From bb70e8917010c45318d9152b85da38f6b3e432cb Mon Sep 17 00:00:00 2001 From: nicolasrannou Date: Thu, 24 Nov 2016 13:17:25 +0100 Subject: [PATCH 01/17] v0.0.12-dev --- bower.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bower.json b/bower.json index d3c785967..274d63b96 100644 --- a/bower.json +++ b/bower.json @@ -1,5 +1,5 @@ { "name": "ami.js", - "version": "v0.0.11", + "version": "v0.0.12-dev", "dependencies": {} } \ No newline at end of file diff --git a/package.json b/package.json index f7f409f04..e520b9f63 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ami.js", - "version": "v0.0.11", + "version": "v0.0.12-dev", "main": "src/ami.js", "keywords": ["ami", "ami.js","three.js", "webgl", "dicom", "nifti", "awesome", "medical", "imaging", "xtk", "nrrd", "vtk", "stl", "trk"], "author": { From 68b66683c80c5f67d1468f7b9ae676c82df2a53c Mon Sep 17 00:00:00 2001 From: nicolasrannou Date: Mon, 28 Nov 2016 11:09:34 +0100 Subject: [PATCH 02/17] add basic support for discrete LUTs --- src/helpers/helpers.lut.js | 84 ++++++++++++++++++++++++++++++-------- 1 file changed, 67 insertions(+), 17 deletions(-) diff --git a/src/helpers/helpers.lut.js b/src/helpers/helpers.lut.js index 47467af11..05a5cd782 100644 --- a/src/helpers/helpers.lut.js +++ b/src/helpers/helpers.lut.js @@ -8,15 +8,17 @@ export default class HelpersLut{ lut = 'default', lutO = 'linear', color = [[0, 0, 0, 0], [1, 1, 1, 1]], - opacity = [[0, 0], [1, 1]]) { + opacity = [[0, 0], [1, 1]], + discrete = false) { // min/max (0-1 or real intensities) // show/hide // horizontal/vertical this._containerID = containerID; - this._color = color; - this._lut = lut; - this._luts = {[lut]: color}; + this._discrete = discrete; + this._color = color; + this._lut = lut; + this._luts = {[lut]: color}; this._opacity = opacity; this._lutO = lutO; @@ -60,23 +62,70 @@ export default class HelpersLut{ ctx.globalCompositeOperation = 'source-over'; // apply color - let color = ctx.createLinearGradient(0, 0, this._canvas.width, this._canvas.height); - for (let i = 0; i < this._color.length; i++) { - color.addColorStop(this._color[i][0], 'rgba(' + Math.round(this._color[i][1] * 255) + ', ' + Math.round(this._color[i][2] * 255) + ', ' + Math.round(this._color[i][3] * 255) + ', 1)'); + if( !this._discrete ){ + + let color = ctx.createLinearGradient(0, 0, this._canvas.width, this._canvas.height); + for (let i = 0; i < this._color.length; i++) { + color.addColorStop(this._color[i][0], `rgba( ${Math.round(this._color[i][1] * 255)}, ${Math.round(this._color[i][2] * 255)}, ${Math.round(this._color[i][3] * 255)}, 1)`); + } + + ctx.fillStyle = color; + ctx.fillRect(0, 0, this._canvas.width , this._canvas.height); + } - ctx.fillStyle = color; - ctx.fillRect(0, 0, this._canvas.width , this._canvas.height); + else{ - // setup context - ctx.globalCompositeOperation = 'destination-in'; + ctx.lineWidth=2*this._canvas.height; + let nextPos = 1.0; + + for( let i=0; i 0){ + + previousPos = this._color[i-1][0]; + + } + + let from = previousPos + (currentPos - previousPos)/2; + let to = currentPos + (nextPos - currentPos)/2; + let color = this._color[i]; + let opacity = this._opacity[i][1]; + + ctx.beginPath(); + ctx.strokeStyle = `rgba( ${Math.round(color[1] * 255)}, ${Math.round(color[2] * 255)}, ${Math.round(color[3] * 255)}, ${opacity})`; + ctx.moveTo(from*this._canvas.width,0); + ctx.lineTo( to*this._canvas.width, 0); + ctx.stroke(); + ctx.closePath(); + + } + + } + + if( !this._discrete ){ + + // if discrete, we already took care of the opacity. + // setup context + ctx.globalCompositeOperation = 'destination-in'; + + // apply opacity + let opacity = ctx.createLinearGradient(0, 0, this._canvas.width, this._canvas.height); + for (let i = 0; i < this._opacity.length; i++) { + opacity.addColorStop(this._opacity[i][0], 'rgba(255, 255, 255, ' + this._opacity[i][1] + ')'); + } + ctx.fillStyle = opacity; + ctx.fillRect(0, 0, this._canvas.width , this._canvas.height); - // apply opacity - let opacity = ctx.createLinearGradient(0, 0, this._canvas.width, this._canvas.height); - for (let i = 0; i < this._opacity.length; i++) { - opacity.addColorStop(this._opacity[i][0], 'rgba(255, 255, 255, ' + this._opacity[i][1] + ')'); } - ctx.fillStyle = opacity; - ctx.fillRect(0, 0, this._canvas.width , this._canvas.height); + } get texture() { @@ -86,6 +135,7 @@ export default class HelpersLut{ texture.magFilter = texture.minFilter = THREE.NearestFilter; texture.premultiplyAlpha = true; texture.needsUpdate = true; + console.log( texture ); return texture; } From aec751befeb4004d8ec80f1b4e465f2c6eb91690 Mon Sep 17 00:00:00 2001 From: nicolasrannou Date: Mon, 28 Nov 2016 11:11:09 +0100 Subject: [PATCH 03/17] extract recommended CIELab color from DICOM SEG --- src/parsers/parsers.dicom.js | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/src/parsers/parsers.dicom.js b/src/parsers/parsers.dicom.js index 9636451da..e77951532 100644 --- a/src/parsers/parsers.dicom.js +++ b/src/parsers/parsers.dicom.js @@ -88,7 +88,6 @@ export default class ParsersDicom extends ParsersVolume { segmentationSegments(){ - // lot to do! let segmentationSegments = []; let segmentSequence = this._dataSet.elements.x00620002; @@ -139,10 +138,29 @@ export default class ParsersDicom extends ParsersVolume { } _recommendedDisplayCIELab( segment ){ - let rawColor = String(segment.dataSet.uint16('x0062000d')); - let recommendedDisplayCIELab = String(`000000${rawColor}`).slice(-6); - return recommendedDisplayCIELab; + if( !segment.dataSet.elements.x0062000d ){ + return null; + } + + let offset = segment.dataSet.elements.x0062000d.dataOffset; + let length = segment.dataSet.elements.x0062000d.length; + let byteArray = segment.dataSet.byteArray.slice(offset, offset+ length); + + // https://www.dabsoft.ch/dicom/3/C.10.7.1.1/ + let CIELabScaled = new Uint16Array(length/2); + for(let i = 0; i Date: Mon, 28 Nov 2016 11:22:13 +0100 Subject: [PATCH 04/17] add "discrete" option in for LUT in viewers_upload --- examples/viewers_upload/viewers_upload.js | 5 +++++ src/helpers/helpers.lut.js | 16 ++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/examples/viewers_upload/viewers_upload.js b/examples/viewers_upload/viewers_upload.js index 720feb39b..3f878f383 100644 --- a/examples/viewers_upload/viewers_upload.js +++ b/examples/viewers_upload/viewers_upload.js @@ -109,6 +109,11 @@ window.onload = function() { lut.lut = value; stackHelper.slice.lutTexture = lut.texture; }); + let lutDiscrete = stackFolder.add(lut, 'discrete', false); + lutDiscrete.onChange(function(value) { + lut.discrete = value; + stackHelper.slice.lutTexture = lut.texture; + }); stackFolder.add(stackHelper, 'index', 0, stack.dimensionsIJK.z - 1).step(1).listen(); stackFolder.open(); diff --git a/src/helpers/helpers.lut.js b/src/helpers/helpers.lut.js index 05a5cd782..58bdd9e5d 100644 --- a/src/helpers/helpers.lut.js +++ b/src/helpers/helpers.lut.js @@ -76,7 +76,6 @@ export default class HelpersLut{ else{ ctx.lineWidth=2*this._canvas.height; - let nextPos = 1.0; for( let i=0; i Date: Mon, 28 Nov 2016 11:22:52 +0100 Subject: [PATCH 05/17] add missing semicolon --- src/helpers/helpers.progressbar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/helpers.progressbar.js b/src/helpers/helpers.progressbar.js index 648628599..2a86729e5 100644 --- a/src/helpers/helpers.progressbar.js +++ b/src/helpers/helpers.progressbar.js @@ -15,7 +15,7 @@ export default class HelpersProgressBar{ 'name' : 'parse', 'color': '#2196F3' } - } + }; this.requestAnimationFrameID = null; From a7bc22d0098fb5661bc6538bb0d7854ee199dc78 Mon Sep 17 00:00:00 2001 From: nicolasrannou Date: Mon, 28 Nov 2016 11:32:13 +0100 Subject: [PATCH 06/17] fix alignment --- src/helpers/helpers.slice.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/helpers/helpers.slice.js b/src/helpers/helpers.slice.js index 287ed79ad..680f852a1 100644 --- a/src/helpers/helpers.slice.js +++ b/src/helpers/helpers.slice.js @@ -273,16 +273,15 @@ export default class HelpersSlice extends HelpersMaterialMixin( THREE.Object3D ) if (!this._material) { // - this._uniforms.uTextureSize.value = this._stack.textureSize; - this._uniforms.uDataDimensions.value = - [this._stack.dimensionsIJK.x, - this._stack.dimensionsIJK.y, - this._stack.dimensionsIJK.z]; - this._uniforms.uWorldToData.value = this._stack.lps2IJK; + this._uniforms.uTextureSize.value = this._stack.textureSize; + this._uniforms.uDataDimensions.value = [ this._stack.dimensionsIJK.x, + this._stack.dimensionsIJK.y, + this._stack.dimensionsIJK.z ]; + this._uniforms.uWorldToData.value = this._stack.lps2IJK; this._uniforms.uNumberOfChannels.value = this._stack.numberOfChannels; - this._uniforms.uPixelType.value = this._stack.pixelType; - this._uniforms.uBitsAllocated.value = this._stack.bitsAllocated; - this._uniforms.uPackedPerPixel.value = this._stack.packedPerPixel; + this._uniforms.uPixelType.value = this._stack.pixelType; + this._uniforms.uBitsAllocated.value = this._stack.bitsAllocated; + this._uniforms.uPackedPerPixel.value = this._stack.packedPerPixel; // compute texture if material exist this._prepareTexture(); this._uniforms.uTextureContainer.value = this._textures; From 1e99de8179c665e1a5b247bc90eac8a4a2570e4f Mon Sep 17 00:00:00 2001 From: nicolasrannou Date: Mon, 28 Nov 2016 11:33:10 +0100 Subject: [PATCH 07/17] handle segmentation type in volume loader --- src/loaders/loaders.volume.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/loaders/loaders.volume.js b/src/loaders/loaders.volume.js index 4e6bba300..a3bd75552 100644 --- a/src/loaders/loaders.volume.js +++ b/src/loaders/loaders.volume.js @@ -97,6 +97,7 @@ export default class LoadersVolumes extends LoadersBase{ if (!series.numberOfFrames) { series.numberOfFrames = 1; } + series.numberOfChannels = volumeParser.numberOfChannels(); series.modality = volumeParser.modality(); // if it is a segmentation, attach extra information if(series.modality === 'SEG'){ @@ -107,15 +108,21 @@ export default class LoadersVolumes extends LoadersBase{ series.segmentationSegments = volumeParser.segmentationSegments(); } - series.numberOfChannels = volumeParser.numberOfChannels(); - // just create 1 dummy stack for now let stack = new ModelsStack(); stack.numberOfChannels = volumeParser.numberOfChannels(); stack.pixelType = volumeParser.pixelType(); stack.invert = volumeParser.invert(); stack.modality = series.modality; - stack.rightHanded = volumeParser.rightHanded(); + stack.rightHanded = volumeParser.rightHanded(); + // if it is a segmentation, attach extra information + if(stack.modality === 'SEG'){ + // colors + // labels + // etc. + stack.segmentationType = series.segmentationType; + stack.segmentationSegments = series.segmentationSegments; + } series.stack.push(stack); // recursive call for each frame // better than for loop to be able to update dom with "progress" callback From 8ce47fe8ac913347dfc9f5733c8340cc788aab1d Mon Sep 17 00:00:00 2001 From: nicolasrannou Date: Mon, 28 Nov 2016 12:30:30 +0100 Subject: [PATCH 08/17] add Core.Colors --- src/core/core.colors.js | 108 ++++++++++++++++++++++++++++++++++++++++ src/core/core.js | 5 +- 2 files changed, 110 insertions(+), 3 deletions(-) create mode 100644 src/core/core.colors.js diff --git a/src/core/core.colors.js b/src/core/core.colors.js new file mode 100644 index 000000000..578f0be78 --- /dev/null +++ b/src/core/core.colors.js @@ -0,0 +1,108 @@ +export default class Colors { + + //http://www.easyrgb.com/index.php?X=MATH&H=08#text8 + static cielab2XYZ( l, a, b) { + + const refX = 95.047; + const refY = 100.00; + const refZ = 108.883; + + let y = ( l + 16 ) / 116; + let x = a / 500 + y; + let z = y - b / 200; + + if ( Math.pow(y,3) > 0.008856 ){ + + y = Math.pow(y, 3); + + } else { + + y = ( y - 16 / 116 ) / 7.787; + + } + + if ( Math.pow(x,3) > 0.008856 ){ + + x = Math.pow(x, 3); + + } else { + + x = ( x - 16 / 116 ) / 7.787; + + } + + if ( Math.pow(z,3) > 0.008856 ){ + + z = Math.pow(z, 3); + + } else { + + z = ( z - 16 / 116 ) / 7.787; + + } + + return [refX * x, refY * y, refZ * z]; + + } + + static xyz2RGB( x, y, z ){ + + x /= 100; + y /= 100; + z /= 100; + let r = x * 3.2406 + y * -1.5372 + z * -0.4986; + let g = x * -0.9689 + y * 1.8758 + z * 0.0415; + let b = x * 0.0557 + y * -0.2040 + z * 1.0570; + + if ( r > 0.0031308 ){ + + r = 1.055 * ( Math.pow( r , 1 / 2.4 ) ) - 0.055; + + } else { + + r = 12.92 * r; + + } + + if ( g > 0.0031308 ){ + + g = 1.055 * ( Math.pow( g, 1 / 2.4 ) ) - 0.055; + + } else { + + g = 12.92 * g; + + } + + if ( b > 0.0031308 ){ + + b = 1.055 * ( Math.pow( b , 1 / 2.4 ) ) - 0.055; + + } else { + + b = 12.92 * b; + + } + + r = r * 255; + g = g * 255; + b = b * 255; + + return [ r, g, b ]; + + } + + static cielab2RGB( l = 50, a = 0, b = 0){ + + if( !( l >= 0 && l <= 100 ) ){ + + return null; + + } + + let xyz = this.cielab2XYZ( l, a, b ); + return this.xyz2RGB(...xyz); + + } + +} \ No newline at end of file diff --git a/src/core/core.js b/src/core/core.js index c5a8afa9d..239c44142 100644 --- a/src/core/core.js +++ b/src/core/core.js @@ -1,16 +1,15 @@ +import Colors from './core.colors'; import Intersections from './core.intersections'; import Pack from './core.pack'; import Validators from './core.validators'; import Utils from './core.utils'; -//import Pack from './core.pack'; /** * @module core */ export default { + Colors, Intersections, Utils, Validators - //, -// Pack }; \ No newline at end of file From 8e7e8204ea762c4126aef8702888320d158406e6 Mon Sep 17 00:00:00 2001 From: nicolasrannou Date: Mon, 28 Nov 2016 12:31:07 +0100 Subject: [PATCH 09/17] basic segmentation stack support --- src/models/models.stack.js | 126 ++++++++++++++++++++++++++++++++----- 1 file changed, 110 insertions(+), 16 deletions(-) diff --git a/src/models/models.stack.js b/src/models/models.stack.js index 639c961d1..2850226cf 100644 --- a/src/models/models.stack.js +++ b/src/models/models.stack.js @@ -1,6 +1,6 @@ /*** Imports ***/ -import CorePack from '../../src/core/core.pack'; -import CoreUtils from '../../src/core/core.utils'; +import CoreColors from '../../src/core/core.colors'; +import CoreUtils from '../../src/core/core.utils'; import ModelsBase from '../../src/models/models.base'; let binaryString = require( 'math-float32-to-binary-string' ); @@ -81,34 +81,97 @@ export default class ModelsStack extends ModelsBase{ // this._modality = 'Modality not set'; - this._frameSegment = []; + + // SEGMENTATION STUFF + this._segmentationType = null; + this._segmentationSegments = []; + this._segmentationDefaultColor = [63, 174, 128]; + this._frameSegment = []; + this._segmentationLUT = []; + this._segmentationLUTO = []; // photometricInterpretation Monochrome1 VS Monochrome2 this._invert = false; } - mergeFrames(){ + prepareSegmentation(){ + + // store frame and do special pre-processing + this._frameSegment = this._frame; let mergedFrames = []; + + // order frames this.computeCosines(); this._frame.map(this._computeDistanceArrayMap.bind(null, this._zCosine)); this._frame.sort(this._sortDistanceArraySort); - mergedFrames.push(this._frame[0]); - let prevIndex = 0; - for(let i = 1; i Date: Mon, 28 Nov 2016 12:37:50 +0100 Subject: [PATCH 10/17] update viewers_labelmap demo --- .../viewers_labelmap/viewers_labelmap.html | 4 +- examples/viewers_labelmap/viewers_labelmap.js | 355 +++++++++++------- 2 files changed, 229 insertions(+), 130 deletions(-) diff --git a/examples/viewers_labelmap/viewers_labelmap.html b/examples/viewers_labelmap/viewers_labelmap.html index 3206b14ca..e68fe2d4c 100644 --- a/examples/viewers_labelmap/viewers_labelmap.html +++ b/examples/viewers_labelmap/viewers_labelmap.html @@ -1,8 +1,8 @@
-
Layer 0
-
Layer 1
+
PET
+
Segmentation
diff --git a/examples/viewers_labelmap/viewers_labelmap.js b/examples/viewers_labelmap/viewers_labelmap.js index 9cabeaada..7ae06957d 100644 --- a/examples/viewers_labelmap/viewers_labelmap.js +++ b/examples/viewers_labelmap/viewers_labelmap.js @@ -26,11 +26,6 @@ let lutLayer0; let sceneLayer1, meshLayer1, uniformsLayer1, materialLayer1, lutLayer1; let sceneLayerMix, meshLayerMix, uniformsLayerMix, materialLayerMix, lutLayerMix; -let layer1 = { - lut: null, - interpolation: 1 -}; - let layerMix = { opacity0: 1.0, opacity1: 1.0, @@ -114,113 +109,226 @@ window.onload = function() { // init threeJS... init(); - let data = [ - '000001.dcm', '000002.dcm', '000003.dcm', - '000004.dcm', '000005.dcm', '000006.dcm', - '000007.dcm', '000008.dcm', '000009.dcm', - '000010.dcm', '000011.dcm', '000012.dcm', - '000013.dcm', '000014.dcm', '000015.dcm', - '000016.dcm', '000017.dcm', '000018.dcm', - '000019.dcm', '000020.dcm', '000021.dcm', - '000022.dcm', '000023.dcm', '000024.dcm', - '000025.dcm', '000026.dcm', '000027.dcm', - '000028.dcm', '000029.dcm', '000030.dcm', - '000031.dcm', '000032.dcm', '000033.dcm', - '000034.dcm', '000035.dcm', '000036.dcm', - '000037.dcm', '000038.dcm', '000039.dcm', - '000040.dcm', '000041.dcm', '000042.dcm', - '000043.dcm', '000044.dcm', '000045.dcm', - '000046.dcm', '000047.dcm', '000048.dcm', - '000049.dcm', '000050.dcm', '000051.dcm', - '000052.dcm', '000053.dcm', '000054.dcm', - '000055.dcm', '000056.dcm', '000057.dcm', - '000058.dcm', '000059.dcm', '000060.dcm', - '000061.dcm', '000062.dcm', '000063.dcm', - '000064.dcm', '000065.dcm', '000066.dcm', - '000067.dcm', '000068.dcm', '000069.dcm', - '000070.dcm', '000071.dcm', '000072.dcm', - '000073.dcm', '000074.dcm', '000075.dcm', - '000076.dcm', '000077.dcm', '000078.dcm', - '000079.dcm', '000080.dcm', '000081.dcm', - '000082.dcm', '000083.dcm', '000084.dcm', - '000085.dcm', '000086.dcm', '000087.dcm', - '000088.dcm', '000089.dcm', '000090.dcm', - '000091.dcm', '000092.dcm', '000093.dcm', - '000094.dcm', '000095.dcm', '000096.dcm', - '000097.dcm', '000098.dcm', '000099.dcm', - '000100.dcm', '000101.dcm', '000102.dcm', - '000103.dcm', '000104.dcm', '000105.dcm', - '000106.dcm', '000107.dcm', '000108.dcm', - '000109.dcm', '000110.dcm', '000111.dcm', - '000112.dcm', '000113.dcm', '000114.dcm', - '000115.dcm', '000116.dcm', '000117.dcm', - '000118.dcm', '000119.dcm', '000120.dcm', - '000121.dcm', '000122.dcm', '000123.dcm', - '000124.dcm', '000125.dcm', '000126.dcm', - '000127.dcm', '000128.dcm', '000129.dcm', - '000130.dcm', '000131.dcm', '000132.dcm', - '000133.dcm', '000134.dcm', '000135.dcm', - '000136.dcm', '000137.dcm', '000138.dcm', - '000139.dcm', '000140.dcm', '000141.dcm', - '000142.dcm', '000143.dcm', '000144.dcm', - '000145.dcm', '000146.dcm', '000147.dcm', - '000148.dcm', '000149.dcm', '000150.dcm', - '000151.dcm', '000152.dcm', '000153.dcm', - '000154.dcm', '000155.dcm', '000156.dcm', - '000157.dcm', '000158.dcm', '000159.dcm', - '000160.dcm', '000161.dcm', '000162.dcm', - '000163.dcm', '000164.dcm', '000165.dcm', - '000166.dcm', '000167.dcm', '000168.dcm', - '000169.dcm', '000170.dcm', '000171.dcm', - '000172.dcm', '000173.dcm', '000174.dcm', - '000175.dcm', '000176.dcm', '000177.dcm', - '000178.dcm', '000179.dcm', '000180.dcm', - '000181.dcm', '000182.dcm', '000183.dcm', - '000184.dcm', '000185.dcm', '000186.dcm', - '000187.dcm', '000188.dcm', '000189.dcm', - '000190.dcm', '000191.dcm', '000192.dcm', - '000193.dcm', '000194.dcm', '000195.dcm', - '000196.dcm', '000197.dcm', '000198.dcm', - '000199.dcm', '000200.dcm', '000201.dcm', - '000202.dcm', '000203.dcm', '000204.dcm', - '000205.dcm', '000206.dcm', '000207.dcm', - '000208.dcm', '000209.dcm', '000210.dcm', - '000211.dcm', '000212.dcm', '000213.dcm', - '000214.dcm', '000215.dcm', '000216.dcm', - '000217.dcm', '000218.dcm', '000219.dcm', - '000220.dcm', '000221.dcm', '000222.dcm', - '000223.dcm', '000224.dcm', '000225.dcm', - '000226.dcm', '000227.dcm', '000228.dcm', - '000229.dcm', '000230.dcm', '000231.dcm', - '000232.dcm', '000233.dcm', '000234.dcm', - '000235.dcm', '000236.dcm', '000237.dcm', - '000238.dcm', '000239.dcm', '000240.dcm', - '000241.dcm', '000242.dcm', '000243.dcm', - '000244.dcm', '000245.dcm', '000246.dcm', - '000247.dcm', '000248.dcm', '000249.dcm', - '000250.dcm', '000251.dcm', '000252.dcm', - '000253.dcm', '000254.dcm', '000255.dcm', - '000256.dcm', '000257.dcm', '000258.dcm', - '000259.dcm', '000260.dcm', '000261.dcm', - '000262.dcm', '000263.dcm', '000264.dcm', - '000265.dcm', '000266.dcm', '000267.dcm', - '000268.dcm', '000269.dcm', '000270.dcm', - '000271.dcm', '000272.dcm', '000273.dcm', - '000274.dcm', '000275.dcm']; - - let dataFullPath = data.map(function(v) { - return 'https://cdn.rawgit.com/FNNDSC/data/master/dicom/andrei_abdomen/data/' + v; - }); - - let labelmap = [ - '000000.dcm' - ]; - - let labelmapFullPath = labelmap.map(function(v) { - return 'https://cdn.rawgit.com/FNNDSC/data/master/dicom/andrei_abdomen/segmentation/' + v; +// let data = [ +// '000001.dcm', '000002.dcm', '000003.dcm', +// '000004.dcm', '000005.dcm', '000006.dcm', +// '000007.dcm', '000008.dcm', '000009.dcm', +// '000010.dcm', '000011.dcm', '000012.dcm', +// '000013.dcm', '000014.dcm', '000015.dcm', +// '000016.dcm', '000017.dcm', '000018.dcm', +// '000019.dcm', '000020.dcm', '000021.dcm', +// '000022.dcm', '000023.dcm', '000024.dcm', +// '000025.dcm', '000026.dcm', '000027.dcm', +// '000028.dcm', '000029.dcm', '000030.dcm', +// '000031.dcm', '000032.dcm', '000033.dcm', +// '000034.dcm', '000035.dcm', '000036.dcm', +// '000037.dcm', '000038.dcm', '000039.dcm', +// '000040.dcm', '000041.dcm', '000042.dcm', +// '000043.dcm', '000044.dcm', '000045.dcm', +// '000046.dcm', '000047.dcm', '000048.dcm', +// '000049.dcm', '000050.dcm', '000051.dcm', +// '000052.dcm', '000053.dcm', '000054.dcm', +// '000055.dcm', '000056.dcm', '000057.dcm', +// '000058.dcm', '000059.dcm', '000060.dcm', +// '000061.dcm', '000062.dcm', '000063.dcm', +// '000064.dcm', '000065.dcm', '000066.dcm', +// '000067.dcm', '000068.dcm', '000069.dcm', +// '000070.dcm', '000071.dcm', '000072.dcm', +// '000073.dcm', '000074.dcm', '000075.dcm', +// '000076.dcm', '000077.dcm', '000078.dcm', +// '000079.dcm', '000080.dcm', '000081.dcm', +// '000082.dcm', '000083.dcm', '000084.dcm', +// '000085.dcm', '000086.dcm', '000087.dcm', +// '000088.dcm', '000089.dcm', '000090.dcm', +// '000091.dcm', '000092.dcm', '000093.dcm', +// '000094.dcm', '000095.dcm', '000096.dcm', +// '000097.dcm', '000098.dcm', '000099.dcm', +// '000100.dcm', '000101.dcm', '000102.dcm', +// '000103.dcm', '000104.dcm', '000105.dcm', +// '000106.dcm', '000107.dcm', '000108.dcm', +// '000109.dcm', '000110.dcm', '000111.dcm', +// '000112.dcm', '000113.dcm', '000114.dcm', +// '000115.dcm', '000116.dcm', '000117.dcm', +// '000118.dcm', '000119.dcm', '000120.dcm', +// '000121.dcm', '000122.dcm', '000123.dcm', +// '000124.dcm', '000125.dcm', '000126.dcm', +// '000127.dcm', '000128.dcm', '000129.dcm', +// '000130.dcm', '000131.dcm', '000132.dcm', +// '000133.dcm', '000134.dcm', '000135.dcm', +// '000136.dcm', '000137.dcm', '000138.dcm', +// '000139.dcm', '000140.dcm', '000141.dcm', +// '000142.dcm', '000143.dcm', '000144.dcm', +// '000145.dcm', '000146.dcm', '000147.dcm', +// '000148.dcm', '000149.dcm', '000150.dcm', +// '000151.dcm', '000152.dcm', '000153.dcm', +// '000154.dcm', '000155.dcm', '000156.dcm', +// '000157.dcm', '000158.dcm', '000159.dcm', +// '000160.dcm', '000161.dcm', '000162.dcm', +// '000163.dcm', '000164.dcm', '000165.dcm', +// '000166.dcm', '000167.dcm', '000168.dcm', +// '000169.dcm', '000170.dcm', '000171.dcm', +// '000172.dcm', '000173.dcm', '000174.dcm', +// '000175.dcm', '000176.dcm', '000177.dcm', +// '000178.dcm', '000179.dcm', '000180.dcm', +// '000181.dcm', '000182.dcm', '000183.dcm', +// '000184.dcm', '000185.dcm', '000186.dcm', +// '000187.dcm', '000188.dcm', '000189.dcm', +// '000190.dcm', '000191.dcm', '000192.dcm', +// '000193.dcm', '000194.dcm', '000195.dcm', +// '000196.dcm', '000197.dcm', '000198.dcm', +// '000199.dcm', '000200.dcm', '000201.dcm', +// '000202.dcm', '000203.dcm', '000204.dcm', +// '000205.dcm', '000206.dcm', '000207.dcm', +// '000208.dcm', '000209.dcm', '000210.dcm', +// '000211.dcm', '000212.dcm', '000213.dcm', +// '000214.dcm', '000215.dcm', '000216.dcm', +// '000217.dcm', '000218.dcm', '000219.dcm', +// '000220.dcm', '000221.dcm', '000222.dcm', +// '000223.dcm', '000224.dcm', '000225.dcm', +// '000226.dcm', '000227.dcm', '000228.dcm', +// '000229.dcm', '000230.dcm', '000231.dcm', +// '000232.dcm', '000233.dcm', '000234.dcm', +// '000235.dcm', '000236.dcm', '000237.dcm', +// '000238.dcm', '000239.dcm', '000240.dcm', +// '000241.dcm', '000242.dcm', '000243.dcm', +// '000244.dcm', '000245.dcm', '000246.dcm', +// '000247.dcm', '000248.dcm', '000249.dcm', +// '000250.dcm', '000251.dcm', '000252.dcm', +// '000253.dcm', '000254.dcm', '000255.dcm', +// '000256.dcm', '000257.dcm', '000258.dcm', +// '000259.dcm', '000260.dcm', '000261.dcm', +// '000262.dcm', '000263.dcm', '000264.dcm', +// '000265.dcm', '000266.dcm', '000267.dcm', +// '000268.dcm', '000269.dcm', '000270.dcm', +// '000271.dcm', '000272.dcm', '000273.dcm', +// '000274.dcm', '000275.dcm']; + +// let dataFullPath = data.map(function(v) { +// return 'https://cdn.rawgit.com/FNNDSC/data/master/dicom/andrei_abdomen/data/' + v; +// }); + +// let labelmap = [ +// '000000.dcm' +// ]; + +// let labelmapFullPath = labelmap.map(function(v) { +// return 'https://cdn.rawgit.com/FNNDSC/data/master/dicom/andrei_abdomen/segmentation/' + v; +// }); + +// let files_dataset1 = dataFullPath.concat(labelmapFullPath); + + +let ds2 = [ +'000000.dcm', '000001.dcm', '000002.dcm', '000003.dcm', '000004.dcm', '000005.dcm', '000006.dcm', '000007.dcm', '000008.dcm', '000009.dcm', '000010.dcm', +'000011.dcm', '000012.dcm', '000013.dcm', '000014.dcm', '000015.dcm', '000016.dcm', '000017.dcm', '000018.dcm', '000019.dcm', '000020.dcm', '000021.dcm', +'000022.dcm', '000023.dcm', '000024.dcm', '000025.dcm', '000026.dcm', '000027.dcm', '000028.dcm', '000029.dcm', '000030.dcm', '000031.dcm', '000032.dcm', +'000033.dcm', '000034.dcm', '000035.dcm', '000036.dcm', '000037.dcm', '000038.dcm', '000039.dcm', '000040.dcm', '000041.dcm', '000042.dcm', '000043.dcm', +'000044.dcm', '000045.dcm', '000046.dcm', '000047.dcm', '000048.dcm', '000049.dcm', '000050.dcm', '000051.dcm', '000052.dcm', '000053.dcm', '000054.dcm', +'000055.dcm', '000056.dcm', '000057.dcm', '000058.dcm', '000059.dcm', '000060.dcm', '000061.dcm', '000062.dcm', '000063.dcm', '000064.dcm', '000065.dcm', +'000066.dcm', '000067.dcm', '000068.dcm', '000069.dcm', '000070.dcm', '000071.dcm', '000072.dcm', '000073.dcm', '000074.dcm', '000075.dcm', '000076.dcm', +'000077.dcm', '000078.dcm', '000079.dcm', '000080.dcm', '000081.dcm', '000082.dcm', '000083.dcm', '000084.dcm', '000085.dcm', '000086.dcm', '000087.dcm', +'000088.dcm', '000089.dcm', '000090.dcm', '000091.dcm', '000092.dcm', '000093.dcm', '000094.dcm', '000095.dcm', '000096.dcm', '000097.dcm', '000098.dcm', +'000099.dcm', '000100.dcm', '000101.dcm', '000102.dcm', '000103.dcm', '000104.dcm', '000105.dcm', '000106.dcm', '000107.dcm', '000108.dcm', '000109.dcm', +'000110.dcm', '000111.dcm', '000112.dcm', '000113.dcm', '000114.dcm', '000115.dcm', '000116.dcm', '000117.dcm', '000118.dcm', '000119.dcm', '000120.dcm', +'000121.dcm', '000122.dcm', '000123.dcm', '000124.dcm', '000125.dcm', '000126.dcm', '000127.dcm', '000128.dcm', '000129.dcm', '000130.dcm', '000131.dcm', +'000132.dcm', '000133.dcm', '000134.dcm', '000135.dcm', '000136.dcm', '000137.dcm', '000138.dcm', '000139.dcm', '000140.dcm', '000141.dcm', '000142.dcm', +'000143.dcm', '000144.dcm', '000145.dcm', '000146.dcm', '000147.dcm', '000148.dcm', '000149.dcm', '000150.dcm', '000151.dcm', '000152.dcm', '000153.dcm', +'000154.dcm', '000155.dcm', '000156.dcm', '000157.dcm', '000158.dcm', '000159.dcm', '000160.dcm', '000161.dcm', '000162.dcm', '000163.dcm', '000164.dcm', +'000165.dcm', '000166.dcm', '000167.dcm', '000168.dcm', '000169.dcm', '000170.dcm', '000171.dcm', '000172.dcm', '000173.dcm', '000174.dcm', '000175.dcm', +'000176.dcm', '000177.dcm', '000178.dcm', '000179.dcm', '000180.dcm', '000181.dcm', '000182.dcm', '000183.dcm', '000184.dcm', '000185.dcm', '000186.dcm', +'000187.dcm', '000188.dcm', '000189.dcm', '000190.dcm', '000191.dcm', '000192.dcm', '000193.dcm', '000194.dcm', '000195.dcm', '000196.dcm', '000197.dcm', +'000198.dcm', '000199.dcm', '000200.dcm', '000201.dcm', '000202.dcm', '000203.dcm', '000204.dcm', '000205.dcm', '000206.dcm', '000207.dcm', '000208.dcm', +'000209.dcm', '000210.dcm', '000211.dcm', '000212.dcm', '000213.dcm', '000214.dcm', '000215.dcm', '000216.dcm', '000217.dcm', '000218.dcm', '000219.dcm', +'000220.dcm', '000221.dcm', '000222.dcm', '000223.dcm', '000224.dcm', '000225.dcm', '000226.dcm', '000227.dcm', '000228.dcm', '000229.dcm', '000230.dcm', +'000231.dcm', '000232.dcm', '000233.dcm', '000234.dcm', '000235.dcm', '000236.dcm', '000237.dcm', '000238.dcm', '000239.dcm', '000240.dcm', '000241.dcm', +'000242.dcm', '000243.dcm', '000244.dcm', '000245.dcm', '000246.dcm', '000247.dcm', '000248.dcm', '000249.dcm', '000250.dcm', '000251.dcm', '000252.dcm', +'000253.dcm', '000254.dcm', '000255.dcm', '000256.dcm', '000257.dcm', '000258.dcm', '000259.dcm', '000260.dcm', '000261.dcm', '000262.dcm', '000263.dcm', +'000264.dcm', '000265.dcm', '000266.dcm', '000267.dcm', '000268.dcm', '000269.dcm', '000270.dcm', '000271.dcm', '000272.dcm', '000273.dcm', '000274.dcm', +'000275.dcm', '000276.dcm', '000277.dcm', '000278.dcm', '000279.dcm', '000280.dcm', '000281.dcm', '000282.dcm', '000283.dcm', '000284.dcm', '000285.dcm', +'000286.dcm', '000287.dcm', '000288.dcm', '000289.dcm', '000290.dcm', '000291.dcm', '000292.dcm', '000293.dcm', '000294.dcm', '000295.dcm', '000296.dcm', +'000297.dcm', '000298.dcm' +]; + + let ds2fp = ds2.map(function(v) { + return 'https://cdn.rawgit.com/FNNDSC/data/master/dicom/rsna_2/PET/' + v; }); - let files = dataFullPath.concat(labelmapFullPath); + ds2fp.push('https://cdn.rawgit.com/FNNDSC/data/master/dicom/rsna_2/SEG/3DSlicer/tumor_User1_Manual_Trial1.dcm'); + +// let ds3 = [ +// '1-103.dcm', '10-112.dcm', '100-202.dcm', '101-203.dcm', '102-204.dcm', '103-205.dcm', '104-206.dcm', '105-207.dcm', '106-208.dcm', '107-209.dcm', +// '108-210.dcm', '109-211.dcm', '11-113.dcm', '110-212.dcm', '111-213.dcm', '112-214.dcm', '113-215.dcm', '114-216.dcm', '115-217.dcm', '116-218.dcm', +// '117-219.dcm', '118-220.dcm', '119-221.dcm', '12-114.dcm', '120-222.dcm', '121-223.dcm', '122-224.dcm', '123-225.dcm', '124-226.dcm', '125-227.dcm', +// '126-228.dcm', '127-229.dcm', '128-230.dcm', '129-231.dcm', '13-115.dcm', '130-232.dcm', '131-233.dcm', '132-234.dcm', '133-235.dcm', '134-236.dcm', +// '135-237.dcm', '136-238.dcm', '137-239.dcm', '138-240.dcm', '139-241.dcm', '14-116.dcm', '140-242.dcm', '141-243.dcm', '142-244.dcm', '143-245.dcm', +// '144-246.dcm', '145-247.dcm', '146-248.dcm', '147-249.dcm', '148-250.dcm', '149-251.dcm', '15-117.dcm', '150-252.dcm', '151-253.dcm', '152-254.dcm', +// '153-255.dcm', '154-256.dcm', '155-257.dcm', '156-258.dcm', '157-259.dcm', '158-260.dcm', '159-261.dcm', '16-118.dcm', '160-262.dcm', '161-263.dcm', +// '162-264.dcm', '163-265.dcm', '164-266.dcm', '165-267.dcm', '166-268.dcm', '167-269.dcm', '168-270.dcm', '169-271.dcm', '17-119.dcm', '170-272.dcm', +// '171-273.dcm', '172-274.dcm', '173-275.dcm', '174-276.dcm','175-277.dcm', '176-278.dcm', '177-279.dcm', '178-280.dcm', '179-281.dcm', '18-120.dcm', +// '180-282.dcm', '181-283.dcm','182-284.dcm', '183-285.dcm', '184-286.dcm', '185-287.dcm', '186-288.dcm', '187-289.dcm', '188-290.dcm', '189-291.dcm', +// '19-121.dcm', '190-292.dcm', '191-293.dcm', '192-294.dcm', '193-295.dcm', '194-296.dcm', '195-297.dcm', '196-298.dcm', '197-299.dcm', '198-000.dcm', +// '199-001.dcm', '2-104.dcm', '20-122.dcm', '200-002.dcm', '201-003.dcm', '202-004.dcm', '203-005.dcm', '204-006.dcm', '205-007.dcm', '206-008.dcm', +// '207-009.dcm', '208-010.dcm', '209-011.dcm', '21-123.dcm', '210-012.dcm', '211-013.dcm', '212-014.dcm', '213-015.dcm', '214-016.dcm', '215-017.dcm', +// '216-018.dcm', '217-019.dcm', '218-020.dcm', '219-021.dcm', '22-124.dcm', '220-022.dcm', '221-023.dcm', '222-024.dcm', '223-025.dcm', '224-026.dcm', +// '225-027.dcm', '226-028.dcm', '227-029.dcm', '228-030.dcm', '229-031.dcm','23-125.dcm', '230-032.dcm', '231-033.dcm', '232-034.dcm', '233-035.dcm', +// '234-036.dcm', '235-037.dcm', '236-038.dcm', '237-039.dcm', '238-040.dcm', '239-041.dcm', '24-126.dcm', '240-042.dcm', '241-043.dcm', '242-044.dcm', +// '243-045.dcm', '244-046.dcm', '245-047.dcm', '246-048.dcm', '247-049.dcm', '248-050.dcm', '249-051.dcm', '25-127.dcm', '250-052.dcm', '251-053.dcm', +// '252-054.dcm', '253-055.dcm', '254-056.dcm', '255-057.dcm', '256-058.dcm', '257-059.dcm', '258-060.dcm', '259-061.dcm', '26-128.dcm', '260-062.dcm', +// '261-063.dcm', '262-064.dcm', '263-065.dcm', '264-066.dcm', '265-067.dcm', '266-068.dcm', '267-069.dcm', '268-070.dcm', '269-071.dcm', '27-129.dcm', +// '270-072.dcm', '271-073.dcm', '272-074.dcm', '273-075.dcm', '274-076.dcm', '275-077.dcm', '276-078.dcm', '277-079.dcm', '278-080.dcm', '279-081.dcm', +// '28-130.dcm', '280-082.dcm', '281-083.dcm', '282-084.dcm', '283-085.dcm', '284-086.dcm', '285-087.dcm', '286-088.dcm', '287-089.dcm', '288-090.dcm', +// '289-091.dcm', '29-131.dcm', '290-092.dcm', '291-093.dcm', '292-094.dcm', '293-095.dcm', '294-096.dcm', '295-097.dcm', '296-098.dcm', '297-099.dcm', +// '298-100.dcm', '299-101.dcm', '3-105.dcm', '30-132.dcm', '300-102.dcm', '301-103.dcm', '302-104.dcm', '303-105.dcm', '304-106.dcm', '305-107.dcm', +// '306-108.dcm', '307-109.dcm', '308-110.dcm', '309-111.dcm', '31-133.dcm', '310-112.dcm', '311-113.dcm', '312-114.dcm', '313-115.dcm', '314-116.dcm', +// '315-117.dcm', '316-118.dcm', '317-119.dcm', '318-120.dcm', '319-121.dcm', '32-134.dcm', '320-122.dcm', '321-123.dcm', '322-124.dcm', '323-125.dcm', +// '324-126.dcm', '325-127.dcm', '326-128.dcm', '327-129.dcm', '328-130.dcm', '329-131.dcm', '33-135.dcm', '330-132.dcm', '331-133.dcm', '332-134.dcm', +// '333-135.dcm', '334-136.dcm', '335-137.dcm', '336-138.dcm', '337-139.dcm', '338-140.dcm', '339-141.dcm', '34-136.dcm', '340-142.dcm', '341-143.dcm', +// '342-144.dcm', '343-145.dcm', '344-146.dcm', '345-147.dcm', '346-148.dcm', '347-149.dcm', '348-150.dcm', '349-151.dcm', '35-137.dcm', '350-152.dcm', +// '351-153.dcm', '352-154.dcm', '353-155.dcm', '354-156.dcm', '355-157.dcm', '356-158.dcm', '357-159.dcm', '358-160.dcm', '359-161.dcm', '36-138.dcm', +// '360-162.dcm', '361-163.dcm', '362-164.dcm', '363-165.dcm', '364-166.dcm', '365-167.dcm', '366-168.dcm', '367-169.dcm', '368-170.dcm','369-171.dcm', +// '37-139.dcm', '370-172.dcm', '371-173.dcm', '372-174.dcm', '373-175.dcm', '374-176.dcm', '375-177.dcm', '376-178.dcm', '377-179.dcm', '378-180.dcm', +// '379-181.dcm', '38-140.dcm', '380-182.dcm', '381-183.dcm', '382-184.dcm', '383-185.dcm', '384-186.dcm', '385-187.dcm', '386-188.dcm', '387-189.dcm', +// '388-190.dcm', '389-191.dcm', '39-141.dcm', '390-192.dcm', '391-193.dcm', '392-194.dcm', '393-195.dcm', '394-196.dcm', '395-197.dcm', '396-198.dcm', +// '397-199.dcm', '398-200.dcm', '399-201.dcm', '4-106.dcm', '40-142.dcm', '400-202.dcm', '401-203.dcm', '402-204.dcm', '403-205.dcm', '404-206.dcm', +// '405-207.dcm', '406-208.dcm', '407-209.dcm', '408-210.dcm', '409-211.dcm', '41-143.dcm', '410-212.dcm', '411-213.dcm', '412-214.dcm', '413-215.dcm', +// '414-216.dcm', '415-217.dcm', '416-218.dcm', '417-219.dcm', '418-220.dcm', '419-221.dcm', '42-144.dcm', '420-222.dcm', '421-223.dcm', '422-224.dcm', +// '423-225.dcm', '424-226.dcm', '425-227.dcm', '426-228.dcm', '427-229.dcm', '428-230.dcm', '429-231.dcm', '43-145.dcm', '430-232.dcm', '431-233.dcm', +// '432-234.dcm', '433-235.dcm', '434-236.dcm', '435-237.dcm', '436-238.dcm', '437-239.dcm', '438-240.dcm', '439-241.dcm', '44-146.dcm', '440-242.dcm', +// '441-243.dcm', '442-244.dcm', '443-245.dcm', '444-246.dcm', '445-247.dcm', '446-248.dcm', '447-249.dcm', '448-250.dcm', '449-251.dcm', '45-147.dcm', +// '450-252.dcm', '451-253.dcm', '452-254.dcm', '453-255.dcm', '454-256.dcm', '455-257.dcm', '456-258.dcm', '457-259.dcm', '458-260.dcm', '459-261.dcm', +// '46-148.dcm', '460-262.dcm', '461-263.dcm', '462-264.dcm', '463-265.dcm', '464-266.dcm', '465-267.dcm', '466-268.dcm', '467-269.dcm', '468-270.dcm', +// '469-271.dcm', '47-149.dcm', '470-272.dcm', '471-273.dcm', '472-274.dcm', '473-275.dcm', '474-276.dcm', '475-277.dcm', '476-278.dcm', '477-279.dcm', +// '478-280.dcm', '479-281.dcm', '48-150.dcm', '480-282.dcm', '481-283.dcm', '482-284.dcm', '483-285.dcm', '484-286.dcm', '485-287.dcm', '486-288.dcm', +// '487-289.dcm', '488-290.dcm', '489-291.dcm', '49-151.dcm', '490-292.dcm', '491-293.dcm', '492-294.dcm', '493-295.dcm', '494-296.dcm', '495-297.dcm', +// '496-298.dcm', '497-299.dcm', '498-000.dcm', '499-001.dcm', '5-107.dcm', '50-152.dcm', '500-002.dcm', '501-003.dcm', '502-004.dcm', '503-005.dcm', +// '504-006.dcm', '505-007.dcm', '506-008.dcm', '507-009.dcm', '508-010.dcm', '509-011.dcm', '51-153.dcm', '510-012.dcm', '511-013.dcm', '512-014.dcm', +// '513-015.dcm', '514-016.dcm', '515-017.dcm', '516-018.dcm', '517-019.dcm', '518-020.dcm', '519-021.dcm', '52-154.dcm', '520-022.dcm', '521-023.dcm', +// '522-024.dcm','523-025.dcm', '524-026.dcm', '525-027.dcm', '526-028.dcm', '527-029.dcm', '528-030.dcm', '529-031.dcm', '53-155.dcm', '530-032.dcm', +// '531-033.dcm','532-034.dcm', '533-035.dcm', '534-036.dcm', '535-037.dcm', '536-038.dcm', '537-039.dcm', '538-040.dcm', '539-041.dcm', '54-156.dcm', +// '540-042.dcm','541-043.dcm', '542-044.dcm', '543-045.dcm', '544-046.dcm', '545-047.dcm', '55-157.dcm', '56-158.dcm', '57-159.dcm', '58-160.dcm', +// '59-161.dcm', '6-108.dcm', '60-162.dcm', '61-163.dcm', '62-164.dcm', '63-165.dcm', '64-166.dcm', '65-167.dcm', '66-168.dcm', '67-169.dcm', '68-170.dcm', +// '69-171.dcm', '7-109.dcm', '70-172.dcm', '71-173.dcm', '72-174.dcm', '73-175.dcm', '74-176.dcm', '75-177.dcm', '76-178.dcm', '77-179.dcm', '78-180.dcm', +// '79-181.dcm', '8-110.dcm', '80-182.dcm', '81-183.dcm', '82-184.dcm', '83-185.dcm', '84-186.dcm', '85-187.dcm', '86-188.dcm', '87-189.dcm', '88-190.dcm', +// '89-191.dcm', '9-111.dcm', '90-192.dcm', '91-193.dcm', '92-194.dcm', '93-195.dcm', '94-196.dcm', '95-197.dcm', '96-198.dcm', '97-199.dcm', '98-200.dcm', +// '99-201.dcm' +// ]; + +// let ds3fp = ds3.map(function(v) { +// return '../../data_rsna/dataset3/PET/' + v; +// }); + +// ds3fp.push('../../data_rsna/dataset3/SEG/3DSlicer/Tumor_User2_SemiAuto_Trial2/1-105.dcm'); + +// let ds4 = [ +// '000000.dcm', '000001.dcm', '000002.dcm', '000003.dcm', '000004.dcm', '000005.dcm', '000006.dcm', '000007.dcm', '000008.dcm', '000009.dcm', '000010.dcm', +// '000011.dcm', '000012.dcm', '000013.dcm', '000014.dcm', '000015.dcm', '000016.dcm', '000017.dcm', '000018.dcm', '000019.dcm' +// ]; + +// let ds4fp = ds4.map(function(v) { +// return '../../data_rsna/dataset4/MR/' + v; +// }); + +// ds4fp.push('../../data_rsna/dataset4/SEG/3DSlicer/adc_label.dcm'); // load sequence for each file // instantiate the loader @@ -228,7 +336,7 @@ window.onload = function() { let loader = new LoadersVolume(threeD); let seriesContainer = []; let loadSequence = []; - files.forEach((url) => { + ds2fp.forEach((url) => { loadSequence.push( Promise.resolve() // fetch the file @@ -306,20 +414,6 @@ window.onload = function() { layer0Folder.open(); - - // layer 1 folder - let layer1Folder = gui.addFolder('Layer 1'); - let interpolationLayer1 = layer1Folder.add(layer1, 'interpolation', 0, 1 ).step( 1 ).listen(); - interpolationLayer1.onChange(function(value){ - uniformsLayer1.uInterpolation.value = value; - // re-compute shaders - let fs = new ShadersDataFragment(uniformsLayer1); - materialLayer1.fragmentShader = fs.compute(); - materialLayer1.needsUpdate = true; - }); - - layer1Folder.open(); - // layer mix folder let layerMixFolder = gui.addFolder('Layer Mix'); let opacityLayerMix1 = layerMixFolder.add(layerMix, 'opacity1', 0, 1).step(0.01); @@ -388,7 +482,7 @@ window.onload = function() { let stackHelper = new HelpersStack(stack); stackHelper.bbox.visible = false; stackHelper.border.visible = false; - stackHelper.index = 160; + stackHelper.index = 247; sceneLayer0.add(stackHelper); @@ -437,6 +531,7 @@ window.onload = function() { uniformsLayer1.uDataDimensions.value = [stack2.dimensionsIJK.x, stack2.dimensionsIJK.y, stack2.dimensionsIJK.z]; + uniformsLayer1.uInterpolation.value = 0; // generate shaders on-demand! let fs = new ShadersDataFragment(uniformsLayer1); @@ -506,13 +601,17 @@ window.onload = function() { [[0, 0, 0, 0], [1, 1, 1, 1]], [[0, 1], [1, 1]]); lutLayer0.luts = HelpersLut.presetLuts(); + lutLayer0.lut = 'random'; + stackHelper.slice.lut = 1; + stackHelper.slice.lutTexture = lutLayer0.texture; lutLayer1 = new HelpersLut( 'my-lut-canvases-l1', 'default', 'linear', - [[0, 0, 0, 0], [1, 0.913, 0.117, 0.388]], - [[0, 0], [1, 1]]); + stack2.segmentationLUT, + stack2.segmentationLUTO, + true); uniformsLayer1.uLut.value = 1; uniformsLayer1.uTextureLUT.value = lutLayer1.texture; From 6e6f9c88790ee1a03c9907b6dbcf59e2093b2d4f Mon Sep 17 00:00:00 2001 From: nicolasrannou Date: Mon, 28 Nov 2016 17:04:09 +0100 Subject: [PATCH 11/17] fix nifti orientation bug if space is left handed (qfac<0) --- build/ami.js | 540 ++++++++++++++---- build/ami.min.js | 20 +- examples/viewers_labelmap/viewers_labelmap.js | 31 +- lessons/04/04.html | 4 +- lessons/04/demo.js | 52 +- src/loaders/loaders.volume.js | 4 +- 6 files changed, 466 insertions(+), 185 deletions(-) diff --git a/build/ami.js b/build/ami.js index 71d7d7200..bf807f6c1 100644 --- a/build/ami.js +++ b/build/ami.js @@ -31229,7 +31229,7 @@ module.exports = isString; },{}],85:[function(require,module,exports){ module.exports={ "name": "ami.js", - "version": "v0.0.11", + "version": "v0.0.12-dev", "main": "src/ami.js", "keywords": ["ami", "ami.js","three.js", "webgl", "dicom", "nifti", "awesome", "medical", "imaging", "xtk", "nrrd", "vtk", "stl", "trk"], "author": { @@ -31375,7 +31375,7 @@ exports.default = { window.console.log('AMI ' + pckg.version + ' ( ThreeJS ' + pckg.config.threeVersion + ')'); -},{"../package.json":85,"./cameras/cameras":87,"./controls/controls":89,"./core/core":93,"./geometries/geometries":97,"./helpers/helpers":102,"./loaders/loaders":111,"./models/models":115,"./parsers/parsers":120,"./shaders/shaders":134,"./widgets/widgets":143}],87:[function(require,module,exports){ +},{"../package.json":85,"./cameras/cameras":87,"./controls/controls":89,"./core/core":94,"./geometries/geometries":98,"./helpers/helpers":103,"./loaders/loaders":112,"./models/models":116,"./parsers/parsers":121,"./shaders/shaders":135,"./widgets/widgets":144}],87:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -31855,7 +31855,7 @@ var CamerasOrthographic = function (_THREE$OrthographicCa) { exports.default = CamerasOrthographic; -},{"../core/core.intersections":92,"../core/core.validators":96}],89:[function(require,module,exports){ +},{"../core/core.intersections":93,"../core/core.validators":97}],89:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -33168,6 +33168,147 @@ var Trackballortho = function (_THREE$EventDispatche) { exports.default = Trackballortho; },{}],92:[function(require,module,exports){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); + } + }return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; + }; +}(); + +function _toConsumableArray(arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + }return arr2; + } else { + return Array.from(arr); + } +} + +function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +} + +var Colors = function () { + function Colors() { + _classCallCheck(this, Colors); + } + + _createClass(Colors, null, [{ + key: "cielab2XYZ", + + //http://www.easyrgb.com/index.php?X=MATH&H=08#text8 + value: function cielab2XYZ(l, a, b) { + + var refX = 95.047; + var refY = 100.00; + var refZ = 108.883; + + var y = (l + 16) / 116; + var x = a / 500 + y; + var z = y - b / 200; + + if (Math.pow(y, 3) > 0.008856) { + + y = Math.pow(y, 3); + } else { + + y = (y - 16 / 116) / 7.787; + } + + if (Math.pow(x, 3) > 0.008856) { + + x = Math.pow(x, 3); + } else { + + x = (x - 16 / 116) / 7.787; + } + + if (Math.pow(z, 3) > 0.008856) { + + z = Math.pow(z, 3); + } else { + + z = (z - 16 / 116) / 7.787; + } + + return [refX * x, refY * y, refZ * z]; + } + }, { + key: "xyz2RGB", + value: function xyz2RGB(x, y, z) { + + x /= 100; + y /= 100; + z /= 100; + var r = x * 3.2406 + y * -1.5372 + z * -0.4986; + var g = x * -0.9689 + y * 1.8758 + z * 0.0415; + var b = x * 0.0557 + y * -0.2040 + z * 1.0570; + + if (r > 0.0031308) { + + r = 1.055 * Math.pow(r, 1 / 2.4) - 0.055; + } else { + + r = 12.92 * r; + } + + if (g > 0.0031308) { + + g = 1.055 * Math.pow(g, 1 / 2.4) - 0.055; + } else { + + g = 12.92 * g; + } + + if (b > 0.0031308) { + + b = 1.055 * Math.pow(b, 1 / 2.4) - 0.055; + } else { + + b = 12.92 * b; + } + + r = r * 255; + g = g * 255; + b = b * 255; + + return [r, g, b]; + } + }, { + key: "cielab2RGB", + value: function cielab2RGB() { + var l = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 50; + var a = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var b = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + + if (!(l >= 0 && l <= 100)) { + + return null; + } + + var xyz = this.cielab2XYZ(l, a, b); + return this.xyz2RGB.apply(this, _toConsumableArray(xyz)); + } + }]); + + return Colors; +}(); + +exports.default = Colors; + +},{}],93:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -33631,47 +33772,48 @@ var Intersections = function () { exports.default = Intersections; -},{"./core.utils":95,"./core.validators":96}],93:[function(require,module,exports){ +},{"./core.utils":96,"./core.validators":97}],94:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); -var _core = require('./core.intersections'); +var _core = require('./core.colors'); var _core2 = _interopRequireDefault(_core); -var _core3 = require('./core.pack'); +var _core3 = require('./core.intersections'); var _core4 = _interopRequireDefault(_core3); -var _core5 = require('./core.validators'); +var _core5 = require('./core.pack'); var _core6 = _interopRequireDefault(_core5); -var _core7 = require('./core.utils'); +var _core7 = require('./core.validators'); var _core8 = _interopRequireDefault(_core7); +var _core9 = require('./core.utils'); + +var _core10 = _interopRequireDefault(_core9); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -//import Pack from './core.pack'; - /** * @module core */ exports.default = { - Intersections: _core2.default, - Utils: _core8.default, - Validators: _core6.default - //, - // Pack + Colors: _core2.default, + Intersections: _core4.default, + Utils: _core10.default, + Validators: _core8.default }; -},{"./core.intersections":92,"./core.pack":94,"./core.utils":95,"./core.validators":96}],94:[function(require,module,exports){ +},{"./core.colors":92,"./core.intersections":93,"./core.pack":95,"./core.utils":96,"./core.validators":97}],95:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -33695,7 +33837,7 @@ var Pack = function Pack() { exports.default = Pack; -},{}],95:[function(require,module,exports){ +},{}],96:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -33816,7 +33958,7 @@ var Utils = function () { exports.default = Utils; -},{"./core.validators":96}],96:[function(require,module,exports){ +},{"./core.validators":97}],97:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -33948,7 +34090,7 @@ var Validators = function () { exports.default = Validators; -},{}],97:[function(require,module,exports){ +},{}],98:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -33976,7 +34118,7 @@ exports.default = { Voxel: _geometries4.default }; -},{"./geometries.slice":98,"./geometries.voxel":99}],98:[function(require,module,exports){ +},{"./geometries.slice":99,"./geometries.voxel":100}],99:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -34214,7 +34356,7 @@ var GeometriesSlice = function (_THREE$ShapeGeometry) { exports.default = GeometriesSlice; -},{"../../src/core/core.intersections":92}],99:[function(require,module,exports){ +},{"../../src/core/core.intersections":93}],100:[function(require,module,exports){ "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -34313,7 +34455,7 @@ var GeometriesVoxel = function (_THREE$BoxGeometry) { exports.default = GeometriesVoxel; -},{}],100:[function(require,module,exports){ +},{}],101:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -34457,7 +34599,7 @@ var HelpersBorder = function (_THREE$Object3D) { exports.default = HelpersBorder; -},{}],101:[function(require,module,exports){ +},{}],102:[function(require,module,exports){ "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -34597,7 +34739,7 @@ var HelpersBoundingBox = function (_THREE$Object3D) { exports.default = HelpersBoundingBox; -},{}],102:[function(require,module,exports){ +},{}],103:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -34655,7 +34797,7 @@ exports.default = { Voxel: _helpers16.default }; -},{"./helpers.border":100,"./helpers.boundingbox":101,"./helpers.lut":103,"./helpers.progressbar":105,"./helpers.slice":106,"./helpers.stack":107,"./helpers.volumerendering":108,"./helpers.voxel":109}],103:[function(require,module,exports){ +},{"./helpers.border":101,"./helpers.boundingbox":102,"./helpers.lut":104,"./helpers.progressbar":106,"./helpers.slice":107,"./helpers.stack":108,"./helpers.volumerendering":109,"./helpers.voxel":110}],104:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -34696,6 +34838,7 @@ var HelpersLut = function () { var lutO = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'linear'; var color = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [[0, 0, 0, 0], [1, 1, 1, 1]]; var opacity = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [[0, 0], [1, 1]]; + var discrete = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false; _classCallCheck(this, HelpersLut); @@ -34704,6 +34847,7 @@ var HelpersLut = function () { // horizontal/vertical this._containerID = containerID; + this._discrete = discrete; this._color = color; this._lut = lut; this._luts = _defineProperty({}, lut, color); @@ -34754,23 +34898,61 @@ var HelpersLut = function () { ctx.globalCompositeOperation = 'source-over'; // apply color - var color = ctx.createLinearGradient(0, 0, this._canvas.width, this._canvas.height); - for (var i = 0; i < this._color.length; i++) { - color.addColorStop(this._color[i][0], 'rgba(' + Math.round(this._color[i][1] * 255) + ', ' + Math.round(this._color[i][2] * 255) + ', ' + Math.round(this._color[i][3] * 255) + ', 1)'); + if (!this._discrete) { + + var color = ctx.createLinearGradient(0, 0, this._canvas.width, this._canvas.height); + for (var i = 0; i < this._color.length; i++) { + color.addColorStop(this._color[i][0], 'rgba( ' + Math.round(this._color[i][1] * 255) + ', ' + Math.round(this._color[i][2] * 255) + ', ' + Math.round(this._color[i][3] * 255) + ', 1)'); + } + + ctx.fillStyle = color; + ctx.fillRect(0, 0, this._canvas.width, this._canvas.height); + } else { + + ctx.lineWidth = 2 * this._canvas.height; + + for (var _i = 0; _i < this._color.length; _i++) { + + var currentPos = this._color[_i][0]; + var nextPos = 1; + if (_i < this._color.length - 1) { + + nextPos = this._color[_i + 1][0]; + } + var previousPos = 0; + if (_i > 0) { + + previousPos = this._color[_i - 1][0]; + } + + var from = previousPos + (currentPos - previousPos) / 2; + var to = currentPos + (nextPos - currentPos) / 2; + var _color = this._color[_i]; + var opacity = this._opacity[_i] ? this._opacity[_i][1] : 1; + + ctx.beginPath(); + ctx.strokeStyle = 'rgba( ' + Math.round(_color[1] * 255) + ', ' + Math.round(_color[2] * 255) + ', ' + Math.round(_color[3] * 255) + ', ' + opacity + ')'; + ctx.moveTo(from * this._canvas.width, 0); + ctx.lineTo(to * this._canvas.width, 0); + ctx.stroke(); + ctx.closePath(); + } } - ctx.fillStyle = color; - ctx.fillRect(0, 0, this._canvas.width, this._canvas.height); - // setup context - ctx.globalCompositeOperation = 'destination-in'; + if (!this._discrete) { - // apply opacity - var opacity = ctx.createLinearGradient(0, 0, this._canvas.width, this._canvas.height); - for (var _i = 0; _i < this._opacity.length; _i++) { - opacity.addColorStop(this._opacity[_i][0], 'rgba(255, 255, 255, ' + this._opacity[_i][1] + ')'); + // if discrete, we already took care of the opacity. + // setup context + ctx.globalCompositeOperation = 'destination-in'; + + // apply opacity + var _opacity = ctx.createLinearGradient(0, 0, this._canvas.width, this._canvas.height); + for (var _i2 = 0; _i2 < this._opacity.length; _i2++) { + _opacity.addColorStop(this._opacity[_i2][0], 'rgba(255, 255, 255, ' + this._opacity[_i2][1] + ')'); + } + ctx.fillStyle = _opacity; + ctx.fillRect(0, 0, this._canvas.width, this._canvas.height); } - ctx.fillStyle = opacity; - ctx.fillRect(0, 0, this._canvas.width, this._canvas.height); } }, { key: 'lutsAvailable', @@ -34842,6 +35024,16 @@ var HelpersLut = function () { get: function get() { return this._lutsO; } + }, { + key: 'discrete', + set: function set(discrete) { + this._discrete = discrete; + + this.paintCanvas(); + }, + get: function get() { + return this._discrete; + } }], [{ key: 'presetLuts', value: function presetLuts() { @@ -34876,7 +35068,7 @@ var HelpersLut = function () { exports.default = HelpersLut; -},{}],104:[function(require,module,exports){ +},{}],105:[function(require,module,exports){ "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -34981,7 +35173,7 @@ var HerlpersMaterialMixin = function HerlpersMaterialMixin(superclass) { exports.default = HerlpersMaterialMixin; -},{}],105:[function(require,module,exports){ +},{}],106:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -35150,7 +35342,7 @@ var HelpersProgressBar = function () { exports.default = HelpersProgressBar; -},{}],106:[function(require,module,exports){ +},{}],107:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -35592,7 +35784,7 @@ var HelpersSlice = function (_HelpersMaterialMixin) { exports.default = HelpersSlice; -},{"../../src/geometries/geometries.slice":98,"../../src/helpers/helpers.material.mixin":104,"../../src/shaders/shaders.data.fragment":131,"../../src/shaders/shaders.data.uniform":132,"../../src/shaders/shaders.data.vertex":133}],107:[function(require,module,exports){ +},{"../../src/geometries/geometries.slice":99,"../../src/helpers/helpers.material.mixin":105,"../../src/shaders/shaders.data.fragment":132,"../../src/shaders/shaders.data.uniform":133,"../../src/shaders/shaders.data.vertex":134}],108:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -36079,7 +36271,7 @@ var HelpersStack = function (_THREE$Object3D) { exports.default = HelpersStack; -},{"../../src/helpers/helpers.border":100,"../../src/helpers/helpers.boundingbox":101,"../../src/helpers/helpers.slice":106}],108:[function(require,module,exports){ +},{"../../src/helpers/helpers.border":101,"../../src/helpers/helpers.boundingbox":102,"../../src/helpers/helpers.slice":107}],109:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -36251,7 +36443,7 @@ var HelpersVolumeRendering = function (_HelpersMaterialMixin) { exports.default = HelpersVolumeRendering; -},{"../../src/helpers/helpers.material.mixin":104,"../../src/shaders/shaders.vr.fragment":138,"../../src/shaders/shaders.vr.uniform":139,"../../src/shaders/shaders.vr.vertex":140}],109:[function(require,module,exports){ +},{"../../src/helpers/helpers.material.mixin":105,"../../src/shaders/shaders.vr.fragment":139,"../../src/shaders/shaders.vr.uniform":140,"../../src/shaders/shaders.vr.vertex":141}],110:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -36651,7 +36843,7 @@ var HelpersVoxel = function (_THREE$Object3D) { exports.default = HelpersVoxel; -},{"../../src/geometries/geometries.voxel":99,"../../src/models/models.stack":117,"../../src/models/models.voxel":118}],110:[function(require,module,exports){ +},{"../../src/geometries/geometries.voxel":100,"../../src/models/models.stack":118,"../../src/models/models.voxel":119}],111:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -36808,7 +37000,7 @@ var LoadersBase = function () { exports.default = LoadersBase; -},{"../../src/helpers/helpers.progressbar":105,"../../src/models/models.frame":114,"../../src/models/models.series":116,"../../src/models/models.stack":117}],111:[function(require,module,exports){ +},{"../../src/helpers/helpers.progressbar":106,"../../src/models/models.frame":115,"../../src/models/models.series":117,"../../src/models/models.stack":118}],112:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -36831,7 +37023,7 @@ exports.default = { Volume: _loaders2.default }; -},{"./loaders.volume":112}],112:[function(require,module,exports){ +},{"./loaders.volume":113}],113:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -36997,6 +37189,7 @@ var LoadersVolumes = function (_LoadersBase) { if (!series.numberOfFrames) { series.numberOfFrames = 1; } + series.numberOfChannels = volumeParser.numberOfChannels(); series.modality = volumeParser.modality(); // if it is a segmentation, attach extra information if (series.modality === 'SEG') { @@ -37007,8 +37200,6 @@ var LoadersVolumes = function (_LoadersBase) { series.segmentationSegments = volumeParser.segmentationSegments(); } - series.numberOfChannels = volumeParser.numberOfChannels(); - // just create 1 dummy stack for now var stack = new _models4.default(); stack.numberOfChannels = volumeParser.numberOfChannels(); @@ -37016,6 +37207,14 @@ var LoadersVolumes = function (_LoadersBase) { stack.invert = volumeParser.invert(); stack.modality = series.modality; stack.rightHanded = volumeParser.rightHanded(); + // if it is a segmentation, attach extra information + if (stack.modality === 'SEG') { + // colors + // labels + // etc. + stack.segmentationType = series.segmentationType; + stack.segmentationSegments = series.segmentationSegments; + } series.stack.push(stack); // recursive call for each frame // better than for loop to be able to update dom with "progress" callback @@ -37109,7 +37308,7 @@ var LoadersVolumes = function (_LoadersBase) { exports.default = LoadersVolumes; -},{"../../src/models/models.frame":114,"../../src/models/models.series":116,"../../src/models/models.stack":117,"../../src/parsers/parsers.dicom":119,"../../src/parsers/parsers.nifti":121,"../../src/parsers/parsers.nrrd":122,"./loaders.base":110,"pako":51}],113:[function(require,module,exports){ +},{"../../src/models/models.frame":115,"../../src/models/models.series":117,"../../src/models/models.stack":118,"../../src/parsers/parsers.dicom":120,"../../src/parsers/parsers.nifti":122,"../../src/parsers/parsers.nrrd":123,"./loaders.base":111,"pako":51}],114:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -37246,7 +37445,7 @@ var ModelsBase = function () { exports.default = ModelsBase; -},{}],114:[function(require,module,exports){ +},{}],115:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -37671,7 +37870,7 @@ var ModelsFrame = function (_ModelsBase) { exports.default = ModelsFrame; -},{"../../src/models/models.base":113}],115:[function(require,module,exports){ +},{"../../src/models/models.base":114}],116:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -37709,7 +37908,7 @@ exports.default = { Voxel: _models8.default }; -},{"./models.frame":114,"./models.series":116,"./models.stack":117,"./models.voxel":118}],116:[function(require,module,exports){ +},{"./models.frame":115,"./models.series":117,"./models.stack":118,"./models.voxel":119}],117:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -37943,7 +38142,7 @@ var ModelsSeries = function (_ModelsBase) { exports.default = ModelsSeries; -},{"../../src/models/models.base":113}],117:[function(require,module,exports){ +},{"../../src/models/models.base":114}],118:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -37962,7 +38161,7 @@ var _createClass = function () { }; }(); -var _core = require('../../src/core/core.pack'); +var _core = require('../../src/core/core.colors'); var _core2 = _interopRequireDefault(_core); @@ -37978,6 +38177,16 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _toConsumableArray(arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + }return arr2; + } else { + return Array.from(arr); + } +} + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); @@ -38077,7 +38286,14 @@ var ModelsStack = function (_ModelsBase) { // _this._modality = 'Modality not set'; + + // SEGMENTATION STUFF + _this._segmentationType = null; + _this._segmentationSegments = []; + _this._segmentationDefaultColor = [63, 174, 128]; _this._frameSegment = []; + _this._segmentationLUT = []; + _this._segmentationLUTO = []; // photometricInterpretation Monochrome1 VS Monochrome2 _this._invert = false; @@ -38085,29 +38301,78 @@ var ModelsStack = function (_ModelsBase) { } _createClass(ModelsStack, [{ - key: 'mergeFrames', - value: function mergeFrames() { + key: 'prepareSegmentation', + value: function prepareSegmentation() { + + // store frame and do special pre-processing + this._frameSegment = this._frame; var mergedFrames = []; + + // order frames this.computeCosines(); this._frame.map(this._computeDistanceArrayMap.bind(null, this._zCosine)); this._frame.sort(this._sortDistanceArraySort); - mergedFrames.push(this._frame[0]); - var prevIndex = 0; - for (var i = 1; i < this._frame.length; i++) { - if (mergedFrames[prevIndex]._dist === this._frame[i]._dist) { + // merge frames + var prevIndex = -1; + for (var i = 0; i < this._frame.length; i++) { + if (!mergedFrames[prevIndex] || mergedFrames[prevIndex]._dist != this._frame[i]._dist) { + mergedFrames.push(this._frame[i]); + prevIndex++; + + // scale it.. for (var k = 0; k < mergedFrames[prevIndex]._rows * mergedFrames[prevIndex]._columns; k++) { - mergedFrames[prevIndex]._pixelData[k] += this._frame[i].pixelData[k] * this._frame[i]._referencedSegmentNumber; + mergedFrames[prevIndex]._pixelData[k] *= this._frame[i]._referencedSegmentNumber; } + } else { + + for (var _k = 0; _k < mergedFrames[prevIndex]._rows * mergedFrames[prevIndex]._columns; _k++) { + mergedFrames[prevIndex]._pixelData[_k] += this._frame[i].pixelData[_k] * this._frame[i]._referencedSegmentNumber; + } + } + + mergedFrames[prevIndex].minMax = _core4.default.minMaxPixelData(mergedFrames[prevIndex]._pixelData); + } + + // get information about segments + var dict = {}; + var max = 0; + for (var _i = 0; _i < this._segmentationSegments.length; _i++) { + + max = Math.max(max, parseInt(this._segmentationSegments[_i].segmentNumber, 10)); - mergedFrames[prevIndex].minMax = _core4.default.minMaxPixelData(mergedFrames[prevIndex]._pixelData); + var color = this._segmentationSegments[_i].recommendedDisplayCIELab; + if (color === null) { + + dict[this._segmentationSegments[_i].segmentNumber] = this._segmentationDefaultColor; } else { - mergedFrames.push(this._frame[i]); - prevIndex++; + + dict[this._segmentationSegments[_i].segmentNumber] = _core2.default.cielab2RGB.apply(_core2.default, _toConsumableArray(color)); } } + // generate LUTs + var colors = []; + var index = [0]; + for (var _i2 = 0; _i2 <= max; _i2++) { + + var _index = _i2 / max; + var opacity = _i2 ? 1 : 0; + var rgb = [0, 0, 0]; + if (dict.hasOwnProperty(_i2.toString())) { + + rgb = dict[_i2.toString()]; + } + + rgb[0] /= 255; + rgb[1] /= 255; + rgb[2] /= 255; + + this._segmentationLUT.push([_index].concat(_toConsumableArray(rgb))); + this._segmentationLUTO.push([_index, opacity]); + } + this._frame = mergedFrames; } @@ -38126,10 +38391,8 @@ var ModelsStack = function (_ModelsBase) { value: function prepare() { // if segmentation, merge some frames... if (this._modality === 'SEG') { - console.log('do some special pre-processing'); - // store frame and do special pre-processing - this._frameSegment = this._frame; - this.mergeFrames(); + + this.prepareSegmentation(); } // we need at least 1 frame @@ -38421,11 +38684,11 @@ var ModelsStack = function (_ModelsBase) { var coordinate = 0; var channelOffset = 0; - for (var _i = startVoxel; _i < stopVoxel; _i++) { + for (var _i3 = startVoxel; _i3 < stopVoxel; _i3++) { /*jshint bitwise: false*/ - frameIndex = ~~(_i / frameDimension); - inFrameIndex = _i % frameDimension; + frameIndex = ~~(_i3 / frameDimension); + inFrameIndex = _i3 % frameDimension; /*jshint bitwise: true*/ var raw = frame[frameIndex].pixelData[inFrameIndex]; @@ -38442,11 +38705,11 @@ var ModelsStack = function (_ModelsBase) { } else if (bits === 32 && channels === 1 && pixelType === 0) { var _data3 = new Uint8Array(textureSize * textureSize * 4); - for (var _i2 = startVoxel; _i2 < stopVoxel; _i2++) { + for (var _i4 = startVoxel; _i4 < stopVoxel; _i4++) { /*jshint bitwise: false*/ - frameIndex = ~~(_i2 / frameDimension); - inFrameIndex = _i2 % frameDimension; + frameIndex = ~~(_i4 / frameDimension); + inFrameIndex = _i4 % frameDimension; /*jshint bitwise: true*/ // slow! @@ -38465,10 +38728,10 @@ var ModelsStack = function (_ModelsBase) { var _data4 = new Uint8Array(textureSize * textureSize * 4); - for (var _i3 = startVoxel; _i3 < stopVoxel; _i3++) { + for (var _i5 = startVoxel; _i5 < stopVoxel; _i5++) { /*jshint bitwise: false*/ - frameIndex = ~~(_i3 / frameDimension); - inFrameIndex = _i3 % frameDimension; + frameIndex = ~~(_i5 / frameDimension); + inFrameIndex = _i5 % frameDimension; /*jshint bitwise: true*/ // slow! @@ -38490,11 +38753,11 @@ var ModelsStack = function (_ModelsBase) { } else if (bits === 8 && channels === 3) { var _data5 = new Uint8Array(textureSize * textureSize * 3); - for (var _i4 = startVoxel; _i4 < stopVoxel; _i4++) { + for (var _i6 = startVoxel; _i6 < stopVoxel; _i6++) { /*jshint bitwise: false*/ - frameIndex = ~~(_i4 / frameDimension); - inFrameIndex = _i4 % frameDimension; + frameIndex = ~~(_i6 / frameDimension); + inFrameIndex = _i6 % frameDimension; /*jshint bitwise: true*/ _data5[3 * packIndex] = frame[frameIndex].pixelData[3 * inFrameIndex]; @@ -38822,6 +39085,38 @@ var ModelsStack = function (_ModelsBase) { set: function set(rightHanded) { this._rightHanded = rightHanded; } + }, { + key: 'segmentationSegments', + set: function set(segmentationSegments) { + this._segmentationSegments = segmentationSegments; + }, + get: function get() { + return this._segmentationSegments; + } + }, { + key: 'segmentationType', + set: function set(segmentationType) { + this._segmentationType = segmentationType; + }, + get: function get() { + return this._segmentationType; + } + }, { + key: 'segmentationLUT', + set: function set(segmentationLUT) { + this._segmentationLUT = segmentationLUT; + }, + get: function get() { + return this._segmentationLUT; + } + }, { + key: 'segmentationLUTO', + set: function set(segmentationLUTO) { + this._segmentationLUTO = segmentationLUTO; + }, + get: function get() { + return this._segmentationLUTO; + } }], [{ key: 'worldToData', value: function worldToData(stack, worldCoordinates) { @@ -38868,7 +39163,7 @@ var ModelsStack = function (_ModelsBase) { exports.default = ModelsStack; -},{"../../src/core/core.pack":94,"../../src/core/core.utils":95,"../../src/models/models.base":113,"math-float32-to-binary-string":43}],118:[function(require,module,exports){ +},{"../../src/core/core.colors":92,"../../src/core/core.utils":96,"../../src/models/models.base":114,"math-float32-to-binary-string":43}],119:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -38953,7 +39248,7 @@ var ModelsVoxel = function () { exports.default = ModelsVoxel; -},{}],119:[function(require,module,exports){ +},{}],120:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -39089,7 +39384,6 @@ var ParsersDicom = function (_ParsersVolume) { key: 'segmentationSegments', value: function segmentationSegments() { - // lot to do! var segmentationSegments = []; var segmentSequence = this._dataSet.elements.x00620002; @@ -39138,10 +39432,24 @@ var ParsersDicom = function (_ParsersVolume) { }, { key: '_recommendedDisplayCIELab', value: function _recommendedDisplayCIELab(segment) { - var rawColor = String(segment.dataSet.uint16('x0062000d')); - var recommendedDisplayCIELab = String('000000' + rawColor).slice(-6); - return recommendedDisplayCIELab; + if (!segment.dataSet.elements.x0062000d) { + return null; + } + + var offset = segment.dataSet.elements.x0062000d.dataOffset; + var length = segment.dataSet.elements.x0062000d.length; + var byteArray = segment.dataSet.byteArray.slice(offset, offset + length); + + // https://www.dabsoft.ch/dicom/3/C.10.7.1.1/ + var CIELabScaled = new Uint16Array(length / 2); + for (var i = 0; i < length / 2; i++) { + CIELabScaled[i] = (byteArray[2 * i + 1] << 8) + byteArray[2 * i]; + } + + var CIELabNormalized = [CIELabScaled[0] / 65535 * 100, CIELabScaled[1] / 65535 * 255 - 128, CIELabScaled[2] / 65535 * 255 - 128]; + + return CIELabNormalized; } }, { key: 'sopInstanceUID', @@ -39684,7 +39992,7 @@ var ParsersDicom = function (_ParsersVolume) { return this._swapFrame(frame); } else { - throw 'no decoder for transfer syntax ${transferSyntaxUID}'; + throw 'no decoder for transfer syntax ' + transferSyntaxUID; } } }, { @@ -39985,7 +40293,7 @@ var ParsersDicom = function (_ParsersVolume) { exports.default = ParsersDicom; -},{"../../external/scripts/jpeg":1,"../../external/scripts/jpx":2,"./parsers.volume":123,"dicom-parser":25,"jpeg-lossless-decoder-js":35}],120:[function(require,module,exports){ +},{"../../external/scripts/jpeg":1,"../../external/scripts/jpx":2,"./parsers.volume":124,"dicom-parser":25,"jpeg-lossless-decoder-js":35}],121:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -40018,7 +40326,7 @@ exports.default = { Nrrd: _parsers6.default }; -},{"./parsers.dicom":119,"./parsers.nifti":121,"./parsers.nrrd":122}],121:[function(require,module,exports){ +},{"./parsers.dicom":120,"./parsers.nifti":122,"./parsers.nrrd":123}],122:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -40483,7 +40791,7 @@ var ParsersNifti = function (_ParsersVolume) { exports.default = ParsersNifti; -},{"./parsers.volume":123,"nifti-reader-js":46}],122:[function(require,module,exports){ +},{"./parsers.volume":124,"nifti-reader-js":46}],123:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -40822,7 +41130,7 @@ var ParsersNifti = function (_ParsersVolume) { exports.default = ParsersNifti; -},{"./parsers.volume":123,"nrrd-js":50,"pako":51}],123:[function(require,module,exports){ +},{"./parsers.volume":124,"nrrd-js":50,"pako":51}],124:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -40917,7 +41225,7 @@ var ParsersVolume = function () { exports.default = ParsersVolume; -},{}],124:[function(require,module,exports){ +},{}],125:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -41019,7 +41327,7 @@ var IntersectBox = function (_ShadersBase) { exports.default = new IntersectBox(); -},{"../shaders.base":130}],125:[function(require,module,exports){ +},{"../shaders.base":131}],126:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -41114,7 +41422,7 @@ var Texture3d = function (_ShadersBase) { exports.default = new Texture3d(); -},{"../shaders.base":130}],126:[function(require,module,exports){ +},{"../shaders.base":131}],127:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -41312,7 +41620,7 @@ var Unpack = function (_ShadersBase) { exports.default = new Unpack(); -},{"../shaders.base":130}],127:[function(require,module,exports){ +},{"../shaders.base":131}],128:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -41413,7 +41721,7 @@ var InterpolationIdentity = function (_ShadersBase) { exports.default = new InterpolationIdentity(); -},{"../helpers/shaders.helpers.texture3d":125,"../helpers/shaders.helpers.unpack":126,"../shaders.base":130}],128:[function(require,module,exports){ +},{"../helpers/shaders.helpers.texture3d":126,"../helpers/shaders.helpers.unpack":127,"../shaders.base":131}],129:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -41452,7 +41760,7 @@ function shadersInterpolation(baseFragment, currentVoxel, dataValue, gradient) { exports.default = shadersInterpolation; -},{"./shaders.interpolation.identity":127,"./shaders.interpolation.trilinear":129}],129:[function(require,module,exports){ +},{"./shaders.interpolation.identity":128,"./shaders.interpolation.trilinear":130}],130:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -41551,7 +41859,7 @@ var InterpolationTrilinear = function (_ShadersBase) { exports.default = new InterpolationTrilinear(); -},{"../shaders.base":130,"./shaders.interpolation.identity":127}],130:[function(require,module,exports){ +},{"../shaders.base":131,"./shaders.interpolation.identity":128}],131:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -41603,7 +41911,7 @@ var ShadersBase = function () { exports.default = ShadersBase; -},{}],131:[function(require,module,exports){ +},{}],132:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -41707,7 +42015,7 @@ var ShadersFragment = function () { exports.default = ShadersFragment; -},{"./interpolation/shaders.interpolation":128}],132:[function(require,module,exports){ +},{"./interpolation/shaders.interpolation":129}],133:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -41825,7 +42133,7 @@ var ShadersUniform = function () { exports.default = ShadersUniform; -},{}],133:[function(require,module,exports){ +},{}],134:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -41865,7 +42173,7 @@ var ShadersVertex = function () { exports.default = ShadersVertex; -},{}],134:[function(require,module,exports){ +},{}],135:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -41932,7 +42240,7 @@ exports.default = { }; -},{"./shaders.data.fragment":131,"./shaders.data.uniform":132,"./shaders.data.vertex":133,"./shaders.layer.fragment":135,"./shaders.layer.uniform":136,"./shaders.layer.vertex":137,"./shaders.vr.fragment":138,"./shaders.vr.uniform":139,"./shaders.vr.vertex":140}],135:[function(require,module,exports){ +},{"./shaders.data.fragment":132,"./shaders.data.uniform":133,"./shaders.data.vertex":134,"./shaders.layer.fragment":136,"./shaders.layer.uniform":137,"./shaders.layer.vertex":138,"./shaders.vr.fragment":139,"./shaders.vr.uniform":140,"./shaders.vr.vertex":141}],136:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -42028,7 +42336,7 @@ var ShadersFragment = function () { exports.default = ShadersFragment; -},{}],136:[function(require,module,exports){ +},{}],137:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -42113,7 +42421,7 @@ var ShadersUniform = function () { exports.default = ShadersUniform; -},{}],137:[function(require,module,exports){ +},{}],138:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -42153,7 +42461,7 @@ var ShadersVertex = function () { exports.default = ShadersVertex; -},{}],138:[function(require,module,exports){ +},{}],139:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -42261,7 +42569,7 @@ var ShadersFragment = function () { exports.default = ShadersFragment; -},{"./helpers/shaders.helpers.intersectBox":124,"./interpolation/shaders.interpolation":128}],139:[function(require,module,exports){ +},{"./helpers/shaders.helpers.intersectBox":125,"./interpolation/shaders.interpolation":129}],140:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -42405,7 +42713,7 @@ var ShadersUniform = function () { exports.default = ShadersUniform; -},{}],140:[function(require,module,exports){ +},{}],141:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -42445,7 +42753,7 @@ var ShadersVertex = function () { exports.default = ShadersVertex; -},{}],141:[function(require,module,exports){ +},{}],142:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -42629,7 +42937,7 @@ var WidgetsBase = function (_THREE$Object3D) { exports.default = WidgetsBase; -},{}],142:[function(require,module,exports){ +},{}],143:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -43144,7 +43452,7 @@ var WidgetsHandle = function (_WidgetsBase) { exports.default = WidgetsHandle; -},{"../../src/core/core.intersections":92,"../../src/widgets/widgets.base":141}],143:[function(require,module,exports){ +},{"../../src/core/core.intersections":93,"../../src/widgets/widgets.base":142}],144:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -43177,7 +43485,7 @@ exports.default = { Ruler: _widgets6.default }; -},{"./widgets.handle":142,"./widgets.ruler":144,"./widgets.voxelProbe":145}],144:[function(require,module,exports){ +},{"./widgets.handle":143,"./widgets.ruler":145,"./widgets.voxelProbe":146}],145:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -43497,7 +43805,7 @@ var WidgetsRuler = function (_WidgetsBase) { exports.default = WidgetsRuler; -},{"../../src/widgets/widgets.base":141,"../../src/widgets/widgets.handle":142}],145:[function(require,module,exports){ +},{"../../src/widgets/widgets.base":142,"../../src/widgets/widgets.handle":143}],146:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -43966,6 +44274,6 @@ var WidgetsVoxelProbe = function (_THREE$Object3D) { exports.default = WidgetsVoxelProbe; -},{"../../src/helpers/helpers.voxel":109}]},{},[86])(86) +},{"../../src/helpers/helpers.voxel":110}]},{},[86])(86) }); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJleHRlcm5hbC9zY3JpcHRzL2pwZWcuanMiLCJleHRlcm5hbC9zY3JpcHRzL2pweC5qcyIsIm5vZGVfbW9kdWxlcy9hc3NlcnQvYXNzZXJ0LmpzIiwibm9kZV9tb2R1bGVzL2Jyb3dzZXItcmVzb2x2ZS9lbXB0eS5qcyIsIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5LXpsaWIvbm9kZV9tb2R1bGVzL3Bha28vbGliL3V0aWxzL2NvbW1vbi5qcyIsIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5LXpsaWIvbm9kZV9tb2R1bGVzL3Bha28vbGliL3psaWIvYWRsZXIzMi5qcyIsIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5LXpsaWIvbm9kZV9tb2R1bGVzL3Bha28vbGliL3psaWIvY29uc3RhbnRzLmpzIiwibm9kZV9tb2R1bGVzL2Jyb3dzZXJpZnktemxpYi9ub2RlX21vZHVsZXMvcGFrby9saWIvemxpYi9jcmMzMi5qcyIsIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5LXpsaWIvbm9kZV9tb2R1bGVzL3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cmV0dXJuIG47XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gcmVjZWl2ZUFuZEV4dGVuZChsZW5ndGgpIHtcbiAgICAgIHZhciBuID0gcmVjZWl2ZShsZW5ndGgpO1xuICAgICAgaWYgKG4gPj0gMSA8PCAobGVuZ3RoIC0gMSkpXG4gICAgICAgIHJldHVybiBuO1xuICAgICAgcmV0dXJuIG4gKyAoLTEgPDwgbGVuZ3RoKSArIDE7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZGVjb2RlQmFzZWxpbmUoY29tcG9uZW50LCBvZmZzZXQpIHtcbiAgICAgIHZhciB0ID0gZGVjb2RlSHVmZm1hbihjb21wb25lbnQuaHVmZm1hblRhYmxlREMpO1xuICAgICAgdmFyIGRpZmYgPSB0ID09PSAwID8gMCA6IHJlY2VpdmVBbmRFeHRlbmQodCk7XG4gICAgICBjb21wb25lbnQuYmxvY2tEYXRhW29mZnNldF0gPSAoY29tcG9uZW50LnByZWQgKz0gZGlmZik7XG4gICAgICB2YXIgayA9IDE7XG4gICAgICB3aGlsZSAoayA8IDY0KSB7XG4gICAgICAgIHZhciBycyA9IGRlY29kZUh1ZmZtYW4oY29tcG9uZW50Lmh1ZmZtYW5UYWJsZUFDKTtcbiAgICAgICAgdmFyIHMgPSBycyAmIDE1LCByID0gcnMgPj4gNDtcbiAgICAgICAgaWYgKHMgPT09IDApIHtcbiAgICAgICAgICBpZiAociA8IDE1KVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgayArPSAxNjtcbiAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuICAgICAgICBrICs9IHI7XG4gICAgICAgIHZhciB6ID0gZGN0WmlnWmFnW2tdO1xuICAgICAgICBjb21wb25lbnQuYmxvY2tEYXRhW29mZnNldCArIHpdID0gcmVjZWl2ZUFuZEV4dGVuZChzKTtcbiAgICAgICAgaysrO1xuICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIGRlY29kZURDRmlyc3QoY29tcG9uZW50LCBvZmZzZXQpIHtcbiAgICAgIHZhciB0ID0gZGVjb2RlSHVmZm1hbihjb21wb25lbnQuaHVmZm1hblRhYmxlREMpO1xuICAgICAgdmFyIGRpZmYgPSB0ID09PSAwID8gMCA6IChyZWNlaXZlQW5kRXh0ZW5kKHQpIDw8IHN1Y2Nlc3NpdmUpO1xuICAgICAgY29tcG9uZW50LmJsb2NrRGF0YVtvZmZzZXRdID0gKGNvbXBvbmVudC5wcmVkICs9IGRpZmYpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGRlY29kZURDU3VjY2Vzc2l2ZShjb21wb25lbnQsIG9mZnNldCkge1xuICAgICAgY29tcG9uZW50LmJsb2NrRGF0YVtvZmZzZXRdIHw9IHJlYWRCaXQoKSA8PCBzdWNjZXNzaXZlO1xuICAgIH1cblxuICAgIHZhciBlb2JydW4gPSAwO1xuICAgIGZ1bmN0aW9uIGRlY29kZUFDRmlyc3QoY29tcG9uZW50LCBvZmZzZXQpIHtcbiAgICAgIGlmIChlb2JydW4gPiAwKSB7XG4gICAgICAgIGVvYnJ1bi0tO1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG4gICAgICB2YXIgayA9IHNwZWN0cmFsU3RhcnQsIGUgPSBzcGVjdHJhbEVuZDtcbiAgICAgIHdoaWxlIChrIDw9IGUpIHtcbiAgICAgICAgdmFyIHJzID0gZGVjb2RlSHVmZm1hbihjb21wb25lbnQuaHVmZm1hblRhYmxlQUMpO1xuICAgICAgICB2YXIgcyA9IHJzICYgMTUsIHIgPSBycyA+PiA0O1xuICAgICAgICBpZiAocyA9PT0gMCkge1xuICAgICAgICAgIGlmIChyIDwgMTUpIHtcbiAgICAgICAgICAgIGVvYnJ1biA9IHJlY2VpdmUocikgKyAoMSA8PCByKSAtIDE7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgICAgayArPSAxNjtcbiAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuICAgICAgICBrICs9IHI7XG4gICAgICAgIHZhciB6ID0gZGN0WmlnWmFnW2tdO1xuICAgICAgICBjb21wb25lbnQuYmxvY2tEYXRhW29mZnNldCArIHpdID0gcmVjZWl2ZUFuZEV4dGVuZChzKSAqICgxIDw8IHN1Y2Nlc3NpdmUpO1xuICAgICAgICBrKys7XG4gICAgICB9XG4gICAgfVxuXG4gICAgdmFyIHN1Y2Nlc3NpdmVBQ1N0YXRlID0gMCwgc3VjY2Vzc2l2ZUFDTmV4dFZhbHVlO1xuICAgIGZ1bmN0aW9uIGRlY29kZUFDU3VjY2Vzc2l2ZShjb21wb25lbnQsIG9mZnNldCkge1xuICAgICAgdmFyIGsgPSBzcGVjdHJhbFN0YXJ0LCBlID0gc3BlY3RyYWxFbmQsIHIgPSAwO1xuICAgICAgd2hpbGUgKGsgPD0gZSkge1xuICAgICAgICB2YXIgeiA9IGRjdFppZ1phZ1trXTtcbiAgICAgICAgc3dpdGNoIChzdWNjZXNzaXZlQUNTdGF0ZSkge1xuICAgICAgICAgIGNhc2UgMDogLy8gaW5pdGlhbCBzdGF0ZVxuICAgICAgICAgICAgdmFyIHJzID0gZGVjb2RlSHVmZm1hbihjb21wb25lbnQuaHVmZm1hblRhYmxlQUMpO1xuICAgICAgICAgICAgdmFyIHMgPSBycyAmIDE1O1xuICAgICAgICAgICAgciA9IHJzID4+IDQ7XG4gICAgICAgICAgICBpZiAocyA9PT0gMCkge1xuICAgICAgICAgICAgICBpZiAociA8IDE1KSB7XG4gICAgICAgICAgICAgICAgZW9icnVuID0gcmVjZWl2ZShyKSArICgxIDw8IHIpO1xuICAgICAgICAgICAgICAgIHN1Y2Nlc3NpdmVBQ1N0YXRlID0gNDtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByID0gMTY7XG4gICAgICAgICAgICAgICAgc3VjY2Vzc2l2ZUFDU3RhdGUgPSAxO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBpZiAocyAhPT0gMSlcbiAgICAgICAgICAgICAgICB0aHJvdyBcImludmFsaWQgQUNuIGVuY29kaW5nXCI7XG4gICAgICAgICAgICAgIHN1Y2Nlc3NpdmVBQ05leHRWYWx1ZSA9IHJlY2VpdmVBbmRFeHRlbmQocyk7XG4gICAgICAgICAgICAgIHN1Y2Nlc3NpdmVBQ1N0YXRlID0gciA/IDIgOiAzO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgY2FzZSAxOiAvLyBza2lwcGluZyByIHplcm8gaXRlbXNcbiAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICBpZiAoY29tcG9uZW50LmJsb2NrRGF0YVtvZmZzZXQgKyB6XSkge1xuICAgICAgICAgICAgICBjb21wb25lbnQuYmxvY2tEYXRhW29mZnNldCArIHpdICs9IChyZWFkQml0KCkgPDwgc3VjY2Vzc2l2ZSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICByLS07XG4gICAgICAgICAgICAgIGlmIChyID09PSAwKVxuICAgICAgICAgICAgICAgIHN1Y2Nlc3NpdmVBQ1N0YXRlID0gc3VjY2Vzc2l2ZUFDU3RhdGUgPT0gMiA/IDMgOiAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSAzOiAvLyBzZXQgdmFsdWUgZm9yIGEgemVybyBpdGVtXG4gICAgICAgICAgICBpZiAoY29tcG9uZW50LmJsb2NrRGF0YVtvZmZzZXQgKyB6XSkge1xuICAgICAgICAgICAgICBjb21wb25lbnQuYmxvY2tEYXRhW29mZnNldCArIHpdICs9IChyZWFkQml0KCkgPDwgc3VjY2Vzc2l2ZSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBjb21wb25lbnQuYmxvY2tEYXRhW29mZnNldCArIHpdID0gc3VjY2Vzc2l2ZUFDTmV4dFZhbHVlIDw8IHN1Y2Nlc3NpdmU7XG4gICAgICAgICAgICAgIHN1Y2Nlc3NpdmVBQ1N0YXRlID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIGNhc2UgNDogLy8gZW9iXG4gICAgICAgICAgICBpZiAoY29tcG9uZW50LmJsb2NrRGF0YVtvZmZzZXQgKyB6XSkge1xuICAgICAgICAgICAgICBjb21wb25lbnQuYmxvY2tEYXRhW29mZnNldCArIHpdICs9IChyZWFkQml0KCkgPDwgc3VjY2Vzc2l2ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBrKys7XG4gICAgICB9XG4gICAgICBpZiAoc3VjY2Vzc2l2ZUFDU3RhdGUgPT09IDQpIHtcbiAgICAgICAgZW9icnVuLS07XG4gICAgICAgIGlmIChlb2JydW4gPT09IDApXG4gICAgICAgICAgc3VjY2Vzc2l2ZUFDU3RhdGUgPSAwO1xuICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIGRlY29kZU1jdShjb21wb25lbnQsIGRlY29kZSwgbWN1LCByb3csIGNvbCkge1xuICAgICAgdmFyIG1jdVJvdyA9IChtY3UgLyBtY3VzUGVyTGluZSkgfCAwO1xuICAgICAgdmFyIG1jdUNvbCA9IG1jdSAlIG1jdXNQZXJMaW5lO1xuICAgICAgdmFyIGJsb2NrUm93ID0gbWN1Um93ICogY29tcG9uZW50LnYgKyByb3c7XG4gICAgICB2YXIgYmxvY2tDb2wgPSBtY3VDb2wgKiBjb21wb25lbnQuaCArIGNvbDtcbiAgICAgIHZhciBvZmZzZXQgPSBnZXRCbG9ja0J1ZmZlck9mZnNldChjb21wb25lbnQsIGJsb2NrUm93LCBibG9ja0NvbCk7XG4gICAgICBkZWNvZGUoY29tcG9uZW50LCBvZmZzZXQpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGRlY29kZUJsb2NrKGNvbXBvbmVudCwgZGVjb2RlLCBtY3Up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MaW5lICogZnJhbWUubWN1c1BlckNvbHVtbjtcbiAgICB9XG4gICAgaWYgKCFyZXNldEludGVydmFsKSB7XG4gICAgICByZXNldEludGVydmFsID0gbWN1RXhwZWN0ZWQ7XG4gICAgfVxuXG4gICAgdmFyIGgsIHY7XG4gICAgd2hpbGUgKG1jdSA8IG1jdUV4cGVjdGVkKSB7XG4gICAgICAvLyByZXNldCBpbnRlcnZhbCBzdHVmZlxuICAgICAgZm9yIChpID0gMDsgaSA8IGNvbXBvbmVudHNMZW5ndGg7IGkrKykge1xuICAgICAgICBjb21wb25lbnRzW2ldLnByZWQgPSAwO1xuICAgICAgfVxuICAgICAgZW9icnVuID0gMDtcblxuICAgICAgaWYgKGNvbXBvbmVudHNMZW5ndGggPT0gMSkge1xuICAgICAgICBjb21wb25lbnQgPSBjb21wb25lbnRzWzBdO1xuICAgICAgICBmb3IgKG4gPSAwOyBuIDwgcmVzZXRJbnRlcnZhbDsgbisrKSB7XG4gICAgICAgICAgZGVjb2RlQmxvY2soY29tcG9uZW50LCBkZWNvZGVGbiwgbWN1KTtcbiAgICAgICAgICBtY3UrKztcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgZm9yIChuID0gMDsgbiA8IHJlc2V0SW50ZXJ2YWw7IG4rKykge1xuICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBjb21wb25lbnRzTGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGNvbXBvbmVudCA9IGNvbXBvbmVudHNbaV07XG4gICAgICAgICAgICBoID0gY29tcG9uZW50Lmg7XG4gICAgICAgICAgICB2ID0gY29tcG9uZW50LnY7XG4gICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgdjsgaisrKSB7XG4gICAgICAgICAgICAgIGZvciAoayA9IDA7IGsgPCBoOyBrKyspIHtcbiAgICAgICAgICAgICAgICBkZWNvZGVNY3UoY29tcG9uZW50LCBkZWNvZGVGbiwgbWN1LCBqLCBrKTtcbiAgICAgICAgICAg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O1xuICAgIHZhciB2MCwgdjEsIHYyLCB2MywgdjQsIHY1LCB2NiwgdjcsIHQ7XG4gICAgdmFyIGk7XG5cbiAgICAvLyBkZXF1YW50XG4gICAgZm9yIChpID0gMDsgaSA8IDY0OyBpKyspIHtcbiAgICAgIHBbaV0gPSBjb21wb25lbnQuYmxvY2tEYXRhW2Jsb2NrQnVmZmVyT2Zmc2V0ICsgaV0gKiBxdFtpXTtcbiAgICB9XG5cbiAgICAvLyBpbnZlcnNlIERDVCBvbiByb3dzXG4gICAgZm9yIChpID0gMDsgaSA8IDg7ICsraSkge1xuICAgICAgdmFyIHJvdyA9IDggKiBpO1xuXG4gICAgICAvLyBjaGVjayBmb3IgYWxsLXplcm8gQUMgY29lZmZpY2llbnRzXG4gICAgICBpZiAocFsxICsgcm93XSA9PT0gMCAmJiBwWzIgKyByb3ddID09PSAwICYmIHBbMyArIHJvd10gPT09IDAgJiZcbiAgICAgICAgcFs0ICsgcm93XSA9PT0gMCAmJiBwWzUgKyByb3ddID09PSAwICYmIHBbNiArIHJvd10gPT09IDAgJiZcbiAgICAgICAgcFs3ICsgcm93XSA9PT0gMCkge1xuICAgICAgICB0ID0gKGRjdFNxcnQyICogcFswICsgcm93XSArIDUxMikgPj4gMTA7XG4gICAgICAgIHBbMCArIHJvd10gPSB0O1xuICAgICAgICBwWzEgKyByb3ddID0gdDtcbiAgICAgICAgcFsyICsgcm93XSA9IHQ7XG4gICAgICAgIHBbMyArIHJvd10gPSB0O1xuICAgICAgICBwWzQgKyByb3ddID0gdDtcbiAgICAgICAgcFs1ICsgcm93XSA9IHQ7XG4gICAgICAgIHBbNiArIHJvd10gPSB0O1xuICAgICAgICBwWzcgKyByb3ddID0gdDtcbiAgICAgICAgY29udGludWU7XG4gICAgICB9XG5cbiAgICAgIC8vIHN0YWdlIDRcbiAgICAgIHYwID0gKGRjdFNxcnQyICogcFswICsgcm93XSArIDEyOCkgPj4gODtcbiAgICAgIHYxID0gKGRjdFNxcnQyICogcFs0IC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jdENvczMgKyAyMDQ4KSA+PiAxMjtcbiAgICAgIHY0ID0gKHY0ICogZGN0Q29zMyAtIHY3ICogZGN0U2luMyArIDIwNDgpID4+IDEyO1xuICAgICAgdjcgPSB0O1xuICAgICAgdCA9ICh2NSAqIGRjdFNpbjEgKyB2NiAqIGRjdENvczEgKyAyMDQ4KSA+PiAxMjtcbiAgICAgIHY1ID0gKHY1ICogZGN0Q29zMSAtIHY2ICogZGN0U2luMSArIDIwNDgpID4+IDEyO1xuICAgICAgdjYgPSB0O1xuXG4gICAgICAvLyBzdGFnZSAxXG4gICAgICBwWzAgKyByb3ddID0gdjAgKyB2NztcbiAgICAgIHBbNyArIHJvd10gPSB2MCAtIHY3O1xuICAgICAgcFsxICsgcm93XSA9IHYxICsgdjY7XG4gICAgICBwWzYgKyByb3ddID0gdjEgLSB2NjtcbiAgICAgIHBbMiArIHJvd10gPSB2MiArIHY1O1xuICAgICAgcFs1ICsgcm93XSA9IHYyIC0gdjU7XG4gICAgICBwWzMgKyByb3ddID0gdjMgKyB2NDtcbiAgICAgIHBbNCArIHJvd10gPSB2MyAtIHY0O1xuICAgIH1cblxuICAgIC8vIGludmVyc2UgRENUIG9uIGNvbHVtbnNcbiAgICBmb3IgKGkgPSAwOyBpIDwgODsgKytpKSB7XG4gICAgICB2YXIgY29sID0gaTtcblxuICAgICAgLy8gY2hlY2sgZm9yIGFsbC16ZXJvIEFDIGNvZWZmaWNpZW50c1xuICAgICAgaWYgKHBbMSAqIDggKyBjb2xdID09PSAwICYmIHBbMiAqIDggKyBjb2xdID09PSAwICYmIHBbMyAqIDggKyBjb2xdID09PSAwICYmXG4gICAgICAgIHBbNCAqIDggKyBjb2xdID09PSAwICYmIHBbNSAqIDggKyBjb2xdID09PSAwICYmIHBbNiAqIDggKyBjb2xdID09PSAwICYmXG4gICAgICAgIHBbNyAqIDggKyBjb2xdID09PSAwKSB7XG4gICAgICAgIHQgPSAoZGN0U3FydDIgKiBwW2kgKyAwXSArIDgxOTIpID4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UDNcbiAgICAgICAgICBjYXNlIDB4RkZFNDogLy8gQVBQNFxuICAgICAgICAgIGNhc2UgMHhGRkU1OiAvLyBBUFA1XG4gICAgICAgICAgY2FzZSAweEZGRTY6IC8vIEFQUDZcbiAgICAgICAgICBjYXNlIDB4RkZFNzogLy8gQVBQN1xuICAgICAgICAgIGNhc2UgMHhGRkU4OiAvLyBBUFA4XG4gICAgICAgICAgY2FzZSAweEZGRTk6IC8vIEFQUDlcbiAgICAgICAgICBjYXNlIDB4RkZFQTogLy8gQVBQMTBcbiAgICAgICAgICBjYXNlIDB4RkZFQjogLy8gQVBQMTFcbiAgICAgICAgICBjYXNlIDB4RkZFQzogLy8gQVBQMTJcbiAgICAgICAgICBjYXNlIDB4RkZFRDogLy8gQVBQMTNcbiAgICAgICAgICBjYXNlIDB4RkZFRTogLy8gQVBQMTRcbiAgICAgICAgICBjYXNlIDB4RkZFRjogLy8gQVBQMTVcbiAgICAgICAgICBjYXNlIDB4RkZGRTogLy8gQ09NIChDb21tZW50KVxuICAgICAgICAgICAgdmFyIGFwcERhdGEgPSByZWFkRGF0YUJsb2NrKCk7XG5cbiAgICAgICAgICAgIGlmIChmaWxlTWFya2VyID09PSAweEZGRTApIHtcbiAgICAgICAgICAgICAgaWYgKGFwcERhdGFbMF0gPT09IDB4NEEgJiYgYXBwRGF0YVsxXSA9PT0gMHg0NiAmJiBhcHBEYXRhWzJdID09PSAweDQ5ICYmXG4gICAgICAgICAgICAgICAgYXBwRGF0YVszXSA9PT0gMHg0NiAmJiBhcHBEYXRhWzRdID09PSAwKSB7IC8vICdKRklGXFx4MDAnXG4gICAgICAgICAgICAgICAgamZpZiA9IHtcbiAgICAgICAgICAgICAgICAgIHZlcnNpb246IHttYWpvcjogYXBwRGF0YVs1XSwgbWlub3I6IGFwcERhdGFbNl19LFxuICAgICAgICAgICAgICAgICAgZGVuc2l0eVVuaXRzOiBhcHBEYXRhWzddLFxuICAgICAgICAgICAgICAgICAgeERlbnNpdHk6IChhcHBEYXRhWzhdIDw8IDgpIHwgYXBwRGF0YVs5XSxcbiAgICAgICAgICAgICAgICAgIHlEZW5zaXR5OiAoYXBwRGF0YVsxMF0gPDwgOCkgfCBhcHBEYXRhWzExXSxcbiAgICAgICAgICAgICAgICAgIHRodW1iV2lkdGg6IGFwcERhdGFbMTJdLFxuICAgICAgICAgICAgICAgICAgdGh1bWJIZWlnaHQ6IGFwcERhdGFbMTNdLFxuICAgICAgICAgICAgICAgICAgdGh1bWJEYXRhOiBhcHBEYXRhLnN1YmFycmF5KDE0LCAxNCArIDMgKiBhcHBEYXRhWzEyXSAqIGFwcERhdGFbMTNdKVxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIFRPRE8gQVBQMSAtIEV4aWZcbiAgICAgICAgICAgIGlmIChmaWxlTWFya2VyID09PSAweEZGRUUpIHtcbiAgICAgICAgICAgICAgaWYgKGFwcERhdGFbMF0gPT09IDB4NDEgJiYgYXBwRGF0YVsxXSA9PT0gMHg2NCAmJiBhcHBEYXRhWzJdID09PSAweDZGICYmXG4gICAgICAgICAgICAgICAgYXBwRGF0YVszXSA9PT0gMHg2MiAmJiBhcHBEYXRhWzRdID09PSAweDY1ICYmIGFwcERhdGFbNV0gPT09IDApIHsgLy8gJ0Fkb2JlXFx4MDAnXG4gICAgICAgICAgICAgICAgYWRvYmUgPSB7XG4gICAgICAgICAgICAgICAgICB2ZXJzaW9uOiBhcHBEYXRhWzZdLFxuICAgICAgICAgICAgICAgICAgZmxhZ3MwOiAoYXBwRGF0YVs3XSA8PCA4KSB8IGFwcERhdGFbOF0sXG4gICAgICAgICAgICAgICAgICBmbGFnczE6IChhcHBEYXRhWzldIDw8IDgpIHwgYXBwRGF0YVsxMF0sXG4gICAgICAgICAgICAgICAgICB0cmFuc2Zvcm1Db2RlOiBhcHBEYXRhWzExXVxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSAweEZGREI6IC8vIERRVCAoRGVmaW5lIFF1YW50aXphdGlvbiBUYWJsZXMpXG4gICAgICAgICAgICB2YXIgcXVhbnRpemF0aW9uVGFibGVzTGVuZ3RoID0gcmVhZFVpbnQxNigpO1xuICAgICAgICAgICAgdmFyIHF1YW50aXphdGlvblRhYmxlc0VuZCA9IHF1YW50aXphdGlvblRhYmxlc0xlbmd0aCArIG9mZnNldCAtIDI7XG4gICAgICAgICAgICB3aGlsZSAob2Zmc2V0IDwgcXVhbnRpemF0aW9uVGFibGVzRW5kKSB7XG4gICAgICAgICAgICAgIHZhciBxdWFudGl6YXRpb25UYWJsZVNwZWMgPSBkYXRhW29mZnNldCsrXTtcbiAgICAgICAgICAgICAgdmFyIHRhYmxlRGF0YSA9IG5ldyBJbnQzMkFycmF5KDY0KTtcbiAgICAgICAgICAgICAgaWYgKChxdWFudGl6YXRpb25UYWJsZVNwZWMgPj4gNCkgPT09IDApIHsgLy8gOCBiaXQgdmFsdWVzXG4gICAgICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IDY0OyBqKyspIHtcbiAgICAgICAgICAgICAgICAgIHZhciB6ID0gZGN0WmlnWmFnW2pdO1xuICAgICAgICAgICAgICAgICAgdGFibGVEYXRhW3pdID0gZGF0YVtvZmZzZXQrK107XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9IGVsc2UgaWYgKChxdWFudGl6YXRpb25UYWJsZVNwZWMgPj4gNCkgPT09IDEpIHsgLy8xNiBiaXRcbiAgICAgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgNjQ7IGorKykge1xuICAgICAgICAgICAgICAgICAgdmFyIHp6ID0gZGN0WmlnWmFnW2pdO1xuICAgICAgICAgICAgICAgICAgdGFibGVEYXRhW3p6XSA9IHJlYWRVaW50MTYoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0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AgICAgIGZyYW1lLmNvbXBvbmVudElkcyA9IHt9O1xuICAgICAgICAgICAgdmFyIGNvbXBvbmVudHNDb3VudCA9IGRhdGFbb2Zmc2V0KytdLCBjb21wb25lbnRJZDtcbiAgICAgICAgICAgIHZhciBtYXhIID0gMCwgbWF4ViA9IDA7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgY29tcG9uZW50c0NvdW50OyBpKyspIHtcbiAgICAgICAgICAgICAgY29tcG9uZW50SWQgPSBkYXRhW29mZnNldF07XG4gICAgICAgICAgICAgIHZhciBoID0gZGF0YVtvZmZzZXQgKyAxXSA+PiA0O1xuICAgICAgICAgICAgICB2YXIgdiA9IGRhdGFbb2Zmc2V0ICsgMV0gJiAxNTtcbiAgICAgICAgICAgICAgaWYgKG1heEggPCBoKVxuICAgICAgICAgICAgICAgIG1heEggPSBoO1xuICAgICAgICAgICAgICBpZiAobWF4ViA8IHYpXG4gICAgICAgICAgICAgICAgbWF4ViA9IHY7XG4gICAgICAgICAgICAgIHZhciBxSWQgPSBkYXRhW29mZnNldCArIDJdO1xuICAgICAgICAgICAgICBsID0gZnJhbWUuY29tcG9uZW50cy5wdXNoKHtcbiAgICAgICAgICAgICAgICBoOiBoLFxuICAgICAgICAgICAgICAgIHY6IHYsXG4gICAgICAgICAgICAgICAgcXVhbnRpemF0aW9uVGFibGU6IHF1YW50aXphdGlvblRhYmxlc1txSWRdLFxuICAgICAgICAgICAgICAgIHF1YW50aXphdGlvblRhYmxlSWQ6IHFJZCxcbiAgICAgICAgICAgICAgICBiaXRDb252ZXJzaW9uOiAyNTUgLyAoKDEgPDwgZnJhbWUucHJlY2lzaW9uKSAtIDEpXG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICBmcmFtZS5jb21wb25lbnRJZHNbY29tcG9uZW50SWRdID0gbCAtIDE7XG4gICAgICAgICAgICAgIG9mZnNldCArPSAzO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnJhbWUubWF4SCA9IG1heEg7XG4gICAgICAgICAgICBmcmFtZS5tYXhWID0gbWF4VjtcbiAgICAgICAgICAgIHByZXBhcmVDb21wb25lbnRzKGZyYW1lKTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSAweEZGQzQ6IC8vIERIVCAoRGVmaW5lIEh1ZmZtYW4gVGFibGVzKVxuICAgICAgICAgICAgdmFyIGh1ZmZtYW5MZW5ndGggPSByZWFkVWludDE2KCk7XG4gICAgICAgICAgICBmb3IgKGkgPSAyOyBpIDwgaHVmZm1hbkxlbmd0aDsgKSB7XG4gICAgICAgICAgICAgIHZhciBodWZmbWFuVGFibGVTcGVjID0gZGF0YVtvZmZzZXQrK107XG4gICAgICAgICAgICAgIHZhciBjb2RlTGVuZ3RocyA9IG5ldyBVaW50OEFycmF5KDE2KTtcbiAgICAgICAgICAgICAgdmFyIGNvZGVMZW5ndGhTdW0gPSAwO1xuICAgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgMTY7IGorKywgb2Zmc2V0KyspXG4gICAgICAgICAgICAgICAgY29kZUxlbmd0aFN1bSArPSAoY29kZUxlbmd0aHNbal0gPSBkYXRhW29mZnNldF0pO1xuICAgICAgICAgICAgICB2YXIgaHVmZm1hblZhbHVlcyA9IG5ldyBVaW50OEFycmF5KGNvZGVMZW5ndGhTdW0pO1xuICAgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgY29kZUxlbmd0aFN1bTsgaisrLCBvZmZzZXQrKylcbiAgICAgICAgICAgICAgICBodWZmbWFuVmFsdWVzW2pdID0gZGF0YVtvZmZzZXRdO1xuICAgICAgICAgICAgICBpICs9IDE3ICsgY29kZUxlbmd0aFN1bTtcblxuICAgICAgICAgICAgICAoKGh1ZmZtYW5UYWJsZVNwZWMgPj4gNCkgPT09IDAgP1xuICAgICAgICAgICAgICAgIGh1ZmZtYW5UYWJsZXNEQyA6IGh1ZmZtYW5UYWJsZXNBQylbaHVmZm1hblRhYmxlU3BlYyAmIDE1XSA9XG4gICAgICAgICAgICAgICAgYnVpbGRIdWZmbWFuVGFibGUoY29kZUxlbmd0aHMsIGh1ZmZtYW5WYWx1ZXMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIDB4RkZERDogLy8gRFJJIChEZWZpbmUgUmVzdGFydCBJbnRlcnZhbClcbiAgICAgICAgICAgIHJlYWRVaW50MTYoKTsgLy8gc2tpcCBkYXRhIGxlbmd0aFxuICAgICAgICAgICAgcmVzZXRJbnRlcnZhbCA9IHJlYWRVaW50MTYoKTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSAweEZGREE6IC8vIFNPUyAoU3RhcnQgb2YgU2NhbilcbiAgICAgICAgICAgIHZhciBzY2FuTGVuZ3RoID0gcmVhZFVpbnQxNigpO1xuICAgICAgICAgICAgdmFyIHNlbGVjdG9yc0NvdW50ID0gZGF0YVtvZmZzZXQrK107XG4gICAgICAgICAgICB2YXIgY29tcG9uZW50cyA9IFtdLCBjb21wb25lbnQ7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgc2VsZWN0b3JzQ291bnQ7IGkrKykge1xuICAgICAgICAgICAgICB2YXIgY29tcG9uZW50SW5kZXggPSBmcmFtZS5jb21wb25lbnRJZHNbZGF0YVtvZmZzZXQrK11dO1xuICAgICAgICAgICAgICBjb21wb25lbnQgPSBmcmFtZS5jb21wb25lbnRzW2NvbXBvbmVudEluZGV4XTtcbiAgICAgICAgICAgICAgdmFyIHRhYmxlU3BlYyA9IGRhdGFbb2Zmc2V0KytdO1xuICAgICAgICAgICAgICBjb21wb25lbnQuaHVmZm1hblRhYmxlREMgPSBodWZmbWFuVGFibGVzRENbdGFibGVTcGVjID4+IDRdO1xuICAgICAgICAgICAgICBjb21wb25lbnQuaHVmZm1hblRhYmxlQUMgPSBodWZmbWFuVGFibGVzQUNbdGFibGVTcGVjICYgMTVdO1xuICAgICAgICAgICAgICBjb21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bmVudC5xdWFudGl6YXRpb25UYWJsZSAmJiBjb21wb25lbnQucXVhbnRpemF0aW9uVGFibGVJZCAhPT0gbnVsbClcbiAgICAgICAgICBjb21wb25lbnQucXVhbnRpemF0aW9uVGFibGUgPSBxdWFudGl6YXRpb25UYWJsZXNbY29tcG9uZW50LnF1YW50aXphdGlvblRhYmxlSWRdO1xuICAgICAgICB0aGlzLmNvbXBvbmVudHMucHVzaCh7XG4gICAgICAgICAgb3V0cHV0OiBidWlsZENvbXBvbmVudERhdGEoZnJhbWUsIGNvbXBvbmVudCksXG4gICAgICAgICAgc2NhbGVYOiBjb21wb25lbnQuaCAvIGZyYW1lLm1heEgsXG4gICAgICAgICAgc2NhbGVZOiBjb21wb25lbnQudiAvIGZyYW1lLm1heFYsXG4gICAgICAgICAgYmxvY2tzUGVyTGluZTogY29tcG9uZW50LmJsb2Nrc1BlckxpbmUsXG4gICAgICAgICAgYmxvY2tzUGVyQ29sdW1uOiBjb21wb25lbnQuYmxvY2tzUGVyQ29sdW1uLFxuICAgICAgICAgIGJpdENvbnZlcnNpb246IGNvbXBvbmVudC5iaXRDb252ZXJzaW9uXG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgIH0sXG4gICAgZ2V0RGF0YTE2OiBmdW5jdGlvbiBnZXREYXRhMTYod2lkdGgsIGhlaWdodCkge1xuICAgICAgaWYgKHRoaXMuY29tcG9uZW50cy5sZW5ndGggIT09IDEpXG4gICAgICAgIHRocm93ICdVbnN1cHBvcnRlZCBjb2xvciBtb2RlJztcbiAgICAgIHZhciBzY2FsZVggPSB0aGlzLndpZHRoIC8gd2lkdGgsIHNjYWxlWSA9IHRoaXMuaGVpZ2h0IC8gaGVpZ2h0O1xuXG4gICAgICB2YXIgY29tcG9uZW50LCBjb21wb25lbnRTY2FsZVgsIGNvbXBvbmVudFNjYWxlWTtcbiAgICAgIHZhciB4LCB5LCBpO1xuICAgICAgdmFyIG9mZnNldCA9IDA7XG4gICAgICB2YXIgbnVtQ29tcG9u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PSBibG9ja1JvdyA8PCAzO1xuICAgICAgICAgIGZvciAodmFyIGJsb2NrQ29sID0gMDsgYmxvY2tDb2wgPCBibG9ja3NQZXJMaW5lOyBibG9ja0NvbCsrKSB7XG4gICAgICAgICAgICB2YXIgYnVmZmVyT2Zmc2V0ID0gZ2V0QmxvY2tCdWZmZXJPZmZzZXQoY29tcG9uZW50LCBibG9ja1JvdywgYmxvY2tDb2wpO1xuICAgICAgICAgICAgdmFyIG9mZnNldCA9IDAsIHNhbXBsZSA9IGJsb2NrQ29sIDw8IDM7XG4gICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgODsgaisrKSB7XG4gICAgICAgICAgICAgIHZhciBsaW5lT2Zmc2V0ID0gKHNjYW5MaW5lICsgaikgKiBzYW1wbGVzUGVyTGluZTtcbiAgICAgICAgICAgICAgZm9yIChrID0gMDsgayA8IDg7IGsrKykge1xuICAgICAgICAgICAgICAgIGxpbmVEYXRhW2xpbmVPZmZzZXQgKyBzYW1wbGUgKyBrXSA9XG4gICAgICAgICAgICAgICAgICBjb21wb25lbnQub3V0cHV0W2J1ZmZlck9mZnNldCArIG9mZnNldCsrXTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGNvbXBvbmVudFNjYWxlWCA9IGNvbXBvbmVudC5zY2FsZVggKiBzY2FsZVg7XG4gICAgICAgIGNvbXBvbmVudFNjYWxlWSA9IGNvbXBvbmVudC5zY2FsZVkgKiBzY2FsZVk7XG4gICAgICAgIG9mZnNldCA9IGk7XG5cbiAgICAgICAgdmFyIGN4LCBjeTtcbiAgICAgICAgdmFyIGluZGV4O1xuICAgICAgICBmb3IgKHkgPSAwOyB5IDwgaGVpZ2h0OyB5KyspIHtcbiAgICAgICAgICBmb3IgKHggPSAwOyB4IDwgd2lkdGg7IHgrKykge1xuICAgICAgICAgICAgY3kgPSAwIHwgKHkgKiBjb21wb25lbnRTY2FsZVkpO1xuIC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FuTGluZSArIGopICogc2FtcGxlc1BlckxpbmU7XG4gICAgICAgICAgICAgIGZvciAoayA9IDA7IGsgPCA4OyBrKyspIHtcbiAgICAgICAgICAgICAgICBsaW5lRGF0YVtsaW5lT2Zmc2V0ICsgc2FtcGxlICsga10gPVxuICAgICAgICAgICAgICAgICAgY29tcG9uZW50Lm91dHB1dFtidWZmZXJPZmZzZXQgKyBvZmZzZXQrK10gKiBjb21wb25lbnQuYml0Q29udmVyc2lvbjtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGNvbXBvbmVudFNjYWxlWCA9IGNvbXBvbmVudC5zY2FsZVggKiBzY2FsZVg7XG4gICAgICAgIGNvbXBvbmVudFNjYWxlWSA9IGNvbXBvbmVudC5zY2FsZVkgKiBzY2FsZVk7XG4gICAgICAgIG9mZnNldCA9IGk7XG5cbiAgICAgICAgdmFyIGN4LCBjeTtcbiAgICAgICAgdmFyIGluZGV4O1xuICAgICAgICBmb3IgKHkgPSAwOyB5IDwgaGVpZ2h0OyB5KyspIHtcbiAgICAgICAgICBmb3IgKHggPSAwOyB4IDwgd2lkdGg7IHgrKykge1xuICAgICAgICAgICAgY3kgPSAwIHwgKHkgKiBjb21wb25lbnRTY2FsZVkpO1xuICAgICAgICAgICAgY3ggPSAwIHwgKHggKiBjb21wb25lbnRTY2FsZVgpO1xuICAgICAgICAgICAgaW5kZXggPSBjeSAqIHNhbXBsZXNQZXJMaW5lICsgY3g7XG4gICAgICAgICAgICBkYXRhW29mZnNldF0gPSBsaW5lRGF0YVtpbmRleF07XG4gICAgICAgICAgICBvZmZzZXQgKz0gbnVtQ29tcG9uZW50cztcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgLy8gLi4uIHRoZW4gdHJhbnNmb3JtIGNvbG9ycywgaWYgbmVjZXNzYXJ5XG4gICAgICBzd2l0Y2ggKG51bUNvbXBvbmVudHMp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ik7XG4gICAgICAgICAgICAgIEIgPSBjbGFtcFRvVWludDgoWSAtIDIyNi44MTYgKyAxLjc3MiAqIENiKTtcblxuICAgICAgICAgICAgICBkYXRhW2kgICAgXSA9IFI7XG4gICAgICAgICAgICAgIGRhdGFbaSArIDFdID0gRztcbiAgICAgICAgICAgICAgZGF0YVtpICsgMl0gPSBCO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSA0OlxuICAgICAgICAgIGlmICghdGhpcy5hZG9iZSlcbiAgICAgICAgICAgIHRocm93ICdVbnN1cHBvcnRlZCBjb2xvciBtb2RlICg0IGNvbXBvbmVudHMpJztcbiAgICAgICAgICAvLyBUaGUgZGVmYXVsdCB0cmFuc2Zvcm0gZm9yIGZvdXIgY29tcG9uZW50cyBpcyBmYWxzZVxuICAgICAgICAgIGNvbG9yVHJhbnNmb3JtID0gZmFsc2U7XG4gICAgICAgICAgLy8gVGhlIGFkb2JlIHRyYW5zZm9ybSBtYXJrZXIgb3ZlcnJpZGVzIGFueSBwcmV2aW91cyBzZXR0aW5nXG4gICAgICAgICAgaWYgKHRoaXMuYWRvYmUgJiYgdGhpcy5hZG9iZS50cmFuc2Zvcm1Db2RlKVxuICAgICAgICAgICAgY29sb3JUcmFuc2Zvcm0gPSB0cnVlO1xuICAgICAgICAgIGVsc2UgaWYgKHR5cGVvZiB0aGlzLmNvbG9yVHJhbnNmb3JtICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIGNvbG9yVHJhbnNmb3JtID0gISF0aGlzLmNvbG9yVHJhbnNmb3JtO1xuXG4gICAgICAgICAgaWYgKGNvbG9yVHJhbnNmb3JtKSB7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgZGF0YUxlbmd0aDsgaSArPSBudW1Db21wb25lbnRzKSB7XG4gICAgICAgICAgICAgIFkgPSBkYXRhW2ldO1xuICAgICAgICAgICAgICBDYiA9IGRhdGFbaSArIDFd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ICAgICAgICAgICB2YXIgcHJlY2VkZW5jZSA9IGRhdGFbcG9zaXRpb24gKyAxXTtcbiAgICAgICAgICAgIHZhciBhcHByb3hpbWF0aW9uID0gZGF0YVtwb3NpdGlvbiArIDJdO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PT0gMSkge1xuICAgICAgICAgICAgICAvLyBlbnVtZXJhdGVkIGNvbG9yc3BhY2VcbiAgICAgICAgICAgICAgdmFyIGNvbG9yc3BhY2UgPSByZWFkVWludDMyKGRhdGEsIHBvc2l0aW9uICsgMyk7XG4gICAgICAgICAgICAgIHN3aXRjaCAoY29sb3JzcGFjZSkge1xuICAgICAgICAgICAgICAgIGNhc2UgMTY6IC8vIHRoaXMgaW5kaWNhdGVzIGEgc1JHQiBjb2xvcnNwYWNlXG4gICAgICAgICAgICAgICAgY2FzZSAxNzogLy8gdGhpcyBpbmRpY2F0ZXMgYSBncmF5c2NhbGUgY29sb3JzcGFjZVxuICAgICAgICAgICAgICAgIGNhc2UgMTg6IC8vIHRoaXMgaW5kaWNhdGVzIGEgWVVWIGNvbG9yc3BhY2VcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICB3YXJuKCdVbmtub3duIGNvbG9yc3BhY2UgJyArIGNvbG9yc3BhY2UpO1xuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWV0aG9kID09PSAyKSB7XG4gICAgICAgICAgICAgIGluZm8oJ0lDQyBwcm9maWxlIG5vdCBzdXBwb3J0ZWQnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIGNhc2UgMHg2QTcwMzI2MzogLy8gJ2pwMmMnXG4gICAgICAgICAgICB0aGlzLnBhcnNlQ29kZXN0cmVhbShkYXRhLCBwb3NpdGlvbiwgcG9zaXRpb24gKyBkYXRhTGVuZ3RoKTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIGNhc2UgMHg2QTUwMjAyMDogLy8gJ2pQXFwwMjRcXDAyNCdcbiAgICAgICAgICAgIGlmICgweDBkMGE4NzBhICE9PSByZWFkVWludDMyKGRhdGEsIHBvc2l0aW9uKSkge1xuICAgICAgICAgICAgICB3YXJuKCdJbnZhbGlkIEpQMiBzaWduYXR1cmUnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIC8vIFRoZSBmb2xsb3dpbmcgaGVhZGVyIHR5cGVzIGFyZSB2YWxpZCBidXQgY3VycmVudGx5IG5vdCB1c2VkOlxuICAgICAgICAgIGNhc2UgMHg2QTUwMUExQTogLy8gJ2pQXFwwMzJcXDAzMidcbiAgICAgICAgICBjYXNlIDB4NjY3NDc5NzA6IC8vICdmdHlwJ1xuICAgICAgICAgIGNhc2UgMHg3MjcyNjU3MTogLy8gJ3JyZXEnXG4gICAgICAgICAgY2FzZSAweDcyNjU3MzIwOiAvLyAncmVzICdcbiAgICAgICAgICBjYXNlIDB4Njk2ODY0NzI6IC8vICdpaGRyJ1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIHZhciBoZWFkZXJUeXBlID0gU3RyaW5nLmZyb21DaGFyQ29kZSgodGJveCA+PiAyNCkgJiAweEZGLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0Ym94ID4+IDE2KSAmIDB4RkYsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRib3ggPj4gOCkgJiAweEZGLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRib3ggJiAweEZGKTtcbiAgICAgICAgICAgIHdhcm4oJ1Vuc3VwcG9ydGVkIGhlYWRlciB0eXBlICcgKyB0Ym94ICs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hlYWRlciA9IHRydWU7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAweEZGRDk6IC8vIEVuZCBvZiBjb2Rlc3RyZWFtIChFT0MpXG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAweEZGNTE6IC8vIEltYWdlIGFuZCB0aWxlIHNpemUgKFNJWilcbiAgICAgICAgICAgICAgbGVuZ3RoID0gcmVhZFVpbnQxNihkYXRhLCBwb3NpdGlvbik7XG4gICAgICAgICAgICAgIHZhciBzaXogPSB7fTtcbiAgICAgICAgICAgICAgc2l6LlhzaXogPSByZWFkVWludDMyKGRhdGEsIHBvc2l0aW9uICsgNCk7XG4gICAgICAgICAgICAgIHNpei5Zc2l6ID0gcmVhZFVpbnQzMihkYXRhLCBwb3NpdGlvbiArIDgpO1xuICAgICAgICAgICAgICBzaXouWE9zaXogPSByZWFkVWludDMyKGRhdGEsIHBvc2l0aW9uICsgMTIpO1xuICAgICAgICAgICAgICBzaXouWU9zaXogPSByZWFkVWludDMyKGRhdGEsIHBvc2l0aW9uICsgMTYpO1xuICAgICAgICAgICAgICBzaXouWFRzaXogPSByZWFkVWludDMyKGRhdGEsIHBvc2l0aW9uICsgMjApO1xuICAgICAgICAgICAgICBzaXouWVRzaXogPSByZWFkVWludDMyKGRhdGEsIHBvc2l0aW9uICsgMjQpO1xuICAgICAgICAgICAgICBzaXouWFRPc2l6ID0gcmVhZFVpbnQzMihkYXRhLCBwb3NpdGlvbiArIDI4KTtcbiAgICAgICAgICAgICAgc2l6LllUT3NpeiA9IHJlYWRVaW50MzIoZGF0YSwgcG9zaXRpb24gKyAzMik7XG4gICAgICAgICAgICAgIHZhciBjb21wb25lbnRzQ291bnQgPSByZWFkVWludDE2KGRhdGEsIHBvc2l0aW9uICsgMzYpO1xuICAgICAgICAgICAgICBzaXouQ3NpeiA9IGNvbXBvbmVudHNDb3VudDtcbiAgICAgICAgICAgICAgdmFyIGNvbXBvbmVudHMgPSBbXTtcbiAgICAgICAgICAgICAgaiA9IHBvc2l0aW9uICsgMzg7XG4gICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY29tcG9uZW50c0NvdW50OyBpKyspIHtcbiAgICAgICAgICAgICAgICB2YXIgY29tcG9uZW50ID0ge1xuICAgICAgICAgICAgICAgICAgcHJlY2lzaW9uOiAoZGF0YVtqXSAmIDB4N0YpICsgMSxcbiAgICAgICAgICAgICAgICAgIGlzU2lnbmVkOiAhIShkYXRhW2pdICYgMHg4MCksXG4gICAgICAgICAgICAgICAgICBYUnNpejogZGF0YVtqICsgMV0sXG4gICAgICAgICAgICAgICAgICBZUnNpejogZGF0YVtqICsgMV1cbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIGNhbGN1bGF0ZUNvbXBvbmVudERpbWVuc2lvbnMoY29tcG9uZW50LCBzaXopO1xuICAgICAgICAgICAgICAgIGNvbXBvbmVudHMucHVzaChjb21wb25lbnQpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGNvbnRleHQuU0laID0gc2l6O1xuICAgICAgICAgICAgICBjb250ZXh0LmNvbXBvbmVudHMgPSBjb21wb25lbnRzO1xuICAgICAgICAgICAgICBjYWxjdWxhdGVUaWxlR3JpZHMoY29udGV4dCwgY29tcG9uZW50cyk7XG4gICAgICAgICAgICAgIGNvbnRleHQuUUNDID0gW107XG4gICAgICAgICAgICAgIGNvbnRleHQuQ09DID0gW107XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAweEZGNUM6IC8vIFF1YW50aXphdGlvbiBkZWZhdWx0IChRQ0QpXG4gICAgICAgICAgICAgIGxlbmd0aCA9IHJlYWRVaW50MTYoZGF0YSwgcG9zaXRpb24pO1xuICAgICAgICAgICAgICB2YXIgcWNkID0ge307XG4gICAgICAgICAgICAgIGogPSBwb3NpdGlvbiArIDI7XG4gICAgICAgICAgICAgIHNxY2QgPSBkYXRhW2orK107XG4gICAgICAgICAgICAgIHN3aXRjaCAoc3FjZCAmIDB4MUYpIHtcbiAgICAgICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgICBzcHFjZFNpemUgPSA4O1xuICAgICAgICAgICAgICAgICAgc2NhbGFyRXhwb3VuZGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICAgIHNwcWNkU2l6ZSA9IDE2O1xuICAgICAgICAgICAgICAgICAgc2NhbGFyRXhwb3VuZGVkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICAgICAgICBzcHFjZFNpemUgPSAxNjtcbiAgICAgICAgICAgICAgICAgIHNjYWxhckV4cG91bmRlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdKUFggRXJyb3I6IEludmFsaWQgU1FjZCB2YWx1ZSAnICsgc3FjZCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgcWNkLm5vUXVhbnRpemF0aW9uID0gKHNwcWNkU2l6ZSA9PT0gOCk7XG4gICAgICAgICAgICAgIHFjZC5zY2FsYXJFeHBvdW5kZWQgPSBzY2FsYXJFeHBvdW5kZWQ7XG4gICAgICAgICAgICAgIHFjZC5ndWFyZEJpdHMgPSBzcWNkID4+IDU7XG4gICAgICAgICAgICAgIHNwcWNkcyA9IFtdO1xuICAgICAgICAgICAgICB3aGlsZSAoaiA8IGxlbmd0aCArIHBvc2l0aW9uKSB7XG4gICAgICAgICAgICAgICAgdmFyIHNwcWNkID0ge307XG4gICAgICAgICAgICAgICAgaWYgKHNwcWNkU2l6ZSA9PT0gOCkge1xuICAgICAgICAgICAgICAgICAgc3BxY2QuZXBzaWxvbiA9IGRhdGFbaisrXSA+PiAzO1xuICAgICAgICAgICAgICAgICAgc3BxY2QubXUgPSAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICBzcHFjZC5lcHNpbG9uID0gZGF0YVtqXSA+PiAzO1xuICAgICAgICAgICAgICAgICAgc3BxY2QubXUgPSAoKGRhdGFbal0gJiAweDcpIDw8IDgpIHwgZGF0YVtqICsgMV07XG4gICAgICAgICAgICAgICAgICBqICs9IDI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHNwcWNkcy5wdXNoKHNwcWNkKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBxY2QuU1BxY2RzID0gc3BxY2RzO1xuICAgICAgICAgICAgICBpZiAoY29udGV4dC5tYWluSGVhZGVyKSB7XG4gICAgICAgICAgICAgICAgY29udGV4dC5RQ0QgPSBxY2Q7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgY29udGV4dC5jdXJyZW50VGlsZS5RQ0QgPSBxY2Q7XG4gICAgICAgICAgICAgICAgY29udGV4dC5jdXJyZW50VGlsZS5RQ0MgPSBbXTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMHhGRjVEOiAvLyBRdWFudGl6YXRpb24gY29tcG9uZW50IChRQ0MpXG4gICAgICAgICAgICAgIGxlbmd0aCA9IHJlYWRVaW50MTYoZGF0YSwgcG9zaXRpb24pO1xuICAgICAgICAgICAgICB2YXIgcWNjID0ge307XG4gICAgICAgICAgICAgIGogPSBwb3NpdGlvbiArIDI7XG4gICAgICAgICAgICAgIHZhciBjcWNjO1xuICAgICAgICAgICAgICBpZiAoY29udGV4dC5TSVouQ3NpeiA8IDI1Nykge1xuICAgICAgICAgICAgICAgIGNxY2MgPSBkYXRhW2orK107XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgY3FjYyA9IHJlYWRVaW50MTYoZGF0YSwgaik7XG4gICAgICAgICAgICAgICAgaiArPSAyO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHNxY2QgPSBkYXRhW2orK107XG4gICAgICAgICAgICAgIHN3aXRjaCAoc3FjZCAmIDB4MUYpIHtcbiAgICAgICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgICBzcHFjZFNpemUgPSA4O1xuICAgICAgICAgICAgICAgICAgc2NhbGFyRXhwb3VuZGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICAgIHNwcWNkU2l6ZSA9IDE2O1xuICAgICAgICAgICAgICAgICAgc2NhbGFyRXhwb3VuZGVkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICAgICAgICBzcHFjZFNpemUgPSAxNjtcbiAgICAgICAgICAgICAgICAgIHNjYWxhckV4cG91bmRlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdKUFggRXJyb3I6IEludmFsaWQgU1FjZCB2YWx1ZSAnICsgc3FjZCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgcWNjLm5vUXVhbnRpemF0aW9uID0gKHNwcWNkU2l6ZSA9PT0gOCk7XG4gICAgICAgICAgICAgIHFjYy5zY2FsYXJFeHBvdW5kZWQgPSBzY2FsYXJFeHBvdW5kZWQ7XG4gICAgICAgICAgICAgIHFjYy5ndWFyZEJpdHMgPSBzcWNkID4+IDU7XG4gICAgICAgICAgICAgIHNwcWNkcyA9IFtdO1xuICAgICAgICAgICAgICB3aGlsZSAoaiA8IChsZW5ndGggKyBwb3NpdGlvbikpIHtcbiAgICAgICAgICAgICAgICBzcHFjZCA9IHt9O1xuICAgICAgICAgICAgICAgIGlmIChzcHFjZFNpemUgPT09IDgpIHtcbiAgICAgICAgICAgICAgICAgIHNwcWNkLmVwc2lsb24gPSBkYXRhW2orK10gPj4gMztcbiAgICAgICAgICAgICAgICAgIHNwcWNkLm11ID0gMDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgc3BxY2QuZXBzaWxvbiA9IGRhdGFbal0gPj4gMztcbiAgICAgICAgICAgICAgICAgIHNwcWNkLm11ID0gKChkYXRhW2pdICYgMHg3KSA8PCA4KSB8IGRhdGFbaiArIDFdO1xuICAgICAgICAgICAgICAgICAgaiArPSAyO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBzcHFjZHMucHVzaChzcHFjZCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgcWNjLlNQcWNkcyA9IHNwcWNkcztcbiAgICAgICAgICAgICAgaWYgKGNvbnRleHQubWFpbkhlYWRlcikge1xuICAgICAgICAgICAgICAgIGNvbnRleHQuUUNDW2NxY2NdID0gcWNjO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGNvbnRleHQuY3VycmVudFRpbGUuUUNDW2NxY2NdID0gcWNjO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAweEZGNTI6IC8vIENvZGluZyBzdHlsZSBkZWZhdWx0IChDT0QpXG4gICAgICAgICAgICAgIGxlbmd0aCA9IHJlYWRVaW50MTYoZGF0YSwgcG9zaXRpb24pO1xuICAgICAgICAgICAgICB2YXIgY29kID0ge307XG4gICAgICAgICAgICAgIGogPSBwb3NpdGlvbiArIDI7XG4gICAgICAgICAgICAgIHZhciBzY29kID0gZGF0YVtqKytdO1xuICAgICAgICAgICAgICBjb2QuZW50cm9weUNvZGVyV2l0aEN1c3RvbVByZWNpbmN0cyA9ICEhKHNjb2QgJiAxKTtcbiAgICAgICAgICAgICAgY29kLnNvcE1hcmtlclVzZWQgPSAhIShzY29kICYgMik7XG4gICAgICAgICAgICAgIGNvZC5lcGhNYXJrZXJVc2VkID0gISEoc2NvZCAmIDQpO1xuICAgICAgICAgICAgICBjb2QucHJvZ3Jlc3Npb25PcmRlciA9IGRhdGFbaisrXTtcbiAgICAgICAgICAgICAgY29kLmxheWVyc0NvdW50ID0gcmVhZFVpbnQxNihkYXRhLCBqKTtcbiAgICAgICAgICAgICAgaiArPSAyO1xuICAgICAgICAgICAgICBjb2QubXVsdGlwbGVDb21wb25lbnRUcmFuc2Zvcm0gPSBkYXRhW2orK107XG5cbiAgICAgICAgICAgICAgY29kLmRlY29tcG9zaXRpb25MZXZlbHNDb3VudCA9IGRhdGFbaisrXTtcbiAgICAgICAgICAgICAgY29kLnhjYiA9IChkYXRhW2orK10gJiAweEYpICsgMjtcbiAgICAgICAgICAgICAgY29kLnljYiA9IChkYXRhW2orK10gJiAweEYpICsgMjtcbiAgICAgICAgICAgICAgdmFyIGJsb2NrU3R5bGUgPSBkYXRhW2orK107XG4gICAgICAgICAgICAgIGNvZC5zZWxlY3RpdmVBcml0aG1ldGljQ29kaW5nQnlwYXNzID0gISEoYmxvY2tTdHlsZSAmIDEpO1xuICAgICAgICAgICAgICBjb2QucmVzZXRDb250ZXh0UHJvYmFiaWxpdGllcyA9ICEhKGJsb2NrU3R5bGUgJiAyKTtcbiAgICAgICAgICAgICAgY29kLnRlcm1pbmF0aW9uT25FYWNoQ29kaW5nUGFzcyA9ICEhKGJsb2NrU3R5bGUgJiA0KTtcbiAgICAgICAgICAgICAgY29kLnZlcnRpY2FseVN0cmlwZSA9ICEhKGJsb2NrU3R5bGUgJiA4KTtcbiAgICAgICAgICAgICAgY29kLnByZWRpY3RhYmxlVGVybWluYXRpb24gPSAhIShibG9ja1N0eWxlICYgMTYpO1xuICAgICAgICAgICAgICBjb2Quc2VnbWVudGF0aW9uU3ltYm9sVXNlZCA9ICEhKGJsb2NrU3R5bGUgJiAzMik7XG4gICAgICAgICAgICAgIGNvZC5yZXZlcnNpYmxlVHJhbnNmb3JtYXRpb24gPSBkYXRhW2orK107XG4gICAgICAgICAgICAgIGlmIChjb2QuZW50cm9weUNvZGVyV2l0aEN1c3RvbVByZWNpbmN0cykge1xuICAgICAgICAgICAgICAgIHZhciBwcmVjaW5jdHNTaXplcyA9IFtdO1xuICAgICAgICAgICAgICAgIHdoaWxlIChqIDwgbGVuZ3RoICsgcG9zaXRpb24pIHtcbiAgICAgICAgICAgICAgICAgIHZhciBwcmVjaW5jdHNTaXplID0gZGF0YVtqKytdO1xuICAgICAgICAgICAgICAgICAgcHJlY2luY3RzU2l6ZXMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgIFBQeDogcHJlY2luY3RzU2l6ZSAmIDB4RixcbiAgICAgICAgICAgICAgICAgICAgUFB5OiBwcmVjaW5jdHNTaXplID4+IDRcbiAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb2QucHJlY2luY3RzU2l6ZXMgPSBwcmVjaW5jdHNTaXplcztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB2YXIgdW5zdXBwb3J0ZWQgPSBbXTtcbiAgICAgICAgICAgICAgaWYgKGNvZC5zZWxlY3RpdmVBcml0aG1ldGljQ29kaW5nQnlwYXNzKSB7XG4gICAgICAgICAgICAgICAgdW5zdXBwb3J0ZWQucHVzaCgnc2VsZWN0aXZlQXJpdGhtZXRpY0NvZGluZ0J5cGFzcycpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChjb2QucmVzZXRDb250ZXh0UHJvYmFiaWxpdGllcykge1xuICAgICAgICAgICAgICAgIHVuc3VwcG9ydGVkLnB1c2goJ3Jlc2V0Q29udGV4dFByb2JhYmlsaXRpZXMnKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAoY29kLnRlcm1pbmF0aW9uT25FYWNoQ29kaW5nUGFzcykge1xuICAgICAgICAgICAgICAgIHVuc3VwcG9ydGVkLnB1c2goJ3Rlcm1pbmF0aW9uT25FYWNoQ29kaW5nUGFzcycpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChjb2QudmVydGljYWx5U3RyaXBlKSB7XG4gICAgICAgICAgICAgICAgdW5zdXBwb3J0ZWQucHVzaCgndmVydGljYWx5U3RyaXBlJyk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKGNvZC5wcmVkaWN0YWJsZVRlcm1pbmF0aW9uKSB7XG4gICAgICAgICAgICAgICAgdW5zdXBwb3J0ZWQucHVzaCgncHJlZGljdGFibGVUZXJtaW5hdGlvbicpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmICh1bnN1cHBvcnRlZC5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgZG9Ob3RSZWNvdmVyID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0pQWCBFcnJvcjogVW5zdXBwb3J0ZWQgQ09EIG9wdGlvbnMgKCcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnN1cHBvcnRlZC5qb2luKCcsICcpICsgJyknKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAoY29udGV4dC5tYWluSGVhZGVyKSB7XG4gICAgICAgICAgICAgICAgY29udGV4dC5DT0QgPSBjb2Q7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgY29udGV4dC5jdXJyZW50VGlsZS5DT0QgPSBjb2Q7XG4gICAgICAgICAgICAgICAgY29udGV4dC5jdXJyZW50VGlsZS5DT0MgPSBbXTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMHhGRjkwOiAvLyBTdGFydCBvZiB0aWxlLXBhcnQgKFNPVClcbiAgICAgICAgICAgICAgbGVuZ3RoID0gcmVhZFVpbnQxNihkYXRhLCBwb3NpdGlvbik7XG4gICAgICAgICAgICAgIHRpbGUgPSB7fTtcbiAgICAgICAgICAgICAgdGlsZS5pbmRleCA9IHJlYWRVaW50MTYoZGF0YSwgcG9zaXRpb24gKyAyKTtcbiAgICAgICAgICAgICAgdGlsZS5sZW5ndGggPSByZWFkVWludDMyKGRhdGEsIHBvc2l0aW9uICsgNCk7XG4gICAgICAgICAgICAgIHRpbGUuZGF0YUVuZCA9IHRpbGUubGVuZ3RoICsgcG9zaXRpb24gLSAyO1xuICAgICAgICAgICAgICB0aWxlLnBhcnRJbmRleCA9IGRhdGFbcG9zaXRpb24gKyA4XTtcbiAgICAgICAgICAgICAgdGlsZS5wYXJ0c0NvdW50ID0gZGF0YVtwb3NpdGlvbiArIDldO1xuXG4gICAgICAgICAgICAgIGNvbnRleHQubWFpbkhlYWRlciA9IGZhbHNlO1xuICAgICAgICAgICAgICBpZiAodGlsZS5wYXJ0SW5kZXggPT09IDApIHtcbiAgICAgICAgICAgICAgICAvLyByZXNldCBjb21wb25lbnQgc3BlY2lmaWMgc2V0dGluZ3NcbiAgICAgICAgICAgICAgICB0aWxlLkNPRCA9IGNvbnRleHQuQ09EO1xuICAgICAgICAgICAgICAgIHRpbGUuQ09DID0gY29udGV4dC5DT0Muc2xpY2UoMCk7IC8vIGNsb25lIG9mIHRoZSBnbG9iYWwgQ09DXG4gICAgICAgICAgICAgICAgdGlsZS5RQ0QgPSBjb250ZXh0LlFDRDtcbiAgICAgICAgICAgICAgICB0aWxlLlFDQyA9IGNvbnRleHQuUUNDLnNsaWNlKDApOyAvLyBjbG9uZSBvZiB0aGUgZ2xvYmFsIENPQ1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGNvbnRleHQuY3VycmVudFRpbGUgPSB0aWxlO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMHhGRjkzOiAvLyBTdGFydCBvZiBkYXRhIChTT0QpXG4gICAgICAgICAgICAgIHRpbGUgPSBjb250ZXh0LmN1cnJlbnRUaWxlO1xuICAgICAgICAgICAgICBpZiAodGlsZS5wYXJ0SW5kZXggPT09IDApIHtcbiAgICAgICAgICAgICAgICBpbml0aWFsaXplVGlsZShjb250ZXh0LCB0aWxlLmluZGV4KTtcbiAgICAgICAgICAgICAgICBidWlsZFBhY2tldHMoY29udGV4dCk7XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAvLyBtb3ZpbmcgdG8gdGhlIGVuZCBvZiB0aGUgZGF0YVxuICAgICAgICAgICAgICBsZW5ndGggPSB0aWxlLmRhdGFFbmQgLSBwb3NpdGlvbjtcbiAgICAgICAgICAgICAgcGFyc2VUaWxlUGFja2V0cyhjb250ZXh0LCBkYXRhLCBwb3NpdGlvbiwgbGVuZ3RoKTtcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDB4RkY1NTogLy8gVGlsZS1wYXJ0IGxlbmd0aHMsIG1haW4gaGVhZGVyIChUTE0pXG4gICAgICAgICAgICBjYXNlIDB4RkY1NzogLy8gUGFja2V0IGxlbmd0aCwgbWFpbiBoZWFkZXIgKFBMTSlcbiAgICAgICAgICAgIGNhc2UgMHhGRjU4OiAvLyBQYWNrZXQgbGVuZ3RoLCB0aWxlLXBhcnQgaGVhZGVyIChQTFQpXG4gICAgICAgICAgICBjYXNlIDB4RkY2NDogLy8gQ29tbWVudCAoQ09NKVxuICAgICAgICAgICAgICBsZW5ndGggPSByZWFkVWludDE2KGRhdGEsIHBvc2l0aW9uKTtcbiAgICAgICAgICAgICAgLy8gc2tpcHBpbmcgY29udGVudFxuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMHhGRjUzOiAvLyBDb2Rpbmcgc3R5bGUgY29tcG9uZW50IChDT0MpXG4gICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignSlBYIEVycm9yOiBDb2Rlc3RyZWFtIGNvZGUgMHhGRjUzIChDT0MpIGlzICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ25vdCBpbXBsZW1lbnRlZCcpO1xuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdKUFggRXJyb3I6IFVua25vd24gY29kZXN0cmVhbSBjb2RlOiAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGUudG9TdHJpbmcoMTYpKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcG9zaXRpb24gKz0gbGVuZ3RoO1xuICAgICAgICB9XG4gICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgIGlmIChkb05vdFJlY292ZXIgfHwgdGhpcy5mYWlsT25Db3JydXB0ZWRJbWFnZSkge1xuICAgICAgICAgIHRocm93IGU7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgd2FybignVHJ5aW5nIHRvIHJlY292ZXIgZnJvbSAnICsgZS5tZXNzYWdlKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgdGhpcy50aWxlcyA9IHRyYW5zZm9ybUNvbXBvbmVudHMoY29udGV4dCk7XG4gICAgICB0aGlzLndpZHRoID0gY29udGV4dC5TSVouWHNpeiAtIGNvbnRleHQuU0laLlhPc2l6O1xuICAgICAgdGhpcy5oZWlnaHQgPSBjb250ZXh0LlNJWi5Zc2l6IC0gY29udGV4dC5TSVouWU9zaXo7XG4gICAgICB0aGlzLmNvbXBvbmVudHNDb3VudCA9IGNvbnRleHQuU0laLkNzaXo7XG4gICAgfVxuICB9O1xuICBmdW5jdGlvbiBjYWxjdWxhdGVDb21wb25lbnREaW1lbnNpb25zKGNvbXBvbmVudCwgc2l6KSB7XG4gICAgLy8gU2VjdGlvbiBCLjIgQ29tcG9uZW50IG1hcHBpbmdcbiAgICBjb21wb25lbnQueDAgPSBNYXRoLmNlaWwoc2l6LlhPc2l6IC8g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ZVHNpeiwgc2l6LllPc2l6KTtcbiAgICAgICAgdGlsZS50eDEgPSBNYXRoLm1pbihzaXouWFRPc2l6ICsgKHAgKyAxKSAqIHNpei5YVHNpeiwgc2l6LlhzaXopO1xuICAgICAgICB0aWxlLnR5MSA9IE1hdGgubWluKHNpei5ZVE9zaXogKyAocSArIDEpICogc2l6LllUc2l6LCBzaXouWXNpeik7XG4gICAgICAgIHRpbGUud2lkdGggPSB0aWxlLnR4MSAtIHRpbGUudHgwO1xuICAgICAgICB0aWxlLmhlaWdodCA9IHRpbGUudHkxIC0gdGlsZS50eTA7XG4gICAgICAgIHRpbGUuY29tcG9uZW50cyA9IFtdO1xuICAgICAgICB0aWxlcy5wdXNoKHRpbGUpO1xuICAgICAgfVxuICAgIH1cbiAgICBjb250ZXh0LnRpbGVzID0gdGlsZXM7XG5cbiAgICB2YXIgY29tcG9uZW50c0NvdW50ID0gc2l6LkNzaXo7XG4gICAgZm9yICh2YXIgaSA9IDAsIGlpID0gY29tcG9uZW50c0NvdW50OyBpIDwgaWk7IGkrKykge1xuICAgICAgdmFyIGNvbXBvbmVudCA9IGNvbXBvbmVudHNbaV07XG4gICAgICBmb3IgKHZhciBqID0gMCwgamogPSB0aWxlcy5sZW5ndGg7IGogPCBqajsgaisrKSB7XG4gICAgICAgIHZhciB0aWxlQ29tcG9uZW50ID0ge307XG4gICAgICAgIHRpbGUgPSB0aWxlc1tqXTtcbiAgICAgICAgdGlsZUNvbXBvbmVudC50Y3gwID0gTWF0aC5jZWlsKHRpbGUudHgwIC8gY29tcG9uZW50LlhSc2l6KTtcbiAgICAgICAgdGlsZUNvbXBvbmVudC50Y3kwID0gTWF0aC5jZWlsKHRpbGUudHkwIC8gY29tcG9uZW50LllSc2l6KTtcbiAgICAgICAgdGlsZUNvbXBvbmVudC50Y3gxID0gTWF0aC5jZWlsKHRpbGUudHgxIC8gY29tcG9uZW50LlhSc2l6KTtcbiAgICAgICAgdGlsZUNvbXBvbmVudC50Y3kxID0gTWF0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Y2luY3ROdW1iZXI7XG4gICAgICAgIGNvZGVibG9jay5zdWJiYW5kVHlwZSA9IHN1YmJhbmQudHlwZTtcbiAgICAgICAgY29kZWJsb2NrLkxibG9jayA9IDM7XG5cbiAgICAgICAgaWYgKGNvZGVibG9jay50YngxXyA8PSBjb2RlYmxvY2sudGJ4MF8gfHxcbiAgICAgICAgICAgIGNvZGVibG9jay50YnkxXyA8PSBjb2RlYmxvY2sudGJ5MF8pIHtcbiAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuICAgICAgICBjb2RlYmxvY2tzLnB1c2goY29kZWJsb2NrKTtcbiAgICAgICAgLy8gYnVpbGRpbmcgcHJlY2luY3QgZm9yIHRoZSBzdWItYmFuZFxuICAgICAgICB2YXIgcHJlY2luY3QgPSBwcmVjaW5jdHNbcHJlY2luY3ROdW1iZXJdO1xuICAgICAgICBpZiAocHJlY2luY3QgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgIGlmIChpIDwgcHJlY2luY3QuY2J4TWluKSB7XG4gICAgICAgICAgICBwcmVjaW5jdC5jYnhNaW4gPSBpO1xuICAgICAgICAgIH0gZWxzZSBpZiAoaSA+IHByZWNpbmN0LmNieE1heCkge1xuICAgICAgICAgICAgcHJlY2luY3QuY2J4TWF4ID0gaTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGogPCBwcmVjaW5jdC5jYnlNaW4pIHtcbiAgICAgICAgICAgIHByZWNpbmN0LmNieE1pbiA9IGo7XG4gICAgICAgICAgfSBlbHNlIGlmIChqID4gcHJlY2luY3QuY2J5TWF4KSB7XG4gICAgICAgICAgICBwcmVjaW5jdC5jYnlNYXggPSBqO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBwcmVjaW5jdHNbcHJlY2luY3ROdW1iZXJdID0gcHJlY2luY3QgPSB7XG4gICAgICAgICAgICBjYnhNaW46IGksXG4gICAgICAgICAgICBjYnlNaW46IGosXG4gICAgICAgICAgICB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ICAgIH1cblxuICAgIHZhciBsID0gMCwgciA9IDAsIGkgPSAwLCBrID0gMDtcblxuICAgIHRoaXMubmV4dFBhY2tldCA9IGZ1bmN0aW9uIEpweEltYWdlX25leHRQYWNrZXQoKSB7XG4gICAgICAvLyBTZWN0aW9uIEIuMTIuMS4xIExheWVyLXJlc29sdXRpb24tY29tcG9uZW50LXBvc2l0aW9uXG4gICAgICBmb3IgKDsgbCA8IGxheWVyc0NvdW50OyBsKyspIHtcbiAgICAgICAgZm9yICg7IHIgPD0gbWF4RGVjb21wb3NpdGlvbkxldmVsc0NvdW50OyByKyspIHtcbiAgICAgICAgICBmb3IgKDsgaSA8IGNvbXBvbmVudHNDb3VudDsgaSsrKSB7XG4gICAgICAgICAgICB2YXIgY29tcG9uZW50ID0gdGlsZS5jb21wb25lbnRzW2ldO1xuICAgICAgICAgICAgaWYgKHIgPiBjb21wb25lbnQuY29kaW5nU3R5bGVQYXJhbWV0ZXJzLmRlY29tcG9zaXRpb25MZXZlbHNDb3VudCkge1xuICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFyIHJlc29sdXRpb24gPSBjb21wb25lbnQucmVzb2x1dGlvbnNbcl07XG4gICAgICAgICAgICB2YXIgbnVtcHJlY2luY3RzID0gcmVzb2x1dGlvbi5wcmVjaW5jdFBhcmFtZXRlcnMubnVtcHJlY2luY3RzO1xuICAgICAgICAgICAgZm9yICg7IGsgPCBudW1wcmVjaW5jdHM7KSB7XG4gICAgICAgICAgICAgIHZhciBwYWNrZXQgPSBjcmVhdGVQYWNrZXQocmVzb2x1dGlvbiwgaywgbCk7XG4gICAgICAgICAgICAgIGsrKztcbiAgICAgICAgICAgICAgcmV0dXJuIHBhY2tldDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGsgPSAwO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpID0gMDtcbiAgICAgICAgfVxuICAgICAgICByID0gMDtcbiAgICAgIH1cbiA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mVudHNDb3VudDsgaSsrKSB7XG4gICAgICAgICAgICB2YXIgY29tcG9uZW50ID0gdGlsZS5jb21wb25lbnRzW2ldO1xuICAgICAgICAgICAgaWYgKHIgPiBjb21wb25lbnQuY29kaW5nU3R5bGVQYXJhbWV0ZXJzLmRlY29tcG9zaXRpb25MZXZlbHNDb3VudCkge1xuICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFyIHJlc29sdXRpb24gPSBjb21wb25lbnQucmVzb2x1dGlvbnNbcl07XG4gICAgICAgICAgICB2YXIgbnVtcHJlY2luY3RzID0gcmVzb2x1dGlvbi5wcmVjaW5jdFBhcmFtZXRlcnMubnVtcHJlY2luY3RzO1xuICAgICAgICAgICAgZm9yICg7IGsgPCBudW1wcmVjaW5jdHM7KSB7XG4gICAgICAgICAgICAgIHZhciBwYWNrZXQgPSBjcmVhdGVQYWNrZXQocmVzb2x1dGlvbiwgaywgbCk7XG4gICAgICAgICAgICAgIGsrKztcbiAgICAgICAgICAgICAgcmV0dXJuIHBhY2tldDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGsgPSAwO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpID0gMDtcbiAgICAgICAgfVxuICAgICAgICBsID0gMDtcbiAgICAgIH1cbiAgICB9O1xuICB9XG4gIGZ1bmN0aW9uIFJlc29sdXRpb25Qb3NpdGlvbkNvbXBvbmVudExheWVySXRlcmF0b3IoY29udGV4dCkge1xuICAgIHZhciBzaXogPSBjb250ZXh0LlNJWjtcbiAgICB2YXIgdGlsZUluZGV4ID0gY29udGV4dC5jdXJyZW50VGlsZS5pbmRleDtcbiAgICB2YXIgdGlsZSA9IGNvbnRleHQudGlsZXNbdGlsZUluZGV4XTtcbiAgICB2YXIgbGF5ZXJzQ291bnQgPSB0aWxlLmNvZGluZ1N0eWxlRGVmYXVsdFBhcmFtZXRlcnMubGF5ZXJzQ291bnQ7XG4gICAgdmFyIGNvbXBvbmVudHNDb3VudCA9IHNpei5Dc2l6O1xuICAgIHZhciBsLCByLCBjLCBwO1xuICAgIHZhciBtYXhEZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQgPSAwO1xuICAgIGZvciAoYyA9IDA7IGMgPCBjb21wb25lbnRzQ291bnQ7IGMrKykge1xuICAgICAgdmFyIGNvbXBvbmVudCA9IHRpbGUuY29tcG9uZW50c1tjXTtcbiAgICAgIG1heERlY29tcG9zaXRpb25MZXZlbHNDb3VudCA9IE1hdGgubWF4KG1heERlY29tcG9zaXRpb25MZXZlbHNDb3VudCxcbiAgICAgICAgY29tcG9uZW50LmNvZGluZ1N0eWxlUGFyYW1ldGVycy5kZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQpO1xuICAgIH1cbiAgICB2YXIgbWF4TnVtUHJlY2luY3RzSW5MZXZlbCA9IG5ldyBJbnQzMkFycmF5KFxuICAgICAgbWF4RGVjb21wb3NpdGlvbkxldmVsc0NvdW50ICsgMSk7XG4gICAgZm9yIChyID0gMDsgciA8PSBtYXhEZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQ7ICsrcikge1xuICAgICAgdmFyIG1heE51bVByZWNpbmN0cyA9IDA7XG4gICAgICBmb3IgKGMgPSAwOyBjIDwgY29tcG9uZW50c0NvdW50OyArK2MpIHtcbiAgICAgICAgdmFyIHJlc29sdXRpb25zID0gdGlsZS5jb21wb25lbnRzW2NdLnJlc29sdXRpb25zO1xuICAgICAgICBpZiAociA8IHJlc29sdXRpb25zLmxlbmd0aCkge1xuICAgICAgICAgIG1heE51bVByZWNpbmN0cyA9IE1hdGgubWF4KG1heE51bVByZWNpbmN0cyxcbiAgICAgICAgICAgIHJlc29sdXRpb25zW3JdLnByZWNpbmN0UGFyYW1ldGVycy5udW1wcmVjaW5jdHMpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBtYXhOdW1QcmVjaW5jdHNJbkxldmVsW3JdID0gbWF4TnVtUHJlY2luY3RzO1xuICAgIH1cbiAgICBsID0gMDtcbiAgICByID0gMDtcbiAgICBjID0gMDtcbiAgICBwID0gMDtcblxuICAgIHRoaXMubmV4dFBhY2tldCA9IGZ1bmN0aW9uIEpweEltYWdlX25leHRQYWNrZXQoKSB7XG4gICAgICAvLyBTZWN0aW9uIEIuMTIuMS4zIFJlc29sdXRpb24tcG9zaXRpb24tY29tcG9uZW50LWxheWVyXG4gICAgICBmb3IgKDsgciA8PSBtYXhEZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQ7IHIrKykge1xuICAgICAgICBmb3IgKDsgcCA8IG1heE51bVByZWNpbmN0c0luTGV2ZWxbcl07IHArKykge1xuICAgICAgICAgIGZvciAoOyBjIDwgY29tcG9uZW50c0NvdW50OyBjKyspIHtcbiAgICAgICAgICAgIHZhciBjb21wb25lbnQgPSB0aWxlLmNvbXBvbmVudHNbY107XG4gICAgICAgICAgICBpZiAociA+IGNvbXBvbmVudC5jb2RpbmdTdHlsZVBhcmFtZXRlcnMuZGVjb21wb3NpdGlvbkxldmVsc0NvdW50KSB7XG4gICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIHJlc29sdXRpb24gPSBjb21wb25lbnQucmVzb2x1dGlvbnNbcl07XG4gICAgICAgICAgICB2YXIgbnVtcHJlY2luY3RzID0gcmVzb2x1dGlvbi5wcmVjaW5jdFBhcmFtZXRlcnMubnVtcHJlY2luY3RzO1xuICAgICAgICAgICAgaWYgKHAgPj0gbnVtcHJlY2luY3RzKSB7XG4gICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZm9yICg7IGwgPCBsYXllcnNDb3VudDspIHtcbiAgICAgICAgICAgICAgdmFyIHBhY2tldCA9IGNyZWF0ZVBhY2tldChyZXNvbHV0aW9uLCBwLCBsKTtcbiAgICAgICAgICAgICAgbCsrO1xuICAgICAgICAgICAgICByZXR1cm4gcGFja2V0O1xuICAgICAgICAgICAgfVxuIC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rKykge1xuICAgICAgICAgICAgdmFyIGNvbXBvbmVudCA9IHRpbGUuY29tcG9uZW50c1tjXTtcbiAgICAgICAgICAgIHZhciBkZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQgPVxuICAgICAgICAgICAgICBjb21wb25lbnQuY29kaW5nU3R5bGVQYXJhbWV0ZXJzLmRlY29tcG9zaXRpb25MZXZlbHNDb3VudDtcbiAgICAgICAgICAgIGZvciAoOyByIDw9IGRlY29tcG9zaXRpb25MZXZlbHNDb3VudDsgcisrKSB7XG4gICAgICAgICAgICAgIHZhciByZXNvbHV0aW9uID0gY29tcG9uZW50LnJlc29sdXRpb25zW3JdO1xuICAgICAgICAgICAgICB2YXIgc2l6ZUluSW1hZ2VTY2FsZSA9XG4gICAgICAgICAgICAgICAgcHJlY2luY3RzU2l6ZXMuY29tcG9uZW50c1tjXS5yZXNvbHV0aW9uc1tyXTtcbiAgICAgICAgICAgICAgdmFyIGsgPSBnZXRQcmVjaW5jdEluZGV4SWZFeGlzdChcbiAgICAgICAgICAgICAgICBweCxcbiAgICAgICAgICAgICAgICBweSxcbiAgICAgICAgICAgICAgICBzaXplSW5JbWFnZVNjYWxlLFxuICAgICAgICAgICAgICAgIHByZWNpbmN0c0l0ZXJhdGlvblNpemVzLFxuICAgICAgICAgICAgICAgIHJlc29sdXRpb24pO1xuICAgICAgICAgICAgICBpZiAoayA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGZvciAoOyBsIDwgbGF5ZXJzQ291bnQ7KSB7XG4gICAgICAgICAgICAgICAgdmFyIHBhY2tldCA9IGNyZWF0ZVBhY2tldChyZXNvbHV0aW9uLCBrLCBsKTtcbiAgICAgICAgICAgICAgICBsKys7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhY2tldDtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBsID0gMDtcbiAgICAgICAgICAgIH1cbiAg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ZVBhcmFtZXRlcnMuZGVjb21wb3NpdGlvbkxldmVsc0NvdW50O1xuICAgICAgICBmb3IgKDsgcHkgPCBwcmVjaW5jdHNJdGVyYXRpb25TaXplcy5tYXhOdW1IaWdoOyBweSsrKSB7XG4gICAgICAgICAgZm9yICg7IHB4IDwgcHJlY2luY3RzSXRlcmF0aW9uU2l6ZXMubWF4TnVtV2lkZTsgcHgrKykge1xuICAgICAgICAgICAgZm9yICg7IHIgPD0gZGVjb21wb3NpdGlvbkxldmVsc0NvdW50OyByKyspIHtcbiAgICAgICAgICAgICAgdmFyIHJlc29sdXRpb24gPSBjb21wb25lbnQucmVzb2x1dGlvbnNbcl07XG4gICAgICAgICAgICAgIHZhciBzaXplSW5JbWFnZVNjYWxlID0gcHJlY2luY3RzSXRlcmF0aW9uU2l6ZXMucmVzb2x1dGlvbnNbcl07XG4gICAgICAgICAgICAgIHZhciBrID0gZ2V0UHJlY2luY3RJbmRleElmRXhpc3QoXG4gICAgICAgICAgICAgICAgcHgsXG4gICAgICAgICAgICAgICAgcHksXG4gICAgICAgICAgICAgICAgc2l6ZUluSW1hZ2VTY2FsZSxcbiAgICAgICAgICAgICAgICBwcmVjaW5jdHNJdGVyYXRpb25TaXplcyxcbiAgICAgICAgICAgICAgICByZXNvbHV0aW9uKTtcbiAgICAgICAgICAgICAgaWYgKGsgPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBmb3IgKDsgbCA8IGxheWVyc0NvdW50Oykge1xuICAgICAgICAgICAgICAgIHZhciBwYWNrZXQgPSBjcmVhdGVQYWNrZXQocmVzb2x1dGlvbiwgaywgbCk7XG4gICAgICAgICAgICAgICAgbCsrO1xuICAgICAgICAgICAgICAgIHJldHVybiBwYWNrZXQ7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgbCA9IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByID0gMDtcbiAgICAg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pO1xuICAgICAgICByZXNvbHV0aW9uLnJlc0xldmVsID0gcjtcbiAgICAgICAgYnVpbGRQcmVjaW5jdHMoY29udGV4dCwgcmVzb2x1dGlvbiwgYmxvY2tzRGltZW5zaW9ucyk7XG4gICAgICAgIHJlc29sdXRpb25zLnB1c2gocmVzb2x1dGlvbik7XG5cbiAgICAgICAgdmFyIHN1YmJhbmQ7XG4gICAgICAgIGlmIChyID09PSAwKSB7XG4gICAgICAgICAgLy8gb25lIHN1Yi1iYW5kIChMTCkgd2l0aCBsYXN0IGRlY29tcG9zaXRpb25cbiAgICAgICAgICBzdWJiYW5kID0ge307XG4gICAgICAgICAgc3ViYmFuZC50eXBlID0gJ0xMJztcbiAgICAgICAgICBzdWJiYW5kLnRieDAgPSBNYXRoLmNlaWwoY29tcG9uZW50LnRjeDAgLyBzY2FsZSk7XG4gICAgICAgICAgc3ViYmFuZC50YnkwID0gTWF0aC5jZWlsKGNvbXBvbmVudC50Y3kwIC8gc2NhbGUpO1xuICAgICAgICAgIHN1YmJhbmQudGJ4MSA9IE1hdGguY2VpbChjb21wb25lbnQudGN4MSAvIHNjYWxlKTtcbiAgICAgICAgICBzdWJiYW5kLnRieTEgPSBNYXRoLmNlaWwoY29tcG9uZW50LnRjeTEgLyBzY2FsZSk7XG4gICAgICAgICAgc3ViYmFuZC5yZXNvbHV0aW9uID0gcmVzb2x1dGlvbjtcbiAgICAgICAgICBidWlsZENvZGVibG9ja3MoY29udGV4dCwgc3ViYmFuZCwgYmxvY2tzRGltZW5zaW9ucyk7XG4gICAgICAgICAgc3ViYmFuZHMucHVzaChzdWJiYW5kKTtcbiAgICAgICAgICByZXNvbHV0aW9uLnN1YmJhbmRzID0gW3N1YmJhbmRdO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHZhciBic2NhbGUgPSAxIDw8IChkZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQgLSByICsgMSk7XG4gICAgICAgICAgdmFyIHJlc29sdXRpb25TdWJiYW5k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gICAgICAgfVxuICAgICAgfVxuICAgICAgY29tcG9uZW50LnJlc29sdXRpb25zID0gcmVzb2x1dGlvbnM7XG4gICAgICBjb21wb25lbnQuc3ViYmFuZHMgPSBzdWJiYW5kcztcbiAgICB9XG4gICAgLy8gR2VuZXJhdGUgdGhlIHBhY2tldHMgc2VxdWVuY2VcbiAgICB2YXIgcHJvZ3Jlc3Npb25PcmRlciA9IHRpbGUuY29kaW5nU3R5bGVEZWZhdWx0UGFyYW1ldGVycy5wcm9ncmVzc2lvbk9yZGVyO1xuICAgIHN3aXRjaCAocHJvZ3Jlc3Npb25PcmRlcikge1xuICAgICAgY2FzZSAwOlxuICAgICAgICB0aWxlLnBhY2tldHNJdGVyYXRvciA9XG4gICAgICAgICAgbmV3IExheWVyUmVzb2x1dGlvbkNvbXBvbmVudFBvc2l0aW9uSXRlcmF0b3IoY29udGV4dCk7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAxOlxuICAgICAgICB0aWxlLnBhY2tldHNJdGVyYXRvciA9XG4gICAgICAgICAgbmV3IFJlc29sdXRpb25MYXllckNvbXBvbmVudFBvc2l0aW9uSXRlcmF0b3IoY29udGV4dCk7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAyOlxuICAgICAgICB0aWxlLnBhY2tldHNJdGVyYXRvciA9XG4gICAgICAgICAgbmV3IFJlc29sdXRpb25Qb3NpdGlvbkNvbXBvbmVudExheWVySXRlcmF0b3IoY29udGV4dCk7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAzOlxuICAgICAgICB0aWxlLnBhY2tldHNJdGVyYXRvciA9XG4gICAgICAgICAgbmV3IFBvc2l0aW9uQ29tcG9uZW50UmVzb2x1dGlvbkxheWVySXRlcmF0b3IoY29udGV4dCk7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSA0OlxuICAgICAgICB0aWxlLnBhY2tldHNJdGVyYXRvciA9XG4gICAgICAgICAgbmV3IENvbXBvbmVudFBvc2l0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09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAvL05vIG1vcmUgcGFja2V0cy4gU3RyZWFtIGlzIHByb2JhYmx5IHRydW5jYXRlZC5cbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFyZWFkQml0cygxKSkge1xuICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG4gICAgICAgIHZhciBsYXllck51bWJlciA9IHBhY2tldC5sYXllck51bWJlcjtcbiAgICAgICAgdmFyIHF1ZXVlID0gW10sIGNvZGVibG9jaztcbiAgICAgICAgZm9yICh2YXIgaSA9IDAsIGlpID0gcGFja2V0LmNvZGVibG9ja3MubGVuZ3RoOyBpIDwgaWk7IGkrKykge1xuICAgICAgICAgIGNvZGVibG9jayA9IHBhY2tldC5jb2RlYmxvY2tzW2ldO1xuICAgICAgICAgIHZhciBwcmVjaW5jdCA9IGNvZGVibG9jay5wcmVjaW5jdDtcbiAgICAgICAgICB2YXIgY29kZWJsb2NrQ29sdW1uID0gY29kZWJsb2NrLmNieCAtIHByZWNpbmN0LmNieE1pbjtcbiAgICAgICAgICB2YXIgY29kZWJsb2NrUm93ID0gY29kZWJsb2NrLmNieSAtIHByZWNpbmN0LmNieU1pbjtcbiAgICAgICAgICB2YXIgY29kZWJsb2NrSW5jbHVkZWQgPSBmYWxzZTtcbiAgICAgICAgICB2YXIgZmlyc3RUaW1lSW5jbHVzaW9uID0gZmFsc2U7XG4gICAgICAgICAgdmFyIHZhbHVlUmVhZHk7XG4gICAgICAgICAgaWYgKGNvZGVibG9ja1snaW5jbHVkZWQnXSAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICBjb2RlYmxvY2tJbmNsdWRlZCA9ICEhcmVhZEJpdHMoMSk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIC8vIHJlYWRpbmcgaW5jbHVzaW9uIHRyZWVcbiAgICAgICAgICAgIHByZWNpbmN0ID0gY29kZWJsb2NrLnByZWNpbmN0O1xuICAgICAgICAgICAgdmFyIGluY2x1c2lvblRyZWUsIHplcm9CaXRQbGFuZXNUcmVlO1xuICAgICAgICAgICAgaWYgKHByZWNpbmN0WydpbmNsdXNpb25UcmVlJ10gIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICBpbmNsdXNpb25UcmVlID0gcHJlY2luY3QuaW5jbHVzaW9uVHJlZTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIC8vIGJ1aWxkaW5nIGluY2x1c2lvbiBhbmQgemVybyBiaXQtcGxhbmVzIHRyZWVzXG4gICAgICAgICAgICAgIHZhciB3aWR0aCA9IHByZWNpbmN0LmNieE1heCAtIHByZWNpbmN0LmNieE1pbiArIDE7XG4gICAgICAgICAgICAgIHZhciBoZWlnaHQgPSBwcmVjaW5jdC5jYnlNYXggLSBwcmVjaW5jdC5jYnlNaW4gKyAxO1xuICAgICAgICAgICAgICBpbmNsdXNpb25UcmVlID0gbmV3IEluY2x1c2lvblRyZWUod2lkdGgsIGhlaWdodCk7XG4gICAgICAgICAgICAgIHplcm9CaXRQbGFuZXNUcmVlID0gbmV3IFRhZ1RyZWUod2lkdGgsIGhlaWdodCk7XG4gICAgICAgICAgICAgIHByZWNpbmN0LmluY2x1c2lvblRyZWUgPSBpbmNsdXNpb25UcmVlO1xuICAgICAgICAgICAgICBwcmVjaW5jdC56ZXJvQml0UGxhbmVzVHJlZSA9IHplcm9CaXRQbGFuZXNUcmVlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpbmNsdXNpb25UcmVlLnJlc2V0KGNvZGVibG9ja0NvbHVtbiwgY29kZWJsb2NrUm93LCBsYXllck51bWJlcik7XG4gICAgICAgICAgICB3aGlsZSAodHJ1ZSkge1xuICAgICAgICAgICAgICBpZiAocG9zaXRpb24gPj0gZGF0YS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKGluY2x1c2lvblRyZWUuaXNBYm92ZVRocmVzaG9sZCgpKXtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAoaW5jbHVzaW9uVHJlZS5pc0tub3duKCkpIHtcbiAgICAgICAgICAgICAgICBpbmNsdXNpb25UcmVlLm5leHRMZXZlbCgpO1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChyZWFkQml0cygxKSkge1xuICAgICAgICAgICAgICAgIGluY2x1c2lvblRyZWUuc2V0S25vd24oKTtcbiAgICAgICAgICAgICAgICBpZiAoaW5jbHVzaW9uVHJlZS5pc0xlYWYoKSkge1xuICAgICAgICAgICAgICAgICAgY29kZWJsb2NrLmluY2x1ZGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgIGNvZGVibG9ja0luY2x1ZGVkID0gZmlyc3RUaW1lSW5jbHVzaW9uID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICBpbmNsdXNpb25UcmVlLm5leHRMZXZlbCgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpbmNsdXNpb25UcmVlLmluY3JlbWVudFZhbHVlKCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKCFjb2RlYmxvY2tJbmNsdWRlZCkge1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChmaXJzdFRpbWVJbmNsdXNpb24pIHtcbiAgICAgICAgICAgIHplcm9CaXRQbGFuZXNUcmVlID0gcHJlY2luY3QuemVyb0JpdFBsYW5lc1RyZWU7XG4gICAgICAgICAgICB6ZXJvQml0UGxhbmVzVHJlZS5yZXNldChjb2RlYmxvY2tDb2x1bW4sIGNvZGVibG9ja1Jvdyk7XG4gICAgICAgICAgICB3aGlsZSAodHJ1ZSkge1xuICAgICAgICAgICAgICBpZiAocG9zaXRpb24gPj0gZGF0YS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKHJlYWRCaXRzKDEpKSB7XG4gICAgICAgICAgICAgICAgdmFsdWVSZWFkeSA9ICF6ZXJvQml0UGxhbmVzVHJlZS5uZXh0TGV2ZWwoKTtcbiAgICAgICAgICAgICAgICBpZiAodmFsdWVSZWFkeSkge1xuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHplcm9CaXRQbGFuZXNUcmVlLmluY3JlbWVudFZhbHVlKCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNvZGVibG9jay56ZXJvQml0UGxhbmVzID0gemVyb0JpdFBsYW5lc1RyZWUudmFsdWU7XG4gICAgICAgICAgfVxuICAgICAgICAgIHZhciBjb2RpbmdwYXNzZXMgPSByZWFkQ29kaW5ncGFzc2VzKCk7XG4gICAgICAgICAgd2hpbGUgKHJlYWRCaXRzKDEpKSB7XG4gICAgICAgICAgICBjb2RlYmxvY2suTGJsb2NrKys7XG4gICAgICAgICAgfVxuICAgICAgICAgIHZhciBjb2RpbmdwYXNzZXNMb2cyID0gbG9nMihjb2RpbmdwYXNzZXMpO1xuICAgICAgICAgIC8vIHJvdW5kaW5nIGRvd24gbG9nMlxuICAgICAgICAgIHZhciBiaXRzID0gKChjb2RpbmdwYXNzZXMgPCAoMSA8PCBjb2RpbmdwYXNzZXNMb2cyKSkgP1xuICAgICAgICAgICAgICAgICAgICAgIGNvZGluZ3Bhc3Nlc0xvZzIgLSAxIDogY29kaW5ncGF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ICogZGVsdGE7XG4gICAgICAgICAgICBpZiAoc2lnbltwb3NpdGlvbl0gIT09IDApIHtcbiAgICAgICAgICAgICAgbiA9IC1uO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbmIgPSBiaXRzRGVjb2RlZFtwb3NpdGlvbl07XG4gICAgICAgICAgICB2YXIgcG9zID0gaW50ZXJsZWF2ZSA/IChsZXZlbE9mZnNldCArIChvZmZzZXQgPDwgMSkpIDogb2Zmc2V0O1xuICAgICAgICAgICAgaWYgKHJldmVyc2libGUgJiYgKG5iID49IG1iKSkge1xuICAgICAgICAgICAgICBjb2VmZmljaWVudHNbcG9zXSA9IG47XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBjb2VmZmljaWVudHNbcG9zXSA9IG4gKiAoMSA8PCAobWIgLSBuYikpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBvZmZzZXQrKztcbiAgICAgICAgICBwb3NpdGlvbisrO1xuICAgICAgICB9XG4gICAgICAgIG9mZnNldCArPSB3aWR0aCAtIGJsb2NrV2lkdGg7XG4gICAgICB9XG4gICAgfVxuICB9XG4gIGZ1bmN0aW9uIHRyYW5zZm9ybVRpbGUoY29udGV4dCwgdGlsZSwgYykge1xuICAgIHZhciBjb21wb25lbnQgPSB0aWxlLmNvbXBvbmVudHNbY107XG4gICAgdmFyIGNvZGluZ1N0eWxlUGFyYW1ldGVycyA9IGNvbXBvbmVudC5jb2RpbmdTdHlsZVBhcmFtZXRlcnM7XG4gICAgdmFyIHF1YW50aXphdGlvblBhcmFtZXRlcnMgPSBjb21wb25lbnQucXVhbnRpemF0aW9uUGFyYW1ldGVycztcbiAgICB2YXIgZGVjb21wb3NpdGlvbkxldmVsc0NvdW50ID1cbiAgICAgIGNvZGluZ1N0eWxlUGFyYW1ldGVycy5kZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQ7XG4gICAgdmFyIHNwcWNkcyA9IHF1YW50aXphdGlvblBhcmF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g7XG4gICAgICAgIG9mZnNldCA9ICgxMjggPDwgc2hpZnQpICsgMC41O1xuICAgICAgICBtYXggPSAyNTUgKiAoMSA8PCBzaGlmdCk7XG4gICAgICAgIG1heEsgPSBtYXggKiAwLjU7XG4gICAgICAgIG1pbiA9IC1tYXhLO1xuXG4gICAgICAgIHZhciBjb21wb25lbnQwID0gdGlsZS5jb21wb25lbnRzWzBdO1xuICAgICAgICB2YXIgYWxwaGEwMSA9IGNvbXBvbmVudHNDb3VudCAtIDM7XG4gICAgICAgIGpqID0geTBpdGVtcy5sZW5ndGg7XG4gICAgICAgIGlmICghY29tcG9uZW50MC5jb2RpbmdTdHlsZVBhcmFtZXRlcnMucmV2ZXJzaWJsZVRyYW5zZm9ybWF0aW9uKSB7XG4gICAgICAgICAgLy8gaW52ZXJzZSBpcnJldmVyc2libGUgbXVsdGlwbGUgY29tcG9uZW50IHRyYW5zZm9ybVxuICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBqajsgaisrLCBwb3MgKz0gYWxwaGEwMSkge1xuICAgICAgICAgICAgeTAgPSB5MGl0ZW1zW2pdICsgb2Zmc2V0O1xuICAgICAgICAgICAgeTEgPSB5MWl0ZW1zW2pdO1xuICAgICAgICAgICAgeTIgPSB5Mml0ZW1zW2pdO1xuICAgICAgICAgICAgciA9IHkwICsgMS40MDIgKiB5MjtcbiAgICAgICAgICAgIGcgPSB5MCAtIDAuMzQ0MTMgKiB5MSAtIDAuNzE0MTQgKiB5MjtcbiAgICAgICAgICAgIGIgPSB5MCArIDEuNzcyICogeTE7XG4gICAgICAgICAgICBvdXRbcG9zKytdID0gciA8PSAwID8gMCA6IHIgPj0gbWF4ID8gMjU1IDogciA+PiBzaGlmdDtcbiAgICAgICAgICAgIG91dFtwb3MrK10gPSBnIDw9IDAgPyAwIDogZyA+PSBtYXggPyAyNTUgOiBnID4+IHNoaWZ0O1xuICAgICAgICAgICAgb3V0W3BvcysrXSA9IGIgPD0gMCA/IDAgOiBiID49IG1heCA/IDI1NSA6IGIgPj4gc2hpZnQ7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vIGludmVyc2UgcmV2ZXJzaWJsZSBtdWx0aXBsZSBjb21wb25lbnQgdHJhbnNmb3JtXG4gICAgICAgICAgZm9yIChqID0gMDsgaiA8IGpqOyBqKyssIHBvcyArPSBhbHBoYTAxKSB7XG4gICAgICAgICAgICB5MCA9IHkwaXRlbXNbal0gKyBvZmZzZXQ7XG4gICAgICAgICAgICB5MSA9IHkxaXRlbXNbal07XG4gICAgICAgICAgICB5MiA9IHkyaXRlbXNbal07XG4gICAgICAgICAgICBnID0geTAgLSAoKHkyICsgeTEpID4+IDIpO1xuICAgICAgICAgICAgciA9IGcgKyB5MjtcbiAgICAgICAgICAgIGIgPSBnICsgeTE7XG4gICAgICAgICAgICBvdXRbcG9zKytdID0gciA8PSAwID8gMCA6IHIgPj0gbWF4ID8gMjU1IDogciA+PiBzaGlmdDtcbiAgICAgICAgICAgIG91dFtwb3MrK10gPSBnIDw9IDAgPyAwIDogZyA+PSBtYXggPyAyNTUgOiBnID4+IHNoaWZ0O1xuICAgICAgICAgICAgb3V0W3BvcysrXSA9IGIgPD0gMCA/IDAgOiBiID49IG1heCA/IDI1NSA6IGIgPj4gc2hpZnQ7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChmb3VyQ29tcG9uZW50cykge1xuICAgICAgICAgIGZvciAoaiA9IDAsIHBvcyA9IDM7IGogPCBqajsgaisrLCBwb3MgKz0gNCkge1xuICAgICAgICAgICAgayA9IHkzaXRlbXNbal07XG4gICAgICAgICAgICBvdXRbcG9zXSA9IGsgPD0gbWluID8gMCA6IGsgPj0gbWF4SyA/IDI1NSA6IChrICsgb2Zmc2V0KSA+PiBzaGlmdDtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7IC8vIG5vIG11bHRpLWNvbXBvbmVudCB0cmFuc2Zvcm1cbiAgICAgICAgZm9yIChjID0gMDsgYyA8IGNvbXBvbmVudHNDb3VudDsgYysrKSB7XG4gICAgICAgICAgaWYgKGNvbXBvbmVudHNbY10ucHJlY2lzaW9uID09PSA4KXtcbiAgICAgICAgICAgIHZhciBpdGVtcyA9IHRyYW5zZm9ybWVkVGlsZXNbY10uaXRlbXM7XG4gICAgICAgICAgICBzaGlmdCA9IGNvbXBvbmVudHNbY10ucHJlY2lzaW9uIC0gODtcbiAgICAgICAgICAgIG9mZnNldCA9ICgxMjggPDwgc2hpZnQpICsgMC41O1xuICAgICAgICAgICAgbWF4ID0gKDEyNy41ICogKDEgPDwgc2hpZnQpKTtcbiAgICAgICAgICAgIG1pbiA9IC1tYXg7XG4gICAgICAgICAgICBmb3IgKHBvcyA9IGMsIGogPSAwLCBqaiA9IGl0ZW1zLmxlbmd0aDsgaiA8IGpqOyBqKyspIHtcbiAgICAgICAgICAgICAgdmFsID0gaXRlbXNbal07XG4gICAgICAgICAgICAgIG91dFtwb3NdID0gdmFsIDw9IG1pbiA/IDAgOlxuICAgICAgICAgICAgICAgICAgICAgICAgIHZhbCA+PSBtYXggPyAyNTUgOiAodmFsICsgb2Zmc2V0KSA+PiBzaGlmdDtcbiAgICAgICAgICAgICAgcG9zICs9IGNvbXBvbmVudHNDb3VudDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9ZWxzZXtcbiAgICAgICAgICAgIHZhciBpc1NpZ25lZCA9IGNvbXBvbmVudHNbY10uaXNTaWduZWQ7XG4gICAgICAgICAgICB2YXIgaXRlbXMgPSB0cmFuc2Zvcm1lZFRpbGVzW2NdLml0ZW1zO1xuXG4gICAgICAgICAgICBpZihpc1NpZ25lZCl7XG4gICAgICAgICAgICAgIGZvciAocG9zID0gYywgaiA9IDAsIGpqID0gaXRlbXMubGVuZ3RoOyBqIDwgamo7IGorKykge1xuICAgICAgICAgICAgICAgIG91dFtwb3NdID0gaXRlbXNbal07XG4gICAgICAgICAgICAgICAgcG9zICs9IGNvbXBvbmVudHNDb3VudDtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfWVsc2V7XG4gICAgICAgICAgICAgIHNoaWZ0ID0gY29tcG9uZW50c1tjXS5wcmVjaXNpb24gLSA4O1xuICAgICAgICAgICAgICBvZmZzZXQgPSAoMTI4IDw8IHNoaWZ0KSArIDAuNTtcbiAgICAgICAgICAgICAgdmFyIHByZWNpc2lvbk1heCA9IE1hdGgucG93KDIsY29tcG9uZW50c1tjXS5wcmVjaXNpb24pLTE7XG4gICAgICAgICAgICAgIGZvciAocG9zID0gYywgaiA9IDAsIGpqID0gaXRlbXMubGVuZ3RoOyBqIDwgamo7IGorKykge1xuICAgICAgICAgICAgICAgIHZhbCA9IGl0ZW1zW2pdO1xuICAgICAgICAgICAgICAgIG91dFtwb3NdID0gTWF0aC5tYXgoTWF0aC5taW4oKHZhbCArIG9mZnNldCkscHJlY2lzaW9uTWF4KSwwKTtcbiAgICAgICAgICAgICAgICBwb3MgKz0gY29tcG9uZW50c0NvdW50O1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICByZXN1bHRJbWFnZXMucHVzaChyZXN1bHQpO1xuICAgIH1cbiAgICByZXR1cm4gcmVzdWx0SW1hZ2VzO1xuICB9XG4gIGZ1bmN0aW9uIGluaXRpYWxpemVUaWxlKGNvbnRleHQsIHRpbGVJbmRleCkge1xuICAgIHZhciBzaXogPSBjb250ZXh0LlNJWjtcbiAgICB2YXIgY29tcG9uZW50c0NvdW50ID0gc2l6LkNzaXo7XG4gICAgdmFyIHRpbGUgPSBjb250ZXh0LnRpbGVzW3RpbGVJbmRleF07XG4gICAgZm9yICh2YXIgYyA9IDA7IGMgPCBjb21wb25lbnRzQ291bnQ7IGMrKykge1xuICAgICAgdmFyIGNvbXBvbmVudCA9IHRpbGUuY29tcG9uZW50c1tjXTtcbiAgICAgIHZhciBxY2RPclFjYyA9IChjb250ZXh0LmN1cnJ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WR0aCAvIDIpO1xuICAgICAgICBoZWlnaHQgPSBNYXRoLmNlaWwoaGVpZ2h0IC8gMik7XG4gICAgICB9XG4gICAgfVxuICAgIFRhZ1RyZWUucHJvdG90eXBlID0ge1xuICAgICAgcmVzZXQ6IGZ1bmN0aW9uIFRhZ1RyZWVfcmVzZXQoaSwgaikge1xuICAgICAgICB2YXIgY3VycmVudExldmVsID0gMCwgdmFsdWUgPSAwLCBsZXZlbDtcbiAgICAgICAgd2hpbGUgKGN1cnJlbnRMZXZlbCA8IHRoaXMubGV2ZWxzLmxlbmd0aCkge1xuICAgICAgICAgIGxldmVsID0gdGhpcy5sZXZlbHNbY3VycmVudExldmVsXTtcbiAgICAgICAgICB2YXIgaW5kZXggPSBpICsgaiAqIGxldmVsLndpZHRoO1xuICAgICAgICAgIGlmIChsZXZlbC5pdGVtc1tpbmRleF0gIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgdmFsdWUgPSBsZXZlbC5pdGVtc1tpbmRleF07XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgICAgbGV2ZWwuaW5kZXggPSBpbmRleDtcbiAgICAgICAgICBpID4+PSAxO1xuICAgICAgICAgIGogPj49IDE7XG4gICAgICAgICAgY3VycmVudExldmVsKys7XG4gICAgICAgIH1cbiAgICAgICAgY3VycmVudExldmVsLS07XG4gICAgICAgIGxldmVsID0gdGhpcy5sZXZlbHNbY3VycmVudExldmVsXTtcbiAgICAgICAgbGV2ZWwuaXRlbXNbbGV2ZWwuaW5kZXhdID0gdmFsdWU7XG4gICAgICAgIHRoaXMuY3VycmVudExldmVsID0gY3VycmVudExldmVsO1xuICAgICAgICBkZWxldGUgdGhpcy52YWx1ZTtcbiAgICAgIH0sXG4gICAgICBpbmNyZW1lbnRWYWx1ZTogZnVuY3Rpb24gVGFnVHJlZV9pbmNyZW1lbnRWYWx1ZSgpIHtcbiAgICAgICAgdmFyIGxldmVsID0gdGhpcy5sZXZlbHNbdGhpcy5j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W50OEFycmF5KHdpZHRoICogaGVpZ2h0KTtcbiAgICAgICAgdmFyIHN0YXR1cyA9IG5ldyBVaW50OEFycmF5KHdpZHRoICogaGVpZ2h0KTtcbiAgICAgICAgZm9yICh2YXIgaiA9IDAsIGpqID0gaXRlbXMubGVuZ3RoOyBqIDwgamo7IGorKykge1xuICAgICAgICAgIGl0ZW1zW2pdID0gMDtcbiAgICAgICAgICBzdGF0dXNbal0gPSAwO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIGxldmVsID0ge1xuICAgICAgICAgIHdpZHRoOiB3aWR0aCxcbiAgICAgICAgICBoZWlnaHQ6IGhlaWdodCxcbiAgICAgICAgICBpdGVtczogaXRlbXMsXG4gICAgICAgICAgc3RhdHVzOiBzdGF0dXNcbiAgICAgICAgfTtcbiAgICAgICAgdGhpcy5sZXZlbHMucHVzaChsZXZlbCk7XG5cbiAgICAgICAgd2lkdGggPSBNYXRoLmNlaWwod2lkdGggLyAyKTtcbiAgICAgICAgaGVpZ2h0ID0gTWF0aC5jZWlsKGhlaWdodCAvIDIpO1xuICAgICAgfVxuICAgIH1cbiAgICBJbmNsdXNpb25UcmVlLnByb3RvdHlwZSA9IHtcbiAgICAgIHJlc2V0OiBmdW5jdGlvbiBJbmNsdXNpb25UcmVlX3Jlc2V0KGksIGosIHN0b3BWYWx1ZSkge1xuICAgICAgICB0aGlzLmN1cnJlbnRTdG9wVmFsdWUgPSBzdG9wVmFsdWU7XG4gICAgICAgIHZhciBjdXJyZW50TGV2ZWwgPSAwO1xuICAgICAgICB3aGlsZSAoY3VycmVudExldmVsIDwgdGhpcy5sZXZlbHMubGVuZ3RoKSB7XG4gICAgICAgICAgdmFyIGxldmVsID0gdGhpcy5sZXZlbHNbY3VycmVudExldmVsXTtcbiAgICAgICAgICB2YXIgaW5kZXggPSBpICsgaiAqIGxldmVsLndpZHRoO1xuICAgICAgICAgIGxldmVsLmluZGV4ID0gaW5kZXg7XG5cbiAgICAgICAgICBpID4+PSAxO1xuICAgICAgICAgIGogPj49IDE7XG4gICAgICAgICAgY3VycmVudExldmVsKys7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLmN1cnJlbnRMZXZlbCA9IHRoaXMubGV2ZWxzLmxlbmd0aCAtIDE7XG4gICAgICAgIHRoaXMubWluVmFsdWUgPXRoaXMubGV2ZWxzW3RoaXMuY3VycmVudExldmVsXS5pdGVtc1swXTtcbiAgICAgICAgcmV0dXJuO1xuICAgICAgfSxcbiAgICAgIGluY3JlbWVudFZhbHVlOiBmdW5jdGlvbiBJbmNsdXNpb25UcmVlX2luY3JlbWVudFZhbHVlKCkge1xuICAgICAgICB2YXIgbGV2ZWwgPSB0aGlzLmxldmVsc1t0aGlzLmN1cnJlbnRMZXZlbF07XG4gICAgICAgIGxldmVsLml0ZW1zW2xldmVsLmluZGV4XSA9IGxldmVsLml0ZW1zW2xldmVsLmluZGV4XSArIDE7XG4gICAgICAgIGlmKGxldmVsLml0ZW1zW2xldmVsLmluZGV4XSA+IHRoaXMubWluVmFsdWUpIHtcbiAgICAgICAgICB0aGlzLm1pblZhbHVlID0gbGV2ZWwuaXRlbXNbbGV2ZWwuaW5kZXhdO1xuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgbmV4dExldmVsOiBmdW5jdGlvbiBJbmNsdXNpb25UcmVlX25leHRMZXZlbCgpIHtcbiAgICAgICAgdmFyIGN1cnJlbnRMZXZlbCA9IHRoaXMuY3VycmVudExldmVsO1xuICAgICAgICBjdXJyZW50TGV2ZWwtLTtcbiAgICAgICAgaWYgKGN1cnJlbnRMZXZlbCA8IDApIHtcbiAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdGhpcy5jdXJyZW50TGV2ZWwgPSBjdXJyZW50TGV2ZWw7XG4gICAgICAgICAgdmFyIGxldmVsID0gdGhpcy5sZXZlbHNbY3VycmVudExldmVsXTtcbiAgICAgICAgICBpZihsZXZlbC5pdGVtc1tsZXZlbC5pb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IDogTExBbmRMSENvbnRleHRzTGFiZWwpKTtcblxuICAgICAgdmFyIGNvZWZmaWNpZW50Q291bnQgPSB3aWR0aCAqIGhlaWdodDtcblxuICAgICAgLy8gY29lZmZpY2llbnRzIG91dHNpZGUgdGhlIGVuY29kaW5nIHJlZ2lvbiB0cmVhdGVkIGFzIGluc2lnbmlmaWNhbnRcbiAgICAgIC8vIGFkZCBib3JkZXIgc3RhdGUgY2VsbHMgZm9yIHNpZ25pZmljYW5jZVN0YXRlXG4gICAgICB0aGlzLm5laWdoYm9yc1NpZ25pZmljYW5jZSA9IG5ldyBVaW50OEFycmF5KGNvZWZmaWNpZW50Q291bnQpO1xuICAgICAgdGhpcy5jb2VmZmljZW50c1NpZ24gPSBuZXcgVWludDhBcnJheShjb2VmZmljaWVudENvdW50KTtcbiAgICAgIHRoaXMuY29lZmZpY2VudHNNYWduaXR1ZGUgPSBtYiA+IDE0ID8gbmV3IFVpbnQzMkFycmF5KGNvZWZmaWNpZW50Q291bnQpIDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYiA+IDYgPyBuZXcgVWludDE2QXJyYXkoY29lZmZpY2llbnRDb3VudCkgOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBVaW50OEFycmF5KGNvZWZmaWNpZW50Q291bnQpO1xuICAgICAgdGhpcy5wcm9jZXNzaW5nRmxhZ3MgPSBuZXcgVWludDhBcnJheShjb2VmZmljaWVudENvdW50KTtcblxuICAgICAgdmFyIGJpdHNEZWNvZGVkID0gbmV3IFVpbnQ4QXJyYXkoY29lZmZpY2llbnRDb3VudCk7XG4gICAgICBpZiAoemVyb0JpdFBsYW5lcyAhPT0gMCkge1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGNvZWZmaWNpZW50Q291bnQ7IGkrKykge1xuICAgICAgICAgIGJpdHNEZWNvZGVkW2ldID0gemVyb0JpdFBsYW5lcztcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAg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UgPSB0aGlzLm5laWdoYm9yc1NpZ25pZmljYW5jZTtcbiAgICAgICAgdmFyIHdpZHRoID0gdGhpcy53aWR0aCwgaGVpZ2h0ID0gdGhpcy5oZWlnaHQ7XG4gICAgICAgIHZhciBsZWZ0ID0gKGNvbHVtbiA+IDApO1xuICAgICAgICB2YXIgcmlnaHQgPSAoY29sdW1uICsgMSA8IHdpZHRoKTtcbiAgICAgICAgdmFyIGk7XG5cbiAgICAgICAgaWYgKHJvdyA+IDApIHtcbiAgICAgICAgICBpID0gaW5kZXggLSB3aWR0aDtcbiAgICAgICAgICBpZiAobGVmdCkge1xuICAgICAgICAgICAgbmVpZ2hib3JzU2lnbmlmaWNhbmNlW2kgLSAxXSArPSAweDEwO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAocmlnaHQpIHtcbiAgICAgICAgICAgIG5laWdoYm9yc1NpZ25pZmljYW5jZVtpICsgMV0gKz0gMHgxMDtcbiAgICAgICAgICB9XG4gICAgICAgICAgbmVpZ2hib3JzU2lnbmlmaWNhbmNlW2ldICs9IDB4MDQ7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAocm93ICsgMSA8IGhlaWdodCkge1xuICAgICAgICAgIGkgPSBpbmRleCArIHdpZHRoO1xuICAgICAgICAgIGlmIChsZWZ0KSB7XG4gICAgICAgICAgICBuZWlnaGJvcnNTaWduaWZpY2FuY2VbaSAtIDFdICs9IDB4MTA7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChyaWdodCkge1xuICAgICAgICAgICAgbmVpZ2hib3JzU2lnbmlmaWNhbmNlW2kgKyAxXSArPSAweDEwO1xuICAgICAgICAgIH1cbiAgICAgICAgICBuZWlnaGJvcnNTaWduaWZpY2FuY2VbaV0gKz0gMHgwNDtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChsZWZ0KSB7XG4gICAgICAgICAgbmVpZ2hib3JzU2lnbmlmaWNhbmNlW2luZGV4IC0gMV0gKz0gMHgwMTtcbiAgICAgICAgfV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AwOyBpMCA8IGhlaWdodDsgaTAgKz0gNCkge1xuICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgd2lkdGg7IGorKykge1xuICAgICAgICAgICAgdmFyIGluZGV4ID0gaTAgKiB3aWR0aCArIGo7XG4gICAgICAgICAgICBmb3IgKHZhciBpMSA9IDA7IGkxIDwgNDsgaTErKywgaW5kZXggKz0gd2lkdGgpIHtcbiAgICAgICAgICAgICAgdmFyIGkgPSBpMCArIGkxO1xuICAgICAgICAgICAgICBpZiAoaSA+PSBoZWlnaHQpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAvLyBjbGVhciBwcm9jZXNzZWQgZmxhZyBmaXJzdFxuICAgICAgICAgICAgICBwcm9jZXNzaW5nRmxhZ3NbaW5kZXhdICY9IHByb2Nlc3NlZEludmVyc2VNYXNrO1xuXG4gICAgICAgICAgICAgIGlmIChjb2VmZmljZW50c01hZ25pdHVkZVtpbmRleF0gfHxcbiAgICAgICAgICAgICAgICAgICFuZWlnaGJvcnNTaWduaWZpY2FuY2VbaW5kZXhdKSB7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICB2YXIgY29udGV4dExhYmVsID0gbGFiZWxzW25laWdoYm9yc1NpZ25pZmljYW5jZVtpbmRleF1dO1xuICAgICAgICAgICAgICB2YXIgZGVjaXNpb24gPSBkZWNvZGVyLnJlYWRCaXQoY29udGV4dHMsIGNvbnRleHRMYWJlbCk7XG4gICAgICAgICAgICAgIGlmIChkZWNpc2lvbikge1xuICAgICAgICAgICAgICAgIHZhciBzaWduID0gdGhpcy5kZWNvZGVTaWduQml0KGksIGosIGluZGV4KTtcbiAgICAgICAgICAgICAgICBjb2VmZmljZW50c1NpZ25baW5kZXhdID0gc2lnbjtcbiAgICAgICAgICAgICAgICBjb2VmZmljZW50c01hZ25pdHVkZVtpbmRleF0gPSAxO1xuICAgICAgIC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aWNlbnRzU2lnbltpbmRleCArIDFdO1xuICAgICAgICAgIGlmIChzaWduaWZpY2FuY2UxKSB7XG4gICAgICAgICAgICBzaWduMCA9IGNvZWZmaWNlbnRzU2lnbltpbmRleCAtIDFdO1xuICAgICAgICAgICAgY29udHJpYnV0aW9uID0gMSAtIHNpZ24xIC0gc2lnbjA7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNvbnRyaWJ1dGlvbiA9IDEgLSBzaWduMSAtIHNpZ24xO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChzaWduaWZpY2FuY2UxKSB7XG4gICAgICAgICAgc2lnbjAgPSBjb2VmZmljZW50c1NpZ25baW5kZXggLSAxXTtcbiAgICAgICAgICBjb250cmlidXRpb24gPSAxIC0gc2lnbjAgLSBzaWduMDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBjb250cmlidXRpb24gPSAwO1xuICAgICAgICB9XG4gICAgICAgIHZhciBob3Jpem9udGFsQ29udHJpYnV0aW9uID0gMyAqIGNvbnRyaWJ1dGlvbjtcblxuICAgICAgICAvLyBjYWxjdWxhdGUgdmVydGljYWwgY29udHJpYnV0aW9uIGFuZCBjb21iaW5lIHdpdGggdGhlIGhvcml6b250YWxcbiAgICAgICAgc2lnbmlmaWNhbmNlMSA9IChyb3cgPiAwICYmIGNvZWZmaWNlbnRzTWFnbml0dWRlW2luZGV4IC0gd2lkdGhdICE9PSAwKTtcbiAgICAgICAgaWYgKHJvdyArIDEgPCBoZWlnaHQgJiYgY29lZmZpY2VudHNNYWduaXR1ZGVbaW5kZXggKyB3aWR0aF0gIT09IDApIHtcbiAgICAgICAgICBzaWduMSA9IGNvZWZmaWNlbnRzU2lnbltpbmRleCArIHdpZHRoXTtcbiAgICAgICAgICBpZiAoc2lnbmlmaWNhbmNlMSkge1xuICAgICAgICAgICAgc2lnbjAgPSBjb2VmZmljZW50c1NpZ25baW5kZXggLSB3aWR0aF07XG4gICAgICAgICAgICBjb250cmlidXRpb24gPSAxIC0gc2lnbjEgLSBzaWduMCArIGhvcml6b250YWxDb250cmlidXRpb247XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNvbnRyaWJ1dGlvbiA9IDEgLSBzaWduMSAtIHNpZ24xICsgaG9yaXpvbnRhbENvbnRyaWJ1dGlvbjtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAoc2lnbmlmaWNhbmNlMSkge1xuICAgICAgICAgIHNpZ24wID0gY29lZmZpY2VudHNTaWduW2luZGV4IC0gd2lkdGhdO1xuICAgICAgICAgIGNvbnRyaWJ1dGlvbiA9IDEgLSBzaWduMCAtIHNpZ24wICsgaG9yaXpvbnRhbENvbnRyaWJ1dGlvbjtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBjb250cmlidXRpb24gPSBob3Jpem9udGFsQ29udHJpYnV0aW9uO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGNvbnRyaWJ1dGlvbiA+PSAwKSB7XG4gICAgICAgICAgY29udGV4dExhYmVsID0gOSArIGNvbnRyaWJ1dGlvbjtcbiAgICAgICAgICBkZWNvZGVkID0gdGhpcy5kZWNvZGVyLnJlYWRCaXQodGhpcy5jb250ZXh0cywgY29udGV4dExhYmVsKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBjb250ZXh0TGFiZWwgPSA5IC0gY29udHJpYnV0aW9uO1xuICAgICAgICAgIGRlY29kZWQgPSB0aGlzLmRlY29kZXIucmVhZEJpdCh0aGlzLmNvbnRleHRzLCBjb250ZXh0TGFiZWwpIF4gMTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZGVjb2RlZDtcbiAgICAgIH0sXG4gICAgICBydW5NYWduaXR1ZGVSZWZpbmVtZW50UGFzczpcbiAgICAgICAgZnVuY3Rpb24gQml0TW9kZWxfcnVuTWFnbml0dWRlUmVmaW5lbWVudFBhc3MoKSB7XG4gICAgICAgIHZhciBkZWNv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NlbnRzTWFnbml0dWRlW2luZGV4XSB8fFxuICAgICAgICAgICAgICAgIChwcm9jZXNzaW5nRmxhZ3NbaW5kZXhdICYgcHJvY2Vzc2VkTWFzaykgIT09IDApIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHZhciBjb250ZXh0TGFiZWwgPSAxNjtcbiAgICAgICAgICAgICAgaWYgKChwcm9jZXNzaW5nRmxhZ3NbaW5kZXhdICYgZmlyc3RNYWduaXR1ZGVCaXRNYXNrKSAhPT0gMCkge1xuICAgICAgICAgICAgICAgIHByb2Nlc3NpbmdGbGFnc1tpbmRleF0gXj0gZmlyc3RNYWduaXR1ZGVCaXRNYXNrO1xuICAgICAgICAgICAgICAgIC8vIGZpcnN0IHJlZmluZW1lbnRcbiAgICAgICAgICAgICAgIHZhciBzaWduaWZpY2FuY2UgPSBuZWlnaGJvcnNTaWduaWZpY2FuY2VbaW5kZXhdICYgMTI3O1xuICAgICAgICAgICAgICAgY29udGV4dExhYmVsID0gc2lnbmlmaWNhbmNlID09PSAwID8gMTUgOiAxNDtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHZhciBiaXQgPSBkZWNvZGVyLnJlYWRCaXQoY29udGV4dHMsIGNvbnRleHRMYWJlbCk7XG4gICAgICAgICAgICAgIGNvZWZmaWNlbnRzTWFnbml0dWRlW2luZGV4XSA9XG4gICAgICAgICAgICAgICAgKGNvZWZmaWNlbnRzTWFnbml0dWRlW2luZGV4XSA8PCAxKSB8IGJpdDtcbiAgICAgICAgICAgICAgYml0c0RlY29kZWRbaW5kZXhdKys7XG4gICAgICAgICAgICAgIHByb2Nlc3NpbmdGbGFnc1tpbmRleF0gfD0gcHJvY2Vzc2VkTWFzaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBydW5DbGVhbnVwUGFzczogZnVuY3Rpb24gQml0TW9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mFyIGkgPSBpMCwgc2lnbjtcbiAgICAgICAgICAgIGlmIChhbGxFbXB0eSkge1xuICAgICAgICAgICAgICB2YXIgaGFzU2lnbmlmaWNhbnRDb2VmZmljZW50ID1cbiAgICAgICAgICAgICAgICBkZWNvZGVyLnJlYWRCaXQoY29udGV4dHMsIFJVTkxFTkdUSF9DT05URVhUKTtcbiAgICAgICAgICAgICAgaWYgKCFoYXNTaWduaWZpY2FudENvZWZmaWNlbnQpIHtcbiAgICAgICAgICAgICAgICBiaXRzRGVjb2RlZFtpbmRleDBdKys7XG4gICAgICAgICAgICAgICAgYml0c0RlY29kZWRbaW5kZXgwICsgb25lUm93RG93bl0rKztcbiAgICAgICAgICAgICAgICBiaXRzRGVjb2RlZFtpbmRleDAgKyB0d29Sb3dzRG93bl0rKztcbiAgICAgICAgICAgICAgICBiaXRzRGVjb2RlZFtpbmRleDAgKyB0aHJlZVJvd3NEb3duXSsrO1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlOyAvLyBuZXh0IGNvbHVtblxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGkxID0gKGRlY29kZXIucmVhZEJpdChjb250ZXh0cywgVU5JRk9STV9DT05URVhUKSA8PCAxKSB8XG4gICAgICAgICAgICAgICAgICAgIGRlY29kZXIucmVhZEJpdChjb250ZXh0cywgVU5JRk9STV9DT05URVhUKTtcbiAgICAgICAgICAgICAgaWYgKGkxICE9PSAwKSB7XG4gICAgICAgICAgICAgICAgaSA9IGkwICsgaTE7XG4gICAgICAgICAgICAgICAgaW5kZXggKz0gaTEgKiB3aWR0aDtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHNpZ24gPSB0aGlzLmRlY29kZVNpZ25CaXQoaSwgaiwgaW5kZXgpO1xuICAgICAgICAgICAgICBjb2VmZmljZW50c1NpZ25baW5kZXhdID0gc2lnbjtcbiAgICAgICAgICAgICAgY29lZmZpY2VudHNNYWduaXR1ZGVbaW5kZXhdID0gMTtcbiAgICAgICAgICAgICAgdGhpcy5zZXROZWlnaGJvcnNTaWduaWZpY2FuY2UoaSwgaiwgaW5kZXgpO1xuICAgICAgICAgICAgICBwcm9jZXNzaW5nRmxhZ3NbaW5kZXhdIHw9IGZpcnN0TWFnbml0dWRlQml0TWFzaztcblxuICAgICAgICAgICAgICBpbmRleCA9IGluZGV4MDtcbiAgICAgICAgICAgICAgZm9yICh2YXIgaTIgPSBpMDsgaTIgPD0gaTsgaTIrKywgaW5kZXggKz0gd2lkdGgpIHtcbiAgICAgICAgICAgICAgICBiaXRzRGVjb2RlZFtpbmRleF0rKztcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGkxKys7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmb3IgKGkgPSBpMCArIGkxOyBpIDwgaU5leHQ7IGkrKywgaW5kZXggKz0gd2lkdGgpIHtcbiAgICAgICAgICAgICAgaWYgKGNvZWZmaWNlbnRzTWFnbml0dWRlW2luZGV4XSB8fFxuICAgICAgICAgICAgICAgIChwcm9jZXNzaW5nRmxhZ3NbaW5kZXhdICYgcHJvY2Vzc2VkTWFzaykgIT09IDApIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHZhciBjb250ZXh0TGFiZWwgPSBsYWJlbHNbbmVpZ2hib3JzU2lnbmlmaWNhbmNlW2luZGV4XV07XG4gICAgICAgICAgICAgIHZhciBkZWNpc2lvbiA9IGRlY29kZXIucmVhZEJpdChjb250ZXh0cywgY29udGV4dExhYmVsKTtcbiAgICAgICAgICAgICAgaWYgKGRlY2lzaW9uID09PSAxKSB7XG4gICAgICAgICAgICAgICAgc2lnbiA9IHRoaXMuZGVjb2RlU2lnbkJpdChpLCBqLCBpbmRleCk7XG4gICAgICAgICAgICAgICAgY29lZmZpY2VudHNTaWduW2luZGV4XSA9IHNpZ247XG4gICAgICAgICAgICAgICAgY29lZmZpY2VudHNNYWduaXR1ZGVbaW5kZXhdID0gMTtcbiAgICAgICAgICAgICAgICB0aGlzLnNldE5laWdoYm9yc1NpZ25pZmljYW5jZShpLCBqLCBpbmRleCk7XG4gICAgICAgICAgICAgICAgcHJvY2Vzc2luZ0ZsYWdzW2luZGV4XSB8PSBmaXJzdE1hZ25pdHVkZUJpdE1hc2s7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgYml0c0RlY29kZWRbaW5kZXhdKys7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgY2hlY2tTZWdtZW50YXRpb25TeW1ib2w6IGZ1bmN0aW9uIEJpdE1vZGVsX2NoZWNrU2VnbWVudGF0aW9uU3ltYm9sKCkge1xuICAgICAgICB2YXIgZGVjb2RlciA9IHRoaXMuZGVjb2RlcjtcbiAgICAgICAgdmFyIGNvbnRleHRzID0gdGhpcy5jb250ZXh0cztcbiAgICAgICAgdmFyIHN5bWJvbCA9IChkZWNvZGVyLnJlYWRCaXQoY29udGV4dHMsIFVOSUZPUk1fQ09OVEVYVCkgPDwgMykgfFxuICAgICAgICAgICAgICAgICAgICAgKGRlY29kZXIucmVhZEJpdChjb250ZXh0cywgVU5JRk9STV9DT05URVhUKSA8PCAyKSB8XG4gICAgICAgICAgICAgICAgICAgICAoZGVjb2Rlci5yZWFkQml0KGNvbnRleHRzLCBVTklGT1JNX0NPTlRFWFQpIDw8IDEpIHxcbiAgICAgICAgICAgICAgICAgICAgICBkZWNvZGVyLnJlYWRCaXQoY29udGV4dHMsIFVOSUZPUk1fQ09OVEVYVCk7XG4gICAgICAgIGlmIChzeW1ib2wgIT09IDB4QSkge1xuICAgICAgICAgIHRocm93IG5ldyBFcnJvcignSlBYIEVycm9yOiBJbnZhbGlkIHNlZ21lbnRhdGlvbiBzeW1ib2wnKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH07XG5cbiAgICByZXR1cm4gQml0TW9kZWw7XG4gIH0pKCk7XG5cbiAgLy8gU2Vjd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G4gICAgICBjdXJyZW50ID0gZ2FtbWEgKiB4W2ogLSAxXTtcbiAgICAgIGZvciAobiA9IGxlbiArIDI7IG4tLTsgaiArPSAyKSB7XG4gICAgICAgIG5leHQgPSBnYW1tYSAqIHhbaiArIDFdO1xuICAgICAgICB4W2pdIC09IGN1cnJlbnQgKyBuZXh0O1xuICAgICAgICBpZiAobi0tKSB7XG4gICAgICAgICAgaiArPSAyO1xuICAgICAgICAgIGN1cnJlbnQgPSBnYW1tYSAqIHhbaiArIDFdO1xuICAgICAgICAgIHhbal0gLT0gY3VycmVudCArIG5leHQ7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgLy8gc3RlcCA1XG4gICAgICBqID0gb2Zmc2V0O1xuICAgICAgY3VycmVudCA9IGJldGEgKiB4W2ogLSAxXTtcbiAgICAgIGZvciAobiA9IGxlbiArIDE7IG4tLTsgaiArPSAyKSB7XG4gICAgICAgIG5leHQgPSBiZXRhICogeFtqICsgMV07XG4gICAgICAgIHhbal0gLT0gY3VycmVudCArIG5leHQ7XG4gICAgICAgIGlmIChuLS0pIHtcbiAgICAgICAgICBqICs9IDI7XG4gICAgICAgICAgY3VycmVudCA9IGJldGEgKiB4W2ogKyAxXTtcbiAgICAgICAgICB4W2pdIC09IGN1cnJlbnQgKyBuZXh0O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIC8vIHN0ZXAgNlxuICAgICAgaWYgKGxlbiAhPT0gMCkge1xuICAgICAgICBqID0gb2Zmc2V0ICsgMTtcbiAgICAgICAgY3VycmVudCA9IGFscGhhICogeFtqIC0gMV07XG4gICAgICAgIGZvciAobiA9IGxlbjsgbi0tOyBqICs9IDIpIHtcbiAgICAgICAgICBuZXh0ID0gYWxwaGEgKiB4W2ogKyAxXTtcbiAgICAgICAgICB4W2pdIC09IGN1cnJlb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AgICAgICAgIGlmIChxZVRhYmxlSWN4LnN3aXRjaEZsYWcgPT09IDEpIHtcbiAgICAgICAgICAgIGN4X21wcyA9IGQ7XG4gICAgICAgICAgfVxuICAgICAgICAgIGN4X2luZGV4ID0gcWVUYWJsZUljeC5ubHBzO1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB0aGlzLmNoaWdoIC09IHFlSWN4O1xuICAgICAgICBpZiAoKGEgJiAweDgwMDApICE9PSAwKSB7XG4gICAgICAgICAgdGhpcy5hID0gYTtcbiAgICAgICAgICByZXR1cm4gY3hfbXBzO1xuICAgICAgICB9XG4gICAgICAgIC8vIGV4Y2hhbmdlTXBzXG4gICAgICAgIGlmIChhIDwgcWVJY3gpIHtcbiAgICAgICAgICBkID0gMSBeIGN4X21wcztcbiAgICAgICAgICBpZiAocWVUYWJsZUljeC5zd2l0Y2hGbGFnID09PSAxKSB7XG4gICAgICAgICAgICBjeF9tcHMgPSBkO1xuICAgICAgICAgIH1cbiAgICAgICAgICBjeF9pbmRleCA9IHFlVGFibGVJY3gubmxwcztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBkID0gY3hfbXBzO1xuICAgICAgICAgIGN4X2luZGV4ID0gcWVUYWJsZUljeC5ubXBzO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICAvLyBDLjMuMyByZW5vcm1EO1xuICAgICAgZG8ge1xuICAgICAgICBpZiAodGhpcy5jdCA9PT0gMCkge1xuICAgICAgICAgIHRoaXMuYnl0ZUluKCk7XG4gICAgICAgIH1cblxuICAgICAgICBhIDw8PSAxO1xuICAgICAgICB0aGlzLmNoaWdoID0gKCh0aGlzLmNoaWdoIDw8IDEpICYgMHhGRkZGKSB8ICgodGhpcy5jbG93ID4+IDE1KSAmIDEpO1xuICAgICAgICB0aGlzLmNsb3cgPSAodGhpcy5jbG93IDw8IDEpICYgMHhGRkZGO1xuICAgICAgICB0aGlzLmN0LS07XG4gICAgICB9IHdoaWxlICgoYSAm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4gICAgICAgIHZhciBjb3VudCA9IDAsIHJlc3VsdHMgPSBbXSwgcmVzb2x2ZSwgcmVqZWN0O1xuICAgICAgICB2YXIgcHJvbWlzZSA9IG5ldyBnbG9iYWxTY29wZS5Qcm9taXNlKGZ1bmN0aW9uIChyZXNvbHZlXywgcmVqZWN0Xykge1xuICAgICAgICAgIHJlc29sdmUgPSByZXNvbHZlXztcbiAgICAgICAgICByZWplY3QgPSByZWplY3RfO1xuICAgICAgICB9KTtcbiAgICAgICAgaXRlcmFibGUuZm9yRWFjaChmdW5jdGlvbiAocCwgaSkge1xuICAgICAgICAgIGNvdW50Kys7XG4gICAgICAgICAgcC50aGVuKGZ1bmN0aW9uIChyZXN1bHQpIHtcbiAgICAgICAgICAgIHJlc3VsdHNbaV0gPSByZXN1bHQ7XG4gICAgICAgICAgICBjb3VudC0tO1xuICAgICAgICAgICAgaWYgKGNvdW50ID09PSAwKSB7XG4gICAgICAgICAgICAgIHJlc29sdmUocmVzdWx0cyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSwgcmVqZWN0KTtcbiAgICAgICAgfSk7XG4gICAgICAgIGlmIChjb3VudCA9PT0gMCkge1xuICAgICAgICAgIHJlc29sdmUocmVzdWx0cyk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHByb21pc2U7XG4gICAgICB9O1xuICAgIH1cbiAgICBpZiAodHlwZW9mIGdsb2JhbFNjb3BlLlByb21pc2UucmVzb2x2ZSAhPT0gJ2Z1bmN0aW9uJykge1xuICAgICAgZ2xvYmFsU2NvcGUuUHJvbWlzZS5yZXNvbHZlID0gZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgIHJldHVybiBuZXcgZ2xvYmFsU2NvcGUuUHJvbWlzZShmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7XG4gICAgICB9O1xuICAgIH1cbiAgICBpZiAodHlwZW9mIGdsb2JhbFNjb3BlLlByb21pc2UucmVqZWN0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HtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgaGFuZGxlci5vblJlc29sdmUgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgICAgbmV4dFZhbHVlID0gaGFuZGxlci5vblJlc29sdmUobmV4dFZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiBoYW5kbGVyLm9uUmVqZWN0ID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICAgIG5leHRWYWx1ZSA9IGhhbmRsZXIub25SZWplY3QobmV4dFZhbHVlKTtcbiAgICAgICAgICAgICAgbmV4dFN0YXR1cyA9IFNUQVRVU19SRVNPTFZFRDtcblxuICAgICAgICAgICAgICBpZiAoaGFuZGxlci50aGlzUHJvbWlzZS5fdW5oYW5kbGVkUmVqZWN0aW9uKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5yZW1vdmVVbmhhbmRlbGVkUmVqZWN0aW9uKGhhbmRsZXIudGhpc1Byb21pc2UpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9IGNhdGNoIChleCkge1xuICAgICAgICAgIG5leHRTdGF0dXMgPSBTVEFUVVNfUkVKRUNURUQ7XG4gICAgICAgICAgbmV4dFZhbHVlID0gZXg7XG4gICAgICAgIH1cblxuICAgICAgICBoYW5kbGVyLm5leHRQcm9taXNlLl91cGRhdGVTdGF0dXMobmV4dFN0YXR1cywgbmV4dFZhbHVlKTtcbiAgICAgICAgaWYgKERhdGUubm93KCkgPj0gdGltZW91dEF0KSB7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgaWYgKHRoaXMuaGFuZGxlcnMubGVuZ3RoID4gMCkge1xuICAgICAgICBzZXRUaW1lb3V0KHRoaXMucnVuSGFuZGxlcnMuYmluZCh0aGlzKSwgMCk7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cblxuICAgICAgdGhpcy5ydW5uaW5nID0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iZcbiAgICAgICAgICAgICBzY2FuIDwgc3RyZW5kKTtcblxuICAgIC8vIEFzc2VydChzY2FuIDw9IHMtPndpbmRvdysodW5zaWduZWQpKHMtPndpbmRvd19zaXplLTEpLCBcIndpbGQgc2NhblwiKTtcblxuICAgIGxlbiA9IE1BWF9NQVRDSCAtIChzdHJlbmQgLSBzY2FuKTtcbiAgICBzY2FuID0gc3RyZW5kIC0gTUFYX01BVENIO1xuXG4gICAgaWYgKGxlbiA+IGJlc3RfbGVuKSB7XG4gICAgICBzLm1hdGNoX3N0YXJ0ID0gY3VyX21hdGNoO1xuICAgICAgYmVzdF9sZW4gPSBsZW47XG4gICAgICBpZiAobGVuID49IG5pY2VfbWF0Y2gpIHtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICBzY2FuX2VuZDEgID0gX3dpbltzY2FuICsgYmVzdF9sZW4gLSAxXTtcbiAgICAgIHNjYW5fZW5kICAgPSBfd2luW3NjYW4gKyBiZXN0X2xlbl07XG4gICAgfVxuICB9IHdoaWxlICgoY3VyX21hdGNoID0gcHJldltjdXJfbWF0Y2ggJiB3bWFza10pID4gbGltaXQgJiYgLS1jaGFpbl9sZW5ndGggIT09IDApO1xuXG4gIGlmIChiZXN0X2xlbiA8PSBzLmxvb2thaGVhZCkge1xuICAgIHJldHVybiBiZXN0X2xlbjtcbiAgfVxuICByZXR1cm4gcy5sb29rYWhlYWQ7XG59XG5cblxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBGaWxsIHRoZSB3aW5kb3cgd2hlbiB0aGUgbG9va2FoZWFkIGJlY29tZXMgaW5zdWZmaWNpZW50LlxuICogVXBkYXRlcyBzdHJzdGFydCBhbmQgbG9va2FoZWFkLlxuICpcbiAqIElOIGFzc2VydGlvbjogbG9va2FoZWFkIDwgTUlOX0xPT0tBSEVBRFxuICogT1VUIGFzc2VydGlvbnM6IHN0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cCA9PT0gMikgeyAvLyBHWklQIGhlYWRlclxuICAgICAgc3RybS5hZGxlciA9IDA7ICAvL2NyYzMyKDBMLCBaX05VTEwsIDApO1xuICAgICAgcHV0X2J5dGUocywgMzEpO1xuICAgICAgcHV0X2J5dGUocywgMTM5KTtcbiAgICAgIHB1dF9ieXRlKHMsIDgpO1xuICAgICAgaWYgKCFzLmd6aGVhZCkgeyAvLyBzLT5nemhlYWQgPT0gWl9OVUxMXG4gICAgICAgIHB1dF9ieXRlKHMsIDApO1xuICAgICAgICBwdXRfYnl0ZShzLCAwKTtcbiAgICAgICAgcHV0X2J5dGUocywgMCk7XG4gICAgICAgIHB1dF9ieXRlKHMsIDApO1xuICAgICAgICBwdXRfYnl0ZShzLCAwKTtcbiAgICAgICAgcHV0X2J5dGUocywgcy5sZXZlbCA9PT0gOSA/IDIgOlxuICAgICAgICAgICAgICAgICAgICAocy5zdHJhdGVneSA+PSBaX0hVRkZNQU5fT05MWSB8fCBzLmxldmVsIDwgMiA/XG4gICAgICAgICAgICAgICAgICAgICA0IDogMCkpO1xuICAgICAgICBwdXRfYnl0ZShzLCBPU19DT0RFKTtcbiAgICAgICAgcy5zdGF0dXMgPSBCVVNZX1NUQVRFO1xuICAgICAgfVxuICAgICAgZWxzZSB7XG4gICAgICAgIHB1dF9ieXRlKHMsIChzLmd6aGVhZC50ZXh0ID8gMSA6IDApICtcbiAgICAgICAgICAgICAgICAgICAgKHMuZ3poZWFkLmhjcmMgPyAyIDogMCkgK1xuICAgICAgICAgICAgICAgICAgICAoIXMuZ3poZWFkLmV4dHJhID8gMCA6IDQpICtcbiAgICAgICAgICAgICAgICAgICAgKCFzLmd6aGVhZC5uYW1lID8gMCA6IDgpICtcbiAgICAgICAgICAgICAgICAgICAgKCFzLmd6aGVhZC5jb21tZW50ID8gMCA6IDE2KVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgIHB1dF9ieXRlKHMsIHMuZ3poZWFkLnRpbWUgJiAweGZmKTtcbiAgICAgIC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H1cbiAgaWYgKHMuc3RhdHVzID09PSBOQU1FX1NUQVRFKSB7XG4gICAgaWYgKHMuZ3poZWFkLm5hbWUvKiAhPSBaX05VTEwqLykge1xuICAgICAgYmVnID0gcy5wZW5kaW5nOyAgLyogc3RhcnQgb2YgYnl0ZXMgdG8gdXBkYXRlIGNyYyAqL1xuICAgICAgLy9pbnQgdmFsO1xuXG4gICAgICBkbyB7XG4gICAgICAgIGlmIChzLnBlbmRpbmcgPT09IHMucGVuZGluZ19idWZfc2l6ZSkge1xuICAgICAgICAgIGlmIChzLmd6aGVhZC5oY3JjICYmIHMucGVuZGluZyA+IGJlZykge1xuICAgICAgICAgICAgc3RybS5hZGxlciA9IGNyYzMyKHN0cm0uYWRsZXIsIHMucGVuZGluZ19idWYsIHMucGVuZGluZyAtIGJlZywgYmVnKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgZmx1c2hfcGVuZGluZyhzdHJtKTtcbiAgICAgICAgICBiZWcgPSBzLnBlbmRpbmc7XG4gICAgICAgICAgaWYgKHMucGVuZGluZyA9PT0gcy5wZW5kaW5nX2J1Zl9zaXplKSB7XG4gICAgICAgICAgICB2YWwgPSAxO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIEpTIHNwZWNpZmljOiBsaXR0bGUgbWFnaWMgdG8gYWRkIHplcm8gdGVybWluYXRvciB0byBlbmQgb2Ygc3RyaW5nXG4gICAgICAgIGlmIChzLmd6aW5kZXggPCBzLmd6aGVhZC5uYW1lLmxlbmd0aCkge1xuICAgICAgICAgIHZhbCA9IHMuZ3poZWFkLm5hbWUuY2hhckNvZGVBdChzLmd6aW5kZXgrKykgJiAweGZmO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHZhbCA9IDA7XG4gICAgICAgIH1cbiAgICAgICAgcHV0X2J5dGUocywgdmFsKTtcbiAgICAgIH0gd2hpbGUgKHZhbCAhPT0gMCk7XG5cbiAgICAgIGlmIChzLmd6aGVhZC5oY3JjICYmIHMucGVuZGluZyA+IGJlZykge1xuICAgICAgICBzdHJtLmFkbGVyID0gY3JjMzIoc3RybS5hZGxlciwgcy5wZW5kaW5nX2J1Ziwgcy5wZW5kaW5nIC0gYmVnLCBiZWcpO1xuICAgICAgfVxuICAgICAgaWYgKHZhbCA9PT0gMCkge1xuICAgICAgICBzLmd6aW5kZXggPSAwO1xuICAgICAgICBzLnN0YXR1cyA9IENPTU1FTlRfU1RBVEU7XG4gICAgICB9XG4gICAgfVxuICAgIGVsc2Uge1xuICAgICAgcy5zdGF0dXMgPSBDT01NRU5UX1NUQVRFO1xuICAgIH1cbiAgfVxuICBpZiAocy5zdGF0dXMgPT09IENPTU1FTlRfU1RBVEUpIHtcbiAgICBpZiAocy5nemhlYWQuY29tbWVudC8qICE9IFpfTlVMTCovKSB7XG4gICAgICBiZWcgPSBzLnBlbmRpbmc7ICAvKiBzdGFydCBvZiBieXRlcyB0byB1cGRhdGUgY3JjICovXG4gICAgICAvL2ludCB2YWw7XG5cbiAgICAgIGRvIHtcbiAgICAgICAgaWYgKHMucGVuZGluZyA9PT0gcy5wZW5kaW5nX2J1Zl9zaXplKSB7XG4gICAgICAgICAgaWYgKHMuZ3poZWFkLmhjcmMgJiYgcy5wZW5kaW5nID4gYmVnKSB7XG4gICAgICAgICAgICBzdHJtLmFkbGVyID0gY3JjMzIoc3RybS5hZGxlciwgcy5wZW5kaW5nX2J1Ziwgcy5wZW5kaW5nIC0gYmVnLCBiZWcpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBmbHVzaF9wZW5kaW5nKHN0cm0pO1xuICAgICAgICAgIGJlZyA9IHMucGVuZGluZztcbiAgICAgICAgICBpZiAocy5wZW5kaW5nID09PSBzLnBlbmRpbmdfYnVmX3NpemUpIHtcbiAgICAgICAgICAgIHZhbCA9IDE7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgLy8gSlMgc3BlY2l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fb3V0OyAgICAgICAgICAgICAgICAgICAvKiBsb2NhbCBzdHJtLm91dHB1dCAqL1xuICB2YXIgYmVnOyAgICAgICAgICAgICAgICAgICAgLyogaW5mbGF0ZSgpJ3MgaW5pdGlhbCBzdHJtLm91dHB1dCAqL1xuICB2YXIgZW5kOyAgICAgICAgICAgICAgICAgICAgLyogd2hpbGUgb3V0IDwgZW5kLCBlbm91Z2ggc3BhY2UgYXZhaWxhYmxlICovXG4vLyNpZmRlZiBJTkZMQVRFX1NUUklDVFxuICB2YXIgZG1heDsgICAgICAgICAgICAgICAgICAgLyogbWF4aW11bSBkaXN0YW5jZSBmcm9tIHpsaWIgaGVhZGVyICovXG4vLyNlbmRpZlxuICB2YXIgd3NpemU7ICAgICAgICAgICAgICAgICAgLyogd2luZG93IHNpemUgb3IgemVybyBpZiBub3QgdXNpbmcgd2luZG93ICovXG4gIHZhciB3aGF2ZTsgICAgICAgICAgICAgICAgICAvKiB2YWxpZCBieXRlcyBpbiB0aGUgd2luZG93ICovXG4gIHZhciB3bmV4dDsgICAgICAgICAgICAgICAgICAvKiB3aW5kb3cgd3JpdGUgaW5kZXggKi9cbiAgLy8gVXNlIGBzX3dpbmRvd2AgaW5zdGVhZCBgd2luZG93YCwgYXZvaWQgY29uZmxpY3Qgd2l0aCBpbnN0cnVtZW50YXRpb24gdG9vbHNcbiAgdmFyIHNfd2luZG93OyAgICAgICAgICAgICAgIC8qIGFsbG9jYXRlZCBzbGlkaW5nIHdpbmRvdywgaWYgd3NpemUgIT0gMCAqL1xuICB2YXIgaG9sZDsgICAgICAgICAgICAgICAgICAgLyogbG9jYWwgc3RybS5ob2xkICovXG4gIHZhciBiaXRzOyAgICAgICAgICAgICAgICAgICAvKiBsb2NhbCBzdHJtLmJpdHMgKi9cbiAgdmFyIGxjb2RlOyAgICAgICAgICAgICAgICAgIC8qIGxvY2FsIHN0cm0ubGVuY29kZSAqL1xuICB2YXIgZGNvZGU7ICAgICAgICAgICAgICAgICAgLyogbG9jYW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+Pj4gMjQvKmhlcmUuYml0cyovO1xuICAgICAgaG9sZCA+Pj49IG9wO1xuICAgICAgYml0cyAtPSBvcDtcbiAgICAgIG9wID0gKGhlcmUgPj4+IDE2KSAmIDB4ZmYvKmhlcmUub3AqLztcbiAgICAgIGlmIChvcCA9PT0gMCkgeyAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbGl0ZXJhbCAqL1xuICAgICAgICAvL1RyYWNldnYoKHN0ZGVyciwgaGVyZS52YWwgPj0gMHgyMCAmJiBoZXJlLnZhbCA8IDB4N2YgP1xuICAgICAgICAvLyAgICAgICAgXCJpbmZsYXRlOiAgICAgICAgIGxpdGVyYWwgJyVjJ1xcblwiIDpcbiAgICAgICAgLy8gICAgICAgIFwiaW5mbGF0ZTogICAgICAgICBsaXRlcmFsIDB4JTAyeFxcblwiLCBoZXJlLnZhbCkpO1xuICAgICAgICBvdXRwdXRbX291dCsrXSA9IGhlcmUgJiAweGZmZmYvKmhlcmUudmFsKi87XG4gICAgICB9XG4gICAgICBlbHNlIGlmIChvcCAmIDE2KSB7ICAgICAgICAgICAgICAgICAgICAgLyogbGVuZ3RoIGJhc2UgKi9cbiAgICAgICAgbGVuID0gaGVyZSAmIDB4ZmZmZi8qaGVyZS52YWwqLztcbiAgICAgICAgb3AgJj0gMTU7ICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbnVtYmVyIG9mIGV4dHJhIGJpdHMgKi9cbiAgICAgICAgaWYgKG9wKSB7XG4gICAgICAgICAgaWYgKGJpdHMgPCBvcCkge1xuICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtfaW4rK10gPDwgYml0cztcbiAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICB9XG4gICAgICAgICAgbGVuICs9IGhvbGQgJiAoKDEgPDwgb3ApIC0gMSk7XG4gICAgICAgICAgaG9sZCA+Pj49IG9wO1xuICAgICAgICAgIGJpdHMgLT0gb3A7XG4gICAgICAgIH1cbiAgICAgICAgLy9UcmFjZXZ2KChzdGRlcnIsIFwiaW5mbGF0ZTogICAgICAgICBsZW5ndGggJXVcXG5cIiwgbGVuKSk7XG4gICAgICAgIGlmIChiaXRzIDwgMTUpIHtcbiAgICAgICAgICBob2xkICs9IGlucHV0W19pbisrXSA8PCBiaXRzO1xuICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICBob2xkICs9IGlucHV0W19pbisrXSA8PCBiaXRzO1xuICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgfVxuICAgICAgICBoZXJlID0gZGNvZGVbaG9sZCAmIGRtYXNrXTtcblxuICAgICAgICBkb2Rpc3Q6XG4gICAgICAgIGZvciAoOzspIHsgLy8gZ290byBlbXVsYXRpb25cbiAgICAgICAgICBvcCA9IGhlcmUgPj4+IDI0LypoZXJlLmJpdHMqLztcbiAgICAgICAgICBob2xkID4+Pj0gb3A7XG4gICAgICAgICAgYml0cyAtPSBvcDtcbiAgICAgICAgICBvcCA9IChoZXJlID4+PiAxNikgJiAweGZmLypoZXJlLm9wKi87XG5cbiAgICAgICAgICBpZiAob3AgJiAxNikgeyAgICAgICAgICAgICAgICAgICAgICAvKiBkaXN0YW5jZSBiYXNlICovXG4gICAgICAgICAgICBkaXN0ID0gaGVyZSAmIDB4ZmZmZi8qaGVyZS52YWwqLztcbiAgICAgICAgICAgIG9wICY9IDE1OyAgICAgICAgICAgICAgICAgICAgICAgLyogbnVtYmVyIG9mIGV4dHJhIGJpdHMgKi9cbiAgICAgICAgICAgIGlmIChiaXRzIDwgb3ApIHtcbiAgICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtfaW4rK10gPDwgYml0cztcbiAgICAgICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICAgICAgICBpZiAoYml0cyA8IG9wKSB7XG4gICAgICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtfaW4rK10gPDwgYml0cztcbiAgICAgICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRpc3QgKz0gaG9sZCAmICgoMSA8PCBvcCkgLSAxKTtcbi8vI2lmZGVmIElORkxBVEVfU1RSSUNUXG4gICAgICAgICAgICBpZiAoZGlzdCA+IGRtYXgpIHtcbiAgICAgICAgICAgICAgc3RybS5tc2cgPSAnaW52YWxpZCBkaXN0YW5jZSB0b28gZmFyIGJhY2snO1xuICAgICAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgICAgICBicmVhayB0b3A7XG4gICAgICAgICAgICB9XG4vLyNlbmRpZlxuICAgICAgICAgICAgaG9sZCA+Pj49IG9wO1xuICAgICAgICAgICAgYml0cyAtPSBvcDtcbiAgICAgICAgICAgIC8vVHJhY2V2digoc3RkZXJyLCBcImluZmxhdGU6ICAgICAgICAgZGlzdGFuY2UgJXVcXG5cIiwgZGlzdCkpO1xuICAgICAgICAgICAgb3AgPSBfb3V0IC0gYmVnOyAgICAgICAgICAgICAgICAvKiBtYXggZGlzdGFuY2UgaW4gb3V0cHV0ICovXG4gICAgICAgICAgICBpZiAoZGlzdCA+IG9wKSB7ICAgICAgICAgICAgICAgIC8qIHNlZSBpZiBjb3B5IGZyb20gd2luZG93ICovXG4gICAgICAgICAgICAgIG9wID0gZGlzdCAtIG9wOyAgICAgICAgICAgICAgIC8qIGRpc3RhbmNlIGJhY2sgaW4gd2luZG93ICovXG4gICAgICAgICAgICAgIGlmIChvcCA+IHdoYXZlKSB7XG4gICAgICAgICAgICAgICAgaWYgKHN0YXRlLnNhbmUpIHtcbiAgICAgICAgICAgICAgICAgIHN0cm0ubXNnID0gJ2ludmFsaWQgZGlzdGFuY2UgdG9vIGZhciBiYWNrJztcbiAgICAgICAgICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgICAgICAgICBicmVhayB0b3A7XG4gICAgICAgICAgICAgICAgfVxuXG4vLyAoISkgVGhpcyBibG9jayBpcyBkaXNhYmxlZCBpbiB6bGliIGRlZmFpbHRzLFxuLy8gZG9uJ3QgZW5hYmxlIGl0IGZvciBiaW5hcnkgY29tcGF0aWJpbGl0eVxuLy8jaWZkZWYgSU5GTEFURV9BTExPV19JTlZBTElEX0RJU1RBTkNFX1RPT0ZBUl9BUlJSXG4vLyAgICAgICAgICAgICAgICBpZiAobGVuIDw9IG9wIC0gd2hhdmUpIHtcbi8vICAgICAgICAgICAgICAgICAgZG8ge1xuLy8gICAgICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gMDtcbi8vICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoLS1sZW4pO1xuLy8gICAgICAgICAgICAgICAgICBjb250aW51ZSB0b3A7XG4vLyAgICAgICAgICAgICAgICB9XG4vLyAgICAgICAgICAgICAgICBsZW4gLT0gb3AgLSB3aGF2ZTtcbi8vICAgICAgICAgICAgICAgIGRvIHtcbi8vICAgICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSAwO1xuLy8gICAgICAgICAgICAgICAgfSB3aGlsZSAoLS1vcCA+IHdoYXZlKTtcbi8vICAgICAgICAgICAgICAgIGlmIChvcCA9PT0gMCkge1xuLy8gICAgICAgICAgICAgICAgICBmcm9tID0gX291dCAtIGRpc3Q7XG4vLyAgICAgICAgICAgICAgICAgIGRvIHtcbi8vICAgICAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IG91dHB1dFtmcm9tKytdO1xuLy8gICAgICAgICAgICAgICAgICB9IHdoaWxlICgtLWxlbik7XG4vLyAgICAgICAgICAgICAgICAgIGNvbnRpbnVlIHRvcDtcbi8vICAgICAgICAgICAgICAgIH1cbi8vI2VuZGlmXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgZnJvbSA9IDA7IC8vIHdpbmRvdyBpbmRleFxuICAgICAgICAgICAgICBmcm9tX3NvdXJjZSA9IHNfd2luZG93O1xuICAgICAgICAgICAgICBpZiAod25leHQgPT09IDApIHsgICAgICAgICAgIC8qIHZlcnkgY29tbW9uIGNhc2UgKi9cbiAgICAgICAgICAgICAgICBmcm9tICs9IHdzaXplIC0gb3A7XG4gICAgICAgICAgICAgICAgaWYgKG9wIDwgbGVuKSB7ICAgICAgICAgLyogc29tZSBmcm9tIHdpbmRvdyAqL1xuICAgICAgICAgICAgICAgICAgbGVuIC09IG9wO1xuICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IHNfd2luZG93W2Zyb20rK107XG4gICAgICAgICAgICAgICAgICB9IHdoaWxlICgtLW9wKTtcbiAgICAgICAgICAgICAgICAgIGZyb20gPSBfb3V0IC0gZGlzdDsgIC8qIHJlc3QgZnJvbSBvdXRwdXQgKi9cbiAgICAgICAgICAgICAgICAgIGZyb21fc291cmNlID0gb3V0cHV0O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBlbHNlIGlmICh3bmV4dCA8IG9wKSB7ICAgICAgLyogd3JhcCBhcm91bmQgd2luZG93ICovXG4gICAgICAgICAgICAgICAgZnJvbSArPSB3c2l6ZSArIHduZXh0IC0gb3A7XG4gICAgICAgICAgICAgICAgb3AgLT0gd25leHQ7XG4gICAgICAgICAgICAgICAgaWYgKG9wIDwgbGVuKSB7ICAgICAgICAgLyogc29tZSBmcm9tIGVuZCBvZiB3aW5kb3cgKi9cbiAgICAgICAgICAgICAgICAgIGxlbiAtPSBvcDtcbiAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBzX3dpbmRvd1tmcm9tKytdO1xuICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoLS1vcCk7XG4gICAgICAgICAgICAgICAgICBmcm9tID0gMDtcbiAgICAgICAgICAgICAgICAgIGlmICh3bmV4dCA8IGxlbikgeyAgLyogc29tZSBmcm9tIHN0YXJ0IG9mIHdpbmRvdyAqL1xuICAgICAgICAgICAgICAgICAgICBvcCA9IHduZXh0O1xuICAgICAgICAgICAgICAgICAgICBsZW4gLT0gb3A7XG4gICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IHNfd2luZG93W2Zyb20rK107XG4gICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKC0tb3ApO1xuICAgICAgICAgICAgICAgICAgICBmcm9tID0gX291dCAtIGRpc3Q7ICAgICAgLyogcmVzdCBmcm9tIG91dHB1dCAqL1xuICAgICAgICAgICAgICAgICAgICBmcm9tX3NvdXJjZSA9IG91dHB1dDtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgZWxzZSB7ICAgICAgICAgICAgICAgICAgICAgIC8qIGNvbnRpZ3VvdXMgaW4gd2luZG93ICovXG4gICAgICAgICAgICAgICAgZnJvbSArPSB3bmV4dCAtIG9wO1xuICAgICAgICAgICAgICAgIGlmIChvcCA8IGxlbikgeyAgICAgICAgIC8qIHNvbWUgZnJvbSB3aW5kb3cgKi9cbiAgICAgICAgICAgICAgICAgIGxlbiAtPSBvcDtcbiAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBzX3dpbmRvd1tmcm9tKytdO1xuICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoLS1vcCk7XG4gICAgICAgICAgICAgICAgICBmcm9tID0gX291dCAtIGRpc3Q7ICAvKiByZXN0IGZyb20gb3V0cHV0ICovXG4gICAgICAgICAgICAgICAgICBmcm9tX3NvdXJjZSA9IG91dHB1dDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgd2hpbGUgKGxlbiA+IDIpIHtcbiAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IGZyb21fc291cmNlW2Zyb20rK107XG4gICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBmcm9tX3NvdXJjZVtmcm9tKytdO1xuICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gZnJvbV9zb3VyY2VbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICBsZW4gLT0gMztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAobGVuKSB7XG4gICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBmcm9tX3NvdXJjZVtmcm9tKytdO1xuICAgICAgICAgICAgICAgIGlmIChsZW4gPiAxKSB7XG4gICAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IGZyb21fc291cmNlW2Zyb20rK107XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgZnJvbSA9IF9vdXQgLSBkaXN0OyAgICAgICAgICAvKiBjb3B5IGRpcmVjdCBmcm9tIG91dHB1dCAqL1xuICAgICAgICAgICAgICBkbyB7ICAgICAgICAgICAgICAgICAgICAgICAgLyogbWluaW11bSBsZW5ndGggaXMgdGhyZWUgKi9cbiAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IG91dHB1dFtmcm9tKytdO1xuICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gb3V0cHV0W2Zyb20rK107XG4gICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBvdXRwdXRbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICBsZW4gLT0gMztcbiAgICAgICAgICAgICAgfSB3aGlsZSAobGVuID4gMik7XG4gICAgICAgICAgICAgIGlmIChsZW4pIHtcbiAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IG91dHB1dFtmcm9tKytdO1xuICAgICAgICAgICAgICAgIGlmIChsZW4gPiAxKSB7XG4gICAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IG91dHB1dFtmcm9tKytdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBlbHNlIGlmICgob3AgJiA2NCkgPT09IDApIHsgICAgICAgICAgLyogMm5kIGxldmVsIGRpc3RhbmNlIGNvZGUgKi9cbiAgICAgICAgICAgIGhlcmUgPSBkY29kZVsoaGVyZSAmIDB4ZmZmZikvKmhlcmUudmFsKi8gKyAoaG9sZCAmICgoMSA8PCBvcCkgLSAxKSldO1xuICAgICAgICAgICAgY29udGludWUgZG9kaXN0O1xuICAgICAgICAgIH1cbiAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHN0cm0ubXNnID0gJ2ludmFsaWQgZGlzdGFuY2UgY29kZSc7XG4gICAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgICAgYnJlYWsgdG9wO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGJyZWFrOyAvLyBuZWVkIHRvIGVtdWxhdGUgZ290byB2aWEgXCJjb250aW51ZVwiXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGVsc2UgaWYgKChvcCAmIDY0KSA9PT0gMCkgeyAgICAgICAgICAgICAgLyogMm5kIGxldmVsIGxlbmd0aCBjb2RlICovXG4gICAgICAgIGhlcmUgPSBsY29kZVsoaGVyZSAmIDB4ZmZmZikvKmhlcmUudmFsKi8gKyAoaG9sZCAmICgoMSA8PCBvcCkgLSAxKSldO1xuICAgICAgICBjb250aW51ZSBkb2xlbjtcbiAgICAgIH1cbiAgICAgIGVsc2UgaWYgKG9wICYgMzIpIHsgICAgICAgICAgICAgICAgICAgICAvKiBlbmQtb2YtYmxvY2sgKi9cbiAgICAgICAgLy9UcmFjZXZ2KChzdGRlcnIsIFwiaW5mbGF0ZTogICAgICAgICBlbmQgb2YgYmxvY2tcXG5cIikpO1xuICAgICAgICBzdGF0ZS5tb2RlID0gVFlQRTtcbiAgICAgICAgYnJlYWsgdG9wO1xuICAgICAgfVxuIC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VJST1IgID0gLTI7XG52YXIgWl9EQVRBX0VSUk9SICAgID0gLTM7XG52YXIgWl9NRU1fRVJST1IgICAgID0gLTQ7XG52YXIgWl9CVUZfRVJST1IgICAgID0gLTU7XG4vL3ZhciBaX1ZFUlNJT05fRVJST1IgPSAtNjtcblxuLyogVGhlIGRlZmxhdGUgY29tcHJlc3Npb24gbWV0aG9kICovXG52YXIgWl9ERUZMQVRFRCAgPSA4O1xuXG5cbi8qIFNUQVRFUyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuXG5cbnZhciAgICBIRUFEID0gMTsgICAgICAgLyogaTogd2FpdGluZyBmb3IgbWFnaWMgaGVhZGVyICovXG52YXIgICAgRkxBR1MgPSAyOyAgICAgIC8qIGk6IHdhaXRpbmcgZm9yIG1ldGhvZCBhbmQgZmxhZ3MgKGd6aXApICovXG52YXIgICAgVElNRSA9IDM7ICAgICAgIC8qIGk6IHdhaXRpbmcgZm9yIG1vZGlmaWNhdGlvbiB0aW1lIChnemlwKSAqL1xudmFyICAgIE9TID0gNDsgICAgICAgICAvKiBpOiB3YWl0aW5nIGZvciBleHRyYSBmbGFncyBhbmQgb3BlcmF0aW5nIHN5c3RlbSAoZ3ppcCkgKi9cbnZhciAgICBFWExFTiA9IDU7ICAgICAgLyogaTogd2FpdGluZyBmb3IgZXh0cmEgbGVuZ3RoIChnemlwKSAqL1xudmFyICAgIEVYVFJBID0gNjsgICAgICAvKiBpOiB3YWl0aW5nIGZvciBleHRyYSBieXRlcyAoZ3ppcCkgKi9cbnZhciAgICBOQU1FID0gNzsgICAgICAgLyogaTogd2FpdGluZyBmb3IgZW5kIG9mIGZpbGUgbmFtZSAoZ3ppcCkgKi9cbnZhciAgICBDT01NRU5UID0gODsgICAgL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AgICAvLz09PS8vXG4gICAgICBzdGF0ZS5tb2RlID0gRVhMRU47XG4gICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgY2FzZSBFWExFTjpcbiAgICAgIGlmIChzdGF0ZS5mbGFncyAmIDB4MDQwMCkge1xuICAgICAgICAvLz09PSBORUVEQklUUygxNik7ICovXG4gICAgICAgIHdoaWxlIChiaXRzIDwgMTYpIHtcbiAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICB9XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgc3RhdGUubGVuZ3RoID0gaG9sZDtcbiAgICAgICAgaWYgKHN0YXRlLmhlYWQpIHtcbiAgICAgICAgICBzdGF0ZS5oZWFkLmV4dHJhX2xlbiA9IGhvbGQ7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHN0YXRlLmZsYWdzICYgMHgwMjAwKSB7XG4gICAgICAgICAgLy89PT0gQ1JDMihzdGF0ZS5jaGVjaywgaG9sZCk7XG4gICAgICAgICAgaGJ1ZlswXSA9IGhvbGQgJiAweGZmO1xuICAgICAgICAgIGhidWZbMV0gPSAoaG9sZCA+Pj4gOCkgJiAweGZmO1xuICAgICAgICAgIHN0YXRlLmNoZWNrID0gY3JjMzIoc3RhdGUuY2hlY2ssIGhidWYsIDIsIDApO1xuICAgICAgICAgIC8vPT09Ly9cbiAgICAgICAgfVxuICAgICAgICAvLz09PSBJTklUQklUUygpO1xuICAgICAgICBob2xkID0gMDtcbiAgICAgICAgYml0cyA9IDA7XG4gICAgICAgIC8vPT09Ly9cbiAgICAgIH1cbiAgICAgIGVsc2UgaWYgKHN0YXRlLmhlYWQpIHtcbiAgICAgICAgc3RhdGUuaGVhZC5leHRyYSA9IG51bGwvKlpfTlVM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gICAgICAgICk7XG4gICAgICAgICAgICAvL3ptZW1jcHkoc3RhdGUuaGVhZC5leHRyYSArIGxlbiwgbmV4dCxcbiAgICAgICAgICAgIC8vICAgICAgICBsZW4gKyBjb3B5ID4gc3RhdGUuaGVhZC5leHRyYV9tYXggP1xuICAgICAgICAgICAgLy8gICAgICAgIHN0YXRlLmhlYWQuZXh0cmFfbWF4IC0gbGVuIDogY29weSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChzdGF0ZS5mbGFncyAmIDB4MDIwMCkge1xuICAgICAgICAgICAgc3RhdGUuY2hlY2sgPSBjcmMzMihzdGF0ZS5jaGVjaywgaW5wdXQsIGNvcHksIG5leHQpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBoYXZlIC09IGNvcHk7XG4gICAgICAgICAgbmV4dCArPSBjb3B5O1xuICAgICAgICAgIHN0YXRlLmxlbmd0aCAtPSBjb3B5O1xuICAgICAgICB9XG4gICAgICAgIGlmIChzdGF0ZS5sZW5ndGgpIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICB9XG4gICAgICBzdGF0ZS5sZW5ndGggPSAwO1xuICAgICAgc3RhdGUubW9kZSA9IE5BTUU7XG4gICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgY2FzZSBOQU1FOlxuICAgICAgaWYgKHN0YXRlLmZsYWdzICYgMHgwODAwKSB7XG4gICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICBjb3B5ID0gMDtcbiAgICAgICAgZG8ge1xuICAgICAgICAgIC8vIFRPRE86IDIgb3IgMSBieXRlcz9cbiAgICAgICAgICBsZW4gPSBpbnB1dFtuZXh0ICsgY29weSsrXTtcbiAgICAgICAgICAvKiB1c2UgY29uc3RhbnQgbGltaXQgYmVjYXVzZSBpbiBqcyB3ZSBzaG91bGQgbm90IHByZWFsbG9jYXRlIG1lbW9yeSAqL1xuICAgICAgICAgIGlmIChzdGF0ZS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AgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICBiaXRzICs9IDg7XG4gICAgICB9XG4gICAgICAvLz09PS8vXG4gICAgICBzdGF0ZS5sYXN0ID0gKGhvbGQgJiAweDAxKS8qQklUUygxKSovO1xuICAgICAgLy8tLS0gRFJPUEJJVFMoMSkgLS0tLy9cbiAgICAgIGhvbGQgPj4+PSAxO1xuICAgICAgYml0cyAtPSAxO1xuICAgICAgLy8tLS0vL1xuXG4gICAgICBzd2l0Y2ggKChob2xkICYgMHgwMykvKkJJVFMoMikqLykge1xuICAgICAgY2FzZSAwOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogc3RvcmVkIGJsb2NrICovXG4gICAgICAgIC8vVHJhY2V2KChzdGRlcnIsIFwiaW5mbGF0ZTogICAgIHN0b3JlZCBibG9jayVzXFxuXCIsXG4gICAgICAgIC8vICAgICAgICBzdGF0ZS5sYXN0ID8gXCIgKGxhc3QpXCIgOiBcIlwiKSk7XG4gICAgICAgIHN0YXRlLm1vZGUgPSBTVE9SRUQ7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAxOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZml4ZWQgYmxvY2sgKi9cbiAgICAgICAgZml4ZWR0YWJsZXMoc3RhdGUpO1xuICAgICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgICBmaXhlZCBjb2RlcyBibG9jayVzXFxuXCIsXG4gICAgICAgIC8vICAgICAgICBzdGF0ZS5sYXN0ID8gXCIgKGxhc3QpXCIgOiBcIlwiKSk7XG4gICAgICAgIHN0YXRlLm1vZGUgPSBMRU5fOyAgICAgICAgICAgICAvKiBkZWNvZGUgY29kZXMgKi9cbiAgICAgICAgaWYgKGZsdXNoID09PSBaX1RSRUVTKSB7XG4gICAgICAgICAgLy8tLS0gRFJPUEJJVFMoMikgLS0tLy9cbiAgICAgICAgICBob2xkID4+Pj0gMjtcbiA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cyArIDIpO1xuICAgICAgICAgICAgbiA9IGhlcmVfYml0cyArIDI7XG4gICAgICAgICAgICB3aGlsZSAoYml0cyA8IG4pIHtcbiAgICAgICAgICAgICAgaWYgKGhhdmUgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vPT09Ly9cbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKGhlcmUuYml0cykgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSBoZXJlX2JpdHM7XG4gICAgICAgICAgICBiaXRzIC09IGhlcmVfYml0cztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICAgIGlmIChzdGF0ZS5oYXZlID09PSAwKSB7XG4gICAgICAgICAgICAgIHN0cm0ubXNnID0gJ2ludmFsaWQgYml0IGxlbmd0aCByZXBlYXQnO1xuICAgICAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxlbiA9IHN0YXRlLmxlbnNbc3RhdGUuaGF2ZSAtIDFdO1xuICAgICAgICAgICAgY29weSA9IDMgKyAoaG9sZCAmIDB4MDMpOy8vQklUUygyKTtcbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKDIpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gMjtcbiAgICAgICAgICAgIGJpdHMgLT0gMjtcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICB9XG4gICAgICAgICAgZWxzZSBpZiAoaGVyZV92YWwgPT09IDE3KSB7XG4gICAgICAgICAgICAvLz09PSBORUVEQklUUyhoZXJlLmJpdHMgKyAzKTtcbiAgICAgICAgICAgIG4gPSBoZXJlX2JpdHMgKyAzO1xuICAgICAgICAgICAgd2hpbGUgKGJpdHMgPCBuKSB7XG4gICAgICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLz09PS8vXG4gICAgICAgICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gaGVyZV9iaXRzO1xuICAgICAgICAgICAgYml0cyAtPSBoZXJlX2JpdHM7XG4gICAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgICBsZW4gPSAwO1xuICAgICAgICAgICAgY29weSA9IDMgKyAoaG9sZCAmIDB4MDcpOy8vQklUUygzKTtcbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKDMpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gMztcbiAgICAgICAgICAgIGJpdHMgLT0gMztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICB9XG4gICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAvLz09PSBORUVEQklUUyhoZXJlLmJpdHMgKyA3KTtcbiAgICAgICAgICAgIG4gPSBoZXJlX2JpdHMgKyA3O1xuICAgICAgICAgICAgd2hpbGUgKGJpdHMgPCBuKSB7XG4gICAgICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLz09PS8vXG4gICAgICAgICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gaGVyZV9iaXRzO1xuICAgICAgICAgICAgYml0cyAtPSBoZXJlX2JpdHM7XG4gICAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgICBsZW4gPSAwO1xuICAgICAgICAgICAgY29weSA9IDExICsgKGhvbGQgJiAweDdmKTsvL0JJVFMoNyk7XG4gICAgICAgICAgICAvLy0tLSBEUk9QQklUUyg3KSAtLS0vL1xuICAgICAgICAgICAgaG9sZCA+Pj49IDc7XG4gICAgICAgICAgICBiaXRzIC09IDc7XG4gICAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChzdGF0ZS5oYXZlICsgY29weSA+IHN0YXRlLm5sZW4gKyBzdGF0ZS5uZGlzdCkge1xuICAgICAgICAgICAgc3RybS5tc2cgPSAnaW52YWxpZCBiaXQgbGVuZ3RoIHJlcGVhdCc7XG4gICAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICAgIHdoaWxlIChjb3B5LS0pIHtcbiAgICAgICAgICAgIHN0YXRlLmxlbnNbc3RhdGUuaGF2ZSsrXSA9IGxlbjtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgLyogaGFuZGxlIGVycm9yIGJyZWFrcyBpbiB3aGlsZSAqL1xuICAgICAgaWYgKHN0YXRlLm1vZGUgPT09IEJBRCkgeyBicmVhazsgfVxuXG4gICAgICAvKiBjaGVjayBmb3IgZW5kLW9mLWJsb2NrIGNvZGUgKGJldHRlciBoYXZlIG9uZSkgKi9cbiAgICAgIGlmIChzdGF0ZS5sZW5zWzI1Nl0gPT09IDApIHtcbiAgICAgICAgc3RybS5tc2cgPSAnaW52YWxpZCBjb2RlIC0tIG1pc3NpbmcgZW5kLW9mLWJsb2NrJztcbiAg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0X3ZhbCArXG4gICAgICAgICAgICAgICAgICAoKGhvbGQgJiAoKDEgPDwgKGxhc3RfYml0cyArIGxhc3Rfb3ApKSAtMSkpLypCSVRTKGxhc3QuYml0cyArIGxhc3Qub3ApKi8gPj4gbGFzdF9iaXRzKV07XG4gICAgICAgICAgaGVyZV9iaXRzID0gaGVyZSA+Pj4gMjQ7XG4gICAgICAgICAgaGVyZV9vcCA9IChoZXJlID4+PiAxNikgJiAweGZmO1xuICAgICAgICAgIGhlcmVfdmFsID0gaGVyZSAmIDB4ZmZmZjtcblxuICAgICAgICAgIGlmICgobGFzdF9iaXRzICsgaGVyZV9iaXRzKSA8PSBiaXRzKSB7IGJyZWFrOyB9XG4gICAgICAgICAgLy8tLS0gUFVMTEJZVEUoKSAtLS0vL1xuICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgLy8tLS0vL1xuICAgICAgICB9XG4gICAgICAgIC8vLS0tIERST1BCSVRTKGxhc3QuYml0cykgLS0tLy9cbiAgICAgICAgaG9sZCA+Pj49IGxhc3RfYml0cztcbiAgICAgICAgYml0cyAtPSBsYXN0X2JpdHM7XG4gICAgICAgIC8vLS0tLy9cbiAgICAgICAgc3RhdGUuYmFjayArPSBsYXN0X2JpdHM7XG4gICAgICB9XG4gICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICBob2xkID4+Pj0gaGVyZV9iaXRzO1xuICAgICAgYml0cyAtPSBoZXJlX2JpdHM7XG4gICAgICAvLy0tLS8vXG4gICAgICBzdGF0ZS5iYWNrICs9IGhlcmVfYml0cztcbiAgICAgIGlmIChoZXJlX29wICYgNjQpIHtcbiAgICAgICAgc3RybS5tc2cgPSAnaW52YWxpZCBkaXN0YW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AgICAgICAvKiBpbmRleCBvZiBjb2RlIHN5bWJvbHMgKi9cbiAgdmFyIG1pbiA9IDAsIG1heCA9IDA7ICAgICAgICAgIC8qIG1pbmltdW0gYW5kIG1heGltdW0gY29kZSBsZW5ndGhzICovXG4gIHZhciByb290ID0gMDsgICAgICAgICAgICAgIC8qIG51bWJlciBvZiBpbmRleCBiaXRzIGZvciByb290IHRhYmxlICovXG4gIHZhciBjdXJyID0gMDsgICAgICAgICAgICAgIC8qIG51bWJlciBvZiBpbmRleCBiaXRzIGZvciBjdXJyZW50IHRhYmxlICovXG4gIHZhciBkcm9wID0gMDsgICAgICAgICAgICAgIC8qIGNvZGUgYml0cyB0byBkcm9wIGZvciBzdWItdGFibGUgKi9cbiAgdmFyIGxlZnQgPSAwOyAgICAgICAgICAgICAgICAgICAvKiBudW1iZXIgb2YgcHJlZml4IGNvZGVzIGF2YWlsYWJsZSAqL1xuICB2YXIgdXNlZCA9IDA7ICAgICAgICAgICAgICAvKiBjb2RlIGVudHJpZXMgaW4gdGFibGUgdXNlZCAqL1xuICB2YXIgaHVmZiA9IDA7ICAgICAgICAgICAgICAvKiBIdWZmbWFuIGNvZGUgKi9cbiAgdmFyIGluY3I7ICAgICAgICAgICAgICAvKiBmb3IgaW5jcmVtZW50aW5nIGNvZGUsIGluZGV4ICovXG4gIHZhciBmaWxsOyAgICAgICAgICAgICAgLyogaW5kZXggZm9yIHJlcGxpY2F0aW5nIGVudHJpZXMgKi9cbiAgdmFyIGxvdzsgICAgICAgICAgICAgICAvKiBsb3cgYml0cyBmb3IgY3VycmVudCByb290IGVudHJ5ICovXG4gIHZhciBtYXNrOyAgICAgICAgICAgICAgLyogbWFzayBmb3IgbG93IHJvb3QgYml0cyAqL1xuICB2YXIgbmV4dDsgICAgICAgICAgICAgLyogbmV4dCBhdmFpbGFibGUgc3BhY2UgaW4gdGFibGUgKi9cbiAgdmFyIGJhc2UgPSBudWxsOyAgICAgLyogYmFzZSB2YWx1ZSB0YWJsZSB0byB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VzdCBvZiB0aGUgZGVjb2RpbmcgdGFibGVzIHdpdGggaW52YWxpZCBjb2RlIG1hcmtlcnMuXG4gICAqL1xuXG4gIC8qIHNldCB1cCBmb3IgY29kZSB0eXBlICovXG4gIC8vIHBvb3IgbWFuIG9wdGltaXphdGlvbiAtIHVzZSBpZi1lbHNlIGluc3RlYWQgb2Ygc3dpdGNoLFxuICAvLyB0byBhdm9pZCBkZW9wdHMgaW4gb2xkIHY4XG4gIGlmICh0eXBlID09PSBDT0RFUykge1xuICAgIGJhc2UgPSBleHRyYSA9IHdvcms7ICAgIC8qIGR1bW15IHZhbHVlLS1ub3QgdXNlZCAqL1xuICAgIGVuZCA9IDE5O1xuXG4gIH0gZWxzZSBpZiAodHlwZSA9PT0gTEVOUykge1xuICAgIGJhc2UgPSBsYmFzZTtcbiAgICBiYXNlX2luZGV4IC09IDI1NztcbiAgICBleHRyYSA9IGxleHQ7XG4gICAgZXh0cmFfaW5kZXggLT0gMjU3O1xuICAgIGVuZCA9IDI1NjtcblxuICB9IGVsc2UgeyAgICAgICAgICAgICAgICAgICAgLyogRElTVFMgKi9cbiAgICBiYXNlID0gZGJhc2U7XG4gICAgZXh0cmEgPSBkZXh0O1xuICAgIGVuZCA9IC0xO1xuICB9XG5cbiAgLyogaW5pdGlhbGl6ZSBvcHRzIGZvciBsb29wICovXG4gIGh1ZmYgPSAwOyAgICAgICAgICAgICAgICAgICAvKiBzdGFydGluZyBjb2RlICovXG4gIHN5bSA9IDA7ICAgICAgICAgICAgICAgICAgICAvKiBzdGFydGluZyBjb2RlIHN5bWJvbCAqL1xuICBsZW4gPSBtaW47ICAgICAgICAgICAgICAgICAgLyogc3RhcnRpbmcgY29kZSBsZW5ndGggKi9cbiAgbmV4dCA9IHRhYmxlX2luZGV4OyAgICAgICAgICAgICAgLyogY3VycmVudCB0YWJsZSB0byBmaWxsIGluICovXG4gIGN1cnIgPSByb290OyAgICAgICAgICAgICAgICAvKiBjdXJyZW50IHRhYmxlIGluZGV4I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25lZWQgZGljdGlvbmFyeScsICAgICAvKiBaX05FRURfRElDVCAgICAgICAyICAqL1xuICAnMSc6ICAgICdzdHJlYW0gZW5kJywgICAgICAgICAgLyogWl9TVFJFQU1fRU5EICAgICAgMSAgKi9cbiAgJzAnOiAgICAnJywgICAgICAgICAgICAgICAgICAgIC8qIFpfT0sgICAgICAgICAgICAgIDAgICovXG4gICctMSc6ICAgJ2ZpbGUgZXJyb3InLCAgICAgICAgICAvKiBaX0VSUk5PICAgICAgICAgKC0xKSAqL1xuICAnLTInOiAgICdzdHJlYW0gZXJyb3InLCAgICAgICAgLyogWl9TVFJFQU1fRVJST1IgICgtMikgKi9cbiAgJy0zJzogICAnZGF0YSBlcnJvcicsICAgICAgICAgIC8qIFpfREFUQV9FUlJPUiAgICAoLTMpICovXG4gICctNCc6ICAgJ2luc3VmZmljaWVudCBtZW1vcnknLCAvKiBaX01FTV9FUlJPUiAgICAgKC00KSAqL1xuICAnLTUnOiAgICdidWZmZXIgZXJyb3InLCAgICAgICAgLyogWl9CVUZfRVJST1IgICAgICgtNSkgKi9cbiAgJy02JzogICAnaW5jb21wYXRpYmxlIHZlcnNpb24nIC8qIFpfVkVSU0lPTl9FUlJPUiAoLTYpICovXG59O1xuIiwiJ3VzZSBzdHJpY3QnO1xuXG5cbnZhciB1dGlscyA9IHJlcXVpcmUoJy4uL3V0aWxzL2NvbW1vbicpO1xuXG4vKiBQdWJsaWMgY29uc3RhbnRzID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cblxuXG4vL3ZhciBaX0ZJTFRFUkVEICAgICAgICAgID0gMTtcbi8vdmFyIFpfSFVGRk1BTl9PTkxZICAgICAgPSAyO1xuLy92YXIgWl9STEUgICAgICAgICAgICAgICA9IDM7XG52YXIgWl9GSVhFRCAgICAgICAgICAgICAgID0gNDtcbi8vdmFyIFpfREVGQVVMVF9TVFJBVEVHWSAgPSAwO1xuXG4vKiBQb3NzaWJsZSB2YWx1ZXMgb2YgdGhlIGRhdGFfdHlwZSBmaWVsZCAodGhvdWdoIHNlZSBpbmZsYXRlKCkpICovXG52YXIgWl9CSU5BUlkgICAgICAgICAgICAgID0gMDtcbnZhciBaX1RFWFQgICAgICAgICAgICAgICAgPSAxO1xuLy92YXIgWl9BU0NJSSAgICAgICAgICAgICA9IDE7IC8vID0gWl9URVhUXG52YXIgWl9VTktOT1dOICAgICAgICAgICAgID0gMjtcblxuLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cblxuXG5mdW5jdGlvbiB6ZXJvKGJ1ZikgeyB2YXIgbGVuID0gYnVmLmxlbmd0aDsgd2hpbGUgKC0tbGVuID49IDApIHsgYnVmW2xlbl0gPSAwOyB9IH1cblxuLy8gRnJvbSB6dXRpbC5oXG5cbnZhciBTVE9SRURfQkxPQ0sgPSAwO1xudmFyIFNUQVRJQ19UUkVFUyA9IDE7XG52YXIgRFlOX1RSRUVTICAgID0gMjtcbi8qIFRoZSB0aHJlZSBraW5kcyBvZiBibG9jayB0eXBlICovXG5cbnZhciBNSU5fTUFUQ0ggICAgPSAzO1xudmFyIE1BWF9NQVRDSCAgICA9IDI1ODtcbi8qIFRoZSBtaW5pbXVtIGFuZCBtYXhpbXVtIG1hdGNoIGxlbmd0aHMgKi9cblxuLy8gRnJvbSBkZWZsYXRlLmhcbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogSW50ZXJuYWwgY29tcHJlc3Npb24gc3RhdGUuXG4gKi9cblxudmFyIExFTkdUSF9DT0RFUyAgPSAyOTtcbi8qIG51bWJlciBvZiBsZW5ndGggY29kZXMsIG5v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ZWVbUkVQWl8zXzEwKjJdLyouRnJlcSovKys7XG5cbiAgICB9IGVsc2Uge1xuICAgICAgcy5ibF90cmVlW1JFUFpfMTFfMTM4KjJdLyouRnJlcSovKys7XG4gICAgfVxuXG4gICAgY291bnQgPSAwO1xuICAgIHByZXZsZW4gPSBjdXJsZW47XG5cbiAgICBpZiAobmV4dGxlbiA9PT0gMCkge1xuICAgICAgbWF4X2NvdW50ID0gMTM4O1xuICAgICAgbWluX2NvdW50ID0gMztcblxuICAgIH0gZWxzZSBpZiAoY3VybGVuID09PSBuZXh0bGVuKSB7XG4gICAgICBtYXhfY291bnQgPSA2O1xuICAgICAgbWluX2NvdW50ID0gMztcblxuICAgIH0gZWxzZSB7XG4gICAgICBtYXhfY291bnQgPSA3O1xuICAgICAgbWluX2NvdW50ID0gNDtcbiAgICB9XG4gIH1cbn1cblxuXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIFNlbmQgYSBsaXRlcmFsIG9yIGRpc3RhbmNlIHRyZWUgaW4gY29tcHJlc3NlZCBmb3JtLCB1c2luZyB0aGUgY29kZXMgaW5cbiAqIGJsX3RyZWUuXG4gKi9cbmZ1bmN0aW9uIHNlbmRfdHJlZShzLCB0cmVlLCBtYXhfY29kZSlcbi8vICAgIGRlZmxhdGVfc3RhdGUgKnM7XG4vLyAgICBjdF9kYXRhICp0cmVlOyAvKiB0aGUgdHJlZSB0byBiZSBzY2FubmVkICovXG4vLyAgICBpbnQgbWF4X2NvZGU7ICAgICAgIC8qIGFuZCBpdHMgbGFyZ2VzdCBjb2RlIG9mIG5vbiB6ZXJvIGZyZXF1ZW5jeSAqL1xue1xuICB2YXIgbjsgICAgICAgICAgICAgICAgICAgICAvKiBpdGVyYXRlcyBvdmVyIGFsbCB0cmVlIGVsZW1lbnRzICovXG4gIHZhciBwcmV2bGVuID0gLTE7ICAgICAgICAgIC8qIGxhc3Q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ZXMgPSB0aGlzLl9iaW5kaW5nLndyaXRlU3luYyhmbHVzaEZsYWcsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2h1bmssIC8vIGluXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5PZmYsIC8vIGluX29mZlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF2YWlsSW5CZWZvcmUsIC8vIGluX2xlblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2J1ZmZlciwgLy8gb3V0XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fb2Zmc2V0LCAvL291dF9vZmZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdmFpbE91dEJlZm9yZSk7IC8vIG91dF9sZW5cbiAgICB9IHdoaWxlICghdGhpcy5faGFkRXJyb3IgJiYgY2FsbGJhY2socmVzWzBdLCByZXNbMV0pKTtcblxuICAgIGlmICh0aGlzLl9oYWRFcnJvcikge1xuICAgICAgdGhyb3cgZXJyb3I7XG4gICAgfVxuXG4gICAgdmFyIGJ1ZiA9IEJ1ZmZlci5jb25jYXQoYnVmZmVycywgbnJlYWQpO1xuICAgIHRoaXMuY2xvc2UoKTtcblxuICAgIHJldHVybiBidWY7XG4gIH1cblxuICB2YXIgcmVxID0gdGhpcy5fYmluZGluZy53cml0ZShmbHVzaEZsYWcsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNodW5rLCAvLyBpblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbk9mZiwgLy8gaW5fb2ZmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF2YWlsSW5CZWZvcmUsIC8vIGluX2xlblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9idWZmZXIsIC8vIG91dFxuICAgICAgICAgICAgICAgICAgICAg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Vua1NpemU7XG4gICAgICBzZWxmLl9vZmZzZXQgPSAwO1xuICAgICAgc2VsZi5fYnVmZmVyID0gbmV3IEJ1ZmZlcihzZWxmLl9jaHVua1NpemUpO1xuICAgIH1cblxuICAgIGlmIChhdmFpbE91dEFmdGVyID09PSAwKSB7XG4gICAgICAvLyBOb3QgYWN0dWFsbHkgZG9uZS4gIE5lZWQgdG8gcmVwcm9jZXNzLlxuICAgICAgLy8gQWxzbywgdXBkYXRlIHRoZSBhdmFpbEluQmVmb3JlIHRvIHRoZSBhdmFpbEluQWZ0ZXIgdmFsdWUsXG4gICAgICAvLyBzbyB0aGF0IGlmIHdlIGhhdmUgdG8gaGl0IGl0IGEgdGhpcmQgKGZvdXJ0aCwgZXRjLikgdGltZSxcbiAgICAgIC8vIGl0J2xsIGhhdmUgdGhlIGNvcnJlY3QgYnl0ZSBjb3VudHMuXG4gICAgICBpbk9mZiArPSAoYXZhaWxJbkJlZm9yZSAtIGF2YWlsSW5BZnRlcik7XG4gICAgICBhdmFpbEluQmVmb3JlID0gYXZhaWxJbkFmdGVyO1xuXG4gICAgICBpZiAoIWFzeW5jKVxuICAgICAgICByZXR1cm4gdHJ1ZTtcblxuICAgICAgdmFyIG5ld1JlcSA9IHNlbGYuX2JpbmRpbmcud3JpdGUoZmx1c2hGbGFnLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2h1bmssXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbk9mZixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF2YWlsSW5CZWZvcmUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9idWZmZXIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9vZmZzZXQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9jaHVua1NpemUpO1xuICAgICAgbm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sZW1lbnQgPSBtZXRhSGVhZGVyRGF0YVNldC5lbGVtZW50cy54MDAwMjAwMTA7XG4gICAgICAgICAgICByZXR1cm4gZGljb21QYXJzZXIucmVhZEZpeGVkU3RyaW5nKGJ5dGVBcnJheSwgdHJhbnNmZXJTeW50YXhFbGVtZW50LmRhdGFPZmZzZXQsIHRyYW5zZmVyU3ludGF4RWxlbWVudC5sZW5ndGgpO1xuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gaXNFeHBsaWNpdCh0cmFuc2ZlclN5bnRheCkge1xuICAgICAgICAgICAgaWYodHJhbnNmZXJTeW50YXggPT09ICcxLjIuODQwLjEwMDA4LjEuMicpIC8vIGltcGxpY2l0IGxpdHRsZSBlbmRpYW5cbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBhbGwgb3RoZXIgdHJhbnNmZXIgc3ludGF4ZXMgc2hvdWxkIGJlIGV4cGxpY2l0XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGdldERhdGFTZXRCeXRlU3RyZWFtKHRyYW5zZmVyU3ludGF4LCBwb3NpdGlvbikge1xuICAgICAgICAgICAgaWYodHJhbnNmZXJTeW50YXggPT09ICcxLjIuODQwLjEwMDA4LjEuMi4xLjk5JylcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAvLyBpZiBhbiBpbmZhbHRlciBjYWxsYmFjayBpcyByZWdpc3RlcmVkLCB1c2UgaXRcbiAgICAgICAgICAgICAgICBpZiAob3B0aW9ucyAmJiBvcHRpb25zLmluZmxhdGVyKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBmdWxsQnl0ZUFycmF5Q2FsbGJhY2sgPSBvcHRpb25zLmluZmxhdGVyKGJ5dGVBcnJheSwgcG9zaXRpb24pO1xuICAgICAgICAgICAgICAgICAgICByZX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5ID0gZGljb21QYXJzZXIuYWxsb2MoYnl0ZUFycmF5LCBpbmZsYXRlZC5sZW5ndGggKyBwb3NpdGlvbik7XG4gICAgICAgICAgICAgICAgICAgIGZ1bGxCeXRlQXJyYXkuc2V0KGJ5dGVBcnJheS5zbGljZSgwLCBwb3NpdGlvbiksIDApO1xuICAgICAgICAgICAgICAgICAgICBmdWxsQnl0ZUFycmF5LnNldChpbmZsYXRlZCwgcG9zaXRpb24pO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IGRpY29tUGFyc2VyLkJ5dGVTdHJlYW0oZGljb21QYXJzZXIubGl0dGxlRW5kaWFuQnl0ZUFycmF5UGFyc2VyLCBmdWxsQnl0ZUFycmF5LCAwKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gdGhyb3cgZXhjZXB0aW9uIHNpbmNlIG5vIGluZmxhdGVyIGlzIGF2YWlsYWJsZVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyAnZGljb21QYXJzZXIucGFyc2VEaWNvbTogbm8gaW5mbGF0ZXIgYXZhaWxhYmxlIHRvIGhhbmRsZSBkZWZsYXRlIHRyYW5zZmVyIHN5bnRheCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYodHJhbnNmZXJTeW50YXggPT09ICcxLjIuODQwLjEwMDA4LjEuMi4yJykgLy8gZXhwbGljaXQgYmlnIGVuZGlhblxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIHJldHVybiBuZXcgZGljb21QYXJzZXIuQnl0ZVN0cmVhbShkaWNvbVBhcnNlci5iaWdFbmRpYW5CeXRlQXJyYXlQYXJzZXIsIGJ5dGVBcnJheSwgcG9zaXRpb24pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIC8vIGFsbCBvdGhlciB0cmFuc2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gICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIGRpY29tUGFyc2VyLnBhcnNlRGljb21EYXRhU2V0SW1wbGljaXQoZGF0YVNldCwgZGF0YVNldEJ5dGVTdHJlYW0sIGRhdGFTZXRCeXRlU3RyZWFtLmJ5dGVBcnJheS5sZW5ndGgsIG9wdGlvbnMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNhdGNoKGUpIHtcbiAgICAgICAgICAgICAgICB2YXIgZXggPSB7XG4gICAgICAgICAgICAgICAgICAgIGV4Y2VwdGlvbjogZSxcbiAgICAgICAgICAgICAgICAgICAgZGF0YVNldDogZGF0YVNldFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgdGhyb3cgZXg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gZGF0YVNldDtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIG1haW4gZnVuY3Rpb24gaGVyZVxuICAgICAgICBmdW5jdGlvbiBwYXJzZVRoZUJ5dGVTdHJlYW0oKSB7XG4gICAgICAgICAgICB2YXIgbWV0YUhlYWRlckRhdGFTZXQgPSBkaWNvbVBhcnNlci5yZWFkUGFydDEwSGVhZGVyKGJ5dGVBcnJheSwgb3B0aW9ucyk7XG5cbiAgICAgICAgICAgIHZhciBkYXRhU2V0ID0gcmVhZERhdGFTZXQobWV0YUhlYWRlckRhdGFTZXQpO1xuXG4gICAgICAgICAgICByZXR1cm4gbWVyZ2VEYXRhU2V0cyhtZXRhSGVhZGVyRGF0YVNldCwgZGF0YVNldCk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBUaGlzIGlzIHdoZXJlIHdlIGFjdHVhbGx5IHN0YXJ0IHBhcnNpbmdcbiAgICAgICAgcmV0dXJuIHBhcnNlVGhlQnl0ZVN0cmVhbSgpO1xuICAgIH07XG5cbiAgICByZXR1cm4gZGljb21QYXJzZXI7XG59KShkaWNvbVBhcnNlcik7XG5c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y8gbWF4aW11bSBlbGVtZW50IGxlbmd0aCB0byB0cnkgYW5kIGNvbnZlcnQgdG8gc3RyaW5nIGZvcm1hdFxuICAgICAgICB9O1xuXG4gICAgICAgIHZhciByZXN1bHQgPSB7XG5cbiAgICAgICAgfTtcblxuICAgICAgICBmb3IodmFyIHRhZyBpbiBkYXRhU2V0LmVsZW1lbnRzKSB7XG4gICAgICAgICAgICB2YXIgZWxlbWVudCA9IGRhdGFTZXQuZWxlbWVudHNbdGFnXTtcblxuICAgICAgICAgICAgLy8gc2tpcCB0aGlzIGVsZW1lbnQgaWYgaXQgYSBwcml2YXRlIGVsZW1lbnQgYW5kIG91ciBvcHRpb25zIHNwZWNpZnkgdGhhdCB3ZSBzaG91bGRcbiAgICAgICAgICAgIGlmKG9wdGlvbnMub21pdFByaXZhdGVBdHRpYnV0ZXMgPT09IHRydWUgJiYgZGljb21QYXJzZXIuaXNQcml2YXRlVGFnKHRhZykpXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmKGVsZW1lbnQuaXRlbXMpIHtcbiAgICAgICAgICAgICAgICAvLyBoYW5kbGUgc2VxdWVuY2VzXG4gICAgICAgICAgICAgICAgdmFyIHNlcXVlbmNlSXRlbXMgPSBbXTtcbiAgICAgICAgICAgICAgICBmb3IodmFyIGk9MDsgaSA8IGVsZW1lbnQuaXRlbXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgc2VxdWVuY2VJdGVtcy5wdXNoKGRpY29tUGFyc2VyLmV4cGxpY2l0RGF0YVNldFRvSlMoZWxlbWVudC5pdGVtc1tpXS5kYXRhU2V0LCBvcHRpb25zKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJlc3VsdFt0YWddID0gc2VxdWVuY2VJdGVtcztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIGFzU3RyaW5nO1xuICAgICAgICAgICAgICAgIGFzU3RyaW5nID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIGlmKGVsZW1lbnQubGVuZ3RoIDwgb3B0aW9ucy5tYXhFbGVtZW50TGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGFzU3RyaW5nID0gZGljb21QYXJzZXIuZXhwbGljaXRFbGVtZW50VG9TdHJpbmcoZGF0YVNldCwgZWxlbWVudCk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYoYXNTdHJpbmcgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHRbdGFnXSA9IGFzU3RyaW5nO1xuICAgICAgICAgICAgICAgIH0gIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHRbdGFnXSA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFPZmZzZXQ6IGVsZW1lbnQuZGF0YU9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aCA6IGVsZW1lbnQubGVuZ3RoXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9O1xuXG5cbiAgICByZXR1cm4gZGljb21QYXJzZXI7XG59KGRpY29tUGFyc2VyKSk7XG52YXIgZGljb21QYXJzZXIgPSAoZnVuY3Rpb24gKGRpY29tUGFyc2VyKSB7XG4gICAgXCJ1c2Ugc3RyaWN0XCI7XG5cbiAgICBpZiAoZGljb21QYXJzZXIgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICBkaWNvbVBhcnNlciA9IHt9O1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIENvbnZlcnRzIGFuIGV4cGxpY2l0IFZSIGVsZW1lbnQgdG8gYSBzdHJpbmcgb3IgdW5kZWZpbmVkIGlmIGl0IGlzIG5vdCBwb3NzaWJsZSB0byBjb252ZXJ0LlxuICAgICAqIFRocm93cyBhbiBlcnJvciBpZiBhbiBpbXBsaWNpdCBlbGVtZW50IGlzIHN1cHBsaWVkXG4gICAgICogQHBhcmFtIGRhdGFTZXRcbiAgICAgKiBAcGFyYW0gZWxlbWVudFxuICAgICAqIEByZXR1cm5zIHsqfVxuICAgICAqL1xuICAgIGRpY29tUGFyc2VyLmV4cGxpY2l0RWxlbWVudFRvU3RyaW5nID0gZnVuY3Rpb24oZGF0YVNldCwgZWxlbWVudClcbiAgICB7XG4gICAgICAgIGlmKGRhdGFTZXQgPT09IHVuZGVmaW5lZCB8fCBlbGVtZW50ID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIHRocm93ICdkaWNvbVBhcnNlci5leHBsaWNpdEVsZW1lbnRUb1N0cmluZzogbWlzc2luZyByZXF1aXJlZCBwYXJhbWV0ZXJzJztcbiAgICAgICAgfVxuICAgICAgICBpZihlbGVtZW50LnZyID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIHRocm93ICdkaWNvbVBhcnNlci5leHBsaWNpdEVsZW1lbnRUb1N0cmluZzogY2Fubm90IGNvbnZlcnQgaW1wbGljaXQgZWxlbWVudCB0byBzdHJpbmcnO1xuICAgICAgICB9XG4gICAgICAgIHZhciB2ciA9IGVsZW1lbnQudnI7XG4gICAgICAgIHZhciB0YWcgPSBlbGVtZW50LnRhZztcblxuICAgICAgICB2YXIgdGV4dFJlc3VsdDtcblxuICAgICAgICBmdW5jdGlvbiBtdWx0aUVsZW1lbnRUb1N0cmluZyhudW1JdGVtcywgZnVuYykge1xuICAgICAgICAgICAgdmFyIHJlc3VsdCA9IFwiXCI7XG4gICAgICAgICAgICBmb3IodmFyIGk9MDsgaSA8IG51bUl0ZW1zOyBpKyspIHtcbiAgICAgICAgICAgICAgICBpZihpICE9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAnLyc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJlc3VsdCArPSBmdW5jLmNhbGwoZGF0YVNldCwgdGFnLCBpKS50b1N0cmluZygpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmKGRpY29tUGFyc2VyLmlzU3RyaW5nVnIodnIpID09PSB0cnVlKVxuICAgICAgICB7XG4gICAgICAgICAgICB0ZXh0UmVzdWx0ID0gZGF0YVNldC5zdHJpbmcodGFnKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICh2ciA9PSAnQVQnKSB7XG4gICAgICAgICAgICB2YXIgbnVtID0gZGF0YVNldC51aW50MzIodGFnKTtcbiAgICAgICAgICAgIGlmKG51bSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChudW0gPCAwKVxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIG51bSA9IDB4RkZGRkZGRkYgKyBudW0gKyAxO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gJ3gnICsgbnVtLnRvU3RyaW5nKDE2KS50b1VwcGVyQ2FzZSgpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHZyID09ICdVUycpXG4gICAgICAgIHtcbiAgICAgICAgICAgIHRleHRSZXN1bHQgPSBtdWx0aUVsZW1lbnRUb1N0cmluZyhlbGVtZW50Lmxlbmd0aCAvIDIsIGRhdGFTZXQudWludDE2KTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmKHZyID09PSAnU1MnKVxuICAgICAgICB7XG4gICAgICAgICAgICB0ZXh0UmVzdWx0ID0gbXVsdGlFbGVtZW50VG9TdHJpbmcoZWxlbWVudC5sZW5ndGggLyAyLCBkYXRhU2V0LmludDE2KTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGl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uXG4gICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgfTtcblxuICByZXR1cm4gZGljb21QYXJzZXI7XG59KGRpY29tUGFyc2VyKSk7XG4vKipcbiAqIFV0aWxpdHkgZnVuY3Rpb25zIGZvciBkZWFsaW5nIHdpdGggRElDT01cbiAqL1xuXG52YXIgZGljb21QYXJzZXIgPSAoZnVuY3Rpb24gKGRpY29tUGFyc2VyKVxue1xuICAgIFwidXNlIHN0cmljdFwiO1xuXG4gICAgaWYoZGljb21QYXJzZXIgPT09IHVuZGVmaW5lZClcbiAgICB7XG4gICAgICAgIGRpY29tUGFyc2VyID0ge307XG4gICAgfVxuXG4gICAgdmFyIHN0cmluZ1ZycyA9IHtcbiAgICAgICAgQUU6IHRydWUsXG4gICAgICAgIEFTOiB0cnVlLFxuICAgICAgICBBVDogZmFsc2UsXG4gICAgICAgIENTOiB0cnVlLFxuICAgICAgICBEQTogdHJ1ZSxcbiAgICAgICAgRFM6IHRydWUsXG4gICAgICAgIERUOiB0cnVlLFxuICAgICAgICBGTDogZmFsc2UsXG4gICAgICAgIEZEOiBmYWxzZSxcbiAgICAgICAgSVM6IHRydWUsXG4gICAgICAgIExPOiB0cnVlLFxuICAgICAgICBMVDogdHJ1ZSxcbiAgICAgICAgT0I6IGZhbHNlLFxuICAgICAgICBPRDogZmFsc2UsXG4gICAgICAgIE9GOiBmYWxzZSxcbiAgICAgICAgT1c6IGZhbHNlLFxuICAgICAgICBQTjogdHJ1ZSxcbiAgICAgICAgU0g6IHRydWUsXG4gICAgICAgIFNMOiBmYWxzZSxcbiAgICAgICAgU1E6IGZhbHNlLFxuICAgICAgICBTUzogZmFsc2UsXG4gICAgICAgIFNUOiB0cnVlLFxuICAgICAgICBUTTogdHJ1ZSxcbiAgICAgICAgVUk6IHRydWUsXG4gICAgICAgIFVMOiBmYWxzZSxcbiAgICAgICAgVU46IHVuZGVmaW5lZCwgLy8gZHVubm9cbiAgICAgICAgVVI6IHRydWUsXG4gICAgICAgIFVTO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mIGJ1ZmZlcic7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciB1aW50MzIgPSAoMjU2ICogKDI1NiAqICgyNTYgKiBieXRlQXJyYXlbcG9zaXRpb25dICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQXJyYXlbcG9zaXRpb24gKyAxXSkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVBcnJheVtwb3NpdGlvbiArIDJdKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUFycmF5W3Bvc2l0aW9uICsgM10pO1xuXG4gICAgICAgICAgICByZXR1cm4gdWludDMyO1xuICAgICAgICB9LFxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBQYXJzZXMgYSBzaWduZWQgaW50IDMyIGZyb20gYSBiaWctZW5kaWFuIGJ5dGUgYXJyYXlcbiAgICAgICAgICpcbiAgICAgICAgICogQHBhcmFtIGJ5dGVBcnJheSB0aGUgYnl0ZSBhcnJheSB0byByZWFkIGZyb21cbiAgICAgICAgICogQHBhcmFtIHBvc2l0aW9uIHRoZSBwb3NpdGlvbiBpbiB0aGUgYnl0ZSBhcnJheSB0byByZWFkIGZyb21cbiAgICAgICAgICogQHJldHVybnMgeyp9IHRoZSBwYXJzZWQgc2lnbmVkIGludCAzMlxuICAgICAgICAgKiBAdGhyb3dzIGVycm9yIGlmIGJ1ZmZlciBvdmVycmVhZCB3b3VsZCBvY2N1clxuICAgICAgICAgKiBAYWNjZXNzIHByaXZhdGVcbiAgICAgICAgICovXG4gICAgICAgIHJlYWRJbnQzMjogZnVuY3Rpb24gKGJ5dGVBcnJheSwgcG9zaXRpb24pIHtcbiAgICAgICAgICAgIGlmIChwb3NpdGlvbiA8IDApIHtcbiAgICAgICAgICAgICAgICB0aHJvdyAnYmlnRW5kaWFuQnl0ZUFycmF5UGFyc2VyLnJlYWRJbnQzMjogcG9zaXRpb24gY2Fubm90IGJlIGxlc3MgdGhhbiAwJztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHBvc2l0aW9uICsgNCA+IGJ5dGVBcnJheS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyAnYmlnRW5kaWFuQnl0ZUFycmF5UGFyc2VyLnJlYWRJbnQzMjogYXR0ZW1wdCB0byByZWFkIHBhc3QgZW5kIG9mIGJ1ZmZlcic7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciBpbnQzMiA9ICgoYnl0ZUFycmF5W3Bvc2l0aW9uXSA8PCAyNCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgIChieXRlQXJyYXlbcG9zaXRpb24gKyAxXSA8PCAxNikgK1xuICAgICAgICAgICAgICAgICAgICAgICAgIChieXRlQXJyYXlbcG9zaXRpb24gKyAyXSA8PCA4KSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVBcnJheVtwb3NpdGlvbiArIDNdKTtcblxuICAgICAgICAgICAgcmV0dXJuIGludDMyO1xuICAgICAgICB9LFxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBQYXJzZXMgMzItYml0IGZsb2F0IGZyb20gYSBiaWctZW5kaWFuIGJ5dGUgYXJyYXlcbiAgICAgICAgICpcbiAgICAgICAgICogQHBhcmFtIGJ5dGVBcnJheSB0aGUgYnl0ZSBhcnJheSB0byByZWFkIGZyb21cbiAgICAgICAgICogQHBhcmFtIHBvc2l0aW9uIHRoZSBwb3NpdGlvbiBpbiB0aGUgYnl0ZSBhcnJheSB0byByZWFkIGZyb21cbiAgICAgICAgICogQHJldHVybnMgeyp9IHRoZSBwYXJzZWQgMzItYml0IGZsb2F0XG4gICAgICAgICAqIEB0aHJvd3MgZXJyb3IgaWYgYnVmZmVyIG92ZXJyZWFkIHdvdWxkIG9jY3VyXG4gICAgICAgICAqIEBhY2Nlc3MgcHJpdmF0ZVxuICAgICAg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jZXNzIHByaXZhdGVcbiAgICAgKi9cbiAgICBkaWNvbVBhcnNlci5yZWFkRml4ZWRTdHJpbmcgPSBmdW5jdGlvbihieXRlQXJyYXksIHBvc2l0aW9uLCBsZW5ndGgpXG4gICAge1xuICAgICAgICBpZihsZW5ndGggPCAwKVxuICAgICAgICB7XG4gICAgICAgICAgICB0aHJvdyAnZGljb21QYXJzZXIucmVhZEZpeGVkU3RyaW5nIC0gbGVuZ3RoIGNhbm5vdCBiZSBsZXNzIHRoYW4gMCc7XG4gICAgICAgIH1cblxuICAgICAgICBpZihwb3NpdGlvbiArIGxlbmd0aCA+IGJ5dGVBcnJheS5sZW5ndGgpIHtcbiAgICAgICAgICAgIHRocm93ICdkaWNvbVBhcnNlci5yZWFkRml4ZWRTdHJpbmc6IGF0dGVtcHQgdG8gcmVhZCBwYXN0IGVuZCBvZiBidWZmZXInO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIHJlc3VsdCA9IFwiXCI7XG4gICAgICAgIHZhciBieXRlO1xuICAgICAgICBmb3IodmFyIGk9MDsgaSA8IGxlbmd0aDsgaSsrKVxuICAgICAgICB7XG4gICAgICAgICAgICBieXRlID0gYnl0ZUFycmF5W3Bvc2l0aW9uICsgaV07XG4gICAgICAgICAgICBpZihieXRlID09PSAwKSB7XG4gICAgICAgICAgICAgICAgcG9zaXRpb24gKz0gIGxlbmd0aDtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0ICs9IFN0cmluZy5mcm9tQ2hhckNvZGUoYnl0ZSk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH07XG5cblxuICAgIHJldHVybiBkaWNvbVBhcnNlcjtcbn0oZGljb21QYXJzZXIpKTtcbi8qKlxuICpcbiAqIEludGVybmFsIGhlbHBlciBjbGFzcyB0byBhc3Npc3Qgd2l0aCBwYXJzaW5nLiBTdXBwb3J0cyByZW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FkaW5nIHNwYWNlcyBwcmVzZXJ2ZWQgYW5kIHRyYWlsaW5nIHNwYWNlcyByZW1vdmVkLlxuICAgICAqXG4gICAgICogVXNlIHRoaXMgZnVuY3Rpb24gdG8gYWNjZXNzIGRhdGEgZm9yIFZScyBvZiB0eXBlIFVULCBTVCBhbmQgTFRcbiAgICAgKlxuICAgICAqIEBwYXJhbSB0YWdcbiAgICAgKiBAcGFyYW0gaW5kZXhcbiAgICAgKiBAcmV0dXJucyB7Kn1cbiAgICAgKi9cbiAgICBkaWNvbVBhcnNlci5EYXRhU2V0LnByb3RvdHlwZS50ZXh0ID0gZnVuY3Rpb24odGFnLCBpbmRleClcbiAgICB7XG4gICAgICAgIHZhciBlbGVtZW50ID0gdGhpcy5lbGVtZW50c1t0YWddO1xuICAgICAgICBpZihlbGVtZW50ICYmIGVsZW1lbnQubGVuZ3RoID4gMClcbiAgICAgICAge1xuICAgICAgICAgICAgdmFyIGZpeGVkU3RyaW5nID0gZGljb21QYXJzZXIucmVhZEZpeGVkU3RyaW5nKHRoaXMuYnl0ZUFycmF5LCBlbGVtZW50LmRhdGFPZmZzZXQsIGVsZW1lbnQubGVuZ3RoKTtcbiAgICAgICAgICAgIGlmKGluZGV4ID49IDApXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgdmFyIHZhbHVlcyA9IGZpeGVkU3RyaW5nLnNwbGl0KCdcXFxcJyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlc1tpbmRleF0ucmVwbGFjZSgvICskLywgJycpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIHJldHVybiBmaXhlZFN0cmluZy5yZXBsYWNlKC8gKyQvLCAnJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICB9O1xuXG4gICAgLyoqXG4gICAgICogUGFyc2VzIGEgc3RyaW5nI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ubGVuZ3RoID0gYnl0ZVN0cmVhbS5wb3NpdGlvbiAtIGVsZW1lbnQuZGF0YU9mZnNldDtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmKHRhZyA9PT0gJ3hmZmZlZTAwMCcpXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgZWxlbWVudC5mcmFnbWVudHMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgIG9mZnNldDogYnl0ZVN0cmVhbS5wb3NpdGlvbiAtIGJhc2VPZmZzZXQgLSA4LFxuICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA6IGJ5dGVTdHJlYW0ucG9zaXRpb24sXG4gICAgICAgICAgICAgICAgICAgIGxlbmd0aCA6IGxlbmd0aFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYod2FybmluZ3MpIHtcbiAgICAgICAgICAgICAgICAgICAgd2FybmluZ3MucHVzaCgndW5leHBlY3RlZCB0YWcgJyArIHRhZyArICcgd2hpbGUgc2VhcmNoaW5nIGZvciBlbmQgb2YgcGl4ZWwgZGF0YSBlbGVtZW50IHdpdGggdW5kZWZpbmVkIGxlbmd0aCcpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZihsZW5ndGggPiBieXRlU3RyZWFtLmJ5dGVBcnJheS5sZW5ndGggLSBieXRlU3RyZWFtLnBvc2l0aW9uKVxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gZml4IGxlbmd0aFxuICAgICAgICAgICAgICAgICAgICBsZW5ndGggPSBieXRlU3RyZWFtLmJ5dGVBcnJheS5sZW5ndGggLSBieXRlU3RyZWFtLnBvc2l0aW9uO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbGVtZW50LmZyYWdtZW50cy5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgb2Zmc2V0OiBieXRlU3RyZWFtLnBvc2l0aW9uIC0gYmFzZU9mZnNldCAtIDgsXG4gICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uIDogYnl0ZVN0cmVhbS5wb3NpdGlvbixcbiAgICAgICAgICAgICAgICAgICAgbGVuZ3RoIDogbGVuZ3RoXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgYnl0ZVN0cmVhbS5zZWVrKGxlbmd0aCk7XG4gICAgICAgICAgICAgICAgZWxlbWVudC5sZW5ndGggPSBieXRlU3RyZWFtLnBvc2l0aW9uIC0gZWxlbWVudC5kYXRhT2Zmc2V0O1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYnl0ZVN0cmVhbS5zZWVrKGxlbmd0aCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZih3YXJuaW5ncykge1xuICAgICAgICAgICAgd2FybmluZ3MucHVzaChcInBpeGVsIGRhdGEgZWxlbWVudCBcIiArIGVsZW1lbnQudGFnICsgXCIgbWlzc2luZyBzZXF1ZW5jZSBkZWxpbWl0ZXIgdGFnIHhmZmZlZTBkZFwiKTtcbiAgICAgICAgfVxuICAgIH07XG5cblxuICAgIHJldHVybiBkaWNvbVBhcnNlcjtcbn0oZGljb21QYXJzZXIpKTtcbi8qKlxuICogSW50ZXJuYWwgaGVscGVyIGZ1bmN0aW9ucyBmb3IgcGFyc2luZyBESUNPTSBlbGVtZW50c1xuICovXG5cbnZhciBkaWNvbVBhcnNlciA9IChmdW5jdGlvbiAoZGljb21QYXJzZXIpXG57XG4gICAgXCJ1c2Ugc3RyaWN0XCI7XG5cbiAgICBpZihkaWNvbVBhcnNlciA9PT0gdW5kZWZpbmVkKVxuICAgIHtcbiAgICAgICAgZGljb21QYXJzZXIgPSB7fTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiByZWFkcyBmcm9tIHRoZSBieXRlIHN0c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ogQHJldHVybnMgeyp9IHRoZSBwYXJzZWQgc2lnbmVkIGludCAxNlxuICAgICAgICAgKiBAdGhyb3dzIGVycm9yIGlmIGJ1ZmZlciBvdmVycmVhZCB3b3VsZCBvY2N1clxuICAgICAgICAgKiBAYWNjZXNzIHByaXZhdGVcbiAgICAgICAgICovXG4gICAgICAgIHJlYWRJbnQxNjogZnVuY3Rpb24gKGJ5dGVBcnJheSwgcG9zaXRpb24pIHtcbiAgICAgICAgICAgIGlmIChwb3NpdGlvbiA8IDApIHtcbiAgICAgICAgICAgICAgICB0aHJvdyAnbGl0dGxlRW5kaWFuQnl0ZUFycmF5UGFyc2VyLnJlYWRJbnQxNjogcG9zaXRpb24gY2Fubm90IGJlIGxlc3MgdGhhbiAwJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChwb3NpdGlvbiArIDIgPiBieXRlQXJyYXkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgJ2xpdHRsZUVuZGlhbkJ5dGVBcnJheVBhcnNlci5yZWFkSW50MTY6IGF0dGVtcHQgdG8gcmVhZCBwYXN0IGVuZCBvZiBidWZmZXInO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIGludDE2ID0gYnl0ZUFycmF5W3Bvc2l0aW9uXSArIChieXRlQXJyYXlbcG9zaXRpb24gKyAxXSA8PCA4KTtcbiAgICAgICAgICAgIC8vIGZpeCBzaWduXG4gICAgICAgICAgICBpZiAoaW50MTYgJiAweDgwMDApIHtcbiAgICAgICAgICAgICAgICBpbnQxNiA9IGludDE2IC0gMHhGRkZGIC0gMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBpbnQxNjtcbiAgICAgICAgfSxcblxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBQYXJzZXMgYW4gdW5zaWduZWQgaW50IDMyIGZyb20gYSBsaXR0bGUtZW5kaWFuIGJ5dGUgYXJyYXlcbiAgICAgICAgICpcbiAgICAgICAgIC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hZykge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG5cbiAgICByZXR1cm4gZGljb21QYXJzZXI7XG59KGRpY29tUGFyc2VyKSk7XG5cbi8qKlxuICogSW50ZXJuYWwgaGVscGVyIGZ1bmN0aW9ucyBmb3IgZm9yIHBhcnNpbmcgRElDT00gZWxlbWVudHNcbiAqL1xuXG52YXIgZGljb21QYXJzZXIgPSAoZnVuY3Rpb24gKGRpY29tUGFyc2VyKVxue1xuICAgIFwidXNlIHN0cmljdFwiO1xuXG4gICAgaWYoZGljb21QYXJzZXIgPT09IHVuZGVmaW5lZClcbiAgICB7XG4gICAgICAgIGRpY29tUGFyc2VyID0ge307XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZ2V0RGF0YUxlbmd0aFNpemVJbkJ5dGVzRm9yVlIodnIpXG4gICAge1xuICAgICAgICBpZiggdnIgPT09ICdPQicgfHxcbiAgICAgICAgICAgIHZyID09PSAnT1cnIHx8XG4gICAgICAgICAgICB2ciA9PT0gJ1NRJyB8fFxuICAgICAgICAgICAgdnIgPT09ICdPRicgfHxcbiAgICAgICAgICAgIHZyID09PSAnVVQnIHx8XG4gICAgICAgICAgICB2ciA9PT0gJ1VOJylcbiAgICAgICAge1xuICAgICAgICAgICAgcmV0dXJuIDQ7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZVxuICAgICAgICB7XG4gICAgICAgICAgICByZXR1cm4gMjtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGRpY29tUGFyc2VyLnJlYWREaWNvbUVsZW1lbnRFeHBsaWNpdCA9IGZ1bmN0aW9uKGJ5dGVTdHJlYW0sIHdhcm5pbmdzLCB1bnRpbFRhZylcbiAgICB7XG4gICAgICAgIGlmKGJ5dGVTdHJlYW0gPT09IHVuZGVmaW5lZClcbiAgICAgICAge1xuICAgICAgICAgICAgdGhyb3cgXCJkaWNvbVBhcnNlci5yZWFkRGljb21FbGVtZW50RX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lZExlbmd0aCA9IHRydWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZihlbGVtZW50LnRhZyA9PT0gdW50aWxUYWcpIHtcbiAgICAgICAgICAgIHJldHVybiBlbGVtZW50O1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gaWYgVlIgaXMgU1EsIHBhcnNlIHRoZSBzZXF1ZW5jZSBpdGVtc1xuICAgICAgICBpZihlbGVtZW50LnZyID09PSAnU1EnKVxuICAgICAgICB7XG4gICAgICAgICAgICBkaWNvbVBhcnNlci5yZWFkU2VxdWVuY2VJdGVtc0V4cGxpY2l0KGJ5dGVTdHJlYW0sIGVsZW1lbnQsIHdhcm5pbmdzKTtcbiAgICAgICAgICAgIHJldHVybiBlbGVtZW50O1xuICAgICAgICB9XG5cblxuICAgICAgICBpZihlbGVtZW50Lmxlbmd0aCA9PT0gNDI5NDk2NzI5NSlcbiAgICAgICAge1xuICAgICAgICAgICAgaWYoZWxlbWVudC50YWcgPT09ICd4N2ZlMDAwMTAnKSB7XG4gICAgICAgICAgICAgICAgZGljb21QYXJzZXIuZmluZEVuZE9mRW5jYXBzdWxhdGVkRWxlbWVudChieXRlU3RyZWFtLCBlbGVtZW50LCB3YXJuaW5ncyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGVsZW1lbnQ7XG4gICAgICAgICAgICB9ICAgZWxzZSBpZihlbGVtZW50LnZyID09PSAnVU4nKSB7XG4gICAgICAgICAgICAgICAgZGljb21QYXJzZXIuZmluZEFuZFNldFVORWxlbWVudExlbmd0aChieXRlU3RyZWFtLCBlbGVtZW50KTtcbiAgICAgICAgICAgICAgICByZXR1cm4gZWxlbWVudDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgZGljb21QYXJzZXIucmVhZFNlcXVlbmNlSXRlbXNJbXBsaWNpdChieXRlU3RyZWFtLCBlbGVtZW50KTtcbiAgICAgICAgICAgICAgICAvL2RpY29tUGFyc2VyLmZpbmRJdGVtRGVsaW1pdGF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ICBjYXNlIDB4RkZEQjpcbiAgICAgICAgICAgICAgICB0aGlzLnF1YW50VGFibGUucmVhZCh0aGlzLnN0cmVhbSwganBlZy5sb3NzbGVzcy5EZWNvZGVyLlRBQkxFKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMHhGRkREOlxuICAgICAgICAgICAgICAgIHRoaXMucmVzdGFydEludGVydmFsID0gdGhpcy5yZWFkTnVtYmVyKCk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDB4RkZFMDpcbiAgICAgICAgICAgIGNhc2UgMHhGRkUxOlxuICAgICAgICAgICAgY2FzZSAweEZGRTI6XG4gICAgICAgICAgICBjYXNlIDB4RkZFMzpcbiAgICAgICAgICAgIGNhc2UgMHhGRkU0OlxuICAgICAgICAgICAgY2FzZSAweEZGRTU6XG4gICAgICAgICAgICBjYXNlIDB4RkZFNjpcbiAgICAgICAgICAgIGNhc2UgMHhGRkU3OlxuICAgICAgICAgICAgY2FzZSAweEZGRTg6XG4gICAgICAgICAgICBjYXNlIDB4RkZFOTpcbiAgICAgICAgICAgIGNhc2UgMHhGRkVBOlxuICAgICAgICAgICAgY2FzZSAweEZGRUI6XG4gICAgICAgICAgICBjYXNlIDB4RkZFQzpcbiAgICAgICAgICAgIGNhc2UgMHhGRkVEOlxuICAgICAgICAgICAgY2FzZSAweEZGRUU6XG4gICAgICAgICAgICBjYXNlIDB4RkZFRjpcbiAgICAgICAgICAgICAgICB0aGlzLnJlYWRBcHAoKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMHhGRkZFOlxuICAgICAgICAgICAgICAgIHRoaXMucmVhZENvbW1lbnQoKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgaWYgKChjdXJyZW50ID4+IDgpICE9PSAweEZGKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkVSUk9SOiBmb3JtYXQgdGhyb3cgbmV3IElPRXhjZXB0aW9uISAoZGVjb2RlKVwiKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBjdXJyZW50ID0gdGhpcy5zdHJlYW0uZ2V0MTYoKTtcbiAgICB9XG5cbiAgICBpZiAoKGN1cnJlbnQgPCAweEZGQzApIHx8IChjdXJyZW50ID4gMHhGRkM3KSkge1xuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJFUlJPUjogY291bGQgbm90IGhhbmRsZSBhcml0aG1ldGljIGNvZGUhXCIpO1xuICAgIH1cblxuICAgIHRoaXMuZnJhbWUucmVhZCh0aGlzLnN0cmVhbSk7XG4gICAgY3VycmVudCA9IHRoaXMuc3RyZWFtLmdldDE2KCk7XG5cbiAgICBkbyB7XG4gICAgICAgIHdoaWxlIChjdXJyZW50ICE9PSAweDBGRkRBKSB7IC8vIFNPU1xuICAgICAgICAgICAgc3dpdGNoIChjdXJyZW50KSB7XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGQzQ6IC8vIERIVFxuICAgICAgICAgICAgICAgICAgICB0aGlzLmh1ZmZUYWJsZS5yZWFkKHRoaXMuc3RyZWFtLCB0aGlzLkh1ZmZUYWIpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZDQzogLy8gREFDXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIlByb2dyYW0gZG9lc24ndCBzdXBwb3J0IGFyaXRobWV0aWMgY29kaW5nLiAoZm9ybWF0IHRocm93IG5ldyBJT0V4Y2VwdGlvbilcIik7XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGREI6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucXVhbnRUYWJsZS5yZWFkKHRoaXMuc3RyZWFtLCBqcGVnLmxvc3NsZXNzLkRlY29kZXIuVEFCTEUpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZERDpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yZXN0YXJ0SW50ZXJ2YWwgPSB0aGlzLnJlYWROdW1iZXIoKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTA6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTE6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTI6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTM6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTQ6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTU6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTY6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTc6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTg6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTk6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRUE6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRUI6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRUM6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRUQ6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRUU6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRUY6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucmVhZEFwcCgpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZGRTpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yZWFkQ29tbWVudCgpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICBpZiAoKGN1cnJlbnQgPj4gOCkgIT09IDB4RkYpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkVSUk9SOiBmb3JtYXQgdGhyb3cgbmV3IElPRXhjZXB0aW9uISAoUGFyc2VyLmRlY29kZSlcIik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY3VycmVudCA9IHRoaXMuc3RyZWFtLmdldDE2KCk7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnByZWNpc2lvbiA9IHRoaXMuZnJhbWUucHJlY2lzaW9uO1xuICAgICAgICB0aGlzLmNvbXBvbmVudHMgPSB0aGlzLmZyYW1lLmNvbXBvbmVudHM7XG5cbiAgICAgICAgaWYgKCF0aGlzLm51bUJ5dGVzKSB7XG4gICAgICAgICAgICB0aGlzLm51bUJ5dGVzID0gcGFyc2VJbnQoTWF0aC5jZWlsKHRoaXMucHJlY2lzaW9uIC8gOCkpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRoaXMubnVtQnl0ZXMgPT0gMSkge1xuICAgICAgICAgICAgdGhpcy5tYXNrID0gMHhGRjtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMubWFzayA9IDB4RkZGRjtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuc2Nhbi5yZWFkKHRoaXMuc3RyZWFtKTtcbiAgICAgICAgdGhpcy5udW1Db21wID0gdGhpcy5zY2FuLm51bUNvbXA7XG4gICAgICAgIHRoaXMuc2VsZWN0aW9uID0gdGhpcy5zY2FuLnNlbGVjdGlvbjtcblxuICAgICAgICBpZiAodGhpcy5udW1CeXRlcyA9PT0gMSkge1xuICAgICAgICAgICAgaWYgKHRoaXMubnVtQ29tcCA9PT0gMykge1xuICAgICAgICAgICAgICAgIHRoaXMuZ2V0dGVyID0gdGhpcy5nZXRWYWx1ZVJHQjtcbiAgICAgICAgICAgICAgICB0aGlzLnNldHRlciA9IHRoaXMuc2V0VmFsdWVSR0I7XG4gICAgICAgICAgICAgICAgdGhpcy5vdXRwdXQgPSB0aGlzLm91dHB1dFJHQjtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5nZXR0ZXIgPSB0aGlzLmdldFZhbHVlODtcbiAgICAgICAgICAgICAgICB0aGlzLnNldHRlciA9IHRoaXMuc2V0VmFsdWU4O1xuICAgICAgICAgICAgICAgIHRoaXMub3V0cHV0ID0gdGhpcy5vdXRwdXRTaW5nbGU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmdldHRlciA9IHRoaXMuZ2V0VmFsdWUxNjtcbiAgICAgICAgICAgIHRoaXMuc2V0dGVyID0gdGhpcy5zZXRWYWx1ZTE2O1xuICAgICAgICAgICAgdGhpcy5vdXRwdXQgPSB0aGlzLm91dHB1dFNpbmdsZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHN3aXRjaCAodGhpcy5zZWxlY3Rpb24pIHtcbiAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICB0aGlzLnNlbGVjdG9yID0gdGhpcy5zZWxlY3QyO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAzOlxuICAgICAgICAgICAgICAgIHRoaXMuc2VsZWN0b3IgPSB0aGlzLnNlbGVjdDM7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAgICAgdGhpcy5zZWxlY3RvciA9IHRoaXMuc2VsZWN0NDtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgICAgICB0aGlzLnNlbGVjdG9yID0gdGhpcy5zZWxlY3Q1O1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA2OlxuICAgICAgICAgICAgICAgIHRoaXMuc2VsZWN0b3IgPSB0aGlzLnNlbGVjdDY7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICA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yBEYXRhVmlldyhuZXcgQXJyYXlCdWZmZXIodGhpcy54RGltICogdGhpcy55RGltICogdGhpcy5udW1CeXRlcyAqIHRoaXMubnVtQ29tcCkpO1xuXG4gICAgICAgIHNjYW5OdW0rPTE7XG5cbiAgICAgICAgd2hpbGUgKHRydWUpIHsgLy8gRGVjb2RlIG9uZSBzY2FuXG4gICAgICAgICAgICB0ZW1wWzBdID0gMDtcbiAgICAgICAgICAgIGluZGV4WzBdID0gMDtcblxuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDEwOyBpKz0xKSB7XG4gICAgICAgICAgICAgICAgcHJlZFtpXSA9ICgxIDw8ICh0aGlzLnByZWNpc2lvbiAtIDEpKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHRoaXMucmVzdGFydEludGVydmFsID09PSAwKSB7XG4gICAgICAgICAgICAgICAgY3VycmVudCA9IHRoaXMuZGVjb2RlVW5pdChwcmVkLCB0ZW1wLCBpbmRleCk7XG5cbiAgICAgICAgICAgICAgICB3aGlsZSAoKGN1cnJlbnQgPT09IDApICYmICgodGhpcy54TG9jIDwgdGhpcy54RGltKSAmJiAodGhpcy55TG9jIDwgdGhpcy55RGltKSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vdXRwdXQocHJlZCk7XG4gICAgICAgICAgICAgICAgICAgIGN1cnJlbnQgPSB0aGlzLmRlY29kZVVuaXQocHJlZCwgdGVtcCwgaW5kZXgpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGJyZWFrOyAvL2N1cnJlbnQ9TUFSS0VSXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZvciAobWN1TnVtID0gMDsgbWN1TnVtIDwgdGhpcy5yZXN0YXJ0SW50ZXJ2YWw7IG1jdU51bSs9MSkge1xuICAgICAgICAgICAgICAgIHRoaXMucmVzdGFydGluZyA9IChtY3VOdW0gPT0gMCk7XG4gICAgICAgICAgICAgICAgY3VycmVudCA9IHRoaXMuZGVjb2RlVW5pdChwcmVkLCB0ZW1wLCBpbmRleCk7XG4gICAgICAgICAgICAgICAgdGhpcy5vdXRwdXQocHJlZCk7XG5cbiAgICAgICAgICAgICAgICBpZiAoY3VycmVudCAhPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChjdXJyZW50ID09PSAwKSB7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMubWFya2VySW5kZXggIT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudCA9ICgweEZGMDAgfCB0aGlzLm1hcmtlcik7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMubWFya2VySW5kZXggPSAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGN1cnJlbnQgPSB0aGlzLnN0cmVhbS5nZXQxNigpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCEoKGN1cnJlbnQgPj0ganBlZy5sb3NzbGVzcy5EZWNvZGVyLlJFU1RBUlRfTUFSS0VSX0JFR0lOKSAmJlxuICAgICAgICAgICAgICAgIChjdXJyZW50IDw9IGpwZWcubG9zc2xlc3MuRGVjb2Rlci5SRVNUQVJUX01BUktFUl9FTkQpKSkge1xuICAgICAgICAgICAgICAgIGJyZWFrOyAvL2N1cnJlbnQ9TUFSS0VSXG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoKGN1cnJlbnQgPT09IDB4RkZEQykgJiYgKHNjYW5OdW0gPT09IDEpKSB7IC8vRE5MXG4gICAgICAgICAgICB0aGlzLnJlYWROdW1iZXIoKTtcbiAgICAgICAgICAgIGN1cnJlbnQgPSB0aGlzLnN0cmVhbS5nZXQxNigpO1xuICAgICAgICB9XG4gICAgfSB3aGlsZSAoKGN1cnJlbnQgIT09IDB4R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ZmbWFuVmFsdWUoYWN0YWIsIHRlbXAsIGluZGV4KTtcblxuICAgICAgICAgICAgICAgIGlmICh2YWx1ZSA+PSAweEZGMDApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGogKz0gKHZhbHVlID4+IDQpO1xuXG4gICAgICAgICAgICAgICAgaWYgKCh2YWx1ZSAmIDB4MEYpID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgodmFsdWUgPj4gNCkgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5JRENUX1NvdXJjZVtqcGVnLmxvc3NsZXNzLkRlY29kZXIuSURDVF9QW2pdXSA9IHRoaXMuZ2V0bihpbmRleCwgdmFsdWUgJiAweDBGLCB0ZW1wLCBpbmRleCkgKiBxdGFiW2pdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiAwO1xufTtcblxuXG5cbmpwZWcubG9zc2xlc3MuRGVjb2Rlci5wcm90b3R5cGUuZGVjb2RlU2luZ2xlID0gZnVuY3Rpb24gKHByZXYsIHRlbXAsIGluZGV4KSB7XG4gICAgLypqc2xpbnQgYml0d2lzZTogdHJ1ZSAqL1xuXG4gICAgdmFyIHZhbHVlLCBpLCBuLCBuUmVzdGFydDtcblxuICAgIGlmICh0aGlzLnJlc3RhcnRpbmcpIHtcbiAgICAgICAgdGhpcy5yZXN0YXJ0aW5nID0gZmFsc2U7XG4gICAgICAgIHByZXZbMF0gPSAoMSA8PCAodGhpcy5mcmFtZS5wcmVjaXNpb24gLSAxKSk7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgcHJldlswXSA9IHRoaXMuc2VsZWN0b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D0gODtcbiAgICAgICAgaW5wdXQgPSB0aGlzLnN0cmVhbS5nZXQ4KCk7XG4gICAgICAgIGlmIChpbnB1dCA9PT0gMHhGRikge1xuICAgICAgICAgICAgdGhpcy5tYXJrZXIgPSB0aGlzLnN0cmVhbS5nZXQ4KCk7XG4gICAgICAgICAgICBpZiAodGhpcy5tYXJrZXIgIT09IDApIHtcbiAgICAgICAgICAgICAgICB0aGlzLm1hcmtlckluZGV4ID0gOTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0ZW1wWzBdIHw9IGlucHV0O1xuICAgIH0gZWxzZSB7XG4gICAgICAgIGluZGV4WzBdIC09IDg7XG4gICAgfVxuXG4gICAgY29kZSA9IHRhYmxlW3RlbXBbMF0gPj4gaW5kZXhbMF1dO1xuXG4gICAgaWYgKChjb2RlICYganBlZy5sb3NzbGVzcy5EZWNvZGVyLk1TQikgIT09IDApIHtcbiAgICAgICAgaWYgKHRoaXMubWFya2VySW5kZXggIT09IDApIHtcbiAgICAgICAgICAgIHRoaXMubWFya2VySW5kZXggPSAwO1xuICAgICAgICAgICAgcmV0dXJuIDB4RkYwMCB8IHRoaXMubWFya2VyO1xuICAgICAgICB9XG5cbiAgICAgICAgdGVtcFswXSAmPSAobWFzayA+PiAoMTYgLSBpbmRleFswXSkpO1xuICAgICAgICB0ZW1wWzBdIDw8PSA4O1xuICAgICAgICBpbnB1dCA9IHRoaXMuc3RyZWFtLmdldDgoKTtcblxuICAgICAgICBpZiAoaW5wdXQgPT09IDB4RkYpIHtcbiAgICAgICAgICAgIHRoaXMubWFya2VyID0gdGhpcy5zdHJlYW0uZ2V0OCgpO1xuICAgICAgICAgICAgaWYgKHRoaXMubWFya2VyICE9PSAwKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5tYXJrZXJJbmRleCA9IDk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICB0ZW1wWzBdIHw9IGlucHV0O1xuICAgICAgICBjb2RlID0gdGF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c2ODtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGluZGV4WzBdIC09IG47XG5cbiAgICBpZiAoaW5kZXhbMF0gPj0gMCkge1xuICAgICAgICBpZiAoKGluZGV4WzBdIDwgdGhpcy5tYXJrZXJJbmRleCkgJiYgIXRoaXMuaXNMYXN0UGl4ZWwoKSkgeyAvLyB0aGlzIHdhcyBjb3JydXB0aW5nIHRoZSBsYXN0IHBpeGVsIGluIHNvbWUgY2FzZXNcbiAgICAgICAgICAgIHRoaXMubWFya2VySW5kZXggPSAwO1xuICAgICAgICAgICAgcmV0dXJuICgweEZGMDAgfCB0aGlzLm1hcmtlcikgPDwgODtcbiAgICAgICAgfVxuXG4gICAgICAgIHJlc3VsdCA9IHRlbXBbMF0gPj4gaW5kZXhbMF07XG4gICAgICAgIHRlbXBbMF0gJj0gKG1hc2sgPj4gKDE2IC0gaW5kZXhbMF0pKTtcbiAgICB9IGVsc2Uge1xuICAgICAgICB0ZW1wWzBdIDw8PSA4O1xuICAgICAgICBpbnB1dCA9IHRoaXMuc3RyZWFtLmdldDgoKTtcblxuICAgICAgICBpZiAoaW5wdXQgPT09IDB4RkYpIHtcbiAgICAgICAgICAgIHRoaXMubWFya2VyID0gdGhpcy5zdHJlYW0uZ2V0OCgpO1xuICAgICAgICAgICAgaWYgKHRoaXMubWFya2VyICE9PSAwKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5tYXJrZXJJbmRleCA9IDk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICB0ZW1wWzBdIHw9IGlucHV0O1xuICAgICAgICBpbmRleFswXSArPSA4O1xuXG4gICAgICAgIGlmIChpbmRleFswXSA8IDApIHtcbiAgICAgICAgICAgIGlmICh0aGlzLm1hcmtlckluZGV4ICE9PSAwKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5tYXJrZXJJbmRleCA9IDA7XG4gICAgICAgICAgICAgICAgcmV0dXJuICgweEZGMDAgfCB0aGlzLm1hcmtlcikgPDwgODtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGVtcFswXSA8PD0gODtcbiAgICAgICAgICAgIGlucHV0ID0gdGhpcy5zdHJlYW0uZ2V0OCgpO1xuXG4gICAgICAgICAgICBpZiAoaW5wdXQgPT09IDB4RkYpIHtcbiAgICAgICAgICAgICAgICB0aGlzLm1hcmtlciA9IHRoaXMuc3RyZWFtLmdldDgoKTtcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5tYXJrZXIgIT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5tYXJrZXJJbmRleCA9IDk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB0ZW1wWzBdIHw9IGlucHV0O1xuICAgICAgICAgICAgaW5kZXhbMF0gKz0gODtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChpbmRleFswXSA8IDApIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcImluZGV4PVwiICsgaW5kZXhbMF0gKyBcIiBpbiBnZXRuKClcIik7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoaW5kZXhbMF0gPCB0aGlzLm1hcmtlckluZGV4KSB7XG4gICAgICAgICAgICB0aGlzLm1hcmtlckluZGV4ID0gMDtcbiAgICAgICAgICAgIHJldHVybiAoMHhGRjAwIHwgdGhpcy5tYXJrZXIpIDw8IDg7XG4gICAgICAgIH1cblxuICAgICAgICByZXN1bHQgPSB0ZW1wWzBdID4+IGluZGV4WzBdO1xuICAgICAgICB0ZW1wWzBdICY9IChtYXNrID4+ICgxNiAtIGluZGV4WzBdKSk7XG4gICAgfVxuXG4gICAgaWYgKHJlc3VsdCA8IChvbmUgPDwgKG4gLSAxKSkpIHtcbiAgICAgICAgcmVzdWx0ICs9IChuX29uZSA8PCBuKSArIDE7XG4gICAgfVxuXG4gICAgcmV0dXJuIHJlc3VsdDtcbn07XG5cblxuXG5qcGVnLmxvc3NsZXNzLkRlY29kZXIucHJvdG90eX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hblRhYmxlLnByb3RvdHlwZS5yZWFkID0gZnVuY3Rpb24oZGF0YSwgSHVmZlRhYikge1xuICAgIC8qanNsaW50IGJpdHdpc2U6IHRydWUgKi9cblxuICAgIHZhciBjb3VudCA9IDAsIGxlbmd0aCwgdGVtcCwgdCwgYywgaSwgajtcblxuICAgIGxlbmd0aCA9IGRhdGEuZ2V0MTYoKTtcbiAgICBjb3VudCArPSAyO1xuXG4gICAgd2hpbGUgKGNvdW50IDwgbGVuZ3RoKSB7XG4gICAgICAgIHRlbXAgPSBkYXRhLmdldDgoKTtcbiAgICAgICAgY291bnQrPTE7XG4gICAgICAgIHQgPSB0ZW1wICYgMHgwRjtcbiAgICAgICAgaWYgKHQgPiAzKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJFUlJPUjogSHVmZm1hbiB0YWJsZSBJRCA+IDNcIik7XG4gICAgICAgIH1cblxuICAgICAgICBjID0gdGVtcCA+PiA0O1xuICAgICAgICBpZiAoYyA+IDIpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkVSUk9SOiBIdWZmbWFuIHRhYmxlIFtUYWJsZSBjbGFzcyA+IDIgXVwiKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMudGhbdF0gPSAxO1xuICAgICAgICB0aGlzLnRjW3RdW2NdID0gMTtcblxuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMTY7IGkrPTEpIHtcbiAgICAgICAgICAgIHRoaXMubFt0XVtjXVtpXSA9IGRhdGEuZ2V0OCgpO1xuICAgICAgICAgICAgY291bnQrPTE7XG4gICAgICAgIH1cblxuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMTY7IGkrPTEpIHtcbiAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCB0aGlzLmxbdF1bY11baV07IGorPTEpIHtcbiAgICAgICAgICAgICAgICBpZiAoY291bnQgPiBsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbm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oaXMucHJlY2lzaW9uW3RdID0gMTY7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJFUlJPUjogUXVhbnRpemF0aW9uIHRhYmxlIHByZWNpc2lvbiBlcnJvclwiKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMudHFbdF0gPSAxO1xuXG4gICAgICAgIGlmICh0aGlzLnByZWNpc2lvblt0XSA9PT0gOCkge1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDY0OyBpKz0xKSB7XG4gICAgICAgICAgICAgICAgaWYgKGNvdW50ID4gbGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkVSUk9SOiBRdWFudGl6YXRpb24gdGFibGUgZm9ybWF0IGVycm9yXCIpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHRoaXMucXVhbnRUYWJsZXNbdF1baV0gPSBkYXRhLmdldDgoKTtcbiAgICAgICAgICAgICAgICBjb3VudCs9MTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAganBlZy5sb3NzbGVzcy5RdWFudGl6YXRpb25UYWJsZS5lbmhhbmNlUXVhbnRpemF0aW9uVGFibGUodGhpcy5xdWFudFRhYmxlc1t0XSwgdGFibGUpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDY0OyBpKz0xKSB7XG4gICAgICAgICAgICAgICAgaWYgKGNvdW50ID4gbGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkVSUk9SOiBRdWFudGl6YXRpb24gdGFibGUgZm9ybWF0IGVycm9yXCIpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHRoaXMucXVhbnRUYWJsZXNbdF1baV0gPSBkYXRhLmdldDE2KCk7XG4gICAgICAgICAgICAgICAgY291bnQgKz0gMjtcbiA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aS5OSUZUSTEucHJvdG90eXBlLnRvRm9ybWF0dGVkU3RyaW5nID0gZnVuY3Rpb24gKCkge1xuICAgIHZhciBmbXQgPSBuaWZ0aS5VdGlscy5mb3JtYXROdW1iZXIsXG4gICAgICAgIHN0cmluZyA9IFwiXCI7XG5cbiAgICBzdHJpbmcgKz0gKFwiRGltIEluZm8gPSBcIiArIHRoaXMuZGltX2luZm8gKyBcIlxcblwiKTtcblxuICAgIHN0cmluZyArPSAoXCJJbWFnZSBEaW1lbnNpb25zICgxLTgpOiBcIiArXG4gICAgICAgIHRoaXMuZGltc1swXSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuZGltc1sxXSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuZGltc1syXSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuZGltc1szXSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuZGltc1s0XSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuZGltc1s1XSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuZGltc1s2XSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuZGltc1s3XSArIFwiXFxuXCIpO1xuXG4gICAgc3RyaW5nICs9IChcIkludGVudCBQYXJhbWV0ZXJzICgxLTMpOiBcIiArXG4gICAgICAgIHRoaXMuaW50ZW50X3AxICsgXCIsIFwiICtcbiAgICAgICAgdGhpcy5pbnRlbnRfcDIgKyBcIiwgXCIgK1xuICAgICAgICB0aGlzLmludGVudF9wMykgKyBcIlxcblwiO1xuXG4gICAgc3RyaW5nICs9IChcIkludGVudCBDb2RlID0gXCIgKyB0aGlzLmludGVudF9jb2RlICsgXCJcXG5cIik7XG4gICAgc3RyaW5nICs9IChcIkRhdGF0eXBlID0gXCIgKyB0aGlzLmRhdGF0eXBlQ29kZSArICBcIiAoXCIgKyB0aGlzLmdldERhdGF0eXBlQ29kZVN0cmluZyh0aGlzLmRhdGF0eXBlQ29kZSkgKyBcIilcXG5cIik7XG4gICAgc3RyaW5n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1bmN0aW9uIChxYiwgcWMsIHFkLCBxeCwgcXksIHF6LCBkeCwgZHksIGR6LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcWZhYykge1xuICAgIHZhciBSID0gW1swLCAwLCAwLCAwXSwgWzAsIDAsIDAsIDBdLCBbMCwgMCwgMCwgMF0sIFswLCAwLCAwLCAwXV0sXG4gICAgICAgIGEsXG4gICAgICAgIGIgPSBxYixcbiAgICAgICAgYyA9IHFjLFxuICAgICAgICBkID0gcWQsXG4gICAgICAgIHhkLFxuICAgICAgICB5ZCxcbiAgICAgICAgemQ7XG5cbiAgICAvLyBsYXN0IHJvdyBpcyBhbHdheXMgWyAwIDAgMCAxIF1cbiAgICBSWzNdWzBdID0gUlszXVsxXSA9IFJbM11bMl0gPSAwLjA7XG4gICAgUlszXVszXSA9IDEuMDtcblxuICAgIC8vIGNvbXB1dGUgYSBwYXJhbWV0ZXIgZnJvbSBiLGMsZFxuICAgIGEgPSAxLjAgLSAoYiAqIGIgKyBjICogYyArIGQgKiBkKTtcbiAgICBpZiAoYSA8IDAuMDAwMDAwMSkgeyAgICAgICAgICAgICAgICAgICAvKiBzcGVjaWFsIGNhc2UgKi9cblxuICAgICAgICBhID0gMS4wIC8gTWF0aC5zcXJ0KGIgKiBiICsgYyAqIGMgKyBkICogZCk7XG4gICAgICAgIGIgKj0gYTtcbiAgICAgICAgYyAqPSBhO1xuICAgICAgICBkICo9IGE7ICAgICAgICAvKiBub3JtYWxpemUgKGIsYyxkKSB2ZWN0b3IgKi9cbiAgICAgICAgYSA9IDAuMDsgICAgICAgICAgICAgICAgICAgICAgICAvKiBhID0gMCA9PT4gMTgwIGRlZ3JlZSByb3RhdGlvbiAqL1xuICAgIH0gZWxzZSB7XG5cbiAgICAgICAgYSA9IE1hdGguc3FydChhKTsgICAgICAgICAgICAgICAgICAgICAvKiBhbmdsZSA9IDIqYXJjY29zKGEpICovXG4gICAgfVxuXG4gICAgLy8gbG9hZ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GguYWJzKHZhbCkgPiAxLkUtNCkge1xuICAgICAgICB4aiAtPSB2YWwgKiB4aTtcbiAgICAgICAgeWogLT0gdmFsICogeWk7XG4gICAgICAgIHpqIC09IHZhbCAqIHppO1xuICAgICAgICB2YWwgPSBNYXRoLnNxcnQoeGogKiB4aiArIHlqICogeWogKyB6aiAqIHpqKTsgIC8qIG11c3QgcmVub3JtYWxpemUgKi9cbiAgICAgICAgaWYgKHZhbCA9PT0gMC4wKSB7ICAgICAgICAgICAgICAvKiBqIHdhcyBwYXJhbGxlbCB0byBpPyAqL1xuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgeGogLz0gdmFsO1xuICAgICAgICB5aiAvPSB2YWw7XG4gICAgICAgIHpqIC89IHZhbDtcbiAgICB9XG5cbiAgICAvKiBub3JtYWxpemUgayBheGlzOyBpZiBpdCBpcyB6ZXJvLCBtYWtlIGl0IHRoZSBjcm9zcyBwcm9kdWN0IGkgeCBqICovXG4gICAgdmFsID0gTWF0aC5zcXJ0KHhrICogeGsgKyB5ayAqIHlrICsgemsgKiB6ayk7XG4gICAgaWYgKHZhbCA9PT0gMC4wKSB7XG4gICAgICAgIHhrID0geWkgKiB6aiAtIHppICogeWo7XG4gICAgICAgIHlrID0gemkgKiB4aiAtIHpqICogeGk7XG4gICAgICAgIHprID0geGkgKiB5aiAtIHlpICogeGo7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgeGsgLz0gdmFsO1xuICAgICAgICB5ayAvPSB2YWw7XG4gICAgICAgIHprIC89IHZhbDtcbiAgICB9XG5cbiAgICAvKiBvcnRob2dvbmFsaXplIGsgdG8gaSAqL1xuICAgIHZhbCA9IHhpICogeGsgKyB5aSAqIHlrICsgemkgKiB6azsgICAgLyogZG90IHByb2R1Y3QgYmV0d2VlbiBpIGFuZCBrICovXG4gICAgaWYgKE1hdGguYWJzKHZhbCkgPiAxLkUtNCkge1xuICAgICAgICB4ayAtPSB2YWwgKiB4aTtcbiAgICAgICAgeWsgLT0gdmFsICogeWk7XG4gICAgICAgIHprIC09IHZhbCAqIHppO1xuICAgICAgICB2YWwgPSBNYXRoLnNxcnQoeGsgKiB4ayArIHlrICogeWsgKyB6ayAqIHprKTtcbiAgICAgICAgaWYgKHZhbCA9PT0gMC4wKSB7ICAgIC8qIGJhZCAqL1xuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgeGsgLz0gdmFsO1xuICAgICAgICB5ayAvPSB2YWw7XG4gICAgICAgIHprIC89IHZhbDtcbiAgICB9XG5cbiAgICAvKiBvcnRob2dvbmFsaXplIGsgdG8gaiAqL1xuICAgIHZhbCA9IHhqICogeGsgKyB5aiAqIHlrICsgemogKiB6azsgICAgLyogZG90IHByb2R1Y3QgYmV0d2VlbiBqIGFuZCBrICovXG4gICAgaWYgKE1hdGguYWJzKHZhbCkgPiAxLmUtNCkge1xuICAgICAgICB4ayAtPSB2YWwgKiB4ajtcbiAgICAgICAgeWsgLT0gdmFsICogeWo7XG4gICAgICAgIHprIC09IHZhbCAqIHpqO1xuICAgICAgICB2YWwgPSBNYXRoLnNxcnQoeGsgKiB4ayArIHlrICogeWsgKyB6ayAqIHprKTtcbiAgICAgICAgaWYgKHZhbCA9PT0gMC4wKSB7ICAgICAvKiBiYWQgKi9cbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9XG4gICAgICAgIHhrIC89IHZhbDtcbiAgICAgICAgeWsgLz0gdmFsO1xuICAgICAgICB6ayAvPSB2YWw7XG4gICAgfVxuXG4gICAgUVswXVswXSA9IHhpO1xuICAgIFFbMF1bMV0gPSB4ajtcbiAgICBRWzBdWzJdID0geGs7XG4gICAgUVsxXVswXSA9IHlpO1xuICAgIFFbMV1bMV0gPSB5ajtcbiAgICBRWzFdWzJdID0geWs7XG4gICAgUVsyXVswXSA9IHppO1xuICAgIFFbMl1bMV0gPSB6ajtcbiAgICBRWzJdWzJdID0gems7XG5cbiAgICAvKiB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G51bWJlciB0byB1c2UgZm9yIHJvdyAjMiAqL1xuICAgICAgICAgICAgaWYgKGkgIT09IGopIHtcbiAgICAgICAgICAgICAgICBmb3IgKGsgPSAxOyBrIDw9IDM7IGsgKz0gMSkgeyAgLyogayA9IGNvbHVtbiBudW1iZXIgdG8gdXNlIGZvciByb3cgIzMgKi9cbiAgICAgICAgICAgICAgICAgICAgaWYgKCEoaSA9PT0gayB8fCBqID09PSBrKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgUFswXVswXSA9IFBbMF1bMV0gPSBQWzBdWzJdID0gUFsxXVswXSA9IFBbMV1bMV0gPSBQWzFdWzJdID0gUFsyXVswXSA9IFBbMl1bMV0gPSBQWzJdWzJdID0gMC4wO1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChwID0gLTE7IHAgPD0gMTsgcCArPSAyKSB7ICAgIC8qIHAscSxyIGFyZSAtMSBvciArMSAgICAgICovXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChxID0gLTE7IHEgPD0gMTsgcSArPSAyKSB7ICAgLyogYW5kIGdvIGludG8gcm93cyAjMSwyLDMgKi9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChyID0gLTE7IHIgPD0gMTsgciArPSAyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQWzBdW2kgLSAxXSA9IHA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQWzFdW2ogLSAxXSA9IHE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQWzJdW2sgLSAxXSA9IHI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXRQID0gdGhpcy5uaWZ0aV9tYXQzM19kZXRlcm0oUCk7ICAgICAgICAgICAvKiBzaWduIG9mIHBlcm11dGF0aW9uICovXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGRldFAgKiBkZXRRKSA+IDAuMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE0gPSB0aGlzLm5pZnRpX21hdDMzX211bChQLCBRKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGFuZ2xlIG9mIE0gcm90YXRpb24gPSAyLjAqYWNvcygwLjUqc3FydCgxLjArdHJhY2UoTSkpKSAgICAgICAqL1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHdlIHdhbnQgbGFyZ2VzdCB0cmFjZShNKSA9PSBzbWFsbGVzdCBhbmdsZSA9PSBNIG5lYXJlc3QgdG8gSSAqL1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsID0gTVswXVswXSArIE1bMV1bMV0gKyBNWzJdWzJdOyAvKiB0cmFjZSAqL1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWwgPiB2YmVzdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YmVzdCA9IHZhbDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWJlc3QgPSBpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqYmVzdCA9IGo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtiZXN0ID0gaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGJlc3QgPSBwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxYmVzdCA9IHE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJiZXN0ID0gcjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ICA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m9yIHRoZSBqIGFuZCBrIGF4ZXMsIG9mIGNvdXJzZS4gKi9cblxuICAgIGlDaGFyID0gakNoYXIgPSBrQ2hhciA9IGlTZW5zZSA9IGpTZW5zZSA9IGtTZW5zZSA9IDA7XG5cbiAgICBzd2l0Y2ggKGliZXN0ICogcGJlc3QpIHtcbiAgICAgICAgY2FzZSAxOiAvKmkgPSBOSUZUSV9MMlIqL1xuICAgICAgICAgICAgaUNoYXIgPSAnWCc7XG4gICAgICAgICAgICBpU2Vuc2UgPSAnKyc7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAtMTogLyppID0gTklGVElfUjJMKi9cbiAgICAgICAgICAgIGlDaGFyID0gJ1gnO1xuICAgICAgICAgICAgaVNlbnNlID0gJy0nO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgMjogLyppID0gTklGVElfUDJBKi9cbiAgICAgICAgICAgIGlDaGFyID0gJ1knO1xuICAgICAgICAgICAgaVNlbnNlID0gJysnO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgLTI6IC8qaSA9IE5JRlRJX0EyUCovXG4gICAgICAgICAgICBpQ2hhciA9ICdZJztcbiAgICAgICAgICAgIGlTZW5zZSA9ICctJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIDM6IC8qaSA9IE5JRlRJX0kyUyovXG4gICAgICAgICAgICBpQ2hhciA9ICdaJztcbiAgICAgICAgICAgIGlTZW5zZSA9ICcrJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIC0zOiAvKmkgPSBOSUZUSV9TMkkqL1xuICAgICAgICAgICAgaUNoYXIgPSAnWic7XG4gICAgICAgICAgICBpU2Vuc2UgPSAnLSc7XG4gICAgICAgICAgICBicmVhaztcbiAgICB9XG5cbiAgICBzd2l0Y2ggKGpiZXN0ICogcWJlc3QpIHtcbiAgICAgICAgY2FzZSAxOiAvKmogPSBOSUZUSV9MMlIqL1xuICAgICAgICAgICAgakNoYXIgPSAnWCc7XG4gICAgICAgICAgICBqU2Vuc2UgPSAnKyc7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAtMTogLypqID0gTklGVElfUjJMKi9cbiAgICAgICAgICAgIGpDaGFyID0gJ1gnO1xuICAgICAgICAgICAgalNlbnNlID0gJy0nO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgMjogLypqID0gTklGVElfUDJBKi9cbiAgICAgICAgICAgIGpDaGFyID0gJ1knO1xuICAgICAgICAgICAgalNlbnNlID0gJysnO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgLTI6IC8qaiA9IE5JRlRJX0EyUCovXG4gICAgICAgICAgICBqQ2hhciA9ICdZJztcbiAgICAgICAgICAgIGpTZW5zZSA9ICctJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIDM6IC8qaiA9IE5JRlRJX0kyUyovXG4gICAgICAgICAgICBqQ2hhciA9ICdaJztcbiAgICAgICAgICAgIGpTZW5zZSA9ICcrJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIC0zOiAvKmogPSBOSUZUSV9TMkkqL1xuICAgICAgICAgICAgakNoYXIgPSAnWic7XG4gICAgICAgICAgICBqU2Vuc2UgPSAnLSc7XG4gICAgICAgICAgICBicmVhaztcbiAgICB9XG5cbiAgICBzd2l0Y2ggKGtiZXN0ICogcmJlc3QpIHtcbiAgICAgICAgY2FzZSAxOiAvKmsgPSBOSUZUSV9MMlIqL1xuICAgICAgICAgICAga0NoYXIgPSAnWCc7XG4gICAgICAgICAgICBrU2Vuc2UgPSAnKyc7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAtMTogLyprID0gTklGVElfUjJMKi9cbiAgICAgICAgICAgIGtDaGFyID0gJ1gnO1xuICAgICAgICAgICAga1NlbnNlID0gJy0nO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgMjogLyprID0gTklGVElfUDJBKi9cbiAgICAgICAgICAgIGtDaGFyID0gJ1knO1xuICAgICAgICAgICAga1NlbnNlID0gJysnO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgLTI6IC8qayA9IE5JRlRJX0EyUCovXG4gICAgICAgICAgICBrQ2hhciA9ICdZJztcbiAgICAgICAgICAgIGtTZW5zZSA9ICctJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIDM6IC8qayA9IE5JRlRJX0kyUyovXG4gICAgICAgICAgICBrQ2hhciA9ICdaJztcbiAgICAgICAgICAgIGtTZW5zZSA9ICcrJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIC0zOiAvKmsgPSBOSUZUSV9TMkkqL1xuICAgICAgICAgICAga0NoYXIgPSAnWic7XG4gICAgICAgICAgICBrU2Vuc2UgPSAnLSc7XG4gICAgICAgICAgICBicmVhaztcbiAgICB9XG5cbiAgICByZXR1cm4gKGlDaGFyICsgakNoYXIgKyBrQ2hhciArIGlTZW5zZSArIGpTZW5zZSArIGtTZW5zZSk7XG59O1xuXG5cblxubmlmdGkuTklGVEkxLnByb3RvdHlwZS5uaWZ0aV9tYXQzM19tdWwgPSBmdW5jdGlvbiAoQSwgQikge1xuICAgIHZhciBDID0gW1swLCAwLCAwXSwgWzAsIDAsIDBdLCBbMCwgMCwgMF1dLFxuICAgICAgICBpLFxuICAgICAgICBqO1xuXG4gICAgZm9yIChpID0gMDsgaSA8IDM7IGkgKz0gMSkge1xuICAgICAgICBmb3IgKGogPSAwOyBqIDwgMzsgaiArPSAxKSB7XG4gICAgICAgICAgICBDW2ldW2pdID0gIEFbaV1bMF0gKiBCWzBdW2pdICArIEFbaV1bMV0gKiBCWzFdW2pdICsgQVtpXVsyXSAqIEJbMl1bal07XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gQztcbn07XG5cblxuXG5uaWZ0aS5OSUZUSTEucH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MV0gKyBcIiwgXCIgK1xuICAgICAgICB0aGlzLmRpbXNbMl0gKyBcIiwgXCIgK1xuICAgICAgICB0aGlzLmRpbXNbM10gKyBcIiwgXCIgK1xuICAgICAgICB0aGlzLmRpbXNbNF0gKyBcIiwgXCIgK1xuICAgICAgICB0aGlzLmRpbXNbNV0gKyBcIiwgXCIgK1xuICAgICAgICB0aGlzLmRpbXNbNl0gKyBcIiwgXCIgK1xuICAgICAgICB0aGlzLmRpbXNbN10gKyBcIlxcblwiKTtcblxuICAgIHN0cmluZyArPSAoXCJJbnRlbnQgUGFyYW1ldGVycyAoMS0zKTogXCIgK1xuICAgICAgICB0aGlzLmludGVudF9wMSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuaW50ZW50X3AyICsgXCIsIFwiICtcbiAgICAgICAgdGhpcy5pbnRlbnRfcDMpICsgXCJcXG5cIjtcblxuICAgIHN0cmluZyArPSAoXCJWb3hlbCBEaW1lbnNpb25zICgxLTgpOiBcIiArXG4gICAgICAgIGZtdCh0aGlzLnBpeERpbXNbMF0pICsgXCIsIFwiICtcbiAgICAgICAgZm10KHRoaXMucGl4RGltc1sxXSkgKyBcIiwgXCIgK1xuICAgICAgICBmbXQodGhpcy5waXhEaW1zWzJdKSArIFwiLCBcIiArXG4gICAgICAgIGZtdCh0aGlzLnBpeERpbXNbM10pICsgXCIsIFwiICtcbiAgICAgICAgZm10KHRoaXMucGl4RGltc1s0XSkgKyBcIiwgXCIgK1xuICAgICAgICBmbXQodGhpcy5waXhEaW1zWzVdKSArIFwiLCBcIiArXG4gICAgICAgIGZtdCh0aGlzLnBpeERpbXNbNl0pICsgXCIsIFwiICtcbiAgICAgICAgZm10KHRoaXMucGl4RGltc1s3XSkgKyBcIlxcblwiKTtcblxuICAgIHN0cmluZyArPSAoXCJJbWFnZSBPZmZzZXQgPSBcIiArIHRoaXMudm94X29mZnNldCArIFwiXFxuXCIpO1xuICAgIHN0cmluZyArPSAoXCJEYXRhIFNjYWxlOiAgU2xvc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9mIFN0cmluZykge1xuICAgICAgICBucnJkLmVuZGlhbiA9IHBhcnNlTlJSREVuZGlhbihucnJkLmVuZGlhbik7XG4gICAgfVxuICAgIFxuICAgIC8vIFRyeSB0byBpbmZlciBzcGF0aWFsIGRpbWVuc2lvblxuICAgIHZhciBzcGFjZURpbWVuc2lvbiA9IHVuZGVmaW5lZDtcbiAgICBpZiAobnJyZC5zcGFjZURpbWVuc2lvbiE9PXVuZGVmaW5lZCkge1xuICAgICAgICBzcGFjZURpbWVuc2lvbiA9IG5ycmQuc3BhY2VEaW1lbnNpb247XG4gICAgfSBlbHNlIGlmIChucnJkLnNwYWNlIT09dW5kZWZpbmVkKSB7XG4gICAgICAgIHN3aXRjaChucnJkLnNwYWNlKSB7XG4gICAgICAgIGNhc2UgXCJyaWdodC1hbnRlcmlvci1zdXBlcmlvclwiOlxuICAgICAgICBjYXNlIFwiUkFTXCI6XG4gICAgICAgICAgICBzcGFjZURpbWVuc2lvbiA9IDM7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBcImxlZnQtYW50ZXJpb3Itc3VwZXJpb3JcIjpcbiAgICAgICAgY2FzZSBcIkxBU1wiOlxuICAgICAgICAgICAgc3BhY2VEaW1lbnNpb24gPSAzO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgXCJsZWZ0LXBvc3Rlcmlvci1zdXBlcmlvclwiOlxuICAgICAgICBjYXNlIFwiTFBTXCI6XG4gICAgICAgICAgICBzcGFjZURpbWVuc2lvbiA9IDM7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgXHQgIGNhc2UgXCJyaWdodC1hbnRlcmlvci1zdXBlcmlvci10aW1lXCI6XG4gICAgIFx0ICBjYXNlIFwiUkFTVFwiOlxuICAgICBcdCAgICAgIHNwYWNlRGltZW5zaW9uID0gNDtcbiAgICAgXHQgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBcImxlZnQtYW50ZXJpb3Itc3VwZXJpb3ItdGltZVwiOlxuICAgICAgICBjYXNlIFwiTEFTVFwiOlxuICAgICAgICAgICAgc3BhY2VEaW1lbnNpb24gPSA0O1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgXCJsZWZ0LXBvc3Rlcmlvci1zdXBlcmlvci10aW1lXCI6XG4gICAgICAgIGNhc2UgXCJMUFNUXCI6XG4gICAgICAgICAgICBzcGFjZURpbWVuc2lvbiA9IDQ7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBcInNjYW5uZXIteHl6XCI6XG4gICAgICAgICAgICBzcGFjZURpbWVuc2lvbiA9IDM7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBcInNjYW5uZXIteHl6LXRpbWVcIjpcbiAgICAgICAgICAgIHNwYWNlRGltZW5zaW9uID0gNDtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIFwiM0QtcmlnaHQtaGFuZGVkXCI6XG4gICAgICAgICAgICBzcGFjZURpbWVuc2lvbiA9IDM7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBcIjNELWxlZnQtaGFuZGVkXCI6XG4gICAgICAgICAgICBzcGFjZURpbWVuc2lvbiA9IDM7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBcIjNELXJpZ2h0LWhhbmRlZC10aW1lXCI6XG4gICAgICAgICAgICBzcGFjZURpbWVuc2lvbiA9IDQ7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBcIjNELWxlZnQtaGFuZGVkLXRpbWVcIjpcbiAgICAgICAgICAgIHNwYWNlRGltZW5zaW9uID0gNDtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgY29uc29sZS53YXJuKFwiVW5yZWNvZ25pemVkIHNwYWNlOiBcIiArIG5ycmQuc3BhY2UpO1xuICAgICAgICB9XG4gICAgfVxuICAgIFxuICAgIC8vIE5vdyBjaGVjay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G4gICAgICAgICAgICAgICAgaWYgKG1hdGNoMi5sZW5ndGggPT0gMiAmJiBtYXRjaDJbMV0pIHsgLy8gc3ViZGltIHNwZWNpZmljYXRpb25cbiAgICAgICAgICAgICAgICAgICAgcmV0W21hdGNoWzFdXSA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVzOiBsaW5lcy5zbGljZShpKzEpLFxuICAgICAgICAgICAgICAgICAgICAgICAgc3ViZGltOiBwYXJzZU5SUkRJbnRlZ2VyKG1hdGNoMlsxXSlcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXRbbWF0Y2hbMV1dID0gbGluZXMuc2xpY2UoaSsxKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbGluZXMubGVuZ3RoID0gaTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0W21hdGNoWzFdXSA9IHBhcnNlRmllbGQobWF0Y2hbMV0sIG1hdGNoWzNdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChtYXRjaFsyXSA9PSAnOj0nKSB7IC8vIEtleS92YWx1ZSBwYWlyXG4gICAgICAgICAgICByZXQua2V5c1ttYXRjaFsxXV0gPSB1bmVzY2FwZVZhbHVlKG1hdGNoWzNdKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkxvZ2ljIGVycm9yIGluIE5SUkQgcGFyc2VyLlwiKTsgLy8gVGhpcyBzaG91bGQgbmV2ZXIgaGFwcGVuICh1bmxlc3MgdGhlIE5SUkQgc3ludGF4IGlzIGV4dGVuZGVkIGFuZCB0aGUgcmVnZXhwIGlzIHVwZGF0ZWQsIGJ1dCB0aGlzIHNlY3Rpb24gaXMgbm90LCBvciBzb21lIG90aGVyIHByb2dyYW1tZXIgZXJyb3IpLlxuICAgICAgIC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gaSsrKSB7XG4gICAgICAgICAgICAgICAgYXJyW2ldID0gdmlldy5nZXRVaW50OChpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBhcnI7XG4gICAgICAgIGNhc2UgXCJpbnQxNlwiOlxuICAgICAgICAgICAgYXJyID0gbmV3IEludDE2QXJyYXkodG90YWxMZW4pO1xuICAgICAgICAgICAgZm9yKGk9MDsgaTx0b3RhbExlbjsgaSsrKSB7XG4gICAgICAgICAgICAgICAgYXJyW2ldID0gdmlldy5nZXRJbnQxNihpKjIpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGFycjtcbiAgICAgICAgY2FzZSBcInVpbnQxNlwiOlxuICAgICAgICAgICAgYXJyID0gbmV3IFVpbnQxNkFycmF5KHRvdGFsTGVuKTtcbiAgICAgICAgICAgIGZvcihpPTA7IGk8dG90YWxMZW47IGkrKykge1xuICAgICAgICAgICAgICAgIGFycltpXSA9IHZpZXcuZ2V0VWludDE2KGkqMik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gYXJyO1xuICAgICAgICBjYXNlIFwiaW50MzJcIjpcbiAgICAgICAgICAgIGFyciA9IG5ldyBJbnQzMkFycmF5KHRvdGFsTGVuKTtcbiAgICAgICAgICAgIGZvcihpPTA7IGk8dG90YWxMZW47IGkrKykge1xuICAgICAgICAgICAgICAgIGFycltpXSA9IHZpZXcuZ2V0SW50MzIoaSo0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBhcnI7XG4gICAgICAgIGNhc2UgXCJ1aW50MzJcIjpcbiAgICAgICAgICAgIGFyciA9IG5ldyBVaW50MzJBcnJheSh0b3RhbExlbik7XG4gICAgICAgICAgICBmb3IoaT0wOyBpPHRvdGFsTGVuOyBpKyspIHtcbiAgICAgICAgICAgICAgICBhcnJbaV0gPSB2aWV3LmdldFVpbnQzMihpKjQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGFycjtcbiAgICAgICAgLy9jYXNlIFwiaW50NjRcIjpcbiAgICAgICAgLy8gICAgYXJyID0gbmV3IEludDY0QXJyYXkodG90YWxMZW4pO1xuICAgICAgICAvLyAgICBmb3IoaT0wOyBpPHRvdGFsTGVuOyBpKyspIHtcbiAgICAgICAgLy8gICAgICAgIGFycltpXSA9IHZpZXcuZ2V0SW50NjQoaSo4KTtcbiAgICAgICAgLy8gICAgfVxuICAgICAgICAvLyAgICByZXR1cm4gYXJyO1xuICAgICAgICAvL2Nhc2UgXCJ1aW50NjRcIjpcbiAgICAgICAgLy8gICAgYXJyID0gbmV3IFVpbnQ2NEFycmF5KHRvdGFsTGVuKTtcbiAgICAgICAgLy8gICAgZm9yKGk9MDsgaTx0b3RhbExlbjsgaSsrKSB7XG4gICAgICAgIC8vICAgICAgICBhcnJbaV0gPSB2aWV3LmdldFVpbnQ2NChpKjgpO1xuICAgICAgICAvLyAgICB9XG4gICAgICAgIC8vICAgIHJldHVybiBhcnI7XG4gICAgICAgIGNhc2UgXCJmbG9hdFwiOlxuICAgICAgICAgICAgYXJyID0gbmV3IEZsb2F0MzJBcnJheSh0b3RhbExlbik7XG4gICAgICAgICAgICBmb3IoaT0wOyBpPHRvdGFsTGVuOyBpKyspIHtcbiAgICAgICAgICAgICAgICBhcnJbaV0gPSB2aWV3LmdldEZsb2F0MzIoaSo0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBhcnI7XG4gICAgICAgIGNhc2UgXCJkb3VibGVcIjpcbiAgICAgICAgICAgIGFyciA9IG5ldyBGbG9hdDY0QXJyYXkodG90YWxMZW4pO1xuICAgICAgICAgICAgZm9yKGk9MDsgaTx0b3RhbExlbjsgaSsrKSB7XG4gICAgICAgICAgICAgICAgYXJyW2ldID0gdmlldy5nZXRGbG9hdDY0KGkqOCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gYXJyO1xuICAgICAgICBkZWZhdWx0OlxuICAgICAgICA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cbiAgICByZXR1cm4gYnVmZmVyO1xufVxuIiwiLy8gVG9wIGxldmVsIGZpbGUgaXMganVzdCBhIG1peGluIG9mIHN1Ym1vZHVsZXMgJiBjb25zdGFudHNcbid1c2Ugc3RyaWN0JztcblxudmFyIGFzc2lnbiAgICA9IHJlcXVpcmUoJy4vbGliL3V0aWxzL2NvbW1vbicpLmFzc2lnbjtcblxudmFyIGRlZmxhdGUgICA9IHJlcXVpcmUoJy4vbGliL2RlZmxhdGUnKTtcbnZhciBpbmZsYXRlICAgPSByZXF1aXJlKCcuL2xpYi9pbmZsYXRlJyk7XG52YXIgY29uc3RhbnRzID0gcmVxdWlyZSgnLi9saWIvemxpYi9jb25zdGFudHMnKTtcblxudmFyIHBha28gPSB7fTtcblxuYXNzaWduKHBha28sIGRlZmxhdGUsIGluZmxhdGUsIGNvbnN0YW50cyk7XG5cbm1vZHVsZS5leHBvcnRzID0gcGFrbztcbiIsIid1c2Ugc3RyaWN0JztcblxuXG52YXIgemxpYl9kZWZsYXRlID0gcmVxdWlyZSgnLi96bGliL2RlZmxhdGUnKTtcbnZhciB1dGlscyAgICAgICAgPSByZXF1aXJlKCcuL3V0aWxzL2NvbW1vbicpO1xudmFyIHN0cmluZ3MgICAgICA9IHJlcXVpcmUoJy4vdXRpbHMvc3RyaW5ncycpO1xudmFyIG1zZyAgICAgICAgICA9IHJlcXVpcmUoJy4vemxpYi9tZXNzYWdlcycpO1xudmFyIFpTdHJlYW0gICAgICA9IHJlcXVpcmUoJy4vemxpYi96c3RyZWFtJyk7XG5cbnZhciB0b1N0cmluZyA9IE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmc7XG5cbi8qIFB1YmxpYyBjb25zdGFudHMgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xu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9ERUZBVUxUX1NUUkFURUdZICAgID0gMDtcblxuLyogUG9zc2libGUgdmFsdWVzIG9mIHRoZSBkYXRhX3R5cGUgZmllbGQgKHRob3VnaCBzZWUgaW5mbGF0ZSgpKSAqL1xuLy92YXIgWl9CSU5BUlkgICAgICAgICAgICAgID0gMDtcbi8vdmFyIFpfVEVYVCAgICAgICAgICAgICAgICA9IDE7XG4vL3ZhciBaX0FTQ0lJICAgICAgICAgICAgICAgPSAxOyAvLyA9IFpfVEVYVFxudmFyIFpfVU5LTk9XTiAgICAgICAgICAgICA9IDI7XG5cblxuLyogVGhlIGRlZmxhdGUgY29tcHJlc3Npb24gbWV0aG9kICovXG52YXIgWl9ERUZMQVRFRCAgPSA4O1xuXG4vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuXG5cbnZhciBNQVhfTUVNX0xFVkVMID0gOTtcbi8qIE1heGltdW0gdmFsdWUgZm9yIG1lbUxldmVsIGluIGRlZmxhdGVJbml0MiAqL1xudmFyIE1BWF9XQklUUyA9IDE1O1xuLyogMzJLIExaNzcgd2luZG93ICovXG52YXIgREVGX01FTV9MRVZFTCA9IDg7XG5cblxudmFyIExFTkdUSF9DT0RFUyAgPSAyOTtcbi8qIG51bWJlciBvZiBsZW5ndGggY29kZXMsIG5vdCBjb3VudGluZyB0aGUgc3BlY2lhbCBFTkRfQkxPQ0sgY29kZSAqL1xudmFyIExJVEVSQUxTICAgICAgPSAyNTY7XG4vKiBudW1iZXIgb2YgbGl0ZXJhbCBieXRlcyAwLi4yNTUgKi9cbnZhciBMX0NPREVTICAgICAgID0gTElURVJBTFMgKyAxICsgTEVOR1RIX0NPREVTO1xuLyogbnVtYmVyIG9mIExpdGVyYWwgb3IgTGVuZ3RoIGNvZGVzLCBpbmNsdWRpbmcgdGhlIEVORF9CTE9DSyBjb2RlICovXG52YXIgRF9DT0RFUyAgICAgICA9IDMwO1xuL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AgICAgICAgICAgIF93aW5bKytzY2FuXSA9PT0gX3dpblsrK21hdGNoXSAmJiBfd2luWysrc2Nhbl0gPT09IF93aW5bKyttYXRjaF0gJiZcbiAgICAgICAgICAgICBzY2FuIDwgc3RyZW5kKTtcblxuICAgIC8vIEFzc2VydChzY2FuIDw9IHMtPndpbmRvdysodW5zaWduZWQpKHMtPndpbmRvd19zaXplLTEpLCBcIndpbGQgc2NhblwiKTtcblxuICAgIGxlbiA9IE1BWF9NQVRDSCAtIChzdHJlbmQgLSBzY2FuKTtcbiAgICBzY2FuID0gc3RyZW5kIC0gTUFYX01BVENIO1xuXG4gICAgaWYgKGxlbiA+IGJlc3RfbGVuKSB7XG4gICAgICBzLm1hdGNoX3N0YXJ0ID0gY3VyX21hdGNoO1xuICAgICAgYmVzdF9sZW4gPSBsZW47XG4gICAgICBpZiAobGVuID49IG5pY2VfbWF0Y2gpIHtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICBzY2FuX2VuZDEgID0gX3dpbltzY2FuICsgYmVzdF9sZW4gLSAxXTtcbiAgICAgIHNjYW5fZW5kICAgPSBfd2luW3NjYW4gKyBiZXN0X2xlbl07XG4gICAgfVxuICB9IHdoaWxlICgoY3VyX21hdGNoID0gcHJldltjdXJfbWF0Y2ggJiB3bWFza10pID4gbGltaXQgJiYgLS1jaGFpbl9sZW5ndGggIT09IDApO1xuXG4gIGlmIChiZXN0X2xlbiA8PSBzLmxvb2thaGVhZCkge1xuICAgIHJldHVybiBiZXN0X2xlbjtcbiAgfVxuICByZXR1cm4gcy5sb29rYWhlYWQ7XG59XG5cblxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBGaWxsIHRoZSB3aW5kb3cgd2hlbiB0aGUgbG9va2FoZWFkIGJlY29tZXMgaW5zdWZmaWNpZW50LlxuICogVXBkYXRlcyBzdHJzdGFydCBhbmQgbG9va2Fo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X0lOSVQ7XG4vLyAgICAgIHptZW16ZXJvKHMtPndpbmRvdyArIGN1cnIsICh1bnNpZ25lZClpbml0KTtcbi8vICAgICAgcy0+aGlnaF93YXRlciA9IGN1cnIgKyBpbml0O1xuLy8gICAgfVxuLy8gICAgZWxzZSBpZiAocy0+aGlnaF93YXRlciA8ICh1bGcpY3VyciArIFdJTl9JTklUKSB7XG4vLyAgICAgIC8qIEhpZ2ggd2F0ZXIgbWFyayBhdCBvciBhYm92ZSBjdXJyZW50IGRhdGEsIGJ1dCBiZWxvdyBjdXJyZW50IGRhdGFcbi8vICAgICAgICogcGx1cyBXSU5fSU5JVCAtLSB6ZXJvIG91dCB0byBjdXJyZW50IGRhdGEgcGx1cyBXSU5fSU5JVCwgb3IgdXBcbi8vICAgICAgICogdG8gZW5kIG9mIHdpbmRvdywgd2hpY2hldmVyIGlzIGxlc3MuXG4vLyAgICAgICAqL1xuLy8gICAgICBpbml0ID0gKHVsZyljdXJyICsgV0lOX0lOSVQgLSBzLT5oaWdoX3dhdGVyO1xuLy8gICAgICBpZiAoaW5pdCA+IHMtPndpbmRvd19zaXplIC0gcy0+aGlnaF93YXRlcilcbi8vICAgICAgICBpbml0ID0gcy0+d2luZG93X3NpemUgLSBzLT5oaWdoX3dhdGVyO1xuLy8gICAgICB6bWVtemVybyhzLT53aW5kb3cgKyBzLT5oaWdoX3dhdGVyLCAodW5zaWduZWQpaW5pdCk7XG4vLyAgICAgIHMtPmhpZ2hfd2F0ZXIgKz0gaW5pdDtcbi8vICAgIH1cbi8vICB9XG4vL1xuLy8gIEFzc2VydCgodWxnKXMtPnN0cnN0YXJ0IDw9IHMtPndpbmRvd19zaXplIC0gTUlOX0xPT0tBSEVBRCxcbi8vICAgIFwibm90IGVub3VnaCByb29tIGZvciBzZWFyY2hcIik7XG59XG5cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogQ29weSB3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1c2g7XG4gIHMubGFzdF9mbHVzaCA9IGZsdXNoO1xuXG4gIC8qIFdyaXRlIHRoZSBoZWFkZXIgKi9cbiAgaWYgKHMuc3RhdHVzID09PSBJTklUX1NUQVRFKSB7XG5cbiAgICBpZiAocy53cmFwID09PSAyKSB7IC8vIEdaSVAgaGVhZGVyXG4gICAgICBzdHJtLmFkbGVyID0gMDsgIC8vY3JjMzIoMEwsIFpfTlVMTCwgMCk7XG4gICAgICBwdXRfYnl0ZShzLCAzMSk7XG4gICAgICBwdXRfYnl0ZShzLCAxMzkpO1xuICAgICAgcHV0X2J5dGUocywgOCk7XG4gICAgICBpZiAoIXMuZ3poZWFkKSB7IC8vIHMtPmd6aGVhZCA9PSBaX05VTExcbiAgICAgICAgcHV0X2J5dGUocywgMCk7XG4gICAgICAgIHB1dF9ieXRlKHMsIDApO1xuICAgICAgICBwdXRfYnl0ZShzLCAwKTtcbiAgICAgICAgcHV0X2J5dGUocywgMCk7XG4gICAgICAgIHB1dF9ieXRlKHMsIDApO1xuICAgICAgICBwdXRfYnl0ZShzLCBzLmxldmVsID09PSA5ID8gMiA6XG4gICAgICAgICAgICAgICAgICAgIChzLnN0cmF0ZWd5ID49IFpfSFVGRk1BTl9PTkxZIHx8IHMubGV2ZWwgPCAyID9cbiAgICAgICAgICAgICAgICAgICAgIDQgOiAwKSk7XG4gICAgICAgIHB1dF9ieXRlKHMsIE9TX0NPREUpO1xuICAgICAgICBzLnN0YXR1cyA9IEJVU1lfU1RBVEU7XG4gICAgICB9XG4gICAgICBlbHNlIHtcbiAgICAgICAgcHV0X2J5dGUocywgKHMuZ3poZWFkLnRleHQgPyAxIDogMCkgK1xuICAgICAgICAgICAgICAgICAgICAocy5nemhlYWQuaGNyYyA/IDIgOiAwKSArXG4gICAgICAgICAgICAgICAgICAgICghcy5nemhlYWQuZXh0cmEgPyAwIDogNCkgK1xuICAgICAgICAgICAgICAgICAgICAoIXMuZ3poZWFkLm5hbWUgPyAwIDogOCkgK1xuICAgICAgICAgICAgICAgICAgICAoIXMuZ3poZWFkLmNvbW1lbnQgPyAwIDogMTYpXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgcHV0X2J5dGUocywgcy5nemhlYWQudGltZSAmIDB4ZmYpO1xuICAgICAgICBwdXRfYnl0ZShzLCAocy5nemhlYWQudGltZSA+PiA4KSAmIDB4ZmYpO1xuICAgICAgICBwdXRfYnl0ZShzLCAocy5nemhlYWQudGltZSA+PiAxNikgJiAweGZmKTtcbiAgICAgICAgcHV0X2J5dGUocywgKHMuZ3poZWFkLnRpbWUgPj4gMjQpICYgMHhmZik7XG4gICAgICAgIHB1dF9ieXRlKHMsIHMubGV2ZWwgPT09IDkgPyAyIDpcbiAgICAgICAgICAgICAgICAgICAgKHMuc3RyYXRlZ3kgPj0gWl9IVUZGTUFOX09OTFkgfHwgcy5sZXZlbCA8IDIgP1xuICAgICAgICAgICAgICAgICAgICAgNCA6IDApKTtcbiAgICAgICAgcHV0X2J5dGUocywgcy5nemhlYWQub3MgJiAweGZmKTtcbiAgICAgICAgaWYgKHMuZ3poZWFkLmV4dHJhICYmIHMuZ3poZWFkLmV4dHJhLmxlbmd0aCkge1xuICAgICAgICAgIHB1dF9ieXRlKHMsIHMuZ3poZWFkLmV4dHJhLmxlbmd0aCAmIDB4ZmYpO1xuICAgICAgICAgIHB1dF9ieXRlKHMsIChzLmd6aGVhZC5leHRyYS5sZW5ndGggPj4gOCkgJiAweGZmKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAocy5nemhlYWQuaGNyYykge1xuICAgICAgICAgIHN0cm0uYWRsZXIgPSBjcmMzMihzdHJtLmFkbGVyLCBzLnBlbmRpbmdfYnVmLCBzLnBlbmRpbmcsIDApO1xuICAgICAgICB9XG4gICAgICAgIHMuZ3ppbmRleCA9IDA7XG4gICAgICAgIHMuc3RhdHVzID0gRVhUUkFfU1RBVEU7XG4gICAgICB9XG4gICAgfVxuICAgIGVsc2UgLy8gREVGTEFURSBoZWFkZXJcbiAgIC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RhdHVzID09PSBFWFRSQV9TVEFURSkge1xuICAgIGlmIChzLmd6aGVhZC5leHRyYS8qICE9IFpfTlVMTCovKSB7XG4gICAgICBiZWcgPSBzLnBlbmRpbmc7ICAvKiBzdGFydCBvZiBieXRlcyB0byB1cGRhdGUgY3JjICovXG5cbiAgICAgIHdoaWxlIChzLmd6aW5kZXggPCAocy5nemhlYWQuZXh0cmEubGVuZ3RoICYgMHhmZmZmKSkge1xuICAgICAgICBpZiAocy5wZW5kaW5nID09PSBzLnBlbmRpbmdfYnVmX3NpemUpIHtcbiAgICAgICAgICBpZiAocy5nemhlYWQuaGNyYyAmJiBzLnBlbmRpbmcgPiBiZWcpIHtcbiAgICAgICAgICAgIHN0cm0uYWRsZXIgPSBjcmMzMihzdHJtLmFkbGVyLCBzLnBlbmRpbmdfYnVmLCBzLnBlbmRpbmcgLSBiZWcsIGJlZyk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGZsdXNoX3BlbmRpbmcoc3RybSk7XG4gICAgICAgICAgYmVnID0gcy5wZW5kaW5nO1xuICAgICAgICAgIGlmIChzLnBlbmRpbmcgPT09IHMucGVuZGluZ19idWZfc2l6ZSkge1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHB1dF9ieXRlKHMsIHMuZ3poZWFkLmV4dHJhW3MuZ3ppbmRleF0gJiAweGZmKTtcbiAgICAgICAgcy5nemluZGV4Kys7XG4gICAgICB9XG4gICAgICBpZiAocy5nemhlYWQuaGNyYyAmJiBzLnBlbmRpbmcgPiBiZWcpIHtcbiAgICAgICAgc3RybS5hZGxlciA9IGNyYzMyKHN0cm0uYWRsZXIsIHMucGVuZGluZ19idWYsIHMucGVuZGluZyAtIGJlZywgYmVnKTtcbiAgICAgIH1cbiAgICAgIGlmIChzLmd6aW5kZXggPT09IHMuZ3poZWFkLmV4dHJhLmxlbmd0aCkge1xuICAgICAgICBzLmd6aW5kZXggPSAwO1xuICAgICAgICBzLn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vdmFyIFpfRlVMTF9GTFVTSCAgICA9IDM7XG52YXIgWl9GSU5JU0ggICAgICAgID0gNDtcbnZhciBaX0JMT0NLICAgICAgICAgPSA1O1xudmFyIFpfVFJFRVMgICAgICAgICA9IDY7XG5cblxuLyogUmV0dXJuIGNvZGVzIGZvciB0aGUgY29tcHJlc3Npb24vZGVjb21wcmVzc2lvbiBmdW5jdGlvbnMuIE5lZ2F0aXZlIHZhbHVlc1xuICogYXJlIGVycm9ycywgcG9zaXRpdmUgdmFsdWVzIGFyZSB1c2VkIGZvciBzcGVjaWFsIGJ1dCBub3JtYWwgZXZlbnRzLlxuICovXG52YXIgWl9PSyAgICAgICAgICAgID0gMDtcbnZhciBaX1NUUkVBTV9FTkQgICAgPSAxO1xudmFyIFpfTkVFRF9ESUNUICAgICA9IDI7XG4vL3ZhciBaX0VSUk5PICAgICAgICAgPSAtMTtcbnZhciBaX1NUUkVBTV9FUlJPUiAgPSAtMjtcbnZhciBaX0RBVEFfRVJST1IgICAgPSAtMztcbnZhciBaX01FTV9FUlJPUiAgICAgPSAtNDtcbnZhciBaX0JVRl9FUlJPUiAgICAgPSAtNTtcbi8vdmFyIFpfVkVSU0lPTl9FUlJPUiA9IC02O1xuXG4vKiBUaGUgZGVmbGF0ZSBjb21wcmVzc2lvbiBtZXRob2QgKi9cbnZhciBaX0RFRkxBVEVEICA9IDg7XG5cblxuLyogU1RBVEVTID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG5cblxudmFyICAgIEhFQUQgPSAxOyAgICAgICAvKiBpOiB3YWl0aW5nIGZvciBtYWdpYyBoZWFkZXIgKi9cbnZhciAgICBGTEFHUyA9IDI7ICAgICAgLyogaTogd2FpdGluZyBmb3IgbWV0aG9kIGFuZCBmbGF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XIgICAgICAgICAgICBNQVRDSCA9IDI1OyAgICAgLyogbzogd2FpdGluZyBmb3Igb3V0cHV0IHNwYWNlIHRvIGNvcHkgc3RyaW5nICovXG52YXIgICAgICAgICAgICBMSVQgPSAyNjsgICAgICAgLyogbzogd2FpdGluZyBmb3Igb3V0cHV0IHNwYWNlIHRvIHdyaXRlIGxpdGVyYWwgKi9cbnZhciAgICBDSEVDSyA9IDI3OyAgICAgLyogaTogd2FpdGluZyBmb3IgMzItYml0IGNoZWNrIHZhbHVlICovXG52YXIgICAgTEVOR1RIID0gMjg7ICAgIC8qIGk6IHdhaXRpbmcgZm9yIDMyLWJpdCBsZW5ndGggKGd6aXApICovXG52YXIgICAgRE9ORSA9IDI5OyAgICAgIC8qIGZpbmlzaGVkIGNoZWNrLCBkb25lIC0tIHJlbWFpbiBoZXJlIHVudGlsIHJlc2V0ICovXG52YXIgICAgQkFEID0gMzA7ICAgICAgIC8qIGdvdCBhIGRhdGEgZXJyb3IgLS0gcmVtYWluIGhlcmUgdW50aWwgcmVzZXQgKi9cbnZhciAgICBNRU0gPSAzMTsgICAgICAgLyogZ290IGFuIGluZmxhdGUoKSBtZW1vcnkgZXJyb3IgLS0gcmVtYWluIGhlcmUgdW50aWwgcmVzZXQgKi9cbnZhciAgICBTWU5DID0gMzI7ICAgICAgLyogbG9va2luZyBmb3Igc3luY2hyb25pemF0aW9uIGJ5dGVzIHRvIHJlc3RhcnQgaW5mbGF0ZSgpICovXG5cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG5cblxuXG52YXIgRU5PVUdIX0xFTlMgPSA4NTI7XG52YXIgRU5PVUdIX0RJU1RTID0gNTkyO1xuLy92YXIgRU5PVUdIID0gIChFTk9VR0hfTEVOUytFTk9VR0hfRElTVFMpO1xuXG52YXIgTUFYX1dCSVRTID0gMTU7XG4vKiAzMksgTFo3NyB3aW5kb3cgKi9cbnZh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GVhdmU7IH1cbiAgICAgICAgaGF2ZS0tO1xuICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgYml0cyArPSA4O1xuICAgICAgfVxuICAgICAgLy89PT0vL1xuICAgICAgaWYgKHN0YXRlLmhlYWQpIHtcbiAgICAgICAgc3RhdGUuaGVhZC50aW1lID0gaG9sZDtcbiAgICAgIH1cbiAgICAgIGlmIChzdGF0ZS5mbGFncyAmIDB4MDIwMCkge1xuICAgICAgICAvLz09PSBDUkM0KHN0YXRlLmNoZWNrLCBob2xkKVxuICAgICAgICBoYnVmWzBdID0gaG9sZCAmIDB4ZmY7XG4gICAgICAgIGhidWZbMV0gPSAoaG9sZCA+Pj4gOCkgJiAweGZmO1xuICAgICAgICBoYnVmWzJdID0gKGhvbGQgPj4+IDE2KSAmIDB4ZmY7XG4gICAgICAgIGhidWZbM10gPSAoaG9sZCA+Pj4gMjQpICYgMHhmZjtcbiAgICAgICAgc3RhdGUuY2hlY2sgPSBjcmMzMihzdGF0ZS5jaGVjaywgaGJ1ZiwgNCwgMCk7XG4gICAgICAgIC8vPT09XG4gICAgICB9XG4gICAgICAvLz09PSBJTklUQklUUygpO1xuICAgICAgaG9sZCA9IDA7XG4gICAgICBiaXRzID0gMDtcbiAgICAgIC8vPT09Ly9cbiAgICAgIHN0YXRlLm1vZGUgPSBPUztcbiAgICAgIC8qIGZhbGxzIHRocm91Z2ggKi9cbiAgICBjYXNlIE9TOlxuICAgICAgLy89PT0gTkVFREJJVFMoMTYpOyAqL1xuICAgICAgd2hpbGUgKGJpdHMgPCAxNikge1xuICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgaGF2ZS0tO1xuICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgYml0cyArPSA4O1xuICAgICAgfVxuICAgICAgLy89PT0vL1xuICAgICAgaWYgKHN0YXRlLmhlYWQpIHtcbiAgICAgICAgc3RhdGUuaGVhZC54ZmxhZ3MgPSAoaG9sZCAmIDB4ZmYpO1xuICAgICAgICBzdGF0ZS5oZWFkLm9zID0gKGhvbGQgPj4gOCk7XG4gICAgICB9XG4gICAgICBpZiAoc3RhdGUuZmxhZ3MgJiAweDAyMDApIHtcbiAgICAgICAgLy89PT0gQ1JDMihzdGF0ZS5jaGVjaywgaG9sZCk7XG4gICAgICAgIGhidWZbMF0gPSBob2xkICYgMHhmZjtcbiAgICAgICAgaGJ1ZlsxXSA9IChob2xkID4+PiA4KSAmIDB4ZmY7XG4gICAgICAgIHN0YXRlLmNoZWNrID0gY3JjMzIoc3RhdGUuY2hlY2ssIGhidWYsIDIsIDApO1xuICAgICAgICAvLz09PS8vXG4gICAgICB9XG4gICAgICAvLz09PSBJTklUQklUUygpO1xuICAgICAgaG9sZCA9IDA7XG4gICAgICBiaXRzID0gMDtcbiAgICAgIC8vPT09Ly9cbiAgICAgIHN0YXRlLm1vZGUgPSBFWExFTjtcbiAgICAgIC8qIGZhbGxzIHRocm91Z2ggKi9cbiAgICBjYXNlIEVYTEVOOlxuICAgICAgaWYgKHN0YXRlLmZsYWdzICYgMHgwNDAwKSB7XG4gICAgICAgIC8vPT09IE5FRURCSVRTKDE2KTsgKi9cbiAgICAgICAgd2hpbGUgKGJpdHMgPCAxNikge1xuICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgIH1cbiAgICAgICAgLy89PT0vL1xuICAgICAgICBzdGF0ZS5sZW5ndGggPSBob2xkO1xuICAgICAgICBpZiAoc3RhdGUuaGVhZCkge1xuICAgICAgICAgIHN0YXRlLmhlYWQuZXh0cmFfbGVuID0gaG9sZDtcbiAgICAgICAgfVxuICAgICAgICBpZiAoc3R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yYXkoc3RhdGUuaGVhZC5leHRyYV9sZW4pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdXRpbHMuYXJyYXlTZXQoXG4gICAgICAgICAgICAgIHN0YXRlLmhlYWQuZXh0cmEsXG4gICAgICAgICAgICAgIGlucHV0LFxuICAgICAgICAgICAgICBuZXh0LFxuICAgICAgICAgICAgICAvLyBleHRyYSBmaWVsZCBpcyBsaW1pdGVkIHRvIDY1NTM2IGJ5dGVzXG4gICAgICAgICAgICAgIC8vIC0gbm8gbmVlZCBmb3IgYWRkaXRpb25hbCBzaXplIGNoZWNrXG4gICAgICAgICAgICAgIGNvcHksXG4gICAgICAgICAgICAgIC8qbGVuICsgY29weSA+IHN0YXRlLmhlYWQuZXh0cmFfbWF4IC0gbGVuID8gc3RhdGUuaGVhZC5leHRyYV9tYXggOiBjb3B5LCovXG4gICAgICAgICAgICAgIGxlblxuICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIC8vem1lbWNweShzdGF0ZS5oZWFkLmV4dHJhICsgbGVuLCBuZXh0LFxuICAgICAgICAgICAgLy8gICAgICAgIGxlbiArIGNvcHkgPiBzdGF0ZS5oZWFkLmV4dHJhX21heCA/XG4gICAgICAgICAgICAvLyAgICAgICAgc3RhdGUuaGVhZC5leHRyYV9tYXggLSBsZW4gOiBjb3B5KTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHN0YXRlLmZsYWdzICYgMHgwMjAwKSB7XG4gICAgICAgICAgICBzdGF0ZS5jaGVjayA9IGNyYzMyKHN0YXRlLmNoZWNrLCBpbnB1dCwgY29weSwgbmV4dCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGhhdmUgLT0gY29weTtcbiAgICAgICAgICBuZXh0ICs9IGNvcHk7XG4gICAgICAgICAgc3RhdGUubGVuZ3RoIC09IGNvcHk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHN0YXRlLmxlbmd0aCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgIH1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0gbnVsbDtcbiAgICAgIH1cbiAgICAgIHN0YXRlLm1vZGUgPSBIQ1JDO1xuICAgICAgLyogZmFsbHMgdGhyb3VnaCAqL1xuICAgIGNhc2UgSENSQzpcbiAgICAgIGlmIChzdGF0ZS5mbGFncyAmIDB4MDIwMCkge1xuICAgICAgICAvLz09PSBORUVEQklUUygxNik7ICovXG4gICAgICAgIHdoaWxlIChiaXRzIDwgMTYpIHtcbiAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICB9XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgaWYgKGhvbGQgIT09IChzdGF0ZS5jaGVjayAmIDB4ZmZmZikpIHtcbiAgICAgICAgICBzdHJtLm1zZyA9ICdoZWFkZXIgY3JjIG1pc21hdGNoJztcbiAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIC8vPT09IElOSVRCSVRTKCk7XG4gICAgICAgIGhvbGQgPSAwO1xuICAgICAgICBiaXRzID0gMDtcbiAgICAgICAgLy89PT0vL1xuICAgICAgfVxuICAgICAgaWYgKHN0YXRlLmhlYWQpIHtcbiAgICAgICAgc3RhdGUuaGVhZC5oY3JjID0gKChzdGF0ZS5mbGFncyA+PiA5KSAmIDEpO1xuICAgICAgICBzdGF0ZS5oZWFkLmRvbmUgPSB0cnVlO1xuICAgICAgfVxuICAgICAgc3RybS5hZGxlciA9IHN0YXRlLmNoZWNrID0gMDtcbiAgICAgIHN0YXRlLm1vZGUgPSBUWVBFO1xuICAgICAgYnJlYWs7XG4gICAgY2FzZSBESUNUSUQ6XG4gICAgICAvLz09PSBORUVEQklUUygzMik7ICovXG4gICAgICB3aGlsZSAoYml0cyA8I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hayBpbmZfbGVhdmU7IH1cbiAgICAgIC8qIGZhbGxzIHRocm91Z2ggKi9cbiAgICBjYXNlIFRZUEVETzpcbiAgICAgIGlmIChzdGF0ZS5sYXN0KSB7XG4gICAgICAgIC8vLS0tIEJZVEVCSVRTKCkgLS0tLy9cbiAgICAgICAgaG9sZCA+Pj49IGJpdHMgJiA3O1xuICAgICAgICBiaXRzIC09IGJpdHMgJiA3O1xuICAgICAgICAvLy0tLS8vXG4gICAgICAgIHN0YXRlLm1vZGUgPSBDSEVDSztcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICAvLz09PSBORUVEQklUUygzKTsgKi9cbiAgICAgIHdoaWxlIChiaXRzIDwgMykge1xuICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgaGF2ZS0tO1xuICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgYml0cyArPSA4O1xuICAgICAgfVxuICAgICAgLy89PT0vL1xuICAgICAgc3RhdGUubGFzdCA9IChob2xkICYgMHgwMSkvKkJJVFMoMSkqLztcbiAgICAgIC8vLS0tIERST1BCSVRTKDEpIC0tLS8vXG4gICAgICBob2xkID4+Pj0gMTtcbiAgICAgIGJpdHMgLT0gMTtcbiAgICAgIC8vLS0tLy9cblxuICAgICAgc3dpdGNoICgoaG9sZCAmIDB4MDMpLypCSVRTKDIpKi8pIHtcbiAgICAgIGNhc2UgMDogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHN0b3JlZCBibG9jayAqL1xuICAgICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgICBzdG9yZWQgYmxvY2slc1xcblwiLFxuICAgICAgICAvLyAgICAgICAgc3RhdGUubGFzdCA/IFwiIChsYXN0KVwiIDogXCJcIikpO1xuICAgICAgICBzdGF0ZS5tb2RlID0gU1RPUkVEO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgMTogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGZpeGVkIGJsb2NrICovXG4gICAgICAgIGZpeGVkdGFibGVzKHN0YXRlKTtcbiAgICAgICAgLy9UcmFjZXYoKHN0ZGVyciwgXCJpbmZsYXRlOiAgICAgZml4ZWQgY29kZXMgYmxvY2slc1xcblwiLFxuICAgICAgICAvLyAgICAgICAgc3RhdGUubGFzdCA/IFwiIChsYXN0KVwiIDogXCJcIikpO1xuICAgICAgICBzdGF0ZS5tb2RlID0gTEVOXzsgICAgICAgICAgICAgLyogZGVjb2RlIGNvZGVzICovXG4gICAgICAgIGlmIChmbHVzaCA9PT0gWl9UUkVFUykge1xuICAgICAgICAgIC8vLS0tIERST1BCSVRTKDIpIC0tLS8vXG4gICAgICAgICAgaG9sZCA+Pj49IDI7XG4gICAgICAgICAgYml0cyAtPSAyO1xuICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICBicmVhayBpbmZfbGVhdmU7XG4gICAgICAgIH1cbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIDI6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBkeW5hbWljIGJsb2NrICovXG4gICAgICAgIC8vVHJhY2V2KChzdGRlcnIsIFwiaW5mbGF0ZTogICAgIGR5bmFtaWMgY29kZXMgYmxvY2slc1xcblwiLFxuICAgICAgICAvLyAgICAgICAgc3RhdGUubGFzdCA/IFwiIChsYXN0KVwiIDogXCJcIikpO1xuICAgICAgICBzdGF0ZS5tb2RlID0gVEFCTEU7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAzOlxuICAgICAgICBzdHJtLm1zZyA9ICdpbnZhbGlkIGJsb2NrIHR5cGUnO1xuICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgfVxuICAgICAgLy8tLS0gRFJPUEJJVFMoMikgLS0tLy9cbiAgICAgIGhvbGQgPj4+PSAyO1xuICAgICAgYml0cyAtPSAyO1xuICAgICAgLy8tLS0vL1xuICA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gICAgY2FzZSBDT1BZXzpcbiAgICAgIHN0YXRlLm1vZGUgPSBDT1BZO1xuICAgICAgLyogZmFsbHMgdGhyb3VnaCAqL1xuICAgIGNhc2UgQ09QWTpcbiAgICAgIGNvcHkgPSBzdGF0ZS5sZW5ndGg7XG4gICAgICBpZiAoY29weSkge1xuICAgICAgICBpZiAoY29weSA+IGhhdmUpIHsgY29weSA9IGhhdmU7IH1cbiAgICAgICAgaWYgKGNvcHkgPiBsZWZ0KSB7IGNvcHkgPSBsZWZ0OyB9XG4gICAgICAgIGlmIChjb3B5ID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAvLy0tLSB6bWVtY3B5KHB1dCwgbmV4dCwgY29weSk7IC0tLVxuICAgICAgICB1dGlscy5hcnJheVNldChvdXRwdXQsIGlucHV0LCBuZXh0LCBjb3B5LCBwdXQpO1xuICAgICAgICAvLy0tLS8vXG4gICAgICAgIGhhdmUgLT0gY29weTtcbiAgICAgICAgbmV4dCArPSBjb3B5O1xuICAgICAgICBsZWZ0IC09IGNvcHk7XG4gICAgICAgIHB1dCArPSBjb3B5O1xuICAgICAgICBzdGF0ZS5sZW5ndGggLT0gY29weTtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgICAgIHN0b3JlZCBlbmRcXG5cIikpO1xuICAgICAgc3RhdGUubW9kZSA9IFRZUEU7XG4gICAgICBicmVhaztcbiAgICBjYXNlIFRBQkxFOlxuICAgICAgLy89PT0gTkVFREJJVFMoMTQpOyAqL1xuICAgICAgd2hpbGUgKGJpdHMgPCAxNCkge1xuICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgaGF2ZS0tO1xuICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgYml0cyArPSA4O1xuICAgICAgfVxuICAgICAgLy89PT0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AgICAgICAgLy8tLS0vL1xuICAgICAgICB9XG4gICAgICAgIGlmIChoZXJlX3ZhbCA8IDE2KSB7XG4gICAgICAgICAgLy8tLS0gRFJPUEJJVFMoaGVyZS5iaXRzKSAtLS0vL1xuICAgICAgICAgIGhvbGQgPj4+PSBoZXJlX2JpdHM7XG4gICAgICAgICAgYml0cyAtPSBoZXJlX2JpdHM7XG4gICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgIHN0YXRlLmxlbnNbc3RhdGUuaGF2ZSsrXSA9IGhlcmVfdmFsO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgIGlmIChoZXJlX3ZhbCA9PT0gMTYpIHtcbiAgICAgICAgICAgIC8vPT09IE5FRURCSVRTKGhlcmUuYml0cyArIDIpO1xuICAgICAgICAgICAgbiA9IGhlcmVfYml0cyArIDI7XG4gICAgICAgICAgICB3aGlsZSAoYml0cyA8IG4pIHtcbiAgICAgICAgICAgICAgaWYgKGhhdmUgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vPT09Ly9cbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKGhlcmUuYml0cykgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSBoZXJlX2JpdHM7XG4gICAgICAgICAgICBiaXRzIC09IGhlcmVfYml0cztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICAgIGlmIChzdGF0ZS5oYXZlID09PSAwKSB7XG4gICAgICAgICAgICAgIHN0cm0ubXNnID0gJ2ludmFsaWQgYml0IGxlbmd0aCByZXBlYXQnO1xuICAgICAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxlbiA9IHN0YXRlLmxlbnNbc3RhdGUuaGF2ZSAtIDFdO1xuICAgICAgICAgICAgY29weSA9IDMgKyAoaG9sZCAmIDB4MDMpOy8vQklUUygyKTtcbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKDIpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gMjtcbiAgICAgICAgICAgIGJpdHMgLT0gMjtcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICB9XG4gICAgICAgICAgZWxzZSBpZiAoaGVyZV92YWwgPT09IDE3KSB7XG4gICAgICAgICAgICAvLz09PSBORUVEQklUUyhoZXJlLmJpdHMgKyAzKTtcbiAgICAgICAgICAgIG4gPSBoZXJlX2JpdHMgKyAzO1xuICAgICAgICAgICAgd2hpbGUgKGJpdHMgPCBuKSB7XG4gICAgICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLz09PS8vXG4gICAgICAgICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gaGVyZV9iaXRzO1xuICAgICAgICAgICAgYml0cyAtPSBoZXJlX2JpdHM7XG4gICAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgICBsZW4gPSAwO1xuICAgICAgICAgICAgY29weSA9IDMgKyAoaG9sZCAmIDB4MDcpOy8vQklUUygzKTtcbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKDMpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gMztcbiAgICAgICAgICAgIGJpdHMgLT0gMztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICB9XG4gICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAvLz09PSBORUVEQklUUyhoZXJlLmJpdHMgKyA3KTtcbiAgICAgICAgICAgIG4gPSBoZXJlX2JpdHMgKyA3O1xuICAgICAgICAgICAgd2hpbGUgKGJpdHMgPCBuKSB7XG4gICAgICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLz09PS8vXG4gICAgICAgICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gaGVyZV9iaXRzO1xuICAgICAgICAgICAgYml0cyAtPSBoZXJlX2JpdHM7XG4gICAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgICBsZW4gPSAwO1xuICAgICAgICAgICAgY29weSA9IDExICsgKGhvbGQgJiAweDdmKTsvL0JJVFMoNyk7XG4gICAgICAgICAgICAvLy0tLSBEUk9QQklUUyg3KSAtLS0vL1xuICAgICAgICAgICAgaG9sZCA+Pj49IDc7XG4gICAgICAgICAgICBiaXRzIC09IDc7XG4gICAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChzdGF0ZS5oYXZlICsgY29weSA+IHN0YXRlLm5sZW4gKyBzdGF0ZS5uZGlzdCkge1xuICAgICAgICAgICAgc3RybS5tc2cgPSAnaW52YWxpZCBiaXQgbGVuZ3RoIHJlcGVhdCc7XG4gICAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICAgIHdoaWxlIChjb3B5LS0pIHtcbiAg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vL1xuICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgaGF2ZS0tO1xuICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgYml0cyArPSA4O1xuICAgICAgICAvLy0tLS8vXG4gICAgICB9XG4gICAgICBpZiAoKGhlcmVfb3AgJiAweGYwKSA9PT0gMCkge1xuICAgICAgICBsYXN0X2JpdHMgPSBoZXJlX2JpdHM7XG4gICAgICAgIGxhc3Rfb3AgPSBoZXJlX29wO1xuICAgICAgICBsYXN0X3ZhbCA9IGhlcmVfdmFsO1xuICAgICAgICBmb3IgKDs7KSB7XG4gICAgICAgICAgaGVyZSA9IHN0YXRlLmRpc3Rjb2RlW2xhc3RfdmFsICtcbiAgICAgICAgICAgICAgICAgICgoaG9sZCAmICgoMSA8PCAobGFzdF9iaXRzICsgbGFzdF9vcCkpIC0gMSkpLypCSVRTKGxhc3QuYml0cyArIGxhc3Qub3ApKi8gPj4gbGFzdF9iaXRzKV07XG4gICAgICAgICAgaGVyZV9iaXRzID0gaGVyZSA+Pj4gMjQ7XG4gICAgICAgICAgaGVyZV9vcCA9IChoZXJlID4+PiAxNikgJiAweGZmO1xuICAgICAgICAgIGhlcmVfdmFsID0gaGVyZSAmIDB4ZmZmZjtcblxuICAgICAgICAgIGlmICgobGFzdF9iaXRzICsgaGVyZV9iaXRzKSA8PSBiaXRzKSB7IGJyZWFrOyB9XG4gICAgICAgICAgLy8tLS0gUFVMTEJZVEUoKSAtLS0vL1xuICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgLy8tLS0vL1xuICAgICAgICB9XG4gICAgICAgIC8vLS0tIERST1BCSVRTKGxhc3QuYml0cykgLS0tLy9cbiAgICAgICAgaG9sZCA+Pj49IGxhc3RfYml0cztcbiAgICAgICAgYml0cyAtPSBsYXN0X2JpdHM7XG4gICAgICAgIC8vLS0tLy9cbiAgICAgICAgc3RhdGUuYmFjayArPSBsYXN0X2JpdHM7XG4gICAgICB9XG4gICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICBob2xkID4+Pj0gaGVyZV9iaXRzO1xuICAgICAgYml0cyAtPSBoZXJlX2JpdHM7XG4gICAgICAvLy0tLS8vXG4gICAgICBzdGF0ZS5iYWNrICs9IGhlcmVfYml0cztcbiAgICAgIGlmIChoZXJlX29wICYgNjQpIHtcbiAgICAgICAgc3RybS5tc2cgPSAnaW52YWxpZCBkaXN0YW5jZSBjb2RlJztcbiAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICBzdGF0ZS5vZmZzZXQgPSBoZXJlX3ZhbDtcbiAgICAgIHN0YXRlLmV4dHJhID0gKGhlcmVfb3ApICYgMTU7XG4gICAgICBzdGF0ZS5tb2RlID0gRElTVEVYVDtcbiAgICAgIC8qIGZhbGxzIHRocm91Z2ggKi9cbiAgICBjYXNlIERJU1RFWFQ6XG4gICAgICBpZiAoc3RhdGUuZXh0cmEpIHtcbiAgICAgICAgLy89PT0gTkVFREJJVFMoc3RhdGUuZXh0cmEpO1xuICAgICAgICBuID0gc3RhdGUuZXh0cmE7XG4gICAgICAgIHdoaWxlIChiaXRzIDwgbikge1xuICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgIH1cbiAgICAgICAgLy89PT0vL1xuICAgICAgICBzdGF0ZS5vZmZzZXQgKz0gaG9sZ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0IC0gY29weTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoY29weSA+IHN0YXRlLmxlbmd0aCkgeyBjb3B5ID0gc3RhdGUubGVuZ3RoOyB9XG4gICAgICAgIGZyb21fc291cmNlID0gc3RhdGUud2luZG93O1xuICAgICAgfVxuICAgICAgZWxzZSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogY29weSBmcm9tIG91dHB1dCAqL1xuICAgICAgICBmcm9tX3NvdXJjZSA9IG91dHB1dDtcbiAgICAgICAgZnJvbSA9IHB1dCAtIHN0YXRlLm9mZnNldDtcbiAgICAgICAgY29weSA9IHN0YXRlLmxlbmd0aDtcbiAgICAgIH1cbiAgICAgIGlmIChjb3B5ID4gbGVmdCkgeyBjb3B5ID0gbGVmdDsgfVxuICAgICAgbGVmdCAtPSBjb3B5O1xuICAgICAgc3RhdGUubGVuZ3RoIC09IGNvcHk7XG4gICAgICBkbyB7XG4gICAgICAgIG91dHB1dFtwdXQrK10gPSBmcm9tX3NvdXJjZVtmcm9tKytdO1xuICAgICAgfSB3aGlsZSAoLS1jb3B5KTtcbiAgICAgIGlmIChzdGF0ZS5sZW5ndGggPT09IDApIHsgc3RhdGUubW9kZSA9IExFTjsgfVxuICAgICAgYnJlYWs7XG4gICAgY2FzZSBMSVQ6XG4gICAgICBpZiAobGVmdCA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgIG91dHB1dFtwdXQrK10gPSBzdGF0ZS5sZW5ndGg7XG4gICAgICBsZWZ0LS07XG4gICAgICBzdGF0ZS5tb2RlID0gTEVOO1xuICAgICAgYnJlYWs7XG4gICAgY2FzZSBDSEVDSzpcbiAgICAgIGlmIChzdGF0ZS53cmFwKSB7XG4gICAgICAgIC8vPT09IE5FRURCSVRTKDMyKTtcbiAgICAgICAgd2hpbGUgKGJpdHMgPCAzMikge1xuICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICA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dvcms7ICAgIC8qIGR1bW15IHZhbHVlLS1ub3QgdXNlZCAqL1xuICAgIGVuZCA9IDE5O1xuXG4gIH0gZWxzZSBpZiAodHlwZSA9PT0gTEVOUykge1xuICAgIGJhc2UgPSBsYmFzZTtcbiAgICBiYXNlX2luZGV4IC09IDI1NztcbiAgICBleHRyYSA9IGxleHQ7XG4gICAgZXh0cmFfaW5kZXggLT0gMjU3O1xuICAgIGVuZCA9IDI1NjtcblxuICB9IGVsc2UgeyAgICAgICAgICAgICAgICAgICAgLyogRElTVFMgKi9cbiAgICBiYXNlID0gZGJhc2U7XG4gICAgZXh0cmEgPSBkZXh0O1xuICAgIGVuZCA9IC0xO1xuICB9XG5cbiAgLyogaW5pdGlhbGl6ZSBvcHRzIGZvciBsb29wICovXG4gIGh1ZmYgPSAwOyAgICAgICAgICAgICAgICAgICAvKiBzdGFydGluZyBjb2RlICovXG4gIHN5bSA9IDA7ICAgICAgICAgICAgICAgICAgICAvKiBzdGFydGluZyBjb2RlIHN5bWJvbCAqL1xuICBsZW4gPSBtaW47ICAgICAgICAgICAgICAgICAgLyogc3RhcnRpbmcgY29kZSBsZW5ndGggKi9cbiAgbmV4dCA9IHRhYmxlX2luZGV4OyAgICAgICAgICAgICAgLyogY3VycmVudCB0YWJsZSB0byBmaWxsIGluICovXG4gIGN1cnIgPSByb290OyAgICAgICAgICAgICAgICAvKiBjdXJyZW50IHRhYmxlIGluZGV4IGJpdHMgKi9cbiAgZHJvcCA9IDA7ICAgICAgICAgICAgICAgICAgIC8qIGN1cnJlbnQgYml0cyB0byBkcm9wIGZyb20gY29kZSBmb3IgaW5kZXggKi9cbiAgbG93ID0gLTE7ICAgICAgICAgICAgICAgICAgIC8qIHRyaWdnZXIgbmV3IHN1Yi10YWJsZSB3aGVuIGxlbiA+IHJvb3QgKi9cbiAgdXNlZCA9IDEgPDwgcm9vdDsgICAgICAgICAgLyogdXNlIHJvb3QgdGFibGUgZW50cmllcyAqL1xuICBtYXNrID0gdXNlZCA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cmVhbSBlcnJvcicsICAgICAgICAvKiBaX1NUUkVBTV9FUlJPUiAgKC0yKSAqL1xuICAnLTMnOiAgICdkYXRhIGVycm9yJywgICAgICAgICAgLyogWl9EQVRBX0VSUk9SICAgICgtMykgKi9cbiAgJy00JzogICAnaW5zdWZmaWNpZW50IG1lbW9yeScsIC8qIFpfTUVNX0VSUk9SICAgICAoLTQpICovXG4gICctNSc6ICAgJ2J1ZmZlciBlcnJvcicsICAgICAgICAvKiBaX0JVRl9FUlJPUiAgICAgKC01KSAqL1xuICAnLTYnOiAgICdpbmNvbXBhdGlibGUgdmVyc2lvbicgLyogWl9WRVJTSU9OX0VSUk9SICgtNikgKi9cbn07XG4iLCIndXNlIHN0cmljdCc7XG5cblxudmFyIHV0aWxzID0gcmVxdWlyZSgnLi4vdXRpbHMvY29tbW9uJyk7XG5cbi8qIFB1YmxpYyBjb25zdGFudHMgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuXG5cbi8vdmFyIFpfRklMVEVSRUQgICAgICAgICAgPSAxO1xuLy92YXIgWl9IVUZGTUFOX09OTFkgICAgICA9IDI7XG4vL3ZhciBaX1JMRSAgICAgICAgICAgICAgID0gMztcbnZhciBaX0ZJWEVEICAgICAgICAgICAgICAgPSA0O1xuLy92YXIgWl9ERUZBVUxUX1NUUkFURUdZICA9IDA7XG5cbi8qIFBvc3NpYmxlIHZhbHVlcyBvZiB0aGUgZGF0YV90eXBlIGZpZWxkICh0aG91Z2ggc2VlIGluZmxhdGUoKSkgKi9cbnZhciBaX0JJTkFSWSAgICAgICAgICAgICAgPSAwO1xudmFyIFpfVEVYVCAgICAgICAgICAgICAgICA9IDE7XG4vL3ZhciBaX0FTQ0lJICAgICAgICAgICAgID0gMTsgLy8gPSBaX1RFWFRcbnZhciBaX1VOS05PV04gICAgICAgICAgICAgPSAyO1xuXG4vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuXG5cbmZ1bmN0aW9uIHplcm8oYnVmKSB7IHZhciBsZW4gPSBidWYubGVuZ3RoOyB3aGlsZSAoLS1sZW4gPj0gMCkgeyBidWZbbGVuXSA9IDA7IH0gfVxuXG4vLyBGcm9tIHp1dGlsLmhcblxudmFyIFNUT1JFRF9CTE9DSyA9IDA7XG52YXIgU1RBVElDX1RSRUVTID0gMTtcbnZhciBEWU5fVFJFRVMgICAgPSAyO1xuLyogVGhlIHRocmVlIGtpbmRzIG9mIGJsb2NrIHR5cGUgKi9cblxudmFyIE1JTl9NQVRDSCAgICA9IDM7XG52YXIgTUFYX01BVENIICAgID0gMjU4O1xuLyogVGhlIG1pbmltdW0gYW5kIG1heGltdW0gbWF0Y2ggbGVuZ3RocyAqL1xuXG4vLyBGcm9tIGRlZmxhdGUuaFxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBJbnRlcm5hbCBjb21wcmVzc2lvbiBzdGF0ZS5cbiAqL1xuXG52YXIgTEVOR1RIX0NPREVTICA9IDI5O1xuLyogbnVtYmVyIG9mIGxlbmd0aCBjb2Rlcywgbm90IGNvdW50aW5nIHRoZSBzcGVjaWFsIEVORF9CTE9DSyBjb2RlICovXG5cbnZhciBMSVRFUkFMUyAgICAgID0gMjU2O1xuLyogbnVtYmVyIG9mIGxpdGVyYWwgYnl0ZXMgMC4uMjU1ICovXG5cbnZhciBMX0NPREVTICAgICAgID0gTElURVJBTFMgKyAxICsgTEVOR1RIX0NPREVTO1xuLyogbnVtYmVyIG9mIExpdGVyYWwgb3IgTGVuZ3RoIGNvZGVzLCBpbmNsdWRpbmcgdGhlIEVORF9CTE9DSyBjb2RlICovXG5cbnZhciBEX0NPREVTICAgICAgID0gMzA7XG4vKiBudW1iZXIgb2YgZGlzdGFuY2UgY29kZXMgKi9cblxudmFyIEJMX0NPREVTICAgICAgPSAxOTtcbi8qIG51bWJlciBvZiBjb2RlcyB1c2VkIHRvIHRyYW5zZmVyIHRoZSBiaXQgbGVuZ3RocyAqL1xuXG52YXIgSEVBUF9TSVpFICAgICA9IDIgKiBMX0NPREVTICsgMTtcbi8qIG1heGltdW0gaGVhcCBzaXplICovXG5cbnZhciBNQVhfQklUUyAgICAgID0gMTU7XG4vKiBBbGwgY29kZXMgbXVzdCBub3QgZXhjZWVkIE1BWF9CSVRTIGJpdHMgKi9cblxudmFyIEJ1Zl9zaXplICAgICAgPSAxNjtcbi8qIHNpemUgb2YgYml0IGJ1ZmZlciBpbiBiaV9idWYgKi9cblxuXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIENvbnN0YW50c1xuICovXG5cbnZhciBNQVhfQkxfQklUUyA9IDc7XG4vKiBCaXQgbGVuZ3RoIGNvZGVzIG11c3Qgbm90IGV4Y2VlZCBNQVhfQkxfQklUUyBiaXRzICovXG5cbnZhciBFTkRfQkxPQ0sgICA9IDI1Njtcbi8qIGVuZCBvZiBibG9jayBsaXRlcmFsIGNvZGUgKi9cblxudmFyIFJFUF8zXzYgICAgID0gMTY7XG4vKiByZXBlYXQgcHJldmlvdXMgYml0IGxlbmd0aCAzLTYgdGltZXMgKDIgYml0cyBvZiByZXBlYXQgY291bnQpICovXG5cbnZhciBSRVBaXzNfMTAgICA9IDE3O1xuLyogcmVwZWF0IGEgemVybyBsZW5ndGggMy0xMCB0aW1lcyAgKDMgYml0cyBvZiByZXBlYXQgY291bnQpICovXG5cbnZhciBSRVBaXzExXzEzOCA9IDE4O1xuLyogcmVwZWF0IGEgemVybyBsZW5ndGggMTEtMTM4IHRpbWVzICAoNyBiaXRzIG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VxKi8rKztcblxuICAgIH0gZWxzZSB7XG4gICAgICBzLmJsX3RyZWVbUkVQWl8xMV8xMzggKiAyXS8qLkZyZXEqLysrO1xuICAgIH1cblxuICAgIGNvdW50ID0gMDtcbiAgICBwcmV2bGVuID0gY3VybGVuO1xuXG4gICAgaWYgKG5leHRsZW4gPT09IDApIHtcbiAgICAgIG1heF9jb3VudCA9IDEzODtcbiAgICAgIG1pbl9jb3VudCA9IDM7XG5cbiAgICB9IGVsc2UgaWYgKGN1cmxlbiA9PT0gbmV4dGxlbikge1xuICAgICAgbWF4X2NvdW50ID0gNjtcbiAgICAgIG1pbl9jb3VudCA9IDM7XG5cbiAgICB9IGVsc2Uge1xuICAgICAgbWF4X2NvdW50ID0gNztcbiAgICAgIG1pbl9jb3VudCA9IDQ7XG4gICAgfVxuICB9XG59XG5cblxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBTZW5kIGEgbGl0ZXJhbCBvciBkaXN0YW5jZSB0cmVlIGluIGNvbXByZXNzZWQgZm9ybSwgdXNpbmcgdGhlIGNvZGVzIGluXG4gKiBibF90cmVlLlxuICovXG5mdW5jdGlvbiBzZW5kX3RyZWUocywgdHJlZSwgbWF4X2NvZGUpXG4vLyAgICBkZWZsYXRlX3N0YXRlICpzO1xuLy8gICAgY3RfZGF0YSAqdHJlZTsgLyogdGhlIHRyZWUgdG8gYmUgc2Nhbm5lZCAqL1xuLy8gICAgaW50IG1heF9jb2RlOyAgICAgICAvKiBhbmQgaXRzIGxhcmdlc3QgY29kZSBvZiBub24gemVybyBmcmVxdWVuY3kgKi9cbntcbiAgdmFyIG47ICAgICAgICAgICAgICAgICAgICAgLyogaXRlcmF0ZXMgb3ZlciBhbGwgdHJlZSBlbGVtZW50cyAqL1xuICB2YXIgcHJldmxlbiA9IC0xOyAgICAgICAgICAvKiBsYXN0IGVtaXR0ZWQgbGVuZ3RoICovXG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cbiAgICAgICAgY291bnQtLTtcbiAgICAgIH1cbiAgICAgIC8vQXNzZXJ0KGNvdW50ID49IDMgJiYgY291bnQgPD0gNiwgXCIgM182P1wiKTtcbiAgICAgIHNlbmRfY29kZShzLCBSRVBfM182LCBzLmJsX3RyZWUpO1xuICAgICAgc2VuZF9iaXRzKHMsIGNvdW50IC0gMywgMik7XG5cbiAgICB9IGVsc2UgaWYgKGNvdW50IDw9IDEwKSB7XG4gICAgICBzZW5kX2NvZGUocywgUkVQWl8zXzEwLCBzLmJsX3RyZWUpO1xuICAgICAgc2VuZF9iaXRzKHMsIGNvdW50IC0gMywgMyk7XG5cbiAgICB9IGVsc2Uge1xuICAgICAgc2VuZF9jb2RlKHMsIFJFUFpfMTFfMTM4LCBzLmJsX3RyZWUpO1xuICAgICAgc2VuZF9iaXRzKHMsIGNvdW50IC0gMTEsIDcpO1xuICAgIH1cblxuICAgIGNvdW50ID0gMDtcbiAgICBwcmV2bGVuID0gY3VybGVuO1xuICAgIGlmIChuZXh0bGVuID09PSAwKSB7XG4gICAgICBtYXhfY291bnQgPSAxMzg7XG4gICAgICBtaW5fY291bnQgPSAzO1xuXG4gICAgfSBlbHNlIGlmIChjdXJsZW4gPT09IG5leHRsZW4pIHtcbiAgICAgIG1heF9jb3VudCA9IDY7XG4gICAgICBtaW5fY291bnQgPSAzO1xuXG4gICAgfSBlbHNlIHtcbiAgICAgIG1heF9jb3VudCA9IDc7XG4gICAgICBtaW5fY291bnQgPSA0O1xuICAgIH1cbiAgfVxufVxuXG5cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogQ29uc3RydWN0IHRoZSBIdWZmbWFuIHRyZWUgZm9yIHRoZSBiaXQgbGVuZ3RocyBhbmQgcmV0dXJuIHRoZSBpbmRleCBpblxuICogYmxfb3JkZXIgb2YgdGhlIGxhc3QgYml0IGxlbmd0aCBjb2RlIHRvIHNlbm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ICAgX3RvdWNoWm9vbURpc3RhbmNlRW5kID0gX3RvdWNoWm9vbURpc3RhbmNlU3RhcnQgPSBNYXRoLnNxcnQoZHggKiBkeCArIGR5ICogZHkpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgX3N0YXRlID0gU1RBVEUuWk9PTTtcbiAgICAgICAgICAgICAgX3pvb21TdGFydC5jb3B5KGdldE1vdXNlT25TY3JlZW4oZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VYLCBldmVudC50b3VjaGVzWyAwIF0ucGFnZVkpKTtcbiAgICAgICAgICAgICAgX3pvb21FbmQuY29weShfem9vbVN0YXJ0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgIGlmIChldmVudC50b3VjaGVzLmxlbmd0aCA+PSAyKSB7XG4gICAgICAgICAgICAgIF9zdGF0ZSA9IFNUQVRFLlRPVUNIX1BBTjtcbiAgICAgICAgICAgICAgdmFyIHggPSAoZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VYICsgZXZlbnQudG91Y2hlc1sgMSBdLnBhZ2VYKSAvIDI7XG4gICAgICAgICAgICAgIHZhciB5ID0gKGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWSArIGV2ZW50LnRvdWNoZXNbIDEgXS5wYWdlWSkgLyAyO1xuICAgICAgICAgICAgICBfcGFuU3RhcnQuY29weShnZXRNb3VzZU9uU2NyZWVuKHgsIHkpKTtcbiAgICAgICAgICAgICAgX3BhbkVuZC5jb3B5KF9wYW5TdGFydCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBfc3RhdGUgPSBTVEFURS5QQU47XG4gICAgICAgICAgICAgIF9wYW5TdGFydC5jb3B5KGdldE1vdXNlT25TY3JlZW4oZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VYLCBldmVudC50b3V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hc2UgMDpcbiAgICAgICAgICAgIF9tb3ZlUHJldi5jb3B5KF9tb3ZlQ3Vycik7XG4gICAgICAgICAgICBfbW92ZUN1cnIuY29weShnZXRNb3VzZU9uQ2lyY2xlKGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWCwgZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VZKSk7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgIF96b29tRW5kLmNvcHkoZ2V0TW91c2VPblNjcmVlbihldmVudC50b3VjaGVzWyAwIF0ucGFnZVgsIGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWSkpO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICBfcGFuRW5kLmNvcHkoZ2V0TW91c2VPblNjcmVlbihldmVudC50b3VjaGVzWyAwIF0ucGFnZVgsIGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWSkpO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAvLyAyIGZpbmdlcnMhXG4gICAgICAgICAgICAvLyBUT1VDSCBaT09NXG4gICAgICAgICAgICB2YXIgZHggPSBldmVudC50b3VjaGVzWyAwIF0ucGFnZVggLSBldmVudC50b3VjaGVzWyAxIF0ucGFnZVg7XG4gICAgICAgICAgICB2YXIgZHkgPSBldmVudC50b3VjaGVzWyAwIF0ucGFnZVkgLSBldmVudC50b3VjaGVzWyAxIF0ucGFnZVk7XG4gICAgICAgICAgICBfdG91Y2hab29tRGlzdGFuY2VFbmQgPSBNYXRoLnNxcnQoZHggKiBkeCArIGR5ICogZHkpO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIDU6XG4gICAgICAgICAgICAvLyAyIGZpbmdlcnNcbiAgICAgICAgICAgIC8vIFRPVUNIX1BBTlxuICAgICAgICAgICAgdmFyIHggPSAo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gMCBdLnBhZ2VYLCBldmVudC50b3VjaGVzWyAwIF0ucGFnZVkpKTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgX3RvdWNoWm9vbURpc3RhbmNlU3RhcnQgPSBfdG91Y2hab29tRGlzdGFuY2VFbmQgPSAwO1xuXG4gICAgICAgICAgICB2YXIgeCA9IChldmVudC50b3VjaGVzWyAwIF0ucGFnZVggKyBldmVudC50b3VjaGVzWyAxIF0ucGFnZVgpIC8gMjtcbiAgICAgICAgICAgIHZhciB5ID0gKGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWSArIGV2ZW50LnRvdWNoZXNbIDEgXS5wYWdlWSkgLyAyO1xuICAgICAgICAgICAgX3BhbkVuZC5jb3B5KGdldE1vdXNlT25TY3JlZW4oeCwgeSkpO1xuICAgICAgICAgICAgX3BhblN0YXJ0LmNvcHkoX3BhbkVuZCk7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICB9XG5cbiAgICAgICAgX3N0YXRlID0gU1RBVEUuTk9ORTtcblxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgc3dpdGNoIChfc3RhdGUpIHtcblxuICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgIF9tb3ZlUHJldi5jb3B5KF9tb3ZlQ3Vycik7XG4gICAgICAgICAgICBfbW92ZUN1cnIuY29weShnZXRNb3VzZU9uQ2lyY2xlKGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWCwgZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VZKSk7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgNDpcbiAgICAgICAgICAgIC8vIFRPVUNIIFpPT01cbiAgICAgICAgICAgIF90b3VjaFpvb21EaXN0YW5jZVN0YXJ0ID0gX3RvdWNoWm9vbURp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VudGVyLnggLSBhYWJiLmhhbGZEaW1lbnNpb25zLngsIGFhYmIuY2VudGVyLnkgLSBhYWJiLmhhbGZEaW1lbnNpb25zLnksIGFhYmIuY2VudGVyLnogLSBhYWJiLmhhbGZEaW1lbnNpb25zLnopLFxuICAgICAgb3JpZW50YXRpb24ueFxuICAgICk7XG4gICAgdGhpcy5yYXlQbGFuZUluQkJveChyYXksIHBsYW5lQUFCQiwgYmJveCwgaW50ZXJzZWN0aW9ucyk7XG5cbiAgICByYXkuZGlyZWN0aW9uID0gb3JpZW50YXRpb24ueTtcbiAgICB0aGlzLnJheVBsYW5lSW5CQm94KHJheSwgcGxhbmVBQUJCLCBiYm94LCBpbnRlcnNlY3Rpb25zKTtcblxuICAgIHJheS5kaXJlY3Rpb24gPSBvcmllbnRhdGlvbi56O1xuICAgIHRoaXMucmF5UGxhbmVJbkJCb3gocmF5LCBwbGFuZUFBQkIsIGJib3gsIGludGVyc2VjdGlvbnMpO1xuXG4gICAgLy8gUkFZUyBTVEFSVElORyBGUk9NIFRIRSBMQVNUIENPUk5FUlxuICAgIC8vXG4gICAgLy8gICAgICAgICAgICAgICArXG4gICAgLy8gICAgICAgICAgICAgLidcbiAgICAvLyAgICstLS0tLS0tKydcbiAgICAvLyAgICAgICAgICAgfFxuICAgIC8vICAgICAgICAgICB8XG4gICAgLy8gICAgICAgICAgIHxcbiAgICAvLyAgICAgICAgICAgK1xuICAgIC8vXG5cbiAgICBsZXQgcmF5MiA9IHRoaXMucG9zZGlyKFxuICAgICAgbmV3IFRIUkVFLlZlY3RvcjMoYWFiYi5jZW50ZXIueCArIGFhYmIuaGFsZkRpbWVuc2lvbnMueCwgYWFiYi5jZW50ZXIueSArIGFhYmIuaGFsZkRpbWVuc2lvbnMueSwgYWFiYi5jZW50ZXIueiArIGFhYmIuaGFsZkRpbWVuc2lvbnMueiksXG4gICAgICBvcmllbnRhdGlvbi54XG4gICAgKTtcbiAgICB0aGlzLnJheVBsYW5lSW5CQm94KHJheTIsIHBsYW5lQUFCQiwgYmJveCwgaW50ZXJzZWN0aW9ucyk7XG5cbiAgICByYXkyLmRpcmVjdGlvbiA9IG9yaWVudGF0aW9uLnk7XG4gICAgdGhpcy5yYXlQbGFuZUluQkJveChyYXkyLCBwbGFuZUFBQkIsIGJib3gsIGludGVyc2VjdGlvbnMpO1xuXG4gICAgcmF5Mi5kaXJlY3Rpb24gPSBvcmllbnRhdGlvbi56O1xuICAgIHRoaXMucmF5UGxhbmVJbkJCb3gocmF5MiwgcGxhbmVBQUJCLCBiYm94LCBpbnRlcnNlY3Rpb25zKTtcblxuICAgIC8vIFJBWVMgU1RBUlRJTkcgRlJPTSBUSEUgU0VDT05EIENPUk5FUlxuICAgIC8vXG4gICAgLy8gICAgICAgICAgICAgICArXG4gICAgLy8gICAgICAgICAgICAgICB8XG4gICAgLy8gICAgICAgICAgICAgICB8XG4gICAgLy8gICAgICAgICAgICAgICB8XG4gICAgLy8gICAgICAgICAgICAgICArXG4gICAgLy8gICAgICAgICAgICAgLidcbiAgICAvLyAgICAgICAgICAgKydcblxuICAgIGxldCByYXkzID0gdGhpcy5wb3NkaXIoXG4gICAgICBuZXcgVEhSRUUuVmVjdG9yMyhhYWJiLmNlbnRlci54ICsgYWFiYi5oYWxmRGltZW5zaW9ucy54LCBhYWJiLmNlbnRlci55IC0gYWFiYi5oYWxmRGltZW5zaW9ucy55LCBhYWJiLmNlbnRlci56IC0gYWFiYi5oYWxmRGltZW5zaW9ucy56KSxcbiAgICAgIG9yaWVudGF0aW9uLnlcbiAgICApO1xuICAgIHRoaXMucmF5UGxhbmVJbkJCb3gocmF5MywgcGxhbmVBQUJCLCBiYm94LCBpbnRlcnNlY3Rpb25zKTtcblxuICAgIHJheTMuZGlyZWN0aW9uID0gb3JpZW50YXRpb24uejtcbiAgICB0aGlzLnJheVBsYW5lSW5CQm94KHJheTMsIHBsYW5lQUFCQiwgYmJveCwgaW50ZXJzZWN0aW9ucyk7XG5cbiAgICAvLyBSQVlTIFNUQVJ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yKFxuICAgICAgbmV3IFRIUkVFLlZlY3RvcjMoXG4gICAgICAgIGJib3gubWF4LngsXG4gICAgICAgIGJveC5jZW50ZXIueSxcbiAgICAgICAgYm94LmNlbnRlci56KSxcbiAgICAgIG5ldyBUSFJFRS5WZWN0b3IzKDEsIDAsIDApXG4gICAgKTtcbiAgICB0aGlzLnJheVBsYW5lSW5CQm94KHJheSwgcGxhbmUsIGJib3gsIGludGVyc2VjdGlvbnMpO1xuXG4gICAgLy8gWSBtaW5cbiAgICBwbGFuZSA9IHRoaXMucG9zZGlyKFxuICAgICAgbmV3IFRIUkVFLlZlY3RvcjMoXG4gICAgICAgIGJveC5jZW50ZXIueCxcbiAgICAgICAgYmJveC5taW4ueSxcbiAgICAgICAgYm94LmNlbnRlci56KSxcbiAgICAgIG5ldyBUSFJFRS5WZWN0b3IzKDAsIC0xLCAwKVxuICAgICk7XG4gICAgdGhpcy5yYXlQbGFuZUluQkJveChyYXksIHBsYW5lLCBiYm94LCBpbnRlcnNlY3Rpb25zKTtcblxuICAgIC8vIFkgbWF4XG4gICAgcGxhbmUgPSB0aGlzLnBvc2RpcihcbiAgICAgIG5ldyBUSFJFRS5WZWN0b3IzKFxuICAgICAgICBib3guY2VudGVyLngsXG4gICAgICAgIGJib3gubWF4LnksXG4gICAgICAgIGJveC5jZW50ZXIueiksXG4gICAgICBuZXcgVEhSRUUuVmVjdG9yMygwLCAxLCAwKVxuICAgICk7XG4gICAgdGhpcy5yYXlQbGFuZUluQkJveChyYXksIHBsYW5lLCBiYm94LCBpbnRlcnNlY3Rpb25zKTtcblxuICAgIC8vIFogbWluXG4gICAgcGxhbmUgPSB0aGlzLnBvc2RpcihcbiAgICAgIG5ldyBUSFJFRS5WZWN0b3IzKFxuICAgICAgICBib3guY2VudGVyLngsXG4gICAgICAgIGJveC5jZW50ZXIueSxcbiAgICAgICAgYmJveC5taW4ueiksXG4gICAgICBuZXcgVEhSRUUuVmVjdG9yMygwLCAwLCAtMSlcbiAgICApO1xuIC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B4bWxucz1cImh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnXCI+IFxcXG4gICAgICAgICAgICAgICAgICAgICAgXFxcbiAgICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPVwiTTcwLDcwIFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTDMwLDMwIFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQTEwLDEwIDAgMSAxIDEwLDEwXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBMTAsMTAgMCAxIDEgMzAsMzBcIiAvPlxcXG4gICAgICAgICAgICAgICAgICAgICAgXFxcbiAgICAgICAgICAgICAgICAgICAgICA8L3N2Zz4nICAgICAgICAgICAgICAgICAgICAgICAgO1xuICAgICAgICAgICAgICAgICAgICAgIFxuXG4gICAgdGhpcy5jcmVhdGVNZXNoKCk7XG4gIH1cblxuICB1cGRhdGVWb3hlbCh3b3JsZENvb3JkaW5hdGVzKSB7XG4gICAgLy8gdXBkYXRlIHdvcmxkIGNvb3JkaW5hdGVzXG4gICAgdGhpcy5fdm94ZWwud29ybGRDb29yZGluYXRlcyA9IHdvcmxkQ29vcmRpbmF0ZXM7XG5cbiAgICAvLyB1cGRhdGUgZGF0YSBjb29yZGluYXRlc1xuICAgIHRoaXMuX3ZveGVsLmRhdGFDb29yZGluYXRlcyA9ICBNb2RlbHNTdGFjay53b3JsZFRvRGF0YShcbiAgICAgICAgICAgICAgICAgIHRoaXMuX3N0YWNrLFxuICAgICAgICAgICAgICAgICAgdGhpcy5fdm94ZWwud29ybGRDb29yZGluYXRlcyk7XG5cbiAgICAvLyB1cGRhdGUgdmFsdWVcbiAgICBsZXQgdmFsdWUgPSBNb2RlbHNTdGFjay52YWx1ZShcbiAgICAgIHRoaXMuX3N0YWNrLFxuICAgICAgdGhpcy5fdm94ZWwuZGF0YUNvb3JkaW5hdGVzKTtcblxuICAgIHRoaXMuX3ZveGVsLnZhbHVlID0gTW9kZWxzU3RhY2sud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rpb24ob2JqZWN0KSB7XG4gKiAgICAgLy9zY2VuZS5hZGQoIG9iamVjdCApO1xuICogICAgIHdpbmRvdy5jb25zb2xlLmxvZyhvYmplY3QpO1xuICogICB9XG4gKiApO1xuICovXG5leHBvcnQgZGVmYXVsdCBjbGFzcyBMb2FkZXJzVm9sdW1lcyBleHRlbmRzIExvYWRlcnNCYXNle1xuXG4gIHBhcnNlKHJlc3BvbnNlKSB7XG5cbiAgICAvLyBnaXZlIGEgY2hhbmNlIHRvIHRoZSBVSSB0byB1cGRhdGUgYmVjYXVzZSBhZnRlciB0aGUgcmVuZGVyaW5nIHdpbGwgYmUgYmxvY2tlZCB3aXRoIGludGVuc2l2ZSBKU1xuICAgIHRoaXMuX3Byb2dyZXNzQmFyLnVwZGF0ZSgwLCAxMDAsICdwYXJzZScpO1xuXG4gICAgcmV0dXJuIG5ldyBQcm9taXNlKFxuICAgICAgICAocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG4gICAgICAgICAgICB3aW5kb3cuc2V0VGltZW91dChcbiAgICAgICAgICAgICAgKCkgPT4ge1xuICAgICAgICAgICAgICAgIHJlc29sdmUobmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuXG4gICAgICAgICAgICAgICAgICBsZXQgZGF0YSA9IHJlc3BvbnNlO1xuICAgICAgICAgICAgICAgICAgZGF0YS5nemNvbXByZXNzZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgIGRhdGEuZmlsZW5hbWUgPSAnJztcbiAgICAgICAgICAgICAgICAgIGRhdGEuZXh0ZW5zaW9uID0gJyc7XG5cbiAgICAgICAgICAgICAgICAgIC8vIHVuY29tcHJlc3M/XG4gICAgICAgICAgICAgICAgICBkYXRhLmZpbGVuYW1lID0gcmVzcG9uc2UudXJsLnNwbGl0KCcvJykucG9wKCk7XG4gICAgICAgICAgICAgICAgICBkYXRhLmd6Y29tcHJlc3NlZCA9IGZhbHNlO1xuXG4gICAgICAgICAgICAgICAgICAvLyBmaW5kIGV4dGVuc2lvblxuICAgICAgICAgICAgICAgICAgbGV0IHNwbGl0dGVkTmFtZSA9IGRhdGEuZmlsZW5hbWUuc3BsaXQoJy4nKTtcbiAgICAgICAgICAgICAgICAgIGlmKHNwbGl0dGVkTmFtZS5sZW5ndGggPD0gMSl7XG4gICAgICAgICAgICAgICAgICAgIGRhdGEuZXh0ZW5zaW9uID0gJyc7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBlbHNle1xuICAgICAgICAgICAgICAgICAgICBkYXRhLmV4dGVuc2lvbiA9IGRhdGEuZmlsZW5hbWUuc3BsaXQoJy4nKS5wb3AoKTtcbiAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgLy8gdW56aXAgaWYgZXh0ZW5zaW9uIGlzICcuZ3onXG4gICAgICAgICAgICAgICAgICBpZiAoZGF0YS5leHRlbnNpb24gPT09ICdneicpIHtcbiAgICAgICAgICAgICAgICAgICAgZGF0YS5nemNvbXByZXNzZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICBkYXRhLmV4dGVuc2lvbiA9IGRhdGEuZmlsZW5hbWUuc3BsaXQoJy5neicpLnNoaWZ0KCkuc3BsaXQoJy4nKS5wb3AoKTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGRlY29tcHJlc3NlZERhdGEgPSBwYWtvLmluZmxhdGUoZGF0YS5idWZmZXIpO1xuICAgICAgICAgICAgICAgICAgICBkYXRhLmJ1ZmZlciA9IGRlY29tcHJlc3NlZERhdGEuYnVmZmVyO1xuICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICBsZXQgcGFyc2VyID0gdGhpcy5fcGFyc2VyKGRhdGEuZXh0ZW5zaW9uKTtcbiAgICAgICAgICAgICAgICAgIGlmICghcGFyc2VyKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlamVjdChkYXRhLmZpbGVuYW1lICsgJyBjYW4gbm90IGJlIHBhcnNlZC4nKTtcbiAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgLy8gY2hlY2sgZXh0ZW5zaW9uXG4gICAgICAgICAgICAgICAgICBsZXQgdm9sdW1lUGFyc2VyID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIHZvbHVtZVBhcnNlciA9IG5ldyBwYXJzZXIoZGF0YSwgMCk7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICB3aW5kb3cuY29uc29sZS5sb2coZSk7XG4gICAgICAgICAgICAgICAgICAgIHJlamVjdChlKTtcbiAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgLy8gY3JlYXRlIGEgc2VyaWVzXG4gICAgICAgICAgICAgICAgICBsZXQgc2VyaWVzID0gbmV3IE1vZGVsc1NlcmllcygpO1xuICAgICAgICAgICAgICAgICAgc2VyaWVzLnNlcmllc0luc3RhbmNlVUlEID0gdm9sdW1lUGFyc2VyLnNlcmllc0luc3RhbmNlVUlEKCk7XG4gICAgICAgICAgICAgICAgICBzZXJpZXMubnVtYmVyT2ZGcmFtZXMgICAgPSB2b2x1bWVQYXJzZXIubnVtYmVyT2ZGcmFtZXMoKTtcbiAgICAgICAgICAgICAgICAgIGlmICghc2VyaWVzLm51bWJlck9mRnJhbWVzKSB7XG4gICAgICAgICAgICAgICAgICAgIHNlcmllcy5udW1iZXJPZkZyYW1lcyA9IDE7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBzZXJpZXMubW9kYWxpdHkgICAgICAgICAgPSB2b2x1bWVQYXJzZXIubW9kYWxpdHkoKTtcbiAgICAgICAgICAgICAgICAgIC8vIGlmIGl0IGlzIGEgc2VnbWVudGF0aW9uLCBhdHRhY2ggZXh0cmEgaW5mb3JtYXRpb25cbiAgICAgICAgICAgICAgICAgIGlmKHNlcmllcy5tb2RhbGl0eSA9PT0gJ1NFRycpe1xuICAgICAgICAgICAgICAgICAgICAvLyBjb2xvcnNcbiAgICAgICAgICAgICAgICAgICAgLy8gbGFiZWxzXG4gICAgICAgICAgICAgICAgICAgIC8vIGV0Yy5cbiAgICAgICAgICAgICAgICAgICAgc2VyaWVzLnNlZ21lbnRhdGlvblR5cGUgICAgID0gdm9sdW1lUGFyc2VyLnNlZ21lbnRhdGlvblR5cGUoKTtcbiAgICAgICAgICAgICAgICAgICAgc2VyaWVzLnNlZ21lbnRhdGlvblNlZ21lbnRzID0gdm9sdW1lUGFyc2VyLnNlZ21lbnRhdGlvblNlZ21lbnRzKCk7XG4gICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgIHNlcmllcy5udW1iZXJPZkNoYW5uZWxzID0gdm9sdW1lUGFyc2VyLm51bWJlck9mQ2hhbm5lbHMoKTtcblxuICAgICAgICAgICAgICAgICAgLy8ganVzdCBjcmVhdGUgMSBkdW1teSBzdGFjayBmb3Igbm93XG4gICAgICAgICAgICAgICAgICBsZXQgc3RhY2sgPSBuZXcgTW9kZWxzU3RhY2soKTtcbiAgICAgICAgICAgICAgICAgIHN0YWNrLm51bWJlck9mQ2hhbm5lbHMgPSB2b2x1bWVQYXJzZXIubnVtYmVyT2ZDaGFubmVscygpO1xuICAgICAgICAgICAgICAgICAgc3RhY2sucGl4ZWxUeXBlICAgICAgICA9IHZvbHVtZVBhcnNlci5waXhlbFR5cGUoKTtcbiAgICAgICAgICAgICAgICAgIHN0YWNrLmludmVydCAgICAgICAgICAgPSB2b2x1bWVQYXJzZXIuaW52ZXJ0KCk7XG4gICAgICAgICAgICAgICAgICBzdGFjay5tb2RhbGl0eSAgICAgICAgID0gc2VyaWVzLm1vZGFsaXR5O1xuICAgICAgICAgICAgICAgICAgc3RhY2sucmlnaHRIYW5kZWQgICAgICA9IHZvbHVtZVBhcnNlci5yaWdodEhhbmRlZCgpO1xuICAgICAgICAgICAgICAgICAgc2V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RSxcbiAgICAgIE51bWJlci5NQVhfVkFMVUUsIE51bWJlci5NSU5fVkFMVUUsXG4gICAgICBOdW1iZXIuTUFYX1ZBTFVFLCBOdW1iZXIuTUlOX1ZBTFVFXG4gICAgXTtcblxuICAgIGZvciAoIGxldCBpID0gMDsgaSA8PSB0aGlzLl9kaW1lbnNpb25zSUpLLng7IGkgKz0gdGhpcy5fZGltZW5zaW9uc0lKSy54ICkge1xuICAgICAgZm9yICggbGV0IGogPSAwOyBqIDw9IHRoaXMuX2RpbWVuc2lvbnNJSksueTsgaiArPSB0aGlzLl9kaW1lbnNpb25zSUpLLnkgKSB7XG4gICAgICAgIGZvciAobGV0IGsgPSAwOyBrIDw9IHRoaXMuX2RpbWVuc2lvbnNJSksuejsgayArPSB0aGlzLl9kaW1lbnNpb25zSUpLLnogKSB7XG5cbiAgICAgICAgICBsZXQgd29ybGQgPSBuZXcgVEhSRUUuVmVjdG9yMyggaSwgaiwgayApLmFwcGx5TWF0cml4NCggdGhpcy5faWprMkxQUyApO1xuICAgICAgICAgIGJib3ggPSBbXG4gICAgICAgICAgICBNYXRoLm1pbihiYm94WzBdLCB3b3JsZC54KSwgTWF0aC5tYXgoYmJveFsxXSwgd29ybGQueCksIC8vIHggbWluL21heFxuICAgICAgICAgICAgTWF0aC5taW4oYmJveFsyXSwgd29ybGQueSksIE1hdGgubWF4KGJib3hbM10sIHdvcmxkLnkpLFxuICAgICAgICAgICAgTWF0aC5taW4oYmJveFs0XSwgd29ybGQueiksIE1hdGgubWF4KGJib3hbNV0sIHdvcmxkLnopXG4gICAgICAgICAgICBdO1xuXG4gICAgICAgIH1cblxuICAgICAgfVxuXG4gICAgfVxuXG4gICAgcmV0dXJuIGJib3g7XG5cbiAgfVxuXG4gIEFBQkJveCgpIHtcblxuICAgIGxldCB3b3JsZDAgPSBuZXcgVEhSRUUuVmVjdG9yMygpLmFkZFNjYWxhciggLTAuNSApXG4gICAgICAuYXBwbHlNYXRyaXg0KCB0aGlzLl9pamsyT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9wZUludGVyY2VwdCggdmFsdWUsIHNsb3BlLCBpbnRlcmNlcHQgKSB7XG5cbiAgICByZXR1cm4gdmFsdWUgKiBzbG9wZSArIGludGVyY2VwdDtcblxuICB9XG5cbiAgc3RhdGljIGluZGV4SW5EaW1lbnNpb25zKCBpbmRleCwgZGltZW5zaW9ucyApIHtcblxuICAgIGlmICggaW5kZXgueCA+PSAwICYmXG4gICAgICAgICBpbmRleC55ID49IDAgJiZcbiAgICAgICAgIGluZGV4LnogPj0gMCAmJlxuICAgICAgICAgaW5kZXgueCA8IGRpbWVuc2lvbnMueCAmJlxuICAgICAgICAgaW5kZXgueSA8IGRpbWVuc2lvbnMueSAmJlxuICAgICAgICAgaW5kZXgueiA8IGRpbWVuc2lvbnMueiApIHtcblxuICAgICAgcmV0dXJuIHRydWU7XG5cbiAgICB9XG5cbiAgICByZXR1cm4gZmFsc2U7XG5cbiAgfVxuXG4gIF92ZWN0b3IzRnJvbUFycmF5KGFycmF5LCBpbmRleCkge1xuICAgIHJldHVybiBuZXcgVEhSRUUuVmVjdG9yMyhcbiAgICAgIGFycmF5W2luZGV4XSxcbiAgICAgIGFycmF5W2luZGV4ICsgMV0sXG4gICAgICBhcnJheVtpbmRleCArIDJdXG4gICAgICApO1xuICB9XG5cbiAgX29yZGVyRnJhbWVPbkRpbWVuc2lvbkluZGljZXNBcnJheVNvcnQoYSwgYikge1xuXG4gICAgaWYgKCdkaW1lbnNpb25JbmRleFZhbHVlcycgaW4gYSAmJiBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwoYS5kaW1lbnNpb25JbmRleFZhbHVlcykgPT09ICdbb2JqZWN0IEFycmF5XScgJiYgJ2RpbWVuc2lvbkluZGV4VmFsdWVzJyBpbiBiICYmIE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbChiLmRpbWVuc2lvbkluZGV4VmFsdWVzKSA9PT0gJ1tvYmplY3QgQXJyYXldJykge1xuICAgICAgZm9yIChsZXQgaSA9ID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doaWxlIChiaXRTdGFydE9mZnNldCA8IDgpIHtcblxuICAgICAgICAgIHN3aXRjaCAoYml0U3RhcnRPZmZzZXQpe1xuICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDEgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDIgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAzOlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDMgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA0OlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDQgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA1OlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDUgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA2OlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDYgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA3OlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDcgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgYml0U3RhcnRPZmZzZXQrKztcbiAgICAgICAgICBpbmRleCsrO1xuICAgICAgICAgIC8vIGlmIHJldHVybi4uXG4gICAgICAgICAgaWYgKGluZGV4ID49IG51bVBpeGVscykge1xuICAgICAgICAgICAgcmV0dXJuIG5ld0FycmF5O1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBiaXRTdGFydE9mZnNldCA9IDA7XG5cbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICBfY29udmVydENvbG9yU3BhY2UodW5jb21wcmVzc2VkRGF0YSkge1xuICAgIGxldCByZ2JEYXRhID0gbnVsbDtcbiAgICBsZXQgcGhvdG9tZXRyaWNJbnRlcnByZXRhdGlvbiA9IHRoaXMucGhvdG9tZXRyaWNJbnRlcnByZXRhdGlvbigpO1xuICAgIGxldCBwbGFuYXJDb25maWd1cmF0aW9uID0gdGhpcy5wbGFuYXJDb25maWd1cmF0aW9uKCk7XG5cbiAgICBpZiAocGhvdG9tZXRyaWNJbnRlcnByZXRhdGlvbiA9PT0gJ1JHQicgJiZcbiAgICAgICAgcGxhbmFyQ29uZmlndXJhdGlvbiA9PT0gMCkge1xuICAgICAgLy8gQUxMIEdPT0QsIEFMUkVBRFkgT1JERVJFRFxuICAgICAgLy8gcGxhbmFyIG9yIG5vbiBwbGFuYXIgcGxhbmFyQ29uZmlndXJhdGlvblxuICAgICAgcmdiRGF0YSA9IHVuY29tcHJlc3NlZERhdGE7XG5cbiAgICB9IGVsc2UgaWYgKHBob3RvbWV0cmljSW50ZXJwcmV0YXRpb24gPT09ICdSR0InICYmXG4gICAgICAgIHBsYW5hckNvbmZpZ3VyYXRpb24gPT09IDEpIHtcbiAgICAgIGlmICh1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ChlcnIpIHtcbiAgICAvLyAgIGNvbnNvbGUubG9nKGVycik7XG4gICAgLy8gfVxuXG4gICAgLy93aW5kb3cuY29uc29sZS5sb2coYnVmZmVyKTtcbiAgICAvLyB9XG5cbiAgICAvLyBpcyBpdCBjb21wcmVzc2VkP1xuICAgIC8vIHllcy9ub1xuXG4gICAgLy8gICAgIHRyeSB7XG4gICAgLy8gICB2YXIgcmVzdWx0ID0gcGFrby5pbmZsYXRlKGNvbXByZXNzZWQpO1xuICAgIC8vIH0gY2F0Y2ggKGVycikge1xuICAgIC8vICAgY29uc29sZS5sb2coZXJyKTtcbiAgICAvLyB9XG5cbiAgICAvLyB3aW5kb3cuY29uc29sZS5sb2codGhpcyk7XG4gIH1cblxuICBfZGVjb21wcmVzc1VuY29tcHJlc3NlZChmcmFtZUluZGV4ID0gMCkge1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9VSU5UOCAgICAgICAgICAgPSAyO1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9JTlQxNiAgICAgICAgICAgPSA0O1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9JTlQzMiAgICAgICAgICAgPSA4O1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9GTE9BVDMyICAgICAgICA9IDE2O1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9DT01QTEVYNjQgICAgICA9IDMyO1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9GTE9BVDY0ICAgICAgICA9IDY0O1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9SR0IyNCAgICAgICAgID0gMTI4O1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9JTlQ4ICAgICAgICAgID0gMjU2O1xuICAgIC8vIHBhcGF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gICd1Qml0c0FsbG9jYXRlZCc6IHtcbiAgICAgICAgdHlwZTogJ2knLFxuICAgICAgICB2YWx1ZTogOCxcbiAgICAgICAgdHlwZUdMU0w6ICdpbnQnXG4gICAgICB9LFxuICAgICAgJ3VJbnZlcnQnOiB7XG4gICAgICAgIHR5cGU6ICdpJyxcbiAgICAgICAgdmFsdWU6IDAsXG4gICAgICAgIHR5cGVHTFNMOiAnaW50J1xuICAgICAgfSxcbiAgICAgICd1THV0Jzoge1xuICAgICAgICB0eXBlOiAnaScsXG4gICAgICAgIHZhbHVlOiAwLFxuICAgICAgICB0eXBlR0xTTDogJ2ludCdcbiAgICAgIH0sXG4gICAgICAndVRleHR1cmVMVVQnOntcbiAgICAgICAgdHlwZTogJ3QnLFxuICAgICAgICB2YWx1ZTogW10sXG4gICAgICAgIHR5cGVHTFNMOiAnc2FtcGxlcjJEJ1xuICAgICAgfSxcbiAgICAgICd1UGl4ZWxUeXBlJzoge1xuICAgICAgICB0eXBlOiAnaScsXG4gICAgICAgIHZhbHVlOiAwLFxuICAgICAgICB0eXBlR0xTTDogJ2ludCdcbiAgICAgIH0sXG4gICAgICAndVBhY2tlZFBlclBpeGVsJzoge1xuICAgICAgICB0eXBlOiAnaScsXG4gICAgICAgIHZhbHVlOiAxLFxuICAgICAgICB0eXBlR0xTTDogJ2ludCdcbiAgICAgIH0sXG4gICAgICAndUludGVycG9sYXRpb24nOiB7XG4gICAgICAgIHR5cGU6ICdpJyxcbiAgICAgICAgdmFsdWU6IDEsXG4gICAgICAgIHR5cGVHTFNMOiAnaW50J1xuICAgICAgfSxcbiAgICAgICd1V29ybGRCQm94Jzoge1xuICAgICAgICB0eXBlOiAnZnYxJyxcbiAgICAgICAgdmFsdWU6IFswLjAsIDAuMCwgMC4wLCAwLjAsIDAuMCwgMC4wXSxcbiAgICAgICAgdHlwZUdMU0w6ICdmbG9hdCcsXG4gICAgICAgIGxlbmd0aDogNlxuICAgICAgfSxcbiAgICAgICd1U3RlcHMnOiB7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ICAgICAgIHZhciBiaXQgPSByZWFkQml0KCk7XG4gICAgICAgIGlmIChiaXQgPT09IG51bGwpXG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICBuID0gKG4gPDwgMSkgfCBiaXQ7XG4gICAgICAgIGxlbmd0aC0tO1xuICAgICAgfVxuICAgICAgcmV0dXJuIG47XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gcmVjZWl2ZUFuZEV4dGVuZChsZW5ndGgpIHtcbiAgICAgIHZhciBuID0gcmVjZWl2ZShsZW5ndGgpO1xuICAgICAgaWYgKG4gPj0gMSA8PCAobGVuZ3RoIC0gMSkpXG4gICAgICAgIHJldHVybiBuO1xuICAgICAgcmV0dXJuIG4gKyAoLTEgPDwgbGVuZ3RoKSArIDE7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZGVjb2RlQmFzZWxpbmUoY29tcG9uZW50LCBvZmZzZXQpIHtcbiAgICAgIHZhciB0ID0gZGVjb2RlSHVmZm1hbihjb21wb25lbnQuaHVmZm1hblRhYmxlREMpO1xuICAgICAgdmFyIGRpZmYgPSB0ID09PSAwID8gMCA6IHJlY2VpdmVBbmRFeHRlbmQodCk7XG4gICAgICBjb21wb25lbnQuYmxvY2tEYXRhW29mZnNldF0gPSAoY29tcG9uZW50LnByZWQgKz0gZGlmZik7XG4gICAgICB2YXIgayA9IDE7XG4gICAgICB3aGlsZSAoayA8IDY0KSB7XG4gICAgICAgIHZhciBycyA9IGRlY29kZUh1ZmZtYW4oY29tcG9uZW50Lmh1ZmZtYW5UYWJsZUFDKTtcbiAgICAgICAgdmFyIHMgPSBycyAmIDE1LCByID0gcnMgPj4gNDtcbiAgICAgICAgaWYgKHMgPT09IDApIHtcbiAgICAgICAgICBpZiAociA8IDE1KVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgayArPSAxNjtcbiAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuICAgICAgICBrICs9IHI7XG4gICAgICAgIHZhciB6ID0gZGN0W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iAgICAgICAgICAgIGVvYnJ1biA9IHJlY2VpdmUocikgKyAoMSA8PCByKSAtIDE7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgICAgayArPSAxNjtcbiAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuICAgICAgICBrICs9IHI7XG4gICAgICAgIHZhciB6ID0gZGN0WmlnWmFnW2tdO1xuICAgICAgICBjb21wb25lbnQuYmxvY2tEYXRhW29mZnNldCArIHpdID0gcmVjZWl2ZUFuZEV4dGVuZChzKSAqICgxIDw8IHN1Y2Nlc3NpdmUpO1xuICAgICAgICBrKys7XG4gICAgICB9XG4gICAgfVxuXG4gICAgdmFyIHN1Y2Nlc3NpdmVBQ1N0YXRlID0gMCwgc3VjY2Vzc2l2ZUFDTmV4dFZhbHVlO1xuICAgIGZ1bmN0aW9uIGRlY29kZUFDU3VjY2Vzc2l2ZShjb21wb25lbnQsIG9mZnNldCkge1xuICAgICAgdmFyIGsgPSBzcGVjdHJhbFN0YXJ0LCBlID0gc3BlY3RyYWxFbmQsIHIgPSAwO1xuICAgICAgd2hpbGUgKGsgPD0gZSkge1xuICAgICAgICB2YXIgeiA9IGRjdFppZ1phZ1trXTtcbiAgICAgICAgc3dpdGNoIChzdWNjZXNzaXZlQUNTdGF0ZSkge1xuICAgICAgICAgIGNhc2UgMDogLy8gaW5pdGlhbCBzdGF0ZVxuICAgICAgICAgICAgdmFyIHJzID0gZGVjb2RlSHVmZm1hbihjb21wb25lbnQuaHVmZm1hblRhYmxlQUMpO1xuICAgICAgICAgICAgdmFyIHMgPSBycyAmIDE1O1xuICAgICAgICAgICAgciA9IHJzID4+IDQ7XG4gICAgICAgICAgICBpZiAocyA9PT0gMCkge1xuICAgICAgICAgICAgICBpZiAociA8IDE1KSB7XG4gICAgICAgICAgICAgICAgZW9icnVuID0gcmVjZWl2ZShyKSArICgxIDw8IHIpO1xuICAgICAgICAgICAgICAgIHN1Y2Nlc3NpdmVBQ1N0YXRlID0gNDtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByID0gMTY7XG4gICAgICAgICAgICAgICAgc3VjY2Vzc2l2ZUFDU3RhdGUgPSAxO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBpZiAocyAhPT0gMSlcbiAgICAgICAgICAgICAgICB0aHJvdyBcImludmFsaWQgQUNuIGVuY29kaW5nXCI7XG4gICAgICAgICAgICAgIHN1Y2Nlc3NpdmVBQ05leHRWYWx1ZSA9IHJlY2VpdmVBbmRFeHRlbmQocyk7XG4gICAgICAgICAgICAgIHN1Y2Nlc3NpdmVBQ1N0YXRlID0gciA/IDIgOiAzO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgY2FzZSAxOiAvLyBza2lwcGluZyByIHplcm8gaXRlbXNcbiAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICBpZiAoY29tcG9uZW50LmJsb2NrRGF0YVtvZmZzZXQgKyB6XSkge1xuICAgICAgICAgICAgICBjb21wb25lbnQuYmxvY2tEYXRhW29mZnNldCArIHpdICs9IChyZWFkQml0KCkgPDwgc3VjY2Vzc2l2ZSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICByLS07XG4gICAgICAgICAgICAgIGlmIChyID09PSAwKVxuICAgICAgICAgICAgICAgIHN1Y2Nlc3NpdmVBQ1N0YXRlID0gc3VjY2Vzc2l2ZUFDU3RhdGUgPT0gMiA/IDMgOiAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSAzOiAvLyBzZXQgdmFsdWUgZm9yIGEgemVybyBpdGVtXG4gICAgICAgICAgICBpZiAoY29tcG9uZW50LmJsb2NrRGF0YVtvZmZzZXQgKyB6XSkge1xuICAgICAgICAgICAgICBjb21wb25lbnQuYmxvY2tEYXRhW29mZnNldCArIHpdICs9IChyZWFkQml0KCkgPDwgc3VjY2Vzc2l2ZSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBjb21wb25lbnQuYmxvY2tEYXRhW29mZnNldCArIHpdID0gc3VjY2Vzc2l2ZUFDTmV4dFZhbHVlIDw8IHN1Y2Nlc3NpdmU7XG4gICAgICAgICAgICAgIHN1Y2Nlc3NpdmVBQ1N0YXRlID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIGNhc2UgNDogLy8gZW9iXG4gICAgICAgICAgICBpZiAoY29tcG9uZW50LmJsb2NrRGF0YVtvZmZzZXQgKyB6XSkge1xuICAgICAgICAgICAgICBjb21wb25lbnQuYmxvY2tEYXRhW29mZnNldCArIHpdICs9IChyZWFkQml0KCkgPDwgc3VjY2Vzc2l2ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBrKys7XG4gICAgICB9XG4gICAgICBpZiAoc3VjY2Vzc2l2ZUFDU3RhdGUgPT09IDQpIHtcbiAgICAgICAgZW9icnVuLS07XG4gICAgICAgIGlmIChlb2JydW4gPT09IDApXG4gICAgICAgICAgc3VjY2Vzc2l2ZUFDU3RhdGUgPSAwO1xuICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIGRlY29kZU1jdShjb21wb25lbnQsIGRlY29kZSwgbWN1LCByb3csIGNvbCkge1xuICAgICAgdmFyIG1jdVJvdyA9IChtY3UgLyBtY3VzUGVyTGluZSkgfCAwO1xuICAgICAgdmFyIG1jdUNvbCA9IG1jdSAlIG1jdXNQZXJMaW5lO1xuICAgICAgdmFyIGJsb2NrUm93ID0gbWN1Um93ICogY29tcG9uZW50LnYgKyByb3c7XG4gICAgICB2YXIgYmxvY2tDb2wgPSBtY3VDb2wgKiBjb21wb25lbnQuaCArIGNvbDtcbiAgICAgIHZhciBvZmZzZXQgPSBnZXRCbG9ja0J1ZmZ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SB7XG4gICAgICBtY3VFeHBlY3RlZCA9IGNvbXBvbmVudHNbMF0uYmxvY2tzUGVyTGluZSAqIGNvbXBvbmVudHNbMF0uYmxvY2tzUGVyQ29sdW1uO1xuICAgIH0gZWxzZSB7XG4gICAgICBtY3VFeHBlY3RlZCA9IG1jdXNQZXJMaW5lICogZnJhbWUubWN1c1BlckNvbHVtbjtcbiAgICB9XG4gICAgaWYgKCFyZXNldEludGVydmFsKSB7XG4gICAgICByZXNldEludGVydmFsID0gbWN1RXhwZWN0ZWQ7XG4gICAgfVxuXG4gICAgdmFyIGgsIHY7XG4gICAgd2hpbGUgKG1jdSA8IG1jdUV4cGVjdGVkKSB7XG4gICAgICAvLyByZXNldCBpbnRlcnZhbCBzdHVmZlxuICAgICAgZm9yIChpID0gMDsgaSA8IGNvbXBvbmVudHNMZW5ndGg7IGkrKykge1xuICAgICAgICBjb21wb25lbnRzW2ldLnByZWQgPSAwO1xuICAgICAgfVxuICAgICAgZW9icnVuID0gMDtcblxuICAgICAgaWYgKGNvbXBvbmVudHNMZW5ndGggPT0gMSkge1xuICAgICAgICBjb21wb25lbnQgPSBjb21wb25lbnRzWzBdO1xuICAgICAgICBmb3IgKG4gPSAwOyBuIDwgcmVzZXRJbnRlcnZhbDsgbisrKSB7XG4gICAgICAgICAgZGVjb2RlQmxvY2soY29tcG9uZW50LCBkZWNvZGVGbiwgbWN1KTtcbiAgICAgICAgICBtY3UrKztcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgZm9yIChuID0gMDsgbiA8IHJlc2V0SW50ZXJ2YWw7IG4rKykge1xuICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBjb21wb25lbnRzTGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGNvbXBvbmVudCA9IGNvbXBvbmVudHNbaV07XG4gICAgICAgICAgICBoID0gY29tcG9uZW50Lmg7XG4gICAgICAgICAgICB2ID0gY29tcG9uZW50LnY7XG4gICAgICAgICAgICBmb3I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xOTg5LFxuICAvLyAgIDk4OC05OTEuXG4gIGZ1bmN0aW9uIHF1YW50aXplQW5kSW52ZXJzZShjb21wb25lbnQsIGJsb2NrQnVmZmVyT2Zmc2V0LCBwKSB7XG4gICAgdmFyIHF0ID0gY29tcG9uZW50LnF1YW50aXphdGlvblRhYmxlO1xuICAgIHZhciB2MCwgdjEsIHYyLCB2MywgdjQsIHY1LCB2NiwgdjcsIHQ7XG4gICAgdmFyIGk7XG5cbiAgICAvLyBkZXF1YW50XG4gICAgZm9yIChpID0gMDsgaSA8IDY0OyBpKyspIHtcbiAgICAgIHBbaV0gPSBjb21wb25lbnQuYmxvY2tEYXRhW2Jsb2NrQnVmZmVyT2Zmc2V0ICsgaV0gKiBxdFtpXTtcbiAgICB9XG5cbiAgICAvLyBpbnZlcnNlIERDVCBvbiByb3dzXG4gICAgZm9yIChpID0gMDsgaSA8IDg7ICsraSkge1xuICAgICAgdmFyIHJvdyA9IDggKiBpO1xuXG4gICAgICAvLyBjaGVjayBmb3IgYWxsLXplcm8gQUMgY29lZmZpY2llbnRzXG4gICAgICBpZiAocFsxICsgcm93XSA9PT0gMCAmJiBwWzIgKyByb3ddID09PSAwICYmIHBbMyArIHJvd10gPT09IDAgJiZcbiAgICAgICAgcFs0ICsgcm93XSA9PT0gMCAmJiBwWzUgKyByb3ddID09PSAwICYmIHBbNiArIHJvd10gPT09IDAgJiZcbiAgICAgICAgcFs3ICsgcm93XSA9PT0gMCkge1xuICAgICAgICB0ID0gKGRjdFNxcnQyICogcFswICsgcm93XSArIDUxMikgPj4gMTA7XG4gICAgICAgIHBbMCArIHJvd10gPSB0O1xuICAgICAgICBwWzEgKyByb3ddID0gdDtcbiAgICAgICAgcFsyICsgcm93XSA9IHQ7XG4gICAgICAgIHBbMyArIHJvd10gPSB0O1xuICAgICAgICBwWzQgKyByb3ddID0gdDtcbiAgICAgICAgcFs1ICsgcm93XSA9IHQ7XG4gICAgICAgIHBbNiArIHJvd10gPSB0O1xuICAgICAgICBwWzcgKyByb3ddID0gdDtcbiAgICAgICAgY29udGludWU7XG4gICAgICB9XG5cbiAgICAgIC8vIHN0YWdlIDRcbiAgICAgIHYwID0gKGRjdFNxcnQyICogcFswICsgcm93XSArIDEyOCkgPj4gODtcbiAgICAgIHYxID0gKGRjdFNxcnQyICogcFs0ICsgcm93XSArIDEyOCkgPj4gODtcbiAgICAgIHYyID0gcFsyICsgcm93XTtcbiAgICAgIHYzID0gcFs2ICsgcm93XTtcbiAgICAgIHY0ID0gKGRjdFNxcnQxZDIgKiAocFsxICsgcm93XSAtIHBbNyArIHJvd10pICsgMTI4KSA+PiA4O1xuICAgICAgdjcgPSAoZGN0U3FydDFkMiAqIChwWzEgKyByb3ddICsgcFs3ICsgcm93XSkgKyAxMjgpID4+IDg7XG4gICAgICB2NSA9IHBbMyArIHJvd10gPDwgNDtcbiAgICAgIHY2ID0gcFs1ICsgcm93XSA8PCA0O1xuXG4gICAgICAvLyBzdGFnZSAzXG4gICAgICB0ID0gKHYwIC0gdjEgKyAxKSA+PiAxO1xuICAgICAgdjAgPSAodjAgKyB2MSArIDEpID4+IDE7XG4gICAgICB2MSA9IHQ7XG4gICAgICB0ID0gKHYyICogZGN0U2luNiArIHYzICogZGN0Q29zNiArIDEyOCkgPj4gODtcbiAgICAgIHYyID0gKHYyICogZGN0Q29zNiAtIHYzICogZGN0U2luNiArIDEyOCkgPj4gODtcbiAgICAgIHYzID0gdDtcbiAgICAgIHQgPSAodjQgLSB2NiArIDEpID4+IDE7XG4gICAgICB2NCA9ICh2NCArIHY2ICsgMSkgPj4gMTtcbiAgICAgIHY2ID0gdDtcbiAgICAgIHQgPSAodjcgKyB2NSArIDEpID4+IDE7XG4gICAgICB2NSA9ICh2NyAtIHY1ICsgMSkgPj4gMTtcbiAgICAgIHY3ID0gdDtcblxuICAgICAgLy8gc3RhZ2UgMlxuICAgICAgdCA9ICh2MCAtIHYzICsgMSkgPj4gMTtcbiAgICAgIHYwID0gKHYwICsgdjMgKyAxKSA+P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b2xdID09PSAwICYmIHBbNSAqIDggKyBjb2xdID09PSAwICYmIHBbNiAqIDggKyBjb2xdID09PSAwICYmXG4gICAgICAgIHBbNyAqIDggKyBjb2xdID09PSAwKSB7XG4gICAgICAgIHQgPSAoZGN0U3FydDIgKiBwW2kgKyAwXSArIDgxOTIpID4+IDE0O1xuICAgICAgICBwWzAgKiA4ICsgY29sXSA9IHQ7XG4gICAgICAgIHBbMSAqIDggKyBjb2xdID0gdDtcbiAgICAgICAgcFsyICogOCArIGNvbF0gPSB0O1xuICAgICAgICBwWzMgKiA4ICsgY29sXSA9IHQ7XG4gICAgICAgIHBbNCAqIDggKyBjb2xdID0gdDtcbiAgICAgICAgcFs1ICogOCArIGNvbF0gPSB0O1xuICAgICAgICBwWzYgKiA4ICsgY29sXSA9IHQ7XG4gICAgICAgIHBbNyAqIDggKyBjb2xdID0gdDtcbiAgICAgICAgY29udGludWU7XG4gICAgICB9XG5cbiAgICAgIC8vIHN0YWdlIDRcbiAgICAgIHYwID0gKGRjdFNxcnQyICogcFswICogOCArIGNvbF0gKyAyMDQ4KSA+PiAxMjtcbiAgICAgIHYxID0gKGRjdFNxcnQyICogcFs0ICogOCArIGNvbF0gKyAyMDQ4KSA+PiAxMjtcbiAgICAgIHYyID0gcFsyICogOCArIGNvbF07XG4gICAgICB2MyA9IHBbNiAqIDggKyBjb2xdO1xuICAgICAgdjQgPSAoZGN0U3FydDFkMiAqIChwWzEgKiA4ICsgY29sXSAtIHBbNyAqIDggKyBjb2xdKSArIDIwNDgpID4+IDEyO1xuICAgICAgdjcgPSAoZGN0U3FydDFkMiAqIChwWzEgKiA4ICsgY29sXSArIHBbNyAqIDggKyBjb2xdKSArIDIwNDgpID4+IDEyO1xuICAgICAgdjUgPSBwWzMgKiA4ICsgY29sXTtcbiAgICAgIHY2ID0gcFs1ICogOCArIGNvbF07XG5cbiAgICAgIC8vIHN0YWdlIDNcbiAgICAgIHQgPSAodjAgLSB2MSArIDEpID4+IDE7XG4gICAgICB2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HhGRkUwOiAvLyBBUFAwIChBcHBsaWNhdGlvbiBTcGVjaWZpYylcbiAgICAgICAgICBjYXNlIDB4RkZFMTogLy8gQVBQMVxuICAgICAgICAgIGNhc2UgMHhGRkUyOiAvLyBBUFAyXG4gICAgICAgICAgY2FzZSAweEZGRTM6IC8vIEFQUDNcbiAgICAgICAgICBjYXNlIDB4RkZFNDogLy8gQVBQNFxuICAgICAgICAgIGNhc2UgMHhGRkU1OiAvLyBBUFA1XG4gICAgICAgICAgY2FzZSAweEZGRTY6IC8vIEFQUDZcbiAgICAgICAgICBjYXNlIDB4RkZFNzogLy8gQVBQN1xuICAgICAgICAgIGNhc2UgMHhGRkU4OiAvLyBBUFA4XG4gICAgICAgICAgY2FzZSAweEZGRTk6IC8vIEFQUDlcbiAgICAgICAgICBjYXNlIDB4RkZFQTogLy8gQVBQMTBcbiAgICAgICAgICBjYXNlIDB4RkZFQjogLy8gQVBQMTFcbiAgICAgICAgICBjYXNlIDB4RkZFQzogLy8gQVBQMTJcbiAgICAgICAgICBjYXNlIDB4RkZFRDogLy8gQVBQMTNcbiAgICAgICAgICBjYXNlIDB4RkZFRTogLy8gQVBQMTRcbiAgICAgICAgICBjYXNlIDB4RkZFRjogLy8gQVBQMTVcbiAgICAgICAgICBjYXNlIDB4RkZGRTogLy8gQ09NIChDb21tZW50KVxuICAgICAgICAgICAgdmFyIGFwcERhdGEgPSByZWFkRGF0YUJsb2NrKCk7XG5cbiAgICAgICAgICAgIGlmIChmaWxlTWFya2VyID09PSAweEZGRTApIHtcbiAgICAgICAgICAgICAgaWYgKGFwcERhdGFbMF0gPT09IDB4NEEgJiYgYXBwRGF0YVsxXSA9PT0gMHg0NiAmJiBhcHBEYXRhWzJdID09PSAweDQ5ICYmXG4gICAgICAgICAgICAgICAgYXBwRGF0YVszXSA9PT0gMHg0NiAmJiBhcHBEYXRhWzRdID09PSAwKSB7IC8vICdKRklGXFx4MDAnXG4gICAgICAgICAgICAgICAgamZpZiA9IHtcbiAgICAgICAgICAgICAgICAgIHZlcnNpb246IHttYWpvcjogYXBwRGF0YVs1XSwgbWlub3I6IGFwcERhdGFbNl19LFxuICAgICAgICAgICAgICAgICAgZGVuc2l0eVVuaXRzOiBhcHBEYXRhWzddLFxuICAgICAgICAgICAgICAgICAgeERlbnNpdHk6IChhcHBEYXRhWzhdIDw8IDgpIHwgYXBwRGF0YVs5XSxcbiAgICAgICAgICAgICAgICAgIHlEZW5zaXR5OiAoYXBwRGF0YVsxMF0gPDwgOCkgfCBhcHBEYXRhWzExXSxcbiAgICAgICAgICAgICAgICAgIHRodW1iV2lkdGg6IGFwcERhdGFbMTJdLFxuICAgICAgICAgICAgICAgICAgdGh1bWJIZWlnaHQ6IGFwcERhdGFbMTNdLFxuICAgICAgICAgICAgICAgICAgdGh1bWJEYXRhOiBhcHBEYXRhLnN1YmFycmF5KDE0LCAxNCArIDMgKiBhcHBEYXRhWzEyXSAqIGFwcERhdGFbMTNdKVxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIFRPRE8gQVBQMSAtIEV4aWZcbiAgICAgICAgICAgIGlmIChmaWxlTWFya2VyID09PSAweEZGRUUpIHtcbiAgICAgICAgICAgICAgaWYgKGFwcERhdGFbMF0gPT09IDB4NDEgJiYgYXBwRGF0YVsxXSA9PT0gMHg2NCAmJiBhcHBEYXRhWzJdID09PSAweDZGICYmXG4gICAgICAgICAgICAgICAgYXBwRGF0YVszXSA9PT0gMHg2MiAmJiBhcHBEYXRhWzRdID09PSAweDY1ICYmIGFwcERhdGFbNV0gPT09IDApIHsgLy8gJ0Fkb2JlXFx4MDAnXG4gICAgICAgICAgICAgICAgYWRvYmUgPSB7XG4gICAgICAgICAgICAgICAgICB2ZXJzaW9uOiBhcHBEYXRhWzZdLFxuICAgICAgICAgICAgICAgICAgZmxhZ3MwOiAoYXBwRGF0YVs3XSA8PCA4KSB8IGFwcERhdGFbOF0sXG4gICAgICAgICAgICAgICAgICBmbGFnczE6IChhcHBEYXRhWzldIDw8IDgpIHwgYXBwRGF0YVsxMF0sXG4gICAgICAgICAgICAgICAgICB0cmFuc2Zvcm1Db2RlOiBhcHBEYXRhWzExXVxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSAweEZGREI6IC8vIERRVCAoRGVmaW5lIFF1YW50aXphdGlvbiBUYWJsZXMpXG4gICAgICAgICAgICB2YXIgcXVhbnRpemF0aW9uVGFibGVzTGVuZ3RoID0gcmVhZFVpbnQxNigpO1xuICAgICAgICAgICAgdmFyIHF1YW50aXphdGlvblRhYmxlc0VuZCA9IHF1YW50aXphdGlvblRhYmxlc0xlbmd0aCArIG9mZnNldCAtIDI7XG4gICAgICAgICAgICB3aGlsZSAob2Zmc2V0IDwgcXVhbnRpemF0aW9uVGFibGVzRW5kKSB7XG4gICAgICAgICAgICAgIHZhciBxdWFudGl6YXRpb25UYWJsZVNwZWMgPSBkYXRhW29mZnNldCsrXTtcbiAgICAgICAgICAgICAgdmFyIHRhYmxlRGF0YSA9IG5ldyBJbnQzMkFycmF5KDY0KTtcbiAgICAgICAgICAgICAgaWYgKChxdWFudGl6YXRpb25UYWJsZVNwZWMgPj4gNCkgPT09IDApIHsgLy8gOCBiaXQgdmFsdWVzXG4gICAgICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IDY0OyBqKyspIHtcbiAgICAgICAgICAgICAgICAgIHZhciB6ID0gZGN0WmlnWmFnW2pdO1xuICAgICAgICAgICAgICAgICAgdGFibGVEYXRhW3pdID0gZGF0YVtvZmZzZXQrK107XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9IGVsc2UgaWYgKChxdWFudGl6YXRpb25UYWJsZVNwZWMgPj4gNCkgPT09IDEpIHsgLy8xNiBiaXRcbiAgICAgICAgICAgICAgICBmb3IgKGogPSAwOyBq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ICAgICAgICAgICBmcmFtZS5zY2FuTGluZXMgPSByZWFkVWludDE2KCk7XG4gICAgICAgICAgICBmcmFtZS5zYW1wbGVzUGVyTGluZSA9IHJlYWRVaW50MTYoKTtcbiAgICAgICAgICAgIGZyYW1lLmNvbXBvbmVudHMgPSBbXTtcbiAgICAgICAgICAgIGZyYW1lLmNvbXBvbmVudElkcyA9IHt9O1xuICAgICAgICAgICAgdmFyIGNvbXBvbmVudHNDb3VudCA9IGRhdGFbb2Zmc2V0KytdLCBjb21wb25lbnRJZDtcbiAgICAgICAgICAgIHZhciBtYXhIID0gMCwgbWF4ViA9IDA7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgY29tcG9uZW50c0NvdW50OyBpKyspIHtcbiAgICAgICAgICAgICAgY29tcG9uZW50SWQgPSBkYXRhW29mZnNldF07XG4gICAgICAgICAgICAgIHZhciBoID0gZGF0YVtvZmZzZXQgKyAxXSA+PiA0O1xuICAgICAgICAgICAgICB2YXIgdiA9IGRhdGFbb2Zmc2V0ICsgMV0gJiAxNTtcbiAgICAgICAgICAgICAgaWYgKG1heEggPCBoKVxuICAgICAgICAgICAgICAgIG1heEggPSBoO1xuICAgICAgICAgICAgICBpZiAobWF4ViA8IHYpXG4gICAgICAgICAgICAgICAgbWF4ViA9IHY7XG4gICAgICAgICAgICAgIHZhciBxSWQgPSBkYXRhW29mZnNldCArIDJdO1xuICAgICAgICAgICAgICBsID0gZnJhbWUuY29tcG9uZW50cy5wdXNoKHtcbiAgICAgICAgICAgICAgICBoOiBoLFxuICAgICAgICAgICAgICAgIHY6IHYsXG4gICAgICAgICAgICAgICAgcXVhbnRpemF0aW9uVGFibGU6IHF1YW50aXphdGlvblRhYmxlc1txSWRdLFxuICAgICAgICAgICAgICAgIHF1YW50aXphdGlvblRhYmxlSWQ6IHFJZCxcbiAgICAgICAgICAgICAgICBiaXRDb252ZXJzaW9uOiAyNTUgLyAoKDEgPDwgZnJhbWUucHJlY2lzaW9uKSAtIDEpXG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICBmcmFtZS5jb21wb25lbnRJZHNbY29tcG9uZW50SWRdID0gbCAtIDE7XG4gICAgICAgICAgICAgIG9mZnNldCArPSAzO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnJhbWUubWF4SCA9IG1heEg7XG4gICAgICAgICAgICBmcmFtZS5tYXhWID0gbWF4VjtcbiAgICAgICAgICAgIHByZXBhcmVDb21wb25lbnRzKGZyYW1lKTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSAweEZGQzQ6IC8vIERIVCAoRGVmaW5lIEh1ZmZtYW4gVGFibGVzKVxuICAgICAgICAgICAgdmFyIGh1ZmZtYW5MZW5ndGggPSByZWFkVWludDE2KCk7XG4gICAgICAgICAgICBmb3IgKGkgPSAyOyBpIDwgaHVmZm1hbkxlbmd0aDsgKSB7XG4gICAgICAgICAgICAgIHZhciBodWZmbWFuVGFibGVTcGVjID0gZGF0YVtvZmZzZXQrK107XG4gICAgICAgICAgICAgIHZhciBjb2RlTGVuZ3RocyA9IG5ldyBVaW50OEFycmF5KDE2KTtcbiAgICAgICAgICAgICAgdmFyIGNvZGVMZW5ndGhTdW0gPSAwO1xuICAgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgMTY7IGorKywgb2Zmc2V0KyspXG4gICAgICAgICAgICAgICAgY29kZUxlbmd0aFN1bSArPSAoY29kZUxlbmd0aHNbal0gPSBkYXRhW29mZnNldF0pO1xuICAgICAgICAgICAgICB2YXIgaHVmZm1hblZhbHVlcyA9IG5ldyBVaW50OEFycmF5KGNvZGVMZW5ndGhTdW0pO1xuICAgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgY29kZUxlbmd0aFN1bTsgaisrLCBvZmZzZXQrKylcbiAgICAgICAgICAgICAgICBodWZmbWFuVmFsdWVzW2pdID0gZGF0YVtvZmZzZXRdO1xuICAgICAgICAgICAgICBpICs9IDE3ICsgY29kZUxlbmd0aFN1bTtcblxuICAgICAgICAgICAgICAoKGh1ZmZtYW5UYWJsZVNwZWMgPj4gNCkgPT09IDAgP1xuICAgICAgICAgICAgICAgIGh1ZmZtYW5UYWJsZXNEQyA6IGh1ZmZtYW5UYWJsZXNBQylbaHVmZm1hblRhYmxlU3BlYyAmIDE1XSA9XG4gICAgICAgICAgICAgICAgYnVpbGRIdWZmbWFuVGFibGUoY29kZUxlbmd0aHMsIGh1ZmZtYW5WYWx1ZXMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIDB4RkZERDogLy8gRFJJIChEZWZpbmUgUmVzdGFydCBJbnRlcnZhbClcbiAgICAgICAgICAgIHJlYWRVaW50MTYoKTsgLy8gc2tpcCBkYXRhIGxlbmd0aFxuICAgICAgICAgICAgcmVzZXRJbnRlcnZhbCA9IHJlYWRVaW50MTYoKTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSAweEZGREE6IC8vIFNPUyAoU3RhcnQgb2YgU2NhbilcbiAgICAgICAgICAgIHZhciBzY2FuTGVuZ3RoID0gcmVhZFVpbnQxNigpO1xuICAgICAgICAgICAgdmFyIHNlbGVjdG9yc0NvdW50ID0gZGF0YVtvZmZzZXQrK107XG4gICAgICAgICAgICB2YXIgY29tcG9uZW50cyA9IFtdLCBjb21wb25lbnQ7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgc2VsZWN0b3JzQ291bnQ7IGkrKykge1xuICAgICAgICAgICAgICB2YXIgY29tcG9uZW50SW5kZXggPSBmcmFtZS5jb21wb25lbnRJZHNbZGF0YVtvZmZzZXQrK11dO1xuICAgICAgICAgICAgICBjb21wb25lbnQgPSBmcmFtZS5jb21wb25lbnRzW2NvbXBvbmVudEluZGV4XTtcbiAgICAgICAgICAgICAgdmFyIHRhYmxlU3BlYyA9IGRhdGFbb2Zmc2V0KytdO1xuICAgICAgICAgICAgICBjb21wb25lbnQuaHVm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BibG9jayB3YXMgZWF0ZW4gYnkgdGhlIGVuY29kZXJcbiAgICAgICAgICAgICAgb2Zmc2V0IC09IDM7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhyb3cgXCJ1bmtub3duIEpQRUcgbWFya2VyIFwiICsgZmlsZU1hcmtlci50b1N0cmluZygxNik7XG4gICAgICAgIH1cbiAgICAgICAgZmlsZU1hcmtlciA9IHJlYWRVaW50MTYoKTtcbiAgICAgIH1cblxuICAgICAgdGhpcy53aWR0aCA9IGZyYW1lLnNhbXBsZXNQZXJMaW5lO1xuICAgICAgdGhpcy5oZWlnaHQgPSBmcmFtZS5zY2FuTGluZXM7XG4gICAgICB0aGlzLmpmaWYgPSBqZmlmO1xuICAgICAgdGhpcy5hZG9iZSA9IGFkb2JlO1xuICAgICAgdGhpcy5jb21wb25lbnRzID0gW107XG4gICAgICBzd2l0Y2ggKGZyYW1lLmNvbXBvbmVudHMubGVuZ3RoKVxuICAgICAge1xuICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgdGhpcy5jb2xvcnNwYWNlID0gQ29sb3JTcGFjZS5HcmF5c2NhbGU7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgMzpcbiAgICAgICAgICBpZiAodGhpcy5hZG9iZSlcbiAgICAgICAgICAgIHRoaXMuY29sb3JzcGFjZSA9IENvbG9yU3BhY2UuQWRvYmVSR0I7XG4gICAgICAgICAgZWxzZVxuICAgICAgICAgICAgdGhpcy5jb2xvcnNwYWNlID0gQ29sb3JTcGFjZS5SR0I7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgNDpcbiAgICAgICAgICB0aGlzLmNvbG9yc3BhY2UgPSBDb2xvclNwYWNlLkNZTUs7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgdGhpcy5jb2xvcnNwYWNlID0gQ29sb3JTcGFjZS5Vbmtub3duO1xuICAgICAgfVxuICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBmcmFtZS5jb21wb25lbnRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgIHZhciBjb21wb25lbnQgPSBmcmFtZS5jb21wb25lbnRzW2ldO1xuICAgICAgICBpZiAoIWNvbXBvbmVudC5xdWFudGl6YXRpb25UYWJsZSAmJiBjb21wb25lbnQucXVhbnRpemF0aW9uVGFibGVJZCAhPT0gbnVsbClcbiAgICAgICAgICBjb21wb25lbnQucXVhbnRpemF0aW9uVGFibGUgPSBxdWFudGl6YXRpb25UYWJsZXNbY29tcG9uZW50LnF1YW50aXphdGlvblRhYmxlSWRdO1xuICAgICAgICB0aGlzLmNvbXBvbmVudHMucHVzaCh7XG4gICAgICAgICAgb3V0cHV0OiBidWlsZENvbXBvbmVudERhdGEoZnJhbWUsIGNvbXBvbmVudCksXG4gICAgICAgICAgc2NhbGVYOiBjb21wb25lbnQuaCAvIGZyYW1lLm1heEgsXG4gICAgICAgICAgc2NhbGVZOiBjb21wb25lbnQudiAvIGZyYW1lLm1heFYsXG4gICAgICAgICAgYmxvY2tzUGVyTGluZTogY29tcG9uZW50LmJsb2Nrc1BlckxpbmUsXG4gICAgICAgICAgYmxvY2tzUGVyQ29sdW1uOiBjb21wb25lbnQuYmxvY2tzUGVyQ29sdW1uLFxuICAgICAgICAgIGJpdENvbnZlcnNpb246IGNvbXBvbmVudC5iaXRDb252ZXJzaW9uXG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgIH0sXG4gICAgZ2V0RGF0YTE2OiBmdW5jdGlvbiBnZXREYXRhMTYod2lkdGgsIGhlaWdodCkge1xuICAgICAgaWYgKHRoaXMuY29tcG9uZW50cy5sZW5ndGggIT09IDEpXG4gICAgICAgIHRocm93ICdVbnN1cHBvcnRlZCBjb2xvciBtb2RlJztcbiAgICAgIHZhciBzY2FsZVggPSB0aGlzLndpZHRoIC8gd2lkdGgsIHNjYWxlWSA9IHRoaXMuaGVpZ2h0I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GwgPSAwO1xuICAgICAgICB2YXIgbGluZU9mZnNldCA9IDA7XG4gICAgICAgIGZvciAodmFyIGJsb2NrUm93ID0gMDsgYmxvY2tSb3cgPCBibG9ja3NQZXJDb2x1bW47IGJsb2NrUm93KyspIHtcbiAgICAgICAgICB2YXIgc2NhbkxpbmUgPSBibG9ja1JvdyA8PCAzO1xuICAgICAgICAgIGZvciAodmFyIGJsb2NrQ29sID0gMDsgYmxvY2tDb2wgPCBibG9ja3NQZXJMaW5lOyBibG9ja0NvbCsrKSB7XG4gICAgICAgICAgICB2YXIgYnVmZmVyT2Zmc2V0ID0gZ2V0QmxvY2tCdWZmZXJPZmZzZXQoY29tcG9uZW50LCBibG9ja1JvdywgYmxvY2tDb2wpO1xuICAgICAgICAgICAgdmFyIG9mZnNldCA9IDAsIHNhbXBsZSA9IGJsb2NrQ29sIDw8IDM7XG4gICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgODsgaisrKSB7XG4gICAgICAgICAgICAgIHZhciBsaW5lT2Zmc2V0ID0gKHNjYW5MaW5lICsgaikgKiBzYW1wbGVzUGVyTGluZTtcbiAgICAgICAgICAgICAgZm9yIChrID0gMDsgayA8IDg7IGsrKykge1xuICAgICAgICAgICAgICAgIGxpbmVEYXRhW2xpbmVPZmZzZXQgKyBzYW1wbGUgKyBrXSA9XG4gICAgICAgICAgICAgICAgICBjb21wb25lbnQub3V0cHV0W2J1ZmZlck9mZnNldCArIG9mZnNldCsrXTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGNvbXBvbmVudFNjYWxlWCA9IGNvbXBvbmVudC5zY2FsZVggKiBzY2FsZVg7XG4gICAgICAgIGNvbXBvbmVudFNjYWxlWSA9IGNvbXBvbmVudC5zY2FsZVkgKiBzY2FsZVk7XG4gICAgICAgIG9mZnNldCA9IGk7XG5cbiAgICAgICAgdmFyIGN4LCBjeTtcbiAgICAgICAgdmFyIGlu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Jsb2NrQ29sKTtcbiAgICAgICAgICAgIHZhciBvZmZzZXQgPSAwLCBzYW1wbGUgPSBibG9ja0NvbCA8PCAzO1xuICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IDg7IGorKykge1xuICAgICAgICAgICAgICB2YXIgbGluZU9mZnNldCA9IChzY2FuTGluZSArIGopICogc2FtcGxlc1BlckxpbmU7XG4gICAgICAgICAgICAgIGZvciAoayA9IDA7IGsgPCA4OyBrKyspIHtcbiAgICAgICAgICAgICAgICBsaW5lRGF0YVtsaW5lT2Zmc2V0ICsgc2FtcGxlICsga10gPVxuICAgICAgICAgICAgICAgICAgY29tcG9uZW50Lm91dHB1dFtidWZmZXJPZmZzZXQgKyBvZmZzZXQrK10gKiBjb21wb25lbnQuYml0Q29udmVyc2lvbjtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGNvbXBvbmVudFNjYWxlWCA9IGNvbXBvbmVudC5zY2FsZVggKiBzY2FsZVg7XG4gICAgICAgIGNvbXBvbmVudFNjYWxlWSA9IGNvbXBvbmVudC5zY2FsZVkgKiBzY2FsZVk7XG4gICAgICAgIG9mZnNldCA9IGk7XG5cbiAgICAgICAgdmFyIGN4LCBjeTtcbiAgICAgICAgdmFyIGluZGV4O1xuICAgICAgICBmb3IgKHkgPSAwOyB5IDwgaGVpZ2h0OyB5KyspIHtcbiAgICAgICAgICBmb3IgKHggPSAwOyB4IDwgd2lkdGg7IHgrKykge1xuICAgICAgICAgICAgY3kgPSAwIHwgKHkgKiBjb21wb25lbnRTY2FsZVkpO1xuICAgICAgICAgICAgY3ggPSAwIHwgKHggKiBjb21wb25lbnRTY2FsZVgpO1xuICAgICAgICAgICAgaW5kZXggPSBjeSAqIHNhbXBsZXNQZXJMaW5lICsgY3g7XG4gICAgICAgICAgICBkYXRhW29mZnNldF0gPSBsaW5lRGF0YVtpbmRleF07XG4gICAgICAgICAgICBvZmZzZXQg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yAyXTtcblxuICAgICAgICAgICAgICBSID0gY2xhbXBUb1VpbnQ4KFkgLSAxNzkuNDU2ICsgMS40MDIgKiBDcik7XG4gICAgICAgICAgICAgIEcgPSBjbGFtcFRvVWludDgoWSArIDEzNS40NTkgLSAwLjM0NCAqIENiIC0gMC43MTQgKiBDcik7XG4gICAgICAgICAgICAgIEIgPSBjbGFtcFRvVWludDgoWSAtIDIyNi44MTYgKyAxLjc3MiAqIENiKTtcblxuICAgICAgICAgICAgICBkYXRhW2kgICAgXSA9IFI7XG4gICAgICAgICAgICAgIGRhdGFbaSArIDFdID0gRztcbiAgICAgICAgICAgICAgZGF0YVtpICsgMl0gPSBCO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSA0OlxuICAgICAgICAgIGlmICghdGhpcy5hZG9iZSlcbiAgICAgICAgICAgIHRocm93ICdVbnN1cHBvcnRlZCBjb2xvciBtb2RlICg0IGNvbXBvbmVudHMpJztcbiAgICAgICAgICAvLyBUaGUgZGVmYXVsdCB0cmFuc2Zvcm0gZm9yIGZvdXIgY29tcG9uZW50cyBpcyBmYWxzZVxuICAgICAgICAgIGNvbG9yVHJhbnNmb3JtID0gZmFsc2U7XG4gICAgICAgICAgLy8gVGhlIGFkb2JlIHRyYW5zZm9ybSBtYXJrZXIgb3ZlcnJpZGVzIGFueSBwcmV2aW91cyBzZXR0aW5nXG4gICAgICAgICAgaWYgKHRoaXMuYWRvYmUgJiYgdGhpcy5hZG9iZS50cmFuc2Zvcm1Db2RlKVxuICAgICAgICAgICAgY29sb3JUcmFuc2Zvcm0gPSB0cnVlO1xuICAgICAgICAgIGVsc2UgaWYgKHR5cGVvZiB0aGlzLmNvbG9yVHJhbnNmb3JtICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIGNvbG9yVHJhbnNmb3JtID0gISF0aGlzLmNvbG9yVHJhbnNmb3JtO1xuXG4gICAgICAgICAgaWYgKGNvbG9yVHJhbnNmb3JtKSB7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgZGF0YUxlbmd0aDsgaSArPSBudW1Db21wb25lbnRzKSB7XG4gICAgICAgICAgICAgIFkgPSBkYXRhW2ldO1xuICAgICAgICAgICAgICBDYiA9IGRhdGFbaSArIDFdO1xuICAgICAgICAgICAgICBDciA9IGRhdGFbaSArIDJdO1xuXG4gICAgICAgICAgICAgIEMgPSBjbGFtcFRvVWludDgoNDM0LjQ1NiAtIFkgLSAxLjQwMiAqIENyKTtcbiAgICAgICAgICAgICAgTSA9IGNsYW1wVG9VaW50OCgxMTkuNTQxIC0gWSArIDAuMzQ0ICogQ2IgKyAwLjcxNCAqIENyKTtcbiAgICAgICAgICAgICAgWSA9IGNsYW1wVG9VaW50OCg0ODEuODE2IC0gWSAtIDEuNzcyICogQ2IpO1xuXG4gICAgICAgICAgICAgIGRhdGFbaSAgICBdID0gQztcbiAgICAgICAgICAgICAgZGF0YVtpICsgMV0gPSBNO1xuICAgICAgICAgICAgICBkYXRhW2kgKyAyXSA9IFk7XG4gICAgICAgICAgICAgIC8vIEsgaXMgdW5jaGFuZ2VkXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGJyZWFrO1xuICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgIHRocm93ICdVbnN1cHBvcnRlZCBjb2xvciBtb2RlJztcbiAgICAgIH1cbiAgICAgIHJldHVybiBkYXRhO1xuICAgIH1cbiAgfTtcblxuICByZXR1cm4gY29uc3RydWN0b3I7XG59KSgpO1xuXG52YXIgbW9kdWxlVHlwZSA9IHR5cGVvZiBtb2R1bGU7XG5pZiAoKG1vZHVsZVR5cGUgIT09ICd1bmRlZmluZWQnKSAmJiBtb2R1bGUuZXhwb3J0cykge1xuICAgIG1vZHVsZS5leHBvcnRzID0gSnBlZ0ltYWdlO1xufSIsIi8qISBpbWFnZS1KUEVHMjAwMCAtIHYwLjMuMSAtIDIwMTUtMDgtMjYgfCBod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AgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIGNhc2UgMHg2QTcwMzI2MzogLy8gJ2pwMmMnXG4gICAgICAgICAgICB0aGlzLnBhcnNlQ29kZXN0cmVhbShkYXRhLCBwb3NpdGlvbiwgcG9zaXRpb24gKyBkYXRhTGVuZ3RoKTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIGNhc2UgMHg2QTUwMjAyMDogLy8gJ2pQXFwwMjRcXDAyNCdcbiAgICAgICAgICAgIGlmICgweDBkMGE4NzBhICE9PSByZWFkVWludDMyKGRhdGEsIHBvc2l0aW9uKSkge1xuICAgICAgICAgICAgICB3YXJuKCdJbnZhbGlkIEpQMiBzaWduYXR1cmUnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIC8vIFRoZSBmb2xsb3dpbmcgaGVhZGVyIHR5cGVzIGFyZSB2YWxpZCBidXQgY3VycmVudGx5IG5vdCB1c2VkOlxuICAgICAgICAgIGNhc2UgMHg2QTUwMUExQTogLy8gJ2pQXFwwMzJcXDAzMidcbiAgICAgICAgICBjYXNlIDB4NjY3NDc5NzA6IC8vICdmdHlwJ1xuICAgICAgICAgIGNhc2UgMHg3MjcyNjU3MTogLy8gJ3JyZXEnXG4gICAgICAgICAgY2FzZSAweDcyNjU3MzIwOiAvLyAncmVzICdcbiAgICAgICAgICBjYXNlIDB4Njk2ODY0NzI6IC8vICdpaGRyJ1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIHZhciBoZWFkZXJUeXBlID0gU3RyaW5nLmZyb21DaGFyQ29kZSgodGJveCA+PiAyNCkgJiAweEZGLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0Ym94ID4+IDE2KSAmIDB4RkYsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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NjYWxhckV4cG91bmRlZCwgdGlsZTtcbiAgICAgICAgICBzd2l0Y2ggKGNvZGUpIHtcbiAgICAgICAgICAgIGNhc2UgMHhGRjRGOiAvLyBTdGFydCBvZiBjb2Rlc3RyZWFtIChTT0MpXG4gICAgICAgICAgICAgIGNvbnRleHQubWFpbkhlYWRlciA9IHRydWU7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAweEZGRDk6IC8vIEVuZCBvZiBjb2Rlc3RyZWFtIChFT0MpXG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAweEZGNTE6IC8vIEltYWdlIGFuZCB0aWxlIHNpemUgKFNJWilcbiAgICAgICAgICAgICAgbGVuZ3RoID0gcmVhZFVpbnQxNihkYXRhLCBwb3NpdGlvbik7XG4gICAgICAgICAgICAgIHZhciBzaXogPSB7fTtcbiAgICAgICAgICAgICAgc2l6LlhzaXogPSByZWFkVWludDMyKGRhdGEsIHBvc2l0aW9uICsgNCk7XG4gICAgICAgICAgICAgIHNpei5Zc2l6ID0gcmVhZFVpbnQzMihkYXRhLCBwb3NpdGlvbiArIDgpO1xuICAgICAgICAgICAgICBzaXouWE9zaXogPSByZWFkVWludDMyKGRhdGEsIHBvc2l0aW9uICsgMTIpO1xuICAgICAgICAgICAgICBzaXouWU9zaXogPSByZWFkVWludDMyKGRhdGEsIHBvc2l0aW9uICsgMTYpO1xuICAgICAgICAgICAgICBzaXouWFRzaXogPSByZWFkVWludDMyKGRhdGEsIHBvc2l0aW9uICsgMjApO1xuICAgICAgICAgICAgICBzaXouWVRzaXogPSByZWFkVWludDMyKGRhdGEsIHBvc2l0aW9uICsgMjQpO1xuICAgICAgICAgICAgICBzaXouWFRPc2l6ID0gcmVhZFVpbnQzMihkYXRhLCBwb3NpdGlvbiArIDI4KTtcbiAgICAgICAgICAgICAgc2l6LllUT3NpeiA9IHJlYWRVaW50MzIoZGF0YSwgcG9zaXRpb24gKyAzMik7XG4gICAgICAgICAgICAgIHZhciBjb21wb25lbnRzQ291bnQgPSByZWFkVWludDE2KGRhdGEsIHBvc2l0aW9uICsgMzYpO1xuICAgICAgICAgICAgICBzaXouQ3NpeiA9IGNvbXBvbmVudHNDb3VudDtcbiAgICAgICAgICAgICAgdmFyIGNvbXBvbmVudHMgPSBbXTtcbiAgICAgICAgICAgICAgaiA9IHBvc2l0aW9uICsgMzg7XG4gICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY29tcG9uZW50c0NvdW50OyBpKyspIHtcbiAgICAgICAgICAgICAgICB2YXIgY29tcG9uZW50ID0ge1xuICAgICAgICAgICAgICAgICAgcHJlY2lzaW9uOiAoZGF0YVtqXSAmIDB4N0YpICsgMSxcbiAgICAgICAgICAgICAgICAgIGlzU2lnbmVkOiAhIShkYXRhW2pdICYgMHg4MCksXG4gICAgICAgICAgICAgICAgICBYUnNpejogZGF0YVtqICsgMV0sXG4gICAgICAgICAgICAgICAgICBZUnNpejogZGF0YVtqICsgMV1cbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIGNhbGN1bGF0ZUNvbXBvbmVudERpbWVuc2lvbnMoY29tcG9uZW50LCBzaXopO1xuICAgICAgICAgICAgICAgIGNvbXBvbmVudHMucHVzaChjb21wb25lbnQpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGNvbnRleHQuU0laID0gc2l6O1xuICAgICAgICAgICAgICBjb250ZXh0LmNvbXBvbmVudHMgPSBjb21wb25lbnRzO1xuICAgICAgICAgICAgICBjYWxjdWxhdGVUaWxlR3JpZHMoY29udGV4dCwgY29tcG9uZW50cyk7XG4gICAgICAgICAgICAgIGNvbnRleHQuUUNDID0gW107XG4gICAgICAgICAgICAgIGNvbnRleHQuQ09DID0gW107XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAweEZGNUM6IC8vIFF1YW50aXphdGlvbiBkZWZhdWx0IChRQ0QpXG4gICAgICAgICAgICAgIGxlbmd0aCA9IHJlYWRVaW50MTYoZGF0YSwgcG9zaXRpb24pO1xuICAgICAgICAgICAgICB2YXIgcWNkID0ge307XG4gICAgICAgICAgICAgIGogPSBwb3NpdGlvbiArIDI7XG4gICAgICAgICAgICAgIHNxY2QgPSBkYXRhW2orK107XG4gICAgICAgICAgICAgIHN3aXRjaCAoc3FjZCAmIDB4MUYpIHtcbiAgICAgICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgICBzcHFjZFNpemUgPSA4O1xuICAgICAgICAgICAgICAgICAgc2NhbGFyRXhwb3VuZGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICAgIHNwcWNkU2l6ZSA9IDE2O1xuICAgICAgICAgICAgICAgICAgc2NhbGFyRXhwb3VuZGVkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICAgICAgICBzcHFjZFNpemUgPSAxNjtcbiAgICAgICAgICAgICAgICAgIHNjYWxhckV4cG91bmRlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdKUFggRXJyb3I6IEludmFsaWQgU1FjZCB2YWx1ZSAnICsgc3FjZCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgcWNkLm5vUXVhbnRpemF0aW9uID0gKHNwcWNkU2l6ZSA9PT0gOCk7XG4gICAgICAgICAgICAgIHFjZC5zY2FsYXJFeHBvdW5kZWQgPSBzY2FsYXJFeHBvdW5kZWQ7XG4gICAgICAgICAgICAgIHFjZC5ndWFyZEJpdHMgPSBzcWNkID4+IDU7XG4gICAgICAgICAgICAgIHNwcWNkcyA9IFtdO1xuICAgICAgICAgICAgICB3aGlsZSAoaiA8IGxlbmd0aCArIHBvc2l0aW9uKSB7XG4gICAgICAgICAgICAgICAgdmFyIHNwcWNkID0ge307XG4gICAgICAgICAgICAgICAgaWYgKHNwcWNkU2l6ZSA9PT0gOCkge1xuICAgICAgICAgICAgICAgICAgc3BxY2QuZXBzaWxvbiA9IGRhdGFbaisrXSA+PiAzO1xuICAgICAgICAgICAgICAgICAgc3BxY2QubXUgPSAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICBzcHFjZC5lcHNpbG9uID0gZGF0YVtqXSA+PiAzO1xuICAgICAgICAgICAgICAgICAgc3BxY2QubXUgPSAoKGRhdGFbal0gJiAweDcpIDw8IDgpIHwgZGF0YVtqICsgMV07XG4gICAgICAgICAgICAgICAgICBqICs9IDI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHNwcWNkcy5wdXNoKHNwcWNkKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBxY2QuU1BxY2RzID0gc3BxY2RzO1xuICAgICAgICAgICAgICBpZiAoY29udGV4dC5tYWluSGVhZGVyKSB7XG4gICAgICAgICAgICAgICAgY29udGV4dC5RQ0QgPSBxY2Q7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgY29udGV4dC5jdXJyZW50VGlsZS5RQ0QgPSBxY2Q7XG4gICAgICAgICAgICAgICAgY29udGV4dC5jdXJyZW50VGlsZS5RQ0MgPSBbXTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMHhGRjVEOiAvLyBRdWFudGl6YXRpb24gY29tcG9uZW50IChRQ0MpXG4gICAgICAgICAgICAgIGxlbmd0aCA9IHJlYWRVaW50MTYoZGF0YSwgcG9zaXRpb24pO1xuICAgICAgICAgICAgICB2YXIgcWNjID0ge307XG4gICAgICAgICAgICAgIGogPSBwb3NpdGlvbiArIDI7XG4gICAgICAgICAgICAgIHZhciBjcWNjO1xuICAgICAgICAgICAgICBpZiAoY29udGV4dC5TSVouQ3NpeiA8IDI1Nykge1xuICAgICAgICAgICAgICAgIGNxY2MgPSBkYXRhW2orK107XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgY3FjYyA9IHJlYWRVaW50MTYoZGF0YSwgaik7XG4gICAgICAgICAgICAgICAgaiArPSAyO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHNxY2QgPSBkYXRhW2orK107XG4gICAgICAgICAgICAgIHN3aXRjaCAoc3FjZCAmIDB4MUYpIHtcbiAgICAgICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgICBzcHFjZFNpemUgPSA4O1xuICAgICAgICAgICAgICAgICAgc2NhbGFyRXhwb3VuZGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICAgIHNwcWNkU2l6ZSA9IDE2O1xuICAgICAgICAgICAgICAgICAgc2NhbGFyRXhwb3VuZGVkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICAgICAgICBzcHFjZFNpemUgPSAxNjtcbiAgICAgICAgICAgICAgICAgIHNjYWxhckV4cG91bmRlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdKUFggRXJyb3I6IEludmFsaWQgU1FjZCB2YWx1ZSAnICsgc3FjZCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgcWNjLm5vUXVhbnRpemF0aW9uID0gKHNwcWNkU2l6ZSA9PT0gOCk7XG4gICAgICAgICAgICAgIHFjYy5zY2FsYXJFeHBvdW5kZWQgPSBzY2FsYXJFeHBvdW5kZWQ7XG4gICAgICAgICAgICAgIHFjYy5ndWFyZEJpdHMgPSBzcWNkID4+IDU7XG4gICAgICAgICAgICAgIHNwcWNkcyA9IFtdO1xuICAgICAgICAgICAgICB3aGlsZSAoaiA8IChsZW5ndGggKyBwb3NpdGlvbikpIHtcbiAgICAgICAgICAgICAgICBzcHFjZCA9IHt9O1xuICAgICAgICAgICAgICAgIGlmIChzcHFjZFNpemUgPT09IDgpIHtcbiAgICAgICAgICAgICAgICAgIHNwcWNkLmVwc2lsb24gPSBkYXRhW2orK10gPj4gMztcbiAgICAgICAgICAgICAgICAgIHNwcWNkLm11ID0gMDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgc3BxY2QuZXBzaWxvbiA9IGRhdGFbal0gPj4gMztcbiAgICAgICAgICAgICAgICAgIHNwcWNkLm11ID0gKChkYXRhW2pdICYgMHg3KSA8PCA4KSB8IGRhdGFbaiArIDFdO1xuICAgICAgICAgICAgICAgICAgaiArPSAyO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBzcHFjZHMucHVzaChzcHFjZCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgcWNjLlNQcWNkcyA9IHNwcWNkcztcbiAgICAgICAgICAgICAgaWYgKGNvbnRleHQubWFpbkhlYWRlcikge1xuICAgICAgICAgICAgICAgIGNvbnRleHQuUUNDW2NxY2NdID0gcWNjO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGNvbnRleHQuY3VycmVudFRpbGUuUUNDW2NxY2NdID0gcWNjO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAweEZGNTI6IC8vIENvZGluZyBzdHlsZSBkZWZhdWx0IChDT0QpXG4gICAgICAgICAgICAgIGxlbmd0aCA9IHJlYWRVaW50MTYoZGF0YSwgcG9zaXRpb24pO1xuICAgICAgICAgICAgICB2YXIgY29kID0ge307XG4gICAgICAgICAgICAgIGogPSBwb3NpdGlvbiArIDI7XG4gICAgICAgICAgICAgIHZhciBzY29kID0gZGF0YVtqKytdO1xuICAgICAgICAgICAgICBjb2QuZW50cm9weUNvZGVyV2l0aEN1c3RvbVByZWNpbmN0cyA9ICEhKHNjb2QgJiAxKTtcbiAgICAgICAgICAgICAgY29kLnNvcE1hcmtlclVzZWQgPSAhIShzY29kICYgMik7XG4gICAgICAgICAgICAgIGNvZC5lcGhNYXJrZXJVc2VkID0gISEoc2NvZCAmIDQpO1xuICAgICAgICAgICAgICBjb2QucHJvZ3Jlc3Npb25PcmRlciA9IGRhdGFbaisrXTtcbiAgICAgICAgICAgICAgY29kLmxheWVyc0NvdW50ID0gcmVhZFVpbnQxNihkYXRhLCBqKTtcbiAgICAgICAgICAgICAgaiArPSAyO1xuICAgICAgICAgICAgICBjb2QubXVsdGlwbGVDb21wb25lbnRUcmFuc2Zvcm0gPSBkYXRhW2orK107XG5cbiAgICAgICAgICAgICAgY29kLmRlY29tcG9zaXRpb25MZXZlbHNDb3VudCA9IGRhdGFbaisrXTtcbiAgICAgICAgICAgICAgY29kLnhjYiA9IChkYXRhW2orK10gJiAweEYpICsgMjtcbiAgICAgICAgICAgICAgY29kLnljYiA9IChkYXRhW2orK10gJiAweEYpICsgMjtcbiAgICAgICAgICAgICAgdmFyIGJsb2NrU3R5bGUgPSBkYXRhW2orK107XG4gICAgICAgICAgICAgIGNvZC5zZWxlY3RpdmVBcml0aG1ldGljQ29kaW5nQnlwYXNzID0gISEoYmxvY2tTdHlsZSAmIDEpO1xuICAgICAgICAgICAgICBjb2QucmVzZXRDb250ZXh0UHJvYmFiaWxpdGllcyA9ICEhKGJsb2NrU3R5bGUgJiAyKTtcbiAgICAgICAgICAgICAgY29kLnRlcm1pbmF0aW9uT25FYWNoQ29kaW5nUGFzcyA9ICEhKGJsb2NrU3R5bGUgJiA0KTtcbiAgICAgICAgICAgICAgY29kLnZlcnRpY2FseVN0cmlwZSA9ICEhKGJsb2NrU3R5bGUgJiA4KTtcbiAgICAgICAgICAgICAgY29kLnByZWRpY3RhYmxlVGVybWluYXRpb24gPSAhIShibG9ja1N0eWxlICYgMTYpO1xuICAgICAgICAgICAgICBjb2Quc2VnbWVudGF0aW9uU3ltYm9sVXNlZCA9ICEhKGJsb2NrU3R5bGUgJiAzMik7XG4gICAgICAgICAgICAgIGNvZC5yZXZlcnNpYmxlVHJhbnNmb3JtYXRpb24gPSBkYXRhW2orK107XG4gICAgICAgICAgICAgIGlmIChjb2QuZW50cm9weUNvZGVyV2l0aEN1c3RvbVByZWNpbmN0cykge1xuICAgICAgICAgICAgICAgIHZhciBwcmVjaW5jdHNTaXplcyA9IFtdO1xuICAgICAgICAgICAgICAgIHdoaWxlIChqIDwgbGVuZ3RoICsgcG9zaXRpb24pIHtcbiAgICAgICAgICAgICAgICAgIHZhciBwcmVjaW5jdHNTaXplID0gZGF0YVtqKytdO1xuICAgICAgICAgICAgICAgICAgcHJlY2luY3RzU2l6ZXMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgIFBQeDogcHJlY2luY3RzU2l6ZSAmIDB4RixcbiAgICAgICAgICAgICAgICAgICAgUFB5OiBwcmVjaW5jdHNTaXplID4+IDRcbiAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb2QucHJlY2luY3RzU2l6ZXMgPSBwcmVjaW5jdHNTaXplcztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB2YXIgdW5zdXBwb3J0ZWQgPSBbXTtcbiAgICAgICAgICAgICAgaWYgKGNvZC5zZWxlY3RpdmVBcml0aG1ldGljQ29kaW5nQnlwYXNzKSB7XG4gICAgICAgICAgICAgICAgdW5zdXBwb3J0ZWQucHVzaCgnc2VsZWN0aXZlQXJpdGhtZXRpY0NvZGluZ0J5cGFzcycpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChjb2QucmVzZXRDb250ZXh0UHJvYmFiaWxpdGllcykge1xuICAgICAgICAgICAgICAgIHVuc3VwcG9ydGVkLnB1c2goJ3Jlc2V0Q29udGV4dFByb2JhYmlsaXRpZXMnKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAoY29kLnRlcm1pbmF0aW9uT25FYWNoQ29kaW5nUGFzcykge1xuICAgICAgICAgICAgICAgIHVuc3VwcG9ydGVkLnB1c2goJ3Rlcm1pbmF0aW9uT25FYWNoQ29kaW5nUGFzcycpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChjb2QudmVydGljYWx5U3RyaXBlKSB7XG4gICAgICAgICAgICAgICAgdW5zdXBwb3J0ZWQucHVzaCgndmVydGljYWx5U3RyaXBlJyk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKGNvZC5wcmVkaWN0YWJsZVRlcm1pbmF0aW9uKSB7XG4gICAgICAgICAgICAgICAgdW5zdXBwb3J0ZWQucHVzaCgncHJlZGljdGFibGVUZXJtaW5hdGlvbicpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmICh1bnN1cHBvcnRlZC5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgZG9Ob3RSZWNvdmVyID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0pQWCBFcnJvcjogVW5zdXBwb3J0ZWQgQ09EIG9wdGlvbnMgKCcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnN1cHBvcnRlZC5qb2luKCcsICcpICsgJyknKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAoY29udGV4dC5tYWluSGVhZGVyKSB7XG4gICAgICAgICAgICAgICAgY29udGV4dC5DT0QgPSBjb2Q7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgY29udGV4dC5jdXJyZW50VGlsZS5DT0QgPSBjb2Q7XG4gICAgICAgICAgICAgICAgY29udGV4dC5jdXJyZW50VGlsZS5DT0MgPSBbXTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMHhGRjkwOiAvLyBTdGFydCBvZiB0aWxlLXBhcnQgKFNPVClcbiAgICAgICAgICAgICAgbGVuZ3RoID0gcmVhZFVpbnQxNihkYXRhLCBwb3NpdGlvbik7XG4gICAgICAgICAgICAgIHRpbGUgPSB7fTtcbiAgICAgICAgICAgICAgdGlsZS5pbmRleCA9IHJlYWRVaW50MTYoZGF0YSwgcG9zaXRpb24gKyAyKTtcbiAgICAgICAgICAgICAgdGlsZS5sZW5ndGggPSByZWFkVWludDMyKGRhdGEsIHBvc2l0aW9uICsgNCk7XG4gICAgICAgICAgICAgIHRpbGUuZGF0YUVuZCA9IHRpbGUubGVuZ3RoICsgcG9zaXRpb24gLSAyO1xuICAgICAgICAgICAgICB0aWxlLnBhcnRJbmRleCA9IGRhdGFbcG9zaXRpb24gKyA4XTtcbiAgICAgICAgICAgICAgdGlsZS5wYXJ0c0NvdW50ID0gZGF0YVtwb3NpdGlvbiArIDldO1xuXG4gICAgICAgICAgICAgIGNvbnRleHQubWFpbkhlYWRlciA9IGZhbHNlO1xuICAgICAgICAgICAgICBpZiAodGlsZS5wYXJ0SW5kZXggPT09IDApIHtcbiAgICAgICAgICAgICAgICAvLyByZXNldCBjb21wb25lbnQgc3BlY2lmaWMgc2V0dGluZ3NcbiAgICAgICAgICAgICAgICB0aWxlLkNPRCA9IGNvbnRleHQuQ09EO1xuICAgICAgICAgICAgICAgIHRpbGUuQ09DID0gY29udGV4dC5DT0Muc2xpY2UoMCk7IC8vIGNsb25lIG9mIHRoZSBnbG9iYWwgQ09DXG4gICAgICAgICAgICAgICAgdGlsZS5RQ0QgPSBjb250ZXh0LlFDRDtcbiAgICAgICAgICAgICAgICB0aWxlLlFDQyA9IGNvbnRleHQuUUNDLnNsaWNlKDApOyAvLyBjbG9uZSBvZiB0aGUgZ2xvYmFsIENPQ1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGNvbnRleHQuY3VycmVudFRpbGUgPSB0aWxlO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMHhGRjkzOiAvLyBTdGFydCBvZiBkYXRhIChTT0QpXG4gICAgICAgICAgICAgIHRpbGUgPSBjb250ZXh0LmN1cnJlbnRUaWxlO1xuICAgICAgICAgICAgICBpZiAodGlsZS5wYXJ0SW5kZXggPT09IDApIHtcbiAgICAgICAgICAgICAgICBpbml0aWFsaXplVGlsZShjb250ZXh0LCB0aWxlLmluZGV4KTtcbiAgICAgICAgICAgICAgICBidWlsZFBhY2tldHMoY29udGV4dCk7XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAvLyBtb3ZpbmcgdG8gdGhlIGVuZCBvZiB0aGUgZGF0YVxuICAgICAgICAgICAgICBsZW5ndGggPSB0aWxlLmRhdGFFbmQgLSBwb3NpdGlvbjtcbiAgICAgICAgICAgICAgcGFyc2VUaWxlUGFja2V0cyhjb250ZXh0LCBkYXRhLCBwb3NpdGlvbiwgbGVuZ3RoKTtcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDB4RkY1NTogLy8gVGlsZS1wYXJ0IGxlbmd0aHMsIG1haW4gaGVhZGVyIChUTE0pXG4gICAgICAgICAgICBjYXNlIDB4RkY1NzogLy8gUGFja2V0IGxlbmd0aCwgbWFpbiBoZWFkZXIgKFBMTSlcbiAgICAgICAgICAgIGNhc2UgMHhGRjU4OiAvLyBQYWNrZXQgbGVuZ3RoLCB0aWxlLXBhcnQgaGVhZGVyIChQTFQpXG4gICAgICAgICAgICBjYXNlIDB4RkY2NDogLy8gQ29tbWVudCAoQ09NKVxuICAgICAgICAgICAgICBsZW5ndGggPSByZWFkVWludDE2KGRhdGEsIHBvc2l0aW9uKTtcbiAgICAgICAgICAgICAgLy8gc2tpcHBpbmcgY29udGVudFxuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMHhGRjUzOiAvLyBDb2Rpbmcgc3R5bGUgY29tcG9uZW50IChDT0MpXG4gICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignSlBYIEVycm9yOiBDb2Rlc3RyZWFtIGNvZGUgMHhGRjUzIChDT0MpIGlzICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ25vdCBpbXBsZW1lbnRlZCcpO1xuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdKUFggRXJyb3I6IFVua25vd24gY29kZXN0cmVhbSBjb2RlOiAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGUudG9TdHJpbmcoMTYpKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcG9zaXRpb24gKz0gbGVuZ3RoO1xuICAgICAgICB9XG4gICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgIGlmIChkb05vdFJlY292ZXIgfHwgdGhpcy5mYWlsT25Db3JydXB0ZWRJbWFnZSkge1xuICAgICAgICAgIHRocm93IGU7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgd2FybignVHJ5aW5nIHRvIHJlY292ZXIgZnJvbSAnICsgZS5tZXNzYWdlKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgdGhpcy50aWxlcyA9IHRyYW5zZm9ybUNvbXBvbmVudHMoY29udGV4dCk7XG4gICAgICB0aGlzLndpZHRoID0gY29udGV4dC5TSVouWHNpeiAtIGNvbnRleHQuU0laLlhPc2l6O1xuICAgICAgdGhpcy5oZWlnaHQgPSBjb250ZXh0LlNJWi5Zc2l6IC0gY29udGV4dC5TSVouWU9zaXo7XG4gICAgICB0aGlzLmNvbXBvbmVudHNDb3VudCA9IGNvbnRleHQuU0laLkNzaXo7XG4gICAgfVxuICB9O1xuICBmdW5jdGl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IHRpbGUgPSB7fTtcbiAgICAgICAgdGlsZS50eDAgPSBNYXRoLm1heChzaXouWFRPc2l6ICsgcCAqIHNpei5YVHNpeiwgc2l6LlhPc2l6KTtcbiAgICAgICAgdGlsZS50eTAgPSBNYXRoLm1heChzaXouWVRPc2l6ICsgcSAqIHNpei5ZVHNpeiwgc2l6LllPc2l6KTtcbiAgICAgICAgdGlsZS50eDEgPSBNYXRoLm1pbihzaXouWFRPc2l6ICsgKHAgKyAxKSAqIHNpei5YVHNpeiwgc2l6LlhzaXopO1xuICAgICAgICB0aWxlLnR5MSA9IE1hdGgubWluKHNpei5ZVE9zaXogKyAocSArIDEpICogc2l6LllUc2l6LCBzaXouWXNpeik7XG4gICAgICAgIHRpbGUud2lkdGggPSB0aWxlLnR4MSAtIHRpbGUudHgwO1xuICAgICAgICB0aWxlLmhlaWdodCA9IHRpbGUudHkxIC0gdGlsZS50eTA7XG4gICAgICAgIHRpbGUuY29tcG9uZW50cyA9IFtdO1xuICAgICAgICB0aWxlcy5wdXNoKHRpbGUpO1xuICAgICAgfVxuICAgIH1cbiAgICBjb250ZXh0LnRpbGVzID0gdGlsZXM7XG5cbiAgICB2YXIgY29tcG9uZW50c0NvdW50ID0gc2l6LkNzaXo7XG4gICAgZm9yICh2YXIgaSA9IDAsIGlpID0gY29tcG9uZW50c0NvdW50OyBpIDwgaWk7IGkrKykge1xuICAgICAgdmFyIGNvbXBvbmVudCA9IGNvbXBvbmVudHNbaV07XG4gICAgICBmb3IgKHZhciBqID0gMCwgamogPSB0aWxlcy5sZW5ndGg7IGogPCBqajsgaisrKSB7XG4gICAgICAgIHZhciB0aWxlQ29tcG9uZW50ID0ge307XG4gICAgICAgIHRpbGUgPSB0aWxlc1tqXTtcbiAgICAgICAgdGlsZUNvbXBvbmVudC50Y3gwID0gTWF0aC5jZWlsKHRpbGUudHgwIC8gY29tcG9uZW50LlhSc2l6KTtcbiAgICAgICAgdGlsZUNvbXBvbmVudC50Y3kwID0gTWF0aC5jZWl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aWdodEluU3ViYmFuZCk7XG4gICAgICAgIHByZWNpbmN0TnVtYmVyID0gcGkgKyAocGogKiBwcmVjaW5jdFBhcmFtZXRlcnMubnVtcHJlY2luY3Rzd2lkZSk7XG5cbiAgICAgICAgY29kZWJsb2NrLnByZWNpbmN0TnVtYmVyID0gcHJlY2luY3ROdW1iZXI7XG4gICAgICAgIGNvZGVibG9jay5zdWJiYW5kVHlwZSA9IHN1YmJhbmQudHlwZTtcbiAgICAgICAgY29kZWJsb2NrLkxibG9jayA9IDM7XG5cbiAgICAgICAgaWYgKGNvZGVibG9jay50YngxXyA8PSBjb2RlYmxvY2sudGJ4MF8gfHxcbiAgICAgICAgICAgIGNvZGVibG9jay50YnkxXyA8PSBjb2RlYmxvY2sudGJ5MF8pIHtcbiAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuICAgICAgICBjb2RlYmxvY2tzLnB1c2goY29kZWJsb2NrKTtcbiAgICAgICAgLy8gYnVpbGRpbmcgcHJlY2luY3QgZm9yIHRoZSBzdWItYmFuZFxuICAgICAgICB2YXIgcHJlY2luY3QgPSBwcmVjaW5jdHNbcHJlY2luY3ROdW1iZXJdO1xuICAgICAgICBpZiAocHJlY2luY3QgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgIGlmIChpIDwgcHJlY2luY3QuY2J4TWluKSB7XG4gICAgICAgICAgICBwcmVjaW5jdC5jYnhNaW4gPSBpO1xuICAgICAgICAgIH0gZWxzZSBpZiAoaSA+IHByZWNpbmN0LmNieE1heCkge1xuICAgICAgICAgICAgcHJlY2luY3QuY2J4TWF4ID0gaTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGogPCBwcmVjaW5jdC5jYnlNaW4pIHtcbiAgICAgICAgICAgIHByZWNpbmN0LmNieE1pbiA9IGo7XG4gICAgICAgICAgfSBlbHNlIGlmIChqID4gcHJlY2luY3QuY2J5TWF4KSB7XG4gICAgICAgICAgICBwcmVjaW5jdC5jYnlNYXggPSBqO1xuICA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25MZXZlbHNDb3VudCA9IE1hdGgubWF4KG1heERlY29tcG9zaXRpb25MZXZlbHNDb3VudCxcbiAgICAgICAgdGlsZS5jb21wb25lbnRzW3FdLmNvZGluZ1N0eWxlUGFyYW1ldGVycy5kZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQpO1xuICAgIH1cblxuICAgIHZhciBsID0gMCwgciA9IDAsIGkgPSAwLCBrID0gMDtcblxuICAgIHRoaXMubmV4dFBhY2tldCA9IGZ1bmN0aW9uIEpweEltYWdlX25leHRQYWNrZXQoKSB7XG4gICAgICAvLyBTZWN0aW9uIEIuMTIuMS4xIExheWVyLXJlc29sdXRpb24tY29tcG9uZW50LXBvc2l0aW9uXG4gICAgICBmb3IgKDsgbCA8IGxheWVyc0NvdW50OyBsKyspIHtcbiAgICAgICAgZm9yICg7IHIgPD0gbWF4RGVjb21wb3NpdGlvbkxldmVsc0NvdW50OyByKyspIHtcbiAgICAgICAgICBmb3IgKDsgaSA8IGNvbXBvbmVudHNDb3VudDsgaSsrKSB7XG4gICAgICAgICAgICB2YXIgY29tcG9uZW50ID0gdGlsZS5jb21wb25lbnRzW2ldO1xuICAgICAgICAgICAgaWYgKHIgPiBjb21wb25lbnQuY29kaW5nU3R5bGVQYXJhbWV0ZXJzLmRlY29tcG9zaXRpb25MZXZlbHNDb3VudCkge1xuICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFyIHJlc29sdXRpb24gPSBjb21wb25lbnQucmVzb2x1dGlvbnNbcl07XG4gICAgICAgICAgICB2YXIgbnVtcHJlY2luY3RzID0gcmVzb2x1dGlvbi5wcmVjaW5jdFBhcmFtZXRlcnMubnVtcHJlY2luY3RzO1xuICAgICAgICAgICAgZm9yICg7IGsgPCBudW1wcmVjaW5jdHM7KSB7XG4gICAgICAgICAgICAgIHZhciBwYWNrZXQgPSBjcmVhdGVQYWNrZXQocmVzb2x1dGlvbiwgaywgbCk7XG4gICAgICAgICAgIC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Bvc2l0aW9uXG4gICAgICBmb3IgKDsgciA8PSBtYXhEZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQ7IHIrKykge1xuICAgICAgICBmb3IgKDsgbCA8IGxheWVyc0NvdW50OyBsKyspIHtcbiAgICAgICAgICBmb3IgKDsgaSA8IGNvbXBvbmVudHNDb3VudDsgaSsrKSB7XG4gICAgICAgICAgICB2YXIgY29tcG9uZW50ID0gdGlsZS5jb21wb25lbnRzW2ldO1xuICAgICAgICAgICAgaWYgKHIgPiBjb21wb25lbnQuY29kaW5nU3R5bGVQYXJhbWV0ZXJzLmRlY29tcG9zaXRpb25MZXZlbHNDb3VudCkge1xuICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFyIHJlc29sdXRpb24gPSBjb21wb25lbnQucmVzb2x1dGlvbnNbcl07XG4gICAgICAgICAgICB2YXIgbnVtcHJlY2luY3RzID0gcmVzb2x1dGlvbi5wcmVjaW5jdFBhcmFtZXRlcnMubnVtcHJlY2luY3RzO1xuICAgICAgICAgICAgZm9yICg7IGsgPCBudW1wcmVjaW5jdHM7KSB7XG4gICAgICAgICAgICAgIHZhciBwYWNrZXQgPSBjcmVhdGVQYWNrZXQocmVzb2x1dGlvbiwgaywgbCk7XG4gICAgICAgICAgICAgIGsrKztcbiAgICAgICAgICAgICAgcmV0dXJuIHBhY2tldDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGsgPSAwO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpID0gMDtcbiAgICAgICAgfVxuICAgICAgICBsID0gMDtcbiAgICAgIH1cbiAgICB9O1xuICB9XG4gIGZ1bmN0aW9uIFJlc29sdXRpb25Qb3NpdGlvbkNvbXBvbmVudExheWVySXRlcmF0b3IoY29udGV4dCkge1xuICAgIHZhciBzaXogPSBjb250ZXh0LlNJWjtcbiAgICB2YXIgdGlsZUluZGV4ID0gY29udGV4dC5jdXJyZW50VGlsZS5pbmRleDtcbi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AgIHJlc29sdXRpb25zW3JdLnByZWNpbmN0UGFyYW1ldGVycy5udW1wcmVjaW5jdHMpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBtYXhOdW1QcmVjaW5jdHNJbkxldmVsW3JdID0gbWF4TnVtUHJlY2luY3RzO1xuICAgIH1cbiAgICBsID0gMDtcbiAgICByID0gMDtcbiAgICBjID0gMDtcbiAgICBwID0gMDtcblxuICAgIHRoaXMubmV4dFBhY2tldCA9IGZ1bmN0aW9uIEpweEltYWdlX25leHRQYWNrZXQoKSB7XG4gICAgICAvLyBTZWN0aW9uIEIuMTIuMS4zIFJlc29sdXRpb24tcG9zaXRpb24tY29tcG9uZW50LWxheWVyXG4gICAgICBmb3IgKDsgciA8PSBtYXhEZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQ7IHIrKykge1xuICAgICAgICBmb3IgKDsgcCA8IG1heE51bVByZWNpbmN0c0luTGV2ZWxbcl07IHArKykge1xuICAgICAgICAgIGZvciAoOyBjIDwgY29tcG9uZW50c0NvdW50OyBjKyspIHtcbiAgICAgICAgICAgIHZhciBjb21wb25lbnQgPSB0aWxlLmNvbXBvbmVudHNbY107XG4gICAgICAgICAgICBpZiAociA+IGNvbXBvbmVudC5jb2RpbmdTdHlsZVBhcmFtZXRlcnMuZGVjb21wb3NpdGlvbkxldmVsc0NvdW50KSB7XG4gICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIHJlc29sdXRpb24gPSBjb21wb25lbnQucmVzb2x1dGlvbnNbcl07XG4gICAgICAgICAgICB2YXIgbnVtcHJlY2luY3RzID0gcmVzb2x1dGlvbi5wcmVjaW5jdFBhcmFtZXRlcnMubnVtcHJlY2luY3RzO1xuICAgICAgICAgICAgaWYgKHAgPj0gbnVtcHJlY2luY3RzKSB7XG4gICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZm9yICg7IGwgPCBsYXll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9uU2l6ZXMubWF4TnVtSGlnaDsgcHkrKykge1xuICAgICAgICBmb3IgKDsgcHggPCBwcmVjaW5jdHNJdGVyYXRpb25TaXplcy5tYXhOdW1XaWRlOyBweCsrKSB7XG4gICAgICAgICAgZm9yICg7IGMgPCBjb21wb25lbnRzQ291bnQ7IGMrKykge1xuICAgICAgICAgICAgdmFyIGNvbXBvbmVudCA9IHRpbGUuY29tcG9uZW50c1tjXTtcbiAgICAgICAgICAgIHZhciBkZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQgPVxuICAgICAgICAgICAgICBjb21wb25lbnQuY29kaW5nU3R5bGVQYXJhbWV0ZXJzLmRlY29tcG9zaXRpb25MZXZlbHNDb3VudDtcbiAgICAgICAgICAgIGZvciAoOyByIDw9IGRlY29tcG9zaXRpb25MZXZlbHNDb3VudDsgcisrKSB7XG4gICAgICAgICAgICAgIHZhciByZXNvbHV0aW9uID0gY29tcG9uZW50LnJlc29sdXRpb25zW3JdO1xuICAgICAgICAgICAgICB2YXIgc2l6ZUluSW1hZ2VTY2FsZSA9XG4gICAgICAgICAgICAgICAgcHJlY2luY3RzU2l6ZXMuY29tcG9uZW50c1tjXS5yZXNvbHV0aW9uc1tyXTtcbiAgICAgICAgICAgICAgdmFyIGsgPSBnZXRQcmVjaW5jdEluZGV4SWZFeGlzdChcbiAgICAgICAgICAgICAgICBweCxcbiAgICAgICAgICAgICAgICBweSxcbiAgICAgICAgICAgICAgICBzaXplSW5JbWFnZVNjYWxlLFxuICAgICAgICAgICAgICAgIHByZWNpbmN0c0l0ZXJhdGlvblNpemVzLFxuICAgICAgICAgICAgICAgIHJlc29sdXRpb24pO1xuICAgICAgICAgICAgICBpZiAoayA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGZvciAoOyBsIDwgbGF5ZXJzQ291bnQ7KSB7XG4gICAgICAgICAgICAgICAgdmFyIHBhY2tldCA9IGNyZWF0ZVBhY2tldChyZXNvbHV0aW9uLCBrLCBsKTtcbiAgICAgICAgICAgICAgICBsKys7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhY2tldDtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBsID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHIgPSAwO1xuICAgICAgICAgIH1cbiAgICAgICAgICBjID0gMDtcbiAgICAgICAgfVxuICAgICAgICBweCA9IDA7XG4gICAgICB9XG4gICAgfTtcbiAgfVxuICBmdW5jdGlvbiBDb21wb25lbnRQb3NpdGlvblJlc29sdXRpb25MYXllckl0ZXJhdG9yKGNvbnRleHQpIHtcbiAgICB2YXIgc2l6ID0gY29udGV4dC5TSVo7XG4gICAgdmFyIHRpbGVJbmRleCA9IGNvbnRleHQuY3VycmVudFRpbGUuaW5kZXg7XG4gICAgdmFyIHRpbGUgPSBjb250ZXh0LnRpbGVzW3RpbGVJbmRleF07XG4gICAgdmFyIGxheWVyc0NvdW50ID0gdGlsZS5jb2RpbmdTdHlsZURlZmF1bHRQYXJhbWV0ZXJzLmxheWVyc0NvdW50O1xuICAgIHZhciBjb21wb25lbnRzQ291bnQgPSBzaXouQ3NpejtcbiAgICB2YXIgcHJlY2luY3RzU2l6ZXMgPSBnZXRQcmVjaW5jdFNpemVzSW5JbWFnZVNjYWxlKHRpbGUpO1xuICAgIHZhciBsID0gMCwgciA9IDAsIGMgPSAwLCBweCA9IDAsIHB5ID0gMDtcblxuICAgIHRoaXMubmV4dFBhY2tldCA9IGZ1bmN0aW9uIEpweEltYWdlX25leHRQYWNrZXQoKSB7XG4gICAgICAvLyBTZWN0aW9uIEIuMTIuMS41IENvbXBvbmVudC1wb3NpdGlvbi1yZXNvbHV0aW9uLWxheWVyXG4gICAgICBmb3IgKDsgYyA8IGNvbXBvbmVudHNDb3VudDsgKytjKSB7XG4gICAgICAgIHZhciBjb21wb25lbnQgPSB0aWxlLmNvbXBvbmVudHNbY107XG4gICAgICAgIHZhciBwcmVjaW5jdHNJdGVyYXRpb25TaXplcyA9IHByZWNpbmN0c1NpemVzLmNvbXBvbmVudHNbY107XG4gICAgICAgIHZhciBkZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQgPVxuICAgICAgICAgIGNvbXBvbmVudC5jb2RpbmdTdHlsZVBhcmFtZXRlcnMuZGVjb21wb3NpdGlvbkxldmVsc0NvdW50O1xuICAgICAgICBmb3IgKDsgcHkgPCBwcmVjaW5jdHNJdGVyYXRpb25TaXplcy5tYXhOdW1IaWdoOyBweSsrKSB7XG4gICAgICAgICAgZm9yICg7IHB4IDwgcHJlY2luY3RzSXRlcmF0aW9uU2l6ZXMubWF4TnVtV2lkZTsgcHgrKykge1xuICAgICAgICAgICAgZm9yICg7IHIgPD0gZGVjb21wb3NpdGlvbkxldmVsc0NvdW50OyByKyspIHtcbiAgICAgICAgICAgICAgdmFyIHJlc29sdXRpb24gPSBjb21wb25lbnQucmVzb2x1dGlvbnNbcl07XG4gICAgICAgICAgICAgIHZhciBzaXplSW5JbWFnZVNjYWxlID0gcHJlY2luY3RzSXRlcmF0aW9uU2l6ZXMucmVzb2x1dGlvbnNbcl07XG4gICAgICAgICAgICAgIHZhciBrID0gZ2V0UHJlY2luY3RJbmRleElmRXhpc3QoXG4gICAgICAgICAgICAgICAgcHgsXG4gICAgICAgICAgICAgICAgcHksXG4gICAgICAgICAgICAgICAgc2l6ZUluSW1hZ2VTY2FsZSxcbiAgICAgICAgICAgICAgICBwcmVjaW5jdHNJdGVyYXRpb25TaXplcyxcbiAgICAgICAgICAgICAgICByZXNvbHV0aW9uKTtcbiAgICAgICAgICAgICAgaWYgKGsgPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBmb3IgKDsgbCA8IGxheWVyc0NvdW50Oykge1xuICAgICAgICAgICAgICAgIHZhciBwYWNrZXQgPSBjcmVhdGVQYWNrZXQocmVzb2x1dGl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ICAgICBzdWJiYW5kcy5wdXNoKHN1YmJhbmQpO1xuICAgICAgICAgIHJlc29sdXRpb25TdWJiYW5kcy5wdXNoKHN1YmJhbmQpO1xuXG4gICAgICAgICAgcmVzb2x1dGlvbi5zdWJiYW5kcyA9IHJlc29sdXRpb25TdWJiYW5kcztcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgY29tcG9uZW50LnJlc29sdXRpb25zID0gcmVzb2x1dGlvbnM7XG4gICAgICBjb21wb25lbnQuc3ViYmFuZHMgPSBzdWJiYW5kcztcbiAgICB9XG4gICAgLy8gR2VuZXJhdGUgdGhlIHBhY2tldHMgc2VxdWVuY2VcbiAgICB2YXIgcHJvZ3Jlc3Npb25PcmRlciA9IHRpbGUuY29kaW5nU3R5bGVEZWZhdWx0UGFyYW1ldGVycy5wcm9ncmVzc2lvbk9yZGVyO1xuICAgIHN3aXRjaCAocHJvZ3Jlc3Npb25PcmRlcikge1xuICAgICAgY2FzZSAwOlxuICAgICAgICB0aWxlLnBhY2tldHNJdGVyYXRvciA9XG4gICAgICAgICAgbmV3IExheWVyUmVzb2x1dGlvbkNvbXBvbmVudFBvc2l0aW9uSXRlcmF0b3IoY29udGV4dCk7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAxOlxuICAgICAgICB0aWxlLnBhY2tldHNJdGVyYXRvciA9XG4gICAgICAgICAgbmV3IFJlc29sdXRpb25MYXllckNvbXBvbmVudFBvc2l0aW9uSXRlcmF0b3IoY29udGV4dCk7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAyOlxuICAgICAgICB0aWxlLnBhY2tldHNJdGVyYXRvciA9XG4gICAgICAgICAgbmV3IFJlc29sdXRpb25Qb3NpdGlvbkNvbXBvbmVudExheWVySXRlcmF0b3IoY29udGV4dCk7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAzOlxuICAgICAgICB0aWxlLnBhY2tldHNJdGVyYXRvciA9XG4gICAgICAgICAgbmV3IFBvc2l0aW9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0aCBhbmQgcGFja2V0IHNlcXVlbmNlIElEXG4gICAgICAgICAgc2tpcEJ5dGVzKDQpO1xuICAgICAgICB9XG4gICAgICAgIHZhciBwYWNrZXQgPSBwYWNrZXRzSXRlcmF0b3IubmV4dFBhY2tldCgpO1xuICAgICAgICBpZiAocGFja2V0ID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAvL05vIG1vcmUgcGFja2V0cy4gU3RyZWFtIGlzIHByb2JhYmx5IHRydW5jYXRlZC5cbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFyZWFkQml0cygxKSkge1xuICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG4gICAgICAgIHZhciBsYXllck51bWJlciA9IHBhY2tldC5sYXllck51bWJlcjtcbiAgICAgICAgdmFyIHF1ZXVlID0gW10sIGNvZGVibG9jaztcbiAgICAgICAgZm9yICh2YXIgaSA9IDAsIGlpID0gcGFja2V0LmNvZGVibG9ja3MubGVuZ3RoOyBpIDwgaWk7IGkrKykge1xuICAgICAgICAgIGNvZGVibG9jayA9IHBhY2tldC5jb2RlYmxvY2tzW2ldO1xuICAgICAgICAgIHZhciBwcmVjaW5jdCA9IGNvZGVibG9jay5wcmVjaW5jdDtcbiAgICAgICAgICB2YXIgY29kZWJsb2NrQ29sdW1uID0gY29kZWJsb2NrLmNieCAtIHByZWNpbmN0LmNieE1pbjtcbiAgICAgICAgICB2YXIgY29kZWJsb2NrUm93ID0gY29kZWJsb2NrLmNieSAtIHByZWNpbmN0LmNieU1pbjtcbiAgICAgICAgICB2YXIgY29kZWJsb2NrSW5jbHVkZWQgPSBmYWxzZTtcbiAgICAgICAgICB2YXIgZmlyc3RUaW1lSW5jbHVzaW9uID0gZmFsc2U7XG4gICAgICAgICAgdmFyIHZhbHVlUmVhZHk7XG4gICAgICAgICAgaWYgKGNvZGVibG9ja1snaW5jbHVkZWQnXSAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICBjb2RlYmxvY2tJbmNsdWRlZCA9ICEhcmVhZEJpdHMoMSk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIC8vIHJlYWRpbmcgaW5jbHVzaW9uIHRyZWVcbiAgICAgICAgICAgIHByZWNpbmN0ID0gY29kZWJsb2NrLnByZWNpbmN0O1xuICAgICAgICAgICAgdmFyIGluY2x1c2lvblRyZWUsIHplcm9CaXRQbGFuZXNUcmVlO1xuICAgICAgICAgICAgaWYgKHByZWNpbmN0WydpbmNsdXNpb25UcmVlJ10gIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICBpbmNsdXNpb25UcmVlID0gcHJlY2luY3QuaW5jbHVzaW9uVHJlZTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIC8vIGJ1aWxkaW5nIGluY2x1c2lvbiBhbmQgemVybyBiaXQtcGxhbmVzIHRyZWVzXG4gICAgICAgICAgICAgIHZhciB3aWR0aCA9IHByZWNpbmN0LmNieE1heCAtIHByZWNpbmN0LmNieE1pbiArIDE7XG4gICAgICAgICAgICAgIHZhciBoZWlnaHQgPSBwcmVjaW5jdC5jYnlNYXggLSBwcmVjaW5jdC5jYnlNaW4gKyAxO1xuICAgICAgICAgICAgICBpbmNsdXNpb25UcmVlID0gbmV3IEluY2x1c2lvblRyZWUod2lkdGgsIGhlaWdodCk7XG4gICAgICAgICAgICAgIHplcm9CaXRQbGFuZXNUcmVlID0gbmV3IFRhZ1RyZWUod2lkdGgsIGhlaWdodCk7XG4gICAgICAgICAgICAgIHByZWNpbmN0LmluY2x1c2lvblRyZWUgPSBpbmNsdXNpb25UcmVlO1xuICAgICAgICAgICAgICBwcmVjaW5jdC56ZXJvQml0UGxhbmVzVHJlZSA9IHplcm9CaXRQbGFuZXNUcmVlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpbmNsdXNpb25UcmVlLnJlc2V0KGNvZGVibG9ja0NvbHVtbiwgY29kZWJsb2NrUm93LCBsYXllck51bWJlcik7XG4gICAgICAgICAgICB3aGlsZSAodHJ1ZSkge1xuICAgICAgICAgICAgICBpZiAocG9zaXRpb24gPj0gZGF0YS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKGluY2x1c2lvblRyZWUuaXNBYm92ZVRocmVzaG9sZCgpKXtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAoaW5jbHVzaW9uVHJlZS5pc0tub3duKCkpIHtcbiAgICAgICAgICAgICAgICBpbmNsdXNpb25UcmVlLm5leHRMZXZlbCgpO1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChyZWFkQml0cygxKSkge1xuICAgICAgICAgICAgICAgIGluY2x1c2lvblRyZWUuc2V0S25vd24oKTtcbiAgICAgICAgICAgICAgICBpZiAoaW5jbHVzaW9uVHJlZS5pc0xlYWYoKSkge1xuICAgICAgICAgICAgICAgICAgY29kZWJsb2NrLmluY2x1ZGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgIGNvZGVibG9ja0luY2x1ZGVkID0gZmlyc3RUaW1lSW5jbHVzaW9uID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICBpbmNsdXNpb25UcmVlLm5leHRMZXZlbCgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpbmNsdXNpb25UcmVlLmluY3JlbWVudFZhbHVlKCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKCFjb2RlYmxvY2tJbmNsdWRlZCkge1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChmaXJzdFRpbWVJbmNsdXNpb24pIHtcbiAgICAgICAgICAgIHplcm9CaXRQbGFuZXNUcmVlID0gcHJlY2luY3QuemVyb0JpdFBsYW5lc1RyZWU7XG4gICAgICAgICAgICB6ZXJvQml0UGxhbmVzVHJlZS5yZXNldChjb2RlYmxvY2tDb2x1bW4sIGNvZGVibG9ja1Jvdyk7XG4gICAgICAgICAgICB3aGlsZSAodHJ1ZSkge1xuICAgICAgICAgICAgICBpZiAocG9zaXRpb24gPj0gZGF0YS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKHJlYWRCaXRzKDEpKSB7XG4gICAgICAgICAgICAgICAgdmFsdWVSZWFkeSA9ICF6ZXJvQml0UGxhbmVzVHJlZS5uZXh0TGV2ZWwoKTtcbiAgICAgICAgICAgICAgICBpZiAodmFsdWVSZWFkeSkge1xuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHplcm9CaXRQbGFuZXNUcmVlLmluY3JlbWVudFZhbHVlKCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNvZGVibG9jay56ZXJvQml0UGxhbmVzID0gemVyb0JpdFBsYW5lc1RyZWUudmFsdWU7XG4gICAgICAgICAgfVxuICAgICAgICAgIHZhciBjb2RpbmdwYXNzZXMgPSByZWFkQ29kaW5ncGFzc2VzKCk7XG4gICAgICAgICAgd2hpbGUgKHJlYWRCaXRzKDEpKSB7XG4gICAgICAgICAgICBjb2RlYmxvY2suTGJsb2NrKys7XG4gICAgICAgICAgfVxuICAgICAgICAgIHZhciBjb2RpbmdwYXNzZXNMb2cyID0gbG9nMihjb2RpbmdwYXNzZXMpO1xuICAgICAgICAgIC8vIHJvdW5kaW5nIGRvd24gbG9nMlxuICAgICAgICAgIHZhciBiaXRzID0gKChjb2RpbmdwYXNzZXMgPCAoMSA8PCBjb2RpbmdwYXNzZXNMb2cyKSkgP1xuICAgICAgICAgICAgICAgICAgICAgIGNvZGluZ3Bhc3Nlc0xvZzIgLSAxIDogY29kaW5ncGFzc2VzTG9nMikgKyBjb2RlYmxvY2suTGJsb2NrO1xuICAgICAgICAgIHZhciBjb2RlZERhdGFMZW5ndGggPSByZWFkQml0cyhiaXRzKTtcbiAgICAgICAgICBxdWV1ZS5wdXNoKHtcbiAgICAgICAgICAgIGNvZGVibG9jazogY29kZWJsb2NrLFxuICAgICAgICAgICAgY29kaW5ncGFzc2VzOiBjb2RpbmdwYXNzZXMsXG4gICAgICAgICAgICBkYXRhTGVuZ3RoOiBjb2RlZERhdGFMZW5ndGhcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICBhbGlnblRvQnl0ZSgpO1xuICAgICAgICBpZiAoZXBoTWFya2VyVXNlZCkge1xuICAgICAgICAgIHNraXBNYXJrZXJJZkVxdWFsKDB4OTIpO1xuICAgICAgICB9XG4gICAgICAgIHdoaWxlIChxdWV1ZS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgdmFyIHBhY2tldEl0ZW0gPSBxdWV1ZS5zaGlmdCgpO1xuICAgICAgICAgIGNvZGVibG9jayA9IHBhY2tldEl0ZW0uY29kZWJsb2NrO1xuICAgICAgICAgIGlmIChjb2RlYmxvY2tbJ2RhdGEnXSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICBjb2RlYmxvY2suZGF0YSA9IFtdO1xuICAgICAgICAgIH1cbiAgICAgICAgICBjb2RlYmxvY2suZGF0YS5wdXNoKHtcbiAgICAgICAgICAgIGRhdGE6IGRhdGEsXG4gICAgICAgICAgICBzdGFydDogb2Zmc2V0ICsgcG9zaXRpb24sXG4gICAgICAgICAgICBlbmQ6IG9mZnNldCArIHBvc2l0aW9uICsgcGFja2V0SXRlbS5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gPSAwOyBrIDwgYmxvY2tXaWR0aDsgaysrKSB7XG4gICAgICAgICAgbiA9IG1hZ25pdHVkZVtwb3NpdGlvbl07XG4gICAgICAgICAgaWYgKG4gIT09IDApIHtcbiAgICAgICAgICAgIG4gPSAobiArIG1hZ25pdHVkZUNvcnJlY3Rpb24pICogZGVsdGE7XG4gICAgICAgICAgICBpZiAoc2lnbltwb3NpdGlvbl0gIT09IDApIHtcbiAgICAgICAgICAgICAgbiA9IC1uO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbmIgPSBiaXRzRGVjb2RlZFtwb3NpdGlvbl07XG4gICAgICAgICAgICB2YXIgcG9zID0gaW50ZXJsZWF2ZSA/IChsZXZlbE9mZnNldCArIChvZmZzZXQgPDwgMSkpIDogb2Zmc2V0O1xuICAgICAgICAgICAgaWYgKHJldmVyc2libGUgJiYgKG5iID49IG1iKSkge1xuICAgICAgICAgICAgICBjb2VmZmljaWVudHNbcG9zXSA9IG47XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBjb2VmZmljaWVudHNbcG9zXSA9IG4gKiAoMSA8PCAobWIgLSBuYikpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBvZmZzZXQrKztcbiAgICAgICAgICBwb3NpdGlvbisrO1xuICAgICAgICB9XG4gICAgICAgIG9mZnNldCArPSB3aWR0aCAtIGJsb2NrV2lkdGg7XG4gICAgICB9XG4gICAgfVxuICB9XG4gIGZ1bmN0aW9uIHRyYW5zZm9ybVRpbGUoY29udGV4dCwgdGlsZSwgYykge1xuICAgIHZhciBjb21wb25lbnQgPSB0aWxlLmNvbXBvbmVudHNbY107XG4gICAgdmFyIGNvZGluZ1N0eWxlUGFyYW1ldGVycyA9IGNvbXBvbmVudC5jb2RpbmdTdHlsZVBhcmFtZXRlcnM7XG4gICAgdmFyIHF1YW50aXphdGlvblBhcmFtZXRlcnMgPSBjb21wb25lbnQucXVhbnRpemF0aW9uUGFyYW1ldG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1IDogciA+PiBzaGlmdDtcbiAgICAgICAgICAgIG91dFtwb3MrK10gPSBnIDw9IDAgPyAwIDogZyA+PSBtYXggPyAyNTUgOiBnID4+IHNoaWZ0O1xuICAgICAgICAgICAgb3V0W3BvcysrXSA9IGIgPD0gMCA/IDAgOiBiID49IG1heCA/IDI1NSA6IGIgPj4gc2hpZnQ7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vIGludmVyc2UgcmV2ZXJzaWJsZSBtdWx0aXBsZSBjb21wb25lbnQgdHJhbnNmb3JtXG4gICAgICAgICAgZm9yIChqID0gMDsgaiA8IGpqOyBqKyssIHBvcyArPSBhbHBoYTAxKSB7XG4gICAgICAgICAgICB5MCA9IHkwaXRlbXNbal0gKyBvZmZzZXQ7XG4gICAgICAgICAgICB5MSA9IHkxaXRlbXNbal07XG4gICAgICAgICAgICB5MiA9IHkyaXRlbXNbal07XG4gICAgICAgICAgICBnID0geTAgLSAoKHkyICsgeTEpID4+IDIpO1xuICAgICAgICAgICAgciA9IGcgKyB5MjtcbiAgICAgICAgICAgIGIgPSBnICsgeTE7XG4gICAgICAgICAgICBvdXRbcG9zKytdID0gciA8PSAwID8gMCA6IHIgPj0gbWF4ID8gMjU1IDogciA+PiBzaGlmdDtcbiAgICAgICAgICAgIG91dFtwb3MrK10gPSBnIDw9IDAgPyAwIDogZyA+PSBtYXggPyAyNTUgOiBnID4+IHNoaWZ0O1xuICAgICAgICAgICAgb3V0W3BvcysrXSA9IGIgPD0gMCA/IDAgOiBiID49IG1heCA/IDI1NSA6IGIgPj4gc2hpZnQ7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChmb3VyQ29tcG9uZW50cykge1xuICAgICAgICAgIGZvciAoaiA9IDAsIHBvcyA9IDM7IGogPCBqajsgaisrLCBwb3MgKz0gNCkge1xuICAgICAgICAgICAgayA9IHkzaXRlbXNbal07XG4gICAgICAgICAgICBvdXRbcG9zXSA9IGsgPD0gbWluID8gMCA6IGsgPj0gbWF4SyA/IDI1NSA6IChrICsgb2Zmc2V0KSA+PiBzaGlmdDtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7IC8vIG5vIG11bHRpLWNvbXBvbmVudCB0cmFuc2Zvcm1cbiAgICAgICAgZm9yIChjID0gMDsgYyA8IGNvbXBvbmVudHNDb3VudDsgYysrKSB7XG4gICAgICAgICAgaWYgKGNvbXBvbmVudHNbY10ucHJlY2lzaW9uID09PSA4KXtcbiAgICAgICAgICAgIHZhciBpdGVtcyA9IHRyYW5zZm9ybWVkVGlsZXNbY10uaXRlbXM7XG4gICAgICAgICAgICBzaGlmdCA9IGNvbXBvbmVudHNbY10ucHJlY2lzaW9uIC0gODtcbiAgICAgICAgICAgIG9mZnNldCA9ICgxMjggPDwgc2hpZnQpICsgMC41O1xuICAgICAgICAgICAgbWF4ID0gKDEyNy41ICogKDEgPDwgc2hpZnQpKTtcbiAgICAgICAgICAgIG1pbiA9IC1tYXg7XG4gICAgICAgICAgICBmb3IgKHBvcyA9IGMsIGogPSAwLCBqaiA9IGl0ZW1zLmxlbmd0aDsgaiA8IGpqOyBqKyspIHtcbiAgICAgICAgICAgICAgdmFsID0gaXRlbXNbal07XG4gICAgICAgICAgICAgIG91dFtwb3NdID0gdmFsIDw9IG1pbiA/IDAgOlxuICAgICAgICAgICAgICAgICAgICAgICAgIHZhbCA+PSBtYXggPyAyNTUgOiAodmFsICsgb2Zmc2V0KSA+PiBzaGlmdDtcbiAgICAgICAgICAgICAgcG9zICs9IGNvbXBvbmVudHNDb3VudDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9ZWxzZXtcbiAgICAgICAgICAgIHZhciBpc1NpZ25lZCA9IGNvbXBvbmVudHNbY10uaXNTaWduZWQ7XG4gICAgICAgICAgICB2YXIgaXRlbXMgPSB0cmFuc2Zvcm1lZFRpbGVzW2NdLml0ZW1zO1xuXG4gICAgICAgICAgICBpZihpc1NpZ25lZCl7XG4gICAgICAgICAgICAgIGZvciAocG9zID0gYywgaiA9IDAsIGpqID0gaXRlbXMubGVuZ3RoOyBqIDwgamo7IGorKykge1xuICAgICAgICAgICAgICAgIG91dFtwb3NdID0gaXRlbXNbal07XG4gICAgICAgICAgICAgICAgcG9zICs9IGNvbXBvbmVudHNDb3VudDtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfWVsc2V7XG4gICAgICAgICAgICAgIHNoaWZ0ID0gY29tcG9uZW50c1tjXS5wcmVjaXNpb24gLSA4O1xuICAgICAgICAgICAgICBvZmZzZXQgPSAoMTI4IDw8IHNoaWZ0KSArIDAuNTtcbiAgICAgICAgICAgICAgdmFyIHByZWNpc2lvbk1heCA9IE1hdGgucG93KDIsY29tcG9uZW50c1tjXS5wcmVjaXNpb24pLTE7XG4gICAgICAgICAgICAgIGZvciAocG9zID0gYywgaiA9IDAsIGpqID0gaXRlbXMubGVuZ3RoOyBqIDwgamo7IGorKykge1xuICAgICAgICAgICAgICAgIHZhbCA9IGl0ZW1zW2pdO1xuICAgICAgICAgICAgICAgIG91dFtwb3NdID0gTWF0aC5tYXgoTWF0aC5taW4oKHZhbCArIG9mZnNldCkscHJlY2lzaW9uTWF4KSwwKTtcbiAgICAgICAgICAgICAgICBwb3MgKz0gY29tcG9uZW50c0NvdW50O1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICByZXN1bHRJbWFnZXMucHVzaChyZXN1bHQpO1xuICAgIH1cbiAgICByZXR1cm4gcmVzdWx0SW1hZ2VzO1xuICB9XG4gIGZ1bmN0aW9uIGluaXRpYWxpemVUaWxlKGNvbnRleHQsIHRpbGVJbmRleCkge1xuICAgIHZhciBzaXogPSBjb250ZXh0LlNJWjtcbiAgICB2YXIgY29tcG9uZW50c0NvdW50ID0gc2l6LkNzaXo7XG4gICAgdmFyIHRpbGUgPSBjb250ZXh0LnRpbGVzW3RpbGV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aDogd2lkdGgsXG4gICAgICAgICAgaGVpZ2h0OiBoZWlnaHQsXG4gICAgICAgICAgaXRlbXM6IFtdXG4gICAgICAgIH07XG4gICAgICAgIHRoaXMubGV2ZWxzLnB1c2gobGV2ZWwpO1xuICAgICAgICB3aWR0aCA9IE1hdGguY2VpbCh3aWR0aCAvIDIpO1xuICAgICAgICBoZWlnaHQgPSBNYXRoLmNlaWwoaGVpZ2h0IC8gMik7XG4gICAgICB9XG4gICAgfVxuICAgIFRhZ1RyZWUucHJvdG90eXBlID0ge1xuICAgICAgcmVzZXQ6IGZ1bmN0aW9uIFRhZ1RyZWVfcmVzZXQoaSwgaikge1xuICAgICAgICB2YXIgY3VycmVudExldmVsID0gMCwgdmFsdWUgPSAwLCBsZXZlbDtcbiAgICAgICAgd2hpbGUgKGN1cnJlbnRMZXZlbCA8IHRoaXMubGV2ZWxzLmxlbmd0aCkge1xuICAgICAgICAgIGxldmVsID0gdGhpcy5sZXZlbHNbY3VycmVudExldmVsXTtcbiAgICAgICAgICB2YXIgaW5kZXggPSBpICsgaiAqIGxldmVsLndpZHRoO1xuICAgICAgICAgIGlmIChsZXZlbC5pdGVtc1tpbmRleF0gIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgdmFsdWUgPSBsZXZlbC5pdGVtc1tpbmRleF07XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgICAgbGV2ZWwuaW5kZXggPSBpbmRleDtcbiAgICAgICAgICBpID4+PSAxO1xuICAgICAgICAgIGogPj49IDE7XG4gICAgICAgICAgY3VycmVudExldmVsKys7XG4gICAgICAgIH1cbiAgICAgICAgY3VycmVudExldmVsLS07XG4gICAgICAgIGxldmVsID0gdGhpcy5sZXZlbHNbY3VycmVudExldmVsXTtcbiAgICAgICAgbGV2ZWwuaXRlbXNbbGV2ZWwuaW5kZXhdID0gdmFsdWU7XG4gICAgICAgIHRoaXMuY3VycmVudExldmVsID0gY3VycmVudExldmVsO1xuICAgICAgICB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mFyIGxldmVsID0gdGhpcy5sZXZlbHNbY3VycmVudExldmVsXTtcbiAgICAgICAgICB2YXIgaW5kZXggPSBpICsgaiAqIGxldmVsLndpZHRoO1xuICAgICAgICAgIGxldmVsLmluZGV4ID0gaW5kZXg7XG5cbiAgICAgICAgICBpID4+PSAxO1xuICAgICAgICAgIGogPj49IDE7XG4gICAgICAgICAgY3VycmVudExldmVsKys7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLmN1cnJlbnRMZXZlbCA9IHRoaXMubGV2ZWxzLmxlbmd0aCAtIDE7XG4gICAgICAgIHRoaXMubWluVmFsdWUgPXRoaXMubGV2ZWxzW3RoaXMuY3VycmVudExldmVsXS5pdGVtc1swXTtcbiAgICAgICAgcmV0dXJuO1xuICAgICAgfSxcbiAgICAgIGluY3JlbWVudFZhbHVlOiBmdW5jdGlvbiBJbmNsdXNpb25UcmVlX2luY3JlbWVudFZhbHVlKCkge1xuICAgICAgICB2YXIgbGV2ZWwgPSB0aGlzLmxldmVsc1t0aGlzLmN1cnJlbnRMZXZlbF07XG4gICAgICAgIGxldmVsLml0ZW1zW2xldmVsLmluZGV4XSA9IGxldmVsLml0ZW1zW2xldmVsLmluZGV4XSArIDE7XG4gICAgICAgIGlmKGxldmVsLml0ZW1zW2xldmVsLmluZGV4XSA+IHRoaXMubWluVmFsdWUpIHtcbiAgICAgICAgICB0aGlzLm1pblZhbHVlID0gbGV2ZWwuaXRlbXNbbGV2ZWwuaW5kZXhdO1xuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgbmV4dExldmVsOiBmdW5jdGlvbiBJbmNsdXNpb25UcmVlX25leHRMZXZlbCgpIHtcbiAgICAgICAgdmFyIGN1cnJlbnRMZXZlbCA9IHRoaXMuY3VycmVudExldmVsO1xuICAgICAgICBjdXJyZW50TGV2ZWwtLTtcbiAgICAgICAgaWYgKGN1cnJlbnRMZXZlbCA8IDApIHtcbiAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH0gZWx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zLmhlaWdodCA9IGhlaWdodDtcblxuICAgICAgdGhpcy5jb250ZXh0TGFiZWxUYWJsZSA9IChzdWJiYW5kID09PSAnSEgnID8gSEhDb250ZXh0TGFiZWwgOlxuICAgICAgICAoc3ViYmFuZCA9PT0gJ0hMJyA/IEhMQ29udGV4dExhYmVsIDogTExBbmRMSENvbnRleHRzTGFiZWwpKTtcblxuICAgICAgdmFyIGNvZWZmaWNpZW50Q291bnQgPSB3aWR0aCAqIGhlaWdodDtcblxuICAgICAgLy8gY29lZmZpY2llbnRzIG91dHNpZGUgdGhlIGVuY29kaW5nIHJlZ2lvbiB0cmVhdGVkIGFzIGluc2lnbmlmaWNhbnRcbiAgICAgIC8vIGFkZCBib3JkZXIgc3RhdGUgY2VsbHMgZm9yIHNpZ25pZmljYW5jZVN0YXRlXG4gICAgICB0aGlzLm5laWdoYm9yc1NpZ25pZmljYW5jZSA9IG5ldyBVaW50OEFycmF5KGNvZWZmaWNpZW50Q291bnQpO1xuICAgICAgdGhpcy5jb2VmZmljZW50c1NpZ24gPSBuZXcgVWludDhBcnJheShjb2VmZmljaWVudENvdW50KTtcbiAgICAgIHRoaXMuY29lZmZpY2VudHNNYWduaXR1ZGUgPSBtYiA+IDE0ID8gbmV3IFVpbnQzMkFycmF5KGNvZWZmaWNpZW50Q291bnQpIDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYiA+IDYgPyBuZXcgVWludDE2QXJyYXkoY29lZmZpY2llbnRDb3VudCkgOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBVaW50OEFycmF5KGNvZWZmaWNpZW50Q291bnQpO1xuICAgICAgdGhpcy5wcm9jZXNzaW5nRmxhZ3MgPSBuZXcgVWludDhBcnJheShjb2VmZmljaWVudENvdW50KTtcblxuICAgICAgdmFyIGJpdHNEZWNvZGVkID0gbmV3IFVpbnQ4QXJyYXkoY29lZmZpY2llbnRDb3VudCk7XG4gICAgICBpZiAoemVyb0JpdFBsY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mVpZ2hib3JzU2lnbmlmaWNhbmNlOlxuICAgICAgICBmdW5jdGlvbiBCaXRNb2RlbF9zZXROZWlnaGJvcnNTaWduaWZpY2FuY2Uocm93LCBjb2x1bW4sIGluZGV4KSB7XG4gICAgICAgIHZhciBuZWlnaGJvcnNTaWduaWZpY2FuY2UgPSB0aGlzLm5laWdoYm9yc1NpZ25pZmljYW5jZTtcbiAgICAgICAgdmFyIHdpZHRoID0gdGhpcy53aWR0aCwgaGVpZ2h0ID0gdGhpcy5oZWlnaHQ7XG4gICAgICAgIHZhciBsZWZ0ID0gKGNvbHVtbiA+IDApO1xuICAgICAgICB2YXIgcmlnaHQgPSAoY29sdW1uICsgMSA8IHdpZHRoKTtcbiAgICAgICAgdmFyIGk7XG5cbiAgICAgICAgaWYgKHJvdyA+IDApIHtcbiAgICAgICAgICBpID0gaW5kZXggLSB3aWR0aDtcbiAgICAgICAgICBpZiAobGVmdCkge1xuICAgICAgICAgICAgbmVpZ2hib3JzU2lnbmlmaWNhbmNlW2kgLSAxXSArPSAweDEwO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAocmlnaHQpIHtcbiAgICAgICAgICAgIG5laWdoYm9yc1NpZ25pZmljYW5jZVtpICsgMV0gKz0gMHgxMDtcbiAgICAgICAgICB9XG4gICAgICAgICAgbmVpZ2hib3JzU2lnbmlmaWNhbmNlW2ldICs9IDB4MDQ7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAocm93ICsgMSA8IGhlaWdodCkge1xuICAgICAgICAgIGkgPSBpbmRleCArIHdpZHRoO1xuICAgICAgICAgIGlmIChsZWZ0KSB7XG4gICAgICAgICAgICBuZWlnaGJvcnNTaWduaWZpY2FuY2VbaSAtIDFdICs9IDB4MTA7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChyaWdodCkge1xuICAgICAgICAgICAgbmVpZ2hib3JzU2lnbmlmaWNhbmNlW2kgKyAxXSArPSAweDEwO1xuICAgICAgICAgIH1cbiAgICAgICAgICBuZ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gICAgICAgdmFyIHByb2Nlc3NlZEludmVyc2VNYXNrID0gfjE7XG4gICAgICAgIHZhciBwcm9jZXNzZWRNYXNrID0gMTtcbiAgICAgICAgdmFyIGZpcnN0TWFnbml0dWRlQml0TWFzayA9IDI7XG5cbiAgICAgICAgZm9yICh2YXIgaTAgPSAwOyBpMCA8IGhlaWdodDsgaTAgKz0gNCkge1xuICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgd2lkdGg7IGorKykge1xuICAgICAgICAgICAgdmFyIGluZGV4ID0gaTAgKiB3aWR0aCArIGo7XG4gICAgICAgICAgICBmb3IgKHZhciBpMSA9IDA7IGkxIDwgNDsgaTErKywgaW5kZXggKz0gd2lkdGgpIHtcbiAgICAgICAgICAgICAgdmFyIGkgPSBpMCArIGkxO1xuICAgICAgICAgICAgICBpZiAoaSA+PSBoZWlnaHQpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAvLyBjbGVhciBwcm9jZXNzZWQgZmxhZyBmaXJzdFxuICAgICAgICAgICAgICBwcm9jZXNzaW5nRmxhZ3NbaW5kZXhdICY9IHByb2Nlc3NlZEludmVyc2VNYXNrO1xuXG4gICAgICAgICAgICAgIGlmIChjb2VmZmljZW50c01hZ25pdHVkZVtpbmRleF0gfHxcbiAgICAgICAgICAgICAgICAgICFuZWlnaGJvcnNTaWduaWZpY2FuY2VbaW5kZXhdKSB7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICB2YXIgY29udGV4dExhYmVsID0gbGFiZWxzW25laWdoYm9yc1NpZ25pZmljYW5jZVtpbmRleF1dO1xuICAgICAgICAgICAgICB2YXIgZGVjaXNpb24gPSBkZWNvZGVyLnJlYWRCaXQoY29udGV4dHMsIGNvbnRleHRMYWJlbCk7XG4gICAgICAgICAgICAgIGlmIChkZWNpc2lvbikge1xuICAgICAgICAgICAgICAgIHZhciBzaWduID0gdGhpcy5kZWNvZGVTaWduQml0KGksIGosIGluZGV4KTtcbiAgICAgICAgICAgICAgICBjb2VmZmljZW50c1NpZ25baW5kZXhdID0gc2lnbjtcbiAgICAgICAgICAgICAgICBjb2VmZmljZW50c01hZ25pdHVkZVtpbmRleF0gPSAxO1xuICAgICAgICAgICAgICAgIHRoaXMuc2V0TmVpZ2hib3JzU2lnbmlmaWNhbmNlKGksIGosIGluZGV4KTtcbiAgICAgICAgICAgICAgICBwcm9jZXNzaW5nRmxhZ3NbaW5kZXhdIHw9IGZpcnN0TWFnbml0dWRlQml0TWFzaztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBiaXRzRGVjb2RlZFtpbmRleF0rKztcbiAgICAgICAgICAgICAgcHJvY2Vzc2luZ0ZsYWdzW2luZGV4XSB8PSBwcm9jZXNzZWRNYXNrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIGRlY29kZVNpZ25CaXQ6IGZ1bmN0aW9uIEJpdE1vZGVsX2RlY29kZVNpZ25CaXQocm93LCBjb2x1bW4sIGluZGV4KSB7XG4gICAgICAgIHZhciB3aWR0aCA9IHRoaXMud2lkdGgsIGhlaWdodCA9IHRoaXMuaGVpZ2h0O1xuICAgICAgICB2YXIgY29lZmZpY2VudHNNYWduaXR1ZGUgPSB0aGlzLmNvZWZmaWNlbnRzTWFnbml0dWRlO1xuICAgICAgICB2YXIgY29lZmZpY2VudHNTaWduID0gdGhpcy5jb2VmZmljZW50c1NpZ247XG4gICAgICAgIHZhciBjb250cmlidXRpb24sIHNpZ24wLCBzaWduMSwgc2lnbmlmaWNhbmNlMTtcbiAgICAgICAgdmFyIGNvbnRleHRMYWJlbCwgZGVjb2RlZDtcblxuICAgICAgICAvLyBjYWxjdWxhdGUgaG9yaXpvbnRhbCBjb250cmlidXRpb25cbiAgICAgICAgc2lnbmlmaWNhbmNlMSA9IChjb2x1bW4gPiAwICYmIGNvZWZmaWNlbnRzTWFnbml0dWRlW2luZGV4IC0gMV0gIT09IDApO1xuICAgICAgICBpZiAoY29sdW1uICsgMSA8IHdpZHRoICYmIGNvZWZmaWNlbnRzTWFnbml0dWRlW2luZGV4ICsgMV0gIT09IDApIHtcbiAgICAgICAgICBzaWduMSA9IGNvZWZmaWNlbnRzU2lnbltpbmRleCArIDFdO1xuICAgICAgICAgIGlmIChzaWduaWZpY2FuY2UxKSB7XG4gICAgICAgICAgICBzaWduMCA9IGNvZWZmaWNlbnRzU2lnbltpbmRleCAtIDFdO1xuICAgICAgICAgICAgY29udHJpYnV0aW9uID0gMSAtIHNpZ24xIC0gc2lnbjA7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNvbnRyaWJ1dGlvbiA9IDEgLSBzaWduMSAtIHNpZ24xO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChzaWduaWZpY2FuY2UxKSB7XG4gICAgICAgICAgc2lnbjAgPSBjb2VmZmljZW50c1NpZ25baW5kZXggLSAxXTtcbiAgICAgICAgICBjb250cmlidXRpb24gPSAxIC0gc2lnbjAgLSBzaWduMDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBjb250cmlidXRpb24gPSAwO1xuICAgICAgICB9XG4gICAgICAgIHZhciBob3Jpem9udGFsQ29udHJpYnV0aW9uID0gMyAqIGNvbnRyaWJ1dGlvbjtcblxuICAgICAgICAvLyBjYWxjdWxhdGUgdmVydGljYWwgY29udHJpYnV0aW9uIGFuZCBjb21iaW5lIHdpdGggdGhlIGhvcml6b250YWxcbiAgICAgICAgc2lnbmlmaWNhbmNlMSA9IChyb3cgPiAwICYmIGNvZWZmaWNlbnRzTWFnbml0dWRlW2luZGV4IC0gd2lkdGhdICE9PSAwKTtcbiAgICAgICAgaWYgKHJvdyArIDEgPCBoZWlnaHQgJiYgY29lZmZpY2VudHNNYWduaXR1ZGVbaW5kZXggKyB3aWR0aF0gIT09IDApIHtcbiAgICAgICAgICBzaWduMSA9IGNvZWZmaWNlbnRzU2lnbltpbmRleCArIHdpZHRoXTtcbiAgICAgICAgICBpZiAoc2lnbmlmaWNhbmNlMSkge1xuICAgICAgICAgICAgc2lnbjAgPSBjb2VmZmljZW50c1NpZ25baW5kZXggLSB3aWR0aF07XG4gICAgICAgICAgICBjb250cmlidXRpb24gPSAxIC0gc2lnbjEgLSBzaWduMCArIGhvcml6b250YWxDb250cmlidXRpb247XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNvbnRyaWJ1dGlvbiA9IDEgLSBzaWduMSAtIHNpZ24xICsgaG9yaXpvbnRhbENvbnRyaWJ1dGlvbjtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAoc2lnbmlmaWNhbmNlMSkge1xuICAgICAgICAgIHNpZ24wID0gY29lZmZpY2VudHNTaWduW2luZGV4IC0gd2lkdGhdO1xuICAgICAgICAgIGNvbnRyaWJ1dGlvbiA9IDEgLSBzaWduMCAtIHNpZ24wICsgaG9yaXpvbnRhbENvbnRyaWJ1dGlvbjtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBjb250cmlidXRpb24gPSBob3Jpem9udGFsQ29udHJpYnV0aW9uO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGNvbnRyaWJ1dGlvbiA+PSAwKSB7XG4gICAgICAgICAgY29udGV4dExhYmVsID0gOSArIGNvbnRyaWJ1dGlvbjtcbiAgICAgICAgICBkZWNvZGVkID0gdGhpcy5kZWNvZGVyLnJlYWRCaXQodGhpcy5jb250ZXh0cywgY29udGV4dExhYmVsKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBjb250ZXh0TGFiZWwgPSA5IC0gY29udHJpYnV0aW9uO1xuICAgICAgICAgIGRlY29kZWQgPSB0aGlzLmRlY29kZXIucmVhZEJpdCh0aGlzLmNvbnRleHRzLCBjb250ZXh0TGFiZWwpIF4gMTtcbiAgICAgICAgfVxuICAgICAgICByZXR1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yBqOyBpbmRleCA8IGluZGV4TmV4dDsgaW5kZXggKz0gd2lkdGgpIHtcblxuICAgICAgICAgICAgICAvLyBzaWduaWZpY2FudCBidXQgbm90IHRob3NlIHRoYXQgaGF2ZSBqdXN0IGJlY29tZVxuICAgICAgICAgICAgICBpZiAoIWNvZWZmaWNlbnRzTWFnbml0dWRlW2luZGV4XSB8fFxuICAgICAgICAgICAgICAgIChwcm9jZXNzaW5nRmxhZ3NbaW5kZXhdICYgcHJvY2Vzc2VkTWFzaykgIT09IDApIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHZhciBjb250ZXh0TGFiZWwgPSAxNjtcbiAgICAgICAgICAgICAgaWYgKChwcm9jZXNzaW5nRmxhZ3NbaW5kZXhdICYgZmlyc3RNYWduaXR1ZGVCaXRNYXNrKSAhPT0gMCkge1xuICAgICAgICAgICAgICAgIHByb2Nlc3NpbmdGbGFnc1tpbmRleF0gXj0gZmlyc3RNYWduaXR1ZGVCaXRNYXNrO1xuICAgICAgICAgICAgICAgIC8vIGZpcnN0IHJlZmluZW1lbnRcbiAgICAgICAgICAgICAgIHZhciBzaWduaWZpY2FuY2UgPSBuZWlnaGJvcnNTaWduaWZpY2FuY2VbaW5kZXhdICYgMTI3O1xuICAgICAgICAgICAgICAgY29udGV4dExhYmVsID0gc2lnbmlmaWNhbmNlID09PSAwID8gMTUgOiAxNDtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHZhciBiaXQgPSBkZWNvZGVyLnJlYWRCaXQoY29udGV4dHMsIGNvbnRleHRMYWJlbCk7XG4gICAgICAgICAgICAgIGNvZWZmaWNlbnRzTWFnbml0dWRlW2luZGV4XSA9XG4gICAgICAgICAgICAgICAgKGNvZWZmaWNlbnRzTWFnbml0dWRlW2luZGV4XSA8PCAxKSB8IGJpdDtcbiAgICAgICAgICAgICAgYml0c0RlY29kZWRbaW5kZXhdKys7XG4gICAgICA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93bl0gPT09IDAgJiZcbiAgICAgICAgICAgICAgbmVpZ2hib3JzU2lnbmlmaWNhbmNlW2luZGV4MCArIHRocmVlUm93c0Rvd25dID09PSAwKTtcbiAgICAgICAgICAgIHZhciBpMSA9IDAsIGluZGV4ID0gaW5kZXgwO1xuICAgICAgICAgICAgdmFyIGkgPSBpMCwgc2lnbjtcbiAgICAgICAgICAgIGlmIChhbGxFbXB0eSkge1xuICAgICAgICAgICAgICB2YXIgaGFzU2lnbmlmaWNhbnRDb2VmZmljZW50ID1cbiAgICAgICAgICAgICAgICBkZWNvZGVyLnJlYWRCaXQoY29udGV4dHMsIFJVTkxFTkdUSF9DT05URVhUKTtcbiAgICAgICAgICAgICAgaWYgKCFoYXNTaWduaWZpY2FudENvZWZmaWNlbnQpIHtcbiAgICAgICAgICAgICAgICBiaXRzRGVjb2RlZFtpbmRleDBdKys7XG4gICAgICAgICAgICAgICAgYml0c0RlY29kZWRbaW5kZXgwICsgb25lUm93RG93bl0rKztcbiAgICAgICAgICAgICAgICBiaXRzRGVjb2RlZFtpbmRleDAgKyB0d29Sb3dzRG93bl0rKztcbiAgICAgICAgICAgICAgICBiaXRzRGVjb2RlZFtpbmRleDAgKyB0aHJlZVJvd3NEb3duXSsrO1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlOyAvLyBuZXh0IGNvbHVtblxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGkxID0gKGRlY29kZXIucmVhZEJpdChjb250ZXh0cywgVU5JRk9STV9DT05URVhUKSA8PCAxKSB8XG4gICAgICAgICAgICAgICAgICAgIGRlY29kZXIucmVhZEJpdChjb250ZXh0cywgVU5JRk9STV9DT05URVhUKTtcbiAgICAgICAgICAgICAgaWYgKGkxICE9PSAwKSB7XG4gICAgICAgICAgICAgICAgaSA9IGkwICsgaTE7XG4gICAgICAgICAgICAgICAgaW5kZXggKz0gaTEgKiB3aWR0aDtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHNpZ24gPSB0aGlzLmRlY29kZVNpZ25CaXQoaSwgaiwgaW5kZXgpO1xuICAgICAgICAgICAgICBjb2VmZmljZW50c1NpZ25baW5kZXhdID0gc2lnbjtcbiAgICAgICAgICAgICAgY29lZmZpY2VudHNNYWduaXR1ZGVbaW5kZXhdID0gMTtcbiAgICAgICAgICAgICAgdGhpcy5zZXROZWlnaGJvcnNTaWduaWZpY2FuY2UoaSwgaiwgaW5kZXgpO1xuICAgICAgICAgICAgICBwcm9jZXNzaW5nRmxhZ3NbaW5kZXhdIHw9IGZpcnN0TWFnbml0dWRlQml0TWFzaztcblxuICAgICAgICAgICAgICBpbmRleCA9IGluZGV4MDtcbiAgICAgICAgICAgICAgZm9yICh2YXIgaTIgPSBpMDsgaTIgPD0gaTsgaTIrKywgaW5kZXggKz0gd2lkdGgpIHtcbiAgICAgICAgICAgICAgICBiaXRzRGVjb2RlZFtpbmRleF0rKztcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGkxKys7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmb3IgKGkgPSBpMCArIGkxOyBpIDwgaU5leHQ7IGkrKywgaW5kZXggKz0gd2lkdGgpIHtcbiAgICAgICAgICAgICAgaWYgKGNvZWZmaWNlbnRzTWFnbml0dWRlW2luZGV4XSB8fFxuICAgICAgICAgICAgICAgIChwcm9jZXNzaW5nRmxhZ3NbaW5kZXhdICYgcHJvY2Vzc2VkTWFzaykgIT09IDApIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHZhciBjb250ZXh0TGFiZWwgPSBsYWJlbHNbbmVpZ2hib3JzU2lnbmlmaWNhbmNlW2luZGV4XV07XG4gICAgICAgICAgICAgIHZhciBkZWNpc2lvbiA9IGRlY29kZXIucmVhZEJpdChjb250ZXh0cywgY29udGV4dExhYmVsKTtcbiAgICAgICAgICAgICAgaWYgKGRlY2lzaW9uID09PSAxKSB7XG4gICAgICAgICAgICAgICAgc2lnbiA9IHRoaXMuZGVjb2RlU2lnbkJpdChpLCBqLCBpbmRleCk7XG4gICAgICAgICAgICAgICAgY29lZmZpY2VudHNTaWduW2luZGV4XSA9IHNpZ247XG4gICAgICAgICAgICAgICAgY29lZmZpY2VudHNNYWduaXR1ZGVbaW5kZXhdID0gMTtcbiAgICAgICAgICAgICAgICB0aGlzLnNldE5laWdoYm9yc1NpZ25pZmljYW5jZShpLCBqLCBpbmRleCk7XG4gICAgICAgICAgICAgICAgcHJvY2Vzc2luZ0ZsYWdzW2luZGV4XSB8PSBmaXJzdE1hZ25pdHVkZUJpdE1hc2s7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgYml0c0RlY29kZWRbaW5kZXhdKys7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgY2hlY2tTZWdtZW50YXRpb25TeW1ib2w6IGZ1bmN0aW9uIEJpdE1vZGVsX2NoZWNrU2VnbWVudGF0aW9uU3ltYm9sKCkge1xuICAgICAgICB2YXIgZGVjb2RlciA9IHRoaXMuZGVjb2RlcjtcbiAgICAgICAgdmFyIGNvbnRleHRzID0gdGhpcy5jb250ZXh0cztcbiAgICAgICAgdmFyIHN5bWJvbCA9IChkZWNvZGVyLnJlYWRCaXQoY29udGV4dHMsIFVOSUZPUk1fQ09OVEVYVCkgPDwgMykgfFxuICAgICAgICAgICAgICAgICAgICAgKGRlY29kZXIucmVhZEJpdChjb250ZXh0cywgVU5JRk9STV9DT05URVhUKSA8PCAyKSB8XG4gICAgICAgICAgICAgICAgICAgICAoZGVjb2Rlci5yZWFkQml0KGNvbnRleHRzLCBVTklGT1JNX0NPTlRFWFQpIDw8IDEpIHxcbiAgICAgICAgICAgICAgICAgICAgICBkZWNvZGVyLnJlYWRCaXQoY29udGV4dHMsIFVOSUZPUk1fQ09OVEVYVCk7XG4gICAgICAgIGlmIChzeW1ib2wgIT09IDB4QSkge1xuICAgICAgICAgI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2h0ID0gMSwgd2hlbiB2MCBldmVuIGtlZXAgaXRlbXMgYXMgaXMsIHdoZW4gb2RkIGRpdmlkZSBieSAyXG4gICAgICAgIGlmICgodjAgJiAxKSAhPT0gMCkge1xuICAgICAgICAgIGZvciAodSA9IDA7IHUgPCB3aWR0aDsgdSsrKSB7XG4gICAgICAgICAgICBpdGVtc1t1XSAqPSAwLjU7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBmb3IgKHUgPSAwOyB1IDwgd2lkdGg7IHUrKykge1xuICAgICAgICAgIC8vIGlmIHdlIHJhbiBvdXQgb2YgYnVmZmVycywgY29weSBzZXZlcmFsIGltYWdlIGNvbHVtbnMgYXQgb25jZVxuICAgICAgICAgIGlmIChjdXJyZW50QnVmZmVyID09PSAwKSB7XG4gICAgICAgICAgICBudW1CdWZmZXJzID0gTWF0aC5taW4od2lkdGggLSB1LCBudW1CdWZmZXJzKTtcbiAgICAgICAgICAgIGZvciAoayA9IHUsIGwgPSBidWZmZXJQYWRkaW5nOyBsIDwgbGw7IGsgKz0gd2lkdGgsIGwrKykge1xuICAgICAgICAgICAgICBmb3IgKGIgPSAwOyBiIDwgbnVtQnVmZmVyczsgYisrKSB7XG4gICAgICAgICAgICAgICAgY29sQnVmZmVyc1tiXVtsXSA9IGl0ZW1zW2sgKyBiXTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY3VycmVudEJ1ZmZlciA9IG51bUJ1ZmZlcnM7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgY3VycmVudEJ1ZmZlci0tO1xuICAgICAgICAgIHZhciBidWZmZXIgPSBjb2xCdWZmZXJzW2N1cnJlbnRCdWZmZXJdO1xuICAgICAgICAgIHRoaXMuZXh0ZW5kKGJ1ZmZlciwgYnVmZmVyUGFkZGluZywgaGVpZ2h0KTtcbiAgICAgICAgICB0aGlzLmZpbHRlcihidWZmZXIsIGJ1ZmZlclBhZG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AgIHhbal0gPSBLICogeFtqXSAtIGN1cnJlbnQgLSBuZXh0O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIC8vIHN0ZXAgNFxuICAgICAgaiA9IG9mZnNldCAtIDE7XG4gICAgICBjdXJyZW50ID0gZ2FtbWEgKiB4W2ogLSAxXTtcbiAgICAgIGZvciAobiA9IGxlbiArIDI7IG4tLTsgaiArPSAyKSB7XG4gICAgICAgIG5leHQgPSBnYW1tYSAqIHhbaiArIDFdO1xuICAgICAgICB4W2pdIC09IGN1cnJlbnQgKyBuZXh0O1xuICAgICAgICBpZiAobi0tKSB7XG4gICAgICAgICAgaiArPSAyO1xuICAgICAgICAgIGN1cnJlbnQgPSBnYW1tYSAqIHhbaiArIDFdO1xuICAgICAgICAgIHhbal0gLT0gY3VycmVudCArIG5leHQ7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgLy8gc3RlcCA1XG4gICAgICBqID0gb2Zmc2V0O1xuICAgICAgY3VycmVudCA9IGJldGEgKiB4W2ogLSAxXTtcbiAgICAgIGZvciAobiA9IGxlbiArIDE7IG4tLTsgaiArPSAyKSB7XG4gICAgICAgIG5leHQgPSBiZXRhICogeFtqICsgMV07XG4gICAgICAgIHhbal0gLT0gY3VycmVudCArIG5leHQ7XG4gICAgICAgIGlmIChuLS0pIHtcbiAgICAgICAgICBqICs9IDI7XG4gICAgICAgICAgY3VycmVudCA9IGJldGEgKiB4W2ogKyAxXTtcbiAgICAgICAgICB4W2pdIC09IGN1cnJlbnQgKyBuZXh0O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIC8vIHN0ZXAgNlxuICAgICAgaWYgKGxlbiAhPT0gMCkge1xuICAgICAgICBqID0gb2Zmc2V0ICsgMTt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1xuICAgICAgICAgIGQgPSBjeF9tcHM7XG4gICAgICAgICAgY3hfaW5kZXggPSBxZVRhYmxlSWN4Lm5tcHM7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgYSA9IHFlSWN4O1xuICAgICAgICAgIGQgPSAxIF4gY3hfbXBzO1xuICAgICAgICAgIGlmIChxZVRhYmxlSWN4LnN3aXRjaEZsYWcgPT09IDEpIHtcbiAgICAgICAgICAgIGN4X21wcyA9IGQ7XG4gICAgICAgICAgfVxuICAgICAgICAgIGN4X2luZGV4ID0gcWVUYWJsZUljeC5ubHBzO1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB0aGlzLmNoaWdoIC09IHFlSWN4O1xuICAgICAgICBpZiAoKGEgJiAweDgwMDApICE9PSAwKSB7XG4gICAgICAgICAgdGhpcy5hID0gYTtcbiAgICAgICAgICByZXR1cm4gY3hfbXBzO1xuICAgICAgICB9XG4gICAgICAgIC8vIGV4Y2hhbmdlTXBzXG4gICAgICAgIGlmIChhIDwgcWVJY3gpIHtcbiAgICAgICAgICBkID0gMSBeIGN4X21wcztcbiAgICAgICAgICBpZiAocWVUYWJsZUljeC5zd2l0Y2hGbGFnID09PSAxKSB7XG4gICAgICAgICAgICBjeF9tcHMgPSBkO1xuICAgICAgICAgIH1cbiAgICAgICAgICBjeF9pbmRleCA9IHFlVGFibGVJY3gubmxwcztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBkID0gY3hfbXBzO1xuICAgICAgICAgIGN4X2luZGV4ID0gcWVUYWJsZUljeC5ubXBzO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICAvLyBDLjMuMyByZW5vcm1EO1xuICAgICAgZG8ge1xuICAgICAgICBpZiAodGhpcy5jdCA9PT0gMCkge1xuICAgICAgICAgIHRoaXMuYnl0ZUluKCk7XG4gICAgICAgIH1cblxuICAgICAgICBhIDw8PSAxO1xuICAgICAgICB0aGlzLmNoaWdoID0gKCh0aGlzLmNoaW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Qcm9taXNlLl9zdGF0dXM7XG4gICAgICAgIHZhciBuZXh0VmFsdWUgPSBoYW5kbGVyLnRoaXNQcm9taXNlLl92YWx1ZTtcblxuICAgICAgICB0cnkge1xuICAgICAgICAgIGlmIChuZXh0U3RhdHVzID09PSBTVEFUVVNfUkVTT0xWRUQpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgaGFuZGxlci5vblJlc29sdmUgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgICAgbmV4dFZhbHVlID0gaGFuZGxlci5vblJlc29sdmUobmV4dFZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiBoYW5kbGVyLm9uUmVqZWN0ID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICAgIG5leHRWYWx1ZSA9IGhhbmRsZXIub25SZWplY3QobmV4dFZhbHVlKTtcbiAgICAgICAgICAgICAgbmV4dFN0YXR1cyA9IFNUQVRVU19SRVNPTFZFRDtcblxuICAgICAgICAgICAgICBpZiAoaGFuZGxlci50aGlzUHJvbWlzZS5fdW5oYW5kbGVkUmVqZWN0aW9uKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5yZW1vdmVVbmhhbmRlbGVkUmVqZWN0aW9uKGhhbmRsZXIudGhpc1Byb21pc2UpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9IGNhdGNoIChleCkge1xuICAgICAgICAgIG5leHRTdGF0dXMgPSBTVEFUVVNfUkVKRUNURUQ7XG4gICAgICAgICAgbmV4dFZhbHVlID0gZXg7XG4gICAgICAgIH1cblxuICAgICAgICBoYW5kbGVyLm5leHRQcm9taXNlLl91cGRhdGVTdGF0dXMobmV4dFN0YXR1cywgbmV4dFZhbHVlKTtcbiAgICAgICAgaWYgKERhdGUubm93KCkgPj0gdGltZW91dEF0KSB7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAga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RkZNQU5fT05MWSAgICAgICAgPSAyO1xudmFyIFpfUkxFICAgICAgICAgICAgICAgICA9IDM7XG52YXIgWl9GSVhFRCAgICAgICAgICAgICAgID0gNDtcbnZhciBaX0RFRkFVTFRfU1RSQVRFR1kgICAgPSAwO1xuXG4vKiBQb3NzaWJsZSB2YWx1ZXMgb2YgdGhlIGRhdGFfdHlwZSBmaWVsZCAodGhvdWdoIHNlZSBpbmZsYXRlKCkpICovXG4vL3ZhciBaX0JJTkFSWSAgICAgICAgICAgICAgPSAwO1xuLy92YXIgWl9URVhUICAgICAgICAgICAgICAgID0gMTtcbi8vdmFyIFpfQVNDSUkgICAgICAgICAgICAgICA9IDE7IC8vID0gWl9URVhUXG52YXIgWl9VTktOT1dOICAgICAgICAgICAgID0gMjtcblxuXG4vKiBUaGUgZGVmbGF0ZSBjb21wcmVzc2lvbiBtZXRob2QgKi9cbnZhciBaX0RFRkxBVEVEICA9IDg7XG5cbi8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG5cblxudmFyIE1BWF9NRU1fTEVWRUwgPSA5O1xuLyogTWF4aW11bSB2YWx1ZSBmb3IgbWVtTGV2ZWwgaW4gZGVmbGF0ZUluaXQyICovXG52YXIgTUFYX1dCSVRTID0gMTU7XG4vKiAzMksgTFo3NyB3aW5kb3cgKi9cbnZhciBERUZfTUVNX0xFVkVMID0gODtcblxuXG52YXIgTEVOR1RIX0NPREVTICA9IDI5O1xuLyogbnVtYmVyIG9mIGxlbmd0aCBjb2Rlcywgbm90IGNvdW50aW5nIHRoZSBzcGVjaWFsIEVORF9CTE9DSyBjb2RlICovXG52YXIgTElURVJBTFMgICAgICA9IDI1Njtcbi8qIG51bWJlciBvZiBsaXRlcmFsIGJ5dGVzIDAuLjI1NSAqL1xudmFyIExfQ09ERVMgICAgICAgPSBMSVRFUkFMUyArIDEgKyBMRU5HVEhfQ09ERVM7XG4vKiBud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dID09PSBfd2luWysrbWF0Y2hdICYmIF93aW5bKytzY2FuXSA9PT0gX3dpblsrK21hdGNoXSAmJlxuICAgICAgICAgICAgIF93aW5bKytzY2FuXSA9PT0gX3dpblsrK21hdGNoXSAmJiBfd2luWysrc2Nhbl0gPT09IF93aW5bKyttYXRjaF0gJiZcbiAgICAgICAgICAgICBzY2FuIDwgc3RyZW5kKTtcblxuICAgIC8vIEFzc2VydChzY2FuIDw9IHMtPndpbmRvdysodW5zaWduZWQpKHMtPndpbmRvd19zaXplLTEpLCBcIndpbGQgc2NhblwiKTtcblxuICAgIGxlbiA9IE1BWF9NQVRDSCAtIChzdHJlbmQgLSBzY2FuKTtcbiAgICBzY2FuID0gc3RyZW5kIC0gTUFYX01BVENIO1xuXG4gICAgaWYgKGxlbiA+IGJlc3RfbGVuKSB7XG4gICAgICBzLm1hdGNoX3N0YXJ0ID0gY3VyX21hdGNoO1xuICAgICAgYmVzdF9sZW4gPSBsZW47XG4gICAgICBpZiAobGVuID49IG5pY2VfbWF0Y2gpIHtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICBzY2FuX2VuZDEgID0gX3dpbltzY2FuICsgYmVzdF9sZW4gLSAxXTtcbiAgICAgIHNjYW5fZW5kICAgPSBfd2luW3NjYW4gKyBiZXN0X2xlbl07XG4gICAgfVxuICB9IHdoaWxlICgoY3VyX21hdGNoID0gcHJldltjdXJfbWF0Y2ggJiB3bWFza10pID4gbGltaXQgJiYgLS1jaGFpbl9sZW5ndGggIT09IDApO1xuXG4gIGlmIChiZXN0X2xlbiA8PSBzLmxvb2thaGVhZCkge1xuICAgIHJldHVybiBiZXN0X2xlbjtcbiAgfVxuICByZXR1cm4gcy5sb29rYWhlYWQ7XG59XG5cblxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBGaWxsIHRoZSB3aW5kb3cgd2hlbiB0aGUgbG9va2Fo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2xkX2ZsdXNoID0gcy5sYXN0X2ZsdXNoO1xuICBzLmxhc3RfZmx1c2ggPSBmbHVzaDtcblxuICAvKiBXcml0ZSB0aGUgaGVhZGVyICovXG4gIGlmIChzLnN0YXR1cyA9PT0gSU5JVF9TVEFURSkge1xuXG4gICAgaWYgKHMud3JhcCA9PT0gMikgeyAvLyBHWklQIGhlYWRlclxuICAgICAgc3RybS5hZGxlciA9IDA7ICAvL2NyYzMyKDBMLCBaX05VTEwsIDApO1xuICAgICAgcHV0X2J5dGUocywgMzEpO1xuICAgICAgcHV0X2J5dGUocywgMTM5KTtcbiAgICAgIHB1dF9ieXRlKHMsIDgpO1xuICAgICAgaWYgKCFzLmd6aGVhZCkgeyAvLyBzLT5nemhlYWQgPT0gWl9OVUxMXG4gICAgICAgIHB1dF9ieXRlKHMsIDApO1xuICAgICAgICBwdXRfYnl0ZShzLCAwKTtcbiAgICAgICAgcHV0X2J5dGUocywgMCk7XG4gICAgICAgIHB1dF9ieXRlKHMsIDApO1xuICAgICAgICBwdXRfYnl0ZShzLCAwKTtcbiAgICAgICAgcHV0X2J5dGUocywgcy5sZXZlbCA9PT0gOSA/IDIgOlxuICAgICAgICAgICAgICAgICAgICAocy5zdHJhdGVneSA+PSBaX0hVRkZNQU5fT05MWSB8fCBzLmxldmVsIDwgMiA/XG4gICAgICAgICAgICAgICAgICAgICA0IDogMCkpO1xuICAgICAgICBwdXRfYnl0ZShzLCBPU19DT0RFKTtcbiAgICAgICAgcy5zdGF0dXMgPSBCVVNZX1NUQVRFO1xuICAgICAgfVxuICAgICAgZWxzZSB7XG4gICAgICAgIHB1dF9ieXRlKHMsIChzLmd6aGVhZC50ZXh0ID8gMSA6IDApICtcbiAgICAgICAgICAgICAgICAgICAgKHMuZ3poZWFkLmhjcmMgPyAyIDogMCkgK1xuICAgICAgICAgICAgICAgICAgICAoIXMuZ3poZWFkLmV4dHJhID8gMCA6IDQpICtcbiAgICAgICAgICAgICAgICAgICAgKCFzLmd6aGVhZC5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RlO1xuICB2YXIgX2luOyAgICAgICAgICAgICAgICAgICAgLyogbG9jYWwgc3RybS5pbnB1dCAqL1xuICB2YXIgbGFzdDsgICAgICAgICAgICAgICAgICAgLyogaGF2ZSBlbm91Z2ggaW5wdXQgd2hpbGUgaW4gPCBsYXN0ICovXG4gIHZhciBfb3V0OyAgICAgICAgICAgICAgICAgICAvKiBsb2NhbCBzdHJtLm91dHB1dCAqL1xuICB2YXIgYmVnOyAgICAgICAgICAgICAgICAgICAgLyogaW5mbGF0ZSgpJ3MgaW5pdGlhbCBzdHJtLm91dHB1dCAqL1xuICB2YXIgZW5kOyAgICAgICAgICAgICAgICAgICAgLyogd2hpbGUgb3V0IDwgZW5kLCBlbm91Z2ggc3BhY2UgYXZhaWxhYmxlICovXG4vLyNpZmRlZiBJTkZMQVRFX1NUUklDVFxuICB2YXIgZG1heDsgICAgICAgICAgICAgICAgICAgLyogbWF4aW11bSBkaXN0YW5jZSBmcm9tIHpsaWIgaGVhZGVyICovXG4vLyNlbmRpZlxuICB2YXIgd3NpemU7ICAgICAgICAgICAgICAgICAgLyogd2luZG93IHNpemUgb3IgemVybyBpZiBub3QgdXNpbmcgd2luZG93ICovXG4gIHZhciB3aGF2ZTsgICAgICAgICAgICAgICAgICAvKiB2YWxpZCBieXRlcyBpbiB0aGUgd2luZG93ICovXG4gIHZhciB3bmV4dDsgICAgICAgICAgICAgICAgICAvKiB3aW5kb3cgd3JpdGUgaW5kZXggKi9cbiAgLy8gVXNlIGBzX3dpbmRvd2AgaW5zdGVhZCBgd2luZG93YCwgYXZvaWQgY29uZmxpY3Qgd2l0aCBpbnN0cnVtZW50YXRpb24gdG9vbHNcbiAgdmFyIHNfd2luZG93OyAgICAgICAgICAgICAgIC8qIGFsbG9jYXRlZCBzbGlkaW5nIHdpbmRvdywgaWYgd3NpemUgIT0gMCAqL1xuICB2YXIgaG9sZDsgICAgICAgICAgICAgICAgICAgLyogbG9jYWwgc3RybS5ob2xkICovXG4gIHZhciBiaXRzO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gPDwgYml0cztcbiAgICAgIGJpdHMgKz0gODtcbiAgICB9XG5cbiAgICBoZXJlID0gbGNvZGVbaG9sZCAmIGxtYXNrXTtcblxuICAgIGRvbGVuOlxuICAgIGZvciAoOzspIHsgLy8gR290byBlbXVsYXRpb25cbiAgICAgIG9wID0gaGVyZSA+Pj4gMjQvKmhlcmUuYml0cyovO1xuICAgICAgaG9sZCA+Pj49IG9wO1xuICAgICAgYml0cyAtPSBvcDtcbiAgICAgIG9wID0gKGhlcmUgPj4+IDE2KSAmIDB4ZmYvKmhlcmUub3AqLztcbiAgICAgIGlmIChvcCA9PT0gMCkgeyAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbGl0ZXJhbCAqL1xuICAgICAgICAvL1RyYWNldnYoKHN0ZGVyciwgaGVyZS52YWwgPj0gMHgyMCAmJiBoZXJlLnZhbCA8IDB4N2YgP1xuICAgICAgICAvLyAgICAgICAgXCJpbmZsYXRlOiAgICAgICAgIGxpdGVyYWwgJyVjJ1xcblwiIDpcbiAgICAgICAgLy8gICAgICAgIFwiaW5mbGF0ZTogICAgICAgICBsaXRlcmFsIDB4JTAyeFxcblwiLCBoZXJlLnZhbCkpO1xuICAgICAgICBvdXRwdXRbX291dCsrXSA9IGhlcmUgJiAweGZmZmYvKmhlcmUudmFsKi87XG4gICAgICB9XG4gICAgICBlbHNlIGlmIChvcCAmIDE2KSB7ICAgICAgICAgICAgICAgICAgICAgLyogbGVuZ3RoIGJhc2UgKi9cbiAgICAgICAgbGVuID0gaGVyZSAmIDB4ZmZmZi8qaGVyZS52YWwqLztcbiAgICAgICAgb3AgJj0gMTU7ICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbnVtYmVyIG9mIGV4dHJhIGJpdHMgKi9cbiAgICAgICAgaWYgKG9wKSB7XG4gICAgICAgICAgaWYgKGJpdHMgPCBvcCkge1xuICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtfaW4rK10gPDwgYml0cztcbiAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICB9XG4gICAgICAgICAgbGVuICs9IGhvbGQgJiAoKDEgPDwgb3ApIC0gMSk7XG4gICAgICAgICAgaG9sZCA+Pj49IG9wO1xuICAgICAgICAgIGJpdHMgLT0gb3A7XG4gICAgICAgIH1cbiAgICAgICAgLy9UcmFjZXZ2KChzdGRlcnIsIFwiaW5mbGF0ZTogICAgICAgICBsZW5ndGggJXVcXG5cIiwgbGVuKSk7XG4gICAgICAgIGlmIChiaXRzIDwgMTUpIHtcbiAgICAgICAgICBob2xkICs9IGlucHV0W19pbisrXSA8PCBiaXRzO1xuICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICBob2xkICs9IGlucHV0W19pbisrXSA8PCBiaXRzO1xuICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgfVxuICAgICAgICBoZXJlID0gZGNvZGVbaG9sZCAmIGRtYXNrXTtcblxuICAgICAgICBkb2Rpc3Q6XG4gICAgICAgIGZvciAoOzspIHsgLy8gZ290byBlbXVsYXRpb25cbiAgICAgICAgICBvcCA9IGhlcmUgPj4+IDI0LypoZXJlLmJpdHMqLztcbiAgICAgICAgICBob2xkID4+Pj0gb3A7XG4gICAgICAgICAgYml0cyAtPSBvcDtcbiAgICAgICAgICBvcCA9IChoZXJlID4+PiAxNikgJiAweGZmLypoZXJlLm9wKi87XG5cbiAgICAgICAgICBpZiAob3AgJiAxNikgeyAgICAgICAgICAgICAgICAgICAgICAvKiBkaXN0YW5jZSBiYXNlICovXG4gICAgICAgICAgICBkaXN0ID0gaGVyZSAmIDB4ZmZmZi8qaGVyZS52YWwqLztcbiAgICAgICAgICAgIG9wICY9IDE1OyAgICAgICAgICAgICAgICAgICAgICAgLyogbnVtYmVyIG9mIGV4dHJhIGJpdHMgKi9cbiAgICAgICAgICAgIGlmIChiaXRzIDwgb3ApIHtcbiAgICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtfaW4rK10gPDwgYml0cztcbiAgICAgICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICAgICAgICBpZiAoYml0cyA8IG9wKSB7XG4gICAgICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtfaW4rK10gPDwgYml0cztcbiAgICAgICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRpc3QgKz0gaG9sZCAmICgoMSA8PCBvcCkgLSAxKTtcbi8vI2lmZGVmIElORkxBVEVfU1RSSUNUXG4gICAgICAgICAgICBpZiAoZGlzdCA+IGRtYXgpIHtcbiAgICAgICAgICAgICAgc3RybS5tc2cgPSAnaW52YWxpZCBkaXN0YW5jZSB0b28gZmFyIGJhY2snO1xuICAgICAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgICAgICBicmVhayB0b3A7XG4gICAgICAgICAgICB9XG4vLyNlbmRpZlxuICAgICAgICAgICAgaG9sZCA+Pj49IG9wO1xuICAgICAgICAgICAgYml0cyAtPSBvcDtcbiAgICAgICAgICAgIC8vVHJhY2V2digoc3RkZXJyLCBcImluZmxhdGU6ICAgICAgICAgZGlzdGFuY2UgJXVcXG5cIiwgZGlzdCkpO1xuICAgICAgICAgICAgb3AgPSBfb3V0IC0gYmVnOyAgICAgICAgICAgICAgICAvKiBtYXggZGlzdGFuY2UgaW4gb3V0cHV0ICovXG4gICAgICAgICAgICBpZiAoZGlzdCA+IG9wKSB7ICAgICAgICAgICAgICAgIC8qIHNlZSBpZiBjb3B5IGZyb20gd2luZG93ICovXG4gICAgICAgICAgICAgIG9wID0gZGlzdCAtIG9wOyAgICAgICAgICAgICAgIC8qIGRpc3RhbmNlIGJhY2sgaW4gd2luZG93ICovXG4gICAgICAgICAgICAgIGlmIChvcCA+IHdoYXZlKSB7XG4gICAgICAgICAgICAgICAgaWYgKHN0YXRlLnNhbmUpIHtcbiAgICAgICAgICAgICAgICAgIHN0cm0ubXNnID0gJ2ludmFsaWQgZGlzdGFuY2UgdG9vIGZhciBiYWNrJztcbiAgICAgICAgICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgICAgICAgICBicmVhayB0b3A7XG4gICAgICAgICAgICAgICAgfVxuXG4vLyAoISkgVGhpcyBibG9jayBpcyBkaXNhYmxlZCBpbiB6bGliIGRlZmFpbHRzLFxuLy8gZG9uJ3QgZW5hYmxlIGl0IGZvciBiaW5hcnkgY29tcGF0aWJpbGl0eVxuLy8jaWZkZWYgSU5GTEFURV9BTExPV19JTlZBTElEX0RJU1RBTkNFX1RPT0ZBUl9BUlJSXG4vLyAgICAgICAgICAgICAgICBpZiAobGVuIDw9IG9wIC0gd2hhdmUpIHtcbi8vICAgICAgICAgICAgICAgICAgZG8ge1xuLy8gICAgICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gMDtcbi8vICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoLS1sZW4pO1xuLy8gICAgICAgICAgICAgICAgICBjb250aW51ZSB0b3A7XG4vLyAgICAgICAgICAgICAgICB9XG4vLyAgICAgICAgICAgICAgICBsZW4gLT0gb3AgLSB3aGF2ZTtcbi8vICAgICAgICAgICAgICAgIGRvIHtcbi8vICAgICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSAwO1xuLy8gICAgICAgICAgICAgICAgfSB3aGlsZSAoLS1vcCA+IHdoYXZlKTtcbi8vICAgICAgICAgICAgICAgIGlmIChvcCA9PT0gMCkge1xuLy8gICAgICAgICAgICAgICAgICBmcm9tID0gX291dCAtIGRpc3Q7XG4vLyAgICAgICAgICAgICAgICAgIGRvIHtcbi8vICAgICAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IG91dHB1dFtmcm9tKytdO1xuLy8gICAgICAgICAgICAgICAgICB9IHdoaWxlICgtLWxlbik7XG4vLyAgICAgICAgICAgICAgICAgIGNvbnRpbnVlIHRvcDtcbi8vICAgICAgICAgICAgICAgIH1cbi8vI2VuZGlmXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgZnJvbSA9IDA7IC8vIHdpbmRvdyBpbmRleFxuICAgICAgICAgICAgICBmcm9tX3NvdXJjZSA9IHNfd2luZG93O1xuICAgICAgICAgICAgICBpZiAod25leHQgPT09IDApIHsgICAgICAgICAgIC8qIHZlcnkgY29tbW9uIGNhc2UgKi9cbiAgICAgICAgICAgICAgICBmcm9tICs9IHdzaXplIC0gb3A7XG4gICAgICAgICAgICAgICAgaWYgKG9wIDwgbGVuKSB7ICAgICAgICAgLyogc29tZSBmcm9tIHdpbmRvdyAqL1xuICAgICAgICAgICAgICAgICAgbGVuIC09IG9wO1xuICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IHNfd2luZG93W2Zyb20rK107XG4gICAgICAgICAgICAgICAgICB9IHdoaWxlICgtLW9wKTtcbiAgICAgICAgICAgICAgICAgIGZyb20gPSBfb3V0IC0gZGlzdDsgIC8qIHJlc3QgZnJvbSBvdXRwdXQgKi9cbiAgICAgICAgICAgICAgICAgIGZyb21fc291cmNlID0gb3V0cHV0O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBlbHNlIGlmICh3bmV4dCA8IG9wKSB7ICAgICAgLyogd3JhcCBhcm91bmQgd2luZG93ICovXG4gICAgICAgICAgICAgICAgZnJvbSArPSB3c2l6ZSArIHduZXh0IC0gb3A7XG4gICAgICAgICAgICAgICAgb3AgLT0gd25leHQ7XG4gICAgICAgICAgICAgICAgaWYgKG9wIDwgbGVuKSB7ICAgICAgICAgLyogc29tZSBmcm9tIGVuZCBvZiB3aW5kb3cgKi9cbiAgICAgICAgICAgICAgICAgIGxlbiAtPSBvcDtcbiAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBzX3dpbmRvd1tmcm9tKytdO1xuICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoLS1vcCk7XG4gICAgICAgICAgICAgICAgICBmcm9tID0gMDtcbiAgICAgICAgICAgICAgICAgIGlmICh3bmV4dCA8IGxlbikgeyAgLyogc29tZSBmcm9tIHN0YXJ0IG9mIHdpbmRvdyAqL1xuICAgICAgICAgICAgICAgICAgICBvcCA9IHduZXh0O1xuICAgICAgICAgICAgICAgICAgICBsZW4gLT0gb3A7XG4gICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IHNfd2luZG93W2Zyb20rK107XG4gICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKC0tb3ApO1xuICAgICAgICAgICAgICAgICAgICBmcm9tID0gX291dCAtIGRpc3Q7ICAgICAgLyogcmVzdCBmcm9tIG91dHB1dCAqL1xuICAgICAgICAgICAgICAgICAgICBmcm9tX3NvdXJjZSA9IG91dHB1dDtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgZWxzZSB7ICAgICAgICAgICAgICAgICAgICAgIC8qIGNvbnRpZ3VvdXMgaW4gd2luZG93ICovXG4gICAgICAgICAgICAgICAgZnJvbSArPSB3bmV4dCAtIG9wO1xuICAgICAgICAgICAgICAgIGlmIChvcCA8IGxlbikgeyAgICAgICAgIC8qIHNvbWUgZnJvbSB3aW5kb3cgKi9cbiAgICAgICAgICAgICAgICAgIGxlbiAtPSBvcDtcbiAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBzX3dpbmRvd1tmcm9tKytdO1xuICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoLS1vcCk7XG4gICAgICAgICAgICAgICAgICBmcm9tID0gX291dCAtIGRpc3Q7ICAvKiByZXN0IGZyb20gb3V0cHV0ICovXG4gICAgICAgICAgICAgICAgICBmcm9tX3NvdXJjZSA9IG91dHB1dDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgd2hpbGUgKGxlbiA+IDIpIHtcbiAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IGZyb21fc291cmNlW2Zyb20rK107XG4gICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBmcm9tX3NvdXJjZVtmcm9tKytdO1xuICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gZnJvbV9zb3VyY2VbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICBsZW4gLT0gMztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAobGVuKSB7XG4gICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBmcm9tX3NvdXJjZVtmcm9tKytdO1xuICAgICAgICAgICAgICAgIGlmIChsZW4gPiAxKSB7XG4gICAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IGZyb21fc291cmNlW2Zyb20rK107XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgZnJvbSA9IF9vdXQgLSBkaXN0OyAgICAgICAgICAvKiBjb3B5IGRpcmVjdCBmcm9tIG91dHB1dCAqL1xuICAgICAgICAgICAgICBkbyB7ICAgICAgICAgICAgICAgICAgICAgICAgLyogbWluaW11bSBsZW5ndGggaXMgdGhyZWUgKi9cbiAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IG91dHB1dFtmcm9tKytdO1xuICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gb3V0cHV0W2Zyb20rK107XG4gICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBvdXRwdXRbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICBsZW4gLT0gMztcbiAgICAgICAgICAgICAgfSB3aGlsZSAobGVuID4gMik7XG4gICAgICAgICAgICAgIGlmIChsZW4pIHtcbiAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IG91dHB1dFtmcm9tKytdO1xuICAgICAgICAgICAgICAgIGlmIChsZW4gPiAxKSB7XG4gICAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IG91dHB1dFtmcm9tKytdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBlbHNlIGlmICgob3AgJiA2NCkgPT09IDApIHsgICAgICAgICAgLyogMm5kIGxldmVsIGRpc3RhbmNlIGNvZGUgKi9cbiAgICAgICAgICAgIGhlcmUgPSBkY29kZVsoaGVyZSAmIDB4ZmZmZikvKmhlcmUudmFsKi8gKyAoaG9sZCAmICgoMSA8PCBvcCkgLSAxKSldO1xuICAgICAgICAgICAgY29udGludWUgZG9kaXN0O1xuICAgICAgICAgIH1cbiAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHN0cm0ubXNnID0gJ2ludmFsaWQgZGlzdGFuY2UgY29kZSc7XG4gICAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgICAgYnJlYWsgdG9wO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGJyZWFrOyAvLyBuZWVkIHRvIGVtdWxhdGUgZ290byB2aWEgXCJjb250aW51ZVwiXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGVsc2UgaWYgKChvcCAmIDY0KSA9PT0gMCkgeyAgICAgICAgICAgICAgLyogMm5kIGxldmVsIGxlbmd0aCBjb2RlICovXG4gICAgICAgIGhlcmUgPSBsY29kZVsoaGVyZSAmIDB4ZmZmZikvKmhlcmUudmFsKi8gKyAoaG9sZCAmICgoMSA8PCBvcCkgLSAxKSldO1xuICAgICAgICBjb250aW51ZSBkb2xlbjtcbiAgICAgIH1cbiAgICAgIGVsc2UgaWYgKG9wICYgMzIpIHsgICAgICAgICAgICAgICAgICAgICAvKiBlbmQtb2YtYmxvY2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GV2ZW50cy5cbiAqL1xudmFyIFpfT0sgICAgICAgICAgICA9IDA7XG52YXIgWl9TVFJFQU1fRU5EICAgID0gMTtcbnZhciBaX05FRURfRElDVCAgICAgPSAyO1xuLy92YXIgWl9FUlJOTyAgICAgICAgID0gLTE7XG52YXIgWl9TVFJFQU1fRVJST1IgID0gLTI7XG52YXIgWl9EQVRBX0VSUk9SICAgID0gLTM7XG52YXIgWl9NRU1fRVJST1IgICAgID0gLTQ7XG52YXIgWl9CVUZfRVJST1IgICAgID0gLTU7XG4vL3ZhciBaX1ZFUlNJT05fRVJST1IgPSAtNjtcblxuLyogVGhlIGRlZmxhdGUgY29tcHJlc3Npb24gbWV0aG9kICovXG52YXIgWl9ERUZMQVRFRCAgPSA4O1xuXG5cbi8qIFNUQVRFUyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuXG5cbnZhciAgICBIRUFEID0gMTsgICAgICAgLyogaTogd2FpdGluZyBmb3IgbWFnaWMgaGVhZGVyICovXG52YXIgICAgRkxBR1MgPSAyOyAgICAgIC8qIGk6IHdhaXRpbmcgZm9yIG1ldGhvZCBhbmQgZmxhZ3MgKGd6aXApICovXG52YXIgICAgVElNRSA9IDM7ICAgICAgIC8qIGk6IHdhaXRpbmcgZm9yIG1vZGlmaWNhdGlvbiB0aW1lIChnemlwKSAqL1xudmFyICAgIE9TID0gNDsgICAgICAgICAvKiBpOiB3YWl0aW5nIGZvciBleHRyYSBmbGFncyBhbmQgb3BlcmF0aW5nIHN5c3RlbSAoZ3ppcCkgKi9cbnZhciAgICBFWExFTiA9IDU7ICAgICAgLyogaTogd2FpdGluZyBmb3IgZXh0cmEgbGVuZ3RoIChnemlwKSAqL1xudmFyICAgIEVYVFJBID0gNjsgICAgICAv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0ZS5jaGVjayA9IGNyYzMyKHN0YXRlLmNoZWNrLCBoYnVmLCAyLCAwKTtcbiAgICAgICAgLy89PT0vL1xuICAgICAgfVxuICAgICAgLy89PT0gSU5JVEJJVFMoKTtcbiAgICAgIGhvbGQgPSAwO1xuICAgICAgYml0cyA9IDA7XG4gICAgICAvLz09PS8vXG4gICAgICBzdGF0ZS5tb2RlID0gRVhMRU47XG4gICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgY2FzZSBFWExFTjpcbiAgICAgIGlmIChzdGF0ZS5mbGFncyAmIDB4MDQwMCkge1xuICAgICAgICAvLz09PSBORUVEQklUUygxNik7ICovXG4gICAgICAgIHdoaWxlIChiaXRzIDwgMTYpIHtcbiAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICB9XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgc3RhdGUubGVuZ3RoID0gaG9sZDtcbiAgICAgICAgaWYgKHN0YXRlLmhlYWQpIHtcbiAgICAgICAgICBzdGF0ZS5oZWFkLmV4dHJhX2xlbiA9IGhvbGQ7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHN0YXRlLmZsYWdzICYgMHgwMjAwKSB7XG4gICAgICAgICAgLy89PT0gQ1JDMihzdGF0ZS5jaGVjaywgaG9sZCk7XG4gICAgICAgICAgaGJ1ZlswXSA9IGhvbGQgJiAweGZmO1xuICAgICAgICAgIGhidWZbMV0gPSAoaG9sZCA+Pj4gOCkgJiAweGZmO1xuICAgICAgICAgIHN0YXRlLmNoZWNrID0gY3JjMzIoc3RhdGUuY2hlY2ssIGhidWYsIDIsIDApO1xuICAgICAgICAgIC8vPT09Ly9cbiAgICAgICAgfVxuICAgICAgICAvLz09PSBJTklUQklUUygpO1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ja1xuICAgICAgICAgICAgICBjb3B5LFxuICAgICAgICAgICAgICAvKmxlbiArIGNvcHkgPiBzdGF0ZS5oZWFkLmV4dHJhX21heCAtIGxlbiA/IHN0YXRlLmhlYWQuZXh0cmFfbWF4IDogY29weSwqL1xuICAgICAgICAgICAgICBsZW5cbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICAvL3ptZW1jcHkoc3RhdGUuaGVhZC5leHRyYSArIGxlbiwgbmV4dCxcbiAgICAgICAgICAgIC8vICAgICAgICBsZW4gKyBjb3B5ID4gc3RhdGUuaGVhZC5leHRyYV9tYXggP1xuICAgICAgICAgICAgLy8gICAgICAgIHN0YXRlLmhlYWQuZXh0cmFfbWF4IC0gbGVuIDogY29weSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChzdGF0ZS5mbGFncyAmIDB4MDIwMCkge1xuICAgICAgICAgICAgc3RhdGUuY2hlY2sgPSBjcmMzMihzdGF0ZS5jaGVjaywgaW5wdXQsIGNvcHksIG5leHQpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBoYXZlIC09IGNvcHk7XG4gICAgICAgICAgbmV4dCArPSBjb3B5O1xuICAgICAgICAgIHN0YXRlLmxlbmd0aCAtPSBjb3B5O1xuICAgICAgICB9XG4gICAgICAgIGlmIChzdGF0ZS5sZW5ndGgpIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICB9XG4gICAgICBzdGF0ZS5sZW5ndGggPSAwO1xuICAgICAgc3RhdGUubW9kZSA9IE5BTUU7XG4gICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgY2FzZSBOQU1FOlxuICAgICAgaWYgKHN0YXRlLmZsYWdzICYgMHgwODAwKSB7XG4gICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICBjb3B5ID0gMDtcbiAgICAgICAgZG8ge1xuICAgICAgICAgIC8vIFRPRE86IDIgb3IgMSBieXRlcz9cbiAgICAgICAgICBs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haztcbiAgICAgIH1cbiAgICAgIC8vPT09IE5FRURCSVRTKDMpOyAqL1xuICAgICAgd2hpbGUgKGJpdHMgPCAzKSB7XG4gICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICBoYXZlLS07XG4gICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICBiaXRzICs9IDg7XG4gICAgICB9XG4gICAgICAvLz09PS8vXG4gICAgICBzdGF0ZS5sYXN0ID0gKGhvbGQgJiAweDAxKS8qQklUUygxKSovO1xuICAgICAgLy8tLS0gRFJPUEJJVFMoMSkgLS0tLy9cbiAgICAgIGhvbGQgPj4+PSAxO1xuICAgICAgYml0cyAtPSAxO1xuICAgICAgLy8tLS0vL1xuXG4gICAgICBzd2l0Y2ggKChob2xkICYgMHgwMykvKkJJVFMoMikqLykge1xuICAgICAgY2FzZSAwOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogc3RvcmVkIGJsb2NrICovXG4gICAgICAgIC8vVHJhY2V2KChzdGRlcnIsIFwiaW5mbGF0ZTogICAgIHN0b3JlZCBibG9jayVzXFxuXCIsXG4gICAgICAgIC8vICAgICAgICBzdGF0ZS5sYXN0ID8gXCIgKGxhc3QpXCIgOiBcIlwiKSk7XG4gICAgICAgIHN0YXRlLm1vZGUgPSBTVE9SRUQ7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAxOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZml4ZWQgYmxvY2sgKi9cbiAgICAgICAgZml4ZWR0YWJsZXMoc3RhdGUpO1xuICAgICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgICBmaXhlZCBjb2RlcyBibG9jayVzXFxuXCIsXG4gICAgICAgIC8vICAgICAgICBzdGF0ZS5sYXN0ID8gXCIgKGxhc3QpXCIgOiBcIlwiKSk7XG4gICAgICAgIHN0YXRlLm1vZGUg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XRlLmxlbnNbc3RhdGUuaGF2ZSsrXSA9IGhlcmVfdmFsO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgIGlmIChoZXJlX3ZhbCA9PT0gMTYpIHtcbiAgICAgICAgICAgIC8vPT09IE5FRURCSVRTKGhlcmUuYml0cyArIDIpO1xuICAgICAgICAgICAgbiA9IGhlcmVfYml0cyArIDI7XG4gICAgICAgICAgICB3aGlsZSAoYml0cyA8IG4pIHtcbiAgICAgICAgICAgICAgaWYgKGhhdmUgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vPT09Ly9cbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKGhlcmUuYml0cykgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSBoZXJlX2JpdHM7XG4gICAgICAgICAgICBiaXRzIC09IGhlcmVfYml0cztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICAgIGlmIChzdGF0ZS5oYXZlID09PSAwKSB7XG4gICAgICAgICAgICAgIHN0cm0ubXNnID0gJ2ludmFsaWQgYml0IGxlbmd0aCByZXBlYXQnO1xuICAgICAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxlbiA9IHN0YXRlLmxlbnNbc3RhdGUuaGF2ZSAtIDFdO1xuICAgICAgICAgICAgY29weSA9IDMgKyAoaG9sZCAmIDB4MDMpOy8vQklUUygyKTtcbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKDIpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gMjtcbiAgICAgICAgICAgIGJpdHMgLT0gMjtcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICB9XG4gICAgICAgICAgZWxzZSBpZiAoaGVyZV92YWwgPT09IDE3KSB7XG4gICAgICAgICAgICAvLz09PSBORUVEQklUUyhoZXJlLmJpdHMgKyAzKTtcbiAgICAgICAgICAgIG4gPSBoZXJlX2JpdHMgKyAzO1xuICAgICAgICAgICAgd2hpbGUgKGJpdHMgPCBuKSB7XG4gICAgICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLz09PS8vXG4gICAgICAgICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gaGVyZV9iaXRzO1xuICAgICAgICAgICAgYml0cyAtPSBoZXJlX2JpdHM7XG4gICAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgICBsZW4gPSAwO1xuICAgICAgICAgICAgY29weSA9IDMgKyAoaG9sZCAmIDB4MDcpOy8vQklUUygzKTtcbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKDMpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gMztcbiAgICAgICAgICAgIGJpdHMgLT0gMztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICB9XG4gICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAvLz09PSBORUVEQklUUyhoZXJlLmJpdHMgKyA3KTtcbiAgICAgICAgICAgIG4gPSBoZXJlX2JpdHMgKyA3O1xuICAgICAgICAgICAgd2hpbGUgKGJpdHMgPCBuKSB7XG4gICAgICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLz09PS8vXG4gICAgICAgICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gaGVyZV9iaXRzO1xuICAgICAgICAgICAgYml0cyAtPSBoZXJlX2JpdHM7XG4gICAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgICBsZW4gPSAwO1xuICAgICAgICAgICAgY29weSA9IDExICsgKGhvbGQgJiAweDdmKTsvL0JJVFMoNyk7XG4gICAgICAgICAgICAvLy0tLSBEUk9QQklUUyg3KSAtLS0vL1xuICAgICAgICAgICAgaG9sZCA+Pj49IDc7XG4gICAgICAgICAgICBiaXRzIC09IDc7XG4gICAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChzdGF0ZS5oYXZlICsgY29weSA+IHN0YXRlLm5sZW4gKyBzdGF0ZS5uZGlzdCkge1xuICAgICAgICAgICAgc3RybS5tc2cgPSAnaW52YWxpZCBiaXQgbGVuZ3RoIHJlcGVhdCc7XG4gICAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICAgIHdoaWxlIChjb3B5LS0pIHtcbiAgICAgICAgICAgIHN0YXRlLmxlbnNbc3RhdGUuaGF2ZSsrXSA9IGxlbjtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgLyogaGFuZGxlIGVycm9yIGJyZWFrcyBpbiB3aGlsZSAqL1xuICAgICAgaWYgKHN0YXRlLm1vZGUgPT09IEJBRCkgeyBicmVhazsgfVxuXG4gICAgICAvKiBjaGVjayBmb3IgZW5kLW9mLWJsb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iaXRzID0gaGVyZV9iaXRzO1xuICAgICAgICBsYXN0X29wID0gaGVyZV9vcDtcbiAgICAgICAgbGFzdF92YWwgPSBoZXJlX3ZhbDtcbiAgICAgICAgZm9yICg7Oykge1xuICAgICAgICAgIGhlcmUgPSBzdGF0ZS5kaXN0Y29kZVtsYXN0X3ZhbCArXG4gICAgICAgICAgICAgICAgICAoKGhvbGQgJiAoKDEgPDwgKGxhc3RfYml0cyArIGxhc3Rfb3ApKSAtMSkpLypCSVRTKGxhc3QuYml0cyArIGxhc3Qub3ApKi8gPj4gbGFzdF9iaXRzKV07XG4gICAgICAgICAgaGVyZV9iaXRzID0gaGVyZSA+Pj4gMjQ7XG4gICAgICAgICAgaGVyZV9vcCA9IChoZXJlID4+PiAxNikgJiAweGZmO1xuICAgICAgICAgIGhlcmVfdmFsID0gaGVyZSAmIDB4ZmZmZjtcblxuICAgICAgICAgIGlmICgobGFzdF9iaXRzICsgaGVyZV9iaXRzKSA8PSBiaXRzKSB7IGJyZWFrOyB9XG4gICAgICAgICAgLy8tLS0gUFVMTEJZVEUoKSAtLS0vL1xuICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgLy8tLS0vL1xuICAgICAgICB9XG4gICAgICAgIC8vLS0tIERST1BCSVRTKGxhc3QuYml0cykgLS0tLy9cbiAgICAgICAgaG9sZCA+Pj49IGxhc3RfYml0cztcbiAgICAgICAgYml0cyAtPSBsYXN0X2JpdHM7XG4gICAgICAgIC8vLS0tLy9cbiAgICAgICAgc3RhdGUuYmFjayArPSBsYXN0X2JpdHM7XG4gICAgICB9XG4gICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICBob2xkID4+Pj0gaGVyZV9iaXRzO1x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Uud3JhcCAmJiBzdGF0ZS5mbGFncykge1xuICAgICAgICAvLz09PSBORUVEQklUUygzMik7XG4gICAgICAgIHdoaWxlIChiaXRzIDwgMzIpIHtcbiAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICB9XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgaWYgKGhvbGQgIT09IChzdGF0ZS50b3RhbCAmIDB4ZmZmZmZmZmYpKSB7XG4gICAgICAgICAgc3RybS5tc2cgPSAnaW5jb3JyZWN0IGxlbmd0aCBjaGVjayc7XG4gICAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICAvLz09PSBJTklUQklUUygpO1xuICAgICAgICBob2xkID0gMDtcbiAgICAgICAgYml0cyA9IDA7XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgLy9UcmFjZXYoKHN0ZGVyciwgXCJpbmZsYXRlOiAgIGxlbmd0aCBtYXRjaGVzIHRyYWlsZXJcXG5cIikpO1xuICAgICAgfVxuICAgICAgc3RhdGUubW9kZSA9IERPTkU7XG4gICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgY2FzZSBET05FOlxuICAgICAgcmV0ID0gWl9TVFJFQU1fRU5EO1xuICAgICAgYnJlYWsgaW5mX2xlYXZlO1xuICAgIGNhc2UgQkFEOlxuICAgICAgcmV0ID0gWl9EQVRBX0VSUk9SO1xuICAgICAgYnJlYWsgaW5mX2xlYXZlO1xuICAgIGNhc2UgTUVNOlxuICAgICAgcmV0dXJuIFpfTUVNX0VSUk9SO1xuICAgIGNhc2UgU1lOQzpcbiAgICAgIC8qIGZhbGxzIHRocm91Z2ggKi9cbiAgICBkZWZhdWx0Olxu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XJlID0gb3B0cy5oZXJlOyAvKiB0YWJsZSBlbnRyeSBmb3IgZHVwbGljYXRpb24gKi9cblxuICB2YXIgbGVuID0gMDsgICAgICAgICAgICAgICAvKiBhIGNvZGUncyBsZW5ndGggaW4gYml0cyAqL1xuICB2YXIgc3ltID0gMDsgICAgICAgICAgICAgICAvKiBpbmRleCBvZiBjb2RlIHN5bWJvbHMgKi9cbiAgdmFyIG1pbiA9IDAsIG1heCA9IDA7ICAgICAgICAgIC8qIG1pbmltdW0gYW5kIG1heGltdW0gY29kZSBsZW5ndGhzICovXG4gIHZhciByb290ID0gMDsgICAgICAgICAgICAgIC8qIG51bWJlciBvZiBpbmRleCBiaXRzIGZvciByb290IHRhYmxlICovXG4gIHZhciBjdXJyID0gMDsgICAgICAgICAgICAgIC8qIG51bWJlciBvZiBpbmRleCBiaXRzIGZvciBjdXJyZW50IHRhYmxlICovXG4gIHZhciBkcm9wID0gMDsgICAgICAgICAgICAgIC8qIGNvZGUgYml0cyB0byBkcm9wIGZvciBzdWItdGFibGUgKi9cbiAgdmFyIGxlZnQgPSAwOyAgICAgICAgICAgICAgICAgICAvKiBudW1iZXIgb2YgcHJlZml4IGNvZGVzIGF2YWlsYWJsZSAqL1xuICB2YXIgdXNlZCA9IDA7ICAgICAgICAgICAgICAvKiBjb2RlIGVudHJpZXMgaW4gdGFibGUgdXNlZCAqL1xuICB2YXIgaHVmZiA9IDA7ICAgICAgICAgICAgICAvKiBIdWZmbWFuIGNvZGUgKi9cbiAgdmFyIGluY3I7ICAgICAgICAgICAgICAvKiBmb3IgaW5jcmVtZW50aW5nIGNvZGUsIGluZGV4ICovXG4gIHZhciBmaWxsOyAgICAgICAgICAgICAgLyogaW5kZXggZm9yIHJlcGxpY2F0aW5nIGVudHJpZXMgKi9cbiAgdmFyIGxvdzsgICAgICAgICAgICAgICAvKiBsb3cgYml0cyBmb3IgY3VycmVudCByb290IGVudHJ5ICovXG4gIHZhciBtYXNrOyAgICAgICAgICAgICAgLyogbWF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lcnMgKi9cbiAgLy9vcHRzLnRhYmxlX2luZGV4ICs9IHVzZWQ7XG4gIG9wdHMuYml0cyA9IHJvb3Q7XG4gIHJldHVybiAwO1xufTtcbiIsIid1c2Ugc3RyaWN0JztcblxubW9kdWxlLmV4cG9ydHMgPSB7XG4gICcyJzogICAgJ25lZWQgZGljdGlvbmFyeScsICAgICAvKiBaX05FRURfRElDVCAgICAgICAyICAqL1xuICAnMSc6ICAgICdzdHJlYW0gZW5kJywgICAgICAgICAgLyogWl9TVFJFQU1fRU5EICAgICAgMSAgKi9cbiAgJzAnOiAgICAnJywgICAgICAgICAgICAgICAgICAgIC8qIFpfT0sgICAgICAgICAgICAgIDAgICovXG4gICctMSc6ICAgJ2ZpbGUgZXJyb3InLCAgICAgICAgICAvKiBaX0VSUk5PICAgICAgICAgKC0xKSAqL1xuICAnLTInOiAgICdzdHJlYW0gZXJyb3InLCAgICAgICAgLyogWl9TVFJFQU1fRVJST1IgICgtMikgKi9cbiAgJy0zJzogICAnZGF0YSBlcnJvcicsICAgICAgICAgIC8qIFpfREFUQV9FUlJPUiAgICAoLTMpICovXG4gICctNCc6ICAgJ2luc3VmZmljaWVudCBtZW1vcnknLCAvKiBaX01FTV9FUlJPUiAgICAgKC00KSAqL1xuICAnLTUnOiAgICdidWZmZXIgZXJyb3InLCAgICAgICAgLyogWl9CVUZfRVJST1IgICAgICgtNSkgKi9cbiAgJy02JzogICAnaW5jb21wYXRpYmxlIHZlcnNpb24nIC8qIFpfVkVSU0lPTl9FUlJPUiAoLTYpICovXG59O1xuIiwiJ3VzZSBzdHJpY3QnO1xuXG5cbnZhciB1dGlscyA9IHJlcXVpcmUoJy4uL3V0aWxzL2NvbW1vbicpO1xuXG4vKiBQdWJsaWMgY29uc3RhbnRzID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cblxuXG4vL3ZhciBaX0ZJTFRFUkVEICAgICAgICAgID0gMTtcbi8vdmFyIFpfSFVGRk1BTl9PTkxZICAgICAgPSAyO1xuLy92YXIgWl9STEUgICAgICAgICAgICAgICA9IDM7XG52YXIgWl9GSVhFRCAgICAgICAgICAgICAgID0gNDtcbi8vdmFyIFpfREVGQVVMVF9TVFJBVEVHWSAgPSAwO1xuXG4vKiBQb3NzaWJsZSB2YWx1ZXMgb2YgdGhlIGRhdGFfdHlwZSBmaWVsZCAodGhvdWdoIHNlZSBpbmZsYXRlKCkpICovXG52YXIgWl9CSU5BUlkgICAgICAgICAgICAgID0gMDtcbnZhciBaX1RFWFQgICAgICAgICAgICAgICAgPSAxO1xuLy92YXIgWl9BU0NJSSAgICAgICAgICAgICA9IDE7IC8vID0gWl9URVhUXG52YXIgWl9VTktOT1dOICAgICAgICAgICAgID0gMjtcblxuLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cblxuXG5mdW5jdGlvbiB6ZXJvKGJ1ZikgeyB2YXIgbGVuID0gYnVmLmxlbmd0aDsgd2hpbGUgKC0tbGVuID49IDApIHsgYnVmW2xlbl0gPSAwOyB9IH1cblxuLy8gRnJvbSB6dXRpbC5oXG5cbnZhciBTVE9SRURfQkxPQ0sgPSAwO1xudmFyIFNUQVRJQ19UUkVFUyA9IDE7XG52YXIgRFlOX1RSRUVTICAgID0gMjtcbi8qIFRoZSB0aHJlZSBraW5kcyBvZiBibG9jayB0eXBlICovXG5cbnZhciBNSU5fTUFUQ0ggICAgPSAzO1xudmFyIE1BWF9NQVRDSCAgICA9IDI1ODtcbi8qIFRoZSBtaW5pbXVtIGFuZCBtYXhpbXVtIG1hdGNoIGxlbmd0aHMgKi9cblxuLy8gRnJvbSBkZWZsYXRlLmhcbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogSW50ZXJuYWwgY29tcHJlc3Npb24gc3RhdGUuXG4gKi9cblxudmFyIExFTkdUSF9DT0RFUyAgPSAyOTtcbi8qIG51bWJlciBvZiBsZW5ndGggY29kZXMsIG5vdCBjb3VudGluZyB0aGUgc3BlY2lhbCBFTkRfQkxPQ0sgY29kZSAqL1xuXG52YXIgTElURVJBTFMgICAgICA9IDI1Njtcbi8qIG51bWJlciBvZiBsaXRlcmFsIGJ5dGVzIDAuLjI1NSAqL1xuXG52YXIgTF9DT0RFUyAgICAgICA9IExJVEVSQUxTICsgMSArIExFTkdUSF9DT0RFUztcbi8qIG51bWJlciBvZiBMaXRlcmFsIG9yIExlbmd0aCBjb2RlcywgaW5jbHVkaW5nIHRoZSBFTkRfQkxPQ0sgY29kZSAqL1xuXG52YXIgRF9DT0RFUyAgICAgICA9IDMwO1xuLyogbnVtYmVyIG9mIGRpc3RhbmNlIGNvZGVzICovXG5cbnZhciBCTF9DT0RFUyAgICAgID0gMTk7XG4vKiBudW1iZXIgb2YgY29kZXMgdXNlZCB0byB0cmFuc2ZlciB0aGUgYml0IGxlbmd0aHMgKi9cblxudmFyIEhFQVBfU0laRSAgICAgPSAyKkxfQ09ERVMgKyAxO1xuLyogbWF4aW11bSBoZWFwIHNpemUgKi9cblxudmFyIE1BWF9CSVRTICAgICAgPSAxNTtcbi8qIEFsbCBjb2RlcyBtdXN0IG5vdCBleGNlZWQgTUFYX0JJVFMgYml0cyAqL1xuXG52YXIgQnVmX3NpemUgICAgICA9IDE2O1xuLyogc2l6ZSBvZiBiaXQgYnVmZmVyIGluIGJpX2J1ZiAqL1xuXG5cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogQ29uc3RhbnRzXG4gKi9cblxudmFyIE1BWF9CTF9CSVRTID0gNztcbi8qIEJpdCBs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j4+IDE7XG59XG5cblxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBGbHVzaCB0aGUgYml0IGJ1ZmZlciwga2VlcGluZyBhdCBtb3N0IDcgYml0cyBpbiBpdC5cbiAqL1xuZnVuY3Rpb24gYmlfZmx1c2gocykge1xuICBpZiAocy5iaV92YWxpZCA9PT0gMTYpIHtcbiAgICBwdXRfc2hvcnQocywgcy5iaV9idWYpO1xuICAgIHMuYmlfYnVmID0gMDtcbiAgICBzLmJpX3ZhbGlkID0gMDtcblxuICB9IGVsc2UgaWYgKHMuYmlfdmFsaWQgPj0gOCkge1xuICAgIHMucGVuZGluZ19idWZbcy5wZW5kaW5nKytdID0gcy5iaV9idWYgJiAweGZmO1xuICAgIHMuYmlfYnVmID4+PSA4O1xuICAgIHMuYmlfdmFsaWQgLT0gODtcbiAgfVxufVxuXG5cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogQ29tcHV0ZSB0aGUgb3B0aW1hbCBiaXQgbGVuZ3RocyBmb3IgYSB0cmVlIGFuZCB1cGRhdGUgdGhlIHRvdGFsIGJpdCBsZW5ndGhcbiAqIGZvciB0aGUgY3VycmVudCBibG9jay5cbiAqIElOIGFzc2VydGlvbjogdGhlIGZpZWxkcyBmcmVxIGFuZCBkYWQgYXJlIHNldCwgaGVhcFtoZWFwX21heF0gYW5kXG4gKiAgICBhYm92ZSBhcmUgdGhlIHRyZWUgbm9kZXMgc29ydGVkIGJ5IGluY3JlYXNpbmcgZnJlcXVlbmN5LlxuICogT1VUIGFzc2VydGlvbnM6IHRoZSBmaWVsZCBsZW4gaXMgc2V0IHRvIHRoZSBvcHRpbWFsIGJpdCBsZW5ndGgsIHRoZVxuICogICAgIGFycmF5IGJsX2NvdW50IGNvbnRhaW5zIHRoZSBmcmVxd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ZXZsZW4pIHsgcy5ibF90cmVlW2N1cmxlbiAqIDJdLyouRnJlcSovKys7IH1cbiAgICAgIHMuYmxfdHJlZVtSRVBfM182KjJdLyouRnJlcSovKys7XG5cbiAgICB9IGVsc2UgaWYgKGNvdW50IDw9IDEwKSB7XG4gICAgICBzLmJsX3RyZWVbUkVQWl8zXzEwKjJdLyouRnJlcSovKys7XG5cbiAgICB9IGVsc2Uge1xuICAgICAgcy5ibF90cmVlW1JFUFpfMTFfMTM4KjJdLyouRnJlcSovKys7XG4gICAgfVxuXG4gICAgY291bnQgPSAwO1xuICAgIHByZXZsZW4gPSBjdXJsZW47XG5cbiAgICBpZiAobmV4dGxlbiA9PT0gMCkge1xuICAgICAgbWF4X2NvdW50ID0gMTM4O1xuICAgICAgbWluX2NvdW50ID0gMztcblxuICAgIH0gZWxzZSBpZiAoY3VybGVuID09PSBuZXh0bGVuKSB7XG4gICAgICBtYXhfY291bnQgPSA2O1xuICAgICAgbWluX2NvdW50ID0gMztcblxuICAgIH0gZWxzZSB7XG4gICAgICBtYXhfY291bnQgPSA3O1xuICAgICAgbWluX2NvdW50ID0gNDtcbiAgICB9XG4gIH1cbn1cblxuXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIFNlbmQgYSBsaXRlcmFsIG9yIGRpc3RhbmNlIHRyZWUgaW4gY29tcHJlc3NlZCBmb3JtLCB1c2luZyB0aGUgY29kZXMgaW5cbiAqIGJsX3RyZWUuXG4gKi9cbmZ1bmN0aW9uIHNlbmRfdHJlZShzLCB0cmVlLCBtYXhfY29kZSlcbi8vICAgIGRlZmxhdGVfc3RhdGUgKnM7XG4vLyAgICBjdF9kYXRhICp0cmVlOyAvKiB0aGUgdHJlZSB0byBiZSBzY2FubmVkICovXG4vLyAgICBpbnQgbWF4X2NvZGU7ICAgICAgIC8qIGFuZCBpdHMgbGFyZ2VzdCBjb2RlIG9m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biwgcy5ibF90cmVlKTsgfSB3aGlsZSAoLS1jb3VudCAhPT0gMCk7XG5cbiAgICB9IGVsc2UgaWYgKGN1cmxlbiAhPT0gMCkge1xuICAgICAgaWYgKGN1cmxlbiAhPT0gcHJldmxlbikge1xuICAgICAgICBzZW5kX2NvZGUocywgY3VybGVuLCBzLmJsX3RyZWUpO1xuICAgICAgICBjb3VudC0tO1xuICAgICAgfVxuICAgICAgLy9Bc3NlcnQoY291bnQgPj0gMyAmJiBjb3VudCA8PSA2LCBcIiAzXzY/XCIpO1xuICAgICAgc2VuZF9jb2RlKHMsIFJFUF8zXzYsIHMuYmxfdHJlZSk7XG4gICAgICBzZW5kX2JpdHMocywgY291bnQtMywgMik7XG5cbiAgICB9IGVsc2UgaWYgKGNvdW50IDw9IDEwKSB7XG4gICAgICBzZW5kX2NvZGUocywgUkVQWl8zXzEwLCBzLmJsX3RyZWUpO1xuICAgICAgc2VuZF9iaXRzKHMsIGNvdW50LTMsIDMpO1xuXG4gICAgfSBlbHNlIHtcbiAgICAgIHNlbmRfY29kZShzLCBSRVBaXzExXzEzOCwgcy5ibF90cmVlKTtcbiAgICAgIHNlbmRfYml0cyhzLCBjb3VudC0xMSwgNyk7XG4gICAgfVxuXG4gICAgY291bnQgPSAwO1xuICAgIHByZXZsZW4gPSBjdXJsZW47XG4gICAgaWYgKG5leHRsZW4gPT09IDApIHtcbiAgICAgIG1heF9jb3VudCA9IDEzODtcbiAgICAgIG1pbl9jb3VudCA9IDM7XG5cbiAgICB9IGVsc2UgaWYgKGN1cmxlbiA9PT0gbmV4dGxlbikge1xuICAgICAgbWF4X2NvdW50ID0gNjtcbiAgICAgIG1pbl9jb3VudCA9IDM7XG5cbiAgICB9IGVsc2Uge1xuICAgICAgbWF4X2NvdW50ID0gNztcbiAgICAgIG1pbl9jb3VudCA9IDQ7XG4gICAgfVxuICB9XG59XG5cblxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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VycyA9IFtdO1xuICAgIHZhciBucmVhZCA9IDA7XG5cbiAgICB2YXIgZXJyb3I7XG4gICAgdGhpcy5vbignZXJyb3InLCBmdW5jdGlvbihlcikge1xuICAgICAgZXJyb3IgPSBlcjtcbiAgICB9KTtcblxuICAgIGRvIHtcbiAgICAgIHZhciByZXMgPSB0aGlzLl9iaW5kaW5nLndyaXRlU3luYyhmbHVzaEZsYWcsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2h1bmssIC8vIGluXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5PZmYsIC8vIGluX29mZlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF2YWlsSW5CZWZvcmUsIC8vIGluX2xlblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2J1ZmZlciwgLy8gb3V0XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fb2Zmc2V0LCAvL291dF9vZmZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdmFpbE91dEJlZm9yZSk7IC8vIG91dF9sZW5cbiAgICB9IHdoaWxlICghdGhpcy5faGFkRXJyb3IgJiYgY2FsbGJhY2socmVzWzBdLCByZXNbMV0pKTtcblxuICAgIGlmICh0aGlzLl9oYWRFcnJvcikge1xuICAgICAgdGhyb3cgZXJyb3I7XG4gICAgfVxuXG4gICAgdmFyIGJ1ZiA9IEJ1ZmZlci5jb25jYXQoYnVmZmVycywgbnJlYWQpO1xuICAgIHRoaXMuY2xvc2UoKTtcblxuICAgIHJldHVybiBidWY7XG4gIH1cblxuICB2YXIgcmVxID0gdGhpcy5fYmluZGluZy53cml0ZShmbHVzaEZsYWcsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNodW5rLCAvLyBpblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbk9mZiwgLy8gaW5fb2ZmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF2YWlsSW5CZWZvcmUsIC8vIGluX2xlblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9idWZmZXIsIC8vIG91dFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9vZmZzZXQsIC8vb3V0X29mZlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdmFpbE91dEJlZm9yZSk7IC8vIG91dF9sZW5cblxuICByZXEuYnVmZmVyID0gY2h1bms7XG4gIHJlcS5jYWxsYmFjayA9IGNhbGxiYWNrO1xuXG4gIGZ1bmN0aW9uIGNhbGxiYWNrKGF2YWlsSW5BZnRlciwgYXZhaWxPdXRBZnRlcikge1xuICAgIGlmIChzZWxmLl9oYWRFcnJvcilcbiAgICAgIHJldHVybjtcblxuICAgIHZhciBoYXZlID0gYXZhaWxPdXRCZWZvcmUgLSBhdmFpbE91dEFmdGVyO1xuICAgIGFzc2VydChoYXZlID49IDAsICdoYXZlIHNob3VsZCBub3QgZ28gZG93bicpO1xuXG4gICAgaWYgKGhhdmUgPiAwKSB7XG4gICAgICB2YXIgb3V0ID0gc2VsZi5fYnVmZmVyLnNsaWNlKHNlbGYuX29mZnNldCwgc2VsZi5fb2Zmc2V0ICsgaGF2ZSk7XG4gICAgICBzZWxmLl9vZmZzZXQgKz0gaGF2ZTtcbiAgICAgIC8vIHNlcnZlIHNvbWUgb3V0cHV0IHRvIHRoZSBjb25zdW1lci5cbiAgICAgIGlmIChhc3luYykge1xuICAgICAgICBzZWxmLnB1c2gob3V0KTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGJ1ZmZlcnMucHVzaChvdXQpO1xuICAgICAgICBucmVhZCArPSBvdXQubGVuZ3RoO1xuICAgICAgfVxuICAgIH1cblxuICAgIC8vIGV4aGF1c3RlZCB0aGUgb3V0cHV0IGJ1ZmZlciwgb3IgdXNlZCBhbGwgdGhlI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G9pbnQgPiAweDdGKSB7XG4gICAgICAgICAgICAgIGNvZGVQb2ludCA9IHRlbXBDb2RlUG9pbnRcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgY2FzZSAzOlxuICAgICAgICAgIHNlY29uZEJ5dGUgPSBidWZbaSArIDFdXG4gICAgICAgICAgdGhpcmRCeXRlID0gYnVmW2kgKyAyXVxuICAgICAgICAgIGlmICgoc2Vjb25kQnl0ZSAmIDB4QzApID09PSAweDgwICYmICh0aGlyZEJ5dGUgJiAweEMwKSA9PT0gMHg4MCkge1xuICAgICAgICAgICAgdGVtcENvZGVQb2ludCA9IChmaXJzdEJ5dGUgJiAweEYpIDw8IDB4QyB8IChzZWNvbmRCeXRlICYgMHgzRikgPDwgMHg2IHwgKHRoaXJkQnl0ZSAmIDB4M0YpXG4gICAgICAgICAgICBpZiAodGVtcENvZGVQb2ludCA+IDB4N0ZGICYmICh0ZW1wQ29kZVBvaW50IDwgMHhEODAwIHx8IHRlbXBDb2RlUG9pbnQgPiAweERGRkYpKSB7XG4gICAgICAgICAgICAgIGNvZGVQb2ludCA9IHRlbXBDb2RlUG9pbnRcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgY2FzZSA0OlxuICAgICAgICAgIHNlY29uZEJ5dGUgPSBidWZbaSArIDFdXG4gICAgICAgICAgdGhpcmRCeXRlID0gYnVmW2kgKyAyXVxuICAgICAgICAgIGZvdXJ0aEJ5dGUgPSBidWZbaSArIDNdXG4gICAgICAgICAgaWYgKChzZWNvbmRCeXRlICYgMHhDMCkgPT09IDB4ODAgJiYgKHRoaXJkQnl0ZSAmIDB4QzApID09PSAweDgwICYmIChmb3VydGhCeXRlICYgMHhDMCkgPT09IDB4ODApIHtcbiAgICAgICAgICAgIHRlbXBDb2RlUG9pbnQgPSAoZmlyc3RCeXRlICYgMHhGKSA8PCAweDEyIHwgKHNlY29uZE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ICAgICB0aHJvdyAnZGljb21QYXJzZXIucGFyc2VEaWNvbTogbWlzc2luZyByZXF1aXJlZCBtZXRhIGhlYWRlciBhdHRyaWJ1dGUgMDAwMiwwMDEwJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciB0cmFuc2ZlclN5bnRheEVsZW1lbnQgPSBtZXRhSGVhZGVyRGF0YVNldC5lbGVtZW50cy54MDAwMjAwMTA7XG4gICAgICAgICAgICByZXR1cm4gZGljb21QYXJzZXIucmVhZEZpeGVkU3RyaW5nKGJ5dGVBcnJheSwgdHJhbnNmZXJTeW50YXhFbGVtZW50LmRhdGFPZmZzZXQsIHRyYW5zZmVyU3ludGF4RWxlbWVudC5sZW5ndGgpO1xuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gaXNFeHBsaWNpdCh0cmFuc2ZlclN5bnRheCkge1xuICAgICAgICAgICAgaWYodHJhbnNmZXJTeW50YXggPT09ICcxLjIuODQwLjEwMDA4LjEuMicpIC8vIGltcGxpY2l0IGxpdHRsZSBlbmRpYW5cbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBhbGwgb3RoZXIgdHJhbnNmZXIgc3ludGF4ZXMgc2hvdWxkIGJlIGV4cGxpY2l0XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGdldERhdGFTZXRCeXRlU3RyZWFtKHRyYW5zZmVyU3ludGF4LCBwb3NpdGlvbikge1xuICAgICAgICAgICAgaWYodHJhbnNmZXJTeW50YXggPT09ICcxLjIuODQwLjEwMDA4LjEuMi4xLjk5JylcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAvLyBpZiBhbiBpbmZhbHRlciBjYWxsYmFjayBpcyByZWdpc3RlcmVkLCB1c2UgaXRcbiAgICAgICAgICAgICAgICBpZiAob3B0aW9uc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gICAgICAgICAgICAgICAvLyBjcmVhdGUgYSBzaW5nbGUgYnl0ZSBhcnJheSB3aXRoIHRoZSBmdWxsIGhlYWRlciBieXRlcyBhbmQgdGhlIGluZmxhdGVkIGJ5dGVzXG4gICAgICAgICAgICAgICAgICAgIHZhciBmdWxsQnl0ZUFycmF5ID0gZGljb21QYXJzZXIuYWxsb2MoYnl0ZUFycmF5LCBpbmZsYXRlZC5sZW5ndGggKyBwb3NpdGlvbik7XG4gICAgICAgICAgICAgICAgICAgIGZ1bGxCeXRlQXJyYXkuc2V0KGJ5dGVBcnJheS5zbGljZSgwLCBwb3NpdGlvbiksIDApO1xuICAgICAgICAgICAgICAgICAgICBmdWxsQnl0ZUFycmF5LnNldChpbmZsYXRlZCwgcG9zaXRpb24pO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IGRpY29tUGFyc2VyLkJ5dGVTdHJlYW0oZGljb21QYXJzZXIubGl0dGxlRW5kaWFuQnl0ZUFycmF5UGFyc2VyLCBmdWxsQnl0ZUFycmF5LCAwKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gdGhyb3cgZXhjZXB0aW9uIHNpbmNlIG5vIGluZmxhdGVyIGlzIGF2YWlsYWJsZVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyAnZGljb21QYXJzZXIucGFyc2VEaWNvbTogbm8gaW5mbGF0ZXIgYXZhaWxhYmxlIHRvIGhhbmRsZSBkZWZsYXRlIHRyYW5zZmVyIHN5bnRheCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYodHJhbnNmZXJTeW50YXggPT09ICcxLjIuODQwLjEwMDA4LjEuMi4yJykgLy8gZXhwbGljaXQgYmlnIGVuZGlhblxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIHJldHVybiBuZXcgZGljb21QYXJzZXIuQnl0ZVN0cmVhbShkaWNvbVBh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saWNpdChkYXRhU2V0LCBkYXRhU2V0Qnl0ZVN0cmVhbSwgZGF0YVNldEJ5dGVTdHJlYW0uYnl0ZUFycmF5Lmxlbmd0aCwgb3B0aW9ucyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIGRpY29tUGFyc2VyLnBhcnNlRGljb21EYXRhU2V0SW1wbGljaXQoZGF0YVNldCwgZGF0YVNldEJ5dGVTdHJlYW0sIGRhdGFTZXRCeXRlU3RyZWFtLmJ5dGVBcnJheS5sZW5ndGgsIG9wdGlvbnMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNhdGNoKGUpIHtcbiAgICAgICAgICAgICAgICB2YXIgZXggPSB7XG4gICAgICAgICAgICAgICAgICAgIGV4Y2VwdGlvbjogZSxcbiAgICAgICAgICAgICAgICAgICAgZGF0YVNldDogZGF0YVNldFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgdGhyb3cgZXg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gZGF0YVNldDtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIG1haW4gZnVuY3Rpb24gaGVyZVxuICAgICAgICBmdW5jdGlvbiBwYXJzZVRoZUJ5dGVTdHJlYW0oKSB7XG4gICAgICAgICAgICB2YXIgbWV0YUhlYWRlckRhdGFTZXQgPSBkaWNvbVBhcnNlci5yZWFkUGFydDEwSGVhZGVyKGJ5dGVBcnJheSwgb3B0aW9ucyk7XG5cbiAgICAgICAgICAgIHZhciBkYXRhU2V0ID0gcmVhZERhdGFTZXQobWV0YUhlYWRlckRhdGFTZXQpO1xuXG4gICAgICAgICAgICByZXR1cm4gbWVyZ2VEYXRhU2V0cyhtZXRhSGVhZGVyRGF0YVNldCwgZGF0YVNldCk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBUaGlzI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tc1tpXS5kYXRhU2V0LCBvcHRpb25zKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJlc3VsdFt0YWddID0gc2VxdWVuY2VJdGVtcztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIGFzU3RyaW5nO1xuICAgICAgICAgICAgICAgIGFzU3RyaW5nID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIGlmKGVsZW1lbnQubGVuZ3RoIDwgb3B0aW9ucy5tYXhFbGVtZW50TGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGFzU3RyaW5nID0gZGljb21QYXJzZXIuZXhwbGljaXRFbGVtZW50VG9TdHJpbmcoZGF0YVNldCwgZWxlbWVudCk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYoYXNTdHJpbmcgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHRbdGFnXSA9IGFzU3RyaW5nO1xuICAgICAgICAgICAgICAgIH0gIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHRbdGFnXSA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFPZmZzZXQ6IGVsZW1lbnQuZGF0YU9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aCA6IGVsZW1lbnQubGVuZ3RoXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9O1xuXG5cbiAgICByZXR1cm4gZGljb21QYXJzZXI7XG59KGRpY29tUGFyc2VyKSk7XG52YXIgZGljb21QYXJzZXIgPSAoZnVuY3Rpb24gKGRpY29tUGFyc2VyKSB7XG4gICAgXCJ1c2Ugc3RyaWN0XCI7XG5cbiAgICBpZiAoZGljb21QYXJzZXIgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICBkaWNvbVBhcnNlciA9IHt9O1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIENvbnZlcnRzIGFuIGV4cGxpY2l0IFZSIGVsZW1lbnQgdG8gYSBzdHJpbmcgb3IgdW5kZWZpbmVkIGlmIGl0IGlzIG5vdCBwb3NzaWJsZSB0byBjb252ZXJ0LlxuICAgICAqIFRocm93cyBhbiBlcnJvciBpZiBhbiBpbXBsaWNpdCBlbGVtZW50IGlzIHN1cHBsaWVkXG4gICAgICogQHBhcmFtIGRhdGFTZXRcbiAgICAgKiBAcGFyYW0gZWxlbWVudFxuICAgICAqIEByZXR1cm5zIHsqfVxuICAgICAqL1xuICAgIGRpY29tUGFyc2VyLmV4cGxpY2l0RWxlbWVudFRvU3RyaW5nID0gZnVuY3Rpb24oZGF0YVNldCwgZWxlbWVudClcbiAgICB7XG4gICAgICAgIGlmKGRhdGFTZXQgPT09IHVuZGVmaW5lZCB8fCBlbGVtZW50ID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIHRocm93ICdkaWNvbVBhcnNlci5leHBsaWNpdEVsZW1lbnRUb1N0cmluZzogbWlzc2luZyByZXF1aXJlZCBwYXJhbWV0ZXJzJztcbiAgICAgICAgfVxuICAgICAgICBpZihlbGVtZW50LnZyID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIHRocm93ICdkaWNvbVBhcnNlci5leHBsaWNpdEVsZW1lbnRUb1N0cmluZzogY2Fubm90IGNvbnZlcnQgaW1wbGljaXQgZWxlbWVudCB0byBzdHJpbmcnO1xuICAgICAgICB9XG4gICAgICAgIHZhciB2ciA9IGVsZW1lbnQudnI7XG4gICAgICAgIHZhciB0YWcgPSBlbGVtZW50LnRhZztcblxuICAgICAgICB2YXIgdGV4dFJlc3VsdDtcblxuICAgICAgICBmdW5jdGlvbiBtdWx0aUVsZW1lbnRUb1N0cmluZyhudW1JdGVtcywgZnVuYykge1xuICAgICAgICAgICAgdmFyIHJlc3VsdCA9IFwiXCI7XG4gICAgICAgICAgICBmb3IodmFyIGk9MDsgaSA8IG51bUl0ZW1zOyBpKyspIHtcbiAgICAgICAgICAgICAgICBpZihpICE9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAnLyc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJlc3VsdCArPSBmdW5jLmNhbGwoZGF0YVNldCwgdGFnLCBpKS50b1N0cmluZygpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmKGRpY29tUGFyc2VyLmlzU3RyaW5nVnIodnIpID09PSB0cnVlKVxuICAgICAgICB7XG4gICAgICAgICAgICB0ZXh0UmVzdWx0ID0gZGF0YVNldC5zdHJpbmcodGFnKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICh2ciA9PSAnQVQnKSB7XG4gICAgICAgICAgICB2YXIgbnVtID0gZGF0YVNldC51aW50MzIodGFnKTtcbiAgICAgICAgICAgIGlmKG51bSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChudW0gPCAwKVxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIG51bSA9IDB4RkZGRkZGRkYgKyBudW0gKyAxO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gJ3gnICsgbnVtLnRvU3RyaW5nKDE2KS50b1VwcGVyQ2FzZSgpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHZyID09ICdVUycpXG4gICAgICAgIHtcbiAgICAgICAgICAgIHRleHRSZXN1bHQgPSBtdWx0aUVsZW1lbnRUb1N0cmluZyhlbGVtZW50Lmxlbmd0aCAvIDIsIGRhdGFTZXQudWludDE2KTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGl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ogc3MsXG4gICAgICAgIGZyYWN0aW9uYWxTZWNvbmRzOiBmZmZmZmZcbiAgICAgIH07XG4gICAgfVxuXG4gICAgaWYodmFsaWRhdGUpIHtcbiAgICAgIHRocm93IFwiaW52YWxpZCBUTSAnXCIgKyB0aW1lICsgXCInXCI7XG4gICAgfVxuXG4gICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgfTtcblxuICByZXR1cm4gZGljb21QYXJzZXI7XG59KGRpY29tUGFyc2VyKSk7XG4vKipcbiAqIFV0aWxpdHkgZnVuY3Rpb25zIGZvciBkZWFsaW5nIHdpdGggRElDT01cbiAqL1xuXG52YXIgZGljb21QYXJzZXIgPSAoZnVuY3Rpb24gKGRpY29tUGFyc2VyKVxue1xuICAgIFwidXNlIHN0cmljdFwiO1xuXG4gICAgaWYoZGljb21QYXJzZXIgPT09IHVuZGVmaW5lZClcbiAgICB7XG4gICAgICAgIGRpY29tUGFyc2VyID0ge307XG4gICAgfVxuXG4gICAgdmFyIHN0cmluZ1ZycyA9IHtcbiAgICAgICAgQUU6IHRydWUsXG4gICAgICAgIEFTOiB0cnVlLFxuICAgICAgICBBVDogZmFsc2UsXG4gICAgICAgIENTOiB0cnVlLFxuICAgICAgICBEQTogdHJ1ZSxcbiAgICAgICAgRFM6IHRydWUsXG4gICAgICAgIERUOiB0cnVlLFxuICAgICAgICBGTDogZmFsc2UsXG4gICAgICAgIEZEOiBmYWxzZSxcbiAgICAgICAgSVM6IHRydWUsXG4gICAgICAgIExPOiB0cnVlLFxuICAgICAgICBMVDogdHJ1ZSxcbiAgICAgICAgT0I6IGZhbHNlLFxuICAgICAgICBPRDogZmFsc2UsXG4gICAgICAgIE9GOiBmYWxzZSxcbiAgICAgICAgT1c6IGZhbHNlLFxuICAgICAgICBQTjogdHJ1ZSxcbiAgICAgICAgU0g6IHRydWUsXG4gICAgICAgIFNMOiBmYWxzZSxcbiAgICAgICAgU1E6IGZhbHNlLFxuICAgICAgICBTUzogZmFsc2UsXG4gICAgICA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GVuZCBvZiBidWZmZXInO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIGludDE2ID0gKGJ5dGVBcnJheVtwb3NpdGlvbl0gPDwgOCkgKyBieXRlQXJyYXlbcG9zaXRpb24gKyAxXTtcbiAgICAgICAgICAgIC8vIGZpeCBzaWduXG4gICAgICAgICAgICBpZiAoaW50MTYgJiAweDgwMDApIHtcbiAgICAgICAgICAgICAgICBpbnQxNiA9IGludDE2IC0gMHhGRkZGIC0gMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBpbnQxNjtcbiAgICAgICAgfSxcblxuICAgICAgICAvKipcbiAgICAgICAgICogUGFyc2VzIGFuIHVuc2lnbmVkIGludCAzMiBmcm9tIGEgYmlnLWVuZGlhbiBieXRlIGFycmF5XG4gICAgICAgICAqXG4gICAgICAgICAqIEBwYXJhbSBieXRlQXJyYXkgdGhlIGJ5dGUgYXJyYXkgdG8gcmVhZCBmcm9tXG4gICAgICAgICAqIEBwYXJhbSBwb3NpdGlvbiB0aGUgcG9zaXRpb24gaW4gdGhlIGJ5dGUgYXJyYXkgdG8gcmVhZCBmcm9tXG4gICAgICAgICAqIEByZXR1cm5zIHsqfSB0aGUgcGFyc2VkIHVuc2lnbmVkIGludCAzMlxuICAgICAgICAgKiBAdGhyb3dzIGVycm9yIGlmIGJ1ZmZlciBvdmVycmVhZCB3b3VsZCBvY2N1clxuICAgICAgICAgKiBAYWNjZXNzIHByaXZhdGVcbiAgICAgICAgICovXG4gICAgICAgIHJlYWRVaW50MzI6IGZ1bmN0aW9uIChieXRlQXJyYXksIHBvc2l0aW9uKSB7XG4gICAgICAgICAgICBpZiAocG9zaXRpb24gPCAwKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgJ2JpZ0VuZGlhbkJ5dGVBcnJheVBhcnNlci5yZWFkVWludDMyOiBwb3NpdGlvbiBjYW5ub3QgYmUgbGVzcyB0aGFuIDAnO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAocG9zaXRpb24gKyA0ID4gYnl0ZUFycmF5Lmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIHRocm93ICdiaWdFbmRpYW5CeXRlQXJyYXlQYXJzZXIucmVhZFVpbnQzMjogYXR0ZW1wdCB0byByZWFkIHBhc3QgZW5kIG9mIGJ1ZmZlcic7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciB1aW50MzIgPSAoMjU2ICogKDI1NiAqICgyNTYgKiBieXRlQXJyYXlbcG9zaXRpb25dICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQXJyYXlbcG9zaXRpb24gKyAxXSkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVBcnJheVtwb3NpdGlvbiArIDJdKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUFycmF5W3Bvc2l0aW9uICsgM10pO1xuXG4gICAgICAgICAgICByZXR1cm4gdWludDMyO1xuICAgICAgICB9LFxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBQYXJzZXMgYSBzaWduZWQgaW50IDMyIGZyb20gYSBiaWctZW5kaWFuIGJ5dGUgYXJyYXlcbiAgICAgICAgICpcbiAgICAgICAgICogQHBhcmFtIGJ5dGVBcnJheSB0aGUgYnl0ZSBhcnJheSB0byByZWFkIGZyb21cbiAgICAgICAgICogQHBhcmFtIHBvc2l0aW9uIHRoZSBwb3NpdGlvbiBpbiB0aGUgYnl0ZSBhcnJheSB0byByZWFkIGZyb21cbiAgICAgICAgICogQHJldHVybnMgeyp9IHRoZSBwYXJzZWQgc2lnbmVkIGludCAzMlxuICAgICAgICAgKiBAdGhyb3dzIGVycm9yIGlmIGJ1ZmZlciBvdmVycmVhZCB3b3VsZCBvY2N1clxuICAgICAgICAgKiBAYWNjZXNzIHByaXZhdGVcbiAgICAgICAgICovXG4gICAgICAgIHJlYWRJbnQzMjogZnVuY3Rpb24gKGJ5dGVBcnJheSwgcG9zaXRpb24pIHtcbiAgICAgICAgICAgIGlmIChwb3NpdGlvbiA8IDApIHtcbiAgICAgICAgICAgICAgICB0aHJvdyAnYmlnRW5kaWFuQnl0ZUFycmF5UGFyc2VyLnJlYWRJbnQzMjogcG9zaXRpb24gY2Fubm90IGJlIGxlc3MgdGhhbiAwJztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHBvc2l0aW9uICsgNCA+IGJ5dGVBcnJheS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyAnYmlnRW5kaWFuQnl0ZUFycmF5UGFyc2VyLnJlYWRJbnQzMjogYXR0ZW1wdCB0byByZWFkIHBhc3QgZW5kIG9mIGJ1ZmZlcic7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciBpbnQzMiA9ICgoYnl0ZUFycmF5W3Bvc2l0aW9uXSA8PCAyNCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgIChieXRlQXJyYXlbcG9zaXRpb24gKyAxXSA8PCAxNikgK1xuICAgICAgICAgICAgICAgICAgICAgICAgIChieXRlQXJyYXlbcG9zaXRpb24gKyAyXSA8PCA4KSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVBcnJheVtwb3NpdGlvbiArIDNdKTtcblxuICAgICAgICAgICAgcmV0dXJuIGludDMyO1xuICAgICAgICB9LFxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBQYXJzZXMgMzItYml0IGZsb2F0IGZyb20gYSBiaWctZW5kaWFuIGJ5dGUgYXJyYXlcbiAgICAgICAgICpcbiAgICAgICAgICogQHBhcmFtIGJ5dGVBcnJheSB0aGUgYnl0ZSBhcnJheSB0byByZWFkIGZyb21cbiAgICAgICAgICogQHBhcmFtIHBvc2l0aW9uIHRoZSBwb3NpdGlvbiBpbiB0aGUgYnl0ZSBhcnJheSB0byByZWFkIGZyb21cbiAgICAgICAgICog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G51bWJlciBvZiBieXRlcyB0byBwYXJzZVxuICAgICAqIEByZXR1cm5zIHtzdHJpbmd9IHRoZSBwYXJzZWQgc3RyaW5nXG4gICAgICogQHRocm93cyBlcnJvciBpZiBidWZmZXIgb3ZlcnJlYWQgd291bGQgb2NjdXJcbiAgICAgKiBAYWNjZXNzIHByaXZhdGVcbiAgICAgKi9cbiAgICBkaWNvbVBhcnNlci5yZWFkRml4ZWRTdHJpbmcgPSBmdW5jdGlvbihieXRlQXJyYXksIHBvc2l0aW9uLCBsZW5ndGgpXG4gICAge1xuICAgICAgICBpZihsZW5ndGggPCAwKVxuICAgICAgICB7XG4gICAgICAgICAgICB0aHJvdyAnZGljb21QYXJzZXIucmVhZEZpeGVkU3RyaW5nIC0gbGVuZ3RoIGNhbm5vdCBiZSBsZXNzIHRoYW4gMCc7XG4gICAgICAgIH1cblxuICAgICAgICBpZihwb3NpdGlvbiArIGxlbmd0aCA+IGJ5dGVBcnJheS5sZW5ndGgpIHtcbiAgICAgICAgICAgIHRocm93ICdkaWNvbVBhcnNlci5yZWFkRml4ZWRTdHJpbmc6IGF0dGVtcHQgdG8gcmVhZCBwYXN0IGVuZCBvZiBidWZmZXInO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIHJlc3VsdCA9IFwiXCI7XG4gICAgICAgIHZhciBieXRlO1xuICAgICAgICBmb3IodmFyIGk9MDsgaSA8IGxlbmd0aDsgaSsrKVxuICAgICAgICB7XG4gICAgICAgICAgICBieXRlID0gYnl0ZUFycmF5W3Bvc2l0aW9uICsgaV07XG4gICAgICAgICAgICBpZihieXRlID09PSAwKSB7XG4gICAgICAgICAgICAgICAgcG9zaXRpb24gKz0gIGxlbmd0aDtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0ICs9IFN0cmluZy5mcm9tQ2hhckNvZGUoYnl0ZSk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcm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IHJldHVybiBmaXhlZFN0cmluZy50cmltKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICB9O1xuXG4gICAgLyoqXG4gICAgICogUmV0dXJucyBhIHN0cmluZyB3aXRoIHRoZSBsZWFkaW5nIHNwYWNlcyBwcmVzZXJ2ZWQgYW5kIHRyYWlsaW5nIHNwYWNlcyByZW1vdmVkLlxuICAgICAqXG4gICAgICogVXNlIHRoaXMgZnVuY3Rpb24gdG8gYWNjZXNzIGRhdGEgZm9yIFZScyBvZiB0eXBlIFVULCBTVCBhbmQgTFRcbiAgICAgKlxuICAgICAqIEBwYXJhbSB0YWdcbiAgICAgKiBAcGFyYW0gaW5kZXhcbiAgICAgKiBAcmV0dXJucyB7Kn1cbiAgICAgKi9cbiAgICBkaWNvbVBhcnNlci5EYXRhU2V0LnByb3RvdHlwZS50ZXh0ID0gZnVuY3Rpb24odGFnLCBpbmRleClcbiAgICB7XG4gICAgICAgIHZhciBlbGVtZW50ID0gdGhpcy5lbGVtZW50c1t0YWddO1xuICAgICAgICBpZihlbGVtZW50ICYmIGVsZW1lbnQubGVuZ3RoID4gMClcbiAgICAgICAge1xuICAgICAgICAgICAgdmFyIGZpeGVkU3RyaW5nID0gZGljb21QYXJzZXIucmVhZEZpeGVkU3RyaW5nKHRoaXMuYnl0ZUFycmF5LCBlbGVtZW50LmRhdGFPZmZzZXQsIGVsZW1lbnQubGVuZ3RoKTtcbiAgICAgICAgICAgIGlmKGluZGV4ID49IDApXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgdmFyIHZhbHVlcyA9IGZpeGVkU3RyaW5nLnNwbGl0KCdcXFxcJyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlc1tpbmRleF0ucmVwbGFjZSgvICskLywgJycpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIHJ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0cmVhbS5yZWFkVWludDMyKCk7XG4gICAgICAgICAgICBpZih0YWcgPT09ICd4ZmZmZWUwZGQnKVxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIGJ5dGVTdHJlYW0uc2VlayhsZW5ndGgpO1xuICAgICAgICAgICAgICAgIGVsZW1lbnQubGVuZ3RoID0gYnl0ZVN0cmVhbS5wb3NpdGlvbiAtIGVsZW1lbnQuZGF0YU9mZnNldDtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmKHRhZyA9PT0gJ3hmZmZlZTAwMCcpXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgZWxlbWVudC5mcmFnbWVudHMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgIG9mZnNldDogYnl0ZVN0cmVhbS5wb3NpdGlvbiAtIGJhc2VPZmZzZXQgLSA4LFxuICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA6IGJ5dGVTdHJlYW0ucG9zaXRpb24sXG4gICAgICAgICAgICAgICAgICAgIGxlbmd0aCA6IGxlbmd0aFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYod2FybmluZ3MpIHtcbiAgICAgICAgICAgICAgICAgICAgd2FybmluZ3MucHVzaCgndW5leHBlY3RlZCB0YWcgJyArIHRhZyArICcgd2hpbGUgc2VhcmNoaW5nIGZvciBlbmQgb2YgcGl4ZWwgZGF0YSBlbGVtZW50IHdpdGggdW5kZWZpbmVkIGxlbmd0aCcpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZihsZW5ndGggPiBieXRlU3RyZWFtLmJ5dGVBcnJheS5sZW5ndGggLSBieXRlU3RyZWFtLnBvc2l0aW9uKVxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gZml4IGxlbmd0aFxuICAgICAgICAgICAgICAgICAgICBsZW5ndGggPSBieXRlU3RyZWFtLmJ5dGVBcnJheS5sZW5ndGggLSBieXRlU3RyZWFtLnBvc2l0aW9uO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbGVtZW50LmZyYWdtZW50cy5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgb2Zmc2V0OiBieXRlU3RyZWFtLnBvc2l0aW9uIC0gYmFzZU9mZnNldCAtIDgsXG4gICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uIDogYnl0ZVN0cmVhbS5wb3NpdGlvbixcbiAgICAgICAgICAgICAgICAgICAgbGVuZ3RoIDogbGVuZ3RoXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgYnl0ZVN0cmVhbS5zZWVrKGxlbmd0aCk7XG4gICAgICAgICAgICAgICAgZWxlbWVudC5sZW5ndGggPSBieXRlU3RyZWFtLnBvc2l0aW9uIC0gZWxlbWVudC5kYXRhT2Zmc2V0O1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYnl0ZVN0cmVhbS5zZWVrKGxlbmd0aCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZih3YXJuaW5ncykge1xuICAgICAgICAgICAgd2FybmluZ3MucHVzaChcInBpeGVsIGRhdGEgZWxlbWVudCBcIiArIGVsZW1lbnQudGFnICsgXCIgbWlzc2luZyBzZXF1ZW5jZSBkZWxpbWl0ZXIgdGFnIHhmZmZlZTBkZFwiKTtcbiAgICAgICAgfVxuICAgIH07XG5cblxuICAgIHJldHVybiBkaWNvbVBhcnNlcjtcbn0oZGljb21QYXJzZXIpKTtcbi8qKlxuICogSW50ZXJuYWwgaGVscGVyIGZ1bmN0aW9ucyBmb3IgcGFyc2luZyBESUNPTSBlbGVtZW50c1xuICovXG5cbnZhciBkaWNvbVBhcnNlciA9IChmdW5jdGlvbiAoZGljb21QYXJzZXIpXG57XG4gICAgXCJ1c2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ICAgICogQHBhcmFtIGJ5dGVBcnJheSB0aGUgYnl0ZSBhcnJheSB0byByZWFkIGZyb21cbiAgICAgICAgICogQHBhcmFtIHBvc2l0aW9uIHRoZSBwb3NpdGlvbiBpbiB0aGUgYnl0ZSBhcnJheSB0byByZWFkIGZyb21cbiAgICAgICAgICogQHJldHVybnMgeyp9IHRoZSBwYXJzZWQgc2lnbmVkIGludCAxNlxuICAgICAgICAgKiBAdGhyb3dzIGVycm9yIGlmIGJ1ZmZlciBvdmVycmVhZCB3b3VsZCBvY2N1clxuICAgICAgICAgKiBAYWNjZXNzIHByaXZhdGVcbiAgICAgICAgICovXG4gICAgICAgIHJlYWRJbnQxNjogZnVuY3Rpb24gKGJ5dGVBcnJheSwgcG9zaXRpb24pIHtcbiAgICAgICAgICAgIGlmIChwb3NpdGlvbiA8IDApIHtcbiAgICAgICAgICAgICAgICB0aHJvdyAnbGl0dGxlRW5kaWFuQnl0ZUFycmF5UGFyc2VyLnJlYWRJbnQxNjogcG9zaXRpb24gY2Fubm90IGJlIGxlc3MgdGhhbiAwJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChwb3NpdGlvbiArIDIgPiBieXRlQXJyYXkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgJ2xpdHRsZUVuZGlhbkJ5dGVBcnJheVBhcnNlci5yZWFkSW50MTY6IGF0dGVtcHQgdG8gcmVhZCBwYXN0IGVuZCBvZiBidWZmZXInO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIGludDE2ID0gYnl0ZUFycmF5W3Bvc2l0aW9uXSArIChieXRlQXJyYXlbcG9zaXRpb24gKyAxXSA8PCA4KTtcbiAgICAgICAgICAgIC8vIGZpeCBzaWduXG4gICAgICAgICAgICBpZiAoaW50MTYgJiAweDgwMDApIHtcbiAgICAgICAgICAgICAgICBpbnQxNiA9IGludDE2IC0gMHhGRkZGIC0gMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH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b3B0aW9ucy51bnRpbFRhZywgb3B0aW9ucy52ckNhbGxiYWNrKTtcbiAgICAgICAgICAgIGVsZW1lbnRzW2VsZW1lbnQudGFnXSA9IGVsZW1lbnQ7XG4gICAgICAgICAgICBpZihlbGVtZW50LnRhZyA9PT0gb3B0aW9ucy51bnRpbFRhZykge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG5cbiAgICByZXR1cm4gZGljb21QYXJzZXI7XG59KGRpY29tUGFyc2VyKSk7XG5cbi8qKlxuICogSW50ZXJuYWwgaGVscGVyIGZ1bmN0aW9ucyBmb3IgZm9yIHBhcnNpbmcgRElDT00gZWxlbWVudHNcbiAqL1xuXG52YXIgZGljb21QYXJzZXIgPSAoZnVuY3Rpb24gKGRpY29tUGFyc2VyKVxue1xuICAgIFwidXNlIHN0cmljdFwiO1xuXG4gICAgaWYoZGljb21QYXJzZXIgPT09IHVuZGVmaW5lZClcbiAgICB7XG4gICAgICAgIGRpY29tUGFyc2VyID0ge307XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZ2V0RGF0YUxlbmd0aFNpemVJbkJ5dGVzRm9yVlIodnIpXG4gICAge1xuICAgICAgICBpZiggdnIgPT09ICdPQicgfHxcbiAgICAgICAgICAgIHZyID09PSAnT1cnIHx8XG4gICAgICAgICAgICB2ciA9PT0gJ1NRJyB8fFxuICAgICAgICAgICAgdnIgPT09ICdPRicgfHxcbiAgICAgICAgICAgIHZyID09PSAnVVQnIHx8XG4gICAgICAgICAgICB2ciA9PT0gJ1VOJylcbiAgICAgICAge1xuICAgICAgICAgICAgcmV0dXJuIDQ7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZVxuICAgICAgICB7XG4gICAgICAgICAgICByZXR1cm4gMjtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGRpY29tUGFyc2VyLnJlYWREaWNvbUVsZW1lbnRFeHBsaWNpdCA9IGZ1bmN0aW9uKGJ5dGVT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hT2Zmc2V0ID0gYnl0ZVN0cmVhbS5wb3NpdGlvbjtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmKGVsZW1lbnQubGVuZ3RoID09PSA0Mjk0OTY3Mjk1KVxuICAgICAgICB7XG4gICAgICAgICAgICBlbGVtZW50LmhhZFVuZGVmaW5lZExlbmd0aCA9IHRydWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZihlbGVtZW50LnRhZyA9PT0gdW50aWxUYWcpIHtcbiAgICAgICAgICAgIHJldHVybiBlbGVtZW50O1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gaWYgVlIgaXMgU1EsIHBhcnNlIHRoZSBzZXF1ZW5jZSBpdGVtc1xuICAgICAgICBpZihlbGVtZW50LnZyID09PSAnU1EnKVxuICAgICAgICB7XG4gICAgICAgICAgICBkaWNvbVBhcnNlci5yZWFkU2VxdWVuY2VJdGVtc0V4cGxpY2l0KGJ5dGVTdHJlYW0sIGVsZW1lbnQsIHdhcm5pbmdzKTtcbiAgICAgICAgICAgIHJldHVybiBlbGVtZW50O1xuICAgICAgICB9XG5cblxuICAgICAgICBpZihlbGVtZW50Lmxlbmd0aCA9PT0gNDI5NDk2NzI5NSlcbiAgICAgICAge1xuICAgICAgICAgICAgaWYoZWxlbWVudC50YWcgPT09ICd4N2ZlMDAwMTAnKSB7XG4gICAgICAgICAgICAgICAgZGljb21QYXJzZXIuZmluZEVuZE9mRW5jYXBzdWxhdGVkRWxlbWVudChieXRlU3RyZWFtLCBlbGVtZW50LCB3YXJuaW5ncyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGVsZW1lbnQ7XG4gICAgICAgICAgICB9ICAgZWxzZSBpZihlbGVtZW50LnZyID09PSAnVU4nKSB7XG4gICAgICAgICAgICAgICAgZGljb21QYXJzZXIuZmluZEFuZFNldFVORWxlbWVudExlbmd0aChieXRlU3RyZWFtLCBlbGVtZW50KTtcbiAgICAgICAgICAgICAgICByZXR1cm4gZWxlbWVudDtcbiAgICAgICAgICAg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0M6IC8vIERBQ1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIlByb2dyYW0gZG9lc24ndCBzdXBwb3J0IGFyaXRobWV0aWMgY29kaW5nLiAoZm9ybWF0IHRocm93IG5ldyBJT0V4Y2VwdGlvbilcIik7XG4gICAgICAgICAgICBjYXNlIDB4RkZEQjpcbiAgICAgICAgICAgICAgICB0aGlzLnF1YW50VGFibGUucmVhZCh0aGlzLnN0cmVhbSwganBlZy5sb3NzbGVzcy5EZWNvZGVyLlRBQkxFKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMHhGRkREOlxuICAgICAgICAgICAgICAgIHRoaXMucmVzdGFydEludGVydmFsID0gdGhpcy5yZWFkTnVtYmVyKCk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDB4RkZFMDpcbiAgICAgICAgICAgIGNhc2UgMHhGRkUxOlxuICAgICAgICAgICAgY2FzZSAweEZGRTI6XG4gICAgICAgICAgICBjYXNlIDB4RkZFMzpcbiAgICAgICAgICAgIGNhc2UgMHhGRkU0OlxuICAgICAgICAgICAgY2FzZSAweEZGRTU6XG4gICAgICAgICAgICBjYXNlIDB4RkZFNjpcbiAgICAgICAgICAgIGNhc2UgMHhGRkU3OlxuICAgICAgICAgICAgY2FzZSAweEZGRTg6XG4gICAgICAgICAgICBjYXNlIDB4RkZFOTpcbiAgICAgICAgICAgIGNhc2UgMHhGRkVBOlxuICAgICAgICAgICAgY2FzZSAweEZGRUI6XG4gICAgICAgICAgICBjYXNlIDB4RkZFQzpcbiAgICAgICAgICAgIGNhc2UgMHhGRkVEOlxuICAgICAgICAgICAgY2FzZSAweEZGRUU6XG4gICAgICAgICAgICBjYXNlIDB4RkZFRjpcbiAgICAgICAgICAgICAgICB0aGlzLnJlYWRBcHAoKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMHhGRkZFOlxuICAgICAgICAgICAgICAgIHRoaXMucmVhZENvbW1lbnQoKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgaWYgKChjdXJyZW50ID4+IDgpICE9PSAweEZGKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkVSUk9SOiBmb3JtYXQgdGhyb3cgbmV3IElPRXhjZXB0aW9uISAoZGVjb2RlKVwiKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBjdXJyZW50ID0gdGhpcy5zdHJlYW0uZ2V0MTYoKTtcbiAgICB9XG5cbiAgICBpZiAoKGN1cnJlbnQgPCAweEZGQzApIHx8IChjdXJyZW50ID4gMHhGRkM3KSkge1xuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJFUlJPUjogY291bGQgbm90IGhhbmRsZSBhcml0aG1ldGljIGNvZGUhXCIpO1xuICAgIH1cblxuICAgIHRoaXMuZnJhbWUucmVhZCh0aGlzLnN0cmVhbSk7XG4gICAgY3VycmVudCA9IHRoaXMuc3RyZWFtLmdldDE2KCk7XG5cbiAgICBkbyB7XG4gICAgICAgIHdoaWxlIChjdXJyZW50ICE9PSAweDBGRkRBKSB7IC8vIFNPU1xuICAgICAgICAgICAgc3dpdGNoIChjdXJyZW50KSB7XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGQzQ6IC8vIERIVFxuICAgICAgICAgICAgICAgICAgICB0aGlzLmh1ZmZUYWJsZS5yZWFkKHRoaXMuc3RyZWFtLCB0aGlzLkh1ZmZUYWIpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZDQzogLy8gREFDXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIlByb2dyYW0gZG9lc24ndCBzdXBwb3J0IGFyaXRobWV0aWMgY29kaW5nLiAoZm9ybWF0IHRocm93IG5ldyBJT0V4Y2VwdGlvbilcIik7XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGREI6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucXVhbnRUYWJsZS5yZWFkKHRoaXMuc3RyZWFtLCBqcGVnLmxvc3NsZXNzLkRlY29kZXIuVEFCTEUpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZERDpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yZXN0YXJ0SW50ZXJ2YWwgPSB0aGlzLnJlYWROdW1iZXIoKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTA6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTE6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTI6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTM6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTQ6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTU6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTY6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTc6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTg6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTk6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRUE6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRUI6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRUM6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRUQ6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRUU6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRUY6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucmVhZEFwcCgpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZGRTpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yZWFkQ29tbWVudCgpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICBpZiAoKGN1cnJlbnQgPj4gOCkgIT09IDB4RkYpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkVSUk9SOiBmb3JtYXQgdGhyb3cgbmV3IElPRXhjZXB0aW9uISAoUGFyc2VyLmRlY29kZSlcIik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY3VycmVudCA9IHRoaXMuc3RyZWFtLmdldDE2KCk7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnByZWNpc2lvbiA9IHRoaXMuZnJhbWUucHJlY2lzaW9uO1xuICAgICAgICB0aGlzLmNvbXBvbmVudHMgPSB0aGlzLmZyYW1lLmNvbXBvbmVudHM7XG5cbiAgICAgICAgaWYgKCF0aGlzLm51bUJ5dGVzKSB7XG4gICAgICAgICAgICB0aGlzLm51bUJ5dGVzID0gcGFyc2VJbnQoTWF0aC5jZWlsKHRoaXMucHJlY2lzaW9uIC8gOCkpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRoaXMubnVtQnl0ZXMgPT0gMSkge1xuICAgICAgICAgICAgdGhpcy5tYXNrID0gMHhGRjtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMubWFzayA9IDB4RkZGRjtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuc2Nhbi5yZWFkKHRoaXMuc3RyZWFtKTtcbiAgICAgICAgdGhpcy5udW1Db21wID0gdGhpcy5zY2FuLm51bUNvbXA7XG4gICAgICAgIHRoaXMuc2VsZWN0aW9uID0gdGhpcy5zY2FuLnNlbGVjdGlvbjtcblxuICAgICAgICBpZiAodGhpcy5udW1CeXRlcyA9PT0gMSkge1xuICAgICAgICAgICAgaWYgKHRoaXMubnVtQ29tcCA9PT0gMykge1xuICAgICAgICAgICAgICAgIHRoaXMuZ2V0dGVyID0gdGhpcy5nZXRWYWx1ZVJHQjtcbiAgICAgICAgICAgICAgICB0aGlzLnNldHRlciA9IHRoaXMuc2V0VmFsdWVSR0I7XG4gICAgICAgICAgICAgICAgdGhpcy5vdXRwdXQgPSB0aGlzLm91dHB1dFJHQjtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5nZXR0ZXIgPSB0aGlzLmdldFZhbHVlODtcbiAgICAgICAgICAgICAgICB0aGlzLnNldHRlciA9IHRoaXMuc2V0VmFsdWU4O1xuICAgICAgICAgICAgICAgIHRoaXMub3V0cHV0ID0gdGhpcy5vdXRwdXRTaW5nbGU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmdldHRlciA9IHRoaXMuZ2V0VmFsdWUxNjtcbiAgICAgICAgICAgIHRoaXMuc2V0dGVyID0gdGhpcy5zZXRWYWx1ZTE2O1xuICAgICAgICAgICAgdGhpcy5vdXRwdXQgPSB0aGlzLm91dHB1dFNpbmdsZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHN3aXRjaCAodGhpcy5zZWxlY3Rpb24pIHtcbiAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICB0aGlzLnNlbGVjdG9yID0gdGhpcy5zZWxlY3QyO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAzOlxuICAgICAgICAgICAgICAgIHRoaXMuc2VsZWN0b3IgPSB0aGlzLnNlbGVjdDM7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAgICAgdGhpcy5zZWxlY3RvciA9IHRoaXMuc2VsZWN0NDtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgICAgICB0aGlzLnNlbGVjdG9yID0gdGhpcy5zZWxlY3Q1O1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA2OlxuICAgICAgICAgICAgICAgIHRoaXMuc2VsZWN0b3IgPSB0aGlzLnNlbGVjdDY7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDc6XG4gICAgICAgICAgICAgICAgdGhpcy5zZWxlY3RvciA9IHRoaXMuc2VsZWN0NztcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgdGhpcy5zZWxlY3RvciA9IHRoaXMuc2VsZWN0MTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuc2NhbkNvbXBzID0gdGhpcy5zY2FuLmNvbXBvbmVudHM7XG4gICAgICAgIHRoaXMucXVhbnRUYWJsZXMgPSB0aGlzLnF1YW50VGFibGUucXVhbnRUYWJsZXM7XG5cbiAgICAgICAgZm9yIChpID0gMDsgaSA8IHRoaXMubnVtQ29tcDsgaSs9MSkge1xuICAgICAgICAgICAgY29tcE4gPSB0aGlzLnNjYW5Db21wc1tpXS5zY2FuQ29tcFNlbDtcbiAgICAgICAgICAgIHRoaXMucVRhYltpXSA9IHRoaXMucXVhbnRUYWJsZXNbdGhpcy5jb21wb25lbnRzW2NvbXBOXS5xdWFudFRhYmxlU2VsXTtcbiAgICAgICAgICAgIHRoaXMubkJsb2NrW2ldID0gdGhpcy5jb21wb25lbnRzW2NvbXBOXS52U2FtcCAqIHRoaXMuY29tcG9uZW50c1tjb21wTl0uaFNhbXA7XG4gICAgICAgICAgICB0aGlzLmRjVGFiW2ldID0gdGhpcy5IdWZmVGFiW3RoaXMuc2NhbkNvbXBzW2ldLmRjVGFiU2VsXVswXTtcbiAgICAgICAgICAgIHRoaXMuYWNUYWJbaV0gPSB0aGlzLkh1ZmZUYWJbdGhpcy5zY2FuQ29tcHNbaV0uYWNUYWJTZWxdWzFdO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy54RGltID0gdGhpcy5mcmFtZS5kaW1YO1xuICAgICAgICB0aGlzLnlEaW0gPSB0aGlzLmZyYW1lLmRpbVk7XG4gICAgICAgIHRoaXMub3V0cHV0RGF0YSA9IG5ldyBEYXRhVmlldyhuZXcgQXJyYXlCdWZmZXIodGhpcy54RGltICogdGhpcy55RGltICogdGhpcy5udW1CeXRlcyAqIHRoaXMubnVtQ29tcCkpO1xuXG4gICAgICAgIHNjYW5OdW0rPTE7XG5cbiAgICAgICAgd2hpbGUgKHRydWUpIHsgLy8gRGVjb2RlIG9uZSBzY2FuXG4gICAgICAgICAgICB0ZW1wWzBdID0gMDtcbiAgICAgICAgICAgIGluZGV4WzBdID0gMDtcblxuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDEwOyBpKz0xKSB7XG4gICAgICAgICAgICAgICAgcHJlZFtpXSA9ICgxIDw8ICh0aGlzLnByZWNpc2lvbiAtIDEpKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHRoaXMucmVzdGFydEludGVydmFsID09PSAwKSB7XG4gICAgICAgICAgICAgICAgY3VycmVudCA9IHRoaXMuZGVjb2RlVW5pdChwcmVkLCB0ZW1wLCBpbmRleCk7XG5cbiAgICAgICAgICAgICAgICB3aGlsZSAoKGN1cnJlbnQgPT09IDApICYmICgodGhpcy54TG9jIDwgdGhpcy54RGltKSAmJiAodGhpcy55TG9jIDwgdGhpcy55RGltKSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vdXRwdXQocHJlZCk7XG4gICAgICAgICAgICAgICAgICAgIGN1cnJlbnQgPSB0aGlzLmRlY29kZVVuaXQocHJlZCwgdGVtcCwgaW5kZXgpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGJyZWFrOyAvL2N1cnJlbnQ9TUFSS0VSXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZvciAobWN1TnVtID0gMDsgbWN1TnVtIDwgdGhpcy5yZXN0YXJ0SW50ZXJ2YWw7IG1jdU51bSs9MSkge1xuICAgICAgICAgICAgICAgIHRoaXMucmVzdGFydGluZyA9IChtY3VOdW0gPT0gMCk7XG4gICAgICAgICAgICAgICAgY3VycmVudCA9IHRoaXMuZGVjb2RlVW5pdChwcmVkLCB0ZW1wLCBpbmRleCk7XG4gICAgICAgICAgICAgICAgdGhpcy5vdXRwdXQocHJlZCk7XG5cbiAgICAgICAgICAgICAgICBpZiAoY3VycmVudCAhPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChjdXJyZW50ID09PSAwKSB7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMubWFya2VySW5kZXggIT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudCA9ICgweEZGMDAgfCB0aGlzLm1hcmtlcik7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMubWFya2VySW5kZXggPSAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGN1cnJlbnQgPSB0aGlzLnN0cmVhbS5nZXQxNigpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCEoKGN1cnJlbnQgPj0ganBlZy5sb3NzbGVzcy5EZWNvZGVyLlJFU1RBUlRfTUFSS0VSX0JFR0lOKSAmJlxuICAgICAgICAgICAgICAgIChjdXJyZW50IDw9IGpwZWcubG9zc2xlc3MuRGVjb2Rlci5SRVNUQVJUX01BUktFUl9FTkQpKSkge1xuICAgICAgICAgICAgICAgIGJyZWFrOyAvL2N1cnJlbnQ9TUFSS0VSXG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoKGN1cnJlbnQgPT09IDB4RkZEQykgJiYgKHNjYW5OdW0g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B0ZW1wLCBpbmRleCk7XG4gICAgICAgICAgICB0aGlzLklEQ1RfU291cmNlWzBdICo9IHF0YWJbMF07XG5cbiAgICAgICAgICAgIGZvciAoaiA9IDE7IGogPCA2NDsgais9MSkge1xuICAgICAgICAgICAgICAgIHZhbHVlID0gdGhpcy5nZXRIdWZmbWFuVmFsdWUoYWN0YWIsIHRlbXAsIGluZGV4KTtcblxuICAgICAgICAgICAgICAgIGlmICh2YWx1ZSA+PSAweEZGMDApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGogKz0gKHZhbHVlID4+IDQpO1xuXG4gICAgICAgICAgICAgICAgaWYgKCh2YWx1ZSAmIDB4MEYpID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgodmFsdWUgPj4gNCkgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5JRENUX1NvdXJjZVtqcGVnLmxvc3NsZXNzLkRlY29kZXIuSURDVF9QW2pdXSA9IHRoaXMuZ2V0bihpbmRleCwgdmFsdWUgJiAweDBGLCB0ZW1wLCBpbmRleCkgKiBxdGFiW2pdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiAwO1xufTtcblxuXG5cbmpwZWcubG9zc2xlc3MuRGVjb2Rlci5wcm90b3R5cGUuZGVjb2RlU2luZ2xlID0gZnVuY3Rpb24gKHByZXYsIHRlbXAsIGluZGV4KSB7XG4gICAgLypqc2xpbnQgYml0d2lzZTogdHJ1ZSAqL1xuXG4gICAgdmFyIHZhbHVlLCBpLCBuLCBuUmVzdGFydDtcblxuICAgIGlmICh0aGlzLnJlc3RhcnRpbmcpIHtcbiA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5kZXgpIHtcbiAgICAvKmpzbGludCBiaXR3aXNlOiB0cnVlICovXG5cbiAgICB2YXIgY29kZSwgaW5wdXQsIG1hc2s7XG4gICAgbWFzayA9IDB4RkZGRjtcblxuICAgIGlmIChpbmRleFswXSA8IDgpIHtcbiAgICAgICAgdGVtcFswXSA8PD0gODtcbiAgICAgICAgaW5wdXQgPSB0aGlzLnN0cmVhbS5nZXQ4KCk7XG4gICAgICAgIGlmIChpbnB1dCA9PT0gMHhGRikge1xuICAgICAgICAgICAgdGhpcy5tYXJrZXIgPSB0aGlzLnN0cmVhbS5nZXQ4KCk7XG4gICAgICAgICAgICBpZiAodGhpcy5tYXJrZXIgIT09IDApIHtcbiAgICAgICAgICAgICAgICB0aGlzLm1hcmtlckluZGV4ID0gOTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0ZW1wWzBdIHw9IGlucHV0O1xuICAgIH0gZWxzZSB7XG4gICAgICAgIGluZGV4WzBdIC09IDg7XG4gICAgfVxuXG4gICAgY29kZSA9IHRhYmxlW3RlbXBbMF0gPj4gaW5kZXhbMF1dO1xuXG4gICAgaWYgKChjb2RlICYganBlZy5sb3NzbGVzcy5EZWNvZGVyLk1TQikgIT09IDApIHtcbiAgICAgICAgaWYgKHRoaXMubWFya2VySW5kZXggIT09IDApIHtcbiAgICAgICAgICAgIHRoaXMubWFya2VySW5kZXggPSAwO1xuICAgICAgICAgICAgcmV0dXJuIDB4RkYwMCB8IHRoaXMubWFya2VyO1xuICAgICAgICB9XG5cbiAgICAgICAgdGVtcFswXSAmPSAobWFzayA+PiAoMTYgLSBpbmRleFswXSkpO1xuICAgICAgICB0ZW1wWzBdIDw8PSA4O1xuICAgICAgICBpbnB1dCA9IHRoaXMuc3RyZWFtLmdldDgoKTtcblxuICAgICAgICBpZiAoaW5wdXQgPT09IDB4RkYpIHtcbiAgICAgICAgICAgIHRoaXMubWFya2VyID0gdGhpcy5zdHJlYW0uZ2V0OCgpO1xuICAgICAgICAgIC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R1cm4gMDtcbiAgICB9XG5cbiAgICBpZiAobiA9PT0gMTYpIHtcbiAgICAgICAgaWYgKFBSRURbMF0gPj0gMCkge1xuICAgICAgICAgICAgcmV0dXJuIC0zMjc2ODtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiAzMjc2ODtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGluZGV4WzBdIC09IG47XG5cbiAgICBpZiAoaW5kZXhbMF0gPj0gMCkge1xuICAgICAgICBpZiAoKGluZGV4WzBdIDwgdGhpcy5tYXJrZXJJbmRleCkgJiYgIXRoaXMuaXNMYXN0UGl4ZWwoKSkgeyAvLyB0aGlzIHdhcyBjb3JydXB0aW5nIHRoZSBsYXN0IHBpeGVsIGluIHNvbWUgY2FzZXNcbiAgICAgICAgICAgIHRoaXMubWFya2VySW5kZXggPSAwO1xuICAgICAgICAgICAgcmV0dXJuICgweEZGMDAgfCB0aGlzLm1hcmtlcikgPDwgODtcbiAgICAgICAgfVxuXG4gICAgICAgIHJlc3VsdCA9IHRlbXBbMF0gPj4gaW5kZXhbMF07XG4gICAgICAgIHRlbXBbMF0gJj0gKG1hc2sgPj4gKDE2IC0gaW5kZXhbMF0pKTtcbiAgICB9IGVsc2Uge1xuICAgICAgICB0ZW1wWzBdIDw8PSA4O1xuICAgICAgICBpbnB1dCA9IHRoaXMuc3RyZWFtLmdldDgoKTtcblxuICAgICAgICBpZiAoaW5wdXQgPT09IDB4RkYpIHtcbiAgICAgICAgICAgIHRoaXMubWFya2VyID0gdGhpcy5zdHJlYW0uZ2V0OCgpO1xuICAgICAgICAgICAgaWYgKHRoaXMubWFya2VyICE9PSAwKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5tYXJrZXJJbmRleCA9IDk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICB0ZW1wWzBdIHw9IGlucHV0O1xuICAgICAgICBpbmRleFswXSArPSA4O1xuXG4gICAgICAgIGlmIChpbmRleFswXSA8IDApIHtcbiAgICAgICAgICAgIGlmICh0aGlzLm1hcmtlckluZGV4ICE9PSAwKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5tYXJrZXJJbmRleCA9IDA7XG4gICAgICAgICAgICAgICAgcmV0dXJuICgweEZGMDAgfCB0aGlzLm1hcmtlcikgPDwgODtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGVtcFswXSA8PD0gODtcbiAgICAgICAgICAgIGlucHV0ID0gdGhpcy5zdHJlYW0uZ2V0OCgpO1xuXG4gICAgICAgICAgICBpZiAoaW5wdXQgPT09IDB4RkYpIHtcbiAgICAgICAgICAgICAgICB0aGlzLm1hcmtlciA9IHRoaXMuc3RyZWFtLmdldDgoKTtcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5tYXJrZXIgIT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5tYXJrZXJJbmRleCA9IDk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB0ZW1wWzBdIHw9IGlucHV0O1xuICAgICAgICAgICAgaW5kZXhbMF0gKz0gODtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChpbmRleFswXSA8IDApIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcImluZGV4PVwiICsgaW5kZXhbMF0gKyBcIiBpbiBnZXRuKClcIik7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoaW5kZXhbMF0gPCB0aGlzLm1hcmtlckluZGV4KSB7XG4gICAgICAgICAgICB0aGlzLm1hcmtlckluZGV4ID0gMDtcbiAgICAgICAgICAgIHJldHVybiAoMHhGRjAwIHwgdGhpcy5tYXJrZXIpIDw8IDg7XG4gICAgICAgIH1cblxuICAgICAgICByZXN1bHQgPSB0ZW1wWzBdID4+IGluZGV4WzBdO1xuICAgICAgICB0ZW1wWzBdICY9IChtYXNrID4+ICgxNiAtIGluZGV4WzBdKSk7XG4gICAgfVxuXG4gICAgaWYgKHJlc3V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BpIDwgMTY7IGkrPTEpIHtcbiAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCB0aGlzLmxbdF1bY11baV07IGorPTEpIHtcbiAgICAgICAgICAgICAgICBpZiAoY291bnQgPiBsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiRVJST1I6IEh1ZmZtYW4gdGFibGUgZm9ybWF0IGVycm9yIFtjb3VudD5MaF1cIik7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdGhpcy52W3RdW2NdW2ldW2pdID0gZGF0YS5nZXQ4KCk7XG4gICAgICAgICAgICAgICAgY291bnQrPTE7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBpZiAoY291bnQgIT09IGxlbmd0aCkge1xuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJFUlJPUjogSHVmZm1hbiB0YWJsZSBmb3JtYXQgZXJyb3IgW2NvdW50IT1MZl1cIik7XG4gICAgfVxuXG4gICAgZm9yIChpID0gMDsgaSA8IDQ7IGkrPTEpIHtcbiAgICAgICAgZm9yIChqID0gMDsgaiA8IDI7IGorPTEpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLnRjW2ldW2pdICE9PSAwKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5idWlsZEh1ZmZUYWJsZShIdWZmVGFiW2ldW2pdLCB0aGlzLmxbaV1bal0sIHRoaXMudltpXVtqXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gMTtcbn07XG5cblxuXG4vL1x0QnVpbGRfSHVmZlRhYigpXG4vL1x0UGFyYW1ldGVyOiAgdCAgICAgICB0YWJsZSBJRFxuLy9cdCAgICAgICAgICAgIGMgICAgICAgdGFibGUgY2xhc3MgKCAwIGZvciBEQywgMSBmb3IgQUMgKVxuLy9cdCAgICAgICAgICAgIExbaV0gICAgIyBvZiBjb2Rld29yZHMgd2h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AgICAgICAgaWYgKHRoaXMucHJlY2lzaW9uW3RdID09PSAwKSB7XG4gICAgICAgICAgICB0aGlzLnByZWNpc2lvblt0XSA9IDg7XG4gICAgICAgIH0gZWxzZSBpZiAodGhpcy5wcmVjaXNpb25bdF0gPT09IDEpIHtcbiAgICAgICAgICAgIHRoaXMucHJlY2lzaW9uW3RdID0gMTY7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJFUlJPUjogUXVhbnRpemF0aW9uIHRhYmxlIHByZWNpc2lvbiBlcnJvclwiKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMudHFbdF0gPSAxO1xuXG4gICAgICAgIGlmICh0aGlzLnByZWNpc2lvblt0XSA9PT0gOCkge1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDY0OyBpKz0xKSB7XG4gICAgICAgICAgICAgICAgaWYgKGNvdW50ID4gbGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkVSUk9SOiBRdWFudGl6YXRpb24gdGFibGUgZm9ybWF0IGVycm9yXCIpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHRoaXMucXVhbnRUYWJsZXNbdF1baV0gPSBkYXRhLmdldDgoKTtcbiAgICAgICAgICAgICAgICBjb3VudCs9MTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAganBlZy5sb3NzbGVzcy5RdWFudGl6YXRpb25UYWJsZS5lbmhhbmNlUXVhbnRpemF0aW9uVGFibGUodGhpcy5xdWFudFRhYmxlc1t0XSwgdGFibGUpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDY0OyBpKz0xKSB7XG4gICAgICAgICAgICAgICAgaWYgKGNvdW50ID4gbGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkVSUk9SOiBRdWFud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Npb25Db2RlKHJhd0RhdGEpO1xuICAgICAgICB9XG4gICAgfVxufTtcblxuXG4vKipcbiAqIFJldHVybnMgYSBmb3JtYXR0ZWQgc3RyaW5nIG9mIGhlYWRlciBmaWVsZHMuXG4gKiBAcmV0dXJucyB7c3RyaW5nfVxuICovXG5uaWZ0aS5OSUZUSTEucHJvdG90eXBlLnRvRm9ybWF0dGVkU3RyaW5nID0gZnVuY3Rpb24gKCkge1xuICAgIHZhciBmbXQgPSBuaWZ0aS5VdGlscy5mb3JtYXROdW1iZXIsXG4gICAgICAgIHN0cmluZyA9IFwiXCI7XG5cbiAgICBzdHJpbmcgKz0gKFwiRGltIEluZm8gPSBcIiArIHRoaXMuZGltX2luZm8gKyBcIlxcblwiKTtcblxuICAgIHN0cmluZyArPSAoXCJJbWFnZSBEaW1lbnNpb25zICgxLTgpOiBcIiArXG4gICAgICAgIHRoaXMuZGltc1swXSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuZGltc1sxXSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuZGltc1syXSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuZGltc1szXSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuZGltc1s0XSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuZGltc1s1XSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuZGltc1s2XSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuZGltc1s3XSArIFwiXFxuXCIpO1xuXG4gICAgc3RyaW5nICs9IChcIkludGVudCBQYXJhbWV0ZXJzICgxLTMpOiBcIiArXG4gICAgICAgIHRoaXMuaW50ZW50X3AxICsgXCIsIFwiICtcbiAgICAgICAgdGhpcy5pbnRlbnRfcDIgKyBcIiwgXCIgK1xuICAgICAgICB0aGlzLmludGVudF9wMykgKyBcIlxcblwiO1xuXG4gICAgc3RyaW5nICs9IChcIkludGVudCBDb2RlID0gXCIgKyB0aGlzLmludGVudF9jb2RlICsgXCJcXG5cIik7XG4gICA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vcnRob2dvbmFsaXplIGogYXhpcyB0byBpIGF4aXMsIGlmIG5lZWRlZCAqL1xuICAgIHZhbCA9IHhpICogeGogKyB5aSAqIHlqICsgemkgKiB6ajsgICAgLyogZG90IHByb2R1Y3QgYmV0d2VlbiBpIGFuZCBqICovXG4gICAgaWYgKE1hdGguYWJzKHZhbCkgPiAxLkUtNCkge1xuICAgICAgICB4aiAtPSB2YWwgKiB4aTtcbiAgICAgICAgeWogLT0gdmFsICogeWk7XG4gICAgICAgIHpqIC09IHZhbCAqIHppO1xuICAgICAgICB2YWwgPSBNYXRoLnNxcnQoeGogKiB4aiArIHlqICogeWogKyB6aiAqIHpqKTsgIC8qIG11c3QgcmVub3JtYWxpemUgKi9cbiAgICAgICAgaWYgKHZhbCA9PT0gMC4wKSB7ICAgICAgICAgICAgICAvKiBqIHdhcyBwYXJhbGxlbCB0byBpPyAqL1xuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgeGogLz0gdmFsO1xuICAgICAgICB5aiAvPSB2YWw7XG4gICAgICAgIHpqIC89IHZhbDtcbiAgICB9XG5cbiAgICAvKiBub3JtYWxpemUgayBheGlzOyBpZiBpdCBpcyB6ZXJvLCBtYWtlIGl0IHRoZSBjcm9zcyBwcm9kdWN0IGkgeCBqICovXG4gICAgdmFsID0gTWF0aC5zcXJ0KHhrICogeGsgKyB5ayAqIHlrICsgemsgKiB6ayk7XG4gICAgaWYgKHZhbCA9PT0gMC4wKSB7XG4gICAgICAgIHhrID0geWkgKiB6aiAtIHppICogeWo7XG4gICAgICAgIHlrID0gemkgKiB4aiAtIHpqICogeGk7XG4gICAgICAgIHprID0geGkgKiB5aiAtIHlpICogeGo7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgeGsgLz0gdmFsO1xuICAgICAgICB5ayAvPSB2YWw7XG4gICAgICAgIHprIC89IHZhbDtcbiAgICB9XG5cbiAgICAvKiBvcnRob2dvbmFsaXplIGsgdG8gaSAqL1xuICAgIHZhbCA9IHhpICogeGsgKyB5aSAqIHlrICsgemkgKiB6azsgICAgLyogZG90IHByb2R1Y3QgYmV0d2VlbiBpIGFuZCBrICovXG4gICAgaWYgKE1hdGguYWJzKHZhbCkgPiAxLkUtNCkge1xuICAgICAgICB4ayAtPSB2YWwgKiB4aTtcbiAgICAgICAgeWsgLT0gdmFsICogeWk7XG4gICAgICAgIHprIC09IHZhbCAqIHppO1xuICAgICAgICB2YWwgPSBNYXRoLnNxcnQoeGsgKiB4ayArIHlrICogeWsgKyB6ayAqIHprKTtcbiAgICAgICAgaWYgKHZhbCA9PT0gMC4wKSB7ICAgIC8qIGJhZCAqL1xuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgeGsgLz0gdmFsO1xuICAgICAgICB5ayAvPSB2YWw7XG4gICAgICAgIHprIC89IHZhbDtcbiAgICB9XG5cbiAgICAvKiBvcnRob2dvbmFsaXplIGsgdG8gaiAqL1xuICAgIHZhbCA9IHhqICogeGsgKyB5aiAqIHlrICsgemogKiB6azsgICAgLyogZG90IHByb2R1Y3QgYmV0d2VlbiBqIGFuZCBrICovXG4gICAgaWYgKE1hdGguYWJzKHZhbCkgPiAxLmUtNCkge1xuICAgICAgICB4ayAtPSB2YWwgKiB4ajtcbiAgICAgICAgeWsgLT0gdmFsICogeWo7XG4gICAgICAgIHprIC09IHZhbCAqIHpqO1xuICAgICAgICB2YWwgPSBNYXRoLnNxcnQoeGsgKiB4ayArIHlrICogeWsgKyB6ayAqIHprKTtcbiAgICAgICAgaWYgKHZhbCA9PT0gMC4wKSB7ICAgICAvKiBiYWQgKi9cbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9XG4gICAgICAgIHhrIC89IHZhbDtcbiAgICAgICAgeWsgLz0gdmFsO1xuICAgICAgICB6ayAvPSB2YWw7XG4gICAgfVxuXG4gICAgUVswXVswXSA9IHhpO1xuICAgIFFbMF1bMV0gPSB4ajtcbiAgICBRWzBd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gIGZvciAoaSA9IDE7IGkgPD0gMzsgaSArPSAxKSB7ICAgICAvKiBpID0gY29sdW1uIG51bWJlciB0byB1c2UgZm9yIHJvdyAjMSAqL1xuICAgICAgICBmb3IgKGogPSAxOyBqIDw9IDM7IGogKz0gMSkgeyAgICAvKiBqID0gY29sdW1uIG51bWJlciB0byB1c2UgZm9yIHJvdyAjMiAqL1xuICAgICAgICAgICAgaWYgKGkgIT09IGopIHtcbiAgICAgICAgICAgICAgICBmb3IgKGsgPSAxOyBrIDw9IDM7IGsgKz0gMSkgeyAgLyogayA9IGNvbHVtbiBudW1iZXIgdG8gdXNlIGZvciByb3cgIzMgKi9cbiAgICAgICAgICAgICAgICAgICAgaWYgKCEoaSA9PT0gayB8fCBqID09PSBrKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgUFswXVswXSA9IFBbMF1bMV0gPSBQWzBdWzJdID0gUFsxXVswXSA9IFBbMV1bMV0gPSBQWzFdWzJdID0gUFsyXVswXSA9IFBbMl1bMV0gPSBQWzJdWzJdID0gMC4wO1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChwID0gLTE7IHAgPD0gMTsgcCArPSAyKSB7ICAgIC8qIHAscSxyIGFyZSAtMSBvciArMSAgICAgICovXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChxID0gLTE7IHEgPD0gMTsgcSArPSAyKSB7ICAgLyogYW5kIGdvIGludG8gcm93cyAjMSwyLDMgKi9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChyID0gLTE7IHIgPD0gMTsgciArPSAyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQWzBdW2kgLSAxXSA9IHA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQWzFdW2ogLSAxXSA9IHE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQWzJdW2sgLSAxXSA9IHI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXRQID0gdGhpcy5uaWZ0aV9tYXQzM19kZXRlcm0oUCk7ICAgICAgICAgICAvKiBzaWduIG9mIHBlcm11dGF0aW9uICovXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGRldFAgKiBkZXRRKSA+IDAuMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE0gPSB0aGlzLm5pZnRpX21hdDMzX211bChQLCBRKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGFuZ2xlIG9mIE0gcm90YXRpb24gPSAyLjAqYWNvcygwLjUqc3FydCgxLjArdHJhY2UoTSkpKSAgICAgICAqL1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHdlIHdhbnQgbGFyZ2VzdCB0cmFjZShNKSA9PSBzbWFsbGVzdCBhbmdsZSA9PSBNIG5lYXJlc3QgdG8gSSAqL1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsID0gTVswXVswXSArIE1bMV1bMV0gKyBNWzJdWzJdOyAvKiB0cmFjZSAqL1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWwgPiB2YmVzdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YmVzdCA9IHZhbDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWJlc3QgPSBpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqYmVzdCA9IGo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtiZXN0ID0gaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGJlc3QgPSBwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxYmVzdCA9IHE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJiZXN0ID0gcjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ICAvKiBkb2Vzbid0IG1hdGNoIHNpZ24gb2YgUSAqL1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgLyogQXQgdGhpcyBwb2ludCBpYmVzdCBpcyAxIG9yIDIgb3IgMzsgcGJlc3QgaXMgLTEgb3IgKzE7IGV0Yy5cblxuICAgICBUaGUgbWF0cml4IFAgdGhhdCBjb3JyZXNwb25kcyBpcyB0aGUgYmVzdCBwZXJtdXRhdGlvbiBhcHByb3hpbWF0aW9uXG4gICAgIHRvIFEtaW52ZXJzZTsgdGhhdCBpcywgUCAoYXBwcm94aW1hdGVseSkgdGFrZXMgKHgseSx6KSBjb29yZGluYXRlc1xuICAgICB0byB0aGUgKGksaixrKSBheGVzLlxuXG4gICAgIEZvciBleGFtcGxlLCB0aGUgZmlyc3Qgcm93IG9mIFAgKHdoaWNoIGNvbnRhaW5zIHBiZXN0IGluIGNvbHVtbiBpYmVzdClcbiAgICAgZGV0ZXJtaW5lcyB0aGUgd2F5IHRoZSBpIGF4aXMgcG9pbnRzIHJlbGF0aXZlIHRvIHRoZSBhbmF0b21pY2FsXG4gICAgICh4LHkseikgYXhlcy4gIElmIGliZXN0IGlzIDIsIHRoZW4gdGhlIGkgYXhpcyBpcyBhbG9uZyB0aGUgeSBheGlzLFxuICAgICB3aGljaCBpcyBkaXJlY3Rpb24gUDJBIChpZiBwYmVzdCA+IDApIG9yIEEyUCAoaWYgcGJlc3QgPCAwKS5cblxuICAgICBTbywgdXNpbmcgaWJlc3QgYW5kIHBiZXN0LCB3ZSBjYW4gYXNzaWduIHRoZSBvdXRwdXQgY29kZSBmb3JcbiAgICAgdGhlIGkgYXhpcy4gIE11dGF0aXMgbXV0YW5kaXMgZm9yIHRoZSBqIGFuZCBrIGF4ZXMsIG9mIGNvdXJzZS4gKi9cblxuICAgIGlDaGFyID0gakNoYXIgPSBrQ2hhciA9IGlTZW5zZSA9IGpTZW5zZSA9IGtTZW5zZSA9IDA7XG5cbiAgICBzd2l0Y2ggKGliZXN0ICogcGJlc3QpIHtcbiAgICAgICAgY2FzZSAxOiAvKmkgPSBOSUZUSV9MMlIqL1xuICAgICAgICAgICAgaUNoYXIgPSAnWCc7XG4gICAgICAgICAgICBpU2Vuc2UgPSAnKyc7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAtMTogLyppID0gTklGVElfUjJMKi9cbiAgICAgICAgICAgIGlDaGFyID0gJ1gnO1xuICAgICAgICAgICAgaVNlbnNlID0gJy0nO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgMjogLyppID0gTklGVElfUDJBKi9cbiAgICAgICAgICAgIGlDaGFyID0gJ1knO1xuICAgICAgICAgICAgaVNlbnNlID0gJysnO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgLTI6IC8qaSA9IE5JRlRJX0EyUCovXG4gICAgICAgICAgICBpQ2hhciA9ICdZJztcbiAgICAgICAgICAgIGlTZW5zZSA9ICctJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIDM6IC8qaSA9IE5JRlRJX0kyUyovXG4gICAgICAgICAgICBpQ2hhciA9ICdaJztcbiAgICAgICAgICAgIGlTZW5zZSA9ICcrJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIC0zOiAvKmkgPSBOSUZUSV9TMkkqL1xuICAgICAgICAgICAgaUNoYXIgPSAnWic7XG4gICAgICAgICAgICBpU2Vuc2UgPSAnLSc7XG4gICAgICAgICAgICBicmVhaztcbiAgICB9XG5cbiAgICBzd2l0Y2ggKGpiZXN0ICogcWJlc3QpIHtcbiAgICAgICAgY2FzZSAxOiAvKmogPSBOSUZUSV9MMlIqL1xuICAgICAgICAgICAgakNoYXIgPSAnWCc7XG4gICAgICAgICAgICBqU2Vuc2UgPSAnKyc7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAtMTogLypqID0gTklGVElfUjJMKi9cbiAgICAgICAgICAgIGpDaGFyID0gJ1gnO1xuICAgICAgICAgICAgalNlbnNlID0gJy0nO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgMjogLypqID0gTklGVElfUDJBKi9cbiAgICAgICAgICAgIGpDaGFyID0gJ1knO1xuICAgICAgICAgICAgalNlbnNlID0gJysnO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgLTI6IC8qaiA9IE5JRlRJX0EyUCovXG4gICAgICAgICAgICBqQ2hhciA9ICdZJztcbiAgICAgICAgICAgIGpTZW5zZSA9ICctJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIDM6IC8qaiA9IE5JRlRJX0kyUyovXG4gICAgICAgICAgICBqQ2hhciA9ICdaJztcbiAgICAgICAgICAgIGpTZW5zZSA9ICcrJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIC0zOiAvKmogPSBOSUZUSV9TMkkqL1xuICAgICAgICAgICAgakNoYXIgPSAnWic7XG4gICAgICAgICAgICBqU2Vuc2UgPSAnLSc7XG4gICAgICAgICAgICBicmVhaztcbiAgICB9XG5cbiAgICBzd2l0Y2ggKGtiZXN0ICogcmJlc3QpIHtcbiAgICAgICAgY2FzZSAxOiAvKmsgPSBOSUZUSV9MMlIqL1xuICAgICAgICAgICAga0NoYXIgPSAnWCc7XG4gICAgICAgICAgICBrU2Vuc2UgPSAnKyc7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAtMTogLyprID0gTklGVElfUjJMKi9cbiAgICAgICAgICAgIGtDaGFyID0gJ1gnO1xuICAgICAgICAgICAga1NlbnNlID0gJy0nO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgMjogLyprID0gTklGVElfUDJBKi9cbiAgICAgICAgICAgIGtDaGFyID0gJ1knO1xuICAgICAgICAgICAga1NlbnNlID0gJysnO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgLTI6IC8qayA9IE5JRlRJX0EyUCovXG4gICAgICAgICAgICBrQ2hhciA9ICdZJztcbiAgICAgICAgICAgIGtTZW5zZSA9ICctJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIDM6IC8qayA9IE5JRlRJX0kyUyovXG4gICAgICAgICAgICBrQ2hhciA9ICdaJztcbiAgICAgICAgICAgIGtTZW5zZSA9ICcrJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIC0zOiAvKmsgPSBOSUZUSV9TMkkqL1xuICAgICAgICAgICAga0NoYXIgPSAnWic7XG4gICAgICAgICAgICBrU2Vuc2UgPSAnLSc7XG4gICAgICAgICAgICBicmVhaztcbiAgICB9XG5cbiAgICByZXR1cm4gKGlDaGFyICsgakNoYXIgKyBrQ2hhciArIGlTZW5zZSArIGpTZW5zZSArIGtTZW5zZSk7XG59O1xuXG5cblxubmlmdGkuTklGVEkxLnByb3RvdHlwZS5uaWZ0aV9tYXQzM19tdWwgPSBmdW5jdGlvbiAoQSwgQikge1xuICAgIHZhciBDID0gW1swLCAwLCAwXSwgWzAsIDAsIDBdLCBbMCwgMCwgMF1dLFxuICAgICAgICBpLFxuICAgICAgICBqO1xuXG4gICAgZm9yIChpID0gMDsgaSA8IDM7IGkgKz0gMSkge1xuICAgICAgICBmb3IgKGogPSAwOyBqIDwgMzsgaiArPSAxKSB7XG4gICAgICAgICAgIC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UJpdHNQZXJWb3hlbCArIFwiXFxuXCIpO1xuICAgIHN0cmluZyArPSAoXCJJbWFnZSBEaW1lbnNpb25zXCIgKyBcIiAoMS04KTogXCIgK1xuICAgICAgICB0aGlzLmRpbXNbMF0gKyBcIiwgXCIgK1xuICAgICAgICB0aGlzLmRpbXNbMV0gKyBcIiwgXCIgK1xuICAgICAgICB0aGlzLmRpbXNbMl0gKyBcIiwgXCIgK1xuICAgICAgICB0aGlzLmRpbXNbM10gKyBcIiwgXCIgK1xuICAgICAgICB0aGlzLmRpbXNbNF0gKyBcIiwgXCIgK1xuICAgICAgICB0aGlzLmRpbXNbNV0gKyBcIiwgXCIgK1xuICAgICAgICB0aGlzLmRpbXNbNl0gKyBcIiwgXCIgK1xuICAgICAgICB0aGlzLmRpbXNbN10gKyBcIlxcblwiKTtcblxuICAgIHN0cmluZyArPSAoXCJJbnRlbnQgUGFyYW1ldGVycyAoMS0zKTogXCIgK1xuICAgICAgICB0aGlzLmludGVudF9wMSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuaW50ZW50X3AyICsgXCIsIFwiICtcbiAgICAgICAgdGhpcy5pbnRlbnRfcDMpICsgXCJcXG5cIjtcblxuICAgIHN0cmluZyArPSAoXCJWb3hlbCBEaW1lbnNpb25zICgxLTgpOiBcIiArXG4gICAgICAgIGZtdCh0aGlzLnBpeERpbXNbMF0pICsgXCIsIFwiICtcbiAgICAgICAgZm10KHRoaXMucGl4RGltc1sxXSkgKyBcIiwgXCIgK1xuICAgICAgICBmbXQodGhpcy5waXhEaW1zWzJdKSArIFwiLCBcIiArXG4gICAgICAgIGZtdCh0aGlzLnBpeERpbXNbM10pICsgXCIsIFwiICtcbiAgICAgICAgZm10KHRoaXMucGl4RGltc1s0XSkgKyBcIiwgXCIgK1xuICAgICAgICBmbXQodGhpcy5waXhEaW1zWzVdKSArIFwiLCBcIiArXG4gICAgICAgIGZtdCh0aGlzLnBpeERpbXNbNl0pICsgXCIsIFwiICtcbiAgICAgICAgZm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aW1lXCI6XG4gICAgIFx0ICBjYXNlIFwiUkFTVFwiOlxuICAgICBcdCAgICAgIHNwYWNlRGltZW5zaW9uID0gNDtcbiAgICAgXHQgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBcImxlZnQtYW50ZXJpb3Itc3VwZXJpb3ItdGltZVwiOlxuICAgICAgICBjYXNlIFwiTEFTVFwiOlxuICAgICAgICAgICAgc3BhY2VEaW1lbnNpb24gPSA0O1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgXCJsZWZ0LXBvc3Rlcmlvci1zdXBlcmlvci10aW1lXCI6XG4gICAgICAgIGNhc2UgXCJMUFNUXCI6XG4gICAgICAgICAgICBzcGFjZURpbWVuc2lvbiA9IDQ7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBcInNjYW5uZXIteHl6XCI6XG4gICAgICAgICAgICBzcGFjZURpbWVuc2lvbiA9IDM7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBcInNjYW5uZXIteHl6LXRpbWVcIjpcbiAgICAgICAgICAgIHNwYWNlRGltZW5zaW9uID0gNDtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIFwiM0QtcmlnaHQtaGFuZGVkXCI6XG4gICAgICAgICAgICBzcGFjZURpbWVuc2lvbiA9IDM7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBcIjNELWxlZnQtaGFuZGVkXCI6XG4gICAgICAgICAgICBzcGFjZURpbWVuc2lvbiA9IDM7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBcIjNELXJpZ2h0LWhhbmRlZC10aW1lXCI6XG4gICAgICAgICAgICBzcGFjZURpbWVuc2lvbiA9IDQ7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBcIjNELWxlZnQtaGFuZGVkLXRpbWVcIjpcbiAgICAgICAgICAgIHNwYWNlRGltZW5zaW9uID0gNDtcbiAgICAgICAg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ICAgICAgICAgICAgLy8gVGhpcyBzaG91bGQgYmUgdGhlIGxhc3QgZmllbGQgc3BlY2lmaWNhdGlvbixcbiAgICAgICAgICAgICAgICAvLyBhbmQgdGhlIHJlc3Qgb2YgdGhlIGxpbmVzIHNob3VsZCBjb250YWluIGZpbGUgbmFtZXMuXG4gICAgICAgICAgICAgICAgaWYgKG1hdGNoMi5sZW5ndGggPT0gMiAmJiBtYXRjaDJbMV0pIHsgLy8gc3ViZGltIHNwZWNpZmljYXRpb25cbiAgICAgICAgICAgICAgICAgICAgcmV0W21hdGNoWzFdXSA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVzOiBsaW5lcy5zbGljZShpKzEpLFxuICAgICAgICAgICAgICAgICAgICAgICAgc3ViZGltOiBwYXJzZU5SUkRJbnRlZ2VyKG1hdGNoMlsxXSlcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXRbbWF0Y2hbMV1dID0gbGluZXMuc2xpY2UoaSsxKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbGluZXMubGVuZ3RoID0gaTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0W21hdGNoWzFdXSA9IHBhcnNlRmllbGQobWF0Y2hbMV0sIG1hdGNoWzNdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChtYXRjaFsyXSA9PSAnOj0nKSB7IC8vIEtleS92YWx1ZSBwYWlyXG4gICAgICAgICAgICByZXQua2V5c1ttYXRjaFsxXV0gPSB1bmVzY2FwZVZhbHVlKG1hdGNoWzNdKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkxvZ2ljIGVycm9yIGluIE5SUkQgcGFyc2VyLlwiKTsgLy8gVGhpcyBzaG91bGQgbmV2ZXIgaGFwcGVuICh1b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IjpcbiAgICAgICAgICAgIGNoZWNrU2l6ZSgyKTtcbiAgICAgICAgICAgIHJldHVybiBuZXcgVWludDE2QXJyYXkoYnVmZmVyLnNsaWNlKDAsdG90YWxMZW4qMikpO1xuICAgICAgICBjYXNlIFwiaW50MzJcIjpcbiAgICAgICAgICAgIGNoZWNrU2l6ZSg0KTtcbiAgICAgICAgICAgIHJldHVybiBuZXcgSW50MzJBcnJheShidWZmZXIuc2xpY2UoMCx0b3RhbExlbio0KSk7XG4gICAgICAgIGNhc2UgXCJ1aW50MzJcIjpcbiAgICAgICAgICAgIGNoZWNrU2l6ZSg0KTtcbiAgICAgICAgICAgIHJldHVybiBuZXcgVWludDMyQXJyYXkoYnVmZmVyLnNsaWNlKDAsdG90YWxMZW4qNCkpO1xuICAgICAgICAvL2Nhc2UgXCJpbnQ2NFwiOlxuICAgICAgICAvLyAgICBjaGVja1NpemUoOCk7XG4gICAgICAgIC8vICAgIHJldHVybiBuZXcgSW50NjRBcnJheShidWZmZXIuc2xpY2UoMCx0b3RhbExlbio4KSk7XG4gICAgICAgIC8vY2FzZSBcInVpbnQ2NFwiOlxuICAgICAgICAvLyAgICBjaGVja1NpemUoOCk7XG4gICAgICAgIC8vICAgIHJldHVybiBuZXcgVWludDY0QXJyYXkoYnVmZmVyLnNsaWNlKDAsdG90YWxMZW4qOCkpO1xuICAgICAgICBjYXNlIFwiZmxvYXRcIjpcbiAgICAgICAgICAgIGNoZWNrU2l6ZSg0KTtcbiAgICAgICAgICAgIHJldHVybiBuZXcgRmxvYXQzMkFycmF5KGJ1ZmZlci5zbGljZSgwLHRvdGFsTGVuKjQpKTtcbiAgICAgICAgY2FzZSBcImRvdWJsZVwiOlxuICAgICAgICAgICAgY2hlY2tTaXplKDgpO1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBGbG9hdDY0QXJyYXkoYnVmZmVyLnNsaWNlKDAsdG90YWxMZW4qOCkpO1xuICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgY29uc29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AgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBhcnI7XG4gICAgICAgIGNhc2UgXCJ1aW50OFwiOlxuICAgICAgICAgICAgYXJyID0gbmV3IFVpbnQ4QXJyYXkodG90YWxMZW4pO1xuICAgICAgICAgICAgZm9yKGk9MDsgaTx0b3RhbExlbjsgaSsrKSB7XG4gICAgICAgICAgICAgICAgYXJyW2ldID0gdmlldy5nZXRVaW50OChpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBhcnI7XG4gICAgICAgIGNhc2UgXCJpbnQxNlwiOlxuICAgICAgICAgICAgYXJyID0gbmV3IEludDE2QXJyYXkodG90YWxMZW4pO1xuICAgICAgICAgICAgZm9yKGk9MDsgaTx0b3RhbExlbjsgaSsrKSB7XG4gICAgICAgICAgICAgICAgYXJyW2ldID0gdmlldy5nZXRJbnQxNihpKjIpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGFycjtcbiAgICAgICAgY2FzZSBcInVpbnQxNlwiOlxuICAgICAgICAgICAgYXJyID0gbmV3IFVpbnQxNkFycmF5KHRvdGFsTGVuKTtcbiAgICAgICAgICAgIGZvcihpPTA7IGk8dG90YWxMZW47IGkrKykge1xuICAgICAgICAgICAgICAgIGFycltpXSA9IHZpZXcuZ2V0VWludDE2KGkqMik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gYXJyO1xuICAgICAgICBjYXNlIFwiaW50MzJcIjpcbiAgICAgICAgICAgIGFyciA9IG5ldyBJbnQzMkFycmF5KHRvdGFsTGVuKTtcbiAgICAgICAgICAgIGZvcihpPTA7IGk8dG90YWxMZW47IGkrKykge1xuICAgICAgICAgICAgICAgIGFycltpXSA9IHZpZXcuZ2V0SW50MzIoaSo0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBhcnI7XG4gICAgICAgIGNhc2UgXCJ1aW50MzJcIjpcbiAgICAgICAgICAgIGFyciA9IG5ldyBVaW50MzJBcnJheSh0b3RhbExlbik7XG4gICAgICAgICAgICBmb3IoaT0wOyBpPHRvdGFsTGVuOyBpKyspIHtcbiAgICAgICAgICAgICAgICBhcnJbaV0gPSB2aWV3LmdldFVpbnQzMihpKjQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGFycjtcbiAgICAgICAgLy9jYXNlIFwiaW50NjRcIjpcbiAgICAgICAgLy8gICAgYXJyID0gbmV3IEludDY0QXJyYXkodG90YWxMZW4pO1xuICAgICAgICAvLyAgICBmb3IoaT0wOyBpPHRvdGFsTGVuOyBpKyspIHtcbiAgICAgICAgLy8gICAgICAgIGFycltpXSA9IHZpZXcuZ2V0SW50NjQoaSo4KTtcbiAgICAgICAgLy8gICAgfVxuICAgICAgICAvLyAgICByZXR1cm4gYXJyO1xuICAgICAgICAvL2Nhc2UgXCJ1aW50NjRcIjpcbiAgICAgICAgLy8gICAgYXJyID0gbmV3IFVpbnQ2NEFycmF5KHRvdGFsTGVuKTtcbiAgICAgICAgLy8gICAgZm9yKGk9MDsgaTx0b3RhbExlbjsgaSsrKSB7XG4gICAgICAgIC8vICAgICAgICBhcnJbaV0gPSB2aWV3LmdldFVpbnQ2NChpKjgpO1xuICAgICAgICAvLyAgICB9XG4gICAgICAgIC8vICAgIHJldHVybiBhcnI7XG4gICAgICAgIGNhc2UgXCJmbG9hdFwiOlxuICAgICAgICAgICAgYXJyID0gbmV3IEZsb2F0MzJBcnJheSh0b3RhbExlbik7XG4gICAgICAgICAgICBmb3IoaT0wOyBpPHRvdGFsTGVuOyBpKyspIHtcbiAgICAgICAgICAgICAgICBhcnJbaV0gPSB2aWV3LmdldEZsb2F0MzIoaSo0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBhcnI7XG4gICAgICAgIGNhc2UgXCJkb3VibGVcIjpcbiAgICAgICAgICAgIGFyciA9IG5ldyBGbG9hdDY0QXJyYXkodG90YWxMZW4pO1xuICAgICAgICAgICAgZm9yKG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YyBjb25zdGFudHMgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuXG52YXIgWl9OT19GTFVTSCAgICAgID0gMDtcbnZhciBaX0ZJTklTSCAgICAgICAgPSA0O1xuXG52YXIgWl9PSyAgICAgICAgICAgID0gMDtcbnZhciBaX1NUUkVBTV9FTkQgICAgPSAxO1xudmFyIFpfU1lOQ19GTFVTSCAgICA9IDI7XG5cbnZhciBaX0RFRkFVTFRfQ09NUFJFU1NJT04gPSAtMTtcblxudmFyIFpfREVGQVVMVF9TVFJBVEVHWSAgICA9IDA7XG5cbnZhciBaX0RFRkxBVEVEICA9IDg7XG5cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG5cblxuLyoqXG4gKiBjbGFzcyBEZWZsYXRlXG4gKlxuICogR2VuZXJpYyBKUy1zdHlsZSB3cmFwcGVyIGZvciB6bGliIGNhbGxzLiBJZiB5b3UgZG9uJ3QgbmVlZFxuICogc3RyZWFtaW5nIGJlaGF2aW91ciAtIHVzZSBtb3JlIHNpbXBsZSBmdW5jdGlvbnM6IFtbZGVmbGF0ZV1dLFxuICogW1tkZWZsYXRlUmF3XV0gYW5kIFtbZ3ppcF1dLlxuICoqL1xuXG4vKiBpbnRlcm5hbFxuICogRGVmbGF0ZS5jaHVua3MgLT4gQXJyYXlcbiAqXG4gKiBDaHVua3Mgb2Ygb3V0cHV0IGRhdGEsIGlmIFtbRGVmbGF0ZSNvbkRhdGFdXSBub3Qgb3ZlcnJpZGVuLlxuICoqL1xuXG4vKipcbiAqIERlZmxhdGUucmVzdWx0IC0+IFVpbnQ4QXJyYXl8QXJyYXlcbiAqXG4gKiBDb21wcmVzc2VkIHJl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7XG5cblxudmFyIFpfRklMVEVSRUQgICAgICAgICAgICA9IDE7XG52YXIgWl9IVUZGTUFOX09OTFkgICAgICAgID0gMjtcbnZhciBaX1JMRSAgICAgICAgICAgICAgICAgPSAzO1xudmFyIFpfRklYRUQgICAgICAgICAgICAgICA9IDQ7XG52YXIgWl9ERUZBVUxUX1NUUkFURUdZICAgID0gMDtcblxuLyogUG9zc2libGUgdmFsdWVzIG9mIHRoZSBkYXRhX3R5cGUgZmllbGQgKHRob3VnaCBzZWUgaW5mbGF0ZSgpKSAqL1xuLy92YXIgWl9CSU5BUlkgICAgICAgICAgICAgID0gMDtcbi8vdmFyIFpfVEVYVCAgICAgICAgICAgICAgICA9IDE7XG4vL3ZhciBaX0FTQ0lJICAgICAgICAgICAgICAgPSAxOyAvLyA9IFpfVEVYVFxudmFyIFpfVU5LTk9XTiAgICAgICAgICAgICA9IDI7XG5cblxuLyogVGhlIGRlZmxhdGUgY29tcHJlc3Npb24gbWV0aG9kICovXG52YXIgWl9ERUZMQVRFRCAgPSA4O1xuXG4vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuXG5cbnZhciBNQVhfTUVNX0xFVkVMID0gOTtcbi8qIE1heGltdW0gdmFsdWUgZm9yIG1lbUxldmVsIGluIGRlZmxhdGVJbml0MiAqL1xudmFyIE1BWF9XQklUUyA9IDE1O1xuLyogMzJLIExaNzcgd2luZG93ICovXG52YXIgREVGX01FTV9MRVZFTCA9IDg7XG5cblxudmFyIExFTkdUSF9DT0RFUyAgPSAyOTtcbi8qIG51bWJlciBvZiBsZW5ndGggY29kZXMsIG5vdCBjb3VudGluZyB0aGUgc3BlY2lhbCBFTkRfQkxPQ0sgY29kZSAqL1xudmFyIExJVEVSQUxTICAgICAgPSAyNTY7XG4vKiBudW1iZXIgb2YgbGl0ZXJhbCBieXRlcyAwLi4yNTUgKi9cbnZhciBMX0NPREVTICAgICA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09IF93aW5bKyttYXRjaF0gJiYgX3dpblsrK3NjYW5dID09PSBfd2luWysrbWF0Y2hdICYmXG4gICAgICAgICAgICAgX3dpblsrK3NjYW5dID09PSBfd2luWysrbWF0Y2hdICYmIF93aW5bKytzY2FuXSA9PT0gX3dpblsrK21hdGNoXSAmJlxuICAgICAgICAgICAgIF93aW5bKytzY2FuXSA9PT0gX3dpblsrK21hdGNoXSAmJiBfd2luWysrc2Nhbl0gPT09IF93aW5bKyttYXRjaF0gJiZcbiAgICAgICAgICAgICBzY2FuIDwgc3RyZW5kKTtcblxuICAgIC8vIEFzc2VydChzY2FuIDw9IHMtPndpbmRvdysodW5zaWduZWQpKHMtPndpbmRvd19zaXplLTEpLCBcIndpbGQgc2NhblwiKTtcblxuICAgIGxlbiA9IE1BWF9NQVRDSCAtIChzdHJlbmQgLSBzY2FuKTtcbiAgICBzY2FuID0gc3RyZW5kIC0gTUFYX01BVENIO1xuXG4gICAgaWYgKGxlbiA+IGJlc3RfbGVuKSB7XG4gICAgICBzLm1hdGNoX3N0YXJ0ID0gY3VyX21hdGNoO1xuICAgICAgYmVzdF9sZW4gPSBsZW47XG4gICAgICBpZiAobGVuID49IG5pY2VfbWF0Y2gpIHtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICBzY2FuX2VuZDEgID0gX3dpbltzY2FuICsgYmVzdF9sZW4gLSAxXTtcbiAgICAgIHNjYW5fZW5kICAgPSBfd2luW3NjYW4gKyBiZXN0X2xlbl07XG4gICAgfVxuICB9IHdoaWxlICgoY3VyX21hdGNoID0gcHJldltjdXJfbWF0Y2ggJiB3bWFza10pID4gbGltaXQgJiYgLS1jaGFpbl9sZW5ndGggIT09IDApO1xuXG4gIGlmIChiZXN0X2xlbiA8PSBzLmxvb2thaGVhZCkge1xuICAgIHJldHVybiBiZXN0X2xlbjtcbiAgfVxuICByZXR1cm4gcy5sb29rYWhlYWQ7XG59XG5cblxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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ICAgICAgICAgICAgICAocy5nemhlYWQuaGNyYyA/IDIgOiAwKSArXG4gICAgICAgICAgICAgICAgICAgICghcy5nemhlYWQuZXh0cmEgPyAwIDogNCkgK1xuICAgICAgICAgICAgICAgICAgICAoIXMuZ3poZWFkLm5hbWUgPyAwIDogOCkgK1xuICAgICAgICAgICAgICAgICAgICAoIXMuZ3poZWFkLmNvbW1lbnQgPyAwIDogMTYpXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgcHV0X2J5dGUocywgcy5nemhlYWQudGltZSAmIDB4ZmYpO1xuICAgICAgICBwdXRfYnl0ZShzLCAocy5nemhlYWQudGltZSA+PiA4KSAmIDB4ZmYpO1xuICAgICAgICBwdXRfYnl0ZShzLCAocy5nemhlYWQudGltZSA+PiAxNikgJiAweGZmKTtcbiAgICAgICAgcHV0X2J5dGUocywgKHMuZ3poZWFkLnRpbWUgPj4gMjQpICYgMHhmZik7XG4gICAgICAgIHB1dF9ieXRlKHMsIHMubGV2ZWwgPT09IDkgPyAyIDpcbiAgICAgICAgICAgICAgICAgICAgKHMuc3RyYXRlZ3kgPj0gWl9IVUZGTUFOX09OTFkgfHwgcy5sZXZlbCA8IDIgP1xuICAgICAgICAgICAgICAgICAgICAgNCA6IDApKTtcbiAgICAgICAgcHV0X2J5dGUocywgcy5nemhlYWQub3MgJiAweGZmKTtcbiAgICAgICAgaWYgKHMuZ3poZWFkLmV4dHJhICYmIHMuZ3poZWFkLmV4dHJhLmxlbmd0aCkge1xuICAgICAgICAgIHB1dF9ieXRlKHMsIHMuZ3poZWFkLmV4dHJhLmxlbmd0aCAmIDB4ZmYpO1xuICAgICAgICAgIHB1dF9ieXRlKHMsIChzLmd6aGVhZC5leHRyYS5sZW5ndGggPj4gOCkgJiAweGZmKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAocy5nemhlYWQuaGNyYykge1xuICAgICAgICAgIHN0cm0uYWRsZXIgPSBjcmMzMihzdHJtLmFkbGVyLCBzLnBlbmRpbmdfYnVm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JtaW5hdGVkIGNvbW1lbnQgb3IgWl9OVUxMICovXG4gIHRoaXMuY29tbWVudCAgICA9ICcnO1xuICAvKiBzcGFjZSBhdCBjb21tZW50IChvbmx5IHdoZW4gcmVhZGluZyBoZWFkZXIpICovXG4gIC8vIHRoaXMuY29tbV9tYXggICA9IDA7XG4gIC8qIHRydWUgaWYgdGhlcmUgd2FzIG9yIHdpbGwgYmUgYSBoZWFkZXIgY3JjICovXG4gIHRoaXMuaGNyYyAgICAgICA9IDA7XG4gIC8qIHRydWUgd2hlbiBkb25lIHJlYWRpbmcgZ3ppcCBoZWFkZXIgKG5vdCB1c2VkIHdoZW4gd3JpdGluZyBhIGd6aXAgZmlsZSkgKi9cbiAgdGhpcy5kb25lICAgICAgID0gZmFsc2U7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gR1poZWFkZXI7XG4iLCIndXNlIHN0cmljdCc7XG5cblxudmFyIHV0aWxzICAgICAgICAgPSByZXF1aXJlKCcuLi91dGlscy9jb21tb24nKTtcbnZhciBhZGxlcjMyICAgICAgID0gcmVxdWlyZSgnLi9hZGxlcjMyJyk7XG52YXIgY3JjMzIgICAgICAgICA9IHJlcXVpcmUoJy4vY3JjMzInKTtcbnZhciBpbmZsYXRlX2Zhc3QgID0gcmVxdWlyZSgnLi9pbmZmYXN0Jyk7XG52YXIgaW5mbGF0ZV90YWJsZSA9IHJlcXVpcmUoJy4vaW5mdHJlZXMnKTtcblxudmFyIENPREVTID0gMDtcbnZhciBMRU5TID0gMTtcbnZhciBESVNUUyA9IDI7XG5cbi8qIFB1YmxpYyBjb25zdGFudHMgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuXG5cbi8qIEFsbG93ZWQgZmx1c2ggdmFsdWVzOyBzZWUgZGVmbGF0ZSgpIGFuZCBpbmZsYXRlKCkgYmVsb3cgZm9yIGRldGFpbHMgKi9cbi8vdmFyIFpfTk9fRkxVU0ggICAgICA9IDA7XG4vL3ZhciBaX1BBUlRJQUxfRkxVU0ggPSAxO1xuLy92YXIgWl9TWU5DX0ZMVVNIICAgID0gMjtcbi8vdmFyIFpfRlVMTF9GTFVTSCAgICA9IDM7XG52YXIgWl9GSU5JU0ggICAgICAgID0gNDtcbnZhciBaX0JMT0NLICAgICAgICAgPSA1O1xudmFyIFpfVFJFRVMgICAgICAgICA9IDY7XG5cblxuLyogUmV0dXJuIGNvZGVzIGZvciB0aGUgY29tcHJlc3Npb24vZGVjb21wcmVzc2lvbiBmdW5jdGlvbnMuIE5lZ2F0aXZlIHZhbHVlc1xuICogYXJlIGVycm9ycywgcG9zaXRpdmUgdmFsdWVzIGFyZSB1c2VkIGZvciBzcGVjaWFsIGJ1dCBub3JtYWwgZXZlbnRzLlxuICovXG52YXIgWl9PSyAgICAgICAgICAgID0gMDtcbnZhciBaX1NUUkVBTV9FTkQgICAgPSAxO1xudmFyIFpfTkVFRF9ESUNUICAgICA9IDI7XG4vL3ZhciBaX0VSUk5PICAgICAgICAgPSAtMTtcbnZhciBaX1NUUkVBTV9FUlJPUiAgPSAtMjtcbnZhciBaX0RBVEFfRVJST1IgICAgPSAtMztcbnZhciBaX01FTV9FUlJPUiAgICAgPSAtNDtcbnZhciBaX0JVRl9FUlJPUiAgICAgPSAtNTtcbi8vdmFyIFpfVkVSU0lPTl9FUlJPUiA9IC02O1xuXG4vKiBUaGUgZGVmbGF0ZSBjb21wcmVzc2lvbiBtZXRob2QgKi9cbnZhciBaX0RFRkxBVEVEICA9IDg7XG5cblxuLyogU1RBVEVTID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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ICAgICAgRElTVCA9IDIzOyAgICAgIC8qIGk6IHdhaXRpbmcgZm9yIGRpc3RhbmNlIGNvZGUgKi9cbnZhciAgICAgICAgICAgIERJU1RFWFQgPSAyNDsgICAvKiBpOiB3YWl0aW5nIGZvciBkaXN0YW5jZSBleHRyYSBiaXRzICovXG52YXIgICAgICAgICAgICBNQVRDSCA9IDI1OyAgICAgLyogbzogd2FpdGluZyBmb3Igb3V0cHV0IHNwYWNlIHRvIGNvcHkgc3RyaW5nICovXG52YXIgICAgICAgICAgICBMSVQgPSAyNjsgICAgICAgLyogbzogd2FpdGluZyBmb3Igb3V0cHV0IHNwYWNlIHRvIHdyaXRlIGxpdGVyYWwgKi9cbnZhciAgICBDSEVDSyA9IDI3OyAgICAgLyogaTogd2FpdGluZyBmb3IgMzItYml0IGNoZWNrIHZhbHVlICovXG52YXIgICAgTEVOR1RIID0gMjg7ICAgIC8qIGk6IHdhaXRpbmcgZm9yIDMyLWJpdCBsZW5ndGggKGd6aXApICovXG52YXIgICAgRE9ORSA9IDI5OyAgICAgIC8qIGZpbmlzaGVkIGNoZWNrLCBkb25lIC0tIHJlbWFpbiBoZXJlIHVudGlsIHJlc2V0ICovXG52YXIgICAgQkFEID0gMzA7ICAgICAgIC8qIGdvdCBhIGRhdGEgZXJyb3IgLS0gcmVtYWluIGhlcmUgdW50aWwgcmVzZXQgKi9cbnZhciAgICBNRU0gPSAzMTsgICAgICAgLyogZ290IGFuIGluZmxhdGUoKSBtZW1vcnkgZXJyb3IgLS0gcmVtYWluIGhlcmUgdW50aWwgcmVzZXQgKi9cbnZhciAgICBTWU5DID0gMzI7ICAgICAgLyogbG9va2luZyBmb3Igc3luY2hyb25pemF0aW9uIGJ5dGVzIHRvIHJlc3RhcnQgaW5mbGF0ZSgpICovXG5cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG5cblxuXG52YXIgRU5PVUdIX0xF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VhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgaGF2ZS0tO1xuICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgYml0cyArPSA4O1xuICAgICAgfVxuICAgICAgLy89PT0vL1xuICAgICAgaWYgKHN0YXRlLmhlYWQpIHtcbiAgICAgICAgc3RhdGUuaGVhZC54ZmxhZ3MgPSAoaG9sZCAmIDB4ZmYpO1xuICAgICAgICBzdGF0ZS5oZWFkLm9zID0gKGhvbGQgPj4gOCk7XG4gICAgICB9XG4gICAgICBpZiAoc3RhdGUuZmxhZ3MgJiAweDAyMDApIHtcbiAgICAgICAgLy89PT0gQ1JDMihzdGF0ZS5jaGVjaywgaG9sZCk7XG4gICAgICAgIGhidWZbMF0gPSBob2xkICYgMHhmZjtcbiAgICAgICAgaGJ1ZlsxXSA9IChob2xkID4+PiA4KSAmIDB4ZmY7XG4gICAgICAgIHN0YXRlLmNoZWNrID0gY3JjMzIoc3RhdGUuY2hlY2ssIGhidWYsIDIsIDApO1xuICAgICAgICAvLz09PS8vXG4gICAgICB9XG4gICAgICAvLz09PSBJTklUQklUUygpO1xuICAgICAgaG9sZCA9IDA7XG4gICAgICBiaXRzID0gMDtcbiAgICAgIC8vPT09Ly9cbiAgICAgIHN0YXRlLm1vZGUgPSBFWExFTjtcbiAgICAgIC8qIGZhbGxzIHRocm91Z2ggKi9cbiAgICBjYXNlIEVYTEVOOlxuICAgICAgaWYgKHN0YXRlLmZsYWdzICYgMHgwNDAwKSB7XG4gICAgICAgIC8vPT09IE5FRURCSVRTKDE2KTsgKi9cbiAgICAgICAgd2hpbGUgKGJpdHMgPCAxNikge1xuICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgIH1cbiAgIC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RlLmhlYWQuZXh0cmEpIHtcbiAgICAgICAgICAgICAgLy8gVXNlIHVudHlwZWQgYXJyYXkgZm9yIG1vcmUgY29udmVuaWVuZCBwcm9jZXNzaW5nIGxhdGVyXG4gICAgICAgICAgICAgIHN0YXRlLmhlYWQuZXh0cmEgPSBuZXcgQXJyYXkoc3RhdGUuaGVhZC5leHRyYV9sZW4pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdXRpbHMuYXJyYXlTZXQoXG4gICAgICAgICAgICAgIHN0YXRlLmhlYWQuZXh0cmEsXG4gICAgICAgICAgICAgIGlucHV0LFxuICAgICAgICAgICAgICBuZXh0LFxuICAgICAgICAgICAgICAvLyBleHRyYSBmaWVsZCBpcyBsaW1pdGVkIHRvIDY1NTM2IGJ5dGVzXG4gICAgICAgICAgICAgIC8vIC0gbm8gbmVlZCBmb3IgYWRkaXRpb25hbCBzaXplIGNoZWNrXG4gICAgICAgICAgICAgIGNvcHksXG4gICAgICAgICAgICAgIC8qbGVuICsgY29weSA+IHN0YXRlLmhlYWQuZXh0cmFfbWF4IC0gbGVuID8gc3RhdGUuaGVhZC5leHRyYV9tYXggOiBjb3B5LCovXG4gICAgICAgICAgICAgIGxlblxuICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIC8vem1lbWNweShzdGF0ZS5oZWFkLmV4dHJhICsgbGVuLCBuZXh0LFxuICAgICAgICAgICAgLy8gICAgICAgIGxlbiArIGNvcHkgPiBzdGF0ZS5oZWFkLmV4dHJhX21heCA/XG4gICAgICAgICAgICAvLyAgICAgICAgc3RhdGUuaGVhZC5leHRyYV9tYXggLSBsZW4gOiBjb3B5KTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHN0YXRlLmZsYWdzICYgMHgwMjAwKSB7XG4gICAgICAgICAgICBzdGF0ZS5jaGVjayA9IGNyYzMyKHN0YXRlLmNoZWNrLCBpbnB1dCwgY29weSwgbmV4dCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGhhdmUgL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cHk7XG4gICAgICAgIG5leHQgKz0gY29weTtcbiAgICAgICAgaWYgKGxlbikgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgIH1cbiAgICAgIGVsc2UgaWYgKHN0YXRlLmhlYWQpIHtcbiAgICAgICAgc3RhdGUuaGVhZC5jb21tZW50ID0gbnVsbDtcbiAgICAgIH1cbiAgICAgIHN0YXRlLm1vZGUgPSBIQ1JDO1xuICAgICAgLyogZmFsbHMgdGhyb3VnaCAqL1xuICAgIGNhc2UgSENSQzpcbiAgICAgIGlmIChzdGF0ZS5mbGFncyAmIDB4MDIwMCkge1xuICAgICAgICAvLz09PSBORUVEQklUUygxNik7ICovXG4gICAgICAgIHdoaWxlIChiaXRzIDwgMTYpIHtcbiAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICB9XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgaWYgKGhvbGQgIT09IChzdGF0ZS5jaGVjayAmIDB4ZmZmZikpIHtcbiAgICAgICAgICBzdHJtLm1zZyA9ICdoZWFkZXIgY3JjIG1pc21hdGNoJztcbiAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIC8vPT09IElOSVRCSVRTKCk7XG4gICAgICAgIGhvbGQgPSAwO1xuICAgICAgICBiaXRzID0gMDtcbiAgICAgICAgLy89PT0vL1xuICAgICAgfVxuICAgICAgaWYgKHN0YXRlLmhlYWQpIHtcbiAgICAgICAgc3RhdGUuaGVhZC5oY3JjID0gKChzdGF0ZS5mbGFncyA+PiA5KSAmIDEpO1xuICAgICAgICBzdGF0ZS5oZWFkLmRvbmUgPSB0cnVlO1xuICAgICAgfVxuICAgICAgc3RybS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qLztcbiAgICAgIHN0YXRlLm1vZGUgPSBUWVBFO1xuICAgICAgLyogZmFsbHMgdGhyb3VnaCAqL1xuICAgIGNhc2UgVFlQRTpcbiAgICAgIGlmIChmbHVzaCA9PT0gWl9CTE9DSyB8fCBmbHVzaCA9PT0gWl9UUkVFUykgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgIC8qIGZhbGxzIHRocm91Z2ggKi9cbiAgICBjYXNlIFRZUEVETzpcbiAgICAgIGlmIChzdGF0ZS5sYXN0KSB7XG4gICAgICAgIC8vLS0tIEJZVEVCSVRTKCkgLS0tLy9cbiAgICAgICAgaG9sZCA+Pj49IGJpdHMgJiA3O1xuICAgICAgICBiaXRzIC09IGJpdHMgJiA3O1xuICAgICAgICAvLy0tLS8vXG4gICAgICAgIHN0YXRlLm1vZGUgPSBDSEVDSztcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICAvLz09PSBORUVEQklUUygzKTsgKi9cbiAgICAgIHdoaWxlIChiaXRzIDwgMykge1xuICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgaGF2ZS0tO1xuICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgYml0cyArPSA4O1xuICAgICAgfVxuICAgICAgLy89PT0vL1xuICAgICAgc3RhdGUubGFzdCA9IChob2xkICYgMHgwMSkvKkJJVFMoMSkqLztcbiAgICAgIC8vLS0tIERST1BCSVRTKDEpIC0tLS8vXG4gICAgICBob2xkID4+Pj0gMTtcbiAgICAgIGJpdHMgLT0gMTtcbiAgICAgIC8vLS0tLy9cblxuICAgICAgc3dpdGNoICgoaG9sZCAmIDB4MDMpLypCSVRTKDIpKi8pIHtcbiAgICAgIGNhc2UgMDogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHN0b3JlZCBibG9jayAqL1xuICAgICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgICBzdG9yZWQgYmxvY2slc1xcblwiLFxuICAgICAgICAvLyAgICAgICAgc3RhdGUubGFzdCA/IFwiIChsYXN0KVwiIDogXCJcIikpO1xuICAgICAgICBzdGF0ZS5tb2RlID0gU1RPUkVEO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgMTogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGZpeGVkIGJsb2NrICovXG4gICAgICAgIGZpeGVkdGFibGVzKHN0YXRlKTtcbiAgICAgICAgLy9UcmFjZXYoKHN0ZGVyciwgXCJpbmZsYXRlOiAgICAgZml4ZWQgY29kZXMgYmxvY2slc1xcblwiLFxuICAgICAgICAvLyAgICAgICAgc3RhdGUubGFzdCA/IFwiIChsYXN0KVwiIDogXCJcIikpO1xuICAgICAgICBzdGF0ZS5tb2RlID0gTEVOXzsgICAgICAgICAgICAgLyogZGVjb2RlIGNvZGVzICovXG4gICAgICAgIGlmIChmbHVzaCA9PT0gWl9UUkVFUykge1xuICAgICAgICAgIC8vLS0tIERST1BCSVRTKDIpIC0tLS8vXG4gICAgICAgICAgaG9sZCA+Pj49IDI7XG4gICAgICAgICAgYml0cyAtPSAyO1xuICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICBicmVhayBpbmZfbGVhdmU7XG4gICAgICAgIH1cbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIDI6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBkeW5hbWljIGJsb2NrICovXG4gICAgICAgIC8vVHJhY2V2KChzdGRlcnIsIFwiaW5mbGF0ZTogICAgIGR5bmFtaWMgY29kZXMgYmxvY2slc1xcblwiLFxuICAgICAgICAvLyAgICAgICAgc3RhdGUubGFzdCA/IFwiIChsYXN0KVwiIDogXCJcIikpO1xuICAgICAgICBzdGF0ZS5tb2RlID0gVEFCTEU7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAzOlxuICAgICAgICBzdHJtLm1zZyA9ICdpbnZhbGlkIGJsb2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tLS0vL1xuICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgLy8tLS0vL1xuICAgICAgICB9XG4gICAgICAgIGlmIChoZXJlX3ZhbCA8IDE2KSB7XG4gICAgICAgICAgLy8tLS0gRFJPUEJJVFMoaGVyZS5iaXRzKSAtLS0vL1xuICAgICAgICAgIGhvbGQgPj4+PSBoZXJlX2JpdHM7XG4gICAgICAgICAgYml0cyAtPSBoZXJlX2JpdHM7XG4gICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgIHN0YXRlLmxlbnNbc3RhdGUuaGF2ZSsrXSA9IGhlcmVfdmFsO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgIGlmIChoZXJlX3ZhbCA9PT0gMTYpIHtcbiAgICAgICAgICAgIC8vPT09IE5FRURCSVRTKGhlcmUuYml0cyArIDIpO1xuICAgICAgICAgICAgbiA9IGhlcmVfYml0cyArIDI7XG4gICAgICAgICAgICB3aGlsZSAoYml0cyA8IG4pIHtcbiAgICAgICAgICAgICAgaWYgKGhhdmUgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vPT09Ly9cbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKGhlcmUuYml0cykgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSBoZXJlX2JpdHM7XG4gICAgICAgICAgICBiaXRzIC09IGhlcmVfYml0cztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICAgIGlmIChzdGF0ZS5oYXZlID09PSAwKSB7XG4gICAgICAgICAgICAgIHN0cm0ubXNnID0gJ2ludmFsaWQgYml0IGxlbmd0aCByZXBlYXQnO1xuICAgICAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxlbiA9IHN0YXRlLmxlbnNbc3RhdGUuaGF2ZSAtIDFdO1xuICAgICAgICAgICAgY29weSA9IDMgKyAoaG9sZCAmIDB4MDMpOy8vQklUUygyKTtcbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKDIpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gMjtcbiAgICAgICAgICAgIGJpdHMgLT0gMjtcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICB9XG4gICAgICAgICAgZWxzZSBpZiAoaGVyZV92YWwgPT09IDE3KSB7XG4gICAgICAgICAgICAvLz09PSBORUVEQklUUyhoZXJlLmJpdHMgKyAzKTtcbiAgICAgICAgICAgIG4gPSBoZXJlX2JpdHMgKyAzO1xuICAgICAgICAgICAgd2hpbGUgKGJpdHMgPCBuKSB7XG4gICAgICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLz09PS8vXG4gICAgICAgICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gaGVyZV9iaXRzO1xuICAgICAgICAgICAgYml0cyAtPSBoZXJlX2JpdHM7XG4gICAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgICBsZW4gPSAwO1xuICAgICAgICAgICAgY29weSA9IDMgKyAoaG9sZCAmIDB4MDcpOy8vQklUUygzKTtcbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKDMpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gMztcbiAgICAgICAgICAgIGJpdHMgLT0gMztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICB9XG4gICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAvLz09PSBORUVEQklUUyhoZXJlLmJpdHMgKyA3KTtcbiAgICAgICAgICAgIG4gPSBoZXJlX2JpdHMgKyA3O1xuICAgICAgICAgICAgd2hpbGUgKGJpdHMgPCBuKSB7XG4gICAgICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLz09PS8vXG4gICAgICAgICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gaGVyZV9iaXRzO1xuICAgICAgICAgICAgYml0cyAtPSBoZXJlX2JpdHM7XG4gICAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgICBsZW4gPSAwO1xuICAgICAgICAgICAgY29weSA9IDExICsgKGhvbGQgJiAweDdmKTsvL0JJVFMoNyk7XG4gICAgICAgICAgICAvLy0tLSBEUk9QQklUUyg3KSAtLS0vL1xuICAgICAgICAgICAgaG9sZCA+Pj49IDc7XG4gICAgICAgICAgICBiaXRzIC09IDc7XG4gICAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChzdGF0ZS5oYXZlICsgY29weSA+IHN0YXRlLm5sZW4gKyBzdGF0ZS5uZGlzdCkge1xuICAgICAgICAgICAgc3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fVxuICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgLy8tLS0vL1xuICAgICAgICB9XG4gICAgICAgIC8vLS0tIERST1BCSVRTKGxhc3QuYml0cykgLS0tLy9cbiAgICAgICAgaG9sZCA+Pj49IGxhc3RfYml0cztcbiAgICAgICAgYml0cyAtPSBsYXN0X2JpdHM7XG4gICAgICAgIC8vLS0tLy9cbiAgICAgICAgc3RhdGUuYmFjayArPSBsYXN0X2JpdHM7XG4gICAgICB9XG4gICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICBob2xkID4+Pj0gaGVyZV9iaXRzO1xuICAgICAgYml0cyAtPSBoZXJlX2JpdHM7XG4gICAgICAvLy0tLS8vXG4gICAgICBzdGF0ZS5iYWNrICs9IGhlcmVfYml0cztcbiAgICAgIGlmIChoZXJlX29wICYgNjQpIHtcbiAgICAgICAgc3RybS5tc2cgPSAnaW52YWxpZCBkaXN0YW5jZSBjb2RlJztcbiAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICBzdGF0ZS5vZmZzZXQgPSBoZXJlX3ZhbDtcbiAgICAgIHN0YXRlLmV4dHJhID0gKGhlcmVfb3ApICYgMTU7XG4gICAgICBzdGF0ZS5tb2RlID0gRElTVEVYVDtcbiAgICAgIC8qIGZhbGxzIHRocm91Z2ggKi9cbiAgICBjYXNlIERJU1RFWFQ6XG4gICAgICBpZiAoc3RhdGUuZXh0cmEpIHtcbiAgICAgICAgLy89PT0gTkVFREJJVFMoc3RhdGUuZXh0cmEpO1xuICAgICAgICBuID0gc3RhdGUuZXh0cmE7XG4gICAgICAgIHdoaWxlIChiaXRzIDwgbikge1xuICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfV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Uud25leHQpIHtcbiAgICAgICAgICBjb3B5IC09IHN0YXRlLnduZXh0O1xuICAgICAgICAgIGZyb20gPSBzdGF0ZS53c2l6ZSAtIGNvcHk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgZnJvbSA9IHN0YXRlLnduZXh0IC0gY29weTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoY29weSA+IHN0YXRlLmxlbmd0aCkgeyBjb3B5ID0gc3RhdGUubGVuZ3RoOyB9XG4gICAgICAgIGZyb21fc291cmNlID0gc3RhdGUud2luZG93O1xuICAgICAgfVxuICAgICAgZWxzZSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogY29weSBmcm9tIG91dHB1dCAqL1xuICAgICAgICBmcm9tX3NvdXJjZSA9IG91dHB1dDtcbiAgICAgICAgZnJvbSA9IHB1dCAtIHN0YXRlLm9mZnNldDtcbiAgICAgICAgY29weSA9IHN0YXRlLmxlbmd0aDtcbiAgICAgIH1cbiAgICAgIGlmIChjb3B5ID4gbGVmdCkgeyBjb3B5ID0gbGVmdDsgfVxuICAgICAgbGVmdCAtPSBjb3B5O1xuICAgICAgc3RhdGUubGVuZ3RoIC09IGNvcHk7XG4gICAgICBkbyB7XG4gICAgICAgIG91dHB1dFtwdXQrK10gPSBmcm9tX3NvdXJjZVtmcm9tKytdO1xuICAgICAgfSB3aGlsZSAoLS1jb3B5KTtcbiAgICAgIGlmIChzdGF0ZS5sZW5ndGggPT09IDApIHsgc3RhdGUubW9kZSA9IExFTjsgfVxuICAgICAgYnJlYWs7XG4gICAgY2FzZSBMSVQ6XG4gICAgICBpZiAobGVmdCA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgIG91dHB1dFtwdXQrK10gPSBzdGF0ZS5sZW5ndGg7XG4gICAgICBsZWZ0LS07XG4gICAgICBzdGF0ZS5tb2RlID0gTEVOO1xuICAgICAgYnJlYWs7XG4gICAgY2FzZSBDSEVDSzpcbiAgICA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yA9ICdpbmNvcnJlY3QgZGF0YSBjaGVjayc7XG4gICAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICAvLz09PSBJTklUQklUUygpO1xuICAgICAgICBob2xkID0gMDtcbiAgICAgICAgYml0cyA9IDA7XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgLy9UcmFjZXYoKHN0ZGVyciwgXCJpbmZsYXRlOiAgIGNoZWNrIG1hdGNoZXMgdHJhaWxlclxcblwiKSk7XG4gICAgICB9XG4gICAgICBzdGF0ZS5tb2RlID0gTEVOR1RIO1xuICAgICAgLyogZmFsbHMgdGhyb3VnaCAqL1xuICAgIGNhc2UgTEVOR1RIOlxuICAgICAgaWYgKHN0YXRlLndyYXAgJiYgc3RhdGUuZmxhZ3MpIHtcbiAgICAgICAgLy89PT0gTkVFREJJVFMoMzIpO1xuICAgICAgICB3aGlsZSAoYml0cyA8IDMyKSB7XG4gICAgICAgICAgaWYgKGhhdmUgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgICAgaGF2ZS0tO1xuICAgICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgfVxuICAgICAgICAvLz09PS8vXG4gICAgICAgIGlmIChob2xkICE9PSAoc3RhdGUudG90YWwgJiAweGZmZmZmZmZmKSkge1xuICAgICAgICAgIHN0cm0ubXNnID0gJ2luY29ycmVjdCBsZW5ndGggY2hlY2snO1xuICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgLy89PT0gSU5JVEJJVFMoKTtcbiAgICAgICAgaG9sZCA9IDA7XG4gICAgICAgIGJpdHMgPSAwO1xuICAgICAgICAvLz09PS8vXG4gICAgICAgIC8vVHJhY2V2KChzdGRlcnIsIFwiaW5mb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3IgbWFuIG9wdGltaXphdGlvbiAtIHVzZSBpZi1lbHNlIGluc3RlYWQgb2Ygc3dpdGNoLFxuICAvLyB0byBhdm9pZCBkZW9wdHMgaW4gb2xkIHY4XG4gIGlmICh0eXBlID09PSBDT0RFUykge1xuICAgIGJhc2UgPSBleHRyYSA9IHdvcms7ICAgIC8qIGR1bW15IHZhbHVlLS1ub3QgdXNlZCAqL1xuICAgIGVuZCA9IDE5O1xuXG4gIH0gZWxzZSBpZiAodHlwZSA9PT0gTEVOUykge1xuICAgIGJhc2UgPSBsYmFzZTtcbiAgICBiYXNlX2luZGV4IC09IDI1NztcbiAgICBleHRyYSA9IGxleHQ7XG4gICAgZXh0cmFfaW5kZXggLT0gMjU3O1xuICAgIGVuZCA9IDI1NjtcblxuICB9IGVsc2UgeyAgICAgICAgICAgICAgICAgICAgLyogRElTVFMgKi9cbiAgICBiYXNlID0gZGJhc2U7XG4gICAgZXh0cmEgPSBkZXh0O1xuICAgIGVuZCA9IC0xO1xuICB9XG5cbiAgLyogaW5pdGlhbGl6ZSBvcHRzIGZvciBsb29wICovXG4gIGh1ZmYgPSAwOyAgICAgICAgICAgICAgICAgICAvKiBzdGFydGluZyBjb2RlICovXG4gIHN5bSA9IDA7ICAgICAgICAgICAgICAgICAgICAvKiBzdGFydGluZyBjb2RlIHN5bWJvbCAqL1xuICBsZW4gPSBtaW47ICAgICAgICAgICAgICAgICAgLyogc3RhcnRpbmcgY29kZSBsZW5ndGggKi9cbiAgbmV4dCA9IHRhYmxlX2luZGV4OyAgICAgICAgICAgICAgLyogY3VycmVudCB0YWJsZSB0byBmaWxsIGluICovXG4gIGN1cnIgPSByb290OyAgICAgICAgICAgICAgICAvKiBjdXJyZW50IHRhYmxlIGluZGV4IGJpdHMgKi9cbiAgZHJvcCA9IDA7ICAgICAgICAgICAgICAgICAgIC8qIGN1cnJlbnQgYml0cyB0byBkcm9wIGZyb20gY29kZSBmb3IgaW5kZXggKi9cbiAgbG93ID0gLTE7ICAgICAg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AxICAqL1xuICAwOiAgICAgICcnLCAgICAgICAgICAgICAgICAgICAgLyogWl9PSyAgICAgICAgICAgICAgMCAgKi9cbiAgJy0xJzogICAnZmlsZSBlcnJvcicsICAgICAgICAgIC8qIFpfRVJSTk8gICAgICAgICAoLTEpICovXG4gICctMic6ICAgJ3N0cmVhbSBlcnJvcicsICAgICAgICAvKiBaX1NUUkVBTV9FUlJPUiAgKC0yKSAqL1xuICAnLTMnOiAgICdkYXRhIGVycm9yJywgICAgICAgICAgLyogWl9EQVRBX0VSUk9SICAgICgtMykgKi9cbiAgJy00JzogICAnaW5zdWZmaWNpZW50IG1lbW9yeScsIC8qIFpfTUVNX0VSUk9SICAgICAoLTQpICovXG4gICctNSc6ICAgJ2J1ZmZlciBlcnJvcicsICAgICAgICAvKiBaX0JVRl9FUlJPUiAgICAgKC01KSAqL1xuICAnLTYnOiAgICdpbmNvbXBhdGlibGUgdmVyc2lvbicgLyogWl9WRVJTSU9OX0VSUk9SICgtNikgKi9cbn07XG4iLCIndXNlIHN0cmljdCc7XG5cblxudmFyIHV0aWxzID0gcmVxdWlyZSgnLi4vdXRpbHMvY29tbW9uJyk7XG5cbi8qIFB1YmxpYyBjb25zdGFudHMgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuXG5cbi8vdmFyIFpfRklMVEVSRUQgICAgICAgICAgPSAxO1xuLy92YXIgWl9IVUZGTUFOX09OTFkgICAgICA9IDI7XG4vL3ZhciBaX1JMRSAgICAgICAgICAgICAgID0gMztcbnZhciBaX0ZJWEVEICAgICAgICAgICAgICAgPSA0O1xuLy92YXIgWl9ERUZBVUxUX1NUUkFURUdZICA9IDA7XG5cbi8qIFBvc3NpYmxlIHZhbHVlcyBvZiB0aGUgZGF0YV90eXBlIGZpZWxkICh0aG91Z2ggc2VlIGluZmxhdGUoKSkgKi9cbnZhciBaX0JJTkFSWSAgICAgICAgICAgICAgPSAwO1xudmFyIFpfVEVYVCAgICAgICAgICAgICAgICA9IDE7XG4vL3ZhciBaX0FTQ0lJICAgICAgICAgICAgID0gMTsgLy8gPSBaX1RFWFRcbnZhciBaX1VOS05PV04gICAgICAgICAgICAgPSAyO1xuXG4vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuXG5cbmZ1bmN0aW9uIHplcm8oYnVmKSB7IHZhciBsZW4gPSBidWYubGVuZ3RoOyB3aGlsZSAoLS1sZW4gPj0gMCkgeyBidWZbbGVuXSA9IDA7IH0gfVxuXG4vLyBGcm9tIHp1dGlsLmhcblxudmFyIFNUT1JFRF9CTE9DSyA9IDA7XG52YXIgU1RBVElDX1RSRUVTID0gMTtcbnZhciBEWU5fVFJFRVMgICAgPSAyO1xuLyogVGhlIHRocmVlIGtpbmRzIG9mIGJsb2NrIHR5cGUgKi9cblxudmFyIE1JTl9NQVRDSCAgICA9IDM7XG52YXIgTUFYX01BVENIICAgID0gMjU4O1xuLyogVGhlIG1pbmltdW0gYW5kIG1heGltdW0gbWF0Y2ggbGVuZ3RocyAqL1xuXG4vLyBGcm9tIGRlZmxhdGUuaFxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBJbnRlcm5hbCBjb21wcmVzc2lvbiBzdGF0ZS5cbiAqL1xuXG52YXIgTEVOR1RIX0NPREVTICA9IDI5O1xuLyogbnVtYmVyIG9mIGxlbmd0aCBjb2Rlcywgbm90IGNvdW50aW5nIHRoZSBzcGVjaWFsIEVORF9CTE9DSyBjb2RlICovXG5cbnZhciBMSVRFUkFMUyAgICAgID0gMjU2O1xuLyogbnVtYmVyIG9mIGxpdGVyYWwgYnl0ZX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GNvZGUgPSAoY29kZSArIGJsX2NvdW50W2JpdHMgLSAxXSkgPDwgMTtcbiAgfVxuICAvKiBDaGVjayB0aGF0IHRoZSBiaXQgY291bnRzIGluIGJsX2NvdW50IGFyZSBjb25zaXN0ZW50LiBUaGUgbGFzdCBjb2RlXG4gICAqIG11c3QgYmUgYWxsIG9uZXMuXG4gICAqL1xuICAvL0Fzc2VydCAoY29kZSArIGJsX2NvdW50W01BWF9CSVRTXS0xID09ICgxPDxNQVhfQklUUyktMSxcbiAgLy8gICAgICAgIFwiaW5jb25zaXN0ZW50IGJpdCBjb3VudHNcIik7XG4gIC8vVHJhY2V2KChzdGRlcnIsXCJcXG5nZW5fY29kZXM6IG1heF9jb2RlICVkIFwiLCBtYXhfY29kZSkpO1xuXG4gIGZvciAobiA9IDA7ICBuIDw9IG1heF9jb2RlOyBuKyspIHtcbiAgICB2YXIgbGVuID0gdHJlZVtuICogMiArIDFdLyouTGVuKi87XG4gICAgaWYgKGxlbiA9PT0gMCkgeyBjb250aW51ZTsgfVxuICAgIC8qIE5vdyByZXZlcnNlIHRoZSBiaXRzICovXG4gICAgdHJlZVtuICogMl0vKi5Db2RlKi8gPSBiaV9yZXZlcnNlKG5leHRfY29kZVtsZW5dKyssIGxlbik7XG5cbiAgICAvL1RyYWNlY3YodHJlZSAhPSBzdGF0aWNfbHRyZWUsIChzdGRlcnIsXCJcXG5uICUzZCAlYyBsICUyZCBjICU0eCAoJXgpIFwiLFxuICAgIC8vICAgICBuLCAoaXNncmFwaChuKSA/IG4gOiAnICcpLCBsZW4sIHRyZWVbbl0uQ29kZSwgbmV4dF9jb2RlW2xlbl0tMSkpO1xuICB9XG59XG5cblxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBJbml0aWFsaXplIHRoZSB2YXJpb3VzICdjb25zdGFudCcgdGFibGVzLlxuICovXG5mdW5jdGlvbiB0cl9zdGF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ucGVuZGluZ19idWZbcy5wZW5kaW5nKytdID0gcy5iaV9idWY7XG4gIH1cbiAgcy5iaV9idWYgPSAwO1xuICBzLmJpX3ZhbGlkID0gMDtcbn1cblxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBDb3B5IGEgc3RvcmVkIGJsb2NrLCBzdG9yaW5nIGZpcnN0IHRoZSBsZW5ndGggYW5kIGl0c1xuICogb25lJ3MgY29tcGxlbWVudCBpZiByZXF1ZXN0ZWQuXG4gKi9cbmZ1bmN0aW9uIGNvcHlfYmxvY2socywgYnVmLCBsZW4sIGhlYWRlcilcbi8vRGVmbGF0ZVN0YXRlICpzO1xuLy9jaGFyZiAgICAqYnVmOyAgICAvKiB0aGUgaW5wdXQgZGF0YSAqL1xuLy91bnNpZ25lZCBsZW47ICAgICAvKiBpdHMgbGVuZ3RoICovXG4vL2ludCAgICAgIGhlYWRlcjsgIC8qIHRydWUgaWYgYmxvY2sgaGVhZGVyIG11c3QgYmUgd3JpdHRlbiAqL1xue1xuICBiaV93aW5kdXAocyk7ICAgICAgICAvKiBhbGlnbiBvbiBieXRlIGJvdW5kYXJ5ICovXG5cbiAgaWYgKGhlYWRlcikge1xuICAgIHB1dF9zaG9ydChzLCBsZW4pO1xuICAgIHB1dF9zaG9ydChzLCB+bGVuKTtcbiAgfVxuLy8gIHdoaWxlIChsZW4tLSkge1xuLy8gICAgcHV0X2J5dGUocywgKmJ1ZisrKTtcbi8vICB9XG4gIHV0aWxzLmFycmF5U2V0KHMucGVuZGluZ19idWYsIHMud2luZG93LCBidWYsIGxlbiwgcy5wZW5kaW5nKTtcbiAgcy5wZW5kaW5nICs9IGxlbjtcbn1cblxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBDb21wYXJlcyB0byBzdWJ0cmVlcyw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0gd2hpbGUgKC0tY291bnQgIT09IDApO1xuXG4gICAgfSBlbHNlIGlmIChjdXJsZW4gIT09IDApIHtcbiAgICAgIGlmIChjdXJsZW4gIT09IHByZXZsZW4pIHtcbiAgICAgICAgc2VuZF9jb2RlKHMsIGN1cmxlbiwgcy5ibF90cmVlKTtcbiAgICAgICAgY291bnQtLTtcbiAgICAgIH1cbiAgICAgIC8vQXNzZXJ0KGNvdW50ID49IDMgJiYgY291bnQgPD0gNiwgXCIgM182P1wiKTtcbiAgICAgIHNlbmRfY29kZShzLCBSRVBfM182LCBzLmJsX3RyZWUpO1xuICAgICAgc2VuZF9iaXRzKHMsIGNvdW50IC0gMywgMik7XG5cbiAgICB9IGVsc2UgaWYgKGNvdW50IDw9IDEwKSB7XG4gICAgICBzZW5kX2NvZGUocywgUkVQWl8zXzEwLCBzLmJsX3RyZWUpO1xuICAgICAgc2VuZF9iaXRzKHMsIGNvdW50IC0gMywgMyk7XG5cbiAgICB9IGVsc2Uge1xuICAgICAgc2VuZF9jb2RlKHMsIFJFUFpfMTFfMTM4LCBzLmJsX3RyZWUpO1xuICAgICAgc2VuZF9iaXRzKHMsIGNvdW50IC0gMTEsIDcpO1xuICAgIH1cblxuICAgIGNvdW50ID0gMDtcbiAgICBwcmV2bGVuID0gY3VybGVuO1xuICAgIGlmIChuZXh0bGVuID09PSAwKSB7XG4gICAgICBtYXhfY291bnQgPSAxMzg7XG4gICAgICBtaW5fY291bnQgPSAzO1xuXG4gICAgfSBlbHNlIGlmIChjdXJsZW4gPT09IG5leHRsZW4pIHtcbiAgICAgIG1heF9jb3VudCA9IDY7XG4gICAgICBtaW5fY291bnQgPSAzO1xuXG4gICAgfSBlbHNlIHtcbiAgICAgIG1heF9jb3VudCA9IDc7XG4gICAgICBtaW5fY291bnQgPSA0O1xuICAgIH1cbiAgfVxufVxuXG5cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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ICAgICAgICAgICAgICAgICAucmVwbGFjZSgvXFxcXFwiL2csICdcIicpXG4gICAgICAgICAgICAgICAgIC5yZXBsYWNlKC8oXlwifFwiJCkvZywgXCInXCIpO1xuICAgICAgbmFtZSA9IGN0eC5zdHlsaXplKG5hbWUsICdzdHJpbmcnKTtcbiAgICB9XG4gIH1cblxuICByZXR1cm4gbmFtZSArICc6ICcgKyBzdHI7XG59XG5cblxuZnVuY3Rpb24gcmVkdWNlVG9TaW5nbGVTdHJpbmcob3V0cHV0LCBiYXNlLCBicmFjZXMpIHtcbiAgdmFyIG51bUxpbmVzRXN0ID0gMDtcbiAgdmFyIGxlbmd0aCA9IG91dHB1dC5yZWR1Y2UoZnVuY3Rpb24ocHJldiwgY3VyKSB7XG4gICAgbnVtTGluZXNFc3QrKztcbiAgICBpZiAoY3VyLmluZGV4T2YoJ1xcbicpID49IDApIG51bUxpbmVzRXN0Kys7XG4gICAgcmV0dXJuIHByZXYgKyBjdXIucmVwbGFjZSgvXFx1MDAxYlxcW1xcZFxcZD9tL2csICcnKS5sZW5ndGggKyAxO1xuICB9LCAwKTtcblxuICBpZiAobGVuZ3RoID4gNjApIHtcbiAgICByZXR1cm4gYnJhY2VzWzBdICtcbiAgICAgICAgICAgKGJhc2UgPT09ICcnID8gJycgOiBiYXNlICsgJ1xcbiAnKSArXG4gICAgICAgICAgICcgJyArXG4gICAgICAgICAgIG91dHB1dC5qb2luKCcsXFxuICAnKSArXG4gICAgICAgICAgICcgJyArXG4gICAgICAgICAgIGJyYWNlc1sxXTtcbiAgfVxuXG4gIHJldHVybiBicmFjZXNbMF0gKyBiYXNlICsgJyAnICsgb3V0cHV0LmpvaW4oJywgJykgKyAnICcgKyBicmFjZXNbMV07XG59XG5cblxuLy8gTk9URTogVGhlc2UgdHlwZSBjaGVja2luZyBmdW5jdGlvbnMgaW50ZW50aW9uYWxseSBkb24ndCB1c2UgYGluc3RhbmNlb2ZgXG4vLyBiZWNhdXNlIGl0IGlzIGZyYWdpbGU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T09IDEuMCAmJiBmYWN0b3IgPiAwLjApIHtcblxuICAgICAgICAgIF9leWUubXVsdGlwbHlTY2FsYXIoZmFjdG9yKTtcblxuICAgICAgICAgIGlmIChfdGhpcy5zdGF0aWNNb3ZpbmcpIHtcblxuICAgICAgICAgICAgX3pvb21TdGFydC5jb3B5KF96b29tRW5kKTtcblxuICAgICAgICAgIH0gZWxzZSB7XG5cbiAgICAgICAgICAgIF96b29tU3RhcnQueSArPSAoX3pvb21FbmQueSAtIF96b29tU3RhcnQueSkgKiB0aGlzLmR5bmFtaWNEYW1waW5nRmFjdG9yO1xuXG4gICAgICAgICAgfVxuXG4gICAgICAgIH1cblxuICAgICAgfVxuXG4gICAgfTtcblxuICAgIHRoaXMucGFuQ2FtZXJhID0gKGZ1bmN0aW9uKCkge1xuXG4gICAgICB2YXIgbW91c2VDaGFuZ2UgPSBuZXcgVEhSRUUuVmVjdG9yMigpLFxuICAgICAgICAgIG9iamVjdFVwID0gbmV3IFRIUkVFLlZlY3RvcjMoKSxcbiAgICAgICAgICBwYW4gPSBuZXcgVEhSRUUuVmVjdG9yMygpO1xuXG4gICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG5cbiAgICAgICAgbW91c2VDaGFuZ2UuY29weShfcGFuRW5kKS5zdWIoX3BhblN0YXJ0KTtcblxuICAgICAgICBpZiAobW91c2VDaGFuZ2UubGVuZ3RoU3EoKSkge1xuXG4gICAgICAgICAgbW91c2VDaGFuZ2UubXVsdGlwbHlTY2FsYXIoX2V5ZS5sZW5ndGgoKSAqIF90aGlzLnBhblNwZWVkKTtcblxuICAgICAgICAgIHBhbi5jb3B5KF9leWUpLmNyb3NzKF90aGlzLm9iamVjdC51cCkuc2V0TGVuZ3RoKG1vdXNlQ2hhbmdlLngpO1xuICAgICAgICAgIHBhbi5hZGQob2JqZWN0VXAuY29weShfdGhpcy5vYmplY3QudXApLnNldExlbmd0aChtb3VzZUNoYW5nZS55KSk7XG5cbiAgICAgICAgICBfdGhpcy5vYm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C0gZXZlbnQudG91Y2hlc1sgMSBdLnBhZ2VYO1xuICAgICAgICAgICAgICB2YXIgZHkgPSBldmVudC50b3VjaGVzWyAwIF0ucGFnZVkgLSBldmVudC50b3VjaGVzWyAxIF0ucGFnZVk7XG4gICAgICAgICAgICAgIF90b3VjaFpvb21EaXN0YW5jZUVuZCA9IF90b3VjaFpvb21EaXN0YW5jZVN0YXJ0ID0gTWF0aC5zcXJ0KGR4ICogZHggKyBkeSAqIGR5KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIF9zdGF0ZSA9IFNUQVRFLlpPT007XG4gICAgICAgICAgICAgIF96b29tU3RhcnQuY29weShnZXRNb3VzZU9uU2NyZWVuKGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWCwgZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VZKSk7XG4gICAgICAgICAgICAgIF96b29tRW5kLmNvcHkoX3pvb21TdGFydCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICBjYXNlIDU6XG4gICAgICAgICAgICBpZiAoZXZlbnQudG91Y2hlcy5sZW5ndGggPj0gMikge1xuICAgICAgICAgICAgICBfc3RhdGUgPSBTVEFURS5UT1VDSF9QQU47XG4gICAgICAgICAgICAgIHZhciB4ID0gKGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWCArIGV2ZW50LnRvdWNoZXNbIDEgXS5wYWdlWCkgLyAyO1xuICAgICAgICAgICAgICB2YXIgeSA9IChldmVudC50b3VjaGVzWyAwIF0ucGFnZVkgKyBldmVudC50b3VjaGVzWyAxIF0ucGFnZVkpIC8gMjtcbiAgICAgICAgICAgICAgX3BhblN0YXJ0LmNvcHkoZ2V0TW91c2VPblNjcmVlbih4LCB5KSk7XG4gICAgICAgICAgICAgIF9wYW5FbmQuY29weShfcGFuU3RhcnQpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgX3N0YXRlID0gU1RBVEUuUEFOO1xuICAgICAgICAgICAgICBfcGFuU3RhcnQuY29weShnZXRNb3VzZU9uU2NyZWVuKGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWCwgZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VZKSk7XG4gICAgICAgICAgICAgIF9wYW5FbmQuY29weShfcGFuU3RhcnQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIDk5OlxuICAgICAgICAgICAgX3N0YXRlID0gU1RBVEUuQ1VTVE9NO1xuICAgICAgICAgICAgdmFyIHggPSAoZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VYICsgZXZlbnQudG91Y2hlc1sgMSBdLnBhZ2VYKSAvIDI7XG4gICAgICAgICAgICB2YXIgeSA9IChldmVudC50b3VjaGVzWyAwIF0ucGFnZVkgKyBldmVudC50b3VjaGVzWyAxIF0ucGFnZVkpIC8gMjtcbiAgICAgICAgICAgIF9jdXN0b21TdGFydC5jb3B5KGdldE1vdXNlT25TY3JlZW4oeCwgeSkpO1xuICAgICAgICAgICAgX2N1c3RvbUVuZC5jb3B5KF9jdXN0b21TdGFydCk7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICBfc3RhdGUgPSBTVEFURS5OT05FO1xuXG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgX3RoaXMuZGlzcGF0Y2hFdmVudChzdGFydEV2ZW50KTtcblxuICAgIH1cblxuICAgIGZ1bmN0aW9uIHRvdWNobW92ZShldmVudCkge1xuXG4gICAgICBpZiAoX3RoaXMuZW5hYmxlZCA9PT0gZmFsc2UpIHJldHVybjtcblxuICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcbiAgICAgIGV2ZW50LnN0b3BQcm9wYWdhdGlvbigpO1xuXG4gICAgICBpZiAoX3RoaXMuZm9yY2VTdGF0ZSA9PT0gLTEpIHtcblxuICAgICAgICBzd2l0Y2ggKGV2ZW50LnRvdWNoZXMubGVuZ3RoKSB7XG5cbiAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICBfbW92ZVByZXYuY29weShfbW92ZUN1cnIpO1xuICAgICAgICAgICAgX21vdmVDdXJyLmNvcHkoZ2V0TW91c2VPbkNpcmNsZShldmVudC50b3VjaGVzWyAwIF0ucGFnZVgsIGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWSkpO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICB2YXIgZHggPSBldmVudC50b3VjaGVzWyAwIF0ucGFnZVggLSBldmVudC50b3VjaGVzWyAxIF0ucGFnZVg7XG4gICAgICAgICAgICB2YXIgZHkgPSBldmVudC50b3VjaGVzWyAwIF0ucGFnZVkgLSBldmVudC50b3VjaGVzWyAxIF0ucGFnZVk7XG4gICAgICAgICAgICBfdG91Y2hab29tRGlzdGFuY2VFbmQgPSBNYXRoLnNxcnQoZHggKiBkeCArIGR5ICogZHkpO1xuXG4gICAgICAgICAgICB2YXIgeCA9IChldmVudC50b3VjaGVzWyAwIF0ucGFnZVggKyBldmVudC50b3VjaGVzWyAxIF0ucGFnZVgpIC8gMjtcbiAgICAgICAgICAgIHZhciB5ID0gKGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWSArIGV2ZW50LnRvdWNoZXNbIDEgXS5wYWdlWSkgLyAyO1xuICAgICAgICAgICAgX3BhbkVuZC5jb3B5KGdldE1vdXNlT25TY3JlZW4oeCwgeSkpO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgX3N0YXRlID0gU1RBVEUuTk9ORTtcbiAgICAgICAgfVxuXG4gICAgICB9IGVsc2Uge1xuICAgICAgICAvL3sgTk9ORTogLTEsIFJPVEFURTogMCwgWk9PTTogMSwgUEFOOiAyLCBUT1VDSF9ST1RBV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xuXG4gICAgICAgICAgY2FzZSA1OlxuICAgICAgICAgICAgLy8gMiBmaW5nZXJzXG4gICAgICAgICAgICAvLyBUT1VDSF9QQU5cbiAgICAgICAgICAgIHZhciB4ID0gKGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWCArIGV2ZW50LnRvdWNoZXNbIDEgXS5wYWdlWCkgLyAyO1xuICAgICAgICAgICAgdmFyIHkgPSAoZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VZICsgZXZlbnQudG91Y2hlc1sgMSBdLnBhZ2VZKSAvIDI7XG4gICAgICAgICAgICBfcGFuRW5kLmNvcHkoZ2V0TW91c2VPblNjcmVlbih4LCB5KSk7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgOTk6XG4gICAgICAgICAgICB2YXIgeCA9IChldmVudC50b3VjaGVzWyAwIF0ucGFnZVggKyBldmVudC50b3VjaGVzWyAxIF0ucGFnZVgpIC8gMjtcbiAgICAgICAgICAgIHZhciB5ID0gKGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWSArIGV2ZW50LnRvdWNoZXNbIDEgXS5wYWdlWSkgLyAyO1xuICAgICAgICAgICAgX2N1c3RvbUVuZC5jb3B5KGdldE1vdXNlT25TY3JlZW4oeCwgeSkpO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgX3N0YXRlID0gU1RBVEUuTk9ORTtcblxuICAgICAgICB9XG4gICAgICB9XG5cbiAgICB9XG5cbiAgICBmdW5jdGlvbiB0b3VjaGVuZChldmVudCkge1xuXG4gICAgICBpZiAoX3RoaXMuZW5hYmxlZCA9PT0gZmFsc2UpIHJldHVybjtcblxuICAgICAgaWYgKF90aGlzLmZvcmNlU3RhdGUgPT09IC0xKSB7XG4gICAgICAgIHN3aXRjaCAoZXZlbnQudG91Y2hlcy5sZW5ndGgpIHtcblxuICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgIF9tb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gICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAvLyBUT1VDSCBaT09NXG4gICAgICAgICAgICBfdG91Y2hab29tRGlzdGFuY2VTdGFydCA9IF90b3VjaFpvb21EaXN0YW5jZUVuZCA9IDA7XG4gICAgICAgICAgICBfc3RhdGUgPSBTVEFURS5aT09NO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIDU6XG4gICAgICAgICAgICAvLyBUT1VDSCBaT09NXG4gICAgICAgICAgICBpZiAoZXZlbnQudG91Y2hlcy5sZW5ndGggPj0gMikge1xuICAgICAgICAgICAgICB2YXIgeCA9IChldmVudC50b3VjaGVzWyAwIF0ucGFnZVggKyBldmVudC50b3VjaGVzWyAxIF0ucGFnZVgpIC8gMjtcbiAgICAgICAgICAgICAgdmFyIHkgPSAoZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VZICsgZXZlbnQudG91Y2hlc1sgMSBdLnBhZ2VZKSAvIDI7XG4gICAgICAgICAgICAgIF9wYW5FbmQuY29weShnZXRNb3VzZU9uU2NyZWVuKHgsIHkpKTtcbiAgICAgICAgICAgICAgX3BhblN0YXJ0LmNvcHkoX3BhbkVuZCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBfc3RhdGUgPSBTVEFURS5QQU47XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgOTk6XG4gICAgICAgICAgICB2YXIgeCA9IChldmVudC50b3VjaGVzWyAwIF0ucGFnZVggKyBldmVudC50b3VjaGVzWyAxIF0ucGFnZVgpIC8gMjtcbiAgICAgICAgICAgIHZhciB5ID0gKGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWSArIGV2ZW50LnRvdWNoZXNbIDEgXS5wYWdlWSkgLyAyO1xuICAgICAgICAgICAgX2N1c3RvbUVuZC5jb3B5KGdldE1vdXNlT25TY3JlZW4oeCwgeSkpO1xuICAgICAgICAgICAgX2N1c3RvbVN0YXJ0LmNvcHkoX2N1c3RvbUV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mVlbi53aWR0aCxcbiAgICAgICAgICAocGFnZVkgLSBfdGhpcy5zY3JlZW4udG9wKSAvIF90aGlzLnNjcmVlbi5oZWlnaHRcbiAgICAgICAgKTtcblxuICAgICAgICByZXR1cm4gdmVjdG9yO1xuXG4gICAgICB9O1xuXG4gICAgfSgpKTtcblxuICAgIHRoaXMuem9vbUNhbWVyYSA9IGZ1bmN0aW9uKCkge1xuXG4gICAgICBpZiAoX3N0YXRlID09PSBTVEFURS5UT1VDSF9aT09NX1BBTikge1xuXG4gICAgICAgIHZhciBmYWN0b3IgPSBfdG91Y2hab29tRGlzdGFuY2VFbmQgLyBfdG91Y2hab29tRGlzdGFuY2VTdGFydDtcbiAgICAgICAgX3RvdWNoWm9vbURpc3RhbmNlU3RhcnQgPSBfdG91Y2hab29tRGlzdGFuY2VFbmQ7XG5cbiAgICAgICAgX3RoaXMub2JqZWN0Lnpvb20gKj0gZmFjdG9yO1xuXG4gICAgICAgIF9jaGFuZ2VkID0gdHJ1ZTtcblxuICAgICAgfSBlbHNlIHtcblxuICAgICAgICB2YXIgZmFjdG9yID0gMS4wICsgKF96b29tRW5kLnkgLSBfem9vbVN0YXJ0LnkpICogX3RoaXMuem9vbVNwZWVkO1xuXG4gICAgICAgIGlmIChNYXRoLmFicyhmYWN0b3IgLSAxLjApID4gRVBTICYmIGZhY3RvciA+IDAuMCkge1xuXG4gICAgICAgICAgX3RoaXMub2JqZWN0Lnpvb20gLz0gZmFjdG9yO1xuXG4gICAgICAgICAgaWYgKF90aGlzLnN0YXRpY01vdmluZykge1xuXG4gICAgICAgICAgICBfem9vbVN0YXJ0LmNvcHkoX3pvb21FbmQpO1xuXG4gICAgICAgICAgfSBlbHNlIHtcblxuICAgICAgICAgICAgX3pvb21TdGFydC55ICs9IChfem9vbUVuZC55IC0gX3pvb21TdGFydC55KSAqIHRoaXMuZHluYW1pY0RhbXBpbmdGYWN0b3I7XG5cbiAgICAgICAgICB9XG5cbiAgICAgICAgICBfY2hhbmdlZCA9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gICAgICAgIF90aGlzLm9iamVjdC5wb3NpdGlvbi5hZGQocGFuKTtcbiAgICAgICAgICBfdGhpcy50YXJnZXQuYWRkKHBhbik7XG5cbiAgICAgICAgICBpZiAoX3RoaXMuc3RhdGljTW92aW5nKSB7XG5cbiAgICAgICAgICAgIF9wYW5TdGFydC5jb3B5KF9wYW5FbmQpO1xuXG4gICAgICAgICAgfSBlbHNlIHtcblxuICAgICAgICAgICAgX3BhblN0YXJ0LmFkZChtb3VzZUNoYW5nZS5zdWJWZWN0b3JzKF9wYW5FbmQsIF9wYW5TdGFydCkubXVsdGlwbHlTY2FsYXIoX3RoaXMuZHluYW1pY0RhbXBpbmdGYWN0b3IpKTtcblxuICAgICAgICAgIH1cblxuICAgICAgICAgIF9jaGFuZ2VkID0gdHJ1ZTtcblxuICAgICAgICB9XG5cbiAgICAgIH1cblxuICAgIH0oKSk7XG5cbiAgICB0aGlzLnVwZGF0ZSA9IGZ1bmN0aW9uKCkge1xuXG4gICAgICBfZXllLnN1YlZlY3RvcnMoX3RoaXMub2JqZWN0LnBvc2l0aW9uLCBfdGhpcy50YXJnZXQpO1xuXG4gICAgICBpZiAoIV90aGlzLm5vWm9vbSkge1xuXG4gICAgICAgIF90aGlzLnpvb21DYW1lcmEoKTtcblxuICAgICAgICBpZiAoX2NoYW5nZWQpIHtcblxuICAgICAgICAgIF90aGlzLm9iamVjdC51cGRhdGVQcm9qZWN0aW9uTWF0cml4KCk7XG5cbiAgICAgICAgfVxuXG4gICAgICB9XG5cbiAgICAgIGlmICghX3RoaXMubm9QYW4pIHtcblxuICAgICAgICBfdGhpcy5wYW5DYW1lcmEoKTtcblxuICAgICAgfVxuXG4gICAgICBfdGhpcy5vYmplY3QucG9zaXRpb24uYWRkVmVjdG9ycyhfdGhpcy50YXJnZXQsIF9leWUpO1xuXG4gICAgICBfdGhpcy5vYmplY3QubG9va0F0KF90aGlzLnRhcmdldCk7XG5cbiAgICAgIGlmIChfY2hhbmdlZCkge1xuXG4gICAgIC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GltZW5zaW9ucy55LCBhYWJiLmNlbnRlci56ICsgYWFiYi5oYWxmRGltZW5zaW9ucy56KSxcbiAgICAgIG9yaWVudGF0aW9uLnhcbiAgICApO1xuICAgIHRoaXMucmF5UGxhbmVJbkJCb3gocmF5MiwgcGxhbmVBQUJCLCBiYm94LCBpbnRlcnNlY3Rpb25zKTtcblxuICAgIHJheTIuZGlyZWN0aW9uID0gb3JpZW50YXRpb24ueTtcbiAgICB0aGlzLnJheVBsYW5lSW5CQm94KHJheTIsIHBsYW5lQUFCQiwgYmJveCwgaW50ZXJzZWN0aW9ucyk7XG5cbiAgICByYXkyLmRpcmVjdGlvbiA9IG9yaWVudGF0aW9uLno7XG4gICAgdGhpcy5yYXlQbGFuZUluQkJveChyYXkyLCBwbGFuZUFBQkIsIGJib3gsIGludGVyc2VjdGlvbnMpO1xuXG4gICAgLy8gUkFZUyBTVEFSVElORyBGUk9NIFRIRSBTRUNPTkQgQ09STkVSXG4gICAgLy9cbiAgICAvLyAgICAgICAgICAgICAgICtcbiAgICAvLyAgICAgICAgICAgICAgIHxcbiAgICAvLyAgICAgICAgICAgICAgIHxcbiAgICAvLyAgICAgICAgICAgICAgIHxcbiAgICAvLyAgICAgICAgICAgICAgICtcbiAgICAvLyAgICAgICAgICAgICAuJ1xuICAgIC8vICAgICAgICAgICArJ1xuXG4gICAgbGV0IHJheTMgPSB0aGlzLnBvc2RpcihcbiAgICAgIG5ldyBUSFJFRS5WZWN0b3IzKGFhYmIuY2VudGVyLnggKyBhYWJiLmhhbGZEaW1lbnNpb25zLngsIGFhYmIuY2VudGVyLnkgLSBhYWJiLmhhbGZEaW1lbnNpb25zLnksIGFhYmIuY2VudGVyLnogLSBhYWJiLmhhbGZEaW1lbnNpb25zLnopLFxuICAgICAgb3JpZW50YXRpb24ueVxuICAgICk7XG4gICAgdGhpcy5yYXlQbGFuZUluQkJveChyYXkzLCBwbGFuZUFBQkIsIGJib3gsIGludGVyc2VjdGlvbnMpO1xuXG4gICAgcmF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5fb3JpZW50YXRpb24pe1xuICAgICAgY2FzZSAwOlxuICAgICAgICBwb3NpdGlvbiA9IG5ldyBUSFJFRS5WZWN0b3IzKFxuICAgICAgICAgIE1hdGguZmxvb3IoclBvc2l0aW9uLngpLFxuICAgICAgICAgIE1hdGguZmxvb3IoclBvc2l0aW9uLnkpLFxuICAgICAgICAgIGluZGV4KTtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIDE6XG4gICAgICAgIHBvc2l0aW9uID0gbmV3IFRIUkVFLlZlY3RvcjMoXG4gICAgICAgICAgaW5kZXgsXG4gICAgICAgICAgTWF0aC5mbG9vcihyUG9zaXRpb24ueSksXG4gICAgICAgICAgTWF0aC5mbG9vcihyUG9zaXRpb24ueikpO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgMjpcbiAgICAgICAgcG9zaXRpb24gPSBuZXcgVEhSRUUuVmVjdG9yMyhcbiAgICAgICAgICBNYXRoLmZsb29yKHJQb3NpdGlvbi54KSxcbiAgICAgICAgICBpbmRleCxcbiAgICAgICAgICBNYXRoLmZsb29yKHJQb3NpdGlvbi56KSk7XG4gICAgICAgIGJyZWFrO1xuICAgICAgZGVmYXVsdDpcbiAgICAgICAgLy8gZG8gbm90aGluZyFcbiAgICAgICAgYnJlYWs7XG4gICAgfVxuICAgIHJldHVybiBwb3NpdGlvbjtcbiAgfVxuXG4gIC8qKlxuICAgKiBDb21wdXRlIHNsaWNlIGRpcmVjdGlvbiBkZXBlbmRpbmcgb24gb3JpZW50YXRpb24uXG4gICAqXG4gICAqIEBwYXJhbSB7bnVtYmVyfSBvcmllbnRhdGlvbiAtIFNsaWNlIG9yaWVudGF0aW9uLlxuICAgKlxuICAgKiBAcmV0dXJucyB7VEhSRUUuVmVjdG9yM30gU2xpY2UgZGlyZWN0aW9uXG4gICAqXG4gICAqIEBwcml2YXRlXG4gICAqL1xuICBfcHJlcGFyZURpcmVjdGlvbihvcmllbnRhdGlvbil7XG4gICAgbGV0IGRpcmVjdG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9ICB0cnVlO1xuICAgIHRoaXMuX3Nob3dEb21NZWFzdXJlbWVudHMgPSAgdHJ1ZTtcbiAgICB0aGlzLl9jb2xvciA9ICcjMDBCMEZGJztcbiAgICAvLyBqdXN0IHZpc3VhbGl6YXRpb25cbiAgICAvLyB0aGlzLl9zdmdQb2ludGVyID0gJzxzdmcgd2lkdGg9XCI0MFwiIGhlaWdodD1cIjQwXCIgXFxcbiAgICAvLyAgICAgIHZpZXdCb3g9XCIwIDAgMTQwIDE0MFwiIHZlcnNpb249XCIxLjFcIiBcXFxuICAgIC8vICAgICAgeG1sbnM9XCJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2Z1wiPiBcXFxuICAgIC8vICAgXFxcbiAgICAvLyAgICAgPHBvbHlsaW5lIHBvaW50cz1cIjEwLDcwIFxcXG4gICAgLy8gICAgICAgICAgICAgICAgICAgICAgIDcwLDEwIFxcXG4gICAgLy8gICAgICAgICAgICAgICAgICAgICAgIDEzMCw3MFwiIC8+XFxcbiAgICAvLyAgIFxcXG4gICAgLy8gICA8L3N2Zz4nO1xuICAgIC8qanNoaW50IG11bHRpc3RyOiB0cnVlICovXG4gICAgdGhpcy5fc3ZnUG9pbnRlciA9ICc8c3ZnIHdpZHRoPVwiNDBcIiBoZWlnaHQ9XCI0MFwiIFxcXG4gICAgICAgICAgICAgICAgICAgICAgdmlld0JveD1cIjAgMCAxNDAgMTQwXCIgdmVyc2lvbj1cIjEuMVwiIFxcXG4gICAgICAgICAgICAgICAgICAgICAgeG1sbnM9XCJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2Z1wiPiBcXFxuICAgICAgICAgICAgICAgICAgICAgIFxcXG4gICAgICAgICAgICAgICAgICAgICAgPHBhdGggZD1cIk03MCw3MCBcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEwzMCwzMCBcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEExMCwxMCAwIDEgMSAxMCwxMFxcXG4gICAgICAgICAgICA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B0byB0aGUgVUkgdG8gdXBkYXRlIGJlY2F1c2UgYWZ0ZXIgdGhlIHJlbmRlcmluZyB3aWxsIGJlIGJsb2NrZWQgd2l0aCBpbnRlbnNpdmUgSlNcbiAgICB0aGlzLl9wcm9ncmVzc0Jhci51cGRhdGUoMCwgMTAwLCAncGFyc2UnKTtcblxuICAgIHJldHVybiBuZXcgUHJvbWlzZShcbiAgICAgICAgKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuICAgICAgICAgICAgd2luZG93LnNldFRpbWVvdXQoXG4gICAgICAgICAgICAgICgpID0+IHtcbiAgICAgICAgICAgICAgICByZXNvbHZlKG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHtcblxuICAgICAgICAgICAgICAgICAgbGV0IGRhdGEgPSByZXNwb25zZTtcbiAgICAgICAgICAgICAgICAgIGRhdGEuZ3pjb21wcmVzc2VkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICBkYXRhLmZpbGVuYW1lID0gJyc7XG4gICAgICAgICAgICAgICAgICBkYXRhLmV4dGVuc2lvbiA9ICcnO1xuXG4gICAgICAgICAgICAgICAgICAvLyB1bmNvbXByZXNzP1xuICAgICAgICAgICAgICAgICAgZGF0YS5maWxlbmFtZSA9IHJlc3BvbnNlLnVybC5zcGxpdCgnLycpLnBvcCgpO1xuICAgICAgICAgICAgICAgICAgZGF0YS5nemNvbXByZXNzZWQgPSBmYWxzZTtcblxuICAgICAgICAgICAgICAgICAgLy8gZmluZCBleHRlbnNpb25cbiAgICAgICAgICAgICAgICAgIGxldCBzcGxpdHRlZE5hbWUgPSBkYXRhLmZpbGVuYW1lLnNwbGl0KCcuJyk7XG4gICAgICAgICAgICAgICAgICBpZihzcGxpdHRlZE5hbWUubGVuZ3RoIDw9IDEpe1xuICAgICAgICAgICAgICAgICAgICBkYXRhLmV4dGVuc2lvbiA9ICcnO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgZWxzZXtcbiAgICAgICAgICAgICAgICAgICAgZGF0YS5leHRlbnNpb24gPSBkYXRhLmZpbGVuYW1lLnNwbGl0KCcuJykucG9wKCk7XG4gICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgIC8vIHVuemlwIGlmIGV4dGVuc2lvbiBpcyAnLmd6J1xuICAgICAgICAgICAgICAgICAgaWYgKGRhdGEuZXh0ZW5zaW9uID09PSAnZ3onKSB7XG4gICAgICAgICAgICAgICAgICAgIGRhdGEuZ3pjb21wcmVzc2VkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgZGF0YS5leHRlbnNpb24gPSBkYXRhLmZpbGVuYW1lLnNwbGl0KCcuZ3onKS5zaGlmdCgpLnNwbGl0KCcuJykucG9wKCk7XG4gICAgICAgICAgICAgICAgICAgIGxldCBkZWNvbXByZXNzZWREYXRhID0gcGFrby5pbmZsYXRlKGRhdGEuYnVmZmVyKTtcbiAgICAgICAgICAgICAgICAgICAgZGF0YS5idWZmZXIgPSBkZWNvbXByZXNzZWREYXRhLmJ1ZmZlcjtcbiAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgbGV0IHBhcnNlciA9IHRoaXMuX3BhcnNlcihkYXRhLmV4dGVuc2lvbik7XG4gICAgICAgICAgICAgICAgICBpZiAoIXBhcnNlcikge1xuICAgICAgICAgICAgICAgICAgICByZWplY3QoZGF0YS5maWxlbmFtZSArICcgY2FuIG5vdCBiZSBwYXJzZWQuJyk7XG4gICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgIC8vIGNoZWNrIGV4dGVuc2lvblxuICAgICAgICAgICAgICAgICAgbGV0IHZvbHVtZVBhcnNlciA9IG51bGw7XG4gICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICB2b2x1bWVQYXJzZXIgPSBuZXcgcGFyc2VyKGRhdGEsIDApO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgd2luZG93LmNvbnNvbGUubG9nKGUpO1xuICAgICAgICAgICAgICAgICAgICByZWplY3QoZSk7XG4gICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgIC8vIGNyZWF0ZSBhIHNlcmllc1xuICAgICAgICAgICAgICAgICAgbGV0IHNlcmllcyA9IG5ldyBNb2RlbHNTZXJpZXMoKTtcbiAgICAgICAgICAgICAgICAgIHNlcmllcy5zZXJpZXNJbnN0YW5jZVVJRCA9IHZvbHVtZVBhcnNlci5zZXJpZXNJbnN0YW5jZVVJRCgpO1xuICAgICAgICAgICAgICAgICAgc2VyaWVzLm51bWJlck9mRnJhbWVzICAgID0gdm9sdW1lUGFyc2VyLm51bWJlck9mRnJhbWVzKCk7XG4gICAgICAgICAgICAgICAgICBpZiAoIXNlcmllcy5udW1iZXJPZkZyYW1lcykge1xuICAgICAgICAgICAgICAgICAgICBzZXJpZXMubnVtYmVyT2ZGcmFtZXMgPSAxO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgc2VyaWVzLm51bWJlck9mQ2hhbm5lbHMgID0gdm9sdW1lUGFyc2VyLm51bWJlck9mQ2hhbm5lbHMoKTtcbiAgICAgICAgICAgICAgICAgIHNlcmllcy5tb2RhbGl0eSAgICAgICAgICA9IHZvbHVtZVBhcnNlci5tb2RhbGl0eSgpO1xuICAgICAgICAgICAgICAgICAgLy8gaWYgaXQgaXMgYSBzZWdtZW50YXRpb24sIGF0dGFjaCBleHRyYSBpbmZvcm1hdGlvblxuICAgICAgICAgICAgICAgICAgaWYoc2VyaWVzLm1vZGFsaXR5ID09PSAnU0VHJyl7XG4gICAgICAgICAgICAgICAgICAgIC8vIGNvbG9yc1xuICAgICAgICAgICAgICAgICAgICAvLyBsYWJlbHNcbiAgICAgICAgICAgICAgICAgICAgLy8gZXRjLlxuICAgICAgICAgICAgICAgICAgICBzZXJpZXMuc2VnbWVudGF0aW9uVHlwZSAgICAgPSB2b2x1bWVQYXJzZXIuc2VnbWVudGF0aW9uVHlwZSgpO1xuICAgICAgICAgICAgICAgICAgICBzZXJpZXMuc2VnbWVudGF0aW9uU2VnbWVudHMgPSB2b2x1bWVQYXJzZXIuc2VnbWVudGF0aW9uU2VnbWVudHMoKTtcbiAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgLy8ganVzdCBjcmVhdGUgMSBkdW1teSBzdGFjayBmb3Igbm93XG4gICAgICAgICAgICAgICAgICBsZXQgc3RhY2sgPSBuZXcgTW9kZWxzU3RhY2soKTtcbiAgICAgICAgICAgICAgICAgIHN0YWNrLm51bWJlck9mQ2hhbm5lbHMgPSB2b2x1bWVQYXJzZXIubnVtYmVyT2ZDaGFubmVscygpO1xuICAgICAgICAgICAgICAgICAgc3RhY2sucGl4ZWxUeXBlICAgICAgICA9IHZvbHVtZVBhcnNlci5waXhlbFR5cGUoKTtcbiAgICAgICAgICAgICAgICAgIHN0YWNrLmludmVydCAgICAgICAgICAgPSB2b2x1bWVQYXJzZXIuaW52ZXJ0KCk7XG4gICAgICAgICAgICAgICAgICBzdGFjay5tb2RhbGl0eSAgICAgICAgID0gc2VyaWVzLm1vZGFsaXR5O1xuICAgICAgICAgICAgICAgICAgc3RhY2sucmlnaHRIYW5kZWQgICAgICAgPSB2b2x1bWVQYXJzZXIucmlnaHRIYW5kZWQoKTtcbiAgICAgICAgICAgICAgICAgIC8vIGlmIGl0IGlzIGEgc2VnbWVudGF0aW9uLCBhdHRhY2ggZXh0cmEgaW5mb3JtYXRpb25cbiAgICAgICAgICAgICAgICAgIGlmKHN0YWNrLm1vZGFsaXR5ID09PSAnU0VHJyl7XG4gICAgICAgICAgICAgICAgICAgIC8vIGNvbG9yc1xuICAgICAgICAgICAgICAgICAgICAvLyBsYWJlbHNcbiAgICAgICAgICAgICAgICAgICAgLy8gZXRjLlxuICAgICAgICAgICAgICAgICAgICBzdGFjay5zZWdtZW50YXRpb25UeXBl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m94ID0gW1xuICAgICAgTnVtYmVyLk1BWF9WQUxVRSwgTnVtYmVyLk1JTl9WQUxVRSxcbiAgICAgIE51bWJlci5NQVhfVkFMVUUsIE51bWJlci5NSU5fVkFMVUUsXG4gICAgICBOdW1iZXIuTUFYX1ZBTFVFLCBOdW1iZXIuTUlOX1ZBTFVFXG4gICAgXTtcblxuICAgIGZvciAoIGxldCBpID0gMDsgaSA8PSB0aGlzLl9kaW1lbnNpb25zSUpLLng7IGkgKz0gdGhpcy5fZGltZW5zaW9uc0lKSy54ICkge1xuICAgICAgZm9yICggbGV0IGogPSAwOyBqIDw9IHRoaXMuX2RpbWVuc2lvbnNJSksueTsgaiArPSB0aGlzLl9kaW1lbnNpb25zSUpLLnkgKSB7XG4gICAgICAgIGZvciAobGV0IGsgPSAwOyBrIDw9IHRoaXMuX2RpbWVuc2lvbnNJSksuejsgayArPSB0aGlzLl9kaW1lbnNpb25zSUpLLnogKSB7XG5cbiAgICAgICAgICBsZXQgd29ybGQgPSBuZXcgVEhSRUUuVmVjdG9yMyggaSwgaiwgayApLmFwcGx5TWF0cml4NCggdGhpcy5faWprMkxQUyApO1xuICAgICAgICAgIGJib3ggPSBbXG4gICAgICAgICAgICBNYXRoLm1pbihiYm94WzBdLCB3b3JsZC54KSwgTWF0aC5tYXgoYmJveFsxXSwgd29ybGQueCksIC8vIHggbWluL21heFxuICAgICAgICAgICAgTWF0aC5taW4oYmJveFsyXSwgd29ybGQueSksIE1hdGgubWF4KGJib3hbM10sIHdvcmxkLnkpLFxuICAgICAgICAgICAgTWF0aC5taW4oYmJveFs0XSwgd29ybGQueiksIE1hdGgubWF4KGJib3hbNV0sIHdvcmxkLnopXG4gICAgICAgICAgICBdO1xuXG4gICAgICAgIH1cblxuICAgICAgfVxuXG4gICAgfVxuXG4gICAgcmV0dXJuIGJib3g7XG5cbiAgfVxuXG4gIEFBQkJveCgpIHtcblxuICAgIGxldCB3b3JsZDAgPSBuZXcgVEhSRUUuVmVjdG9yMygpLmF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cnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDMgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA0OlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDQgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA1OlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDUgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA2OlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDYgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA3OlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDcgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgYml0U3RhcnRPZmZzZXQrKztcbiAgICAgICAgICBpbmRleCsrO1xuICAgICAgICAgIC8vIGlmIHJldHVybi4uXG4gICAgICAgICAgaWYgKGluZGV4ID49IG51bVBpeGVscykge1xuICAgICAgICAgICAgcmV0dXJuIG5ld0FycmF5O1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBiaXRTdGFydE9mZnNldCA9IDA7XG5cbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICBfY29udmVydENvbG9yU3BhY2UodW5jb21wcmVzc2VkRGF0YSkge1xuICAgIGxldCByZ2JEYXRhID0gbnVsbDtcbiAgICBsZXQgcGhvdG9tZXRyaWNJbnR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2RhdGFTZXQucXVhdGVybl9kO1xuICAgICAgLy8gY29tcHV0ZSBhXG4gICAgICBhID0gMS4wIC0gKGIqYiArIGMqYyArIGQqZCkgO1xuICAgICAgaWYoIGEgPCAwLjAwMDAwMDEgKXsgICAgICAgICAgICAgICAgICAgLyogc3BlY2lhbCBjYXNlICovXG5cbiAgICAgICAgYSA9IDEuMCAvIE1hdGguc3FydChiKmIrYypjK2QqZCkgO1xuICAgICAgICBiICo9IGEgOyBjICo9IGEgOyBkICo9IGEgOyAgICAgICAgLyogbm9ybWFsaXplIChiLGMsZCkgdmVjdG9yICovXG4gICAgICAgIGEgPSAwLjA7ICAgICAgICAgICAgICAgICAgICAgICAvKiBhID0gMCA9PT4gMTgwIGRlZ3JlZSByb3RhdGlvbiAqL1xuXG4gICAgICB9IGVsc2Uge1xuXG4gICAgICAgIGEgPSBNYXRoLnNxcnQoYSkgOyAgICAgICAgICAgICAgICAgICAgIC8qIGFuZ2xlID0gMiphcmNjb3MoYSkgKi9cblxuICAgICAgfVxuXG4gICAgICBpZih0aGlzLl9kYXRhU2V0LnBpeERpbXNbMF0gPCAwLjApIHtcblxuICAgICAgICB0aGlzLl9yaWdodEhhbmRlZCA9IGZhbHNlO1xuXG4gICAgICB9XG5cbiAgICAgICByZXR1cm4gW1xuICAgICAgICAgIC0oYSphK2IqYi1jKmMtZCpkKSxcbiAgICAgICAgICAtMiooYipjK2EqZCksXG4gICAgICAgICAgMiooYipkLWEqYyksXG4gICAgICAgICAgLTIqKGIqYy1hKmQpLFxuICAgICAgICAgIC0oYSphK2MqYy1iKmItZCpkKSxcbiAgICAgICAgICAyKihjKmQrYSpiKVxuICAgICAgICBdO1xuXG4gICAgfWVsc2UgaWYodGhpcy5fZGF0YVNldC5zZm9ybV9jb2RlID4gMCkgeyAgXG5cbiAgICAgIGNvbnNvbGUubG9nKCAnc2Zvcm0gPiAwJyApO1xuXG4gICAgICB2YXIgc3ggPSB0aGlzLl9kYXRhU2V0LnNyb3dfeCwgc3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B0eXBlOiAnaScsXG4gICAgICAgIHZhbHVlOiAwLFxuICAgICAgICB0eXBlR0xTTDogJ2ludCdcbiAgICAgIH0sXG4gICAgICAndVBhY2tlZFBlclBpeGVsJzoge1xuICAgICAgICB0eXBlOiAnaScsXG4gICAgICAgIHZhbHVlOiAxLFxuICAgICAgICB0eXBlR0xTTDogJ2ludCdcbiAgICAgIH0sXG4gICAgICAndUludGVycG9sYXRpb24nOiB7XG4gICAgICAgIHR5cGU6ICdpJyxcbiAgICAgICAgdmFsdWU6IDEsXG4gICAgICAgIHR5cGVHTFNMOiAnaW50J1xuICAgICAgfSxcbiAgICAgICd1V29ybGRCQm94Jzoge1xuICAgICAgICB0eXBlOiAnZnYxJyxcbiAgICAgICAgdmFsdWU6IFswLjAsIDAuMCwgMC4wLCAwLjAsIDAuMCwgMC4wXSxcbiAgICAgICAgdHlwZUdMU0w6ICdmbG9hdCcsXG4gICAgICAgIGxlbmd0aDogNlxuICAgICAgfSxcbiAgICAgICd1U3RlcHMnOiB7XG4gICAgICAgIHR5cGU6ICdpJyxcbiAgICAgICAgdmFsdWU6IDI1NixcbiAgICAgICAgdHlwZUdMU0w6ICdpbnQnXG4gICAgICB9LFxuICAgICAgJ3VBbHBoYUNvcnJlY3Rpb24nOntcbiAgICAgICAgdHlwZTogJ2YnLFxuICAgICAgICB2YWx1ZTogMC41LFxuICAgICAgICB0eXBlR0xTTDogJ2Zsb2F0J1xuICAgICAgfSxcbiAgICAgICd1RnJlcXVlbmNlJzp7XG4gICAgICAgIHR5cGU6ICdmJyxcbiAgICAgICAgdmFsdWU6IDAuMCxcbiAgICAgICAgdHlwZUdMU0w6ICdmbG9hdCdcbiAgICAgIH0sXG4gICAgICAndUFtcGxpdHVkZSc6e1xuICAgICAgICB0eXBlOiAnZicsXG4gICAgICAgIHZhbHVlOiAwLjAsXG4gICAgICAgIHR5cGVHTFNMOiAnZmxvYXQnXG4gICAgICB9XG4gICAgfTtcbiAgfVxufSIsImV4cG9ydCBkZWZ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dXJlbWVudHM7XG4gIH1cbn1cbiJdfQ== diff --git a/build/ami.min.js b/build/ami.min.js index 6201721a2..ffd72a0e3 100644 --- a/build/ami.min.js +++ b/build/ami.min.js @@ -12,13 +12,13 @@ this.affine=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];this.magic=0;this.extensio totalLen*=sizes[i]}buf8=new Uint8Array(buffer);str=String.fromCharCode.apply(null,buf8);strList=str.split(whitespaceDataValueListSeparatorRE);if(strList.lengthtotalLen){if(strList[0]==="")strList=strList.slice(1);strList=strList.slice(0,totalLen)}switch(type){case"int8":return new Int8Array(strList.map(parseNRRDInteger));case"uint8":return new Uint8Array(strList.map(parseNRRDInteger));case"int16":return new Int16Array(strList.map(parseNRRDInteger));case"uint16":return new Uint16Array(strList.map(parseNRRDInteger));case"int32":return new Int32Array(strList.map(parseNRRDInteger));case"uint32":return new Uint32Array(strList.map(parseNRRDInteger));case"float":return new Float32Array(strList.map(parseNRRDFloat));case"double":return new Float64Array(strList.map(parseNRRDFloat));default:console.warn("Unsupported NRRD type: "+type+".");return undefined}}function getNRRDTypeSize(type){switch(type){case"int8":return 1;case"uint8":return 1;case"int16":return 2;case"uint16":return 2;case"int32":return 4;case"uint32":return 4;case"int64":return 8;case"uint64":return 8;case"float":return 4;case"double":return 8;default:throw new Error("Do not know the size of NRRD type: "+type)}}function checkNRRD(ret){if(ret.dimension===undefined){throw new Error("Dimension missing from NRRD file!")}else if(ret.type===undefined){throw new Error("Type missing from NRRD file!")}else if(ret.encoding===undefined){throw new Error("Encoding missing from NRRD file!")}else if(ret.sizes===undefined){throw new Error("Sizes missing from NRRD file!")}if(ret.type!="block"&&ret.type!="int8"&&ret.type!="uint8"&&ret.encoding!="ascii"&&ret.endian===undefined){throw new Error("Endianness missing from NRRD file!")}else if(ret.type=="block"&&ret.blockSize===undefined){throw new Error("Missing block size in NRRD file!")}if(ret.dimension===0){throw new Error("Zero-dimensional NRRD file?")}else if(ret.dimension!=ret.sizes.length){throw new Error("Length of 'sizes' is different from 'dimension' in an NRRD file!")}else if(ret.spacings&&ret.dimension!=ret.spacings.length){throw new Error("Length of 'spacings' is different from 'dimension' in an NRRD file!")}else if(ret.thicknesses&&ret.dimension!=ret.thicknesses.length){throw new Error("Length of 'thicknesses' is different from 'dimension' in an NRRD file!")}else if(ret.axisMins&&ret.dimension!=ret.axisMins.length){throw new Error("Length of 'axis mins' is different from 'dimension' in an NRRD file!")}else if(ret.axisMaxs&&ret.dimension!=ret.axisMaxs.length){throw new Error("Length of 'axis maxs' is different from 'dimension' in an NRRD file!")}else if(ret.centers&&ret.dimension!=ret.centers.length){throw new Error("Length of 'centers' is different from 'dimension' in an NRRD file!")}else if(ret.labels&&ret.dimension!=ret.labels.length){throw new Error("Length of 'labels' is different from 'dimension' in an NRRD file!")}else if(ret.units&&ret.dimension!=ret.units.length){throw new Error("Length of 'units' is different from 'dimension' in an NRRD file!")}else if(ret.kinds&&ret.dimension!=ret.kinds.length){throw new Error("Length of 'kinds' is different from 'dimension' in an NRRD file!")}if((ret.data===undefined||ret.data.length===0)&&(ret.buffer===undefined||ret.buffer.byteLength===0)&&ret.dataFile===undefined){throw new Error("NRRD file has neither inline or external data!")}}function castTypedArray(data,type){switch(type){case"int8":return new Int8Array(data);case"uint8":return new Uint8Array(data);case"int16":return new Int16Array(data);case"uint16":return new Uint16Array(data);case"int32":return new Int32Array(data);case"uint32":return new Uint32Array(data);case"float":return new Float32Array(data);case"double":return new Float64Array(data);default:throw new Error("Cannot cast to NRRD type: "+type)}}function serializeToBuffer(data,type,endian){var i,endianFlag,view,nativeSize=getNRRDTypeSize(type),buffer=new ArrayBuffer(data.length*nativeSize);switch(endian){case"big":endianFlag=false;break;case"little":endianFlag=true;break;default:console.warn("Unsupported endianness in NRRD file: "+endian);return undefined}view=new DataView(buffer);switch(type){case"int8":for(i=0;i0){opt.windowBits=-opt.windowBits}else if(opt.gzip&&opt.windowBits>0&&opt.windowBits<16){opt.windowBits+=16}this.err=0;this.msg="";this.ended=false;this.chunks=[];this.strm=new ZStream;this.strm.avail_out=0;var status=zlib_deflate.deflateInit2(this.strm,opt.level,opt.method,opt.windowBits,opt.memLevel,opt.strategy);if(status!==Z_OK){throw new Error(msg[status])}if(opt.header){zlib_deflate.deflateSetHeader(this.strm,opt.header)}if(opt.dictionary){var dict;if(typeof opt.dictionary==="string"){dict=strings.string2buf(opt.dictionary)}else if(toString.call(opt.dictionary)==="[object ArrayBuffer]"){dict=new Uint8Array(opt.dictionary)}else{dict=opt.dictionary}status=zlib_deflate.deflateSetDictionary(this.strm,dict);if(status!==Z_OK){throw new Error(msg[status])}this._dict_set=true}}Deflate.prototype.push=function(data,mode){var strm=this.strm;var chunkSize=this.options.chunkSize;var status,_mode;if(this.ended){return false}_mode=mode===~~mode?mode:mode===true?Z_FINISH:Z_NO_FLUSH;if(typeof data==="string"){strm.input=strings.string2buf(data)}else if(toString.call(data)==="[object ArrayBuffer]"){strm.input=new Uint8Array(data)}else{strm.input=data}strm.next_in=0;strm.avail_in=strm.input.length;do{if(strm.avail_out===0){strm.output=new utils.Buf8(chunkSize);strm.next_out=0;strm.avail_out=chunkSize}status=zlib_deflate.deflate(strm,_mode);if(status!==Z_STREAM_END&&status!==Z_OK){this.onEnd(status);this.ended=true;return false}if(strm.avail_out===0||strm.avail_in===0&&(_mode===Z_FINISH||_mode===Z_SYNC_FLUSH)){if(this.options.to==="string"){this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output,strm.next_out)))}else{this.onData(utils.shrinkBuf(strm.output,strm.next_out))}}}while((strm.avail_in>0||strm.avail_out===0)&&status!==Z_STREAM_END);if(_mode===Z_FINISH){status=zlib_deflate.deflateEnd(this.strm);this.onEnd(status);this.ended=true;return status===Z_OK}if(_mode===Z_SYNC_FLUSH){this.onEnd(Z_OK);strm.avail_out=0;return true}return true};Deflate.prototype.onData=function(chunk){this.chunks.push(chunk)};Deflate.prototype.onEnd=function(status){if(status===Z_OK){if(this.options.to==="string"){this.result=this.chunks.join("")}else{this.result=utils.flattenChunks(this.chunks)}}this.chunks=[];this.err=status;this.msg=this.strm.msg};function deflate(input,options){var deflator=new Deflate(options);deflator.push(input,true);if(deflator.err){throw deflator.msg}return deflator.result}function deflateRaw(input,options){options=options||{};options.raw=true;return deflate(input,options)}function gzip(input,options){options=options||{};options.gzip=true;return deflate(input,options)}exports.Deflate=Deflate;exports.deflate=deflate;exports.deflateRaw=deflateRaw;exports.gzip=gzip},{"./utils/common":54,"./utils/strings":55,"./zlib/deflate":59,"./zlib/messages":64,"./zlib/zstream":66}],53:[function(require,module,exports){"use strict";var zlib_inflate=require("./zlib/inflate");var utils=require("./utils/common");var strings=require("./utils/strings");var c=require("./zlib/constants");var msg=require("./zlib/messages");var ZStream=require("./zlib/zstream");var GZheader=require("./zlib/gzheader");var toString=Object.prototype.toString;function Inflate(options){if(!(this instanceof Inflate))return new Inflate(options);this.options=utils.assign({chunkSize:16384,windowBits:0,to:""},options||{});var opt=this.options;if(opt.raw&&opt.windowBits>=0&&opt.windowBits<16){opt.windowBits=-opt.windowBits;if(opt.windowBits===0){opt.windowBits=-15}}if(opt.windowBits>=0&&opt.windowBits<16&&!(options&&options.windowBits)){opt.windowBits+=32}if(opt.windowBits>15&&opt.windowBits<48){if((opt.windowBits&15)===0){opt.windowBits|=15}}this.err=0;this.msg="";this.ended=false;this.chunks=[];this.strm=new ZStream;this.strm.avail_out=0;var status=zlib_inflate.inflateInit2(this.strm,opt.windowBits);if(status!==c.Z_OK){throw new Error(msg[status])}this.header=new GZheader;zlib_inflate.inflateGetHeader(this.strm,this.header)}Inflate.prototype.push=function(data,mode){var strm=this.strm;var chunkSize=this.options.chunkSize;var dictionary=this.options.dictionary;var status,_mode;var next_out_utf8,tail,utf8str;var dict;var allowBufError=false;if(this.ended){return false}_mode=mode===~~mode?mode:mode===true?c.Z_FINISH:c.Z_NO_FLUSH;if(typeof data==="string"){strm.input=strings.binstring2buf(data)}else if(toString.call(data)==="[object ArrayBuffer]"){strm.input=new Uint8Array(data)}else{strm.input=data}strm.next_in=0;strm.avail_in=strm.input.length;do{if(strm.avail_out===0){strm.output=new utils.Buf8(chunkSize);strm.next_out=0;strm.avail_out=chunkSize}status=zlib_inflate.inflate(strm,c.Z_NO_FLUSH);if(status===c.Z_NEED_DICT&&dictionary){if(typeof dictionary==="string"){dict=strings.string2buf(dictionary)}else if(toString.call(dictionary)==="[object ArrayBuffer]"){dict=new Uint8Array(dictionary)}else{dict=dictionary}status=zlib_inflate.inflateSetDictionary(this.strm,dict)}if(status===c.Z_BUF_ERROR&&allowBufError===true){status=c.Z_OK;allowBufError=false}if(status!==c.Z_STREAM_END&&status!==c.Z_OK){this.onEnd(status);this.ended=true;return false}if(strm.next_out){if(strm.avail_out===0||status===c.Z_STREAM_END||strm.avail_in===0&&(_mode===c.Z_FINISH||_mode===c.Z_SYNC_FLUSH)){if(this.options.to==="string"){next_out_utf8=strings.utf8border(strm.output,strm.next_out);tail=strm.next_out-next_out_utf8;utf8str=strings.buf2string(strm.output,next_out_utf8);strm.next_out=tail;strm.avail_out=chunkSize-tail;if(tail){utils.arraySet(strm.output,strm.output,next_out_utf8,tail,0)}this.onData(utf8str)}else{this.onData(utils.shrinkBuf(strm.output,strm.next_out))}}}if(strm.avail_in===0&&strm.avail_out===0){allowBufError=true}}while((strm.avail_in>0||strm.avail_out===0)&&status!==c.Z_STREAM_END);if(status===c.Z_STREAM_END){_mode=c.Z_FINISH}if(_mode===c.Z_FINISH){status=zlib_inflate.inflateEnd(this.strm);this.onEnd(status);this.ended=true;return status===c.Z_OK}if(_mode===c.Z_SYNC_FLUSH){this.onEnd(c.Z_OK);strm.avail_out=0;return true}return true};Inflate.prototype.onData=function(chunk){this.chunks.push(chunk)};Inflate.prototype.onEnd=function(status){if(status===c.Z_OK){if(this.options.to==="string"){this.result=this.chunks.join("")}else{this.result=utils.flattenChunks(this.chunks)}}this.chunks=[];this.err=status;this.msg=this.strm.msg};function inflate(input,options){var inflator=new Inflate(options);inflator.push(input,true);if(inflator.err){throw inflator.msg}return inflator.result}function inflateRaw(input,options){options=options||{};options.raw=true;return inflate(input,options)}exports.Inflate=Inflate;exports.inflate=inflate;exports.inflateRaw=inflateRaw;exports.ungzip=inflate},{"./utils/common":54,"./utils/strings":55,"./zlib/constants":57,"./zlib/gzheader":60,"./zlib/inflate":62,"./zlib/messages":64,"./zlib/zstream":66}],54:[function(require,module,exports){"use strict";var TYPED_OK=typeof Uint8Array!=="undefined"&&typeof Uint16Array!=="undefined"&&typeof Int32Array!=="undefined";exports.assign=function(obj){var sources=Array.prototype.slice.call(arguments,1);while(sources.length){var source=sources.shift();if(!source){continue}if(typeof source!=="object"){throw new TypeError(source+"must be non-object")}for(var p in source){if(source.hasOwnProperty(p)){obj[p]=source[p]}}}return obj};exports.shrinkBuf=function(buf,size){if(buf.length===size){return buf}if(buf.subarray){return buf.subarray(0,size)}buf.length=size;return buf};var fnTyped={arraySet:function(dest,src,src_offs,len,dest_offs){if(src.subarray&&dest.subarray){dest.set(src.subarray(src_offs,src_offs+len),dest_offs);return}for(var i=0;i=252?6:q>=248?5:q>=240?4:q>=224?3:q>=192?2:1}_utf8len[254]=_utf8len[254]=1;exports.string2buf=function(str){var buf,c,c2,m_pos,i,str_len=str.length,buf_len=0;for(m_pos=0;m_pos>>6;buf[i++]=128|c&63}else if(c<65536){buf[i++]=224|c>>>12;buf[i++]=128|c>>>6&63;buf[i++]=128|c&63}else{buf[i++]=240|c>>>18;buf[i++]=128|c>>>12&63;buf[i++]=128|c>>>6&63;buf[i++]=128|c&63}}return buf};function buf2binstring(buf,len){if(len<65537){if(buf.subarray&&STR_APPLY_UIA_OK||!buf.subarray&&STR_APPLY_OK){return String.fromCharCode.apply(null,utils.shrinkBuf(buf,len))}}var result="";for(var i=0;i4){utf16buf[out++]=65533;i+=c_len-1;continue}c&=c_len===2?31:c_len===3?15:7;while(c_len>1&&i1){utf16buf[out++]=65533;continue}if(c<65536){utf16buf[out++]=c}else{c-=65536;utf16buf[out++]=55296|c>>10&1023;utf16buf[out++]=56320|c&1023}}return buf2binstring(utf16buf,out)};exports.utf8border=function(buf,max){var pos;max=max||buf.length;if(max>buf.length){max=buf.length}pos=max-1;while(pos>=0&&(buf[pos]&192)===128){pos--}if(pos<0){return max}if(pos===0){return max}return pos+_utf8len[buf[pos]]>max?pos:max}},{"./common":54}],56:[function(require,module,exports){arguments[4][6][0].apply(exports,arguments)},{dup:6}],57:[function(require,module,exports){"use strict";module.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],58:[function(require,module,exports){"use strict";function makeTable(){var c,table=[];for(var n=0;n<256;n++){c=n;for(var k=0;k<8;k++){c=c&1?3988292384^c>>>1:c>>>1}table[n]=c}return table}var crcTable=makeTable();function crc32(crc,buf,len,pos){var t=crcTable,end=pos+len;crc^=-1;for(var i=pos;i>>8^t[(crc^buf[i])&255]}return crc^-1}module.exports=crc32},{}],59:[function(require,module,exports){"use strict";var utils=require("../utils/common");var trees=require("./trees");var adler32=require("./adler32");var crc32=require("./crc32");var msg=require("./messages");var Z_NO_FLUSH=0;var Z_PARTIAL_FLUSH=1;var Z_FULL_FLUSH=3;var Z_FINISH=4;var Z_BLOCK=5;var Z_OK=0;var Z_STREAM_END=1;var Z_STREAM_ERROR=-2;var Z_DATA_ERROR=-3;var Z_BUF_ERROR=-5;var Z_DEFAULT_COMPRESSION=-1;var Z_FILTERED=1;var Z_HUFFMAN_ONLY=2;var Z_RLE=3;var Z_FIXED=4;var Z_DEFAULT_STRATEGY=0;var Z_UNKNOWN=2;var Z_DEFLATED=8;var MAX_MEM_LEVEL=9;var MAX_WBITS=15;var DEF_MEM_LEVEL=8;var LENGTH_CODES=29;var LITERALS=256;var L_CODES=LITERALS+1+LENGTH_CODES;var D_CODES=30;var BL_CODES=19;var HEAP_SIZE=2*L_CODES+1;var MAX_BITS=15;var MIN_MATCH=3;var MAX_MATCH=258;var MIN_LOOKAHEAD=MAX_MATCH+MIN_MATCH+1;var PRESET_DICT=32;var INIT_STATE=42;var EXTRA_STATE=69;var NAME_STATE=73;var COMMENT_STATE=91;var HCRC_STATE=103;var BUSY_STATE=113;var FINISH_STATE=666;var BS_NEED_MORE=1;var BS_BLOCK_DONE=2;var BS_FINISH_STARTED=3;var BS_FINISH_DONE=4;var OS_CODE=3;function err(strm,errorCode){strm.msg=msg[errorCode];return errorCode}function rank(f){return(f<<1)-(f>4?9:0)}function zero(buf){var len=buf.length;while(--len>=0){buf[len]=0}}function flush_pending(strm){var s=strm.state;var len=s.pending;if(len>strm.avail_out){len=strm.avail_out}if(len===0){return}utils.arraySet(strm.output,s.pending_buf,s.pending_out,len,strm.next_out);strm.next_out+=len;s.pending_out+=len;strm.total_out+=len;strm.avail_out-=len;s.pending-=len;if(s.pending===0){s.pending_out=0}}function flush_block_only(s,last){trees._tr_flush_block(s,s.block_start>=0?s.block_start:-1,s.strstart-s.block_start,last);s.block_start=s.strstart;flush_pending(s.strm)}function put_byte(s,b){s.pending_buf[s.pending++]=b}function putShortMSB(s,b){s.pending_buf[s.pending++]=b>>>8&255;s.pending_buf[s.pending++]=b&255}function read_buf(strm,buf,start,size){var len=strm.avail_in;if(len>size){len=size}if(len===0){return 0}strm.avail_in-=len;utils.arraySet(buf,strm.input,strm.next_in,len,start);if(strm.state.wrap===1){strm.adler=adler32(strm.adler,buf,len,start)}else if(strm.state.wrap===2){strm.adler=crc32(strm.adler,buf,len,start)}strm.next_in+=len;strm.total_in+=len;return len}function longest_match(s,cur_match){var chain_length=s.max_chain_length;var scan=s.strstart;var match;var len;var best_len=s.prev_length;var nice_match=s.nice_match;var limit=s.strstart>s.w_size-MIN_LOOKAHEAD?s.strstart-(s.w_size-MIN_LOOKAHEAD):0;var _win=s.window;var wmask=s.w_mask;var prev=s.prev;var strend=s.strstart+MAX_MATCH;var scan_end1=_win[scan+best_len-1];var scan_end=_win[scan+best_len];if(s.prev_length>=s.good_match){chain_length>>=2}if(nice_match>s.lookahead){nice_match=s.lookahead}do{match=cur_match;if(_win[match+best_len]!==scan_end||_win[match+best_len-1]!==scan_end1||_win[match]!==_win[scan]||_win[++match]!==_win[scan+1]){continue}scan+=2;match++;do{}while(_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&scanbest_len){s.match_start=cur_match;best_len=len;if(len>=nice_match){break}scan_end1=_win[scan+best_len-1];scan_end=_win[scan+best_len]}}while((cur_match=prev[cur_match&wmask])>limit&&--chain_length!==0);if(best_len<=s.lookahead){return best_len}return s.lookahead}function fill_window(s){var _w_size=s.w_size;var p,n,m,more,str;do{more=s.window_size-s.lookahead-s.strstart;if(s.strstart>=_w_size+(_w_size-MIN_LOOKAHEAD)){utils.arraySet(s.window,s.window,_w_size,_w_size,0);s.match_start-=_w_size;s.strstart-=_w_size;s.block_start-=_w_size;n=s.hash_size;p=n;do{m=s.head[--p];s.head[p]=m>=_w_size?m-_w_size:0}while(--n);n=_w_size;p=n;do{m=s.prev[--p];s.prev[p]=m>=_w_size?m-_w_size:0}while(--n);more+=_w_size}if(s.strm.avail_in===0){break}n=read_buf(s.strm,s.window,s.strstart+s.lookahead,more);s.lookahead+=n;if(s.lookahead+s.insert>=MIN_MATCH){str=s.strstart-s.insert;s.ins_h=s.window[str];s.ins_h=(s.ins_h<s.pending_buf_size-5){max_block_size=s.pending_buf_size-5}for(;;){if(s.lookahead<=1){fill_window(s);if(s.lookahead===0&&flush===Z_NO_FLUSH){return BS_NEED_MORE}if(s.lookahead===0){break}}s.strstart+=s.lookahead;s.lookahead=0;var max_start=s.block_start+max_block_size;if(s.strstart===0||s.strstart>=max_start){s.lookahead=s.strstart-max_start;s.strstart=max_start;flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE}}if(s.strstart-s.block_start>=s.w_size-MIN_LOOKAHEAD){flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE}}}s.insert=0;if(flush===Z_FINISH){flush_block_only(s,true);if(s.strm.avail_out===0){return BS_FINISH_STARTED}return BS_FINISH_DONE}if(s.strstart>s.block_start){flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE}}return BS_NEED_MORE}function deflate_fast(s,flush){var hash_head;var bflush;for(;;){if(s.lookahead=MIN_MATCH){s.ins_h=(s.ins_h<=MIN_MATCH){bflush=trees._tr_tally(s,s.strstart-s.match_start,s.match_length-MIN_MATCH);s.lookahead-=s.match_length;if(s.match_length<=s.max_lazy_match&&s.lookahead>=MIN_MATCH){s.match_length--;do{s.strstart++;s.ins_h=(s.ins_h<=MIN_MATCH){s.ins_h=(s.ins_h<4096)){s.match_length=MIN_MATCH-1}}if(s.prev_length>=MIN_MATCH&&s.match_length<=s.prev_length){max_insert=s.strstart+s.lookahead-MIN_MATCH;bflush=trees._tr_tally(s,s.strstart-1-s.prev_match,s.prev_length-MIN_MATCH);s.lookahead-=s.prev_length-1;s.prev_length-=2;do{if(++s.strstart<=max_insert){s.ins_h=(s.ins_h<=MIN_MATCH&&s.strstart>0){scan=s.strstart-1;prev=_win[scan];if(prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]){strend=s.strstart+MAX_MATCH;do{}while(prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&scans.lookahead){s.match_length=s.lookahead}}}if(s.match_length>=MIN_MATCH){bflush=trees._tr_tally(s,1,s.match_length-MIN_MATCH);s.lookahead-=s.match_length;s.strstart+=s.match_length;s.match_length=0}else{bflush=trees._tr_tally(s,0,s.window[s.strstart]);s.lookahead--;s.strstart++}if(bflush){flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE}}}s.insert=0;if(flush===Z_FINISH){flush_block_only(s,true);if(s.strm.avail_out===0){return BS_FINISH_STARTED}return BS_FINISH_DONE}if(s.last_lit){flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE}}return BS_BLOCK_DONE}function deflate_huff(s,flush){var bflush;for(;;){if(s.lookahead===0){fill_window(s);if(s.lookahead===0){if(flush===Z_NO_FLUSH){return BS_NEED_MORE}break}}s.match_length=0;bflush=trees._tr_tally(s,0,s.window[s.strstart]);s.lookahead--;s.strstart++;if(bflush){flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE}}}s.insert=0;if(flush===Z_FINISH){flush_block_only(s,true);if(s.strm.avail_out===0){return BS_FINISH_STARTED}return BS_FINISH_DONE}if(s.last_lit){flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE}}return BS_BLOCK_DONE}function Config(good_length,max_lazy,nice_length,max_chain,func){this.good_length=good_length;this.max_lazy=max_lazy;this.nice_length=nice_length;this.max_chain=max_chain;this.func=func}var configuration_table;configuration_table=[new Config(0,0,0,0,deflate_stored),new Config(4,4,8,4,deflate_fast),new Config(4,5,16,8,deflate_fast),new Config(4,6,32,32,deflate_fast),new Config(4,4,16,16,deflate_slow),new Config(8,16,32,32,deflate_slow),new Config(8,16,128,128,deflate_slow),new Config(8,32,128,256,deflate_slow),new Config(32,128,258,1024,deflate_slow),new Config(32,258,258,4096,deflate_slow)];function lm_init(s){s.window_size=2*s.w_size;zero(s.head);s.max_lazy_match=configuration_table[s.level].max_lazy;s.good_match=configuration_table[s.level].good_length;s.nice_match=configuration_table[s.level].nice_length;s.max_chain_length=configuration_table[s.level].max_chain;s.strstart=0;s.block_start=0;s.lookahead=0;s.insert=0;s.match_length=s.prev_length=MIN_MATCH-1;s.match_available=0;s.ins_h=0}function DeflateState(){this.strm=null;this.status=0;this.pending_buf=null;this.pending_buf_size=0;this.pending_out=0;this.pending=0;this.wrap=0;this.gzhead=null;this.gzindex=0;this.method=Z_DEFLATED;this.last_flush=-1;this.w_size=0;this.w_bits=0;this.w_mask=0;this.window=null;this.window_size=0;this.prev=null;this.head=null;this.ins_h=0;this.hash_size=0;this.hash_bits=0;this.hash_mask=0;this.hash_shift=0;this.block_start=0;this.match_length=0;this.prev_match=0;this.match_available=0;this.strstart=0;this.match_start=0;this.lookahead=0;this.prev_length=0;this.max_chain_length=0;this.max_lazy_match=0;this.level=0;this.strategy=0;this.good_match=0;this.nice_match=0;this.dyn_ltree=new utils.Buf16(HEAP_SIZE*2);this.dyn_dtree=new utils.Buf16((2*D_CODES+1)*2);this.bl_tree=new utils.Buf16((2*BL_CODES+1)*2);zero(this.dyn_ltree);zero(this.dyn_dtree);zero(this.bl_tree);this.l_desc=null;this.d_desc=null;this.bl_desc=null;this.bl_count=new utils.Buf16(MAX_BITS+1);this.heap=new utils.Buf16(2*L_CODES+1);zero(this.heap);this.heap_len=0;this.heap_max=0;this.depth=new utils.Buf16(2*L_CODES+1);zero(this.depth);this.l_buf=0;this.lit_bufsize=0;this.last_lit=0;this.d_buf=0;this.opt_len=0;this.static_len=0;this.matches=0;this.insert=0;this.bi_buf=0;this.bi_valid=0}function deflateResetKeep(strm){var s;if(!strm||!strm.state){return err(strm,Z_STREAM_ERROR)}strm.total_in=strm.total_out=0;strm.data_type=Z_UNKNOWN;s=strm.state;s.pending=0;s.pending_out=0;if(s.wrap<0){s.wrap=-s.wrap}s.status=s.wrap?INIT_STATE:BUSY_STATE;strm.adler=s.wrap===2?0:1;s.last_flush=Z_NO_FLUSH;trees._tr_init(s);return Z_OK}function deflateReset(strm){var ret=deflateResetKeep(strm);if(ret===Z_OK){lm_init(strm.state)}return ret}function deflateSetHeader(strm,head){if(!strm||!strm.state){return Z_STREAM_ERROR}if(strm.state.wrap!==2){return Z_STREAM_ERROR}strm.state.gzhead=head;return Z_OK}function deflateInit2(strm,level,method,windowBits,memLevel,strategy){if(!strm){return Z_STREAM_ERROR}var wrap=1;if(level===Z_DEFAULT_COMPRESSION){level=6}if(windowBits<0){wrap=0;windowBits=-windowBits}else if(windowBits>15){wrap=2;windowBits-=16}if(memLevel<1||memLevel>MAX_MEM_LEVEL||method!==Z_DEFLATED||windowBits<8||windowBits>15||level<0||level>9||strategy<0||strategy>Z_FIXED){ return err(strm,Z_STREAM_ERROR)}if(windowBits===8){windowBits=9}var s=new DeflateState;strm.state=s;s.strm=strm;s.wrap=wrap;s.gzhead=null;s.w_bits=windowBits;s.w_size=1<>1;s.l_buf=(1+2)*s.lit_bufsize;s.level=level;s.strategy=strategy;s.method=method;return deflateReset(strm)}function deflateInit(strm,level){return deflateInit2(strm,level,Z_DEFLATED,MAX_WBITS,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY)}function deflate(strm,flush){var old_flush,s;var beg,val;if(!strm||!strm.state||flush>Z_BLOCK||flush<0){return strm?err(strm,Z_STREAM_ERROR):Z_STREAM_ERROR}s=strm.state;if(!strm.output||!strm.input&&strm.avail_in!==0||s.status===FINISH_STATE&&flush!==Z_FINISH){return err(strm,strm.avail_out===0?Z_BUF_ERROR:Z_STREAM_ERROR)}s.strm=strm;old_flush=s.last_flush;s.last_flush=flush;if(s.status===INIT_STATE){if(s.wrap===2){strm.adler=0;put_byte(s,31);put_byte(s,139);put_byte(s,8);if(!s.gzhead){put_byte(s,0);put_byte(s,0);put_byte(s,0);put_byte(s,0);put_byte(s,0);put_byte(s,s.level===9?2:s.strategy>=Z_HUFFMAN_ONLY||s.level<2?4:0);put_byte(s,OS_CODE);s.status=BUSY_STATE}else{put_byte(s,(s.gzhead.text?1:0)+(s.gzhead.hcrc?2:0)+(!s.gzhead.extra?0:4)+(!s.gzhead.name?0:8)+(!s.gzhead.comment?0:16));put_byte(s,s.gzhead.time&255);put_byte(s,s.gzhead.time>>8&255);put_byte(s,s.gzhead.time>>16&255);put_byte(s,s.gzhead.time>>24&255);put_byte(s,s.level===9?2:s.strategy>=Z_HUFFMAN_ONLY||s.level<2?4:0);put_byte(s,s.gzhead.os&255);if(s.gzhead.extra&&s.gzhead.extra.length){put_byte(s,s.gzhead.extra.length&255);put_byte(s,s.gzhead.extra.length>>8&255)}if(s.gzhead.hcrc){strm.adler=crc32(strm.adler,s.pending_buf,s.pending,0)}s.gzindex=0;s.status=EXTRA_STATE}}else{var header=Z_DEFLATED+(s.w_bits-8<<4)<<8;var level_flags=-1;if(s.strategy>=Z_HUFFMAN_ONLY||s.level<2){level_flags=0}else if(s.level<6){level_flags=1}else if(s.level===6){level_flags=2}else{level_flags=3}header|=level_flags<<6;if(s.strstart!==0){header|=PRESET_DICT}header+=31-header%31;s.status=BUSY_STATE;putShortMSB(s,header);if(s.strstart!==0){putShortMSB(s,strm.adler>>>16);putShortMSB(s,strm.adler&65535)}strm.adler=1}}if(s.status===EXTRA_STATE){if(s.gzhead.extra){beg=s.pending;while(s.gzindex<(s.gzhead.extra.length&65535)){if(s.pending===s.pending_buf_size){if(s.gzhead.hcrc&&s.pending>beg){strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)}flush_pending(strm);beg=s.pending;if(s.pending===s.pending_buf_size){break}}put_byte(s,s.gzhead.extra[s.gzindex]&255);s.gzindex++}if(s.gzhead.hcrc&&s.pending>beg){strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)}if(s.gzindex===s.gzhead.extra.length){s.gzindex=0;s.status=NAME_STATE}}else{s.status=NAME_STATE}}if(s.status===NAME_STATE){if(s.gzhead.name){beg=s.pending;do{if(s.pending===s.pending_buf_size){if(s.gzhead.hcrc&&s.pending>beg){strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)}flush_pending(strm);beg=s.pending;if(s.pending===s.pending_buf_size){val=1;break}}if(s.gzindexbeg){strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)}if(val===0){s.gzindex=0;s.status=COMMENT_STATE}}else{s.status=COMMENT_STATE}}if(s.status===COMMENT_STATE){if(s.gzhead.comment){beg=s.pending;do{if(s.pending===s.pending_buf_size){if(s.gzhead.hcrc&&s.pending>beg){strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)}flush_pending(strm);beg=s.pending;if(s.pending===s.pending_buf_size){val=1;break}}if(s.gzindexbeg){strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)}if(val===0){s.status=HCRC_STATE}}else{s.status=HCRC_STATE}}if(s.status===HCRC_STATE){if(s.gzhead.hcrc){if(s.pending+2>s.pending_buf_size){flush_pending(strm)}if(s.pending+2<=s.pending_buf_size){put_byte(s,strm.adler&255);put_byte(s,strm.adler>>8&255);strm.adler=0;s.status=BUSY_STATE}}else{s.status=BUSY_STATE}}if(s.pending!==0){flush_pending(strm);if(strm.avail_out===0){s.last_flush=-1;return Z_OK}}else if(strm.avail_in===0&&rank(flush)<=rank(old_flush)&&flush!==Z_FINISH){return err(strm,Z_BUF_ERROR)}if(s.status===FINISH_STATE&&strm.avail_in!==0){return err(strm,Z_BUF_ERROR)}if(strm.avail_in!==0||s.lookahead!==0||flush!==Z_NO_FLUSH&&s.status!==FINISH_STATE){var bstate=s.strategy===Z_HUFFMAN_ONLY?deflate_huff(s,flush):s.strategy===Z_RLE?deflate_rle(s,flush):configuration_table[s.level].func(s,flush);if(bstate===BS_FINISH_STARTED||bstate===BS_FINISH_DONE){s.status=FINISH_STATE}if(bstate===BS_NEED_MORE||bstate===BS_FINISH_STARTED){if(strm.avail_out===0){s.last_flush=-1}return Z_OK}if(bstate===BS_BLOCK_DONE){if(flush===Z_PARTIAL_FLUSH){trees._tr_align(s)}else if(flush!==Z_BLOCK){trees._tr_stored_block(s,0,0,false);if(flush===Z_FULL_FLUSH){zero(s.head);if(s.lookahead===0){s.strstart=0;s.block_start=0;s.insert=0}}}flush_pending(strm);if(strm.avail_out===0){s.last_flush=-1;return Z_OK}}}if(flush!==Z_FINISH){return Z_OK}if(s.wrap<=0){return Z_STREAM_END}if(s.wrap===2){put_byte(s,strm.adler&255);put_byte(s,strm.adler>>8&255);put_byte(s,strm.adler>>16&255);put_byte(s,strm.adler>>24&255);put_byte(s,strm.total_in&255);put_byte(s,strm.total_in>>8&255);put_byte(s,strm.total_in>>16&255);put_byte(s,strm.total_in>>24&255)}else{putShortMSB(s,strm.adler>>>16);putShortMSB(s,strm.adler&65535)}flush_pending(strm);if(s.wrap>0){s.wrap=-s.wrap}return s.pending!==0?Z_OK:Z_STREAM_END}function deflateEnd(strm){var status;if(!strm||!strm.state){return Z_STREAM_ERROR}status=strm.state.status;if(status!==INIT_STATE&&status!==EXTRA_STATE&&status!==NAME_STATE&&status!==COMMENT_STATE&&status!==HCRC_STATE&&status!==BUSY_STATE&&status!==FINISH_STATE){return err(strm,Z_STREAM_ERROR)}strm.state=null;return status===BUSY_STATE?err(strm,Z_DATA_ERROR):Z_OK}function deflateSetDictionary(strm,dictionary){var dictLength=dictionary.length;var s;var str,n;var wrap;var avail;var next;var input;var tmpDict;if(!strm||!strm.state){return Z_STREAM_ERROR}s=strm.state;wrap=s.wrap;if(wrap===2||wrap===1&&s.status!==INIT_STATE||s.lookahead){return Z_STREAM_ERROR}if(wrap===1){strm.adler=adler32(strm.adler,dictionary,dictLength,0)}s.wrap=0;if(dictLength>=s.w_size){if(wrap===0){zero(s.head);s.strstart=0;s.block_start=0;s.insert=0}tmpDict=new utils.Buf8(s.w_size);utils.arraySet(tmpDict,dictionary,dictLength-s.w_size,s.w_size,0);dictionary=tmpDict;dictLength=s.w_size}avail=strm.avail_in;next=strm.next_in;input=strm.input;strm.avail_in=dictLength;strm.next_in=0;strm.input=dictionary;fill_window(s);while(s.lookahead>=MIN_MATCH){str=s.strstart;n=s.lookahead-(MIN_MATCH-1);do{s.ins_h=(s.ins_h<>>24&255)+(q>>>8&65280)+((q&65280)<<8)+((q&255)<<24)}function InflateState(){this.mode=0;this.last=false;this.wrap=0;this.havedict=false;this.flags=0;this.dmax=0;this.check=0;this.total=0;this.head=null;this.wbits=0;this.wsize=0;this.whave=0;this.wnext=0;this.window=null;this.hold=0;this.bits=0;this.length=0;this.offset=0;this.extra=0;this.lencode=null;this.distcode=null;this.lenbits=0;this.distbits=0;this.ncode=0;this.nlen=0;this.ndist=0;this.have=0;this.next=null;this.lens=new utils.Buf16(320);this.work=new utils.Buf16(288);this.lendyn=null;this.distdyn=null;this.sane=0;this.back=0;this.was=0}function inflateResetKeep(strm){var state;if(!strm||!strm.state){return Z_STREAM_ERROR}state=strm.state;strm.total_in=strm.total_out=state.total=0;strm.msg="";if(state.wrap){strm.adler=state.wrap&1}state.mode=HEAD;state.last=0;state.havedict=0;state.dmax=32768;state.head=null;state.hold=0;state.bits=0;state.lencode=state.lendyn=new utils.Buf32(ENOUGH_LENS);state.distcode=state.distdyn=new utils.Buf32(ENOUGH_DISTS);state.sane=1;state.back=-1;return Z_OK}function inflateReset(strm){var state;if(!strm||!strm.state){return Z_STREAM_ERROR}state=strm.state;state.wsize=0;state.whave=0;state.wnext=0;return inflateResetKeep(strm)}function inflateReset2(strm,windowBits){var wrap;var state;if(!strm||!strm.state){return Z_STREAM_ERROR}state=strm.state;if(windowBits<0){wrap=0;windowBits=-windowBits}else{wrap=(windowBits>>4)+1;if(windowBits<48){windowBits&=15}}if(windowBits&&(windowBits<8||windowBits>15)){return Z_STREAM_ERROR}if(state.window!==null&&state.wbits!==windowBits){state.window=null}state.wrap=wrap;state.wbits=windowBits;return inflateReset(strm)}function inflateInit2(strm,windowBits){var ret;var state;if(!strm){return Z_STREAM_ERROR}state=new InflateState;strm.state=state;state.window=null;ret=inflateReset2(strm,windowBits);if(ret!==Z_OK){strm.state=null}return ret}function inflateInit(strm){return inflateInit2(strm,DEF_WBITS)}var virgin=true;var lenfix,distfix;function fixedtables(state){if(virgin){var sym;lenfix=new utils.Buf32(512);distfix=new utils.Buf32(32);sym=0;while(sym<144){state.lens[sym++]=8}while(sym<256){state.lens[sym++]=9}while(sym<280){state.lens[sym++]=7}while(sym<288){state.lens[sym++]=8}inflate_table(LENS,state.lens,0,288,lenfix,0,state.work,{bits:9});sym=0;while(sym<32){state.lens[sym++]=5}inflate_table(DISTS,state.lens,0,32,distfix,0,state.work,{bits:5});virgin=false}state.lencode=lenfix;state.lenbits=9;state.distcode=distfix;state.distbits=5}function updatewindow(strm,src,end,copy){var dist;var state=strm.state;if(state.window===null){state.wsize=1<=state.wsize){utils.arraySet(state.window,src,end-state.wsize,state.wsize,0);state.wnext=0;state.whave=state.wsize}else{dist=state.wsize-state.wnext;if(dist>copy){dist=copy}utils.arraySet(state.window,src,end-copy,dist,state.wnext);copy-=dist;if(copy){utils.arraySet(state.window,src,end-copy,copy,0);state.wnext=copy;state.whave=state.wsize}else{state.wnext+=dist;if(state.wnext===state.wsize){state.wnext=0}if(state.whave>>8&255;state.check=crc32(state.check,hbuf,2,0);hold=0;bits=0;state.mode=FLAGS;break}state.flags=0;if(state.head){state.head.done=false}if(!(state.wrap&1)||(((hold&255)<<8)+(hold>>8))%31){strm.msg="incorrect header check";state.mode=BAD;break}if((hold&15)!==Z_DEFLATED){strm.msg="unknown compression method";state.mode=BAD;break}hold>>>=4;bits-=4;len=(hold&15)+8;if(state.wbits===0){state.wbits=len}else if(len>state.wbits){strm.msg="invalid window size";state.mode=BAD;break}state.dmax=1<>8&1}if(state.flags&512){hbuf[0]=hold&255;hbuf[1]=hold>>>8&255;state.check=crc32(state.check,hbuf,2,0)}hold=0;bits=0;state.mode=TIME;case TIME:while(bits<32){if(have===0){break inf_leave}have--;hold+=input[next++]<>>8&255;hbuf[2]=hold>>>16&255;hbuf[3]=hold>>>24&255;state.check=crc32(state.check,hbuf,4,0)}hold=0;bits=0;state.mode=OS;case OS:while(bits<16){if(have===0){break inf_leave}have--;hold+=input[next++]<>8}if(state.flags&512){hbuf[0]=hold&255;hbuf[1]=hold>>>8&255;state.check=crc32(state.check,hbuf,2,0)}hold=0;bits=0;state.mode=EXLEN;case EXLEN:if(state.flags&1024){while(bits<16){if(have===0){break inf_leave}have--;hold+=input[next++]<>>8&255;state.check=crc32(state.check,hbuf,2,0)}hold=0;bits=0}else if(state.head){state.head.extra=null}state.mode=EXTRA;case EXTRA:if(state.flags&1024){copy=state.length;if(copy>have){copy=have}if(copy){if(state.head){len=state.head.extra_len-state.length;if(!state.head.extra){state.head.extra=new Array(state.head.extra_len)}utils.arraySet(state.head.extra,input,next,copy,len)}if(state.flags&512){state.check=crc32(state.check,input,copy,next)}have-=copy;next+=copy;state.length-=copy}if(state.length){break inf_leave}}state.length=0;state.mode=NAME;case NAME:if(state.flags&2048){if(have===0){break inf_leave}copy=0;do{len=input[next+copy++];if(state.head&&len&&state.length<65536){state.head.name+=String.fromCharCode(len)}}while(len&©>9&1;state.head.done=true}strm.adler=state.check=0;state.mode=TYPE;break;case DICTID:while(bits<32){if(have===0){break inf_leave}have--;hold+=input[next++]<>>=bits&7;bits-=bits&7;state.mode=CHECK;break}while(bits<3){if(have===0){break inf_leave}have--;hold+=input[next++]<>>=1;bits-=1;switch(hold&3){case 0:state.mode=STORED;break;case 1:fixedtables(state);state.mode=LEN_;if(flush===Z_TREES){hold>>>=2;bits-=2;break inf_leave}break;case 2:state.mode=TABLE;break;case 3:strm.msg="invalid block type";state.mode=BAD}hold>>>=2;bits-=2;break;case STORED:hold>>>=bits&7;bits-=bits&7;while(bits<32){if(have===0){break inf_leave}have--;hold+=input[next++]<>>16^65535)){strm.msg="invalid stored block lengths";state.mode=BAD;break}state.length=hold&65535;hold=0;bits=0;state.mode=COPY_;if(flush===Z_TREES){break inf_leave}case COPY_:state.mode=COPY;case COPY:copy=state.length;if(copy){if(copy>have){copy=have}if(copy>left){copy=left}if(copy===0){break inf_leave}utils.arraySet(output,input,next,copy,put);have-=copy;next+=copy;left-=copy;put+=copy;state.length-=copy;break}state.mode=TYPE;break;case TABLE:while(bits<14){if(have===0){break inf_leave}have--;hold+=input[next++]<>>=5;bits-=5;state.ndist=(hold&31)+1;hold>>>=5;bits-=5;state.ncode=(hold&15)+4;hold>>>=4;bits-=4;if(state.nlen>286||state.ndist>30){strm.msg="too many length or distance symbols";state.mode=BAD;break}state.have=0;state.mode=LENLENS;case LENLENS:while(state.have>>=3;bits-=3}while(state.have<19){state.lens[order[state.have++]]=0}state.lencode=state.lendyn;state.lenbits=7;opts={bits:state.lenbits};ret=inflate_table(CODES,state.lens,0,19,state.lencode,0,state.work,opts);state.lenbits=opts.bits;if(ret){strm.msg="invalid code lengths set";state.mode=BAD;break}state.have=0;state.mode=CODELENS;case CODELENS:while(state.have>>24;here_op=here>>>16&255;here_val=here&65535;if(here_bits<=bits){break}if(have===0){break inf_leave}have--;hold+=input[next++]<>>=here_bits;bits-=here_bits;state.lens[state.have++]=here_val}else{if(here_val===16){n=here_bits+2;while(bits>>=here_bits;bits-=here_bits;if(state.have===0){strm.msg="invalid bit length repeat";state.mode=BAD;break}len=state.lens[state.have-1];copy=3+(hold&3);hold>>>=2;bits-=2}else if(here_val===17){n=here_bits+3;while(bits>>=here_bits;bits-=here_bits;len=0;copy=3+(hold&7);hold>>>=3;bits-=3}else{n=here_bits+7;while(bits>>=here_bits;bits-=here_bits;len=0;copy=11+(hold&127);hold>>>=7;bits-=7}if(state.have+copy>state.nlen+state.ndist){strm.msg="invalid bit length repeat";state.mode=BAD;break}while(copy--){state.lens[state.have++]=len}}}if(state.mode===BAD){break}if(state.lens[256]===0){strm.msg="invalid code -- missing end-of-block";state.mode=BAD;break}state.lenbits=9;opts={bits:state.lenbits};ret=inflate_table(LENS,state.lens,0,state.nlen,state.lencode,0,state.work,opts);state.lenbits=opts.bits;if(ret){strm.msg="invalid literal/lengths set";state.mode=BAD;break}state.distbits=6;state.distcode=state.distdyn;opts={bits:state.distbits};ret=inflate_table(DISTS,state.lens,state.nlen,state.ndist,state.distcode,0,state.work,opts);state.distbits=opts.bits;if(ret){strm.msg="invalid distances set";state.mode=BAD;break}state.mode=LEN_;if(flush===Z_TREES){break inf_leave}case LEN_:state.mode=LEN;case LEN:if(have>=6&&left>=258){strm.next_out=put;strm.avail_out=left;strm.next_in=next;strm.avail_in=have;state.hold=hold;state.bits=bits;inflate_fast(strm,_out);put=strm.next_out;output=strm.output;left=strm.avail_out;next=strm.next_in;input=strm.input;have=strm.avail_in;hold=state.hold;bits=state.bits;if(state.mode===TYPE){state.back=-1}break}state.back=0;for(;;){here=state.lencode[hold&(1<>>24;here_op=here>>>16&255;here_val=here&65535;if(here_bits<=bits){break}if(have===0){break inf_leave}have--;hold+=input[next++]<>last_bits)];here_bits=here>>>24;here_op=here>>>16&255;here_val=here&65535;if(last_bits+here_bits<=bits){break}if(have===0){break inf_leave}have--;hold+=input[next++]<>>=last_bits;bits-=last_bits;state.back+=last_bits}hold>>>=here_bits;bits-=here_bits;state.back+=here_bits;state.length=here_val;if(here_op===0){state.mode=LIT;break}if(here_op&32){state.back=-1;state.mode=TYPE;break}if(here_op&64){strm.msg="invalid literal/length code";state.mode=BAD;break}state.extra=here_op&15;state.mode=LENEXT;case LENEXT:if(state.extra){n=state.extra;while(bits>>=state.extra;bits-=state.extra;state.back+=state.extra}state.was=state.length;state.mode=DIST;case DIST:for(;;){here=state.distcode[hold&(1<>>24;here_op=here>>>16&255;here_val=here&65535;if(here_bits<=bits){break}if(have===0){break inf_leave}have--;hold+=input[next++]<>last_bits)];here_bits=here>>>24;here_op=here>>>16&255;here_val=here&65535;if(last_bits+here_bits<=bits){break}if(have===0){break inf_leave}have--;hold+=input[next++]<>>=last_bits;bits-=last_bits;state.back+=last_bits}hold>>>=here_bits;bits-=here_bits;state.back+=here_bits;if(here_op&64){strm.msg="invalid distance code";state.mode=BAD;break}state.offset=here_val;state.extra=here_op&15;state.mode=DISTEXT;case DISTEXT:if(state.extra){n=state.extra;while(bits>>=state.extra;bits-=state.extra;state.back+=state.extra}if(state.offset>state.dmax){strm.msg="invalid distance too far back";state.mode=BAD;break}state.mode=MATCH;case MATCH:if(left===0){break inf_leave}copy=_out-left;if(state.offset>copy){copy=state.offset-copy;if(copy>state.whave){if(state.sane){strm.msg="invalid distance too far back";state.mode=BAD;break}}if(copy>state.wnext){copy-=state.wnext;from=state.wsize-copy}else{from=state.wnext-copy}if(copy>state.length){copy=state.length}from_source=state.window}else{from_source=output;from=put-state.offset;copy=state.length}if(copy>left){copy=left}left-=copy;state.length-=copy;do{output[put++]=from_source[from++]}while(--copy);if(state.length===0){state.mode=LEN}break;case LIT:if(left===0){break inf_leave}output[put++]=state.length;left--;state.mode=LEN;break;case CHECK:if(state.wrap){while(bits<32){if(have===0){break inf_leave}have--;hold|=input[next++]<=1;max--){if(count[max]!==0){break}}if(root>max){root=max}if(max===0){table[table_index++]=1<<24|64<<16|0;table[table_index++]=1<<24|64<<16|0;opts.bits=1;return 0}for(min=1;min0&&(type===CODES||max!==1)){return-1}offs[1]=0;for(len=1;lenENOUGH_LENS||type===DISTS&&used>ENOUGH_DISTS){return 1}var i=0;for(;;){i++;here_bits=len-drop;if(work[sym]end){here_op=extra[extra_index+work[sym]];here_val=base[base_index+work[sym]]}else{here_op=32+64;here_val=0}incr=1<>drop)+fill]=here_bits<<24|here_op<<16|here_val|0}while(fill!==0);incr=1<>=1}if(incr!==0){huff&=incr-1;huff+=incr}else{huff=0}sym++;if(--count[len]===0){if(len===max){break}len=lens[lens_index+work[sym]]}if(len>root&&(huff&mask)!==low){if(drop===0){drop=root}next+=min;curr=len-drop;left=1<ENOUGH_LENS||type===DISTS&&used>ENOUGH_DISTS){return 1}low=huff&mask;table[low]=root<<24|curr<<16|next-table_index|0}}if(huff!==0){table[next+huff]=len-drop<<24|64<<16|0}opts.bits=root;return 0}},{"../utils/common":54}],64:[function(require,module,exports){"use strict";module.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],65:[function(require,module,exports){"use strict";var utils=require("../utils/common");var Z_FIXED=4;var Z_BINARY=0;var Z_TEXT=1;var Z_UNKNOWN=2;function zero(buf){var len=buf.length;while(--len>=0){buf[len]=0}}var STORED_BLOCK=0;var STATIC_TREES=1;var DYN_TREES=2;var MIN_MATCH=3;var MAX_MATCH=258;var LENGTH_CODES=29;var LITERALS=256;var L_CODES=LITERALS+1+LENGTH_CODES;var D_CODES=30;var BL_CODES=19;var HEAP_SIZE=2*L_CODES+1;var MAX_BITS=15;var Buf_size=16;var MAX_BL_BITS=7;var END_BLOCK=256;var REP_3_6=16;var REPZ_3_10=17;var REPZ_11_138=18;var extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];var extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];var extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];var bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];var DIST_CODE_LEN=512;var static_ltree=new Array((L_CODES+2)*2);zero(static_ltree);var static_dtree=new Array(D_CODES*2);zero(static_dtree);var _dist_code=new Array(DIST_CODE_LEN);zero(_dist_code);var _length_code=new Array(MAX_MATCH-MIN_MATCH+1);zero(_length_code);var base_length=new Array(LENGTH_CODES);zero(base_length);var base_dist=new Array(D_CODES);zero(base_dist);function StaticTreeDesc(static_tree,extra_bits,extra_base,elems,max_length){this.static_tree=static_tree;this.extra_bits=extra_bits;this.extra_base=extra_base;this.elems=elems;this.max_length=max_length;this.has_stree=static_tree&&static_tree.length}var static_l_desc;var static_d_desc;var static_bl_desc;function TreeDesc(dyn_tree,stat_desc){this.dyn_tree=dyn_tree;this.max_code=0;this.stat_desc=stat_desc}function d_code(dist){return dist<256?_dist_code[dist]:_dist_code[256+(dist>>>7)]; }function put_short(s,w){s.pending_buf[s.pending++]=w&255;s.pending_buf[s.pending++]=w>>>8&255}function send_bits(s,value,length){if(s.bi_valid>Buf_size-length){s.bi_buf|=value<>Buf_size-s.bi_valid;s.bi_valid+=length-Buf_size}else{s.bi_buf|=value<>>=1;res<<=1}while(--len>0);return res>>>1}function bi_flush(s){if(s.bi_valid===16){put_short(s,s.bi_buf);s.bi_buf=0;s.bi_valid=0}else if(s.bi_valid>=8){s.pending_buf[s.pending++]=s.bi_buf&255;s.bi_buf>>=8;s.bi_valid-=8}}function gen_bitlen(s,desc){var tree=desc.dyn_tree;var max_code=desc.max_code;var stree=desc.stat_desc.static_tree;var has_stree=desc.stat_desc.has_stree;var extra=desc.stat_desc.extra_bits;var base=desc.stat_desc.extra_base;var max_length=desc.stat_desc.max_length;var h;var n,m;var bits;var xbits;var f;var overflow=0;for(bits=0;bits<=MAX_BITS;bits++){s.bl_count[bits]=0}tree[s.heap[s.heap_max]*2+1]=0;for(h=s.heap_max+1;hmax_length){bits=max_length;overflow++}tree[n*2+1]=bits;if(n>max_code){continue}s.bl_count[bits]++;xbits=0;if(n>=base){xbits=extra[n-base]}f=tree[n*2];s.opt_len+=f*(bits+xbits);if(has_stree){s.static_len+=f*(stree[n*2+1]+xbits)}}if(overflow===0){return}do{bits=max_length-1;while(s.bl_count[bits]===0){bits--}s.bl_count[bits]--;s.bl_count[bits+1]+=2;s.bl_count[max_length]--;overflow-=2}while(overflow>0);for(bits=max_length;bits!==0;bits--){n=s.bl_count[bits];while(n!==0){m=s.heap[--h];if(m>max_code){continue}if(tree[m*2+1]!==bits){s.opt_len+=(bits-tree[m*2+1])*tree[m*2];tree[m*2+1]=bits}n--}}}function gen_codes(tree,max_code,bl_count){var next_code=new Array(MAX_BITS+1);var code=0;var bits;var n;for(bits=1;bits<=MAX_BITS;bits++){next_code[bits]=code=code+bl_count[bits-1]<<1}for(n=0;n<=max_code;n++){var len=tree[n*2+1];if(len===0){continue}tree[n*2]=bi_reverse(next_code[len]++,len)}}function tr_static_init(){var n;var bits;var length;var code;var dist;var bl_count=new Array(MAX_BITS+1);length=0;for(code=0;code>=7;for(;code8){put_short(s,s.bi_buf)}else if(s.bi_valid>0){s.pending_buf[s.pending++]=s.bi_buf}s.bi_buf=0;s.bi_valid=0}function copy_block(s,buf,len,header){bi_windup(s);if(header){put_short(s,len);put_short(s,~len)}utils.arraySet(s.pending_buf,s.window,buf,len,s.pending);s.pending+=len}function smaller(tree,n,m,depth){var _n2=n*2;var _m2=m*2;return tree[_n2]>1;n>=1;n--){pqdownheap(s,tree,n)}node=elems;do{n=s.heap[1];s.heap[1]=s.heap[s.heap_len--];pqdownheap(s,tree,1);m=s.heap[1];s.heap[--s.heap_max]=n;s.heap[--s.heap_max]=m;tree[node*2]=tree[n*2]+tree[m*2];s.depth[node]=(s.depth[n]>=s.depth[m]?s.depth[n]:s.depth[m])+1;tree[n*2+1]=tree[m*2+1]=node;s.heap[1]=node++;pqdownheap(s,tree,1)}while(s.heap_len>=2);s.heap[--s.heap_max]=s.heap[1];gen_bitlen(s,desc);gen_codes(tree,max_code,s.bl_count)}function scan_tree(s,tree,max_code){var n;var prevlen=-1;var curlen;var nextlen=tree[0*2+1];var count=0;var max_count=7;var min_count=4;if(nextlen===0){max_count=138;min_count=3}tree[(max_code+1)*2+1]=65535;for(n=0;n<=max_code;n++){curlen=nextlen;nextlen=tree[(n+1)*2+1];if(++count=3;max_blindex--){if(s.bl_tree[bl_order[max_blindex]*2+1]!==0){break}}s.opt_len+=3*(max_blindex+1)+5+5+4;return max_blindex}function send_all_trees(s,lcodes,dcodes,blcodes){var rank;send_bits(s,lcodes-257,5);send_bits(s,dcodes-1,5);send_bits(s,blcodes-4,4);for(rank=0;rank>>=1){if(black_mask&1&&s.dyn_ltree[n*2]!==0){return Z_BINARY}}if(s.dyn_ltree[9*2]!==0||s.dyn_ltree[10*2]!==0||s.dyn_ltree[13*2]!==0){return Z_TEXT}for(n=32;n0){if(s.strm.data_type===Z_UNKNOWN){s.strm.data_type=detect_data_type(s)}build_tree(s,s.l_desc);build_tree(s,s.d_desc);max_blindex=build_bl_tree(s);opt_lenb=s.opt_len+3+7>>>3;static_lenb=s.static_len+3+7>>>3;if(static_lenb<=opt_lenb){opt_lenb=static_lenb}}else{opt_lenb=static_lenb=stored_len+5}if(stored_len+4<=opt_lenb&&buf!==-1){_tr_stored_block(s,buf,stored_len,last)}else if(s.strategy===Z_FIXED||static_lenb===opt_lenb){send_bits(s,(STATIC_TREES<<1)+(last?1:0),3);compress_block(s,static_ltree,static_dtree)}else{send_bits(s,(DYN_TREES<<1)+(last?1:0),3);send_all_trees(s,s.l_desc.max_code+1,s.d_desc.max_code+1,max_blindex+1);compress_block(s,s.dyn_ltree,s.dyn_dtree)}init_block(s);if(last){bi_windup(s)}}function _tr_tally(s,dist,lc){s.pending_buf[s.d_buf+s.last_lit*2]=dist>>>8&255;s.pending_buf[s.d_buf+s.last_lit*2+1]=dist&255;s.pending_buf[s.l_buf+s.last_lit]=lc&255;s.last_lit++;if(dist===0){s.dyn_ltree[lc*2]++}else{s.matches++;dist--;s.dyn_ltree[(_length_code[lc]+LITERALS+1)*2]++;s.dyn_dtree[d_code(dist)*2]++}return s.last_lit===s.lit_bufsize-1}exports._tr_init=_tr_init;exports._tr_stored_block=_tr_stored_block;exports._tr_flush_block=_tr_flush_block;exports._tr_tally=_tr_tally;exports._tr_align=_tr_align},{"../utils/common":54}],66:[function(require,module,exports){arguments[4][15][0].apply(exports,arguments)},{dup:15}],67:[function(require,module,exports){(function(process){"use strict";if(!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0){module.exports=nextTick}else{module.exports=process.nextTick}function nextTick(fn,arg1,arg2,arg3){if(typeof fn!=="function"){throw new TypeError('"callback" argument must be a function')}var len=arguments.length;var args,i;switch(len){case 0:case 1:return process.nextTick(fn);case 2:return process.nextTick(function afterTickOne(){fn.call(null,arg1)});case 3:return process.nextTick(function afterTickTwo(){fn.call(null,arg1,arg2)});case 4:return process.nextTick(function afterTickThree(){fn.call(null,arg1,arg2,arg3)});default:args=new Array(len-1);i=0;while(i1){for(var i=1;i0){if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var _e=new Error("stream.unshift() after end event");stream.emit("error",_e)}else{var skipAdd;if(state.decoder&&!addToFront&&!encoding){chunk=state.decoder.write(chunk);skipAdd=!state.objectMode&&chunk.length===0}if(!addToFront)state.reading=false;if(!skipAdd){if(state.flowing&&state.length===0&&!state.sync){stream.emit("data",chunk);stream.read(0)}else{state.length+=state.objectMode?1:chunk.length;if(addToFront)state.buffer.unshift(chunk);else state.buffer.push(chunk);if(state.needReadable)emitReadable(stream)}}maybeReadMore(stream,state)}}else if(!addToFront){state.reading=false}return needMoreData(state)}function needMoreData(state){return!state.ended&&(state.needReadable||state.length=MAX_HWM){n=MAX_HWM}else{n--;n|=n>>>1;n|=n>>>2;n|=n>>>4;n|=n>>>8;n|=n>>>16;n++}return n}function howMuchToRead(n,state){if(state.length===0&&state.ended)return 0;if(state.objectMode)return n===0?0:1;if(n===null||isNaN(n)){if(state.flowing&&state.buffer.length)return state.buffer[0].length;else return state.length}if(n<=0)return 0;if(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n>state.length){if(!state.ended){state.needReadable=true;return 0}else{return state.length}}return n}Readable.prototype.read=function(n){debug("read",n);var state=this._readableState;var nOrig=n;if(typeof n!=="number"||n>0)state.emittedReadable=false;if(n===0&&state.needReadable&&(state.length>=state.highWaterMark||state.ended)){debug("read: emitReadable",state.length,state.ended);if(state.length===0&&state.ended)endReadable(this);else emitReadable(this);return null}n=howMuchToRead(n,state);if(n===0&&state.ended){if(state.length===0)endReadable(this);return null}var doRead=state.needReadable;debug("need readable",doRead);if(state.length===0||state.length-n0)ret=fromList(n,state);else ret=null;if(ret===null){state.needReadable=true;n=0}state.length-=n;if(state.length===0&&!state.ended)state.needReadable=true;if(nOrig!==n&&state.ended&&state.length===0)endReadable(this);if(ret!==null)this.emit("data",ret);return ret};function chunkInvalid(state,chunk){var er=null;if(!Buffer.isBuffer(chunk)&&typeof chunk!=="string"&&chunk!==null&&chunk!==undefined&&!state.objectMode){er=new TypeError("Invalid non-string/buffer chunk")}return er}function onEofChunk(stream,state){if(state.ended)return;if(state.decoder){var chunk=state.decoder.end();if(chunk&&chunk.length){state.buffer.push(chunk);state.length+=state.objectMode?1:chunk.length}}state.ended=true;emitReadable(stream)}function emitReadable(stream){var state=stream._readableState;state.needReadable=false;if(!state.emittedReadable){debug("emitReadable",state.flowing);state.emittedReadable=true;if(state.sync)processNextTick(emitReadable_,stream);else emitReadable_(stream)}}function emitReadable_(stream){debug("emit readable");stream.emit("readable");flow(stream)}function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state)}}function maybeReadMore_(stream,state){var len=state.length;while(!state.reading&&!state.flowing&&!state.ended&&state.length1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp){debug("false write response, pause",src._readableState.awaitDrain);src._readableState.awaitDrain++}src.pause()}}function onerror(er){debug("onerror",er);unpipe();dest.removeListener("error",onerror);if(EElistenerCount(dest,"error")===0)dest.emit("error",er)}prependListener(dest,"error",onerror);function onclose(){dest.removeListener("finish",onfinish);unpipe()}dest.once("close",onclose);function onfinish(){debug("onfinish");dest.removeListener("close",onclose);unpipe()}dest.once("finish",onfinish);function unpipe(){debug("unpipe");src.unpipe(dest)}dest.emit("pipe",src);if(!state.flowing){debug("pipe resume");src.resume()}return dest};function pipeOnDrain(src){return function(){var state=src._readableState;debug("pipeOnDrain",state.awaitDrain);if(state.awaitDrain)state.awaitDrain--;if(state.awaitDrain===0&&EElistenerCount(src,"data")){state.flowing=true;flow(src)}}}Readable.prototype.unpipe=function(dest){var state=this._readableState;if(state.pipesCount===0)return this;if(state.pipesCount===1){if(dest&&dest!==state.pipes)return this;if(!dest)dest=state.pipes;state.pipes=null;state.pipesCount=0;state.flowing=false;if(dest)dest.emit("unpipe",this);return this}if(!dest){var dests=state.pipes;var len=state.pipesCount;state.pipes=null;state.pipesCount=0;state.flowing=false;for(var _i=0;_i=length){if(stringMode)ret=list.join("");else if(list.length===1)ret=list[0];else ret=Buffer.concat(list,length);list.length=0}else{if(n0)throw new Error('"endReadable()" called on non-empty stream');if(!state.endEmitted){state.ended=true;processNextTick(endReadableNT,state,stream)}}function endReadableNT(state,stream){if(!state.endEmitted&&state.length===0){state.endEmitted=true;stream.readable=false;stream.emit("end")}}function forEach(xs,f){for(var i=0,l=xs.length;i-1?setImmediate:processNextTick;Writable.WritableState=WritableState;var util=require("core-util-is");util.inherits=require("inherits");var internalUtil={deprecate:require("util-deprecate")};var Stream;(function(){try{Stream=require("st"+"ream")}catch(_){}finally{if(!Stream)Stream=require("events").EventEmitter}})();var Buffer=require("buffer").Buffer;var bufferShim=require("buffer-shims");util.inherits(Writable,Stream);function nop(){}function WriteReq(chunk,encoding,cb){this.chunk=chunk;this.encoding=encoding;this.callback=cb;this.next=null}var Duplex;function WritableState(options,stream){Duplex=Duplex||require("./_stream_duplex");options=options||{};this.objectMode=!!options.objectMode;if(stream instanceof Duplex)this.objectMode=this.objectMode||!!options.writableObjectMode;var hwm=options.highWaterMark;var defaultHwm=this.objectMode?16:16*1024;this.highWaterMark=hwm||hwm===0?hwm:defaultHwm;this.highWaterMark=~~this.highWaterMark;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;var noDecode=options.decodeStrings===false; -this.decodeStrings=!noDecode;this.defaultEncoding=options.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(er){onwrite(stream,er)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.bufferedRequestCount=0;this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function writableStateGetBuffer(){var current=this.bufferedRequest;var out=[];while(current){out.push(current);current=current.next}return out};(function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.")})}catch(_){}})();var Duplex;function Writable(options){Duplex=Duplex||require("./_stream_duplex");if(!(this instanceof Writable)&&!(this instanceof Duplex))return new Writable(options);this._writableState=new WritableState(options,this);this.writable=true;if(options){if(typeof options.write==="function")this._write=options.write;if(typeof options.writev==="function")this._writev=options.writev}Stream.call(this)}Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function writeAfterEnd(stream,cb){var er=new Error("write after end");stream.emit("error",er);processNextTick(cb,er)}function validChunk(stream,state,chunk,cb){var valid=true;var er=false;if(chunk===null){er=new TypeError("May not write null values to stream")}else if(!Buffer.isBuffer(chunk)&&typeof chunk!=="string"&&chunk!==undefined&&!state.objectMode){er=new TypeError("Invalid non-string/buffer chunk")}if(er){stream.emit("error",er);processNextTick(cb,er);valid=false}return valid}Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState;var ret=false;if(typeof encoding==="function"){cb=encoding;encoding=null}if(Buffer.isBuffer(chunk))encoding="buffer";else if(!encoding)encoding=state.defaultEncoding;if(typeof cb!=="function")cb=nop;if(state.ended)writeAfterEnd(this,cb);else if(validChunk(this,state,chunk,cb)){state.pendingcb++;ret=writeOrBuffer(this,state,chunk,encoding,cb)}return ret};Writable.prototype.cork=function(){var state=this._writableState;state.corked++};Writable.prototype.uncork=function(){var state=this._writableState;if(state.corked){state.corked--;if(!state.writing&&!state.corked&&!state.finished&&!state.bufferProcessing&&state.bufferedRequest)clearBuffer(this,state)}};Writable.prototype.setDefaultEncoding=function setDefaultEncoding(encoding){if(typeof encoding==="string")encoding=encoding.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);this._writableState.defaultEncoding=encoding;return this};function decodeChunk(state,chunk,encoding){if(!state.objectMode&&state.decodeStrings!==false&&typeof chunk==="string"){chunk=bufferShim.from(chunk,encoding)}return chunk}function writeOrBuffer(stream,state,chunk,encoding,cb){chunk=decodeChunk(state,chunk,encoding);if(Buffer.isBuffer(chunk))encoding="buffer";var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length=this.charLength-this.charReceived?this.charLength-this.charReceived:buffer.length;buffer.copy(this.charBuffer,this.charReceived,0,available);this.charReceived+=available;if(this.charReceived=55296&&charCode<=56319){this.charLength+=this.surrogateSize;charStr="";continue}this.charReceived=this.charLength=0;if(buffer.length===0){return charStr}break}this.detectIncompleteChar(buffer);var end=buffer.length;if(this.charLength){buffer.copy(this.charBuffer,0,buffer.length-this.charReceived,end);end-=this.charReceived}charStr+=buffer.toString(this.encoding,0,end);var end=charStr.length-1;var charCode=charStr.charCodeAt(end);if(charCode>=55296&&charCode<=56319){var size=this.surrogateSize;this.charLength+=size;this.charReceived+=size;this.charBuffer.copy(this.charBuffer,size,0,size);buffer.copy(this.charBuffer,0,0,size);return charStr.substring(0,end)}return charStr};StringDecoder.prototype.detectIncompleteChar=function(buffer){var i=buffer.length>=3?3:buffer.length;for(;i>0;i--){var c=buffer[buffer.length-i];if(i==1&&c>>5==6){this.charLength=2;break}if(i<=2&&c>>4==14){this.charLength=3;break}if(i<=3&&c>>3==30){this.charLength=4;break}}this.charReceived=i};StringDecoder.prototype.end=function(buffer){var res="";if(buffer&&buffer.length)res=this.write(buffer);if(this.charReceived){var cr=this.charReceived;var buf=this.charBuffer;var enc=this.encoding;res+=buf.slice(0,cr).toString(enc)}return res};function passThroughWrite(buffer){return buffer.toString(this.encoding)}function utf16DetectIncompleteChar(buffer){this.charReceived=buffer.length%2;this.charLength=this.charReceived?2:0}function base64DetectIncompleteChar(buffer){this.charReceived=buffer.length%3;this.charLength=this.charReceived?3:0}},{buffer:19}],75:[function(require,module,exports){(function(global){module.exports=deprecate;function deprecate(fn,msg){if(config("noDeprecation")){return fn}var warned=false;function deprecated(){if(!warned){if(config("throwDeprecation")){throw new Error(msg)}else if(config("traceDeprecation")){console.trace(msg)}else{console.warn(msg)}warned=true}return fn.apply(this,arguments)}return deprecated}function config(name){try{if(!global.localStorage)return false}catch(_){return false}var val=global.localStorage[name];if(null==val)return false;return String(val).toLowerCase()==="true"}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],76:[function(require,module,exports){module.exports=function isBuffer(arg){return arg&&typeof arg==="object"&&typeof arg.copy==="function"&&typeof arg.fill==="function"&&typeof arg.readUInt8==="function"}},{}],77:[function(require,module,exports){(function(process,global){var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){var objects=[];for(var i=0;i=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}});for(var x=args[i];i=3)ctx.depth=arguments[2];if(arguments.length>=4)ctx.colors=arguments[3];if(isBoolean(opts)){ctx.showHidden=opts}else if(opts){exports._extend(ctx,opts)}if(isUndefined(ctx.showHidden))ctx.showHidden=false;if(isUndefined(ctx.depth))ctx.depth=2;if(isUndefined(ctx.colors))ctx.colors=false;if(isUndefined(ctx.customInspect))ctx.customInspect=true;if(ctx.colors)ctx.stylize=stylizeWithColor;return formatValue(ctx,obj,ctx.depth)}exports.inspect=inspect;inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];if(style){return"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m"}else{return str}}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};array.forEach(function(val,idx){hash[val]=true});return hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&!(value.constructor&&value.constructor.prototype===value)){var ret=value.inspect(recurseTimes,ctx);if(!isString(ret)){ret=formatValue(ctx,ret,recurseTimes)}return ret}var primitive=formatPrimitive(ctx,value);if(primitive){return primitive}var keys=Object.keys(value);var visibleKeys=arrayToHash(keys);if(ctx.showHidden){keys=Object.getOwnPropertyNames(value)}if(isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0)){return formatError(value)}if(keys.length===0){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}if(isDate(value)){return ctx.stylize(Date.prototype.toString.call(value),"date")}if(isError(value)){return formatError(value)}}var base="",array=false,braces=["{","}"];if(isArray(value)){array=true;braces=["[","]"]}if(isFunction(value)){var n=value.name?": "+value.name:"";base=" [Function"+n+"]"}if(isRegExp(value)){base=" "+RegExp.prototype.toString.call(value)}if(isDate(value)){base=" "+Date.prototype.toUTCString.call(value)}if(isError(value)){base=" "+formatError(value)}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1]}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}else{return ctx.stylize("[Object]","special")}}ctx.seen.push(value);var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys)}else{output=keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)})}ctx.seen.pop();return reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}if(isNumber(value))return ctx.stylize(""+value,"number");if(isBoolean(value))return ctx.stylize(""+value,"boolean");if(isNull(value))return ctx.stylize("null","null")}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i-1){if(array){str=str.split("\n").map(function(line){return" "+line}).join("\n").substr(2)}else{str="\n"+str.split("\n").map(function(line){return" "+line}).join("\n")}}}else{str=ctx.stylize("[Circular]","special")}}if(isUndefined(name)){if(array&&key.match(/^\d+$/)){return str}name=JSON.stringify(""+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.substr(1,name.length-2);name=ctx.stylize(name,"name")}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,"string")}}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=output.reduce(function(prev,cur){numLinesEst++;if(cur.indexOf("\n")>=0)numLinesEst++;return prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(length>60){return braces[0]+(base===""?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]}return braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;exports.isBuffer=require("./support/isBuffer");function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var d=new Date;var time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))};exports.inherits=require("inherits");exports._extend=function(origin,add){if(!add||!isObject(add))return origin;var keys=Object.keys(add);var i=keys.length;while(i--){origin[keys[i]]=add[keys[i]]}return origin};function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":76,_process:68,inherits:27}],78:[function(require,module,exports){"use strict";var isString=require("validate.io-string-primitive");var isNonNegativeInteger=require("validate.io-nonnegative-integer");var ceil=require("math-ceil");var repeat=require("utils-repeat-string");var MAX_SAFE_INTEGER=9007199254740991;function lpad(str,len,pad){var n;var p;if(!isString(str)){throw new TypeError("invalid input argument. First argument must be a string. Value: `"+str+"`.")}if(!isNonNegativeInteger(len)){throw new TypeError("invalid input argument. Second argument must be a nonnegative integer. Value: `"+len+"`.")}if(arguments.length>2){p=pad;if(!isString(p)){throw new TypeError("invalid input argument. Third argument must be a string. Value: `"+p+"`.")}if(p.length===0){throw new RangeError("invalid input argument. Pad string must not be an empty string.")}}else{p=" "}if(len>MAX_SAFE_INTEGER){throw new RangeError("invalid input argument. Output string length exceeds maximum allowed string length.")}n=(len-str.length)/p.length;if(n<=0){return str}n=ceil(n);return repeat(p,n)+str}module.exports=lpad},{"math-ceil":41,"utils-repeat-string":79,"validate.io-nonnegative-integer":82,"validate.io-string-primitive":84}],79:[function(require,module,exports){"use strict";var isString=require("validate.io-string-primitive");var isNonNegativeInteger=require("validate.io-nonnegative-integer");var MAX_SAFE_INTEGER=9007199254740991;function repeat(str,n){var rpt;var cnt;if(!isString(str)){throw new TypeError("invalid input argument. First argument must be a string. Value: `"+str+"`.")}if(!isNonNegativeInteger(n)){throw new TypeError("invalid input argument. Second argument must be a nonnegative integer. Value: `"+n+"`.")}if(str.length===0||n===0){return""}if(str.length*n>MAX_SAFE_INTEGER){throw new RangeError("invalid input argument. Output string length exceeds maximum allowed string length.")}rpt="";cnt=n;for(;;){if((cnt&1)===1){rpt+=str}cnt>>>=1;if(cnt===0){break}str+=str}return rpt}module.exports=repeat},{"validate.io-nonnegative-integer":82,"validate.io-string-primitive":84}],80:[function(require,module,exports){"use strict";var isString=require("validate.io-string-primitive");var isNonNegativeInteger=require("validate.io-nonnegative-integer");var ceil=require("math-ceil");var repeat=require("utils-repeat-string");var MAX_SAFE_INTEGER=9007199254740991;function rpad(str,len,pad){var n;var p;if(!isString(str)){throw new TypeError("invalid input argument. First argument must be a string. Value: `"+str+"`.")}if(!isNonNegativeInteger(len)){throw new TypeError("invalid input argument. Second argument must be a nonnegative integer. Value: `"+len+"`.")}if(arguments.length>2){p=pad;if(!isString(p)){throw new TypeError("invalid input argument. Third argument must be a string. Value: `"+p+"`.")}if(p.length===0){throw new RangeError("invalid input argument. Pad string must not be an empty string.")}}else{p=" "}if(len>MAX_SAFE_INTEGER){throw new RangeError("invalid input argument. Output string length exceeds maximum allowed string length.")}n=(len-str.length)/p.length;if(n<=0){return str}n=ceil(n);return str+repeat(p,n)}module.exports=rpad},{"math-ceil":41,"utils-repeat-string":79,"validate.io-nonnegative-integer":82,"validate.io-string-primitive":84}],81:[function(require,module,exports){"use strict";var isNumber=require("validate.io-number");function isInteger(value){return isNumber(value)&&value%1===0}module.exports=isInteger},{"validate.io-number":83}],82:[function(require,module,exports){"use strict";var isInteger=require("validate.io-integer");function isNonNegativeInteger(value){return isInteger(value)&&value>=0}module.exports=isNonNegativeInteger},{"validate.io-integer":81}],83:[function(require,module,exports){"use strict";function isNumber(value){return(typeof value==="number"||Object.prototype.toString.call(value)==="[object Number]")&&value.valueOf()===value.valueOf()}module.exports=isNumber},{}],84:[function(require,module,exports){"use strict";function isString(value){return typeof value==="string"}module.exports=isString},{}],85:[function(require,module,exports){module.exports={name:"ami.js",version:"v0.0.11",main:"src/ami.js",keywords:["ami","ami.js","three.js","webgl","dicom","nifti","awesome","medical","imaging","xtk","nrrd","vtk","stl","trk"],author:{name:"Nicolas Rannou",email:"nicolas@eunate.ch",url:"https://eunate.ch"},license:"Apache-2.0",repository:{type:"git",url:"https://fnndsc.github.io/ami"},config:{threeVersion:"r81",amiCDN:"https://cdn.rawgit.com/fnndsc/ami/master/build/ami.min.js",gaKey:"UA-39303022-3",transforms:"-t [babelify --presets [ es2015 ] ]"},dependencies:{"dicom-parser":"1.7.3","image-JPEG2000":"OHIF/image-JPEG2000#master","jpeg-lossless-decoder-js":"1.2.3","math-float32-to-binary-string":"^1.0.0","nrrd-js":"^0.2.1","nifti-reader-js":"v0.5.3",pako:"1.0.1"},scripts:{"dist:prepare":"node ./scripts/$npm_package_config_mode.js --dist","dist:watchAmi":"watchify -d src/ami $npm_package_config_transforms --standalone AMI -o dist/build/ami.js -v","dist:watch":"watchify $npm_package_config_target -d $npm_package_config_transforms -o dist/$npm_package_config_target -v",dist:"npm run dist:prepare --ami.js:mode=$npm_package_config_mode && (live-server dist --open=$npm_package_config_open & npm run dist:watch --ami.js:target=$npm_package_config_target)",example:"npm run clean && node ./scripts/router.js examples ",lesson:"npm run clean && mkdir dist/build && touch dist/build/ami.js && node ./scripts/router.js lessons ",demo:"node ./scripts/lessons.js --demo",lint:"eslint **/*.js --quiet","build:examples":"npm run dist:prepare --ami.js:mode=examples && find examples -name '*.js' -print0 | xargs -0 -n1 -I{} bash -c \"echo Building {}; browserify {} -d -v $npm_package_config_transforms > dist/{} \"","build:ami":"browserify src/ami.js -d -v $npm_package_config_transforms --standalone AMI > build/ami.js && uglifyjs build/ami.js -o build/ami.min.js",build:"npm run clean && cp index.html dist/index.html && npm run build:examples && npm run doc",clean:"rm -rf dist/*",test:"karma start",doc:"jsdoc -p -r -R README.md -c jsdoc.conf -d dist/doc src",ami:"npm run lint && npm run demo && npm run build:ami && npm run test",deploy:"npm run build && gh-pages -d dist"},devDependencies:{browserify:"^13.1.0","uglify-js":"^2.7.3","live-server":"^1.1.0","babel-cli":"latest",shelljs:"latest","gh-pages":"latest",eslint:"latest","babel-polyfill":"^6.13.0","babel-preset-es2015":"^6.13.2",babelify:"7.3.0",glslify:"5.1.0",jsdoc:"jsdoc3/jsdoc#master",karma:"latest",phantomjs:"latest","karma-browserify":"latest","karma-jasmine":"latest","karma-phantomjs-launcher":"latest","karma-spec-reporter":"latest","jasmine-core":"latest",watchify:"3.7.0"},engines:{node:">=6.9.0"},browserify:{transform:["babelify"]}}},{}],86:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _cameras=require("./cameras/cameras");var _cameras2=_interopRequireDefault(_cameras);var _controls=require("./controls/controls");var _controls2=_interopRequireDefault(_controls);var _core=require("./core/core");var _core2=_interopRequireDefault(_core);var _geometries=require("./geometries/geometries");var _geometries2=_interopRequireDefault(_geometries);var _helpers=require("./helpers/helpers");var _helpers2=_interopRequireDefault(_helpers);var _loaders=require("./loaders/loaders");var _loaders2=_interopRequireDefault(_loaders);var _models=require("./models/models");var _models2=_interopRequireDefault(_models);var _parsers=require("./parsers/parsers");var _parsers2=_interopRequireDefault(_parsers);var _shaders=require("./shaders/shaders");var _shaders2=_interopRequireDefault(_shaders);var _widgets=require("./widgets/widgets");var _widgets2=_interopRequireDefault(_widgets);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var pckg=require("../package.json");exports.default={Cameras:_cameras2.default,Controls:_controls2.default,Core:_core2.default,Geometries:_geometries2.default,Helpers:_helpers2.default,Loaders:_loaders2.default,Models:_models2.default,Parsers:_parsers2.default,Shaders:_shaders2.default,Widgets:_widgets2.default};window.console.log("AMI "+pckg.version+" ( ThreeJS "+pckg.config.threeVersion+")")},{"../package.json":85,"./cameras/cameras":87,"./controls/controls":89,"./core/core":93,"./geometries/geometries":97,"./helpers/helpers":102,"./loaders/loaders":111,"./models/models":115,"./parsers/parsers":120,"./shaders/shaders":134,"./widgets/widgets":143}],87:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _cameras=require("./cameras.orthographic");var _cameras2=_interopRequireDefault(_cameras);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Orthographic:_cameras2.default}},{"./cameras.orthographic":88}],88:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:null;this.center();var computedAngle=90;var clockwise=1;if(!this._fromFront){clockwise=-1}if(angle===null){computedAngle*=-clockwise;this._angle+=90}else{computedAngle=360-clockwise*(angle-this._angle);this._angle=angle}this._angle%=360;var rotation=(new THREE.Matrix4).makeRotationAxis(this._zCosine,computedAngle*Math.PI/180);this.up.applyMatrix4(rotation);this._updateMatrices()}},{key:"fitBox",value:function fitBox(){var direction=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var factor=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1.5;var zoom=1;switch(direction){case 0:zoom=factor*this._computeZoom(this._canvas.width,this._xCosine);break;case 1:zoom=factor*this._computeZoom(this._canvas.height,this._yCosine);break;case 2:zoom=factor*Math.min(this._computeZoom(this._canvas.width,this._xCosine),this._computeZoom(this._canvas.height,this._yCosine));break;default:break}if(!zoom){return false}this.zoom=zoom;this.center()}},{key:"_adjustTopDirection",value:function _adjustTopDirection(horizontalDirection,verticalDirection){var hMaxIndex=this._getMaxIndex(horizontalDirection);var vMaxIndex=this._getMaxIndex(verticalDirection);if(vMaxIndex===2&&verticalDirection.getComponent(vMaxIndex)<0||vMaxIndex===1&&verticalDirection.getComponent(vMaxIndex)>0||vMaxIndex===0&&verticalDirection.getComponent(vMaxIndex)>0){verticalDirection.negate()}return verticalDirection}},{key:"_getMaxIndex",value:function _getMaxIndex(vector){if(Math.abs(Math.round(vector.x))===1){return 0}else if(Math.abs(Math.round(vector.y))===1){return 1}else if(Math.abs(Math.round(vector.z))===1){return 2}}},{key:"_orderIntersections",value:function _orderIntersections(intersections,direction){var maxIndex=this._getMaxIndex(direction);var ordered=intersections[0].dot(direction)0)){window.console.log("Invalid dimension provided.");window.console.log(dimension);return false}var ray={position:this._box.center.clone(),direction:direction};var intersections=_core2.default.rayBox(ray,this._box);if(intersections.length<2){window.console.log("Can not adjust the camera ( < 2 intersections).");window.console.log(ray);window.console.log(this._box);return false}return dimension/intersections[0].distanceTo(intersections[1])}},{key:"_updatePositionAndTarget",value:function _updatePositionAndTarget(position,target){this.position.set(position.x,position.y,position.z);this.lookAt(target.x,target.y,target.z);this._controls.target.set(target.x,target.y,target.z)}},{key:"_updateMatrices",value:function _updateMatrices(){this._controls.update();this.updateProjectionMatrix();this.updateMatrixWorld()}},{key:"xCosine",set:function set(xCosine){this._xCosine=xCosine},get:function get(){return this._xCosine}},{key:"yCosine",set:function set(yCosine){this._yCosine=yCosine},get:function get(){return this._yCosine}},{key:"zCosine",set:function set(zCosine){this._zCosine=zCosine},get:function get(){return this._zCosine}},{key:"controls",set:function set(controls){this._controls=controls},get:function get(){return this._controls}},{key:"box",set:function set(box){this._box=box},get:function get(){return this._box}},{key:"canvas",set:function set(canvas){this._canvas=canvas;this._updateCanvas()},get:function get(){return this._canvas}},{key:"angle",set:function set(angle){this.rotate(angle)},get:function get(){return this._angle}}]);return CamerasOrthographic}(THREE.OrthographicCamera);exports.default=CamerasOrthographic},{"../core/core.intersections":92,"../core/core.validators":96}],89:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _controls=require("./controls.trackball");var _controls2=_interopRequireDefault(_controls);var _controls3=require("./controls.trackballortho");var _controls4=_interopRequireDefault(_controls3);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Trackball:_controls2.default,TrackballOrtho:_controls4.default}},{"./controls.trackball":90,"./controls.trackballortho":91}],90:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return call&&((typeof call==="undefined"?"undefined":_typeof(call))==="object"||typeof call==="function")?call:self}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+(typeof superClass==="undefined"?"undefined":_typeof(superClass)))}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass}var Trackball=function(_THREE$EventDispatche){_inherits(Trackball,_THREE$EventDispatche);function Trackball(object,domElement){_classCallCheck(this,Trackball);var _this2=_possibleConstructorReturn(this,(Trackball.__proto__||Object.getPrototypeOf(Trackball)).call(this));var _this=_this2;var STATE={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM:4,TOUCH_PAN:5,CUSTOM:99};_this2.object=object;_this2.domElement=domElement!==undefined?domElement:document;_this2.enabled=true;_this2.screen={left:0,top:0,width:0,height:0};_this2.rotateSpeed=1;_this2.zoomSpeed=1.2;_this2.panSpeed=.3;_this2.noRotate=false;_this2.noZoom=false;_this2.noPan=false;_this2.noCustom=false;_this2.forceState=-1;_this2.staticMoving=false;_this2.dynamicDampingFactor=.2;_this2.minDistance=0;_this2.maxDistance=Infinity;_this2.keys=[65,83,68];_this2.target=new THREE.Vector3;var EPS=1e-6;var lastPosition=new THREE.Vector3;var _state=STATE.NONE,_prevState=STATE.NONE,_eye=new THREE.Vector3,_movePrev=new THREE.Vector2,_moveCurr=new THREE.Vector2,_lastAxis=new THREE.Vector3,_lastAngle=0,_zoomStart=new THREE.Vector2,_zoomEnd=new THREE.Vector2,_touchZoomDistanceStart=0,_touchZoomDistanceEnd=0,_panStart=new THREE.Vector2,_panEnd=new THREE.Vector2,_customStart=new THREE.Vector2,_customEnd=new THREE.Vector2;_this2.target0=_this2.target.clone();_this2.position0=_this2.object.position.clone();_this2.up0=_this2.object.up.clone();var changeEvent={type:"change"};var startEvent={type:"start"};var endEvent={type:"end"};_this2.handleResize=function(){if(this.domElement===document){this.screen.left=0;this.screen.top=0;this.screen.width=window.innerWidth;this.screen.height=window.innerHeight}else{var box=this.domElement.getBoundingClientRect();var d=this.domElement.ownerDocument.documentElement;this.screen.left=box.left+window.pageXOffset-d.clientLeft;this.screen.top=box.top+window.pageYOffset-d.clientTop;this.screen.width=box.width;this.screen.height=box.height}};_this2.handleEvent=function(event){if(typeof this[event.type]=="function"){this[event.type](event)}};var getMouseOnScreen=function(){var vector=new THREE.Vector2;return function(pageX,pageY){vector.set((pageX-_this.screen.left)/_this.screen.width,(pageY-_this.screen.top)/_this.screen.height);return vector}}();var getMouseOnCircle=function(){var vector=new THREE.Vector2;return function(pageX,pageY){vector.set((pageX-_this.screen.width*.5-_this.screen.left)/(_this.screen.width*.5),(_this.screen.height+2*(_this.screen.top-pageY))/_this.screen.width);return vector}}();_this2.rotateCamera=function(){var axis=new THREE.Vector3,quaternion=new THREE.Quaternion,eyeDirection=new THREE.Vector3,objectUpDirection=new THREE.Vector3,objectSidewaysDirection=new THREE.Vector3,moveDirection=new THREE.Vector3,angle;return function(){moveDirection.set(_moveCurr.x-_movePrev.x,_moveCurr.y-_movePrev.y,0);angle=moveDirection.length();if(angle){_eye.copy(_this.object.position).sub(_this.target);eyeDirection.copy(_eye).normalize();objectUpDirection.copy(_this.object.up).normalize();objectSidewaysDirection.crossVectors(objectUpDirection,eyeDirection).normalize();objectUpDirection.setLength(_moveCurr.y-_movePrev.y);objectSidewaysDirection.setLength(_moveCurr.x-_movePrev.x);moveDirection.copy(objectUpDirection.add(objectSidewaysDirection));axis.crossVectors(moveDirection,_eye).normalize();angle*=_this.rotateSpeed;quaternion.setFromAxisAngle(axis,angle);_eye.applyQuaternion(quaternion);_this.object.up.applyQuaternion(quaternion);_lastAxis.copy(axis);_lastAngle=angle}else if(!_this.staticMoving&&_lastAngle){_lastAngle*=Math.sqrt(1-_this.dynamicDampingFactor);_eye.copy(_this.object.position).sub(_this.target);quaternion.setFromAxisAngle(_lastAxis,_lastAngle);_eye.applyQuaternion(quaternion);_this.object.up.applyQuaternion(quaternion)}_movePrev.copy(_moveCurr)}}();_this2.zoomCamera=function(){var factor;if(_state===STATE.TOUCH_ZOOM){factor=_touchZoomDistanceStart/_touchZoomDistanceEnd;_touchZoomDistanceStart=_touchZoomDistanceEnd;_eye.multiplyScalar(factor)}else{factor=1+(_zoomEnd.y-_zoomStart.y)*_this.zoomSpeed;if(factor!==1&&factor>0){_eye.multiplyScalar(factor);if(_this.staticMoving){_zoomStart.copy(_zoomEnd)}else{_zoomStart.y+=(_zoomEnd.y-_zoomStart.y)*this.dynamicDampingFactor}}}};_this2.panCamera=function(){var mouseChange=new THREE.Vector2,objectUp=new THREE.Vector3,pan=new THREE.Vector3;return function(){mouseChange.copy(_panEnd).sub(_panStart);if(mouseChange.lengthSq()){mouseChange.multiplyScalar(_eye.length()*_this.panSpeed);pan.copy(_eye).cross(_this.object.up).setLength(mouseChange.x);pan.add(objectUp.copy(_this.object.up).setLength(mouseChange.y));_this.object.position.add(pan);_this.target.add(pan);if(_this.staticMoving){_panStart.copy(_panEnd)}else{_panStart.add(mouseChange.subVectors(_panEnd,_panStart).multiplyScalar(_this.dynamicDampingFactor))}}}}();_this2.checkDistances=function(){if(!_this.noZoom||!_this.noPan){if(_eye.lengthSq()>_this.maxDistance*_this.maxDistance){_this.object.position.addVectors(_this.target,_eye.setLength(_this.maxDistance))}if(_eye.lengthSq()<_this.minDistance*_this.minDistance){_this.object.position.addVectors(_this.target,_eye.setLength(_this.minDistance))}}};_this2.update=function(){_eye.subVectors(_this.object.position,_this.target);if(!_this.noRotate){_this.rotateCamera()}if(!_this.noZoom){_this.zoomCamera()}if(!_this.noPan){_this.panCamera()}if(!_this.noCustom){_this.custom(_customStart,_customEnd)}_this.object.position.addVectors(_this.target,_eye);_this.checkDistances();_this.object.lookAt(_this.target);if(lastPosition.distanceToSquared(_this.object.position)>EPS){_this.dispatchEvent(changeEvent);lastPosition.copy(_this.object.position)}};_this2.reset=function(){_state=STATE.NONE;_prevState=STATE.NONE;_this.target.copy(_this.target0);_this.object.position.copy(_this.position0);_this.object.up.copy(_this.up0);_eye.subVectors(_this.object.position,_this.target);_this.object.lookAt(_this.target);_this.dispatchEvent(changeEvent);lastPosition.copy(_this.object.position)};_this2.setState=function(targetState){_this.forceState=targetState;_prevState=targetState;_state=targetState};_this2.custom=function(customStart,customEnd){};function keydown(event){if(_this.enabled===false)return;window.removeEventListener("keydown",keydown);_prevState=_state;if(_state!==STATE.NONE){return}else if(event.keyCode===_this.keys[STATE.ROTATE]&&!_this.noRotate){_state=STATE.ROTATE}else if(event.keyCode===_this.keys[STATE.ZOOM]&&!_this.noZoom){_state=STATE.ZOOM}else if(event.keyCode===_this.keys[STATE.PAN]&&!_this.noPan){_state=STATE.PAN}}function keyup(event){if(_this.enabled===false)return;_state=_prevState;window.addEventListener("keydown",keydown,false)}function mousedown(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_state===STATE.NONE){_state=event.button}if(_state===STATE.ROTATE&&!_this.noRotate){_moveCurr.copy(getMouseOnCircle(event.pageX,event.pageY));_movePrev.copy(_moveCurr)}else if(_state===STATE.ZOOM&&!_this.noZoom){_zoomStart.copy(getMouseOnScreen(event.pageX,event.pageY));_zoomEnd.copy(_zoomStart)}else if(_state===STATE.PAN&&!_this.noPan){_panStart.copy(getMouseOnScreen(event.pageX,event.pageY));_panEnd.copy(_panStart)}else if(_state===STATE.CUSTOM&&!_this.noCustom){_customStart.copy(getMouseOnScreen(event.pageX,event.pageY));_customEnd.copy(_panStart)}document.addEventListener("mousemove",mousemove,false);document.addEventListener("mouseup",mouseup,false);_this.dispatchEvent(startEvent)}function mousemove(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_state===STATE.ROTATE&&!_this.noRotate){_movePrev.copy(_moveCurr);_moveCurr.copy(getMouseOnCircle(event.pageX,event.pageY))}else if(_state===STATE.ZOOM&&!_this.noZoom){_zoomEnd.copy(getMouseOnScreen(event.pageX,event.pageY))}else if(_state===STATE.PAN&&!_this.noPan){_panEnd.copy(getMouseOnScreen(event.pageX,event.pageY))}else if(_state===STATE.CUSTOM&&!_this.noCustom){_customEnd.copy(getMouseOnScreen(event.pageX,event.pageY))}}function mouseup(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_this.forceState===-1){_state=STATE.NONE}document.removeEventListener("mousemove",mousemove);document.removeEventListener("mouseup",mouseup);_this.dispatchEvent(endEvent)}function mousewheel(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();var delta=0;if(event.wheelDelta){delta=event.wheelDelta/40}else if(event.detail){delta=-event.detail/3}if(_state!==STATE.CUSTOM){_zoomStart.y+=delta*.01}else if(_state===STATE.CUSTOM){_customStart.y+=delta*.01}_this.dispatchEvent(startEvent);_this.dispatchEvent(endEvent)}function touchstart(event){if(_this.enabled===false)return;if(_this.forceState===-1){switch(event.touches.length){case 1:_state=STATE.TOUCH_ROTATE;_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));_movePrev.copy(_moveCurr);break;case 2:_state=STATE.TOUCH_ZOOM;var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=_touchZoomDistanceStart=Math.sqrt(dx*dx+dy*dy);var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panStart.copy(getMouseOnScreen(x,y));_panEnd.copy(_panStart);break;default:_state=STATE.NONE}}else{switch(_state){case 0:_state=STATE.TOUCH_ROTATE;_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));_movePrev.copy(_moveCurr);break;case 1:case 4:if(event.touches.length>=2){_state=STATE.TOUCH_ZOOM;var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=_touchZoomDistanceStart=Math.sqrt(dx*dx+dy*dy)}else{_state=STATE.ZOOM;_zoomStart.copy(getMouseOnScreen(event.touches[0].pageX,event.touches[0].pageY));_zoomEnd.copy(_zoomStart)}break;case 2:case 5:if(event.touches.length>=2){_state=STATE.TOUCH_PAN;var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panStart.copy(getMouseOnScreen(x,y));_panEnd.copy(_panStart)}else{_state=STATE.PAN;_panStart.copy(getMouseOnScreen(event.touches[0].pageX,event.touches[0].pageY));_panEnd.copy(_panStart)}break;case 99:_state=STATE.CUSTOM;var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_customStart.copy(getMouseOnScreen(x,y));_customEnd.copy(_customStart);break;default:_state=STATE.NONE}}_this.dispatchEvent(startEvent)}function touchmove(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_this.forceState===-1){switch(event.touches.length){case 1:_movePrev.copy(_moveCurr);_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));break;case 2:var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=Math.sqrt(dx*dx+dy*dy);var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));break;default:_state=STATE.NONE}}else{switch(_state){case 0:_movePrev.copy(_moveCurr);_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));break;case 1:_zoomEnd.copy(getMouseOnScreen(event.touches[0].pageX,event.touches[0].pageY));break;case 2:_panEnd.copy(getMouseOnScreen(event.touches[0].pageX,event.touches[0].pageY));break;case 4:var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=Math.sqrt(dx*dx+dy*dy);break;case 5:var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));break;case 99:var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_customEnd.copy(getMouseOnScreen(x,y));break;default:_state=STATE.NONE}}}function touchend(event){if(_this.enabled===false)return;if(_this.forceState===-1){switch(event.touches.length){case 1:_movePrev.copy(_moveCurr);_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));break;case 2:_touchZoomDistanceStart=_touchZoomDistanceEnd=0;var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));_panStart.copy(_panEnd);break}_state=STATE.NONE}else{switch(_state){case 0:_movePrev.copy(_moveCurr);_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));break;case 1:case 2:break;case 4:_touchZoomDistanceStart=_touchZoomDistanceEnd=0;_state=STATE.ZOOM;break;case 5:if(event.touches.length>=2){var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));_panStart.copy(_panEnd)}_state=STATE.PAN;break;case 99:var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_customEnd.copy(getMouseOnScreen(x,y));_customStart.copy(_customEnd);break;default:_state=STATE.NONE}}_this.dispatchEvent(endEvent)}_this2.domElement.addEventListener("contextmenu",function(event){event.preventDefault()},false);_this2.domElement.addEventListener("mousedown",mousedown,false);_this2.domElement.addEventListener("mousewheel",mousewheel,false);_this2.domElement.addEventListener("DOMMouseScroll",mousewheel,false);_this2.domElement.addEventListener("touchstart",touchstart,false);_this2.domElement.addEventListener("touchend",touchend,false);_this2.domElement.addEventListener("touchmove",touchmove,false);window.addEventListener("keydown",keydown,false);window.addEventListener("keyup",keyup,false);_this2.handleResize();_this2.update();return _this2}return Trackball}(THREE.EventDispatcher);exports.default=Trackball},{}],91:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return call&&((typeof call==="undefined"?"undefined":_typeof(call))==="object"||typeof call==="function")?call:self}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+(typeof superClass==="undefined"?"undefined":_typeof(superClass)))}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass}var Trackballortho=function(_THREE$EventDispatche){_inherits(Trackballortho,_THREE$EventDispatche);function Trackballortho(object,domElement){var state=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{NONE:-1,ROTATE:1,ZOOM:2,PAN:0,SCROLL:4,TOUCH_ROTATE:4,TOUCH_ZOOM_PAN:5};_classCallCheck(this,Trackballortho);var _this2=_possibleConstructorReturn(this,(Trackballortho.__proto__||Object.getPrototypeOf(Trackballortho)).call(this));var _this=_this2;var STATE=state;_this2.object=object;_this2.domElement=domElement!==undefined?domElement:document;_this2.enabled=true;_this2.screen={left:0,top:0,width:0,height:0};_this2.radius=0;_this2.zoomSpeed=1.2;_this2.noZoom=false;_this2.noPan=false;_this2.staticMoving=false;_this2.dynamicDampingFactor=.2;_this2.keys=[65,83,68];_this2.target=new THREE.Vector3;var EPS=1e-6;var _changed=true;var _state=STATE.NONE,_prevState=STATE.NONE,_eye=new THREE.Vector3,_zoomStart=new THREE.Vector2,_zoomEnd=new THREE.Vector2,_touchZoomDistanceStart=0,_touchZoomDistanceEnd=0,_panStart=new THREE.Vector2,_panEnd=new THREE.Vector2;_this2.target0=_this2.target.clone();_this2.position0=_this2.object.position.clone();_this2.up0=_this2.object.up.clone();_this2.left0=_this2.object.left;_this2.right0=_this2.object.right;_this2.top0=_this2.object.top;_this2.bottom0=_this2.object.bottom;var changeEvent={type:"change"};var startEvent={type:"start"};var endEvent={type:"end"};_this2.handleResize=function(){if(this.domElement===document){this.screen.left=0;this.screen.top=0;this.screen.width=window.innerWidth;this.screen.height=window.innerHeight}else{var box=this.domElement.getBoundingClientRect();var d=this.domElement.ownerDocument.documentElement;this.screen.left=box.left+window.pageXOffset-d.clientLeft;this.screen.top=box.top+window.pageYOffset-d.clientTop;this.screen.width=box.width;this.screen.height=box.height}this.radius=.5*Math.min(this.screen.width,this.screen.height);this.left0=this.object.left;this.right0=this.object.right;this.top0=this.object.top;this.bottom0=this.object.bottom};_this2.handleEvent=function(event){if(typeof this[event.type]=="function"){this[event.type](event)}};var getMouseOnScreen=function(){var vector=new THREE.Vector2;return function getMouseOnScreen(pageX,pageY){vector.set((pageX-_this.screen.left)/_this.screen.width,(pageY-_this.screen.top)/_this.screen.height);return vector}}();_this2.zoomCamera=function(){if(_state===STATE.TOUCH_ZOOM_PAN){var factor=_touchZoomDistanceEnd/_touchZoomDistanceStart;_touchZoomDistanceStart=_touchZoomDistanceEnd;_this.object.zoom*=factor;_changed=true}else{var factor=1+(_zoomEnd.y-_zoomStart.y)*_this.zoomSpeed;if(Math.abs(factor-1)>EPS&&factor>0){_this.object.zoom/=factor;if(_this.staticMoving){_zoomStart.copy(_zoomEnd)}else{_zoomStart.y+=(_zoomEnd.y-_zoomStart.y)*this.dynamicDampingFactor}_changed=true}}};_this2.panCamera=function(){var mouseChange=new THREE.Vector2,objectUp=new THREE.Vector3,pan=new THREE.Vector3;return function panCamera(){mouseChange.copy(_panEnd).sub(_panStart);if(mouseChange.lengthSq()){var scale_x=(_this.object.right-_this.object.left)/_this.object.zoom;var scale_y=(_this.object.top-_this.object.bottom)/_this.object.zoom;mouseChange.x*=scale_x;mouseChange.y*=scale_y;pan.copy(_eye).cross(_this.object.up).setLength(mouseChange.x);pan.add(objectUp.copy(_this.object.up).setLength(mouseChange.y));_this.object.position.add(pan);_this.target.add(pan);if(_this.staticMoving){_panStart.copy(_panEnd)}else{_panStart.add(mouseChange.subVectors(_panEnd,_panStart).multiplyScalar(_this.dynamicDampingFactor))}_changed=true}}}();_this2.update=function(){_eye.subVectors(_this.object.position,_this.target);if(!_this.noZoom){_this.zoomCamera();if(_changed){_this.object.updateProjectionMatrix()}}if(!_this.noPan){_this.panCamera()}_this.object.position.addVectors(_this.target,_eye);_this.object.lookAt(_this.target);if(_changed){_this.dispatchEvent(changeEvent);_changed=false}};_this2.reset=function(){_state=STATE.NONE;_prevState=STATE.NONE;_this.target.copy(_this.target0);_this.object.position.copy(_this.position0);_this.object.up.copy(_this.up0);_eye.subVectors(_this.object.position,_this.target);_this.object.left=_this.left0;_this.object.right=_this.right0;_this.object.top=_this.top0;_this.object.bottom=_this.bottom0;_this.object.lookAt(_this.target);_this.dispatchEvent(changeEvent);_changed=false};function keydown(event){if(_this.enabled===false)return;window.removeEventListener("keydown",keydown);_prevState=_state;if(_state!==STATE.NONE){return}else if(event.keyCode===_this.keys[STATE.ROTATE]&&!_this.noRotate){_state=STATE.ROTATE}else if(event.keyCode===_this.keys[STATE.ZOOM]&&!_this.noZoom){_state=STATE.ZOOM}else if(event.keyCode===_this.keys[STATE.PAN]&&!_this.noPan){_state=STATE.PAN}}function keyup(event){if(_this.enabled===false)return;_state=_prevState;window.addEventListener("keydown",keydown,false)}function mousedown(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_state===STATE.NONE){_state=event.button}if(_state===STATE.ROTATE&&!_this.noRotate){}else if(_state===STATE.ZOOM&&!_this.noZoom){_zoomStart.copy(getMouseOnScreen(event.pageX,event.pageY));_zoomEnd.copy(_zoomStart)}else if(_state===STATE.PAN&&!_this.noPan){_panStart.copy(getMouseOnScreen(event.pageX,event.pageY));_panEnd.copy(_panStart)}document.addEventListener("mousemove",mousemove,false);document.addEventListener("mouseup",mouseup,false);_this.dispatchEvent(startEvent)}function mousemove(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_state===STATE.ROTATE&&!_this.noRotate){}else if(_state===STATE.ZOOM&&!_this.noZoom){_zoomEnd.copy(getMouseOnScreen(event.pageX,event.pageY))}else if(_state===STATE.PAN&&!_this.noPan){_panEnd.copy(getMouseOnScreen(event.pageX,event.pageY))}}function mouseup(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();_state=STATE.NONE;document.removeEventListener("mousemove",mousemove);document.removeEventListener("mouseup",mouseup);_this.dispatchEvent(endEvent)}function mousewheel(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();var delta=0;if(event.wheelDelta){delta=event.wheelDelta/40}else if(event.detail){delta=-event.detail/3}_this.dispatchEvent({type:"OnScroll",delta:delta});_this.dispatchEvent(startEvent);_this.dispatchEvent(endEvent)}function touchstart(event){if(_this.enabled===false)return;switch(event.touches.length){case 1:_state=STATE.TOUCH_ROTATE;break;case 2:_state=STATE.TOUCH_ZOOM_PAN;var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=_touchZoomDistanceStart=Math.sqrt(dx*dx+dy*dy);var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panStart.copy(getMouseOnScreen(x,y));_panEnd.copy(_panStart);break;default:_state=STATE.NONE}_this.dispatchEvent(startEvent)}function touchmove(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();switch(event.touches.length){case 1:break;case 2:var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=Math.sqrt(dx*dx+dy*dy);var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));break;default:_state=STATE.NONE}}function touchend(event){if(_this.enabled===false)return;switch(event.touches.length){case 1:break;case 2:_touchZoomDistanceStart=_touchZoomDistanceEnd=0;var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));_panStart.copy(_panEnd);break}_state=STATE.NONE;_this.dispatchEvent(endEvent)}function contextmenu(event){event.preventDefault()}_this2.dispose=function(){this.domElement.removeEventListener("contextmenu",contextmenu,false);this.domElement.removeEventListener("mousedown",mousedown,false);this.domElement.removeEventListener("mousewheel",mousewheel,false);this.domElement.removeEventListener("MozMousePixelScroll",mousewheel,false);this.domElement.removeEventListener("touchstart",touchstart,false);this.domElement.removeEventListener("touchend",touchend,false);this.domElement.removeEventListener("touchmove",touchmove,false);document.removeEventListener("mousemove",mousemove,false);document.removeEventListener("mouseup",mouseup,false);window.removeEventListener("keydown",keydown,false);window.removeEventListener("keyup",keyup,false)};_this2.domElement.addEventListener("contextmenu",contextmenu,false);_this2.domElement.addEventListener("mousedown",mousedown,false);_this2.domElement.addEventListener("mousewheel",mousewheel,false);_this2.domElement.addEventListener("MozMousePixelScroll",mousewheel,false);_this2.domElement.addEventListener("touchstart",touchstart,false);_this2.domElement.addEventListener("touchend",touchend,false); -_this2.domElement.addEventListener("touchmove",touchmove,false);window.addEventListener("keydown",keydown,false);window.addEventListener("keyup",keyup,false);_this2.handleResize();_this2.update();return _this2}return Trackballortho}(THREE.EventDispatcher);exports.default=Trackballortho},{}],92:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i=bbox.min.x-epsilon&&point.y>=bbox.min.y-epsilon&&point.z>=bbox.min.z-epsilon&&point.x<=bbox.max.x+epsilon&&point.y<=bbox.max.y+epsilon&&point.z<=bbox.max.z+epsilon){return true}return false}},{key:"posdir",value:function posdir(position,direction){return{position:position,direction:direction}}},{key:"validatePlane",value:function validatePlane(plane){if(plane===null){window.console.log("Invalid plane.");window.console.log(plane);return false}if(!_core4.default.vector3(plane.position)){window.console.log("Invalid plane.position.");window.console.log(plane.position);return false}if(!_core4.default.vector3(plane.direction)){window.console.log("Invalid plane.direction.");window.console.log(plane.direction);return false}return true}},{key:"validateAabb",value:function validateAabb(aabb){if(aabb===null){window.console.log("Invalid aabb.");window.console.log(aabb);return false}if(!_core4.default.matrix4(aabb.toAABB)){window.console.log("Invalid aabb.toAABB: ");window.console.log(aabb.toAABB);return false}if(!_core4.default.vector3(aabb.center)){window.console.log("Invalid aabb.center.");window.console.log(aabb.center);return false}if(!(_core4.default.vector3(aabb.halfDimensions)&&aabb.halfDimensions.x>=0&&aabb.halfDimensions.y>=0&&aabb.halfDimensions.z>=0)){window.console.log("Invalid aabb.halfDimensions.");window.console.log(aabb.halfDimensions);return false}return true}}]);return Intersections}();exports.default=Intersections},{"./core.utils":95,"./core.validators":96}],93:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _core=require("./core.intersections");var _core2=_interopRequireDefault(_core);var _core3=require("./core.pack");var _core4=_interopRequireDefault(_core3);var _core5=require("./core.validators");var _core6=_interopRequireDefault(_core5);var _core7=require("./core.utils");var _core8=_interopRequireDefault(_core7);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Intersections:_core2.default,Utils:_core8.default,Validators:_core6.default}},{"./core.intersections":92,"./core.pack":94,"./core.utils":95,"./core.validators":96}],94:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var Pack=function Pack(){_classCallCheck(this,Pack)};exports.default=Pack},{}],95:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i=0&&halfDimensions.y>=0&&halfDimensions.z>=0)){window.console.log("halfDimensions must be >= 0.");window.console.log(halfDimensions);return false}var min=center.clone().sub(halfDimensions);var max=center.clone().add(halfDimensions);return{min:min,max:max}}},{key:"minMaxPixelData",value:function minMaxPixelData(){var pixelData=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var minMax=[65535,-32768];var numPixels=pixelData.length;for(var index=0;index=0&&objectToTest.halfDimensions.y>=0&&objectToTest.halfDimensions.z>=0)){return false}return true}},{key:"ray",value:function ray(objectToTest){if(!(objectToTest!==null&&typeof objectToTest!=="undefined"&&objectToTest.hasOwnProperty("position")&&this.vector3(objectToTest.position)&&objectToTest.hasOwnProperty("direction")&&this.vector3(objectToTest.direction))){return false}return true}}]);return Validators}();exports.default=Validators},{}],97:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _geometries=require("./geometries.slice");var _geometries2=_interopRequireDefault(_geometries);var _geometries3=require("./geometries.voxel");var _geometries4=_interopRequireDefault(_geometries3);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Slice:_geometries2.default,Voxel:_geometries4.default}},{"./geometries.slice":98,"./geometries.voxel":99}],98:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i4&&arguments[4]!==undefined?arguments[4]:new THREE.Matrix4;_classCallCheck(this,GeometriesSlice);var aabb={halfDimensions:halfDimensions,center:center,toAABB:toAABB};var plane={position:position,direction:direction};var intersections=_core2.default.aabbPlane(aabb,plane);if(intersections.length<3){window.console.log("WARNING: Less than 3 intersections between AABB and Plane.");window.console.log("AABB");window.console.log(aabb);window.console.log("Plane");window.console.log(plane);window.console.log("exiting...");throw"geometries.slice has less than 3 intersections, can not create a valid geometry."}var orderedIntersections=GeometriesSlice.orderIntersections(intersections,direction);var sliceShape=GeometriesSlice.shape(orderedIntersections);var _this=_possibleConstructorReturn(this,(GeometriesSlice.__proto__||Object.getPrototypeOf(GeometriesSlice)).call(this,sliceShape));_this.type="SliceGeometry";_this.vertices=orderedIntersections;_this.verticesNeedUpdate=true;return _this}_createClass(GeometriesSlice,null,[{key:"shape",value:function shape(points){var shape=new THREE.Shape;shape.moveTo(points[0].xy.x,points[0].xy.y);for(var l=1;l1&&arguments[1]!==undefined?arguments[1]:"default";var lutO=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"linear";var color=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[[0,0,0,0],[1,1,1,1]];var opacity=arguments.length>4&&arguments[4]!==undefined?arguments[4]:[[0,0],[1,1]];_classCallCheck(this,HelpersLut);this._containerID=containerID;this._color=color;this._lut=lut;this._luts=_defineProperty({},lut,color);this._opacity=opacity;this._lutO=lutO;this._lutsO=_defineProperty({},lutO,opacity);this.initCanvas();this.paintCanvas()}_createClass(HelpersLut,[{key:"initCanvas",value:function initCanvas(){this._canvasContainer=this.initCanvasContainer(this._containerID);this._canvasBg=this.createCanvas();this._canvasContainer.appendChild(this._canvasBg);this._canvas=this.createCanvas();this._canvasContainer.appendChild(this._canvas)}},{key:"initCanvasContainer",value:function initCanvasContainer(canvasContainerId){var canvasContainer=document.getElementById(canvasContainerId);canvasContainer.style.width="256 px";canvasContainer.style.height="128 px";canvasContainer.style.border="1px solid #F9F9F9";return canvasContainer}},{key:"createCanvas",value:function createCanvas(){var canvas=document.createElement("canvas");canvas.height=16;canvas.width=256;return canvas}},{key:"paintCanvas",value:function paintCanvas(){var ctx=this._canvas.getContext("2d");ctx.clearRect(0,0,this._canvas.width,this._canvas.height);ctx.globalCompositeOperation="source-over";var color=ctx.createLinearGradient(0,0,this._canvas.width,this._canvas.height);for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:"color";var available=[];var luts=this._luts;if(type!=="color"){luts=this._lutsO}for(var i in luts){available.push(i)}return available}},{key:"texture",get:function get(){var texture=new THREE.Texture(this._canvas);texture.mapping=THREE.UVMapping;texture.wrapS=texture.wrapT=THREE.ClampToEdgeWrapping;texture.magFilter=texture.minFilter=THREE.NearestFilter;texture.premultiplyAlpha=true;texture.needsUpdate=true;return texture}},{key:"lut",set:function set(targetLUT){this._color=this._luts[targetLUT];this._lut=targetLUT;this.paintCanvas()},get:function get(){return this._lut}},{key:"luts",set:function set(newLuts){this._luts=newLuts},get:function get(){return this._luts}},{key:"lutO",set:function set(targetLUTO){this._opacity=this._lutsO[targetLUTO];this._lutO=targetLUTO;this.paintCanvas()},get:function get(){return this._lutO}},{key:"lutsO",set:function set(newLutsO){this._lutsO=newLutsO},get:function get(){return this._lutsO}}],[{key:"presetLuts",value:function presetLuts(){return{default:[[0,0,0,0],[1,1,1,1]],spectrum:[[0,0,0,0],[.1,0,0,1],[.33,0,1,1],[.5,0,1,0],[.66,1,1,0],[.9,1,0,0],[1,1,1,1]],hot_and_cold:[[0,0,0,1],[.15,0,1,1],[.3,0,1,0],[.45,0,0,0],[.5,0,0,0],[.55,0,0,0],[.7,1,1,0],[.85,1,0,0],[1,1,1,1]],gold:[[0,0,0,0],[.13,.19,.03,0],[.25,.39,.12,0],[.38,.59,.26,0],[.5,.8,.46,.08],[.63,.99,.71,.21],[.75,.99,.88,.34],[.88,.99,.99,.48],[1,.9,.95,.61]],red:[[0,.75,0,0],[.5,1,.5,0],[.95,1,1,0],[1,1,1,1]],green:[[0,0,.75,0],[.5,.5,1,0],[.95,1,1,0],[1,1,1,1]],blue:[[0,0,0,1],[.5,0,.5,1],[.95,0,1,1],[1,1,1,1]],walking_dead:[[0,.1,1,1],[1,1,1,1]],random:[[0,0,0,0],[.27,.18,.18,.18],[.41,1,1,1],[.7,1,0,0],[1,1,1,1]]}}},{key:"presetLutsO",value:function presetLutsO(){return{linear:[[0,0],[1,1]],lowpass:[[0,.8],[.2,.6],[.3,.1],[1,0]],bandpass:[[0,0],[.4,.8],[.6,.8],[1,0]],highpass:[[0,0],[.7,.1],[.8,.6],[1,.8]],flat:[[0,.7],[1,1]],random:[[0,0],[.38,0],[.55,1],[.72,1],[1,.05]]}}}]);return HelpersLut}();exports.default=HelpersLut},{}],104:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0){progressContainers[0].parentNode.removeChild(progressContainers[0])}progressContainers=null;window.cancelAnimationFrame(this.requestAnimationFrameID)}},{key:"init",value:function init(){var progressContainer=this._domContainer();for(var mode in this._modes){if(this._modes.hasOwnProperty(mode)){var bar=this._domBar(this._modes[mode]);progressContainer.appendChild(bar);bar=null}}this._container.appendChild(progressContainer);progressContainer=null;this.updateUI()}},{key:"update",value:function update(value,total,mode){this._mode=mode;this._value=value;if(total===0){this._total=value;this._value=Math.random()*value}else{this._total=total}}},{key:"updateUI",value:function updateUI(){var _this=this;this.requestAnimationFrameID=requestAnimationFrame(function(){_this.updateUI()});if(!(this._modes.hasOwnProperty(this._mode)&&this._modes[this._mode].hasOwnProperty("name")&&this._modes[this._mode].hasOwnProperty("color"))){return false}var message="";var progress=Math.round(this._value/this._total*100);var color=this._modes[this._mode].color;var progressBar=this._container.getElementsByClassName("progress "+this._modes[this._mode].name);if(progressBar.length>0){progressBar[0].style.borderColor=color;progressBar[0].style.width=progress+"%"}progressBar=null}},{key:"_domContainer",value:function _domContainer(){var container=document.createElement("div");container.classList.add("progress");container.classList.add("container");container.style.width="100%";container.style.height="8px";container.style.position="absolute";container.style.backgroundColor="rgba(158, 158, 158, 0.5)";container.style.top="0";container.style.zIndex="1";return container}},{key:"_domBar",value:function _domBar(mode){if(!(mode.hasOwnProperty("name")&&mode.hasOwnProperty("color"))){window.console.log("Invalid mode provided.");window.console.log(mode);return false}var bar=document.createElement("div");bar.classList.add(mode.name);bar.classList.add("progress");bar.style.border="2px solid "+mode.color;bar.style.width="0%";return bar}}]);return HelpersProgressBar}();exports.default=HelpersProgressBar},{}],106:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i1&&arguments[1]!==undefined?arguments[1]:0;var position=arguments.length>2&&arguments[2]!==undefined?arguments[2]:new THREE.Vector3(0,0,0);var direction=arguments.length>3&&arguments[3]!==undefined?arguments[3]:new THREE.Vector3(0,0,1);var aabbSpace=arguments.length>4&&arguments[4]!==undefined?arguments[4]:"IJK";_classCallCheck(this,HelpersSlice);var _this=_possibleConstructorReturn(this,(HelpersSlice.__proto__||Object.getPrototypeOf(HelpersSlice)).call(this));_this._stack=stack;_this._invert=_this._stack.invert;_this._lut="none";_this._lutTexture=null;_this._intensityAuto=true;_this._interpolation=1;_this._index=index;_this._windowWidth=null;_this._windowCenter=null;_this._rescaleSlope=null;_this._rescaleIntercept=null;_this._planePosition=position;_this._planeDirection=direction;_this._aaBBspace=aabbSpace;_this._material=null;_this._textures=[];_this._shadersFragment=_shadersData6.default;_this._shadersVertex=_shadersData4.default;_this._uniforms=_shadersData2.default.uniforms();_this._geometry=null;_this._mesh=null;_this._visible=true;_this._init();_this._create();return _this}_createClass(HelpersSlice,[{key:"_init",value:function _init(){if(!this._stack||!this._stack._prepared||!this._stack._packed){return}if(this._aaBBspace==="IJK"){this._halfDimensions=this._stack.halfDimensionsIJK;this._center=new THREE.Vector3(this._stack.halfDimensionsIJK.x-.5,this._stack.halfDimensionsIJK.y-.5,this._stack.halfDimensionsIJK.z-.5);this._toAABB=new THREE.Matrix4}else{var aaBBox=this._stack.AABBox();this._halfDimensions=aaBBox.clone().multiplyScalar(.5);this._center=this._stack.centerAABBox();this._toAABB=this._stack.lps2AABB}}},{key:"_create",value:function _create(){if(!this._stack||!this._stack.prepared||!this._stack.packed){return}try{this._geometry=new _geometries2.default(this._halfDimensions,this._center,this._planePosition,this._planeDirection,this._toAABB)}catch(e){window.console.log(e);window.console.log("invalid slice geometry - exiting...");return}if(!this._geometry.vertices){return}if(!this._material){this._uniforms.uTextureSize.value=this._stack.textureSize;this._uniforms.uDataDimensions.value=[this._stack.dimensionsIJK.x,this._stack.dimensionsIJK.y,this._stack.dimensionsIJK.z];this._uniforms.uWorldToData.value=this._stack.lps2IJK;this._uniforms.uNumberOfChannels.value=this._stack.numberOfChannels;this._uniforms.uPixelType.value=this._stack.pixelType;this._uniforms.uBitsAllocated.value=this._stack.bitsAllocated;this._uniforms.uPackedPerPixel.value=this._stack.packedPerPixel;this._prepareTexture();this._uniforms.uTextureContainer.value=this._textures;this._createMaterial({side:THREE.DoubleSide})}this.updateIntensitySettings();this.updateIntensitySettingsUniforms();this._mesh=new THREE.Mesh(this._geometry,this._material);if(this._aaBBspace==="IJK"){this._mesh.applyMatrix(this._stack.ijk2LPS)}this._mesh.visible=this._visible;this.add(this._mesh)}},{key:"updateIntensitySettings",value:function updateIntensitySettings(){if(this._intensityAuto){this.updateIntensitySetting("windowCenter");this.updateIntensitySetting("windowWidth");this.updateIntensitySetting("rescaleSlope");this.updateIntensitySetting("rescaleIntercept")}else{if(this._windowCenter===null){this._windowCenter=this._stack.windowCenter}if(this.__windowWidth===null){this._windowWidth=this._stack.windowWidth}if(this._rescaleSlope===null){this._rescaleSlope=this._stack.rescaleSlope}if(this._rescaleIntercept===null){this._rescaleIntercept=this._stack.rescaleIntercept}}}},{key:"updateIntensitySettingsUniforms",value:function updateIntensitySettingsUniforms(){this._uniforms.uRescaleSlopeIntercept.value=[this._rescaleSlope,this._rescaleIntercept];this._uniforms.uWindowCenterWidth.value=[this._windowCenter,this._windowWidth];this._uniforms.uInvert.value=this._invert===true?1:0;this._uniforms.uInterpolation.value=this._interpolation;if(this._lut==="none"){this._uniforms.uLut.value=0}else{this._uniforms.uLut.value=1;this._uniforms.uTextureLUT.value=this._lutTexture}}},{key:"updateIntensitySetting",value:function updateIntensitySetting(setting){if(this._stack.frame[this._index]&&this._stack.frame[this._index][setting]){this["_"+setting]=this._stack.frame[this._index][setting]}else{this["_"+setting]=this._stack[setting]}}},{key:"_update",value:function _update(){if(this._mesh){this.remove(this._mesh);this._mesh.geometry.dispose();this._mesh.geometry=null;this._mesh=null}this._create()}},{key:"stack",get:function get(){return this._stack},set:function set(stack){this._stack=stack}},{key:"windowWidth",get:function get(){return this._windowWidth},set:function set(windowWidth){this._windowWidth=windowWidth;this.updateIntensitySettingsUniforms()}},{key:"windowCenter",get:function get(){return this._windowCenter},set:function set(windowCenter){this._windowCenter=windowCenter;this.updateIntensitySettingsUniforms()}},{key:"rescaleSlope",get:function get(){return this._rescaleSlope},set:function set(rescaleSlope){this._rescaleSlope=rescaleSlope;this.updateIntensitySettingsUniforms()}},{key:"rescaleIntercept",get:function get(){return this._rescaleIntercept},set:function set(rescaleIntercept){this._rescaleIntercept=rescaleIntercept;this.updateIntensitySettingsUniforms()}},{key:"invert",get:function get(){return this._invert},set:function set(invert){this._invert=invert;this.updateIntensitySettingsUniforms()}},{key:"lut",get:function get(){return this._lut},set:function set(lut){this._lut=lut}},{key:"lutTexture",get:function get(){return this._lutTexture},set:function set(lutTexture){this._lutTexture=lutTexture;this.updateIntensitySettingsUniforms()}},{key:"intensityAuto",get:function get(){return this._intensityAuto},set:function set(intensityAuto){this._intensityAuto=intensityAuto;this.updateIntensitySettings();this.updateIntensitySettingsUniforms()}},{key:"interpolation",get:function get(){return this._interpolation},set:function set(interpolation){this._interpolation=interpolation;this.updateIntensitySettingsUniforms();this._updateMaterial()}},{key:"index",get:function get(){return this._index},set:function set(index){this._index=index;this._update()}},{key:"planePosition",set:function set(position){this._planePosition=position;this._update()},get:function get(){return this._planePosition}},{key:"planeDirection",set:function set(direction){this._planeDirection=direction;this._update()},get:function get(){return this._planeDirection}},{key:"halfDimensions",set:function set(halfDimensions){this._halfDimensions=halfDimensions},get:function get(){return this._halfDimensions}},{key:"center",set:function set(center){this._center=center},get:function get(){return this._center}},{key:"aabbSpace",set:function set(aabbSpace){this._aaBBspace=aabbSpace;this._init()},get:function get(){return this._aaBBspace}},{key:"mesh",set:function set(mesh){this._mesh=mesh},get:function get(){return this._mesh}},{key:"geometry",set:function set(geometry){this._geometry=geometry},get:function get(){return this._geometry}}]);return HelpersSlice}((0,_helpersMaterial2.default)(THREE.Object3D));exports.default=HelpersSlice},{"../../src/geometries/geometries.slice":98,"../../src/helpers/helpers.material.mixin":104,"../../src/shaders/shaders.data.fragment":131,"../../src/shaders/shaders.data.uniform":132,"../../src/shaders/shaders.data.vertex":133}],107:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i=dimensions||this._index<0){this._outOfBounds=true}else{this._outOfBounds=false}}},{key:"_prepareStack",value:function _prepareStack(){if(!this._stack.prepared){this._stack.prepare()}if(!this._stack.packed){this._stack.pack()}}},{key:"_prepareBBox",value:function _prepareBBox(){this._bBox=new _helpers4.default(this._stack);this.add(this._bBox)}},{key:"_prepareBorder",value:function _prepareBorder(){this._border=new _helpers2.default(this._slice);this.add(this._border)}},{key:"_prepareSlice",value:function _prepareSlice(){var halfDimensionsIJK=this._stack.halfDimensionsIJK;this._index=this._prepareSliceIndex(halfDimensionsIJK);var position=this._prepareSlicePosition(halfDimensionsIJK,this._index);var direction=this._prepareDirection(this._orientation);this._slice=new _helpers6.default(this._stack,this._index,position,direction);this.add(this._slice)}},{key:"_prepareSliceIndex",value:function _prepareSliceIndex(indices){var index=0;switch(this._orientation){case 0:index=Math.floor(indices.z);break;case 1:index=Math.floor(indices.x);break;case 2:index=Math.floor(indices.y);break;default:break}return index}},{key:"_prepareSlicePosition",value:function _prepareSlicePosition(rPosition,index){var position=new THREE.Vector3(0,0,0);switch(this._orientation){case 0:position=new THREE.Vector3(Math.floor(rPosition.x),Math.floor(rPosition.y),index);break;case 1:position=new THREE.Vector3(index,Math.floor(rPosition.y),Math.floor(rPosition.z));break;case 2:position=new THREE.Vector3(Math.floor(rPosition.x),index,Math.floor(rPosition.z));break;default:break}return position}},{key:"_prepareDirection",value:function _prepareDirection(orientation){var direction=new THREE.Vector3(0,0,1);switch(orientation){case 0:direction=new THREE.Vector3(0,0,1);break;case 1:direction=new THREE.Vector3(1,0,0);break;case 2:direction=new THREE.Vector3(0,1,0);break;default:break}return direction}},{key:"stack",get:function get(){return this._stack}},{key:"bbox",get:function get(){return this._bBox}},{key:"slice",get:function get(){return this._slice}},{key:"border",get:function get(){return this._border}},{key:"index",get:function get(){return this._index},set:function set(index){this._index=index;this._slice.index=index;var halfDimensions=this._stack.halfDimensionsIJK;this._slice.planePosition=this._prepareSlicePosition(halfDimensions,this._index);this._border.helpersSlice=this._slice;this._isIndexOutOfBounds()}},{key:"orientation",set:function set(orientation){this._orientation=orientation;this._slice.planeDirection=this._prepareDirection(this._orientation);this._border.helpersSlice=this._slice},get:function get(){return this._orientation}},{key:"outOfBounds",set:function set(outOfBounds){this._outOfBounds=outOfBounds},get:function get(){return this._outOfBounds}}]);return HelpersStack}(THREE.Object3D);exports.default=HelpersStack},{"../../src/helpers/helpers.border":100,"../../src/helpers/helpers.boundingbox":101,"../../src/helpers/helpers.slice":106}],108:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:null;var stack=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;_classCallCheck(this,HelpersVoxel);var _this=_possibleConstructorReturn(this,(HelpersVoxel.__proto__||Object.getPrototypeOf(HelpersVoxel)).call(this));_this._stack=stack;_this._worldCoordinates=worldCoordinates;_this._voxel=new _models4.default;_this._voxel.id=_this.id;_this._voxel.worldCoordinates=_this._worldCoordinates;if(_this._stack&&_this._stack.prepared&&_this._worldCoordinates){_this.updateVoxel(_this._worldCoordinates)}_this._mesh=null;_this._geometry=null;_this._material=null;_this._selected=false;_this._active=false;_this._hover=false;_this._distance=null;_this._showVoxel=true;_this._showDomSVG=true;_this._showDomMeasurements=true;_this._color="#00B0FF";_this._svgPointer=' ';_this.createMesh();return _this}_createClass(HelpersVoxel,[{key:"updateVoxel",value:function updateVoxel(worldCoordinates){this._voxel.worldCoordinates=worldCoordinates;this._voxel.dataCoordinates=_models2.default.worldToData(this._stack,this._voxel.worldCoordinates);var value=_models2.default.value(this._stack,this._voxel.dataCoordinates);this._voxel.value=_models2.default.valueRescaleSlopeIntercept(value,this._stack.rescaleSlope,this._stack.rescaleIntercept)}},{key:"updateVoxelScreenCoordinates",value:function updateVoxelScreenCoordinates(camera,container){this._voxel.screenCoordinates=HelpersVoxel.worldToScreen(this._worldCoordinates,camera,container)}},{key:"createMesh",value:function createMesh(){var dataCoordinates=_models2.default.worldToData(this._stack,this._worldCoordinates);this._geometry=new _geometries2.default(dataCoordinates);this._material=new THREE.MeshBasicMaterial({wireframe:true,wireframeLinewidth:2});this._material.color.set(this._color);this._mesh=new THREE.Mesh(this._geometry,this._material);this._mesh.applyMatrix(this._stack.ijk2LPS);this._mesh.visible=this._showVoxel;this.add(this._mesh)}},{key:"createDom",value:function createDom(){var measurementsContainer=this._createDiv("VJSVoxelMeasurements",this.id,"VJSVoxelMeasurements");var rasContainer=this._createDiv("VJSVoxelProbeWorld",this.id,"VJSVoxelProbeWorld");measurementsContainer.appendChild(rasContainer);var ijkContainer=this._createDiv("VJSVoxelProbeData",this.id,"VJSVoxelProbeData");measurementsContainer.appendChild(ijkContainer);var valueContainer=this._createDiv("VJSVoxelProbeValue",this.id,"VJSVoxelProbeValue");measurementsContainer.appendChild(valueContainer);var svgContainer=this._createDiv("VJSVoxelProbeSVG",this.id,"VJSVoxelProbeSVG");svgContainer.innerHTML=this._svgPointer;var domElement=this._createDiv("VJSWidgetVoxelProbe",this.id,"VJSWidgetVoxelProbe");domElement.appendChild(svgContainer);domElement.appendChild(measurementsContainer);return domElement}},{key:"updateDom",value:function updateDom(container){if(document.getElementById("VJSVoxelProbeWorld"+this.id)===null){container.appendChild(this.createDom())}var rasContainer=document.getElementById("VJSVoxelProbeWorld"+this.id);var rasContent=this._voxel.worldCoordinates.x.toFixed(2)+" : "+this._voxel.worldCoordinates.y.toFixed(2)+" : "+this._voxel.worldCoordinates.z.toFixed(2);rasContainer.innerHTML="LPS: "+rasContent;var ijkContainer=document.getElementById("VJSVoxelProbeData"+this.id);var ijkContent=this._voxel.dataCoordinates.x+" : "+this._voxel.dataCoordinates.y+" : "+this._voxel.dataCoordinates.z;ijkContainer.innerHTML="IJK: "+ijkContent;var valueContainer=document.getElementById("VJSVoxelProbeValue"+this.id);var valueContent=this._voxel.value;valueContainer.innerHTML="Value: "+valueContent;var selectedElement=document.getElementById("VJSWidgetVoxelProbe"+this.id);selectedElement.style.top=this._voxel.screenCoordinates.y;selectedElement.style.left=this._voxel.screenCoordinates.x;this.updateDomClass(selectedElement)}},{key:"updateDomClass",value:function updateDomClass(){var element=document.getElementById("VJSWidgetVoxelProbe"+this.id);if(this._active===true){element.classList.add("VJSVoxelProbeActive")}else{element.classList.remove("VJSVoxelProbeActive")}if(this._hover===true){element.classList.add("VJSVoxelProbeHover")}else{element.classList.remove("VJSVoxelProbeHover")}if(this._selected===true){element.classList.add("VJSVoxelProbeSelect")}else{element.classList.remove("VJSVoxelProbeSelect")}this.updateDomElementDisplay("VJSVoxelMeasurements"+this.id,this._showDomMeasurements);this.updateDomElementDisplay("VJSVoxelProbeSVG"+this.id,this._showDomSVG)}},{key:"updateDomElementDisplay",value:function updateDomElementDisplay(id,show){if(show){document.getElementById(id).style.display="block"}else{document.getElementById(id).style.display="none"}}},{key:"removeTest",value:function removeTest(){var node=document.getElementById("VJSWidgetVoxelProbe"+this.id);if(node.parentNode){node.parentNode.removeChild(node)}this.remove(this._mesh);this._mesh.geometry.dispose();this._mesh.material.dispose();this._mesh=null}},{key:"_createDiv",value:function _createDiv(idPrefix,idSuffix,className){var divContainer=document.createElement("div");divContainer.setAttribute("id",idPrefix+idSuffix);divContainer.setAttribute("class",className);return divContainer}},{key:"color",set:function set(color){this._color=color;if(this._material){this._material.color.set(this._color)}var selectedElement=document.getElementById("VJSVoxelMeasurements"+this.id);if(selectedElement){selectedElement.style.borderColor=this._color.replace("0x","#")}selectedElement=document.querySelector("#VJSVoxelProbeSVG"+this.id+"> svg > path");if(selectedElement){selectedElement.style.stroke=this._color.replace("0x","#")}},get:function get(){return this._color}},{key:"worldCoordinates",set:function set(worldCoordinates){this._worldCoordinates=worldCoordinates;this._voxel._worldCoordinates=worldCoordinates;this.updateVoxel(this._worldCoordinates);if(this._mesh&&this._mesh.geometry){this._mesh.geometry.location=this._voxel.dataCoordinates}},get:function get(){return this._worldCoordinates}},{key:"voxel",get:function get(){return this._voxel},set:function set(voxel){this._voxel=voxel}},{key:"showVoxel",set:function set(showVoxel){this._showVoxel=showVoxel;if(this._mesh){this._mesh.visible=this._showVoxel}},get:function get(){return this._showVoxel}},{key:"showDomSVG",set:function set(showDomSVG){this._showDomSVG=showDomSVG;this.updateDomClass()},get:function get(){return this._showDomSVG}},{key:"showDomMeasurements",set:function set(showDomMeasurements){this._showDomMeasurements=showDomMeasurements;this.updateDomClass()},get:function get(){return this._showDomMeasurements}},{key:"distance",set:function set(distance){this._distance=distance},get:function get(){return this._distance}},{key:"selected",set:function set(selected){this._selected=selected},get:function get(){return this._selected}},{key:"hover",set:function set(hover){this._hover=hover},get:function get(){return this._hover}},{key:"active",set:function set(active){this._active=active},get:function get(){return this._active}}],[{key:"worldToScreen",value:function worldToScreen(worldCoordinate,camera,canvas){var screenCoordinates=worldCoordinate.clone();screenCoordinates.project(camera);screenCoordinates.x=Math.round((screenCoordinates.x+1)*canvas.offsetWidth/2);screenCoordinates.y=Math.round((-screenCoordinates.y+1)*canvas.offsetHeight/2);screenCoordinates.z=0;return screenCoordinates}}]);return HelpersVoxel}(THREE.Object3D);exports.default=HelpersVoxel},{"../../src/geometries/geometries.voxel":99,"../../src/models/models.stack":117,"../../src/models/models.voxel":118}],110:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:document.body;var helpersProgress=arguments.length>1&&arguments[1]!==undefined?arguments[1]:_helpers2.default;_classCallCheck(this,LoadersBase);this._loaded=-1;this._totalLoaded=-1;this._parsed=-1;this._totalParsed=-1;this._container=container;this._helpersProgressBar=helpersProgress;this._progressBar=null;if(this._container&&this._helpersProgressBar){this._progressBar=new helpersProgress(this._container)}}_createClass(LoadersBase,[{key:"free",value:function free(){this._container=null;this._helpersProgressBar=null;if(this._progressBar){this._progressBar.free();this._progressBar=null}}},{key:"fetch",value:function fetch(url){var _this=this;return new Promise(function(resolve,reject){var request=new XMLHttpRequest;request.open("GET",url);request.crossOrigin=true;request.responseType="arraybuffer";request.onload=function(event){if(request.status===200){_this._loaded=event.loaded;_this._totalLoaded=event.total;if(_this._progressBar){_this._progressBar.update(_this._loaded,_this._totalLoaded,"load")}var buffer=request.response;var response={url:url,buffer:buffer};resolve(response)}else{reject(request.statusText)}};request.onerror=function(){reject(request.statusText)};request.onprogress=function(event){_this._loaded=event.loaded;_this._totalLoaded=event.total;if(_this._progressBar){_this._progressBar.update(_this._loaded,_this._totalLoaded,"load")}};request.send()})}}]);return LoadersBase}();exports.default=LoadersBase},{"../../src/helpers/helpers.progressbar":105,"../../src/models/models.frame":114,"../../src/models/models.series":116,"../../src/models/models.stack":117}],111:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _loaders=require("./loaders.volume");var _loaders2=_interopRequireDefault(_loaders);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Volume:_loaders2.default}},{"./loaders.volume":112}],112:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&yCos.length()>0){cosines[0]=xCos;cosines[1]=yCos;cosines[2]=new THREE.Vector3(0,0,0).crossVectors(cosines[0],cosines[1]).normalize()}}else{window.console.log("No valid image orientation for frame");window.console.log(this);window.console.log("Returning default orientation.")}if(!this._rightHanded){cosines[2].negate()}return cosines}},{key:"spacingXY",value:function spacingXY(){var spacingXY=[1,1];if(this.pixelSpacing){spacingXY[0]=this.pixelSpacing[0];spacingXY[1]=this.pixelSpacing[1]}else if(this.pixelAspectRatio){spacingXY[0]=1;spacingXY[1]=1*this.pixelAspectRatio[1]/this.pixelAspectRatio[0]}return spacingXY}},{key:"value",value:function value(column,row){return this.pixelData[column+this._columns*row]}},{key:"_compareArrays",value:function _compareArrays(reference,target){if(reference===target){return true}if(reference&&target&&reference.join()===target.join()){return true}return false}},{key:"rows",get:function get(){return this._rows},set:function set(rows){this._rows=rows}},{key:"columns",get:function get(){return this._columns},set:function set(columns){this._columns=columns}},{key:"spacingBetweenSlices",get:function get(){return this._spacingBetweenSlices},set:function set(spacingBetweenSlices){this._spacingBetweenSlices=spacingBetweenSlices}},{key:"sliceThickness",get:function get(){return this._sliceThickness},set:function set(sliceThickness){this._sliceThickness=sliceThickness}},{key:"imagePosition",get:function get(){return this._imagePosition},set:function set(imagePosition){this._imagePosition=imagePosition}},{key:"imageOrientation",get:function get(){return this._imageOrientation},set:function set(imageOrientation){this._imageOrientation=imageOrientation}},{key:"windowWidth",get:function get(){return this._windowWidth},set:function set(windowWidth){this._windowWidth=windowWidth}},{key:"windowCenter",get:function get(){return this._windowCenter},set:function set(windowCenter){this._windowCenter=windowCenter}},{key:"rescaleSlope",get:function get(){return this._rescaleSlope},set:function set(rescaleSlope){this._rescaleSlope=rescaleSlope}},{key:"rescaleIntercept",get:function get(){return this._rescaleIntercept},set:function set(rescaleIntercept){this._rescaleIntercept=rescaleIntercept}},{key:"bitsAllocated",get:function get(){return this._bitsAllocated},set:function set(bitsAllocated){this._bitsAllocated=bitsAllocated}},{key:"dist",get:function get(){return this._dist},set:function set(dist){this._dist=dist}},{key:"pixelSpacing",get:function get(){return this._pixelSpacing},set:function set(pixelSpacing){this._pixelSpacing=pixelSpacing}},{key:"pixelAspectRatio",get:function get(){return this._pixelAspectRatio},set:function set(pixelAspectRatio){this._pixelAspectRatio=pixelAspectRatio}},{key:"minMax",get:function get(){return this._minMax},set:function set(minMax){this._minMax=minMax}},{key:"dimensionIndexValues",get:function get(){return this._dimensionIndexValues},set:function set(dimensionIndexValues){this._dimensionIndexValues=dimensionIndexValues}},{key:"instanceNumber",get:function get(){return this._instanceNumber},set:function set(instanceNumber){this._instanceNumber=instanceNumber}},{key:"pixelData",get:function get(){return this._pixelData},set:function set(pixelData){this._pixelData=pixelData}},{key:"sopInstanceUID",set:function set(sopInstanceUID){this._sopInstanceUID=sopInstanceUID},get:function get(){return this._sopInstanceUID}},{key:"pixelType",get:function get(){return this._pixelType},set:function set(pixelType){this._pixelType=pixelType}},{key:"url",get:function get(){return this._url},set:function set(url){this._url=url}},{key:"referencedSegmentNumber",get:function get(){return this._referencedSegmentNumber},set:function set(referencedSegmentNumber){this._referencedSegmentNumber=referencedSegmentNumber}},{key:"rightHanded",get:function get(){return this._rightHanded},set:function set(rightHanded){this._rightHanded=rightHanded}}]);return ModelsFrame}(_models2.default);exports.default=ModelsFrame},{"../../src/models/models.base":113}],115:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _models=require("./models.frame");var _models2=_interopRequireDefault(_models);var _models3=require("./models.stack");var _models4=_interopRequireDefault(_models3);var _models5=require("./models.series");var _models6=_interopRequireDefault(_models5);var _models7=require("./models.voxel");var _models8=_interopRequireDefault(_models7);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Frame:_models2.default,Stack:_models4.default,Series:_models6.default,Voxel:_models8.default}},{"./models.frame":114,"./models.series":116,"./models.stack":117,"./models.voxel":118}],116:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0){this._numberOfFrames=this._frame.length}else{window.console.log("_frame doesn't contain anything....");window.console.log(this._frame);return false}this._rows=this._frame[0].rows;this._columns=this._frame[0].columns;this._dimensionsIJK=new THREE.Vector3(this._columns,this._rows,this._numberOfFrames);this._halfDimensionsIJK=new THREE.Vector3(this._dimensionsIJK.x/2,this._dimensionsIJK.y/2,this._dimensionsIJK.z/2);this._spacingBetweenSlices=this._frame[0].spacingBetweenSlices;this._sliceThickness=this._frame[0].sliceThickness;this.computeCosines();this.orderFrames();this.computeSpacing();if(!this._frame[0].imagePosition){this._frame[0].imagePosition=[0,0,0]}if(!this._frame[0].imageOrientation){this._frame[0].imageOrientation=[1,0,0,0,1,0]}this._origin=this._vector3FromArray(this._frame[0].imagePosition,0);this.computeIJK2LPS();this.computeLPS2AABB();this._rescaleSlope=this._frame[0].rescaleSlope||1;this._rescaleIntercept=this._frame[0].rescaleIntercept||0;this.computeMinMaxIntensities();this._minMax[0]=ModelsStack.valueRescaleSlopeIntercept(this._minMax[0],this._rescaleSlope,this._rescaleIntercept);this._minMax[1]=ModelsStack.valueRescaleSlopeIntercept(this._minMax[1],this._rescaleSlope,this._rescaleIntercept);var width=this._frame[0].windowWidth||this._minMax[1]-this._minMax[0];this._windowWidth=this._rescaleSlope*width+this._rescaleIntercept;var center=this._frame[0].windowCenter||this._minMax[0]+width/2;this._windowCenter=this._rescaleSlope*center+this._rescaleIntercept;this._bitsAllocated=this._frame[0].bitsAllocated;this._prepared=true}},{key:"packEchos",value:function packEchos(){var echos=4;var packedEcho=[];for(var i=0;i1){if(this._spacingBetweenSlices){this._spacing.z=this._spacingBetweenSlices}else if(this._frame[0].pixelSpacing&&this._frame[0].pixelSpacing[2]){this._spacing.z=this._frame[0].pixelSpacing[2]}else{this._frame.map(this._computeDistanceArrayMap.bind(null,this._zCosine));this._frame.sort(this._sortDistanceArraySort);this._spacing.z=this._frame[1].dist-this._frame[0].dist}}if(this._spacing.z===0){this._spacing.z=1}}},{key:"xySpacing",value:function xySpacing(){if(this._frame&&this._frame[0]){var spacingXY=this._frame[0].spacingXY();this._spacing.x=spacingXY[0];this._spacing.y=spacingXY[1]}}},{key:"computeMinMaxIntensities",value:function computeMinMaxIntensities(){for(var i=0;inbVoxels){voxelIndexStop=nbVoxels}for(var ii=0;iinbVoxels){voxelIndexStop=nbVoxels}}this._packed=true}},{key:"_packTo8Bits",value:function _packTo8Bits(bits,pixelType,channels,frame,textureSize,startVoxel,stopVoxel){var packed={textureType:null,data:null};var packIndex=0;var frameIndex=0;var inFrameIndex=0;var frameDimension=frame[0].rows*frame[0].columns;var data=null;if(bits===8&&channels===1||bits===1){var _data=new Uint8Array(textureSize*textureSize*1);for(var i=startVoxel;i>>8&255;packIndex++;coordinate=Math.floor(packIndex/2);channelOffset=packIndex%2}packed.textureType=THREE.RGBAFormat;packed.data=_data2}else if(bits===32&&channels===1&&pixelType===0){var _data3=new Uint8Array(textureSize*textureSize*4);for(var _i2=startVoxel;_i2>>8&255;_data3[4*packIndex+2]=_raw>>>8&255;_data3[4*packIndex+3]=_raw>>>8&255;packIndex++}packed.textureType=THREE.RGBAFormat;packed.data=_data3}else if(bits===32&&channels===1&&pixelType===1){var _data4=new Uint8Array(textureSize*textureSize*4);for(var _i3=startVoxel;_i3parseInt(b.dimensionIndexValues[i],10)){return 1}if(parseInt(a.dimensionIndexValues[i],10)=0&&ijkCoordinate.z=0&&index.y>=0&&index.z>=0&&index.x0){segmentationCodeDesignator=element.items[0].dataSet.string("x00080102");segmentationCodeValue=element.items[0].dataSet.string("x00080100");segmentationCodeMeaning=element.items[0].dataSet.string("x00080104")}return{segmentationCodeDesignator:segmentationCodeDesignator,segmentationCodeValue:segmentationCodeValue,segmentationCodeMeaning:segmentationCodeMeaning}}},{key:"_recommendedDisplayCIELab",value:function _recommendedDisplayCIELab(segment){var rawColor=String(segment.dataSet.uint16("x0062000d"));var recommendedDisplayCIELab=String("000000"+rawColor).slice(-6);return recommendedDisplayCIELab}},{key:"sopInstanceUID",value:function sopInstanceUID(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var sopInstanceUID=this._findStringEverywhere("x2005140f","x00080018",frameIndex);return sopInstanceUID}},{key:"transferSyntaxUID",value:function transferSyntaxUID(){return this._dataSet.string("x00020010")}},{key:"photometricInterpretation",value:function photometricInterpretation(){return this._dataSet.string("x00280004")}},{key:"planarConfiguration",value:function planarConfiguration(){var planarConfiguration=this._dataSet.uint16("x00280006");if(typeof planarConfiguration==="undefined"){planarConfiguration=null}return planarConfiguration}},{key:"samplesPerPixel",value:function samplesPerPixel(){return this._dataSet.uint16("x00280002")}},{key:"numberOfFrames",value:function numberOfFrames(){var numberOfFrames=this._dataSet.intString("x00280008");if(typeof numberOfFrames==="undefined"){numberOfFrames=null}return numberOfFrames}},{key:"numberOfChannels",value:function numberOfChannels(){var numberOfChannels=1;var photometricInterpretation=this.photometricInterpretation();if(!(photometricInterpretation!=="RGB"&&photometricInterpretation!=="PALETTE COLOR"&&photometricInterpretation!=="YBR_FULL"&&photometricInterpretation!=="YBR_FULL_422"&&photometricInterpretation!=="YBR_PARTIAL_422"&&photometricInterpretation!=="YBR_PARTIAL_420"&&photometricInterpretation!=="YBR_RCT")){numberOfChannels=3}return numberOfChannels}},{key:"invert",value:function invert(){var photometricInterpretation=this.photometricInterpretation();return photometricInterpretation==="MONOCHROME1"?true:false}},{key:"imageOrientation",value:function imageOrientation(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var imageOrientation=this._findStringEverywhere("x00209116","x00200037",frameIndex);if(imageOrientation){imageOrientation=imageOrientation.split("\\").map(Number)}return imageOrientation}},{key:"referencedSegmentNumber",value:function referencedSegmentNumber(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var referencedSegmentNumber=-1;var referencedSegmentNumberElement=this._findInGroupSequence("x52009230","x0062000a",frameIndex);if(referencedSegmentNumberElement!==null){referencedSegmentNumber=referencedSegmentNumberElement.uint16("x0062000b")}return referencedSegmentNumber}},{key:"pixelAspectRatio",value:function pixelAspectRatio(){var pixelAspectRatio=[this._dataSet.intString("x00280034",0),this._dataSet.intString("x00280034",1)];if(typeof pixelAspectRatio[0]==="undefined"){pixelAspectRatio=null}return pixelAspectRatio}},{key:"imagePosition",value:function imagePosition(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var imagePosition=this._findStringEverywhere("x00209113","x00200032",frameIndex); -if(imagePosition){imagePosition=imagePosition.split("\\").map(Number)}return imagePosition}},{key:"instanceNumber",value:function instanceNumber(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var instanceNumber=null;var perFrameFunctionnalGroupSequence=this._dataSet.elements.x52009230;if(typeof perFrameFunctionnalGroupSequence!=="undefined"){if(perFrameFunctionnalGroupSequence.items[frameIndex].dataSet.elements.x2005140f){var planeOrientationSequence=perFrameFunctionnalGroupSequence.items[frameIndex].dataSet.elements.x2005140f.items[0].dataSet;instanceNumber=planeOrientationSequence.intString("x00200013")}else{instanceNumber=this._dataSet.intString("x00200013");if(typeof instanceNumber==="undefined"){instanceNumber=null}}}else{instanceNumber=this._dataSet.intString("x00200013");if(typeof instanceNumber==="undefined"){instanceNumber=null}}return instanceNumber}},{key:"pixelSpacing",value:function pixelSpacing(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var pixelSpacing=this._findStringEverywhere("x00289110","x00280030",frameIndex);if(pixelSpacing){pixelSpacing=pixelSpacing.split("\\").map(Number)}return pixelSpacing}},{key:"rows",value:function rows(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var rows=this._dataSet.uint16("x00280010");if(typeof rows==="undefined"){rows=null}return rows}},{key:"columns",value:function columns(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var columns=this._dataSet.uint16("x00280011");if(typeof columns==="undefined"){columns=null}return columns}},{key:"pixelType",value:function pixelType(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return 0}},{key:"pixelRepresentation",value:function pixelRepresentation(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var pixelRepresentation=this._dataSet.uint16("x00280103");return pixelRepresentation}},{key:"bitsAllocated",value:function bitsAllocated(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var bitsAllocated=this._dataSet.uint16("x00280100");return bitsAllocated}},{key:"highBit",value:function highBit(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var highBit=this._dataSet.uint16("x00280102");return highBit}},{key:"rescaleIntercept",value:function rescaleIntercept(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._findFloatStringInFrameGroupSequence("x00289145","x00281052",frameIndex)}},{key:"rescaleSlope",value:function rescaleSlope(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._findFloatStringInFrameGroupSequence("x00289145","x00281053",frameIndex)}},{key:"windowCenter",value:function windowCenter(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._findFloatStringInFrameGroupSequence("x00289132","x00281050",frameIndex)}},{key:"windowWidth",value:function windowWidth(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._findFloatStringInFrameGroupSequence("x00289132","x00281051",frameIndex)}},{key:"sliceThickness",value:function sliceThickness(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._findFloatStringInFrameGroupSequence("x00289110","x00180050",frameIndex)}},{key:"dimensionIndexValues",value:function dimensionIndexValues(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var dimensionIndexValues=[];var perFrameFunctionnalGroupSequence=this._dataSet.elements.x52009230;if(typeof perFrameFunctionnalGroupSequence!=="undefined"){var philipsPrivateSequence=perFrameFunctionnalGroupSequence.items[frameIndex].dataSet.elements.x00209111.items[0].dataSet;var element=philipsPrivateSequence.elements.x00209157;var nbValues=element.length/4;for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:0;var inStackPositionNumber=null;var perFrameFunctionnalGroupSequence=this._dataSet.elements.x52009230;if(typeof perFrameFunctionnalGroupSequence!=="undefined"){var philipsPrivateSequence=perFrameFunctionnalGroupSequence.items[frameIndex].dataSet.elements.x00209111.items[0].dataSet;inStackPositionNumber=philipsPrivateSequence.uint32("x00209057")}else{inStackPositionNumber=null}console.log("instack position "+inStackPositionNumber);return inStackPositionNumber}},{key:"stackID",value:function stackID(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var stackID=null;var perFrameFunctionnalGroupSequence=this._dataSet.elements.x52009230;if(typeof perFrameFunctionnalGroupSequence!=="undefined"){var philipsPrivateSequence=perFrameFunctionnalGroupSequence.items[frameIndex].dataSet.elements.x00209111.items[0].dataSet;stackID=philipsPrivateSequence.intString("x00209056")}else{stackID=null}return stackID}},{key:"extractPixelData",value:function extractPixelData(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var decompressedData=this._decodePixelData(frameIndex);var numberOfChannels=this.numberOfChannels();if(numberOfChannels>1){return this._convertColorSpace(decompressedData)}else{return decompressedData}}},{key:"minMaxPixelData",value:function minMaxPixelData(){var pixelData=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var minMax=[65535,-32768];var numPixels=pixelData.length;for(var index=0;index0&&arguments[0]!==undefined?arguments[0]:0;var transferSyntaxUID=this.transferSyntaxUID();if(transferSyntaxUID==="1.2.840.10008.1.2.4.90"||transferSyntaxUID==="1.2.840.10008.1.2.4.91"){return this._decodeJ2K(frameIndex)}else if(transferSyntaxUID==="1.2.840.10008.1.2.4.57"||transferSyntaxUID==="1.2.840.10008.1.2.4.70"){return this._decodeJPEGLossless(frameIndex)}else if(transferSyntaxUID==="1.2.840.10008.1.2.4.50"||transferSyntaxUID==="1.2.840.10008.1.2.4.51"){return this._decodeJPEGBaseline(frameIndex)}else if(transferSyntaxUID==="1.2.840.10008.1.2"||transferSyntaxUID==="1.2.840.10008.1.2.1"){return this._decodeUncompressed(frameIndex)}else if(transferSyntaxUID==="1.2.840.10008.1.2.2"){var frame=this._decodeUncompressed(frameIndex);return this._swapFrame(frame)}else{throw"no decoder for transfer syntax ${transferSyntaxUID}"}}},{key:"_decodeJ2K",value:function _decodeJ2K(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var encodedPixelData=DicomParser.readEncapsulatedPixelData(this._dataSet,this._dataSet.elements.x7fe00010,frameIndex);var jpxImage=new Jpx;jpxImage.parse(encodedPixelData);var componentsCount=jpxImage.componentsCount;if(componentsCount!==1){throw"JPEG2000 decoder returned a componentCount of ${componentsCount}, when 1 is expected"}var tileCount=jpxImage.tiles.length;if(tileCount!==1){throw"JPEG2000 decoder returned a tileCount of ${tileCount}, when 1 is expected"}var tileComponents=jpxImage.tiles[0];var pixelData=tileComponents.items;return pixelData}},{key:"_decodeJPEGLossless",value:function _decodeJPEGLossless(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var encodedPixelData=DicomParser.readEncapsulatedPixelData(this._dataSet,this._dataSet.elements.x7fe00010,frameIndex);var pixelRepresentation=this.pixelRepresentation(frameIndex);var bitsAllocated=this.bitsAllocated(frameIndex);var byteOutput=bitsAllocated<=8?1:2;var decoder=new Jpeg.lossless.Decoder;var decompressedData=decoder.decode(encodedPixelData.buffer,encodedPixelData.byteOffset,encodedPixelData.length,byteOutput);if(pixelRepresentation===0){if(byteOutput===2){return new Uint16Array(decompressedData.buffer)}else{return new Uint8Array(decompressedData.buffer)}}else{return new Int16Array(decompressedData.buffer)}}},{key:"_decodeJPEGBaseline",value:function _decodeJPEGBaseline(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var encodedPixelData=DicomParser.readEncapsulatedPixelData(this._dataSet,this._dataSet.elements.x7fe00010,frameIndex);var rows=this.rows(frameIndex);var columns=this.columns(frameIndex);var bitsAllocated=this.bitsAllocated(frameIndex);var jpegBaseline=new JpegBaseline;jpegBaseline.parse(encodedPixelData);if(bitsAllocated===8){return jpegBaseline.getData(columns,rows)}else if(bitsAllocated===16){return jpegBaseline.getData16(columns,rows)}}},{key:"_decodeUncompressed",value:function _decodeUncompressed(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var pixelRepresentation=this.pixelRepresentation(frameIndex);var bitsAllocated=this.bitsAllocated(frameIndex);var pixelDataElement=this._dataSet.elements.x7fe00010;var pixelDataOffset=pixelDataElement.dataOffset;var numberOfChannels=this.numberOfChannels();var numPixels=this.rows(frameIndex)*this.columns(frameIndex)*numberOfChannels;var frameOffset=0;var buffer=this._dataSet.byteArray.buffer;if(pixelRepresentation===0&&bitsAllocated===8){frameOffset=pixelDataOffset+frameIndex*numPixels;return new Uint8Array(buffer,frameOffset,numPixels)}else if(pixelRepresentation===0&&bitsAllocated===16){frameOffset=pixelDataOffset+frameIndex*numPixels*2;return new Uint16Array(buffer,frameOffset,numPixels)}else if(pixelRepresentation===1&&bitsAllocated===16){frameOffset=pixelDataOffset+frameIndex*numPixels*2;return new Int16Array(buffer,frameOffset,numPixels)}else if(pixelRepresentation===0&&bitsAllocated===32){frameOffset=pixelDataOffset+frameIndex*numPixels*4;return new Uint32Array(buffer,frameOffset,numPixels)}else if(pixelRepresentation===0&&bitsAllocated===1){var newBuffer=new ArrayBuffer(numPixels);var newArray=new Uint8Array(newBuffer);frameOffset=pixelDataOffset+frameIndex*numPixels;var index=0;var bitStart=frameIndex*numPixels;var bitEnd=frameIndex*numPixels+numPixels;var byteStart=Math.floor(bitStart/8);var bitStartOffset=bitStart-byteStart*8;var byteEnd=Math.ceil(bitEnd/8);var targetBuffer=new Uint8Array(buffer,pixelDataOffset);for(var i=byteStart;i<=byteEnd;i++){while(bitStartOffset<8){switch(bitStartOffset){case 0:newArray[index]=targetBuffer[i]&1;break;case 1:newArray[index]=targetBuffer[i]>>>1&1;break;case 2:newArray[index]=targetBuffer[i]>>>2&1;break;case 3:newArray[index]=targetBuffer[i]>>>3&1;break;case 4:newArray[index]=targetBuffer[i]>>>4&1;break;case 5:newArray[index]=targetBuffer[i]>>>5&1;break;case 6:newArray[index]=targetBuffer[i]>>>6&1;break;case 7:newArray[index]=targetBuffer[i]>>>7&1;break;default:break}bitStartOffset++;index++;if(index>=numPixels){return newArray}}bitStartOffset=0}}}},{key:"_convertColorSpace",value:function _convertColorSpace(uncompressedData){var rgbData=null;var photometricInterpretation=this.photometricInterpretation();var planarConfiguration=this.planarConfiguration();if(photometricInterpretation==="RGB"&&planarConfiguration===0){rgbData=uncompressedData}else if(photometricInterpretation==="RGB"&&planarConfiguration===1){if(uncompressedData instanceof Int8Array){rgbData=new Int8Array(uncompressedData.length)}else if(uncompressedData instanceof Uint8Array){rgbData=new Uint8Array(uncompressedData.length)}else if(uncompressedData instanceof Int16Array){rgbData=new Int16Array(uncompressedData.length)}else if(uncompressedData instanceof Uint16Array){rgbData=new Uint16Array(uncompressedData.length)}else{throw"unsuported typed array: ${uncompressedData}"}var numPixels=uncompressedData.length/3;var rgbaIndex=0;var rIndex=0;var gIndex=numPixels;var bIndex=numPixels*2;for(var i=0;i=5){numberOfChannels=this._dataSet.dims[5];this._ordered=false}else if(this._dataSet.datatypeCode===128){numberOfChannels=3}else if(this._dataSet.datatypeCode===2304){numberOfChannels=4}return numberOfChannels}},{key:"sopInstanceUID",value:function sopInstanceUID(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return frameIndex}},{key:"rows",value:function rows(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.dims[2]}},{key:"columns",value:function columns(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.dims[1]}},{key:"pixelType",value:function pixelType(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var pixelType=0;if(this._dataSet.datatypeCode===16||this._dataSet.datatypeCode===64||this._dataSet.datatypeCode===1536){pixelType=1}return pixelType}},{key:"bitsAllocated",value:function bitsAllocated(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.numBitsPerVoxel}},{key:"pixelSpacing",value:function pixelSpacing(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return[this._dataSet.pixDims[1],this._dataSet.pixDims[2],this._dataSet.pixDims[3]]}},{key:"sliceThickness",value:function sliceThickness(){return null}},{key:"imageOrientation",value:function imageOrientation(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;if(this._dataSet.qform_code>0){var a=0,b=this._dataSet.quatern_b,c=this._dataSet.quatern_c,d=this._dataSet.quatern_d;a=1-(b*b+c*c+d*d);if(a<1e-7){a=1/Math.sqrt(b*b+c*c+d*d);b*=a;c*=a;d*=a;a=0}else{a=Math.sqrt(a)}if(this._dataSet.pixDims[0]<0){this._rightHanded=false}return[-(a*a+b*b-c*c-d*d),-2*(b*c+a*d),2*(b*d-a*c),-2*(b*c-a*d),-(a*a+c*c-b*b-d*d),2*(c*d+a*b)]}else if(this._dataSet.sform_code>0){console.log("sform > 0");var sx=this._dataSet.srow_x,sy=this._dataSet.srow_y,sz=this._dataSet.srow_z}else if(this._dataSet.qform_code===0){console.log("qform === 0")}return[1,0,0,0,1,0]}},{key:"imagePosition",value:function imagePosition(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return[-this._dataSet.qoffset_x,-this._dataSet.qoffset_y,this._dataSet.qoffset_z]}},{key:"dimensionIndexValues",value:function dimensionIndexValues(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"instanceNumber",value:function instanceNumber(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return frameIndex}},{key:"windowCenter",value:function windowCenter(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"windowWidth",value:function windowWidth(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"rescaleSlope",value:function rescaleSlope(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.scl_slope}},{key:"rescaleIntercept",value:function rescaleIntercept(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.scl_intercept}},{key:"minMaxPixelData",value:function minMaxPixelData(){var pixelData=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var minMax=[65535,-32768];var numPixels=pixelData.length;for(var index=0;index0&&arguments[0]!==undefined?arguments[0]:0;return this._decompressUncompressed(frameIndex)}},{key:"_decompressUncompressed",value:function _decompressUncompressed(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var numberOfChannels=this.numberOfChannels();var numPixels=this.rows(frameIndex)*this.columns(frameIndex)*numberOfChannels;if(!this.rightHanded()){frameIndex=this.numberOfFrames()-1-frameIndex}var frameOffset=frameIndex*numPixels;var buffer=this._niftiImage;if(!this._ordered&&this._orderedData===null){this._reorderData()}if(this._orderedData!==null){return this._orderedData.slice(frameOffset,frameOffset+numPixels)}else if(this._dataSet.datatypeCode===2){return new Uint8Array(buffer,frameOffset,numPixels)}else if(this._dataSet.datatypeCode===256){return new Int8Array(buffer,frameOffset,numPixels)}else if(this._dataSet.datatypeCode===512){frameOffset=frameOffset*2;return new Uint16Array(buffer,frameOffset,numPixels)}else if(this._dataSet.datatypeCode===4){frameOffset=frameOffset*2;return new Int16Array(buffer,frameOffset,numPixels)}else if(this._dataSet.datatypeCode===16){frameOffset=frameOffset*4;return new Float32Array(buffer,frameOffset,numPixels)}}},{key:"_reorderData",value:function _reorderData(){window.console.log("re-order");var numberOfChannels=this.numberOfChannels();var numPixels=this.rows()*this.columns()*numberOfChannels;var buffer=this._niftiImage;var totalNumPixels=numPixels*this.numberOfFrames();var tmp=null;this._orderedData=null;if(this._dataSet.datatypeCode===2){tmp=new Uint8Array(buffer,0,totalNumPixels);this._orderedData=new Uint8Array(tmp.length)}else if(this._dataSet.datatypeCode===256){tmp=new Int8Array(buffer,0,totalNumPixels);this._orderedData=new Int8Array(tmp.length)}else if(this._dataSet.datatypeCode===512){tmp=new Uint16Array(buffer,0,totalNumPixels);this._orderedData=new Uint16Array(tmp.length)}else if(this._dataSet.datatypeCode===4){tmp=new Int16Array(buffer,0,totalNumPixels);this._orderedData=new Int16Array(tmp.length)}else if(this._dataSet.datatypeCode===16){tmp=new Float32Array(buffer,0,totalNumPixels);this._orderedData=new Float32Array(tmp.length)}var numPixels2=tmp.length/3;var rgbaIndex=0;var rIndex=0;var gIndex=numPixels2;var bIndex=numPixels2*2;for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:0;return frameIndex}},{key:"rows",value:function rows(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.sizes[1]}},{key:"columns",value:function columns(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.sizes[0]}},{key:"pixelType",value:function pixelType(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var pixelType=0;if(this._dataSet.type==="float"){pixelType=1}return pixelType}},{key:"bitsAllocated",value:function bitsAllocated(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var bitsAllocated=1;if(this._dataSet.type==="int8"||this._dataSet.type==="uint8"||this._dataSet.type==="char"){bitsAllocated=8}else if(this._dataSet.type==="int16"||this._dataSet.type==="uint16"||this._dataSet.type==="short"){bitsAllocated=16}else if(this._dataSet.type==="int32"||this._dataSet.type==="uint32"||this._dataSet.type==="float"){bitsAllocated=32}return bitsAllocated}},{key:"pixelSpacing",value:function pixelSpacing(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var x=new THREE.Vector3(this._dataSet.spaceDirections[0][0],this._dataSet.spaceDirections[0][1],this._dataSet.spaceDirections[0][2]);var y=new THREE.Vector3(this._dataSet.spaceDirections[1][0],this._dataSet.spaceDirections[1][1],this._dataSet.spaceDirections[1][2]);var z=new THREE.Vector3(this._dataSet.spaceDirections[2][0],this._dataSet.spaceDirections[2][1],this._dataSet.spaceDirections[2][2]);return[x.length(),y.length(),z.length()]}},{key:"sliceThickness",value:function sliceThickness(){return null}},{key:"imageOrientation",value:function imageOrientation(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var invertX=this._dataSet.space.match(/right/)?-1:1;var invertY=this._dataSet.space.match(/anterior/)?-1:1;var x=new THREE.Vector3(this._dataSet.spaceDirections[0][0]*invertX,this._dataSet.spaceDirections[0][1]*invertY,this._dataSet.spaceDirections[0][2]);x.normalize();var y=new THREE.Vector3(this._dataSet.spaceDirections[1][0]*invertX,this._dataSet.spaceDirections[1][1]*invertY,this._dataSet.spaceDirections[1][2]);y.normalize();return[x.x,x.y,x.z,y.x,y.y,y.z]}},{key:"imagePosition",value:function imagePosition(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return[this._dataSet.spaceOrigin[0],this._dataSet.spaceOrigin[1],this._dataSet.spaceOrigin[2]]}},{key:"dimensionIndexValues",value:function dimensionIndexValues(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"instanceNumber",value:function instanceNumber(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return frameIndex}},{key:"windowCenter",value:function windowCenter(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"windowWidth",value:function windowWidth(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"rescaleSlope",value:function rescaleSlope(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return 1}},{key:"rescaleIntercept",value:function rescaleIntercept(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return 0}},{key:"minMaxPixelData",value:function minMaxPixelData(){var pixelData=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var minMax=[65535,-32768];var numPixels=pixelData.length;for(var index=0;index0&&arguments[0]!==undefined?arguments[0]:0; -return this._decompressUncompressed(frameIndex)}},{key:"_decompressUncompressed",value:function _decompressUncompressed(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var buffer=this._dataSet.buffer;var numberOfChannels=this.numberOfChannels();var numPixels=this.rows(frameIndex)*this.columns(frameIndex)*numberOfChannels;if(!this.rightHanded()){frameIndex=this.numberOfFrames()-1-frameIndex}var frameOffset=frameIndex*numPixels;if(this._unpackedData===null&&this._dataSet.encoding==="gzip"){var unpackedData=pako.inflate(this._dataSet.buffer);this._unpackedData=unpackedData.buffer;buffer=this._unpackedData}else if(this._dataSet.encoding==="gzip"){buffer=this._unpackedData}if(this._dataSet.type==="int8"||this._dataSet.type==="char"){frameOffset=frameOffset;return new Int8Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="uint8"){frameOffset=frameOffset;return new Uint8Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="int16"||this._dataSet.type==="short"){frameOffset=frameOffset*2;return new Int16Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="uint16"){frameOffset=frameOffset*2;return new Uint16Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="int32"){frameOffset=frameOffset*4;return new Int32Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="uint32"){frameOffset=frameOffset*4;return new Uint32Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="float"){frameOffset=frameOffset*4;return new Float32Array(buffer,frameOffset,numPixels)}}}]);return ParsersNifti}(_parsers2.default);exports.default=ParsersNifti},{"./parsers.volume":123,"nrrd-js":50,pako:51}],123:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i>8&255}},{key:"_swap32",value:function _swap32(val){return(val&255)<<24|(val&65280)<<8|val>>8&65280|val>>24&255}},{key:"invert",value:function invert(){return false}}]);return ParsersVolume}();exports.default=ParsersVolume},{}],124:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:this._base;var rayOrigin=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this._rayOrigin;var rayDirection=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this._rayDirection;var aabbMin=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this._aabbMin;var aabbMax=arguments.length>4&&arguments[4]!==undefined?arguments[4]:this._aabbMax;var tNear=arguments.length>5&&arguments[5]!==undefined?arguments[5]:this._tNear;var tFar=arguments.length>6&&arguments[6]!==undefined?arguments[6]:this._tFar;var intersect=arguments.length>7&&arguments[7]!==undefined?arguments[7]:this._intersect;this._base=baseFragment;return this.compute(rayOrigin,rayDirection,aabbMin,aabbMax,tNear,tFar,intersect)}},{key:"compute",value:function compute(rayOrigin,rayDirection,aabbMin,aabbMax,tNear,tFar,intersect){this.computeDefinition();this._base._functions[this._name]=this._definition;return this._name+"("+rayOrigin+", "+rayDirection+", "+aabbMin+", "+aabbMax+", "+tNear+", "+tFar+", "+intersect+");"}},{key:"computeDefinition",value:function computeDefinition(){this._definition="\nvoid "+this._name+"(vec3 rayOrigin, vec3 rayDirection, vec3 boxMin, vec3 boxMax, out float tNear, out float tFar, out bool intersect){\n // compute intersection of ray with all six bbox planes\n vec3 invRay = vec3(1.) / rayDirection;\n vec3 tBot = invRay * (boxMin - rayOrigin);\n vec3 tTop = invRay * (boxMax - rayOrigin);\n // re-order intersections to find smallest and largest on each axis\n vec3 tMin = min(tTop, tBot);\n vec3 tMax = max(tTop, tBot);\n // find the largest tMin and the smallest tMax\n float largest_tMin = max(max(tMin.x, tMin.y), max(tMin.x, tMin.z));\n float smallest_tMax = min(min(tMax.x, tMax.y), min(tMax.x, tMax.z));\n tNear = largest_tMin;\n tFar = smallest_tMax;\n intersect = smallest_tMax > largest_tMin;\n}\n\n "}}]);return IntersectBox}(_shaders2.default);exports.default=new IntersectBox},{"../shaders.base":130}],125:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:this._base;var dataCoordinates=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this._dataCoordinates;var dataValue=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this._dataValue;var offset=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this._offset;this._base=baseFragment;return this.compute(dataCoordinates,dataValue,offset)}},{key:"compute",value:function compute(dataCoordinates,dataValue,offset){this.computeDefinition();this._base._functions[this._name]=this._definition;return this._name+"("+dataCoordinates+", "+dataValue+", "+offset+");"}},{key:"computeDefinition",value:function computeDefinition(){this._definition="\nvoid "+this._name+"(in ivec3 dataCoordinates, out vec4 dataValue, out int offset){\n \n int index = dataCoordinates.x\n + dataCoordinates.y * uDataDimensions.x\n + dataCoordinates.z * uDataDimensions.y * uDataDimensions.x;\n int indexP = int(index/uPackedPerPixel);\n offset = index - 2*indexP;\n\n // Map data index to right sampler2D texture\n int voxelsPerTexture = uTextureSize*uTextureSize;\n int textureIndex = int(floor(float(indexP) / float(voxelsPerTexture)));\n // modulo seems incorrect sometimes...\n // int inTextureIndex = int(mod(float(index), float(textureSize*textureSize)));\n int inTextureIndex = indexP - voxelsPerTexture*textureIndex;\n\n // Get row and column in the texture\n int colIndex = int(mod(float(inTextureIndex), float(uTextureSize)));\n int rowIndex = int(floor(float(inTextureIndex)/float(uTextureSize)));\n\n // Map row and column to uv\n vec2 uv = vec2(0,0);\n uv.x = (0.5 + float(colIndex)) / float(uTextureSize);\n uv.y = 1. - (0.5 + float(rowIndex)) / float(uTextureSize);\n\n //\n if(textureIndex == 0){ dataValue = texture2D(uTextureContainer[0], uv); }\n else if(textureIndex == 1){dataValue = texture2D(uTextureContainer[1], uv);}\n else if(textureIndex == 2){ dataValue = texture2D(uTextureContainer[2], uv); }\n else if(textureIndex == 3){ dataValue = texture2D(uTextureContainer[3], uv); }\n else if(textureIndex == 4){ dataValue = texture2D(uTextureContainer[4], uv); }\n else if(textureIndex == 5){ dataValue = texture2D(uTextureContainer[5], uv); }\n else if(textureIndex == 6){ dataValue = texture2D(uTextureContainer[6], uv); }\n\n}\n "}}]);return Texture3d}(_shaders2.default);exports.default=new Texture3d},{"../shaders.base":130}],126:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:this._base;var packedData=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this._packedData;var offset=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this._offset;var unpackedData=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this._unpackedData;this._base=baseFragment;return this.compute(packedData,offset,unpackedData)}},{key:"compute",value:function compute(packedData,offset,unpackedData){this.computeDefinition();this._base._functions[this._name]=this._definition;return this._name+"("+packedData+", "+offset+", "+unpackedData+");"}},{key:"computeDefinition",value:function computeDefinition(){var content="";if(this._base._uniforms.uNumberOfChannels.value===1){switch(this._base._uniforms.uBitsAllocated.value){case 1:case 8:content=this.upack8();break;case 16:content=this.upack16();break;case 32:content=this.upack32();break;default:content=this.upackDefault();break}}else{content=this.upackIdentity()}this._definition="\nvoid "+this._name+"(in vec4 packedData, in int offset, out vec4 unpackedData){\n\n"+content+"\n\n} \n "}},{key:"upack8",value:function upack8(){this._base._functions["uInt8"]=this.uInt8();return"\nuInt8(\n packedData.r,\n unpackedData.x);\n "}},{key:"upack16",value:function upack16(){this._base._functions["uInt16"]=this.uInt16();return"\nuInt16(\n packedData.r * float( 1 - offset) + packedData.b * float(offset),\n packedData.g * float( 1 - offset) + packedData.a * float(offset),\n unpackedData.x);\n "}},{key:"upack32",value:function upack32(){if(this._base._uniforms.uPixelType.value===0){this._base._functions["uInt32"]=this.uInt32();return"\nuInt32(\n packedData.r,\n packedData.g,\n packedData.b,\n packedData.a,\n unpackedData.x);\n "}else{this._base._functions["uFloat32"]=this.uFloat32();return"\nuFloat32(\n packedData.r,\n packedData.g,\n packedData.b,\n packedData.a,\n unpackedData.x);\n "}}},{key:"upackIdentity",value:function upackIdentity(){return"\n\nunpackedData = packedData;\n\n "}},{key:"uInt8",value:function uInt8(){return"\nvoid uInt8(in float r, out float value){\n value = r * 256.;\n}\n "}},{key:"uInt16",value:function uInt16(){return"\nvoid uInt16(in float r, in float a, out float value){\n value = r * 256. + a * 65536.;\n}\n "}},{key:"uInt32",value:function uInt32(){return"\nvoid uInt32(in float r, in float g, in float b, in float a, out float value){\n value = r * 256. + g * 65536. + b * 16777216. + a * 4294967296.;\n}\n "}},{key:"uFloat32",value:function uFloat32(){return"\nvoid uFloat32(in float r, in float g, in float b, in float a, out float value){\n\n // create arrays containing bits for rgba values\n // value between 0 and 255\n value = r * 255.;\n int bytemeR[8];\n bytemeR[0] = int(floor(value / 128.));\n value -= float(bytemeR[0] * 128);\n bytemeR[1] = int(floor(value / 64.));\n value -= float(bytemeR[1] * 64);\n bytemeR[2] = int(floor(value / 32.));\n value -= float(bytemeR[2] * 32);\n bytemeR[3] = int(floor(value / 16.));\n value -= float(bytemeR[3] * 16);\n bytemeR[4] = int(floor(value / 8.));\n value -= float(bytemeR[4] * 8);\n bytemeR[5] = int(floor(value / 4.));\n value -= float(bytemeR[5] * 4);\n bytemeR[6] = int(floor(value / 2.));\n value -= float(bytemeR[6] * 2);\n bytemeR[7] = int(floor(value));\n\n value = g * 255.;\n int bytemeG[8];\n bytemeG[0] = int(floor(value / 128.));\n value -= float(bytemeG[0] * 128);\n bytemeG[1] = int(floor(value / 64.));\n value -= float(bytemeG[1] * 64);\n bytemeG[2] = int(floor(value / 32.));\n value -= float(bytemeG[2] * 32);\n bytemeG[3] = int(floor(value / 16.));\n value -= float(bytemeG[3] * 16);\n bytemeG[4] = int(floor(value / 8.));\n value -= float(bytemeG[4] * 8);\n bytemeG[5] = int(floor(value / 4.));\n value -= float(bytemeG[5] * 4);\n bytemeG[6] = int(floor(value / 2.));\n value -= float(bytemeG[6] * 2);\n bytemeG[7] = int(floor(value));\n\n value = b * 255.;\n int bytemeB[8];\n bytemeB[0] = int(floor(value / 128.));\n value -= float(bytemeB[0] * 128);\n bytemeB[1] = int(floor(value / 64.));\n value -= float(bytemeB[1] * 64);\n bytemeB[2] = int(floor(value / 32.));\n value -= float(bytemeB[2] * 32);\n bytemeB[3] = int(floor(value / 16.));\n value -= float(bytemeB[3] * 16);\n bytemeB[4] = int(floor(value / 8.));\n value -= float(bytemeB[4] * 8);\n bytemeB[5] = int(floor(value / 4.));\n value -= float(bytemeB[5] * 4);\n bytemeB[6] = int(floor(value / 2.));\n value -= float(bytemeB[6] * 2);\n bytemeB[7] = int(floor(value));\n\n value = a * 255.;\n int bytemeA[8];\n bytemeA[0] = int(floor(value / 128.));\n value -= float(bytemeA[0] * 128);\n bytemeA[1] = int(floor(value / 64.));\n value -= float(bytemeA[1] * 64);\n bytemeA[2] = int(floor(value / 32.));\n value -= float(bytemeA[2] * 32);\n bytemeA[3] = int(floor(value / 16.));\n value -= float(bytemeA[3] * 16);\n bytemeA[4] = int(floor(value / 8.));\n value -= float(bytemeA[4] * 8);\n bytemeA[5] = int(floor(value / 4.));\n value -= float(bytemeA[5] * 4);\n bytemeA[6] = int(floor(value / 2.));\n value -= float(bytemeA[6] * 2);\n bytemeA[7] = int(floor(value));\n\n // compute float32 value from bit arrays\n\n // sign\n int issigned = 1 - 2 * bytemeR[0];\n // issigned = int(pow(-1., float(bytemeR[0])));\n\n // exponent\n int exponent = 0;\n\n exponent += bytemeR[1] * int(pow(2., 7.));\n exponent += bytemeR[2] * int(pow(2., 6.));\n exponent += bytemeR[3] * int(pow(2., 5.));\n exponent += bytemeR[4] * int(pow(2., 4.));\n exponent += bytemeR[5] * int(pow(2., 3.));\n exponent += bytemeR[6] * int(pow(2., 2.));\n exponent += bytemeR[7] * int(pow(2., 1.));\n\n exponent += bytemeG[0];\n\n\n // fraction\n float fraction = 0.;\n\n fraction = float(bytemeG[1]) * pow(2., -1.);\n fraction += float(bytemeG[2]) * pow(2., -2.);\n fraction += float(bytemeG[3]) * pow(2., -3.);\n fraction += float(bytemeG[4]) * pow(2., -4.);\n fraction += float(bytemeG[5]) * pow(2., -5.);\n fraction += float(bytemeG[6]) * pow(2., -6.);\n fraction += float(bytemeG[7]) * pow(2., -7.);\n\n fraction += float(bytemeB[0]) * pow(2., -8.);\n fraction += float(bytemeB[1]) * pow(2., -9.);\n fraction += float(bytemeB[2]) * pow(2., -10.);\n fraction += float(bytemeB[3]) * pow(2., -11.);\n fraction += float(bytemeB[4]) * pow(2., -12.);\n fraction += float(bytemeB[5]) * pow(2., -13.);\n fraction += float(bytemeB[6]) * pow(2., -14.);\n fraction += float(bytemeB[7]) * pow(2., -15.);\n\n fraction += float(bytemeA[0]) * pow(2., -16.);\n fraction += float(bytemeA[1]) * pow(2., -17.);\n fraction += float(bytemeA[2]) * pow(2., -18.);\n fraction += float(bytemeA[3]) * pow(2., -19.);\n fraction += float(bytemeA[4]) * pow(2., -20.);\n fraction += float(bytemeA[5]) * pow(2., -21.);\n fraction += float(bytemeA[6]) * pow(2., -22.);\n fraction += float(bytemeA[7]) * pow(2., -23.);\n\n value = float(issigned) * pow( 2., float(exponent - 127)) * (1. + fraction);\n}\n "}}]);return Unpack}(_shaders2.default);exports.default=new Unpack},{"../shaders.base":130}],127:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:this._base;var currentVoxel=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this._currentVoxel;var dataValue=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this._dataValue;this._base=baseFragment;return this.compute(currentVoxel,dataValue)}},{key:"compute",value:function compute(currentVoxel,dataValue){this.computeDefinition();this._base._functions[this._name]=this._definition;return this._name+"("+currentVoxel+", "+dataValue+");"}},{key:"computeDefinition",value:function computeDefinition(){this._definition="\nvoid "+this._name+"(in vec3 currentVoxel, out vec4 dataValue){\n // lower bound\n vec3 rcurrentVoxel = vec3(floor(currentVoxel.x + 0.5 ), floor(currentVoxel.y + 0.5 ), floor(currentVoxel.z + 0.5 ));\n ivec3 voxel = ivec3(int(rcurrentVoxel.x), int(rcurrentVoxel.y), int(rcurrentVoxel.z));\n\n vec4 tmp = vec4(0., 0., 0., 0.);\n int offset = 0;\n\n "+_shadersHelpers4.default.api(this._base,"voxel","tmp","offset")+"\n "+_shadersHelpers2.default.api(this._base,"tmp","offset","dataValue")+"\n}\n "}}]);return InterpolationIdentity}(_shaders2.default);exports.default=new InterpolationIdentity},{"../helpers/shaders.helpers.texture3d":125,"../helpers/shaders.helpers.unpack":126,"../shaders.base":130}],128:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _shadersInterpolation=require("./shaders.interpolation.identity");var _shadersInterpolation2=_interopRequireDefault(_shadersInterpolation);var _shadersInterpolation3=require("./shaders.interpolation.trilinear");var _shadersInterpolation4=_interopRequireDefault(_shadersInterpolation3);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function shadersInterpolation(baseFragment,currentVoxel,dataValue,gradient){switch(baseFragment._uniforms.uInterpolation.value){case 0:return _shadersInterpolation2.default.api(baseFragment,currentVoxel,dataValue);case 1:return _shadersInterpolation4.default.api(baseFragment,currentVoxel,dataValue,gradient);default:return _shadersInterpolation2.default.api(baseFragment,currentVoxel,dataValue)}}exports.default=shadersInterpolation},{"./shaders.interpolation.identity":127,"./shaders.interpolation.trilinear":129}],129:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:this._base;var currentVoxel=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this._currentVoxel;var dataValue=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this._dataValue;var gradient=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this._gradient;this._base=baseFragment;return this.compute(currentVoxel,dataValue,gradient)}},{key:"compute",value:function compute(currentVoxel,dataValue,gradient){this.computeDefinition();this._base._functions[this._name]=this._definition;return this._name+"("+currentVoxel+", "+dataValue+", "+gradient+");"}},{key:"computeDefinition",value:function computeDefinition(){this._definition="\nvoid "+this._name+"(in vec3 currentVoxel, out vec4 dataValue, out vec3 gradient){\n\n // https://en.wikipedia.org/wiki/Trilinear_interpolation\n vec3 lower_bound = vec3(floor(currentVoxel.x), floor(currentVoxel.y), floor(currentVoxel.z));\n vec3 higher_bound = lower_bound + vec3(1);\n\n float xd = ( currentVoxel.x - lower_bound.x ) / ( higher_bound.x - lower_bound.x );\n float yd = ( currentVoxel.y - lower_bound.y ) / ( higher_bound.y - lower_bound.y );\n float zd = ( currentVoxel.z - lower_bound.z ) / ( higher_bound.z - lower_bound.z );\n\n //\n // c00\n //\n\n //\n\n vec4 v000 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c000 = vec3(lower_bound.x, lower_bound.y, lower_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c000","v000")+"\n vec3 g000 = v000.r * vec3(-1., -1., -1.);\n\n //\n\n vec4 v100 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c100 = vec3(higher_bound.x, lower_bound.y, lower_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c100","v100")+"\n vec3 g100 = v100.r * vec3(1., -1., -1.);\n\n vec4 c00 = v000 * ( 1.0 - xd ) + v100 * xd;\n\n //\n // c01\n //\n vec4 v001 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c001 = vec3(lower_bound.x, lower_bound.y, higher_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c001","v001")+"\n vec3 g001 = v001.r * vec3(-1., -1., 1.);\n\n vec4 v101 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c101 = vec3(higher_bound.x, lower_bound.y, higher_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c101","v101")+"\n vec3 g101 = v101.r * vec3(1., -1., 1.);\n\n vec4 c01 = v001 * ( 1.0 - xd ) + v101 * xd;\n\n //\n // c10\n //\n vec4 v010 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c010 = vec3(lower_bound.x, higher_bound.y, lower_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c010","v010")+"\n vec3 g010 = v010.r * vec3(-1., 1., -1.);\n\n vec4 v110 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c110 = vec3(higher_bound.x, higher_bound.y, lower_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c110","v110")+"\n vec3 g110 = v110.r * vec3(1., 1., -1.);\n\n vec4 c10 = v010 * ( 1.0 - xd ) + v110 * xd;\n\n //\n // c11\n //\n vec4 v011 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c011 = vec3(lower_bound.x, higher_bound.y, higher_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c011","v011")+"\n vec3 g011 = v011.r * vec3(-1., 1., 1.);\n\n vec4 v111 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c111 = vec3(higher_bound.x, higher_bound.y, higher_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c111","v111")+"\n vec3 g111 = v111.r * vec3(1., 1., 1.);\n\n vec4 c11 = v011 * ( 1.0 - xd ) + v111 * xd;\n\n // c0 and c1\n vec4 c0 = c00 * ( 1.0 - yd) + c10 * yd;\n vec4 c1 = c01 * ( 1.0 - yd) + c11 * yd;\n\n // c\n vec4 c = c0 * ( 1.0 - zd) + c1 * zd;\n dataValue = c;\n\n // compute gradient\n gradient = g000 + g100 + g010 + g110 + g011 + g111 + g110 + g011;\n // gradientMagnitude = length(gradient);\n // // https://en.wikipedia.org/wiki/Normal_(geometry)#Transforming_normals\n // vec3 localNormal = (-1. / gradientMagnitude) * gradient;\n // normal = normalize(normalPixelToPatient"+this.id+" * localNormal);\n //normal = gradient;\n\n}\n "; -}}]);return InterpolationTrilinear}(_shaders2.default);exports.default=new InterpolationTrilinear},{"../shaders.base":130,"./shaders.interpolation.identity":127}],130:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i tFar || accumulatedAlpha >= 1.0 ) break;\n }\n\n gl_FragColor = vec4(accumulatedColor.xyz, accumulatedAlpha);\n}\n "}},{key:"compute",value:function compute(){var shaderInterpolation="";return"\n// uniforms\n"+this.uniforms()+"\n\n// varying (should fetch it from vertex directly)\nvarying vec4 vPos;\n\n// tailored functions\n"+this.functions()+"\n\n// main loop\n"+this._main+"\n "}}]);return ShadersFragment}();exports.default=ShadersFragment},{"./helpers/shaders.helpers.intersectBox":124,"./interpolation/shaders.interpolation":128}],139:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0){this._offset.copy(intersectsTarget[0].point).sub(this._mesh.position)}}else{var intersection=_core2.default.rayPlane(this._raycaster.ray,this._plane);if(intersection!==null){this._offset.copy(intersection).sub(this._plane.position)}}this.update()}}},{key:"onEnd",value:function onEnd(evt){evt.preventDefault();if(this._tracking===true){return}if(!this._dragged&&this._active){this._selected=!this._selected}this._active=false;this._dragged=false;this._controls.enabled=true;this.update()}},{key:"onMove",value:function onMove(evt){evt.preventDefault();this._mouse.set(event.clientX/this._container.offsetWidth*2-1,-(event.clientY/this._container.offsetHeight)*2+1);this._screenPosition=this.worldToScreen(this._worldPosition,this._camera,this._container);this._raycaster.setFromCamera(this._mouse,this._camera);this._raycaster.ray.position=this._raycaster.ray.origin;if(this._active){this._dragged=true;if(this._targetMesh!==null){var intersectsTarget=this._raycaster.intersectObject(this._targetMesh);if(intersectsTarget.length>0){this._worldPosition.copy(intersectsTarget[0].point.sub(this._offset))}}else{if(this._plane.direction.length()===0){this._plane.position.copy(this._worldPosition); -this._plane.direction.copy(this._camera.getWorldDirection())}var intersection=_core2.default.rayPlane(this._raycaster.ray,this._plane);if(intersection!==null){this._worldPosition.copy(intersection.sub(this._offset))}}}else{this.onHover(null);if(this._targetMesh===null){this._plane.position.copy(this._worldPosition);this._plane.direction.copy(this._camera.getWorldDirection())}}this.update()}},{key:"onHover",value:function onHover(evt){if(evt){evt.preventDefault();this.hoverDom(evt)}this.hoverMesh();this._hovered=this._meshHovered||this._domHovered;this._container.style.cursor=this._hovered?"pointer":"default"}},{key:"update",value:function update(){this.updateColor();this.updateMeshColor();this.updateMeshPosition();this.updateDOMColor();this.updateDOMPosition()}},{key:"updateMeshColor",value:function updateMeshColor(){if(this._material){this._material.color.set(this._color)}}},{key:"updateMeshPosition",value:function updateMeshPosition(){if(this._mesh){this._mesh.position.x=this._worldPosition.x;this._mesh.position.y=this._worldPosition.y;this._mesh.position.z=this._worldPosition.z}}},{key:"hoverMesh",value:function hoverMesh(){var intersectsHandle=this._raycaster.intersectObject(this._mesh);this._meshHovered=intersectsHandle.length>0}},{key:"hoverDom",value:function hoverDom(evt){this._domHovered=evt.type==="mouseenter"}},{key:"worldToScreen",value:function worldToScreen(worldCoordinate,camera,canvas){var screenCoordinates=worldCoordinate.clone();screenCoordinates.project(camera);screenCoordinates.x=Math.round((screenCoordinates.x+1)*canvas.offsetWidth/2);screenCoordinates.y=Math.round((-screenCoordinates.y+1)*canvas.offsetHeight/2);screenCoordinates.z=0;return screenCoordinates}},{key:"createMesh",value:function createMesh(){this._geometry=new THREE.SphereGeometry(2,32,32);this._material=new THREE.MeshBasicMaterial({wireframe:true,wireframeLinewidth:2});this._mesh=new THREE.Mesh(this._geometry,this._material);this._mesh.position.x=this._worldPosition.x;this._mesh.position.y=this._worldPosition.y;this._mesh.position.z=this._worldPosition.z;this._mesh.visible=true;this.updateMeshColor();this.add(this._mesh)}},{key:"createDOM",value:function createDOM(){this._dom=document.createElement("div");this._dom.setAttribute("id",this.uuid);this._dom.setAttribute("class","widgets handle");this._dom.style.border="2px solid";this._dom.style.backgroundColor="#F9F9F9";this._dom.style.color="#F9F9F9";this._dom.style.position="absolute";this._dom.style.width="12px";this._dom.style.height="12px";this._dom.style.margin="-6px";this._dom.style.borderRadius="50%";this._dom.style.transformOrigin="0 100%";var posY=this._screenPosition.y-this._container.offsetHeight;this._dom.style.transform="translate3D("+this._screenPosition.x+"px, "+posY+"px, 0)";this.updateDOMColor();this._container.appendChild(this._dom)}},{key:"updateDOMPosition",value:function updateDOMPosition(){if(this._dom){var posY=this._screenPosition.y-this._container.offsetHeight;this._dom.style.transform="translate3D("+this._screenPosition.x+"px, "+posY+"px, 0)"}}},{key:"updateDOMColor",value:function updateDOMColor(){this._dom.style.borderColor=""+this._color}},{key:"free",value:function free(){this.removeEventListeners()}},{key:"worldPosition",set:function set(worldPosition){this._worldPosition.copy(worldPosition);this._screenPosition=this.worldToScreen(this._worldPosition,this._camera,this._container);this.update()},get:function get(){return this._worldPosition}},{key:"screenPosition",set:function set(screenPosition){this._screenPosition=screenPosition},get:function get(){return this._screenPosition}},{key:"active",get:function get(){return this._active},set:function set(active){this._active=active;this._controls.enabled=!this._active;this.update()}},{key:"tracking",get:function get(){return this._tracking},set:function set(tracking){this._tracking=tracking;this.update()}}]);return WidgetsHandle}(_widgets2.default);exports.default=WidgetsHandle},{"../../src/core/core.intersections":92,"../../src/widgets/widgets.base":141}],143:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _widgets=require("./widgets.handle");var _widgets2=_interopRequireDefault(_widgets);var _widgets3=require("./widgets.voxelProbe");var _widgets4=_interopRequireDefault(_widgets3);var _widgets5=require("./widgets.ruler");var _widgets6=_interopRequireDefault(_widgets5);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Handle:_widgets2.default,VoxelProbe:_widgets4.default,Ruler:_widgets6.default}},{"./widgets.handle":142,"./widgets.ruler":144,"./widgets.voxelProbe":145}],144:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i=0){this.activateVoxel()}}}},{key:"updateRaycaster",value:function updateRaycaster(raycaster,event,container){this._mouse={x:event.clientX/container.offsetWidth*2-1,y:-(event.clientY/container.offsetHeight)*2+1,screenX:event.clientX,screenY:event.clientY};raycaster.setFromCamera(this._mouse,this._camera)}},{key:"updateColor",value:function updateColor(voxel){if(voxel._active){voxel.color=this._activeColor}else if(voxel.hover){voxel.color=this._hoverColor}else if(voxel.selected){voxel.color=this._selectedColor}else{voxel.color=this._defaultColor}}},{key:"deleteAllSelected",value:function deleteAllSelected(){var i=this._voxels.length;while(i--){var match=this._selected.indexOf(i);if(match>=0){if(this._active===i){this._active=-1}this.remove(this._voxels[i]);this._voxels[i].removeTest();this._voxels.splice(i,1)}}this._selected=[];this._closest=null}},{key:"selectVoxel",value:function selectVoxel(){var selIndex=this._selected.indexOf(this._active);if(selIndex===-1){this._selected.push(this._active);this._voxels[this._active].selected=true;this.updateColor(this._voxels[this._active])}else{this._selected.splice(selIndex,1);this._voxels[this._active].selected=false}}},{key:"activateVoxel",value:function activateVoxel(){if(this._active===-1){var intersects=this._raycaster.intersectObject(this._targetMesh);if(intersects.length>0){if(this._hover>=0||this._closest!==null&&this._voxels[this._closest].distance<10){var index=Math.max(this._hover,this._closest);this._voxels[index]._active=true;this.updateColor(this._voxels[index]);this._active=index;this._controls.enabled=false}}}else{this._voxels[this._active].active=false;this._active=-1;this._controls.enabled=true}}},{key:"createVoxel",value:function createVoxel(){if(this._hover>=0){return}var intersects=this._raycaster.intersectObject(this._targetMesh);if(intersects.length>0){var helpersVoxel=new _helpers2.default(intersects[0].point,this._stack);this.add(helpersVoxel);this._voxels.push(helpersVoxel);helpersVoxel.updateVoxelScreenCoordinates(this._camera,this._container);this.hoverVoxel(helpersVoxel,this._mouse,this._current.voxel.dataCoordinates);this.updateColor(helpersVoxel);helpersVoxel.updateDom(this._container);helpersVoxel.showVoxel=this._showVoxel;helpersVoxel.showDomSVG=this._showDomSVG;helpersVoxel.showDomMeasurements=this._showDomMeasurements}}},{key:"update",value:function update(){if(!this._targetMesh){return}var intersects=this._raycaster.intersectObject(this._targetMesh);if(intersects.length>0){this._current.worldCoordinates=intersects[0].point;this._current.updateVoxelScreenCoordinates(this._camera,this._container);this.updateColor(this._current);this._current.updateDom(this._container);this._current.showVoxel=this._showVoxel;this._current.showDomSVG=this._showDomSVG;this._current.showDomMeasurements=this._showDomMeasurements;if(this._active>=0){this._voxels[this._active].worldCoordinates=intersects[0].point}}this.updateVoxels()}},{key:"updateVoxels",value:function updateVoxels(){var hover=-1;var closest=null;for(var i=0;i=0&&distance<10){helpersVoxel.hover=true}else{helpersVoxel.hover=false}}}},{key:"showOfIntersectsFrame",value:function showOfIntersectsFrame(voxelHelper,frameIndex){if(frameIndex===voxelHelper.voxel.dataCoordinates.z||frameIndex===-1){voxelHelper._showDomSVG=true;voxelHelper._showDomMeasurements=true}else{voxelHelper._showDomSVG=false;voxelHelper._showDomMeasurements=false}}},{key:"defaultColor",set:function set(defaultColor){this._defaultColor=defaultColor;this.update()},get:function get(){return this._defaultColor}},{key:"activeColor",set:function set(activeColor){this._activeColor=activeColor;this.update()},get:function get(){return this._activeColor}},{key:"hoverColor",set:function set(hoverColor){this._hoverColor=hoverColor;this.update()},get:function get(){return this._hoverColor}},{key:"selectedColor",set:function set(selectedColor){this._selectedColor=selectedColor;this.update()},get:function get(){return this._selectedColor}},{key:"showVoxel",set:function set(showVoxel){this._showVoxel=showVoxel;this.update()},get:function get(){return this._showVoxel}},{key:"showDomSVG",set:function set(showDomSVG){this._showDomSVG=showDomSVG;this.update()},get:function get(){return this._showDomSVG}},{key:"showDomMeasurements",set:function set(showDomMeasurements){this._showDomMeasurements=showDomMeasurements;this.update()},get:function get(){return this._showDomMeasurements}}]);return WidgetsVoxelProbe}(THREE.Object3D);exports.default=WidgetsVoxelProbe},{"../../src/helpers/helpers.voxel":109}]},{},[86])(86)}); \ No newline at end of file +this.decodeStrings=!noDecode;this.defaultEncoding=options.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(er){onwrite(stream,er)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.bufferedRequestCount=0;this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function writableStateGetBuffer(){var current=this.bufferedRequest;var out=[];while(current){out.push(current);current=current.next}return out};(function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.")})}catch(_){}})();var Duplex;function Writable(options){Duplex=Duplex||require("./_stream_duplex");if(!(this instanceof Writable)&&!(this instanceof Duplex))return new Writable(options);this._writableState=new WritableState(options,this);this.writable=true;if(options){if(typeof options.write==="function")this._write=options.write;if(typeof options.writev==="function")this._writev=options.writev}Stream.call(this)}Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function writeAfterEnd(stream,cb){var er=new Error("write after end");stream.emit("error",er);processNextTick(cb,er)}function validChunk(stream,state,chunk,cb){var valid=true;var er=false;if(chunk===null){er=new TypeError("May not write null values to stream")}else if(!Buffer.isBuffer(chunk)&&typeof chunk!=="string"&&chunk!==undefined&&!state.objectMode){er=new TypeError("Invalid non-string/buffer chunk")}if(er){stream.emit("error",er);processNextTick(cb,er);valid=false}return valid}Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState;var ret=false;if(typeof encoding==="function"){cb=encoding;encoding=null}if(Buffer.isBuffer(chunk))encoding="buffer";else if(!encoding)encoding=state.defaultEncoding;if(typeof cb!=="function")cb=nop;if(state.ended)writeAfterEnd(this,cb);else if(validChunk(this,state,chunk,cb)){state.pendingcb++;ret=writeOrBuffer(this,state,chunk,encoding,cb)}return ret};Writable.prototype.cork=function(){var state=this._writableState;state.corked++};Writable.prototype.uncork=function(){var state=this._writableState;if(state.corked){state.corked--;if(!state.writing&&!state.corked&&!state.finished&&!state.bufferProcessing&&state.bufferedRequest)clearBuffer(this,state)}};Writable.prototype.setDefaultEncoding=function setDefaultEncoding(encoding){if(typeof encoding==="string")encoding=encoding.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);this._writableState.defaultEncoding=encoding;return this};function decodeChunk(state,chunk,encoding){if(!state.objectMode&&state.decodeStrings!==false&&typeof chunk==="string"){chunk=bufferShim.from(chunk,encoding)}return chunk}function writeOrBuffer(stream,state,chunk,encoding,cb){chunk=decodeChunk(state,chunk,encoding);if(Buffer.isBuffer(chunk))encoding="buffer";var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length=this.charLength-this.charReceived?this.charLength-this.charReceived:buffer.length;buffer.copy(this.charBuffer,this.charReceived,0,available);this.charReceived+=available;if(this.charReceived=55296&&charCode<=56319){this.charLength+=this.surrogateSize;charStr="";continue}this.charReceived=this.charLength=0;if(buffer.length===0){return charStr}break}this.detectIncompleteChar(buffer);var end=buffer.length;if(this.charLength){buffer.copy(this.charBuffer,0,buffer.length-this.charReceived,end);end-=this.charReceived}charStr+=buffer.toString(this.encoding,0,end);var end=charStr.length-1;var charCode=charStr.charCodeAt(end);if(charCode>=55296&&charCode<=56319){var size=this.surrogateSize;this.charLength+=size;this.charReceived+=size;this.charBuffer.copy(this.charBuffer,size,0,size);buffer.copy(this.charBuffer,0,0,size);return charStr.substring(0,end)}return charStr};StringDecoder.prototype.detectIncompleteChar=function(buffer){var i=buffer.length>=3?3:buffer.length;for(;i>0;i--){var c=buffer[buffer.length-i];if(i==1&&c>>5==6){this.charLength=2;break}if(i<=2&&c>>4==14){this.charLength=3;break}if(i<=3&&c>>3==30){this.charLength=4;break}}this.charReceived=i};StringDecoder.prototype.end=function(buffer){var res="";if(buffer&&buffer.length)res=this.write(buffer);if(this.charReceived){var cr=this.charReceived;var buf=this.charBuffer;var enc=this.encoding;res+=buf.slice(0,cr).toString(enc)}return res};function passThroughWrite(buffer){return buffer.toString(this.encoding)}function utf16DetectIncompleteChar(buffer){this.charReceived=buffer.length%2;this.charLength=this.charReceived?2:0}function base64DetectIncompleteChar(buffer){this.charReceived=buffer.length%3;this.charLength=this.charReceived?3:0}},{buffer:19}],75:[function(require,module,exports){(function(global){module.exports=deprecate;function deprecate(fn,msg){if(config("noDeprecation")){return fn}var warned=false;function deprecated(){if(!warned){if(config("throwDeprecation")){throw new Error(msg)}else if(config("traceDeprecation")){console.trace(msg)}else{console.warn(msg)}warned=true}return fn.apply(this,arguments)}return deprecated}function config(name){try{if(!global.localStorage)return false}catch(_){return false}var val=global.localStorage[name];if(null==val)return false;return String(val).toLowerCase()==="true"}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],76:[function(require,module,exports){module.exports=function isBuffer(arg){return arg&&typeof arg==="object"&&typeof arg.copy==="function"&&typeof arg.fill==="function"&&typeof arg.readUInt8==="function"}},{}],77:[function(require,module,exports){(function(process,global){var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){var objects=[];for(var i=0;i=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}});for(var x=args[i];i=3)ctx.depth=arguments[2];if(arguments.length>=4)ctx.colors=arguments[3];if(isBoolean(opts)){ctx.showHidden=opts}else if(opts){exports._extend(ctx,opts)}if(isUndefined(ctx.showHidden))ctx.showHidden=false;if(isUndefined(ctx.depth))ctx.depth=2;if(isUndefined(ctx.colors))ctx.colors=false;if(isUndefined(ctx.customInspect))ctx.customInspect=true;if(ctx.colors)ctx.stylize=stylizeWithColor;return formatValue(ctx,obj,ctx.depth)}exports.inspect=inspect;inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];if(style){return"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m"}else{return str}}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};array.forEach(function(val,idx){hash[val]=true});return hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&!(value.constructor&&value.constructor.prototype===value)){var ret=value.inspect(recurseTimes,ctx);if(!isString(ret)){ret=formatValue(ctx,ret,recurseTimes)}return ret}var primitive=formatPrimitive(ctx,value);if(primitive){return primitive}var keys=Object.keys(value);var visibleKeys=arrayToHash(keys);if(ctx.showHidden){keys=Object.getOwnPropertyNames(value)}if(isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0)){return formatError(value)}if(keys.length===0){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}if(isDate(value)){return ctx.stylize(Date.prototype.toString.call(value),"date")}if(isError(value)){return formatError(value)}}var base="",array=false,braces=["{","}"];if(isArray(value)){array=true;braces=["[","]"]}if(isFunction(value)){var n=value.name?": "+value.name:"";base=" [Function"+n+"]"}if(isRegExp(value)){base=" "+RegExp.prototype.toString.call(value)}if(isDate(value)){base=" "+Date.prototype.toUTCString.call(value)}if(isError(value)){base=" "+formatError(value)}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1]}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}else{return ctx.stylize("[Object]","special")}}ctx.seen.push(value);var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys)}else{output=keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)})}ctx.seen.pop();return reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}if(isNumber(value))return ctx.stylize(""+value,"number");if(isBoolean(value))return ctx.stylize(""+value,"boolean");if(isNull(value))return ctx.stylize("null","null")}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i-1){if(array){str=str.split("\n").map(function(line){return" "+line}).join("\n").substr(2)}else{str="\n"+str.split("\n").map(function(line){return" "+line}).join("\n")}}}else{str=ctx.stylize("[Circular]","special")}}if(isUndefined(name)){if(array&&key.match(/^\d+$/)){return str}name=JSON.stringify(""+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.substr(1,name.length-2);name=ctx.stylize(name,"name")}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,"string")}}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=output.reduce(function(prev,cur){numLinesEst++;if(cur.indexOf("\n")>=0)numLinesEst++;return prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(length>60){return braces[0]+(base===""?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]}return braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;exports.isBuffer=require("./support/isBuffer");function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var d=new Date;var time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))};exports.inherits=require("inherits");exports._extend=function(origin,add){if(!add||!isObject(add))return origin;var keys=Object.keys(add);var i=keys.length;while(i--){origin[keys[i]]=add[keys[i]]}return origin};function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":76,_process:68,inherits:27}],78:[function(require,module,exports){"use strict";var isString=require("validate.io-string-primitive");var isNonNegativeInteger=require("validate.io-nonnegative-integer");var ceil=require("math-ceil");var repeat=require("utils-repeat-string");var MAX_SAFE_INTEGER=9007199254740991;function lpad(str,len,pad){var n;var p;if(!isString(str)){throw new TypeError("invalid input argument. First argument must be a string. Value: `"+str+"`.")}if(!isNonNegativeInteger(len)){throw new TypeError("invalid input argument. Second argument must be a nonnegative integer. Value: `"+len+"`.")}if(arguments.length>2){p=pad;if(!isString(p)){throw new TypeError("invalid input argument. Third argument must be a string. Value: `"+p+"`.")}if(p.length===0){throw new RangeError("invalid input argument. Pad string must not be an empty string.")}}else{p=" "}if(len>MAX_SAFE_INTEGER){throw new RangeError("invalid input argument. Output string length exceeds maximum allowed string length.")}n=(len-str.length)/p.length;if(n<=0){return str}n=ceil(n);return repeat(p,n)+str}module.exports=lpad},{"math-ceil":41,"utils-repeat-string":79,"validate.io-nonnegative-integer":82,"validate.io-string-primitive":84}],79:[function(require,module,exports){"use strict";var isString=require("validate.io-string-primitive");var isNonNegativeInteger=require("validate.io-nonnegative-integer");var MAX_SAFE_INTEGER=9007199254740991;function repeat(str,n){var rpt;var cnt;if(!isString(str)){throw new TypeError("invalid input argument. First argument must be a string. Value: `"+str+"`.")}if(!isNonNegativeInteger(n)){throw new TypeError("invalid input argument. Second argument must be a nonnegative integer. Value: `"+n+"`.")}if(str.length===0||n===0){return""}if(str.length*n>MAX_SAFE_INTEGER){throw new RangeError("invalid input argument. Output string length exceeds maximum allowed string length.")}rpt="";cnt=n;for(;;){if((cnt&1)===1){rpt+=str}cnt>>>=1;if(cnt===0){break}str+=str}return rpt}module.exports=repeat},{"validate.io-nonnegative-integer":82,"validate.io-string-primitive":84}],80:[function(require,module,exports){"use strict";var isString=require("validate.io-string-primitive");var isNonNegativeInteger=require("validate.io-nonnegative-integer");var ceil=require("math-ceil");var repeat=require("utils-repeat-string");var MAX_SAFE_INTEGER=9007199254740991;function rpad(str,len,pad){var n;var p;if(!isString(str)){throw new TypeError("invalid input argument. First argument must be a string. Value: `"+str+"`.")}if(!isNonNegativeInteger(len)){throw new TypeError("invalid input argument. Second argument must be a nonnegative integer. Value: `"+len+"`.")}if(arguments.length>2){p=pad;if(!isString(p)){throw new TypeError("invalid input argument. Third argument must be a string. Value: `"+p+"`.")}if(p.length===0){throw new RangeError("invalid input argument. Pad string must not be an empty string.")}}else{p=" "}if(len>MAX_SAFE_INTEGER){throw new RangeError("invalid input argument. Output string length exceeds maximum allowed string length.")}n=(len-str.length)/p.length;if(n<=0){return str}n=ceil(n);return str+repeat(p,n)}module.exports=rpad},{"math-ceil":41,"utils-repeat-string":79,"validate.io-nonnegative-integer":82,"validate.io-string-primitive":84}],81:[function(require,module,exports){"use strict";var isNumber=require("validate.io-number");function isInteger(value){return isNumber(value)&&value%1===0}module.exports=isInteger},{"validate.io-number":83}],82:[function(require,module,exports){"use strict";var isInteger=require("validate.io-integer");function isNonNegativeInteger(value){return isInteger(value)&&value>=0}module.exports=isNonNegativeInteger},{"validate.io-integer":81}],83:[function(require,module,exports){"use strict";function isNumber(value){return(typeof value==="number"||Object.prototype.toString.call(value)==="[object Number]")&&value.valueOf()===value.valueOf()}module.exports=isNumber},{}],84:[function(require,module,exports){"use strict";function isString(value){return typeof value==="string"}module.exports=isString},{}],85:[function(require,module,exports){module.exports={name:"ami.js",version:"v0.0.12-dev",main:"src/ami.js",keywords:["ami","ami.js","three.js","webgl","dicom","nifti","awesome","medical","imaging","xtk","nrrd","vtk","stl","trk"],author:{name:"Nicolas Rannou",email:"nicolas@eunate.ch",url:"https://eunate.ch"},license:"Apache-2.0",repository:{type:"git",url:"https://fnndsc.github.io/ami"},config:{threeVersion:"r81",amiCDN:"https://cdn.rawgit.com/fnndsc/ami/master/build/ami.min.js",gaKey:"UA-39303022-3",transforms:"-t [babelify --presets [ es2015 ] ]"},dependencies:{"dicom-parser":"1.7.3","image-JPEG2000":"OHIF/image-JPEG2000#master","jpeg-lossless-decoder-js":"1.2.3","math-float32-to-binary-string":"^1.0.0","nrrd-js":"^0.2.1","nifti-reader-js":"v0.5.3",pako:"1.0.1"},scripts:{"dist:prepare":"node ./scripts/$npm_package_config_mode.js --dist","dist:watchAmi":"watchify -d src/ami $npm_package_config_transforms --standalone AMI -o dist/build/ami.js -v","dist:watch":"watchify $npm_package_config_target -d $npm_package_config_transforms -o dist/$npm_package_config_target -v",dist:"npm run dist:prepare --ami.js:mode=$npm_package_config_mode && (live-server dist --open=$npm_package_config_open & npm run dist:watch --ami.js:target=$npm_package_config_target)",example:"npm run clean && node ./scripts/router.js examples ",lesson:"npm run clean && mkdir dist/build && touch dist/build/ami.js && node ./scripts/router.js lessons ",demo:"node ./scripts/lessons.js --demo",lint:"eslint **/*.js --quiet","build:examples":"npm run dist:prepare --ami.js:mode=examples && find examples -name '*.js' -print0 | xargs -0 -n1 -I{} bash -c \"echo Building {}; browserify {} -d -v $npm_package_config_transforms > dist/{} \"","build:ami":"browserify src/ami.js -d -v $npm_package_config_transforms --standalone AMI > build/ami.js && uglifyjs build/ami.js -o build/ami.min.js",build:"npm run clean && cp index.html dist/index.html && npm run build:examples && npm run doc",clean:"rm -rf dist/*",test:"karma start",doc:"jsdoc -p -r -R README.md -c jsdoc.conf -d dist/doc src",ami:"npm run lint && npm run demo && npm run build:ami && npm run test",deploy:"npm run build && gh-pages -d dist"},devDependencies:{browserify:"^13.1.0","uglify-js":"^2.7.3","live-server":"^1.1.0","babel-cli":"latest",shelljs:"latest","gh-pages":"latest",eslint:"latest","babel-polyfill":"^6.13.0","babel-preset-es2015":"^6.13.2",babelify:"7.3.0",glslify:"5.1.0",jsdoc:"jsdoc3/jsdoc#master",karma:"latest",phantomjs:"latest","karma-browserify":"latest","karma-jasmine":"latest","karma-phantomjs-launcher":"latest","karma-spec-reporter":"latest","jasmine-core":"latest",watchify:"3.7.0"},engines:{node:">=6.9.0"},browserify:{transform:["babelify"]}}},{}],86:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _cameras=require("./cameras/cameras");var _cameras2=_interopRequireDefault(_cameras);var _controls=require("./controls/controls");var _controls2=_interopRequireDefault(_controls);var _core=require("./core/core");var _core2=_interopRequireDefault(_core);var _geometries=require("./geometries/geometries");var _geometries2=_interopRequireDefault(_geometries);var _helpers=require("./helpers/helpers");var _helpers2=_interopRequireDefault(_helpers);var _loaders=require("./loaders/loaders");var _loaders2=_interopRequireDefault(_loaders);var _models=require("./models/models");var _models2=_interopRequireDefault(_models);var _parsers=require("./parsers/parsers");var _parsers2=_interopRequireDefault(_parsers);var _shaders=require("./shaders/shaders");var _shaders2=_interopRequireDefault(_shaders);var _widgets=require("./widgets/widgets");var _widgets2=_interopRequireDefault(_widgets);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var pckg=require("../package.json");exports.default={Cameras:_cameras2.default,Controls:_controls2.default,Core:_core2.default,Geometries:_geometries2.default,Helpers:_helpers2.default,Loaders:_loaders2.default,Models:_models2.default,Parsers:_parsers2.default,Shaders:_shaders2.default,Widgets:_widgets2.default};window.console.log("AMI "+pckg.version+" ( ThreeJS "+pckg.config.threeVersion+")")},{"../package.json":85,"./cameras/cameras":87,"./controls/controls":89,"./core/core":94,"./geometries/geometries":98,"./helpers/helpers":103,"./loaders/loaders":112,"./models/models":116,"./parsers/parsers":121,"./shaders/shaders":135,"./widgets/widgets":144}],87:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _cameras=require("./cameras.orthographic");var _cameras2=_interopRequireDefault(_cameras);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Orthographic:_cameras2.default}},{"./cameras.orthographic":88}],88:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:null;this.center();var computedAngle=90;var clockwise=1;if(!this._fromFront){clockwise=-1}if(angle===null){computedAngle*=-clockwise;this._angle+=90}else{computedAngle=360-clockwise*(angle-this._angle);this._angle=angle}this._angle%=360;var rotation=(new THREE.Matrix4).makeRotationAxis(this._zCosine,computedAngle*Math.PI/180);this.up.applyMatrix4(rotation);this._updateMatrices()}},{key:"fitBox",value:function fitBox(){var direction=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var factor=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1.5;var zoom=1;switch(direction){case 0:zoom=factor*this._computeZoom(this._canvas.width,this._xCosine);break;case 1:zoom=factor*this._computeZoom(this._canvas.height,this._yCosine);break;case 2:zoom=factor*Math.min(this._computeZoom(this._canvas.width,this._xCosine),this._computeZoom(this._canvas.height,this._yCosine));break;default:break}if(!zoom){return false}this.zoom=zoom;this.center()}},{key:"_adjustTopDirection",value:function _adjustTopDirection(horizontalDirection,verticalDirection){var hMaxIndex=this._getMaxIndex(horizontalDirection);var vMaxIndex=this._getMaxIndex(verticalDirection);if(vMaxIndex===2&&verticalDirection.getComponent(vMaxIndex)<0||vMaxIndex===1&&verticalDirection.getComponent(vMaxIndex)>0||vMaxIndex===0&&verticalDirection.getComponent(vMaxIndex)>0){verticalDirection.negate()}return verticalDirection}},{key:"_getMaxIndex",value:function _getMaxIndex(vector){if(Math.abs(Math.round(vector.x))===1){return 0}else if(Math.abs(Math.round(vector.y))===1){return 1}else if(Math.abs(Math.round(vector.z))===1){return 2}}},{key:"_orderIntersections",value:function _orderIntersections(intersections,direction){var maxIndex=this._getMaxIndex(direction);var ordered=intersections[0].dot(direction)0)){window.console.log("Invalid dimension provided.");window.console.log(dimension);return false}var ray={position:this._box.center.clone(),direction:direction};var intersections=_core2.default.rayBox(ray,this._box);if(intersections.length<2){window.console.log("Can not adjust the camera ( < 2 intersections).");window.console.log(ray);window.console.log(this._box);return false}return dimension/intersections[0].distanceTo(intersections[1])}},{key:"_updatePositionAndTarget",value:function _updatePositionAndTarget(position,target){this.position.set(position.x,position.y,position.z);this.lookAt(target.x,target.y,target.z);this._controls.target.set(target.x,target.y,target.z)}},{key:"_updateMatrices",value:function _updateMatrices(){this._controls.update();this.updateProjectionMatrix();this.updateMatrixWorld()}},{key:"xCosine",set:function set(xCosine){this._xCosine=xCosine},get:function get(){return this._xCosine}},{key:"yCosine",set:function set(yCosine){this._yCosine=yCosine},get:function get(){return this._yCosine}},{key:"zCosine",set:function set(zCosine){this._zCosine=zCosine},get:function get(){return this._zCosine}},{key:"controls",set:function set(controls){this._controls=controls},get:function get(){return this._controls}},{key:"box",set:function set(box){this._box=box},get:function get(){return this._box}},{key:"canvas",set:function set(canvas){this._canvas=canvas;this._updateCanvas()},get:function get(){return this._canvas}},{key:"angle",set:function set(angle){this.rotate(angle)},get:function get(){return this._angle}}]);return CamerasOrthographic}(THREE.OrthographicCamera);exports.default=CamerasOrthographic},{"../core/core.intersections":93,"../core/core.validators":97}],89:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _controls=require("./controls.trackball");var _controls2=_interopRequireDefault(_controls);var _controls3=require("./controls.trackballortho");var _controls4=_interopRequireDefault(_controls3);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Trackball:_controls2.default,TrackballOrtho:_controls4.default}},{"./controls.trackball":90,"./controls.trackballortho":91}],90:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return call&&((typeof call==="undefined"?"undefined":_typeof(call))==="object"||typeof call==="function")?call:self}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+(typeof superClass==="undefined"?"undefined":_typeof(superClass)))}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass}var Trackball=function(_THREE$EventDispatche){_inherits(Trackball,_THREE$EventDispatche);function Trackball(object,domElement){_classCallCheck(this,Trackball);var _this2=_possibleConstructorReturn(this,(Trackball.__proto__||Object.getPrototypeOf(Trackball)).call(this));var _this=_this2;var STATE={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM:4,TOUCH_PAN:5,CUSTOM:99};_this2.object=object;_this2.domElement=domElement!==undefined?domElement:document;_this2.enabled=true;_this2.screen={left:0,top:0,width:0,height:0};_this2.rotateSpeed=1;_this2.zoomSpeed=1.2;_this2.panSpeed=.3;_this2.noRotate=false;_this2.noZoom=false;_this2.noPan=false;_this2.noCustom=false;_this2.forceState=-1;_this2.staticMoving=false;_this2.dynamicDampingFactor=.2;_this2.minDistance=0;_this2.maxDistance=Infinity;_this2.keys=[65,83,68];_this2.target=new THREE.Vector3;var EPS=1e-6;var lastPosition=new THREE.Vector3;var _state=STATE.NONE,_prevState=STATE.NONE,_eye=new THREE.Vector3,_movePrev=new THREE.Vector2,_moveCurr=new THREE.Vector2,_lastAxis=new THREE.Vector3,_lastAngle=0,_zoomStart=new THREE.Vector2,_zoomEnd=new THREE.Vector2,_touchZoomDistanceStart=0,_touchZoomDistanceEnd=0,_panStart=new THREE.Vector2,_panEnd=new THREE.Vector2,_customStart=new THREE.Vector2,_customEnd=new THREE.Vector2;_this2.target0=_this2.target.clone();_this2.position0=_this2.object.position.clone();_this2.up0=_this2.object.up.clone();var changeEvent={type:"change"};var startEvent={type:"start"};var endEvent={type:"end"};_this2.handleResize=function(){if(this.domElement===document){this.screen.left=0;this.screen.top=0;this.screen.width=window.innerWidth;this.screen.height=window.innerHeight}else{var box=this.domElement.getBoundingClientRect();var d=this.domElement.ownerDocument.documentElement;this.screen.left=box.left+window.pageXOffset-d.clientLeft;this.screen.top=box.top+window.pageYOffset-d.clientTop;this.screen.width=box.width;this.screen.height=box.height}};_this2.handleEvent=function(event){if(typeof this[event.type]=="function"){this[event.type](event)}};var getMouseOnScreen=function(){var vector=new THREE.Vector2;return function(pageX,pageY){vector.set((pageX-_this.screen.left)/_this.screen.width,(pageY-_this.screen.top)/_this.screen.height);return vector}}();var getMouseOnCircle=function(){var vector=new THREE.Vector2;return function(pageX,pageY){vector.set((pageX-_this.screen.width*.5-_this.screen.left)/(_this.screen.width*.5),(_this.screen.height+2*(_this.screen.top-pageY))/_this.screen.width);return vector}}();_this2.rotateCamera=function(){var axis=new THREE.Vector3,quaternion=new THREE.Quaternion,eyeDirection=new THREE.Vector3,objectUpDirection=new THREE.Vector3,objectSidewaysDirection=new THREE.Vector3,moveDirection=new THREE.Vector3,angle;return function(){moveDirection.set(_moveCurr.x-_movePrev.x,_moveCurr.y-_movePrev.y,0);angle=moveDirection.length();if(angle){_eye.copy(_this.object.position).sub(_this.target);eyeDirection.copy(_eye).normalize();objectUpDirection.copy(_this.object.up).normalize();objectSidewaysDirection.crossVectors(objectUpDirection,eyeDirection).normalize();objectUpDirection.setLength(_moveCurr.y-_movePrev.y);objectSidewaysDirection.setLength(_moveCurr.x-_movePrev.x);moveDirection.copy(objectUpDirection.add(objectSidewaysDirection));axis.crossVectors(moveDirection,_eye).normalize();angle*=_this.rotateSpeed;quaternion.setFromAxisAngle(axis,angle);_eye.applyQuaternion(quaternion);_this.object.up.applyQuaternion(quaternion);_lastAxis.copy(axis);_lastAngle=angle}else if(!_this.staticMoving&&_lastAngle){_lastAngle*=Math.sqrt(1-_this.dynamicDampingFactor);_eye.copy(_this.object.position).sub(_this.target);quaternion.setFromAxisAngle(_lastAxis,_lastAngle);_eye.applyQuaternion(quaternion);_this.object.up.applyQuaternion(quaternion)}_movePrev.copy(_moveCurr)}}();_this2.zoomCamera=function(){var factor;if(_state===STATE.TOUCH_ZOOM){factor=_touchZoomDistanceStart/_touchZoomDistanceEnd;_touchZoomDistanceStart=_touchZoomDistanceEnd;_eye.multiplyScalar(factor)}else{factor=1+(_zoomEnd.y-_zoomStart.y)*_this.zoomSpeed;if(factor!==1&&factor>0){_eye.multiplyScalar(factor);if(_this.staticMoving){_zoomStart.copy(_zoomEnd)}else{_zoomStart.y+=(_zoomEnd.y-_zoomStart.y)*this.dynamicDampingFactor}}}};_this2.panCamera=function(){var mouseChange=new THREE.Vector2,objectUp=new THREE.Vector3,pan=new THREE.Vector3;return function(){mouseChange.copy(_panEnd).sub(_panStart);if(mouseChange.lengthSq()){mouseChange.multiplyScalar(_eye.length()*_this.panSpeed);pan.copy(_eye).cross(_this.object.up).setLength(mouseChange.x);pan.add(objectUp.copy(_this.object.up).setLength(mouseChange.y));_this.object.position.add(pan);_this.target.add(pan);if(_this.staticMoving){_panStart.copy(_panEnd)}else{_panStart.add(mouseChange.subVectors(_panEnd,_panStart).multiplyScalar(_this.dynamicDampingFactor))}}}}();_this2.checkDistances=function(){if(!_this.noZoom||!_this.noPan){if(_eye.lengthSq()>_this.maxDistance*_this.maxDistance){_this.object.position.addVectors(_this.target,_eye.setLength(_this.maxDistance))}if(_eye.lengthSq()<_this.minDistance*_this.minDistance){_this.object.position.addVectors(_this.target,_eye.setLength(_this.minDistance))}}};_this2.update=function(){_eye.subVectors(_this.object.position,_this.target);if(!_this.noRotate){_this.rotateCamera()}if(!_this.noZoom){_this.zoomCamera()}if(!_this.noPan){_this.panCamera()}if(!_this.noCustom){_this.custom(_customStart,_customEnd)}_this.object.position.addVectors(_this.target,_eye);_this.checkDistances();_this.object.lookAt(_this.target);if(lastPosition.distanceToSquared(_this.object.position)>EPS){_this.dispatchEvent(changeEvent);lastPosition.copy(_this.object.position)}};_this2.reset=function(){_state=STATE.NONE;_prevState=STATE.NONE;_this.target.copy(_this.target0);_this.object.position.copy(_this.position0);_this.object.up.copy(_this.up0);_eye.subVectors(_this.object.position,_this.target);_this.object.lookAt(_this.target);_this.dispatchEvent(changeEvent);lastPosition.copy(_this.object.position)};_this2.setState=function(targetState){_this.forceState=targetState;_prevState=targetState;_state=targetState};_this2.custom=function(customStart,customEnd){};function keydown(event){if(_this.enabled===false)return;window.removeEventListener("keydown",keydown);_prevState=_state;if(_state!==STATE.NONE){return}else if(event.keyCode===_this.keys[STATE.ROTATE]&&!_this.noRotate){_state=STATE.ROTATE}else if(event.keyCode===_this.keys[STATE.ZOOM]&&!_this.noZoom){_state=STATE.ZOOM}else if(event.keyCode===_this.keys[STATE.PAN]&&!_this.noPan){_state=STATE.PAN}}function keyup(event){if(_this.enabled===false)return;_state=_prevState;window.addEventListener("keydown",keydown,false)}function mousedown(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_state===STATE.NONE){_state=event.button}if(_state===STATE.ROTATE&&!_this.noRotate){_moveCurr.copy(getMouseOnCircle(event.pageX,event.pageY));_movePrev.copy(_moveCurr)}else if(_state===STATE.ZOOM&&!_this.noZoom){_zoomStart.copy(getMouseOnScreen(event.pageX,event.pageY));_zoomEnd.copy(_zoomStart)}else if(_state===STATE.PAN&&!_this.noPan){_panStart.copy(getMouseOnScreen(event.pageX,event.pageY));_panEnd.copy(_panStart)}else if(_state===STATE.CUSTOM&&!_this.noCustom){_customStart.copy(getMouseOnScreen(event.pageX,event.pageY));_customEnd.copy(_panStart)}document.addEventListener("mousemove",mousemove,false);document.addEventListener("mouseup",mouseup,false);_this.dispatchEvent(startEvent)}function mousemove(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_state===STATE.ROTATE&&!_this.noRotate){_movePrev.copy(_moveCurr);_moveCurr.copy(getMouseOnCircle(event.pageX,event.pageY))}else if(_state===STATE.ZOOM&&!_this.noZoom){_zoomEnd.copy(getMouseOnScreen(event.pageX,event.pageY))}else if(_state===STATE.PAN&&!_this.noPan){_panEnd.copy(getMouseOnScreen(event.pageX,event.pageY))}else if(_state===STATE.CUSTOM&&!_this.noCustom){_customEnd.copy(getMouseOnScreen(event.pageX,event.pageY))}}function mouseup(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_this.forceState===-1){_state=STATE.NONE}document.removeEventListener("mousemove",mousemove);document.removeEventListener("mouseup",mouseup);_this.dispatchEvent(endEvent)}function mousewheel(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();var delta=0;if(event.wheelDelta){delta=event.wheelDelta/40}else if(event.detail){delta=-event.detail/3}if(_state!==STATE.CUSTOM){_zoomStart.y+=delta*.01}else if(_state===STATE.CUSTOM){_customStart.y+=delta*.01}_this.dispatchEvent(startEvent);_this.dispatchEvent(endEvent)}function touchstart(event){if(_this.enabled===false)return;if(_this.forceState===-1){switch(event.touches.length){case 1:_state=STATE.TOUCH_ROTATE;_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));_movePrev.copy(_moveCurr);break;case 2:_state=STATE.TOUCH_ZOOM;var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=_touchZoomDistanceStart=Math.sqrt(dx*dx+dy*dy);var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panStart.copy(getMouseOnScreen(x,y));_panEnd.copy(_panStart);break;default:_state=STATE.NONE}}else{switch(_state){case 0:_state=STATE.TOUCH_ROTATE;_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));_movePrev.copy(_moveCurr);break;case 1:case 4:if(event.touches.length>=2){_state=STATE.TOUCH_ZOOM;var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=_touchZoomDistanceStart=Math.sqrt(dx*dx+dy*dy)}else{_state=STATE.ZOOM;_zoomStart.copy(getMouseOnScreen(event.touches[0].pageX,event.touches[0].pageY));_zoomEnd.copy(_zoomStart)}break;case 2:case 5:if(event.touches.length>=2){_state=STATE.TOUCH_PAN;var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panStart.copy(getMouseOnScreen(x,y));_panEnd.copy(_panStart)}else{_state=STATE.PAN;_panStart.copy(getMouseOnScreen(event.touches[0].pageX,event.touches[0].pageY));_panEnd.copy(_panStart)}break;case 99:_state=STATE.CUSTOM;var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_customStart.copy(getMouseOnScreen(x,y));_customEnd.copy(_customStart);break;default:_state=STATE.NONE}}_this.dispatchEvent(startEvent)}function touchmove(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_this.forceState===-1){switch(event.touches.length){case 1:_movePrev.copy(_moveCurr);_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));break;case 2:var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=Math.sqrt(dx*dx+dy*dy);var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));break;default:_state=STATE.NONE}}else{switch(_state){case 0:_movePrev.copy(_moveCurr);_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));break;case 1:_zoomEnd.copy(getMouseOnScreen(event.touches[0].pageX,event.touches[0].pageY));break;case 2:_panEnd.copy(getMouseOnScreen(event.touches[0].pageX,event.touches[0].pageY));break;case 4:var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=Math.sqrt(dx*dx+dy*dy);break;case 5:var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));break;case 99:var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_customEnd.copy(getMouseOnScreen(x,y));break;default:_state=STATE.NONE}}}function touchend(event){if(_this.enabled===false)return;if(_this.forceState===-1){switch(event.touches.length){case 1:_movePrev.copy(_moveCurr);_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));break;case 2:_touchZoomDistanceStart=_touchZoomDistanceEnd=0;var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));_panStart.copy(_panEnd);break}_state=STATE.NONE}else{switch(_state){case 0:_movePrev.copy(_moveCurr);_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));break;case 1:case 2:break;case 4:_touchZoomDistanceStart=_touchZoomDistanceEnd=0;_state=STATE.ZOOM;break;case 5:if(event.touches.length>=2){var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));_panStart.copy(_panEnd)}_state=STATE.PAN;break;case 99:var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_customEnd.copy(getMouseOnScreen(x,y));_customStart.copy(_customEnd);break;default:_state=STATE.NONE}}_this.dispatchEvent(endEvent)}_this2.domElement.addEventListener("contextmenu",function(event){event.preventDefault()},false);_this2.domElement.addEventListener("mousedown",mousedown,false);_this2.domElement.addEventListener("mousewheel",mousewheel,false);_this2.domElement.addEventListener("DOMMouseScroll",mousewheel,false);_this2.domElement.addEventListener("touchstart",touchstart,false);_this2.domElement.addEventListener("touchend",touchend,false);_this2.domElement.addEventListener("touchmove",touchmove,false);window.addEventListener("keydown",keydown,false);window.addEventListener("keyup",keyup,false);_this2.handleResize();_this2.update();return _this2}return Trackball}(THREE.EventDispatcher);exports.default=Trackball},{}],91:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return call&&((typeof call==="undefined"?"undefined":_typeof(call))==="object"||typeof call==="function")?call:self}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+(typeof superClass==="undefined"?"undefined":_typeof(superClass)))}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass}var Trackballortho=function(_THREE$EventDispatche){_inherits(Trackballortho,_THREE$EventDispatche);function Trackballortho(object,domElement){var state=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{NONE:-1,ROTATE:1,ZOOM:2,PAN:0,SCROLL:4,TOUCH_ROTATE:4,TOUCH_ZOOM_PAN:5};_classCallCheck(this,Trackballortho);var _this2=_possibleConstructorReturn(this,(Trackballortho.__proto__||Object.getPrototypeOf(Trackballortho)).call(this));var _this=_this2;var STATE=state;_this2.object=object;_this2.domElement=domElement!==undefined?domElement:document;_this2.enabled=true;_this2.screen={left:0,top:0,width:0,height:0};_this2.radius=0;_this2.zoomSpeed=1.2;_this2.noZoom=false;_this2.noPan=false;_this2.staticMoving=false;_this2.dynamicDampingFactor=.2;_this2.keys=[65,83,68];_this2.target=new THREE.Vector3;var EPS=1e-6;var _changed=true;var _state=STATE.NONE,_prevState=STATE.NONE,_eye=new THREE.Vector3,_zoomStart=new THREE.Vector2,_zoomEnd=new THREE.Vector2,_touchZoomDistanceStart=0,_touchZoomDistanceEnd=0,_panStart=new THREE.Vector2,_panEnd=new THREE.Vector2;_this2.target0=_this2.target.clone();_this2.position0=_this2.object.position.clone();_this2.up0=_this2.object.up.clone();_this2.left0=_this2.object.left;_this2.right0=_this2.object.right;_this2.top0=_this2.object.top;_this2.bottom0=_this2.object.bottom;var changeEvent={type:"change"};var startEvent={type:"start"};var endEvent={type:"end"};_this2.handleResize=function(){if(this.domElement===document){this.screen.left=0;this.screen.top=0;this.screen.width=window.innerWidth;this.screen.height=window.innerHeight}else{var box=this.domElement.getBoundingClientRect();var d=this.domElement.ownerDocument.documentElement;this.screen.left=box.left+window.pageXOffset-d.clientLeft;this.screen.top=box.top+window.pageYOffset-d.clientTop;this.screen.width=box.width;this.screen.height=box.height}this.radius=.5*Math.min(this.screen.width,this.screen.height);this.left0=this.object.left;this.right0=this.object.right;this.top0=this.object.top;this.bottom0=this.object.bottom};_this2.handleEvent=function(event){if(typeof this[event.type]=="function"){this[event.type](event)}};var getMouseOnScreen=function(){var vector=new THREE.Vector2;return function getMouseOnScreen(pageX,pageY){vector.set((pageX-_this.screen.left)/_this.screen.width,(pageY-_this.screen.top)/_this.screen.height);return vector}}();_this2.zoomCamera=function(){if(_state===STATE.TOUCH_ZOOM_PAN){var factor=_touchZoomDistanceEnd/_touchZoomDistanceStart;_touchZoomDistanceStart=_touchZoomDistanceEnd;_this.object.zoom*=factor;_changed=true}else{var factor=1+(_zoomEnd.y-_zoomStart.y)*_this.zoomSpeed;if(Math.abs(factor-1)>EPS&&factor>0){_this.object.zoom/=factor;if(_this.staticMoving){_zoomStart.copy(_zoomEnd)}else{_zoomStart.y+=(_zoomEnd.y-_zoomStart.y)*this.dynamicDampingFactor}_changed=true}}};_this2.panCamera=function(){var mouseChange=new THREE.Vector2,objectUp=new THREE.Vector3,pan=new THREE.Vector3;return function panCamera(){mouseChange.copy(_panEnd).sub(_panStart);if(mouseChange.lengthSq()){var scale_x=(_this.object.right-_this.object.left)/_this.object.zoom;var scale_y=(_this.object.top-_this.object.bottom)/_this.object.zoom;mouseChange.x*=scale_x;mouseChange.y*=scale_y;pan.copy(_eye).cross(_this.object.up).setLength(mouseChange.x);pan.add(objectUp.copy(_this.object.up).setLength(mouseChange.y));_this.object.position.add(pan);_this.target.add(pan);if(_this.staticMoving){_panStart.copy(_panEnd)}else{_panStart.add(mouseChange.subVectors(_panEnd,_panStart).multiplyScalar(_this.dynamicDampingFactor))}_changed=true}}}();_this2.update=function(){_eye.subVectors(_this.object.position,_this.target);if(!_this.noZoom){_this.zoomCamera();if(_changed){_this.object.updateProjectionMatrix()}}if(!_this.noPan){_this.panCamera()}_this.object.position.addVectors(_this.target,_eye);_this.object.lookAt(_this.target);if(_changed){_this.dispatchEvent(changeEvent);_changed=false}};_this2.reset=function(){_state=STATE.NONE;_prevState=STATE.NONE;_this.target.copy(_this.target0);_this.object.position.copy(_this.position0);_this.object.up.copy(_this.up0);_eye.subVectors(_this.object.position,_this.target);_this.object.left=_this.left0;_this.object.right=_this.right0;_this.object.top=_this.top0;_this.object.bottom=_this.bottom0;_this.object.lookAt(_this.target);_this.dispatchEvent(changeEvent);_changed=false};function keydown(event){if(_this.enabled===false)return;window.removeEventListener("keydown",keydown);_prevState=_state;if(_state!==STATE.NONE){return}else if(event.keyCode===_this.keys[STATE.ROTATE]&&!_this.noRotate){_state=STATE.ROTATE}else if(event.keyCode===_this.keys[STATE.ZOOM]&&!_this.noZoom){_state=STATE.ZOOM}else if(event.keyCode===_this.keys[STATE.PAN]&&!_this.noPan){_state=STATE.PAN}}function keyup(event){if(_this.enabled===false)return;_state=_prevState;window.addEventListener("keydown",keydown,false)}function mousedown(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_state===STATE.NONE){_state=event.button}if(_state===STATE.ROTATE&&!_this.noRotate){}else if(_state===STATE.ZOOM&&!_this.noZoom){_zoomStart.copy(getMouseOnScreen(event.pageX,event.pageY));_zoomEnd.copy(_zoomStart)}else if(_state===STATE.PAN&&!_this.noPan){_panStart.copy(getMouseOnScreen(event.pageX,event.pageY));_panEnd.copy(_panStart)}document.addEventListener("mousemove",mousemove,false);document.addEventListener("mouseup",mouseup,false);_this.dispatchEvent(startEvent)}function mousemove(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_state===STATE.ROTATE&&!_this.noRotate){}else if(_state===STATE.ZOOM&&!_this.noZoom){_zoomEnd.copy(getMouseOnScreen(event.pageX,event.pageY))}else if(_state===STATE.PAN&&!_this.noPan){_panEnd.copy(getMouseOnScreen(event.pageX,event.pageY))}}function mouseup(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();_state=STATE.NONE;document.removeEventListener("mousemove",mousemove);document.removeEventListener("mouseup",mouseup);_this.dispatchEvent(endEvent)}function mousewheel(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();var delta=0;if(event.wheelDelta){delta=event.wheelDelta/40}else if(event.detail){delta=-event.detail/3}_this.dispatchEvent({type:"OnScroll",delta:delta});_this.dispatchEvent(startEvent);_this.dispatchEvent(endEvent)}function touchstart(event){if(_this.enabled===false)return;switch(event.touches.length){case 1:_state=STATE.TOUCH_ROTATE;break;case 2:_state=STATE.TOUCH_ZOOM_PAN;var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=_touchZoomDistanceStart=Math.sqrt(dx*dx+dy*dy);var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panStart.copy(getMouseOnScreen(x,y));_panEnd.copy(_panStart);break;default:_state=STATE.NONE}_this.dispatchEvent(startEvent)}function touchmove(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();switch(event.touches.length){case 1:break;case 2:var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=Math.sqrt(dx*dx+dy*dy);var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));break;default:_state=STATE.NONE}}function touchend(event){if(_this.enabled===false)return;switch(event.touches.length){case 1:break;case 2:_touchZoomDistanceStart=_touchZoomDistanceEnd=0;var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));_panStart.copy(_panEnd);break}_state=STATE.NONE;_this.dispatchEvent(endEvent)}function contextmenu(event){event.preventDefault()}_this2.dispose=function(){this.domElement.removeEventListener("contextmenu",contextmenu,false);this.domElement.removeEventListener("mousedown",mousedown,false);this.domElement.removeEventListener("mousewheel",mousewheel,false);this.domElement.removeEventListener("MozMousePixelScroll",mousewheel,false);this.domElement.removeEventListener("touchstart",touchstart,false);this.domElement.removeEventListener("touchend",touchend,false);this.domElement.removeEventListener("touchmove",touchmove,false);document.removeEventListener("mousemove",mousemove,false);document.removeEventListener("mouseup",mouseup,false);window.removeEventListener("keydown",keydown,false);window.removeEventListener("keyup",keyup,false)};_this2.domElement.addEventListener("contextmenu",contextmenu,false);_this2.domElement.addEventListener("mousedown",mousedown,false);_this2.domElement.addEventListener("mousewheel",mousewheel,false);_this2.domElement.addEventListener("MozMousePixelScroll",mousewheel,false);_this2.domElement.addEventListener("touchstart",touchstart,false);_this2.domElement.addEventListener("touchend",touchend,false); +_this2.domElement.addEventListener("touchmove",touchmove,false);window.addEventListener("keydown",keydown,false);window.addEventListener("keyup",keyup,false);_this2.handleResize();_this2.update();return _this2}return Trackballortho}(THREE.EventDispatcher);exports.default=Trackballortho},{}],92:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i.008856){y=Math.pow(y,3)}else{y=(y-16/116)/7.787}if(Math.pow(x,3)>.008856){x=Math.pow(x,3)}else{x=(x-16/116)/7.787}if(Math.pow(z,3)>.008856){z=Math.pow(z,3)}else{z=(z-16/116)/7.787}return[refX*x,refY*y,refZ*z]}},{key:"xyz2RGB",value:function xyz2RGB(x,y,z){x/=100;y/=100;z/=100;var r=x*3.2406+y*-1.5372+z*-.4986;var g=x*-.9689+y*1.8758+z*.0415;var b=x*.0557+y*-.204+z*1.057;if(r>.0031308){r=1.055*Math.pow(r,1/2.4)-.055}else{r=12.92*r}if(g>.0031308){g=1.055*Math.pow(g,1/2.4)-.055}else{g=12.92*g}if(b>.0031308){b=1.055*Math.pow(b,1/2.4)-.055}else{b=12.92*b}r=r*255;g=g*255;b=b*255;return[r,g,b]}},{key:"cielab2RGB",value:function cielab2RGB(){var l=arguments.length>0&&arguments[0]!==undefined?arguments[0]:50;var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var b=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;if(!(l>=0&&l<=100)){return null}var xyz=this.cielab2XYZ(l,a,b);return this.xyz2RGB.apply(this,_toConsumableArray(xyz))}}]);return Colors}();exports.default=Colors},{}],93:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i=bbox.min.x-epsilon&&point.y>=bbox.min.y-epsilon&&point.z>=bbox.min.z-epsilon&&point.x<=bbox.max.x+epsilon&&point.y<=bbox.max.y+epsilon&&point.z<=bbox.max.z+epsilon){return true}return false}},{key:"posdir",value:function posdir(position,direction){return{position:position,direction:direction}}},{key:"validatePlane",value:function validatePlane(plane){if(plane===null){window.console.log("Invalid plane.");window.console.log(plane);return false}if(!_core4.default.vector3(plane.position)){window.console.log("Invalid plane.position.");window.console.log(plane.position);return false}if(!_core4.default.vector3(plane.direction)){window.console.log("Invalid plane.direction.");window.console.log(plane.direction);return false}return true}},{key:"validateAabb",value:function validateAabb(aabb){if(aabb===null){window.console.log("Invalid aabb.");window.console.log(aabb);return false}if(!_core4.default.matrix4(aabb.toAABB)){window.console.log("Invalid aabb.toAABB: ");window.console.log(aabb.toAABB);return false}if(!_core4.default.vector3(aabb.center)){window.console.log("Invalid aabb.center.");window.console.log(aabb.center);return false}if(!(_core4.default.vector3(aabb.halfDimensions)&&aabb.halfDimensions.x>=0&&aabb.halfDimensions.y>=0&&aabb.halfDimensions.z>=0)){window.console.log("Invalid aabb.halfDimensions.");window.console.log(aabb.halfDimensions);return false}return true}}]);return Intersections}();exports.default=Intersections},{"./core.utils":96,"./core.validators":97}],94:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _core=require("./core.colors");var _core2=_interopRequireDefault(_core);var _core3=require("./core.intersections");var _core4=_interopRequireDefault(_core3);var _core5=require("./core.pack");var _core6=_interopRequireDefault(_core5);var _core7=require("./core.validators");var _core8=_interopRequireDefault(_core7);var _core9=require("./core.utils");var _core10=_interopRequireDefault(_core9);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Colors:_core2.default,Intersections:_core4.default,Utils:_core10.default,Validators:_core8.default}},{"./core.colors":92,"./core.intersections":93,"./core.pack":95,"./core.utils":96,"./core.validators":97}],95:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var Pack=function Pack(){_classCallCheck(this,Pack)};exports.default=Pack},{}],96:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i=0&&halfDimensions.y>=0&&halfDimensions.z>=0)){window.console.log("halfDimensions must be >= 0.");window.console.log(halfDimensions);return false}var min=center.clone().sub(halfDimensions);var max=center.clone().add(halfDimensions);return{min:min,max:max}}},{key:"minMaxPixelData",value:function minMaxPixelData(){var pixelData=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var minMax=[65535,-32768];var numPixels=pixelData.length;for(var index=0;index=0&&objectToTest.halfDimensions.y>=0&&objectToTest.halfDimensions.z>=0)){return false}return true}},{key:"ray",value:function ray(objectToTest){if(!(objectToTest!==null&&typeof objectToTest!=="undefined"&&objectToTest.hasOwnProperty("position")&&this.vector3(objectToTest.position)&&objectToTest.hasOwnProperty("direction")&&this.vector3(objectToTest.direction))){return false}return true}}]);return Validators}();exports.default=Validators},{}],98:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _geometries=require("./geometries.slice");var _geometries2=_interopRequireDefault(_geometries);var _geometries3=require("./geometries.voxel");var _geometries4=_interopRequireDefault(_geometries3);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Slice:_geometries2.default,Voxel:_geometries4.default}},{"./geometries.slice":99,"./geometries.voxel":100}],99:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i4&&arguments[4]!==undefined?arguments[4]:new THREE.Matrix4;_classCallCheck(this,GeometriesSlice);var aabb={halfDimensions:halfDimensions,center:center,toAABB:toAABB};var plane={position:position,direction:direction};var intersections=_core2.default.aabbPlane(aabb,plane);if(intersections.length<3){window.console.log("WARNING: Less than 3 intersections between AABB and Plane.");window.console.log("AABB");window.console.log(aabb);window.console.log("Plane");window.console.log(plane);window.console.log("exiting...");throw"geometries.slice has less than 3 intersections, can not create a valid geometry."}var orderedIntersections=GeometriesSlice.orderIntersections(intersections,direction);var sliceShape=GeometriesSlice.shape(orderedIntersections);var _this=_possibleConstructorReturn(this,(GeometriesSlice.__proto__||Object.getPrototypeOf(GeometriesSlice)).call(this,sliceShape));_this.type="SliceGeometry";_this.vertices=orderedIntersections;_this.verticesNeedUpdate=true;return _this}_createClass(GeometriesSlice,null,[{key:"shape",value:function shape(points){var shape=new THREE.Shape;shape.moveTo(points[0].xy.x,points[0].xy.y);for(var l=1;l1&&arguments[1]!==undefined?arguments[1]:"default";var lutO=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"linear";var color=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[[0,0,0,0],[1,1,1,1]];var opacity=arguments.length>4&&arguments[4]!==undefined?arguments[4]:[[0,0],[1,1]];var discrete=arguments.length>5&&arguments[5]!==undefined?arguments[5]:false;_classCallCheck(this,HelpersLut);this._containerID=containerID;this._discrete=discrete;this._color=color;this._lut=lut;this._luts=_defineProperty({},lut,color);this._opacity=opacity;this._lutO=lutO;this._lutsO=_defineProperty({},lutO,opacity);this.initCanvas();this.paintCanvas()}_createClass(HelpersLut,[{key:"initCanvas",value:function initCanvas(){this._canvasContainer=this.initCanvasContainer(this._containerID);this._canvasBg=this.createCanvas();this._canvasContainer.appendChild(this._canvasBg);this._canvas=this.createCanvas();this._canvasContainer.appendChild(this._canvas)}},{key:"initCanvasContainer",value:function initCanvasContainer(canvasContainerId){var canvasContainer=document.getElementById(canvasContainerId);canvasContainer.style.width="256 px";canvasContainer.style.height="128 px";canvasContainer.style.border="1px solid #F9F9F9";return canvasContainer}},{key:"createCanvas",value:function createCanvas(){var canvas=document.createElement("canvas");canvas.height=16;canvas.width=256;return canvas}},{key:"paintCanvas",value:function paintCanvas(){var ctx=this._canvas.getContext("2d");ctx.clearRect(0,0,this._canvas.width,this._canvas.height);ctx.globalCompositeOperation="source-over";if(!this._discrete){var color=ctx.createLinearGradient(0,0,this._canvas.width,this._canvas.height);for(var i=0;i0){previousPos=this._color[_i-1][0]}var from=previousPos+(currentPos-previousPos)/2;var to=currentPos+(nextPos-currentPos)/2;var _color=this._color[_i];var opacity=this._opacity[_i]?this._opacity[_i][1]:1;ctx.beginPath();ctx.strokeStyle="rgba( "+Math.round(_color[1]*255)+", "+Math.round(_color[2]*255)+", "+Math.round(_color[3]*255)+", "+opacity+")";ctx.moveTo(from*this._canvas.width,0);ctx.lineTo(to*this._canvas.width,0);ctx.stroke();ctx.closePath()}}if(!this._discrete){ctx.globalCompositeOperation="destination-in";var _opacity=ctx.createLinearGradient(0,0,this._canvas.width,this._canvas.height);for(var _i2=0;_i20&&arguments[0]!==undefined?arguments[0]:"color";var available=[];var luts=this._luts;if(type!=="color"){luts=this._lutsO}for(var i in luts){available.push(i)}return available}},{key:"texture",get:function get(){var texture=new THREE.Texture(this._canvas);texture.mapping=THREE.UVMapping;texture.wrapS=texture.wrapT=THREE.ClampToEdgeWrapping;texture.magFilter=texture.minFilter=THREE.NearestFilter;texture.premultiplyAlpha=true;texture.needsUpdate=true;return texture}},{key:"lut",set:function set(targetLUT){this._color=this._luts[targetLUT];this._lut=targetLUT;this.paintCanvas()},get:function get(){return this._lut}},{key:"luts",set:function set(newLuts){this._luts=newLuts},get:function get(){return this._luts}},{key:"lutO",set:function set(targetLUTO){this._opacity=this._lutsO[targetLUTO];this._lutO=targetLUTO;this.paintCanvas()},get:function get(){return this._lutO}},{key:"lutsO",set:function set(newLutsO){this._lutsO=newLutsO},get:function get(){return this._lutsO}},{key:"discrete",set:function set(discrete){this._discrete=discrete;this.paintCanvas()},get:function get(){return this._discrete}}],[{key:"presetLuts",value:function presetLuts(){return{default:[[0,0,0,0],[1,1,1,1]],spectrum:[[0,0,0,0],[.1,0,0,1],[.33,0,1,1],[.5,0,1,0],[.66,1,1,0],[.9,1,0,0],[1,1,1,1]],hot_and_cold:[[0,0,0,1],[.15,0,1,1],[.3,0,1,0],[.45,0,0,0],[.5,0,0,0],[.55,0,0,0],[.7,1,1,0],[.85,1,0,0],[1,1,1,1]],gold:[[0,0,0,0],[.13,.19,.03,0],[.25,.39,.12,0],[.38,.59,.26,0],[.5,.8,.46,.08],[.63,.99,.71,.21],[.75,.99,.88,.34],[.88,.99,.99,.48],[1,.9,.95,.61]],red:[[0,.75,0,0],[.5,1,.5,0],[.95,1,1,0],[1,1,1,1]],green:[[0,0,.75,0],[.5,.5,1,0],[.95,1,1,0],[1,1,1,1]],blue:[[0,0,0,1],[.5,0,.5,1],[.95,0,1,1],[1,1,1,1]],walking_dead:[[0,.1,1,1],[1,1,1,1]],random:[[0,0,0,0],[.27,.18,.18,.18],[.41,1,1,1],[.7,1,0,0],[1,1,1,1]]}}},{key:"presetLutsO",value:function presetLutsO(){return{linear:[[0,0],[1,1]],lowpass:[[0,.8],[.2,.6],[.3,.1],[1,0]],bandpass:[[0,0],[.4,.8],[.6,.8],[1,0]],highpass:[[0,0],[.7,.1],[.8,.6],[1,.8]],flat:[[0,.7],[1,1]],random:[[0,0],[.38,0],[.55,1],[.72,1],[1,.05]]}}}]);return HelpersLut}();exports.default=HelpersLut},{}],105:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0){progressContainers[0].parentNode.removeChild(progressContainers[0])}progressContainers=null;window.cancelAnimationFrame(this.requestAnimationFrameID)}},{key:"init",value:function init(){var progressContainer=this._domContainer();for(var mode in this._modes){if(this._modes.hasOwnProperty(mode)){var bar=this._domBar(this._modes[mode]);progressContainer.appendChild(bar);bar=null}}this._container.appendChild(progressContainer);progressContainer=null;this.updateUI()}},{key:"update",value:function update(value,total,mode){this._mode=mode;this._value=value;if(total===0){this._total=value;this._value=Math.random()*value}else{this._total=total}}},{key:"updateUI",value:function updateUI(){var _this=this;this.requestAnimationFrameID=requestAnimationFrame(function(){_this.updateUI()});if(!(this._modes.hasOwnProperty(this._mode)&&this._modes[this._mode].hasOwnProperty("name")&&this._modes[this._mode].hasOwnProperty("color"))){return false}var message="";var progress=Math.round(this._value/this._total*100);var color=this._modes[this._mode].color;var progressBar=this._container.getElementsByClassName("progress "+this._modes[this._mode].name);if(progressBar.length>0){progressBar[0].style.borderColor=color;progressBar[0].style.width=progress+"%"}progressBar=null}},{key:"_domContainer",value:function _domContainer(){var container=document.createElement("div");container.classList.add("progress");container.classList.add("container");container.style.width="100%";container.style.height="8px";container.style.position="absolute";container.style.backgroundColor="rgba(158, 158, 158, 0.5)";container.style.top="0";container.style.zIndex="1";return container}},{key:"_domBar",value:function _domBar(mode){if(!(mode.hasOwnProperty("name")&&mode.hasOwnProperty("color"))){window.console.log("Invalid mode provided.");window.console.log(mode);return false}var bar=document.createElement("div");bar.classList.add(mode.name);bar.classList.add("progress");bar.style.border="2px solid "+mode.color;bar.style.width="0%";return bar}}]);return HelpersProgressBar}();exports.default=HelpersProgressBar},{}],107:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i1&&arguments[1]!==undefined?arguments[1]:0;var position=arguments.length>2&&arguments[2]!==undefined?arguments[2]:new THREE.Vector3(0,0,0);var direction=arguments.length>3&&arguments[3]!==undefined?arguments[3]:new THREE.Vector3(0,0,1);var aabbSpace=arguments.length>4&&arguments[4]!==undefined?arguments[4]:"IJK";_classCallCheck(this,HelpersSlice);var _this=_possibleConstructorReturn(this,(HelpersSlice.__proto__||Object.getPrototypeOf(HelpersSlice)).call(this));_this._stack=stack;_this._invert=_this._stack.invert;_this._lut="none";_this._lutTexture=null;_this._intensityAuto=true;_this._interpolation=1;_this._index=index;_this._windowWidth=null;_this._windowCenter=null;_this._rescaleSlope=null;_this._rescaleIntercept=null;_this._planePosition=position;_this._planeDirection=direction;_this._aaBBspace=aabbSpace;_this._material=null;_this._textures=[];_this._shadersFragment=_shadersData6.default;_this._shadersVertex=_shadersData4.default;_this._uniforms=_shadersData2.default.uniforms();_this._geometry=null;_this._mesh=null;_this._visible=true;_this._init();_this._create();return _this}_createClass(HelpersSlice,[{key:"_init",value:function _init(){if(!this._stack||!this._stack._prepared||!this._stack._packed){return}if(this._aaBBspace==="IJK"){this._halfDimensions=this._stack.halfDimensionsIJK;this._center=new THREE.Vector3(this._stack.halfDimensionsIJK.x-.5,this._stack.halfDimensionsIJK.y-.5,this._stack.halfDimensionsIJK.z-.5);this._toAABB=new THREE.Matrix4}else{var aaBBox=this._stack.AABBox();this._halfDimensions=aaBBox.clone().multiplyScalar(.5);this._center=this._stack.centerAABBox();this._toAABB=this._stack.lps2AABB}}},{key:"_create",value:function _create(){if(!this._stack||!this._stack.prepared||!this._stack.packed){return}try{this._geometry=new _geometries2.default(this._halfDimensions,this._center,this._planePosition,this._planeDirection,this._toAABB)}catch(e){window.console.log(e);window.console.log("invalid slice geometry - exiting...");return}if(!this._geometry.vertices){return}if(!this._material){this._uniforms.uTextureSize.value=this._stack.textureSize;this._uniforms.uDataDimensions.value=[this._stack.dimensionsIJK.x,this._stack.dimensionsIJK.y,this._stack.dimensionsIJK.z];this._uniforms.uWorldToData.value=this._stack.lps2IJK;this._uniforms.uNumberOfChannels.value=this._stack.numberOfChannels;this._uniforms.uPixelType.value=this._stack.pixelType;this._uniforms.uBitsAllocated.value=this._stack.bitsAllocated;this._uniforms.uPackedPerPixel.value=this._stack.packedPerPixel;this._prepareTexture();this._uniforms.uTextureContainer.value=this._textures;this._createMaterial({side:THREE.DoubleSide})}this.updateIntensitySettings();this.updateIntensitySettingsUniforms();this._mesh=new THREE.Mesh(this._geometry,this._material);if(this._aaBBspace==="IJK"){this._mesh.applyMatrix(this._stack.ijk2LPS)}this._mesh.visible=this._visible;this.add(this._mesh)}},{key:"updateIntensitySettings",value:function updateIntensitySettings(){if(this._intensityAuto){this.updateIntensitySetting("windowCenter");this.updateIntensitySetting("windowWidth");this.updateIntensitySetting("rescaleSlope");this.updateIntensitySetting("rescaleIntercept")}else{if(this._windowCenter===null){this._windowCenter=this._stack.windowCenter}if(this.__windowWidth===null){this._windowWidth=this._stack.windowWidth}if(this._rescaleSlope===null){this._rescaleSlope=this._stack.rescaleSlope}if(this._rescaleIntercept===null){this._rescaleIntercept=this._stack.rescaleIntercept}}}},{key:"updateIntensitySettingsUniforms",value:function updateIntensitySettingsUniforms(){this._uniforms.uRescaleSlopeIntercept.value=[this._rescaleSlope,this._rescaleIntercept];this._uniforms.uWindowCenterWidth.value=[this._windowCenter,this._windowWidth];this._uniforms.uInvert.value=this._invert===true?1:0;this._uniforms.uInterpolation.value=this._interpolation;if(this._lut==="none"){this._uniforms.uLut.value=0}else{this._uniforms.uLut.value=1;this._uniforms.uTextureLUT.value=this._lutTexture}}},{key:"updateIntensitySetting",value:function updateIntensitySetting(setting){if(this._stack.frame[this._index]&&this._stack.frame[this._index][setting]){this["_"+setting]=this._stack.frame[this._index][setting]}else{this["_"+setting]=this._stack[setting]}}},{key:"_update",value:function _update(){if(this._mesh){this.remove(this._mesh);this._mesh.geometry.dispose();this._mesh.geometry=null;this._mesh=null}this._create()}},{key:"stack",get:function get(){return this._stack},set:function set(stack){this._stack=stack}},{key:"windowWidth",get:function get(){return this._windowWidth},set:function set(windowWidth){this._windowWidth=windowWidth;this.updateIntensitySettingsUniforms()}},{key:"windowCenter",get:function get(){return this._windowCenter},set:function set(windowCenter){this._windowCenter=windowCenter;this.updateIntensitySettingsUniforms()}},{key:"rescaleSlope",get:function get(){return this._rescaleSlope},set:function set(rescaleSlope){this._rescaleSlope=rescaleSlope;this.updateIntensitySettingsUniforms()}},{key:"rescaleIntercept",get:function get(){return this._rescaleIntercept},set:function set(rescaleIntercept){this._rescaleIntercept=rescaleIntercept;this.updateIntensitySettingsUniforms()}},{key:"invert",get:function get(){return this._invert},set:function set(invert){this._invert=invert;this.updateIntensitySettingsUniforms()}},{key:"lut",get:function get(){return this._lut},set:function set(lut){this._lut=lut}},{key:"lutTexture",get:function get(){return this._lutTexture},set:function set(lutTexture){this._lutTexture=lutTexture;this.updateIntensitySettingsUniforms()}},{key:"intensityAuto",get:function get(){return this._intensityAuto},set:function set(intensityAuto){this._intensityAuto=intensityAuto;this.updateIntensitySettings();this.updateIntensitySettingsUniforms()}},{key:"interpolation",get:function get(){return this._interpolation},set:function set(interpolation){this._interpolation=interpolation;this.updateIntensitySettingsUniforms();this._updateMaterial()}},{key:"index",get:function get(){return this._index},set:function set(index){this._index=index;this._update()}},{key:"planePosition",set:function set(position){this._planePosition=position;this._update()},get:function get(){return this._planePosition}},{key:"planeDirection",set:function set(direction){this._planeDirection=direction;this._update()},get:function get(){return this._planeDirection}},{key:"halfDimensions",set:function set(halfDimensions){this._halfDimensions=halfDimensions},get:function get(){return this._halfDimensions}},{key:"center",set:function set(center){this._center=center},get:function get(){return this._center}},{key:"aabbSpace",set:function set(aabbSpace){this._aaBBspace=aabbSpace;this._init()},get:function get(){return this._aaBBspace}},{key:"mesh",set:function set(mesh){this._mesh=mesh},get:function get(){return this._mesh}},{key:"geometry",set:function set(geometry){this._geometry=geometry},get:function get(){return this._geometry}}]);return HelpersSlice}((0,_helpersMaterial2.default)(THREE.Object3D));exports.default=HelpersSlice},{"../../src/geometries/geometries.slice":99,"../../src/helpers/helpers.material.mixin":105,"../../src/shaders/shaders.data.fragment":132,"../../src/shaders/shaders.data.uniform":133,"../../src/shaders/shaders.data.vertex":134}],108:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i=dimensions||this._index<0){this._outOfBounds=true}else{this._outOfBounds=false}}},{key:"_prepareStack",value:function _prepareStack(){if(!this._stack.prepared){this._stack.prepare()}if(!this._stack.packed){this._stack.pack()}}},{key:"_prepareBBox",value:function _prepareBBox(){this._bBox=new _helpers4.default(this._stack);this.add(this._bBox)}},{key:"_prepareBorder",value:function _prepareBorder(){this._border=new _helpers2.default(this._slice);this.add(this._border)}},{key:"_prepareSlice",value:function _prepareSlice(){var halfDimensionsIJK=this._stack.halfDimensionsIJK;this._index=this._prepareSliceIndex(halfDimensionsIJK);var position=this._prepareSlicePosition(halfDimensionsIJK,this._index);var direction=this._prepareDirection(this._orientation);this._slice=new _helpers6.default(this._stack,this._index,position,direction);this.add(this._slice)}},{key:"_prepareSliceIndex",value:function _prepareSliceIndex(indices){var index=0;switch(this._orientation){case 0:index=Math.floor(indices.z);break;case 1:index=Math.floor(indices.x);break;case 2:index=Math.floor(indices.y);break;default:break}return index}},{key:"_prepareSlicePosition",value:function _prepareSlicePosition(rPosition,index){var position=new THREE.Vector3(0,0,0);switch(this._orientation){case 0:position=new THREE.Vector3(Math.floor(rPosition.x),Math.floor(rPosition.y),index);break;case 1:position=new THREE.Vector3(index,Math.floor(rPosition.y),Math.floor(rPosition.z));break;case 2:position=new THREE.Vector3(Math.floor(rPosition.x),index,Math.floor(rPosition.z));break;default:break}return position}},{key:"_prepareDirection",value:function _prepareDirection(orientation){var direction=new THREE.Vector3(0,0,1);switch(orientation){case 0:direction=new THREE.Vector3(0,0,1);break;case 1:direction=new THREE.Vector3(1,0,0);break;case 2:direction=new THREE.Vector3(0,1,0);break;default:break}return direction}},{key:"stack",get:function get(){return this._stack}},{key:"bbox",get:function get(){return this._bBox}},{key:"slice",get:function get(){return this._slice}},{key:"border",get:function get(){return this._border}},{key:"index",get:function get(){return this._index},set:function set(index){this._index=index;this._slice.index=index;var halfDimensions=this._stack.halfDimensionsIJK;this._slice.planePosition=this._prepareSlicePosition(halfDimensions,this._index);this._border.helpersSlice=this._slice;this._isIndexOutOfBounds()}},{key:"orientation",set:function set(orientation){this._orientation=orientation;this._slice.planeDirection=this._prepareDirection(this._orientation);this._border.helpersSlice=this._slice},get:function get(){return this._orientation}},{key:"outOfBounds",set:function set(outOfBounds){this._outOfBounds=outOfBounds},get:function get(){return this._outOfBounds}}]);return HelpersStack}(THREE.Object3D);exports.default=HelpersStack},{"../../src/helpers/helpers.border":101,"../../src/helpers/helpers.boundingbox":102,"../../src/helpers/helpers.slice":107}],109:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:null;var stack=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;_classCallCheck(this,HelpersVoxel);var _this=_possibleConstructorReturn(this,(HelpersVoxel.__proto__||Object.getPrototypeOf(HelpersVoxel)).call(this));_this._stack=stack;_this._worldCoordinates=worldCoordinates;_this._voxel=new _models4.default;_this._voxel.id=_this.id;_this._voxel.worldCoordinates=_this._worldCoordinates;if(_this._stack&&_this._stack.prepared&&_this._worldCoordinates){_this.updateVoxel(_this._worldCoordinates)}_this._mesh=null;_this._geometry=null;_this._material=null;_this._selected=false;_this._active=false;_this._hover=false;_this._distance=null;_this._showVoxel=true;_this._showDomSVG=true;_this._showDomMeasurements=true;_this._color="#00B0FF";_this._svgPointer=' ';_this.createMesh();return _this}_createClass(HelpersVoxel,[{key:"updateVoxel",value:function updateVoxel(worldCoordinates){this._voxel.worldCoordinates=worldCoordinates;this._voxel.dataCoordinates=_models2.default.worldToData(this._stack,this._voxel.worldCoordinates);var value=_models2.default.value(this._stack,this._voxel.dataCoordinates);this._voxel.value=_models2.default.valueRescaleSlopeIntercept(value,this._stack.rescaleSlope,this._stack.rescaleIntercept)}},{key:"updateVoxelScreenCoordinates",value:function updateVoxelScreenCoordinates(camera,container){this._voxel.screenCoordinates=HelpersVoxel.worldToScreen(this._worldCoordinates,camera,container)}},{key:"createMesh",value:function createMesh(){var dataCoordinates=_models2.default.worldToData(this._stack,this._worldCoordinates);this._geometry=new _geometries2.default(dataCoordinates);this._material=new THREE.MeshBasicMaterial({wireframe:true,wireframeLinewidth:2});this._material.color.set(this._color);this._mesh=new THREE.Mesh(this._geometry,this._material);this._mesh.applyMatrix(this._stack.ijk2LPS);this._mesh.visible=this._showVoxel;this.add(this._mesh)}},{key:"createDom",value:function createDom(){var measurementsContainer=this._createDiv("VJSVoxelMeasurements",this.id,"VJSVoxelMeasurements");var rasContainer=this._createDiv("VJSVoxelProbeWorld",this.id,"VJSVoxelProbeWorld");measurementsContainer.appendChild(rasContainer);var ijkContainer=this._createDiv("VJSVoxelProbeData",this.id,"VJSVoxelProbeData");measurementsContainer.appendChild(ijkContainer);var valueContainer=this._createDiv("VJSVoxelProbeValue",this.id,"VJSVoxelProbeValue");measurementsContainer.appendChild(valueContainer);var svgContainer=this._createDiv("VJSVoxelProbeSVG",this.id,"VJSVoxelProbeSVG");svgContainer.innerHTML=this._svgPointer;var domElement=this._createDiv("VJSWidgetVoxelProbe",this.id,"VJSWidgetVoxelProbe");domElement.appendChild(svgContainer);domElement.appendChild(measurementsContainer);return domElement}},{key:"updateDom",value:function updateDom(container){if(document.getElementById("VJSVoxelProbeWorld"+this.id)===null){container.appendChild(this.createDom())}var rasContainer=document.getElementById("VJSVoxelProbeWorld"+this.id);var rasContent=this._voxel.worldCoordinates.x.toFixed(2)+" : "+this._voxel.worldCoordinates.y.toFixed(2)+" : "+this._voxel.worldCoordinates.z.toFixed(2);rasContainer.innerHTML="LPS: "+rasContent;var ijkContainer=document.getElementById("VJSVoxelProbeData"+this.id);var ijkContent=this._voxel.dataCoordinates.x+" : "+this._voxel.dataCoordinates.y+" : "+this._voxel.dataCoordinates.z;ijkContainer.innerHTML="IJK: "+ijkContent;var valueContainer=document.getElementById("VJSVoxelProbeValue"+this.id);var valueContent=this._voxel.value;valueContainer.innerHTML="Value: "+valueContent;var selectedElement=document.getElementById("VJSWidgetVoxelProbe"+this.id);selectedElement.style.top=this._voxel.screenCoordinates.y;selectedElement.style.left=this._voxel.screenCoordinates.x;this.updateDomClass(selectedElement)}},{key:"updateDomClass",value:function updateDomClass(){var element=document.getElementById("VJSWidgetVoxelProbe"+this.id);if(this._active===true){element.classList.add("VJSVoxelProbeActive")}else{element.classList.remove("VJSVoxelProbeActive")}if(this._hover===true){element.classList.add("VJSVoxelProbeHover")}else{element.classList.remove("VJSVoxelProbeHover")}if(this._selected===true){element.classList.add("VJSVoxelProbeSelect")}else{element.classList.remove("VJSVoxelProbeSelect")}this.updateDomElementDisplay("VJSVoxelMeasurements"+this.id,this._showDomMeasurements);this.updateDomElementDisplay("VJSVoxelProbeSVG"+this.id,this._showDomSVG)}},{key:"updateDomElementDisplay",value:function updateDomElementDisplay(id,show){if(show){document.getElementById(id).style.display="block"}else{document.getElementById(id).style.display="none"}}},{key:"removeTest",value:function removeTest(){var node=document.getElementById("VJSWidgetVoxelProbe"+this.id);if(node.parentNode){node.parentNode.removeChild(node)}this.remove(this._mesh);this._mesh.geometry.dispose();this._mesh.material.dispose();this._mesh=null}},{key:"_createDiv",value:function _createDiv(idPrefix,idSuffix,className){var divContainer=document.createElement("div");divContainer.setAttribute("id",idPrefix+idSuffix);divContainer.setAttribute("class",className);return divContainer}},{key:"color",set:function set(color){this._color=color;if(this._material){this._material.color.set(this._color)}var selectedElement=document.getElementById("VJSVoxelMeasurements"+this.id);if(selectedElement){selectedElement.style.borderColor=this._color.replace("0x","#")}selectedElement=document.querySelector("#VJSVoxelProbeSVG"+this.id+"> svg > path");if(selectedElement){selectedElement.style.stroke=this._color.replace("0x","#")}},get:function get(){return this._color}},{key:"worldCoordinates",set:function set(worldCoordinates){this._worldCoordinates=worldCoordinates;this._voxel._worldCoordinates=worldCoordinates;this.updateVoxel(this._worldCoordinates);if(this._mesh&&this._mesh.geometry){this._mesh.geometry.location=this._voxel.dataCoordinates}},get:function get(){return this._worldCoordinates}},{key:"voxel",get:function get(){return this._voxel},set:function set(voxel){this._voxel=voxel}},{key:"showVoxel",set:function set(showVoxel){this._showVoxel=showVoxel;if(this._mesh){this._mesh.visible=this._showVoxel}},get:function get(){return this._showVoxel}},{key:"showDomSVG",set:function set(showDomSVG){this._showDomSVG=showDomSVG;this.updateDomClass()},get:function get(){return this._showDomSVG}},{key:"showDomMeasurements",set:function set(showDomMeasurements){this._showDomMeasurements=showDomMeasurements;this.updateDomClass()},get:function get(){return this._showDomMeasurements}},{key:"distance",set:function set(distance){this._distance=distance},get:function get(){return this._distance}},{key:"selected",set:function set(selected){this._selected=selected},get:function get(){return this._selected}},{key:"hover",set:function set(hover){this._hover=hover},get:function get(){return this._hover}},{key:"active",set:function set(active){this._active=active},get:function get(){return this._active}}],[{key:"worldToScreen",value:function worldToScreen(worldCoordinate,camera,canvas){var screenCoordinates=worldCoordinate.clone();screenCoordinates.project(camera);screenCoordinates.x=Math.round((screenCoordinates.x+1)*canvas.offsetWidth/2);screenCoordinates.y=Math.round((-screenCoordinates.y+1)*canvas.offsetHeight/2);screenCoordinates.z=0;return screenCoordinates}}]);return HelpersVoxel}(THREE.Object3D);exports.default=HelpersVoxel},{"../../src/geometries/geometries.voxel":100,"../../src/models/models.stack":118,"../../src/models/models.voxel":119}],111:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:document.body;var helpersProgress=arguments.length>1&&arguments[1]!==undefined?arguments[1]:_helpers2.default;_classCallCheck(this,LoadersBase);this._loaded=-1;this._totalLoaded=-1;this._parsed=-1;this._totalParsed=-1;this._container=container;this._helpersProgressBar=helpersProgress;this._progressBar=null;if(this._container&&this._helpersProgressBar){this._progressBar=new helpersProgress(this._container)}}_createClass(LoadersBase,[{key:"free",value:function free(){this._container=null;this._helpersProgressBar=null;if(this._progressBar){this._progressBar.free();this._progressBar=null}}},{key:"fetch",value:function fetch(url){var _this=this;return new Promise(function(resolve,reject){var request=new XMLHttpRequest;request.open("GET",url);request.crossOrigin=true;request.responseType="arraybuffer";request.onload=function(event){if(request.status===200){_this._loaded=event.loaded;_this._totalLoaded=event.total;if(_this._progressBar){_this._progressBar.update(_this._loaded,_this._totalLoaded,"load")}var buffer=request.response;var response={url:url,buffer:buffer};resolve(response)}else{reject(request.statusText)}};request.onerror=function(){reject(request.statusText)};request.onprogress=function(event){_this._loaded=event.loaded;_this._totalLoaded=event.total;if(_this._progressBar){_this._progressBar.update(_this._loaded,_this._totalLoaded,"load")}};request.send()})}}]);return LoadersBase}();exports.default=LoadersBase},{"../../src/helpers/helpers.progressbar":106,"../../src/models/models.frame":115,"../../src/models/models.series":117,"../../src/models/models.stack":118}],112:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _loaders=require("./loaders.volume");var _loaders2=_interopRequireDefault(_loaders);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Volume:_loaders2.default}},{"./loaders.volume":113}],113:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&yCos.length()>0){cosines[0]=xCos;cosines[1]=yCos;cosines[2]=new THREE.Vector3(0,0,0).crossVectors(cosines[0],cosines[1]).normalize()}}else{window.console.log("No valid image orientation for frame");window.console.log(this);window.console.log("Returning default orientation.")}if(!this._rightHanded){cosines[2].negate()}return cosines}},{key:"spacingXY",value:function spacingXY(){var spacingXY=[1,1];if(this.pixelSpacing){spacingXY[0]=this.pixelSpacing[0];spacingXY[1]=this.pixelSpacing[1]}else if(this.pixelAspectRatio){spacingXY[0]=1;spacingXY[1]=1*this.pixelAspectRatio[1]/this.pixelAspectRatio[0]}return spacingXY}},{key:"value",value:function value(column,row){return this.pixelData[column+this._columns*row]}},{key:"_compareArrays",value:function _compareArrays(reference,target){if(reference===target){return true}if(reference&&target&&reference.join()===target.join()){return true}return false}},{key:"rows",get:function get(){return this._rows},set:function set(rows){this._rows=rows}},{key:"columns",get:function get(){return this._columns},set:function set(columns){this._columns=columns}},{key:"spacingBetweenSlices",get:function get(){return this._spacingBetweenSlices},set:function set(spacingBetweenSlices){this._spacingBetweenSlices=spacingBetweenSlices}},{key:"sliceThickness",get:function get(){return this._sliceThickness},set:function set(sliceThickness){this._sliceThickness=sliceThickness}},{key:"imagePosition",get:function get(){return this._imagePosition},set:function set(imagePosition){this._imagePosition=imagePosition}},{key:"imageOrientation",get:function get(){return this._imageOrientation},set:function set(imageOrientation){this._imageOrientation=imageOrientation}},{key:"windowWidth",get:function get(){return this._windowWidth},set:function set(windowWidth){this._windowWidth=windowWidth}},{key:"windowCenter",get:function get(){return this._windowCenter},set:function set(windowCenter){this._windowCenter=windowCenter}},{key:"rescaleSlope",get:function get(){return this._rescaleSlope},set:function set(rescaleSlope){this._rescaleSlope=rescaleSlope}},{key:"rescaleIntercept",get:function get(){return this._rescaleIntercept},set:function set(rescaleIntercept){this._rescaleIntercept=rescaleIntercept}},{key:"bitsAllocated",get:function get(){return this._bitsAllocated},set:function set(bitsAllocated){this._bitsAllocated=bitsAllocated}},{key:"dist",get:function get(){return this._dist},set:function set(dist){this._dist=dist}},{key:"pixelSpacing",get:function get(){return this._pixelSpacing},set:function set(pixelSpacing){this._pixelSpacing=pixelSpacing}},{key:"pixelAspectRatio",get:function get(){return this._pixelAspectRatio},set:function set(pixelAspectRatio){this._pixelAspectRatio=pixelAspectRatio}},{key:"minMax",get:function get(){return this._minMax},set:function set(minMax){this._minMax=minMax}},{key:"dimensionIndexValues",get:function get(){return this._dimensionIndexValues},set:function set(dimensionIndexValues){this._dimensionIndexValues=dimensionIndexValues}},{key:"instanceNumber",get:function get(){return this._instanceNumber},set:function set(instanceNumber){this._instanceNumber=instanceNumber}},{key:"pixelData",get:function get(){return this._pixelData},set:function set(pixelData){this._pixelData=pixelData}},{key:"sopInstanceUID",set:function set(sopInstanceUID){this._sopInstanceUID=sopInstanceUID},get:function get(){return this._sopInstanceUID; +}},{key:"pixelType",get:function get(){return this._pixelType},set:function set(pixelType){this._pixelType=pixelType}},{key:"url",get:function get(){return this._url},set:function set(url){this._url=url}},{key:"referencedSegmentNumber",get:function get(){return this._referencedSegmentNumber},set:function set(referencedSegmentNumber){this._referencedSegmentNumber=referencedSegmentNumber}},{key:"rightHanded",get:function get(){return this._rightHanded},set:function set(rightHanded){this._rightHanded=rightHanded}}]);return ModelsFrame}(_models2.default);exports.default=ModelsFrame},{"../../src/models/models.base":114}],116:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _models=require("./models.frame");var _models2=_interopRequireDefault(_models);var _models3=require("./models.stack");var _models4=_interopRequireDefault(_models3);var _models5=require("./models.series");var _models6=_interopRequireDefault(_models5);var _models7=require("./models.voxel");var _models8=_interopRequireDefault(_models7);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Frame:_models2.default,Stack:_models4.default,Series:_models6.default,Voxel:_models8.default}},{"./models.frame":115,"./models.series":117,"./models.stack":118,"./models.voxel":119}],117:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0){this._numberOfFrames=this._frame.length}else{window.console.log("_frame doesn't contain anything....");window.console.log(this._frame);return false}this._rows=this._frame[0].rows;this._columns=this._frame[0].columns;this._dimensionsIJK=new THREE.Vector3(this._columns,this._rows,this._numberOfFrames);this._halfDimensionsIJK=new THREE.Vector3(this._dimensionsIJK.x/2,this._dimensionsIJK.y/2,this._dimensionsIJK.z/2);this._spacingBetweenSlices=this._frame[0].spacingBetweenSlices;this._sliceThickness=this._frame[0].sliceThickness;this.computeCosines();this.orderFrames();this.computeSpacing();if(!this._frame[0].imagePosition){this._frame[0].imagePosition=[0,0,0]}if(!this._frame[0].imageOrientation){this._frame[0].imageOrientation=[1,0,0,0,1,0]}this._origin=this._vector3FromArray(this._frame[0].imagePosition,0);this.computeIJK2LPS();this.computeLPS2AABB();this._rescaleSlope=this._frame[0].rescaleSlope||1;this._rescaleIntercept=this._frame[0].rescaleIntercept||0;this.computeMinMaxIntensities();this._minMax[0]=ModelsStack.valueRescaleSlopeIntercept(this._minMax[0],this._rescaleSlope,this._rescaleIntercept);this._minMax[1]=ModelsStack.valueRescaleSlopeIntercept(this._minMax[1],this._rescaleSlope,this._rescaleIntercept);var width=this._frame[0].windowWidth||this._minMax[1]-this._minMax[0];this._windowWidth=this._rescaleSlope*width+this._rescaleIntercept;var center=this._frame[0].windowCenter||this._minMax[0]+width/2;this._windowCenter=this._rescaleSlope*center+this._rescaleIntercept;this._bitsAllocated=this._frame[0].bitsAllocated;this._prepared=true}},{key:"packEchos",value:function packEchos(){var echos=4;var packedEcho=[];for(var i=0;i1){if(this._spacingBetweenSlices){this._spacing.z=this._spacingBetweenSlices}else if(this._frame[0].pixelSpacing&&this._frame[0].pixelSpacing[2]){this._spacing.z=this._frame[0].pixelSpacing[2]}else{this._frame.map(this._computeDistanceArrayMap.bind(null,this._zCosine));this._frame.sort(this._sortDistanceArraySort);this._spacing.z=this._frame[1].dist-this._frame[0].dist}}if(this._spacing.z===0){this._spacing.z=1}}},{key:"xySpacing",value:function xySpacing(){if(this._frame&&this._frame[0]){var spacingXY=this._frame[0].spacingXY();this._spacing.x=spacingXY[0];this._spacing.y=spacingXY[1]}}},{key:"computeMinMaxIntensities",value:function computeMinMaxIntensities(){for(var i=0;inbVoxels){voxelIndexStop=nbVoxels}for(var ii=0;iinbVoxels){voxelIndexStop=nbVoxels}}this._packed=true}},{key:"_packTo8Bits",value:function _packTo8Bits(bits,pixelType,channels,frame,textureSize,startVoxel,stopVoxel){var packed={textureType:null,data:null};var packIndex=0;var frameIndex=0;var inFrameIndex=0;var frameDimension=frame[0].rows*frame[0].columns;var data=null;if(bits===8&&channels===1||bits===1){var _data=new Uint8Array(textureSize*textureSize*1);for(var i=startVoxel;i>>8&255;packIndex++;coordinate=Math.floor(packIndex/2);channelOffset=packIndex%2}packed.textureType=THREE.RGBAFormat;packed.data=_data2}else if(bits===32&&channels===1&&pixelType===0){var _data3=new Uint8Array(textureSize*textureSize*4);for(var _i4=startVoxel;_i4>>8&255;_data3[4*packIndex+2]=_raw>>>8&255;_data3[4*packIndex+3]=_raw>>>8&255;packIndex++}packed.textureType=THREE.RGBAFormat;packed.data=_data3}else if(bits===32&&channels===1&&pixelType===1){var _data4=new Uint8Array(textureSize*textureSize*4);for(var _i5=startVoxel;_i5parseInt(b.dimensionIndexValues[i],10)){return 1}if(parseInt(a.dimensionIndexValues[i],10)=0&&ijkCoordinate.z=0&&index.y>=0&&index.z>=0&&index.x0){segmentationCodeDesignator=element.items[0].dataSet.string("x00080102");segmentationCodeValue=element.items[0].dataSet.string("x00080100");segmentationCodeMeaning=element.items[0].dataSet.string("x00080104")}return{segmentationCodeDesignator:segmentationCodeDesignator,segmentationCodeValue:segmentationCodeValue,segmentationCodeMeaning:segmentationCodeMeaning}}},{key:"_recommendedDisplayCIELab",value:function _recommendedDisplayCIELab(segment){if(!segment.dataSet.elements.x0062000d){return null}var offset=segment.dataSet.elements.x0062000d.dataOffset;var length=segment.dataSet.elements.x0062000d.length;var byteArray=segment.dataSet.byteArray.slice(offset,offset+length);var CIELabScaled=new Uint16Array(length/2);for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:0;var sopInstanceUID=this._findStringEverywhere("x2005140f","x00080018",frameIndex);return sopInstanceUID}},{key:"transferSyntaxUID",value:function transferSyntaxUID(){return this._dataSet.string("x00020010")}},{key:"photometricInterpretation",value:function photometricInterpretation(){return this._dataSet.string("x00280004")}},{key:"planarConfiguration",value:function planarConfiguration(){var planarConfiguration=this._dataSet.uint16("x00280006");if(typeof planarConfiguration==="undefined"){planarConfiguration=null}return planarConfiguration}},{key:"samplesPerPixel",value:function samplesPerPixel(){return this._dataSet.uint16("x00280002")}},{key:"numberOfFrames",value:function numberOfFrames(){var numberOfFrames=this._dataSet.intString("x00280008");if(typeof numberOfFrames==="undefined"){numberOfFrames=null}return numberOfFrames}},{key:"numberOfChannels",value:function numberOfChannels(){var numberOfChannels=1;var photometricInterpretation=this.photometricInterpretation();if(!(photometricInterpretation!=="RGB"&&photometricInterpretation!=="PALETTE COLOR"&&photometricInterpretation!=="YBR_FULL"&&photometricInterpretation!=="YBR_FULL_422"&&photometricInterpretation!=="YBR_PARTIAL_422"&&photometricInterpretation!=="YBR_PARTIAL_420"&&photometricInterpretation!=="YBR_RCT")){numberOfChannels=3}return numberOfChannels}},{key:"invert",value:function invert(){var photometricInterpretation=this.photometricInterpretation();return photometricInterpretation==="MONOCHROME1"?true:false}},{key:"imageOrientation",value:function imageOrientation(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var imageOrientation=this._findStringEverywhere("x00209116","x00200037",frameIndex);if(imageOrientation){imageOrientation=imageOrientation.split("\\").map(Number)}return imageOrientation}},{key:"referencedSegmentNumber",value:function referencedSegmentNumber(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var referencedSegmentNumber=-1;var referencedSegmentNumberElement=this._findInGroupSequence("x52009230","x0062000a",frameIndex);if(referencedSegmentNumberElement!==null){referencedSegmentNumber=referencedSegmentNumberElement.uint16("x0062000b")}return referencedSegmentNumber}},{key:"pixelAspectRatio",value:function pixelAspectRatio(){var pixelAspectRatio=[this._dataSet.intString("x00280034",0),this._dataSet.intString("x00280034",1)];if(typeof pixelAspectRatio[0]==="undefined"){pixelAspectRatio=null}return pixelAspectRatio}},{key:"imagePosition",value:function imagePosition(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var imagePosition=this._findStringEverywhere("x00209113","x00200032",frameIndex);if(imagePosition){imagePosition=imagePosition.split("\\").map(Number)}return imagePosition}},{key:"instanceNumber",value:function instanceNumber(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var instanceNumber=null;var perFrameFunctionnalGroupSequence=this._dataSet.elements.x52009230;if(typeof perFrameFunctionnalGroupSequence!=="undefined"){if(perFrameFunctionnalGroupSequence.items[frameIndex].dataSet.elements.x2005140f){var planeOrientationSequence=perFrameFunctionnalGroupSequence.items[frameIndex].dataSet.elements.x2005140f.items[0].dataSet;instanceNumber=planeOrientationSequence.intString("x00200013")}else{instanceNumber=this._dataSet.intString("x00200013");if(typeof instanceNumber==="undefined"){instanceNumber=null}}}else{instanceNumber=this._dataSet.intString("x00200013");if(typeof instanceNumber==="undefined"){instanceNumber=null}}return instanceNumber}},{key:"pixelSpacing",value:function pixelSpacing(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var pixelSpacing=this._findStringEverywhere("x00289110","x00280030",frameIndex);if(pixelSpacing){pixelSpacing=pixelSpacing.split("\\").map(Number)}return pixelSpacing}},{key:"rows",value:function rows(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var rows=this._dataSet.uint16("x00280010");if(typeof rows==="undefined"){rows=null}return rows}},{key:"columns",value:function columns(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var columns=this._dataSet.uint16("x00280011");if(typeof columns==="undefined"){columns=null}return columns}},{key:"pixelType",value:function pixelType(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return 0}},{key:"pixelRepresentation",value:function pixelRepresentation(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var pixelRepresentation=this._dataSet.uint16("x00280103");return pixelRepresentation}},{key:"bitsAllocated",value:function bitsAllocated(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var bitsAllocated=this._dataSet.uint16("x00280100");return bitsAllocated}},{key:"highBit",value:function highBit(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var highBit=this._dataSet.uint16("x00280102");return highBit}},{key:"rescaleIntercept",value:function rescaleIntercept(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._findFloatStringInFrameGroupSequence("x00289145","x00281052",frameIndex)}},{key:"rescaleSlope",value:function rescaleSlope(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._findFloatStringInFrameGroupSequence("x00289145","x00281053",frameIndex)}},{key:"windowCenter",value:function windowCenter(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._findFloatStringInFrameGroupSequence("x00289132","x00281050",frameIndex)}},{key:"windowWidth",value:function windowWidth(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._findFloatStringInFrameGroupSequence("x00289132","x00281051",frameIndex)}},{key:"sliceThickness",value:function sliceThickness(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._findFloatStringInFrameGroupSequence("x00289110","x00180050",frameIndex)}},{key:"dimensionIndexValues",value:function dimensionIndexValues(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var dimensionIndexValues=[];var perFrameFunctionnalGroupSequence=this._dataSet.elements.x52009230;if(typeof perFrameFunctionnalGroupSequence!=="undefined"){var philipsPrivateSequence=perFrameFunctionnalGroupSequence.items[frameIndex].dataSet.elements.x00209111.items[0].dataSet;var element=philipsPrivateSequence.elements.x00209157;var nbValues=element.length/4;for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:0;var inStackPositionNumber=null;var perFrameFunctionnalGroupSequence=this._dataSet.elements.x52009230;if(typeof perFrameFunctionnalGroupSequence!=="undefined"){var philipsPrivateSequence=perFrameFunctionnalGroupSequence.items[frameIndex].dataSet.elements.x00209111.items[0].dataSet;inStackPositionNumber=philipsPrivateSequence.uint32("x00209057")}else{inStackPositionNumber=null}console.log("instack position "+inStackPositionNumber);return inStackPositionNumber}},{key:"stackID",value:function stackID(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var stackID=null;var perFrameFunctionnalGroupSequence=this._dataSet.elements.x52009230;if(typeof perFrameFunctionnalGroupSequence!=="undefined"){var philipsPrivateSequence=perFrameFunctionnalGroupSequence.items[frameIndex].dataSet.elements.x00209111.items[0].dataSet;stackID=philipsPrivateSequence.intString("x00209056")}else{stackID=null}return stackID}},{key:"extractPixelData",value:function extractPixelData(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var decompressedData=this._decodePixelData(frameIndex);var numberOfChannels=this.numberOfChannels();if(numberOfChannels>1){return this._convertColorSpace(decompressedData)}else{return decompressedData}}},{key:"minMaxPixelData",value:function minMaxPixelData(){var pixelData=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var minMax=[65535,-32768];var numPixels=pixelData.length;for(var index=0;index0&&arguments[0]!==undefined?arguments[0]:0;var transferSyntaxUID=this.transferSyntaxUID();if(transferSyntaxUID==="1.2.840.10008.1.2.4.90"||transferSyntaxUID==="1.2.840.10008.1.2.4.91"){return this._decodeJ2K(frameIndex)}else if(transferSyntaxUID==="1.2.840.10008.1.2.4.57"||transferSyntaxUID==="1.2.840.10008.1.2.4.70"){return this._decodeJPEGLossless(frameIndex)}else if(transferSyntaxUID==="1.2.840.10008.1.2.4.50"||transferSyntaxUID==="1.2.840.10008.1.2.4.51"){return this._decodeJPEGBaseline(frameIndex)}else if(transferSyntaxUID==="1.2.840.10008.1.2"||transferSyntaxUID==="1.2.840.10008.1.2.1"){return this._decodeUncompressed(frameIndex)}else if(transferSyntaxUID==="1.2.840.10008.1.2.2"){var frame=this._decodeUncompressed(frameIndex);return this._swapFrame(frame)}else{throw"no decoder for transfer syntax "+transferSyntaxUID}}},{key:"_decodeJ2K",value:function _decodeJ2K(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var encodedPixelData=DicomParser.readEncapsulatedPixelData(this._dataSet,this._dataSet.elements.x7fe00010,frameIndex);var jpxImage=new Jpx;jpxImage.parse(encodedPixelData);var componentsCount=jpxImage.componentsCount;if(componentsCount!==1){throw"JPEG2000 decoder returned a componentCount of ${componentsCount}, when 1 is expected"}var tileCount=jpxImage.tiles.length;if(tileCount!==1){throw"JPEG2000 decoder returned a tileCount of ${tileCount}, when 1 is expected"}var tileComponents=jpxImage.tiles[0];var pixelData=tileComponents.items;return pixelData}},{key:"_decodeJPEGLossless",value:function _decodeJPEGLossless(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var encodedPixelData=DicomParser.readEncapsulatedPixelData(this._dataSet,this._dataSet.elements.x7fe00010,frameIndex);var pixelRepresentation=this.pixelRepresentation(frameIndex);var bitsAllocated=this.bitsAllocated(frameIndex);var byteOutput=bitsAllocated<=8?1:2;var decoder=new Jpeg.lossless.Decoder;var decompressedData=decoder.decode(encodedPixelData.buffer,encodedPixelData.byteOffset,encodedPixelData.length,byteOutput);if(pixelRepresentation===0){if(byteOutput===2){return new Uint16Array(decompressedData.buffer)}else{return new Uint8Array(decompressedData.buffer)}}else{return new Int16Array(decompressedData.buffer)}}},{key:"_decodeJPEGBaseline",value:function _decodeJPEGBaseline(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var encodedPixelData=DicomParser.readEncapsulatedPixelData(this._dataSet,this._dataSet.elements.x7fe00010,frameIndex);var rows=this.rows(frameIndex);var columns=this.columns(frameIndex);var bitsAllocated=this.bitsAllocated(frameIndex);var jpegBaseline=new JpegBaseline;jpegBaseline.parse(encodedPixelData);if(bitsAllocated===8){return jpegBaseline.getData(columns,rows)}else if(bitsAllocated===16){return jpegBaseline.getData16(columns,rows)}}},{key:"_decodeUncompressed",value:function _decodeUncompressed(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var pixelRepresentation=this.pixelRepresentation(frameIndex);var bitsAllocated=this.bitsAllocated(frameIndex);var pixelDataElement=this._dataSet.elements.x7fe00010;var pixelDataOffset=pixelDataElement.dataOffset;var numberOfChannels=this.numberOfChannels();var numPixels=this.rows(frameIndex)*this.columns(frameIndex)*numberOfChannels;var frameOffset=0;var buffer=this._dataSet.byteArray.buffer;if(pixelRepresentation===0&&bitsAllocated===8){frameOffset=pixelDataOffset+frameIndex*numPixels;return new Uint8Array(buffer,frameOffset,numPixels)}else if(pixelRepresentation===0&&bitsAllocated===16){frameOffset=pixelDataOffset+frameIndex*numPixels*2;return new Uint16Array(buffer,frameOffset,numPixels)}else if(pixelRepresentation===1&&bitsAllocated===16){frameOffset=pixelDataOffset+frameIndex*numPixels*2;return new Int16Array(buffer,frameOffset,numPixels)}else if(pixelRepresentation===0&&bitsAllocated===32){frameOffset=pixelDataOffset+frameIndex*numPixels*4;return new Uint32Array(buffer,frameOffset,numPixels)}else if(pixelRepresentation===0&&bitsAllocated===1){var newBuffer=new ArrayBuffer(numPixels);var newArray=new Uint8Array(newBuffer);frameOffset=pixelDataOffset+frameIndex*numPixels;var index=0;var bitStart=frameIndex*numPixels;var bitEnd=frameIndex*numPixels+numPixels;var byteStart=Math.floor(bitStart/8);var bitStartOffset=bitStart-byteStart*8;var byteEnd=Math.ceil(bitEnd/8);var targetBuffer=new Uint8Array(buffer,pixelDataOffset);for(var i=byteStart;i<=byteEnd;i++){while(bitStartOffset<8){switch(bitStartOffset){case 0:newArray[index]=targetBuffer[i]&1;break;case 1:newArray[index]=targetBuffer[i]>>>1&1;break;case 2:newArray[index]=targetBuffer[i]>>>2&1;break;case 3:newArray[index]=targetBuffer[i]>>>3&1;break;case 4:newArray[index]=targetBuffer[i]>>>4&1;break;case 5:newArray[index]=targetBuffer[i]>>>5&1;break;case 6:newArray[index]=targetBuffer[i]>>>6&1;break;case 7:newArray[index]=targetBuffer[i]>>>7&1;break;default:break}bitStartOffset++;index++;if(index>=numPixels){return newArray}}bitStartOffset=0}}}},{key:"_convertColorSpace",value:function _convertColorSpace(uncompressedData){var rgbData=null;var photometricInterpretation=this.photometricInterpretation();var planarConfiguration=this.planarConfiguration();if(photometricInterpretation==="RGB"&&planarConfiguration===0){rgbData=uncompressedData}else if(photometricInterpretation==="RGB"&&planarConfiguration===1){if(uncompressedData instanceof Int8Array){rgbData=new Int8Array(uncompressedData.length)}else if(uncompressedData instanceof Uint8Array){rgbData=new Uint8Array(uncompressedData.length)}else if(uncompressedData instanceof Int16Array){rgbData=new Int16Array(uncompressedData.length)}else if(uncompressedData instanceof Uint16Array){rgbData=new Uint16Array(uncompressedData.length)}else{throw"unsuported typed array: ${uncompressedData}"}var numPixels=uncompressedData.length/3;var rgbaIndex=0;var rIndex=0;var gIndex=numPixels;var bIndex=numPixels*2;for(var i=0;i=5){numberOfChannels=this._dataSet.dims[5];this._ordered=false}else if(this._dataSet.datatypeCode===128){numberOfChannels=3}else if(this._dataSet.datatypeCode===2304){numberOfChannels=4}return numberOfChannels}},{key:"sopInstanceUID",value:function sopInstanceUID(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return frameIndex}},{key:"rows",value:function rows(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.dims[2]}},{key:"columns",value:function columns(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.dims[1]}},{key:"pixelType",value:function pixelType(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var pixelType=0;if(this._dataSet.datatypeCode===16||this._dataSet.datatypeCode===64||this._dataSet.datatypeCode===1536){pixelType=1}return pixelType}},{key:"bitsAllocated",value:function bitsAllocated(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.numBitsPerVoxel}},{key:"pixelSpacing",value:function pixelSpacing(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return[this._dataSet.pixDims[1],this._dataSet.pixDims[2],this._dataSet.pixDims[3]]}},{key:"sliceThickness",value:function sliceThickness(){return null}},{key:"imageOrientation",value:function imageOrientation(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;if(this._dataSet.qform_code>0){var a=0,b=this._dataSet.quatern_b,c=this._dataSet.quatern_c,d=this._dataSet.quatern_d;a=1-(b*b+c*c+d*d);if(a<1e-7){a=1/Math.sqrt(b*b+c*c+d*d);b*=a;c*=a;d*=a;a=0}else{a=Math.sqrt(a)}if(this._dataSet.pixDims[0]<0){this._rightHanded=false}return[-(a*a+b*b-c*c-d*d),-2*(b*c+a*d),2*(b*d-a*c),-2*(b*c-a*d),-(a*a+c*c-b*b-d*d),2*(c*d+a*b)]}else if(this._dataSet.sform_code>0){console.log("sform > 0");var sx=this._dataSet.srow_x,sy=this._dataSet.srow_y,sz=this._dataSet.srow_z}else if(this._dataSet.qform_code===0){console.log("qform === 0")}return[1,0,0,0,1,0]}},{key:"imagePosition",value:function imagePosition(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return[-this._dataSet.qoffset_x,-this._dataSet.qoffset_y,this._dataSet.qoffset_z]}},{key:"dimensionIndexValues",value:function dimensionIndexValues(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"instanceNumber",value:function instanceNumber(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return frameIndex}},{key:"windowCenter",value:function windowCenter(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"windowWidth",value:function windowWidth(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"rescaleSlope",value:function rescaleSlope(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.scl_slope}},{key:"rescaleIntercept",value:function rescaleIntercept(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.scl_intercept}},{key:"minMaxPixelData",value:function minMaxPixelData(){var pixelData=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var minMax=[65535,-32768];var numPixels=pixelData.length;for(var index=0;index0&&arguments[0]!==undefined?arguments[0]:0;return this._decompressUncompressed(frameIndex)}},{key:"_decompressUncompressed",value:function _decompressUncompressed(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var numberOfChannels=this.numberOfChannels();var numPixels=this.rows(frameIndex)*this.columns(frameIndex)*numberOfChannels;if(!this.rightHanded()){frameIndex=this.numberOfFrames()-1-frameIndex}var frameOffset=frameIndex*numPixels;var buffer=this._niftiImage;if(!this._ordered&&this._orderedData===null){this._reorderData()}if(this._orderedData!==null){return this._orderedData.slice(frameOffset,frameOffset+numPixels)}else if(this._dataSet.datatypeCode===2){return new Uint8Array(buffer,frameOffset,numPixels)}else if(this._dataSet.datatypeCode===256){return new Int8Array(buffer,frameOffset,numPixels)}else if(this._dataSet.datatypeCode===512){frameOffset=frameOffset*2;return new Uint16Array(buffer,frameOffset,numPixels)}else if(this._dataSet.datatypeCode===4){frameOffset=frameOffset*2;return new Int16Array(buffer,frameOffset,numPixels)}else if(this._dataSet.datatypeCode===16){frameOffset=frameOffset*4;return new Float32Array(buffer,frameOffset,numPixels)}}},{key:"_reorderData",value:function _reorderData(){window.console.log("re-order");var numberOfChannels=this.numberOfChannels();var numPixels=this.rows()*this.columns()*numberOfChannels;var buffer=this._niftiImage;var totalNumPixels=numPixels*this.numberOfFrames();var tmp=null;this._orderedData=null;if(this._dataSet.datatypeCode===2){tmp=new Uint8Array(buffer,0,totalNumPixels);this._orderedData=new Uint8Array(tmp.length)}else if(this._dataSet.datatypeCode===256){tmp=new Int8Array(buffer,0,totalNumPixels);this._orderedData=new Int8Array(tmp.length)}else if(this._dataSet.datatypeCode===512){tmp=new Uint16Array(buffer,0,totalNumPixels);this._orderedData=new Uint16Array(tmp.length)}else if(this._dataSet.datatypeCode===4){tmp=new Int16Array(buffer,0,totalNumPixels);this._orderedData=new Int16Array(tmp.length)}else if(this._dataSet.datatypeCode===16){tmp=new Float32Array(buffer,0,totalNumPixels);this._orderedData=new Float32Array(tmp.length)}var numPixels2=tmp.length/3;var rgbaIndex=0;var rIndex=0;var gIndex=numPixels2;var bIndex=numPixels2*2;for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:0;return frameIndex}},{key:"rows",value:function rows(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.sizes[1]}},{key:"columns",value:function columns(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.sizes[0]}},{key:"pixelType",value:function pixelType(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var pixelType=0;if(this._dataSet.type==="float"){pixelType=1}return pixelType}},{key:"bitsAllocated",value:function bitsAllocated(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var bitsAllocated=1;if(this._dataSet.type==="int8"||this._dataSet.type==="uint8"||this._dataSet.type==="char"){bitsAllocated=8}else if(this._dataSet.type==="int16"||this._dataSet.type==="uint16"||this._dataSet.type==="short"){bitsAllocated=16}else if(this._dataSet.type==="int32"||this._dataSet.type==="uint32"||this._dataSet.type==="float"){bitsAllocated=32}return bitsAllocated}},{key:"pixelSpacing",value:function pixelSpacing(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var x=new THREE.Vector3(this._dataSet.spaceDirections[0][0],this._dataSet.spaceDirections[0][1],this._dataSet.spaceDirections[0][2]);var y=new THREE.Vector3(this._dataSet.spaceDirections[1][0],this._dataSet.spaceDirections[1][1],this._dataSet.spaceDirections[1][2]);var z=new THREE.Vector3(this._dataSet.spaceDirections[2][0],this._dataSet.spaceDirections[2][1],this._dataSet.spaceDirections[2][2]);return[x.length(),y.length(),z.length()]}},{key:"sliceThickness",value:function sliceThickness(){return null}},{key:"imageOrientation",value:function imageOrientation(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var invertX=this._dataSet.space.match(/right/)?-1:1;var invertY=this._dataSet.space.match(/anterior/)?-1:1;var x=new THREE.Vector3(this._dataSet.spaceDirections[0][0]*invertX,this._dataSet.spaceDirections[0][1]*invertY,this._dataSet.spaceDirections[0][2]);x.normalize();var y=new THREE.Vector3(this._dataSet.spaceDirections[1][0]*invertX,this._dataSet.spaceDirections[1][1]*invertY,this._dataSet.spaceDirections[1][2]);y.normalize();return[x.x,x.y,x.z,y.x,y.y,y.z]}},{key:"imagePosition",value:function imagePosition(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return[this._dataSet.spaceOrigin[0],this._dataSet.spaceOrigin[1],this._dataSet.spaceOrigin[2]]}},{key:"dimensionIndexValues",value:function dimensionIndexValues(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"instanceNumber",value:function instanceNumber(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return frameIndex}},{key:"windowCenter",value:function windowCenter(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"windowWidth",value:function windowWidth(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"rescaleSlope",value:function rescaleSlope(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return 1}},{key:"rescaleIntercept",value:function rescaleIntercept(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return 0}},{key:"minMaxPixelData",value:function minMaxPixelData(){var pixelData=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var minMax=[65535,-32768];var numPixels=pixelData.length;for(var index=0;index0&&arguments[0]!==undefined?arguments[0]:0;return this._decompressUncompressed(frameIndex)}},{key:"_decompressUncompressed",value:function _decompressUncompressed(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var buffer=this._dataSet.buffer;var numberOfChannels=this.numberOfChannels();var numPixels=this.rows(frameIndex)*this.columns(frameIndex)*numberOfChannels;if(!this.rightHanded()){frameIndex=this.numberOfFrames()-1-frameIndex}var frameOffset=frameIndex*numPixels;if(this._unpackedData===null&&this._dataSet.encoding==="gzip"){var unpackedData=pako.inflate(this._dataSet.buffer);this._unpackedData=unpackedData.buffer;buffer=this._unpackedData}else if(this._dataSet.encoding==="gzip"){buffer=this._unpackedData}if(this._dataSet.type==="int8"||this._dataSet.type==="char"){frameOffset=frameOffset;return new Int8Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="uint8"){frameOffset=frameOffset;return new Uint8Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="int16"||this._dataSet.type==="short"){frameOffset=frameOffset*2;return new Int16Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="uint16"){frameOffset=frameOffset*2;return new Uint16Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="int32"){frameOffset=frameOffset*4;return new Int32Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="uint32"){frameOffset=frameOffset*4;return new Uint32Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="float"){frameOffset=frameOffset*4;return new Float32Array(buffer,frameOffset,numPixels)}}}]);return ParsersNifti}(_parsers2.default);exports.default=ParsersNifti},{"./parsers.volume":124,"nrrd-js":50,pako:51}],124:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i>8&255}},{key:"_swap32",value:function _swap32(val){return(val&255)<<24|(val&65280)<<8|val>>8&65280|val>>24&255}},{key:"invert",value:function invert(){return false}}]);return ParsersVolume}();exports.default=ParsersVolume},{}],125:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:this._base;var rayOrigin=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this._rayOrigin;var rayDirection=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this._rayDirection;var aabbMin=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this._aabbMin;var aabbMax=arguments.length>4&&arguments[4]!==undefined?arguments[4]:this._aabbMax;var tNear=arguments.length>5&&arguments[5]!==undefined?arguments[5]:this._tNear;var tFar=arguments.length>6&&arguments[6]!==undefined?arguments[6]:this._tFar;var intersect=arguments.length>7&&arguments[7]!==undefined?arguments[7]:this._intersect;this._base=baseFragment;return this.compute(rayOrigin,rayDirection,aabbMin,aabbMax,tNear,tFar,intersect)}},{key:"compute",value:function compute(rayOrigin,rayDirection,aabbMin,aabbMax,tNear,tFar,intersect){this.computeDefinition();this._base._functions[this._name]=this._definition;return this._name+"("+rayOrigin+", "+rayDirection+", "+aabbMin+", "+aabbMax+", "+tNear+", "+tFar+", "+intersect+");"}},{key:"computeDefinition",value:function computeDefinition(){this._definition="\nvoid "+this._name+"(vec3 rayOrigin, vec3 rayDirection, vec3 boxMin, vec3 boxMax, out float tNear, out float tFar, out bool intersect){\n // compute intersection of ray with all six bbox planes\n vec3 invRay = vec3(1.) / rayDirection;\n vec3 tBot = invRay * (boxMin - rayOrigin);\n vec3 tTop = invRay * (boxMax - rayOrigin);\n // re-order intersections to find smallest and largest on each axis\n vec3 tMin = min(tTop, tBot);\n vec3 tMax = max(tTop, tBot);\n // find the largest tMin and the smallest tMax\n float largest_tMin = max(max(tMin.x, tMin.y), max(tMin.x, tMin.z));\n float smallest_tMax = min(min(tMax.x, tMax.y), min(tMax.x, tMax.z));\n tNear = largest_tMin;\n tFar = smallest_tMax;\n intersect = smallest_tMax > largest_tMin;\n}\n\n "}}]);return IntersectBox}(_shaders2.default);exports.default=new IntersectBox},{"../shaders.base":131}],126:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:this._base;var dataCoordinates=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this._dataCoordinates;var dataValue=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this._dataValue;var offset=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this._offset;this._base=baseFragment;return this.compute(dataCoordinates,dataValue,offset)}},{key:"compute",value:function compute(dataCoordinates,dataValue,offset){this.computeDefinition();this._base._functions[this._name]=this._definition;return this._name+"("+dataCoordinates+", "+dataValue+", "+offset+");"}},{key:"computeDefinition",value:function computeDefinition(){this._definition="\nvoid "+this._name+"(in ivec3 dataCoordinates, out vec4 dataValue, out int offset){\n \n int index = dataCoordinates.x\n + dataCoordinates.y * uDataDimensions.x\n + dataCoordinates.z * uDataDimensions.y * uDataDimensions.x;\n int indexP = int(index/uPackedPerPixel);\n offset = index - 2*indexP;\n\n // Map data index to right sampler2D texture\n int voxelsPerTexture = uTextureSize*uTextureSize;\n int textureIndex = int(floor(float(indexP) / float(voxelsPerTexture)));\n // modulo seems incorrect sometimes...\n // int inTextureIndex = int(mod(float(index), float(textureSize*textureSize)));\n int inTextureIndex = indexP - voxelsPerTexture*textureIndex;\n\n // Get row and column in the texture\n int colIndex = int(mod(float(inTextureIndex), float(uTextureSize)));\n int rowIndex = int(floor(float(inTextureIndex)/float(uTextureSize)));\n\n // Map row and column to uv\n vec2 uv = vec2(0,0);\n uv.x = (0.5 + float(colIndex)) / float(uTextureSize);\n uv.y = 1. - (0.5 + float(rowIndex)) / float(uTextureSize);\n\n //\n if(textureIndex == 0){ dataValue = texture2D(uTextureContainer[0], uv); }\n else if(textureIndex == 1){dataValue = texture2D(uTextureContainer[1], uv);}\n else if(textureIndex == 2){ dataValue = texture2D(uTextureContainer[2], uv); }\n else if(textureIndex == 3){ dataValue = texture2D(uTextureContainer[3], uv); }\n else if(textureIndex == 4){ dataValue = texture2D(uTextureContainer[4], uv); }\n else if(textureIndex == 5){ dataValue = texture2D(uTextureContainer[5], uv); }\n else if(textureIndex == 6){ dataValue = texture2D(uTextureContainer[6], uv); }\n\n}\n "}}]);return Texture3d}(_shaders2.default);exports.default=new Texture3d},{"../shaders.base":131}],127:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:this._base;var packedData=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this._packedData;var offset=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this._offset;var unpackedData=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this._unpackedData;this._base=baseFragment;return this.compute(packedData,offset,unpackedData)}},{key:"compute",value:function compute(packedData,offset,unpackedData){this.computeDefinition();this._base._functions[this._name]=this._definition;return this._name+"("+packedData+", "+offset+", "+unpackedData+");"}},{key:"computeDefinition",value:function computeDefinition(){var content="";if(this._base._uniforms.uNumberOfChannels.value===1){switch(this._base._uniforms.uBitsAllocated.value){case 1:case 8:content=this.upack8();break;case 16:content=this.upack16();break;case 32:content=this.upack32();break;default:content=this.upackDefault();break}}else{content=this.upackIdentity()}this._definition="\nvoid "+this._name+"(in vec4 packedData, in int offset, out vec4 unpackedData){\n\n"+content+"\n\n} \n "}},{key:"upack8",value:function upack8(){this._base._functions["uInt8"]=this.uInt8();return"\nuInt8(\n packedData.r,\n unpackedData.x);\n "}},{key:"upack16",value:function upack16(){this._base._functions["uInt16"]=this.uInt16();return"\nuInt16(\n packedData.r * float( 1 - offset) + packedData.b * float(offset),\n packedData.g * float( 1 - offset) + packedData.a * float(offset),\n unpackedData.x);\n "}},{key:"upack32",value:function upack32(){if(this._base._uniforms.uPixelType.value===0){this._base._functions["uInt32"]=this.uInt32();return"\nuInt32(\n packedData.r,\n packedData.g,\n packedData.b,\n packedData.a,\n unpackedData.x);\n "}else{this._base._functions["uFloat32"]=this.uFloat32();return"\nuFloat32(\n packedData.r,\n packedData.g,\n packedData.b,\n packedData.a,\n unpackedData.x);\n "}}},{key:"upackIdentity",value:function upackIdentity(){return"\n\nunpackedData = packedData;\n\n "}},{key:"uInt8",value:function uInt8(){return"\nvoid uInt8(in float r, out float value){\n value = r * 256.;\n}\n "}},{key:"uInt16",value:function uInt16(){return"\nvoid uInt16(in float r, in float a, out float value){\n value = r * 256. + a * 65536.;\n}\n "}},{key:"uInt32",value:function uInt32(){return"\nvoid uInt32(in float r, in float g, in float b, in float a, out float value){\n value = r * 256. + g * 65536. + b * 16777216. + a * 4294967296.;\n}\n "}},{key:"uFloat32",value:function uFloat32(){return"\nvoid uFloat32(in float r, in float g, in float b, in float a, out float value){\n\n // create arrays containing bits for rgba values\n // value between 0 and 255\n value = r * 255.;\n int bytemeR[8];\n bytemeR[0] = int(floor(value / 128.));\n value -= float(bytemeR[0] * 128);\n bytemeR[1] = int(floor(value / 64.));\n value -= float(bytemeR[1] * 64);\n bytemeR[2] = int(floor(value / 32.));\n value -= float(bytemeR[2] * 32);\n bytemeR[3] = int(floor(value / 16.));\n value -= float(bytemeR[3] * 16);\n bytemeR[4] = int(floor(value / 8.));\n value -= float(bytemeR[4] * 8);\n bytemeR[5] = int(floor(value / 4.));\n value -= float(bytemeR[5] * 4);\n bytemeR[6] = int(floor(value / 2.));\n value -= float(bytemeR[6] * 2);\n bytemeR[7] = int(floor(value));\n\n value = g * 255.;\n int bytemeG[8];\n bytemeG[0] = int(floor(value / 128.));\n value -= float(bytemeG[0] * 128);\n bytemeG[1] = int(floor(value / 64.));\n value -= float(bytemeG[1] * 64);\n bytemeG[2] = int(floor(value / 32.));\n value -= float(bytemeG[2] * 32);\n bytemeG[3] = int(floor(value / 16.));\n value -= float(bytemeG[3] * 16);\n bytemeG[4] = int(floor(value / 8.));\n value -= float(bytemeG[4] * 8);\n bytemeG[5] = int(floor(value / 4.));\n value -= float(bytemeG[5] * 4);\n bytemeG[6] = int(floor(value / 2.));\n value -= float(bytemeG[6] * 2);\n bytemeG[7] = int(floor(value));\n\n value = b * 255.;\n int bytemeB[8];\n bytemeB[0] = int(floor(value / 128.));\n value -= float(bytemeB[0] * 128);\n bytemeB[1] = int(floor(value / 64.));\n value -= float(bytemeB[1] * 64);\n bytemeB[2] = int(floor(value / 32.));\n value -= float(bytemeB[2] * 32);\n bytemeB[3] = int(floor(value / 16.));\n value -= float(bytemeB[3] * 16);\n bytemeB[4] = int(floor(value / 8.));\n value -= float(bytemeB[4] * 8);\n bytemeB[5] = int(floor(value / 4.));\n value -= float(bytemeB[5] * 4);\n bytemeB[6] = int(floor(value / 2.));\n value -= float(bytemeB[6] * 2);\n bytemeB[7] = int(floor(value));\n\n value = a * 255.;\n int bytemeA[8];\n bytemeA[0] = int(floor(value / 128.));\n value -= float(bytemeA[0] * 128);\n bytemeA[1] = int(floor(value / 64.));\n value -= float(bytemeA[1] * 64);\n bytemeA[2] = int(floor(value / 32.));\n value -= float(bytemeA[2] * 32);\n bytemeA[3] = int(floor(value / 16.));\n value -= float(bytemeA[3] * 16);\n bytemeA[4] = int(floor(value / 8.));\n value -= float(bytemeA[4] * 8);\n bytemeA[5] = int(floor(value / 4.));\n value -= float(bytemeA[5] * 4);\n bytemeA[6] = int(floor(value / 2.));\n value -= float(bytemeA[6] * 2);\n bytemeA[7] = int(floor(value));\n\n // compute float32 value from bit arrays\n\n // sign\n int issigned = 1 - 2 * bytemeR[0];\n // issigned = int(pow(-1., float(bytemeR[0])));\n\n // exponent\n int exponent = 0;\n\n exponent += bytemeR[1] * int(pow(2., 7.));\n exponent += bytemeR[2] * int(pow(2., 6.));\n exponent += bytemeR[3] * int(pow(2., 5.));\n exponent += bytemeR[4] * int(pow(2., 4.));\n exponent += bytemeR[5] * int(pow(2., 3.));\n exponent += bytemeR[6] * int(pow(2., 2.));\n exponent += bytemeR[7] * int(pow(2., 1.));\n\n exponent += bytemeG[0];\n\n\n // fraction\n float fraction = 0.;\n\n fraction = float(bytemeG[1]) * pow(2., -1.);\n fraction += float(bytemeG[2]) * pow(2., -2.);\n fraction += float(bytemeG[3]) * pow(2., -3.);\n fraction += float(bytemeG[4]) * pow(2., -4.);\n fraction += float(bytemeG[5]) * pow(2., -5.);\n fraction += float(bytemeG[6]) * pow(2., -6.);\n fraction += float(bytemeG[7]) * pow(2., -7.);\n\n fraction += float(bytemeB[0]) * pow(2., -8.);\n fraction += float(bytemeB[1]) * pow(2., -9.);\n fraction += float(bytemeB[2]) * pow(2., -10.);\n fraction += float(bytemeB[3]) * pow(2., -11.);\n fraction += float(bytemeB[4]) * pow(2., -12.);\n fraction += float(bytemeB[5]) * pow(2., -13.);\n fraction += float(bytemeB[6]) * pow(2., -14.);\n fraction += float(bytemeB[7]) * pow(2., -15.);\n\n fraction += float(bytemeA[0]) * pow(2., -16.);\n fraction += float(bytemeA[1]) * pow(2., -17.);\n fraction += float(bytemeA[2]) * pow(2., -18.);\n fraction += float(bytemeA[3]) * pow(2., -19.);\n fraction += float(bytemeA[4]) * pow(2., -20.);\n fraction += float(bytemeA[5]) * pow(2., -21.);\n fraction += float(bytemeA[6]) * pow(2., -22.);\n fraction += float(bytemeA[7]) * pow(2., -23.);\n\n value = float(issigned) * pow( 2., float(exponent - 127)) * (1. + fraction);\n}\n "}}]);return Unpack}(_shaders2.default);exports.default=new Unpack},{"../shaders.base":131}],128:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:this._base;var currentVoxel=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this._currentVoxel;var dataValue=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this._dataValue;this._base=baseFragment;return this.compute(currentVoxel,dataValue)}},{key:"compute",value:function compute(currentVoxel,dataValue){this.computeDefinition();this._base._functions[this._name]=this._definition;return this._name+"("+currentVoxel+", "+dataValue+");"}},{key:"computeDefinition",value:function computeDefinition(){this._definition="\nvoid "+this._name+"(in vec3 currentVoxel, out vec4 dataValue){\n // lower bound\n vec3 rcurrentVoxel = vec3(floor(currentVoxel.x + 0.5 ), floor(currentVoxel.y + 0.5 ), floor(currentVoxel.z + 0.5 ));\n ivec3 voxel = ivec3(int(rcurrentVoxel.x), int(rcurrentVoxel.y), int(rcurrentVoxel.z));\n\n vec4 tmp = vec4(0., 0., 0., 0.);\n int offset = 0;\n\n "+_shadersHelpers4.default.api(this._base,"voxel","tmp","offset")+"\n "+_shadersHelpers2.default.api(this._base,"tmp","offset","dataValue")+"\n}\n "}}]);return InterpolationIdentity}(_shaders2.default);exports.default=new InterpolationIdentity},{"../helpers/shaders.helpers.texture3d":126,"../helpers/shaders.helpers.unpack":127,"../shaders.base":131}],129:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _shadersInterpolation=require("./shaders.interpolation.identity");var _shadersInterpolation2=_interopRequireDefault(_shadersInterpolation);var _shadersInterpolation3=require("./shaders.interpolation.trilinear"); +var _shadersInterpolation4=_interopRequireDefault(_shadersInterpolation3);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function shadersInterpolation(baseFragment,currentVoxel,dataValue,gradient){switch(baseFragment._uniforms.uInterpolation.value){case 0:return _shadersInterpolation2.default.api(baseFragment,currentVoxel,dataValue);case 1:return _shadersInterpolation4.default.api(baseFragment,currentVoxel,dataValue,gradient);default:return _shadersInterpolation2.default.api(baseFragment,currentVoxel,dataValue)}}exports.default=shadersInterpolation},{"./shaders.interpolation.identity":128,"./shaders.interpolation.trilinear":130}],130:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:this._base;var currentVoxel=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this._currentVoxel;var dataValue=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this._dataValue;var gradient=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this._gradient;this._base=baseFragment;return this.compute(currentVoxel,dataValue,gradient)}},{key:"compute",value:function compute(currentVoxel,dataValue,gradient){this.computeDefinition();this._base._functions[this._name]=this._definition;return this._name+"("+currentVoxel+", "+dataValue+", "+gradient+");"}},{key:"computeDefinition",value:function computeDefinition(){this._definition="\nvoid "+this._name+"(in vec3 currentVoxel, out vec4 dataValue, out vec3 gradient){\n\n // https://en.wikipedia.org/wiki/Trilinear_interpolation\n vec3 lower_bound = vec3(floor(currentVoxel.x), floor(currentVoxel.y), floor(currentVoxel.z));\n vec3 higher_bound = lower_bound + vec3(1);\n\n float xd = ( currentVoxel.x - lower_bound.x ) / ( higher_bound.x - lower_bound.x );\n float yd = ( currentVoxel.y - lower_bound.y ) / ( higher_bound.y - lower_bound.y );\n float zd = ( currentVoxel.z - lower_bound.z ) / ( higher_bound.z - lower_bound.z );\n\n //\n // c00\n //\n\n //\n\n vec4 v000 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c000 = vec3(lower_bound.x, lower_bound.y, lower_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c000","v000")+"\n vec3 g000 = v000.r * vec3(-1., -1., -1.);\n\n //\n\n vec4 v100 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c100 = vec3(higher_bound.x, lower_bound.y, lower_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c100","v100")+"\n vec3 g100 = v100.r * vec3(1., -1., -1.);\n\n vec4 c00 = v000 * ( 1.0 - xd ) + v100 * xd;\n\n //\n // c01\n //\n vec4 v001 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c001 = vec3(lower_bound.x, lower_bound.y, higher_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c001","v001")+"\n vec3 g001 = v001.r * vec3(-1., -1., 1.);\n\n vec4 v101 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c101 = vec3(higher_bound.x, lower_bound.y, higher_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c101","v101")+"\n vec3 g101 = v101.r * vec3(1., -1., 1.);\n\n vec4 c01 = v001 * ( 1.0 - xd ) + v101 * xd;\n\n //\n // c10\n //\n vec4 v010 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c010 = vec3(lower_bound.x, higher_bound.y, lower_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c010","v010")+"\n vec3 g010 = v010.r * vec3(-1., 1., -1.);\n\n vec4 v110 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c110 = vec3(higher_bound.x, higher_bound.y, lower_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c110","v110")+"\n vec3 g110 = v110.r * vec3(1., 1., -1.);\n\n vec4 c10 = v010 * ( 1.0 - xd ) + v110 * xd;\n\n //\n // c11\n //\n vec4 v011 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c011 = vec3(lower_bound.x, higher_bound.y, higher_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c011","v011")+"\n vec3 g011 = v011.r * vec3(-1., 1., 1.);\n\n vec4 v111 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c111 = vec3(higher_bound.x, higher_bound.y, higher_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c111","v111")+"\n vec3 g111 = v111.r * vec3(1., 1., 1.);\n\n vec4 c11 = v011 * ( 1.0 - xd ) + v111 * xd;\n\n // c0 and c1\n vec4 c0 = c00 * ( 1.0 - yd) + c10 * yd;\n vec4 c1 = c01 * ( 1.0 - yd) + c11 * yd;\n\n // c\n vec4 c = c0 * ( 1.0 - zd) + c1 * zd;\n dataValue = c;\n\n // compute gradient\n gradient = g000 + g100 + g010 + g110 + g011 + g111 + g110 + g011;\n // gradientMagnitude = length(gradient);\n // // https://en.wikipedia.org/wiki/Normal_(geometry)#Transforming_normals\n // vec3 localNormal = (-1. / gradientMagnitude) * gradient;\n // normal = normalize(normalPixelToPatient"+this.id+" * localNormal);\n //normal = gradient;\n\n}\n "}}]);return InterpolationTrilinear}(_shaders2.default);exports.default=new InterpolationTrilinear},{"../shaders.base":131,"./shaders.interpolation.identity":128}],131:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i tFar || accumulatedAlpha >= 1.0 ) break;\n }\n\n gl_FragColor = vec4(accumulatedColor.xyz, accumulatedAlpha);\n}\n "}},{key:"compute",value:function compute(){var shaderInterpolation="";return"\n// uniforms\n"+this.uniforms()+"\n\n// varying (should fetch it from vertex directly)\nvarying vec4 vPos;\n\n// tailored functions\n"+this.functions()+"\n\n// main loop\n"+this._main+"\n "}}]);return ShadersFragment}();exports.default=ShadersFragment},{"./helpers/shaders.helpers.intersectBox":125,"./interpolation/shaders.interpolation":129}],140:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0){this._offset.copy(intersectsTarget[0].point).sub(this._mesh.position)}}else{var intersection=_core2.default.rayPlane(this._raycaster.ray,this._plane);if(intersection!==null){this._offset.copy(intersection).sub(this._plane.position)}}this.update()}}},{key:"onEnd",value:function onEnd(evt){evt.preventDefault();if(this._tracking===true){return}if(!this._dragged&&this._active){this._selected=!this._selected}this._active=false;this._dragged=false;this._controls.enabled=true;this.update()}},{key:"onMove",value:function onMove(evt){evt.preventDefault();this._mouse.set(event.clientX/this._container.offsetWidth*2-1,-(event.clientY/this._container.offsetHeight)*2+1);this._screenPosition=this.worldToScreen(this._worldPosition,this._camera,this._container);this._raycaster.setFromCamera(this._mouse,this._camera);this._raycaster.ray.position=this._raycaster.ray.origin;if(this._active){this._dragged=true;if(this._targetMesh!==null){var intersectsTarget=this._raycaster.intersectObject(this._targetMesh);if(intersectsTarget.length>0){this._worldPosition.copy(intersectsTarget[0].point.sub(this._offset))}}else{if(this._plane.direction.length()===0){this._plane.position.copy(this._worldPosition);this._plane.direction.copy(this._camera.getWorldDirection())}var intersection=_core2.default.rayPlane(this._raycaster.ray,this._plane);if(intersection!==null){this._worldPosition.copy(intersection.sub(this._offset))}}}else{this.onHover(null);if(this._targetMesh===null){this._plane.position.copy(this._worldPosition);this._plane.direction.copy(this._camera.getWorldDirection())}}this.update()}},{key:"onHover",value:function onHover(evt){if(evt){evt.preventDefault();this.hoverDom(evt)}this.hoverMesh();this._hovered=this._meshHovered||this._domHovered;this._container.style.cursor=this._hovered?"pointer":"default"}},{key:"update",value:function update(){this.updateColor();this.updateMeshColor();this.updateMeshPosition();this.updateDOMColor();this.updateDOMPosition()}},{key:"updateMeshColor",value:function updateMeshColor(){if(this._material){this._material.color.set(this._color)}}},{key:"updateMeshPosition",value:function updateMeshPosition(){if(this._mesh){this._mesh.position.x=this._worldPosition.x;this._mesh.position.y=this._worldPosition.y;this._mesh.position.z=this._worldPosition.z}}},{key:"hoverMesh",value:function hoverMesh(){var intersectsHandle=this._raycaster.intersectObject(this._mesh);this._meshHovered=intersectsHandle.length>0}},{key:"hoverDom",value:function hoverDom(evt){this._domHovered=evt.type==="mouseenter"}},{key:"worldToScreen",value:function worldToScreen(worldCoordinate,camera,canvas){var screenCoordinates=worldCoordinate.clone();screenCoordinates.project(camera);screenCoordinates.x=Math.round((screenCoordinates.x+1)*canvas.offsetWidth/2);screenCoordinates.y=Math.round((-screenCoordinates.y+1)*canvas.offsetHeight/2);screenCoordinates.z=0;return screenCoordinates}},{key:"createMesh",value:function createMesh(){this._geometry=new THREE.SphereGeometry(2,32,32);this._material=new THREE.MeshBasicMaterial({wireframe:true,wireframeLinewidth:2});this._mesh=new THREE.Mesh(this._geometry,this._material);this._mesh.position.x=this._worldPosition.x;this._mesh.position.y=this._worldPosition.y;this._mesh.position.z=this._worldPosition.z;this._mesh.visible=true;this.updateMeshColor();this.add(this._mesh)}},{key:"createDOM",value:function createDOM(){this._dom=document.createElement("div");this._dom.setAttribute("id",this.uuid);this._dom.setAttribute("class","widgets handle");this._dom.style.border="2px solid";this._dom.style.backgroundColor="#F9F9F9";this._dom.style.color="#F9F9F9";this._dom.style.position="absolute";this._dom.style.width="12px";this._dom.style.height="12px";this._dom.style.margin="-6px";this._dom.style.borderRadius="50%";this._dom.style.transformOrigin="0 100%";var posY=this._screenPosition.y-this._container.offsetHeight;this._dom.style.transform="translate3D("+this._screenPosition.x+"px, "+posY+"px, 0)";this.updateDOMColor();this._container.appendChild(this._dom)}},{key:"updateDOMPosition",value:function updateDOMPosition(){if(this._dom){var posY=this._screenPosition.y-this._container.offsetHeight;this._dom.style.transform="translate3D("+this._screenPosition.x+"px, "+posY+"px, 0)"}}},{key:"updateDOMColor",value:function updateDOMColor(){this._dom.style.borderColor=""+this._color}},{key:"free",value:function free(){this.removeEventListeners()}},{key:"worldPosition",set:function set(worldPosition){this._worldPosition.copy(worldPosition);this._screenPosition=this.worldToScreen(this._worldPosition,this._camera,this._container);this.update()},get:function get(){return this._worldPosition}},{key:"screenPosition",set:function set(screenPosition){this._screenPosition=screenPosition},get:function get(){return this._screenPosition}},{key:"active",get:function get(){return this._active},set:function set(active){this._active=active;this._controls.enabled=!this._active;this.update()}},{key:"tracking",get:function get(){return this._tracking},set:function set(tracking){this._tracking=tracking;this.update()}}]);return WidgetsHandle}(_widgets2.default);exports.default=WidgetsHandle},{"../../src/core/core.intersections":93,"../../src/widgets/widgets.base":142}],144:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _widgets=require("./widgets.handle");var _widgets2=_interopRequireDefault(_widgets);var _widgets3=require("./widgets.voxelProbe");var _widgets4=_interopRequireDefault(_widgets3);var _widgets5=require("./widgets.ruler");var _widgets6=_interopRequireDefault(_widgets5);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Handle:_widgets2.default,VoxelProbe:_widgets4.default,Ruler:_widgets6.default}},{"./widgets.handle":143,"./widgets.ruler":145,"./widgets.voxelProbe":146}],145:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i=0){this.activateVoxel()}}}},{key:"updateRaycaster",value:function updateRaycaster(raycaster,event,container){this._mouse={x:event.clientX/container.offsetWidth*2-1,y:-(event.clientY/container.offsetHeight)*2+1,screenX:event.clientX,screenY:event.clientY};raycaster.setFromCamera(this._mouse,this._camera)}},{key:"updateColor",value:function updateColor(voxel){if(voxel._active){voxel.color=this._activeColor}else if(voxel.hover){voxel.color=this._hoverColor}else if(voxel.selected){voxel.color=this._selectedColor}else{voxel.color=this._defaultColor}}},{key:"deleteAllSelected",value:function deleteAllSelected(){var i=this._voxels.length;while(i--){var match=this._selected.indexOf(i);if(match>=0){if(this._active===i){this._active=-1}this.remove(this._voxels[i]);this._voxels[i].removeTest();this._voxels.splice(i,1)}}this._selected=[];this._closest=null}},{key:"selectVoxel",value:function selectVoxel(){var selIndex=this._selected.indexOf(this._active);if(selIndex===-1){this._selected.push(this._active);this._voxels[this._active].selected=true;this.updateColor(this._voxels[this._active])}else{this._selected.splice(selIndex,1);this._voxels[this._active].selected=false}}},{key:"activateVoxel",value:function activateVoxel(){if(this._active===-1){var intersects=this._raycaster.intersectObject(this._targetMesh);if(intersects.length>0){if(this._hover>=0||this._closest!==null&&this._voxels[this._closest].distance<10){var index=Math.max(this._hover,this._closest);this._voxels[index]._active=true;this.updateColor(this._voxels[index]);this._active=index;this._controls.enabled=false}}}else{this._voxels[this._active].active=false;this._active=-1;this._controls.enabled=true}}},{key:"createVoxel",value:function createVoxel(){if(this._hover>=0){return}var intersects=this._raycaster.intersectObject(this._targetMesh);if(intersects.length>0){var helpersVoxel=new _helpers2.default(intersects[0].point,this._stack);this.add(helpersVoxel);this._voxels.push(helpersVoxel);helpersVoxel.updateVoxelScreenCoordinates(this._camera,this._container);this.hoverVoxel(helpersVoxel,this._mouse,this._current.voxel.dataCoordinates);this.updateColor(helpersVoxel);helpersVoxel.updateDom(this._container);helpersVoxel.showVoxel=this._showVoxel;helpersVoxel.showDomSVG=this._showDomSVG;helpersVoxel.showDomMeasurements=this._showDomMeasurements}}},{key:"update",value:function update(){if(!this._targetMesh){return}var intersects=this._raycaster.intersectObject(this._targetMesh);if(intersects.length>0){this._current.worldCoordinates=intersects[0].point;this._current.updateVoxelScreenCoordinates(this._camera,this._container);this.updateColor(this._current);this._current.updateDom(this._container);this._current.showVoxel=this._showVoxel;this._current.showDomSVG=this._showDomSVG;this._current.showDomMeasurements=this._showDomMeasurements;if(this._active>=0){this._voxels[this._active].worldCoordinates=intersects[0].point}}this.updateVoxels()}},{key:"updateVoxels",value:function updateVoxels(){var hover=-1;var closest=null;for(var i=0;i=0&&distance<10){helpersVoxel.hover=true}else{helpersVoxel.hover=false}}}},{key:"showOfIntersectsFrame",value:function showOfIntersectsFrame(voxelHelper,frameIndex){if(frameIndex===voxelHelper.voxel.dataCoordinates.z||frameIndex===-1){voxelHelper._showDomSVG=true;voxelHelper._showDomMeasurements=true}else{voxelHelper._showDomSVG=false;voxelHelper._showDomMeasurements=false}}},{key:"defaultColor",set:function set(defaultColor){this._defaultColor=defaultColor;this.update()},get:function get(){return this._defaultColor}},{key:"activeColor",set:function set(activeColor){this._activeColor=activeColor;this.update()},get:function get(){return this._activeColor}},{key:"hoverColor",set:function set(hoverColor){this._hoverColor=hoverColor;this.update()},get:function get(){return this._hoverColor}},{key:"selectedColor",set:function set(selectedColor){this._selectedColor=selectedColor;this.update()},get:function get(){return this._selectedColor}},{key:"showVoxel",set:function set(showVoxel){this._showVoxel=showVoxel;this.update()},get:function get(){return this._showVoxel}},{key:"showDomSVG",set:function set(showDomSVG){this._showDomSVG=showDomSVG;this.update()},get:function get(){return this._showDomSVG}},{key:"showDomMeasurements",set:function set(showDomMeasurements){this._showDomMeasurements=showDomMeasurements;this.update()},get:function get(){return this._showDomMeasurements}}]);return WidgetsVoxelProbe}(THREE.Object3D);exports.default=WidgetsVoxelProbe},{"../../src/helpers/helpers.voxel":110}]},{},[86])(86)}); \ No newline at end of file diff --git a/examples/viewers_labelmap/viewers_labelmap.js b/examples/viewers_labelmap/viewers_labelmap.js index 7ae06957d..b02c68170 100644 --- a/examples/viewers_labelmap/viewers_labelmap.js +++ b/examples/viewers_labelmap/viewers_labelmap.js @@ -27,10 +27,7 @@ let sceneLayer1, meshLayer1, uniformsLayer1, materialLayer1, lutLayer1; let sceneLayerMix, meshLayerMix, uniformsLayerMix, materialLayerMix, lutLayerMix; let layerMix = { - opacity0: 1.0, opacity1: 1.0, - type0: 0, - type1: 1, lut: null }; @@ -392,7 +389,7 @@ let ds2 = [ let customContainer = document.getElementById('my-gui-container'); customContainer.appendChild(gui.domElement); - let layer0Folder = gui.addFolder('Layer 0 (Base)'); + let layer0Folder = gui.addFolder('PET'); layer0Folder.add(stackHelper.slice, 'windowWidth', 1, stack.minMax[1]).step(1).listen(); layer0Folder.add(stackHelper.slice, 'windowCenter', stack.minMax[0], stack.minMax[1]).step(1).listen(); layer0Folder.add(stackHelper.slice, 'intensityAuto'); @@ -415,15 +412,11 @@ let ds2 = [ layer0Folder.open(); // layer mix folder - let layerMixFolder = gui.addFolder('Layer Mix'); + let layerMixFolder = gui.addFolder('Segmentation'); let opacityLayerMix1 = layerMixFolder.add(layerMix, 'opacity1', 0, 1).step(0.01); opacityLayerMix1.onChange(function(value){ uniformsLayerMix.uOpacity1.value = value; }); - let typeLayerMix1 = layerMixFolder.add(layerMix, 'type1', 0, 1).step( 1 ); - typeLayerMix1.onChange(function(value){ - uniformsLayerMix.uType1.value = value; - }); layerMixFolder.open(); @@ -519,19 +512,19 @@ let ds2 = [ } // create material && mesh then add it to sceneLayer1 - uniformsLayer1 = ShadersDataUniform.uniforms(); - uniformsLayer1.uTextureSize.value = stack2.textureSize; - uniformsLayer1.uTextureContainer.value = textures2; - uniformsLayer1.uWorldToData.value = stack2.lps2IJK; - uniformsLayer1.uNumberOfChannels.value = stack2.numberOfChannels; - uniformsLayer1.uPixelType.value = stack2.pixelType; - uniformsLayer1.uBitsAllocated.value = stack2.bitsAllocated; - uniformsLayer1.uWindowCenterWidth.value = [stack2.windowCenter, stack2.windowWidth]; + uniformsLayer1 = ShadersDataUniform.uniforms(); + uniformsLayer1.uTextureSize.value = stack2.textureSize; + uniformsLayer1.uTextureContainer.value = textures2; + uniformsLayer1.uWorldToData.value = stack2.lps2IJK; + uniformsLayer1.uNumberOfChannels.value = stack2.numberOfChannels; + uniformsLayer1.uPixelType.value = stack2.pixelType; + uniformsLayer1.uBitsAllocated.value = stack2.bitsAllocated; + uniformsLayer1.uWindowCenterWidth.value = [stack2.windowCenter, stack2.windowWidth]; uniformsLayer1.uRescaleSlopeIntercept.value = [stack2.rescaleSlope, stack2.rescaleIntercept]; - uniformsLayer1.uDataDimensions.value = [stack2.dimensionsIJK.x, + uniformsLayer1.uDataDimensions.value = [stack2.dimensionsIJK.x, stack2.dimensionsIJK.y, stack2.dimensionsIJK.z]; - uniformsLayer1.uInterpolation.value = 0; + uniformsLayer1.uInterpolation.value = 0; // generate shaders on-demand! let fs = new ShadersDataFragment(uniformsLayer1); diff --git a/lessons/04/04.html b/lessons/04/04.html index 59411f285..aa35fde83 100644 --- a/lessons/04/04.html +++ b/lessons/04/04.html @@ -1,7 +1,7 @@
-
Layer 0
-
Layer 1
+
CT
+
Segmentation
\ No newline at end of file diff --git a/lessons/04/demo.js b/lessons/04/demo.js index 05bf5fbce..8a44e8039 100644 --- a/lessons/04/demo.js +++ b/lessons/04/demo.js @@ -31,11 +31,8 @@ var layer1 = { interpolation: 1 }; - var layerMix = { - opacity1: 1.0, - type0: 0, - type1: 1 + opacity1: 1.0 }; // FUNCTIONS @@ -210,7 +207,7 @@ function buildGUI(stackHelper) { var customContainer = document.getElementById('my-gui-container'); customContainer.appendChild(gui.domElement); - var layer0Folder = gui.addFolder('Layer 0 (Base)'); + var layer0Folder = gui.addFolder('CT'); layer0Folder.add(stackHelper.slice, 'invert'); var lutUpdate = layer0Folder.add(stackHelper.slice, 'lut', lutLayer0.lutsAvailable()); @@ -229,31 +226,12 @@ function buildGUI(stackHelper) { layer0Folder.open(); - - // layer 1 folder - var layer1Folder = gui.addFolder('Layer 1'); - var interpolationLayer1 = layer1Folder.add(layer1, 'interpolation', 0, 1 ).step( 1 ).listen(); - interpolationLayer1.onChange(function(value){ - uniformsLayer1.uInterpolation.value = value; - - // re-compute shaders - let fs = new ShadersDataFragment(uniformsLayer1); - materialLayer1.fragmentShader = fs.compute(); - materialLayer1.needsUpdate = true; - }); - - layer1Folder.open(); - // layer mix folder - var layerMixFolder = gui.addFolder('Layer Mix'); + var layerMixFolder = gui.addFolder('Segmentation'); var opacityLayerMix1 = layerMixFolder.add(layerMix, 'opacity1', 0, 1).step(0.01); opacityLayerMix1.onChange(function(value){ uniformsLayerMix.uOpacity1.value = value; }); - var typeLayerMix1 = layerMixFolder.add(layerMix, 'type1', 0, 1).step( 1 ); - typeLayerMix1.onChange(function(value){ - uniformsLayerMix.uType1.value = value; - }); layerMixFolder.open(); @@ -349,18 +327,19 @@ function handleSeries() { } // create material && mesh then add it to sceneLayer1 - uniformsLayer1 = ShadersDataUniforms.uniforms(); - uniformsLayer1.uTextureSize.value = stack2.textureSize; - uniformsLayer1.uTextureContainer.value = textures2; - uniformsLayer1.uWorldToData.value = stack2.lps2IJK; - uniformsLayer1.uNumberOfChannels.value = stack2.numberOfChannels; - uniformsLayer1.uPixelType.value = stack2.pixelType; - uniformsLayer1.uBitsAllocated.value = stack2.bitsAllocated; - uniformsLayer1.uWindowCenterWidth.value = [stack2.windowCenter, stack2.windowWidth]; + uniformsLayer1 = ShadersDataUniforms.uniforms(); + uniformsLayer1.uTextureSize.value = stack2.textureSize; + uniformsLayer1.uTextureContainer.value = textures2; + uniformsLayer1.uWorldToData.value = stack2.lps2IJK; + uniformsLayer1.uNumberOfChannels.value = stack2.numberOfChannels; + uniformsLayer1.uPixelType.value = stack2.pixelType; + uniformsLayer1.uBitsAllocated.value = stack2.bitsAllocated; + uniformsLayer1.uWindowCenterWidth.value = [stack2.windowCenter, stack2.windowWidth]; uniformsLayer1.uRescaleSlopeIntercept.value = [stack2.rescaleSlope, stack2.rescaleIntercept]; - uniformsLayer1.uDataDimensions.value = [stack2.dimensionsIJK.x, + uniformsLayer1.uDataDimensions.value = [stack2.dimensionsIJK.x, stack2.dimensionsIJK.y, stack2.dimensionsIJK.z]; + uniformsLayer1.uInterpolation.value = 0; // generate shaders on-demand! var fs = new ShadersDataFragment(uniformsLayer1); @@ -435,8 +414,9 @@ function handleSeries() { 'my-lut-canvases-l1', 'default', 'linear', - [[0, 0, 0, 0], [1, 0.913, 0.117, 0.388]], - [[0, 0], [1, 1]]); + stack2.segmentationLUT, + stack2.segmentationLUTO, + true); uniformsLayer1.uLut.value = 1; uniformsLayer1.uTextureLUT.value = lutLayer1.texture; diff --git a/src/loaders/loaders.volume.js b/src/loaders/loaders.volume.js index a3bd75552..4c545fa1e 100644 --- a/src/loaders/loaders.volume.js +++ b/src/loaders/loaders.volume.js @@ -114,7 +114,6 @@ export default class LoadersVolumes extends LoadersBase{ stack.pixelType = volumeParser.pixelType(); stack.invert = volumeParser.invert(); stack.modality = series.modality; - stack.rightHanded = volumeParser.rightHanded(); // if it is a segmentation, attach extra information if(stack.modality === 'SEG'){ // colors @@ -145,7 +144,8 @@ export default class LoadersVolumes extends LoadersBase{ frame.pixelSpacing = dataParser.pixelSpacing(i); frame.sliceThickness = dataParser.sliceThickness(i); frame.imageOrientation = dataParser.imageOrientation(i); - frame.rightHanded = stack.rightHanded; + frame.rightHanded = dataParser.rightHanded(); + stack.rightHanded = frame.rightHanded; if (frame.imageOrientation === null) { frame.imageOrientation = [1, 0, 0, 0, 1, 0]; } From c192962f0c1ac46c01052ee5243250f6ccd55e93 Mon Sep 17 00:00:00 2001 From: nicolasrannou Date: Mon, 28 Nov 2016 17:05:32 +0100 Subject: [PATCH 12/17] update build --- build/ami.js | 6 +++--- build/ami.min.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/ami.js b/build/ami.js index bf807f6c1..f9454bbb9 100644 --- a/build/ami.js +++ b/build/ami.js @@ -37206,7 +37206,6 @@ var LoadersVolumes = function (_LoadersBase) { stack.pixelType = volumeParser.pixelType(); stack.invert = volumeParser.invert(); stack.modality = series.modality; - stack.rightHanded = volumeParser.rightHanded(); // if it is a segmentation, attach extra information if (stack.modality === 'SEG') { // colors @@ -37237,7 +37236,8 @@ var LoadersVolumes = function (_LoadersBase) { frame.pixelSpacing = dataParser.pixelSpacing(i); frame.sliceThickness = dataParser.sliceThickness(i); frame.imageOrientation = dataParser.imageOrientation(i); - frame.rightHanded = stack.rightHanded; + frame.rightHanded = dataParser.rightHanded(); + stack.rightHanded = frame.rightHanded; if (frame.imageOrientation === null) { frame.imageOrientation = [1, 0, 0, 0, 1, 0]; } @@ -44276,4 +44276,4 @@ exports.default = WidgetsVoxelProbe; },{"../../src/helpers/helpers.voxel":110}]},{},[86])(86) }); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJleHRlcm5hbC9zY3JpcHRzL2pwZWcuanMiLCJleHRlcm5hbC9zY3JpcHRzL2pweC5qcyIsIm5vZGVfbW9kdWxlcy9hc3NlcnQvYXNzZXJ0LmpzIiwibm9kZV9tb2R1bGVzL2Jyb3dzZXItcmVzb2x2ZS9lbXB0eS5qcyIsIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5LXpsaWIvbm9kZV9tb2R1bGVzL3Bha28vbGliL3V0aWx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mxlQUMpO1xuICAgICAgICB2YXIgcyA9IHJzICYgMTUsIHIgPSBycyA+PiA0O1xuICAgICAgICBpZiAocyA9PT0gMCkge1xuICAgICAgICAgIGlmIChyIDwgMTUpIHtcbiAgICAgICAgICAgIGVvYnJ1biA9IHJlY2VpdmUocikgKyAoMSA8PCByKSAtIDE7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgICAgayArPSAxNjtcbiAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuICAgICAgICBrICs9IHI7XG4gICAgICAgIHZhciB6ID0gZGN0WmlnWmFnW2tdO1xuICAgICAgICBjb21wb25lbnQuYmxvY2tEYXRhW29mZnNldCArIHpdID0gcmVjZWl2ZUFuZEV4dGVuZChzKSAqICgxIDw8IHN1Y2Nlc3NpdmUpO1xuICAgICAgICBrKys7XG4gICAgICB9XG4gICAgfVxuXG4gICAgdmFyIHN1Y2Nlc3NpdmVBQ1N0YXRlID0gMCwgc3VjY2Vzc2l2ZUFDTmV4dFZhbHVlO1xuICAgIGZ1bmN0aW9uIGRlY29kZUFDU3VjY2Vzc2l2ZShjb21wb25lbnQsIG9mZnNldCkge1xuICAgICAgdmFyIGsgPSBzcGVjdHJhbFN0YXJ0LCBlID0gc3BlY3RyYWxFbmQsIHIgPSAwO1xuICAgICAgd2hpbGUgKGsgPD0gZSkge1xuICAgICAgICB2YXIgeiA9IGRjdFppZ1phZ1trXTtcbiAgICAgICAgc3dpdGNoIChzdWNjZXNzaXZlQUNTdGF0ZSkge1xuICAgICAgICAgIGNhc2UgMDogLy8gaW5pdGlhbCBzdGF0ZVxuICAgICAgICAgICAgdmFyIHJzID0gZGVjb2RlSHVmZm1hbihjb21wb25lbnQuaHVmZm1hblRhYmxlQUMpO1xuICAgICAgICAgICAgdmFyIHMgPSBycyAmIDE1O1xuICAgICAgICAgICAgciA9IHJzID4+IDQ7XG4gICAgICAgICAgICBpZiAocyA9PT0gMCkge1xuICAgICAgICAgICAgICBpZiAociA8IDE1KSB7XG4gICAgICAgICAgICAgICAgZW9icnVuID0gcmVjZWl2ZShyKSArICgxIDw8IHIpO1xuICAgICAgICAgICAgICAgIHN1Y2Nlc3NpdmVBQ1N0YXRlID0gNDtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByID0gMTY7XG4gICAgICAgICAgICAgICAgc3VjY2Vzc2l2ZUFDU3RhdGUgPSAxO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBpZiAocyAhPT0gMSlcbiAgICAgICAgICAgICAgICB0aHJvdyBcImludmFsaWQgQUNuIGVuY29kaW5nXCI7XG4gICAgICAgICAgICAgIHN1Y2Nlc3NpdmVBQ05leHRWYWx1ZSA9IHJlY2VpdmVBbmRFeHRlbmQocyk7XG4gICAgICAgICAgICAgIHN1Y2Nlc3NpdmVBQ1N0YXRlID0gciA/IDIgOiAzO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgY2FzZSAxOiAvLyBza2lwcGluZyByIHplcm8gaXRlbXNcbiAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICBpZiAoY29tcG9uZW50LmJsb2NrRGF0YVtvZmZzZXQgKyB6XSkge1xuICAgICAgICAgICAgICBjb21wb25lbnQuYmxvY2tEYXRhW29mZnNldCArIHpdICs9IChyZWFkQml0KCkgPDwgc3VjY2Vzc2l2ZSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICByLS07XG4gICAgICAgICAgICAgIGlmIChyID09PSAwKVxuICAgICAgICAgICAgICAgIHN1Y2Nlc3NpdmVBQ1N0YXRlID0gc3VjY2Vzc2l2ZUFDU3RhdGUgPT0gMiA/IDMgOiAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSAzOiAvLyBzZXQgdmFsdWUgZm9yIGEgemVybyBpdGVtXG4gICAgICAgICAgICBpZiAoY29tcG9uZW50LmJsb2NrRGF0YVtvZmZzZXQgKyB6XSkge1xuICAgICAgICAgICAgICBjb21wb25lbnQuYmxvY2tEYXRhW29mZnNldCArIHpdICs9IChyZWFkQml0KCkgPDwgc3VjY2Vzc2l2ZSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBjb21wb25lbnQuYmxvY2tEYXRhW29mZnNldCArIHpdID0gc3VjY2Vzc2l2ZUFDTmV4dFZhbHVlIDw8IHN1Y2Nlc3NpdmU7XG4gICAgICAgICAgICAgIHN1Y2Nlc3NpdmVBQ1N0YXRlID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIGNhc2UgNDogLy8gZW9iXG4gICAgICAgICAgICBpZiAoY29tcG9uZW50LmJsb2NrRGF0YVtvZmZzZXQgKyB6XSkge1xuICAgICAgICAgICAgICBjb21wb25lbnQuYmxvY2tEYXRhW29mZnNldCArIHpdICs9IChyZWFkQml0KCkgPDwgc3VjY2Vzc2l2ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBrKys7XG4gICAgICB9XG4gICAgICBpZiAoc3VjY2Vzc2l2ZUFDU3RhdGUgPT09IDQpIHtcbiAgICAgICAgZW9icnVuLS07XG4gICAgICAgIGlmIChlb2JydW4gPT09IDApXG4gICAgICAgICAgc3VjY2Vzc2l2ZUFDU3RhdGUgPSAwO1xuICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIGRlY29kZU1jdShjb21wb25lbnQsIGRlY29kZSwgbWN1LCByb3csIGNvbCkge1xuICAgICAgdmFyIG1jdVJvdyA9IChtY3UgLyBtY3VzUGVyTGluZSkgfCAwO1xuICAgICAgdmFyIG1jdUNvbCA9IG1jdSAlIG1jdXNQZXJMaW5lO1xuICAgICAgdmFyIGJsb2NrUm93ID0gbWN1Um93ICogY29tcG9uZW50Ln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luZTtcbiAgICB9XG5cbiAgICB2YXIgbWN1ID0gMCwgbWFya2VyO1xuICAgIHZhciBtY3VFeHBlY3RlZDtcbiAgICBpZiAoY29tcG9uZW50c0xlbmd0aCA9PSAxKSB7XG4gICAgICBtY3VFeHBlY3RlZCA9IGNvbXBvbmVudHNbMF0uYmxvY2tzUGVyTGluZSAqIGNvbXBvbmVudHNbMF0uYmxvY2tzUGVyQ29sdW1uO1xuICAgIH0gZWxzZSB7XG4gICAgICBtY3VFeHBlY3RlZCA9IG1jdXNQZXJMaW5lICogZnJhbWUubWN1c1BlckNvbHVtbjtcbiAgICB9XG4gICAgaWYgKCFyZXNldEludGVydmFsKSB7XG4gICAgICByZXNldEludGVydmFsID0gbWN1RXhwZWN0ZWQ7XG4gICAgfVxuXG4gICAgdmFyIGgsIHY7XG4gICAgd2hpbGUgKG1jdSA8IG1jdUV4cGVjdGVkKSB7XG4gICAgICAvLyByZXNldCBpbnRlcnZhbCBzdHVmZlxuICAgICAgZm9yIChpID0gMDsgaSA8IGNvbXBvbmVudHNMZW5ndGg7IGkrKykge1xuICAgICAgICBjb21wb25lbnRzW2ldLnByZWQgPSAwO1xuICAgICAgfVxuICAgICAgZW9icnVuID0gMDtcblxuICAgICAgaWYgKGNvbXBvbmVudHNMZW5ndGggPT0gMSkge1xuICAgICAgICBjb21wb25lbnQgPSBjb21wb25lbnRzWzBdO1xuICAgICAgICBmb3IgKG4gPSAwOyBuIDwgcmVzZXRJbnRlcnZhbDsgbisrKSB7XG4gICAgICAgICAgZGVjb2RlQmxvY2soY29tcG9uZW50LCBkZWNvZGVGbiwgbWN1KTtcbiAgICAgICAgICBtY3UrKztcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgZm9yIChuID0gMDsgbiA8IHJlc2V0SW50ZXJ2YWw7IG4rKykge1xuICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBjb21wb25lbnRzTGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGNvbXBvbmVudCA9IGNvbXBvbmVudHNbaV07XG4gICAgICAgICAgICBoID0gY29tcG9uZW50Lmg7XG4gICAgICAgICAgICB2ID0gY29tcG9uZW50LnY7XG4gICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgdjsgaisrKSB7XG4gICAgICAgICAgICAgIGZvciAoayA9IDA7IGsgPCBoOyBrKyspIHtcbiAgICAgICAgICAgICAgICBkZWNvZGVNY3UoY29tcG9uZW50LCBkZWNvZGVGbiwgbWN1LCBqLCBrKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBtY3UrKztcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICAvLyBmaW5kIG1hcmtlclxuICAgICAgYml0c0NvdW50ID0gMDtcbiAgICAgIG1hcmtlciA9IChkYXRhW29mZnNldF0gPDwgOCkgfCBkYXRhW29mZnNldCArIDFdO1xuICAgICAgaWYgKG1hcmtlciA8PSAweEZGMDApIHtcbiAgICAgICAgdGhyb3cgXCJtYXJrZXIgd2FzIG5vdCBmb3VuZFwiO1xuICAgICAgfVxuXG4gICAgICBpZiAobWFya2VyID49IDB4RkZEMCAmJiBtYXJrZXIgPD0gMHhGRkQ3KSB7IC8vIFJTVHhcbiAgICAgICAgb2Zmc2V0ICs9IDI7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBicmVhaztcbiAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gb2Zmc2V0IC0gc3RhcnRPZmZzZXQ7XG4gIH1cblxuICAvLyBBIHBvcnQgb2YgcG9wcGxlcidzIElEQ1QgbWV0aG9kIHdoaWNoIGluIHR1cm4gaXMgdGFrZW4gZnJvbTpcbiAgLy8gICBDaHJpc3RvcGggTG9lZmZsZXIsIEFkcmlhYW4gTGlndGVuYmVyZywgR2VvcmdlIFMuIE1vc2NoeXR6LFxuICAvLyAgIFwiUHJhY3RpY2FsIEZhc3QgMS1EIERDVCBBbGdvcml0aG1zIHdpdG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ArIHJvd10gPSB0O1xuICAgICAgICBwWzQgKyByb3ddID0gdDtcbiAgICAgICAgcFs1ICsgcm93XSA9IHQ7XG4gICAgICAgIHBbNiArIHJvd10gPSB0O1xuICAgICAgICBwWzcgKyByb3ddID0gdDtcbiAgICAgICAgY29udGludWU7XG4gICAgICB9XG5cbiAgICAgIC8vIHN0YWdlIDRcbiAgICAgIHYwID0gKGRjdFNxcnQyICogcFswICsgcm93XSArIDEyOCkgPj4gODtcbiAgICAgIHYxID0gKGRjdFNxcnQyICogcFs0ICsgcm93XSArIDEyOCkgPj4gODtcbiAgICAgIHYyID0gcFsyICsgcm93XTtcbiAgICAgIHYzID0gcFs2ICsgcm93XTtcbiAgICAgIHY0ID0gKGRjdFNxcnQxZDIgKiAocFsxICsgcm93XSAtIHBbNyArIHJvd10pICsgMTI4KSA+PiA4O1xuICAgICAgdjcgPSAoZGN0U3FydDFkMiAqIChwWzEgKyByb3ddICsgcFs3ICsgcm93XSkgKyAxMjgpID4+IDg7XG4gICAgICB2NSA9IHBbMyArIHJvd10gPDwgNDtcbiAgICAgIHY2ID0gcFs1ICsgcm93XSA8PCA0O1xuXG4gICAgICAvLyBzdGFnZSAzXG4gICAgICB0ID0gKHYwIC0gdjEgKyAxKSA+PiAxO1xuICAgICAgdjAgPSAodjAgKyB2MSArIDEpID4+IDE7XG4gICAgICB2MSA9IHQ7XG4gICAgICB0ID0gKHYyICogZGN0U2luNiArIHYzICogZGN0Q29zNiArIDEyOCkgPj4gODtcbiAgICAgIHYyID0gKHYyICogZGN0Q29zNiAtIHYzICogZGN0U2luNiArIDEyOCkgPj4gODtcbiAgICAgIHYzID0gdDtcbiAgICAgIHQgPSAodjQgLSB2NiArIDEpID4+IDE7XG4gICAgICB2NCA9ICh2NCArIHY2ICsgMSkgPj4gMTtcbiAgICAgIHY2ID0gdDtcbiAgICAgIHQgPSAodjcgKyB2NSArIDEpID4+IDE7XG4gICAgICB2NSA9ICh2NyAtIHY1ICsgMSkgPj4gMTtcbi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gaWYgKHBbMSAqIDggKyBjb2xdID09PSAwICYmIHBbMiAqIDggKyBjb2xdID09PSAwICYmIHBbMyAqIDggKyBjb2xdID09PSAwICYmXG4gICAgICAgIHBbNCAqIDggKyBjb2xdID09PSAwICYmIHBbNSAqIDggKyBjb2xdID09PSAwICYmIHBbNiAqIDggKyBjb2xdID09PSAwICYmXG4gICAgICAgIHBbNyAqIDggKyBjb2xdID09PSAwKSB7XG4gICAgICAgIHQgPSAoZGN0U3FydDIgKiBwW2kgKyAwXSArIDgxOTIpID4+IDE0O1xuICAgICAgICBwWzAgKiA4ICsgY29sXSA9IHQ7XG4gICAgICAgIHBbMSAqIDggKyBjb2xdID0gdDtcbiAgICAgICAgcFsyICogOCArIGNvbF0gPSB0O1xuICAgICAgICBwWzMgKiA4ICsgY29sXSA9IHQ7XG4gICAgICAgIHBbNCAqIDggKyBjb2xdID0gdDtcbiAgICAgICAgcFs1ICogOCArIGNvbF0gPSB0O1xuICAgICAgICBwWzYgKiA4ICsgY29sXSA9IHQ7XG4gICAgICAgIHBbNyAqIDggKyBjb2xdID0gdDtcbiAgICAgICAgY29udGludWU7XG4gICAgICB9XG5cbiAgICAgIC8vIHN0YWdlIDRcbiAgICAgIHYwID0gKGRjdFNxcnQyICogcFswICogOCArIGNvbF0gKyAyMDQ4KSA+PiAxMjtcbiAgICAgIHYxID0gKGRjdFNxcnQyICogcFs0ICogOCArIGNvbF0gKyAyMDQ4KSA+PiAxMjtcbiAgICAgIHYyID0gcFsyICogOCArIGNvbF07XG4gICAgICB2MyA9IHBbNiAqIDggKyBjb2xdO1xuICAgICAgdjQgPSAoZGN0U3FydDFkMiAqIChwWzEgKiA4ICsgY29sXSAtIHBbNyAqIDggKyBjb2xdKSArIDIwNDgpID4+IDEyO1xuICAgICAgdjcgPSAoZGN0U3FydDFkMiAqIChwWzEgKiA4ICsgY29sXSArIHBbNyAqIDggKyBjb2xdKSArIDIwNDgpID4+IDEyO1xuICAgICAgdjUgPSBwWzMgKiA4IC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eyAvLyBFT0kgKEVuZCBvZiBpbWFnZSlcbiAgICAgICAgdmFyIGksIGosIGw7XG4gICAgICAgIHN3aXRjaCAoZmlsZU1hcmtlcikge1xuICAgICAgICAgIGNhc2UgMHhGRkUwOiAvLyBBUFAwIChBcHBsaWNhdGlvbiBTcGVjaWZpYylcbiAgICAgICAgICBjYXNlIDB4RkZFMTogLy8gQVBQMVxuICAgICAgICAgIGNhc2UgMHhGRkUyOiAvLyBBUFAyXG4gICAgICAgICAgY2FzZSAweEZGRTM6IC8vIEFQUDNcbiAgICAgICAgICBjYXNlIDB4RkZFNDogLy8gQVBQNFxuICAgICAgICAgIGNhc2UgMHhGRkU1OiAvLyBBUFA1XG4gICAgICAgICAgY2FzZSAweEZGRTY6IC8vIEFQUDZcbiAgICAgICAgICBjYXNlIDB4RkZFNzogLy8gQVBQN1xuICAgICAgICAgIGNhc2UgMHhGRkU4OiAvLyBBUFA4XG4gICAgICAgICAgY2FzZSAweEZGRTk6IC8vIEFQUDlcbiAgICAgICAgICBjYXNlIDB4RkZFQTogLy8gQVBQMTBcbiAgICAgICAgICBjYXNlIDB4RkZFQjogLy8gQVBQMTFcbiAgICAgICAgICBjYXNlIDB4RkZFQzogLy8gQVBQMTJcbiAgICAgICAgICBjYXNlIDB4RkZFRDogLy8gQVBQMTNcbiAgICAgICAgICBjYXNlIDB4RkZFRTogLy8gQVBQMTRcbiAgICAgICAgICBjYXNlIDB4RkZFRjogLy8gQVBQMTVcbiAgICAgICAgICBjYXNlIDB4RkZGRTogLy8gQ09NIChDb21tZW50KVxuICAgICAgICAgICAgdmFyIGFwcERhdGEgPSByZWFkRGF0YUJsb2NrKCk7XG5cbiAgICAgICAgICAgIGlmIChmaWxlTWFya2VyID09PSAweEZGRTApIHtcbiAgICAgICAgICAgICAgaWYgKGFwcERhdGFbMF0gPT09IDB4NEEgJiYgYXBwRGF0YVsxXSA9PT0gMHg0NiAmJiBhcHBEYXRhWzJdID09PSAweDQ5ICYmXG4gICAgICAgICAgICAgICAgYXBwRGF0YVszXSA9PT0gMHg0NiAmJiBhcHBEYXRhWzRdID09PSAwKSB7IC8vICdKRklGXFx4MDAnXG4gICAgICAgICAgICAgICAgamZpZiA9IHtcbiAgICAgICAgICAgICAgICAgIHZlcnNpb246IHttYWpvcjogYXBwRGF0YVs1XSwgbWlub3I6IGFwcERhdGFbNl19LFxuICAgICAgICAgICAgICAgICAgZGVuc2l0eVVuaXRzOiBhcHBEYXRhWzddLFxuICAgICAgICAgICAgICAgICAgeERlbnNpdHk6IChhcHBEYXRhWzhdIDw8IDgpIHwgYXBwRGF0YVs5XSxcbiAgICAgICAgICAgICAgICAgIHlEZW5zaXR5OiAoYXBwRGF0YVsxMF0gPDwgOCkgfCBhcHBEYXRhWzExXSxcbiAgICAgICAgICAgICAgICAgIHRodW1iV2lkdGg6IGFwcERhdGFbMTJdLFxuICAgICAgICAgICAgICAgICAgdGh1bWJIZWlnaHQ6IGFwcERhdGFbMTNdLFxuICAgICAgICAgICAgICAgICAgdGh1bWJEYXRhOiBhcHBEYXRhLnN1YmFycmF5KDE0LCAxNCArIDMgKiBhcHBEYXRhWzEyXSAqIGFwcERhdGFbMTNdKVxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIFRPRE8gQVBQMSAtIEV4aWZcbiAgICAgICAgICAgIGlmIChmaWxlTWFya2VyID09PSAweEZGRUUpIHtcbiAgICAgICAgICAgICAgaWYgKGFwcERhdGFbMF0gPT09IDB4NDEgJiYgYXBwRGF0YVsxXSA9PT0gMHg2NCAmJiBhcHBEYXRhWzJdID09PSAweDZGICYmXG4gICAgICAgICAgICAgICAgYXBwRGF0YVszXSA9PT0gMHg2MiAmJiBhcHBEYXRhWzRdID09PSAweDY1ICYmIGFwcERhdGFbNV0gPT09IDApIHsgLy8gJ0Fkb2JlXFx4MDAnXG4gICAgICAgICAgICAgICAgYWRvYmUgPSB7XG4gICAgICAgICAgICAgICAgICB2ZXJzaW9uOiBhcHBEYXRhWzZdLFxuICAgICAgICAgICAgICAgICAgZmxhZ3MwOiAoYXBwRGF0YVs3XSA8PCA4KSB8IGFwcERhdGFbOF0sXG4gICAgICAgICAgICAgICAgICBmbGFnczE6IChhcHBEYXRhWzldIDw8IDgpIHwgYXBwRGF0YVsxMF0sXG4gICAgICAgICAgICAgICAgICB0cmFuc2Zvcm1Db2RlOiBhcHBEYXRhWzExXVxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSAweEZGREI6IC8vIERRVCAoRGVmaW5lIFF1YW50aXphdGlvbiBUYWJsZXMpXG4gICAgICAgICAgICB2YXIgcXVhbnRpemF0aW9uVGFibGVzTGVuZ3RoID0gcmVhZFVpbnQxNigpO1xuICAgICAgICAgICAgdmFyIHF1YW50aXphdGlvblRhYmxlc0VuZCA9IHF1YW50aXphdGlvblRhYmxlc0xlbmd0aCArIG9mZnNldCAtIDI7XG4gICAgICAgICAgICB3aGlsZSAob2Zmc2V0IDwgcXVhbnRpemF0aW9uVGFibGVzRW5kKSB7XG4gICAgICAgICAgICAgIHZhciBxdWFudGl6YXRpb25UYWJsZVNwZWMgPSBkYXRhW29mZnNldCsrXTtcbiAgICAgICAgICAgICAgdmFyIHRhYmxlRGF0YSA9IG5ldyBJbnQzMkFycmF5KDY0KTtcbiAgICAgICAgICAgICAgaWYgKChxdWFudGl6YXRpb25UYWJsZVNwZWMgPj4gNCkgPT09IDApIHsgLy8gOCBiaXQgdmFsdWVzXG4gICAgICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IDY0OyBqKyspIHtcbiAgICAgICAgICAgICAgICAgIHZhciB6ID0gZGN0WmlnWmFnW2pdO1xuICAgICAgICAgICAgICAgICAgdGFibGVEYXRhW3pdID0gZGF0YVtvZmZzZXQrK107XG4gICAgICAgICAgICAgICAgfVxuICAgICAgIC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BmcmFtZS5wcm9ncmVzc2l2ZSA9IChmaWxlTWFya2VyID09PSAweEZGQzIpO1xuICAgICAgICAgICAgZnJhbWUucHJlY2lzaW9uID0gZGF0YVtvZmZzZXQrK107XG4gICAgICAgICAgICBmcmFtZS5zY2FuTGluZXMgPSByZWFkVWludDE2KCk7XG4gICAgICAgICAgICBmcmFtZS5zYW1wbGVzUGVyTGluZSA9IHJlYWRVaW50MTYoKTtcbiAgICAgICAgICAgIGZyYW1lLmNvbXBvbmVudHMgPSBbXTtcbiAgICAgICAgICAgIGZyYW1lLmNvbXBvbmVudElkcyA9IHt9O1xuICAgICAgICAgICAgdmFyIGNvbXBvbmVudHNDb3VudCA9IGRhdGFbb2Zmc2V0KytdLCBjb21wb25lbnRJZDtcbiAgICAgICAgICAgIHZhciBtYXhIID0gMCwgbWF4ViA9IDA7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgY29tcG9uZW50c0NvdW50OyBpKyspIHtcbiAgICAgICAgICAgICAgY29tcG9uZW50SWQgPSBkYXRhW29mZnNldF07XG4gICAgICAgICAgICAgIHZhciBoID0gZGF0YVtvZmZzZXQgKyAxXSA+PiA0O1xuICAgICAgICAgICAgICB2YXIgdiA9IGRhdGFbb2Zmc2V0ICsgMV0gJiAxNTtcbiAgICAgICAgICAgICAgaWYgKG1heEggPCBoKVxuICAgICAgICAgICAgICAgIG1heEggPSBoO1xuICAgICAgICAgICAgICBpZiAobWF4ViA8IHYpXG4gICAgICAgICAgICAgICAgbWF4ViA9IHY7XG4gICAgICAgICAgICAgIHZhciBxSWQgPSBkYXRhW29mZnNldCArIDJdO1xuICAgICAgICAgICAgICBsID0gZnJhbWUuY29tcG9uZW50cy5wdXNoKHtcbiAgICAgICAgICAgICAgICBoOiBoLFxuICAgICAgICAgICAgICAgIHY6IHYsXG4gICAgICAgICAgICAgICAgcXVhbnRpemF0aW9uVGFibGU6IHF1YW50aXphdGlvblRhYmxlc1txSWRdLFxuICAgICAgICAgICAgICAgIHF1YW50aXphdGlvblRhYmxlSWQ6IHFJZCxcbiAgICAgICAgICAgICAgICBiaXRDb252ZXJzaW9uOiAyNTUgLyAoKDEgPDwgZnJhbWUucHJlY2lzaW9uKSAtIDEpXG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICBmcmFtZS5jb21wb25lbnRJZHNbY29tcG9uZW50SWRdID0gbCAtIDE7XG4gICAgICAgICAgICAgIG9mZnNldCArPSAzO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnJhbWUubWF4SCA9IG1heEg7XG4gICAgICAgICAgICBmcmFtZS5tYXhWID0gbWF4VjtcbiAgICAgICAgICAgIHByZXBhcmVDb21wb25lbnRzKGZyYW1lKTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSAweEZGQzQ6IC8vIERIVCAoRGVmaW5lIEh1ZmZtYW4gVGFibGVzKVxuICAgICAgICAgICAgdmFyIGh1ZmZtYW5MZW5ndGggPSByZWFkVWludDE2KCk7XG4gICAgICAgICAgICBmb3IgKGkgPSAyOyBpIDwgaHVmZm1hbkxlbmd0aDsgKSB7XG4gICAgICAgICAgICAgIHZhciBodWZmbWFuVGFibGVTcGVjID0gZGF0YVtvZmZzZXQrK107XG4gICAgICAgICAgICAgIHZhciBjb2RlTGVuZ3RocyA9IG5ldyBVaW50OEFycmF5KDE2KTtcbiAgICAgICAgICAgICAgdmFyIGNvZGVMZW5ndGhTdW0gPSAwO1xuICAgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgMTY7IGorKywgb2Zmc2V0KyspXG4gICAgICAgICAgICAgICAgY29kZUxlbmd0aFN1bSArPSAoY29kZUxlbmd0aHNbal0gPSBkYXRhW29mZnNldF0pO1xuICAgICAgICAgICAgICB2YXIgaHVmZm1hblZhbHVlcyA9IG5ldyBVaW50OEFycmF5KGNvZGVMZW5ndGhTdW0pO1xuICAgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgY29kZUxlbmd0aFN1bTsgaisrLCBvZmZzZXQrKylcbiAgICAgICAgICAgICAgICBodWZmbWFuVmFsdWVzW2pdID0gZGF0YVtvZmZzZXRdO1xuICAgICAgICAgICAgICBpICs9IDE3ICsgY29kZUxlbmd0aFN1bTtcblxuICAgICAgICAgICAgICAoKGh1ZmZtYW5UYWJsZVNwZWMgPj4gNCkgPT09IDAgP1xuICAgICAgICAgICAgICAgIGh1ZmZtYW5UYWJsZXNEQyA6IGh1ZmZtYW5UYWJsZXNBQylbaHVmZm1hblRhYmxlU3BlYyAmIDE1XSA9XG4gICAgICAgICAgICAgICAgYnVpbGRIdWZmbWFuVGFibGUoY29kZUxlbmd0aHMsIGh1ZmZtYW5WYWx1ZXMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIDB4RkZERDogLy8gRFJJIChEZWZpbmUgUmVzdGFydCBJbnRlcnZhbClcbiAgICAgICAgICAgIHJlYWRVaW50MTYoKTsgLy8gc2tpcCBkYXRhIGxlbmd0aFxuICAgICAgICAgICAgcmVzZXRJbnRlcnZhbCA9IHJlYWRVaW50MTYoKTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSAweEZGREE6IC8vIFNPUyAoU3RhcnQgb2YgU2NhbilcbiAgICAgICAgICAgIHZhciBzY2FuTGVuZ3RoID0gcmVhZFVpbnQxNigpO1xuICAgICAgICAgICAgdmFyIHNlbGVjdG9yc0NvdW50ID0gZGF0YVtvZmZzZXQrK107XG4gICAgICAgICAgICB2YXIgY29tcG9uZW50cyA9IFtdLCBjb21wb25lbnQ7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgc2VsZWN0b3JzQ291bnQ7IGkrKykge1xuICAgICAgICAgICAgICB2YXIgY29tcG9uZW50SW5kZXggPSBmcmFtZS5jb21wb25lbnRJZHNbZGF0YVtvZmZzZXQrK11dO1xuICAgICAgICAgICAgICBjb21wb25lbnQgPSBmcmFtZS5jb21wb25lb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AgICAgICAgICAgICAgLy8gY291bGQgYmUgaW5jb3JyZWN0IGVuY29kaW5nIC0tIGxhc3QgMHhGRiBieXRlIG9mIHRoZSBwcmV2aW91c1xuICAgICAgICAgICAgICAvLyBibG9jayB3YXMgZWF0ZW4gYnkgdGhlIGVuY29kZXJcbiAgICAgICAgICAgICAgb2Zmc2V0IC09IDM7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhyb3cgXCJ1bmtub3duIEpQRUcgbWFya2VyIFwiICsgZmlsZU1hcmtlci50b1N0cmluZygxNik7XG4gICAgICAgIH1cbiAgICAgICAgZmlsZU1hcmtlciA9IHJlYWRVaW50MTYoKTtcbiAgICAgIH1cblxuICAgICAgdGhpcy53aWR0aCA9IGZyYW1lLnNhbXBsZXNQZXJMaW5lO1xuICAgICAgdGhpcy5oZWlnaHQgPSBmcmFtZS5zY2FuTGluZXM7XG4gICAgICB0aGlzLmpmaWYgPSBqZmlmO1xuICAgICAgdGhpcy5hZG9iZSA9IGFkb2JlO1xuICAgICAgdGhpcy5jb21wb25lbnRzID0gW107XG4gICAgICBzd2l0Y2ggKGZyYW1lLmNvbXBvbmVudHMubGVuZ3RoKVxuICAgICAge1xuICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgdGhpcy5jb2xvcnNwYWNlID0gQ29sb3JTcGFjZS5HcmF5c2NhbGU7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgMzpcbiAgICAgICAgICBpZiAodGhpcy5hZG9iZSlcbiAgICAgICAgICAgIHRoaXMuY29sb3JzcGFjZSA9IENvbG9yU3BhY2UuQWRvYmVSR0I7XG4gICAgICAgICAgZWxzZVxuICAgICAgICAgICAgdGhpcy5jb2xvcnNwYWNlID0gQ29sb3JTcGFjZS5SR0I7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgNDpcbiAgICAgICAgICB0aGlzLmNvbG9yc3BhY2UgPSBDb2xvclNwYWNlLkNZTUs7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgdGhpcy5jb2xvcnNwYWNlID0gQ29sb3JTcGFjZS5Vbmtub3duO1xuICAgICAgfVxuICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBmcmFtZS5jb21wb25lbnRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgIHZhciBjb21wb25lbnQgPSBmcmFtZS5jb21wb25lbnRzW2ldO1xuICAgICAgICBpZiAoIWNvbXBvbmVudC5xdWFudGl6YXRpb25UYWJsZSAmJiBjb21wb25lbnQucXVhbnRpemF0aW9uVGFibGVJZCAhPT0gbnVsbClcbiAgICAgICAgICBjb21wb25lbnQucXVhbnRpemF0aW9uVGFibGUgPSBxdWFudGl6YXRpb25UYWJsZXNbY29tcG9uZW50LnF1YW50aXphdGlvblRhYmxlSWRdO1xuICAgICAgICB0aGlzLmNvbXBvbmVudHMucHVzaCh7XG4gICAgICAgICAgb3V0cHV0OiBidWlsZENvbXBvbmVudERhdGEoZnJhbWUsIGNvbXBvbmVudCksXG4gICAgICAgICAgc2NhbGVYOiBjb21wb25lbnQuaCAvIGZyYW1lLm1heEgsXG4gICAgICAgICAgc2NhbGVZOiBjb21wb25lbnQudiAvIGZyYW1lLm1heFYsXG4gICAgICAgICAgYmxvY2tzUGVyTGluZTogY29tcG9uZW50LmJsb2Nrc1BlckxpbmUsXG4gICAgICAgICAgYmxvY2tzUGVyQ29sdW1uOiBjb21wb25lbnQuYmxvY2tzUGVyQ29sdW1uLFxuICAgICAgICAgIGJpdENvbnZlcnNpb246IGNvbXBvbmVudC5iaXRDb252ZXJzaW9uXG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgIH0sXG4gICAgZ2V0RGF0YTE2OiBmdW5jdGlvbiBnZXREYXRhMTYod2lkdGgsIGhlaWdodCkge1xuICAgICAgaWYgKHRoaXMuY29tcG9uZW50cy5sZW5ndGggIT09IDEpXG4gICAgICAgIHRoc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vbmVudC5ibG9ja3NQZXJDb2x1bW47XG4gICAgICAgIHZhciBzYW1wbGVzUGVyTGluZSA9IGJsb2Nrc1BlckxpbmUgPDwgMztcblxuICAgICAgICB2YXIgaiwgaywgbGwgPSAwO1xuICAgICAgICB2YXIgbGluZU9mZnNldCA9IDA7XG4gICAgICAgIGZvciAodmFyIGJsb2NrUm93ID0gMDsgYmxvY2tSb3cgPCBibG9ja3NQZXJDb2x1bW47IGJsb2NrUm93KyspIHtcbiAgICAgICAgICB2YXIgc2NhbkxpbmUgPSBibG9ja1JvdyA8PCAzO1xuICAgICAgICAgIGZvciAodmFyIGJsb2NrQ29sID0gMDsgYmxvY2tDb2wgPCBibG9ja3NQZXJMaW5lOyBibG9ja0NvbCsrKSB7XG4gICAgICAgICAgICB2YXIgYnVmZmVyT2Zmc2V0ID0gZ2V0QmxvY2tCdWZmZXJPZmZzZXQoY29tcG9uZW50LCBibG9ja1JvdywgYmxvY2tDb2wpO1xuICAgICAgICAgICAgdmFyIG9mZnNldCA9IDAsIHNhbXBsZSA9IGJsb2NrQ29sIDw8IDM7XG4gICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgODsgaisrKSB7XG4gICAgICAgICAgICAgIHZhciBsaW5lT2Zmc2V0ID0gKHNjYW5MaW5lICsgaikgKiBzYW1wbGVzUGVyTGluZTtcbiAgICAgICAgICAgICAgZm9yIChrID0gMDsgayA8IDg7IGsrKykge1xuICAgICAgICAgICAgICAgIGxpbmVEYXRhW2xpbmVPZmZzZXQgKyBzYW1wbGUgKyBrXSA9XG4gICAgICAgICAgICAgICAgICBjb21wb25lbnQub3V0cHV0W2J1ZmZlck9mZnNldCArIG9mZnNldCsrXTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGNvbXBvbmVudFNjYWxlWCA9IGNvbXBvbmVudC5zY2FsZVggKiBzY2FsZVg7XG4gICAgICAgIGNvbXBvbmVudFNjY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ZTsgYmxvY2tDb2wrKykge1xuICAgICAgICAgICAgdmFyIGJ1ZmZlck9mZnNldCA9IGdldEJsb2NrQnVmZmVyT2Zmc2V0KGNvbXBvbmVudCwgYmxvY2tSb3csIGJsb2NrQ29sKTtcbiAgICAgICAgICAgIHZhciBvZmZzZXQgPSAwLCBzYW1wbGUgPSBibG9ja0NvbCA8PCAzO1xuICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IDg7IGorKykge1xuICAgICAgICAgICAgICB2YXIgbGluZU9mZnNldCA9IChzY2FuTGluZSArIGopICogc2FtcGxlc1BlckxpbmU7XG4gICAgICAgICAgICAgIGZvciAoayA9IDA7IGsgPCA4OyBrKyspIHtcbiAgICAgICAgICAgICAgICBsaW5lRGF0YVtsaW5lT2Zmc2V0ICsgc2FtcGxlICsga10gPVxuICAgICAgICAgICAgICAgICAgY29tcG9uZW50Lm91dHB1dFtidWZmZXJPZmZzZXQgKyBvZmZzZXQrK10gKiBjb21wb25lbnQuYml0Q29udmVyc2lvbjtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGNvbXBvbmVudFNjYWxlWCA9IGNvbXBvbmVudC5zY2FsZVggKiBzY2FsZVg7XG4gICAgICAgIGNvbXBvbmVudFNjYWxlWSA9IGNvbXBvbmVudC5zY2FsZVkgKiBzY2FsZVk7XG4gICAgICAgIG9mZnNldCA9IGk7XG5cbiAgICAgICAgdmFyIGN4LCBjeTtcbiAgICAgICAgdmFyIGluZGV4O1xuICAgICAgICBmb3IgKHkgPSAwOyB5IDwgaGVpZ2h0OyB5KyspIHtcbiAgICAgICAgICBmb3IgKHggPSAwOyB4IDwgd2lkdGg7IHgrKykge1xuICAgICAgICAgICAgY3kgPSAwIHwgKHkgKiBjb21wb25lbnRTY2FsZVkpO1xuICAgICAgICAgICAgY3ggPSAwIHwgKHggKiBjb21wb25lbnRTY2FsZVgpO1xuICAgICAgICAgICAgaW5k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XG4gICAgICAgICAgICAgIFkgPSBkYXRhW2kgICAgXTtcbiAgICAgICAgICAgICAgQ2IgPSBkYXRhW2kgKyAxXTtcbiAgICAgICAgICAgICAgQ3IgPSBkYXRhW2kgKyAyXTtcblxuICAgICAgICAgICAgICBSID0gY2xhbXBUb1VpbnQ4KFkgLSAxNzkuNDU2ICsgMS40MDIgKiBDcik7XG4gICAgICAgICAgICAgIEcgPSBjbGFtcFRvVWludDgoWSArIDEzNS40NTkgLSAwLjM0NCAqIENiIC0gMC43MTQgKiBDcik7XG4gICAgICAgICAgICAgIEIgPSBjbGFtcFRvVWludDgoWSAtIDIyNi44MTYgKyAxLjc3MiAqIENiKTtcblxuICAgICAgICAgICAgICBkYXRhW2kgICAgXSA9IFI7XG4gICAgICAgICAgICAgIGRhdGFbaSArIDFdID0gRztcbiAgICAgICAgICAgICAgZGF0YVtpICsgMl0gPSBCO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSA0OlxuICAgICAgICAgIGlmICghdGhpcy5hZG9iZSlcbiAgICAgICAgICAgIHRocm93ICdVbnN1cHBvcnRlZCBjb2xvciBtb2RlICg0IGNvbXBvbmVudHMpJztcbiAgICAgICAgICAvLyBUaGUgZGVmYXVsdCB0cmFuc2Zvcm0gZm9yIGZvdXIgY29tcG9uZW50cyBpcyBmYWxzZVxuICAgICAgICAgIGNvbG9yVHJhbnNmb3JtID0gZmFsc2U7XG4gICAgICAgICAgLy8gVGhlIGFkb2JlIHRyYW5zZm9ybSBtYXJrZXIgb3ZlcnJpZGVzIGFueSBwcmV2aW91cyBzZXR0aW5nXG4gICAgICAgICAgaWYgKHRoaXMuYWRvYmUgJiYgdGhpcy5hZG9iZS50cmFuc2Zvcm1Db2RlKVxuICAgICAgICAgICAgY29sb3JUcmFuc2Zvcm0gPSB0cnVlO1xuICAgICAgICAgIGVsc2UgaWYgKHR5cGVvZiB0aGlzLmNvbG9yVHJhbnNmb3JtICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIGNvbG9yVHJhbnNmb3JtID0gISF0aGlzLmNvbG9yVHJhbnNmb3JtO1xuXG4gICAgICAgICAgaWYgKGNvbG9yVHJhbnNmb3JtKSB7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgZGF0YUxlbmd0aDsgaSArPSBudW1Db21wb25lbnRzKSB7XG4gICAgICAgICAgICAgIFkgPSBkYXRhW2ldO1xuICAgICAgICAgICAgICBDYiA9IGRhdGFbaSArIDFdO1xuICAgICAgICAgICAgICBDciA9IGRhdGFbaSArIDJdO1xuXG4gICAgICAgICAgICAgIEMgPSBjbGFtcFRvVWludDgoNDM0LjQ1NiAtIFkgLSAxLjQwMiAqIENyKTtcbiAgICAgICAgICAgICAgTSA9IGNsYW1wVG9VaW50OCgxMTkuNTQxIC0gWSArIDAuMzQ0ICogQ2IgKyAwLjcxNCAqIENyKTtcbiAgICAgICAgICAgICAgWSA9IGNsYW1wVG9VaW50OCg0ODEuODE2IC0gWSAtIDEuNzcyICogQ2IpO1xuXG4gICAgICAgICAgICAgIGRhdGFbaSAgICBdID0gQztcbiAgICAgICAgICAgICAgZGF0YVtpICsgMV0gPSBNO1xuICAgICAgICAgICAgICBkYXRhW2kgKyAyXSA9IFk7XG4gICAgICAgICAgICAgIC8vIEsgaXMgdW5jaGFuZ2VkXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGJyZWFrO1xuICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgIHRocm93ICdVbnN1cHBvcnRlZCBjb2xvciBtb2RlJztcbiAgICAgIH1cbiAgICAgIHJldHVybiBkYXRhO1xuICAgIH1cbiAgfTtcblxuICByZXR1cm4gY29uc3RydWN0b3I7XG59KSgpO1xuXG52YXIgbW9kdWxlVHlwZSA9IHR5cGVvZiBtb2R1bGU7XG5pZiAoKG1vZHVsZVR5cGUgIT09ICd1bmRlZmluZWQnKSAmJiBtb2R1bGUuZXhw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zaXRpb24pO1xuICAgICAgICAgIHBvc2l0aW9uICs9IDI7XG5cbiAgICAgICAgICB2YXIgbGVuZ3RoID0gMCwgaiwgc3FjZCwgc3BxY2RzLCBzcHFjZFNpemUsIHNjYWxhckV4cG91bmRlZCwgdGlsZTtcbiAgICAgICAgICBzd2l0Y2ggKGNvZGUpIHtcbiAgICAgICAgICAgIGNhc2UgMHhGRjRGOiAvLyBTdGFydCBvZiBjb2Rlc3RyZWFtIChTT0MpXG4gICAgICAgICAgICAgIGNvbnRleHQubWFpbkhlYWRlciA9IHRydWU7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAweEZGRDk6IC8vIEVuZCBvZiBjb2Rlc3RyZWFtIChFT0MpXG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAweEZGNTE6IC8vIEltYWdlIGFuZCB0aWxlIHNpemUgKFNJWilcbiAgICAgICAgICAgICAgbGVuZ3RoID0gcmVhZFVpbnQxNihkYXRhLCBwb3NpdGlvbik7XG4gICAgICAgICAgICAgIHZhciBzaXogPSB7fTtcbiAgICAgICAgICAgICAgc2l6LlhzaXogPSByZWFkVWludDMyKGRhdGEsIHBvc2l0aW9uICsgNCk7XG4gICAgICAgICAgICAgIHNpei5Zc2l6ID0gcmVhZFVpbnQzMihkYXRhLCBwb3NpdGlvbiArIDgpO1xuICAgICAgICAgICAgICBzaXouWE9zaXogPSByZWFkVWludDMyKGRhdGEsIHBvc2l0aW9uICsgMTIpO1xuICAgICAgICAgICAgICBzaXouWU9zaXogPSByZWFkVWludDMyKGRhdGEsIHBvc2l0aW9uICsgMTYpO1xuICAgICAgICAgICAgICBzaXouWFRzaXogPSByZWFkVWludDMyKGRhdGEsIHBvc2l0aW9uICsgMjApO1xuICAgICAgICAgICAgICBzaXouWVRzaXogPSByZWFkVWludDMyKGRhdGEsIHBvc2l0aW9uICsgMjQpO1xuICAgICAgICAgICAgICBzaXouWFRPc2l6ID0gcmVhZFVpbnQzMihkYXRhLCBwb3NpdGlvbiArIDI4KTtcbiAgICAgICAgICAgICAgc2l6LllUT3NpeiA9IHJlYWRVaW50MzIoZGF0YSwgcG9zaXRpb24gKyAzMik7XG4gICAgICAgICAgICAgIHZhciBjb21wb25lbnRzQ291bnQgPSByZWFkVWludDE2KGRhdGEsIHBvc2l0aW9uICsgMzYpO1xuICAgICAgICAgICAgICBzaXouQ3NpeiA9IGNvbXBvbmVudHNDb3VudDtcbiAgICAgICAgICAgICAgdmFyIGNvbXBvbmVudHMgPSBbXTtcbiAgICAgICAgICAgICAgaiA9IHBvc2l0aW9uICsgMzg7XG4gICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY29tcG9uZW50c0NvdW50OyBpKyspIHtcbiAgICAgICAgICAgICAgICB2YXIgY29tcG9uZW50ID0ge1xuICAgICAgICAgICAgICAgICAgcHJlY2lzaW9uOiAoZGF0YVtqXSAmIDB4N0YpICsgMSxcbiAgICAgICAgICAgICAgICAgIGlzU2lnbmVkOiAhIShkYXRhW2pdICYgMHg4MCksXG4gICAgICAgICAgICAgICAgICBYUnNpejogZGF0YVtqICsgMV0sXG4gICAgICAgICAgICAgICAgICBZUnNpejogZGF0YVtqICsgMV1cbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIGNhbGN1bGF0ZUNvbXBvbmVudERpbWVuc2lvbnMoY29tcG9uZW50LCBzaXopO1xuICAgICAgICAgICAgICAgIGNvbXBvbmVudHMucHVzaChjb21wb25lbnQpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGNvbnRleHQuU0laID0gc2l6O1xuICAgICAgICAgICAgICBjb250ZXh0LmNvbXBvbmVudHMgPSBjb21wb25lbnRzO1xuICAgICAgICAgICAgICBjYWxjdWxhdGVUaWxlR3JpZHMoY29udGV4dCwgY29tcG9uZW50cyk7XG4gICAgICAgICAgICAgIGNvbnRleHQuUUNDID0gW107XG4gICAgICAgICAgICAgIGNvbnRleHQuQ09DID0gW107XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAweEZGNUM6IC8vIFF1YW50aXphdGlvbiBkZWZhdWx0IChRQ0QpXG4gICAgICAgICAgICAgIGxlbmd0aCA9IHJlYWRVaW50MTYoZGF0YSwgcG9zaXRpb24pO1xuICAgICAgICAgICAgICB2YXIgcWNkID0ge307XG4gICAgICAgICAgICAgIGogPSBwb3NpdGlvbiArIDI7XG4gICAgICAgICAgICAgIHNxY2QgPSBkYXRhW2orK107XG4gICAgICAgICAgICAgIHN3aXRjaCAoc3FjZCAmIDB4MUYpIHtcbiAgICAgICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgICBzcHFjZFNpemUgPSA4O1xuICAgICAgICAgICAgICAgICAgc2NhbGFyRXhwb3VuZGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICAgIHNwcWNkU2l6ZSA9IDE2O1xuICAgICAgICAgICAgICAgICAgc2NhbGFyRXhwb3VuZGVkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICAgICAgICBzcHFjZFNpemUgPSAxNjtcbiAgICAgICAgICAgICAgICAgIHNjYWxhckV4cG91bmRlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdKUFggRXJyb3I6IEludmFsaWQgU1FjZCB2YWx1ZSAnICsgc3FjZCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgcWNkLm5vUXVhbnRpemF0aW9uID0gKHNwcWNkU2l6ZSA9PT0gOCk7XG4gICAgICAgICAgICAgIHFjZC5zY2FsYXJFeHBvdW5kZWQgPSBzY2FsYXJFeHBvdW5kZWQ7XG4gICAgICAgICAgICAgIHFjZC5ndWFyZEJpdHMgPSBzcWNkID4+IDU7XG4gICAgICAgICAgICAgIHNwcWNkcyA9IFtdO1xuICAgICAgICAgICAgICB3aGlsZSAoaiA8IGxlbmd0aCArIHBvc2l0aW9uKSB7XG4gICAgICAgICAgICAgICAgdmFyIHNwcWNkID0ge307XG4gICAgICAgICAgICAgICAgaWYgKHNwcWNkU2l6ZSA9PT0gOCkge1xuICAgICAgICAgICAgICAgICAgc3BxY2QuZXBzaWxvbiA9IGRhdGFbaisrXSA+PiAzO1xuICAgICAgICAgICAgICAgICAgc3BxY2QubXUgPSAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICBzcHFjZC5lcHNpbG9uID0gZGF0YVtqXSA+PiAzO1xuICAgICAgICAgICAgICAgICAgc3BxY2QubXUgPSAoKGRhdGFbal0gJiAweDcpIDw8IDgpIHwgZGF0YVtqICsgMV07XG4gICAgICAgICAgICAgICAgICBqICs9IDI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHNwcWNkcy5wdXNoKHNwcWNkKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBxY2QuU1BxY2RzID0gc3BxY2RzO1xuICAgICAgICAgICAgICBpZiAoY29udGV4dC5tYWluSGVhZGVyKSB7XG4gICAgICAgICAgICAgICAgY29udGV4dC5RQ0QgPSBxY2Q7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgY29udGV4dC5jdXJyZW50VGlsZS5RQ0QgPSBxY2Q7XG4gICAgICAgICAgICAgICAgY29udGV4dC5jdXJyZW50VGlsZS5RQ0MgPSBbXTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMHhGRjVEOiAvLyBRdWFudGl6YXRpb24gY29tcG9uZW50IChRQ0MpXG4gICAgICAgICAgICAgIGxlbmd0aCA9IHJlYWRVaW50MTYoZGF0YSwgcG9zaXRpb24pO1xuICAgICAgICAgICAgICB2YXIgcWNjID0ge307XG4gICAgICAgICAgICAgIGogPSBwb3NpdGlvbiArIDI7XG4gICAgICAgICAgICAgIHZhciBjcWNjO1xuICAgICAgICAgICAgICBpZiAoY29udGV4dC5TSVouQ3NpeiA8IDI1Nykge1xuICAgICAgICAgICAgICAgIGNxY2MgPSBkYXRhW2orK107XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgY3FjYyA9IHJlYWRVaW50MTYoZGF0YSwgaik7XG4gICAgICAgICAgICAgICAgaiArPSAyO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHNxY2QgPSBkYXRhW2orK107XG4gICAgICAgICAgICAgIHN3aXRjaCAoc3FjZCAmIDB4MUYpIHtcbiAgICAgICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgICBzcHFjZFNpemUgPSA4O1xuICAgICAgICAgICAgICAgICAgc2NhbGFyRXhwb3VuZGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICAgIHNwcWNkU2l6ZSA9IDE2O1xuICAgICAgICAgICAgICAgICAgc2NhbGFyRXhwb3VuZGVkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICAgICAgICBzcHFjZFNpemUgPSAxNjtcbiAgICAgICAgICAgICAgICAgIHNjYWxhckV4cG91bmRlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdKUFggRXJyb3I6IEludmFsaWQgU1FjZCB2YWx1ZSAnICsgc3FjZCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgcWNjLm5vUXVhbnRpemF0aW9uID0gKHNwcWNkU2l6ZSA9PT0gOCk7XG4gICAgICAgICAgICAgIHFjYy5zY2FsYXJFeHBvdW5kZWQgPSBzY2FsYXJFeHBvdW5kZWQ7XG4gICAgICAgICAgICAgIHFjYy5ndWFyZEJpdHMgPSBzcWNkID4+IDU7XG4gICAgICAgICAgICAgIHNwcWNkcyA9IFtdO1xuICAgICAgICAgICAgICB3aGlsZSAoaiA8IChsZW5ndGggKyBwb3NpdGlvbikpIHtcbiAgICAgICAgICAgICAgICBzcHFjZCA9IHt9O1xuICAgICAgICAgICAgICAgIGlmIChzcHFjZFNpemUgPT09IDgpIHtcbiAgICAgICAgICAgICAgICAgIHNwcWNkLmVwc2lsb24gPSBkYXRhW2orK10gPj4gMztcbiAgICAgICAgICAgICAgICAgIHNwcWNkLm11ID0gMDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgc3BxY2QuZXBzaWxvbiA9IGRhdGFbal0gPj4gMztcbiAgICAgICAgICAgICAgICAgIHNwcWNkLm11ID0gKChkYXRhW2pdICYgMHg3KSA8PCA4KSB8IGRhdGFbaiArIDFdO1xuICAgICAgICAgICAgICAgICAgaiArPSAyO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBzcHFjZHMucHVzaChzcHFjZCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgcWNjLlNQcWNkcyA9IHNwcWNkcztcbiAgICAgICAgICAgICAgaWYgKGNvbnRleHQubWFpbkhlYWRlcikge1xuICAgICAgICAgICAgICAgIGNvbnRleHQuUUNDW2NxY2NdID0gcWNjO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGNvbnRleHQuY3VycmVudFRpbGUuUUNDW2NxY2NdID0gcWNjO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAweEZGNTI6IC8vIENvZGluZyBzdHlsZSBkZWZhdWx0IChDT0QpXG4gICAgICAgICAgICAgIGxlbmd0aCA9IHJlYWRVaW50MTYoZGF0YSwgcG9zaXRpb24pO1xuICAgICAgICAgICAgICB2YXIgY29kID0ge307XG4gICAgICAgICAgICAgIGogPSBwb3NpdGlvbiArIDI7XG4gICAgICAgICAgICAgIHZhciBzY29kID0gZGF0YVtqKytdO1xuICAgICAgICAgICAgICBjb2QuZW50cm9weUNvZGVyV2l0aEN1c3RvbVByZWNpbmN0cyA9ICEhKHNjb2QgJiAxKTtcbiAgICAgICAgICAgICAgY29kLnNvcE1hcmtlclVzZWQgPSAhIShzY29kICYgMik7XG4gICAgICAgICAgICAgIGNvZC5lcGhNYXJrZXJVc2VkID0gISEoc2NvZCAmIDQpO1xuICAgICAgICAgICAgICBjb2QucHJvZ3Jlc3Npb25PcmRlciA9IGRhdGFbaisrXTtcbiAgICAgICAgICAgICAgY29kLmxheWVyc0NvdW50ID0gcmVhZFVpbnQxNihkYXRhLCBqKTtcbiAgICAgICAgICAgICAgaiArPSAyO1xuICAgICAgICAgICAgICBjb2QubXVsdGlwbGVDb21wb25lbnRUcmFuc2Zvcm0gPSBkYXRhW2orK107XG5cbiAgICAgICAgICAgICAgY29kLmRlY29tcG9zaXRpb25MZXZlbHNDb3VudCA9IGRhdGFbaisrXTtcbiAgICAgICAgICAgICAgY29kLnhjYiA9IChkYXRhW2orK10gJiAweEYpICsgMjtcbiAgICAgICAgICAgICAgY29kLnljYiA9IChkYXRhW2orK10gJiAweEYpICsgMjtcbiAgICAgICAgICAgICAgdmFyIGJsb2NrU3R5bGUgPSBkYXRhW2orK107XG4gICAgICAgICAgICAgIGNvZC5zZWxlY3RpdmVBcml0aG1ldGljQ29kaW5nQnlwYXNzID0gISEoYmxvY2tTdHlsZSAmIDEpO1xuICAgICAgICAgICAgICBjb2QucmVzZXRDb250ZXh0UHJvYmFiaWxpdGllcyA9ICEhKGJsb2NrU3R5bGUgJiAyKTtcbiAgICAgICAgICAgICAgY29kLnRlcm1pbmF0aW9uT25FYWNoQ29kaW5nUGFzcyA9ICEhKGJsb2NrU3R5bGUgJiA0KTtcbiAgICAgICAgICAgICAgY29kLnZlcnRpY2FseVN0cmlwZSA9ICEhKGJsb2NrU3R5bGUgJiA4KTtcbiAgICAgICAgICAgICAgY29kLnByZWRpY3RhYmxlVGVybWluYXRpb24gPSAhIShibG9ja1N0eWxlICYgMTYpO1xuICAgICAgICAgICAgICBjb2Quc2VnbWVudGF0aW9uU3ltYm9sVXNlZCA9ICEhKGJsb2NrU3R5bGUgJiAzMik7XG4gICAgICAgICAgICAgIGNvZC5yZXZlcnNpYmxlVHJhbnNmb3JtYXRpb24gPSBkYXRhW2orK107XG4gICAgICAgICAgICAgIGlmIChjb2QuZW50cm9weUNvZGVyV2l0aEN1c3RvbVByZWNpbmN0cykge1xuICAgICAgICAgICAgICAgIHZhciBwcmVjaW5jdHNTaXplcyA9IFtdO1xuICAgICAgICAgICAgICAgIHdoaWxlIChqIDwgbGVuZ3RoICsgcG9zaXRpb24pIHtcbiAgICAgICAgICAgICAgICAgIHZhciBwcmVjaW5jdHNTaXplID0gZGF0YVtqKytdO1xuICAgICAgICAgICAgICAgICAgcHJlY2luY3RzU2l6ZXMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgIFBQeDogcHJlY2luY3RzU2l6ZSAmIDB4RixcbiAgICAgICAgICAgICAgICAgICAgUFB5OiBwcmVjaW5jdHNTaXplID4+IDRcbiAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb2QucHJlY2luY3RzU2l6ZXMgPSBwcmVjaW5jdHNTaXplcztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB2YXIgdW5zdXBwb3J0ZWQgPSBbXTtcbiAgICAgICAgICAgICAgaWYgKGNvZC5zZWxlY3RpdmVBcml0aG1ldGljQ29kaW5nQnlwYXNzKSB7XG4gICAgICAgICAgICAgICAgdW5zdXBwb3J0ZWQucHVzaCgnc2VsZWN0aXZlQXJpdGhtZXRpY0NvZGluZ0J5cGFzcycpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChjb2QucmVzZXRDb250ZXh0UHJvYmFiaWxpdGllcykge1xuICAgICAgICAgICAgICAgIHVuc3VwcG9ydGVkLnB1c2goJ3Jlc2V0Q29udGV4dFByb2JhYmlsaXRpZXMnKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAoY29kLnRlcm1pbmF0aW9uT25FYWNoQ29kaW5nUGFzcykge1xuICAgICAgICAgICAgICAgIHVuc3VwcG9ydGVkLnB1c2goJ3Rlcm1pbmF0aW9uT25FYWNoQ29kaW5nUGFzcycpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChjb2QudmVydGljYWx5U3RyaXBlKSB7XG4gICAgICAgICAgICAgICAgdW5zdXBwb3J0ZWQucHVzaCgndmVydGljYWx5U3RyaXBlJyk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKGNvZC5wcmVkaWN0YWJsZVRlcm1pbmF0aW9uKSB7XG4gICAgICAgICAgICAgICAgdW5zdXBwb3J0ZWQucHVzaCgncHJlZGljdGFibGVUZXJtaW5hdGlvbicpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmICh1bnN1cHBvcnRlZC5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgZG9Ob3RSZWNvdmVyID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0pQWCBFcnJvcjogVW5zdXBwb3J0ZWQgQ09EIG9wdGlvbnMgKCcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnN1cHBvcnRlZC5qb2luKCcsICcpICsgJyknKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAoY29udGV4dC5tYWluSGVhZGVyKSB7XG4gICAgICAgICAgICAgICAgY29udGV4dC5DT0QgPSBjb2Q7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgY29udGV4dC5jdXJyZW50VGlsZS5DT0QgPSBjb2Q7XG4gICAgICAgICAgICAgICAgY29udGV4dC5jdXJyZW50VGlsZS5DT0MgPSBbXTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMHhGRjkwOiAvLyBTdGFydCBvZiB0aWxlLXBhcnQgKFNPVClcbiAgICAgICAgICAgICAgbGVuZ3RoID0gcmVhZFVpbnQxNihkYXRhLCBwb3NpdGlvbik7XG4gICAgICAgICAgICAgIHRpbGUgPSB7fTtcbiAgICAgICAgICAgICAgdGlsZS5pbmRleCA9IHJlYWRVaW50MTYoZGF0YSwgcG9zaXRpb24gKyAyKTtcbiAgICAgICAgICAgICAgdGlsZS5sZW5ndGggPSByZWFkVWludDMyKGRhdGEsIHBvc2l0aW9uICsgNCk7XG4gICAgICAgICAgICAgIHRpbGUuZGF0YUVuZCA9IHRpbGUubGVuZ3RoICsgcG9zaXRpb24gLSAyO1xuICAgICAgICAgICAgICB0aWxlLnBhcnRJbmRleCA9IGRhdGFbcG9zaXRpb24gKyA4XTtcbiAgICAgICAgICAgICAgdGlsZS5wYXJ0c0NvdW50ID0gZGF0YVtwb3NpdGlvbiArIDldO1xuXG4gICAgICAgICAgICAgIGNvbnRleHQubWFpbkhlYWRlciA9IGZhbHNlO1xuICAgICAgICAgICAgICBpZiAodGlsZS5wYXJ0SW5kZXggPT09IDApIHtcbiAgICAgICAgICAgICAgICAvLyByZXNldCBjb21wb25lbnQgc3BlY2lmaWMgc2V0dGluZ3NcbiAgICAgICAgICAgICAgICB0aWxlLkNPRCA9IGNvbnRleHQuQ09EO1xuICAgICAgICAgICAgICAgIHRpbGUuQ09DID0gY29udGV4dC5DT0Muc2xpY2UoMCk7IC8vIGNsb25lIG9mIHRoZSBnbG9iYWwgQ09DXG4gICAgICAgICAgICAgICAgdGlsZS5RQ0QgPSBjb250ZXh0LlFDRDtcbiAgICAgICAgICAgICAgICB0aWxlLlFDQyA9IGNvbnRleHQuUUNDLnNsaWNlKDApOyAvLyBjbG9uZSBvZiB0aGUgZ2xvYmFsIENPQ1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGNvbnRleHQuY3VycmVudFRpbGUgPSB0aWxlO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMHhGRjkzOiAvLyBTdGFydCBvZiBkYXRhIChTT0QpXG4gICAgICAgICAgICAgIHRpbGUgPSBjb250ZXh0LmN1cnJlbnRUaWxlO1xuICAgICAgICAgICAgICBpZiAodGlsZS5wYXJ0SW5kZXggPT09IDApIHtcbiAgICAgICAgICAgICAgICBpbml0aWFsaXplVGlsZShjb250ZXh0LCB0aWxlLmluZGV4KTtcbiAgICAgICAgICAgICAgICBidWlsZFBhY2tldHMoY29udGV4dCk7XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAvLyBtb3ZpbmcgdG8gdGhlIGVuZCBvZiB0aGUgZGF0YVxuICAgICAgICAgICAgICBsZW5ndGggPSB0aWxlLmRhdGFFbmQgLSBwb3NpdGlvbjtcbiAgICAgICAgICAgICAgcGFyc2VUaWxlUGFja2V0cyhjb250ZXh0LCBkYXRhLCBwb3NpdGlvbiwgbGVuZ3RoKTtcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDB4RkY1NTogLy8gVGlsZS1wYXJ0IGxlbmd0aHMsIG1haW4gaGVhZGVyIChUTE0pXG4gICAgICAgICAgICBjYXNlIDB4RkY1NzogLy8gUGFja2V0IGxlbmd0aCwgbWFpbiBoZWFkZXIgKFBMTSlcbiAgICAgICAgICAgIGNhc2UgMHhGRjU4OiAvLyBQYWNrZXQgbGVuZ3RoLCB0aWxlLXBhcnQgaGVhZGVyIChQTFQpXG4gICAgICAgICAgICBjYXNlIDB4RkY2NDogLy8gQ29tbWVudCAoQ09NKVxuICAgICAgICAgICAgICBsZW5ndGggPSByZWFkVWludDE2KGRhdGEsIHBvc2l0aW9uKTtcbiAgICAgICAgICAgICAgLy8gc2tpcHBpbmcgY29udGVudFxuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMHhGRjUzOiAvLyBDb2Rpbmcgc3R5bGUgY29tcG9uZW50IChDT0MpXG4gICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignSlBYIEVycm9yOiBDb2Rlc3RyZWFtIGNvZGUgMHhGRjUzIChDT0MpIGlzICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ25vdCBpbXBsZW1lbnRlZCcpO1xuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdKUFggRXJyb3I6IFVua25vd24gY29kZXN0cmVhbSBjb2RlOiAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGUudG9TdHJpbmcoMTYpKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcG9zaXRpb24gKz0gbGVuZ3RoO1xuICAgICAgICB9XG4gICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgIGlmIChkb05vdFJlY292ZXIgfHwgdGhpcy5mYWlsT25Db3JydXB0ZWRJbWFnZSkge1xuICAgICAgICAgIHRocm93IGU7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgd2FybignVHJ5aW5nIHRvIHJlY292ZXIgZnJvbSAnICsgZS5tZXNzYWdlKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgdGhpcy50aWxlcyA9IHRyYW5zZm9ybUNvbXBvbmVudHMoY29udGV4dCk7XG4gICAgICB0aGlzLndpZHRoID0gY29udGV4dC5TSVouWHNpeiAtIGNvbnRleHQuU0laLlhPc2l6O1xuICAgICAgdGhpcy5oZWlnaHQgPSBjb250ZXh0LlNJWi5Zc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iAgICBmb3IgKHZhciBxID0gMDsgcSA8IG51bVl0aWxlczsgcSsrKSB7XG4gICAgICBmb3IgKHZhciBwID0gMDsgcCA8IG51bVh0aWxlczsgcCsrKSB7XG4gICAgICAgIHRpbGUgPSB7fTtcbiAgICAgICAgdGlsZS50eDAgPSBNYXRoLm1heChzaXouWFRPc2l6ICsgcCAqIHNpei5YVHNpeiwgc2l6LlhPc2l6KTtcbiAgICAgICAgdGlsZS50eTAgPSBNYXRoLm1heChzaXouWVRPc2l6ICsgcSAqIHNpei5ZVHNpeiwgc2l6LllPc2l6KTtcbiAgICAgICAgdGlsZS50eDEgPSBNYXRoLm1pbihzaXouWFRPc2l6ICsgKHAgKyAxKSAqIHNpei5YVHNpeiwgc2l6LlhzaXopO1xuICAgICAgICB0aWxlLnR5MSA9IE1hdGgubWluKHNpei5ZVE9zaXogKyAocSArIDEpICogc2l6LllUc2l6LCBzaXouWXNpeik7XG4gICAgICAgIHRpbGUud2lkdGggPSB0aWxlLnR4MSAtIHRpbGUudHgwO1xuICAgICAgICB0aWxlLmhlaWdodCA9IHRpbGUudHkxIC0gdGlsZS50eTA7XG4gICAgICAgIHRpbGUuY29tcG9uZW50cyA9IFtdO1xuICAgICAgICB0aWxlcy5wdXNoKHRpbGUpO1xuICAgICAgfVxuICAgIH1cbiAgICBjb250ZXh0LnRpbGVzID0gdGlsZXM7XG5cbiAgICB2YXIgY29tcG9uZW50c0NvdW50ID0gc2l6LkNzaXo7XG4gICAgZm9yICh2YXIgaSA9IDAsIGlpID0gY29tcG9uZW50c0NvdW50OyBpIDwgaWk7IGkrKykge1xuICAgICAgdmFyIGNvbXBvbmVudCA9IGNvbXBvbmVudHNbaV07XG4gICAgICBmb3IgKHZhciBqID0gMCwgamogPSB0aWxlcy5sZW5ndGg7IGogPCBqajsgaisrKSB7XG4gICAgICAgIHZhciB0aWxlQ29tcG9uZW50ID0ge307XG4gICAgICAgIHRpbGUgPSB0aWxlc1tqXTtcbiAgICAgICAgdGlsZUNv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ciBwaiA9IE1hdGguZmxvb3IoKGNvZGVibG9jay50YnkwXyAtIHN1YmJhbmQudGJ5MCkgL1xuICAgICAgICAgIHByZWNpbmN0UGFyYW1ldGVycy5wcmVjaW5jdEhlaWdodEluU3ViYmFuZCk7XG4gICAgICAgIHByZWNpbmN0TnVtYmVyID0gcGkgKyAocGogKiBwcmVjaW5jdFBhcmFtZXRlcnMubnVtcHJlY2luY3Rzd2lkZSk7XG5cbiAgICAgICAgY29kZWJsb2NrLnByZWNpbmN0TnVtYmVyID0gcHJlY2luY3ROdW1iZXI7XG4gICAgICAgIGNvZGVibG9jay5zdWJiYW5kVHlwZSA9IHN1YmJhbmQudHlwZTtcbiAgICAgICAgY29kZWJsb2NrLkxibG9jayA9IDM7XG5cbiAgICAgICAgaWYgKGNvZGVibG9jay50YngxXyA8PSBjb2RlYmxvY2sudGJ4MF8gfHxcbiAgICAgICAgICAgIGNvZGVibG9jay50YnkxXyA8PSBjb2RlYmxvY2sudGJ5MF8pIHtcbiAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuICAgICAgICBjb2RlYmxvY2tzLnB1c2goY29kZWJsb2NrKTtcbiAgICAgICAgLy8gYnVpbGRpbmcgcHJlY2luY3QgZm9yIHRoZSBzdWItYmFuZFxuICAgICAgICB2YXIgcHJlY2luY3QgPSBwcmVjaW5jdHNbcHJlY2luY3ROdW1iZXJdO1xuICAgICAgICBpZiAocHJlY2luY3QgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgIGlmIChpIDwgcHJlY2luY3QuY2J4TWluKSB7XG4gICAgICAgICAgICBwcmVjaW5jdC5jYnhNaW4gPSBpO1xuICAgICAgICAgIH0gZWxzZSBpZiAoaSA+IHByZWNpbmN0LmNieE1heCkge1xuICAgICAgICAgICAgcHJlY2luY3QuY2J4TWF4ID0gaTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGogPCBwcmVjaW5jdC5jYnlNaW4pIHtcbiAgICAgICAgICAgIHByZWNpbmN0LmNieE1pbiA9IGo7XG4gICAgICAgICAgfSBlbHNlIGlmIChqID4gcHJlY2luY3QuY2J5TWF4KSB7XG4gICAgICAgICAgICBwcmVjaW5jdC5jYnlNYXggPSBqO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBwcmVjaW5jdHNbcHJlY2luY3ROdW1iZXJdID0gcHJlY2luY3QgPSB7XG4gICAgICAgICAgICBjYnhNaW46IGksXG4gICAgICAgICAgICBjYnlNaW46IGosXG4gICAgICAgICAgICBjYnhNYXg6IGksXG4gICAgICAgICAgICBjYnlNYXg6IGpcbiAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIGNvZGVibG9jay5wcmVjaW5jdCA9IHByZWNpbmN0O1xuICAgICAgfVxuICAgIH1cbiAgICBzdWJiYW5kLmNvZGVibG9ja1BhcmFtZXRlcnMgPSB7XG4gICAgICBjb2RlYmxvY2tXaWR0aDogeGNiXyxcbiAgICAgIGNvZGVibG9ja0hlaWdodDogeWNiXyxcbiAgICAgIG51bWNvZGVibG9ja3dpZGU6IGNieDEgLSBjYngwICsgMSxcbiAgICAgIG51bWNvZGVibG9ja2hpZ2g6IGNieTEgLSBjYnkwICsgMVxuICAgIH07XG4gICAgc3ViYmFuZC5jb2RlYmxvY2tzID0gY29kZWJsb2NrcztcbiAgICBzdWJiYW5kLnByZWNpbmN0cyA9IHByZWNpbmN0cztcbiAgfVxuICBmdW5jdGlvbiBjcmVhdGVQYWNrZXQocmVzb2x1dGlvbiwgcHJlY2luY3ROdW1iZXIsIGxheWVyTnVtYmVyKSB7XG4gICAgdmFyIHByZWNpbmN0Q29kZWJsb2NrcyA9IFtdO1xuICAgIC8vIFNlY3Rpb24gQi4xMC44IE9yZGVyIG9mIGluZm8gaW4gcGFja2V0XG4gICAgdmFyIHN1YmJhbmRzID0gcmVzb2x1dGlvbi5zdWJiYW5kcztcbiAgICAvLyBzdWItYmFuZHMgYWxyZWFkeSBvcmRlcmVkIGluICdM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c2l0aW9uTGV2ZWxzQ291bnQgPSAwO1xuICAgIGZvciAodmFyIHEgPSAwOyBxIDwgY29tcG9uZW50c0NvdW50OyBxKyspIHtcbiAgICAgIG1heERlY29tcG9zaXRpb25MZXZlbHNDb3VudCA9IE1hdGgubWF4KG1heERlY29tcG9zaXRpb25MZXZlbHNDb3VudCxcbiAgICAgICAgdGlsZS5jb21wb25lbnRzW3FdLmNvZGluZ1N0eWxlUGFyYW1ldGVycy5kZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQpO1xuICAgIH1cblxuICAgIHZhciBsID0gMCwgciA9IDAsIGkgPSAwLCBrID0gMDtcblxuICAgIHRoaXMubmV4dFBhY2tldCA9IGZ1bmN0aW9uIEpweEltYWdlX25leHRQYWNrZXQoKSB7XG4gICAgICAvLyBTZWN0aW9uIEIuMTIuMS4xIExheWVyLXJlc29sdXRpb24tY29tcG9uZW50LXBvc2l0aW9uXG4gICAgICBmb3IgKDsgbCA8IGxheWVyc0NvdW50OyBsKyspIHtcbiAgICAgICAgZm9yICg7IHIgPD0gbWF4RGVjb21wb3NpdGlvbkxldmVsc0NvdW50OyByKyspIHtcbiAgICAgICAgICBmb3IgKDsgaSA8IGNvbXBvbmVudHNDb3VudDsgaSsrKSB7XG4gICAgICAgICAgICB2YXIgY29tcG9uZW50ID0gdGlsZS5jb21wb25lbnRzW2ldO1xuICAgICAgICAgICAgaWYgKHIgPiBjb21wb25lbnQuY29kaW5nU3R5bGVQYXJhbWV0ZXJzLmRlY29tcG9zaXRpb25MZXZlbHNDb3VudCkge1xuICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFyIHJlc29sdXRpb24gPSBjb21wb25lbnQucmVzb2x1dGlvbnNbcl07XG4gICAgICAgICAgICB2YXIgbnVtcHJlY2luY3RzID0gcmVzb2x1dGlvbi5wcmVjaW5jdFBhcmFtZXRlcnMubnVtcHJlY2luY3RzO1xuICAgICAgICAgICAgZm9yICg7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tldCA9IGZ1bmN0aW9uIEpweEltYWdlX25leHRQYWNrZXQoKSB7XG4gICAgICAvLyBTZWN0aW9uIEIuMTIuMS4yIFJlc29sdXRpb24tbGF5ZXItY29tcG9uZW50LXBvc2l0aW9uXG4gICAgICBmb3IgKDsgciA8PSBtYXhEZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQ7IHIrKykge1xuICAgICAgICBmb3IgKDsgbCA8IGxheWVyc0NvdW50OyBsKyspIHtcbiAgICAgICAgICBmb3IgKDsgaSA8IGNvbXBvbmVudHNDb3VudDsgaSsrKSB7XG4gICAgICAgICAgICB2YXIgY29tcG9uZW50ID0gdGlsZS5jb21wb25lbnRzW2ldO1xuICAgICAgICAgICAgaWYgKHIgPiBjb21wb25lbnQuY29kaW5nU3R5bGVQYXJhbWV0ZXJzLmRlY29tcG9zaXRpb25MZXZlbHNDb3VudCkge1xuICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFyIHJlc29sdXRpb24gPSBjb21wb25lbnQucmVzb2x1dGlvbnNbcl07XG4gICAgICAgICAgICB2YXIgbnVtcHJlY2luY3RzID0gcmVzb2x1dGlvbi5wcmVjaW5jdFBhcmFtZXRlcnMubnVtcHJlY2luY3RzO1xuICAgICAgICAgICAgZm9yICg7IGsgPCBudW1wcmVjaW5jdHM7KSB7XG4gICAgICAgICAgICAgIHZhciBwYWNrZXQgPSBjcmVhdGVQYWNrZXQocmVzb2x1dGlvbiwgaywgbCk7XG4gICAgICAgICAgICAgIGsrKztcbiAgICAgICAgICAgICAgcmV0dXJuIHBhY2tldDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGsgPSAwO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpID0gMDtcbiAgICAgICAgfVxuICAgICAgICBsID0gMDtcbiAgICAgIH1cbiAgICB9O1xuICB9XG4gIGZ1bmN0aW9uIFJlc29sdXRpb25Qb3NpdGlvbkNvbXBvbmVudExheWVySXR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ICAgICBpZiAociA8IHJlc29sdXRpb25zLmxlbmd0aCkge1xuICAgICAgICAgIG1heE51bVByZWNpbmN0cyA9IE1hdGgubWF4KG1heE51bVByZWNpbmN0cyxcbiAgICAgICAgICAgIHJlc29sdXRpb25zW3JdLnByZWNpbmN0UGFyYW1ldGVycy5udW1wcmVjaW5jdHMpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBtYXhOdW1QcmVjaW5jdHNJbkxldmVsW3JdID0gbWF4TnVtUHJlY2luY3RzO1xuICAgIH1cbiAgICBsID0gMDtcbiAgICByID0gMDtcbiAgICBjID0gMDtcbiAgICBwID0gMDtcblxuICAgIHRoaXMubmV4dFBhY2tldCA9IGZ1bmN0aW9uIEpweEltYWdlX25leHRQYWNrZXQoKSB7XG4gICAgICAvLyBTZWN0aW9uIEIuMTIuMS4zIFJlc29sdXRpb24tcG9zaXRpb24tY29tcG9uZW50LWxheWVyXG4gICAgICBmb3IgKDsgciA8PSBtYXhEZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQ7IHIrKykge1xuICAgICAgICBmb3IgKDsgcCA8IG1heE51bVByZWNpbmN0c0luTGV2ZWxbcl07IHArKykge1xuICAgICAgICAgIGZvciAoOyBjIDwgY29tcG9uZW50c0NvdW50OyBjKyspIHtcbiAgICAgICAgICAgIHZhciBjb21wb25lbnQgPSB0aWxlLmNvbXBvbmVudHNbY107XG4gICAgICAgICAgICBpZiAociA+IGNvbXBvbmVudC5jb2RpbmdTdHlsZVBhcmFtZXRlcnMuZGVjb21wb3NpdGlvbkxldmVsc0NvdW50KSB7XG4gICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIHJlc29sdXRpb24gPSBjb21wb25lbnQucmVzb2x1dGlvbnNbcl07XG4gICAgICAgICAgICB2YXIgbnVtcHJlY2luY3RzID0gcmVzb2x1dGlvbi5wcmVjaW5jdFBhcmFtZXRlcnMubnVtcHJlY2luY3RzO1xuICAgICAgICAgICAgaWYgKHAgPj0gbnVtcHJlY2luY3RzKSB7XG4gICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZm9yICg7IGwgPCBsYXllcnNDb3VudDspIHtcbiAgICAgICAgICAgICAgdmFyIHBhY2tldCA9IGNyZWF0ZVBhY2tldChyZXNvbHV0aW9uLCBwLCBsKTtcbiAgICAgICAgICAgICAgbCsrO1xuICAgICAgICAgICAgICByZXR1cm4gcGFja2V0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbCA9IDA7XG4gICAgICAgICAgfVxuICAgICAgICAgIGMgPSAwO1xuICAgICAgICB9XG4gICAgICAgIHAgPSAwO1xuICAgICAgfVxuICAgIH07XG4gIH1cbiAgZnVuY3Rpb24gUG9zaXRpb25Db21wb25lbnRSZXNvbHV0aW9uTGF5ZXJJdGVyYXRvcihjb250ZXh0KSB7XG4gICAgdmFyIHNpeiA9IGNvbnRleHQuU0laO1xuICAgIHZhciB0aWxlSW5kZXggPSBjb250ZXh0LmN1cnJlbnRUaWxlLmluZGV4O1xuICAgIHZhciB0aWxlID0gY29udGV4dC50aWxlc1t0aWxlSW5kZXhdO1xuICAgIHZhciBsYXllcnNDb3VudCA9IHRpbGUuY29kaW5nU3R5bGVEZWZhdWx0UGFyYW1ldGVycy5sYXllcnNDb3VudDtcbiAgICB2YXIgY29tcG9uZW50c0NvdW50ID0gc2l6LkNzaXo7XG4gICAgdmFyIHByZWNpbmN0c1NpemVzID0gZ2V0UHJlY2luY3RTaXplc0luSW1hZ2VTY2FsZSh0aWxlKTtcbiAgICB2YXIgcHJlY2luY3RzSXRlcmF0aW9uU2l6ZXMgPSBwcmVjaW5jdHNTaXplcztcbiAgICB2YXIgbCA9IDAsIHIgPSAwLCBjID0gMCwgcHggPSAwLCBweSA9IDA7XG5cbiAgICB0aGlzLm5leHRQYWNrZXQgPSBmdW5jdGlvbiBKcHhJbWFnZV9uZXh0UGFja2V0KCkge1xuICAgICAgLy8gU2VjdGlvbiBCLjEyLjEuNCBQb3NpdGlvbi1jb21wb25lbnQtcmVzb2x1dGlvbi1sYXllclxuICAgICAgZm9yICg7IHB5IDwgcHJlY2luY3RzSXRlcmF0aW9uU2l6ZXMubWF4TnVtSGlnaDsgcHkrKykge1xuICAgICAgICBmb3IgKDsgcHggPCBwcmVjaW5jdHNJdGVyYXRpb25TaXplcy5tYXhOdW1XaWRlOyBweCsrKSB7XG4gICAgICAgICAgZm9yICg7IGMgPCBjb21wb25lbnRzQ291bnQ7IGMrKykge1xuICAgICAgICAgICAgdmFyIGNvbXBvbmVudCA9IHRpbGUuY29tcG9uZW50c1tjXTtcbiAgICAgICAgICAgIHZhciBkZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQgPVxuICAgICAgICAgICAgICBjb21wb25lbnQuY29kaW5nU3R5bGVQYXJhbWV0ZXJzLmRlY29tcG9zaXRpb25MZXZlbHNDb3VudDtcbiAgICAgICAgICAgIGZvciAoOyByIDw9IGRlY29tcG9zaXRpb25MZXZlbHNDb3VudDsgcisrKSB7XG4gICAgICAgICAgICAgIHZhciByZXNvbHV0aW9uID0gY29tcG9uZW50LnJlc29sdXRpb25zW3JdO1xuICAgICAgICAgICAgICB2YXIgc2l6ZUluSW1hZ2VTY2FsZSA9XG4gICAgICAgICAgICAgICAgcHJlY2luY3RzU2l6ZXMuY29tcG9uZW50c1tjXS5yZXNvbHV0aW9uc1tyXTtcbiAgICAgICAgICAgICAgdmFyIGsgPSBnZXRQcmVjaW5jdEluZGV4SWZFeGlzdChcbiAgICAgICAgICAgICAgICBweCxcbiAgICAgICAgICAgICAgICBweSxcbiAgICAgICAgICAgICAgICBzaXplSW5JbWFnZVNjYWxlLFxuICAgICAgICAgICAgICAgIHByZWNpbmN0c0l0ZXJhdGlvblNpemVzLFxuICAgICAgICAgICAgICAgIHJlc29sdXRpb24pO1xuICAgICAgICAgICAgICBpZiAoayA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGZvciAoOyBsIDwgbGF5ZXJzQ291bnQ7KSB7XG4gICAgICAgICAgICAgICAgdmFyIHBhY2tldCA9IGNyZWF0ZVBhY2tldChyZXNvbHV0aW9uLCBrLCBsKTtcbiAgICAgICAgICAgICAgICBsKys7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhY2tldDtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBsID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHIgPSAwO1xuICAgICAgICAgIH1cbiAgICAgICAgICBjID0gMDtcbiAgICAgICAgfVxuICAgICAgICBweCA9IDA7XG4gICAgICB9XG4gICAgfTtcbiAgfVxuICBmdW5jdGlvbiBDb21wb25lbnRQb3NpdGlvblJlc29sdXRpb25MYXllckl0ZXJhdG9yKGNvbnRleHQpIHtcbiAgICB2YXIgc2l6ID0gY29udGV4dC5TSVo7XG4gICAgdmFyIHRpbGVJbmRleCA9IGNvbnRleHQuY3VycmVudFRpbGUuaW5kZXg7XG4gICAgdmFyIHRpbGUgPSBjb250ZXh0LnRpbGVzW3RpbGVJbmRleF07XG4gICAgdmFyIGxheWVyc0NvdW50ID0gdGlsZS5jb2RpbmdTdHlsZURlZmF1bHRQYXJhbWV0ZXJzLmxheWVyc0NvdW50O1xuICAgIHZhciBjb21wb25lbnRzQ291bnQgPSBzaXouQ3NpejtcbiAgICB2YXIgcHJlY2luY3RzU2l6ZXMgPSBnZXRQcmVjaW5jdFNpemVzSW5JbWFnZVNjYWxlKHRpbGUpO1xuICAgIHZhciBsID0gMCwgciA9IDAsIGMgPSAwLCBweCA9IDAsIHB5ID0gMDtcblxuICAgIHRoaXMubmV4dFBhY2tldCA9IGZ1bmN0aW9uIEpweEltYWdlX25leHRQYWNrZXQoKSB7XG4gICAgICAvLyBTZWN0aW9uIEIuMTIuMS41IENvbXBvbmVudC1wb3NpdGlvbi1yZXNvbHV0aW9uLWxheWVyXG4gICAgICBmb3IgKDsgYyA8IGNvbXBvbmVudHNDb3VudDsgKytjKSB7XG4gICAgICAgIHZhciBjb21wb25lbnQgPSB0aWxlLmNvbXBvbmVudHNbY107XG4gICAgICAgIHZhciBwcmVjaW5jdHNJdGVyYXRpb25TaXplcyA9IHByZWNpbmN0c1NpemVzLmNvbXBvbmVudHNbY107XG4gICAgICAgIHZhciBkZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQgPVxuICAgICAgICAgIGNvbXBvbmVudC5jb2RpbmdTdHlsZVBhcmFtZXRlcnMuZGVjb21wb3NpdGlvbkxldmVsc0NvdW50O1xuICAgICAgICBmb3IgKDsgcHkgPCBwcmVjaW5jdHNJdGVyYXRpb25TaXplcy5tYXhOdW1IaWdoOyBweSsrKSB7XG4gICAgICAgICAgZm9yICg7IHB4IDwgcHJlY2luY3RzSXRlcmF0aW9uU2l6ZXMubWF4TnVtV2lkZTsgcHgrKykge1xuICAgICAgICAgICAgZm9yICg7IHIgPD0gZGVjb21wb3NpdGlvbkxldmVsc0NvdW50OyByKyspIHtcbiAgICAgICAgICAgICAgdmFyIHJlc29sdXRpb24gPSBjb21wb25lbnQucmVzb2x1dGlvbnNbcl07XG4gICAgICAgICAgICAgIHZhciBzaXplSW5JbWFnZVNjYWxlID0gcHJlY2luY3RzSXRlcmF0aW9uU2l6ZXMucmVzb2x1dGlvbnNbcl07XG4gICAgICAgICAgICAgIHZhciBrID0gZ2V0UHJlY2luY3RJbmRleElmRXhpc3QoXG4gICAgICAgICAgICAgICAgcHgsXG4gICAgICAgICAgICAgICAgcHksXG4gICAgICAgICAgICAgICAgc2l6ZUluSW1hZ2VTY2FsZSxcbiAgICAgICAgICAgICAgICBwcmVjaW5jdHNJdGVyYXRpb25TaXplcyxcbiAgICAgICAgICAgICAgICByZXNvbHV0aW9uKTtcbiAgICAgICAgICAgICAgaWYgKGsgPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIC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GlmIChzb3BNYXJrZXJVc2VkICYmIHNraXBNYXJrZXJJZkVxdWFsKDB4OTEpKSB7XG4gICAgICAgICAgLy8gU2tpcCBhbHNvIG1hcmtlciBzZWdtZW50IGxlbmd0aCBhbmQgcGFja2V0IHNlcXVlbmNlIElEXG4gICAgICAgICAgc2tpcEJ5dGVzKDQpO1xuICAgICAgICB9XG4gICAgICAgIHZhciBwYWNrZXQgPSBwYWNrZXRzSXRlcmF0b3IubmV4dFBhY2tldCgpO1xuICAgICAgICBpZiAocGFja2V0ID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAvL05vIG1vcmUgcGFja2V0cy4gU3RyZWFtIGlzIHByb2JhYmx5IHRydW5jYXRlZC5cbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFyZWFkQml0cygxKSkge1xuICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG4gICAgICAgIHZhciBsYXllck51bWJlciA9IHBhY2tldC5sYXllck51bWJlcjtcbiAgICAgICAgdmFyIHF1ZXVlID0gW10sIGNvZGVibG9jaztcbiAgICAgICAgZm9yICh2YXIgaSA9IDAsIGlpID0gcGFja2V0LmNvZGVibG9ja3MubGVuZ3RoOyBpIDwgaWk7IGkrKykge1xuICAgICAgICAgIGNvZGVibG9jayA9IHBhY2tldC5jb2RlYmxvY2tzW2ldO1xuICAgICAgICAgIHZhciBwcmVjaW5jdCA9IGNvZGVibG9jay5wcmVjaW5jdDtcbiAgICAgICAgICB2YXIgY29kZWJsb2NrQ29sdW1uID0gY29kZWJsb2NrLmNieCAtIHByZWNpbmN0LmNieE1pbjtcbiAgICAgICAgICB2YXIgY29kZWJsb2NrUm93ID0gY29kZWJsb2NrLmNieSAtIHByZWNpbmN0LmNieU1pbjtcbiAgICAgICAgICB2YXIgY29kZWJsb2NrSW5jbHVkZWQgPSBmYWxzZTtcbiAgICAgICAgICB2YXIgZmlyc3RUaW1lSW5jbHVzaW9uID0gZmFsc2U7XG4gICAgICAgICAgdmFyIHZhbHVlUmVhZHk7XG4gICAgICAgICAgaWYgKGNvZGVibG9ja1snaW5jbHVkZWQnXSAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICBjb2RlYmxvY2tJbmNsdWRlZCA9ICEhcmVhZEJpdHMoMSk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIC8vIHJlYWRpbmcgaW5jbHVzaW9uIHRyZWVcbiAgICAgICAgICAgIHByZWNpbmN0ID0gY29kZWJsb2NrLnByZWNpbmN0O1xuICAgICAgICAgICAgdmFyIGluY2x1c2lvblRyZWUsIHplcm9CaXRQbGFuZXNUcmVlO1xuICAgICAgICAgICAgaWYgKHByZWNpbmN0WydpbmNsdXNpb25UcmVlJ10gIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICBpbmNsdXNpb25UcmVlID0gcHJlY2luY3QuaW5jbHVzaW9uVHJlZTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIC8vIGJ1aWxkaW5nIGluY2x1c2lvbiBhbmQgemVybyBiaXQtcGxhbmVzIHRyZWVzXG4gICAgICAgICAgICAgIHZhciB3aWR0aCA9IHByZWNpbmN0LmNieE1heCAtIHByZWNpbmN0LmNieE1pbiArIDE7XG4gICAgICAgICAgICAgIHZhciBoZWlnaHQgPSBwcmVjaW5jdC5jYnlNYXggLSBwcmVjaW5jdC5jYnlNaW4gKyAxO1xuICAgICAgICAgICAgICBpbmNsdXNpb25UcmVlID0gbmV3IEluY2x1c2lvblRyZWUod2lkdGgsIGhlaWdodCk7XG4gICAgICAgICAgICAgIHplcm9CaXRQbGFuZXNUcmVlID0gbmV3IFRhZ1RyZWUod2lkdGgsIGhlaWdodCk7XG4gICAgICAgICAgICAgIHByZWNpbmN0LmluY2x1c2lvblRyZWUgPSBpbmNsdXNpb25UcmVlO1xuICAgICAgICAgICAgICBwcmVjaW5jdC56ZXJvQml0UGxhbmVzVHJlZSA9IHplcm9CaXRQbGFuZXNUcmVlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpbmNsdXNpb25UcmVlLnJlc2V0KGNvZGVibG9ja0NvbHVtbiwgY29kZWJsb2NrUm93LCBsYXllck51bWJlcik7XG4gICAgICAgICAgICB3aGlsZSAodHJ1ZSkge1xuICAgICAgICAgICAgICBpZiAocG9zaXRpb24gPj0gZGF0YS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKGluY2x1c2lvblRyZWUuaXNBYm92ZVRocmVzaG9sZCgpKXtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAoaW5jbHVzaW9uVHJlZS5pc0tub3duKCkpIHtcbiAgICAgICAgICAgICAgICBpbmNsdXNpb25UcmVlLm5leHRMZXZlbCgpO1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChyZWFkQml0cygxKSkge1xuICAgICAgICAgICAgICAgIGluY2x1c2lvblRyZWUuc2V0S25vd24oKTtcbiAgICAgICAgICAgICAgICBpZiAoaW5jbHVzaW9uVHJlZS5pc0xlYWYoKSkge1xuICAgICAgICAgICAgICAgICAgY29kZWJsb2NrLmluY2x1ZGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgIGNvZGVibG9ja0luY2x1ZGVkID0gZmlyc3RUaW1lSW5jbHVzaW9uID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICBpbmNsdXNpb25UcmVlLm5leHRMZXZlbCgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpbmNsdXNpb25UcmVlLmluY3JlbWVudFZhbHVlKCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKCFjb2RlYmxvY2tJbmNsdWRlZCkge1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChmaXJzdFRpbWVJbmNsdXNpb24pIHtcbiAgICAgICAgICAgIHplcm9CaXRQbGFuZXNUcmVlID0gcHJlY2luY3QuemVyb0JpdFBsYW5lc1RyZWU7XG4gICAgICAgICAgICB6ZXJvQml0UGxhbmVzVHJlZS5yZXNldChjb2RlYmxvY2tDb2x1bW4sIGNvZGVibG9ja1Jvdyk7XG4gICAgICAgICAgICB3aGlsZSAodHJ1ZSkge1xuICAgICAgICAgICAgICBpZiAocG9zaXRpb24gPj0gZGF0YS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKHJlYWRCaXRzKDEpKSB7XG4gICAgICAgICAgICAgICAgdmFsdWVSZWFkeSA9ICF6ZXJvQml0UGxhbmVzVHJlZS5uZXh0TGV2ZWwoKTtcbiAgICAgICAgICAgICAgICBpZiAodmFsdWVSZWFkeSkge1xuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHplcm9CaXRQbGFuZXNUcmVlLmluY3JlbWVudFZhbHVlKCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNvZGVibG9jay56ZXJvQml0UGxhbmVzID0gemVyb0JpdFBsYW5lc1RyZWUudmFsdWU7XG4gICAgICAgICAgfVxuICAgICAgICAgIHZhciBjb2RpbmdwYXNzZXMgPSByZWFkQ29kaW5ncGFzc2VzKCk7XG4gICAgICAgICAgd2hpbGUgKHJlYWRCaXRzKDEpKSB7XG4gICAgICAgICAgICBjb2RlYmxvY2suTGJsb2NrKys7XG4gICAgICAgICAgfVxuICAgICAgICAgIHZhciBjb2RpbmdwYXNzZXNMb2cyID0gbG9nMihjb2RpbmdwYXNzZXMpO1xuICAgICAgICAgIC8vIHJvdW5kaW5nIGRvd24gbG9nMlxuICAgICAgICAgIHZhciBiaXRzID0gKChjb2RpbmdwYXNzZXMgPCAoMSA8PCBjb2RpbmdwYXNzZXNMb2cyKSkgP1xuICAgICAgICAgICAgICAgICAgICAgIGNvZGluZ3Bhc3Nlc0xvZzIgLSAxIDogY29kaW5ncGFzc2VzTG9nMikgKyBjb2RlYmxvY2suTGJsb2NrO1xuICAgICAgICAgIHZhciBjb2RlZERhdGFMZW5ndGggPSByZWFkQml0cyhiaXRzKTtcbiAgICAgICAgICBxdWV1ZS5wdXNoKHtcbiAgICAgICAgICAgIGNvZGVibG9jazogY29kZWJsb2NrLFxuICAgICAgICAgICAgY29kaW5ncGFzc2VzOiBjb2RpbmdwYXNzZXMsXG4gICAgICAgICAgICBkYXRhTGVuZ3RoOiBjb2RlZERhdGFMZW5ndGhcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICBhbGlnblRvQnl0ZSgpO1xuICAgICAgICBpZiAoZXBoTWFya2VyVXNlZCkge1xuICAgICAgICAgIHNraXBNYXJrZXJJZkVxdWFsKDB4OTIpO1xuICAgICAgICB9XG4gICAgICAgIHdoaWxlIChxdWV1ZS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgdmFyIHBhY2tldEl0ZW0gPSBxdWV1ZS5zaGlmdCgpO1xuICAgICAgICAgIGNvZGVibG9jayA9IHBhY2tldEl0ZW0uY29kZWJsb2NrO1xuICAgICAgICAgIGlmIChjb2RlYmxvY2tbJ2RhdGEnXSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICBjb2RlYmxvY2suZGF0YSA9IFtdO1xuICAgICAgICAgIH1cbiAgICAgICAgICBjb2RlYmxvY2suZGF0YS5wdXNoKHtcbiAgICAgICAgICAgIGRhdGE6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XG4gICAgICAgIHZhciBsZXZlbE9mZnNldCA9IDIgKiByb3cgKiAobGV2ZWxXaWR0aCAtIHdpZHRoKSArIHJpZ2h0ICsgYm90dG9tO1xuICAgICAgICBmb3IgKGsgPSAwOyBrIDwgYmxvY2tXaWR0aDsgaysrKSB7XG4gICAgICAgICAgbiA9IG1hZ25pdHVkZVtwb3NpdGlvbl07XG4gICAgICAgICAgaWYgKG4gIT09IDApIHtcbiAgICAgICAgICAgIG4gPSAobiArIG1hZ25pdHVkZUNvcnJlY3Rpb24pICogZGVsdGE7XG4gICAgICAgICAgICBpZiAoc2lnbltwb3NpdGlvbl0gIT09IDApIHtcbiAgICAgICAgICAgICAgbiA9IC1uO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbmIgPSBiaXRzRGVjb2RlZFtwb3NpdGlvbl07XG4gICAgICAgICAgICB2YXIgcG9zID0gaW50ZXJsZWF2ZSA/IChsZXZlbE9mZnNldCArIChvZmZzZXQgPDwgMSkpIDogb2Zmc2V0O1xuICAgICAgICAgICAgaWYgKHJldmVyc2libGUgJiYgKG5iID49IG1iKSkge1xuICAgICAgICAgICAgICBjb2VmZmljaWVudHNbcG9zXSA9IG47XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBjb2VmZmljaWVudHNbcG9zXSA9IG4gKiAoMSA8PCAobWIgLSBuYikpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBvZmZzZXQrKztcbiAgICAgICAgICBwb3NpdGlvbisrO1xuICAgICAgICB9XG4gICAgICAgIG9mZnNldCArPSB3aWR0aCAtIGJsb2NrV2lkdGg7XG4gICAgICB9XG4gICAgfVxuICB9XG4gIGZ1bmN0aW9uIHRyYW5zZm9ybVRpbGUoY29udGV4dCwgdGlsZSwgYykge1xuICAgIHZhciBjb21wb25lbnQgPSB0aWxlLmNvbXBvbmVudHNbY107XG4gICAgdmFyIGNvZGluZ1N0eWxlUGFyYW1ldGVycyA9IGNvbXB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WNpZW50cyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21wb25lbnQudGN4MCwgY29tcG9uZW50LnRjeTApO1xuICAgIHJldHVybiB7XG4gICAgICBsZWZ0OiBjb21wb25lbnQudGN4MCxcbiAgICAgIHRvcDogY29tcG9uZW50LnRjeTAsXG4gICAgICB3aWR0aDogcmVzdWx0LndpZHRoLFxuICAgICAgaGVpZ2h0OiByZXN1bHQuaGVpZ2h0LFxuICAgICAgaXRlbXM6IHJlc3VsdC5pdGVtc1xuICAgIH07XG4gIH1cbiAgZnVuY3Rpb24gdHJhbnNmb3JtQ29tcG9uZW50cyhjb250ZXh0KSB7XG4gICAgdmFyIHNpeiA9IGNvbnRleHQuU0laO1xuICAgIHZhciBjb21wb25lbnRzID0gY29udGV4dC5jb21wb25lbnRzO1xuICAgIHZhciBjb21wb25lbnRzQ291bnQgPSBzaXouQ3NpejtcbiAgICB2YXIgcmVzdWx0SW1hZ2VzID0gW107XG4gICAgZm9yICh2YXIgaSA9IDAsIGlpID0gY29udGV4dC50aWxlcy5sZW5ndGg7IGkgPCBpaTsgaSsrKSB7XG4gICAgICB2YXIgdGlsZSA9IGNvbnRleHQudGlsZXNbaV07XG4gICAgICB2YXIgdHJhbnNmb3JtZWRUaWxlcyA9IFtdO1xuICAgICAgdmFyIGM7XG4gICAgICBmb3IgKGMgPSAwOyBjIDwgY29tcG9uZW50c0NvdW50OyBjKyspIHtcbiAgICAgICAgdHJhbnNmb3JtZWRUaWxlc1tjXSA9IHRyYW5zZm9ybVRpbGUoY29udGV4dCwgdGlsZSwgYyk7XG4gICAgICB9XG4gICAgICB2YXIgdGlsZTAgPSB0cmFuc2Zvcm1lZFRpbGVzWzBdO1xuICAgICAgdmFyIGlzU2lnbmVkID0gY29tcG9uZW50c1swXS5pc1NpZ25lZDtcbiAgICAgIGlmIChpc1NpZ25lZCkge1xuICAgICAgICB2YXIgb3V0ID0gbmV3IEludDE2QXJyYXkodGlsZTAuaXRlbX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0MTQgKiB5MjtcbiAgICAgICAgICAgIGIgPSB5MCArIDEuNzcyICogeTE7XG4gICAgICAgICAgICBvdXRbcG9zKytdID0gciA8PSAwID8gMCA6IHIgPj0gbWF4ID8gMjU1IDogciA+PiBzaGlmdDtcbiAgICAgICAgICAgIG91dFtwb3MrK10gPSBnIDw9IDAgPyAwIDogZyA+PSBtYXggPyAyNTUgOiBnID4+IHNoaWZ0O1xuICAgICAgICAgICAgb3V0W3BvcysrXSA9IGIgPD0gMCA/IDAgOiBiID49IG1heCA/IDI1NSA6IGIgPj4gc2hpZnQ7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vIGludmVyc2UgcmV2ZXJzaWJsZSBtdWx0aXBsZSBjb21wb25lbnQgdHJhbnNmb3JtXG4gICAgICAgICAgZm9yIChqID0gMDsgaiA8IGpqOyBqKyssIHBvcyArPSBhbHBoYTAxKSB7XG4gICAgICAgICAgICB5MCA9IHkwaXRlbXNbal0gKyBvZmZzZXQ7XG4gICAgICAgICAgICB5MSA9IHkxaXRlbXNbal07XG4gICAgICAgICAgICB5MiA9IHkyaXRlbXNbal07XG4gICAgICAgICAgICBnID0geTAgLSAoKHkyICsgeTEpID4+IDIpO1xuICAgICAgICAgICAgciA9IGcgKyB5MjtcbiAgICAgICAgICAgIGIgPSBnICsgeTE7XG4gICAgICAgICAgICBvdXRbcG9zKytdID0gciA8PSAwID8gMCA6IHIgPj0gbWF4ID8gMjU1IDogciA+PiBzaGlmdDtcbiAgICAgICAgICAgIG91dFtwb3MrK10gPSBnIDw9IDAgPyAwIDogZyA+PSBtYXggPyAyNTUgOiBnID4+IHNoaWZ0O1xuICAgICAgICAgICAgb3V0W3BvcysrXSA9IGIgPD0gMCA/IDAgOiBiID49IG1heCA/IDI1NSA6IGIgPj4gc2hpZnQ7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChmb3VyQ29tcG9uZW50cykge1xuICAgICAgICAgIGZvciAoaiA9IDAsIHBvcyA9IDM7IGogPCBqajsgaisrLCBwb3MgKz0gNCkge1xuICAgICAgICAgICAgayA9IHkzaXRlbXNbal07XG4gICAgICAgICAgICBvdXRbcG9zXSA9IGsgPD0gbWluID8gMCA6IGsgPj0gbWF4SyA/IDI1NSA6IChrICsgb2Zmc2V0KSA+PiBzaGlmdDtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7IC8vIG5vIG11bHRpLWNvbXBvbmVudCB0cmFuc2Zvcm1cbiAgICAgICAgZm9yIChjID0gMDsgYyA8IGNvbXBvbmVudHNDb3VudDsgYysrKSB7XG4gICAgICAgICAgaWYgKGNvbXBvbmVudHNbY10ucHJlY2lzaW9uID09PSA4KXtcbiAgICAgICAgICAgIHZhciBpdGVtcyA9IHRyYW5zZm9ybWVkVGlsZXNbY10uaXRlbXM7XG4gICAgICAgICAgICBzaGlmdCA9IGNvbXBvbmVudHNbY10ucHJlY2lzaW9uIC0gODtcbiAgICAgICAgICAgIG9mZnNldCA9ICgxMjggPDwgc2hpZnQpICsgMC41O1xuICAgICAgICAgICAgbWF4ID0gKDEyNy41ICogKDEgPDwgc2hpZnQpKTtcbiAgICAgICAgICAgIG1pbiA9IC1tYXg7XG4gICAgICAgICAgICBmb3IgKHBvcyA9IGMsIGogPSAwLCBqaiA9IGl0ZW1zLmxlbmd0aDsgaiA8IGpqOyBqKyspIHtcbiAgICAgICAgICAgICAgdmFsID0gaXRlbXNbal07XG4gICAgICAgICAgICAgIG91dFtwb3NdID0gdmFsIDw9IG1pbiA/IDAgOlxuICAgICAgICAgICAgICAgICAgICAgICAgIHZhbCA+PSBtYXggPyAyNTUgOiAodmFsICsgb2Zmc2V0KSA+PiBzaGlmdDtcbiAgICAgICAgICAgICAgcG9zICs9IGNvbXBvbmVudHNDb3VudDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9ZWxzZXtcbiAgICAgICAgICAgIHZhciBpc1NpZ25lZCA9IGNvbXBvbmVudHNbY10uaXNTaWduZWQ7XG4gICAgICAgICAgICB2YXIgaXRlbXMgPSB0cmFuc2Zvcm1lZFRpbGVzW2NdLml0ZW1zO1xuXG4gICAgICAgICAgICBpZihpc1NpZ25lZCl7XG4gICAgICAgICAgICAgIGZvciAocG9zID0gYywgaiA9IDAsIGpqID0gaXRlbXMubGVuZ3RoOyBqIDwgamo7IGorKykge1xuICAgICAgICAgICAgICAgIG91dFtwb3NdID0gaXRlbXNbal07XG4gICAgICAgICAgICAgICAgcG9zICs9IGNvbXBvbmVudHNDb3VudDtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfWVsc2V7XG4gICAgICAgICAgICAgIHNoaWZ0ID0gY29tcG9uZW50c1tjXS5wcmVjaXNpb24gLSA4O1xuICAgICAgICAgICAgICBvZmZzZXQgPSAoMTI4IDw8IHNoaWZ0KSArIDAuNTtcbiAgICAgICAgICAgICAgdmFyIHByZWNpc2lvbk1heCA9IE1hdGgucG93KDIsY29tcG9uZW50c1tjXS5wcmVjaXNpb24pLTE7XG4gICAgICAgICAgICAgIGZvciAocG9zID0gYywgaiA9IDAsIGpqID0gaXRlbXMubGVuZ3RoOyBqIDwgamo7IGorKykge1xuICAgICAgICAgICAgICAgIHZhbCA9IGl0ZW1zW2pdO1xuICAgICAgICAgICAgICAgIG91dFtwb3NdID0gTWF0aC5tYXgoTWF0aC5taW4oKHZhbCArIG9mZnNldCkscHJlY2lzaW9uTWF4KSwwKTtcbiAgICAgICAgICAgICAgICBwb3MgKz0gY29tcG9uZW50c0NvdW50O1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICByZXN1bHRJbWFnZXMucHVzaChyZXN1bHQpO1xuICAgIH1cbiAgICByZXR1cm4gcmVzdWx0SW1hZ2VzO1xuICB9XG4gIGZ1bmN0aW9uIGluaXRpYWxpemVUaWxlKGNvbnRleHQsIHRpbGVJbmRleCkge1xuICAgIHZh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ZWxzID0gW107XG4gICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxldmVsc0xlbmd0aDsgaSsrKSB7XG4gICAgICAgIHZhciBsZXZlbCA9IHtcbiAgICAgICAgICB3aWR0aDogd2lkdGgsXG4gICAgICAgICAgaGVpZ2h0OiBoZWlnaHQsXG4gICAgICAgICAgaXRlbXM6IFtdXG4gICAgICAgIH07XG4gICAgICAgIHRoaXMubGV2ZWxzLnB1c2gobGV2ZWwpO1xuICAgICAgICB3aWR0aCA9IE1hdGguY2VpbCh3aWR0aCAvIDIpO1xuICAgICAgICBoZWlnaHQgPSBNYXRoLmNlaWwoaGVpZ2h0IC8gMik7XG4gICAgICB9XG4gICAgfVxuICAgIFRhZ1RyZWUucHJvdG90eXBlID0ge1xuICAgICAgcmVzZXQ6IGZ1bmN0aW9uIFRhZ1RyZWVfcmVzZXQoaSwgaikge1xuICAgICAgICB2YXIgY3VycmVudExldmVsID0gMCwgdmFsdWUgPSAwLCBsZXZlbDtcbiAgICAgICAgd2hpbGUgKGN1cnJlbnRMZXZlbCA8IHRoaXMubGV2ZWxzLmxlbmd0aCkge1xuICAgICAgICAgIGxldmVsID0gdGhpcy5sZXZlbHNbY3VycmVudExldmVsXTtcbiAgICAgICAgICB2YXIgaW5kZXggPSBpICsgaiAqIGxldmVsLndpZHRoO1xuICAgICAgICAgIGlmIChsZXZlbC5pdGVtc1tpbmRleF0gIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgdmFsdWUgPSBsZXZlbC5pdGVtc1tpbmRleF07XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgICAgbGV2ZWwuaW5kZXggPSBpbmRleDtcbiAgICAgICAgICBpID4+PSAxO1xuICAgICAgICAgIGogPj49IDE7XG4gICAgICAgICAgY3VycmVudExldmVsKys7XG4gICAgICAgIH1cbiAgICAgICAgY3VycmVudExldmVsLS07XG4gICAgICAgIGxldmVsID0gdGhpcy5sZXZlbHNbY3VycmVudExldmVsXT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4gICAgICAgIHZhciBjdXJyZW50TGV2ZWwgPSAwO1xuICAgICAgICB3aGlsZSAoY3VycmVudExldmVsIDwgdGhpcy5sZXZlbHMubGVuZ3RoKSB7XG4gICAgICAgICAgdmFyIGxldmVsID0gdGhpcy5sZXZlbHNbY3VycmVudExldmVsXTtcbiAgICAgICAgICB2YXIgaW5kZXggPSBpICsgaiAqIGxldmVsLndpZHRoO1xuICAgICAgICAgIGxldmVsLmluZGV4ID0gaW5kZXg7XG5cbiAgICAgICAgICBpID4+PSAxO1xuICAgICAgICAgIGogPj49IDE7XG4gICAgICAgICAgY3VycmVudExldmVsKys7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLmN1cnJlbnRMZXZlbCA9IHRoaXMubGV2ZWxzLmxlbmd0aCAtIDE7XG4gICAgICAgIHRoaXMubWluVmFsdWUgPXRoaXMubGV2ZWxzW3RoaXMuY3VycmVudExldmVsXS5pdGVtc1swXTtcbiAgICAgICAgcmV0dXJuO1xuICAgICAgfSxcbiAgICAgIGluY3JlbWVudFZhbHVlOiBmdW5jdGlvbiBJbmNsdXNpb25UcmVlX2luY3JlbWVudFZhbHVlKCkge1xuICAgICAgICB2YXIgbGV2ZWwgPSB0aGlzLmxldmVsc1t0aGlzLmN1cnJlbnRMZXZlbF07XG4gICAgICAgIGxldmVsLml0ZW1zW2xldmVsLmluZGV4XSA9IGxldmVsLml0ZW1zW2xldmVsLmluZGV4XSArIDE7XG4gICAgICAgIGlmKGxldmVsLml0ZW1zW2xldmVsLmluZGV4XSA+IHRoaXMubWluVmFsdWUpIHtcbiAgICAgICAgICB0aGlzLm1pblZhbHVlID0gbGV2ZWwuaXRlbXNbbGV2ZWwuaW5kZXhdO1xuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgbmV4dExldmVsOiBmdW5jdGlvbiBJbmNsdXNpb25UcmVlX25leHRMZXZlbCgpIHtcbiAgICAgICAgdmFyIGN1cnJlbnRMZXZlbCA9IHRoaXMuY3VycmVudExldmVsO1xuIC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JpdE1vZGVsKHdpZHRoLCBoZWlnaHQsIHN1YmJhbmQsIHplcm9CaXRQbGFuZXMsIG1iKSB7XG4gICAgICB0aGlzLndpZHRoID0gd2lkdGg7XG4gICAgICB0aGlzLmhlaWdodCA9IGhlaWdodDtcblxuICAgICAgdGhpcy5jb250ZXh0TGFiZWxUYWJsZSA9IChzdWJiYW5kID09PSAnSEgnID8gSEhDb250ZXh0TGFiZWwgOlxuICAgICAgICAoc3ViYmFuZCA9PT0gJ0hMJyA/IEhMQ29udGV4dExhYmVsIDogTExBbmRMSENvbnRleHRzTGFiZWwpKTtcblxuICAgICAgdmFyIGNvZWZmaWNpZW50Q291bnQgPSB3aWR0aCAqIGhlaWdodDtcblxuICAgICAgLy8gY29lZmZpY2llbnRzIG91dHNpZGUgdGhlIGVuY29kaW5nIHJlZ2lvbiB0cmVhdGVkIGFzIGluc2lnbmlmaWNhbnRcbiAgICAgIC8vIGFkZCBib3JkZXIgc3RhdGUgY2VsbHMgZm9yIHNpZ25pZmljYW5jZVN0YXRlXG4gICAgICB0aGlzLm5laWdoYm9yc1NpZ25pZmljYW5jZSA9IG5ldyBVaW50OEFycmF5KGNvZWZmaWNpZW50Q291bnQpO1xuICAgICAgdGhpcy5jb2VmZmljZW50c1NpZ24gPSBuZXcgVWludDhBcnJheShjb2VmZmljaWVudENvdW50KTtcbiAgICAgIHRoaXMuY29lZmZpY2VudHNNYWduaXR1ZGUgPSBtYiA+IDE0ID8gbmV3IFVpbnQzMkFycmF5KGNvZWZmaWNpZW50Q291bnQpIDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYiA+IDYgPyBuZXcgVWludDE2QXJyYXkoY29lZmZpY2llbnRDb3VudCkgOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBVaW50OEFycmF5KGNvZWZmaWNpZW50Q291bnQpO1xuICAgICAgdGhpcy5wcm9jZXNzaW5nRmxhZ3MgPSBuZXcgVWludDhBcnJheShjb2VmZm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AgICAgICB2YXIgbGFiZWxzID0gdGhpcy5jb250ZXh0TGFiZWxUYWJsZTtcbiAgICAgICAgdmFyIGJpdHNEZWNvZGVkID0gdGhpcy5iaXRzRGVjb2RlZDtcbiAgICAgICAgdmFyIHByb2Nlc3NlZEludmVyc2VNYXNrID0gfjE7XG4gICAgICAgIHZhciBwcm9jZXNzZWRNYXNrID0gMTtcbiAgICAgICAgdmFyIGZpcnN0TWFnbml0dWRlQml0TWFzayA9IDI7XG5cbiAgICAgICAgZm9yICh2YXIgaTAgPSAwOyBpMCA8IGhlaWdodDsgaTAgKz0gNCkge1xuICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgd2lkdGg7IGorKykge1xuICAgICAgICAgICAgdmFyIGluZGV4ID0gaTAgKiB3aWR0aCArIGo7XG4gICAgICAgICAgICBmb3IgKHZhciBpMSA9IDA7IGkxIDwgNDsgaTErKywgaW5kZXggKz0gd2lkdGgpIHtcbiAgICAgICAgICAgICAgdmFyIGkgPSBpMCArIGkxO1xuICAgICAgICAgICAgICBpZiAoaSA+PSBoZWlnaHQpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAvLyBjbGVhciBwcm9jZXNzZWQgZmxhZyBmaXJzdFxuICAgICAgICAgICAgICBwcm9jZXNzaW5nRmxhZ3NbaW5kZXhdICY9IHByb2Nlc3NlZEludmVyc2VNYXNrO1xuXG4gICAgICAgICAgICAgIGlmIChjb2VmZmljZW50c01hZ25pdHVkZVtpbmRleF0gfHxcbiAgICAgICAgICAgICAgICAgICFuZWlnaGJvcnNTaWduaWZpY2FuY2VbaW5kZXhdKSB7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICB2YXIgY29udGV4dExhYmVsID0gbGFiZWxzW25laWdoYm9yc1NpZ25pZmljYW5jZVtpbmRleF1dO1xuICAgICAgICAgICAgICB2YXIgZGVjaXNpb24gPSBkZWNvZGVyLnJlYWRCaXQoY29udGV4dHMsIGNvbnRleHRMYWJlbCk7XG4gICAgICAgICAgICAgIGlmIChkZWNpc2lvbikge1xuICAgICAgICAgICAgICAgIHZhciBzaWduID0gdGhpcy5kZWNvZGVTaWduQml0KGksIGosIGluZGV4KTtcbiAgICAgICAgICAgICAgICBjb2VmZmljZW50c1NpZ25baW5kZXhdID0gc2lnbjtcbiAgICAgICAgICAgICAgICBjb2VmZmljZW50c01hZ25pdHVkZVtpbmRleF0gPSAxO1xuICAgICAgICAgICAgICAgIHRoaXMuc2V0TmVpZ2hib3JzU2lnbmlmaWNhbmNlKGksIGosIGluZGV4KTtcbiAgICAgICAgICAgICAgICBwcm9jZXNzaW5nRmxhZ3NbaW5kZXhdIHw9IGZpcnN0TWFnbml0dWRlQml0TWFzaztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBiaXRzRGVjb2RlZFtpbmRleF0rKztcbiAgICAgICAgICAgICAgcHJvY2Vzc2luZ0ZsYWdzW2luZGV4XSB8PSBwcm9jZXNzZWRNYXNrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIGRlY29kZVNpZ25CaXQ6IGZ1bmN0aW9uIEJpdE1vZGVsX2RlY29kZVNpZ25CaXQocm93LCBjb2x1bW4sIGluZGV4KSB7XG4gICAgICAgIHZhciB3aWR0aCA9IHRoaXMud2lkdGgsIGhlaWdodCA9IHRoaXMuaGVpZ2h0O1xuICAgICAgICB2YXIgY29lZmZpY2VudHNNYWduaXR1ZGUgPSB0aGlzLmNvZWZmaWNlbnRzTWFnbml0dWRlO1xuICAgICAgICB2YXIgY29lZmZpY2VudHNTaWduID0gdGhpcy5jb2VmZmljZW50c1NpZ247XG4gICAgICAgIHZhciBjb250cmlidXRpb24sIHNpZ24wLCBzaWduMSwgc2lnbmlmaWNhbmNlMTtcbiAgICAgICAgdmFyIGNvbnRleHRMYWJlbCwgZGVjb2RlZDtcblxuICAgICAgICAvLyBjYWxjdWxhdGUgaG9yaXpvbnRhbCBjb250cmlidXRpb25cbiAgICAgICAgc2lnbmlmaWNhbmNlMSA9IChjb2x1bW4gPiAwICYmIGNvZWZmaWNlbnRzTWFnbml0dWRlW2luZGV4IC0gMV0gIT09IDApO1xuICAgICAgICBpZiAoY29sdW1uICsgMSA8IHdpZHRoICYmIGNvZWZmaWNlbnRzTWFnbml0dWRlW2luZGV4ICsgMV0gIT09IDApIHtcbiAgICAgICAgICBzaWduMSA9IGNvZWZmaWNlbnRzU2lnbltpbmRleCArIDFdO1xuICAgICAgICAgIGlmIChzaWduaWZpY2FuY2UxKSB7XG4gICAgICAgICAgICBzaWduMCA9IGNvZWZmaWNlbnRzU2lnbltpbmRleCAtIDFdO1xuICAgICAgICAgICAgY29udHJpYnV0aW9uID0gMSAtIHNpZ24xIC0gc2lnbjA7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNvbnRyaWJ1dGlvbiA9IDEgLSBzaWduMSAtIHNpZ24xO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChzaWduaWZpY2FuY2UxKSB7XG4gICAgICAgICAgc2lnbjAgPSBjb2VmZmljZW50c1NpZ25baW5kZXggLSAxXTtcbiAgICAgICAgICBjb250cmlidXRpb24gPSAxIC0gc2lnbjAgLSBzaWduMDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBjb250cmlidXRpb24gPSAwO1xuICAgICAgICB9XG4gICAgICAgIHZhciBob3Jpem9udGFsQ29udHJpYnV0aW9uID0gMyAqIGNvbnRyaWJ1dGlvbjtcblxuICAgICAgICAvLyBjYWxjdWxhdGUgdmVydGljYWwgY29udHJpYnV0aW9uIGFuZCBjb21iaW5lIHdpdGggdGhlIGhvcml6b250YWxcbiAgICAgICAgc2lnbmlmaWNhbmNlMSA9IChyb3cgPiAwICYmIGNvZWZmaWNlbnRzTWFnbml0dWRlW2luZGV4IC0gd2lkdGhdICE9PSAwKTtcbiAgICAgICAgaWYgKHJvdyArIDEgPCBoZWlnaHQgJiYgY29lZmZpY2VudHNNYWduaXR1ZGVbaW5kZXggKyB3aWR0aF0gIT09IDApIHtcbiAgICAgICAgICBzaWduMSA9IGNvZWZmaWNlbnRzU2lnbltpbmRleCArIHdpZHRoXTtcbiAgICAgICAgICBpZiAoc2lnbmlmaWNhbmNlMSkge1xuICAgICAgICAgICAgc2lnbjAgPSBjb2VmZmljZW50c1NpZ25baW5kZXggLSB3aWR0aF07XG4gICAgICAgICAgICBjb250cmlidXRpb24gPSAxIC0gc2lnbjEgLSBzaWduMCArIGhvcml6b250YWxDb250cmlidXRpb247XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNvbnRyaWJ1dGlvbiA9IDEgLSBzaWduMSAtIHNpZ24xICsgaG9yaXpvbnRhbENvbnRyaWJ1dGlvbjtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAoc2lnbmlmaWNhbmNlMSkge1xuICAgICAgICAgIHNpZ24wID0gY29lZmZpY2VudHNTaWduW2luZGV4IC0gd2lkdGhdO1xuICAgICAgICAgIGNvbnRyaWJ1dGlvbiA9IDEgLSBzaWduMCAtIHNpZ24wICsgaG9yaXpvbnRhbENvbnRyaWJ1dGlvbjtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBjb250cmlidXRpb24gPSBob3Jpem9udGFsQ29udHJpYnV0aW9uO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGNvbnRyaWJ1dGlvbiA+PSAwKSB7XG4gICAgICAgICAgY29udGV4dExhYmVsID0gOSArIGNvbnRyaWJ1dGlvbjtcbiAgICAgICAgICBkZWNvZGVkID0gdGhpcy5kZWNvZGVyLnJlYWRCaXQodGhpcy5jb250ZXh0cywgY29udGV4dExhYmVsKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBjb250ZXh0TGFiZWwgPSA5IC0gY29udHJpYnV0aW9uO1xuICAgIC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RleDAgKyB3aWR0aDQpO1xuICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgd2lkdGg7IGorKykge1xuICAgICAgICAgICAgZm9yICh2YXIgaW5kZXggPSBpbmRleDAgKyBqOyBpbmRleCA8IGluZGV4TmV4dDsgaW5kZXggKz0gd2lkdGgpIHtcblxuICAgICAgICAgICAgICAvLyBzaWduaWZpY2FudCBidXQgbm90IHRob3NlIHRoYXQgaGF2ZSBqdXN0IGJlY29tZVxuICAgICAgICAgICAgICBpZiAoIWNvZWZmaWNlbnRzTWFnbml0dWRlW2luZGV4XSB8fFxuICAgICAgICAgICAgICAgIChwcm9jZXNzaW5nRmxhZ3NbaW5kZXhdICYgcHJvY2Vzc2VkTWFzaykgIT09IDApIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHZhciBjb250ZXh0TGFiZWwgPSAxNjtcbiAgICAgICAgICAgICAgaWYgKChwcm9jZXNzaW5nRmxhZ3NbaW5kZXhdICYgZmlyc3RNYWduaXR1ZGVCaXRNYXNrKSAhPT0gMCkge1xuICAgICAgICAgICAgICAgIHByb2Nlc3NpbmdGbGFnc1tpbmRleF0gXj0gZmlyc3RNYWduaXR1ZGVCaXRNYXNrO1xuICAgICAgICAgICAgICAgIC8vIGZpcnN0IHJlZmluZW1lbnRcbiAgICAgICAgICAgICAgIHZhciBzaWduaWZpY2FuY2UgPSBuZWlnaGJvcnNTaWduaWZpY2FuY2VbaW5kZXhdICYgMTI3O1xuICAgICAgICAgICAgICAgY29udGV4dExhYmVsID0gc2lnbmlmaWNhbmNlID09PSAwID8gMTUgOiAxNDtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHZhciBiaXQgPSBkZWNvZGVyLnJlYWRCaXQoY29udGV4dHMsIGNvbnRleHRMYWJlbCk7XG4gICAgICAgICAgICAgIGNvZWZmaWNlbnRzTWFnbml0dWRlW2luZGV4XSA9XG4gICAgICA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bmlmaWNhbmNlW2luZGV4MCArIG9uZVJvd0Rvd25dID09PSAwICYmXG4gICAgICAgICAgICAgIG5laWdoYm9yc1NpZ25pZmljYW5jZVtpbmRleDAgKyB0d29Sb3dzRG93bl0gPT09IDAgJiZcbiAgICAgICAgICAgICAgbmVpZ2hib3JzU2lnbmlmaWNhbmNlW2luZGV4MCArIHRocmVlUm93c0Rvd25dID09PSAwKTtcbiAgICAgICAgICAgIHZhciBpMSA9IDAsIGluZGV4ID0gaW5kZXgwO1xuICAgICAgICAgICAgdmFyIGkgPSBpMCwgc2lnbjtcbiAgICAgICAgICAgIGlmIChhbGxFbXB0eSkge1xuICAgICAgICAgICAgICB2YXIgaGFzU2lnbmlmaWNhbnRDb2VmZmljZW50ID1cbiAgICAgICAgICAgICAgICBkZWNvZGVyLnJlYWRCaXQoY29udGV4dHMsIFJVTkxFTkdUSF9DT05URVhUKTtcbiAgICAgICAgICAgICAgaWYgKCFoYXNTaWduaWZpY2FudENvZWZmaWNlbnQpIHtcbiAgICAgICAgICAgICAgICBiaXRzRGVjb2RlZFtpbmRleDBdKys7XG4gICAgICAgICAgICAgICAgYml0c0RlY29kZWRbaW5kZXgwICsgb25lUm93RG93bl0rKztcbiAgICAgICAgICAgICAgICBiaXRzRGVjb2RlZFtpbmRleDAgKyB0d29Sb3dzRG93bl0rKztcbiAgICAgICAgICAgICAgICBiaXRzRGVjb2RlZFtpbmRleDAgKyB0aHJlZVJvd3NEb3duXSsrO1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlOyAvLyBuZXh0IGNvbHVtblxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGkxID0gKGRlY29kZXIucmVhZEJpdChjb250ZXh0cywgVU5JRk9STV9DT05URVhUKSA8PCAxKSB8XG4gICAgICAgICAgICAgICAgICAgIGRlY29kZXIucmVhZEJpdChjb250ZXh0cywgVU5JRk9STV9DT05URVhUKTtcbiAgICAgICAgICAgICAgaWYgKGkxICE9PSAwKSB7XG4gICAgICAgICAgICAgICAgaSA9IGkwICsgaTE7XG4gICAgICAgICAgICAgICAgaW5kZXggKz0gaTEgKiB3aWR0aDtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHNpZ24gPSB0aGlzLmRlY29kZVNpZ25CaXQoaSwgaiwgaW5kZXgpO1xuICAgICAgICAgICAgICBjb2VmZmljZW50c1NpZ25baW5kZXhdID0gc2lnbjtcbiAgICAgICAgICAgICAgY29lZmZpY2VudHNNYWduaXR1ZGVbaW5kZXhdID0gMTtcbiAgICAgICAgICAgICAgdGhpcy5zZXROZWlnaGJvcnNTaWduaWZpY2FuY2UoaSwgaiwgaW5kZXgpO1xuICAgICAgICAgICAgICBwcm9jZXNzaW5nRmxhZ3NbaW5kZXhdIHw9IGZpcnN0TWFnbml0dWRlQml0TWFzaztcblxuICAgICAgICAgICAgICBpbmRleCA9IGluZGV4MDtcbiAgICAgICAgICAgICAgZm9yICh2YXIgaTIgPSBpMDsgaTIgPD0gaTsgaTIrKywgaW5kZXggKz0gd2lkdGgpIHtcbiAgICAgICAgICAgICAgICBiaXRzRGVjb2RlZFtpbmRleF0rKztcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGkxKys7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmb3IgKGkgPSBpMCArIGkxOyBpIDwgaU5leHQ7IGkrKywgaW5kZXggKz0gd2lkdGgpIHtcbiAgICAgICAgICAgICAgaWYgKGNvZWZmaWNlbnRzTWFnbml0dWRlW2luZGV4XSB8fFxuICAgICAgICAgICAgICAgIChwcm9jZXNzaW5nRmxhZ3NbaW5kZXhdICYgcHJvY2Vzc2VkTWFzaykgIT09IDApIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHZhciBjb250ZXh0TGFiZWwgPSBsYWJlbHNbbmVpZ2hib3JzU2lnbmlmaWNhbmNlW2luZGV4XV07XG4gICAgICAgICAgICAgIHZhciBkZWNpc2lvbiA9IGRlY29kZXIucmVhZEJpdChjb250ZXh0cywgY29udGV4dExhYmVsKTtcbiAgICAgICAgICAgICAgaWYgKGRlY2lzaW9uID09PSAxKSB7XG4gICAgICAgICAgICAgICAgc2lnbiA9IHRoaXMuZGVjb2RlU2lnbkJpdChpLCBqLCBpbmRleCk7XG4gICAgICAgICAgICAgICAgY29lZmZpY2VudHNTaWduW2luZGV4XSA9IHNpZ247XG4gICAgICAgICAgICAgICAgY29lZmZpY2VudHNNYWduaXR1ZGVbaW5kZXhdID0gMTtcbiAgICAgICAgICAgICAgICB0aGlzLnNldE5laWdoYm9yc1NpZ25pZmljYW5jZShpLCBqLCBpbmRleCk7XG4gICAgICAgICAgICAgICAgcHJvY2Vzc2luZ0ZsYWdzW2luZGV4XSB8PSBmaXJzdE1hZ25pdHVkZUJpdE1hc2s7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgYml0c0RlY29kZWRbaW5kZXhdKys7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgY2hlY2tTZWdtZW50YXRpb25TeW1ib2w6IGZ1bmN0aW9uIEJpdE1vZGVsX2NoZWNrU2VnbWVudGF0aW9uU3ltYm9sKCkge1xuICAgICAgICB2YXIgZGVjb2RlciA9IHRoaXMuZGVjb2RlcjtcbiAgICAgICAgdmFyIGNvbnRleHRzID0gdGhpcy5jb250ZXh0cztcbiAgICAgICAgdmFyIHN5bWJvbCA9IChkZWNvZGVyLnJlYWRCaXQoY29udGV4dHMsIFVOSUZPUk1fQ09OVEVYVCkgPDwgMykgfFxuICAgICAgICAgICAgICAgICAgICAgKGRlY29kZXIucmVhZEJpdChjb250ZXh0cywgVU5JRk9STV9DT05URVhUKSA8PCAyKSB8XG4gICAgICAgICAgICAgICAgICAgICAoZGVjb2Rlci5yZWFkQml0KGNvbnRleHRzLCBVTklGT1JNX0NPTlRFWFQpIDw8IDEpIHxcbiAgICAgICAgICAgIC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oZWlnaHQ7XG5cbiAgICAgIC8vIFNlY3Rpb24gRi4zLjUgVkVSX1NSXG4gICAgICBpZiAoaGVpZ2h0ID09PSAxKSB7XG4gICAgICAgICAgLy8gaWYgaGVpZ2h0ID0gMSwgd2hlbiB2MCBldmVuIGtlZXAgaXRlbXMgYXMgaXMsIHdoZW4gb2RkIGRpdmlkZSBieSAyXG4gICAgICAgIGlmICgodjAgJiAxKSAhPT0gMCkge1xuICAgICAgICAgIGZvciAodSA9IDA7IHUgPCB3aWR0aDsgdSsrKSB7XG4gICAgICAgICAgICBpdGVtc1t1XSAqPSAwLjU7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBmb3IgKHUgPSAwOyB1IDwgd2lkdGg7IHUrKykge1xuICAgICAgICAgIC8vIGlmIHdlIHJhbiBvdXQgb2YgYnVmZmVycywgY29weSBzZXZlcmFsIGltYWdlIGNvbHVtbnMgYXQgb25jZVxuICAgICAgICAgIGlmIChjdXJyZW50QnVmZmVyID09PSAwKSB7XG4gICAgICAgICAgICBudW1CdWZmZXJzID0gTWF0aC5taW4od2lkdGggLSB1LCBudW1CdWZmZXJzKTtcbiAgICAgICAgICAgIGZvciAoayA9IHUsIGwgPSBidWZmZXJQYWRkaW5nOyBsIDwgbGw7IGsgKz0gd2lkdGgsIGwrKykge1xuICAgICAgICAgICAgICBmb3IgKGIgPSAwOyBiIDwgbnVtQnVmZmVyczsgYisrKSB7XG4gICAgICAgICAgICAgICAgY29sQnVmZmVyc1tiXVtsXSA9IGl0ZW1zW2sgKyBiXTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY3VycmVudEJ1ZmZlciA9IG51bUJ1ZmZlcnM7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgY3VycmVudEJ1ZmZlci0tO1xuICAgICAgICAgIHZhciBidWZmZXIgPSBjb2xCdWZmZXJzW2N1cnJlbnRCdWZmZXJdO1xuICAgICAg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nQgLSBuZXh0O1xuICAgICAgICBpZiAobi0tKSB7XG4gICAgICAgICAgaiArPSAyO1xuICAgICAgICAgIGN1cnJlbnQgPSBkZWx0YSAqIHhbaiArIDFdO1xuICAgICAgICAgIHhbal0gPSBLICogeFtqXSAtIGN1cnJlbnQgLSBuZXh0O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIC8vIHN0ZXAgNFxuICAgICAgaiA9IG9mZnNldCAtIDE7XG4gICAgICBjdXJyZW50ID0gZ2FtbWEgKiB4W2ogLSAxXTtcbiAgICAgIGZvciAobiA9IGxlbiArIDI7IG4tLTsgaiArPSAyKSB7XG4gICAgICAgIG5leHQgPSBnYW1tYSAqIHhbaiArIDFdO1xuICAgICAgICB4W2pdIC09IGN1cnJlbnQgKyBuZXh0O1xuICAgICAgICBpZiAobi0tKSB7XG4gICAgICAgICAgaiArPSAyO1xuICAgICAgICAgIGN1cnJlbnQgPSBnYW1tYSAqIHhbaiArIDFdO1xuICAgICAgICAgIHhbal0gLT0gY3VycmVudCArIG5leHQ7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgLy8gc3RlcCA1XG4gICAgICBqID0gb2Zmc2V0O1xuICAgICAgY3VycmVudCA9IGJldGEgKiB4W2ogLSAxXTtcbiAgICAgIGZvciAobiA9IGxlbiArIDE7IG4tLTsgaiArPSAyKSB7XG4gICAgICAgIG5leHQgPSBiZXRhICogeFtqICsgMV07XG4gICAgICAgIHhbal0gLT0gY3VycmVudCArIG5leHQ7XG4gICAgICAgIGlmIChuLS0pIHtcbiAgICAgICAgICBqICs9IDI7XG4gICAgICAgICAgY3VycmVudCA9IGJldGEgKiB4W2ogKyAxXTtcbiAgICAgICAgICB4W2pdIC09IGN1cnJlbnQgKyBuZXh0O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIG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KHRoaXMuY2hpZ2ggPCBxZUljeCkge1xuICAgICAgICAvLyBleGNoYW5nZUxwc1xuICAgICAgICBpZiAoYSA8IHFlSWN4KSB7XG4gICAgICAgICAgYSA9IHFlSWN4O1xuICAgICAgICAgIGQgPSBjeF9tcHM7XG4gICAgICAgICAgY3hfaW5kZXggPSBxZVRhYmxlSWN4Lm5tcHM7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgYSA9IHFlSWN4O1xuICAgICAgICAgIGQgPSAxIF4gY3hfbXBzO1xuICAgICAgICAgIGlmIChxZVRhYmxlSWN4LnN3aXRjaEZsYWcgPT09IDEpIHtcbiAgICAgICAgICAgIGN4X21wcyA9IGQ7XG4gICAgICAgICAgfVxuICAgICAgICAgIGN4X2luZGV4ID0gcWVUYWJsZUljeC5ubHBzO1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB0aGlzLmNoaWdoIC09IHFlSWN4O1xuICAgICAgICBpZiAoKGEgJiAweDgwMDApICE9PSAwKSB7XG4gICAgICAgICAgdGhpcy5hID0gYTtcbiAgICAgICAgICByZXR1cm4gY3hfbXBzO1xuICAgICAgICB9XG4gICAgICAgIC8vIGV4Y2hhbmdlTXBzXG4gICAgICAgIGlmIChhIDwgcWVJY3gpIHtcbiAgICAgICAgICBkID0gMSBeIGN4X21wcztcbiAgICAgICAgICBpZiAocWVUYWJsZUljeC5zd2l0Y2hGbGFnID09PSAxKSB7XG4gICAgICAgICAgICBjeF9tcHMgPSBkO1xuICAgICAgICAgIH1cbiAgICAgICAgICBjeF9pbmRleCA9IHFlVGFibGVJY3gubmxwcztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBkID0gY3hfbXBzO1xuICAgICAgICAgIGN4X2luZGV4ID0gcWVUYWJsZUljeC5ubXBzO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICAvLyBDLjMuMyByZW5vcm1EO1xuICAgICAgZG8ge1xuICAgICAgICBpZiAodGhpcy5jdCA9PT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ZiAoZ2xvYmFsU2NvcGUuUHJvbWlzZSkge1xuICAgIC8vIFByb21pc2VzIGV4aXN0aW5nIGluIHRoZSBET00vV29ya2VyLCBjaGVja2luZyBwcmVzZW5jZSBvZiBhbGwvcmVzb2x2ZVxuICAgIGlmICh0eXBlb2YgZ2xvYmFsU2NvcGUuUHJvbWlzZS5hbGwgIT09ICdmdW5jdGlvbicpIHtcbiAgICAgIGdsb2JhbFNjb3BlLlByb21pc2UuYWxsID0gZnVuY3Rpb24gKGl0ZXJhYmxlKSB7XG4gICAgICAgIHZhciBjb3VudCA9IDAsIHJlc3VsdHMgPSBbXSwgcmVzb2x2ZSwgcmVqZWN0O1xuICAgICAgICB2YXIgcHJvbWlzZSA9IG5ldyBnbG9iYWxTY29wZS5Qcm9taXNlKGZ1bmN0aW9uIChyZXNvbHZlXywgcmVqZWN0Xykge1xuICAgICAgICAgIHJlc29sdmUgPSByZXNvbHZlXztcbiAgICAgICAgICByZWplY3QgPSByZWplY3RfO1xuICAgICAgICB9KTtcbiAgICAgICAgaXRlcmFibGUuZm9yRWFjaChmdW5jdGlvbiAocCwgaSkge1xuICAgICAgICAgIGNvdW50Kys7XG4gICAgICAgICAgcC50aGVuKGZ1bmN0aW9uIChyZXN1bHQpIHtcbiAgICAgICAgICAgIHJlc3VsdHNbaV0gPSByZXN1bHQ7XG4gICAgICAgICAgICBjb3VudC0tO1xuICAgICAgICAgICAgaWYgKGNvdW50ID09PSAwKSB7XG4gICAgICAgICAgICAgIHJlc29sdmUocmVzdWx0cyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSwgcmVqZWN0KTtcbiAgICAgICAgfSk7XG4gICAgICAgIGlmIChjb3VudCA9PT0gMCkge1xuICAgICAgICAgIHJlc29sdmUocmVzdWx0cyk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHByb21pc2U7XG4gICAgICB9O1xuICAgIH1cbiAgICBpZiAodHlwZW9mIGdsb2JhbFNjb3BlLlByb21pc2UucmVzb2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HtcbiAgICAgICAgdmFyIGhhbmRsZXIgPSB0aGlzLmhhbmRsZXJzLnNoaWZ0KCk7XG5cbiAgICAgICAgdmFyIG5leHRTdGF0dXMgPSBoYW5kbGVyLnRoaXNQcm9taXNlLl9zdGF0dXM7XG4gICAgICAgIHZhciBuZXh0VmFsdWUgPSBoYW5kbGVyLnRoaXNQcm9taXNlLl92YWx1ZTtcblxuICAgICAgICB0cnkge1xuICAgICAgICAgIGlmIChuZXh0U3RhdHVzID09PSBTVEFUVVNfUkVTT0xWRUQpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgaGFuZGxlci5vblJlc29sdmUgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgICAgbmV4dFZhbHVlID0gaGFuZGxlci5vblJlc29sdmUobmV4dFZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiBoYW5kbGVyLm9uUmVqZWN0ID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICAgIG5leHRWYWx1ZSA9IGhhbmRsZXIub25SZWplY3QobmV4dFZhbHVlKTtcbiAgICAgICAgICAgICAgbmV4dFN0YXR1cyA9IFNUQVRVU19SRVNPTFZFRDtcblxuICAgICAgICAgICAgICBpZiAoaGFuZGxlci50aGlzUHJvbWlzZS5fdW5oYW5kbGVkUmVqZWN0aW9uKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5yZW1vdmVVbmhhbmRlbGVkUmVqZWN0aW9uKGhhbmRsZXIudGhpc1Byb21pc2UpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9IGNhdGNoIChleCkge1xuICAgICAgICAgIG5leHRTdGF0dXMgPSBTVEFUVVNfUkVKRUNURUQ7XG4gICAgICAgICAgbmV4dFZhbHVlID0gZXg7XG4gICAgICAgIH1cblxuICAgICAgICBoYW5kbGVyLm5leHRQcm9taXNlLl91cGRhdGVTdGF0dXMobmV4dFN0YXR1cywgbmV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cyA9IFtdO1xuICAgIGlmICh1bnJlc29sdmVkID09PSAwKSB7XG4gICAgICByZXNvbHZlQWxsKHJlc3VsdHMpO1xuICAgICAgcmV0dXJuIGRlZmVycmVkO1xuICAgIH1cbiAgICBmdW5jdGlvbiByZWplY3QocmVhc29uKSB7XG4gICAgICBpZiAoZGVmZXJyZWQuX3N0YXR1cyA9PT0gU1RBVFVTX1JFSkVDVEVEKSB7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cbiAgICAgIHJlc3VsdHMgPSBbXTtcbiAgICAgIHJlamVjdEFsbChyZWFzb24pO1xuICAgIH1cbiAgICBmb3IgKHZhciBpID0gMCwgaWkgPSBwcm9taXNlcy5sZW5ndGg7IGkgPCBpaTsgKytpKSB7XG4gICAgICB2YXIgcHJvbWlzZSA9IHByb21pc2VzW2ldO1xuICAgICAgdmFyIHJlc29sdmUgPSAoZnVuY3Rpb24oaSkge1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24odmFsdWUpIHtcbiAgICAgICAgICBpZiAoZGVmZXJyZWQuX3N0YXR1cyA9PT0gU1RBVFVTX1JFSkVDVEVEKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuICAgICAgICAgIHJlc3VsdHNbaV0gPSB2YWx1ZTtcbiAgICAgICAgICB1bnJlc29sdmVkLS07XG4gICAgICAgICAgaWYgKHVucmVzb2x2ZWQgPT09IDApIHtcbiAgICAgICAgICAgIHJlc29sdmVBbGwocmVzdWx0cyk7XG4gICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgfSkoaSk7XG4gICAgICBpZiAoUHJvbWlzZS5pc1Byb21pc2UocHJvbWlzZSkpIHtcbiAgICAgICAgcHJvbWlzZS50aGVuKHJlc29sdmUsIHJlamVjdCk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICByZXNvbHZlKHByb21pc2UpO1xuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gZGVmZXJyZWQ7XG4gIH07XG5cbiAgLyo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BSRVNTSU9OICAgID0gOTtcbnZhciBaX0RFRkFVTFRfQ09NUFJFU1NJT04gPSAtMTtcblxuXG52YXIgWl9GSUxURVJFRCAgICAgICAgICAgID0gMTtcbnZhciBaX0hVRkZNQU5fT05MWSAgICAgICAgPSAyO1xudmFyIFpfUkxFICAgICAgICAgICAgICAgICA9IDM7XG52YXIgWl9GSVhFRCAgICAgICAgICAgICAgID0gNDtcbnZhciBaX0RFRkFVTFRfU1RSQVRFR1kgICAgPSAwO1xuXG4vKiBQb3NzaWJsZSB2YWx1ZXMgb2YgdGhlIGRhdGFfdHlwZSBmaWVsZCAodGhvdWdoIHNlZSBpbmZsYXRlKCkpICovXG4vL3ZhciBaX0JJTkFSWSAgICAgICAgICAgICAgPSAwO1xuLy92YXIgWl9URVhUICAgICAgICAgICAgICAgID0gMTtcbi8vdmFyIFpfQVNDSUkgICAgICAgICAgICAgICA9IDE7IC8vID0gWl9URVhUXG52YXIgWl9VTktOT1dOICAgICAgICAgICAgID0gMjtcblxuXG4vKiBUaGUgZGVmbGF0ZSBjb21wcmVzc2lvbiBtZXRob2QgKi9cbnZhciBaX0RFRkxBVEVEICA9IDg7XG5cbi8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG5cblxudmFyIE1BWF9NRU1fTEVWRUwgPSA5O1xuLyogTWF4aW11bSB2YWx1ZSBmb3IgbWVtTGV2ZWwgaW4gZGVmbGF0ZUluaXQyICovXG52YXIgTUFYX1dCSVRTID0gMTU7XG4vKiAzMksgTFo3NyB3aW5kb3cgKi9cbnZhciBERUZfTUVNX0xFVkVMID0gODtcblxuXG52YXIgTEVOR1RIX0NPREVTICA9IDI5O1xuLyogbnVtYmVyIG9mIGxlbmd0aCBjb2Rlcywgbm90IGNvdW50aW5nIHRoZSBzcGVjaWFsIEVORF9CTE9DSyBjb2RlICovXG52YXIgTElURVJBTFMgICAgICA9IDI1Njtcbi8q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AgICBfd2luWysrc2Nhbl0gPT09IF93aW5bKyttYXRjaF0gJiYgX3dpblsrK3NjYW5dID09PSBfd2luWysrbWF0Y2hdICYmXG4gICAgICAgICAgICAgX3dpblsrK3NjYW5dID09PSBfd2luWysrbWF0Y2hdICYmIF93aW5bKytzY2FuXSA9PT0gX3dpblsrK21hdGNoXSAmJlxuICAgICAgICAgICAgIF93aW5bKytzY2FuXSA9PT0gX3dpblsrK21hdGNoXSAmJiBfd2luWysrc2Nhbl0gPT09IF93aW5bKyttYXRjaF0gJiZcbiAgICAgICAgICAgICBzY2FuIDwgc3RyZW5kKTtcblxuICAgIC8vIEFzc2VydChzY2FuIDw9IHMtPndpbmRvdysodW5zaWduZWQpKHMtPndpbmRvd19zaXplLTEpLCBcIndpbGQgc2NhblwiKTtcblxuICAgIGxlbiA9IE1BWF9NQVRDSCAtIChzdHJlbmQgLSBzY2FuKTtcbiAgICBzY2FuID0gc3RyZW5kIC0gTUFYX01BVENIO1xuXG4gICAgaWYgKGxlbiA+IGJlc3RfbGVuKSB7XG4gICAgICBzLm1hdGNoX3N0YXJ0ID0gY3VyX21hdGNoO1xuICAgICAgYmVzdF9sZW4gPSBsZW47XG4gICAgICBpZiAobGVuID49IG5pY2VfbWF0Y2gpIHtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICBzY2FuX2VuZDEgID0gX3dpbltzY2FuICsgYmVzdF9sZW4gLSAxXTtcbiAgICAgIHNjYW5fZW5kICAgPSBfd2luW3NjYW4gKyBiZXN0X2xlbl07XG4gICAgfVxuICB9IHdoaWxlICgoY3VyX21hdGNoID0gcHJldltjdXJfbWF0Y2ggJiB3bWFza10pID4gbGltaXQgJiYgLS1jaGFpbl9sZW5ndGggIT09IDApO1xuXG4gIGlmIChiZXN0X2xlbiA8PSBzLmxvb2thaGVhZCkge1xuICAgIHJldHVybiBiZXN0X2xlbjtcbiAgfVxuICByZXR1cm4gcy5sb29rYWhlYWQ7XG59XG5cblxuLyogPT09PT09PT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GlkaW5nIHdpbmRvdywgaWYgd3NpemUgIT0gMCAqL1xuICB2YXIgaG9sZDsgICAgICAgICAgICAgICAgICAgLyogbG9jYWwgc3RybS5ob2xkICovXG4gIHZhciBiaXRzOyAgICAgICAgICAgICAgICAgICAvKiBsb2NhbCBzdHJtLmJpdHMgKi9cbiAgdmFyIGxjb2RlOyAgICAgICAgICAgICAgICAgIC8qIGxvY2FsIHN0cm0ubGVuY29kZSAqL1xuICB2YXIgZGNvZGU7ICAgICAgICAgICAgICAgICAgLyogbG9jYWwgc3RybS5kaXN0Y29kZSAqL1xuICB2YXIgbG1hc2s7ICAgICAgICAgICAgICAgICAgLyogbWFzayBmb3IgZmlyc3QgbGV2ZWwgb2YgbGVuZ3RoIGNvZGVzICovXG4gIHZhciBkbWFzazsgICAgICAgICAgICAgICAgICAvKiBtYXNrIGZvciBmaXJzdCBsZXZlbCBvZiBkaXN0YW5jZSBjb2RlcyAqL1xuICB2YXIgaGVyZTsgICAgICAgICAgICAgICAgICAgLyogcmV0cmlldmVkIHRhYmxlIGVudHJ5ICovXG4gIHZhciBvcDsgICAgICAgICAgICAgICAgICAgICAvKiBjb2RlIGJpdHMsIG9wZXJhdGlvbiwgZXh0cmEgYml0cywgb3IgKi9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qICB3aW5kb3cgcG9zaXRpb24sIHdpbmRvdyBieXRlcyB0byBjb3B5ICovXG4gIHZhciBsZW47ICAgICAgICAgICAgICAgICAgICAvKiBtYXRjaCBsZW5ndGgsIHVudXNlZCBieXRlcyAqL1xuICB2YXIgZGlzdDsgICAgICAgICAgICAgICAgICAgLyogbWF0Y2ggZGlzdGFuY2UgKi9cbiAgdmFyIGZyb207ICAgICAgICAgICAgICAgICAgIC8qIHdoZXJlIHRvIGNvcHkgbWF0Y2ggZnJvbSAqL1xuICB2YXIgZnJvbV9zb3VyY2U7XG5cblxuICB2YXIgaW5wdXQsIG91dHB1dDsgLy8gSlMgc3BlY2lmaWMsIGJlY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iAoYml0cyA8IDE1KSB7XG4gICAgICBob2xkICs9IGlucHV0W19pbisrXSA8PCBiaXRzO1xuICAgICAgYml0cyArPSA4O1xuICAgICAgaG9sZCArPSBpbnB1dFtfaW4rK10gPDwgYml0cztcbiAgICAgIGJpdHMgKz0gODtcbiAgICB9XG5cbiAgICBoZXJlID0gbGNvZGVbaG9sZCAmIGxtYXNrXTtcblxuICAgIGRvbGVuOlxuICAgIGZvciAoOzspIHsgLy8gR290byBlbXVsYXRpb25cbiAgICAgIG9wID0gaGVyZSA+Pj4gMjQvKmhlcmUuYml0cyovO1xuICAgICAgaG9sZCA+Pj49IG9wO1xuICAgICAgYml0cyAtPSBvcDtcbiAgICAgIG9wID0gKGhlcmUgPj4+IDE2KSAmIDB4ZmYvKmhlcmUub3AqLztcbiAgICAgIGlmIChvcCA9PT0gMCkgeyAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbGl0ZXJhbCAqL1xuICAgICAgICAvL1RyYWNldnYoKHN0ZGVyciwgaGVyZS52YWwgPj0gMHgyMCAmJiBoZXJlLnZhbCA8IDB4N2YgP1xuICAgICAgICAvLyAgICAgICAgXCJpbmZsYXRlOiAgICAgICAgIGxpdGVyYWwgJyVjJ1xcblwiIDpcbiAgICAgICAgLy8gICAgICAgIFwiaW5mbGF0ZTogICAgICAgICBsaXRlcmFsIDB4JTAyeFxcblwiLCBoZXJlLnZhbCkpO1xuICAgICAgICBvdXRwdXRbX291dCsrXSA9IGhlcmUgJiAweGZmZmYvKmhlcmUudmFsKi87XG4gICAgICB9XG4gICAgICBlbHNlIGlmIChvcCAmIDE2KSB7ICAgICAgICAgICAgICAgICAgICAgLyogbGVuZ3RoIGJhc2UgKi9cbiAgICAgICAgbGVuID0gaGVyZSAmIDB4ZmZmZi8qaGVyZS52YWwqLztcbiAgICAgICAgb3AgJj0gMTU7ICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbnVtYmVyIG9mIGV4dHJhIGJpdHMgKi9cbiAgICAgICAgaWYgKG9wKSB7XG4gICAgICAgICAgaWYgKGJpdHMgPCBvcCkge1xuICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtfaW4rK10gPDwgYml0cztcbiAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICB9XG4gICAgICAgICAgbGVuICs9IGhvbGQgJiAoKDEgPDwgb3ApIC0gMSk7XG4gICAgICAgICAgaG9sZCA+Pj49IG9wO1xuICAgICAgICAgIGJpdHMgLT0gb3A7XG4gICAgICAgIH1cbiAgICAgICAgLy9UcmFjZXZ2KChzdGRlcnIsIFwiaW5mbGF0ZTogICAgICAgICBsZW5ndGggJXVcXG5cIiwgbGVuKSk7XG4gICAgICAgIGlmIChiaXRzIDwgMTUpIHtcbiAgICAgICAgICBob2xkICs9IGlucHV0W19pbisrXSA8PCBiaXRzO1xuICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICBob2xkICs9IGlucHV0W19pbisrXSA8PCBiaXRzO1xuICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgfVxuICAgICAgICBoZXJlID0gZGNvZGVbaG9sZCAmIGRtYXNrXTtcblxuICAgICAgICBkb2Rpc3Q6XG4gICAgICAgIGZvciAoOzspIHsgLy8gZ290byBlbXVsYXRpb25cbiAgICAgICAgICBvcCA9IGhlcmUgPj4+IDI0LypoZXJlLmJpdHMqLztcbiAgICAgICAgICBob2xkID4+Pj0gb3A7XG4gICAgICAgICAgYml0cyAtPSBvcDtcbiAgICAgICAgICBvcCA9IChoZXJlID4+PiAxNikgJiAweGZmLypoZXJlLm9wKi87XG5cbiAgICAgICAgICBpZiAob3AgJiAxNikgeyAgICAgICAgICAgICAgICAgICAgICAvKiBkaXN0YW5jZSBiYXNlICovXG4gICAgICAgICAgICBkaXN0ID0gaGVyZSAmIDB4ZmZmZi8qaGVyZS52YWwqLztcbiAgICAgICAgICAgIG9wICY9IDE1OyAgICAgICAgICAgICAgICAgICAgICAgLyogbnVtYmVyIG9mIGV4dHJhIGJpdHMgKi9cbiAgICAgICAgICAgIGlmIChiaXRzIDwgb3ApIHtcbiAgICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtfaW4rK10gPDwgYml0cztcbiAgICAgICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICAgICAgICBpZiAoYml0cyA8IG9wKSB7XG4gICAgICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtfaW4rK10gPDwgYml0cztcbiAgICAgICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRpc3QgKz0gaG9sZCAmICgoMSA8PCBvcCkgLSAxKTtcbi8vI2lmZGVmIElORkxBVEVfU1RSSUNUXG4gICAgICAgICAgICBpZiAoZGlzdCA+IGRtYXgpIHtcbiAgICAgICAgICAgICAgc3RybS5tc2cgPSAnaW52YWxpZCBkaXN0YW5jZSB0b28gZmFyIGJhY2snO1xuICAgICAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgICAgICBicmVhayB0b3A7XG4gICAgICAgICAgICB9XG4vLyNlbmRpZlxuICAgICAgICAgICAgaG9sZCA+Pj49IG9wO1xuICAgICAgICAgICAgYml0cyAtPSBvcDtcbiAgICAgICAgICAgIC8vVHJhY2V2digoc3RkZXJyLCBcImluZmxhdGU6ICAgICAgICAgZGlzdGFuY2UgJXVcXG5cIiwgZGlzdCkpO1xuICAgICAgICAgICAgb3AgPSBfb3V0IC0gYmVnOyAgICAgICAgICAgICAgICAvKiBtYXggZGlzdGFuY2UgaW4gb3V0cHV0ICovXG4gICAgICAgICAgICBpZiAoZGlzdCA+IG9wKSB7ICAgICAgICAgICAgICAgIC8qIHNlZSBpZiBjb3B5IGZyb20gd2luZG93ICovXG4gICAgICAgICAgICAgIG9wID0gZGlzdCAtIG9wOyAgICAgICAgICAgICAgIC8qIGRpc3RhbmNlIGJhY2sgaW4gd2luZG93ICovXG4gICAgICAgICAgICAgIGlmIChvcCA+IHdoYXZlKSB7XG4gICAgICAgICAgICAgICAgaWYgKHN0YXRlLnNhbmUpIHtcbiAgICAgICAgICAgICAgICAgIHN0cm0ubXNnID0gJ2ludmFsaWQgZGlzdGFuY2UgdG9vIGZhciBiYWNrJztcbiAgICAgICAgICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgICAgICAgICBicmVhayB0b3A7XG4gICAgICAgICAgICAgICAgfVxuXG4vLyAoISkgVGhpcyBibG9jayBpcyBkaXNhYmxlZCBpbiB6bGliIGRlZmFpbHRzLFxuLy8gZG9uJ3QgZW5hYmxlIGl0IGZvciBiaW5hcnkgY29tcGF0aWJpbGl0eVxuLy8jaWZkZWYgSU5GTEFURV9BTExPV19JTlZBTElEX0RJU1RBTkNFX1RPT0ZBUl9BUlJSXG4vLyAgICAgICAgICAgICAgICBpZiAobGVuIDw9IG9wIC0gd2hhdmUpIHtcbi8vICAgICAgICAgICAgICAgICAgZG8ge1xuLy8gICAgICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gMDtcbi8vICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoLS1sZW4pO1xuLy8gICAgICAgICAgICAgICAgICBjb250aW51ZSB0b3A7XG4vLyAgICAgICAgICAgICAgICB9XG4vLyAgICAgICAgICAgICAgICBsZW4gLT0gb3AgLSB3aGF2ZTtcbi8vICAgICAgICAgICAgICAgIGRvIHtcbi8vICAgICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSAwO1xuLy8gICAgICAgICAgICAgICAgfSB3aGlsZSAoLS1vcCA+IHdoYXZlKTtcbi8vICAgICAgICAgICAgICAgIGlmIChvcCA9PT0gMCkge1xuLy8gICAgICAgICAgICAgICAgICBmcm9tID0gX291dCAtIGRpc3Q7XG4vLyAgICAgICAgICAgICAgICAgIGRvIHtcbi8vICAgICAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IG91dHB1dFtmcm9tKytdO1xuLy8gICAgICAgICAgICAgICAgICB9IHdoaWxlICgtLWxlbik7XG4vLyAgICAgICAgICAgICAgICAgIGNvbnRpbnVlIHRvcDtcbi8vICAgICAgICAgICAgICAgIH1cbi8vI2VuZGlmXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgZnJvbSA9IDA7IC8vIHdpbmRvdyBpbmRleFxuICAgICAgICAgICAgICBmcm9tX3NvdXJjZSA9IHNfd2luZG93O1xuICAgICAgICAgICAgICBpZiAod25leHQgPT09IDApIHsgICAgICAgICAgIC8qIHZlcnkgY29tbW9uIGNhc2UgKi9cbiAgICAgICAgICAgICAgICBmcm9tICs9IHdzaXplIC0gb3A7XG4gICAgICAgICAgICAgICAgaWYgKG9wIDwgbGVuKSB7ICAgICAgICAgLyogc29tZSBmcm9tIHdpbmRvdyAqL1xuICAgICAgICAgICAgICAgICAgbGVuIC09IG9wO1xuICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IHNfd2luZG93W2Zyb20rK107XG4gICAgICAgICAgICAgICAgICB9IHdoaWxlICgtLW9wKTtcbiAgICAgICAgICAgICAgICAgIGZyb20gPSBfb3V0IC0gZGlzdDsgIC8qIHJlc3QgZnJvbSBvdXRwdXQgKi9cbiAgICAgICAgICAgICAgICAgIGZyb21fc291cmNlID0gb3V0cHV0O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBlbHNlIGlmICh3bmV4dCA8IG9wKSB7ICAgICAgLyogd3JhcCBhcm91bmQgd2luZG93ICovXG4gICAgICAgICAgICAgICAgZnJvbSArPSB3c2l6ZSArIHduZXh0IC0gb3A7XG4gICAgICAgICAgICAgICAgb3AgLT0gd25leHQ7XG4gICAgICAgICAgICAgICAgaWYgKG9wIDwgbGVuKSB7ICAgICAgICAgLyogc29tZSBmcm9tIGVuZCBvZiB3aW5kb3cgKi9cbiAgICAgICAgICAgICAgICAgIGxlbiAtPSBvcDtcbiAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBzX3dpbmRvd1tmcm9tKytdO1xuICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoLS1vcCk7XG4gICAgICAgICAgICAgICAgICBmcm9tID0gMDtcbiAgICAgICAgICAgICAgICAgIGlmICh3bmV4dCA8IGxlbikgeyAgLyogc29tZSBmcm9tIHN0YXJ0IG9mIHdpbmRvdyAqL1xuICAgICAgICAgICAgICAgICAgICBvcCA9IHduZXh0O1xuICAgICAgICAgICAgICAgICAgICBsZW4gLT0gb3A7XG4gICAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IHNfd2luZG93W2Zyb20rK107XG4gICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKC0tb3ApO1xuICAgICAgICAgICAgICAgICAgICBmcm9tID0gX291dCAtIGRpc3Q7ICAgICAgLyogcmVzdCBmcm9tIG91dHB1dCAqL1xuICAgICAgICAgICAgICAgICAgICBmcm9tX3NvdXJjZSA9IG91dHB1dDtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgZWxzZSB7ICAgICAgICAgICAgICAgICAgICAgIC8qIGNvbnRpZ3VvdXMgaW4gd2luZG93ICovXG4gICAgICAgICAgICAgICAgZnJvbSArPSB3bmV4dCAtIG9wO1xuICAgICAgICAgICAgICAgIGlmIChvcCA8IGxlbikgeyAgICAgICAgIC8qIHNvbWUgZnJvbSB3aW5kb3cgKi9cbiAgICAgICAgICAgICAgICAgIGxlbiAtPSBvcDtcbiAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBzX3dpbmRvd1tmcm9tKytdO1xuICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoLS1vcCk7XG4gICAgICAgICAgICAgICAgICBmcm9tID0gX291dCAtIGRpc3Q7ICAvKiByZXN0IGZyb20gb3V0cHV0ICovXG4gICAgICAgICAgICAgICAgICBmcm9tX3NvdXJjZSA9IG91dHB1dDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgd2hpbGUgKGxlbiA+IDIpIHtcbiAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IGZyb21fc291cmNlW2Zyb20rK107XG4gICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBmcm9tX3NvdXJjZVtmcm9tKytdO1xuICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gZnJvbV9zb3VyY2VbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICBsZW4gLT0gMztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAobGVuKSB7XG4gICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBmcm9tX3NvdXJjZVtmcm9tKytdO1xuICAgICAgICAgICAgICAgIGlmIChsZW4gPiAxKSB7XG4gICAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IGZyb21fc291cmNlW2Zyb20rK107XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgZnJvbSA9IF9vdXQgLSBkaXN0OyAgICAgICAgICAvKiBjb3B5IGRpcmVjdCBmcm9tIG91dHB1dCAqL1xuICAgICAgICAgICAgICBkbyB7ICAgICAgICAgICAgICAgICAgICAgICAgLyogbWluaW11bSBsZW5ndGggaXMgdGhyZWUgKi9cbiAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IG91dHB1dFtmcm9tKytdO1xuICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gb3V0cHV0W2Zyb20rK107XG4gICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBvdXRwdXRbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICBsZW4gLT0gMztcbiAgICAgICAgICAgICAgfSB3aGlsZSAobGVuID4gMik7XG4gICAgICAgICAgICAgIGlmIChsZW4pIHtcbiAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IG91dHB1dFtmcm9tKytdO1xuICAgICAgICAgICAgICAgIGlmIChsZW4gPiAxKSB7XG4gICAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IG91dHB1dFtmcm9tKytdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBlbHNlIGlmICgob3AgJiA2NCkgPT09IDApIHsgICAgICAgICAgLyogMm5kIGxldmVsIGRpc3RhbmNlIGNvZGUgKi9cbiAgICAgICAgICAgIGhlcmUgPSBkY29kZVsoaGVyZSAmIDB4ZmZmZikvKmhlcmUudmFsKi8gKyAoaG9sZCAmICgoMSA8PCBvcCkgLSAxKSldO1xuICAgICAgICAgICAgY29udGludWUgZG9kaXN0O1xuICAgICAgICAgIH1cbiAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHN0cm0ubXNnID0gJ2ludmFsaWQgZGlzdGFuY2UgY29kZSc7XG4gICAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgICAgYnJlYWsgdG9wO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGJyZWFrOyAvLyBuZWVkIHRvIGVtdWxhdGUgZ290byB2aWEgXCJjb250aW51ZVwiXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGVsc2UgaWYgKChvcCAmIDY0KSA9PT0gMCkgeyAgICAgICAgICAgICAgLyogMm5kIGxldmVsIGxlbmd0aCBjb2RlICovXG4gICAgICAgIGhlcmUgPSBsY29kZVsoaGVyZSAmIDB4ZmZmZikvKmhlcmUudmFsKi8gKyAoaG9sZCAmICgoMSA8PCBvcCkgLSAxKSldO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pb25zLiBOZWdhdGl2ZSB2YWx1ZXNcbiAqIGFyZSBlcnJvcnMsIHBvc2l0aXZlIHZhbHVlcyBhcmUgdXNlZCBmb3Igc3BlY2lhbCBidXQgbm9ybWFsIGV2ZW50cy5cbiAqL1xudmFyIFpfT0sgICAgICAgICAgICA9IDA7XG52YXIgWl9TVFJFQU1fRU5EICAgID0gMTtcbnZhciBaX05FRURfRElDVCAgICAgPSAyO1xuLy92YXIgWl9FUlJOTyAgICAgICAgID0gLTE7XG52YXIgWl9TVFJFQU1fRVJST1IgID0gLTI7XG52YXIgWl9EQVRBX0VSUk9SICAgID0gLTM7XG52YXIgWl9NRU1fRVJST1IgICAgID0gLTQ7XG52YXIgWl9CVUZfRVJST1IgICAgID0gLTU7XG4vL3ZhciBaX1ZFUlNJT05fRVJST1IgPSAtNjtcblxuLyogVGhlIGRlZmxhdGUgY29tcHJlc3Npb24gbWV0aG9kICovXG52YXIgWl9ERUZMQVRFRCAgPSA4O1xuXG5cbi8qIFNUQVRFUyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuXG5cbnZhciAgICBIRUFEID0gMTsgICAgICAgLyogaTogd2FpdGluZyBmb3IgbWFnaWMgaGVhZGVyICovXG52YXIgICAgRkxBR1MgPSAyOyAgICAgIC8qIGk6IHdhaXRpbmcgZm9yIG1ldGhvZCBhbmQgZmxhZ3MgKGd6aXApICovXG52YXIgICAgVElNRSA9IDM7ICAgICAgIC8qIGk6IHdhaXRpbmcgZm9yIG1vZGlmaWNhdGlvbiB0aW1lIChnemlwKSAqL1xudmFyICAgIE9TID0gNDsgICAgICAgICAvKiBpOiB3YWl0aW5nIGZvciBleHRyYSBmbGFncyBhbmQgb3BlcmF0aW5nIHN5c3RlbSAoZ3ppc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ICAgICAvLz09PSBJTklUQklUUygpO1xuICAgICAgICBob2xkID0gMDtcbiAgICAgICAgYml0cyA9IDA7XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgc3RhdGUubW9kZSA9IEZMQUdTO1xuICAgICAgICBicmVhaztcbiAgICAgIH1cbiAgICAgIHN0YXRlLmZsYWdzID0gMDsgICAgICAgICAgIC8qIGV4cGVjdCB6bGliIGhlYWRlciAqL1xuICAgICAgaWYgKHN0YXRlLmhlYWQpIHtcbiAgICAgICAgc3RhdGUuaGVhZC5kb25lID0gZmFsc2U7XG4gICAgICB9XG4gICAgICBpZiAoIShzdGF0ZS53cmFwICYgMSkgfHwgICAvKiBjaGVjayBpZiB6bGliIGhlYWRlciBhbGxvd2VkICovXG4gICAgICAgICgoKGhvbGQgJiAweGZmKS8qQklUUyg4KSovIDw8IDgpICsgKGhvbGQgPj4gOCkpICUgMzEpIHtcbiAgICAgICAgc3RybS5tc2cgPSAnaW5jb3JyZWN0IGhlYWRlciBjaGVjayc7XG4gICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgIGJyZWFrO1xuICAgICAgfVxuICAgICAgaWYgKChob2xkICYgMHgwZikvKkJJVFMoNCkqLyAhPT0gWl9ERUZMQVRFRCkge1xuICAgICAgICBzdHJtLm1zZyA9ICd1bmtub3duIGNvbXByZXNzaW9uIG1ldGhvZCc7XG4gICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgIGJyZWFrO1xuICAgICAgfVxuICAgICAgLy8tLS0gRFJPUEJJVFMoNCkgLS0tLy9cbiAgICAgIGhvbGQgPj4+PSA0O1xuICAgICAgYml0cyAtPSA0O1xuICAgICAgLy8tLS0vL1xuICAgICAgbGVuID0gKGhvbGQgJiAweDBmKS8qQklUUyg0KSovICsgODtcbiAgICAgIGlmIChzdGF0ZS53Yml0cyA9PT0gMCkge1xuICAgICAgICBzdGF0ZS53Yml0cyA9IGxlbjtcbiAgICAgIH1cbiAgICAgIG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y8gZXh0cmEgZmllbGQgaXMgbGltaXRlZCB0byA2NTUzNiBieXRlc1xuICAgICAgICAgICAgICAvLyAtIG5vIG5lZWQgZm9yIGFkZGl0aW9uYWwgc2l6ZSBjaGVja1xuICAgICAgICAgICAgICBjb3B5LFxuICAgICAgICAgICAgICAvKmxlbiArIGNvcHkgPiBzdGF0ZS5oZWFkLmV4dHJhX21heCAtIGxlbiA/IHN0YXRlLmhlYWQuZXh0cmFfbWF4IDogY29weSwqL1xuICAgICAgICAgICAgICBsZW5cbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICAvL3ptZW1jcHkoc3RhdGUuaGVhZC5leHRyYSArIGxlbiwgbmV4dCxcbiAgICAgICAgICAgIC8vICAgICAgICBsZW4gKyBjb3B5ID4gc3RhdGUuaGVhZC5leHRyYV9tYXggP1xuICAgICAgICAgICAgLy8gICAgICAgIHN0YXRlLmhlYWQuZXh0cmFfbWF4IC0gbGVuIDogY29weSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChzdGF0ZS5mbGFncyAmIDB4MDIwMCkge1xuICAgICAgICAgICAgc3RhdGUuY2hlY2sgPSBjcmMzMihzdGF0ZS5jaGVjaywgaW5wdXQsIGNvcHksIG5leHQpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBoYXZlIC09IGNvcHk7XG4gICAgICAgICAgbmV4dCArPSBjb3B5O1xuICAgICAgICAgIHN0YXRlLmxlbmd0aCAtPSBjb3B5O1xuICAgICAgICB9XG4gICAgICAgIGlmIChzdGF0ZS5sZW5ndGgpIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICB9XG4gICAgICBzdGF0ZS5sZW5ndGggPSAwO1xuICAgICAgc3RhdGUubW9kZSA9IE5BTUU7XG4gICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgY2FzZSBOQU1FOlxuICAgICAgaWYgKHN0YXRlLmZsYWdzICYgMHgwODAwKSB7XG4gICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZ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gYml0cyAmIDc7XG4gICAgICAgIGJpdHMgLT0gYml0cyAmIDc7XG4gICAgICAgIC8vLS0tLy9cbiAgICAgICAgc3RhdGUubW9kZSA9IENIRUNLO1xuICAgICAgICBicmVhaztcbiAgICAgIH1cbiAgICAgIC8vPT09IE5FRURCSVRTKDMpOyAqL1xuICAgICAgd2hpbGUgKGJpdHMgPCAzKSB7XG4gICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICBoYXZlLS07XG4gICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICBiaXRzICs9IDg7XG4gICAgICB9XG4gICAgICAvLz09PS8vXG4gICAgICBzdGF0ZS5sYXN0ID0gKGhvbGQgJiAweDAxKS8qQklUUygxKSovO1xuICAgICAgLy8tLS0gRFJPUEJJVFMoMSkgLS0tLy9cbiAgICAgIGhvbGQgPj4+PSAxO1xuICAgICAgYml0cyAtPSAxO1xuICAgICAgLy8tLS0vL1xuXG4gICAgICBzd2l0Y2ggKChob2xkICYgMHgwMykvKkJJVFMoMikqLykge1xuICAgICAgY2FzZSAwOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogc3RvcmVkIGJsb2NrICovXG4gICAgICAgIC8vVHJhY2V2KChzdGRlcnIsIFwiaW5mbGF0ZTogICAgIHN0b3JlZCBibG9jayVzXFxuXCIsXG4gICAgICAgIC8vICAgICAgICBzdGF0ZS5sYXN0ID8gXCIgKGxhc3QpXCIgOiBcIlwiKSk7XG4gICAgICAgIHN0YXRlLm1vZGUgPSBTVE9SRUQ7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAxOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZml4ZWQgYmxvY2sgKi9cbiAgICAgICAgZml4ZWR0YWJsZXMoc3RhdGUpO1xuICAgICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgICBmaXhlZCBjb2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xuICAgICAgICAgIGhvbGQgPj4+PSBoZXJlX2JpdHM7XG4gICAgICAgICAgYml0cyAtPSBoZXJlX2JpdHM7XG4gICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgIHN0YXRlLmxlbnNbc3RhdGUuaGF2ZSsrXSA9IGhlcmVfdmFsO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgIGlmIChoZXJlX3ZhbCA9PT0gMTYpIHtcbiAgICAgICAgICAgIC8vPT09IE5FRURCSVRTKGhlcmUuYml0cyArIDIpO1xuICAgICAgICAgICAgbiA9IGhlcmVfYml0cyArIDI7XG4gICAgICAgICAgICB3aGlsZSAoYml0cyA8IG4pIHtcbiAgICAgICAgICAgICAgaWYgKGhhdmUgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vPT09Ly9cbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKGhlcmUuYml0cykgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSBoZXJlX2JpdHM7XG4gICAgICAgICAgICBiaXRzIC09IGhlcmVfYml0cztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICAgIGlmIChzdGF0ZS5oYXZlID09PSAwKSB7XG4gICAgICAgICAgICAgIHN0cm0ubXNnID0gJ2ludmFsaWQgYml0IGxlbmd0aCByZXBlYXQnO1xuICAgICAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxlbiA9IHN0YXRlLmxlbnNbc3RhdGUuaGF2ZSAtIDFdO1xuICAgICAgICAgICAgY29weSA9IDMgKyAoaG9sZCAmIDB4MDMpOy8vQklUUygyKTtcbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKDIpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gMjtcbiAgICAgICAgICAgIGJpdHMgLT0gMjtcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICB9XG4gICAgICAgICAgZWxzZSBpZiAoaGVyZV92YWwgPT09IDE3KSB7XG4gICAgICAgICAgICAvLz09PSBORUVEQklUUyhoZXJlLmJpdHMgKyAzKTtcbiAgICAgICAgICAgIG4gPSBoZXJlX2JpdHMgKyAzO1xuICAgICAgICAgICAgd2hpbGUgKGJpdHMgPCBuKSB7XG4gICAgICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLz09PS8vXG4gICAgICAgICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gaGVyZV9iaXRzO1xuICAgICAgICAgICAgYml0cyAtPSBoZXJlX2JpdHM7XG4gICAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgICBsZW4gPSAwO1xuICAgICAgICAgICAgY29weSA9IDMgKyAoaG9sZCAmIDB4MDcpOy8vQklUUygzKTtcbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKDMpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gMztcbiAgICAgICAgICAgIGJpdHMgLT0gMztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICB9XG4gICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAvLz09PSBORUVEQklUUyhoZXJlLmJpdHMgKyA3KTtcbiAgICAgICAgICAgIG4gPSBoZXJlX2JpdHMgKyA3O1xuICAgICAgICAgICAgd2hpbGUgKGJpdHMgPCBuKSB7XG4gICAgICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLz09PS8vXG4gICAgICAgICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gaGVyZV9iaXRzO1xuICAgICAgICAgICAgYml0cyAtPSBoZXJlX2JpdHM7XG4gICAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgICBsZW4gPSAwO1xuICAgICAgICAgICAgY29weSA9IDExICsgKGhvbGQgJiAweDdmKTsvL0JJVFMoNyk7XG4gICAgICAgICAgICAvLy0tLSBEUk9QQklUUyg3KSAtLS0vL1xuICAgICAgICAgICAgaG9sZCA+Pj49IDc7XG4gICAgICAgICAgICBiaXRzIC09IDc7XG4gICAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChzdGF0ZS5oYXZlICsgY29weSA+IHN0YXRlLm5sZW4gKyBzdGF0ZS5uZGlzdCkge1xuICAgICAgICAgICAgc3RybS5tc2cgPSAnaW52YWxpZCBiaXQgbGVuZ3RoIHJlcGVhdCc7XG4gICAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICAgIHdoaWxlIChjb3B5LS0pIHtcbiAgICAgICAgICAgIHN0YXRlLmxlbnNbc3RhdGUuaGF2ZSsrXSA9IGxlbjtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgLyogaGFuZGxlIGVycm9yIGJ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G4gICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgLy8tLS0vL1xuICAgICAgfVxuICAgICAgaWYgKChoZXJlX29wICYgMHhmMCkgPT09IDApIHtcbiAgICAgICAgbGFzdF9iaXRzID0gaGVyZV9iaXRzO1xuICAgICAgICBsYXN0X29wID0gaGVyZV9vcDtcbiAgICAgICAgbGFzdF92YWwgPSBoZXJlX3ZhbDtcbiAgICAgICAgZm9yICg7Oykge1xuICAgICAgICAgIGhlcmUgPSBzdGF0ZS5kaXN0Y29kZVtsYXN0X3ZhbCArXG4gICAgICAgICAgICAgICAgICAoKGhvbGQgJiAoKDEgPDwgKGxhc3RfYml0cyArIGxhc3Rfb3ApKSAtMSkpLypCSVRTKGxhc3QuYml0cyArIGxhc3Qub3ApKi8gPj4gbGFzdF9iaXRzKV07XG4gICAgICAgICAgaGVyZV9iaXRzID0gaGVyZSA+Pj4gMjQ7XG4gICAgICAgICAgaGVyZV9vcCA9IChoZXJlID4+PiAxNikgJiAweGZmO1xuICAgICAgICAgIGhlcmVfdmFsID0gaGVyZSAmIDB4ZmZmZjtcblxuICAgICAgICAgIGlmICgobGFzdF9iaXRzICsgaGVyZV9iaXRzKSA8PSBiaXRzKSB7IGJyZWFrOyB9XG4gICAgICAgICAgLy8tLS0gUFVMTEJZVEUoKSAtLS0vL1xuICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgLy8tLS0vL1xuICAgICAgICB9XG4gICAgICAgIC8vLS0tIERST1BCSVRTKGxhc3QuYml0cykgLS0tLy9cbiAgICAgICAgaG9sZCA+Pj49IGxhc3RfYml0cztcbiAgICAgICAgYml0cyAtPSBsYXN0X2JpdHM7XG4gICAgICAgIC8vLS0tLy9cbiAgICAgICAgc3RhdGUuYmF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gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgfVxuICAgICAgICAvLz09PS8vXG4gICAgICAgIF9vdXQgLT0gbGVmdDtcbiAgICAgICAgc3RybS50b3RhbF9vdXQgKz0gX291dDtcbiAgICAgICAgc3RhdGUudG90YWwgKz0gX291dDtcbiAgICAgICAgaWYgKF9vdXQpIHtcbiAgICAgICAgICBzdHJtLmFkbGVyID0gc3RhdGUuY2hlY2sgPVxuICAgICAgICAgICAgICAvKlVQREFURShzdGF0ZS5jaGVjaywgcHV0IC0gX291dCwgX291dCk7Ki9cbiAgICAgICAgICAgICAgKHN0YXRlLmZsYWdzID8gY3JjMzIoc3RhdGUuY2hlY2ssIG91dHB1dCwgX291dCwgcHV0IC0gX291dCkgOiBhZGxlcjMyKHN0YXRlLmNoZWNrLCBvdXRwdXQsIF9vdXQsIHB1dCAtIF9vdXQpKTtcblxuICAgICAgICB9XG4gICAgICAgIF9vdXQgPSBsZWZ0O1xuICAgICAgICAvLyBOQjogY3JjMzIgc3RvcmVkIGFzIHNpZ25lZCAzMi1iaXQgaW50LCBaU1dBUDMyIHJldHVybnMgc2lnbmVkIHRvb1xuICAgICAgICBpZiAoKHN0YXRlLmZsYWdzID8gaG9sZCA6IFpTV0FQMzIoaG9sZCkpICE9PSBzdGF0ZS5jaGVjaykge1xuICAgICAgICAgIHN0cm0ubXNnID0gJ2luY29ycmVjdCBkYXRhIGNoZWNrJztcbiAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIC8vPT09IElOSVRCSVRTKCk7XG4gICAgICAgIGhvbGQgPSAwO1xuICAgICAgICBiaXRzID0gMDtcbiAgICAgICAgLy89PT0vL1xuICAgICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgY2hlY2sgbWF0Y2hlcyB0cmFpbGVyXFxuXCIpKTtcbiAgICAgIH1cbiAgICAgIHN0YXRlLm1vZGUgPSBMRU5HVEg7XG4gICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgY2FzZSBMRU5HVEg6XG4gICAgICBpZiAoc3RhdGUud3JhcCAmJiBzdGF0ZS5mbGFncykge1xuICAgICAgICAvLz09PSBORUVEQklUUygzMik7XG4gICAgICAgIHdoaWxlIChiaXRzIDwgMzIpIHtcbiAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICB9XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgaWYgKGhvbGQgIT09IChzdGF0ZS50b3RhbCAmIDB4ZmZmZmZmZmYpKSB7XG4gICAgICAgICAgc3RybS5tc2cgPSAnaW5jb3JyZWN0IGxlbmd0aCBjaGVjayc7XG4gICAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICAvLz09PSBJTklUQklUUygpO1xuICAgICAgICBob2xkID0gMDtcbiAgICAgICAgYml0cyA9IDA7XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgLy9UcmFjZXYoKHN0ZGVyciwgXCJpbmZsYXRlOiAgIGxlbmd0aCBtYXRjaGVzIHRyYWlsZXJcXG5cIikpO1xuICAgICAgfVxuICAgICAgc3RhdGUubW9kZSA9IERPTkU7XG4gICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgY2FzZSBET05FOlxuICAgICAgcmV0ID0gWl9TVFJFQU1fRU5EO1xuICAgICAgYnJlYWsgaW5mX2xlYXZlO1xuICAgIGNhc2UgQkFEOlxuICAgICAgcmV0ID0gWl9EQVRBX0VSUk9SO1xuICAgICAgYnJlYWsgaW5mX2xlYXZlO1xuICAgIGNhc2Ug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IGxlbnNfaW5kZXgsIGNvZGVzLCB0YWJsZSwgdGFibGVfaW5kZXgsIHdvcmssIG9wdHMpXG57XG4gIHZhciBiaXRzID0gb3B0cy5iaXRzO1xuICAgICAgLy9oZXJlID0gb3B0cy5oZXJlOyAvKiB0YWJsZSBlbnRyeSBmb3IgZHVwbGljYXRpb24gKi9cblxuICB2YXIgbGVuID0gMDsgICAgICAgICAgICAgICAvKiBhIGNvZGUncyBsZW5ndGggaW4gYml0cyAqL1xuICB2YXIgc3ltID0gMDsgICAgICAgICAgICAgICAvKiBpbmRleCBvZiBjb2RlIHN5bWJvbHMgKi9cbiAgdmFyIG1pbiA9IDAsIG1heCA9IDA7ICAgICAgICAgIC8qIG1pbmltdW0gYW5kIG1heGltdW0gY29kZSBsZW5ndGhzICovXG4gIHZhciByb290ID0gMDsgICAgICAgICAgICAgIC8qIG51bWJlciBvZiBpbmRleCBiaXRzIGZvciByb290IHRhYmxlICovXG4gIHZhciBjdXJyID0gMDsgICAgICAgICAgICAgIC8qIG51bWJlciBvZiBpbmRleCBiaXRzIGZvciBjdXJyZW50IHRhYmxlICovXG4gIHZhciBkcm9wID0gMDsgICAgICAgICAgICAgIC8qIGNvZGUgYml0cyB0byBkcm9wIGZvciBzdWItdGFibGUgKi9cbiAgdmFyIGxlZnQgPSAwOyAgICAgICAgICAgICAgICAgICAvKiBudW1iZXIgb2YgcHJlZml4IGNvZGVzIGF2YWlsYWJsZSAqL1xuICB2YXIgdXNlZCA9IDA7ICAgICAgICAgICAgICAvKiBjb2RlIGVudHJpZXMgaW4gdGFibGUgdXNlZCAqL1xuICB2YXIgaHVmZiA9IDA7ICAgICAgICAgICAgICAvKiBIdWZmbWFuIGNvZGUgKi9cbiAgdmFyIGluY3I7ICAgICAgICAgICAgICAvKiBmb3IgaW5jcmVtZW50aW5nIGNvZGUsIGluZGV4ICovXG4gIHZhciBmaWxsOyAgICAgICAgICAgICAgLyogaW5kZXggZm9yIHJlcGxpY2F0aW5nIGVudHJpZXM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JsZVtuZXh0ICsgaHVmZl0gPSAoKGxlbiAtIGRyb3ApIDw8IDI0KSB8ICg2NCA8PCAxNikgfDA7XG4gIH1cblxuICAvKiBzZXQgcmV0dXJuIHBhcmFtZXRlcnMgKi9cbiAgLy9vcHRzLnRhYmxlX2luZGV4ICs9IHVzZWQ7XG4gIG9wdHMuYml0cyA9IHJvb3Q7XG4gIHJldHVybiAwO1xufTtcbiIsIid1c2Ugc3RyaWN0JztcblxubW9kdWxlLmV4cG9ydHMgPSB7XG4gICcyJzogICAgJ25lZWQgZGljdGlvbmFyeScsICAgICAvKiBaX05FRURfRElDVCAgICAgICAyICAqL1xuICAnMSc6ICAgICdzdHJlYW0gZW5kJywgICAgICAgICAgLyogWl9TVFJFQU1fRU5EICAgICAgMSAgKi9cbiAgJzAnOiAgICAnJywgICAgICAgICAgICAgICAgICAgIC8qIFpfT0sgICAgICAgICAgICAgIDAgICovXG4gICctMSc6ICAgJ2ZpbGUgZXJyb3InLCAgICAgICAgICAvKiBaX0VSUk5PICAgICAgICAgKC0xKSAqL1xuICAnLTInOiAgICdzdHJlYW0gZXJyb3InLCAgICAgICAgLyogWl9TVFJFQU1fRVJST1IgICgtMikgKi9cbiAgJy0zJzogICAnZGF0YSBlcnJvcicsICAgICAgICAgIC8qIFpfREFUQV9FUlJPUiAgICAoLTMpICovXG4gICctNCc6ICAgJ2luc3VmZmljaWVudCBtZW1vcnknLCAvKiBaX01FTV9FUlJPUiAgICAgKC00KSAqL1xuICAnLTUnOiAgICdidWZmZXIgZXJyb3InLCAgICAgICAgLyogWl9CVUZfRVJST1IgICAgICgtNSkgKi9cbiAgJy02JzogICAnaW5jb21wYXRpYmxlIHZlcnNpb24nIC8qIFpfVkVSU0lPTl9FUlJPUiAoLTYpICovXG59O1xuIiwiJ3VzZSBzdHJpY3QnO1xuXG5cbnZhciB1dGlscyA9IHJlcXVpcmUoJy4uL3V0aWxzL2NvbW1vbicpO1xuXG4vKiBQdWJsaWMgY29uc3RhbnRzID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cblxuXG4vL3ZhciBaX0ZJTFRFUkVEICAgICAgICAgID0gMTtcbi8vdmFyIFpfSFVGRk1BTl9PTkxZICAgICAgPSAyO1xuLy92YXIgWl9STEUgICAgICAgICAgICAgICA9IDM7XG52YXIgWl9GSVhFRCAgICAgICAgICAgICAgID0gNDtcbi8vdmFyIFpfREVGQVVMVF9TVFJBVEVHWSAgPSAwO1xuXG4vKiBQb3NzaWJsZSB2YWx1ZXMgb2YgdGhlIGRhdGFfdHlwZSBmaWVsZCAodGhvdWdoIHNlZSBpbmZsYXRlKCkpICovXG52YXIgWl9CSU5BUlkgICAgICAgICAgICAgID0gMDtcbnZhciBaX1RFWFQgICAgICAgICAgICAgICAgPSAxO1xuLy92YXIgWl9BU0NJSSAgICAgICAgICAgICA9IDE7IC8vID0gWl9URVhUXG52YXIgWl9VTktOT1dOICAgICAgICAgICAgID0gMjtcblxuLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cblxuXG5mdW5jdGlvbiB6ZXJvKGJ1ZikgeyB2YXIgbGVuID0gYnVmLmxlbmd0aDsgd2hpbGUgKC0tbGVuID49IDApIHsgYnVmW2xlbl0gPSAwOyB9IH1cblxuLy8gRnJvbSB6dXRpbC5oXG5cbnZhciBTVE9SRURfQkxPQ0sgPSAwO1xudmFyIFNUQVRJQ19UUkVFUyA9IDE7XG52YXIgRFlOX1RSRUVTICAgID0gMjtcbi8qIFRoZSB0aHJlZSBraW5kcyBvZiBibG9jayB0eXBlICovXG5cbnZhciBNSU5fTUFUQ0ggICAgPSAzO1xudmFyIE1BWF9NQVRDSCAgICA9IDI1ODtcbi8qIF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gIHJlcyB8PSBjb2RlICYgMTtcbiAgICBjb2RlID4+Pj0gMTtcbiAgICByZXMgPDw9IDE7XG4gIH0gd2hpbGUgKC0tbGVuID4gMCk7XG4gIHJldHVybiByZXMgPj4+IDE7XG59XG5cblxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBGbHVzaCB0aGUgYml0IGJ1ZmZlciwga2VlcGluZyBhdCBtb3N0IDcgYml0cyBpbiBpdC5cbiAqL1xuZnVuY3Rpb24gYmlfZmx1c2gocykge1xuICBpZiAocy5iaV92YWxpZCA9PT0gMTYpIHtcbiAgICBwdXRfc2hvcnQocywgcy5iaV9idWYpO1xuICAgIHMuYmlfYnVmID0gMDtcbiAgICBzLmJpX3ZhbGlkID0gMDtcblxuICB9IGVsc2UgaWYgKHMuYmlfdmFsaWQgPj0gOCkge1xuICAgIHMucGVuZGluZ19idWZbcy5wZW5kaW5nKytdID0gcy5iaV9idWYgJiAweGZmO1xuICAgIHMuYmlfYnVmID4+PSA4O1xuICAgIHMuYmlfdmFsaWQgLT0gODtcbiAgfVxufVxuXG5cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogQ29tcHV0ZSB0aGUgb3B0aW1hbCBiaXQgbGVuZ3RocyBmb3IgYSB0cmVlIGFuZCB1cGRhdGUgdGhlIHRvdGFsIGJpdCBsZW5ndGhcbiAqIGZvciB0aGUgY3VycmVudCBibG9jay5cbiAqIElOIGFzc2VydGlvbjogdGhlIGZpZWxkcyBmcmVxIGFuZCBkYWQgYXJlIHNldCwgaGVhcFtoZWFwX21heF0gYW5kXG4gKiAgICBhYm92ZSBhcmUgdGhlIHRyZWUgbm9kZXMgc29ydGVkIGJ5IGluY3JlYXNpbmcgZnJlcXVlbmN5LlxuICogT1VUIGFzc2VydGlvbnM6IHRoZS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ZVtjdXJsZW4gKiAyXS8qLkZyZXEqLyArPSBjb3VudDtcblxuICAgIH0gZWxzZSBpZiAoY3VybGVuICE9PSAwKSB7XG5cbiAgICAgIGlmIChjdXJsZW4gIT09IHByZXZsZW4pIHsgcy5ibF90cmVlW2N1cmxlbiAqIDJdLyouRnJlcSovKys7IH1cbiAgICAgIHMuYmxfdHJlZVtSRVBfM182KjJdLyouRnJlcSovKys7XG5cbiAgICB9IGVsc2UgaWYgKGNvdW50IDw9IDEwKSB7XG4gICAgICBzLmJsX3RyZWVbUkVQWl8zXzEwKjJdLyouRnJlcSovKys7XG5cbiAgICB9IGVsc2Uge1xuICAgICAgcy5ibF90cmVlW1JFUFpfMTFfMTM4KjJdLyouRnJlcSovKys7XG4gICAgfVxuXG4gICAgY291bnQgPSAwO1xuICAgIHByZXZsZW4gPSBjdXJsZW47XG5cbiAgICBpZiAobmV4dGxlbiA9PT0gMCkge1xuICAgICAgbWF4X2NvdW50ID0gMTM4O1xuICAgICAgbWluX2NvdW50ID0gMztcblxuICAgIH0gZWxzZSBpZiAoY3VybGVuID09PSBuZXh0bGVuKSB7XG4gICAgICBtYXhfY291bnQgPSA2O1xuICAgICAgbWluX2NvdW50ID0gMztcblxuICAgIH0gZWxzZSB7XG4gICAgICBtYXhfY291bnQgPSA3O1xuICAgICAgbWluX2NvdW50ID0gNDtcbiAgICB9XG4gIH1cbn1cblxuXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIFNlbmQgYSBsaXRlcmFsIG9yIGRpc3RhbmNlIHRyZWUgaW4gY29tcHJlc3NlZCBmb3JtLCB1c2luZyB0aGUgY29kZXMgaW5cbiAqIGJsX3RyZWUuXG4gKi9cbmZ1bmN0aW9uIHNlbmRfdHJlZShzLCB0cmVlLCBtYXhfY29kZSlcbi8vICAgIGRlZmxhdGVfc3RhdGUgKnM7XG4vLyAgICBjdF9kYXRh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Igc2VsZiA9IHRoaXM7XG5cbiAgdmFyIGFzeW5jID0gdHlwZW9mIGNiID09PSAnZnVuY3Rpb24nO1xuXG4gIGlmICghYXN5bmMpIHtcbiAgICB2YXIgYnVmZmVycyA9IFtdO1xuICAgIHZhciBucmVhZCA9IDA7XG5cbiAgICB2YXIgZXJyb3I7XG4gICAgdGhpcy5vbignZXJyb3InLCBmdW5jdGlvbihlcikge1xuICAgICAgZXJyb3IgPSBlcjtcbiAgICB9KTtcblxuICAgIGRvIHtcbiAgICAgIHZhciByZXMgPSB0aGlzLl9iaW5kaW5nLndyaXRlU3luYyhmbHVzaEZsYWcsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2h1bmssIC8vIGluXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5PZmYsIC8vIGluX29mZlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF2YWlsSW5CZWZvcmUsIC8vIGluX2xlblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2J1ZmZlciwgLy8gb3V0XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fb2Zmc2V0LCAvL291dF9vZmZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdmFpbE91dEJlZm9yZSk7IC8vIG91dF9sZW5cbiAgICB9IHdoaWxlICghdGhpcy5faGFkRXJyb3IgJiYgY2FsbGJhY2socmVzWzBdLCByZXNbMV0pKTtcblxuICAgIGlmICh0aGlzLl9oYWRFcnJvcikge1xuICAgICAgdGhyb3cgZXJyb3I7XG4gICAgfVxuXG4gICAgdmFyIGJ1ZiA9IEJ1ZmZlci5jb25jYXQoYnVmZmVycywgbnJlYWQpO1xuICAgIHRoaXMuY2xvc2UoKTtcblxuICAgIHJldHVybiBidWY7XG4gIH1cblxuICB2YXIgcmVxID0gdGhpcy5fYmluZGluZy53cml0ZShmbHVzaEZsYWcsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNodW5rLCAvLyBpblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbk9mZiwgLy8gaW5fb2ZmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF2YWlsSW5CZWZvcmUsIC8vIGluX2xlblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9idWZmZXIsIC8vIG91dFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9vZmZzZXQsIC8vb3V0X29mZlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdmFpbE91dEJlZm9yZSk7IC8vIG91dF9sZW5cblxuICByZXEuYnVmZmVyID0gY2h1bms7XG4gIHJlcS5jYWxsYmFjayA9IGNhbGxiYWNrO1xuXG4gIGZ1bmN0aW9uIGNhbGxiYWNrKGF2YWlsSW5BZnRlciwgYXZhaWxPdXRBZnRlcikge1xuICAgIGlmIChzZWxmLl9oYWRFcnJvcilcbiAgICAgIHJldHVybjtcblxuICAgIHZhciBoYXZlID0gYXZhaWxPdXRCZWZvcmUgLSBhdmFpbE91dEFmdGVyO1xuICAgIGFzc2VydChoYXZlID49IDAsICdoYXZlIHNob3VsZCBub3QgZ28gZG93bicpO1xuXG4gICAgaWYgKGhhdmUgPiAwKSB7XG4gICAgICB2YXIgb3V0ID0gc2VsZi5fYnVmZmVyLnNsaWNlKHNlbGYuX29mZnNldCwgc2VsZi5fb2Zmc2V0ICsgaGF2ZSk7XG4gICAgICBzZWxmLl9vZmZzZXQgKz0gaGF2ZTtcbiAgICAgIC8vIHNlcnZlIHNvbWUgb3V0cHV0IHRvIHRoZSBjb25zdW1lci5cbiAgICAgIGlmIChhc3luYykge1xuICAgICAgICBzZWxmLnB1c2gob3V0KTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGJ1ZmZlcnMucHVzaChvdXQpO1xuICAgICAgICBucm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gICAgICAgICAgICAgICAgICBpbk9mZixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF2YWlsSW5CZWZvcmUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9idWZmZXIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9vZmZzZXQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9jaHVua1NpemUpO1xuICAgICAgbmV3UmVxLmNhbGxiYWNrID0gY2FsbGJhY2s7IC8vIHRoaXMgc2FtZSBmdW5jdGlvblxuICAgICAgbmV3UmVxLmJ1ZmZlciA9IGNodW5rO1xuICAgICAgcmV0dXJuO1xuICAgIH1cblxuICAgIGlmICghYXN5bmMpXG4gICAgICByZXR1cm4gZmFsc2U7XG5cbiAgICAvLyBmaW5pc2hlZCB3aXRoIHRoZSBjaHVuay5cbiAgICBjYigpO1xuICB9XG59O1xuXG51dGlsLmluaGVyaXRzKERlZmxhdGUsIFpsaWIpO1xudXRpbC5pbmhlcml0cyhJbmZsYXRlLCBabGliKTtcbnV0aWwuaW5oZXJpdHMoR3ppcCwgWmxpYik7XG51dGlsLmluaGVyaXRzKEd1bnppcCwgWmxpYik7XG51dGlsLmluaGVyaXRzKERlZmxhdGVSYXcsIFpsaWIpO1xudXRpbC5pbmhlcml0cyhJbmZsYXRlUmF3LCBabGliKTtcbnV0aWwuaW5oZXJpdHMoVW56aXAsIFpsaWIpO1xuIiwiJ3VzZSBzdHJpY3QnXG5cbmV4cG9ydHMudG9CeXRlQXJyYXkgPSB0b0J5dGVBcnJheVxuZXhwb3J0cy5mcm9tQnl0ZUFycmF5ID0gZnJvbUJ5dGVBcnJheVxuXG52YXIgbG9va3VwID0gW11cbnZhciByZXZMb29rdXAgPSBbXVxudmFyIEFyciA9IHR5cGVvZiBVaW50OEFycmF5ICE9PSAndW5kZWZpbmVkJyA/IFVpbnQ4QX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ZVBvaW50ID4gMHhEN0ZGICYmIGNvZGVQb2ludCA8IDB4RTAwMCkge1xuICAgICAgLy8gbGFzdCBjaGFyIHdhcyBhIGxlYWRcbiAgICAgIGlmICghbGVhZFN1cnJvZ2F0ZSkge1xuICAgICAgICAvLyBubyBsZWFkIHlldFxuICAgICAgICBpZiAoY29kZVBvaW50ID4gMHhEQkZGKSB7XG4gICAgICAgICAgLy8gdW5leHBlY3RlZCB0cmFpbFxuICAgICAgICAgIGlmICgodW5pdHMgLT0gMykgPiAtMSkgYnl0ZXMucHVzaCgweEVGLCAweEJGLCAweEJEKVxuICAgICAgICAgIGNvbnRpbnVlXG4gICAgICAgIH0gZWxzZSBpZiAoaSArIDEgPT09IGxlbmd0aCkge1xuICAgICAgICAgIC8vIHVucGFpcmVkIGxlYWRcbiAgICAgICAgICBpZiAoKHVuaXRzIC09IDMpID4gLTEpIGJ5dGVzLnB1c2goMHhFRiwgMHhCRiwgMHhCRClcbiAgICAgICAgICBjb250aW51ZVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gdmFsaWQgbGVhZFxuICAgICAgICBsZWFkU3Vycm9nYXRlID0gY29kZVBvaW50XG5cbiAgICAgICAgY29udGludWVcbiAgICAgIH1cblxuICAgICAgLy8gMiBsZWFkcyBpbiBhIHJvd1xuICAgICAgaWYgKGNvZGVQb2ludCA8IDB4REMwMCkge1xuICAgICAgICBpZiAoKHVuaXRzIC09IDMpID4gLTEpIGJ5dGVzLnB1c2goMHhFRiwgMHhCRiwgMHhCRClcbiAgICAgICAgbGVhZFN1cnJvZ2F0ZSA9IGNvZGVQb2ludFxuICAgICAgICBjb250aW51ZVxuICAgICAgfVxuXG4gICAgICAvLyB2YWxpZCBzdXJyb2dhdGUgcGFpclxuICAgICAgY29kZVBvaW50ID0gKGxlYWRTdXJyb2dhdGUgLSAweEQ4MDAgPDwgMTAgfCBjb2RlUG9pbnQgLSAweERDMDApICsgMHgxMDAwMFxuICAgIH0gZWxzZSBpZiAobGVhZFN1cn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VhZGVyRGF0YVNldCkge1xuICAgICAgICAgICAgaWYobWV0YUhlYWRlckRhdGFTZXQuZWxlbWVudHMueDAwMDIwMDEwID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyAnZGljb21QYXJzZXIucGFyc2VEaWNvbTogbWlzc2luZyByZXF1aXJlZCBtZXRhIGhlYWRlciBhdHRyaWJ1dGUgMDAwMiwwMDEwJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciB0cmFuc2ZlclN5bnRheEVsZW1lbnQgPSBtZXRhSGVhZGVyRGF0YVNldC5lbGVtZW50cy54MDAwMjAwMTA7XG4gICAgICAgICAgICByZXR1cm4gZGljb21QYXJzZXIucmVhZEZpeGVkU3RyaW5nKGJ5dGVBcnJheSwgdHJhbnNmZXJTeW50YXhFbGVtZW50LmRhdGFPZmZzZXQsIHRyYW5zZmVyU3ludGF4RWxlbWVudC5sZW5ndGgpO1xuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gaXNFeHBsaWNpdCh0cmFuc2ZlclN5bnRheCkge1xuICAgICAgICAgICAgaWYodHJhbnNmZXJTeW50YXggPT09ICcxLjIuODQwLjEwMDA4LjEuMicpIC8vIGltcGxpY2l0IGxpdHRsZSBlbmRpYW5cbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBhbGwgb3RoZXIgdHJhbnNmZXIgc3ludGF4ZXMgc2hvdWxkIGJlIGV4cGxpY2l0XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGdldERhdGFTZXRCeXRlU3RyZWFtKHRyYW5zZmVyU3ludGF4LCBwb3NpdGlvbikge1xuICAgICAgICAgICAgaWYodHJhbnNmZXJTeW50YXggPT09ICcxLjIuODQwLjEwMDA4LjEuMi4xLjk5JylcbiAgICAgICAgICAgI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ZUFycmF5LnNsaWNlKHBvc2l0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGluZmxhdGVkID0gcGFrby5pbmZsYXRlUmF3KGRlZmxhdGVkKTtcblxuICAgICAgICAgICAgICAgICAgICAvLyBjcmVhdGUgYSBzaW5nbGUgYnl0ZSBhcnJheSB3aXRoIHRoZSBmdWxsIGhlYWRlciBieXRlcyBhbmQgdGhlIGluZmxhdGVkIGJ5dGVzXG4gICAgICAgICAgICAgICAgICAgIHZhciBmdWxsQnl0ZUFycmF5ID0gZGljb21QYXJzZXIuYWxsb2MoYnl0ZUFycmF5LCBpbmZsYXRlZC5sZW5ndGggKyBwb3NpdGlvbik7XG4gICAgICAgICAgICAgICAgICAgIGZ1bGxCeXRlQXJyYXkuc2V0KGJ5dGVBcnJheS5zbGljZSgwLCBwb3NpdGlvbiksIDApO1xuICAgICAgICAgICAgICAgICAgICBmdWxsQnl0ZUFycmF5LnNldChpbmZsYXRlZCwgcG9zaXRpb24pO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IGRpY29tUGFyc2VyLkJ5dGVTdHJlYW0oZGljb21QYXJzZXIubGl0dGxlRW5kaWFuQnl0ZUFycmF5UGFyc2VyLCBmdWxsQnl0ZUFycmF5LCAwKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gdGhyb3cgZXhjZXB0aW9uIHNpbmNlIG5vIGluZmxhdGVyIGlzIGF2YWlsYWJsZVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyAnZGljb21QYXJzZXIucGFyc2VEaWNvbTogbm8gaW5mbGF0ZXIgYXZhaWxhYmxlIHRvIGhhbmRsZSBkZWZsYXRlIHRyYW5zZmVyIHN5bnRheCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYodHJhbnNmZXJTeW50YXggPT09ICcxLjIuODQwLjEwMDA4LjEuMi4yJ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AgICAgICAgICB0cnl7XG4gICAgICAgICAgICAgICAgaWYoZXhwbGljaXQpIHtcbiAgICAgICAgICAgICAgICAgICAgZGljb21QYXJzZXIucGFyc2VEaWNvbURhdGFTZXRFeHBsaWNpdChkYXRhU2V0LCBkYXRhU2V0Qnl0ZVN0cmVhbSwgZGF0YVNldEJ5dGVTdHJlYW0uYnl0ZUFycmF5Lmxlbmd0aCwgb3B0aW9ucyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIGRpY29tUGFyc2VyLnBhcnNlRGljb21EYXRhU2V0SW1wbGljaXQoZGF0YVNldCwgZGF0YVNldEJ5dGVTdHJlYW0sIGRhdGFTZXRCeXRlU3RyZWFtLmJ5dGVBcnJheS5sZW5ndGgsIG9wdGlvbnMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNhdGNoKGUpIHtcbiAgICAgICAgICAgICAgICB2YXIgZXggPSB7XG4gICAgICAgICAgICAgICAgICAgIGV4Y2VwdGlvbjogZSxcbiAgICAgICAgICAgICAgICAgICAgZGF0YVNldDogZGF0YVNldFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgdGhyb3cgZXg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gZGF0YVNldDtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIG1haW4gZnVuY3Rpb24gaGVyZVxuICAgICAgICBmdW5jdGlvbiBwYXJzZVRoZUJ5dGVTdHJlYW0oKSB7XG4gICAgICAgICAgICB2YXIgbWV0YUhlYWRlckRhdGFTZXQgPSBkaWNvbVBhcnNlci5yZWFkUGFydDEwSGVhZGVyKGJ5dGVBcnJheSwgb3B0aW9ucyk7XG5cbiAgICAgICAgICAgIHZhciBkYXRhU2V0ID0gcmVhZERhdGFTZXQobWV0YUhlYWRlckRhdGFTZXQpO1x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oOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgc2VxdWVuY2VJdGVtcy5wdXNoKGRpY29tUGFyc2VyLmV4cGxpY2l0RGF0YVNldFRvSlMoZWxlbWVudC5pdGVtc1tpXS5kYXRhU2V0LCBvcHRpb25zKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJlc3VsdFt0YWddID0gc2VxdWVuY2VJdGVtcztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIGFzU3RyaW5nO1xuICAgICAgICAgICAgICAgIGFzU3RyaW5nID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIGlmKGVsZW1lbnQubGVuZ3RoIDwgb3B0aW9ucy5tYXhFbGVtZW50TGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGFzU3RyaW5nID0gZGljb21QYXJzZXIuZXhwbGljaXRFbGVtZW50VG9TdHJpbmcoZGF0YVNldCwgZWxlbWVudCk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYoYXNTdHJpbmcgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHRbdGFnXSA9IGFzU3RyaW5nO1xuICAgICAgICAgICAgICAgIH0gIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHRbdGFnXSA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFPZmZzZXQ6IGVsZW1lbnQuZGF0YU9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aCA6IGVsZW1lbnQubGVuZ3RoXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9O1xuXG5cbiAgICByZXR1cm4gZGljb21QYXJzZXI7XG59KGRpY29tUGFyc2VyKSk7XG52YXIgZGlj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XIgdGV4dFJlc3VsdDtcblxuICAgICAgICBmdW5jdGlvbiBtdWx0aUVsZW1lbnRUb1N0cmluZyhudW1JdGVtcywgZnVuYykge1xuICAgICAgICAgICAgdmFyIHJlc3VsdCA9IFwiXCI7XG4gICAgICAgICAgICBmb3IodmFyIGk9MDsgaSA8IG51bUl0ZW1zOyBpKyspIHtcbiAgICAgICAgICAgICAgICBpZihpICE9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAnLyc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJlc3VsdCArPSBmdW5jLmNhbGwoZGF0YVNldCwgdGFnLCBpKS50b1N0cmluZygpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmKGRpY29tUGFyc2VyLmlzU3RyaW5nVnIodnIpID09PSB0cnVlKVxuICAgICAgICB7XG4gICAgICAgICAgICB0ZXh0UmVzdWx0ID0gZGF0YVNldC5zdHJpbmcodGFnKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICh2ciA9PSAnQVQnKSB7XG4gICAgICAgICAgICB2YXIgbnVtID0gZGF0YVNldC51aW50MzIodGFnKTtcbiAgICAgICAgICAgIGlmKG51bSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChudW0gPCAwKVxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIG51bSA9IDB4RkZGRkZGRkYgKyBudW0gKyAxO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gJ3gnICsgbnVtLnRvU3RyaW5nKDE2KS50b1VwcGVyQ2FzZSgpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHZyID09ICdVUycpXG4gICAgICAgIHtcbiAgICAgICAgICAgIHRleHRS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XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgcmV0dXJuIHtcbiAgICAgICAgaG91cnM6IGhoLFxuICAgICAgICBtaW51dGVzOiBtbSxcbiAgICAgICAgc2Vjb25kczogc3MsXG4gICAgICAgIGZyYWN0aW9uYWxTZWNvbmRzOiBmZmZmZmZcbiAgICAgIH07XG4gICAgfVxuXG4gICAgaWYodmFsaWRhdGUpIHtcbiAgICAgIHRocm93IFwiaW52YWxpZCBUTSAnXCIgKyB0aW1lICsgXCInXCI7XG4gICAgfVxuXG4gICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgfTtcblxuICByZXR1cm4gZGljb21QYXJzZXI7XG59KGRpY29tUGFyc2VyKSk7XG4vKipcbiAqIFV0aWxpdHkgZnVuY3Rpb25zIGZvciBkZWFsaW5nIHdpdGggRElDT01cbiAqL1xuXG52YXIgZGljb21QYXJzZXIgPSAoZnVuY3Rpb24gKGRpY29tUGFyc2VyKVxue1xuICAgIFwidXNlIHN0cmljdFwiO1xuXG4gICAgaWYoZGljb21QYXJzZXIgPT09IHVuZGVmaW5lZClcbiAgICB7XG4gICAgICAgIGRpY29tUGFyc2VyID0ge307XG4gICAgfVxuXG4gICAgdmFyIHN0cmluZ1ZycyA9IHtcbiAgICAgICAgQUU6IHRydWUsXG4gICAgICAgIEFTOiB0cnVlLFxuICAgICAgICBBVDogZmFsc2UsXG4gICAgICAgIENTOiB0cnVlLFxuICAgICAgICBEQTogdHJ1ZSxcbiAgICAgICAgRFM6IHRydWUsXG4gICAgICAgIERUOiB0cnVlLFxuICAgICAgICBGTDogZmFsc2UsXG4gICAgICAgIEZEOiBmYWxzZSxcbiAgICAgICAgSVM6IHRydWUsXG4gICAgICAgIExPOiB0cnVlLFxuICAgICAgICBMVDogdHJ1ZSxcbiAgICAgICAgT0I6IGZhbHNlLFxuICAgICAgICBPRDogZmFsc2UsXG4gICAgICAgIE9GOiBmYWxzZSxcbiAgICAgICAgT1c6IGZhbHNlLFxuICAgICAgICBQT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udCB0eXBlcyBmcm9tIGEgYmlnLWVuZGlhbiBieXRlIGFycmF5XG4gKi9cblxudmFyIGRpY29tUGFyc2VyID0gKGZ1bmN0aW9uIChkaWNvbVBhcnNlcilcbntcbiAgICBcInVzZSBzdHJpY3RcIjtcblxuICAgIGlmKGRpY29tUGFyc2VyID09PSB1bmRlZmluZWQpXG4gICAge1xuICAgICAgICBkaWNvbVBhcnNlciA9IHt9O1xuICAgIH1cblxuICAgIGRpY29tUGFyc2VyLmJpZ0VuZGlhbkJ5dGVBcnJheVBhcnNlciA9IHtcbiAgICAgICAgLyoqXG4gICAgICAgICAqXG4gICAgICAgICAqIFBhcnNlcyBhbiB1bnNpZ25lZCBpbnQgMTYgZnJvbSBhIGJpZy1lbmRpYW4gYnl0ZSBhcnJheVxuICAgICAgICAgKlxuICAgICAgICAgKiBAcGFyYW0gYnl0ZUFycmF5IHRoZSBieXRlIGFycmF5IHRvIHJlYWQgZnJvbVxuICAgICAgICAgKiBAcGFyYW0gcG9zaXRpb24gdGhlIHBvc2l0aW9uIGluIHRoZSBieXRlIGFycmF5IHRvIHJlYWQgZnJvbVxuICAgICAgICAgKiBAcmV0dXJucyB7Kn0gdGhlIHBhcnNlZCB1bnNpZ25lZCBpbnQgMTZcbiAgICAgICAgICogQHRocm93cyBlcnJvciBpZiBidWZmZXIgb3ZlcnJlYWQgd291bGQgb2NjdXJcbiAgICAgICAgICogQGFjY2VzcyBwcml2YXRlXG4gICAgICAgICAqL1xuICAgICAgICByZWFkVWludDE2OiBmdW5jdGlvbiAoYnl0ZUFycmF5LCBwb3NpdGlvbikge1xuICAgICAgICAgICAgaWYgKHBvc2l0aW9uIDwgMCkge1xuICAgICAgICAgICAgICAgIHRocm93ICdiaWdFbmRpYW5CeXRlQXJyYXlQYXJzZXIucmVhZFVpbnQxNjogcG9zaXRpb24gY2Fubm90IGJlIGxlc3MgdGhhbiAwJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChwb3NpdGlvbiArID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0VuZGlhbkJ5dGVBcnJheVBhcnNlci5yZWFkVWludDMyOiBwb3NpdGlvbiBjYW5ub3QgYmUgbGVzcyB0aGFuIDAnO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAocG9zaXRpb24gKyA0ID4gYnl0ZUFycmF5Lmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIHRocm93ICdiaWdFbmRpYW5CeXRlQXJyYXlQYXJzZXIucmVhZFVpbnQzMjogYXR0ZW1wdCB0byByZWFkIHBhc3QgZW5kIG9mIGJ1ZmZlcic7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciB1aW50MzIgPSAoMjU2ICogKDI1NiAqICgyNTYgKiBieXRlQXJyYXlbcG9zaXRpb25dICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQXJyYXlbcG9zaXRpb24gKyAxXSkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVBcnJheVtwb3NpdGlvbiArIDJdKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUFycmF5W3Bvc2l0aW9uICsgM10pO1xuXG4gICAgICAgICAgICByZXR1cm4gdWludDMyO1xuICAgICAgICB9LFxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBQYXJzZXMgYSBzaWduZWQgaW50IDMyIGZyb20gYSBiaWctZW5kaWFuIGJ5dGUgYXJyYXlcbiAgICAgICAgICpcbiAgICAgICAgICogQHBhcmFtIGJ5dGVBcnJheSB0aGUgYnl0ZSBhcnJheSB0byByZWFkIGZyb21cbiAgICAgICAgICogQHBhcmFtIHBvc2l0aW9uIHRoZSBwb3NpdGlvbiBpbiB0aGUgYnl0ZSBhcnJheSB0byByZWFkIGZyb21cbiAgICAgICAgICogQHJldHVybnMgeyp9IHRoZSBwYXJzZWQgc2lnbmVkIGludCAzMlxuICAgICAgICAgKiBAdGhyb3dzIGVycm9yIGlmIGJ1ZmZlciBvdmVycmVhZCB3b3VsZCBvY2N1clxuICAgICAgICAgKiBAYWNjZXNzIHByaXZhdGVcbiAgICAgICAgICovXG4gICAgICAgIHJlYWRJbnQzMjogZnVuY3Rpb24gKGJ5dGVBcnJheSwgcG9zaXRpb24pIHtcbiAgICAgICAgICAgIGlmIChwb3NpdGlvbiA8IDApIHtcbiAgICAgICAgICAgICAgICB0aHJvdyAnYmlnRW5kaWFuQnl0ZUFycmF5UGFyc2VyLnJlYWRJbnQzMjogcG9zaXRpb24gY2Fubm90IGJlIGxlc3MgdGhhbiAwJztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHBvc2l0aW9uICsgNCA+IGJ5dGVBcnJheS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyAnYmlnRW5kaWFuQnl0ZUFycmF5UGFyc2VyLnJlYWRJbnQzMjogYXR0ZW1wdCB0byByZWFkIHBhc3QgZW5kIG9mIGJ1ZmZlcic7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciBpbnQzMiA9ICgoYnl0ZUFycmF5W3Bvc2l0aW9uXSA8PCAyNCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgIChieXRlQXJyYXlbcG9zaXRpb24gKyAxXSA8PCAxNikgK1xuICAgICAgICAgICAgICAgICAgICAgICAgIChieXRlQXJyYXlbcG9zaXRpb24gKyAyXSA8PCA4KSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVBcnJheVtwb3NpdGlvbiArIDNdKTtcblxuICAgICAgICAgICAgcmV0dXJuIGludDMyO1xuICAgICAgICB9LFxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBQYXJzZXMgMzItYml0IGZsb2F0IGZyb20gYSBiaWctZW5kaWFuIGJ5dGUgYXJyYXlcbiAgICAgICAgICpcbiAgICAgICAgICogQHBhcmFtIGJ5dGVBcnJheSB0aGUgYnl0ZSBhcnJheSB0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gICAgICAgIH1cbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAvLyB0cmltIHRyYWlsaW5nIHNwYWNlc1xuICAgICAgICAgICAgICAgIHJldHVybiBmaXhlZFN0cmluZy50cmltKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICB9O1xuXG4gICAgLyoqXG4gICAgICogUmV0dXJucyBhIHN0cmluZyB3aXRoIHRoZSBsZWFkaW5nIHNwYWNlcyBwcmVzZXJ2ZWQgYW5kIHRyYWlsaW5nIHNwYWNlcyByZW1vdmVkLlxuICAgICAqXG4gICAgICogVXNlIHRoaXMgZnVuY3Rpb24gdG8gYWNjZXNzIGRhdGEgZm9yIFZScyBvZiB0eXBlIFVULCBTVCBhbmQgTFRcbiAgICAgKlxuICAgICAqIEBwYXJhbSB0YWdcbiAgICAgKiBAcGFyYW0gaW5kZXhcbiAgICAgKiBAcmV0dXJucyB7Kn1cbiAgICAgKi9cbiAgICBkaWNvbVBhcnNlci5EYXRhU2V0LnByb3RvdHlwZS50ZXh0ID0gZnVuY3Rpb24odGFnLCBpbmRleClcbiAgICB7XG4gICAgICAgIHZhciBlbGVtZW50ID0gdGhpcy5lbGVtZW50c1t0YWddO1xuICAgICAgICBpZihlbGVtZW50ICYmIGVsZW1lbnQubGVuZ3RoID4gMClcbiAgICAgICAge1xuICAgICAgICAgICAgdmFyIGZpeGVkU3RyaW5nID0gZGljb21QYXJzZXIucmVhZEZpeGVkU3RyaW5nKHRoaXMuYnl0ZUFycmF5LCBlbGVtZW50LmRhdGFPZmZzZXQsIGVsZW1lbnQubGVuZ3RoKTtcbiAgICAgICAgICAgIGlmKGluZGV4ID49IDApXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgdmFyIHZhbHVlcyA9IGZpeGVkU3RyaW5nLnNwbGl0KCdcXFxcJyk7XG4gICAgICAgICAgICAgICAgcmV0dX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ICAge1xuICAgICAgICAgICAgdmFyIHRhZyA9IGRpY29tUGFyc2VyLnJlYWRUYWcoYnl0ZVN0cmVhbSk7XG4gICAgICAgICAgICB2YXIgbGVuZ3RoID0gYnl0ZVN0cmVhbS5yZWFkVWludDMyKCk7XG4gICAgICAgICAgICBpZih0YWcgPT09ICd4ZmZmZWUwZGQnKVxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIGJ5dGVTdHJlYW0uc2VlayhsZW5ndGgpO1xuICAgICAgICAgICAgICAgIGVsZW1lbnQubGVuZ3RoID0gYnl0ZVN0cmVhbS5wb3NpdGlvbiAtIGVsZW1lbnQuZGF0YU9mZnNldDtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmKHRhZyA9PT0gJ3hmZmZlZTAwMCcpXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgZWxlbWVudC5mcmFnbWVudHMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgIG9mZnNldDogYnl0ZVN0cmVhbS5wb3NpdGlvbiAtIGJhc2VPZmZzZXQgLSA4LFxuICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA6IGJ5dGVTdHJlYW0ucG9zaXRpb24sXG4gICAgICAgICAgICAgICAgICAgIGxlbmd0aCA6IGxlbmd0aFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYod2FybmluZ3MpIHtcbiAgICAgICAgICAgICAgICAgICAgd2FybmluZ3MucHVzaCgndW5leHBlY3RlZCB0YWcgJyArIHRhZyArICcgd2hpbGUgc2VhcmNoaW5nIGZvciBlbmQgb2YgcGl4ZWwgZGF0YSBlbGVtZW50IHdpdGggdW5kZWZpbmVkIGxlbmd0aCcpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZihsZW5ndGggPiBieXRlU3RyZWFtLmJ5dGVBcnJheS5sZW5ndGggLSBieXRlU3RyZWFtLnBvc2l0aW9uKVxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gZml4IGxlbmd0aFxuICAgICAgICAgICAgICAgICAgICBsZW5ndGggPSBieXRlU3RyZWFtLmJ5dGVBcnJheS5sZW5ndGggLSBieXRlU3RyZWFtLnBvc2l0aW9uO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbGVtZW50LmZyYWdtZW50cy5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgb2Zmc2V0OiBieXRlU3RyZWFtLnBvc2l0aW9uIC0gYmFzZU9mZnNldCAtIDgsXG4gICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uIDogYnl0ZVN0cmVhbS5wb3NpdGlvbixcbiAgICAgICAgICAgICAgICAgICAgbGVuZ3RoIDogbGVuZ3RoXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgYnl0ZVN0cmVhbS5zZWVrKGxlbmd0aCk7XG4gICAgICAgICAgICAgICAgZWxlbWVudC5sZW5ndGggPSBieXRlU3RyZWFtLnBvc2l0aW9uIC0gZWxlbWVudC5kYXRhT2Zmc2V0O1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYnl0ZVN0cmVhbS5zZWVrKGxlbmd0aCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZih3YXJuaW5ncykge1xuICAgICAgICAgICAgd2FybmluZ3MucHVzaChcInBpeGVsIGRhdGEgZWxlbWVudCBcIiArIGVsZW1lbnQudGFnICsgXCIgbWlzc2luZyBzZXF1ZW5jZSBkZWxpbWl0ZXIgdGFnIHhmZmZlZTBkZFwiKTtcbiAgICAgICAgfVxuICAgIH07XG5cblxuICAgIHJldHVybiBkaWNvbVBhcnNlcjtcbn0oZGljb21QYXJzZXIpKTtcbi8qKlxuICogSW50ZXJuYWwgaGVscGVyIGZ1bmN0a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NpdGlvbilcbiAgICAgICAge1xuICAgICAgICAgICAgdmFyIGVsZW1lbnQgPSBkaWNvbVBhcnNlci5yZWFkRGljb21FbGVtZW50SW1wbGljaXQoYnl0ZVN0cmVhbSwgb3B0aW9ucy51bnRpbFRhZywgb3B0aW9ucy52ckNhbGxiYWNrKTtcbiAgICAgICAgICAgIGVsZW1lbnRzW2VsZW1lbnQudGFnXSA9IGVsZW1lbnQ7XG4gICAgICAgICAgICBpZihlbGVtZW50LnRhZyA9PT0gb3B0aW9ucy51bnRpbFRhZykge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG5cbiAgICByZXR1cm4gZGljb21QYXJzZXI7XG59KGRpY29tUGFyc2VyKSk7XG5cbi8qKlxuICogSW50ZXJuYWwgaGVscGVyIGZ1bmN0aW9ucyBmb3IgZm9yIHBhcnNpbmcgRElDT00gZWxlbWVudHNcbiAqL1xuXG52YXIgZGljb21QYXJzZXIgPSAoZnVuY3Rpb24gKGRpY29tUGFyc2VyKVxue1xuICAgIFwidXNlIHN0cmljdFwiO1xuXG4gICAgaWYoZGljb21QYXJzZXIgPT09IHVuZGVmaW5lZClcbiAgICB7XG4gICAgICAgIGRpY29tUGFyc2VyID0ge307XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZ2V0RGF0YUxlbmd0aFNpemVJbkJ5dGVzRm9yVlIodnIpXG4gICAge1xuICAgICAgICBpZiggdnIgPT09ICdPQicgfHxcbiAgICAgICAgICAgIHZyID09PSAnT1cnIHx8XG4gICAgICAgICAgICB2ciA9PT0gJ1NRJyB8fFxuICAgICAgICAgICAgdnIgPT09ICdPRicgfHxcbiAgICAgICAgICAgIHZyID09PSAnVVQnIHx8XG4gICAgICAgICAgICB2ciA9PT0gJ1VOJylcbiAgICAgICAge1xuICAgICAgICAgICAgcmV0dXJuIDQ7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZVxuICAgICAgICB7XG4gICAgICAgICA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yZWFtLnNlZWsoMik7XG4gICAgICAgICAgICBlbGVtZW50Lmxlbmd0aCA9IGJ5dGVTdHJlYW0ucmVhZFVpbnQzMigpO1xuICAgICAgICAgICAgZWxlbWVudC5kYXRhT2Zmc2V0ID0gYnl0ZVN0cmVhbS5wb3NpdGlvbjtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmKGVsZW1lbnQubGVuZ3RoID09PSA0Mjk0OTY3Mjk1KVxuICAgICAgICB7XG4gICAgICAgICAgICBlbGVtZW50LmhhZFVuZGVmaW5lZExlbmd0aCA9IHRydWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZihlbGVtZW50LnRhZyA9PT0gdW50aWxUYWcpIHtcbiAgICAgICAgICAgIHJldHVybiBlbGVtZW50O1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gaWYgVlIgaXMgU1EsIHBhcnNlIHRoZSBzZXF1ZW5jZSBpdGVtc1xuICAgICAgICBpZihlbGVtZW50LnZyID09PSAnU1EnKVxuICAgICAgICB7XG4gICAgICAgICAgICBkaWNvbVBhcnNlci5yZWFkU2VxdWVuY2VJdGVtc0V4cGxpY2l0KGJ5dGVTdHJlYW0sIGVsZW1lbnQsIHdhcm5pbmdzKTtcbiAgICAgICAgICAgIHJldHVybiBlbGVtZW50O1xuICAgICAgICB9XG5cblxuICAgICAgICBpZihlbGVtZW50Lmxlbmd0aCA9PT0gNDI5NDk2NzI5NSlcbiAgICAgICAge1xuICAgICAgICAgICAgaWYoZWxlbWVudC50YWcgPT09ICd4N2ZlMDAwMTAnKSB7XG4gICAgICAgICAgICAgICAgZGljb21QYXJzZXIuZmluZEVuZE9mRW5jYXBzdWxhdGVkRWxlbWVudChieXRlU3RyZWFtLCBlbGVtZW50LCB3YXJuaW5ncyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGVsZW1lbnQ7XG4gICAgICAgICAgICB9ICAgZWxzZSBpZihlbGVtZW50LnZyID09PSAnVU4nKSB7XG4gICAgICAgICAgICAgICAgZGljb21Q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zLmh1ZmZUYWJsZS5yZWFkKHRoaXMuc3RyZWFtLCB0aGlzLkh1ZmZUYWIpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAweEZGQ0M6IC8vIERBQ1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIlByb2dyYW0gZG9lc24ndCBzdXBwb3J0IGFyaXRobWV0aWMgY29kaW5nLiAoZm9ybWF0IHRocm93IG5ldyBJT0V4Y2VwdGlvbilcIik7XG4gICAgICAgICAgICBjYXNlIDB4RkZEQjpcbiAgICAgICAgICAgICAgICB0aGlzLnF1YW50VGFibGUucmVhZCh0aGlzLnN0cmVhbSwganBlZy5sb3NzbGVzcy5EZWNvZGVyLlRBQkxFKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMHhGRkREOlxuICAgICAgICAgICAgICAgIHRoaXMucmVzdGFydEludGVydmFsID0gdGhpcy5yZWFkTnVtYmVyKCk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDB4RkZFMDpcbiAgICAgICAgICAgIGNhc2UgMHhGRkUxOlxuICAgICAgICAgICAgY2FzZSAweEZGRTI6XG4gICAgICAgICAgICBjYXNlIDB4RkZFMzpcbiAgICAgICAgICAgIGNhc2UgMHhGRkU0OlxuICAgICAgICAgICAgY2FzZSAweEZGRTU6XG4gICAgICAgICAgICBjYXNlIDB4RkZFNjpcbiAgICAgICAgICAgIGNhc2UgMHhGRkU3OlxuICAgICAgICAgICAgY2FzZSAweEZGRTg6XG4gICAgICAgICAgICBjYXNlIDB4RkZFOTpcbiAgICAgICAgICAgIGNhc2UgMHhGRkVBOlxuICAgICAgICAgICAgY2FzZSAweEZGRUI6XG4gICAgICAgICAgICBjYXNlIDB4RkZFQzpcbiAgICAgICAgICAgIGNhc2UgMHhGRkVEOlxuICAgICAgICAgICAgY2FzZSAweEZGRUU6XG4gICAgICAgICAgICBjYXNlIDB4RkZFRjpcbiAgICAgICAgICAgICAgICB0aGlzLnJlYWRBcHAoKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMHhGRkZFOlxuICAgICAgICAgICAgICAgIHRoaXMucmVhZENvbW1lbnQoKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgaWYgKChjdXJyZW50ID4+IDgpICE9PSAweEZGKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkVSUk9SOiBmb3JtYXQgdGhyb3cgbmV3IElPRXhjZXB0aW9uISAoZGVjb2RlKVwiKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBjdXJyZW50ID0gdGhpcy5zdHJlYW0uZ2V0MTYoKTtcbiAgICB9XG5cbiAgICBpZiAoKGN1cnJlbnQgPCAweEZGQzApIHx8IChjdXJyZW50ID4gMHhGRkM3KSkge1xuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJFUlJPUjogY291bGQgbm90IGhhbmRsZSBhcml0aG1ldGljIGNvZGUhXCIpO1xuICAgIH1cblxuICAgIHRoaXMuZnJhbWUucmVhZCh0aGlzLnN0cmVhbSk7XG4gICAgY3VycmVudCA9IHRoaXMuc3RyZWFtLmdldDE2KCk7XG5cbiAgICBkbyB7XG4gICAgICAgIHdoaWxlIChjdXJyZW50ICE9PSAweDBGRkRBKSB7IC8vIFNPU1xuICAgICAgICAgICAgc3dpdGNoIChjdXJyZW50KSB7XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGQzQ6IC8vIERIVFxuICAgICAgICAgICAgICAgICAgICB0aGlzLmh1ZmZUYWJsZS5yZWFkKHRoaXMuc3RyZWFtLCB0aGlzLkh1ZmZUYWIpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZDQzogLy8gREFDXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIlByb2dyYW0gZG9lc24ndCBzdXBwb3J0IGFyaXRobWV0aWMgY29kaW5nLiAoZm9ybWF0IHRocm93IG5ldyBJT0V4Y2VwdGlvbilcIik7XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGREI6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucXVhbnRUYWJsZS5yZWFkKHRoaXMuc3RyZWFtLCBqcGVnLmxvc3NsZXNzLkRlY29kZXIuVEFCTEUpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZERDpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yZXN0YXJ0SW50ZXJ2YWwgPSB0aGlzLnJlYWROdW1iZXIoKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTA6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTE6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTI6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTM6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTQ6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTU6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTY6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTc6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTg6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRTk6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRUE6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRUI6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRUM6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRUQ6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRUU6XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRUY6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucmVhZEFwcCgpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZGRTpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yZWFkQ29tbWVudCgpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICBpZiAoKGN1cnJlbnQgPj4gOCkgIT09IDB4RkYpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkVSUk9SOiBmb3JtYXQgdGhyb3cgbmV3IElPRXhjZXB0aW9uISAoUGFyc2VyLmRlY29kZSlcIik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY3VycmVudCA9IHRoaXMuc3RyZWFtLmdldDE2KCk7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnByZWNpc2lvbiA9IHRoaXMuZnJhbWUucHJlY2lzaW9uO1xuICAgICAgICB0aGlzLmNvbXBvbmVudHMgPSB0aGlzLmZyYW1lLmNvbXBvbmVudHM7XG5cbiAgICAgICAgaWYgKCF0aGlzLm51bUJ5dGVzKSB7XG4gICAgICAgICAgICB0aGlzLm51bUJ5dGVzID0gcGFyc2VJbnQoTWF0aC5jZWlsKHRoaXMucHJlY2lzaW9uIC8gOCkpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRoaXMubnVtQnl0ZXMgPT0gMSkge1xuICAgICAgICAgICAgdGhpcy5tYXNrID0gMHhGRjtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMubWFzayA9IDB4RkZGRjtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuc2Nhbi5yZWFkKHRoaXMuc3RyZWFtKTtcbiAgICAgICAgdGhpcy5udW1Db21wID0gdGhpcy5zY2FuLm51bUNvbXA7XG4gICAgICAgIHRoaXMuc2VsZWN0aW9uID0gdGhpcy5zY2FuLnNlbGVjdGlvbjtcblxuICAgICAgICBpZiAodGhpcy5udW1CeXRlcyA9PT0gMSkge1xuICAgICAgICAgICAgaWYgKHRoaXMubnVtQ29tcCA9PT0gMykge1xuICAgICAgICAgICAgICAgIHRoaXMuZ2V0dGVyID0gdGhpcy5nZXRWYWx1ZVJHQjtcbiAgICAgICAgICAgICAgICB0aGlzLnNldHRlciA9IHRoaXMuc2V0VmFsdWVSR0I7XG4gICAgICAgICAgICAgICAgdGhpcy5vdXRwdXQgPSB0aGlzLm91dHB1dFJHQjtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5nZXR0ZXIgPSB0aGlzLmdldFZhbHVlODtcbiAgICAgICAgICAgICAgICB0aGlzLnNldHRlciA9IHRoaXMuc2V0VmFsdWU4O1xuICAgICAgICAgICAgICAgIHRoaXMub3V0cHV0ID0gdGhpcy5vdXRwdXRTaW5nbGU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmdldHRlciA9IHRoaXMuZ2V0VmFsdWUxNjtcbiAgICAgICAgICAgIHRoaXMuc2V0dGVyID0gdGhpcy5zZXRWYWx1ZTE2O1xuICAgICAgICAgICAgdGhpcy5vdXRwdXQgPSB0aGlzLm91dHB1dFNpbmdsZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHN3aXRjaCAodGhpcy5zZWxlY3Rpb24pIHtcbiAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICB0aGlzLnNlbGVjdG9yID0gdGhpcy5zZWxlY3QyO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAzOlxuICAgICAgICAgICAgICAgIHRoaXMuc2VsZWN0b3IgPSB0aGlzLnNlbGVjdDM7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAgICAgdGhpcy5zZWxlY3RvciA9IHRoaXMuc2VsZWN0NDtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgICAgICB0aGlzLnNlbGVjdG9yID0gdGhpcy5zZWxlY3Q1O1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA2OlxuICAgICAgICAgICAgICAgIHRoaXMuc2VsZWN0b3IgPSB0aGlzLnNlbGVjdDY7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDc6XG4gICAgICAgICAgICAgICAgdGhpcy5zZWxlY3RvciA9IHRoaXMuc2VsZWN0NztcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgdGhpcy5zZWxlY3RvciA9IHRoaXMuc2VsZWN0MTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuc2NhbkNvbXBzID0gdGhpcy5zY2FuLmNvbXBvbmVudHM7XG4gICAgICAgIHRoaXMucXVhbnRUYWJsZXMgPSB0aGlzLnF1YW50VGFibGUucXVhbnRUYWJsZXM7XG5cbiAgICAgICAgZm9yIChpID0gMDsgaSA8IHRoaXMubnVtQ29tcDsgaSs9MSkge1xuICAgICAgICAgICAgY29tcE4gPSB0aGlzLnNjYW5Db21wc1tpXS5zY2FuQ29tcFNlbDtcbiAgICAgICAgICAgIHRoaXMucVRhYltpXSA9IHRoaXMucXVhbnRUYWJsZXNbdGhpcy5jb21wb25lbnRzW2NvbXBOXS5xdWFudFRhYmxlU2VsXTtcbiAgICAgICAgICAgIHRoaXMubkJsb2NrW2ldID0gdGhpcy5jb21wb25lbnRzW2NvbXBOXS52U2FtcCAqIHRoaXMuY29tcG9uZW50c1tjb21wTl0uaFNhbXA7XG4gICAgICAgICAgICB0aGlzLmRjVGFiW2ldID0gdGhpcy5IdWZmVGFiW3RoaXMuc2NhbkNvbXBzW2ldLmRjVGFiU2VsXVswXTtcbiAgICAgICAgICAgIHRoaXMuYWNUYWJbaV0gPSB0aGlzLkh1ZmZUYWJbdGhpcy5zY2FuQ29tcHNbaV0uYWNUYWJTZWxdWzFdO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy54RGltID0gdGhpcy5mcmFtZS5kaW1YO1xuICAgICAgICB0aGlzLnlEaW0gPSB0aGlzLmZyYW1lLmRpbVk7XG4gICAgICAgIHRoaXMub3V0cHV0RGF0YSA9IG5ldyBEYXRhVmlldyhuZXcgQXJyYXlCdWZmZXIodGhpcy54RGltICogdGhpcy55RGltICogdGhpcy5udW1CeXRlcyAqIHRoaXMubnVtQ29tcCkpO1xuXG4gICAgICAgIHNjYW5OdW0rPTE7XG5cbiAgICAgICAgd2hpbGUgKHRydWUpIHsgLy8gRGVjb2RlIG9uZSBzY2FuXG4gICAgICAgICAgICB0ZW1wWzBdID0gMDtcbiAgICAgICAgICAgIGluZGV4WzBdID0gMDtcblxuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDEwOyBpKz0xKSB7XG4gICAgICAgICAgICAgICAgcHJlZFtpXSA9ICgxIDw8ICh0aGlzLnByZWNpc2lvbiAtIDEpKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHRoaXMucmVzdGFydEludGVydmFsID09PSAwKSB7XG4gICAgICAgICAgICAgICAgY3VycmVudCA9IHRoaXMuZGVjb2RlVW5pdChwcmVkLCB0ZW1wLCBpbmRleCk7XG5cbiAgICAgICAgICAgICAgICB3aGlsZSAoKGN1cnJlbnQgPT09IDApICYmICgodGhpcy54TG9jIDwgdGhpcy54RGltKSAmJiAodGhpcy55TG9jIDwgdGhpcy55RGltKSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vdXRwdXQocHJlZCk7XG4gICAgICAgICAgICAgICAgICAgIGN1cnJlbnQgPSB0aGlzLmRlY29kZVVuaXQocHJlZCwgdGVtcCwgaW5kZXgpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGJyZWFrOyAvL2N1cnJlbnQ9TUFSS0VSXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZvciAobWN1TnVtID0gMDsgbWN1TnVtIDwgdGhpcy5yZXN0YXJ0SW50ZXJ2YWw7IG1jdU51bSs9MSkge1xuICAgICAgICAgICAgICAgIHRoaXMucmVzdGFydGluZyA9IChtY3VOdW0gPT0gMCk7XG4gICAgICAgICAgICAgICAgY3VycmVudCA9IHRoaXMuZGVjb2RlVW5pdChwcmVkLCB0ZW1wLCBpbmRleCk7XG4gICAgICAgICAgICAgICAgdGhpcy5vdXRwdXQocHJlZCk7XG5cbiAgICAgICAgICAgICAgICBpZiAoY3VycmVudCAhPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChjdXJyZW50ID09PSAwKSB7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMubWFya2VySW5kZXggIT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudCA9ICgweEZGMDAgfCB0aGlzLm1hcmtlcik7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMubWFya2VySW5kZXggPSAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGN1cnJlbnQgPSB0aGlzLnN0cmVhbS5nZXQxNigpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCEoKGN1cnJlbnQgPj0ganBlZy5sb3NzbGVzcy5EZWNvZGVyLlJFU1RBUlRfTUFSS0VSX0JFR0lOKSAmJlxuICAgICAgICAgICAgICAgIChjdXJyZW50IDw9IGpwZWcubG9zc2xlc3MuRGVjb2Rlci5SRVNUQVJUX01BUktFUl9FTkQpKSkge1xuICAgICAgICAgICAgICAgIGJyZWF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AgICAgfVxuXG4gICAgICAgICAgICBwcmV2W2N0ckNdID0gdGhpcy5JRENUX1NvdXJjZVswXSA9IHByZXZbY3RyQ10gKyB0aGlzLmdldG4oaW5kZXgsIHZhbHVlLCB0ZW1wLCBpbmRleCk7XG4gICAgICAgICAgICB0aGlzLklEQ1RfU291cmNlWzBdICo9IHF0YWJbMF07XG5cbiAgICAgICAgICAgIGZvciAoaiA9IDE7IGogPCA2NDsgais9MSkge1xuICAgICAgICAgICAgICAgIHZhbHVlID0gdGhpcy5nZXRIdWZmbWFuVmFsdWUoYWN0YWIsIHRlbXAsIGluZGV4KTtcblxuICAgICAgICAgICAgICAgIGlmICh2YWx1ZSA+PSAweEZGMDApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGogKz0gKHZhbHVlID4+IDQpO1xuXG4gICAgICAgICAgICAgICAgaWYgKCh2YWx1ZSAmIDB4MEYpID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgodmFsdWUgPj4gNCkgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5JRENUX1NvdXJjZVtqcGVnLmxvc3NsZXNzLkRlY29kZXIuSURDVF9QW2pdXSA9IHRoaXMuZ2V0bihpbmRleCwgdmFsdWUgJiAweDBGLCB0ZW1wLCBpbmRleCkgKiBxdGFiW2pdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiAwO1xufTtcblxuXG5cbmpwZWcubG9zc2xlc3MuRGVjb2Rlci5wcm90b3R5cGUuZGVjb2RlU2luZ2xlID0gZnVuY3Rpb24gKHByZXYsIHRlbXAsIGluZGV4KSB7XG4gICAgLypq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QgYmUgY2FsbGVkXG5qcGVnLmxvc3NsZXNzLkRlY29kZXIucHJvdG90eXBlLmdldEh1ZmZtYW5WYWx1ZSA9IGZ1bmN0aW9uICh0YWJsZSwgdGVtcCwgaW5kZXgpIHtcbiAgICAvKmpzbGludCBiaXR3aXNlOiB0cnVlICovXG5cbiAgICB2YXIgY29kZSwgaW5wdXQsIG1hc2s7XG4gICAgbWFzayA9IDB4RkZGRjtcblxuICAgIGlmIChpbmRleFswXSA8IDgpIHtcbiAgICAgICAgdGVtcFswXSA8PD0gODtcbiAgICAgICAgaW5wdXQgPSB0aGlzLnN0cmVhbS5nZXQ4KCk7XG4gICAgICAgIGlmIChpbnB1dCA9PT0gMHhGRikge1xuICAgICAgICAgICAgdGhpcy5tYXJrZXIgPSB0aGlzLnN0cmVhbS5nZXQ4KCk7XG4gICAgICAgICAgICBpZiAodGhpcy5tYXJrZXIgIT09IDApIHtcbiAgICAgICAgICAgICAgICB0aGlzLm1hcmtlckluZGV4ID0gOTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0ZW1wWzBdIHw9IGlucHV0O1xuICAgIH0gZWxzZSB7XG4gICAgICAgIGluZGV4WzBdIC09IDg7XG4gICAgfVxuXG4gICAgY29kZSA9IHRhYmxlW3RlbXBbMF0gPj4gaW5kZXhbMF1dO1xuXG4gICAgaWYgKChjb2RlICYganBlZy5sb3NzbGVzcy5EZWNvZGVyLk1TQikgIT09IDApIHtcbiAgICAgICAgaWYgKHRoaXMubWFya2VySW5kZXggIT09IDApIHtcbiAgICAgICAgICAgIHRoaXMubWFya2VySW5kZXggPSAwO1xuICAgICAgICAgICAgcmV0dXJuIDB4RkYwMCB8IHRoaXMubWFya2VyO1xuICAgICAgICB9XG5cbiAgICAgICAgdGVtcFswXSAmPSAobWFzayA+PiAoMTYgLSBpbmRleFswXSkpO1xuICAgICAgICB0ZW1wWzBdIDw8PSA4O1xuICAgICAgICBpbnB1dCA9IHRoaXMuc3RyZWFtLmdldD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gICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICB0ZW1wWzBdIHw9IGlucHV0O1xuICAgICAgICBpbmRleFswXSArPSA4O1xuXG4gICAgICAgIGlmIChpbmRleFswXSA8IDApIHtcbiAgICAgICAgICAgIGlmICh0aGlzLm1hcmtlckluZGV4ICE9PSAwKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5tYXJrZXJJbmRleCA9IDA7XG4gICAgICAgICAgICAgICAgcmV0dXJuICgweEZGMDAgfCB0aGlzLm1hcmtlcikgPDwgODtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGVtcFswXSA8PD0gODtcbiAgICAgICAgICAgIGlucHV0ID0gdGhpcy5zdHJlYW0uZ2V0OCgpO1xuXG4gICAgICAgICAgICBpZiAoaW5wdXQgPT09IDB4RkYpIHtcbiAgICAgICAgICAgICAgICB0aGlzLm1hcmtlciA9IHRoaXMuc3RyZWFtLmdldDgoKTtcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5tYXJrZXIgIT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5tYXJrZXJJbmRleCA9IDk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB0ZW1wWzBdIHw9IGlucHV0O1xuICAgICAgICAgICAgaW5kZXhbMF0gKz0gODtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChpbmRleFswXSA8IDApIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcImluZGV4PVwiICsgaW5kZXhbMF0gKyBcIiBpbiBnZXRuKClcIik7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoaW5kZXhbMF0gPCB0aGlzLm1hcmtlckluZGV4KSB7XG4gICAgICAgICAgICB0aGlzLm1hcmtlckluZGV4ID0gMDtcbiAgICAgICAgICAgIHJldHVybiAoMHhGRjAwIHwgdGhpcy5tYXJrZXIpIDw8IDg7XG4gICAgICAgIH1cblxuICAgICAgICByZXN1bHQg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AgICAgICAgIHRoaXMubFt0XVtjXVtpXSA9IGRhdGEuZ2V0OCgpO1xuICAgICAgICAgICAgY291bnQrPTE7XG4gICAgICAgIH1cblxuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMTY7IGkrPTEpIHtcbiAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCB0aGlzLmxbdF1bY11baV07IGorPTEpIHtcbiAgICAgICAgICAgICAgICBpZiAoY291bnQgPiBsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiRVJST1I6IEh1ZmZtYW4gdGFibGUgZm9ybWF0IGVycm9yIFtjb3VudD5MaF1cIik7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdGhpcy52W3RdW2NdW2ldW2pdID0gZGF0YS5nZXQ4KCk7XG4gICAgICAgICAgICAgICAgY291bnQrPTE7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBpZiAoY291bnQgIT09IGxlbmd0aCkge1xuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJFUlJPUjogSHVmZm1hbiB0YWJsZSBmb3JtYXQgZXJyb3IgW2NvdW50IT1MZl1cIik7XG4gICAgfVxuXG4gICAgZm9yIChpID0gMDsgaSA8IDQ7IGkrPTEpIHtcbiAgICAgICAgZm9yIChqID0gMDsgaiA8IDI7IGorPTEpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLnRjW2ldW2pdICE9PSAwKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5idWlsZEh1ZmZUYWJsZShIdWZmVGFiW2ldW2pdLCB0aGlzLmxbaV1bal0sIHRoaXMudltpXVtqXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gMTtcbn07XG5cblxuXG4vL1x0QnVpbGRfSHVmZlRhYigpXG4vL1x0UGFyYW1ldGVyOiAgdCAgICAgICB0YWJsZSBJRFxuLy9cdCA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BpKz0xKSB7IC8vIGkrMSBpcyBDb2RlIGxlbmd0aFxuICAgICAgICBmb3IgKGogPSAwOyBqIDwgTFtpXTsgais9MSkge1xuICAgICAgICAgICAgZm9yIChuID0gMDsgbiA8ICh0ZW1wID4+IChpIC0gNykpOyBuKz0xKSB7XG4gICAgICAgICAgICAgICAgdGFiWyhjdXJyZW50VGFibGUgKiAyNTYpICsga10gPSBWW2ldW2pdIHwgKChpICsgMSkgPDwgOCk7XG4gICAgICAgICAgICAgICAgays9MTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKGsgPj0gMjU2KSB7XG4gICAgICAgICAgICAgICAgaWYgKGsgPiAyNTYpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiRVJST1I6IEh1ZmZtYW4gdGFibGUgZXJyb3IoMSkhXCIpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGsgPSAwO1xuICAgICAgICAgICAgICAgIGN1cnJlbnRUYWJsZSs9MTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn07XG5cblxuLyoqKiBFeHBvcnRzICoqKi9cblxudmFyIG1vZHVsZVR5cGUgPSB0eXBlb2YgbW9kdWxlO1xuaWYgKChtb2R1bGVUeXBlICE9PSAndW5kZWZpbmVkJykgJiYgbW9kdWxlLmV4cG9ydHMpIHtcbiAgICBtb2R1bGUuZXhwb3J0cyA9IGpwZWcubG9zc2xlc3MuSHVmZm1hblRhYmxlO1xufVxuIiwiLypqc2xpbnQgYnJvd3NlcjogdHJ1ZSwgbm9kZTogdHJ1ZSAqL1xuLypnbG9iYWwgcmVxdWlyZSwgbW9kdWxlICovXG5cblwidXNlIHN0cmljdFwiO1xuXG4vKioqIEltcG9ydHMgKioqL1xudmFyIGpwZWcgPSBqcGVnIHx8IHt9O1xuanBlZy5sb3NzbGVzcyA9IGpwZWcubG9zc2xlc3MgfHwge307XG5qcGVnLmxvc3NsZXNzLk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Uk9SOiBRdWFudGl6YXRpb24gdGFibGUgSUQgPiAzXCIpO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5wcmVjaXNpb25bdF0gPSB0ZW1wID4+IDQ7XG5cbiAgICAgICAgaWYgKHRoaXMucHJlY2lzaW9uW3RdID09PSAwKSB7XG4gICAgICAgICAgICB0aGlzLnByZWNpc2lvblt0XSA9IDg7XG4gICAgICAgIH0gZWxzZSBpZiAodGhpcy5wcmVjaXNpb25bdF0gPT09IDEpIHtcbiAgICAgICAgICAgIHRoaXMucHJlY2lzaW9uW3RdID0gMTY7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJFUlJPUjogUXVhbnRpemF0aW9uIHRhYmxlIHByZWNpc2lvbiBlcnJvclwiKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMudHFbdF0gPSAxO1xuXG4gICAgICAgIGlmICh0aGlzLnByZWNpc2lvblt0XSA9PT0gOCkge1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDY0OyBpKz0xKSB7XG4gICAgICAgICAgICAgICAgaWYgKGNvdW50ID4gbGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkVSUk9SOiBRdWFudGl6YXRpb24gdGFibGUgZm9ybWF0IGVycm9yXCIpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHRoaXMucXVhbnRUYWJsZXNbdF1baV0gPSBkYXRhLmdldDgoKTtcbiAgICAgICAgICAgICAgICBjb3VudCs9MTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAganBlZy5sb3NzbGVzcy5RdWFudGl6YXRpb25UYWJsZS5lbmhhbmNlUXVhbnRpemF0aW9uVGFibGUodGhpcy5xdWFudFRhYmxlc1t0XSwgdGFibGUpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDY0OyBp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leHRlbnNpb25TaXplID0gdGhpcy5nZXRFeHRlbnNpb25TaXplKHJhd0RhdGEpO1xuICAgICAgICAgICAgdGhpcy5leHRlbnNpb25Db2RlID0gdGhpcy5nZXRFeHRlbnNpb25Db2RlKHJhd0RhdGEpO1xuICAgICAgICB9XG4gICAgfVxufTtcblxuXG4vKipcbiAqIFJldHVybnMgYSBmb3JtYXR0ZWQgc3RyaW5nIG9mIGhlYWRlciBmaWVsZHMuXG4gKiBAcmV0dXJucyB7c3RyaW5nfVxuICovXG5uaWZ0aS5OSUZUSTEucHJvdG90eXBlLnRvRm9ybWF0dGVkU3RyaW5nID0gZnVuY3Rpb24gKCkge1xuICAgIHZhciBmbXQgPSBuaWZ0aS5VdGlscy5mb3JtYXROdW1iZXIsXG4gICAgICAgIHN0cmluZyA9IFwiXCI7XG5cbiAgICBzdHJpbmcgKz0gKFwiRGltIEluZm8gPSBcIiArIHRoaXMuZGltX2luZm8gKyBcIlxcblwiKTtcblxuICAgIHN0cmluZyArPSAoXCJJbWFnZSBEaW1lbnNpb25zICgxLTgpOiBcIiArXG4gICAgICAgIHRoaXMuZGltc1swXSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuZGltc1sxXSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuZGltc1syXSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuZGltc1szXSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuZGltc1s0XSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuZGltc1s1XSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuZGltc1s2XSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuZGltc1s3XSArIFwiXFxuXCIpO1xuXG4gICAgc3RyaW5nICs9IChcIkludGVudCBQYXJhbWV0ZXJzICgxLTMpOiBcIiArXG4gICAgICAgIHRoaXMuaW50ZW50X3AxICsgXCIsIFwiICtcbiAgICAgICAgdGhpcy5pbnRlbnRfcDIgKyBcIiwgXCIgK1xuICAgICAgICB0aGlzLmludGVudF9wMykgKyBcIlxcblwiO1xuXG4gICAgc3RyaW5nICs9IChcIkludGVudCBDb2RlID0gXCIgKyB0aGlzLmludGVudF9jb2RlICsgXCJcXG5cIik7XG4gICAgc3RyaW5nICs9IChcIkRhdGF0eXBlID0gXCIgKyB0aGlzLmRhdGF0eXBlQ29kZSArICBcIiAoXCIgKyB0aGlzLmdldERhdGF0eXBlQ29kZVN0cmluZyh0aGlzLmRhdGF0eXBlQ29kZSkgKyBcIilcXG5cIik7XG4gICAgc3RyaW5nICs9IChcIkJpdHMgUGVyIFZveGVsID0gXCIgKyB0aGlzLm51bUJpdHNQZXJWb3hlbCArIFwiXFxuXCIpO1xuICAgIHN0cmluZyArPSAoXCJTbGljZSBTdGFydCA9IFwiICsgdGhpcy5zbGljZV9zdGFydCArIFwiXFxuXCIpO1xuICAgIHN0cmluZyArPSAoXCJWb3hlbCBEaW1lbnNpb25zICgxLTgpOiBcIiArXG4gICAgICAgIGZtdCh0aGlzLnBpeERpbXNbMF0pICsgXCIsIFwiICtcbiAgICAgICAgZm10KHRoaXMucGl4RGltc1sxXSkgKyBcIiwgXCIgK1xuICAgICAgICBmbXQodGhpcy5waXhEaW1zWzJdKSArIFwiLCBcIiArXG4gICAgICAgIGZtdCh0aGlzLnBpeERpbXNbM10pICsgXCIsIFwiICtcbiAgICAgICAgZm10KHRoaXMucGl4RGltc1s0XSkgKyBcIiwgXCIgK1xuICAgICAgICBmbXQodGhpcy5waXhEaW1zWzVdKSArIFwiLCBcIiArXG4gICAgICAgIGZtdCh0aGlzLnBpeERpbXNbNl0pICsgXCIsIFwiICtcbiAgICAgICAgZm10KHRoaXMucGl4RGltc1s3XSkgKyBcIlxcblwiKTtcblxuICAgIHN0cmluZyArPSAoXCJJbWFnZSBPZmZzZXQgPSBcIiArIHRoaXMudm94X29mZnNldCArIFwiXFxuXCIpO1xuICAgIHN0cmluZyArPSAoXCJEYXRhIFNjYWxlOiAgU2xvcGUgPSBcIiArIGZtdCh0a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gKi9cbiAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgfVxuXG4gICAgeGogLz0gdmFsO1xuICAgIHlqIC89IHZhbDtcbiAgICB6aiAvPSB2YWw7XG5cbiAgICAvKiBvcnRob2dvbmFsaXplIGogYXhpcyB0byBpIGF4aXMsIGlmIG5lZWRlZCAqL1xuICAgIHZhbCA9IHhpICogeGogKyB5aSAqIHlqICsgemkgKiB6ajsgICAgLyogZG90IHByb2R1Y3QgYmV0d2VlbiBpIGFuZCBqICovXG4gICAgaWYgKE1hdGguYWJzKHZhbCkgPiAxLkUtNCkge1xuICAgICAgICB4aiAtPSB2YWwgKiB4aTtcbiAgICAgICAgeWogLT0gdmFsICogeWk7XG4gICAgICAgIHpqIC09IHZhbCAqIHppO1xuICAgICAgICB2YWwgPSBNYXRoLnNxcnQoeGogKiB4aiArIHlqICogeWogKyB6aiAqIHpqKTsgIC8qIG11c3QgcmVub3JtYWxpemUgKi9cbiAgICAgICAgaWYgKHZhbCA9PT0gMC4wKSB7ICAgICAgICAgICAgICAvKiBqIHdhcyBwYXJhbGxlbCB0byBpPyAqL1xuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgeGogLz0gdmFsO1xuICAgICAgICB5aiAvPSB2YWw7XG4gICAgICAgIHpqIC89IHZhbDtcbiAgICB9XG5cbiAgICAvKiBub3JtYWxpemUgayBheGlzOyBpZiBpdCBpcyB6ZXJvLCBtYWtlIGl0IHRoZSBjcm9zcyBwcm9kdWN0IGkgeCBqICovXG4gICAgdmFsID0gTWF0aC5zcXJ0KHhrICogeGsgKyB5ayAqIHlrICsgemsgKiB6ayk7XG4gICAgaWYgKHZhbCA9PT0gMC4wKSB7XG4gICAgICAgIHhrID0geWkgKiB6aiAtIHppICogeWo7XG4gICAgICAgIHlrID0gemkgKiB4aiAtIHpqICogeGk7XG4gICAgICAgIHprID0geGkgKiB5aiAtIHlpICogeGo7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgeGsgLz0gdmFsO1xuICAgICAgICB5ayAvPSB2YWw7XG4gICAgICAgIHprIC89IHZhbDtcbiAgICB9XG5cbiAgICAvKiBvcnRob2dvbmFsaXplIGsgdG8gaSAqL1xuICAgIHZhbCA9IHhpICogeGsgKyB5aSAqIHlrICsgemkgKiB6azsgICAgLyogZG90IHByb2R1Y3QgYmV0d2VlbiBpIGFuZCBrICovXG4gICAgaWYgKE1hdGguYWJzKHZhbCkgPiAxLkUtNCkge1xuICAgICAgICB4ayAtPSB2YWwgKiB4aTtcbiAgICAgICAgeWsgLT0gdmFsICogeWk7XG4gICAgICAgIHprIC09IHZhbCAqIHppO1xuICAgICAgICB2YWwgPSBNYXRoLnNxcnQoeGsgKiB4ayArIHlrICogeWsgKyB6ayAqIHprKTtcbiAgICAgICAgaWYgKHZhbCA9PT0gMC4wKSB7ICAgIC8qIGJhZCAqL1xuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgeGsgLz0gdmFsO1xuICAgICAgICB5ayAvPSB2YWw7XG4gICAgICAgIHprIC89IHZhbDtcbiAgICB9XG5cbiAgICAvKiBvcnRob2dvbmFsaXplIGsgdG8gaiAqL1xuICAgIHZhbCA9IHhqICogeGsgKyB5aiAqIHlrICsgemogKiB6azsgICAgLyogZG90IHByb2R1Y3QgYmV0d2VlbiBqIGFuZCBrICovXG4gICAgaWYgKE1hdGguYWJzKHZhbCkgPiAxLmUtNCkge1xuICAgICAgICB4ayAtPSB2YWwgKiB4ajtcbiAgICAgICAgeWsgLT0gdmFsICogeWo7XG4gICAgICAgIHprIC09IHZhbCAqIHpqO1xuICAgICAgICB2YWwgPSBNYXRoLnNxcnQoeGsgKiB4ayArIHlrICogeWsgKyB6ayAqIHprKTtcbiAgICAgICAgaWYgKHZhbCA9PT0gMC4wKSB7ICAgICAvKiBiYWQgKi9cbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9XG4gICAgICAgIHhrIC89IHZhbDtcbiA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YmVzdCA9IC02NjYuMDtcbiAgICBpYmVzdCA9IHBiZXN0ID0gcWJlc3QgPSByYmVzdCA9IDE7XG4gICAgamJlc3QgPSAyO1xuICAgIGtiZXN0ID0gMztcblxuICAgIGZvciAoaSA9IDE7IGkgPD0gMzsgaSArPSAxKSB7ICAgICAvKiBpID0gY29sdW1uIG51bWJlciB0byB1c2UgZm9yIHJvdyAjMSAqL1xuICAgICAgICBmb3IgKGogPSAxOyBqIDw9IDM7IGogKz0gMSkgeyAgICAvKiBqID0gY29sdW1uIG51bWJlciB0byB1c2UgZm9yIHJvdyAjMiAqL1xuICAgICAgICAgICAgaWYgKGkgIT09IGopIHtcbiAgICAgICAgICAgICAgICBmb3IgKGsgPSAxOyBrIDw9IDM7IGsgKz0gMSkgeyAgLyogayA9IGNvbHVtbiBudW1iZXIgdG8gdXNlIGZvciByb3cgIzMgKi9cbiAgICAgICAgICAgICAgICAgICAgaWYgKCEoaSA9PT0gayB8fCBqID09PSBrKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgUFswXVswXSA9IFBbMF1bMV0gPSBQWzBdWzJdID0gUFsxXVswXSA9IFBbMV1bMV0gPSBQWzFdWzJdID0gUFsyXVswXSA9IFBbMl1bMV0gPSBQWzJdWzJdID0gMC4wO1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChwID0gLTE7IHAgPD0gMTsgcCArPSAyKSB7ICAgIC8qIHAscSxyIGFyZSAtMSBvciArMSAgICAgICovXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChxID0gLTE7IHEgPD0gMTsgcSArPSAyKSB7ICAgLyogYW5kIGdvIGludG8gcm93cyAjMSwyLDMgKi9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChyID0gLTE7IHIgPD0gMTsgciArPSAyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQWzBdW2kgLSAxXSA9IHA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQWzFdW2ogLSAxXSA9IHE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQWzJdW2sgLSAxXSA9IHI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXRQID0gdGhpcy5uaWZ0aV9tYXQzM19kZXRlcm0oUCk7ICAgICAgICAgICAvKiBzaWduIG9mIHBlcm11dGF0aW9uICovXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGRldFAgKiBkZXRRKSA+IDAuMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE0gPSB0aGlzLm5pZnRpX21hdDMzX211bChQLCBRKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGFuZ2xlIG9mIE0gcm90YXRpb24gPSAyLjAqYWNvcygwLjUqc3FydCgxLjArdHJhY2UoTSkpKSAgICAgICAqL1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHdlIHdhbnQgbGFyZ2VzdCB0cmFjZShNKSA9PSBzbWFsbGVzdCBhbmdsZSA9PSBNIG5lYXJlc3QgdG8gSSAqL1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsID0gTVswXVswXSArIE1bMV1bMV0gKyBNWzJdWzJdOyAvKiB0cmFjZSAqL1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWwgPiB2YmVzdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YmVzdCA9IHZhbDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWJlc3QgPSBpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqYmVzdCA9IGo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtiZXN0ID0gaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGJlc3QgPSBwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxYmVzdCA9IHE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJiZXN0ID0gcjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ICAvKiBkb2Vzbid0IG1hdGNoIHNpZ24gb2YgUSAqL1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgLyogQXQgdGhpcyBwb2ludCBpYmVzdCBpcyAxIG9yIDIgb3IgMzsgcGJlc3QgaXMgLTEgb3IgKzE7IGV0Yy5cblxuICAgICBUaGUgbWF0cml4IFAgdGhhdCBjb3JyZXNwb25kcyBpcyB0aGUgYmVzdCBwZXJtdXRhdGlvbiBhcHByb3hpbWF0aW9uXG4gICAgIHRvIFEtaW52ZXJzZTsgdGhhdCBpcywgUCAoYXBwcm94aW1hdGVseSkgdGFrZXMgKHgseSx6KSBjb29yZGluYXRlc1xuICAgICB0byB0aGUgKGksaixrKSBheGVzLlxuXG4gICAgIEZvciBleGFtcGxlLCB0aGUgZmlyc3Qgcm93IG9mIFAgKHdoaWNoIGNvbnRhaW5zIHBiZXN0IGluIGNvbHVtbiBpYmVzdClcbiAgICAgZGV0ZXJtaW5lcyB0aGUgd2F5IHRoZSBpIGF4aXMgcG9pbnRzIHJlbGF0aXZlIHRvIHRoZSBhbmF0b21pY2FsXG4gICAgICh4LHkseikgYXhlcy4gIElmIGliZXN0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AgICAgICAgICAgIGlTZW5zZSA9ICcrJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIC0zOiAvKmkgPSBOSUZUSV9TMkkqL1xuICAgICAgICAgICAgaUNoYXIgPSAnWic7XG4gICAgICAgICAgICBpU2Vuc2UgPSAnLSc7XG4gICAgICAgICAgICBicmVhaztcbiAgICB9XG5cbiAgICBzd2l0Y2ggKGpiZXN0ICogcWJlc3QpIHtcbiAgICAgICAgY2FzZSAxOiAvKmogPSBOSUZUSV9MMlIqL1xuICAgICAgICAgICAgakNoYXIgPSAnWCc7XG4gICAgICAgICAgICBqU2Vuc2UgPSAnKyc7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAtMTogLypqID0gTklGVElfUjJMKi9cbiAgICAgICAgICAgIGpDaGFyID0gJ1gnO1xuICAgICAgICAgICAgalNlbnNlID0gJy0nO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgMjogLypqID0gTklGVElfUDJBKi9cbiAgICAgICAgICAgIGpDaGFyID0gJ1knO1xuICAgICAgICAgICAgalNlbnNlID0gJysnO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgLTI6IC8qaiA9IE5JRlRJX0EyUCovXG4gICAgICAgICAgICBqQ2hhciA9ICdZJztcbiAgICAgICAgICAgIGpTZW5zZSA9ICctJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIDM6IC8qaiA9IE5JRlRJX0kyUyovXG4gICAgICAgICAgICBqQ2hhciA9ICdaJztcbiAgICAgICAgICAgIGpTZW5zZSA9ICcrJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIC0zOiAvKmogPSBOSUZUSV9TMkkqL1xuICAgICAgICAgICAgakNoYXIgPSAnWic7XG4gICAgICAgICAgICBqU2Vuc2UgPSAnLSc7XG4gICAgICAgICAgICBicmVhaztcbiAgICB9XG5cbiAgICBzd2l0Y2ggKGtiZXN0ICogcmJlc3QpIHtcbiAgICAgICAgY2FzZSAxOiAvKmsgPSBOSUZUSV9MMlIqL1xuICAgICAgICAgICAga0NoYXIgPSAnWCc7XG4gICAgICAgICAgICBrU2Vuc2UgPSAnKyc7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAtMTogLyprID0gTklGVElfUjJMKi9cbiAgICAgICAgICAgIGtDaGFyID0gJ1gnO1xuICAgICAgICAgICAga1NlbnNlID0gJy0nO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgMjogLyprID0gTklGVElfUDJBKi9cbiAgICAgICAgICAgIGtDaGFyID0gJ1knO1xuICAgICAgICAgICAga1NlbnNlID0gJysnO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgLTI6IC8qayA9IE5JRlRJX0EyUCovXG4gICAgICAgICAgICBrQ2hhciA9ICdZJztcbiAgICAgICAgICAgIGtTZW5zZSA9ICctJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIDM6IC8qayA9IE5JRlRJX0kyUyovXG4gICAgICAgICAgICBrQ2hhciA9ICdaJztcbiAgICAgICAgICAgIGtTZW5zZSA9ICcrJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIC0zOiAvKmsgPSBOSUZUSV9TMkkqL1xuICAgICAgICAgICAga0NoYXIgPSAnWic7XG4gICAgICAgICAgICBrU2Vuc2UgPSAnLSc7XG4gICAgICAgICAgICBicmVhaztcbiAgICB9XG5cbiAgICByZXR1cm4gKGlDaGFyICsgakNoYXIgKyBrQ2hhciArIGlTZW5zZSArIGpTZW5zZSArIGtTZW5zZSk7XG59O1xuXG5cblxubmlmdGkuTklGVEkxLnByb3RvdHlwZS5uaWZ0aV9tYXQzM19tdWwgPSBmdW5jdGlvbiAoQSwgQikge1xuICAgIHZhciBDID0gW1swLCAwLCAwXSwgWzAsIDAsIDBdLCBbMCwgMCwgMF1dLFxuICAgICAgICBpLFxu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I6XG4gICAgICAgICAgICBzcGFjZURpbWVuc2lvbiA9IDM7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgXHQgIGNhc2UgXCJyaWdodC1hbnRlcmlvci1zdXBlcmlvci10aW1lXCI6XG4gICAgIFx0ICBjYXNlIFwiUkFTVFwiOlxuICAgICBcdCAgICAgIHNwYWNlRGltZW5zaW9uID0gNDtcbiAgICAgXHQgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBcImxlZnQtYW50ZXJpb3Itc3VwZXJpb3ItdGltZVwiOlxuICAgICAgICBjYXNlIFwiTEFTVFwiOlxuICAgICAgICAgICAgc3BhY2VEaW1lbnNpb24gPSA0O1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgXCJsZWZ0LXBvc3Rlcmlvci1zdXBlcmlvci10aW1lXCI6XG4gICAgICAgIGNhc2UgXCJMUFNUXCI6XG4gICAgICAgICAgICBzcGFjZURpbWVuc2lvbiA9IDQ7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBcInNjYW5uZXIteHl6XCI6XG4gICAgICAgICAgICBzcGFjZURpbWVuc2lvbiA9IDM7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBcInNjYW5uZXIteHl6LXRpbWVcIjpcbiAgICAgICAgICAgIHNwYWNlRGltZW5zaW9uID0gNDtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIFwiM0QtcmlnaHQtaGFuZGVkXCI6XG4gICAgICAgICAgICBzcGFjZURpbWVuc2lvbiA9IDM7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBcIjNELWxlZnQtaGFuZGVkXCI6XG4gICAgICAgICAgICBzcGFjZURpbWVuc2lvbiA9IDM7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBcIjNELXJpZ2h0LWhhbmRlZC10aW1lXCI6XG4gICAgICAgICAgICBzcGFjZURpbWVuc2lvbiA9IDQ7XG4gICA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0Y2hbMV0gPT0gJ2RhdGFGaWxlJyAmJlxuICAgICAgICAgICAgICAgICAobWF0Y2gyID0gZGF0YUZpbGVMaXN0UkUuZXhlYyhtYXRjaFszXSkpKSB7XG4gICAgICAgICAgICAgICAgLy8gVGhpcyBzaG91bGQgYmUgdGhlIGxhc3QgZmllbGQgc3BlY2lmaWNhdGlvbixcbiAgICAgICAgICAgICAgICAvLyBhbmQgdGhlIHJlc3Qgb2YgdGhlIGxpbmVzIHNob3VsZCBjb250YWluIGZpbGUgbmFtZXMuXG4gICAgICAgICAgICAgICAgaWYgKG1hdGNoMi5sZW5ndGggPT0gMiAmJiBtYXRjaDJbMV0pIHsgLy8gc3ViZGltIHNwZWNpZmljYXRpb25cbiAgICAgICAgICAgICAgICAgICAgcmV0W21hdGNoWzFdXSA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVzOiBsaW5lcy5zbGljZShpKzEpLFxuICAgICAgICAgICAgICAgICAgICAgICAgc3ViZGltOiBwYXJzZU5SUkRJbnRlZ2VyKG1hdGNoMlsxXSlcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXRbbWF0Y2hbMV1dID0gbGluZXMuc2xpY2UoaSsxKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbGluZXMubGVuZ3RoID0gaTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0W21hdGNoWzFdXSA9IHBhcnNlRmllbGQobWF0Y2hbMV0sIG1hdGNoWzNdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChtYXRjaFsyXSA9PSAnOj0nKSB7IC8vIEtleS92YWx1ZSBwYWlyXG4gICAgICAgICAgICByZXQua2V5c1ttYXRjaFsxXV0gPSB1bmVzY2FwZVZhbHVlKG1hdGNoWzNdKTtcbiAgICAgICAgfSBlbHNlIHtcbiA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4gICAgY2FzZSBcInNpZ25lZCBjaGFyXCI6XG4gICAgY2FzZSBcImludDhcIjpcbiAgICBjYXNlIFwiaW50OF90XCI6XG4gICAgICAgIHJldHVybiAnaW50OCc7XG4gICAgY2FzZSBcInVjaGFyXCI6XG4gICAgY2FzZSBcInVuc2lnbmVkIGNoYXJcIjpcbiAgICBjYXNlIFwidWludDhcIjpcbiAgICBjYXNlIFwidWludDhfdFwiOlxuICAgICAgICByZXR1cm4gJ3VpbnQ4JztcbiAgICBjYXNlIFwic2hvcnRcIjpcbiAgICBjYXNlIFwic2hvcnQgaW50XCI6XG4gICAgY2FzZSBcInNpZ25lZCBzaG9ydFwiOlxuICAgIGNhc2UgXCJzaWduZWQgc2hvcnQgaW50XCI6XG4gICAgY2FzZSBcImludDE2XCI6XG4gICAgY2FzZSBcImludDE2X3RcIjpcbiAgICAgICAgcmV0dXJuICdpbnQxNic7XG4gICAgY2FzZSBcInVzaG9ydFwiOlxuICAgIGNhc2UgXCJ1bnNpZ25lZCBzaG9ydFwiOlxuICAgIGNhc2UgXCJ1bnNpZ25lZCBzaG9ydCBpbnRcIjpcbiAgICBjYXNlIFwidWludDE2XCI6XG4gICAgY2FzZSBcInVpbnQxNl90XCI6XG4gICAgICAgIHJldHVybiAndWludDE2JztcbiAgICBjYXNlIFwiaW50XCI6XG4gICAgY2FzZSBcInNpZ25lZCBpbnRcIjpcbiAgICBjYXNlIFwiaW50MzJcIjpcbiAgICBjYXNlIFwiaW50MzJfdFwiOlxuICAgICAgICByZXR1cm4gJ2ludDMyJztcbiAgICBjYXNlIFwidWludFwiOlxuICAgIGNhc2UgXCJ1bnNpZ25lZCBpbnRcIjpcbiAgICBjYXNlIFwidWludDMyXCI6XG4gICAgY2FzZSBcInVpbnQzMl90XCI6XG4gICAgICAgIHJldHVybiAndWludDMyJztcbiAgICBjYXNlIFwibG9uZ2xvbmdcIjpcbiAgICBjYXNlIFwibG9uZyBsb25nXCI6XG4gICAgY2FzZSBcImxvbmcgbG9u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l6ZSgyKTtcbiAgICAgICAgICAgIHJldHVybiBuZXcgSW50MTZBcnJheShidWZmZXIuc2xpY2UoMCx0b3RhbExlbioyKSk7XG4gICAgICAgIGNhc2UgXCJ1aW50MTZcIjpcbiAgICAgICAgICAgIGNoZWNrU2l6ZSgyKTtcbiAgICAgICAgICAgIHJldHVybiBuZXcgVWludDE2QXJyYXkoYnVmZmVyLnNsaWNlKDAsdG90YWxMZW4qMikpO1xuICAgICAgICBjYXNlIFwiaW50MzJcIjpcbiAgICAgICAgICAgIGNoZWNrU2l6ZSg0KTtcbiAgICAgICAgICAgIHJldHVybiBuZXcgSW50MzJBcnJheShidWZmZXIuc2xpY2UoMCx0b3RhbExlbio0KSk7XG4gICAgICAgIGNhc2UgXCJ1aW50MzJcIjpcbiAgICAgICAgICAgIGNoZWNrU2l6ZSg0KTtcbiAgICAgICAgICAgIHJldHVybiBuZXcgVWludDMyQXJyYXkoYnVmZmVyLnNsaWNlKDAsdG90YWxMZW4qNCkpO1xuICAgICAgICAvL2Nhc2UgXCJpbnQ2NFwiOlxuICAgICAgICAvLyAgICBjaGVja1NpemUoOCk7XG4gICAgICAgIC8vICAgIHJldHVybiBuZXcgSW50NjRBcnJheShidWZmZXIuc2xpY2UoMCx0b3RhbExlbio4KSk7XG4gICAgICAgIC8vY2FzZSBcInVpbnQ2NFwiOlxuICAgICAgICAvLyAgICBjaGVja1NpemUoOCk7XG4gICAgICAgIC8vICAgIHJldHVybiBuZXcgVWludDY0QXJyYXkoYnVmZmVyLnNsaWNlKDAsdG90YWxMZW4qOCkpO1xuICAgICAgICBjYXNlIFwiZmxvYXRcIjpcbiAgICAgICAgICAgIGNoZWNrU2l6ZSg0KTtcbiAgICAgICAgICAgIHJldHVybiBuZXcgRmxvYXQzMkFycmF5KGJ1ZmZlci5zbGljZSgwLHRvdGFsTGVuKjQpKTtcbiAgICAgICAgY2FzZSBcImRvdWJsZVwiOlxuICAgICAgICAgICAgY2hlY2tTaXplKDgpO1xuICAgICAgIC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FsTGVuKTtcbiAgICAgICAgICAgIGZvcihpPTA7IGk8dG90YWxMZW47IGkrKykge1xuICAgICAgICAgICAgICAgIGFycltpXSA9IHZpZXcuZ2V0SW50OChpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBhcnI7XG4gICAgICAgIGNhc2UgXCJ1aW50OFwiOlxuICAgICAgICAgICAgYXJyID0gbmV3IFVpbnQ4QXJyYXkodG90YWxMZW4pO1xuICAgICAgICAgICAgZm9yKGk9MDsgaTx0b3RhbExlbjsgaSsrKSB7XG4gICAgICAgICAgICAgICAgYXJyW2ldID0gdmlldy5nZXRVaW50OChpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBhcnI7XG4gICAgICAgIGNhc2UgXCJpbnQxNlwiOlxuICAgICAgICAgICAgYXJyID0gbmV3IEludDE2QXJyYXkodG90YWxMZW4pO1xuICAgICAgICAgICAgZm9yKGk9MDsgaTx0b3RhbExlbjsgaSsrKSB7XG4gICAgICAgICAgICAgICAgYXJyW2ldID0gdmlldy5nZXRJbnQxNihpKjIpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGFycjtcbiAgICAgICAgY2FzZSBcInVpbnQxNlwiOlxuICAgICAgICAgICAgYXJyID0gbmV3IFVpbnQxNkFycmF5KHRvdGFsTGVuKTtcbiAgICAgICAgICAgIGZvcihpPTA7IGk8dG90YWxMZW47IGkrKykge1xuICAgICAgICAgICAgICAgIGFycltpXSA9IHZpZXcuZ2V0VWludDE2KGkqMik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gYXJyO1xuICAgICAgICBjYXNlIFwiaW50MzJcIjpcbiAgICAgICAgICAgIGFyciA9IG5ldyBJbnQzMkFycmF5KHRvdGFsTGVuKTtcbiAgICAgICAgICAgIGZvcihpPTA7IGk8dG90YWxMZW47IGkrKykge1xuICAgICAgICAgICAgICAgIGFycltpXSA9IHZpZXcuZ2V0SW50MzIoaSo0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBhcnI7XG4gICAgICAgIGNhc2UgXCJ1aW50MzJcIjpcbiAgICAgICAgICAgIGFyciA9IG5ldyBVaW50MzJBcnJheSh0b3RhbExlbik7XG4gICAgICAgICAgICBmb3IoaT0wOyBpPHRvdGFsTGVuOyBpKyspIHtcbiAgICAgICAgICAgICAgICBhcnJbaV0gPSB2aWV3LmdldFVpbnQzMihpKjQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGFycjtcbiAgICAgICAgLy9jYXNlIFwiaW50NjRcIjpcbiAgICAgICAgLy8gICAgYXJyID0gbmV3IEludDY0QXJyYXkodG90YWxMZW4pO1xuICAgICAgICAvLyAgICBmb3IoaT0wOyBpPHRvdGFsTGVuOyBpKyspIHtcbiAgICAgICAgLy8gICAgICAgIGFycltpXSA9IHZpZXcuZ2V0SW50NjQoaSo4KTtcbiAgICAgICAgLy8gICAgfVxuICAgICAgICAvLyAgICByZXR1cm4gYXJyO1xuICAgICAgICAvL2Nhc2UgXCJ1aW50NjRcIjpcbiAgICAgICAgLy8gICAgYXJyID0gbmV3IFVpbnQ2NEFycmF5KHRvdGFsTGVuKTtcbiAgICAgICAgLy8gICAgZm9yKGk9MDsgaTx0b3RhbExlbjsgaSsrKSB7XG4gICAgICAgIC8vICAgICAgICBhcnJbaV0gPSB2aWV3LmdldFVpbnQ2NChpKjgpO1xuICAgICAgICAvLyAgICB9XG4gICAgICAgIC8vICAgIHJldHVybiBhcnI7XG4gICAgICAgIGNhc2UgXCJmbG9hdFwiOlxuICAgICAgICAgICAgYXJyID0gbmV3IEZsb2F0MzJBcnJheSh0b3RhbExlbik7XG4gICAgICAgICAgICBmb3IoaT0wOyBpPHRvdGFsTGVuOyBpKyspIHtcbiAgICAgICAgICAgICAgICBhcnJbaV0gPSB2aWV3LmdldEZsb2F0MzIoaSo0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB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W0gICAgICA9IHJlcXVpcmUoJy4vemxpYi96c3RyZWFtJyk7XG5cbnZhciB0b1N0cmluZyA9IE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmc7XG5cbi8qIFB1YmxpYyBjb25zdGFudHMgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuXG52YXIgWl9OT19GTFVTSCAgICAgID0gMDtcbnZhciBaX0ZJTklTSCAgICAgICAgPSA0O1xuXG52YXIgWl9PSyAgICAgICAgICAgID0gMDtcbnZhciBaX1NUUkVBTV9FTkQgICAgPSAxO1xudmFyIFpfU1lOQ19GTFVTSCAgICA9IDI7XG5cbnZhciBaX0RFRkFVTFRfQ09NUFJFU1NJT04gPSAtMTtcblxudmFyIFpfREVGQVVMVF9TVFJBVEVHWSAgICA9IDA7XG5cbnZhciBaX0RFRkxBVEVEICA9IDg7XG5cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG5cblxuLyoqXG4gKiBjbGFzcyBEZWZsYXRlXG4gKlxuICogR2VuZXJpYyBKUy1zdHlsZSB3cmFwcGVyIGZvciB6bGliIGNhbGxzLiBJZiB5b3UgZG9uJ3QgbmVlZFxuICogc3RyZWFtaW5nIGJlaGF2aW91ciAtIHVzZSBtb3JlIHNpbXBsZSBmdW5jdGlvbnM6IFtbZGVmbGF0ZV1dLFxuICogW1tkZWZsYXRlUmF3XV0gYW5kIFtbZ3ppcF1dLlxuICoqL1xuXG4vKiBpbnRlcm5hbFxuICogRGVmbGF0ZS5jaHVua3MgLT4gQXJyYXlcbiAqXG4gKiBDaHVua3Mgb2Ygb3V0cHV0IGRhdGEsIGlmIFtbRGVmbGF0ZSNvbkRhdGFdXSB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l9CRVNUX1NQRUVEICAgICAgICAgID0gMTtcbi8vdmFyIFpfQkVTVF9DT01QUkVTU0lPTiAgICA9IDk7XG52YXIgWl9ERUZBVUxUX0NPTVBSRVNTSU9OID0gLTE7XG5cblxudmFyIFpfRklMVEVSRUQgICAgICAgICAgICA9IDE7XG52YXIgWl9IVUZGTUFOX09OTFkgICAgICAgID0gMjtcbnZhciBaX1JMRSAgICAgICAgICAgICAgICAgPSAzO1xudmFyIFpfRklYRUQgICAgICAgICAgICAgICA9IDQ7XG52YXIgWl9ERUZBVUxUX1NUUkFURUdZICAgID0gMDtcblxuLyogUG9zc2libGUgdmFsdWVzIG9mIHRoZSBkYXRhX3R5cGUgZmllbGQgKHRob3VnaCBzZWUgaW5mbGF0ZSgpKSAqL1xuLy92YXIgWl9CSU5BUlkgICAgICAgICAgICAgID0gMDtcbi8vdmFyIFpfVEVYVCAgICAgICAgICAgICAgICA9IDE7XG4vL3ZhciBaX0FTQ0lJICAgICAgICAgICAgICAgPSAxOyAvLyA9IFpfVEVYVFxudmFyIFpfVU5LTk9XTiAgICAgICAgICAgICA9IDI7XG5cblxuLyogVGhlIGRlZmxhdGUgY29tcHJlc3Npb24gbWV0aG9kICovXG52YXIgWl9ERUZMQVRFRCAgPSA4O1xuXG4vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuXG5cbnZhciBNQVhfTUVNX0xFVkVMID0gOTtcbi8qIE1heGltdW0gdmFsdWUgZm9yIG1lbUxldmVsIGluIGRlZmxhdGVJbml0MiAqL1xudmFyIE1BWF9XQklUUyA9IDE1O1xuLyogMzJLIExaNzcgd2luZG93ICovXG52YXIgREVGX01FTV9MRVZFTCA9IDg7XG5cblxudmFyIExFTkdUSF9DT0RFUyAgPSAyOTtcbi8qIG51bWJlciBvZiBsZW5ndGggY29kZXMsIG5vdCBjb3VudGluZyB0aGUgc3BlY2lhbCBFTkRfQkxP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aW5bKytzY2FuXSA9PT0gX3dpblsrK21hdGNoXSAmJiBfd2luWysrc2Nhbl0gPT09IF93aW5bKyttYXRjaF0gJiZcbiAgICAgICAgICAgICBfd2luWysrc2Nhbl0gPT09IF93aW5bKyttYXRjaF0gJiYgX3dpblsrK3NjYW5dID09PSBfd2luWysrbWF0Y2hdICYmXG4gICAgICAgICAgICAgX3dpblsrK3NjYW5dID09PSBfd2luWysrbWF0Y2hdICYmIF93aW5bKytzY2FuXSA9PT0gX3dpblsrK21hdGNoXSAmJlxuICAgICAgICAgICAgIF93aW5bKytzY2FuXSA9PT0gX3dpblsrK21hdGNoXSAmJiBfd2luWysrc2Nhbl0gPT09IF93aW5bKyttYXRjaF0gJiZcbiAgICAgICAgICAgICBzY2FuIDwgc3RyZW5kKTtcblxuICAgIC8vIEFzc2VydChzY2FuIDw9IHMtPndpbmRvdysodW5zaWduZWQpKHMtPndpbmRvd19zaXplLTEpLCBcIndpbGQgc2NhblwiKTtcblxuICAgIGxlbiA9IE1BWF9NQVRDSCAtIChzdHJlbmQgLSBzY2FuKTtcbiAgICBzY2FuID0gc3RyZW5kIC0gTUFYX01BVENIO1xuXG4gICAgaWYgKGxlbiA+IGJlc3RfbGVuKSB7XG4gICAgICBzLm1hdGNoX3N0YXJ0ID0gY3VyX21hdGNoO1xuICAgICAgYmVzdF9sZW4gPSBsZW47XG4gICAgICBpZiAobGVuID49IG5pY2VfbWF0Y2gpIHtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICBzY2FuX2VuZDEgID0gX3dpbltzY2FuICsgYmVzdF9sZW4gLSAxXTtcbiAgICAgIHNjYW5fZW5kICAgPSBfd2luW3NjYW4gKyBiZXN0X2xlbl07XG4gICAgfVxuICB9IHdoaWxlICgoY3VyX21hdGNoID0gcHJldltjdXJfbWF0Y2ggJiB3bWFza10pID4gbGltaXQgJiYgLS1jaGFpbl9sZW5ndGggIT09IDApO1xuXG4gIGlmIChiZXN0X2xlbiA8PSBzLmxvb2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R1cyA9IEJVU1lfU1RBVEU7XG4gICAgICB9XG4gICAgICBlbHNlIHtcbiAgICAgICAgcHV0X2J5dGUocywgKHMuZ3poZWFkLnRleHQgPyAxIDogMCkgK1xuICAgICAgICAgICAgICAgICAgICAocy5nemhlYWQuaGNyYyA/IDIgOiAwKSArXG4gICAgICAgICAgICAgICAgICAgICghcy5nemhlYWQuZXh0cmEgPyAwIDogNCkgK1xuICAgICAgICAgICAgICAgICAgICAoIXMuZ3poZWFkLm5hbWUgPyAwIDogOCkgK1xuICAgICAgICAgICAgICAgICAgICAoIXMuZ3poZWFkLmNvbW1lbnQgPyAwIDogMTYpXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgcHV0X2J5dGUocywgcy5nemhlYWQudGltZSAmIDB4ZmYpO1xuICAgICAgICBwdXRfYnl0ZShzLCAocy5nemhlYWQudGltZSA+PiA4KSAmIDB4ZmYpO1xuICAgICAgICBwdXRfYnl0ZShzLCAocy5nemhlYWQudGltZSA+PiAxNikgJiAweGZmKTtcbiAgICAgICAgcHV0X2J5dGUocywgKHMuZ3poZWFkLnRpbWUgPj4gMjQpICYgMHhmZik7XG4gICAgICAgIHB1dF9ieXRlKHMsIHMubGV2ZWwgPT09IDkgPyAyIDpcbiAgICAgICAgICAgICAgICAgICAgKHMuc3RyYXRlZ3kgPj0gWl9IVUZGTUFOX09OTFkgfHwgcy5sZXZlbCA8IDIgP1xuICAgICAgICAgICAgICAgICAgICAgNCA6IDApKTtcbiAgICAgICAgcHV0X2J5dGUocywgcy5nemhlYWQub3MgJiAweGZmKTtcbiAgICAgICAgaWYgKHMuZ3poZWFkLmV4dHJhICYmIHMuZ3poZWFkLmV4dHJhLmxlbmd0aCkge1xuICAgICAgICAgIHB1dF9ieXRlKHMsIHMuZ3poZWFkLmV4dHJhLmxlbmd0aCAmIDB4ZmYpO1xuICAgICAgICAgIHB1dF9ieXRlKHMsIChzLmd6aGVhZC5leHRyYS5sZW5ndGggPj4gOCkgJiAweGZmKTtcb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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG5cblxudmFyICAgIEhFQUQgPSAxOyAgICAgICAvKiBpOiB3YWl0aW5nIGZvciBtYWdpYyBoZWFkZXIgKi9cbnZhciAgICBGTEFHUyA9IDI7ICAgICAgLyogaTogd2FpdGluZyBmb3IgbWV0aG9kIGFuZCBmbGFncyAoZ3ppcCkgKi9cbnZhciAgICBUSU1FID0gMzsgICAgICAgLyogaTogd2FpdGluZyBmb3IgbW9kaWZpY2F0aW9uIHRpbWUgKGd6aXApICovXG52YXIgICAgT1MgPSA0OyAgICAgICAgIC8qIGk6IHdhaXRpbmcgZm9yIGV4dHJhIGZsYWdzIGFuZCBvcGVyYXRpbmcgc3lzdGVtIChnemlwKSAqL1xudmFyICAgIEVYTEVOID0gNTsgICAgICAvKiBpOiB3YWl0aW5nIGZvciBleHRyYSBsZW5ndGggKGd6aXApICovXG52YXIgICAgRVhUUkEgPSA2OyAgICAgIC8qIGk6IHdhaXRpbmcgZm9yIGV4dHJhIGJ5dGVzIChnemlwKSAqL1xudmFyICAgIE5BTUUgPSA3OyAgICAgICAvKiBpOiB3YWl0aW5nIGZvciBlbmQgb2YgZmlsZSBuYW1lIChnemlwKSAqL1xudmFyICAgIENPTU1FTlQgPSA4OyAgICAvKiBpOiB3YWl0aW5nIGZvciBlbmQgb2YgY29tbWVudCAoZ3ppcCkgKi9cbnZhciAgICBIQ1JDID0gOTsgICAgICAgLyogaTogd2FpdGluZyBmb3IgaGVhZGVyIGNyYyAoZ3ppcCkgKi9cbnZhciAgICBESUNUSUQgPSAxMDsgICAgLyogaTogd2FpdGluZyBmb3IgZGljdGlvbmFyeSBjaGVjayB2YWx1ZSAqL1xudmFyICAgIERJQ1QgPSAxMTsgICAgICAvKiB3YWl0aW5nIGZvciBpbmZsYXR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8vPT09IElOSVRCSVRTKCk7XG4gICAgICBob2xkID0gMDtcbiAgICAgIGJpdHMgPSAwO1xuICAgICAgLy89PT0vL1xuICAgICAgc3RhdGUubW9kZSA9IFRJTUU7XG4gICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgY2FzZSBUSU1FOlxuICAgICAgLy89PT0gTkVFREJJVFMoMzIpOyAqL1xuICAgICAgd2hpbGUgKGJpdHMgPCAzMikge1xuICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgaGF2ZS0tO1xuICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgYml0cyArPSA4O1xuICAgICAgfVxuICAgICAgLy89PT0vL1xuICAgICAgaWYgKHN0YXRlLmhlYWQpIHtcbiAgICAgICAgc3RhdGUuaGVhZC50aW1lID0gaG9sZDtcbiAgICAgIH1cbiAgICAgIGlmIChzdGF0ZS5mbGFncyAmIDB4MDIwMCkge1xuICAgICAgICAvLz09PSBDUkM0KHN0YXRlLmNoZWNrLCBob2xkKVxuICAgICAgICBoYnVmWzBdID0gaG9sZCAmIDB4ZmY7XG4gICAgICAgIGhidWZbMV0gPSAoaG9sZCA+Pj4gOCkgJiAweGZmO1xuICAgICAgICBoYnVmWzJdID0gKGhvbGQgPj4+IDE2KSAmIDB4ZmY7XG4gICAgICAgIGhidWZbM10gPSAoaG9sZCA+Pj4gMjQpICYgMHhmZjtcbiAgICAgICAgc3RhdGUuY2hlY2sgPSBjcmMzMihzdGF0ZS5jaGVjaywgaGJ1ZiwgNCwgMCk7XG4gICAgICAgIC8vPT09XG4gICAgICB9XG4gICAgICAvLz09PSBJTklUQklUUygpO1xuICAgICAgaG9sZCA9IDA7XG4gICAgICBiaXRzID0gMDtcbiAgICAgIC8vPT09Ly9cbiAgICAgIHN0YXRlLm1vZGUgPSBPUztcbiAgICAgIC8qIGZhbGxzIHRocm91Z2ggKi9cbiAgICBjY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gfVxuICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgIH1cbiAgICAgICAgLy89PT0vL1xuICAgICAgICBzdGF0ZS5sZW5ndGggPSBob2xkO1xuICAgICAgICBpZiAoc3RhdGUuaGVhZCkge1xuICAgICAgICAgIHN0YXRlLmhlYWQuZXh0cmFfbGVuID0gaG9sZDtcbiAgICAgICAgfVxuICAgICAgICBpZiAoc3RhdGUuZmxhZ3MgJiAweDAyMDApIHtcbiAgICAgICAgICAvLz09PSBDUkMyKHN0YXRlLmNoZWNrLCBob2xkKTtcbiAgICAgICAgICBoYnVmWzBdID0gaG9sZCAmIDB4ZmY7XG4gICAgICAgICAgaGJ1ZlsxXSA9IChob2xkID4+PiA4KSAmIDB4ZmY7XG4gICAgICAgICAgc3RhdGUuY2hlY2sgPSBjcmMzMihzdGF0ZS5jaGVjaywgaGJ1ZiwgMiwgMCk7XG4gICAgICAgICAgLy89PT0vL1xuICAgICAgICB9XG4gICAgICAgIC8vPT09IElOSVRCSVRTKCk7XG4gICAgICAgIGhvbGQgPSAwO1xuICAgICAgICBiaXRzID0gMDtcbiAgICAgICAgLy89PT0vL1xuICAgICAgfVxuICAgICAgZWxzZSBpZiAoc3RhdGUuaGVhZCkge1xuICAgICAgICBzdGF0ZS5oZWFkLmV4dHJhID0gbnVsbC8qWl9OVUxMKi87XG4gICAgICB9XG4gICAgICBzdGF0ZS5tb2RlID0gRVhUUkE7XG4gICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgY2FzZSBFWFRSQTpcbiAgICAgIGlmIChzdGF0ZS5mbGFncyAmIDB4MDQwMCkge1xuICAgICAgICBjb3B5ID0gc3RhdGUubGVuZ3RoO1xuICAgICAgICBpZiAoY29weSA+IGhhdmUpIHsgY29weSA9IGhhdmU7IH1cbiAgICAgICAgaWYgKGNvcHkpIHtcbiAgICAgICAgICBpZiAoc3RhdGUuaGVhZCkge1xuICAgICAgICAgICAgbGVuID0gc3RhdGUuaGVhZC5leHRyYV9sZW4gLSBzdGF0ZS5sZW5ndGg7XG4gICAgICAgICAgICBpZiAoIXN0YXRlLmhlYWQuZXh0cmEpIHtcbiAgICAgICAgICAgICAgLy8gVXNlIHVudHlwZWQgYXJyYXkgZm9yIG1vcmUgY29udmVuaWVuZCBwcm9jZXNzaW5nIGxhdGVyXG4gICAgICAgICAgICAgIHN0YXRlLmhlYWQuZXh0cmEgPSBuZXcgQXJyYXkoc3RhdGUuaGVhZC5leHRyYV9sZW4pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdXRpbHMuYXJyYXlTZXQoXG4gICAgICAgICAgICAgIHN0YXRlLmhlYWQuZXh0cmEsXG4gICAgICAgICAgICAgIGlucHV0LFxuICAgICAgICAgICAgICBuZXh0LFxuICAgICAgICAgICAgICAvLyBleHRyYSBmaWVsZCBpcyBsaW1pdGVkIHRvIDY1NTM2IGJ5dGVzXG4gICAgICAgICAgICAgIC8vIC0gbm8gbmVlZCBmb3IgYWRkaXRpb25hbCBzaXplIGNoZWNrXG4gICAgICAgICAgICAgIGNvcHksXG4gICAgICAgICAgICAgIC8qbGVuICsgY29weSA+IHN0YXRlLmhlYWQuZXh0cmFfbWF4IC0gbGVuID8gc3RhdGUuaGVhZC5leHRyYV9tYXggOiBjb3B5LCovXG4gICAgICAgICAgICAgIGxlblxuICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIC8vem1lbWNweShzdGF0ZS5oZWFkLmV4dHJhICsgbGVuLCBuZXh0LFxuICAgICAgICAgICAgLy8gICAgICAgIGxlbiArIGNvcHkgPiBzdGF0ZS5oZWFkLmV4dHJhX21heCA/XG4gICAgICAgICAgICAvLyAgICAgICAgc3RhdGUuaGVhZC5leHRyYV9tYXggLSBsZW4gOiBjb3B5KTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHN0YXRlLmZsYWdzICYgMHgwMjAwKSB7XG4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uICAgICAgICAgIHN0YXRlLmNoZWNrID0gY3JjMzIoc3RhdGUuY2hlY2ssIGlucHV0LCBjb3B5LCBuZXh0KTtcbiAgICAgICAgfVxuICAgICAgICBoYXZlIC09IGNvcHk7XG4gICAgICAgIG5leHQgKz0gY29weTtcbiAgICAgICAgaWYgKGxlbikgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgIH1cbiAgICAgIGVsc2UgaWYgKHN0YXRlLmhlYWQpIHtcbiAgICAgICAgc3RhdGUuaGVhZC5jb21tZW50ID0gbnVsbDtcbiAgICAgIH1cbiAgICAgIHN0YXRlLm1vZGUgPSBIQ1JDO1xuICAgICAgLyogZmFsbHMgdGhyb3VnaCAqL1xuICAgIGNhc2UgSENSQzpcbiAgICAgIGlmIChzdGF0ZS5mbGFncyAmIDB4MDIwMCkge1xuICAgICAgICAvLz09PSBORUVEQklUUygxNik7ICovXG4gICAgICAgIHdoaWxlIChiaXRzIDwgMTYpIHtcbiAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICB9XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgaWYgKGhvbGQgIT09IChzdGF0ZS5jaGVjayAmIDB4ZmZmZikpIHtcbiAgICAgICAgICBzdHJtLm1zZyA9ICdoZWFkZXIgY3JjIG1pc21hdGNoJztcbiAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIC8vPT09IElOSVRCSVRTKCk7XG4gICAgICAgIGhvbGQgPSAwO1xuICAgICAgICBiaXRzID0gMDtcbiAgICAgICAgLy89PT0vL1xuICAgICAgfVxuICAgICAgaWYgKHN0YXRlLmhlYWQpIHtcbiAgICAgICAgc3RhdGU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tcbiAgICAgIGNhc2UgMDogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHN0b3JlZCBibG9jayAqL1xuICAgICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgICBzdG9yZWQgYmxvY2slc1xcblwiLFxuICAgICAgICAvLyAgICAgICAgc3RhdGUubGFzdCA/IFwiIChsYXN0KVwiIDogXCJcIikpO1xuICAgICAgICBzdGF0ZS5tb2RlID0gU1RPUkVEO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgMTogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGZpeGVkIGJsb2NrICovXG4gICAgICAgIGZpeGVkdGFibGVzKHN0YXRlKTtcbiAgICAgICAgLy9UcmFjZXYoKHN0ZGVyciwgXCJpbmZsYXRlOiAgICAgZml4ZWQgY29kZXMgYmxvY2slc1xcblwiLFxuICAgICAgICAvLyAgICAgICAgc3RhdGUubGFzdCA/IFwiIChsYXN0KVwiIDogXCJcIikpO1xuICAgICAgICBzdGF0ZS5tb2RlID0gTEVOXzsgICAgICAgICAgICAgLyogZGVjb2RlIGNvZGVzICovXG4gICAgICAgIGlmIChmbHVzaCA9PT0gWl9UUkVFUykge1xuICAgICAgICAgIC8vLS0tIERST1BCSVRTKDIpIC0tLS8vXG4gICAgICAgICAgaG9sZCA+Pj49IDI7XG4gICAgICAgICAgYml0cyAtPSAyO1xuICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICBicmVhayBpbmZfbGVhdmU7XG4gICAgICAgIH1cbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIDI6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBkeW5hbWljIGJsb2NrICovXG4gICAgICAgIC8vVHJhY2V2KChzdGRlcnIsIFwiaW5mbGF0ZTogICAgIGR5bmFtaWMgY29kZXMgYmxvY2slc1xcblwiLFxuICAgICAgICAvLyAgICAgICAgc3RhdGUubGFzdCA/IFwiIChsYXN0KVwiIDogXCJcIikpO1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VyZSAmIDB4ZmZmZjtcblxuICAgICAgICAgIGlmICgoaGVyZV9iaXRzKSA8PSBiaXRzKSB7IGJyZWFrOyB9XG4gICAgICAgICAgLy8tLS0gUFVMTEJZVEUoKSAtLS0vL1xuICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgLy8tLS0vL1xuICAgICAgICB9XG4gICAgICAgIGlmIChoZXJlX3ZhbCA8IDE2KSB7XG4gICAgICAgICAgLy8tLS0gRFJPUEJJVFMoaGVyZS5iaXRzKSAtLS0vL1xuICAgICAgICAgIGhvbGQgPj4+PSBoZXJlX2JpdHM7XG4gICAgICAgICAgYml0cyAtPSBoZXJlX2JpdHM7XG4gICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgIHN0YXRlLmxlbnNbc3RhdGUuaGF2ZSsrXSA9IGhlcmVfdmFsO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgIGlmIChoZXJlX3ZhbCA9PT0gMTYpIHtcbiAgICAgICAgICAgIC8vPT09IE5FRURCSVRTKGhlcmUuYml0cyArIDIpO1xuICAgICAgICAgICAgbiA9IGhlcmVfYml0cyArIDI7XG4gICAgICAgICAgICB3aGlsZSAoYml0cyA8IG4pIHtcbiAgICAgICAgICAgICAgaWYgKGhhdmUgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vPT09Ly9cbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKGhlcmUuYml0cykgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSBoZXJlX2JpdHM7XG4gICAgICAgICAgICBiaXRzIC09IGhlcmVfYml0cztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICAgIGlmIChzdGF0ZS5oYXZlID09PSAwKSB7XG4gICAgICAgICAgICAgIHN0cm0ubXNnID0gJ2ludmFsaWQgYml0IGxlbmd0aCByZXBlYXQnO1xuICAgICAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxlbiA9IHN0YXRlLmxlbnNbc3RhdGUuaGF2ZSAtIDFdO1xuICAgICAgICAgICAgY29weSA9IDMgKyAoaG9sZCAmIDB4MDMpOy8vQklUUygyKTtcbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKDIpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gMjtcbiAgICAgICAgICAgIGJpdHMgLT0gMjtcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICB9XG4gICAgICAgICAgZWxzZSBpZiAoaGVyZV92YWwgPT09IDE3KSB7XG4gICAgICAgICAgICAvLz09PSBORUVEQklUUyhoZXJlLmJpdHMgKyAzKTtcbiAgICAgICAgICAgIG4gPSBoZXJlX2JpdHMgKyAzO1xuICAgICAgICAgICAgd2hpbGUgKGJpdHMgPCBuKSB7XG4gICAgICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLz09PS8vXG4gICAgICAgICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gaGVyZV9iaXRzO1xuICAgICAgICAgICAgYml0cyAtPSBoZXJlX2JpdHM7XG4gICAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgICBsZW4gPSAwO1xuICAgICAgICAgICAgY29weSA9IDMgKyAoaG9sZCAmIDB4MDcpOy8vQklUUygzKTtcbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKDMpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gMztcbiAgICAgICAgICAgIGJpdHMgLT0gMztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICB9XG4gICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAvLz09PSBORUVEQklUUyhoZXJlLmJpdHMgKyA3KTtcbiAgICAgICAgICAgIG4gPSBoZXJlX2JpdHMgKyA3O1xuICAgICAgICAgICAgd2hpbGUgKGJpdHMgPCBuKSB7XG4gICAgICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLz09PS8vXG4gICAgICAgICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gaGVyZV9iaXRzO1xuICAgICAgICAgICAgYml0cyAtPSBoZXJlX2JpdHM7XG4gICAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgICBsZW4gPSAwO1xuICAgICAgICAgICAgY29weSA9IDExICsgKGhvbGQgJiAweDdmKTsvL0JJVFMoNyk7XG4gICAgICAgICAgICAvLy0tLSBEUk9QQklUUyg3KSAtLS0vL1xuICAgICAgICAgICAgaG9sZCA+Pj49IDc7XG4gICAgICAgICAgICBiaXRzIC09IDc7XG4gICAgICAgICAgICAvLy0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ggPT09IDApIHsgc3RhdGUubW9kZSA9IExFTjsgfVxuLy8gICAgICAgICAgYnJlYWs7XG4vLyNlbmRpZlxuICAgICAgICB9XG4gICAgICAgIGlmIChjb3B5ID4gc3RhdGUud25leHQpIHtcbiAgICAgICAgICBjb3B5IC09IHN0YXRlLnduZXh0O1xuICAgICAgICAgIGZyb20gPSBzdGF0ZS53c2l6ZSAtIGNvcHk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgZnJvbSA9IHN0YXRlLnduZXh0IC0gY29weTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoY29weSA+IHN0YXRlLmxlbmd0aCkgeyBjb3B5ID0gc3RhdGUubGVuZ3RoOyB9XG4gICAgICAgIGZyb21fc291cmNlID0gc3RhdGUud2luZG93O1xuICAgICAgfVxuICAgICAgZWxzZSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogY29weSBmcm9tIG91dHB1dCAqL1xuICAgICAgICBmcm9tX3NvdXJjZSA9IG91dHB1dDtcbiAgICAgICAgZnJvbSA9IHB1dCAtIHN0YXRlLm9mZnNldDtcbiAgICAgICAgY29weSA9IHN0YXRlLmxlbmd0aDtcbiAgICAgIH1cbiAgICAgIGlmIChjb3B5ID4gbGVmdCkgeyBjb3B5ID0gbGVmdDsgfVxuICAgICAgbGVmdCAtPSBjb3B5O1xuICAgICAgc3RhdGUubGVuZ3RoIC09IGNvcHk7XG4gICAgICBkbyB7XG4gICAgICAgIG91dHB1dFtwdXQrK10gPSBmcm9tX3NvdXJjZVtmcm9tKytdO1xuICAgICAgfSB3aGlsZSAoLS1jb3B5KTtcbiAgICAgIGlmIChzdGF0ZS5sZW5ndGggPT09IDApIHsgc3RhdGUubW9kZSA9IExFTjsgfVxuICAgICAgYnJlYWs7XG4gICAgY2FzZSBMSVQ6XG4gICAgICBpZiAobGVmdCA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgIG91dHB1dFtwdXQrK10gPS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0b29cbiAgICAgICAgaWYgKChzdGF0ZS5mbGFncyA/IGhvbGQgOiB6c3dhcDMyKGhvbGQpKSAhPT0gc3RhdGUuY2hlY2spIHtcbiAgICAgICAgICBzdHJtLm1zZyA9ICdpbmNvcnJlY3QgZGF0YSBjaGVjayc7XG4gICAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICAvLz09PSBJTklUQklUUygpO1xuICAgICAgICBob2xkID0gMDtcbiAgICAgICAgYml0cyA9IDA7XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgLy9UcmFjZXYoKHN0ZGVyciwgXCJpbmZsYXRlOiAgIGNoZWNrIG1hdGNoZXMgdHJhaWxlclxcblwiKSk7XG4gICAgICB9XG4gICAgICBzdGF0ZS5tb2RlID0gTEVOR1RIO1xuICAgICAgLyogZmFsbHMgdGhyb3VnaCAqL1xuICAgIGNhc2UgTEVOR1RIOlxuICAgICAgaWYgKHN0YXRlLndyYXAgJiYgc3RhdGUuZmxhZ3MpIHtcbiAgICAgICAgLy89PT0gTkVFREJJVFMoMzIpO1xuICAgICAgICB3aGlsZSAoYml0cyA8IDMyKSB7XG4gICAgICAgICAgaWYgKGhhdmUgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgICAgaGF2ZS0tO1xuICAgICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgfVxuICAgICAgICAvLz09PS8vXG4gICAgICAgIGlmIChob2xkICE9PSAoc3RhdGUudG90YWwgJiAweGZmZmZmZmZmKSkge1xuICAgICAgICAgIHN0cm0ubXNnID0gJ2luY29ycmVjdCBsZW5ndGggY2hlY2snO1xuICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgLy89PT0gSU5JVEJJ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gZGVjb2RpbmcgdGFibGVzIHdpdGggaW52YWxpZCBjb2RlIG1hcmtlcnMuXG4gICAqL1xuXG4gIC8qIHNldCB1cCBmb3IgY29kZSB0eXBlICovXG4gIC8vIHBvb3IgbWFuIG9wdGltaXphdGlvbiAtIHVzZSBpZi1lbHNlIGluc3RlYWQgb2Ygc3dpdGNoLFxuICAvLyB0byBhdm9pZCBkZW9wdHMgaW4gb2xkIHY4XG4gIGlmICh0eXBlID09PSBDT0RFUykge1xuICAgIGJhc2UgPSBleHRyYSA9IHdvcms7ICAgIC8qIGR1bW15IHZhbHVlLS1ub3QgdXNlZCAqL1xuICAgIGVuZCA9IDE5O1xuXG4gIH0gZWxzZSBpZiAodHlwZSA9PT0gTEVOUykge1xuICAgIGJhc2UgPSBsYmFzZTtcbiAgICBiYXNlX2luZGV4IC09IDI1NztcbiAgICBleHRyYSA9IGxleHQ7XG4gICAgZXh0cmFfaW5kZXggLT0gMjU3O1xuICAgIGVuZCA9IDI1NjtcblxuICB9IGVsc2UgeyAgICAgICAgICAgICAgICAgICAgLyogRElTVFMgKi9cbiAgICBiYXNlID0gZGJhc2U7XG4gICAgZXh0cmEgPSBkZXh0O1xuICAgIGVuZCA9IC0xO1xuICB9XG5cbiAgLyogaW5pdGlhbGl6ZSBvcHRzIGZvciBsb29wICovXG4gIGh1ZmYgPSAwOyAgICAgICAgICAgICAgICAgICAvKiBzdGFydGluZyBjb2RlICovXG4gIHN5bSA9IDA7ICAgICAgICAgICAgICAgICAgICAvKiBzdGFydGluZyBjb2RlIHN5bWJvbCAqL1xuICBsZW4gPSBtaW47ICAgICAgICAgICAgICAgICAgLyogc3RhcnRpbmcgY29kZSBsZW5ndGggKi9cbiAgbmV4dCA9IHRhYmxlX2luZGV4OyAgICAgICAgICAgICAgLyogY3VycmVudCB0YWJsZSB0byBmaWxsIGluICovXG4gIGN1cnIgPSByb290OyAgICAgICAgICAgICAgICAvKiBjdXJyZW50IHRhYmxlIGluZGV4IGJpdHMgKi9cbi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9uYXJ5JywgICAgIC8qIFpfTkVFRF9ESUNUICAgICAgIDIgICovXG4gIDE6ICAgICAgJ3N0cmVhbSBlbmQnLCAgICAgICAgICAvKiBaX1NUUkVBTV9FTkQgICAgICAxICAqL1xuICAwOiAgICAgICcnLCAgICAgICAgICAgICAgICAgICAgLyogWl9PSyAgICAgICAgICAgICAgMCAgKi9cbiAgJy0xJzogICAnZmlsZSBlcnJvcicsICAgICAgICAgIC8qIFpfRVJSTk8gICAgICAgICAoLTEpICovXG4gICctMic6ICAgJ3N0cmVhbSBlcnJvcicsICAgICAgICAvKiBaX1NUUkVBTV9FUlJPUiAgKC0yKSAqL1xuICAnLTMnOiAgICdkYXRhIGVycm9yJywgICAgICAgICAgLyogWl9EQVRBX0VSUk9SICAgICgtMykgKi9cbiAgJy00JzogICAnaW5zdWZmaWNpZW50IG1lbW9yeScsIC8qIFpfTUVNX0VSUk9SICAgICAoLTQpICovXG4gICctNSc6ICAgJ2J1ZmZlciBlcnJvcicsICAgICAgICAvKiBaX0JVRl9FUlJPUiAgICAgKC01KSAqL1xuICAnLTYnOiAgICdpbmNvbXBhdGlibGUgdmVyc2lvbicgLyogWl9WRVJTSU9OX0VSUk9SICgtNikgKi9cbn07XG4iLCIndXNlIHN0cmljdCc7XG5cblxudmFyIHV0aWxzID0gcmVxdWlyZSgnLi4vdXRpbHMvY29tbW9uJyk7XG5cbi8qIFB1YmxpYyBjb25zdGFudHMgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuXG5cbi8vdmFyIFpfRklMVEVSRUQgICAgICAgICAgPSAxO1xuLy92YXIgWl9IVUZGTUFOX09OTFkgICAgICA9IDI7XG4vL3ZhciBaX1JMRSAgICAgICAgICAgICAgID0gMztcbnZhciBaX0ZJWEVEICAgICAgICAgICAgICAgPSA0O1xuLy92YXIgWl9ERUZBVUxUX1NUUkFURUdZICA9IDA7XG5cbi8qIFBvc3NpYmxlIHZhbHVlcyBvZiB0aGUgZGF0YV90eXBlIGZpZWxkICh0aG91Z2ggc2VlIGluZmxhdGUoKSkgKi9cbnZhciBaX0JJTkFSWSAgICAgICAgICAgICAgPSAwO1xudmFyIFpfVEVYVCAgICAgICAgICAgICAgICA9IDE7XG4vL3ZhciBaX0FTQ0lJICAgICAgICAgICAgID0gMTsgLy8gPSBaX1RFWFRcbnZhciBaX1VOS05PV04gICAgICAgICAgICAgPSAyO1xuXG4vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuXG5cbmZ1bmN0aW9uIHplcm8oYnVmKSB7IHZhciBsZW4gPSBidWYubGVuZ3RoOyB3aGlsZSAoLS1sZW4gPj0gMCkgeyBidWZbbGVuXSA9IDA7IH0gfVxuXG4vLyBGcm9tIHp1dGlsLmhcblxudmFyIFNUT1JFRF9CTE9DSyA9IDA7XG52YXIgU1RBVElDX1RSRUVTID0gMTtcbnZhciBEWU5fVFJFRVMgICAgPSAyO1xuLyogVGhlIHRocmVlIGtpbmRzIG9mIGJsb2NrIHR5cGUgKi9cblxudmFyIE1JTl9NQVRDSCAgICA9IDM7XG52YXIgTUFYX01BVENIICAgID0gMjU4O1xuLyogVGhlIG1pbmltdW0gYW5kIG1heGltdW0gbWF0Y2ggbGVuZ3RocyAqL1xuXG4vLyBGcm9tIGRlZmxhdGUuaFxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBJbnRlcm5hbCBjb21wcmVzc2lvbiBzdGF0ZS5cbiAqL1xuXG52YXIgTEVOR1RIX0NPREVTICA9IDI5O1xuLyogbnVtYmVyIG9mIGxlbmd0aCBjb2Rlcywgbm90IGNvd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IGZyZXF1ZW5jeSAqL1xue1xuICB2YXIgbjsgICAgICAgICAgICAgICAgICAgICAvKiBpdGVyYXRlcyBvdmVyIGFsbCB0cmVlIGVsZW1lbnRzICovXG4gIHZhciBwcmV2bGVuID0gLTE7ICAgICAgICAgIC8qIGxhc3QgZW1pdHRlZCBsZW5ndGggKi9cbiAgdmFyIGN1cmxlbjsgICAgICAgICAgICAgICAgLyogbGVuZ3RoIG9mIGN1cnJlbnQgY29kZSAqL1xuXG4gIHZhciBuZXh0bGVuID0gdHJlZVswICogMiArIDFdLyouTGVuKi87IC8qIGxlbmd0aCBvZiBuZXh0IGNvZGUgKi9cblxuICB2YXIgY291bnQgPSAwOyAgICAgICAgICAgICAvKiByZXBlYXQgY291bnQgb2YgdGhlIGN1cnJlbnQgY29kZSAqL1xuICB2YXIgbWF4X2NvdW50ID0gNzsgICAgICAgICAvKiBtYXggcmVwZWF0IGNvdW50ICovXG4gIHZhciBtaW5fY291bnQgPSA0OyAgICAgICAgIC8qIG1pbiByZXBlYXQgY291bnQgKi9cblxuICBpZiAobmV4dGxlbiA9PT0gMCkge1xuICAgIG1heF9jb3VudCA9IDEzODtcbiAgICBtaW5fY291bnQgPSAzO1xuICB9XG4gIHRyZWVbKG1heF9jb2RlICsgMSkgKiAyICsgMV0vKi5MZW4qLyA9IDB4ZmZmZjsgLyogZ3VhcmQgKi9cblxuICBmb3IgKG4gPSAwOyBuIDw9IG1heF9jb2RlOyBuKyspIHtcbiAgICBjdXJsZW4gPSBuZXh0bGVuO1xuICAgIG5leHRsZW4gPSB0cmVlWyhuICsgMSkgKiAyICsgMV0vKi5MZW4qLztcblxuICAgIGlmICgrK2NvdW50IDwgbWF4X2NvdW50ICYmIGN1cmxlbiA9PT0gbmV4dGxlbikge1xuICAgICAgY29udGludWU7XG5cbiAgICB9IGVsc2UgaWYgKGNvdW50IDwgbWluX2NvdW50KSB7XG4gICAgICBzLmJsX3RyZWVbY3VybGVuICogMl0vKi5GcmVxKi8gKz0gY291b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bnNpb25zLmxlbmd0aCA+PSAyKSkge1xuICAgIC8vICAgd2luZG93LmNvbnNvbGUubG9nKCdJbnZhbGlkIGRpbWVuc2lvbnMgY29udGFpbmVyLicpO1xuICAgIC8vICAgd2luZG93LmNvbnNvbGUubG9nKGRpbWVuc2lvbnMpO1xuXG4gICAgLy8gICByZXR1cm4gZmFsc2U7XG4gICAgLy8gfVxuXG4gICAgLy9cbiAgICBsZXQgem9vbSA9IDE7XG5cbiAgICAvLyB1cGRhdGUgem9vbVxuICAgIHN3aXRjaCAoZGlyZWN0aW9uKXtcbiAgICAgIGNhc2UgMDpcbiAgICAgICAgem9vbSA9IGZhY3RvciAqIHRoaXMuX2NvbXB1dGVab29tKHRoaXMuX2NhbnZhcy53aWR0aCwgdGhpcy5feENvc2luZSk7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAxOlxuICAgICAgICB6b29tID0gZmFjdG9yICogdGhpcy5fY29tcHV0ZVpvb20odGhpcy5fY2FudmFzLmhlaWdodCwgdGhpcy5feUNvc2luZSk7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAyOlxuICAgICAgICB6b29tID0gZmFjdG9yICogKE1hdGgubWluKFxuICAgICAgICAgIHRoaXMuX2NvbXB1dGVab29tKHRoaXMuX2NhbnZhcy53aWR0aCwgdGhpcy5feENvc2luZSksXG4gICAgICAgICAgdGhpcy5fY29tcHV0ZVpvb20odGhpcy5fY2FudmFzLmhlaWdodCwgdGhpcy5feUNvc2luZSlcbiAgICAgICAgKSk7XG4gICAgICAgIGJyZWFrO1xuICAgICAgZGVmYXVsdDpcbiAgICAgICAgYnJlYWs7XG4gICAgfVxuXG4gICAgaWYoIXpvb20pe1xuXG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgICBcbiAgICB9XG5cbiAgICB0aGlzLnpvb20gPSB6b29tO1xuXG4gICAgdGhpcy5jZW50ZXIoKTtcbiAgfVxuXG4gIF9hZGp1c3RUb3BEaXJlY3Rpb24oIGhvcml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ICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgY2FzZSA0OlxuICAgICAgICAgICAgaWYgKGV2ZW50LnRvdWNoZXMubGVuZ3RoID49IDIpIHtcbiAgICAgICAgICAgICAgX3N0YXRlID0gU1RBVEUuVE9VQ0hfWk9PTTtcbiAgICAgICAgICAgICAgdmFyIGR4ID0gZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VYIC0gZXZlbnQudG91Y2hlc1sgMSBdLnBhZ2VYO1xuICAgICAgICAgICAgICB2YXIgZHkgPSBldmVudC50b3VjaGVzWyAwIF0ucGFnZVkgLSBldmVudC50b3VjaGVzWyAxIF0ucGFnZVk7XG4gICAgICAgICAgICAgIF90b3VjaFpvb21EaXN0YW5jZUVuZCA9IF90b3VjaFpvb21EaXN0YW5jZVN0YXJ0ID0gTWF0aC5zcXJ0KGR4ICogZHggKyBkeSAqIGR5KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIF9zdGF0ZSA9IFNUQVRFLlpPT007XG4gICAgICAgICAgICAgIF96b29tU3RhcnQuY29weShnZXRNb3VzZU9uU2NyZWVuKGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWCwgZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VZKSk7XG4gICAgICAgICAgICAgIF96b29tRW5kLmNvcHkoX3pvb21TdGFydCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICBjYXNlIDU6XG4gICAgICAgICAgICBpZiAoZXZlbnQudG91Y2hlcy5sZW5ndGggPj0gMikge1xuICAgICAgICAgICAgICBfc3RhdGUgPSBTVEFURS5UT1VDSF9QQU47XG4gICAgICAgICAgICAgIHZhciB4ID0gKGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWCArIGV2ZW50LnRvdWNoZXNbIDEgXS5wYWdlWCkgLyAyO1xuICAgICAgICAgICAgICB2YXIgeSA9IChldmVudC50b3VjaGVzWyAwIF0ucGFnZVkgKyBldmVudC50b3VjaGVzWyAxIF0ucGFnZVkpIC8gMjtcbiAgICAgICAgICAgICAgX3BhblN0YXJ0LmNvcHkoZ2V0TW91c2VPblNjcmVlbih4LCB5KSk7XG4gICAgICAgICAgICAgIF9wYW5FbmQuY29weShfcGFuU3RhcnQpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgX3N0YXRlID0gU1RBVEUuUEFOO1xuICAgICAgICAgICAgICBfcGFuU3RhcnQuY29weShnZXRNb3VzZU9uU2NyZWVuKGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWCwgZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VZKSk7XG4gICAgICAgICAgICAgIF9wYW5FbmQuY29weShfcGFuU3RhcnQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIDk5OlxuICAgICAgICAgICAgX3N0YXRlID0gU1RBVEUuQ1VTVE9NO1xuICAgICAgICAgICAgdmFyIHggPSAoZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VYICsgZXZlbnQudG91Y2hlc1sgMSBdLnBhZ2VYKSAvIDI7XG4gICAgICAgICAgICB2YXIgeSA9IChldmVudC50b3VjaGVzWyAwIF0ucGFnZVkgKyBldmVudC50b3VjaGVzWyAxIF0ucGFnZVkpIC8gMjtcbiAgICAgICAgICAgIF9jdXN0b21TdGFydC5jb3B5KGdldE1vdXNlT25TY3JlZW4oeCwgeSkpO1xuICAgICAgICAgICAgX2N1c3RvbUVuZC5jb3B5KF9jdXN0b21TdGFydCk7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICBfc3RhdGUgPSBTVEFURS5OT05FO1xuXG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgX3RoaXMuZGlzcGF0Y2hFdmVudChzdGFydEV2ZW50KTtcblxuICAgIH1cblxuICAgIGZ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vdmVDdXJyLmNvcHkoZ2V0TW91c2VPbkNpcmNsZShldmVudC50b3VjaGVzWyAwIF0ucGFnZVgsIGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWSkpO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAvLyBUT1VDSCBaT09NXG4gICAgICAgICAgICBfdG91Y2hab29tRGlzdGFuY2VTdGFydCA9IF90b3VjaFpvb21EaXN0YW5jZUVuZCA9IDA7XG4gICAgICAgICAgICBfc3RhdGUgPSBTVEFURS5aT09NO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIDU6XG4gICAgICAgICAgICAvLyBUT1VDSCBaT09NXG4gICAgICAgICAgICBpZiAoZXZlbnQudG91Y2hlcy5sZW5ndGggPj0gMikge1xuICAgICAgICAgICAgICB2YXIgeCA9IChldmVudC50b3VjaGVzWyAwIF0ucGFnZVggKyBldmVudC50b3VjaGVzWyAxIF0ucGFnZVgpIC8gMjtcbiAgICAgICAgICAgICAgdmFyIHkgPSAoZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VZICsgZXZlbnQudG91Y2hlc1sgMSBdLnBhZ2VZKSAvIDI7XG4gICAgICAgICAgICAgIF9wYW5FbmQuY29weShnZXRNb3VzZU9uU2NyZWVuKHgsIHkpKTtcbiAgICAgICAgICAgICAgX3BhblN0YXJ0LmNvcHkoX3BhbkVuZCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBfc3RhdGUgPSBTVEFURS5QQU47XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgOTk6XG4gICAgICAgICAgICB2YXIgeCA9IChldmVudC50b3VjaGVzWyAwIF0ucGFnZVggKyBldmVudC50b3VjaGVzWyAxIF0ucGFnZVgpIC8gMjtcbiAgICAgIC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W5ndGgpIHtcblxuICAgICAgICBjYXNlIDE6XG4gICAgICAgIFxuICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgMjpcbiAgICAgICAgICB2YXIgZHggPSBldmVudC50b3VjaGVzWyAwIF0ucGFnZVggLSBldmVudC50b3VjaGVzWyAxIF0ucGFnZVg7XG4gICAgICAgICAgdmFyIGR5ID0gZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VZIC0gZXZlbnQudG91Y2hlc1sgMSBdLnBhZ2VZO1xuICAgICAgICAgIF90b3VjaFpvb21EaXN0YW5jZUVuZCA9IE1hdGguc3FydChkeCAqIGR4ICsgZHkgKiBkeSk7XG5cbiAgICAgICAgICB2YXIgeCA9IChldmVudC50b3VjaGVzWyAwIF0ucGFnZVggKyBldmVudC50b3VjaGVzWyAxIF0ucGFnZVgpIC8gMjtcbiAgICAgICAgICB2YXIgeSA9IChldmVudC50b3VjaGVzWyAwIF0ucGFnZVkgKyBldmVudC50b3VjaGVzWyAxIF0ucGFnZVkpIC8gMjtcbiAgICAgICAgICBfcGFuRW5kLmNvcHkoZ2V0TW91c2VPblNjcmVlbih4LCB5KSk7XG4gICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICBfc3RhdGUgPSBTVEFURS5OT05FO1xuXG4gICAgICB9XG5cbiAgICB9XG5cbiAgICBmdW5jdGlvbiB0b3VjaGVuZChldmVudCkge1xuXG4gICAgICBpZiAoX3RoaXMuZW5hYmxlZCA9PT0gZmFsc2UpIHJldHVybjtcblxuICAgICAgc3dpdGNoIChldmVudC50b3VjaGVzLmxlbmd0aCkge1xuXG4gICAgICAgIGNhc2UgMTpcbiAgICAgICAgXG4gICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAyOlxuICAgICAgICAgIF90b3VjaFpvb21EaXN0YW5jZVN0YXJ0ID0gX3RvdWNoWm9vbURpc3RhbmNlRW5kID0gMDtcblxuICAgICAgICAgIHZhci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gICAgIHxcbiAgICAvLyAgICAgICAgICAgfFxuICAgIC8vICAgICAgICAgICArXG4gICAgLy9cblxuICAgIGxldCByYXkyID0gdGhpcy5wb3NkaXIoXG4gICAgICBuZXcgVEhSRUUuVmVjdG9yMyhhYWJiLmNlbnRlci54ICsgYWFiYi5oYWxmRGltZW5zaW9ucy54LCBhYWJiLmNlbnRlci55ICsgYWFiYi5oYWxmRGltZW5zaW9ucy55LCBhYWJiLmNlbnRlci56ICsgYWFiYi5oYWxmRGltZW5zaW9ucy56KSxcbiAgICAgIG9yaWVudGF0aW9uLnhcbiAgICApO1xuICAgIHRoaXMucmF5UGxhbmVJbkJCb3gocmF5MiwgcGxhbmVBQUJCLCBiYm94LCBpbnRlcnNlY3Rpb25zKTtcblxuICAgIHJheTIuZGlyZWN0aW9uID0gb3JpZW50YXRpb24ueTtcbiAgICB0aGlzLnJheVBsYW5lSW5CQm94KHJheTIsIHBsYW5lQUFCQiwgYmJveCwgaW50ZXJzZWN0aW9ucyk7XG5cbiAgICByYXkyLmRpcmVjdGlvbiA9IG9yaWVudGF0aW9uLno7XG4gICAgdGhpcy5yYXlQbGFuZUluQkJveChyYXkyLCBwbGFuZUFBQkIsIGJib3gsIGludGVyc2VjdGlvbnMpO1xuXG4gICAgLy8gUkFZUyBTVEFSVElORyBGUk9NIFRIRSBTRUNPTkQgQ09STkVSXG4gICAgLy9cbiAgICAvLyAgICAgICAgICAgICAgICtcbiAgICAvLyAgICAgICAgICAgICAgIHxcbiAgICAvLyAgICAgICAgICAgICAgIHxcbiAgICAvLyAgICAgICAgICAgICAgIHxcbiAgICAvLyAgICAgICAgICAgICAgICtcbiAgICAvLyAgICAgICAgICAgICAuJ1xuICAgIC8vICAgICAgICAgICArJ1xuXG4gICAgbGV0IHJheTMgPSB0aGlzLnBvc2RpcihcbiAgICAgIG5ldyBUSFJFRS5WZWN0b3IzKGFhYmIuY2VudGVyLnggKyBhYWJiLmhhbGZEaW1lbnNpb25zLngsIGFhYmIuY2VudG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AgICBsZXQgcGxhbmUgPSB0aGlzLnBvc2RpcihcbiAgICAgIG5ldyBUSFJFRS5WZWN0b3IzKFxuICAgICAgICBiYm94Lm1pbi54LFxuICAgICAgICBib3guY2VudGVyLnksXG4gICAgICAgIGJveC5jZW50ZXIueiksXG4gICAgICBuZXcgVEhSRUUuVmVjdG9yMygtMSwgMCwgMClcbiAgICApO1xuICAgIHRoaXMucmF5UGxhbmVJbkJCb3gocmF5LCBwbGFuZSwgYmJveCwgaW50ZXJzZWN0aW9ucyk7XG5cbiAgICAvLyBYIG1heFxuICAgIHBsYW5lID0gdGhpcy5wb3NkaXIoXG4gICAgICBuZXcgVEhSRUUuVmVjdG9yMyhcbiAgICAgICAgYmJveC5tYXgueCxcbiAgICAgICAgYm94LmNlbnRlci55LFxuICAgICAgICBib3guY2VudGVyLnopLFxuICAgICAgbmV3IFRIUkVFLlZlY3RvcjMoMSwgMCwgMClcbiAgICApO1xuICAgIHRoaXMucmF5UGxhbmVJbkJCb3gocmF5LCBwbGFuZSwgYmJveCwgaW50ZXJzZWN0aW9ucyk7XG5cbiAgICAvLyBZIG1pblxuICAgIHBsYW5lID0gdGhpcy5wb3NkaXIoXG4gICAgICBuZXcgVEhSRUUuVmVjdG9yMyhcbiAgICAgICAgYm94LmNlbnRlci54LFxuICAgICAgICBiYm94Lm1pbi55LFxuICAgICAgICBib3guY2VudGVyLnopLFxuICAgICAgbmV3IFRIUkVFLlZlY3RvcjMoMCwgLTEsIDApXG4gICAgKTtcbiAgICB0aGlzLnJheVBsYW5lSW5CQm94KHJheSwgcGxhbmUsIGJib3gsIGludGVyc2VjdGlvbnMpO1xuXG4gICAgLy8gWSBtYXhcbiAgICBwbGFuZSA9IHRoaXMucG9zZGlyKFxuICAgICAgbmV3IFRIUkVFLlZlY3RvcjMoXG4gICAgICAgIGJveC5jZW50ZXIueCxcbiAgICAgICAgYmJveC5tYXgueSxcbiAgICAgICAgYm94LmNlbnRlci56KSxcbiAgICAgIG5ldyBUSFJFRS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ZpbmQodGhpcy5maW5kSW50ZXJzZWN0aW9uKGludGVyc2VjdGlvbikpKXtcbiAgICAgICAgaW50ZXJzZWN0aW9ucy5wdXNoKGludGVyc2VjdGlvbik7XG4gICAgICB9XG4gICAgfVxuICB9XG5cbiAgc3RhdGljIGZpbmRJbnRlcnNlY3Rpb24obXlpbnRlcnNlY3Rpb24pe1xuICAgIHJldHVybiBmdW5jdGlvbiBmb3VuZChlbGVtZW50LCBpbmRleCwgYXJyYXkpIHtcbiAgICAgIGlmKG15aW50ZXJzZWN0aW9uLnggPT09IGVsZW1lbnQueCAmJlxuICAgICAgICBteWludGVyc2VjdGlvbi55ID09PSBlbGVtZW50LnkgJiZcbiAgICAgICAgbXlpbnRlcnNlY3Rpb24ueiA9PT0gZWxlbWVudC56KXtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG4gIH1cblxuICBzdGF0aWMgaW5CQm94KHBvaW50LCBiYm94KSB7XG4gICAgLy9cbiAgICBsZXQgZXBzaWxvbiA9IDAuMDAwMTtcbiAgICBpZiAocG9pbnQgJiZcbiAgICAgICAgcG9pbnQueCA+PSBiYm94Lm1pbi54IC0gZXBzaWxvbiAmJiBwb2ludC55ID49IGJib3gubWluLnkgLSBlcHNpbG9uICYmIHBvaW50LnogPj0gYmJveC5taW4ueiAtIGVwc2lsb24gJiZcbiAgICAgICAgcG9pbnQueCA8PSBiYm94Lm1heC54ICsgZXBzaWxvbiAmJiBwb2ludC55IDw9IGJib3gubWF4LnkgKyBlcHNpbG9uICYmIHBvaW50LnogPD0gYmJveC5tYXgueiArIGVwc2lsb24pIHtcbiAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cbiAgICByZXR1cm4gZmFsc2U7XG4gIH1cblxuICBzdGF0aWMgcG9zZGlyKHBvc2l0aW9uLCBkaXJlY3Rpb24pe1xuICAgIHJldHVybiB7cG9zaXRpb24sIGRpcmVjdGlvbn07XG4gI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Y2NvcmRpbmcgdG8gY3VycmVudCBvcmllbnRhdGlvbi5cbiAgICpcbiAgICogQHByaXZhdGVcbiAgICovXG4gIF9wcmVwYXJlU2xpY2VQb3NpdGlvbihyUG9zaXRpb24sIGluZGV4KXtcbiAgICBsZXQgcG9zaXRpb24gPSBuZXcgVEhSRUUuVmVjdG9yMygwLCAwLCAwKTtcbiAgICBzd2l0Y2godGhpcy5fb3JpZW50YXRpb24pe1xuICAgICAgY2FzZSAwOlxuICAgICAgICBwb3NpdGlvbiA9IG5ldyBUSFJFRS5WZWN0b3IzKFxuICAgICAgICAgIE1hdGguZmxvb3IoclBvc2l0aW9uLngpLFxuICAgICAgICAgIE1hdGguZmxvb3IoclBvc2l0aW9uLnkpLFxuICAgICAgICAgIGluZGV4KTtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIDE6XG4gICAgICAgIHBvc2l0aW9uID0gbmV3IFRIUkVFLlZlY3RvcjMoXG4gICAgICAgICAgaW5kZXgsXG4gICAgICAgICAgTWF0aC5mbG9vcihyUG9zaXRpb24ueSksXG4gICAgICAgICAgTWF0aC5mbG9vcihyUG9zaXRpb24ueikpO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgMjpcbiAgICAgICAgcG9zaXRpb24gPSBuZXcgVEhSRUUuVmVjdG9yMyhcbiAgICAgICAgICBNYXRoLmZsb29yKHJQb3NpdGlvbi54KSxcbiAgICAgICAgICBpbmRleCxcbiAgICAgICAgICBNYXRoLmZsb29yKHJQb3NpdGlvbi56KSk7XG4gICAgICAgIGJyZWFrO1xuICAgICAgZGVmYXVsdDpcbiAgICAgICAgLy8gZG8gbm90aGluZyFcbiAgICAgICAgYnJlYWs7XG4gICAgfVxuICAgIHJldHVybiBwb3NpdGlvbjtcbiAgfVxuXG4gIC8qKlxuICAgKiBDb21wdXRlIHNsaWNlIGRpcmVjdGlvbiBkZXBlbmRpbmcgb24gb3JpZW50YXRpb24uXG4gICAqXG4gICAqIEBwYXJhbSB7bnVtY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N2Z1wiPiBcXFxuICAgICAgICAgICAgICAgICAgICAgIFxcXG4gICAgICAgICAgICAgICAgICAgICAgPHBhdGggZD1cIk03MCw3MCBcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEwzMCwzMCBcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEExMCwxMCAwIDEgMSAxMCwxMFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQTEwLDEwIDAgMSAxIDMwLDMwXCIgLz5cXFxuICAgICAgICAgICAgICAgICAgICAgIFxcXG4gICAgICAgICAgICAgICAgICAgICAgPC9zdmc+JyAgICAgICAgICAgICAgICAgICAgICAgIDtcbiAgICAgICAgICAgICAgICAgICAgICBcblxuICAgIHRoaXMuY3JlYXRlTWVzaCgpO1xuICB9XG5cbiAgdXBkYXRlVm94ZWwod29ybGRDb29yZGluYXRlcykge1xuICAgIC8vIHVwZGF0ZSB3b3JsZCBjb29yZGluYXRlc1xuICAgIHRoaXMuX3ZveGVsLndvcmxkQ29vcmRpbmF0ZXMgPSB3b3JsZENvb3JkaW5hdGVzO1xuXG4gICAgLy8gdXBkYXRlIGRhdGEgY29vcmRpbmF0ZXNcbiAgICB0aGlzLl92b3hlbC5kYXRhQ29vcmRpbmF0ZXMgPSAgTW9kZWxzU3RhY2sud29ybGRUb0RhdGEoXG4gICAgICAgICAgICAgICAgICB0aGlzLl9zdGFjayxcbiAgICAgICAgICAgICAgICAgIHRoaXMuX3ZveGVsLndvcmxkQ29vcmRpbmF0ZXMpO1xuXG4gICAgLy8gdXBkYXRlIHZhbHVlXG4gICAgbGV0IHZhbHVlID0gTW9kZWxzU3RhY2sudmFsdWUoXG4gICAgICB0aGlzLl9zdGFjayxcbiAgICAgIHRoaXMuX3ZveGVsLmRhdGFDb29yZGluYXRlcyk7XG5cbiAgICB0aGlzLl92b3hlbC52YWx1ZSA9IE1vZGVsc1N0YWNrLnZhbHVlUmVzY2FsZVNsb3BlSW50ZXJjZXB0KFxuIC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gKTtcbiAqICAgICB3aW5kb3cuY29uc29sZS5sb2cob2JqZWN0KTtcbiAqICAgfVxuICogKTtcbiAqL1xuZXhwb3J0IGRlZmF1bHQgY2xhc3MgTG9hZGVyc1ZvbHVtZXMgZXh0ZW5kcyBMb2FkZXJzQmFzZXtcblxuICBwYXJzZShyZXNwb25zZSkge1xuXG4gICAgLy8gZ2l2ZSBhIGNoYW5jZSB0byB0aGUgVUkgdG8gdXBkYXRlIGJlY2F1c2UgYWZ0ZXIgdGhlIHJlbmRlcmluZyB3aWxsIGJlIGJsb2NrZWQgd2l0aCBpbnRlbnNpdmUgSlNcbiAgICB0aGlzLl9wcm9ncmVzc0Jhci51cGRhdGUoMCwgMTAwLCAncGFyc2UnKTtcblxuICAgIHJldHVybiBuZXcgUHJvbWlzZShcbiAgICAgICAgKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuICAgICAgICAgICAgd2luZG93LnNldFRpbWVvdXQoXG4gICAgICAgICAgICAgICgpID0+IHtcbiAgICAgICAgICAgICAgICByZXNvbHZlKG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHtcblxuICAgICAgICAgICAgICAgICAgbGV0IGRhdGEgPSByZXNwb25zZTtcbiAgICAgICAgICAgICAgICAgIGRhdGEuZ3pjb21wcmVzc2VkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICBkYXRhLmZpbGVuYW1lID0gJyc7XG4gICAgICAgICAgICAgICAgICBkYXRhLmV4dGVuc2lvbiA9ICcnO1xuXG4gICAgICAgICAgICAgICAgICAvLyB1bmNvbXByZXNzP1xuICAgICAgICAgICAgICAgICAgZGF0YS5maWxlbmFtZSA9IHJlc3BvbnNlLnVybC5zcGxpdCgnLycpLnBvcCgpO1xuICAgICAgICAgICAgICAgICAgZGF0YS5nemNvbXByZXNzZWQgPSBmYWxzZTtcblxuICAgICAgICAgICAgICAgICAgLy8gZmluZCBleHRlbnNpb25cbiAgICAgICAgICAgICAgICAgIGxldCBzcGxpdHRlZE5hbWUgPSBkYXRhLmZpbGVuYW1lLnNwbGl0KCcuJyk7XG4gICAgICAgICAgICAgICAgICBpZihzcGxpdHRlZE5hbWUubGVuZ3RoIDw9IDEpe1xuICAgICAgICAgICAgICAgICAgICBkYXRhLmV4dGVuc2lvbiA9ICcnO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgZWxzZXtcbiAgICAgICAgICAgICAgICAgICAgZGF0YS5leHRlbnNpb24gPSBkYXRhLmZpbGVuYW1lLnNwbGl0KCcuJykucG9wKCk7XG4gICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgIC8vIHVuemlwIGlmIGV4dGVuc2lvbiBpcyAnLmd6J1xuICAgICAgICAgICAgICAgICAgaWYgKGRhdGEuZXh0ZW5zaW9uID09PSAnZ3onKSB7XG4gICAgICAgICAgICAgICAgICAgIGRhdGEuZ3pjb21wcmVzc2VkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgZGF0YS5leHRlbnNpb24gPSBkYXRhLmZpbGVuYW1lLnNwbGl0KCcuZ3onKS5zaGlmdCgpLnNwbGl0KCcuJykucG9wKCk7XG4gICAgICAgICAgICAgICAgICAgIGxldCBkZWNvbXByZXNzZWREYXRhID0gcGFrby5pbmZsYXRlKGRhdGEuYnVmZmVyKTtcbiAgICAgICAgICAgICAgICAgICAgZGF0YS5idWZmZXIgPSBkZWNvbXByZXNzZWREYXRhLmJ1ZmZlcjtcbiAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgbGV0IHBhcnNlciA9IHRoaXMuX3BhcnNlcihkYXRhLmV4dGVuc2lvbik7XG4gICAgICAgICAgICAgICAgICBpZiAoIXBhcnNlcikge1xuICAgICAgICAgICAgICAgICAgICByZWplY3QoZGF0YS5maWxlbmFtZSArICcgY2FuIG5vdCBiZSBwYXJzZWQuJyk7XG4gICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgIC8vIGNoZWNrIGV4dGVuc2lvblxuICAgICAgICAgICAgICAgICAgbGV0IHZvbHVtZVBhcnNlciA9IG51bGw7XG4gICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICB2b2x1bWVQYXJzZXIgPSBuZXcgcGFyc2VyKGRhdGEsIDApO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgd2luZG93LmNvbnNvbGUubG9nKGUpO1xuICAgICAgICAgICAgICAgICAgICByZWplY3QoZSk7XG4gICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgIC8vIGNyZWF0ZSBhIHNlcmllc1xuICAgICAgICAgICAgICAgICAgbGV0IHNlcmllcyA9IG5ldyBNb2RlbHNTZXJpZXMoKTtcbiAgICAgICAgICAgICAgICAgIHNlcmllcy5zZXJpZXNJbnN0YW5jZVVJRCA9IHZvbHVtZVBhcnNlci5zZXJpZXNJbnN0YW5jZVVJRCgpO1xuICAgICAgICAgICAgICAgICAgc2VyaWVzLm51bWJlck9mRnJhbWVzICAgID0gdm9sdW1lUGFyc2VyLm51bWJlck9mRnJhbWVzKCk7XG4gICAgICAgICAgICAgICAgICBpZiAoIXNlcmllcy5udW1iZXJPZkZyYW1lcykge1xuICAgICAgICAgICAgICAgICAgICBzZXJpZXMubnVtYmVyT2ZGcmFtZXMgPSAxO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgc2VyaWVzLm51bWJlck9mQ2hhbm5lbHMgID0gdm9sdW1lUGFyc2VyLm51bWJlck9mQ2hhbm5lbHMoKTtcbiAgICAgICAgICAgICAgICAgIHNlcmllcy5tb2RhbGl0eSAgICAgICAgICA9IHZvbHVtZVBhcnNlci5tb2RhbGl0eSgpO1xuICAgICAgICAgICAgICAgICAgLy8gaWYgaXQgaXMgYSBzZWdtZW50YXRpb24sIGF0dGFjaCBleHRyYSBpbmZvcm1hdGlvblxuICAgICAgICAgICAgICAgICAgaWYoc2VyaWVzLm1vZGFsaXR5ID09PSAnU0VHJyl7XG4gICAgICAgICAgICAgICAgICAgIC8vIGNvbG9yc1xuICAgICAgICAgICAgICAgICAgICAvLyBsYWJlbHNcbiAgICAgICAgICAgICAgICAgICAgLy8gZXRjLlxuICAgICAgICAgICAgICAgICAgICBzZXJpZXMuc2VnbWVudGF0aW9uVHlwZSAgICAgPSB2b2x1bWVQYXJzZXIuc2VnbWVudGF0aW9uVHlwZSgpO1xuICAgICAgICAgICAgICAgICAgICBzZXJpZXMuc2VnbWVudGF0aW9uU2VnbWVudHMgPSB2b2x1bWVQYXJzZXIuc2VnbWVudGF0aW9uU2VnbWVudHMoKTtcbiAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgLy8ganVzdCBjcmVhdGUgMSBkdW1teSBzdGFjayBmb3Igbm93XG4gICAgICAgICAgICAgICAgICBsZXQgc3RhY2sgPSBuZXcgTW9kZWxzU3RhY2soKTtcbiAgICAgICAgICAgICAgICAgIHN0YWNrLm51bWJlck9mQ2hhbm5lbHMgPSB2b2x1bWVQYXJzZXIubnVtYmVyT2ZDaGFubmVscygpO1xuICAgICAgICAgICAgICAgICAgc3RhY2sucGl4ZWxUeXBlICAgICAgICA9IHZvbHVtZVBhcnNlci5waXhlbFR5cGUoKTtcbiAgICAgICAgICAgICAgICAgIHN0YWNrLmludmVydCAgICAgICAgICAgPSB2b2x1bWVQYXJzZXIuaW52ZXJ0KCk7XG4gICAgICAgICAgICAgICAgICBzdGFjay5tb2RhbGl0eSAgICAgICAgID0gc2VyaWVzLm1vZGFsaXR5O1xuICAgICAgICAgICAgICAgICAgc3RhY2sucmlnaHRIYW5kZWQgICAgICAgPSB2b2x1bWVQYXJzZXIucmlnaHRIYW5kZWQoKTtcbiAgICAgICAgICAgICAgICAgIC8vIGlmIGl0IGlzIGEgc2VnbWVudGF0aW9uLCBhdHRhY2ggZXh0cmEgaW5mb3JtYXRpb25cbiAgICAgICAgICAgICAgICAgIGlmKHN0YWNrLm1vZGFsaXR5ID09PSAnU0VHJyl7XG4gICAgICAgICAgICAgICAgICAgIC8vIGNvbG9yc1xuICAgICAgICAgICAgICAgICAgICAvLyBsYWJlbHNcbiAgICAgICAgICAgICAgICAgICAgLy8gZXRjLlxuICAgICAgICAgICAgICAgICAgICBzdGFjay5zZWdtZW50YXRpb25UeXBlICAgICA9IHNlcmllcy5zZWdtZW50YXRpb25UeXBlO1xuICAgICAgICAgICAgICAgICAgICBzdGFjay5zZWdtZW50YXRpb25TZWdtZW50cyA9IHNlcmllcy5zZWdtZW50YXRpb25TZWdtZW50cztcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgIHNlcmllcy5zdGFjay5wdXNoKHN0YWNrKTtcbiAgICAgICAgICAgICAgICAgIC8vIHJlY3Vyc2l2ZSBjYWxsIGZvciBlYWNoIGZyYW1lXG4gICAgICAgICAgICAgICAgICAvLyBiZXR0ZXIgdGhhbiBmb3IgbG9vcCB0byBiZSBhYmxlIHRvIHVwZGF0ZSBkb20gd2l0aCBcInByb2dyZXNzXCIgY2FsbGJhY2tcbiAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQodGhpcy5wYXJzZUZyYW1lKHNlcmllcywgc3RhY2ssIHJlc3BvbnNlLnVybCwgMCwgdm9sdW1lUGFyc2VyLCByZXNvbHZlLCByZWplY3QpLCAwKTtcbiAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICAgfSwxMCk7XG4gICAgICAgICAgIH1cbiAgICAgICAgKTtcbiAgfVxuXG4gIHBhcnNlRnJhbWUoc2VyaWVzLCBzdGFjaywgdXJsLCBpLCBkYXRhUGFyc2VyLCByZXNvbHZlLCByZWplY3QpIHtcbiAgICBsZXQgZnJhbWUgPSBuZXcgTW9kZWxzRnJhbWUoKTtcbiAgICBmcmFtZS5zb3BJbnN0YW5jZVVJRCAgID0gZGF0YVBhcnNlci5zb3BJbnN0YW5jZVV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G4gICAgbGV0IGNlbnRlciA9IHRoaXMuX2hhbGZEaW1lbnNpb25zSUpLLmNsb25lKCkuYWRkU2NhbGFyKCAtMC41IClcbiAgICAgIC5hcHBseU1hdHJpeDQodGhpcy5faWprMkxQUyk7XG4gICAgcmV0dXJuIGNlbnRlcjtcblxuICB9XG5cbiAgd29ybGRCb3VuZGluZ0JveCgpIHtcblxuICAgIGxldCBiYm94ID0gW1xuICAgICAgTnVtYmVyLk1BWF9WQUxVRSwgTnVtYmVyLk1JTl9WQUxVRSxcbiAgICAgIE51bWJlci5NQVhfVkFMVUUsIE51bWJlci5NSU5fVkFMVUUsXG4gICAgICBOdW1iZXIuTUFYX1ZBTFVFLCBOdW1iZXIuTUlOX1ZBTFVFXG4gICAgXTtcblxuICAgIGZvciAoIGxldCBpID0gMDsgaSA8PSB0aGlzLl9kaW1lbnNpb25zSUpLLng7IGkgKz0gdGhpcy5fZGltZW5zaW9uc0lKSy54ICkge1xuICAgICAgZm9yICggbGV0IGogPSAwOyBqIDw9IHRoaXMuX2RpbWVuc2lvbnNJSksueTsgaiArPSB0aGlzLl9kaW1lbnNpb25zSUpLLnkgKSB7XG4gICAgICAgIGZvciAobGV0IGsgPSAwOyBrIDw9IHRoaXMuX2RpbWVuc2lvbnNJSksuejsgayArPSB0aGlzLl9kaW1lbnNpb25zSUpLLnogKSB7XG5cbiAgICAgICAgICBsZXQgd29ybGQgPSBuZXcgVEhSRUUuVmVjdG9yMyggaSwgaiwgayApLmFwcGx5TWF0cml4NCggdGhpcy5faWprMkxQUyApO1xuICAgICAgICAgIGJib3ggPSBbXG4gICAgICAgICAgICBNYXRoLm1pbihiYm94WzBdLCB3b3JsZC54KSwgTWF0aC5tYXgoYmJveFsxXSwgd29ybGQueCksIC8vIHggbWluL21heFxuICAgICAgICAgICAgTWF0aC5taW4oYmJveFsyXSwgd29ybGQueSksIE1hdGgubWF4KGJib3hbM10sIHdvcmxkLnkpLFxuICAgICAgICAgICAgTWF0aC5taW4oYmJveFs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0ZS56IDwgc3RhY2suX2ZyYW1lLmxlbmd0aCApIHtcblxuICAgICAgcmV0dXJuIHN0YWNrLl9mcmFtZVtpamtDb29yZGluYXRlLnpdLnZhbHVlKFxuICAgICAgICBpamtDb29yZGluYXRlLngsXG4gICAgICAgIGlqa0Nvb3JkaW5hdGUueSApO1xuXG4gICAgfSBlbHNlIHtcblxuICAgICAgcmV0dXJuIG51bGw7XG5cbiAgICB9XG5cbiAgfVxuXG4gIHN0YXRpYyB2YWx1ZVJlc2NhbGVTbG9wZUludGVyY2VwdCggdmFsdWUsIHNsb3BlLCBpbnRlcmNlcHQgKSB7XG5cbiAgICByZXR1cm4gdmFsdWUgKiBzbG9wZSArIGludGVyY2VwdDtcblxuICB9XG5cbiAgc3RhdGljIGluZGV4SW5EaW1lbnNpb25zKCBpbmRleCwgZGltZW5zaW9ucyApIHtcblxuICAgIGlmICggaW5kZXgueCA+PSAwICYmXG4gICAgICAgICBpbmRleC55ID49IDAgJiZcbiAgICAgICAgIGluZGV4LnogPj0gMCAmJlxuICAgICAgICAgaW5kZXgueCA8IGRpbWVuc2lvbnMueCAmJlxuICAgICAgICAgaW5kZXgueSA8IGRpbWVuc2lvbnMueSAmJlxuICAgICAgICAgaW5kZXgueiA8IGRpbWVuc2lvbnMueiApIHtcblxuICAgICAgcmV0dXJuIHRydWU7XG5cbiAgICB9XG5cbiAgICByZXR1cm4gZmFsc2U7XG5cbiAgfVxuXG4gIF92ZWN0b3IzRnJvbUFycmF5KGFycmF5LCBpbmRleCkge1xuICAgIHJldHVybiBuZXcgVEhSRUUuVmVjdG9yMyhcbiAgICAgIGFycmF5W2luZGV4XSxcbiAgICAgIGFycmF5W2luZGV4ICsgMV0sXG4gICAgICBhcnJheVtpbmRleCArIDJdXG4gICAgICApO1xuICB9XG5cbiAgX29yZGVyRnJhbWVPbkRpbWVuc2lvbkluZGljZXNBcnJheVNvcnQoYSwgYikge1xuXG4gICAgaWYgKCdkaW1lbnNpb25JbmRleFZhbHVlcycg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iAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDIgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAzOlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDMgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA0OlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDQgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA1OlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDUgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA2OlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDYgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA3OlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDcgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgYml0U3RhcnRPZmZzZXQrKztcbiAgICAgICAgICBpbmRleCsrO1xuICAgICAgICAgIC8vIGlmIHJldHVybi4uXG4gICAgICAgICAgaWYgKGluZGV4ID49IG51bVBpeGVscykge1xuICAgICAgICAgICAgcmV0dXJuIG5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naXRodWIuY29tL0tpdHdhcmUvSVRLL2Jsb2IvbWFzdGVyL01vZHVsZXMvSU8vTklGVEkvc3JjL2l0a05pZnRpSW1hZ2VJTy5jeHhcbiAgICAgIHZhciBhID0gMC4wLCBiID0gdGhpcy5fZGF0YVNldC5xdWF0ZXJuX2IsIGMgPSB0aGlzLl9kYXRhU2V0LnF1YXRlcm5fYywgZCA9IHRoaXMuX2RhdGFTZXQucXVhdGVybl9kO1xuICAgICAgLy8gY29tcHV0ZSBhXG4gICAgICBhID0gMS4wIC0gKGIqYiArIGMqYyArIGQqZCkgO1xuICAgICAgaWYoIGEgPCAwLjAwMDAwMDEgKXsgICAgICAgICAgICAgICAgICAgLyogc3BlY2lhbCBjYXNlICovXG5cbiAgICAgICAgYSA9IDEuMCAvIE1hdGguc3FydChiKmIrYypjK2QqZCkgO1xuICAgICAgICBiICo9IGEgOyBjICo9IGEgOyBkICo9IGEgOyAgICAgICAgLyogbm9ybWFsaXplIChiLGMsZCkgdmVjdG9yICovXG4gICAgICAgIGEgPSAwLjA7ICAgICAgICAgICAgICAgICAgICAgICAvKiBhID0gMCA9PT4gMTgwIGRlZ3JlZSByb3RhdGlvbiAqL1xuXG4gICAgICB9IGVsc2Uge1xuXG4gICAgICAgIGEgPSBNYXRoLnNxcnQoYSkgOyAgICAgICAgICAgICAgICAgICAgIC8qIGFuZ2xlID0gMiphcmNjb3MoYSkgKi9cblxuICAgICAgfVxuXG4gICAgICBpZih0aGlzLl9kYXRhU2V0LnBpeERpbXNbMF0gPCAwLjApIHtcblxuICAgICAgICB0aGlzLl9yaWdodEhhbmRlZCA9IGZhbHNlO1xuXG4gICAgICB9XG5cbiAgICAgICByZXR1cm4gW1xuICAgICAgICAgIC0oYSphK2IqYi1jKmMtZCpkKSxcbiAgICAgICAgICAtMiooYipjK2EqZCksXG4gICAgICAgICAgMiooYipkLWEqYyksXG4gICAgICAgICAgLTIqKGIqYy1hKmQpLFxuICAgICAgICAgIC0oYSphK2MqYy1iKmItZC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Y29uc29sZS5sb2coZXJyKTtcbiAgICAvLyB9XG5cbiAgICAvLyB3aW5kb3cuY29uc29sZS5sb2codGhpcyk7XG4gIH1cblxuICBfZGVjb21wcmVzc1VuY29tcHJlc3NlZChmcmFtZUluZGV4ID0gMCkge1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9VSU5UOCAgICAgICAgICAgPSAyO1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9JTlQxNiAgICAgICAgICAgPSA0O1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9JTlQzMiAgICAgICAgICAgPSA4O1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9GTE9BVDMyICAgICAgICA9IDE2O1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9DT01QTEVYNjQgICAgICA9IDMyO1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9GTE9BVDY0ICAgICAgICA9IDY0O1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9SR0IyNCAgICAgICAgID0gMTI4O1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9JTlQ4ICAgICAgICAgID0gMjU2O1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9VSU5UMTYgICAgICAgID0gNTEyO1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9VSU5UMzIgICAgICAgID0gNzY4O1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9JTlQ2NCAgICAgICAgPSAxMDI0O1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9VSU5UNjQgICAgICAgPSAxMjgwO1xuICAgIC8vIHBhcGF5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iAwLFxuICAgICAgICB0eXBlR0xTTDogJ2ludCdcbiAgICAgIH0sXG4gICAgICAndVRleHR1cmVMVVQnOntcbiAgICAgICAgdHlwZTogJ3QnLFxuICAgICAgICB2YWx1ZTogW10sXG4gICAgICAgIHR5cGVHTFNMOiAnc2FtcGxlcjJEJ1xuICAgICAgfSxcbiAgICAgICd1UGl4ZWxUeXBlJzoge1xuICAgICAgICB0eXBlOiAnaScsXG4gICAgICAgIHZhbHVlOiAwLFxuICAgICAgICB0eXBlR0xTTDogJ2ludCdcbiAgICAgIH0sXG4gICAgICAndVBhY2tlZFBlclBpeGVsJzoge1xuICAgICAgICB0eXBlOiAnaScsXG4gICAgICAgIHZhbHVlOiAxLFxuICAgICAgICB0eXBlR0xTTDogJ2ludCdcbiAgICAgIH0sXG4gICAgICAndUludGVycG9sYXRpb24nOiB7XG4gICAgICAgIHR5cGU6ICdpJyxcbiAgICAgICAgdmFsdWU6IDEsXG4gICAgICAgIHR5cGVHTFNMOiAnaW50J1xuICAgICAgfSxcbiAgICAgICd1V29ybGRCQm94Jzoge1xuICAgICAgICB0eXBlOiAnZnYxJyxcbiAgICAgICAgdmFsdWU6IFswLjAsIDAuMCwgMC4wLCAwLjAsIDAuMCwgMC4wXSxcbiAgICAgICAgdHlwZUdMU0w6ICdmbG9hdCcsXG4gICAgICAgIGxlbmd0aDogNlxuICAgICAgfSxcbiAgICAgICd1U3RlcHMnOiB7XG4gICAgICAgIHR5cGU6ICdpJyxcbiAgICAgICAgdmFsdWU6IDI1NixcbiAgICAgICAgdHlwZUdMU0w6ICdpbnQnXG4gICAgICB9LFxuICAgICAgJ3VBbHBoYUNvcnJlY3Rpb24nOntcbiAgICAgICAgdHlwZTogJ2YnLFxuICAgICAgICB2YWx1ZTogMC41LFxuICAgICAgICB0eXBlR0xTTDogJ2Zsb2F0J1xuICAgICAgfSxcbiAgICAgICd1RnJlcXVlbmNlJzp7XG4gICAgICAgIHR5cGU6ICdmJyxcbiAgICAgICAgdmFsdWU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yIChqID0gMDsgaiA8IGNvZGVMZW5ndGhzW2ldOyBqKyspIHtcbiAgICAgICAgcCA9IGNvZGUucG9wKCk7XG4gICAgICAgIHAuY2hpbGRyZW5bcC5pbmRleF0gPSB2YWx1ZXNba107XG4gICAgICAgIHdoaWxlIChwLmluZGV4ID4gMCkge1xuICAgICAgICAgIHAgPSBjb2RlLnBvcCgpO1xuICAgICAgICB9XG4gICAgICAgIHAuaW5kZXgrKztcbiAgICAgICAgY29kZS5wdXNoKHApO1xuICAgICAgICB3aGlsZSAoY29kZS5sZW5ndGggPD0gaSkge1xuICAgICAgICAgIGNvZGUucHVzaChxID0ge2NoaWxkcmVuOiBbXSwgaW5kZXg6IDB9KTtcbiAgICAgICAgICBwLmNoaWxkcmVuW3AuaW5kZXhdID0gcS5jaGlsZHJlbjtcbiAgICAgICAgICBwID0gcTtcbiAgICAgICAgfVxuICAgICAgICBrKys7XG4gICAgICB9XG4gICAgICBpZiAoaSArIDEgPCBsZW5ndGgpIHtcbiAgICAgICAgLy8gcCBoZXJlIHBvaW50cyB0byBsYXN0IGNvZGVcbiAgICAgICAgY29kZS5wdXNoKHEgPSB7Y2hpbGRyZW46IFtdLCBpbmRleDogMH0pO1xuICAgICAgICBwLmNoaWxkcmVuW3AuaW5kZXhdID0gcS5jaGlsZHJlbjtcbiAgICAgICAgcCA9IHE7XG4gICAgICB9XG4gICAgfVxuICAgIHJldHVybiBjb2RlWzBdLmNoaWxkcmVuO1xuICB9XG5cbiAgZnVuY3Rpb24gZ2V0QmxvY2tCdWZmZXJPZmZzZXQoY29tcG9uZW50LCByb3csIGNvbCkge1xuICAgIHJldHVybiA2NCAqICgoY29tcG9uZW50LmJsb2Nrc1BlckxpbmUgKyAxKSAqIHJvdyArIGNvbCk7XG4gIH1cblxuICBmdW5jdGlvbiBkZWNvZGVTY2FuKGRhdGEsIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgICBmcmFtZSwgY29tcG9uZW50cywgcmVzZXRJbnRlcnZhb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A3O1xuICAgICAgcmV0dXJuIGJpdHNEYXRhID4+PiA3O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGRlY29kZUh1ZmZtYW4odHJlZSkge1xuICAgICAgdmFyIG5vZGUgPSB0cmVlO1xuICAgICAgdmFyIGJpdDtcbiAgICAgIHdoaWxlICgoYml0ID0gcmVhZEJpdCgpKSAhPT0gbnVsbCkge1xuICAgICAgICBub2RlID0gbm9kZVtiaXRdO1xuICAgICAgICBpZiAodHlwZW9mIG5vZGUgPT09ICdudW1iZXInKVxuICAgICAgICAgIHJldHVybiBub2RlO1xuICAgICAgICBpZiAodHlwZW9mIG5vZGUgIT09ICdvYmplY3QnKVxuICAgICAgICAgIHRocm93IFwiaW52YWxpZCBodWZmbWFuIHNlcXVlbmNlXCI7XG4gICAgICB9XG4gICAgICByZXR1cm4gbnVsbDtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiByZWNlaXZlKGxlbmd0aCkge1xuICAgICAgdmFyIG4gPSAwO1xuICAgICAgd2hpbGUgKGxlbmd0aCA+IDApIHtcbiAgICAgICAgdmFyIGJpdCA9IHJlYWRCaXQoKTtcbiAgICAgICAgaWYgKGJpdCA9PT0gbnVsbClcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIG4gPSAobiA8PCAxKSB8IGJpdDtcbiAgICAgICAgbGVuZ3RoLS07XG4gICAgICB9XG4gICAgICByZXR1cm4gbjtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiByZWNlaXZlQW5kRXh0ZW5kKGxlbmd0aCkge1xuICAgICAgdmFyIG4gPSByZWNlaXZlKGxlbmd0aCk7XG4gICAgICBpZiAobiA+PSAxIDw8IChsZW5ndGggLSAxKSlcbiAgICAgICAgcmV0dXJuIG47XG4gICAgICByZXR1cm4gbiArICgtMSA8PCBsZW5ndGgpICsgMTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBkZWNvZGVCYXNlbGluZShjb21wb25lbnQsIG9mZnNldCkge1xuICAgICAgdmFyIHQg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vbXBvbmVudCwgb2Zmc2V0KSB7XG4gICAgICB2YXIgayA9IHNwZWN0cmFsU3RhcnQsIGUgPSBzcGVjdHJhbEVuZCwgciA9IDA7XG4gICAgICB3aGlsZSAoayA8PSBlKSB7XG4gICAgICAgIHZhciB6ID0gZGN0WmlnWmFnW2tdO1xuICAgICAgICBzd2l0Y2ggKHN1Y2Nlc3NpdmVBQ1N0YXRlKSB7XG4gICAgICAgICAgY2FzZSAwOiAvLyBpbml0aWFsIHN0YXRlXG4gICAgICAgICAgICB2YXIgcnMgPSBkZWNvZGVIdWZmbWFuKGNvbXBvbmVudC5odWZmbWFuVGFibGVBQyk7XG4gICAgICAgICAgICB2YXIgcyA9IHJzICYgMTU7XG4gICAgICAgICAgICByID0gcnMgPj4gNDtcbiAgICAgICAgICAgIGlmIChzID09PSAwKSB7XG4gICAgICAgICAgICAgIGlmIChyIDwgMTUpIHtcbiAgICAgICAgICAgICAgICBlb2JydW4gPSByZWNlaXZlKHIpICsgKDEgPDwgcik7XG4gICAgICAgICAgICAgICAgc3VjY2Vzc2l2ZUFDU3RhdGUgPSA0O1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHIgPSAxNjtcbiAgICAgICAgICAgICAgICBzdWNjZXNzaXZlQUNTdGF0ZSA9IDE7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGlmIChzICE9PSAxKVxuICAgICAgICAgICAgICAgIHRocm93IFwiaW52YWxpZCBBQ24gZW5jb2RpbmdcIjtcbiAgICAgICAgICAgICAgc3VjY2Vzc2l2ZUFDTmV4dFZhbHVlID0gcmVjZWl2ZUFuZEV4dGVuZChzKTtcbiAgICAgICAgICAgICAgc3VjY2Vzc2l2ZUFDU3RhdGUgPSByID8gMiA6IDM7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICBjYXNlIDE6IC8vIHNraXBwaW5nIHIgem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9uZW50c0xlbmd0aDsgaSsrKSB7XG4gICAgICAgIGNvbXBvbmVudHNbaV0ucHJlZCA9IDA7XG4gICAgICB9XG4gICAgICBlb2JydW4gPSAwO1xuXG4gICAgICBpZiAoY29tcG9uZW50c0xlbmd0aCA9PSAxKSB7XG4gICAgICAgIGNvbXBvbmVudCA9IGNvbXBvbmVudHNbMF07XG4gICAgICAgIGZvciAobiA9IDA7IG4gPCByZXNldEludGVydmFsOyBuKyspIHtcbiAgICAgICAgICBkZWNvZGVCbG9jayhjb21wb25lbnQsIGRlY29kZUZuLCBtY3UpO1xuICAgICAgICAgIG1jdSsrO1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBmb3IgKG4gPSAwOyBuIDwgcmVzZXRJbnRlcnZhbDsgbisrKSB7XG4gICAgICAgICAgZm9yIChpID0gMDsgaSA8IGNvbXBvbmVudHNMZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgY29tcG9uZW50ID0gY29tcG9uZW50c1tpXTtcbiAgICAgICAgICAgIGggPSBjb21wb25lbnQuaDtcbiAgICAgICAgICAgIHYgPSBjb21wb25lbnQudjtcbiAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCB2OyBqKyspIHtcbiAgICAgICAgICAgICAgZm9yIChrID0gMDsgayA8IGg7IGsrKykge1xuICAgICAgICAgICAgICAgIGRlY29kZU1jdShjb21wb25lbnQsIGRlY29kZUZuLCBtY3UsIGosIGspO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIG1jdSsrO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIC8vIGZpbmQgbWFya2VyXG4gICAgICBiaXRzQ291bnQgPSAwO1xuICAgICAgbWFya2VyID0gKGRhdGFbb2Zmc2V0XSA8PCA4KSB8IGRhdGFbb2Zmc2V0ICsgMV07XG4gICAgICBpZiAobWFya2VyIDw9IDB4RkYwMCkge1xuICAgICAgICB0aHJvdyBcIm1h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biAgICBmb3IgKGkgPSAwOyBpIDwgODsgKytpKSB7XG4gICAgICB2YXIgcm93ID0gOCAqIGk7XG5cbiAgICAgIC8vIGNoZWNrIGZvciBhbGwtemVybyBBQyBjb2VmZmljaWVudHNcbiAgICAgIGlmIChwWzEgKyByb3ddID09PSAwICYmIHBbMiArIHJvd10gPT09IDAgJiYgcFszICsgcm93XSA9PT0gMCAmJlxuICAgICAgICBwWzQgKyByb3ddID09PSAwICYmIHBbNSArIHJvd10gPT09IDAgJiYgcFs2ICsgcm93XSA9PT0gMCAmJlxuICAgICAgICBwWzcgKyByb3ddID09PSAwKSB7XG4gICAgICAgIHQgPSAoZGN0U3FydDIgKiBwWzAgKyByb3ddICsgNTEyKSA+PiAxMDtcbiAgICAgICAgcFswICsgcm93XSA9IHQ7XG4gICAgICAgIHBbMSArIHJvd10gPSB0O1xuICAgICAgICBwWzIgKyByb3ddID0gdDtcbiAgICAgICAgcFszICsgcm93XSA9IHQ7XG4gICAgICAgIHBbNCArIHJvd10gPSB0O1xuICAgICAgICBwWzUgKyByb3ddID0gdDtcbiAgICAgICAgcFs2ICsgcm93XSA9IHQ7XG4gICAgICAgIHBbNyArIHJvd10gPSB0O1xuICAgICAgICBjb250aW51ZTtcbiAgICAgIH1cblxuICAgICAgLy8gc3RhZ2UgNFxuICAgICAgdjAgPSAoZGN0U3FydDIgKiBwWzAgKyByb3ddICsgMTI4KSA+PiA4O1xuICAgICAgdjEgPSAoZGN0U3FydDIgKiBwWzQgKyByb3ddICsgMTI4KSA+PiA4O1xuICAgICAgdjIgPSBwWzIgKyByb3ddO1xuICAgICAgdjMgPSBwWzYgKyByb3ddO1xuICAgICAgdjQgPSAoZGN0U3FydDFkMiAqIChwWzEgKyByb3ddIC0gcFs3ICsgcm93XSkgKyAxMjgpID4+IDg7XG4gICAgICB2NyA9IChkY3RTcXJ0MWQyICogKHBbMSArIHJvd10gKyBwWzcgKyByb3ddKSArIDEyOCkgPj4gODtcbiAgICAgIHY1ID0gcFsz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4gMTI7XG4gICAgICB2NiA9IHQ7XG5cbiAgICAgIC8vIHN0YWdlIDFcbiAgICAgIHBbMCArIHJvd10gPSB2MCArIHY3O1xuICAgICAgcFs3ICsgcm93XSA9IHYwIC0gdjc7XG4gICAgICBwWzEgKyByb3ddID0gdjEgKyB2NjtcbiAgICAgIHBbNiArIHJvd10gPSB2MSAtIHY2O1xuICAgICAgcFsyICsgcm93XSA9IHYyICsgdjU7XG4gICAgICBwWzUgKyByb3ddID0gdjIgLSB2NTtcbiAgICAgIHBbMyArIHJvd10gPSB2MyArIHY0O1xuICAgICAgcFs0ICsgcm93XSA9IHYzIC0gdjQ7XG4gICAgfVxuXG4gICAgLy8gaW52ZXJzZSBEQ1Qgb24gY29sdW1uc1xuICAgIGZvciAoaSA9IDA7IGkgPCA4OyArK2kpIHtcbiAgICAgIHZhciBjb2wgPSBpO1xuXG4gICAgICAvLyBjaGVjayBmb3IgYWxsLXplcm8gQUMgY29lZmZpY2llbnRzXG4gICAgICBpZiAocFsxICogOCArIGNvbF0gPT09IDAgJiYgcFsyICogOCArIGNvbF0gPT09IDAgJiYgcFszICogOCArIGNvbF0gPT09IDAgJiZcbiAgICAgICAgcFs0ICogOCArIGNvbF0gPT09IDAgJiYgcFs1ICogOCArIGNvbF0gPT09IDAgJiYgcFs2ICogOCArIGNvbF0gPT09IDAgJiZcbiAgICAgICAgcFs3ICogOCArIGNvbF0gPT09IDApIHtcbiAgICAgICAgdCA9IChkY3RTcXJ0MiAqIHBbaSArIDBdICsgODE5MikgPj4gMTQ7XG4gICAgICAgIHBbMCAqIDggKyBjb2xdID0gdDtcbiAgICAgICAgcFsxICogOCArIGNvbF0gPSB0O1xuICAgICAgICBwWzIgKiA4ICsgY29sXSA9IHQ7XG4gICAgICAgIHBbMyAqIDggKyBjb2xdID0gdDtcbiAgICAgICAgcFs0ICogOCArIGNvbF0gPSB0O1xuICAgICAgICBwWzUgKiA4ICsgY29sXSA9IHQ7XG4gICAgICAgIHBbNiAqIDggKy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xuICAgICAgICAgIGNhc2UgMHhGRkVBOiAvLyBBUFAxMFxuICAgICAgICAgIGNhc2UgMHhGRkVCOiAvLyBBUFAxMVxuICAgICAgICAgIGNhc2UgMHhGRkVDOiAvLyBBUFAxMlxuICAgICAgICAgIGNhc2UgMHhGRkVEOiAvLyBBUFAxM1xuICAgICAgICAgIGNhc2UgMHhGRkVFOiAvLyBBUFAxNFxuICAgICAgICAgIGNhc2UgMHhGRkVGOiAvLyBBUFAxNVxuICAgICAgICAgIGNhc2UgMHhGRkZFOiAvLyBDT00gKENvbW1lbnQpXG4gICAgICAgICAgICB2YXIgYXBwRGF0YSA9IHJlYWREYXRhQmxvY2soKTtcblxuICAgICAgICAgICAgaWYgKGZpbGVNYXJrZXIgPT09IDB4RkZFMCkge1xuICAgICAgICAgICAgICBpZiAoYXBwRGF0YVswXSA9PT0gMHg0QSAmJiBhcHBEYXRhWzFdID09PSAweDQ2ICYmIGFwcERhdGFbMl0gPT09IDB4NDkgJiZcbiAgICAgICAgICAgICAgICBhcHBEYXRhWzNdID09PSAweDQ2ICYmIGFwcERhdGFbNF0gPT09IDApIHsgLy8gJ0pGSUZcXHgwMCdcbiAgICAgICAgICAgICAgICBqZmlmID0ge1xuICAgICAgICAgICAgICAgICAgdmVyc2lvbjoge21ham9yOiBhcHBEYXRhWzVdLCBtaW5vcjogYXBwRGF0YVs2XX0sXG4gICAgICAgICAgICAgICAgICBkZW5zaXR5VW5pdHM6IGFwcERhdGFbN10sXG4gICAgICAgICAgICAgICAgICB4RGVuc2l0eTogKGFwcERhdGFbOF0gPDwgOCkgfCBhcHBEYXRhWzldLFxuICAgICAgICAgICAgICAgICAgeURlbnNpdHk6IChhcHBEYXRhWzEwXSA8PCA4KSB8IGFwcERhdGFbMTFdLFxuICAgICAgICAgICAgICAgICAgdGh1bWJXaWR0aDogYXBwRGF0YVsxMl0sXG4gICAgICAgICAgICAgICAgICB0aHVtYkhlaWdodDogYXBwRGF0YVsxM10sXG4gICAgICAgICAgICAgICAgICB0aHVtYkRhdGE6IGFwcERhdGEuc3ViYXJyYXkoMTQsIDE0ICsgMyAqIGFwcERhdGFbMTJdICogYXBwRGF0YVsxM10pXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gVE9ETyBBUFAxIC0gRXhpZlxuICAgICAgICAgICAgaWYgKGZpbGVNYXJrZXIgPT09IDB4RkZFRSkge1xuICAgICAgICAgICAgICBpZiAoYXBwRGF0YVswXSA9PT0gMHg0MSAmJiBhcHBEYXRhWzFdID09PSAweDY0ICYmIGFwcERhdGFbMl0gPT09IDB4NkYgJiZcbiAgICAgICAgICAgICAgICBhcHBEYXRhWzNdID09PSAweDYyICYmIGFwcERhdGFbNF0gPT09IDB4NjUgJiYgYXBwRGF0YVs1XSA9PT0gMCkgeyAvLyAnQWRvYmVcXHgwMCdcbiAgICAgICAgICAgICAgICBhZG9iZSA9IHtcbiAgICAgICAgICAgICAgICAgIHZlcnNpb246IGFwcERhdGFbNl0sXG4gICAgICAgICAgICAgICAgICBmbGFnczA6IChhcHBEYXRhWzddIDw8IDgpIHwgYXBwRGF0YVs4XSxcbiAgICAgICAgICAgICAgICAgIGZsYWdzMTogKGFwcERhdGFbOV0gPDwgOCkgfCBhcHBEYXRhWzEwXSxcbiAgICAgICAgICAgICAgICAgIHRyYW5zZm9ybUNvZGU6IGFwcERhdGFbMTFdXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIDB4RkZEQjogLy8gRFFUIChEZWZpbmUgUXVhbnRpemF0aW9uIFRhYmxlcylcbiAgICAgICAgICAgIHZhciBxdWFudGl6YXRpb25UYWJsZXNMZW5ndGggPSByZWFkVWludDE2KCk7XG4gICAgICAgICAgICB2YXIgcXVhbnRpemF0aW9uVGFibGVzRW5kID0gcXVhbnRpemF0aW9uVGFibGVzTGVuZ3RoICsgb2Zmc2V0IC0gMjtcbiAgICAgICAgICAgIHdoaWxlIChvZmZzZXQgPCBxdWFudGl6YXRpb25UYWJsZXNFbmQpIHtcbiAgICAgICAgICAgICAgdmFyIHF1YW50aXphdGlvblRhYmxlU3BlYyA9IGRhdGFbb2Zmc2V0KytdO1xuICAgICAgICAgICAgICB2YXIgdGFibGVEYXRhID0gbmV3IEludDMyQXJyYXkoNjQpO1xuICAgICAgICAgICAgICBpZiAoKHF1YW50aXphdGlvblRhYmxlU3BlYyA+PiA0KSA9PT0gMCkgeyAvLyA4IGJpdCB2YWx1ZXNcbiAgICAgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgNjQ7IGorKykge1xuICAgICAgICAgICAgICAgICAgdmFyIHogPSBkY3RaaWdaYWdbal07XG4gICAgICAgICAgICAgICAgICB0YWJsZURhdGFbel0gPSBkYXRhW29mZnNldCsrXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHF1YW50aXphdGlvblRhYmxlU3BlYyA+PiA0KSA9PT0gMSkgeyAvLzE2IGJpdFxuICAgICAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCA2NDsgaisrKSB7XG4gICAgICAgICAgICAgICAgICB2YXIgenogPSBkY3RaaWdaYWdbal07XG4gICAgICAgICAgICAgICAgICB0YWJsZURhdGFbenpdID0gcmVhZFVpbnQxNigpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSBlbHNlXG4gICAgICAgICAgICAgICAgdGhyb3cgXCJEUVQ6IGludmFsaWQgdGFibGUgc3BlY1wiO1xuICAgICAgICAgICAgICBxdWFudGl6YXRpb25UYWJsZXNbcXVhbnRpemF0aW9uVGFibGVTcGVjICYgMTVdID0gdGFibGVEYXRhO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIDB4RkZDMDogLy8gU09GMCAoU3RhcnQgb2YgRnJhbWUsIEJhc2VsaW5lIERDVClcbiAgICAgICAgICBjYXNlIDB4RkZDMTogLy8gU09GMSAoU3RhcnQgb2YgRnJhbWUsIEV4dGVuZGVkIERDVClcbiAgICAgICAgICBjYXNlIDB4RkZDMjogLy8gU09GMiAoU3RhcnQgb2YgRnJhbWUsIFByb2dyZXNzaXZlIERDVClcbiAgICAgICAgICAgIGlmIChmcmFtZSkge1xuICAgICAgICAgICAgICB0aHJvdyBcIk9ubHkgc2luZ2xlIGZyYW1lIEpQRUdzIHN1cHBvcnRlZFwiO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVhZFVpbnQxNigpOyAvLyBza2lwIGRhdGEgbGVuZ3RoXG4gICAgICAgICAgICBmcmFtZSA9IHt9O1xuICAgICAgICAgICAgZnJhbWUuZXh0ZW5kZWQgPSAoZmlsZU1hcmtlciA9PT0gMHhGRkMxKTtcbiAgICAgICAgICAgIGZyYW1lLnByb2dyZXNzaXZlID0gKGZpbGVNYXJrZXIgPT09IDB4RkZDMik7XG4gICAgICAgICAgICBmcmFtZS5wcmVjaXNpb24gPSBkYXRhW29mZnNldCsrXTtcbiAgICAgICAgICAgIGZyYW1lLnNjYW5MaW5lcyA9IHJlYWRVaW50MTYoKTtcbiAgICAgICAgICAgIGZyYW1lLnNhbXBsZXNQZXJMaW5lID0gcmVhZFVpbnQxNigpO1xuICAgICAgICAgICAgZnJhbWUuY29tcG9uZW50cyA9IFtdO1xuICAgICAgICAgICAgZnJhbWUuY29tcG9uZW50SWRzID0ge307XG4gICAgICAgICAgICB2YXIgY29tcG9uZW50c0NvdW50ID0gZGF0YVtvZmZzZXQrK10sIGNvbXBvbmVudElkO1xuICAgICAgICAgICAgdmFyIG1heEggPSAwLCBtYXhWID0gMDtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBjb21wb25lbnRzQ291bnQ7IGkrKykge1xuICAgICAgICAgICAgICBjb21wb25lbnRJZCA9IGRhdGFbb2Zmc2V0XTtcbiAgICAgICAgICAgICAgdmFyIGggPSBkYXRhW29mZnNldCArIDFdID4+IDQ7XG4gICAgICAgICAgICAgIHZhciB2ID0gZGF0YVtvZmZzZXQgKyAxXSAmIDE1O1xuICAgICAgICAgICAgICBpZiAobWF4SCA8IGgpXG4gICAgICAgICAgICAgICAgbWF4SCA9IGg7XG4gICAgICAgICAgICAgIGlmIChtYXhWIDwgdilcbiAgICAgICAgICAgICAgICBtYXhWID0gdjtcbiAgICAgICAgICAgICAgdmFyIHFJZCA9IGRhdGFbb2Zmc2V0ICsgMl07XG4gICAgICAgICAgICAgIGwgPSBmcmFtZS5jb21wb25lbnRzLnB1c2goe1xuICAgICAgICAgICAgICAgIGg6IGgsXG4gICAgICAgICAgICAgICAgdjogdixcbiAgICAgICAgICAgICAgICBxdWFudGl6YXRpb25UYWJsZTogcXVhbnRpemF0aW9uVGFibGVzW3FJZF0sXG4gICAgICAgICAgICAgICAgcXVhbnRpemF0aW9uVGFibGVJZDogcUlkLFxuICAgICAgICAgICAgICAgIGJpdENvbnZlcnNpb246IDI1NSAvICgoMSA8PCBmcmFtZS5wcmVjaXNpb24pIC0gMSlcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIGZyYW1lLmNvbXBvbmVudElkc1tjb21wb25lbnRJZF0gPSBsIC0gMTtcbiAgICAgICAgICAgICAgb2Zmc2V0ICs9IDM7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmcmFtZS5tYXhIID0gbWF4SDtcbiAgICAgICAgICAgIGZyYW1lLm1heFYgPSBtYXhWO1xuICAgICAgICAgICAgcHJlcGFyZUNvbXBvbmVudHMoZnJhbWUpO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIDB4RkZDNDogLy8gREhUIChEZWZpbmUgSHVmZm1hbiBUYWJsZXMpXG4gICAgICAgICAgICB2YXIgaHVmZm1hbkxlbmd0aCA9IHJlYWRVaW50MTYoKTtcbiAgICAgICAgICAgIGZvciAoaSA9IDI7IGkgPCBodWZmbWFuTGVuZ3RoOyApIHtcbiAgICAgICAgICAgICAgdmFyIGh1ZmZtYW5UYWJsZVNwZWMgPSBkYXRhW29mZnNldCsrXTtcbiAgICAgICAgICAgICAgdmFyIGNvZGVMZW5ndGhzID0gbmV3IFVpbnQ4QXJyYXkoMTYpO1xuICAgICAgICAgICAgICB2YXIgY29kZUxlbmd0aFN1bSA9IDA7XG4gICAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCAxNjsgaisrLCBvZmZzZXQrKylcbiAgICAgICAgICAgICAgICBjb2RlTGVuZ3RoU3VtICs9IChjb2RlTGVuZ3Roc1tqXSA9IGRhdGFbb2Zmc2V0XSk7XG4gICAgICAgICAgICAgIHZhciBodWZmbWFuVmFsdWVzID0gbmV3IFVpbnQ4QXJyYXkoY29kZUxlbmd0aFN1bSk7XG4gICAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBjb2RlTGVuZ3RoU3VtOyBqKyssIG9mZnNldCsrKVxuICAgICAgICAgICAgICAgIGh1ZmZtYW5WYWx1ZXNbal0gPSBkYXRhW29mZnNldF07XG4gICAgICAgICAgICAgIGkgKz0gMTcgKyBjb2RlTGVuZ3RoU3VtO1xuXG4gICAgICAgICAgICAgICgoaHVmZm1hblRhYmxlU3BlYyA+PiA0KSA9PT0gMCA/XG4gICAgICAgICAgICAgICAgaHVmZm1hblRhYmxlc0RDIDogaHVmZm1hblRhYmxlc0FDKVtodWZmbWFuVGFibGVTcGVjICYgMTVdID1cbiAgICAgICAgICAgICAgICBidWlsZEh1ZmZtYW5UYWJsZShjb2RlTGVuZ3RocywgaHVmZm1hblZhbHVlcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgMHhGRkREOiAvLyBEUkkgKERlZmluZSBSZXN0YXJ0IEludGVydmFsKVxuICAgICAgICAgICAgcmVhZFVpbnQxNigpOyAvLyBza2lwIGRhdGEgbGVuZ3RoXG4gICAgICAgICAgICByZXNldEludGVydmFsID0gcmVhZFVpbnQxNigpO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIDB4RkZEQTogLy8gU09TIChTdGFydCBvZiBTY2FuKVxuICAgICAgICAgICAgdmFyIHNjYW5MZW5ndGggPSByZWFkVWludDE2KCk7XG4gICAgICAgICAgICB2YXIgc2VsZWN0b3JzQ291bnQgPSBkYXRhW29mZnNldCsrXTtcbiAgICAgICAgICAgIHZhciBjb21wb25lbnRzID0gW10sIGNvbXBvbmVudDtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBzZWxlY3RvcnNDb3VudDsgaSsrKSB7XG4gICAgICAgICAgICAgIHZhciBjb21wb25lbnRJbmRleCA9IGZyYW1lLmNvbXBvbmVudElkc1tkYXRhW29mZnNldCsrXV07XG4gICAgICAgICAgICAgIGNvbXBvbmVudCA9IGZyYW1lLmNvbXBvbmVudHNbY29tcG9uZW50SW5kZXhdO1xuICAgICAgICAgICAgICB2YXIgdGFibGVTcGVjID0gZGF0YVtvZmZzZXQrK107XG4gICAgICAgICAgICAgIGNvbXBvbmVudC5odWZmbWFuVGFibGVEQyA9IGh1ZmZtYW5UYWJsZXNEQ1t0YWJsZVNwZWMgPj4gNF07XG4gICAgICAgICAgICAgIGNvbXBvbmVudC5odWZmbWFuVGFibGVBQyA9IGh1ZmZtYW5UYWJsZXNBQ1t0YWJsZVNwZWMgJiAxNV07XG4gICAgICAgICAgICAgIGNvbXBvbmVudHMucHVzaChjb21wb25lbnQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIHNwZWN0cmFsU3RhcnQgPSBkYXRhW29mZnNldCsrXTtcbiAgICAgICAgICAgIHZhciBzcGVjdHJhbEVuZCA9IGRhdGFbb2Zmc2V0KytdO1xuICAgICAgICAgICAgdmFyIHN1Y2Nlc3NpdmVBcHByb3hpbWF0aW9uID0gZGF0YVtvZmZzZXQrK107XG4gICAgICAgICAgICB2YXIgcHJvY2Vzc2VkID0gZGVjb2RlU2NhbihkYXRhLCBvZmZzZXQsXG4gICAgICAgICAgICAgIGZyYW1lLCBjb21wb25lbnRzLCByZXNldEludGVydmFsLFxuICAgICAgICAgICAgICBzcGVjdHJhbFN0YXJ0LCBzcGVjdHJhbEVuZCxcbiAgICAgICAgICAgICAgc3VjY2Vzc2l2ZUFwcHJveGltYXRpb24gPj4gNCwgc3VjY2Vzc2l2ZUFwcHJveGltYXRpb24gJiAxNSk7XG4gICAgICAgICAgICBvZmZzZXQgKz0gcHJvY2Vzc2VkO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIGlmIChkYXRhW29mZnNldCAtIDNdID09IDB4RkYgJiZcbiAgICAgICAgICAgICAgZGF0YVtvZmZzZXQgLSAyXSA+PSAweEMwICYmIGRhdGFbb2Zmc2V0IC0gMl0gPD0gMHhGRSkge1xuICAgICAgICAgICAgICAvLyBjb3VsZCBiZSBpbmNvcnJlY3QgZW5jb2RpbmcgLS0gbGFzdCAweEZGIGJ5dGUgb2YgdGhlIHByZXZpb3VzXG4gICAgICAgICAgICAgIC8vIGJsb2NrIHdhcyBlYXRlbiBieSB0aGUgZW5jb2RlclxuICAgICAgICAgICAgICBvZmZzZXQgLT0gMztcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aHJvdyBcInVua25vd24gSlBFRyBtYXJrZXIgXCIgKyBmaWxlTWFya2VyLnRvU3RyaW5nKDE2KTtcbiAgICAgICAgfVxuICAgICAgICBmaWxlTWFya2VyID0gcmVhZFVpbnQxNigpO1xuICAgICAgfVxuXG4gICAgICB0aGlzLndpZHRoID0gZnJhbWUuc2FtcGxlc1BlckxpbmU7XG4gICAgICB0aGlzLmhlaWdodCA9IGZyYW1lLnNjYW5MaW5lcztcbiAgICAgIHRoaXMuamZpZiA9IGpmaWY7XG4gICAgICB0aGlzLmFkb2JlID0gYWRvYmU7XG4gICAgICB0aGlzLmNvbXBvbmVudHMgPSBbXTtcbiAgICAgIHN3aXRjaCAoZnJhbWUuY29tcG9uZW50cy5sZW5ndGgpXG4gICAgICB7XG4gICAgICAgIGNhc2UgMTpcbiAgICAgICAgICB0aGlzLmNvbG9yc3BhY2UgPSBDb2xvclNwYWNlLkdyYXlzY2FsZTtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAzOlxuICAgICAgICAgIGlmICh0aGlzLmFkb2JlKVxuICAgICAgICAgICAgdGhpcy5jb2xvcnNwYWNlID0gQ29sb3JTcGFjZS5BZG9iZVJHQjtcbiAgICAgICAgICBlbHNlXG4gICAgICAgICAgICB0aGlzLmNvbG9yc3BhY2UgPSBDb2xvclNwYWNlLlJHQjtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSA0OlxuICAgICAgICAgIHRoaXMuY29sb3JzcGFjZSA9IENvbG9yU3BhY2UuQ1lNSztcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICB0aGlzLmNvbG9yc3BhY2UgPSBDb2xvclNwYWNlLlVua25vd247XG4gICAgICB9XG4gICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGZyYW1lLmNvbXBvbmVudHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgdmFyIGNvbXBvbmVudCA9IGZyYW1lLmNvbXBvbmVudHNbaV07XG4gICAgICAgIGlmICghY29tcG9uZW50LnF1YW50aXphdGlvblRhYmxlICYmIGNvbXBvbmVudC5xdWFudGl6YXRpb25UYWJsZUlkICE9PSBudWxsKVxuICAgICAgICAgIGNvbXBvbmVudC5xdWFudGl6YXRpb25UYWJsZSA9IHF1YW50aXphdGlvblRhYmxlc1tjb21wb25lbnQucXVhbnRpemF0aW9uVGFibGVJZF07XG4gICAgICAgIHRoaXMuY29tcG9uZW50cy5wdXNoKHtcbiAgICAgICAgICBvdXRwdXQ6IGJ1aWxkQ29tcG9uZW50RGF0YShmcmFtZSwgY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wgPDwgMztcbiAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCA4OyBqKyspIHtcbiAgICAgICAgICAgICAgdmFyIGxpbmVPZmZzZXQgPSAoc2NhbkxpbmUgKyBqKSAqIHNhbXBsZXNQZXJMaW5lO1xuICAgICAgICAgICAgICBmb3IgKGsgPSAwOyBrIDwgODsgaysrKSB7XG4gICAgICAgICAgICAgICAgbGluZURhdGFbbGluZU9mZnNldCArIHNhbXBsZSArIGtdID1cbiAgICAgICAgICAgICAgICAgIGNvbXBvbmVudC5vdXRwdXRbYnVmZmVyT2Zmc2V0ICsgb2Zmc2V0KytdO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgY29tcG9uZW50U2NhbGVYID0gY29tcG9uZW50LnNjYWxlWCAqIHNjYWxlWDtcbiAgICAgICAgY29tcG9uZW50U2NhbGVZID0gY29tcG9uZW50LnNjYWxlWSAqIHNjYWxlWTtcbiAgICAgICAgb2Zmc2V0ID0gaTtcblxuICAgICAgICB2YXIgY3gsIGN5O1xuICAgICAgICB2YXIgaW5kZXg7XG4gICAgICAgIGZvciAoeSA9IDA7IHkgPCBoZWlnaHQ7IHkrKykge1xuICAgICAgICAgIGZvciAoeCA9IDA7IHggPCB3aWR0aDsgeCsrKSB7XG4gICAgICAgICAgICBjeSA9IDAgfCAoeSAqIGNvbXBvbmVudFNjYWxlWSk7XG4gICAgICAgICAgICBjeCA9IDAgfCAoeCAqIGNvbXBvbmVudFNjYWxlWCk7XG4gICAgICAgICAgICBpbmRleCA9IGN5ICogc2FtcGxlc1BlckxpbmUgKyBjeDtcbiAgICAgICAgICAgIGRhdGFbb2Zmc2V0XSA9IGxpbmVEYXRhW2luZGV4XTtcbiAgICAgICAgICAgIG9mZnNldCArPSBudW1Db21wb25lbnRzO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmV0dXJuIGRhdGE7XG4gICAgf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AgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgY29tcG9uZW50U2NhbGVYID0gY29tcG9uZW50LnNjYWxlWCAqIHNjYWxlWDtcbiAgICAgICAgY29tcG9uZW50U2NhbGVZID0gY29tcG9uZW50LnNjYWxlWSAqIHNjYWxlWTtcbiAgICAgICAgb2Zmc2V0ID0gaTtcblxuICAgICAgICB2YXIgY3gsIGN5O1xuICAgICAgICB2YXIgaW5kZXg7XG4gICAgICAgIGZvciAoeSA9IDA7IHkgPCBoZWlnaHQ7IHkrKykge1xuICAgICAgICAgIGZvciAoeCA9IDA7IHggPCB3aWR0aDsgeCsrKSB7XG4gICAgICAgICAgICBjeSA9IDAgfCAoeSAqIGNvbXBvbmVudFNjYWxlWSk7XG4gICAgICAgICAgICBjeCA9IDAgfCAoeCAqIGNvbXBvbmVudFNjYWxlWCk7XG4gICAgICAgICAgICBpbmRleCA9IGN5ICogc2FtcGxlc1BlckxpbmUgKyBjeDtcbiAgICAgICAgICAgIGRhdGFbb2Zmc2V0XSA9IGxpbmVEYXRhW2luZGV4XTtcbiAgICAgICAgICAgIG9mZnNldCArPSBudW1Db21wb25lbnRzO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICAvLyAuLi4gdGhlbiB0cmFuc2Zvcm0gY29sb3JzLCBpZiBuZWNlc3NhcnlcbiAgICAgIHN3aXRjaCAobnVtQ29tcG9uZW50cykge1xuICAgICAgICBjYXNlIDE6XG4gICAgICAgIGNhc2UgMjpcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgLy8gbm8gY29sb3IgY29udmVyc2lvbiBmb3Igb25lIG9yIHR3byBjb21wb2VuZW50c1xuXG4gICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAvLyBUaGUgZGVmYXVsdCB0cmFuc2Zvcm0gZm9yIHRocmVlIGNvbXBvbmVudHMgaXMgdHJ1ZVxuICAgICAgICAgIGNvbG9yVHJhbnNmb3JtID0gdHJ1ZTtcbiAgICAgICAgICAvLyBUaGUgYWRvYmUgdHJhbnNmb3JtIG1hcmtlciBvdmVycmlkZXMgYW55IHByZXZpb3VzIHNldHRpbmdcbiAgICAgICAgICBpZiAodGhpcy5hZG9iZSAmJiB0aGlzLmFkb2JlLnRyYW5zZm9ybUNvZGUpXG4gICAgICAgICAgICBjb2xvclRyYW5zZm9ybSA9IHRydWU7XG4gICAgICAgICAgZWxzZSBpZiAodHlwZW9mIHRoaXMuY29sb3JUcmFuc2Zvcm0gIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgY29sb3JUcmFuc2Zvcm0gPSAhIXRoaXMuY29sb3JUcmFuc2Zvcm07XG5cbiAgICAgICAgICBpZiAoY29sb3JUcmFuc2Zvcm0pIHtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBkYXRhTGVuZ3RoOyBpICs9IG51bUNvbXBvbmVudHMpIHtcbiAgICAgICAgICAgICAgWSA9IGRhdGFbaSAgICBdO1xuICAgICAgICAgICAgICBDYiA9IGRhdGFbaSArIDFdO1xuICAgICAgICAgICAgICBDciA9IGRhdGFbaSArIDJdO1xuXG4gICAgICAgICAgICAgIFIgPSBjbGFtcFRvVWludDgoWSAtIDE3OS40NTYgKyAxLjQwMiAqIENyKTtcbiAgICAgICAgICAgICAgRyA9IGNsYW1wVG9VaW50OChZICsgMTM1LjQ1OSAtIDAuMzQ0ICogQ2IgLSAwLjcxNCAqIENyKTtcbiAgICAgICAgICAgICAgQiA9IGNsYW1wVG9VaW50OChZIC0gMjI2LjgxNiArIDEuNzcyICogQ2IpO1xuXG4gICAgICAgICAgICAgIGRhdGFbaSAgICBdID0gUjtcbiAgICAgICAgICAgICAgZGF0YVtpICsgMV0gPSBHO1xuICAgICAgICAgICAgICBkYXRhW2kgKyAyXSA9IEI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIDQ6XG4gIC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pb24gKyAzKTtcbiAgICAgICAgICAgICAgc3dpdGNoIChjb2xvcnNwYWNlKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAxNjogLy8gdGhpcyBpbmRpY2F0ZXMgYSBzUkdCIGNvbG9yc3BhY2VcbiAgICAgICAgICAgICAgICBjYXNlIDE3OiAvLyB0aGlzIGluZGljYXRlcyBhIGdyYXlzY2FsZSBjb2xvcnNwYWNlXG4gICAgICAgICAgICAgICAgY2FzZSAxODogLy8gdGhpcyBpbmRpY2F0ZXMgYSBZVVYgY29sb3JzcGFjZVxuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgIHdhcm4oJ1Vua25vd24gY29sb3JzcGFjZSAnICsgY29sb3JzcGFjZSk7XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXRob2QgPT09IDIpIHtcbiAgICAgICAgICAgICAgaW5mbygnSUNDIHByb2ZpbGUgbm90IHN1cHBvcnRlZCcpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSAweDZBNzAzMjYzOiAvLyAnanAyYydcbiAgICAgICAgICAgIHRoaXMucGFyc2VDb2Rlc3RyZWFtKGRhdGEsIHBvc2l0aW9uLCBwb3NpdGlvbiArIGRhdGFMZW5ndGgpO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSAweDZBNTAyMDIwOiAvLyAnalBcXDAyNFxcMDI0J1xuICAgICAgICAgICAgaWYgKDB4MGQwYTg3MGEgIT09IHJlYWRVaW50MzIoZGF0YSwgcG9zaXRpb24pKSB7XG4gICAgICAgICAgICAgIHdhcm4oJ0ludmFsaWQgSlAyIHNpZ25hdHVyZScpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgLy8gVGhlIGZvbGxvd2luZyBoZWFkZXIgdHlwZXMgYXJlIHZhbGlkIGJ1dCBjdXJyZW50bHkgbm90IHVzZWQ6XG4gICAgICAgICAgY2FzZSAweDZBNTAxQTFBOiAvLyAnalBcXDAzMlxcMDMyJ1xuICAgICAgICAgIGNhc2UgMHg2Njc0Nzk3MDogLy8gJ2Z0eXAnXG4gICAgICAgICAgY2FzZSAweDcyNzI2NTcxOiAvLyAncnJlcSdcbiAgICAgICAgICBjYXNlIDB4NzI2NTczMjA6IC8vICdyZXMgJ1xuICAgICAgICAgIGNhc2UgMHg2OTY4NjQ3MjogLy8gJ2loZHInXG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgdmFyIGhlYWRlclR5cGUgPSBTdHJpbmcuZnJvbUNoYXJDb2RlKCh0Ym94ID4+IDI0KSAmIDB4RkYsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRib3ggPj4gMTYpICYgMHhGRixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodGJveCA+PiA4KSAmIDB4RkYsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGJveCAmIDB4RkYpO1xuICAgICAgICAgICAgd2FybignVW5zdXBwb3J0ZWQgaGVhZGVyIHR5cGUgJyArIHRib3ggKyAnICgnICsgaGVhZGVyVHlwZSArICcpJyk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBpZiAoanVtcERhdGFMZW5ndGgpIHtcbiAgICAgICAgICBwb3NpdGlvbiArPSBkYXRhTGVuZ3RoO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSxcbiAgICBwYXJzZUltYWdlUHJvcGVydGllczogZnVuY3Rpb24gSnB4SW1hZ2VfcGFyc2VJbWFnZVByb3BlcnRpZXMoc3RyZWFtKSB7XG4gICAgICB2YXIgbmV3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aW50MzIoZGF0YSwgcG9zaXRpb24gKyA0KTtcbiAgICAgICAgICAgICAgc2l6LllzaXogPSByZWFkVWludDMyKGRhdGEsIHBvc2l0aW9uICsgOCk7XG4gICAgICAgICAgICAgIHNpei5YT3NpeiA9IHJlYWRVaW50MzIoZGF0YSwgcG9zaXRpb24gKyAxMik7XG4gICAgICAgICAgICAgIHNpei5ZT3NpeiA9IHJlYWRVaW50MzIoZGF0YSwgcG9zaXRpb24gKyAxNik7XG4gICAgICAgICAgICAgIHNpei5YVHNpeiA9IHJlYWRVaW50MzIoZGF0YSwgcG9zaXRpb24gKyAyMCk7XG4gICAgICAgICAgICAgIHNpei5ZVHNpeiA9IHJlYWRVaW50MzIoZGF0YSwgcG9zaXRpb24gKyAyNCk7XG4gICAgICAgICAgICAgIHNpei5YVE9zaXogPSByZWFkVWludDMyKGRhdGEsIHBvc2l0aW9uICsgMjgpO1xuICAgICAgICAgICAgICBzaXouWVRPc2l6ID0gcmVhZFVpbnQzMihkYXRhLCBwb3NpdGlvbiArIDMyKTtcbiAgICAgICAgICAgICAgdmFyIGNvbXBvbmVudHNDb3VudCA9IHJlYWRVaW50MTYoZGF0YSwgcG9zaXRpb24gKyAzNik7XG4gICAgICAgICAgICAgIHNpei5Dc2l6ID0gY29tcG9uZW50c0NvdW50O1xuICAgICAgICAgICAgICB2YXIgY29tcG9uZW50cyA9IFtdO1xuICAgICAgICAgICAgICBqID0gcG9zaXRpb24gKyAzODtcbiAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjb21wb25lbnRzQ291bnQ7IGkrKykge1xuICAgICAgICAgICAgICAgIHZhciBjb21wb25lbnQgPSB7XG4gICAgICAgICAgICAgICAgICBwcmVjaXNpb246IChkYXRhW2pdICYgMHg3RikgKyAxLFxuICAgICAgICAgICAgICAgICAgaXNTaWduZWQ6ICEhKGRhdGFbal0gJiAweDgwKSxcbiAgICAgICAgICAgICAgICAgIFhSc2l6OiBkYXRhW2ogKyAxXSxcbiAgICAgICAgICAgICAgICAgIFlSc2l6OiBkYXRhW2ogKyAxXVxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgY2FsY3VsYXRlQ29tcG9uZW50RGltZW5zaW9ucyhjb21wb25lbnQsIHNpeik7XG4gICAgICAgICAgICAgICAgY29tcG9uZW50cy5wdXNoKGNvbXBvbmVudCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgY29udGV4dC5TSVogPSBzaXo7XG4gICAgICAgICAgICAgIGNvbnRleHQuY29tcG9uZW50cyA9IGNvbXBvbmVudHM7XG4gICAgICAgICAgICAgIGNhbGN1bGF0ZVRpbGVHcmlkcyhjb250ZXh0LCBjb21wb25lbnRzKTtcbiAgICAgICAgICAgICAgY29udGV4dC5RQ0MgPSBbXTtcbiAgICAgICAgICAgICAgY29udGV4dC5DT0MgPSBbXTtcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDB4RkY1QzogLy8gUXVhbnRpemF0aW9uIGRlZmF1bHQgKFFDRClcbiAgICAgICAgICAgICAgbGVuZ3RoID0gcmVhZFVpbnQxNihkYXRhLCBwb3NpdGlvbik7XG4gICAgICAgICAgICAgIHZhciBxY2QgPSB7fTtcbiAgICAgICAgICAgICAgaiA9IHBvc2l0aW9uICsgMjtcbiAgICAgICAgICAgICAgc3FjZCA9IGRhdGFbaisrXTtcbiAgICAgICAgICAgICAgc3dpdGNoIChzcWNkICYgMHgxRikge1xuICAgICAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgICAgIHNwcWNkU2l6ZSA9IDg7XG4gICAgICAgICAgICAgICAgICBzY2FsYXJFeHBvdW5kZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgICAgICAgc3BxY2RTaXplID0gMTY7XG4gICAgICAgICAgICAgICAgICBzY2FsYXJFeHBvdW5kZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICAgIHNwcWNkU2l6ZSA9IDE2O1xuICAgICAgICAgICAgICAgICAgc2NhbGFyRXhwb3VuZGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0pQWCBFcnJvcjogSW52YWxpZCBTUWNkIHZhbHVlICcgKyBzcWNkKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBxY2Qubm9RdWFudGl6YXRpb24gPSAoc3BxY2RTaXplID09PSA4KTtcbiAgICAgICAgICAgICAgcWNkLnNjYWxhckV4cG91bmRlZCA9IHNjYWxhckV4cG91bmRlZDtcbiAgICAgICAgICAgICAgcWNkLmd1YXJkQml0cyA9IHNxY2QgPj4gNTtcbiAgICAgICAgICAgICAgc3BxY2RzID0gW107XG4gICAgICAgICAgICAgIHdoaWxlIChqIDwgbGVuZ3RoICsgcG9zaXRpb24pIHtcbiAgICAgICAgICAgICAgICB2YXIgc3BxY2QgPSB7fTtcbiAgICAgICAgICAgICAgICBpZiAoc3BxY2RTaXplID09PSA4KSB7XG4gICAgICAgICAgICAgICAgICBzcHFjZC5lcHNpbG9uID0gZGF0YVtqKytdID4+IDM7XG4gICAgICAgICAgICAgICAgICBzcHFjZC5tdSA9IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgIHNwcWNkLmVwc2lsb24gPSBkYXRhW2pdID4+IDM7XG4gICAgICAgICAgICAgICAgICBzcHFjZC5tdSA9ICgoZGF0YVtqXSAmIDB4NykgPDwgOCkgfCBkYXRhW2ogKyAxXTtcbiAgICAgICAgICAgICAgICAgIGogKz0gMjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgc3BxY2RzLnB1c2goc3BxY2QpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHFjZC5TUHFjZHMgPSBzcHFjZHM7XG4gICAgICAgICAgICAgIGlmIChjb250ZXh0Lm1haW5IZWFkZXIpIHtcbiAgICAgICAgICAgICAgICBjb250ZXh0LlFDRCA9IHFjZDtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb250ZXh0LmN1cnJlbnRUaWxlLlFDRCA9IHFjZDtcbiAgICAgICAgICAgICAgICBjb250ZXh0LmN1cnJlbnRUaWxlLlFDQyA9IFtdO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAweEZGNUQ6IC8vIFF1YW50aXphdGlvbiBjb21wb25lbnQgKFFDQylcbiAgICAgICAgICAgICAgbGVuZ3RoID0gcmVhZFVpbnQxNihkYXRhLCBwb3NpdGlvbik7XG4gICAgICAgICAgICAgIHZhciBxY2MgPSB7fTtcbiAgICAgICAgICAgICAgaiA9IHBvc2l0aW9uICsgMjtcbiAgICAgICAgICAgICAgdmFyIGNxY2M7XG4gICAgICAgICAgICAgIGlmIChjb250ZXh0LlNJWi5Dc2l6IDwgMjU3KSB7XG4gICAgICAgICAgICAgICAgY3FjYyA9IGRhdGFbaisrXTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjcWNjID0gcmVhZFVpbnQxNihkYXRhLCBqKTtcbiAgICAgICAgICAgICAgICBqICs9IDI7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgc3FjZCA9IGRhdGFbaisrXTtcbiAgICAgICAgICAgICAgc3dpdGNoIChzcWNkICYgMHgxRikge1xuICAgICAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgICAgIHNwcWNkU2l6ZSA9IDg7XG4gICAgICAgICAgICAgICAgICBzY2FsYXJFeHBvdW5kZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgICAgICAgc3BxY2RTaXplID0gMTY7XG4gICAgICAgICAgICAgICAgICBzY2FsYXJFeHBvdW5kZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICAgIHNwcWNkU2l6ZSA9IDE2O1xuICAgICAgICAgICAgICAgICAgc2NhbGFyRXhwb3VuZGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0pQWCBFcnJvcjogSW52YWxpZCBTUWNkIHZhbHVlICcgKyBzcWNkKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBxY2Mubm9RdWFudGl6YXRpb24gPSAoc3BxY2RTaXplID09PSA4KTtcbiAgICAgICAgICAgICAgcWNjLnNjYWxhckV4cG91bmRlZCA9IHNjYWxhckV4cG91bmRlZDtcbiAgICAgICAgICAgICAgcWNjLmd1YXJkQml0cyA9IHNxY2QgPj4gNTtcbiAgICAgICAgICAgICAgc3BxY2RzID0gW107XG4gICAgICAgICAgICAgIHdoaWxlIChqIDwgKGxlbmd0aCArIHBvc2l0aW9uKSkge1xuICAgICAgICAgICAgICAgIHNwcWNkID0ge307XG4gICAgICAgICAgICAgICAgaWYgKHNwcWNkU2l6ZSA9PT0gOCkge1xuICAgICAgICAgICAgICAgICAgc3BxY2QuZXBzaWxvbiA9IGRhdGFbaisrXSA+PiAzO1xuICAgICAgICAgICAgICAgICAgc3BxY2QubXUgPSAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICBzcHFjZC5lcHNpbG9uID0gZGF0YVtqXSA+PiAzO1xuICAgICAgICAgICAgICAgICAgc3BxY2QubXUgPSAoKGRhdGFbal0gJiAweDcpIDw8IDgpIHwgZGF0YVtqICsgMV07XG4gICAgICAgICAgICAgICAgICBqICs9IDI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHNwcWNkcy5wdXNoKHNwcWNkKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBxY2MuU1BxY2RzID0gc3BxY2RzO1xuICAgICAgICAgICAgICBpZiAoY29udGV4dC5tYWluSGVhZGVyKSB7XG4gICAgICAgICAgICAgICAgY29udGV4dC5RQ0NbY3FjY10gPSBxY2M7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgY29udGV4dC5jdXJyZW50VGlsZS5RQ0NbY3FjY10gPSBxY2M7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDB4RkY1MjogLy8gQ29kaW5nIHN0eWxlIGRlZmF1bHQgKENPRClcbiAgICAgICAgICAgICAgbGVuZ3RoID0gcmVhZFVpbnQxNihkYXRhLCBwb3NpdGlvbik7XG4gICAgICAgICAgICAgIHZhciBjb2QgPSB7fTtcbiAgICAgICAgICAgICAgaiA9IHBvc2l0aW9uICsgMjtcbiAgICAgICAgICAgICAgdmFyIHNjb2QgPSBkYXRhW2orK107XG4gICAgICAgICAgICAgIGNvZC5lbnRyb3B5Q29kZXJXaXRoQ3VzdG9tUHJlY2luY3RzID0gISEoc2NvZCAmIDEpO1xuICAgICAgICAgICAgICBjb2Quc29wTWFya2VyVXNlZCA9ICEhKHNjb2QgJiAyKTtcbiAgICAgICAgICAgICAgY29kLmVwaE1hcmtlclVzZWQgPSAhIShzY29kICYgNCk7XG4gICAgICAgICAgICAgIGNvZC5wcm9ncmVzc2lvbk9yZGVyID0gZGF0YVtqKytdO1xuICAgICAgICAgICAgICBjb2QubGF5ZXJzQ291bnQgPSByZWFkVWludDE2KGRhdGEsIGopO1xuICAgICAgICAgICAgICBqICs9IDI7XG4gICAgICAgICAgICAgIGNvZC5tdWx0aXBsZUNvbXBvbmVudFRyYW5zZm9ybSA9IGRhdGFbaisrXTtcblxuICAgICAgICAgICAgICBjb2QuZGVjb21wb3NpdGlvbkxldmVsc0NvdW50ID0gZGF0YVtqKytdO1xuICAgICAgICAgICAgICBjb2QueGNiID0gKGRhdGFbaisrXSAmIDB4RikgKyAyO1xuICAgICAgICAgICAgICBjb2QueWNiID0gKGRhdGFbaisrXSAmIDB4RikgKyAyO1xuICAgICAgICAgICAgICB2YXIgYmxvY2tTdHlsZSA9IGRhdGFbaisrXTtcbiAgICAgICAgICAgICAgY29kLnNlbGVjdGl2ZUFyaXRobWV0aWNDb2RpbmdCeXBhc3MgPSAhIShibG9ja1N0eWxlICYgMSk7XG4gICAgICAgICAgICAgIGNvZC5yZXNldENvbnRleHRQcm9iYWJpbGl0aWVzID0gISEoYmxvY2tTdHlsZSAmIDIpO1xuICAgICAgICAgICAgICBjb2QudGVybWluYXRpb25PbkVhY2hDb2RpbmdQYXNzID0gISEoYmxvY2tTdHlsZSAmIDQpO1xuICAgICAgICAgICAgICBjb2QudmVydGljYWx5U3RyaXBlID0gISEoYmxvY2tTdHlsZSAmIDgpO1xuICAgICAgICAgICAgICBjb2QucHJlZGljdGFibGVUZXJtaW5hdGlvbiA9ICEhKGJsb2NrU3R5bGUgJiAxNik7XG4gICAgICAgICAgICAgIGNvZC5zZWdtZW50YXRpb25TeW1ib2xVc2VkID0gISEoYmxvY2tTdHlsZSAmIDMyKTtcbiAgICAgICAgICAgICAgY29kLnJldmVyc2libGVUcmFuc2Zvcm1hdGlvbiA9IGRhdGFbaisrXTtcbiAgICAgICAgICAgICAgaWYgKGNvZC5lbnRyb3B5Q29kZXJXaXRoQ3VzdG9tUHJlY2luY3RzKSB7XG4gICAgICAgICAgICAgICAgdmFyIHByZWNpbmN0c1NpemVzID0gW107XG4gICAgICAgICAgICAgICAgd2hpbGUgKGogPCBsZW5ndGggKyBwb3NpdGlvbikge1xuICAgICAgICAgICAgICAgICAgdmFyIHByZWNpbmN0c1NpemUgPSBkYXRhW2orK107XG4gICAgICAgICAgICAgICAgICBwcmVjaW5jdHNTaXplcy5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgUFB4OiBwcmVjaW5jdHNTaXplICYgMHhGLFxuICAgICAgICAgICAgICAgICAgICBQUHk6IHByZWNpbmN0c1NpemUgPj4gNFxuICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNvZC5wcmVjaW5jdHNTaXplcyA9IHByZWNpbmN0c1NpemVzO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHZhciB1bnN1cHBvcnRlZCA9IFtdO1xuICAgICAgICAgICAgICBpZiAoY29kLnNlbGVjdGl2ZUFyaXRobWV0aWNDb2RpbmdCeXBhc3MpIHtcbiAgICAgICAgICAgICAgICB1bnN1cHBvcnRlZC5wdXNoKCdzZWxlY3RpdmVBcml0aG1ldGljQ29kaW5nQnlwYXNzJyk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKGNvZC5yZXNldENvbnRleHRQcm9iYWJpbGl0aWVzKSB7XG4gICAgICAgICAgICAgICAgdW5zdXBwb3J0ZWQucHVzaCgncmVzZXRDb250ZXh0UHJvYmFiaWxpdGllcycpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChjb2QudGVybWluYXRpb25PbkVhY2hDb2RpbmdQYXNzKSB7XG4gICAgICAgICAgICAgICAgdW5zdXBwb3J0ZWQucHVzaCgndGVybWluYXRpb25PbkVhY2hDb2RpbmdQYXNzJyk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKGNvZC52ZXJ0aWNhbHlTdHJpcGUpIHtcbiAgICAgICAgICAgICAgICB1bnN1cHBvcnRlZC5wdXNoKCd2ZXJ0aWNhbHlTdHJpcGUnKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAoY29kLnByZWRpY3RhYmxlVGVybWluYXRpb24pIHtcbiAgICAgICAgICAgICAgICB1bnN1cHBvcnRlZC5wdXNoKCdwcmVkaWN0YWJsZVRlcm1pbmF0aW9uJyk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKHVuc3VwcG9ydGVkLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICBkb05vdFJlY292ZXIgPSB0cnVlO1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignSlBYIEVycm9yOiBVbnN1cHBvcnRlZCBDT0Qgb3B0aW9ucyAoJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc3VwcG9ydGVkLmpvaW4oJywgJykgKyAnKScpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChjb250ZXh0Lm1haW5IZWFkZXIpIHtcbiAgICAgICAgICAgICAgICBjb250ZXh0LkNPRCA9IGNvZDtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb250ZXh0LmN1cnJlbnRUaWxlLkNPRCA9IGNvZDtcbiAgICAgICAgICAgICAgICBjb250ZXh0LmN1cnJlbnRUaWxlLkNPQyA9IFtdO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAweEZGOTA6IC8vIFN0YXJ0IG9mIHRpbGUtcGFydCAoU09UKVxuICAgICAgICAgICAgICBsZW5ndGggPSByZWFkVWludDE2KGRhdGEsIHBvc2l0aW9uKTtcbiAgICAgICAgICAgICAgdGlsZSA9IHt9O1xuICAgICAgICAgICAgICB0aWxlLmluZGV4ID0gcmVhZFVpbnQxNihkYXRhLCBwb3NpdGlvbiArIDIpO1xuICAgICAgICAgICAgICB0aWxlLmxlbmd0aCA9IHJlYWRVaW50MzIoZGF0YSwgcG9zaXRpb24gKyA0KTtcbiAgICAgICAgICAgICAgdGlsZS5kYXRhRW5kID0gdGlsZS5sZW5ndGggKyBwb3NpdGlvbiAtIDI7XG4gICAgICAgICAgICAgIHRpbGUucGFydEluZGV4ID0gZGF0YVtwb3NpdGlvbiArIDhdO1xuICAgICAgICAgICAgICB0aWxlLnBhcnRzQ291bnQgPSBkYXRhW3Bvc2l0aW9uICsgOV07XG5cbiAgICAgICAgICAgICAgY29udGV4dC5tYWluSGVhZGVyID0gZmFsc2U7XG4gICAgICAgICAgICAgIGlmICh0aWxlLnBhcnRJbmRleCA9PT0gMCkge1xuICAgICAgICAgICAgICAgIC8vIHJlc2V0IGNvbXBvbmVudCBzcGVjaWZpYyBzZXR0aW5nc1xuICAgICAgICAgICAgICAgIHRpbGUuQ09EID0gY29udGV4dC5DT0Q7XG4gICAgICAgICAgICAgICAgdGlsZS5DT0MgPSBjb250ZXh0LkNPQy5zbGljZSgwKTsgLy8gY2xvbmUgb2YgdGhlIGdsb2JhbCBDT0NcbiAgICAgICAgICAgICAgICB0aWxlLlFDRCA9IGNvbnRleHQuUUNEO1xuICAgICAgICAgICAgICAgIHRpbGUuUUNDID0gY29udGV4dC5RQ0Muc2xpY2UoMCk7IC8vIGNsb25lIG9mIHRoZSBnbG9iYWwgQ09DXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgY29udGV4dC5jdXJyZW50VGlsZSA9IHRpbGU7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAweEZGOTM6IC8vIFN0YXJ0IG9mIGRhdGEgKFNPRClcbiAgICAgICAgICAgICAgdGlsZSA9IGNvbnRleHQuY3VycmVudFRpbGU7XG4gICAgICAgICAgICAgIGlmICh0aWxlLnBhcnRJbmRleCA9PT0gMCkge1xuICAgICAgICAgICAgICAgIGluaXRpYWxpemVUaWxlKGNvbnRleHQsIHRpbGUuaW5kZXgpO1xuICAgICAgICAgICAgICAgIGJ1aWxkUGFja2V0cyhjb250ZXh0KTtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIC8vIG1vdmluZyB0byB0aGUgZW5kIG9mIHRoZSBkYXRhXG4gICAgICAgICAgICAgIGxlbmd0aCA9IHRpbGUuZGF0YUVuZCAtIHBvc2l0aW9uO1xuICAgICAgICAgICAgICBwYXJzZVRpbGVQYWNrZXRzKGNvbnRleHQsIGRhdGEsIHBvc2l0aW9uLCBsZW5ndGgpO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMHhGRjU1OiAvLyBUaWxlLXBhcnQgbGVuZ3RocywgbWFpbiBoZWFkZXIgKFRMTSlcbiAgICAgICAgICAgIGNhc2UgMHhGRjU3OiAvLyBQYWNrZXQgbGVuZ3RoLCBtYWluIGhlYWRlciAoUExNKVxuICAgICAgICAgICAgY2FzZSAweEZGNTg6IC8vIFBhY2tldCBsZW5ndGgsIHRpbGUtcGFydCBoZWFkZXIgKFBMVClcbiAgICAgICAgICAgIGNhc2UgMHhGRjY0OiAvLyBDb21tZW50IChDT00pXG4gICAgICAgICAgICAgIGxlbmd0aCA9IHJlYWRVaW50MTYoZGF0YSwgcG9zaXRpb24pO1xuICAgICAgICAgICAgICAvLyBza2lwcGluZyBjb250ZW50XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAweEZGNTM6IC8vIENvZGluZyBzdHlsZSBjb21wb25lbnQgKENPQylcbiAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdKUFggRXJyb3I6IENvZGVzdHJlYW0gY29kZSAweEZGNTMgKENPQykgaXMgJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbm90IGltcGxlbWVudGVkJyk7XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0pQWCBFcnJvcjogVW5rbm93biBjb2Rlc3RyZWFtIGNvZGU6ICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29kZS50b1N0cmluZygxNikpO1xuICAgICA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GlsZS50eTEgLSB0aWxlLnR5MDtcbiAgICAgICAgdGlsZS5jb21wb25lbnRzID0gW107XG4gICAgICAgIHRpbGVzLnB1c2godGlsZSk7XG4gICAgICB9XG4gICAgfVxuICAgIGNvbnRleHQudGlsZXMgPSB0aWxlcztcblxuICAgIHZhciBjb21wb25lbnRzQ291bnQgPSBzaXouQ3NpejtcbiAgICBmb3IgKHZhciBpID0gMCwgaWkgPSBjb21wb25lbnRzQ291bnQ7IGkgPCBpaTsgaSsrKSB7XG4gICAgICB2YXIgY29tcG9uZW50ID0gY29tcG9uZW50c1tpXTtcbiAgICAgIGZvciAodmFyIGogPSAwLCBqaiA9IHRpbGVzLmxlbmd0aDsgaiA8IGpqOyBqKyspIHtcbiAgICAgICAgdmFyIHRpbGVDb21wb25lbnQgPSB7fTtcbiAgICAgICAgdGlsZSA9IHRpbGVzW2pdO1xuICAgICAgICB0aWxlQ29tcG9uZW50LnRjeDAgPSBNYXRoLmNlaWwodGlsZS50eDAgLyBjb21wb25lbnQuWFJzaXopO1xuICAgICAgICB0aWxlQ29tcG9uZW50LnRjeTAgPSBNYXRoLmNlaWwodGlsZS50eTAgLyBjb21wb25lbnQuWVJzaXopO1xuICAgICAgICB0aWxlQ29tcG9uZW50LnRjeDEgPSBNYXRoLmNlaWwodGlsZS50eDEgLyBjb21wb25lbnQuWFJzaXopO1xuICAgICAgICB0aWxlQ29tcG9uZW50LnRjeTEgPSBNYXRoLmNlaWwodGlsZS50eTEgLyBjb21wb25lbnQuWVJzaXopO1xuICAgICAgICB0aWxlQ29tcG9uZW50LndpZHRoID0gdGlsZUNvbXBvbmVudC50Y3gxIC0gdGlsZUNvbXBvbmVudC50Y3gwO1xuICAgICAgICB0aWxlQ29tcG9uZW50LmhlaWdodCA9IHRpbGVDb21wb25lbnQudGN5MSAtIHRpbGVDb21wb25lbnQudGN5MDtcbiAgICAgICAgdGlsZS5jb21wb25lbnRzW2ldID0gdGlsZUNvbXBvbmVudDtcbiAgICAgIH1cbiA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ICAgIHZhciBjYngxID0gKHN1YmJhbmQudGJ4MSArIGNvZGVibG9ja1dpZHRoIC0gMSkgPj4geGNiXztcbiAgICB2YXIgY2J5MSA9IChzdWJiYW5kLnRieTEgKyBjb2RlYmxvY2tIZWlnaHQgLSAxKSA+PiB5Y2JfO1xuICAgIHZhciBwcmVjaW5jdFBhcmFtZXRlcnMgPSBzdWJiYW5kLnJlc29sdXRpb24ucHJlY2luY3RQYXJhbWV0ZXJzO1xuICAgIHZhciBjb2RlYmxvY2tzID0gW107XG4gICAgdmFyIHByZWNpbmN0cyA9IFtdO1xuICAgIHZhciBpLCBqLCBjb2RlYmxvY2ssIHByZWNpbmN0TnVtYmVyO1xuICAgIGZvciAoaiA9IGNieTA7IGogPCBjYnkxOyBqKyspIHtcbiAgICAgIGZvciAoaSA9IGNieDA7IGkgPCBjYngxOyBpKyspIHtcbiAgICAgICAgY29kZWJsb2NrID0ge1xuICAgICAgICAgIGNieDogaSxcbiAgICAgICAgICBjYnk6IGosXG4gICAgICAgICAgdGJ4MDogY29kZWJsb2NrV2lkdGggKiBpLFxuICAgICAgICAgIHRieTA6IGNvZGVibG9ja0hlaWdodCAqIGosXG4gICAgICAgICAgdGJ4MTogY29kZWJsb2NrV2lkdGggKiAoaSArIDEpLFxuICAgICAgICAgIHRieTE6IGNvZGVibG9ja0hlaWdodCAqIChqICsgMSlcbiAgICAgICAgfTtcblxuICAgICAgICBjb2RlYmxvY2sudGJ4MF8gPSBNYXRoLm1heChzdWJiYW5kLnRieDAsIGNvZGVibG9jay50YngwKTtcbiAgICAgICAgY29kZWJsb2NrLnRieTBfID0gTWF0aC5tYXgoc3ViYmFuZC50YnkwLCBjb2RlYmxvY2sudGJ5MCk7XG4gICAgICAgIGNvZGVibG9jay50YngxXyA9IE1hdGgubWluKHN1YmJhbmQudGJ4MSwgY29kZWJsb2NrLnRieDEpO1xuICAgICAgICBjb2RlYmxvY2sudGJ5MV8gPSBNYXRoLm1pbihzdWJiYW5kLnRieTEsIGNvZGVibG9jay50YnkxKTtcblxuICAgICAgICAvLyBDYWxjdWxhdGUgcHJlY2luY3QgbnVtYmVyIGZvciB0aGlzIGNvZGVibG9jaywgY29kZWJsb2NrIHBvc2l0aW9uXG4gICAgICAgIC8vIHNob3VsZCBiZSByZWxhdGl2ZSB0byBpdHMgc3ViYmFuZCwgdXNlIGFjdHVhbCBkaW1lbnNpb24gYW5kIHBvc2l0aW9uXG4gICAgICAgIC8vIFNlZSBjb21tZW50IGFib3V0IGNvZGVibG9jayBncm91cCB3aWR0aCBhbmQgaGVpZ2h0XG4gICAgICAgIHZhciBwaSA9IE1hdGguZmxvb3IoKGNvZGVibG9jay50YngwXyAtIHN1YmJhbmQudGJ4MCkgL1xuICAgICAgICAgIHByZWNpbmN0UGFyYW1ldGVycy5wcmVjaW5jdFdpZHRoSW5TdWJiYW5kKTtcbiAgICAgICAgdmFyIHBqID0gTWF0aC5mbG9vcigoY29kZWJsb2NrLnRieTBfIC0gc3ViYmFuZC50YnkwKSAvXG4gICAgICAgICAgcHJlY2luY3RQYXJhbWV0ZXJzLnByZWNpbmN0SGVpZ2h0SW5TdWJiYW5kKTtcbiAgICAgICAgcHJlY2luY3ROdW1iZXIgPSBwaSArIChwaiAqIHByZWNpbmN0UGFyYW1ldGVycy5udW1wcmVjaW5jdHN3aWRlKTtcblxuICAgICAgICBjb2RlYmxvY2sucHJlY2luY3ROdW1iZXIgPSBwcmVjaW5jdE51bWJlcjtcbiAgICAgICAgY29kZWJsb2NrLnN1YmJhbmRUeXBlID0gc3ViYmFuZC50eXBlO1xuICAgICAgICBjb2RlYmxvY2suTGJsb2NrID0gMztcblxuICAgICAgICBpZiAoY29kZWJsb2NrLnRieDFfIDw9IGNvZGVibG9jay50YngwXyB8fFxuICAgICAgICAgICAgY29kZWJsb2NrLnRieTFfIDw9IGNvZGVibG9jay50YnkwXykge1xuICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG4gICAgICAgIGNvZGVibG9ja3MucHVzaChjb2RlYmxvY2spO1xuICAgICAgICAvLyBidWlsZGluZyBwcmVjaW5jdCBmb3IgdGhlIHN1Yi1iYW5kXG4gICAgICAgIHZhciBwcmVjaW5jdCA9IHByZWNpbmN0c1twcmVjaW5jdE51bWJlcl07XG4gICAgICAgIGlmIChwcmVjaW5jdCAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgaWYgKGkgPCBwcmVjaW5jdC5jYnhNaW4pIHtcbiAgICAgICAgICAgIHByZWNpbmN0LmNieE1pbiA9IGk7XG4gICAgICAgICAgfSBlbHNlIGlmIChpID4gcHJlY2luY3QuY2J4TWF4KSB7XG4gICAgICAgICAgICBwcmVjaW5jdC5jYnhNYXggPSBpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoaiA8IHByZWNpbmN0LmNieU1pbikge1xuICAgICAgICAgICAgcHJlY2luY3QuY2J4TWluID0gajtcbiAgICAgICAgICB9IGVsc2UgaWYgKGogPiBwcmVjaW5jdC5jYnlNYXgpIHtcbiAgICAgICAgICAgIHByZWNpbmN0LmNieU1heCA9IGo7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHByZWNpbmN0c1twcmVjaW5jdE51bWJlcl0gPSBwcmVjaW5jdCA9IHtcbiAgICAgICAgICAgIGNieE1pbjogaSxcbiAgICAgICAgICAgIGNieU1pbjogaixcbiAgICAgICAgICAgIGNieE1heDogaSxcbiAgICAgICAgICAgIGNieU1heDogalxuICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgY29kZWJsb2NrLnByZWNpbmN0ID0gcHJlY2luY3Q7XG4gICAgICB9XG4gICAgfVxuICAgIHN1YmJhbmQuY29kZWJsb2NrUGFyYW1ldGVycyA9IHtcbiAgICAgIGNvZGVibG9ja1dpZHRoOiB4Y2JfLFxuICAgICAgY29kZWJsb2NrSGVpZ2h0OiB5Y2JfLFxuICAgICAgbnVtY29kZWJsb2Nrd2lkZTogY2J4MSAtIGNieDAgKyAxL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uTGV2ZWxzQ291bnQ7IHIrKykge1xuICAgICAgICAgIGZvciAoOyBpIDwgY29tcG9uZW50c0NvdW50OyBpKyspIHtcbiAgICAgICAgICAgIHZhciBjb21wb25lbnQgPSB0aWxlLmNvbXBvbmVudHNbaV07XG4gICAgICAgICAgICBpZiAociA+IGNvbXBvbmVudC5jb2RpbmdTdHlsZVBhcmFtZXRlcnMuZGVjb21wb3NpdGlvbkxldmVsc0NvdW50KSB7XG4gICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgcmVzb2x1dGlvbiA9IGNvbXBvbmVudC5yZXNvbHV0aW9uc1tyXTtcbiAgICAgICAgICAgIHZhciBudW1wcmVjaW5jdHMgPSByZXNvbHV0aW9uLnByZWNpbmN0UGFyYW1ldGVycy5udW1wcmVjaW5jdHM7XG4gICAgICAgICAgICBmb3IgKDsgayA8IG51bXByZWNpbmN0czspIHtcbiAgICAgICAgICAgICAgdmFyIHBhY2tldCA9IGNyZWF0ZVBhY2tldChyZXNvbHV0aW9uLCBrLCBsKTtcbiAgICAgICAgICAgICAgaysrO1xuICAgICAgICAgICAgICByZXR1cm4gcGFja2V0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgayA9IDA7XG4gICAgICAgICAgfVxuICAgICAgICAgIGkgPSAwO1xuICAgICAgICB9XG4gICAgICAgIHIgPSAwO1xuICAgICAgfVxuICAgIH07XG4gIH1cbiAgZnVuY3Rpb24gUmVzb2x1dGlvbkxheWVyQ29tcG9uZW50UG9zaXRpb25JdGVyYXRvcihjb250ZXh0KSB7XG4gICAgdmFyIHNpeiA9IGNvbnRleHQuU0laO1xuICAgIHZhciB0aWxlSW5kZXggPSBjb250ZXh0LmN1cnJlbnRUaWxlLmluZGV4O1xuICAgIHZhciB0aWxlID0gY29udGV4dC50aWxlc1t0aWxlSW5kZXhdO1xuICAgIHZhciBsYXllcnNDb3VudCA9IHRpbGUuY29kaW5nU3R5bGVEZWZ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tcbiAgICAgICAgICAgIHZhciBudW1wcmVjaW5jdHMgPSByZXNvbHV0aW9uLnByZWNpbmN0UGFyYW1ldGVycy5udW1wcmVjaW5jdHM7XG4gICAgICAgICAgICBmb3IgKDsgayA8IG51bXByZWNpbmN0czspIHtcbiAgICAgICAgICAgICAgdmFyIHBhY2tldCA9IGNyZWF0ZVBhY2tldChyZXNvbHV0aW9uLCBrLCBsKTtcbiAgICAgICAgICAgICAgaysrO1xuICAgICAgICAgICAgICByZXR1cm4gcGFja2V0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgayA9IDA7XG4gICAgICAgICAgfVxuICAgICAgICAgIGkgPSAwO1xuICAgICAgICB9XG4gICAgICAgIGwgPSAwO1xuICAgICAgfVxuICAgIH07XG4gIH1cbiAgZnVuY3Rpb24gUmVzb2x1dGlvblBvc2l0aW9uQ29tcG9uZW50TGF5ZXJJdGVyYXRvcihjb250ZXh0KSB7XG4gICAgdmFyIHNpeiA9IGNvbnRleHQuU0laO1xuICAgIHZhciB0aWxlSW5kZXggPSBjb250ZXh0LmN1cnJlbnRUaWxlLmluZGV4O1xuICAgIHZhciB0aWxlID0gY29udGV4dC50aWxlc1t0aWxlSW5kZXhdO1xuICAgIHZhciBsYXllcnNDb3VudCA9IHRpbGUuY29kaW5nU3R5bGVEZWZhdWx0UGFyYW1ldGVycy5sYXllcnNDb3VudDtcbiAgICB2YXIgY29tcG9uZW50c0NvdW50ID0gc2l6LkNzaXo7XG4gICAgdmFyIGwsIHIsIGMsIHA7XG4gICAgdmFyIG1heERlY29tcG9zaXRpb25MZXZlbHNDb3VudCA9IDA7XG4gICAgZm9yIChjID0gMDsgYyA8IGNvbXBvbmVudHNDb3VudDsgYysrKSB7XG4gICAgICB2YXIgY29tcG9uZW50ID0gdGlsZS5jb21wb25lbnRzW2NdO1xuICAgICAgbWF4RGVjb21wb3NpdGlvbkxldmVsc0NvdW50ID0gTWF0aC5tYXgobWF4RGVjb21wb3NpdGlvbkxldmVsc0NvdW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AgIGZvciAoOyBwIDwgbWF4TnVtUHJlY2luY3RzSW5MZXZlbFtyXTsgcCsrKSB7XG4gICAgICAgICAgZm9yICg7IGMgPCBjb21wb25lbnRzQ291bnQ7IGMrKykge1xuICAgICAgICAgICAgdmFyIGNvbXBvbmVudCA9IHRpbGUuY29tcG9uZW50c1tjXTtcbiAgICAgICAgICAgIGlmIChyID4gY29tcG9uZW50LmNvZGluZ1N0eWxlUGFyYW1ldGVycy5kZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQpIHtcbiAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgcmVzb2x1dGlvbiA9IGNvbXBvbmVudC5yZXNvbHV0aW9uc1tyXTtcbiAgICAgICAgICAgIHZhciBudW1wcmVjaW5jdHMgPSByZXNvbHV0aW9uLnByZWNpbmN0UGFyYW1ldGVycy5udW1wcmVjaW5jdHM7XG4gICAgICAgICAgICBpZiAocCA+PSBudW1wcmVjaW5jdHMpIHtcbiAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmb3IgKDsgbCA8IGxheWVyc0NvdW50Oykge1xuICAgICAgICAgICAgICB2YXIgcGFja2V0ID0gY3JlYXRlUGFja2V0KHJlc29sdXRpb24sIHAsIGwpO1xuICAgICAgICAgICAgICBsKys7XG4gICAgICAgICAgICAgIHJldHVybiBwYWNrZXQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsID0gMDtcbiAgICAgICAgICB9XG4gICAgICAgICAgYyA9IDA7XG4gICAgICAgIH1cbiAgICAgICAgcCA9IDA7XG4gICAgICB9XG4gICAgfTtcbiAgfVxuICBmdW5jdGlvbiBQb3NpdGlvbkNvbXBvbmVudFJlc29sdXRpb25MYXllckl0ZXJhdG9yKGNvbnRleHQpIHtcbiAgICB2YXIgc2l6ID0gY29udGV4dC5TSVo7XG4gICAgdmFyIHRpbGVJbmRleCA9IGNvbnRleHQuY3VycmVudF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cbiAgICAgICAgICAgICAgdmFyIHJlc29sdXRpb24gPSBjb21wb25lbnQucmVzb2x1dGlvbnNbcl07XG4gICAgICAgICAgICAgIHZhciBzaXplSW5JbWFnZVNjYWxlID1cbiAgICAgICAgICAgICAgICBwcmVjaW5jdHNTaXplcy5jb21wb25lbnRzW2NdLnJlc29sdXRpb25zW3JdO1xuICAgICAgICAgICAgICB2YXIgayA9IGdldFByZWNpbmN0SW5kZXhJZkV4aXN0KFxuICAgICAgICAgICAgICAgIHB4LFxuICAgICAgICAgICAgICAgIHB5LFxuICAgICAgICAgICAgICAgIHNpemVJbkltYWdlU2NhbGUsXG4gICAgICAgICAgICAgICAgcHJlY2luY3RzSXRlcmF0aW9uU2l6ZXMsXG4gICAgICAgICAgICAgICAgcmVzb2x1dGlvbik7XG4gICAgICAgICAgICAgIGlmIChrID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgZm9yICg7IGwgPCBsYXllcnNDb3VudDspIHtcbiAgICAgICAgICAgICAgICB2YXIgcGFja2V0ID0gY3JlYXRlUGFja2V0KHJlc29sdXRpb24sIGssIGwpO1xuICAgICAgICAgICAgICAgIGwrKztcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFja2V0O1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGwgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgciA9IDA7XG4gICAgICAgICAgfVxuICAgICAgICAgIGMgPSAwO1xuICAgICAgICB9XG4gICAgICAgIHB4ID0gMDtcbiAgICAgIH1cbiAgICB9O1xuICB9XG4gIGZ1bmN0aW9uIENvbXBvbmVudFBvc2l0aW9uUmVzb2x1dGlvbkxheWVySXRlcmF0b3IoY29udGV4dCkge1xuICAgIHZhciBzaXogPSBjb250ZXh0LlNJWjtcbiAgICB2YXIgdGlsZUluZGV4ID0gY29udGV4dC5jdXJyZW50VGlsZS5pbmRleDtcbiAgICB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7IHIrKykge1xuICAgICAgICAgICAgICB2YXIgcmVzb2x1dGlvbiA9IGNvbXBvbmVudC5yZXNvbHV0aW9uc1tyXTtcbiAgICAgICAgICAgICAgdmFyIHNpemVJbkltYWdlU2NhbGUgPSBwcmVjaW5jdHNJdGVyYXRpb25TaXplcy5yZXNvbHV0aW9uc1tyXTtcbiAgICAgICAgICAgICAgdmFyIGsgPSBnZXRQcmVjaW5jdEluZGV4SWZFeGlzdChcbiAgICAgICAgICAgICAgICBweCxcbiAgICAgICAgICAgICAgICBweSxcbiAgICAgICAgICAgICAgICBzaXplSW5JbWFnZVNjYWxlLFxuICAgICAgICAgICAgICAgIHByZWNpbmN0c0l0ZXJhdGlvblNpemVzLFxuICAgICAgICAgICAgICAgIHJlc29sdXRpb24pO1xuICAgICAgICAgICAgICBpZiAoayA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGZvciAoOyBsIDwgbGF5ZXJzQ291bnQ7KSB7XG4gICAgICAgICAgICAgICAgdmFyIHBhY2tldCA9IGNyZWF0ZVBhY2tldChyZXNvbHV0aW9uLCBrLCBsKTtcbiAgICAgICAgICAgICAgICBsKys7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhY2tldDtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBsID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHIgPSAwO1xuICAgICAgICAgIH1cbiAgICAgICAgICBweCA9IDA7XG4gICAgICAgIH1cbiAgICAgICAgcHkgPSAwO1xuICAgICAgfVxuICAgIH07XG4gIH1cbiAgZnVuY3Rpb24gZ2V0UHJlY2luY3RJbmRleElmRXhpc3QoXG4gICAgcHhJbmRleCwgcHlJbmRleCwgc2l6ZUluSW1hZ2VTY2FsZSwgcHJlY2luY3RJdGVyYXRpb25TaXplcywgcmVzb2x1dGlvbikge1xuICAgIHZhciBwb3NYID0gcHhJbmRleC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RoLm1pbihcbiAgICAgICAgICBtaW5IZWlnaHRDdXJyZW50Q29tcG9uZW50LFxuICAgICAgICAgIGhlaWdodEN1cnJlbnRSZXNvbHV0aW9uKTtcbiAgICAgICAgbWF4TnVtV2lkZUN1cnJlbnRDb21wb25lbnQgPSBNYXRoLm1heChtYXhOdW1XaWRlQ3VycmVudENvbXBvbmVudCxcbiAgICAgICAgICByZXNvbHV0aW9uLnByZWNpbmN0UGFyYW1ldGVycy5udW1wcmVjaW5jdHN3aWRlKTtcbiAgICAgICAgbWF4TnVtSGlnaEN1cnJlbnRDb21wb25lbnQgPSBNYXRoLm1heChtYXhOdW1IaWdoQ3VycmVudENvbXBvbmVudCxcbiAgICAgICAgICByZXNvbHV0aW9uLnByZWNpbmN0UGFyYW1ldGVycy5udW1wcmVjaW5jdHNoaWdoKTtcbiAgICAgICAgc2l6ZVBlclJlc29sdXRpb25bcl0gPSB7XG4gICAgICAgICAgd2lkdGg6IHdpZHRoQ3VycmVudFJlc29sdXRpb24sXG4gICAgICAgICAgaGVpZ2h0OiBoZWlnaHRDdXJyZW50UmVzb2x1dGlvblxuICAgICAgICB9O1xuICAgICAgICBzY2FsZSA8PD0gMTtcbiAgICAgIH1cbiAgICAgIG1pbldpZHRoID0gTWF0aC5taW4obWluV2lkdGgsIG1pbldpZHRoQ3VycmVudENvbXBvbmVudCk7XG4gICAgICBtaW5IZWlnaHQgPSBNYXRoLm1pbihtaW5IZWlnaHQsIG1pbkhlaWdodEN1cnJlbnRDb21wb25lbnQpO1xuICAgICAgbWF4TnVtV2lkZSA9IE1hdGgubWF4KG1heE51bVdpZGUsIG1heE51bVdpZGVDdXJyZW50Q29tcG9uZW50KTtcbiAgICAgIG1heE51bUhpZ2ggPSBNYXRoLm1heChtYXhOdW1IaWdoLCBtYXhOdW1IaWdoQ3VycmVudENvbXBvbmVudCk7XG4gICAgICBzaXplUGVyQ29tcG9uZW50W2NdID0ge1xuICAgICAgICByZXNvbHV0aW9uczogc2l6ZVBlclJl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ICAgICAgIGRhdGFbb2Zmc2V0ICsgcG9zaXRpb25dID09PSB2YWx1ZSkge1xuICAgICAgICBza2lwQnl0ZXMoMSk7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgfSBlbHNlIGlmIChkYXRhW29mZnNldCArIHBvc2l0aW9uXSA9PT0gMHhGRiAmJlxuICAgICAgICAgICAgICAgICBkYXRhW29mZnNldCArIHBvc2l0aW9uICsgMV0gPT09IHZhbHVlKSB7XG4gICAgICAgIHNraXBCeXRlcygyKTtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICB9XG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHNraXBCeXRlcyhjb3VudCkge1xuICAgICAgcG9zaXRpb24gKz0gY291bnQ7XG4gICAgfVxuICAgIGZ1bmN0aW9uIGFsaWduVG9CeXRlKCkge1xuICAgICAgYnVmZmVyU2l6ZSA9IDA7XG4gICAgICBpZiAoc2tpcE5leHRCaXQpIHtcbiAgICAgICAgcG9zaXRpb24rKztcbiAgICAgICAgc2tpcE5leHRCaXQgPSBmYWxzZTtcbiAgICAgIH1cbiAgICB9XG4gICAgZnVuY3Rpb24gcmVhZENvZGluZ3Bhc3NlcygpIHtcbiAgICAgIGlmIChyZWFkQml0cygxKSA9PT0gMCkge1xuICAgICAgICByZXR1cm4gMTtcbiAgICAgIH1cbiAgICAgIGlmIChyZWFkQml0cygxKSA9PT0gMCkge1xuICAgICAgICByZXR1cm4gMjtcbiAgICAgIH1cbiAgICAgIHZhciB2YWx1ZSA9IHJlYWRCaXRzKDIpO1xuICAgICAgaWYgKHZhbHVlIDwgMykge1xuICAgICAgICByZXR1cm4gdmFsdWUgKyAzO1xuICAgICAgfVxuICAgICAgdmFsdWUgPSByZWFkQml0cyg1KTtcbiAgICAgIGlmICh2YWx1ZSA8IDMxKSB7XG4gICAgICAgIHJldHVybiB2YWx1ZSArIDY7XG4gICAgICB9XG4gICAgICB2YWx1ZSA9IHJlY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ZWJsb2NrO1xuICAgICAgICBmb3IgKHZhciBpID0gMCwgaWkgPSBwYWNrZXQuY29kZWJsb2Nrcy5sZW5ndGg7IGkgPCBpaTsgaSsrKSB7XG4gICAgICAgICAgY29kZWJsb2NrID0gcGFja2V0LmNvZGVibG9ja3NbaV07XG4gICAgICAgICAgdmFyIHByZWNpbmN0ID0gY29kZWJsb2NrLnByZWNpbmN0O1xuICAgICAgICAgIHZhciBjb2RlYmxvY2tDb2x1bW4gPSBjb2RlYmxvY2suY2J4IC0gcHJlY2luY3QuY2J4TWluO1xuICAgICAgICAgIHZhciBjb2RlYmxvY2tSb3cgPSBjb2RlYmxvY2suY2J5IC0gcHJlY2luY3QuY2J5TWluO1xuICAgICAgICAgIHZhciBjb2RlYmxvY2tJbmNsdWRlZCA9IGZhbHNlO1xuICAgICAgICAgIHZhciBmaXJzdFRpbWVJbmNsdXNpb24gPSBmYWxzZTtcbiAgICAgICAgICB2YXIgdmFsdWVSZWFkeTtcbiAgICAgICAgICBpZiAoY29kZWJsb2NrWydpbmNsdWRlZCddICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIGNvZGVibG9ja0luY2x1ZGVkID0gISFyZWFkQml0cygxKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgLy8gcmVhZGluZyBpbmNsdXNpb24gdHJlZVxuICAgICAgICAgICAgcHJlY2luY3QgPSBjb2RlYmxvY2sucHJlY2luY3Q7XG4gICAgICAgICAgICB2YXIgaW5jbHVzaW9uVHJlZSwgemVyb0JpdFBsYW5lc1RyZWU7XG4gICAgICAgICAgICBpZiAocHJlY2luY3RbJ2luY2x1c2lvblRyZWUnXSAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgIGluY2x1c2lvblRyZWUgPSBwcmVjaW5jdC5pbmNsdXNpb25UcmVlO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgLy8gYnVpbGRpbmcgaW5jbHVzaW9uIGFuZCB6ZXJvIGJpdC1wbGFuZXMgdHJlZXNcbiAgICAgICAgICAgICAgdmFyIHdpZHRoID0gcHJlY2luY3QuY2J4TWF4IC0gcHJlY2luY3QuY2J4TWluICsgMTtcbiAgICAgICAgICAgICAgdmFyIGhlaWdodCA9IHByZWNpbmN0LmNieU1heCAtIHByZWNpbmN0LmNieU1pbiArIDE7XG4gICAgICAgICAgICAgIGluY2x1c2lvblRyZWUgPSBuZXcgSW5jbHVzaW9uVHJlZSh3aWR0aCwgaGVpZ2h0KTtcbiAgICAgICAgICAgICAgemVyb0JpdFBsYW5lc1RyZWUgPSBuZXcgVGFnVHJlZSh3aWR0aCwgaGVpZ2h0KTtcbiAgICAgICAgICAgICAgcHJlY2luY3QuaW5jbHVzaW9uVHJlZSA9IGluY2x1c2lvblRyZWU7XG4gICAgICAgICAgICAgIHByZWNpbmN0Lnplcm9CaXRQbGFuZXNUcmVlID0gemVyb0JpdFBsYW5lc1RyZWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGluY2x1c2lvblRyZWUucmVzZXQoY29kZWJsb2NrQ29sdW1uLCBjb2RlYmxvY2tSb3csIGxheWVyTnVtYmVyKTtcbiAgICAgICAgICAgIHdoaWxlICh0cnVlKSB7XG4gICAgICAgICAgICAgIGlmIChwb3NpdGlvbiA+PSBkYXRhLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAoaW5jbHVzaW9uVHJlZS5pc0Fib3ZlVGhyZXNob2xkKCkpe1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChpbmNsdXNpb25UcmVlLmlzS25vd24oKSkge1xuICAgICAgICAgICAgICAgIGluY2x1c2lvblRyZWUubmV4dExldmVsKCk7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKHJlYWRCaXRzKDEpKSB7XG4gICAgICAgICAgICAgICAgaW5jbHVzaW9uVHJlZS5zZXRLbm93bigpO1xuICAgICAgICAgICAgICAgIGlmIChpbmNsdXNpb25UcmVlLmlzTGVhZigpKSB7XG4gICAgICAgICAgICAgICAgICBjb2RlYmxvY2suaW5jbHVkZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgY29kZWJsb2NrSW5jbHVkZWQgPSBmaXJzdFRpbWVJbmNsdXNpb24gPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgIGluY2x1c2lvblRyZWUubmV4dExldmVsKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGluY2x1c2lvblRyZWUuaW5jcmVtZW50VmFsdWUoKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoIWNvZGVibG9ja0luY2x1ZGVkKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGZpcnN0VGltZUluY2x1c2lvbikge1xuICAgICAgICAgICAgemVyb0JpdFBsYW5lc1RyZWUgPSBwcmVjaW5jdC56ZXJvQml0UGxhbmVzVHJlZTtcbiAgICAgICAgICAgIHplcm9CaXRQbGFuZXNUcmVlLnJlc2V0KGNvZGVibG9ja0NvbHVtbiwgY29kZWJsb2NrUm93KTtcbiAgICAgICAgICAgIHdoaWxlICh0cnVlKSB7XG4gICAgICAgICAgICAgIGlmIChwb3NpdGlvbiA+PSBkYXRhLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAocmVhZEJpdHMoMSkpIHtcbiAgICAgICAgICAgICAgICB2YWx1ZVJlYWR5ID0gIXplcm9CaXR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lbmd0aFxuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIGFsaWduVG9CeXRlKCk7XG4gICAgICAgIGlmIChlcGhNYXJrZXJVc2VkKSB7XG4gICAgICAgICAgc2tpcE1hcmtlcklmRXF1YWwoMHg5Mik7XG4gICAgICAgIH1cbiAgICAgICAgd2hpbGUgKHF1ZXVlLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICB2YXIgcGFja2V0SXRlbSA9IHF1ZXVlLnNoaWZ0KCk7XG4gICAgICAgICAgY29kZWJsb2NrID0gcGFja2V0SXRlbS5jb2RlYmxvY2s7XG4gICAgICAgICAgaWYgKGNvZGVibG9ja1snZGF0YSddID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIGNvZGVibG9jay5kYXRhID0gW107XG4gICAgICAgICAgfVxuICAgICAgICAgIGNvZGVibG9jay5kYXRhLnB1c2goe1xuICAgICAgICAgICAgZGF0YTogZGF0YSxcbiAgICAgICAgICAgIHN0YXJ0OiBvZmZzZXQgKyBwb3NpdGlvbixcbiAgICAgICAgICAgIGVuZDogb2Zmc2V0ICsgcG9zaXRpb24gKyBwYWNrZXRJdGVtLmRhdGFMZW5ndGgsXG4gICAgICAgICAgICBjb2RpbmdwYXNzZXM6IHBhY2tldEl0ZW0uY29kaW5ncGFzc2VzXG4gICAgICAgICAgfSk7XG4gICAgICAgICAgcG9zaXRpb24gKz0gcGFja2V0SXRlbS5kYXRhTGVuZ3RoO1xuICAgICAgICB9XG4gICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIHBvc2l0aW9uO1xuICB9XG4gIGZ1bmN0aW9uIGNvcHlDb2VmZmljaWVudHMoY29lZmZpY2llbnRzLCBsZXZlbFdpZHRoLCBsZXZlbEhlaWdodCwgc3ViYmFuZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWx0YSwgbWIsIHJldmVyc2libGUsIHNlZ21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AxID0gY29tcG9uZW50c0NvdW50IC0gMztcbiAgICAgICAgamogPSB5MGl0ZW1zLmxlbmd0aDtcbiAgICAgICAgaWYgKCFjb21wb25lbnQwLmNvZGluZ1N0eWxlUGFyYW1ldGVycy5yZXZlcnNpYmxlVHJhbnNmb3JtYXRpb24pIHtcbiAgICAgICAgICAvLyBpbnZlcnNlIGlycmV2ZXJzaWJsZSBtdWx0aXBsZSBjb21wb25lbnQgdHJhbnNmb3JtXG4gICAgICAgICAgZm9yIChqID0gMDsgaiA8IGpqOyBqKyssIHBvcyArPSBhbHBoYTAxKSB7XG4gICAgICAgICAgICB5MCA9IHkwaXRlbXNbal0gKyBvZmZzZXQ7XG4gICAgICAgICAgICB5MSA9IHkxaXRlbXNbal07XG4gICAgICAgICAgICB5MiA9IHkyaXRlbXNbal07XG4gICAgICAgICAgICByID0geTAgKyAxLjQwMiAqIHkyO1xuICAgICAgICAgICAgZyA9IHkwIC0gMC4zNDQxMyAqIHkxIC0gMC43MTQxNCAqIHkyO1xuICAgICAgICAgICAgYiA9IHkwICsgMS43NzIgKiB5MTtcbiAgICAgICAgICAgIG91dFtwb3MrK10gPSByIDw9IDAgPyAwIDogciA+PSBtYXggPyAyNTUgOiByID4+IHNoaWZ0O1xuICAgICAgICAgICAgb3V0W3BvcysrXSA9IGcgPD0gMCA/IDAgOiBnID49IG1heCA/IDI1NSA6IGcgPj4gc2hpZnQ7XG4gICAgICAgICAgICBvdXRbcG9zKytdID0gYiA8PSAwID8gMCA6IGIgPj0gbWF4ID8gMjU1IDogYiA+PiBzaGlmdDtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgLy8gaW52ZXJzZSByZXZlcnNpYmxlIG11bHRpcGxlIGNvbXBvbmVudCB0cmFuc2Zvcm1cbiAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgamo7IGorKywgcG9zICs9IGFscGhhMDEpIHtcbiAgICAgICAgICAgIHkwID0geTBpdGVtc1tqXSArIG9mZnNldDtcbiAgICAgICAgICAgIHkxID0geTFpdGVtc1tqXTtcbiAgICAgICAgICAgIHkyID0geTJpdGVtc1tqXTtcbiAgICAgICAgICAgIGcgPSB5MCAtICgoeTIgKyB5MSkgPj4gMik7XG4gICAgICAgICAgICByID0gZyArIHkyO1xuICAgICAgICAgICAgYiA9IGcgKyB5MTtcbiAgICAgICAgICAgIG91dFtwb3MrK10gPSByIDw9IDAgPyAwIDogciA+PSBtYXggPyAyNTUgOiByID4+IHNoaWZ0O1xuICAgICAgICAgICAgb3V0W3BvcysrXSA9IGcgPD0gMCA/IDAgOiBnID49IG1heCA/IDI1NSA6IGcgPj4gc2hpZnQ7XG4gICAgICAgICAgICBvdXRbcG9zKytdID0gYiA8PSAwID8gMCA6IGIgPj0gbWF4ID8gMjU1IDogYiA+PiBzaGlmdDtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGZvdXJDb21wb25lbnRzKSB7XG4gICAgICAgICAgZm9yIChqID0gMCwgcG9zID0gMzsgaiA8IGpqOyBqKyssIHBvcyArPSA0KSB7XG4gICAgICAgICAgICBrID0geTNpdGVtc1tqXTtcbiAgICAgICAgICAgIG91dFtwb3NdID0gayA8PSBtaW4gPyAwIDogayA+PSBtYXhLID8gMjU1IDogKGsgKyBvZmZzZXQpID4+IHNoaWZ0O1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHsgLy8gbm8gbXVsdGktY29tcG9uZW50IHRyYW5zZm9ybVxuICAgICAgICBmb3IgKGMgPSAwOyBjIDwgY29tcG9uZW50c0NvdW50OyBjKyspIHtcbiAgICAgICAgICBpZiAoY29tcG9uZW50c1tjXS5wcmVjaXNpb24gPT09IDgpe1xuICAgICAgICAgICAgdmFyIGl0ZW1zID0gdHJhbnNmb3JtZWRUaWxlc1tjXS5pdGVtcztcbiAgICAgICAgICAgIHNoaWZ0ID0gY29tcG9uZW50c1tjXS5wcmVjaXNpb24gLSA4O1xuICAgICAgICAgICAgb2Zmc2V0ID0gKDEyOCA8PCBzaGlmdCkgKyAwLjU7XG4gICAgICAgICAgICBtYXggPSAoMTI3LjUgKiAoMSA8PCBzaGlmdCkpO1xuICAgICAgICAgICAgbWluID0gLW1heDtcbiAgICAgICAgICAgIGZvciAocG9zID0gYywgaiA9IDAsIGpqID0gaXRlbXMubGVuZ3RoOyBqIDwgamo7IGorKykge1xuICAgICAgICAgICAgICB2YWwgPSBpdGVtc1tqXTtcbiAgICAgICAgICAgICAgb3V0W3Bvc10gPSB2YWwgPD0gbWluID8gMCA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgdmFsID49IG1heCA/IDI1NSA6ICh2YWwgKyBvZmZzZXQpID4+IHNoaWZ0O1xuICAgICAgICAgICAgICBwb3MgKz0gY29tcG9uZW50c0NvdW50O1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1lbHNle1xuICAgICAgICAgICAgdmFyIGlzU2lnbmVkID0gY29tcG9uZW50c1tjXS5pc1NpZ25lZDtcbiAgICAgICAgICAgIHZhciBpdGVtcyA9IHRyYW5zZm9ybWVkVGlsZXNbY10uaXRlbXM7XG5cbiAgICAgICAgICAgIGlmKGlzU2lnbmVkKXtcbiAgICAgICAgICAgICAgZm9yIChwb3MgPSBjLCBqID0gMCwgamogPSBpdGVtcy5sZW5ndGg7IGogPCBqajsgaisrKSB7XG4gICAgICAgICAgICAgICAgb3V0W3Bvc10gPSBpdGVtc1tqXTtcbiAgICAgICAgICAgICAgICBwb3MgKz0gY29tcG9uZW50c0NvdW50O1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9ZWxzZXtcbiAgICAgICAgICAgICAgc2hpZnQgPSBjb21wb25lbnRzW2NdLnByZWNpc2lvbiAtIDg7XG4gICAgICAgICAgICAgIG9mZnNldCA9ICgxMjggPDwgc2hpZnQpICsgMC41O1xuICAgICAgICAgICAgICB2YXIgcHJlY2lzaW9uTWF4ID0gTWF0aC5wb3coMixjb21wb25lbnRzW2NdLnByZWNpc2lvbiktMTtcbiAgICAgICAgICAgICAgZm9yIChwb3MgPSBjLCBqID0gMCwgamogPSBpdGVtcy5sZW5ndGg7IGogPCBqajsgaisrKSB7XG4gICAgICAgICAgICAgICAgdmFsID0gaXRlbXNbal07XG4gICAgICAgICAgICAgICAgb3V0W3Bvc10gPSBNYXRoLm1heChNYXRoLm1pbigodmFsICsgb2Zmc2V0KSxwcmVjaXNpb25NYXgpLDApO1xuICAgICAgICAgICAgICAgIHBvcyArPSBjb21wb25lbnRzQ291bnQ7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJlc3VsdEltYWdlcy5wdXNoKHJlc3VsdCk7XG4gICAgfVxuICAgIHJldHVybiByZXN1bHRJbWFnZXM7XG4gIH1cbiAgZnVuY3Rpb24gaW5pdGlhbGl6ZVRpbGUoY29udGV4dCwgdGlsZUluZGV4KSB7XG4gICAgdmFyIHNpeiA9IGNvbnRleHQuU0laO1xuICAgIHZhciBjb21wb25lbnRzQ291bnQgPSBzaXouQ3NpejtcbiAgICB2YXIgdGlsZSA9IGNvbnRleHQudGlsZXNbdGlsZUluZGV4XTtcbiAgICBmb3IgKHZhciBjID0gMDsgYyA8IGNvbXBvbmVudHNDb3VudDsgYysrKSB7XG4gICAgICB2YXIgY29tcG9uZW50ID0gdGlsZS5jb21wb25lbnRzW2NdO1xuICAgICAgdmFyIHFjZE9yUWNjID0gKGNvbnRleHQuY3VycmVudFRpbGUuUUNDW2NdICE9PSB1bmRlZmluZWQgP1xuICAgICAgICBjb250ZXh0LmN1cnJlbnRUaWxlLlFDQ1tjXSA6IGNvbnRleHQuY3VycmVudFRpbGUuUUNEKTtcbiAgICAgIGNvbXBvbmVudC5xdWFudGl6YXRpb25QYXJhbWV0ZXJzID0gcWNkT3JRY2M7XG4gICAgICB2YXIgY29kT3JDb2MgPSAoY29udGV4dC5jdXJyZW50VGlsZS5DT0NbY10gIT09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cmVnaW9uIHRyZWF0ZWQgYXMgaW5zaWduaWZpY2FudFxuICAgICAgLy8gYWRkIGJvcmRlciBzdGF0ZSBjZWxscyBmb3Igc2lnbmlmaWNhbmNlU3RhdGVcbiAgICAgIHRoaXMubmVpZ2hib3JzU2lnbmlmaWNhbmNlID0gbmV3IFVpbnQ4QXJyYXkoY29lZmZpY2llbnRDb3VudCk7XG4gICAgICB0aGlzLmNvZWZmaWNlbnRzU2lnbiA9IG5ldyBVaW50OEFycmF5KGNvZWZmaWNpZW50Q291bnQpO1xuICAgICAgdGhpcy5jb2VmZmljZW50c01hZ25pdHVkZSA9IG1iID4gMTQgPyBuZXcgVWludDMyQXJyYXkoY29lZmZpY2llbnRDb3VudCkgOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1iID4gNiA/IG5ldyBVaW50MTZBcnJheShjb2VmZmljaWVudENvdW50KSA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IFVpbnQ4QXJyYXkoY29lZmZpY2llbnRDb3VudCk7XG4gICAgICB0aGlzLnByb2Nlc3NpbmdGbGFncyA9IG5ldyBVaW50OEFycmF5KGNvZWZmaWNpZW50Q291bnQpO1xuXG4gICAgICB2YXIgYml0c0RlY29kZWQgPSBuZXcgVWludDhBcnJheShjb2VmZmljaWVudENvdW50KTtcbiAgICAgIGlmICh6ZXJvQml0UGxhbmVzICE9PSAwKSB7XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY29lZmZpY2llbnRDb3VudDsgaSsrKSB7XG4gICAgICAgICAgYml0c0RlY29kZWRbaV0gPSB6ZXJvQml0UGxhbmVzO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICB0aGlzLmJpdHNEZWNvZGVkID0gYml0c0RlY29kZWQ7XG5cbiAgICAgIHRoaXMucmVzZXQoKTtcbiAgICB9XG5cbiAgICBCaXRNb2RlbC5wcm90b3R5cGUgPSB7XG4gICAgICBzZXREZWNvZGVyOiBmdW5jd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4gMCk7XG4gICAgICAgIHZhciByaWdodCA9IChjb2x1bW4gKyAxIDwgd2lkdGgpO1xuICAgICAgICB2YXIgaTtcblxuICAgICAgICBpZiAocm93ID4gMCkge1xuICAgICAgICAgIGkgPSBpbmRleCAtIHdpZHRoO1xuICAgICAgICAgIGlmIChsZWZ0KSB7XG4gICAgICAgICAgICBuZWlnaGJvcnNTaWduaWZpY2FuY2VbaSAtIDFdICs9IDB4MTA7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChyaWdodCkge1xuICAgICAgICAgICAgbmVpZ2hib3JzU2lnbmlmaWNhbmNlW2kgKyAxXSArPSAweDEwO1xuICAgICAgICAgIH1cbiAgICAgICAgICBuZWlnaGJvcnNTaWduaWZpY2FuY2VbaV0gKz0gMHgwNDtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChyb3cgKyAxIDwgaGVpZ2h0KSB7XG4gICAgICAgICAgaSA9IGluZGV4ICsgd2lkdGg7XG4gICAgICAgICAgaWYgKGxlZnQpIHtcbiAgICAgICAgICAgIG5laWdoYm9yc1NpZ25pZmljYW5jZVtpIC0gMV0gKz0gMHgxMDtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHJpZ2h0KSB7XG4gICAgICAgICAgICBuZWlnaGJvcnNTaWduaWZpY2FuY2VbaSArIDFdICs9IDB4MTA7XG4gICAgICAgICAgfVxuICAgICAgICAgIG5laWdoYm9yc1NpZ25pZmljYW5jZVtpXSArPSAweDA0O1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGxlZnQpIHtcbiAgICAgICAgICBuZWlnaGJvcnNTaWduaWZpY2FuY2VbaW5kZXggLSAxXSArPSAweDAxO1xuICAgICAgICB9XG4gICAgICAgIGlmIChyaWdodCkge1xuICAgICAgICAgIG5laWdoYm9yc1NpZ25pZmljYW5jZVtpbmRleCArIDFdICs9IDB4MDE7XG4gICAgICAgIH1cbiAgICAgICAgbmVpZ2hib3JzU2lnbmlmaWNhbmNlW2luZGV4XSB8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iAgICAgICAgICAgIGZvciAodmFyIGkxID0gMDsgaTEgPCA0OyBpMSsrLCBpbmRleCArPSB3aWR0aCkge1xuICAgICAgICAgICAgICB2YXIgaSA9IGkwICsgaTE7XG4gICAgICAgICAgICAgIGlmIChpID49IGhlaWdodCkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIC8vIGNsZWFyIHByb2Nlc3NlZCBmbGFnIGZpcnN0XG4gICAgICAgICAgICAgIHByb2Nlc3NpbmdGbGFnc1tpbmRleF0gJj0gcHJvY2Vzc2VkSW52ZXJzZU1hc2s7XG5cbiAgICAgICAgICAgICAgaWYgKGNvZWZmaWNlbnRzTWFnbml0dWRlW2luZGV4XSB8fFxuICAgICAgICAgICAgICAgICAgIW5laWdoYm9yc1NpZ25pZmljYW5jZVtpbmRleF0pIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHZhciBjb250ZXh0TGFiZWwgPSBsYWJlbHNbbmVpZ2hib3JzU2lnbmlmaWNhbmNlW2luZGV4XV07XG4gICAgICAgICAgICAgIHZhciBkZWNpc2lvbiA9IGRlY29kZXIucmVhZEJpdChjb250ZXh0cywgY29udGV4dExhYmVsKTtcbiAgICAgICAgICAgICAgaWYgKGRlY2lzaW9uKSB7XG4gICAgICAgICAgICAgICAgdmFyIHNpZ24gPSB0aGlzLmRlY29kZVNpZ25CaXQoaSwgaiwgaW5kZXgpO1xuICAgICAgICAgICAgICAgIGNvZWZmaWNlbnRzU2lnbltpbmRleF0gPSBzaWduO1xuICAgICAgICAgICAgICAgIGNvZWZmaWNlbnRzTWFnbml0dWRlW2luZGV4XSA9IDE7XG4gICAgICAgICAgICAgICAgdGhpcy5zZXROZWlnaGJvcnNTaWduaWZpY2FuY2UoaSwgaiwgaW5kZXgpO1xuICAgICAgICAgICAgICAgIHByb2Nlc3NpbmdGbGFnc1tpbmRleF0gfD0g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WduW2luZGV4IC0gMV07XG4gICAgICAgICAgICBjb250cmlidXRpb24gPSAxIC0gc2lnbjEgLSBzaWduMDtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgY29udHJpYnV0aW9uID0gMSAtIHNpZ24xIC0gc2lnbjE7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKHNpZ25pZmljYW5jZTEpIHtcbiAgICAgICAgICBzaWduMCA9IGNvZWZmaWNlbnRzU2lnbltpbmRleCAtIDFdO1xuICAgICAgICAgIGNvbnRyaWJ1dGlvbiA9IDEgLSBzaWduMCAtIHNpZ24wO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGNvbnRyaWJ1dGlvbiA9IDA7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIGhvcml6b250YWxDb250cmlidXRpb24gPSAzICogY29udHJpYnV0aW9uO1xuXG4gICAgICAgIC8vIGNhbGN1bGF0ZSB2ZXJ0aWNhbCBjb250cmlidXRpb24gYW5kIGNvbWJpbmUgd2l0aCB0aGUgaG9yaXpvbnRhbFxuICAgICAgICBzaWduaWZpY2FuY2UxID0gKHJvdyA+IDAgJiYgY29lZmZpY2VudHNNYWduaXR1ZGVbaW5kZXggLSB3aWR0aF0gIT09IDApO1xuICAgICAgICBpZiAocm93ICsgMSA8IGhlaWdodCAmJiBjb2VmZmljZW50c01hZ25pdHVkZVtpbmRleCArIHdpZHRoXSAhPT0gMCkge1xuICAgICAgICAgIHNpZ24xID0gY29lZmZpY2VudHNTaWduW2luZGV4ICsgd2lkdGhdO1xuICAgICAgICAgIGlmIChzaWduaWZpY2FuY2UxKSB7XG4gICAgICAgICAgICBzaWduMCA9IGNvZWZmaWNlbnRzU2lnbltpbmRleCAtIHdpZHRoXTtcbiAgICAgICAgICAgIGNvbnRyaWJ1dGlvbiA9IDEgLSBzaWduMSAtIHNpZ24wICsgaG9yaXpvbnRhbENvbnRyaWJ1dGlvbjtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgY29udHJpYnV0aW9uID0gMSAtIHNpZ24xIC0gc2lnbjEgKyBob3Jpem9udGFsQ29udHJpYnV0aW9uO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChzaWduaWZpY2FuY2UxKSB7XG4gICAgICAgICAgc2lnbjAgPSBjb2VmZmljZW50c1NpZ25baW5kZXggLSB3aWR0aF07XG4gICAgICAgICAgY29udHJpYnV0aW9uID0gMSAtIHNpZ24wIC0gc2lnbjAgKyBob3Jpem9udGFsQ29udHJpYnV0aW9uO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGNvbnRyaWJ1dGlvbiA9IGhvcml6b250YWxDb250cmlidXRpb247XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoY29udHJpYnV0aW9uID49IDApIHtcbiAgICAgICAgICBjb250ZXh0TGFiZWwgPSA5ICsgY29udHJpYnV0aW9uO1xuICAgICAgICAgIGRlY29kZWQgPSB0aGlzLmRlY29kZXIucmVhZEJpdCh0aGlzLmNvbnRleHRzLCBjb250ZXh0TGFiZWwpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGNvbnRleHRMYWJlbCA9IDkgLSBjb250cmlidXRpb247XG4gICAgICAgICAgZGVjb2RlZCA9IHRoaXMuZGVjb2Rlci5yZWFkQml0KHRoaXMuY29udGV4dHMsIGNvbnRleHRMYWJlbCkgXiAxO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBkZWNvZGVkO1xuICAgICAgfSxcbiAgICAgIHJ1bk1hZ25pdHVkZVJlZmluZW1lbnRQYXNzOlxuICAgICAgICBmdW5jdGlvbiBCaXRNb2RlbF9ydW5NYWduaXR1ZGVSZWZpbmVtZW50UGFzcygpIHtcbiAgICAgICAgdmFyIGRlY29kZXIgPSB0aGlzLmRlY29kZXI7XG4gICAgICAgIHZhciB3aWR0aCA9IHRoaXMud2lkdGgsIGhlaWdodCA9IHRoaXMuaGVpZ2h0O1xuICAgICAgICB2YXIg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AhPT0gMCkge1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgdmFyIGNvbnRleHRMYWJlbCA9IDE2O1xuICAgICAgICAgICAgICBpZiAoKHByb2Nlc3NpbmdGbGFnc1tpbmRleF0gJiBmaXJzdE1hZ25pdHVkZUJpdE1hc2spICE9PSAwKSB7XG4gICAgICAgICAgICAgICAgcHJvY2Vzc2luZ0ZsYWdzW2luZGV4XSBePSBmaXJzdE1hZ25pdHVkZUJpdE1hc2s7XG4gICAgICAgICAgICAgICAgLy8gZmlyc3QgcmVmaW5lbWVudFxuICAgICAgICAgICAgICAgdmFyIHNpZ25pZmljYW5jZSA9IG5laWdoYm9yc1NpZ25pZmljYW5jZVtpbmRleF0gJiAxMjc7XG4gICAgICAgICAgICAgICBjb250ZXh0TGFiZWwgPSBzaWduaWZpY2FuY2UgPT09IDAgPyAxNSA6IDE0O1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgdmFyIGJpdCA9IGRlY29kZXIucmVhZEJpdChjb250ZXh0cywgY29udGV4dExhYmVsKTtcbiAgICAgICAgICAgICAgY29lZmZpY2VudHNNYWduaXR1ZGVbaW5kZXhdID1cbiAgICAgICAgICAgICAgICAoY29lZmZpY2VudHNNYWduaXR1ZGVbaW5kZXhdIDw8IDEpIHwgYml0O1xuICAgICAgICAgICAgICBiaXRzRGVjb2RlZFtpbmRleF0rKztcbiAgICAgICAgICAgICAgcHJvY2Vzc2luZ0ZsYWdzW2luZGV4XSB8PSBwcm9jZXNzZWRNYXNrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIHJ1bkNsZWFudXBQYXNzOiBmdW5jdGlvbiBCaXRNb2RlbF9ydW5DbGVhbnVwUGFzcygpIHtcbiAgICAgICAgdmFyIGRlY29kZXIgPSB0aGlzLmRlY29kZXI7XG4gICAgICAgIHZhciB3aWR0aCA9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gICAgICAgICAgICB2YXIgaW5kZXgwID0gaW5kZXhCYXNlICsgajtcbiAgICAgICAgICAgIC8vIHVzaW5nIHRoZSBwcm9wZXJ0eTogbGFiZWxzW25laWdoYm9yc1NpZ25pZmljYW5jZVtpbmRleF1dID09PSAwXG4gICAgICAgICAgICAvLyB3aGVuIG5laWdoYm9yc1NpZ25pZmljYW5jZVtpbmRleF0gPT09IDBcbiAgICAgICAgICAgIHZhciBhbGxFbXB0eSA9IChjaGVja0FsbEVtcHR5ICYmXG4gICAgICAgICAgICAgIHByb2Nlc3NpbmdGbGFnc1tpbmRleDBdID09PSAwICYmXG4gICAgICAgICAgICAgIHByb2Nlc3NpbmdGbGFnc1tpbmRleDAgKyBvbmVSb3dEb3duXSA9PT0gMCAmJlxuICAgICAgICAgICAgICBwcm9jZXNzaW5nRmxhZ3NbaW5kZXgwICsgdHdvUm93c0Rvd25dID09PSAwICYmXG4gICAgICAgICAgICAgIHByb2Nlc3NpbmdGbGFnc1tpbmRleDAgKyB0aHJlZVJvd3NEb3duXSA9PT0gMCAmJlxuICAgICAgICAgICAgICBuZWlnaGJvcnNTaWduaWZpY2FuY2VbaW5kZXgwXSA9PT0gMCAmJlxuICAgICAgICAgICAgICBuZWlnaGJvcnNTaWduaWZpY2FuY2VbaW5kZXgwICsgb25lUm93RG93bl0gPT09IDAgJiZcbiAgICAgICAgICAgICAgbmVpZ2hib3JzU2lnbmlmaWNhbmNlW2luZGV4MCArIHR3b1Jvd3NEb3duXSA9PT0gMCAmJlxuICAgICAgICAgICAgICBuZWlnaGJvcnNTaWduaWZpY2FuY2VbaW5kZXgwICsgdGhyZWVSb3dzRG93bl0gPT09IDApO1xuICAgICAgICAgICAgdmFyIGkxID0gMCwgaW5kZXggPSBpbmRleDA7XG4gICAgICAgICAgICB2YXIgaSA9IGkwLCBzaWduO1xuICAgICAgICAgICAgaWYgKGFsbEVtcHR5KSB7XG4gICAgICAgICAgICAgIHZhciBoYXNTaWduaWZpY2FudENvZWZmaWNlbnQgPVxuICAgICAgICAgICAgICAgIGRlY29kZXIucmVhZEJpdChjb250ZXh0cywgUlVOTEVOR1RIX0NPTlRFWFQpO1xuICAgICAgICAgICAgICBpZiAoIWhhc1NpZ25pZmljYW50Q29lZmZpY2VudCkge1xuICAgICAgICAgICAgICAgIGJpdHNEZWNvZGVkW2luZGV4MF0rKztcbiAgICAgICAgICAgICAgICBiaXRzRGVjb2RlZFtpbmRleDAgKyBvbmVSb3dEb3duXSsrO1xuICAgICAgICAgICAgICAgIGJpdHNEZWNvZGVkW2luZGV4MCArIHR3b1Jvd3NEb3duXSsrO1xuICAgICAgICAgICAgICAgIGJpdHNEZWNvZGVkW2luZGV4MCArIHRocmVlUm93c0Rvd25dKys7XG4gICAgICAgICAgICAgICAgY29udGludWU7IC8vIG5leHQgY29sdW1uXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaTEgPSAoZGVjb2Rlci5yZWFkQml0KGNvbnRleHRzLCBVTklGT1JNX0NPTlRFWFQpIDw8IDEpIHxcbiAgICAgICAgICAgICAgICAgICAgZGVjb2Rlci5yZWFkQml0KGNvbnRleHRzLCBVTklGT1JNX0NPTlRFWFQpO1xuICAgICAgICAgICAgICBpZiAoaTEgIT09IDApIHtcbiAgICAgICAgICAgICAgICBpID0gaTAgKyBpMTtcbiAgICAgICAgICAgICAgICBpbmRleCArPSBpMSAqIHdpZHRoO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgc2lnbiA9IHRoaXMuZGVjb2RlU2lnbkJpdChpLCBqLCBpbmRleCk7XG4gICAgICAgICAgICAgIGNvZWZmaWNlbnRzU2lnbltpbmRleF0gPSBzaWduO1xuICAgICAgICAgICAgICBjb2VmZmljZW50c01hZ25pdHVkZVtpbmRleF0gPSAxO1xuICAgICAgICAgICAgICB0aGlzLnNldE5laWdoYm9yc1NpZ25pZmljYW5jZShpLCBqLCBpbmRleCk7XG4gICAgICAgICAgICAgIHByb2Nlc3NpbmdGbGFnc1tpbmRleF0gfD0gZmlyc3RNYWduaXR1ZGVCaXRNYXNrO1xuXG4gICAgICAgICAgICAgIGluZGV4ID0gaW5kZXgwO1xuICAgICAgICAgICAgICBmb3IgKHZhciBpMiA9IGkwOyBpMiA8PSBpOyBpMisrLCBpbmRleCArPSB3aWR0aCkge1xuICAgICAgICAgICAgICAgIGJpdHNEZWNvZGVkW2luZGV4XSsrO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgaTErKztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZvciAoaSA9IGkwICsgaTE7IGkgPCBpTmV4dDsgaSsrLCBpbmRleCArPSB3aWR0aCkge1xuICAgICAgICAgICAgICBpZiAoY29lZmZpY2VudHNNYWduaXR1ZGVbaW5kZXhdIHx8XG4gICAgICAgICAgICAgICAgKHByb2Nlc3NpbmdGbGFnc1tpbmRleF0gJiBwcm9jZXNzZWRNYXNrKSAhPT0gMCkge1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgdmFyIGNvbnRleHRMYWJlbCA9IGxhYmVsc1tuZWlnaGJvcnNTaWduaWZpY2FuY2VbaW5kZXhdXTtcbiAgICAgICAgICAgICAgdmFyIGRlY2lzaW9uID0gZGVjb2Rlci5yZWFkQml0KGNvbnRleHRzLCBjb250ZXh0TGFiZWwpO1xuICAgICAgICAgICAgICBpZiAoZGVjaXNpb24gPT09IDEpIHtcbiAgICAgICAgICAgICAgICBzaWduID0gdGhpcy5kZWNvZGVTaWduQml0KGksIGosIGluZGV4KTtcbiAgICAgICAgICAgICAgICBjb2VmZmljZW50c1NpZ25baW5kZXhdID0gc2lnbjtcbiAgICAgICAgICAgICAgICBjb2VmZmljZW50c01hZ25pdHVkZVtpbmRleF0gPSAxO1xuICAgICAgICAgICAgICAgIHRoaXMuc2V0TmVpZ2hib3JzU2lnbmlmaWNhbmNlKGksIGosIGluZGV4KTtcbiAgICAgICAgICAgICAgICBwcm9jZXNzaW5nRmxhZ3NbaW5kZXhdIHw9IGZpcnN0TWFnbml0dWRlQml0TWFzaztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBiaXRzRGVjb2RlZFtpbmRleF0rKztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBjaGVja1NlZ21lbnRhdGlvblN5bWJvbDogZnVuY3Rpb24gQml0TW9kZWxfY2hlY2tTZWdtZW50YXRpb25TeW1ib2woKSB7XG4gICAgICAgIHZhciBkZWNvZGVyID0gdGhpcy5kZWNvZGVyO1xuICAgICAgICB2YXIgY29udGV4dHMgPSB0aGlzLmNvbnRleHRzO1xuICAgICAgICB2YXIgc3ltYm9sID0gKGRlY29kZXIucmVhZEJpdChjb250ZXh0cywgVU5JRk9STV9DT05URVhUKSA8PCAzKSB8XG4gICAgICAgICAgICAgICAgICAgICAoZGVjb2Rlci5yZWFkQml0KGNvbnRleHRzLCBVTklGT1JNX0NPTlRFWFQpIDw8IDIpIHxcbiAgICAgICAgICAgICAgICAgICAgIChkZWNvZGVyLnJlYWRCaXQoY29udGV4dHMsIFVOSUZPUk1fQ09OVEVYVCkgPDwgMSkgfFxuICAgICAgICAgICAgICAgICAgICAgIGRlY29kZXIucmVhZEJpdChjb250ZXh0cywgVU5JRk9STV9DT05URVhUKTtcbiAgICAgICAgaWYgKHN5bWJvbCAhPT0gMHhBKSB7XG4gICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdKUFggRXJyb3I6IEludmFsaWQgc2VnbWVudGF0aW9uIHN5bWJvbCcpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfTtcblxuICAgIHJldHVybiBCaXRNb2RlbDtcbiAgfSkoKTtcblxuICAvLyBTZWN0aW9uIEYsIERpc2NyZXRlIHdhdmVsZXQgdHJhbnNmb3JtYXRpb25cbiAgdmFyIFRyYW5zZm9ybSA9IChmdW5jdGlvbiBUcmFuc2Zvcm1DbG9zdXJl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sgMV07XG4gICAgICAgIHhbal0gLT0gY3VycmVudCArIG5leHQ7XG4gICAgICAgIGlmIChuLS0pIHtcbiAgICAgICAgICBqICs9IDI7XG4gICAgICAgICAgY3VycmVudCA9IGdhbW1hICogeFtqICsgMV07XG4gICAgICAgICAgeFtqXSAtPSBjdXJyZW50ICsgbmV4dDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICAvLyBzdGVwIDVcbiAgICAgIGogPSBvZmZzZXQ7XG4gICAgICBjdXJyZW50ID0gYmV0YSAqIHhbaiAtIDFdO1xuICAgICAgZm9yIChuID0gbGVuICsgMTsgbi0tOyBqICs9IDIpIHtcbiAgICAgICAgbmV4dCA9IGJldGEgKiB4W2ogKyAxXTtcbiAgICAgICAgeFtqXSAtPSBjdXJyZW50ICsgbmV4dDtcbiAgICAgICAgaWYgKG4tLSkge1xuICAgICAgICAgIGogKz0gMjtcbiAgICAgICAgICBjdXJyZW50ID0gYmV0YSAqIHhbaiArIDFdO1xuICAgICAgICAgIHhbal0gLT0gY3VycmVudCArIG5leHQ7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgLy8gc3RlcCA2XG4gICAgICBpZiAobGVuICE9PSAwKSB7XG4gICAgICAgIGogPSBvZmZzZXQgKyAxO1xuICAgICAgICBjdXJyZW50ID0gYWxwaGEgKiB4W2ogLSAxXTtcbiAgICAgICAgZm9yIChuID0gbGVuOyBuLS07IGogKz0gMikge1xuICAgICAgICAgIG5leHQgPSBhbHBoYSAqIHhbaiArIDFdO1xuICAgICAgICAgIHhbal0gLT0gY3VycmVudCArIG5leHQ7XG4gICAgICAgICAgaWYgKG4tLSkge1xuICAgICAgICAgICAgaiArPSAyO1xuICAgICAgICAgICAgY3VycmVudCA9IGFscGhhICogeFtqICsgMV07XG4gICAgICAgICAgICB4W2pdIC09IGN1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zZS5hbGwgPSBmdW5jdGlvbiAoaXRlcmFibGUpIHtcbiAgICAgICAgdmFyIGNvdW50ID0gMCwgcmVzdWx0cyA9IFtdLCByZXNvbHZlLCByZWplY3Q7XG4gICAgICAgIHZhciBwcm9taXNlID0gbmV3IGdsb2JhbFNjb3BlLlByb21pc2UoZnVuY3Rpb24gKHJlc29sdmVfLCByZWplY3RfKSB7XG4gICAgICAgICAgcmVzb2x2ZSA9IHJlc29sdmVfO1xuICAgICAgICAgIHJlamVjdCA9IHJlamVjdF87XG4gICAgICAgIH0pO1xuICAgICAgICBpdGVyYWJsZS5mb3JFYWNoKGZ1bmN0aW9uIChwLCBpKSB7XG4gICAgICAgICAgY291bnQrKztcbiAgICAgICAgICBwLnRoZW4oZnVuY3Rpb24gKHJlc3VsdCkge1xuICAgICAgICAgICAgcmVzdWx0c1tpXSA9IHJlc3VsdDtcbiAgICAgICAgICAgIGNvdW50LS07XG4gICAgICAgICAgICBpZiAoY291bnQgPT09IDApIHtcbiAgICAgICAgICAgICAgcmVzb2x2ZShyZXN1bHRzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9LCByZWplY3QpO1xuICAgICAgICB9KTtcbiAgICAgICAgaWYgKGNvdW50ID09PSAwKSB7XG4gICAgICAgICAgcmVzb2x2ZShyZXN1bHRzKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcHJvbWlzZTtcbiAgICAgIH07XG4gICAgfVxuICAgIGlmICh0eXBlb2YgZ2xvYmFsU2NvcGUuUHJvbWlzZS5yZXNvbHZlICE9PSAnZnVuY3Rpb24nKSB7XG4gICAgICBnbG9iYWxTY29wZS5Qcm9taXNlLnJlc29sdmUgPSBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgcmV0dXJuIG5ldyBnbG9iYWxTY29wZS5Qcm9taXNlKGZ1bmN0aW9uIChyZXNvbHZlKSB7IHJlc29sdmUodmFsdWUpOyB9KTtcbiAgICAgIH07XG4gICAgfVxuICAgIGlmICh0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ZiAocy53cmFwID09PSAyKSB7IC8vIEdaSVAgaGVhZGVyXG4gICAgICBzdHJtLmFkbGVyID0gMDsgIC8vY3JjMzIoMEwsIFpfTlVMTCwgMCk7XG4gICAgICBwdXRfYnl0ZShzLCAzMSk7XG4gICAgICBwdXRfYnl0ZShzLCAxMzkpO1xuICAgICAgcHV0X2J5dGUocywgOCk7XG4gICAgICBpZiAoIXMuZ3poZWFkKSB7IC8vIHMtPmd6aGVhZCA9PSBaX05VTExcbiAgICAgICAgcHV0X2J5dGUocywgMCk7XG4gICAgICAgIHB1dF9ieXRlKHMsIDApO1xuICAgICAgICBwdXRfYnl0ZShzLCAwKTtcbiAgICAgICAgcHV0X2J5dGUocywgMCk7XG4gICAgICAgIHB1dF9ieXRlKHMsIDApO1xuICAgICAgICBwdXRfYnl0ZShzLCBzLmxldmVsID09PSA5ID8gMiA6XG4gICAgICAgICAgICAgICAgICAgIChzLnN0cmF0ZWd5ID49IFpfSFVGRk1BTl9PTkxZIHx8IHMubGV2ZWwgPCAyID9cbiAgICAgICAgICAgICAgICAgICAgIDQgOiAwKSk7XG4gICAgICAgIHB1dF9ieXRlKHMsIE9TX0NPREUpO1xuICAgICAgICBzLnN0YXR1cyA9IEJVU1lfU1RBVEU7XG4gICAgICB9XG4gICAgICBlbHNlIHtcbiAgICAgICAgcHV0X2J5dGUocywgKHMuZ3poZWFkLnRleHQgPyAxIDogMCkgK1xuICAgICAgICAgICAgICAgICAgICAocy5nemhlYWQuaGNyYyA/IDIgOiAwKSArXG4gICAgICAgICAgICAgICAgICAgICghcy5nemhlYWQuZXh0cmEgPyAwIDogNCkgK1xuICAgICAgICAgICAgICAgICAgICAoIXMuZ3poZWFkLm5hbWUgPyAwIDogOCkgK1xuICAgICAgICAgICAgICAgICAgICAoIXMuZ3poZWFkLmNvbW1lbnQgPyAwIDogMTYpXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgcHV0X2J5dGUocywgcy5nemhlYWQudGltZSAmIDB4ZmYpO1x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ICAgICAgb3AgPSBoZXJlID4+PiAyNC8qaGVyZS5iaXRzKi87XG4gICAgICBob2xkID4+Pj0gb3A7XG4gICAgICBiaXRzIC09IG9wO1xuICAgICAgb3AgPSAoaGVyZSA+Pj4gMTYpICYgMHhmZi8qaGVyZS5vcCovO1xuICAgICAgaWYgKG9wID09PSAwKSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBsaXRlcmFsICovXG4gICAgICAgIC8vVHJhY2V2digoc3RkZXJyLCBoZXJlLnZhbCA+PSAweDIwICYmIGhlcmUudmFsIDwgMHg3ZiA/XG4gICAgICAgIC8vICAgICAgICBcImluZmxhdGU6ICAgICAgICAgbGl0ZXJhbCAnJWMnXFxuXCIgOlxuICAgICAgICAvLyAgICAgICAgXCJpbmZsYXRlOiAgICAgICAgIGxpdGVyYWwgMHglMDJ4XFxuXCIsIGhlcmUudmFsKSk7XG4gICAgICAgIG91dHB1dFtfb3V0KytdID0gaGVyZSAmIDB4ZmZmZi8qaGVyZS52YWwqLztcbiAgICAgIH1cbiAgICAgIGVsc2UgaWYgKG9wICYgMTYpIHsgICAgICAgICAgICAgICAgICAgICAvKiBsZW5ndGggYmFzZSAqL1xuICAgICAgICBsZW4gPSBoZXJlICYgMHhmZmZmLypoZXJlLnZhbCovO1xuICAgICAgICBvcCAmPSAxNTsgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBudW1iZXIgb2YgZXh0cmEgYml0cyAqL1xuICAgICAgICBpZiAob3ApIHtcbiAgICAgICAgICBpZiAoYml0cyA8IG9wKSB7XG4gICAgICAgICAgICBob2xkICs9IGlucHV0W19pbisrXSA8PCBiaXRzO1xuICAgICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICAgIH1cbiAgICAgICAgICBsZW4gKz0gaG9sZCAmICgoMSA8PCBvcCkgLSAxKTtcbiAgICAgICAgICBob2xkID4+Pj0gb3A7XG4gICAgICAgICAgYml0cyAtPSBvcDtcbiAgICAgICAgfVxuICAgICAgICAvL1RyYWNldnYoKHN0ZGVyciwgXCJpbmZsYXRlOiAgICAgICAgIGxlbmd0aCAldVxcblwiLCBsZW4pKTtcbiAgICAgICAgaWYgKGJpdHMgPCAxNSkge1xuICAgICAgICAgIGhvbGQgKz0gaW5wdXRbX2luKytdIDw8IGJpdHM7XG4gICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICAgIGhvbGQgKz0gaW5wdXRbX2luKytdIDw8IGJpdHM7XG4gICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICB9XG4gICAgICAgIGhlcmUgPSBkY29kZVtob2xkICYgZG1hc2tdO1xuXG4gICAgICAgIGRvZGlzdDpcbiAgICAgICAgZm9yICg7OykgeyAvLyBnb3RvIGVtdWxhdGlvblxuICAgICAgICAgIG9wID0gaGVyZSA+Pj4gMjQvKmhlcmUuYml0cyovO1xuICAgICAgICAgIGhvbGQgPj4+PSBvcDtcbiAgICAgICAgICBiaXRzIC09IG9wO1xuICAgICAgICAgIG9wID0gKGhlcmUgPj4+IDE2KSAmIDB4ZmYvKmhlcmUub3AqLztcblxuICAgICAgICAgIGlmIChvcCAmIDE2KSB7ICAgICAgICAgICAgICAgICAgICAgIC8qIGRpc3RhbmNlIGJhc2UgKi9cbiAgICAgICAgICAgIGRpc3QgPSBoZXJlICYgMHhmZmZmLypoZXJlLnZhbCovO1xuICAgICAgICAgICAgb3AgJj0gMTU7ICAgICAgICAgICAgICAgICAgICAgICAvKiBudW1iZXIgb2YgZXh0cmEgYml0cyAqL1xuICAgICAgICAgICAgaWYgKGJpdHMgPCBvcCkge1xuICAgICAgICAgICAgICBob2xkICs9IGlucHV0W19pbisrXSA8PCBiaXRzO1xuICAgICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgICAgIGlmIChiaXRzIDwgb3ApIHtcbiAgICAgICAgICAgICAgICBob2xkICs9IGlucHV0W19pbisrXSA8PCBiaXRzO1xuICAgICAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZGlzdCArPSBob2xkICYgKCgxIDw8IG9wKSAtIDEpO1xuLy8jaWZkZWYgSU5GTEFURV9TVFJJQ1RcbiAgICAgICAgICAgIGlmIChkaXN0ID4gZG1heCkge1xuICAgICAgICAgICAgICBzdHJtLm1zZyA9ICdpbnZhbGlkIGRpc3RhbmNlIHRvbyBmYXIgYmFjayc7XG4gICAgICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgICAgIGJyZWFrIHRvcDtcbiAgICAgICAgICAgIH1cbi8vI2VuZGlmXG4gICAgICAgICAgICBob2xkID4+Pj0gb3A7XG4gICAgICAgICAgICBiaXRzIC09IG9wO1xuICAgICAgICAgICAgLy9UcmFjZXZ2KChzdGRlcnIsIFwiaW5mbGF0ZTogICAgICAgICBkaXN0YW5jZSAldVxcblwiLCBkaXN0KSk7XG4gICAgICAgICAgICBvcCA9IF9vdXQgLSBiZWc7ICAgICAgICAgICAgICAgIC8qIG1heCBkaXN0YW5jZSBpbiBvdXRwdXQgKi9cbiAgICAgICAgICAgIGlmIChkaXN0ID4gb3ApIHsgICAgICAgICAgICAgICAgLyogc2VlIGlmIGNvcHkgZnJvbSB3aW5kb3cgKi9cbiAgICAgICAgICAgICAgb3AgPSBkaXN0IC0gb3A7ICAgICAgICAgICAgICAgLyogZGlzdGFuY2UgYmFjayBpbiB3aW5kb3cgKi9cbiAgICAgICAgICAgICAgaWYgKG9wID4gd2hhdmUpIHtcbiAgICAgICAgICAgICAgICBpZiAoc3RhdGUuc2FuZSkge1xuICAgICAgICAgICAgICAgICAgc3RybS5tc2cgPSAnaW52YWxpZCBkaXN0YW5jZSB0b28gZmFyIGJhY2snO1xuICAgICAgICAgICAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgICAgICAgICAgIGJyZWFrIHRvcDtcbiAgICAgICAgICAgICAgICB9XG5cbi8vICghKSBUaGlzIGJsb2NrIGlzIGRpc2FibGVkIGluIHpsaWIgZGVmYWlsdHMsXG4vLyBkb24ndCBlbmFibGUgaXQgZm9yIGJpbmFyeSBjb21wYXRpYmlsaXR5XG4vLyNpZmRlZiBJTkZMQVRFX0FMTE9XX0lOVkFMSURfRElTVEFOQ0VfVE9PRkFSX0FSUlJcbi8vICAgICAgICAgICAgICAgIGlmIChsZW4gPD0gb3AgLSB3aGF2ZSkge1xuLy8gICAgICAgICAgICAgICAgICBkbyB7XG4vLyAgICAgICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSAwO1xuLy8gICAgICAgICAgICAgICAgICB9IHdoaWxlICgtLWxlbik7XG4vLyAgICAgICAgICAgICAgICAgIGNvbnRpbnVlIHRvcDtcbi8vICAgICAgICAgICAgICAgIH1cbi8vICAgICAgICAgICAgICAgIGxlbiAtPSBvcCAtIHdoYXZlO1xuLy8gICAgICAgICAgICAgICAgZG8ge1xuLy8gICAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IDA7XG4vLyAgICAgICAgICAgICAgICB9IHdoaWxlICgtLW9wID4gd2hhdmUpO1xuLy8gICAgICAgICAgICAgICAgaWYgKG9wID09PSAwKSB7XG4vLyAgICAgICAgICAgICAgICAgIGZyb20gPSBfb3V0IC0gZGlzdDtcbi8vICAgICAgICAgICAgICAgICAgZG8ge1xuLy8gICAgICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gb3V0cHV0W2Zyb20rK107XG4vLyAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKC0tbGVuKTtcbi8vICAgICAgICAgICAgICAgICAgY29udGludWUgdG9wO1xuLy8gICAgICAgICAgICAgICAgfVxuLy8jZW5kaWZcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBmcm9tID0gMDsgLy8gd2luZG93IGluZGV4XG4gICAgICAgICAgICAgIGZyb21fc291cmNlID0gc193aW5kb3c7XG4gICAgICAgICAgICAgIGlmICh3bmV4dCA9PT0gMCkgeyAgICAgICAgICAgLyogdmVyeSBjb21tb24gY2FzZSAqL1xuICAgICAgICAgICAgICAgIGZyb20gKz0gd3NpemUgLSBvcDtcbiAgICAgICAgICAgICAgICBpZiAob3AgPCBsZW4pIHsgICAgICAgICAvKiBzb21lIGZyb20gd2luZG93ICovXG4gICAgICAgICAgICAgICAgICBsZW4gLT0gb3A7XG4gICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gc193aW5kb3dbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKC0tb3ApO1xuICAgICAgICAgICAgICAgICAgZnJvbSA9IF9vdXQgLSBkaXN0OyAgLyogcmVzdCBmcm9tIG91dHB1dCAqL1xuICAgICAgICAgICAgICAgICAgZnJvbV9zb3VyY2UgPSBvdXRwdXQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGVsc2UgaWYgKHduZXh0IDwgb3ApIHsgICAgICAvKiB3cmFwIGFyb3VuZCB3aW5kb3cgKi9cbiAgICAgICAgICAgICAgICBmcm9tICs9IHdzaXplICsgd25leHQgLSBvcDtcbiAgICAgICAgICAgICAgICBvcCAtPSB3bmV4dDtcbiAgICAgICAgICAgICAgICBpZiAob3AgPCBsZW4pIHsgICAgICAgICAvKiBzb21lIGZyb20gZW5kIG9mIHdpbmRvdyAqL1xuICAgICAgICAgICAgICAgICAgbGVuIC09IG9wO1xuICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IHNfd2luZG93W2Zyb20rK107XG4gICAgICAgICAgICAgICAgICB9IHdoaWxlICgtLW9wKTtcbiAgICAgICAgICAgICAgICAgIGZyb20gPSAwO1xuICAgICAgICAgICAgICAgICAgaWYgKHduZXh0IDwgbGVuKSB7ICAvKiBzb21lIGZyb20gc3RhcnQgb2Ygd2luZG93ICovXG4gICAgICAgICAgICAgICAgICAgIG9wID0gd25leHQ7XG4gICAgICAgICAgICAgICAgICAgIGxlbiAtPSBvcDtcbiAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gc193aW5kb3dbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoLS1vcCk7XG4gICAgICAgICAgICAgICAgICAgIGZyb20gPSBfb3V0IC0gZGlzdDsgICAgICAvKiByZXN0IGZyb20gb3V0cHV0ICovXG4gICAgICAgICAgICAgICAgICAgIGZyb21fc291cmNlID0gb3V0cHV0O1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBlbHNlIHsgICAgICAgICAgICAgICAgICAgICAgLyogY29udGlndW91cyBpbiB3aW5kb3cgKi9cbiAgICAgICAgICAgICAgICBmcm9tICs9IHduZXh0IC0gb3A7XG4gICAgICAgICAgICAgICAgaWYgKG9wIDwgbGVuKSB7ICAgICAgICAgLyogc29tZSBmcm9tIHdpbmRvdyAqL1xuICAgICAgICAgICAgICAgICAgbGVuIC09IG9wO1xuICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IHNfd2luZG93W2Zyb20rK107XG4gICAgICAgICAgICAgICAgICB9IHdoaWxlICgtLW9wKTtcbiAgICAgICAgICAgICAgICAgIGZyb20gPSBfb3V0IC0gZGlzdDsgIC8qIHJlc3QgZnJvbSBvdXRwdXQgKi9cbiAgICAgICAgICAgICAgICAgIGZyb21fc291cmNlID0gb3V0cHV0O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB3aGlsZSAobGVuID4gMikge1xuICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gZnJvbV9zb3VyY2VbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IGZyb21fc291cmNlW2Zyb20rK107XG4gICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBmcm9tX3NvdXJjZVtmcm9tKytdO1xuICAgICAgICAgICAgICAgIGxlbiAtPSAzO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChsZW4pIHtcbiAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IGZyb21fc291cmNlW2Zyb20rK107XG4gICAgICAgICAgICAgICAgaWYgKGxlbiA+IDEpIHtcbiAgICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gZnJvbV9zb3VyY2VbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICBmcm9tID0gX291dCAtIGRpc3Q7ICAgICAgICAgIC8qIGNvcHkgZGlyZWN0IGZyb20gb3V0cHV0ICovXG4gICAgICAgICAgICAgIGRvIHsgICAgICAgICAgICAgICAgICAgICAgICAvKiBtaW5pbXVtIGxlbmd0aCBpcyB0aHJlZSAqL1xuICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gb3V0cHV0W2Zyb20rK107XG4gICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBvdXRwdXRbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IG91dHB1dFtmcm9tKytdO1xuICAgICAgICAgICAgICAgIGxlbiAtPSAzO1xuICAgICAgICAgICAgICB9IHdoaWxlIChsZW4gPiAyKTtcbiAgICAgICAgICAgICAgaWYgKGxlbikge1xuICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gb3V0cHV0W2Zyb20rK107XG4gICAgICAgICAgICAgICAgaWYgKGxlbiA+IDEpIHtcbiAgICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gb3V0cHV0W2Zyb20rK107XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGVsc2UgaWYgKChvcCAmIDY0KSA9PT0gMCkgeyAgICAgICAgICAvKiAybmQgbGV2ZWwgZGlzdGFuY2UgY29kZSAqL1xuICAgICAgICAgICAgaGVyZSA9IGRjb2RlWyhoZXJlICYgMHhmZmZmKS8qaGVyZS52YWwqLyArIChob2xkICYgKCgxIDw8IG9wKSAtIDEpKV07XG4gICAgICAgICAgICBjb250aW51ZSBkb2Rpc3Q7XG4gICAgICAgICAgfVxuICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgc3RybS5tc2cgPSAnaW52YWxpZCBkaXN0YW5jZSBjb2RlJztcbiAgICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgICBicmVhayB0b3A7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgYnJlYWs7IC8vIG5lZWQgdG8gZW11bGF0ZSBnb3RvIHZpYSBcImNvbnRpbnVlXCJcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZWxzZSBpZiAoKG9wICYgNjQpID09PSAwKSB7ICAgICAgICAgICAgICAvKiAybmQgbGV2ZWwgbGVuZ3RoIGNvZGUgKi9cbiAgICAgICAgaGVyZSA9IGxjb2RlWyhoZXJlICYgMHhmZmZmKS8qaGVyZS52YWwqLyArIChob2xkICYgKCgxIDw8IG9wKSAtIDEpKV07XG4gICAgICAgIGNvbnRpbnVlIGRvbGVuO1xuICAgICAgfVxuICAgICAgZWxzZSBpZiAob3AgJiAzMikgeyAgICAgICAgICAgICAgICAgICAgIC8qIGVuZC1vZi1ibG9jayAqL1xuICAgICAgICAvL1RyYWNldnYoKHN0ZGVyciwgXCJpbmZsYXRlOiAgICAgICAgIGVuZCBvZiBibG9ja1xcblwiKSk7XG4gICAgICAgIHN0YXRlLm1vZGUgPSBUWVBFO1xuICAgICAgICBicmVhayB0b3A7XG4gICAgICB9XG4gICAgICBlbHNlI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tcbnZhciBaX0RBVEFfRVJST1IgICAgPSAtMztcbnZhciBaX01FTV9FUlJPUiAgICAgPSAtNDtcbnZhciBaX0JVRl9FUlJPUiAgICAgPSAtNTtcbi8vdmFyIFpfVkVSU0lPTl9FUlJPUiA9IC02O1xuXG4vKiBUaGUgZGVmbGF0ZSBjb21wcmVzc2lvbiBtZXRob2QgKi9cbnZhciBaX0RFRkxBVEVEICA9IDg7XG5cblxuLyogU1RBVEVTID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG5cblxudmFyICAgIEhFQUQgPSAxOyAgICAgICAvKiBpOiB3YWl0aW5nIGZvciBtYWdpYyBoZWFkZXIgKi9cbnZhciAgICBGTEFHUyA9IDI7ICAgICAgLyogaTogd2FpdGluZyBmb3IgbWV0aG9kIGFuZCBmbGFncyAoZ3ppcCkgKi9cbnZhciAgICBUSU1FID0gMzsgICAgICAgLyogaTogd2FpdGluZyBmb3IgbW9kaWZpY2F0aW9uIHRpbWUgKGd6aXApICovXG52YXIgICAgT1MgPSA0OyAgICAgICAgIC8qIGk6IHdhaXRpbmcgZm9yIGV4dHJhIGZsYWdzIGFuZCBvcGVyYXRpbmcgc3lzdGVtIChnemlwKSAqL1xudmFyICAgIEVYTEVOID0gNTsgICAgICAvKiBpOiB3YWl0aW5nIGZvciBleHRyYSBsZW5ndGggKGd6aXApICovXG52YXIgICAgRVhUUkEgPSA2OyAgICAgIC8qIGk6IHdhaXRpbmcgZm9yIGV4dHJhIGJ5dGVzIChnemlwKSAqL1xudmFyICAgIE5BTUUgPSA3OyAgICAgICAvKiBpOiB3YWl0aW5nIGZvciBlbmQgb2YgZmlsZSBuYW1lIChnemlwKSAqL1xudmFyICAgIENPTU1FTlQgPSA4OyAgICAvKiBpOiB3YW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IGRhdGEgZXJyb3IgLS0gcmVtYWluIGhlcmUgdW50aWwgcmVzZXQgKi9cbnZhciAgICBNRU0gPSAzMTsgICAgICAgLyogZ290IGFuIGluZmxhdGUoKSBtZW1vcnkgZXJyb3IgLS0gcmVtYWluIGhlcmUgdW50aWwgcmVzZXQgKi9cbnZhciAgICBTWU5DID0gMzI7ICAgICAgLyogbG9va2luZyBmb3Igc3luY2hyb25pemF0aW9uIGJ5dGVzIHRvIHJlc3RhcnQgaW5mbGF0ZSgpICovXG5cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG5cblxuXG52YXIgRU5PVUdIX0xFTlMgPSA4NTI7XG52YXIgRU5PVUdIX0RJU1RTID0gNTkyO1xuLy92YXIgRU5PVUdIID0gIChFTk9VR0hfTEVOUytFTk9VR0hfRElTVFMpO1xuXG52YXIgTUFYX1dCSVRTID0gMTU7XG4vKiAzMksgTFo3NyB3aW5kb3cgKi9cbnZhciBERUZfV0JJVFMgPSBNQVhfV0JJVFM7XG5cblxuZnVuY3Rpb24gWlNXQVAzMihxKSB7XG4gIHJldHVybiAgKCgocSA+Pj4gMjQpICYgMHhmZikgK1xuICAgICAgICAgICgocSA+Pj4gOCkgJiAweGZmMDApICtcbiAgICAgICAgICAoKHEgJiAweGZmMDApIDw8IDgpICtcbiAgICAgICAgICAoKHEgJiAweGZmKSA8PCAyNCkpO1xufVxuXG5cbmZ1bmN0aW9uIEluZmxhdGVTdGF0ZSgpIHtcbiAgdGhpcy5tb2RlID0gMDsgICAgICAgICAgICAgLyogY3VycmVudCBpbmZsYXRlIG1vZGUgKi9cbiAgdGhpcy5sYXN0ID0gZmFsc2U7ICAgICAgICAgIC8qIHRydWUgaWYgcHJvY2Vzc2luZyBsYXN0IGJsb2NrICovXG4gIHRoaXMud3JhcCA9IDA7ICAgICAgICAgICAgICAvKiBiaXQgMCB0cnVlIGZvciB6bGliLCBia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UgSEVBRDpcbiAgICAgIGlmIChzdGF0ZS53cmFwID09PSAwKSB7XG4gICAgICAgIHN0YXRlLm1vZGUgPSBUWVBFRE87XG4gICAgICAgIGJyZWFrO1xuICAgICAgfVxuICAgICAgLy89PT0gTkVFREJJVFMoMTYpO1xuICAgICAgd2hpbGUgKGJpdHMgPCAxNikge1xuICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgaGF2ZS0tO1xuICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgYml0cyArPSA4O1xuICAgICAgfVxuICAgICAgLy89PT0vL1xuICAgICAgaWYgKChzdGF0ZS53cmFwICYgMikgJiYgaG9sZCA9PT0gMHg4YjFmKSB7ICAvKiBnemlwIGhlYWRlciAqL1xuICAgICAgICBzdGF0ZS5jaGVjayA9IDAvKmNyYzMyKDBMLCBaX05VTEwsIDApKi87XG4gICAgICAgIC8vPT09IENSQzIoc3RhdGUuY2hlY2ssIGhvbGQpO1xuICAgICAgICBoYnVmWzBdID0gaG9sZCAmIDB4ZmY7XG4gICAgICAgIGhidWZbMV0gPSAoaG9sZCA+Pj4gOCkgJiAweGZmO1xuICAgICAgICBzdGF0ZS5jaGVjayA9IGNyYzMyKHN0YXRlLmNoZWNrLCBoYnVmLCAyLCAwKTtcbiAgICAgICAgLy89PT0vL1xuXG4gICAgICAgIC8vPT09IElOSVRCSVRTKCk7XG4gICAgICAgIGhvbGQgPSAwO1xuICAgICAgICBiaXRzID0gMDtcbiAgICAgICAgLy89PT0vL1xuICAgICAgICBzdGF0ZS5tb2RlID0gRkxBR1M7XG4gICAgICAgIGJyZWFrO1xuICAgICAgfVxuICAgICAgc3RhdGUuZmxhZ3MgPSAwOyAgICAgICAgICAgLyogZXhwZWN0IHpsaWIgaGVhZGVyICovXG4gICAgICBpZiAoc3RhdGUuaGVhZCkge1xuICAgICAgICBzdGF0ZS5oZWFkLmRvbmUgPSB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ICAgIHN0YXRlLm1vZGUgPSBFWExFTjtcbiAgICAgIC8qIGZhbGxzIHRocm91Z2ggKi9cbiAgICBjYXNlIEVYTEVOOlxuICAgICAgaWYgKHN0YXRlLmZsYWdzICYgMHgwNDAwKSB7XG4gICAgICAgIC8vPT09IE5FRURCSVRTKDE2KTsgKi9cbiAgICAgICAgd2hpbGUgKGJpdHMgPCAxNikge1xuICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgIH1cbiAgICAgICAgLy89PT0vL1xuICAgICAgICBzdGF0ZS5sZW5ndGggPSBob2xkO1xuICAgICAgICBpZiAoc3RhdGUuaGVhZCkge1xuICAgICAgICAgIHN0YXRlLmhlYWQuZXh0cmFfbGVuID0gaG9sZDtcbiAgICAgICAgfVxuICAgICAgICBpZiAoc3RhdGUuZmxhZ3MgJiAweDAyMDApIHtcbiAgICAgICAgICAvLz09PSBDUkMyKHN0YXRlLmNoZWNrLCBob2xkKTtcbiAgICAgICAgICBoYnVmWzBdID0gaG9sZCAmIDB4ZmY7XG4gICAgICAgICAgaGJ1ZlsxXSA9IChob2xkID4+PiA4KSAmIDB4ZmY7XG4gICAgICAgICAgc3RhdGUuY2hlY2sgPSBjcmMzMihzdGF0ZS5jaGVjaywgaGJ1ZiwgMiwgMCk7XG4gICAgICAgICAgLy89PT0vL1xuICAgICAgICB9XG4gICAgICAgIC8vPT09IElOSVRCSVRTKCk7XG4gICAgICAgIGhvbGQgPSAwO1xuICAgICAgICBiaXRzID0gMDtcbiAgICAgICAgLy89PT0vL1xuICAgICAgfVxuICAgICAgZWxzZSBpZiAoc3RhdGUuaGVhZCkge1xuICAgICAgICBzdGF0ZS5oZWFkLmV4dHJhID0gbnVsbC8qWl9OVUxMKi87XG4gICAgICB9XG4gICAgICBzdGF0ZS5tb2RlID0gRVhUUkE7XG4gICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgY2FzZSBFWFRSQTpcbiAgICAgIGlmIChzdGF0ZS5mbGFncyAmIDB4MDQwMCkge1xuICAgICAgICBjb3B5ID0gc3RhdGUubGVuZ3RoO1xuICAgICAgICBpZiAoY29weSA+IGhhdmUpIHsgY29weSA9IGhhdmU7IH1cbiAgICAgICAgaWYgKGNvcHkpIHtcbiAgICAgICAgICBpZiAoc3RhdGUuaGVhZCkge1xuICAgICAgICAgICAgbGVuID0gc3RhdGUuaGVhZC5leHRyYV9sZW4gLSBzdGF0ZS5sZW5ndGg7XG4gICAgICAgICAgICBpZiAoIXN0YXRlLmhlYWQuZXh0cmEpIHtcbiAgICAgICAgICAgICAgLy8gVXNlIHVudHlwZWQgYXJyYXkgZm9yIG1vcmUgY29udmVuaWVuZCBwcm9jZXNzaW5nIGxhdGVyXG4gICAgICAgICAgICAgIHN0YXRlLmhlYWQuZXh0cmEgPSBuZXcgQXJyYXkoc3RhdGUuaGVhZC5leHRyYV9sZW4pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdXRpbHMuYXJyYXlTZXQoXG4gICAgICAgICAgICAgIHN0YXRlLmhlYWQuZXh0cmEsXG4gICAgICAgICAgICAgIGlucHV0LFxuICAgICAgICAgICAgICBuZXh0LFxuICAgICAgICAgICAgICAvLyBleHRyYSBmaWVsZCBpcyBsaW1pdGVkIHRvIDY1NTM2IGJ5dGVzXG4gICAgICAgICAgICAgIC8vIC0gbm8gbmVlZCBmb3IgYWRkaXRpb25hbCBzaXplIGNoZWNrXG4gICAgICAgICAgICAgIGNvcHksXG4gICAgICAgICAgICAgIC8qbGVuICsgY29weSA+IHN0YXRlLmhlYWQuZXh0cmFfbWF4IC0gbGVuID8gc3RhdGUuaGVhZC5leHRyYV9tYXggOiBjb3B5LCovXG4gICAgICAgICAgICAgIGxlblxuICAgICAgICAgICAgKTtcbiAgICAgICAgICAg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ZyA9ICdoZWFkZXIgY3JjIG1pc21hdGNoJztcbiAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIC8vPT09IElOSVRCSVRTKCk7XG4gICAgICAgIGhvbGQgPSAwO1xuICAgICAgICBiaXRzID0gMDtcbiAgICAgICAgLy89PT0vL1xuICAgICAgfVxuICAgICAgaWYgKHN0YXRlLmhlYWQpIHtcbiAgICAgICAgc3RhdGUuaGVhZC5oY3JjID0gKChzdGF0ZS5mbGFncyA+PiA5KSAmIDEpO1xuICAgICAgICBzdGF0ZS5oZWFkLmRvbmUgPSB0cnVlO1xuICAgICAgfVxuICAgICAgc3RybS5hZGxlciA9IHN0YXRlLmNoZWNrID0gMCAvKmNyYzMyKDBMLCBaX05VTEwsIDApKi87XG4gICAgICBzdGF0ZS5tb2RlID0gVFlQRTtcbiAgICAgIGJyZWFrO1xuICAgIGNhc2UgRElDVElEOlxuICAgICAgLy89PT0gTkVFREJJVFMoMzIpOyAqL1xuICAgICAgd2hpbGUgKGJpdHMgPCAzMikge1xuICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgaGF2ZS0tO1xuICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgYml0cyArPSA4O1xuICAgICAgfVxuICAgICAgLy89PT0vL1xuICAgICAgc3RybS5hZGxlciA9IHN0YXRlLmNoZWNrID0gWlNXQVAzMihob2xkKTtcbiAgICAgIC8vPT09IElOSVRCSVRTKCk7XG4gICAgICBob2xkID0gMDtcbiAgICAgIGJpdHMgPSAwO1xuICAgICAgLy89PT0vL1xuICAgICAgc3RhdGUubW9kZSA9IERJQ1Q7XG4gICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgY2FzZSBESUNUOlxuICAgICAgaWYgKHN0YXRlLmhhdmVkaWN0ID09PSAwKSB7XG4gICAgICA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AgICAgICAvLy0tLS8vXG4gICAgICAgICAgYnJlYWsgaW5mX2xlYXZlO1xuICAgICAgICB9XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAyOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZHluYW1pYyBibG9jayAqL1xuICAgICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgICBkeW5hbWljIGNvZGVzIGJsb2NrJXNcXG5cIixcbiAgICAgICAgLy8gICAgICAgIHN0YXRlLmxhc3QgPyBcIiAobGFzdClcIiA6IFwiXCIpKTtcbiAgICAgICAgc3RhdGUubW9kZSA9IFRBQkxFO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgMzpcbiAgICAgICAgc3RybS5tc2cgPSAnaW52YWxpZCBibG9jayB0eXBlJztcbiAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgIH1cbiAgICAgIC8vLS0tIERST1BCSVRTKDIpIC0tLS8vXG4gICAgICBob2xkID4+Pj0gMjtcbiAgICAgIGJpdHMgLT0gMjtcbiAgICAgIC8vLS0tLy9cbiAgICAgIGJyZWFrO1xuICAgIGNhc2UgU1RPUkVEOlxuICAgICAgLy8tLS0gQllURUJJVFMoKSAtLS0vLyAvKiBnbyB0byBieXRlIGJvdW5kYXJ5ICovXG4gICAgICBob2xkID4+Pj0gYml0cyAmIDc7XG4gICAgICBiaXRzIC09IGJpdHMgJiA3O1xuICAgICAgLy8tLS0vL1xuICAgICAgLy89PT0gTkVFREJJVFMoMzIpOyAqL1xuICAgICAgd2hpbGUgKGJpdHMgPCAzMikge1xuICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgaGF2ZS0tO1xuICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgYml0cyArPSA4O1xuICAgICAgfVxuICAgICAgLy89PT0vL1xuICAgICAgaWYgKChob2xkICYgMHhmZm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hdmUgPCBzdGF0ZS5ubGVuICsgc3RhdGUubmRpc3QpIHtcbiAgICAgICAgZm9yICg7Oykge1xuICAgICAgICAgIGhlcmUgPSBzdGF0ZS5sZW5jb2RlW2hvbGQgJiAoKDEgPDwgc3RhdGUubGVuYml0cykgLSAxKV07LypCSVRTKHN0YXRlLmxlbmJpdHMpKi9cbiAgICAgICAgICBoZXJlX2JpdHMgPSBoZXJlID4+PiAyNDtcbiAgICAgICAgICBoZXJlX29wID0gKGhlcmUgPj4+IDE2KSAmIDB4ZmY7XG4gICAgICAgICAgaGVyZV92YWwgPSBoZXJlICYgMHhmZmZmO1xuXG4gICAgICAgICAgaWYgKChoZXJlX2JpdHMpIDw9IGJpdHMpIHsgYnJlYWs7IH1cbiAgICAgICAgICAvLy0tLSBQVUxMQllURSgpIC0tLS8vXG4gICAgICAgICAgaWYgKGhhdmUgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgICAgaGF2ZS0tO1xuICAgICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAvLy0tLS8vXG4gICAgICAgIH1cbiAgICAgICAgaWYgKGhlcmVfdmFsIDwgMTYpIHtcbiAgICAgICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICAgICAgaG9sZCA+Pj49IGhlcmVfYml0cztcbiAgICAgICAgICBiaXRzIC09IGhlcmVfYml0cztcbiAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgc3RhdGUubGVuc1tzdGF0ZS5oYXZlKytdID0gaGVyZV92YWw7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgaWYgKGhlcmVfdmFsID09PSAxNikge1xuICAgICAgICAgICAgLy89PT0gTkVFREJJVFMoaGVyZS5iaXRzICsgMik7XG4gICAgICAgICAgICBuID0gaGVyZV9iaXRzICsgMjtcbiAgICAgICAgICAgIHdoaWxlIChiaXRzIDwgbikge1xuICAgICAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICAgICAgaGF2ZS0tO1xuICAgICAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy89PT0vL1xuICAgICAgICAgICAgLy8tLS0gRFJPUEJJVFMoaGVyZS5iaXRzKSAtLS0vL1xuICAgICAgICAgICAgaG9sZCA+Pj49IGhlcmVfYml0cztcbiAgICAgICAgICAgIGJpdHMgLT0gaGVyZV9iaXRzO1xuICAgICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgICAgaWYgKHN0YXRlLmhhdmUgPT09IDApIHtcbiAgICAgICAgICAgICAgc3RybS5tc2cgPSAnaW52YWxpZCBiaXQgbGVuZ3RoIHJlcGVhdCc7XG4gICAgICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGVuID0gc3RhdGUubGVuc1tzdGF0ZS5oYXZlIC0gMV07XG4gICAgICAgICAgICBjb3B5ID0gMyArIChob2xkICYgMHgwMyk7Ly9CSVRTKDIpO1xuICAgICAgICAgICAgLy8tLS0gRFJPUEJJVFMoMikgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSAyO1xuICAgICAgICAgICAgYml0cyAtPSAyO1xuICAgICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgIH1cbiAgICAgICAgICBlbHNlIGlmIChoZXJlX3ZhbCA9PT0gMTcpIHtcbiAgICAgICAgICAgIC8vPT09IE5FRURCSVRTKGhlcmUuYml0cyArIDMpO1xuICAgICAgICAgICAgbiA9IGhlcmVfYml0cyArIDM7XG4gICAgICAgICAgICB3aGlsZSAoYml0cyA8IG4pIHtcbiAgICAgICAgICAgICAgaWYgKGhhdmUgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vPT09Ly9cbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKGhlcmUuYml0cykgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSBoZXJlX2JpdHM7XG4gICAgICAgICAgICBiaXRzIC09IGhlcmVfYml0cztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICAgIGxlbiA9IDA7XG4gICAgICAgICAgICBjb3B5ID0gMyArIChob2xkICYgMHgwNyk7Ly9CSVRTKDMpO1xuICAgICAgICAgICAgLy8tLS0gRFJPUEJJVFMoMykgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSAzO1xuICAgICAgICAgICAgYml0cyAtPSAzO1xuICAgICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgIH1cbiAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIC8vPT09IE5FRURCSVRTKGhlcmUuYml0cyArIDcpO1xuICAgICAgICAgICAgbiA9IGhlcmVfYml0cyArIDc7XG4gICAgICAgICAgICB3aGlsZSAoYml0cyA8IG4pIHtcbiAgICAgICAgICAgICAgaWYgKGhhdmUgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vPT09Ly9cbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKGhlcmUuYml0cykgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSBoZXJlX2JpdHM7XG4gICAgICAgICAgICBiaXRzIC09IGhlcmVfYml0cztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICAgIGxlbiA9IDA7XG4gICAgICAgICAgICBjb3B5ID0gMTEgKyAoaG9sZCAmIDB4N2YpOy8vQklUUyg3KTtcbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKDcpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gNztcbiAgICAgICAgICAgIGJpdHMgLT0gNztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHN0YXRlLmhhdmUgKyBjb3B5ID4gc3RhdGUubmxlbiArIHN0YXRlLm5kaXN0KSB7XG4gICAgICAgICAgICBzdHJtLm1zZyA9ICdpbnZhbGlkIGJpdCBsZW5ndGggcmVwZWF0JztcbiAgICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgICAgd2hpbGUgKGNvcHktLSkge1xuICAgICAgICAgICAgc3RhdGUubGVuc1tzdGF0ZS5oYXZlKytdID0gbGVuO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICAvKiBoYW5kbGUgZXJyb3IgYnJlYWtzIGluIHdoaWxlICovXG4gICAgICBpZiAoc3RhdGUubW9kZSA9PT0gQkFEKSB7IGJyZWFrOyB9XG5cbiAgICAgIC8qIGNoZWNrIGZvciBlbmQtb2YtYmxvY2sgY29kZSAoYmV0dGVyIGhhdmUgb25lKSAqL1xuICAgICAgaWYgKHN0YXRlLmxlbnNbMjU2XSA9PT0gMCkge1xuICAgICAgICBzdHJtLm1zZyA9ICdpbnZhbGlkIGNvZGUgLS0gbWlzc2luZyBlbmQtb2YtYmxvY2snO1xuICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICBicmVhaztcbiAgIC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AgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgLy8tLS0vL1xuICAgICAgICB9XG4gICAgICAgIC8vLS0tIERST1BCSVRTKGxhc3QuYml0cykgLS0tLy9cbiAgICAgICAgaG9sZCA+Pj49IGxhc3RfYml0cztcbiAgICAgICAgYml0cyAtPSBsYXN0X2JpdHM7XG4gICAgICAgIC8vLS0tLy9cbiAgICAgICAgc3RhdGUuYmFjayArPSBsYXN0X2JpdHM7XG4gICAgICB9XG4gICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICBob2xkID4+Pj0gaGVyZV9iaXRzO1xuICAgICAgYml0cyAtPSBoZXJlX2JpdHM7XG4gICAgICAvLy0tLS8vXG4gICAgICBzdGF0ZS5iYWNrICs9IGhlcmVfYml0cztcbiAgICAgIHN0YXRlLmxlbmd0aCA9IGhlcmVfdmFsO1xuICAgICAgaWYgKGhlcmVfb3AgPT09IDApIHtcbiAgICAgICAgLy9UcmFjZXZ2KChzdGRlcnIsIGhlcmUudmFsID49IDB4MjAgJiYgaGVyZS52YWwgPCAweDdmID9cbiAgICAgICAgLy8gICAgICAgIFwiaW5mbGF0ZTogICAgICAgICBsaXRlcmFsICclYydcXG5cIiA6XG4gICAgICAgIC8vICAgICAgICBcImluZmxhdGU6ICAgICAgICAgbGl0ZXJhbCAweCUwMnhcXG5cIiwgaGVyZS52YWwpKTtcbiAgICAgICAgc3RhdGUubW9kZSA9IExJVDtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICBpZiAoaGVyZV9vcCAmIDMyKSB7XG4gICAgICAgIC8vVHJhY2V2digoc3RkZXJyLCBcImluZmxhdGU6ICAgICAgICAgZW5kIG9mIGJsb2NrXFxuXCIpKTtcbiAgICAgICAgc3RhdGUuYmFjayA9IC0xO1xuICAgICAgICBzdGF0ZS5tb2RlID0gVFlQRTtcbiAgICAgICAgY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xuICAgICAgICBvdXRwdXRbcHV0KytdID0gZnJvbV9zb3VyY2VbZnJvbSsrXTtcbiAgICAgIH0gd2hpbGUgKC0tY29weSk7XG4gICAgICBpZiAoc3RhdGUubGVuZ3RoID09PSAwKSB7IHN0YXRlLm1vZGUgPSBMRU47IH1cbiAgICAgIGJyZWFrO1xuICAgIGNhc2UgTElUOlxuICAgICAgaWYgKGxlZnQgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICBvdXRwdXRbcHV0KytdID0gc3RhdGUubGVuZ3RoO1xuICAgICAgbGVmdC0tO1xuICAgICAgc3RhdGUubW9kZSA9IExFTjtcbiAgICAgIGJyZWFrO1xuICAgIGNhc2UgQ0hFQ0s6XG4gICAgICBpZiAoc3RhdGUud3JhcCkge1xuICAgICAgICAvLz09PSBORUVEQklUUygzMik7XG4gICAgICAgIHdoaWxlIChiaXRzIDwgMzIpIHtcbiAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgLy8gVXNlICd8JyBpbnNkZWFkIG9mICcrJyB0byBtYWtlIHN1cmUgdGhhdCByZXN1bHQgaXMgc2lnbmVkXG4gICAgICAgICAgaG9sZCB8PSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICB9XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgX291dCAtPSBsZWZ0O1xuICAgICAgICBzdHJtLnRvdGFsX291dCArPSBfb3V0O1xuICAgICAgICBzdGF0ZS50b3RhbCArPSBfb3V0O1xuICAgICAgICBpZiAoX291dCkge1xuICAgICAgICAgIHN0cm0uYWRsZXIgPSBzdGF0ZS5jaGVjayA9XG4gICAgICAgICAgICAgIC8qVVBEQVRFKHN0YXRlLmNoZWNrLCBwdXQgLSBfb3V0LCBfb3V0KTsqL1xuICAgICAgICAgICAgICAoc3RhdGUuZmx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mVlZCBkaWN0aW9uYXJ5JywgICAgIC8qIFpfTkVFRF9ESUNUICAgICAgIDIgICovXG4gICcxJzogICAgJ3N0cmVhbSBlbmQnLCAgICAgICAgICAvKiBaX1NUUkVBTV9FTkQgICAgICAxICAqL1xuICAnMCc6ICAgICcnLCAgICAgICAgICAgICAgICAgICAgLyogWl9PSyAgICAgICAgICAgICAgMCAgKi9cbiAgJy0xJzogICAnZmlsZSBlcnJvcicsICAgICAgICAgIC8qIFpfRVJSTk8gICAgICAgICAoLTEpICovXG4gICctMic6ICAgJ3N0cmVhbSBlcnJvcicsICAgICAgICAvKiBaX1NUUkVBTV9FUlJPUiAgKC0yKSAqL1xuICAnLTMnOiAgICdkYXRhIGVycm9yJywgICAgICAgICAgLyogWl9EQVRBX0VSUk9SICAgICgtMykgKi9cbiAgJy00JzogICAnaW5zdWZmaWNpZW50IG1lbW9yeScsIC8qIFpfTUVNX0VSUk9SICAgICAoLTQpICovXG4gICctNSc6ICAgJ2J1ZmZlciBlcnJvcicsICAgICAgICAvKiBaX0JVRl9FUlJPUiAgICAgKC01KSAqL1xuICAnLTYnOiAgICdpbmNvbXBhdGlibGUgdmVyc2lvbicgLyogWl9WRVJTSU9OX0VSUk9SICgtNikgKi9cbn07XG4iLCIndXNlIHN0cmljdCc7XG5cblxudmFyIHV0aWxzID0gcmVxdWlyZSgnLi4vdXRpbHMvY29tbW9uJyk7XG5cbi8qIFB1YmxpYyBjb25zdGFudHMgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuXG5cbi8vdmFyIFpfRklMVEVSRUQgICAgICAgICAgPSAxO1xuLy92YXIgWl9IVUZGTUFOX09OTFkgICAgICA9IDI7XG4vL3ZhciBaX1JMRSAgICAgICAgICAgICAgID0gMztcbnZhciBaX0ZJWEVEICAgICAgICAgICAgICAgPSA0O1xuLy92YXIgWl9ERUZBVUxUX1NUUkFURUdZICA9IDA7XG5cbi8qIFBvc3NpYmxlIHZhbHVlcyBvZiB0aGUgZGF0YV90eXBlIGZpZWxkICh0aG91Z2ggc2VlIGluZmxhdGUoKSkgKi9cbnZhciBaX0JJTkFSWSAgICAgICAgICAgICAgPSAwO1xudmFyIFpfVEVYVCAgICAgICAgICAgICAgICA9IDE7XG4vL3ZhciBaX0FTQ0lJICAgICAgICAgICAgID0gMTsgLy8gPSBaX1RFWFRcbnZhciBaX1VOS05PV04gICAgICAgICAgICAgPSAyO1xuXG4vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuXG5cbmZ1bmN0aW9uIHplcm8oYnVmKSB7IHZhciBsZW4gPSBidWYubGVuZ3RoOyB3aGlsZSAoLS1sZW4gPj0gMCkgeyBidWZbbGVuXSA9IDA7IH0gfVxuXG4vLyBGcm9tIHp1dGlsLmhcblxudmFyIFNUT1JFRF9CTE9DSyA9IDA7XG52YXIgU1RBVElDX1RSRUVTID0gMTtcbnZhciBEWU5fVFJFRVMgICAgPSAyO1xuLyogVGhlIHRocmVlIGtpbmRzIG9mIGJsb2NrIHR5cGUgKi9cblxudmFyIE1JTl9NQVRDSCAgICA9IDM7XG52YXIgTUFYX01BVENIICAgID0gMjU4O1xuLyogVGhlIG1pbmltdW0gYW5kIG1heGltdW0gbWF0Y2ggbGVuZ3RocyAqL1xuXG4vLyBGcm9tIGRlZmxhdGUuaFxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBJbnRlcm5hbCBjb21wcmVzc2lvbiBzdGF0ZS5cbiAqL1xuXG52YXIgTEVOR1RIX0NPREVTICA9IDI5O1xuLyogbnVtYmVyIG9mIGxlbmd0aCBjb2R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blxuICAgIGlmIChuZXh0bGVuID09PSAwKSB7XG4gICAgICBtYXhfY291bnQgPSAxMzg7XG4gICAgICBtaW5fY291bnQgPSAzO1xuXG4gICAgfSBlbHNlIGlmIChjdXJsZW4gPT09IG5leHRsZW4pIHtcbiAgICAgIG1heF9jb3VudCA9IDY7XG4gICAgICBtaW5fY291bnQgPSAzO1xuXG4gICAgfSBlbHNlIHtcbiAgICAgIG1heF9jb3VudCA9IDc7XG4gICAgICBtaW5fY291bnQgPSA0O1xuICAgIH1cbiAgfVxufVxuXG5cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogU2VuZCBhIGxpdGVyYWwgb3IgZGlzdGFuY2UgdHJlZSBpbiBjb21wcmVzc2VkIGZvcm0sIHVzaW5nIHRoZSBjb2RlcyBpblxuICogYmxfdHJlZS5cbiAqL1xuZnVuY3Rpb24gc2VuZF90cmVlKHMsIHRyZWUsIG1heF9jb2RlKVxuLy8gICAgZGVmbGF0ZV9zdGF0ZSAqcztcbi8vICAgIGN0X2RhdGEgKnRyZWU7IC8qIHRoZSB0cmVlIHRvIGJlIHNjYW5uZWQgKi9cbi8vICAgIGludCBtYXhfY29kZTsgICAgICAgLyogYW5kIGl0cyBsYXJnZXN0IGNvZGUgb2Ygbm9uIHplcm8gZnJlcXVlbmN5ICovXG57XG4gIHZhciBuOyAgICAgICAgICAgICAgICAgICAgIC8qIGl0ZXJhdGVzIG92ZXIgYWxsIHRyZWUgZWxlbWVudHMgKi9cbiAgdmFyIHByZXZsZW4gPSAtMTsgICAgICAgICAgLyogbGFzdCBlbWl0dGVkIGxlbmd0aCAqL1xuICB2YXIgY3VybGVuOyAgICAgICAgICAgICAgICAvKiBsZW5ndGggb2YgY3VycmVudCBjb2RlICovXG5cbiAgdmFyIG5leHRsZW4gPSB0cmVlWzAqMiArIDFdLyouTGVuKi87IC8qIGxlbmd0aCBvZiBuZXh0IGNvZGUgKi9cblxuICB2YXIgY291bnQgPSAwOyAgICAgICAgICAgICAvKiByZXBlYXQgY291bnQgb2YgdGhlIGN1cnJlbnQgY29kZSAqL1xuICB2YXIgbWF4X2NvdW50ID0gNzsgICAgICAgICAvKiBtYXggcmVwZWF0IGNvdW50ICovXG4gIHZhciBtaW5fY291bnQgPSA0OyAgICAgICAgIC8qIG1pbiByZXBlYXQgY291bnQgKi9cblxuICAvKiB0cmVlW21heF9jb2RlKzFdLkxlbiA9IC0xOyAqLyAgLyogZ3VhcmQgYWxyZWFkeSBzZXQgKi9cbiAgaWYgKG5leHRsZW4gPT09IDApIHtcbiAgICBtYXhfY291bnQgPSAxMzg7XG4gICAgbWluX2NvdW50ID0gMztcbiAgfVxuXG4gIGZvciAobiA9IDA7IG4gPD0gbWF4X2NvZGU7IG4rKykge1xuICAgIGN1cmxlbiA9IG5leHRsZW47XG4gICAgbmV4dGxlbiA9IHRyZWVbKG4rMSkqMiArIDFdLyouTGVuKi87XG5cbiAgICBpZiAoKytjb3VudCA8IG1heF9jb3VudCAmJiBjdXJsZW4gPT09IG5leHRsZW4pIHtcbiAgICAgIGNvbnRpbnVlO1xuXG4gICAgfSBlbHNlIGlmIChjb3VudCA8IG1pbl9jb3VudCkge1xuICAgICAgZG8geyBzZW5kX2NvZGUocywgY3VybGVuLCBzLmJsX3RyZWUpOyB9IHdoaWxlICgtLWNvdW50ICE9PSAwKTtcblxuICAgIH0gZWxzZSBpZiAoY3VybGVuICE9PSAwKSB7XG4gICAgICBpZiAoY3VybGVuICE9PSBwcmV2bGVuKSB7XG4gICAgICAgIHNlbmRfY29kZShzLCBjdXJsZW4sIHMuYmxfdHJlZSk7XG4gICAgICAgIGNvdW50LS07XG4gICAgICB9XG4gICAgICAvL0Fzc2VydChjb3VudCA+PSAzICYmIGNvdW50IDw9IDYsIFwiIDNfNj9cIik7XG4gICAgICBzZW5kX2NvZGUocywgUkVQXzNfNiwgcy5ibF90cmVlKTtcbiAgICAgIHNlbmRfYml0cyhzLCBjb3VudC0zLCAyKTtcblxuICAgIH0gZWxzZSBpZiAoY291bnQgPD0gMTApIHtcbiAgICAgIHNlbmRfY29kZShzLCBSRVBaXzNfMTAsIHMuYmxfdHJlZSk7XG4gICAgICBzZW5kX2JpdHMocywgY291bnQtMywgMyk7XG5cbiAgICB9IGVsc2Uge1xuICAgICAgc2VuZF9jb2RlKHMsIFJFUFpfMTFfMTM4LCBzLmJsX3RyZWUpO1xuICAgICAgc2VuZF9iaXRzKHMsIGNvdW50LTExLCA3KTtcbiAgICB9XG5cbiAgICBjb3VudCA9IDA7XG4gICAgcHJldmxlbiA9IGN1cmxlbjtcbiAgICBpZiAobmV4dGxlbiA9PT0gMCkge1xuICAgICAgbWF4X2NvdW50ID0gMTM4O1xuICAgICAgbWluX2NvdW50ID0gMztcblxuICAgIH0gZWxzZSBpZiAoY3VybGVuID09PSBuZXh0bGVuKSB7XG4gICAgICBtYXhfY291bnQgPSA2O1xuICAgICAgbWluX2NvdW50ID0gMztcblxuICAgIH0gZWxzZSB7XG4gICAgICBtYXhfY291bnQgPSA3O1xuICAgICAgbWluX2NvdW50ID0gNDtcbiAgICB9XG4gIH1cbn1cblxuXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIENvbnN0cnVjdCB0aGUgSHVmZm1hbiB0cmVlIGZvciB0aGUgYml0IGxlbmd0aHMgYW5kIHJldHVybiB0aGUgaW5kZXggaW5cbiAqIGJsX29yZGVyIG9mIHRoZSBsYXN0IGJpdCBsZW5ndGggY29kZSB0byBzZW5kLlxuICovXG5mdW5jdGlvbiBidWlsZF9ibF90cmVlKHMpIHtcbiAgdmFyIG1heF9ibGluZGV4OyAgLyogaW5kZXggb2YgbGFzdCBiaXQgbGVuZ3RoIGNvZGUgb2Ygbm9uIHplcm8gZnJlcSAqL1xuXG4gIC8qIERldGVybWluZSB0aGUgYml0IGxlbmd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ICAgYXZhaWxJbkJlZm9yZSwgLy8gaW5fbGVuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fYnVmZmVyLCAvLyBvdXRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9vZmZzZXQsIC8vb3V0X29mZlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF2YWlsT3V0QmVmb3JlKTsgLy8gb3V0X2xlblxuICAgIH0gd2hpbGUgKCF0aGlzLl9oYWRFcnJvciAmJiBjYWxsYmFjayhyZXNbMF0sIHJlc1sxXSkpO1xuXG4gICAgaWYgKHRoaXMuX2hhZEVycm9yKSB7XG4gICAgICB0aHJvdyBlcnJvcjtcbiAgICB9XG5cbiAgICB2YXIgYnVmID0gQnVmZmVyLmNvbmNhdChidWZmZXJzLCBucmVhZCk7XG4gICAgdGhpcy5jbG9zZSgpO1xuXG4gICAgcmV0dXJuIGJ1ZjtcbiAgfVxuXG4gIHZhciByZXEgPSB0aGlzLl9iaW5kaW5nLndyaXRlKGZsdXNoRmxhZyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2h1bmssIC8vIGluXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluT2ZmLCAvLyBpbl9vZmZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXZhaWxJbkJlZm9yZSwgLy8gaW5fbGVuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2J1ZmZlciwgLy8gb3V0XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX29mZnNldCwgLy9vdXRfb2ZmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF2YWlsT3V0QmVmb3JlKTsgLy8gb3V0X2xlblxuXG4gIHJlcS5idWZmZXIgPSBjaHVuaztcbiAgcmVxLmNhbGxiYWNrID0gY2FsbGJhY2s7XG5cbiAgZ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E5vdCBhY3R1YWxseSBkb25lLiAgTmVlZCB0byByZXByb2Nlc3MuXG4gICAgICAvLyBBbHNvLCB1cGRhdGUgdGhlIGF2YWlsSW5CZWZvcmUgdG8gdGhlIGF2YWlsSW5BZnRlciB2YWx1ZSxcbiAgICAgIC8vIHNvIHRoYXQgaWYgd2UgaGF2ZSB0byBoaXQgaXQgYSB0aGlyZCAoZm91cnRoLCBldGMuKSB0aW1lLFxuICAgICAgLy8gaXQnbGwgaGF2ZSB0aGUgY29ycmVjdCBieXRlIGNvdW50cy5cbiAgICAgIGluT2ZmICs9IChhdmFpbEluQmVmb3JlIC0gYXZhaWxJbkFmdGVyKTtcbiAgICAgIGF2YWlsSW5CZWZvcmUgPSBhdmFpbEluQWZ0ZXI7XG5cbiAgICAgIGlmICghYXN5bmMpXG4gICAgICAgIHJldHVybiB0cnVlO1xuXG4gICAgICB2YXIgbmV3UmVxID0gc2VsZi5fYmluZGluZy53cml0ZShmbHVzaEZsYWcsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaHVuayxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluT2ZmLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXZhaWxJbkJlZm9yZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuX2J1ZmZlcixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuX29mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuX2NodW5rU2l6ZSk7XG4gICAgICBuZXdSZXEuY2FsbGJhY2sgPSBjYWxsYmFjazsgLy8gdGhpcyBzYW1lIGZ1bmN0aW9uXG4gICAgICBuZXdSZXEuYnVmZmVyID0gY2h1bms7XG4gICAgICByZXR1cm47XG4gICAgfVxuXG4gICAgaWYgKCFhc3luYylcbiAgICAgIHJldHVybiBmYW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DQsIGogKz0gMykge1xuICAgIHRtcCA9IChyZXZMb29rdXBbYjY0LmNoYXJDb2RlQXQoaSldIDw8IDE4KSB8IChyZXZMb29rdXBbYjY0LmNoYXJDb2RlQXQoaSArIDEpXSA8PCAxMikgfCAocmV2TG9va3VwW2I2NC5jaGFyQ29kZUF0KGkgKyAyKV0gPDwgNikgfCByZXZMb29rdXBbYjY0LmNoYXJDb2RlQXQoaSArIDMpXVxuICAgIGFycltMKytdID0gKHRtcCA+PiAxNikgJiAweEZGXG4gICAgYXJyW0wrK10gPSAodG1wID4+IDgpICYgMHhGRlxuICAgIGFycltMKytdID0gdG1wICYgMHhGRlxuICB9XG5cbiAgaWYgKHBsYWNlSG9sZGVycyA9PT0gMikge1xuICAgIHRtcCA9IChyZXZMb29rdXBbYjY0LmNoYXJDb2RlQXQoaSldIDw8IDIpIHwgKHJldkxvb2t1cFtiNjQuY2hhckNvZGVBdChpICsgMSldID4+IDQpXG4gICAgYXJyW0wrK10gPSB0bXAgJiAweEZGXG4gIH0gZWxzZSBpZiAocGxhY2VIb2xkZXJzID09PSAxKSB7XG4gICAgdG1wID0gKHJldkxvb2t1cFtiNjQuY2hhckNvZGVBdChpKV0gPDwgMTApIHwgKHJldkxvb2t1cFtiNjQuY2hhckNvZGVBdChpICsgMSldIDw8IDQpIHwgKHJldkxvb2t1cFtiNjQuY2hhckNvZGVBdChpICsgMildID4+IDIpXG4gICAgYXJyW0wrK10gPSAodG1wID4+IDgpICYgMHhGRlxuICAgIGFycltMKytdID0gdG1wICYgMHhGRlxuICB9XG5cbiAgcmV0dXJuIGFyclxufVxuXG5mdW5jdGlvbiB0cmlwbGV0VG9CYXNlNjQgKG51bSkge1xuICByZXR1cm4gbG9va3VwW251bSA+PiAxOCAmIDB4M0ZdICsgbG9va3VwW251bSA+PiAxMiAmIDB4M0ZdICsgbG9va3VwW251bSA+PiA2ICYgMHgzRl0gKyBsb29rdXBbbnVtICYgMHgzRl1cbn1cblxuZnVuY3Rpb24gZW5j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AgICAgICAgICBpZih0cmFuc2ZlclN5bnRheCA9PT0gJzEuMi44NDAuMTAwMDguMS4yJykgLy8gaW1wbGljaXQgbGl0dGxlIGVuZGlhblxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIGFsbCBvdGhlciB0cmFuc2ZlciBzeW50YXhlcyBzaG91bGQgYmUgZXhwbGljaXRcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gZ2V0RGF0YVNldEJ5dGVTdHJlYW0odHJhbnNmZXJTeW50YXgsIHBvc2l0aW9uKSB7XG4gICAgICAgICAgICBpZih0cmFuc2ZlclN5bnRheCA9PT0gJzEuMi44NDAuMTAwMDguMS4yLjEuOTknKVxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIC8vIGlmIGFuIGluZmFsdGVyIGNhbGxiYWNrIGlzIHJlZ2lzdGVyZWQsIHVzZSBpdFxuICAgICAgICAgICAgICAgIGlmIChvcHRpb25zICYmIG9wdGlvbnMuaW5mbGF0ZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGZ1bGxCeXRlQXJyYXlDYWxsYmFjayA9IG9wdGlvbnMuaW5mbGF0ZXIoYnl0ZUFycmF5LCBwb3NpdGlvbik7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgZGljb21QYXJzZXIuQnl0ZVN0cmVhbShkaWNvbVBhcnNlci5saXR0bGVFbmRpYW5CeXRlQXJyYXlQYXJzZXIsIGZ1bGxCeXRlQXJyYXlDYWxsYmFjaywgMCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIGlmIHJ1bm5pbmcgb24gbm9kZSwgdXNlIHRoZSB6bGliIGxpYnJhcnkgdG8gaW5mbGF0ZVxuICAgICAgICAgICAgICAgIC8vIGh0dHA6Ly9zdGFja292ZXJmbG93Lm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Gl0dGxlRW5kaWFuQnl0ZUFycmF5UGFyc2VyLCBieXRlQXJyYXksIHBvc2l0aW9uKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIG1lcmdlRGF0YVNldHMobWV0YUhlYWRlckRhdGFTZXQsIGluc3RhbmNlRGF0YVNldClcbiAgICAgICAge1xuICAgICAgICAgICAgZm9yICh2YXIgcHJvcGVydHlOYW1lIGluIG1ldGFIZWFkZXJEYXRhU2V0LmVsZW1lbnRzKVxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIGlmKG1ldGFIZWFkZXJEYXRhU2V0LmVsZW1lbnRzLmhhc093blByb3BlcnR5KHByb3BlcnR5TmFtZSkpXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBpbnN0YW5jZURhdGFTZXQuZWxlbWVudHNbcHJvcGVydHlOYW1lXSA9IG1ldGFIZWFkZXJEYXRhU2V0LmVsZW1lbnRzW3Byb3BlcnR5TmFtZV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG1ldGFIZWFkZXJEYXRhU2V0Lndhcm5pbmdzICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICBpbnN0YW5jZURhdGFTZXQud2FybmluZ3MgPSBtZXRhSGVhZGVyRGF0YVNldC53YXJuaW5ncy5jb25jYXQoaW5zdGFuY2VEYXRhU2V0Lndhcm5pbmdzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBpbnN0YW5jZURhdGFTZXQ7XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiByZWFkRGF0YVNldChtZXRhSGVhZGVyRGF0YVNldClcbiAgICAgICAge1xuICAgICAgICAgICAgdmFyIHRyYW5zZmVyU3ludGF4ID0gcmVhZFRyYW5zZmVyU3ludGF4KG1ldGFIZWFkZXJEYXRhU2V0KTtcbiAgICAgICAgICAgIHZhciBleHBsaWNpdCA9IGlzRXhwbGljaXQodHJhbnNmZXJTeW50YXgpO1xuICAgICAgICAgICAgdmFyIGRhdGFTZXRCeXRlU3RyZWFtID0gZ2V0RGF0YVNldEJ5dGVTdHJlYW0odHJhbnNmZXJTeW50YXgsIG1ldGFIZWFkZXJEYXRhU2V0LnBvc2l0aW9uKTtcblxuICAgICAgICAgICAgdmFyIGVsZW1lbnRzID0ge307XG4gICAgICAgICAgICB2YXIgZGF0YVNldCA9IG5ldyBkaWNvbVBhcnNlci5EYXRhU2V0KGRhdGFTZXRCeXRlU3RyZWFtLmJ5dGVBcnJheVBhcnNlciwgZGF0YVNldEJ5dGVTdHJlYW0uYnl0ZUFycmF5LCBlbGVtZW50cyk7XG4gICAgICAgICAgICBkYXRhU2V0Lndhcm5pbmdzID0gZGF0YVNldEJ5dGVTdHJlYW0ud2FybmluZ3M7XG5cbiAgICAgICAgICAgIHRyeXtcbiAgICAgICAgICAgICAgICBpZihleHBsaWNpdCkge1xuICAgICAgICAgICAgICAgICAgICBkaWNvbVBhcnNlci5wYXJzZURpY29tRGF0YVNldEV4cGxpY2l0KGRhdGFTZXQsIGRhdGFTZXRCeXRlU3RyZWFtLCBkYXRhU2V0Qnl0ZVN0cmVhbS5ieXRlQXJyYXkubGVuZ3RoLCBvcHRpb25zKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgZGljb21QYXJzZXIucGFyc2VEaWNvbURhdGFTZXRJbXBsaWNpdChkYXRhU2V0LCBkYXRhU2V0Qnl0ZVN0cmVhbSwgZGF0YVNldEJ5dGVTdHJlYW0uYnl0ZUFycmF5Lmxlbmd0aCwgb3B0aW9ucyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY2F0Y2goZSkge1xuICAgICAgICAgICAgICAgIHZhciBleCA9IHtcbiAgICAgICAgICAgICAgICAgIC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iBpdCBhIHByaXZhdGUgZWxlbWVudCBhbmQgb3VyIG9wdGlvbnMgc3BlY2lmeSB0aGF0IHdlIHNob3VsZFxuICAgICAgICAgICAgaWYob3B0aW9ucy5vbWl0UHJpdmF0ZUF0dGlidXRlcyA9PT0gdHJ1ZSAmJiBkaWNvbVBhcnNlci5pc1ByaXZhdGVUYWcodGFnKSlcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYoZWxlbWVudC5pdGVtcykge1xuICAgICAgICAgICAgICAgIC8vIGhhbmRsZSBzZXF1ZW5jZXNcbiAgICAgICAgICAgICAgICB2YXIgc2VxdWVuY2VJdGVtcyA9IFtdO1xuICAgICAgICAgICAgICAgIGZvcih2YXIgaT0wOyBpIDwgZWxlbWVudC5pdGVtcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBzZXF1ZW5jZUl0ZW1zLnB1c2goZGljb21QYXJzZXIuZXhwbGljaXREYXRhU2V0VG9KUyhlbGVtZW50Lml0ZW1zW2ldLmRhdGFTZXQsIG9wdGlvbnMpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmVzdWx0W3RhZ10gPSBzZXF1ZW5jZUl0ZW1zO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB2YXIgYXNTdHJpbmc7XG4gICAgICAgICAgICAgICAgYXNTdHJpbmcgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgaWYoZWxlbWVudC5sZW5ndGggPCBvcHRpb25zLm1heEVsZW1lbnRMZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgYXNTdHJpbmcgPSBkaWNvbVBhcnNlci5leHBsaWNpdEVsZW1lbnRUb1N0cmluZyhkYXRhU2V0LCBlbGVtZW50KTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZihhc1N0cmluZyAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdFt0YWddID0gYXNTdHJpbmc7XG4gICAgICAgICAgICAgICAgfSAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdFt0YWddID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YU9mZnNldDogZWxlbWVudC5kYXRhT2Zmc2V0LFxuICAgICAgICAgICAgICAgICAgICAgICAgbGVuZ3RoIDogZWxlbWVudC5sZW5ndGhcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH07XG5cblxuICAgIHJldHVybiBkaWNvbVBhcnNlcjtcbn0oZGljb21QYXJzZXIpKTtcbnZhciBkaWNvbVBhcnNlciA9IChmdW5jdGlvbiAoZGljb21QYXJzZXIpIHtcbiAgICBcInVzZSBzdHJpY3RcIjtcblxuICAgIGlmIChkaWNvbVBhcnNlciA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGRpY29tUGFyc2VyID0ge307XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQ29udmVydHMgYW4gZXhwbGljaXQgVlIgZWxlbWVudCB0byBhIHN0cmluZyBvciB1bmRlZmluZWQgaWYgaXQgaXMgbm90IHBvc3NpYmxlIHRvIGNvbnZlcnQuXG4gICAgICogVGhyb3dzIGFuIGVycm9yIGlmIGFuIGltcGxpY2l0IGVsZW1lbnQgaXMgc3VwcGxpZWRcbiAgICAgKiBAcGFyYW0gZGF0YVNldFxuICAgICAqIEBwYXJhbSBlbGVtZW50XG4gICAgICogQHJldHVybnMgeyp9XG4gICAgICovXG4gICAgZGljb21QYXJzZXIuZXhwbGljaXRFbGVtZW50VG9TdHJpbmcgPSBmdW5jdGlvbihkYXRhU2V0LCBlbGVtZW50KVxuICAgIHtcbiAgICAgICAgaWYoZGF0YVNldCA9PT0gdW5kZWZpbmVkIHx8IGVsZW1lbnQgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgdGhyb3cgJ2RpY29tUGFyc2VyLmV4cGxpY2l0RWxlbWVudFRvU3RyaW5nOiBtaXNzaW5nIHJlcXVpcmVkIHBhcmFtZXRlcnMnO1xuICAgICAgICB9XG4gICAgICAgIGlmKGVsZW1lbnQudnIgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgdGhyb3cgJ2RpY29tUGFyc2VyLmV4cGxpY2l0RWxlbWVudFRvU3RyaW5nOiBjYW5ub3QgY29udmVydCBpbXBsaWNpdCBlbGVtZW50IHRvIHN0cmluZyc7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIHZyID0gZWxlbWVudC52cjtcbiAgICAgICAgdmFyIHRhZyA9IGVsZW1lbnQudGFnO1xuXG4gICAgICAgIHZhciB0ZXh0UmVzdWx0O1xuXG4gICAgICAgIGZ1bmN0aW9uIG11bHRpRWxlbWVudFRvU3RyaW5nKG51bUl0ZW1zLCBmdW5jKSB7XG4gICAgICAgICAgICB2YXIgcmVzdWx0ID0gXCJcIjtcbiAgICAgICAgICAgIGZvcih2YXIgaT0wOyBpIDwgbnVtSXRlbXM7IGkrKykge1xuICAgICAgICAgICAgICAgIGlmKGkgIT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9ICcvJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmVzdWx0ICs9IGZ1bmMuY2FsbChkYXRhU2V0LCB0YWcsIGkpLnRvU3RyaW5nKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICB9XG5cbiAgICAgICAgaWYoZGljb21QYXJzZXIuaXNTdHJpbmdWcih2cikgPT09IHRydWUpXG4gICAgICAgIHtcbiAgICAgICAgICAgIHRleHRSZXN1bHQgPSBkYXRhU2V0LnN0cmluZyh0YWcpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHZyID09ICdBVCcpIHtcbiAgICAgICAgICAgIHZhciBudW0gPSBkYXRhU2V0LnVpbnQzMih0YWcpO1xuICAgICAgICAgICAgaWYobnVtID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG51bSA8IDApXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgbnVtID0gMHhGRkZGRkZGRiArIG51bSArIDE7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiAneCcgKyBudW0udG9TdHJpbmcoMTYpLnRvVXBwZXJDYXNlKCk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAodnIgPT0gJ1VTJylcbiAgICAgICAge1xuICAgICAgICAgICAgdGV4dFJlc3VsdCA9IG11bHRpRWxlbWVudFRvU3RyaW5nKGVsZW1lbnQubGVuZ3RoIC8gMiwgZGF0YVNldC51aW50MTYpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYodnIgPT09ICdTUycpXG4gICAgICAgIHtcbiAgICAgICAgICAgIHRleHRSZXN1bHQgPSBtdWx0aUVsZW1lbnRUb1N0cmluZyhlbGVtZW50Lmxlbmd0aCAvIDIsIGRhdGFTZXQuaW50MTYpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHZyID09ICdVTCcpXG4gICAgICAgIHtcbiAgICAgICAgICAgIHRleHRSZXN1bHQgPSBtdWx0aUVsZW1lbnRUb1N0cmluZyhlbGVtZW50Lmxlbmd0aCAvIDQsIGRhdGFTZXQudWludDMyKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmKHZyID09PSAnU0wnKVxuICAgICAgICB7XG4gICAgICAgICAgICB0ZXh0UmVzdWx0ID0gbXVsdGlFbGVtZW50VG9TdHJpbmcoZWxlbWVudC5sZW5ndGggLyA0LCBkYXRhU2V0LmludDMyKTtc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ICAgICAgKiBAcmV0dXJucyB7Kn0gdGhlIHBhcnNlZCBzaWduZWQgaW50IDE2XG4gICAgICAgICAqIEB0aHJvd3MgZXJyb3IgaWYgYnVmZmVyIG92ZXJyZWFkIHdvdWxkIG9jY3VyXG4gICAgICAgICAqIEBhY2Nlc3MgcHJpdmF0ZVxuICAgICAgICAgKi9cbiAgICAgICAgcmVhZEludDE2OiBmdW5jdGlvbiAoYnl0ZUFycmF5LCBwb3NpdGlvbikge1xuICAgICAgICAgICAgaWYgKHBvc2l0aW9uIDwgMCkge1xuICAgICAgICAgICAgICAgIHRocm93ICdiaWdFbmRpYW5CeXRlQXJyYXlQYXJzZXIucmVhZEludDE2OiBwb3NpdGlvbiBjYW5ub3QgYmUgbGVzcyB0aGFuIDAnO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHBvc2l0aW9uICsgMiA+IGJ5dGVBcnJheS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyAnYmlnRW5kaWFuQnl0ZUFycmF5UGFyc2VyLnJlYWRJbnQxNjogYXR0ZW1wdCB0byByZWFkIHBhc3QgZW5kIG9mIGJ1ZmZlcic7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgaW50MTYgPSAoYnl0ZUFycmF5W3Bvc2l0aW9uXSA8PCA4KSArIGJ5dGVBcnJheVtwb3NpdGlvbiArIDFdO1xuICAgICAgICAgICAgLy8gZml4IHNpZ25cbiAgICAgICAgICAgIGlmIChpbnQxNiAmIDB4ODAwMCkge1xuICAgICAgICAgICAgICAgIGludDE2ID0gaW50MTYgLSAweEZGRkYgLSAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGludDE2O1xuICAgICAgICB9LFxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBQYXJzZXMgYW4gdW5zaWduZWQgaW50IDMyIGZyb20gYSBiaWctZW5kaWFuIGJ5dGUgYXJyYXlcbiAgICAgICAgICpcbiAgICAgICAgICog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ICAgIH1cblxuICAgICAgICAgICAgdmFyIGludDMyID0gKChieXRlQXJyYXlbcG9zaXRpb25dIDw8IDI0KSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgKGJ5dGVBcnJheVtwb3NpdGlvbiArIDFdIDw8IDE2KSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgKGJ5dGVBcnJheVtwb3NpdGlvbiArIDJdIDw8IDgpICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUFycmF5W3Bvc2l0aW9uICsgM10pO1xuXG4gICAgICAgICAgICByZXR1cm4gaW50MzI7XG4gICAgICAgIH0sXG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIFBhcnNlcyAzMi1iaXQgZmxvYXQgZnJvbSBhIGJpZy1lbmRpYW4gYnl0ZSBhcnJheVxuICAgICAgICAgKlxuICAgICAgICAgKiBAcGFyYW0gYnl0ZUFycmF5IHRoZSBieXRlIGFycmF5IHRvIHJlYWQgZnJvbVxuICAgICAgICAgKiBAcGFyYW0gcG9zaXRpb24gdGhlIHBvc2l0aW9uIGluIHRoZSBieXRlIGFycmF5IHRvIHJlYWQgZnJvbVxuICAgICAgICAgKiBAcmV0dXJucyB7Kn0gdGhlIHBhcnNlZCAzMi1iaXQgZmxvYXRcbiAgICAgICAgICogQHRocm93cyBlcnJvciBpZiBidWZmZXIgb3ZlcnJlYWQgd291bGQgb2NjdXJcbiAgICAgICAgICogQGFjY2VzcyBwcml2YXRlXG4gICAgICAgICAqL1xuICAgICAgICByZWFkRmxvYXQ6IGZ1bmN0aW9uIChieXRlQXJyYXksIHBvc2l0aW9uKSB7XG4gICAgICAgICAgICBpZiAocG9zaXRpb24gPCAwKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgJ2JpZ0VuZGlhbkJ5dGVBcnJheVBhcnNlci5yZWFkRmxvYXQ6IHBvc2l0aW9uIGNhbm5vdCBiZSBsZXNzIHRoYW4gMCc7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGl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0gYnl0ZVN0cmVhbS5yZWFkVWludDMyKCk7XG4gICAgICAgIHZhciBudW1GcmFnbWVudHMgPSBiYXNpY09mZnNldFRhYmxlSXRlbWxlbmd0aCAvIDQ7XG4gICAgICAgIGZvcih2YXIgaSA9MDsgaSA8IG51bUZyYWdtZW50czsgaSsrKSB7XG4gICAgICAgICAgICB2YXIgb2Zmc2V0ID0gYnl0ZVN0cmVhbS5yZWFkVWludDMyKCk7XG4gICAgICAgICAgICBlbGVtZW50LmJhc2ljT2Zmc2V0VGFibGUucHVzaChvZmZzZXQpO1xuICAgICAgICB9XG4gICAgICAgIHZhciBiYXNlT2Zmc2V0ID0gYnl0ZVN0cmVhbS5wb3NpdGlvbjtcblxuICAgICAgICB3aGlsZShieXRlU3RyZWFtLnBvc2l0aW9uIDwgYnl0ZVN0cmVhbS5ieXRlQXJyYXkubGVuZ3RoKVxuICAgICAgICB7XG4gICAgICAgICAgICB2YXIgdGFnID0gZGljb21QYXJzZXIucmVhZFRhZyhieXRlU3RyZWFtKTtcbiAgICAgICAgICAgIHZhciBsZW5ndGggPSBieXRlU3RyZWFtLnJlYWRVaW50MzIoKTtcbiAgICAgICAgICAgIGlmKHRhZyA9PT0gJ3hmZmZlZTBkZCcpXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgYnl0ZVN0cmVhbS5zZWVrKGxlbmd0aCk7XG4gICAgICAgICAgICAgICAgZWxlbWVudC5sZW5ndGggPSBieXRlU3RyZWFtLnBvc2l0aW9uIC0gZWxlbWVudC5kYXRhT2Zmc2V0O1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYodGFnID09PSAneGZmZmVlMDAwJylcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBlbGVtZW50LmZyYWdtZW50cy5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgb2Zmc2V0OiBieXRlU3RyZWFtLnBvc2l0aW9uIC0gYmFzZU9mZnNldCAtIDgsXG4gICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uIDogYnl0ZVN0cmVhbS5wb3NpdGlvbixcbiAgICAgICAgICAgICAgICAgICAgbGVuZ3RoIDogbGVuZ3RoXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZih3YXJuaW5ncykge1xuICAgICAgICAgICAgICAgICAgICB3YXJuaW5ncy5wdXNoKCd1bmV4cGVjdGVkIHRhZyAnICsgdGFnICsgJyB3aGlsZSBzZWFyY2hpbmcgZm9yIGVuZCBvZiBwaXhlbCBkYXRhIGVsZW1lbnQgd2l0aCB1bmRlZmluZWQgbGVuZ3RoJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmKGxlbmd0aCA+IGJ5dGVTdHJlYW0uYnl0ZUFycmF5Lmxlbmd0aCAtIGJ5dGVTdHJlYW0ucG9zaXRpb24pXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAvLyBmaXggbGVuZ3RoXG4gICAgICAgICAgICAgICAgICAgIGxlbmd0aCA9IGJ5dGVTdHJlYW0uYnl0ZUFycmF5Lmxlbmd0aCAtIGJ5dGVTdHJlYW0ucG9zaXRpb247XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsZW1lbnQuZnJhZ21lbnRzLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICBvZmZzZXQ6IGJ5dGVTdHJlYW0ucG9zaXRpb24gLSBiYXNlT2Zmc2V0IC0gOCxcbiAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gOiBieXRlU3RyZWFtLnBvc2l0aW9uLFxuICAgICAgICAgICAgICAgICAgICBsZW5ndGggOiBsZW5ndGhcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICBieXRlU3RyZWFtLnNlZWsobGVuZ3RoKTtcbiAgICAgICAgICAgICAgICB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WZmZXIgb3ZlcnJlYWQgd291bGQgb2NjdXJcbiAgICAgICAgICogQGFjY2VzcyBwcml2YXRlXG4gICAgICAgICAqL1xuICAgICAgICByZWFkVWludDMyOiBmdW5jdGlvbiAoYnl0ZUFycmF5LCBwb3NpdGlvbikge1xuICAgICAgICAgICAgaWYgKHBvc2l0aW9uIDwgMCkge1xuICAgICAgICAgICAgICAgIHRocm93ICdsaXR0bGVFbmRpYW5CeXRlQXJyYXlQYXJzZXIucmVhZFVpbnQzMjogcG9zaXRpb24gY2Fubm90IGJlIGxlc3MgdGhhbiAwJztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHBvc2l0aW9uICsgNCA+IGJ5dGVBcnJheS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyAnbGl0dGxlRW5kaWFuQnl0ZUFycmF5UGFyc2VyLnJlYWRVaW50MzI6IGF0dGVtcHQgdG8gcmVhZCBwYXN0IGVuZCBvZiBidWZmZXInO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgdWludDMyID0gKGJ5dGVBcnJheVtwb3NpdGlvbl0gK1xuICAgICAgICAgICAgKGJ5dGVBcnJheVtwb3NpdGlvbiArIDFdICogMjU2KSArXG4gICAgICAgICAgICAoYnl0ZUFycmF5W3Bvc2l0aW9uICsgMl0gKiAyNTYgKiAyNTYpICtcbiAgICAgICAgICAgIChieXRlQXJyYXlbcG9zaXRpb24gKyAzXSAqIDI1NiAqIDI1NiAqIDI1NiApKTtcblxuICAgICAgICAgICAgcmV0dXJuIHVpbnQzMjtcbiAgICAgICAgfSxcblxuICAgICAgICAvKipcbiAgICAgICAgICogUGFyc2VzIGEgc2lnbmVkIGludCAzMiBmcm9tIGEgbGl0dGxlLWVuZGlhbiBieXRlIGFycmF5XG4gICAgICAgICAqXG4gICAgICAgICAqIEBwYXJhbSBieXRlQXJyYXkgdGhlIGJ5dGUgYXJyYXkgdG8gcmVhZCBmcm9tXG4gICAgICAgICAq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wgPSB0aGlzLnJlYWROdW1iZXIoKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMHhGRkUwOlxuICAgICAgICAgICAgY2FzZSAweEZGRTE6XG4gICAgICAgICAgICBjYXNlIDB4RkZFMjpcbiAgICAgICAgICAgIGNhc2UgMHhGRkUzOlxuICAgICAgICAgICAgY2FzZSAweEZGRTQ6XG4gICAgICAgICAgICBjYXNlIDB4RkZFNTpcbiAgICAgICAgICAgIGNhc2UgMHhGRkU2OlxuICAgICAgICAgICAgY2FzZSAweEZGRTc6XG4gICAgICAgICAgICBjYXNlIDB4RkZFODpcbiAgICAgICAgICAgIGNhc2UgMHhGRkU5OlxuICAgICAgICAgICAgY2FzZSAweEZGRUE6XG4gICAgICAgICAgICBjYXNlIDB4RkZFQjpcbiAgICAgICAgICAgIGNhc2UgMHhGRkVDOlxuICAgICAgICAgICAgY2FzZSAweEZGRUQ6XG4gICAgICAgICAgICBjYXNlIDB4RkZFRTpcbiAgICAgICAgICAgIGNhc2UgMHhGRkVGOlxuICAgICAgICAgICAgICAgIHRoaXMucmVhZEFwcCgpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAweEZGRkU6XG4gICAgICAgICAgICAgICAgdGhpcy5yZWFkQ29tbWVudCgpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICBpZiAoKGN1cnJlbnQgPj4gOCkgIT09IDB4RkYpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiRVJST1I6IGZvcm1hdCB0aHJvdyBuZXcgSU9FeGNlcHRpb24hIChkZWNvZGUpXCIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGN1cnJlbnQgPSB0aGlzLnN0cmVhbS5nZXQxNigpO1xuICAgIH1cblxuICAgIGlmICgoY3VycmVudCA8IDB4RkZDMCkgfHwgKGN1cnJlbnQgPiAweEZGQzcpKSB7XG4gICAgICAgIHRocm93IG5ldyBFcnJvcihcIkVSUk9SOiBjb3VsZCBub3QgaGFuZGxlIGFyaXRobWV0aWMgY29kZSFcIik7XG4gICAgfVxuXG4gICAgdGhpcy5mcmFtZS5yZWFkKHRoaXMuc3RyZWFtKTtcbiAgICBjdXJyZW50ID0gdGhpcy5zdHJlYW0uZ2V0MTYoKTtcblxuICAgIGRvIHtcbiAgICAgICAgd2hpbGUgKGN1cnJlbnQgIT09IDB4MEZGREEpIHsgLy8gU09TXG4gICAgICAgICAgICBzd2l0Y2ggKGN1cnJlbnQpIHtcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZDNDogLy8gREhUXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuaHVmZlRhYmxlLnJlYWQodGhpcy5zdHJlYW0sIHRoaXMuSHVmZlRhYik7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgMHhGRkNDOiAvLyBEQUNcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiUHJvZ3JhbSBkb2Vzbid0IHN1cHBvcnQgYXJpdGhtZXRpYyBjb2RpbmcuIChmb3JtYXQgdGhyb3cgbmV3IElPRXhjZXB0aW9uKVwiKTtcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZEQjpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5xdWFudFRhYmxlLnJlYWQodGhpcy5zdHJlYW0sIGpwZWcubG9zc2xlc3MuRGVjb2Rlci5UQUJMRSk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgMHhGRkREOlxuICAgICAgICAgICAgICAgICAgICB0aGlzLnJlc3RhcnRJbnRlcnZhbCA9IHRoaXMucmVhZE51bWJlcigpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFMDpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFMTpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFMjpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFMzpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFNDpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFNTpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFNjpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFNzpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFODpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFOTpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFQTpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFQjpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFQzpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFRDpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFRTpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFRjpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yZWFkQXBwKCk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgMHhGRkZFOlxuICAgICAgICAgICAgICAgICAgICB0aGlzLnJlYWRDb21tZW50KCk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgIGlmICgoY3VycmVudCA+PiA4KSAhPT0gMHhGRikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiRVJST1I6IGZvcm1hdCB0aHJvdyBuZXcgSU9FeGNlcHRpb24hIChQYXJzZXIuZGVjb2RlKVwiKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBjdXJyZW50ID0gdGhpcy5zdHJlYW0uZ2V0MTYoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMucHJlY2lzaW9uID0gdGhpcy5mcmFtZS5wcmVjaXNpb247XG4gICAgICAgIHRoaXMuY29tcG9uZW50cyA9IHRoaXMuZnJhbWUuY29tcG9uZW50cztcblxuICAgICAgICBpZiAoIXRoaXMubnVtQnl0ZXMpIHtcbiAgICAgICAgICAgIHRoaXMubnVtQnl0ZXMgPSBwYXJzZUludChNYXRoLmNlaWwodGhpcy5wcmVjaXNpb24gLyA4KSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5udW1CeXRlcyA9PSAxKSB7XG4gICAgICAgICAgICB0aGlzLm1hc2sgPSAweEZGO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5tYXNrID0gMHhGRkZGO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5zY2FuLnJlYWQodGhpcy5zdHJlYW0pO1xuICAgICAgICB0aGlzLm51bUNvbXAgPSB0aGlzLnNjYW4ubnVtQ29tcDtcbiAgICAgICAgdGhpcy5zZWxlY3Rpb24gPSB0aGlzLnNjYW4uc2VsZWN0aW9uO1xuXG4gICAgICAgIGlmICh0aGlzLm51bUJ5dGVzID09PSAxKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5udW1Db21wID09PSAzKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5nZXR0ZXIgPSB0aGlzLmdldFZhbHVlUkdCO1xuICAgICAgICAgICAgICAgIHRoaXMuc2V0dGVyID0gdGhpcy5zZXRWYWx1ZVJHQjtcbiAgICAgICAgICAgICAgICB0aGlzLm91dHB1dCA9IHRoaXMub3V0cHV0UkdCO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLmdldHRlciA9IHRoaXMuZ2V0VmFsdWU4O1xuICAgICAgICAgICAgICAgIHRoaXMuc2V0dGVyID0gdGhpcy5zZXRWYWx1ZTg7XG4gICAgICAgICAgICAgICAgdGhpcy5vdXRwdXQgPSB0aGlzLm91dHB1dFNpbmdsZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuZ2V0dGVyID0gdGhpcy5nZXRWYWx1ZTE2O1xuICAgICAgICAgICAgdGhpcy5zZXR0ZXIgPSB0aGlzLnNldFZhbHVlMTY7XG4gICAgICAgICAgICB0aGlzLm91dHB1dCA9IHRoaXMub3V0cHV0U2luZ2xlO1xuICAgICAgICB9XG5cbiAgICAgICAgc3dpdGNoICh0aGlzLnNlbGVjdGlvbikge1xuICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgIHRoaXMuc2VsZWN0b3IgPSB0aGlzLnNlbGVjdDI7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgICAgICAgdGhpcy5zZWxlY3RvciA9IHRoaXMuc2VsZWN0MztcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgNDpcbiAgICAgICAgICAgICAgICB0aGlzLnNlbGVjdG9yID0gdGhpcy5zZWxlY3Q0O1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA1OlxuICAgICAgICAgICAgICAgIHRoaXMuc2VsZWN0b3IgPSB0aGlzLnNlbGVjdDU7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDY6XG4gICAgICAgICAgICAgICAgdGhpcy5zZWxlY3RvciA9IHRoaXMuc2VsZWN0NjtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgNzpcbiAgICAgICAgICAgICAgICB0aGlzLnNlbGVjdG9yID0gdGhpcy5zZWxlY3Q3O1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICB0aGlzLnNlbGVjdG9yID0gdGhpcy5zZWxlY3QxO1x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W5cbiAgICAgICAgICAgIHRlbXBbMF0gPSAwO1xuICAgICAgICAgICAgaW5kZXhbMF0gPSAwO1xuXG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMTA7IGkrPTEpIHtcbiAgICAgICAgICAgICAgICBwcmVkW2ldID0gKDEgPDwgKHRoaXMucHJlY2lzaW9uIC0gMSkpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAodGhpcy5yZXN0YXJ0SW50ZXJ2YWwgPT09IDApIHtcbiAgICAgICAgICAgICAgICBjdXJyZW50ID0gdGhpcy5kZWNvZGVVbml0KHByZWQsIHRlbXAsIGluZGV4KTtcblxuICAgICAgICAgICAgICAgIHdoaWxlICgoY3VycmVudCA9PT0gMCkgJiYgKCh0aGlzLnhMb2MgPCB0aGlzLnhEaW0pICYmICh0aGlzLnlMb2MgPCB0aGlzLnlEaW0pKSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLm91dHB1dChwcmVkKTtcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudCA9IHRoaXMuZGVjb2RlVW5pdChwcmVkLCB0ZW1wLCBpbmRleCk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgYnJlYWs7IC8vY3VycmVudD1NQVJLRVJcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZm9yIChtY3VOdW0gPSAwOyBtY3VOdW0gPCB0aGlzLnJlc3RhcnRJbnRlcnZhbDsgbWN1TnVtKz0xKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5yZXN0YXJ0aW5nID0gKG1jdU51bSA9PSAwKTtcbiAgICAgICAgICAgICAgICBjdXJyZW50ID0gdGhpcy5kZWNvZGVVbml0KHByZWQsIHRlbXAsIGluZGV4KTtcbiAgICAgICAgICAgICAgICB0aGlzLm91dHB1dChwcmVkKTtcblxuICAgICAgICAgICAgICAgIGlmIChjdXJyZW50ICE9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKGN1cnJlbnQgPT09IDApIHtcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5tYXJrZXJJbmRleCAhPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBjdXJyZW50ID0gKDB4RkYwMCB8IHRoaXMubWFya2VyKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5tYXJrZXJJbmRleCA9IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudCA9IHRoaXMuc3RyZWFtLmdldDE2KCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoISgoY3VycmVudCA+PSBqcGVnLmxvc3NsZXNzLkRlY29kZXIuUkVTVEFSVF9NQVJLRVJfQkVHSU4pICYmXG4gICAgICAgICAgICAgICAgKGN1cnJlbnQgPD0ganBlZy5sb3NzbGVzcy5EZWNvZGVyLlJFU1RBUlRfTUFSS0VSX0VORCkpKSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7IC8vY3VycmVudD1NQVJLRVJcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmICgoY3VycmVudCA9PT0gMHhGRkRDKSAmJiAoc2Nhbk51bSA9PT0gMSkpIHsgLy9ETkxcbiAgICAgICAgICAgIHRoaXMucmVhZE51bWJlcigpO1xuICAgICAgICAgICAgY3VycmVudCA9IHRoaXMuc3RyZWFtLmdldDE2KCk7XG4gICAgICAgIH1cbiAgICB9IHdoaWxlICgoY3VycmVudCAhPT0gMHhGRkQ5KSAmJiAoKHRoaXMueExvYyA8IHRoaXMueERpbSkgJiYgKHRoaXMueUxvYyA8IHRoaXMueURpbSkpICYmIChzY2FuTnVtID09PSAwKSk7XG5cbiAgICByZXR1cm4gdGhpcy5vdXRwdXREYXRhO1xufTtcblxuXG5cbmpwZWcubG9zc2xlc3M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Mik7XG5cbiAgICBmb3IgKGN0ckMgPSAwOyBjdHJDIDwgdGhpcy5udW1Db21wOyBjdHJDKz0xKSB7XG4gICAgICAgIHF0YWIgPSB0aGlzLnFUYWJbY3RyQ107XG4gICAgICAgIGFjdGFiID0gdGhpcy5hY1RhYltjdHJDXTtcbiAgICAgICAgZGN0YWIgPSB0aGlzLmRjVGFiW2N0ckNdO1xuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgdGhpcy5uQmxvY2tbY3RyQ107IGkrPTEpIHtcbiAgICAgICAgICAgIGZvciAoayA9IDA7IGsgPCB0aGlzLklEQ1RfU291cmNlLmxlbmd0aDsgays9MSkge1xuICAgICAgICAgICAgICAgIHRoaXMuSURDVF9Tb3VyY2Vba10gPSAwO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YWx1ZSA9IHRoaXMuZ2V0SHVmZm1hblZhbHVlKGRjdGFiLCB0ZW1wLCBpbmRleCk7XG5cbiAgICAgICAgICAgIGlmICh2YWx1ZSA+PSAweEZGMDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHByZXZbY3RyQ10gPSB0aGlzLklEQ1RfU291cmNlWzBdID0gcHJldltjdHJDXSArIHRoaXMuZ2V0bihpbmRleCwgdmFsdWUsIHRlbXAsIGluZGV4KTtcbiAgICAgICAgICAgIHRoaXMuSURDVF9Tb3VyY2VbMF0gKj0gcXRhYlswXTtcblxuICAgICAgICAgICAgZm9yIChqID0gMTsgaiA8IDY0OyBqKz0xKSB7XG4gICAgICAgICAgICAgICAgdmFsdWUgPSB0aGlzLmdldEh1ZmZtYW5WYWx1ZShhY3RhYiwgdGVtcCwgaW5kZXgpO1xuXG4gICAgICAgICAgICAgICAgaWYgKHZhbHVlID49IDB4RkYwMCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaiArPSAodmFsdWUgPj4gNCk7XG5cbiAgICAgICAgICAgICAgICBpZiAoKHZhbHVlICYgMHgwRikgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCh2YWx1ZSA+PiA0KSA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLklEQ1RfU291cmNlW2pwZWcubG9zc2xlc3MuRGVjb2Rlci5JRENUX1Bbal1dID0gdGhpcy5nZXRuKGluZGV4LCB2YWx1ZSAmIDB4MEYsIHRlbXAsIGluZGV4KSAqIHF0YWJbal07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIDA7XG59O1xuXG5cblxuanBlZy5sb3NzbGVzcy5EZWNvZGVyLnByb3RvdHlwZS5kZWNvZGVTaW5nbGUgPSBmdW5jdGlvbiAocHJldiwgdGVtcCwgaW5kZXgpIHtcbiAgICAvKmpzbGludCBiaXR3aXNlOiB0cnVlICovXG5cbiAgICB2YXIgdmFsdWUsIGksIG4sIG5SZXN0YXJ0O1xuXG4gICAgaWYgKHRoaXMucmVzdGFydGluZykge1xuICAgICAgICB0aGlzLnJlc3RhcnRpbmcgPSBmYWxzZTtcbiAgICAgICAgcHJldlswXSA9ICgxIDw8ICh0aGlzLmZyYW1lLnByZWNpc2lvbiAtIDEpKTtcbiAgICB9IGVsc2Uge1xuICAgICAgICBwcmV2WzBdID0gdGhpcy5zZWxlY3RvcigpO1xuICAgIH1cblxuICAgIGZvciAoaSA9IDA7IGkgPCB0aGlzLm5CbG9ja1swXTsgaSs9MSkge1xuICAgICAgICB2YWx1ZSA9IHRoaXMuZ2V0SHVmZm1hblZhbHVlKHRoaXMuZGNUYWJbMF0sIHRlbXAsIGluZGV4KTtcbiAgICAgICAgaWYgK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MCkge1xuICAgICAgICAgICAgICAgIHRoaXMubWFya2VySW5kZXggPSA5O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHRlbXBbMF0gfD0gaW5wdXQ7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgaW5kZXhbMF0gLT0gODtcbiAgICB9XG5cbiAgICBjb2RlID0gdGFibGVbdGVtcFswXSA+PiBpbmRleFswXV07XG5cbiAgICBpZiAoKGNvZGUgJiBqcGVnLmxvc3NsZXNzLkRlY29kZXIuTVNCKSAhPT0gMCkge1xuICAgICAgICBpZiAodGhpcy5tYXJrZXJJbmRleCAhPT0gMCkge1xuICAgICAgICAgICAgdGhpcy5tYXJrZXJJbmRleCA9IDA7XG4gICAgICAgICAgICByZXR1cm4gMHhGRjAwIHwgdGhpcy5tYXJrZXI7XG4gICAgICAgIH1cblxuICAgICAgICB0ZW1wWzBdICY9IChtYXNrID4+ICgxNiAtIGluZGV4WzBdKSk7XG4gICAgICAgIHRlbXBbMF0gPDw9IDg7XG4gICAgICAgIGlucHV0ID0gdGhpcy5zdHJlYW0uZ2V0OCgpO1xuXG4gICAgICAgIGlmIChpbnB1dCA9PT0gMHhGRikge1xuICAgICAgICAgICAgdGhpcy5tYXJrZXIgPSB0aGlzLnN0cmVhbS5nZXQ4KCk7XG4gICAgICAgICAgICBpZiAodGhpcy5tYXJrZXIgIT09IDApIHtcbiAgICAgICAgICAgICAgICB0aGlzLm1hcmtlckluZGV4ID0gOTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHRlbXBbMF0gfD0gaW5wdXQ7XG4gICAgICAgIGNvZGUgPSB0YWJsZVsoKGNvZGUgJiAweEZGKSAqIDI1NikgKyAodGVtcFswXSA+PiBpbmRleFswXSldO1xuICAgICAgICBpbmRleFswXSArPSA4O1xuICAgIH1cblxuICAgIGluZGV4WzBdICs9IDggLSAoY29kZSA+PiA4KTtcblxuICAgIGlmIChpbmRleFswXSA8IDApIHtcbiAgICA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J1cHRpbmcgdGhlIGxhc3QgcGl4ZWwgaW4gc29tZSBjYXNlc1xuICAgICAgICAgICAgdGhpcy5tYXJrZXJJbmRleCA9IDA7XG4gICAgICAgICAgICByZXR1cm4gKDB4RkYwMCB8IHRoaXMubWFya2VyKSA8PCA4O1xuICAgICAgICB9XG5cbiAgICAgICAgcmVzdWx0ID0gdGVtcFswXSA+PiBpbmRleFswXTtcbiAgICAgICAgdGVtcFswXSAmPSAobWFzayA+PiAoMTYgLSBpbmRleFswXSkpO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIHRlbXBbMF0gPDw9IDg7XG4gICAgICAgIGlucHV0ID0gdGhpcy5zdHJlYW0uZ2V0OCgpO1xuXG4gICAgICAgIGlmIChpbnB1dCA9PT0gMHhGRikge1xuICAgICAgICAgICAgdGhpcy5tYXJrZXIgPSB0aGlzLnN0cmVhbS5nZXQ4KCk7XG4gICAgICAgICAgICBpZiAodGhpcy5tYXJrZXIgIT09IDApIHtcbiAgICAgICAgICAgICAgICB0aGlzLm1hcmtlckluZGV4ID0gOTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHRlbXBbMF0gfD0gaW5wdXQ7XG4gICAgICAgIGluZGV4WzBdICs9IDg7XG5cbiAgICAgICAgaWYgKGluZGV4WzBdIDwgMCkge1xuICAgICAgICAgICAgaWYgKHRoaXMubWFya2VySW5kZXggIT09IDApIHtcbiAgICAgICAgICAgICAgICB0aGlzLm1hcmtlckluZGV4ID0gMDtcbiAgICAgICAgICAgICAgICByZXR1cm4gKDB4RkYwMCB8IHRoaXMubWFya2VyKSA8PCA4O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB0ZW1wWzBdIDw8PSA4O1xuICAgICAgICAgICAgaW5wdXQgPSB0aGlzLnN0cmVhbS5nZXQ4KCk7XG5cbiAgICAgICAgICAgIGlmIChpbnB1dCA9PT0gMHhGRikge1xuICAgICAgICAgICAgICAgIHRoaXMubWFya2VyID0gdGhpcy5zdHJlYW0uZ2V0OCgpO1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLm1hcmtlciAhPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLm1hcmtlckluZGV4ID0gOTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRlbXBbMF0gfD0gaW5wdXQ7XG4gICAgICAgICAgICBpbmRleFswXSArPSA4O1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGluZGV4WzBdIDwgMCkge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiaW5kZXg9XCIgKyBpbmRleFswXSArIFwiIGluIGdldG4oKVwiKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChpbmRleFswXSA8IHRoaXMubWFya2VySW5kZXgpIHtcbiAgICAgICAgICAgIHRoaXMubWFya2VySW5kZXggPSAwO1xuICAgICAgICAgICAgcmV0dXJuICgweEZGMDAgfCB0aGlzLm1hcmtlcikgPDwgODtcbiAgICAgICAgfVxuXG4gICAgICAgIHJlc3VsdCA9IHRlbXBbMF0gPj4gaW5kZXhbMF07XG4gICAgICAgIHRlbXBbMF0gJj0gKG1hc2sgPj4gKDE2IC0gaW5kZXhbMF0pKTtcbiAgICB9XG5cbiAgICBpZiAocmVzdWx0IDwgKG9uZSA8PCAobiAtIDEpKSkge1xuICAgICAgICByZXN1bHQgKz0gKG5fb25lIDw8IG4pICsgMTtcbiAgICB9XG5cbiAgICByZXR1cm4gcmVzdWx0O1xufTtcblxuXG5cbmpwZWcubG9zc2xlc3MuRGVjb2Rlci5wcm90b3R5cGUuZ2V0UHJldmlvdXNYID0gZnVuY3Rpb24gKGNvbXBPZmZzZXQpIHtcbiAgICAvKmpzbGludCBiaXR3aXNlOiB0cnVlICovXG5cbiAgICBpZiAodGhpcy54TG9jID4gMCkge1xuICAgICAgICByZXR1cm4gdGhpcy5nZXR0ZXIoKCgodGhpcy55TG9jICogdGhpcy54RGltKSArIHRo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LmlzTGFzdFBpeGVsID0gZnVuY3Rpb24gKCkge1xuICAgIHJldHVybiAodGhpcy54TG9jID09PSAodGhpcy54RGltIC0gMSkpICYmICh0aGlzLnlMb2MgPT09ICh0aGlzLnlEaW0gLSAxKSk7XG59O1xuXG5cblxuanBlZy5sb3NzbGVzcy5EZWNvZGVyLnByb3RvdHlwZS5vdXRwdXRTaW5nbGUgPSBmdW5jdGlvbiAoUFJFRCkge1xuICAgIGlmICgodGhpcy54TG9jIDwgdGhpcy54RGltKSAmJiAodGhpcy55TG9jIDwgdGhpcy55RGltKSkge1xuICAgICAgICB0aGlzLnNldHRlcigoKCh0aGlzLnlMb2MgKiB0aGlzLnhEaW0pICsgdGhpcy54TG9jKSksIHRoaXMubWFzayAmIFBSRURbMF0pO1xuXG4gICAgICAgIHRoaXMueExvYys9MTtcblxuICAgICAgICBpZiAodGhpcy54TG9jID49IHRoaXMueERpbSkge1xuICAgICAgICAgICAgdGhpcy55TG9jKz0xO1xuICAgICAgICAgICAgdGhpcy54TG9jID0gMDtcbiAgICAgICAgfVxuICAgIH1cbn07XG5cblxuXG5qcGVnLmxvc3NsZXNzLkRlY29kZXIucHJvdG90eXBlLm91dHB1dFJHQiA9IGZ1bmN0aW9uIChQUkVEKSB7XG4gICAgdmFyIG9mZnNldCA9ICgodGhpcy55TG9jICogdGhpcy54RGltKSArIHRoaXMueExvYyk7XG5cbiAgICBpZiAoKHRoaXMueExvYyA8IHRoaXMueERpbSkgJiYgKHRoaXMueUxvYyA8IHRoaXMueURpbSkpIHtcbiAgICAgICAgdGhpcy5zZXR0ZXIob2Zmc2V0LCBQUkVEWzBdLCAwKTtcbiAgICAgICAgdGhpcy5zZXR0ZXIob2Zmc2V0LCBQUkVEWzFdLCAxKTtcbiAgICAgICAgdGhpcy5zZXR0ZXIob2Zmc2V0LCBQUkVEWzJdLCAyKTtcblxuICAgICAgICB0aGlzLnhMb2MrPTE7XG5cbiAgICAgICAgaWYgKHRoaXMueExvYyA+PSB0aGlz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3aGlsZSAoY291bnQgPCBsZW5ndGgpIHtcbiAgICAgICAgdGVtcCA9IGRhdGEuZ2V0OCgpO1xuICAgICAgICBjb3VudCs9MTtcbiAgICAgICAgdCA9IHRlbXAgJiAweDBGO1xuICAgICAgICBpZiAodCA+IDMpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkVSUk9SOiBIdWZmbWFuIHRhYmxlIElEID4gM1wiKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGMgPSB0ZW1wID4+IDQ7XG4gICAgICAgIGlmIChjID4gMikge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiRVJST1I6IEh1ZmZtYW4gdGFibGUgW1RhYmxlIGNsYXNzID4gMiBdXCIpO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy50aFt0XSA9IDE7XG4gICAgICAgIHRoaXMudGNbdF1bY10gPSAxO1xuXG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCAxNjsgaSs9MSkge1xuICAgICAgICAgICAgdGhpcy5sW3RdW2NdW2ldID0gZGF0YS5nZXQ4KCk7XG4gICAgICAgICAgICBjb3VudCs9MTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCAxNjsgaSs9MSkge1xuICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IHRoaXMubFt0XVtjXVtpXTsgais9MSkge1xuICAgICAgICAgICAgICAgIGlmIChjb3VudCA+IGxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJFUlJPUjogSHVmZm1hbiB0YWJsZSBmb3JtYXQgZXJyb3IgW2NvdW50PkxoXVwiKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB0aGlzLnZbdF1bY11baV1bal0gPSBkYXRhLmdldDgoKTtcbiAgICAgICAgICAgICAgICBjb3VudCs9MTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgI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gICBmb3IgKGkgPSAwOyBpIDwgODsgaSs9MSkgeyAvLyBpKzEgaXMgQ29kZSBsZW5ndGhcbiAgICAgICAgZm9yIChqID0gMDsgaiA8IExbaV07IGorPTEpIHtcbiAgICAgICAgICAgIGZvciAobiA9IDA7IG4gPCAodGVtcCA+PiAoaSArIDEpKTsgbis9MSkge1xuICAgICAgICAgICAgICAgIHRhYltrXSA9IFZbaV1bal0gfCAoKGkgKyAxKSA8PCA4KTtcbiAgICAgICAgICAgICAgICBrKz0xO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgZm9yIChpID0gMTsgayA8IDI1NjsgaSs9MSwgays9MSkge1xuICAgICAgICB0YWJba10gPSBpIHwganBlZy5sb3NzbGVzcy5IdWZmbWFuVGFibGUuTVNCO1xuICAgIH1cblxuICAgIGN1cnJlbnRUYWJsZSA9IDE7XG4gICAgayA9IDA7XG5cbiAgICBmb3IgKGkgPSA4OyBpIDwgMTY7IGkrPTEpIHsgLy8gaSsxIGlzIENvZGUgbGVuZ3RoXG4gICAgICAgIGZvciAoaiA9IDA7IGogPCBMW2ldOyBqKz0xKSB7XG4gICAgICAgICAgICBmb3IgKG4gPSAwOyBuIDwgKHRlbXAgPj4gKGkgLSA3KSk7IG4rPTEpIHtcbiAgICAgICAgICAgICAgICB0YWJbKGN1cnJlbnRUYWJsZSAqIDI1NikgKyBrXSA9IFZbaV1bal0gfCAoKGkgKyAxKSA8PCA4KTtcbiAgICAgICAgICAgICAgICBrKz0xO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoayA+PSAyNTYpIHtcbiAgICAgICAgICAgICAgICBpZiAoayA+IDI1Nikge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJFUlJPUjogSHVmZm1hbiB0YWJsZSBlcnJvcigxKSFcIik7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgayA9IDA7XG4gICAgICAgICAgICAgICAg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AgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNjQ7IGkrPTEpIHtcbiAgICAgICAgICAgICAgICBpZiAoY291bnQgPiBsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiRVJST1I6IFF1YW50aXphdGlvbiB0YWJsZSBmb3JtYXQgZXJyb3JcIik7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdGhpcy5xdWFudFRhYmxlc1t0XVtpXSA9IGRhdGEuZ2V0OCgpO1xuICAgICAgICAgICAgICAgIGNvdW50Kz0xO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBqcGVnLmxvc3NsZXNzLlF1YW50aXphdGlvblRhYmxlLmVuaGFuY2VRdWFudGl6YXRpb25UYWJsZSh0aGlzLnF1YW50VGFibGVzW3RdLCB0YWJsZSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNjQ7IGkrPTEpIHtcbiAgICAgICAgICAgICAgICBpZiAoY291bnQgPiBsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiRVJST1I6IFF1YW50aXphdGlvbiB0YWJsZSBmb3JtYXQgZXJyb3JcIik7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdGhpcy5xdWFudFRhYmxlc1t0XVtpXSA9IGRhdGEuZ2V0MTYoKTtcbiAgICAgICAgICAgICAgICBjb3VudCArPSAyO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBqcGVnLmxvc3NsZXNzLlF1YW50aXphdGlvblRhYmxlLmVuaGFuY2VRdWFudGl6YXRpb25UYWJsZSh0aGlzLnF1YW50VGFibGVzW3RdLCB0YWJsZSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBpZiAoY291bnQgIT09IGxlbmd0aCkge1xuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXC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HpqICogemopOyAgLyogbXVzdCByZW5vcm1hbGl6ZSAqL1xuICAgICAgICBpZiAodmFsID09PSAwLjApIHsgICAgICAgICAgICAgIC8qIGogd2FzIHBhcmFsbGVsIHRvIGk/ICovXG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgfVxuICAgICAgICB4aiAvPSB2YWw7XG4gICAgICAgIHlqIC89IHZhbDtcbiAgICAgICAgemogLz0gdmFsO1xuICAgIH1cblxuICAgIC8qIG5vcm1hbGl6ZSBrIGF4aXM7IGlmIGl0IGlzIHplcm8sIG1ha2UgaXQgdGhlIGNyb3NzIHByb2R1Y3QgaSB4IGogKi9cbiAgICB2YWwgPSBNYXRoLnNxcnQoeGsgKiB4ayArIHlrICogeWsgKyB6ayAqIHprKTtcbiAgICBpZiAodmFsID09PSAwLjApIHtcbiAgICAgICAgeGsgPSB5aSAqIHpqIC0gemkgKiB5ajtcbiAgICAgICAgeWsgPSB6aSAqIHhqIC0gemogKiB4aTtcbiAgICAgICAgemsgPSB4aSAqIHlqIC0geWkgKiB4ajtcbiAgICB9IGVsc2Uge1xuICAgICAgICB4ayAvPSB2YWw7XG4gICAgICAgIHlrIC89IHZhbDtcbiAgICAgICAgemsgLz0gdmFsO1xuICAgIH1cblxuICAgIC8qIG9ydGhvZ29uYWxpemUgayB0byBpICovXG4gICAgdmFsID0geGkgKiB4ayArIHlpICogeWsgKyB6aSAqIHprOyAgICAvKiBkb3QgcHJvZHVjdCBiZXR3ZWVuIGkgYW5kIGsgKi9cbiAgICBpZiAoTWF0aC5hYnModmFsKSA+IDEuRS00KSB7XG4gICAgICAgIHhrIC09IHZhbCAqIHhpO1xuICAgICAgICB5ayAtPSB2YWwgKiB5aTtcbiAgICAgICAgemsgLT0gdmFsICogemk7XG4gICAgICAgIHZhbCA9IE1hdGguc3FydCh4ayAqIHhrICsgeWsgKiB5ayArIHprICogemspO1xuICAgICAgICBpZiAodmFsID09PSAwLjApIHsgICAgLyogYmFkICovXG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgfVxuICAgICAgICB4ayAvPSB2YWw7XG4gICAgICAgIHlrIC89IHZhbDtcbiAgICAgICAgemsgLz0gdmFsO1xuICAgIH1cblxuICAgIC8qIG9ydGhvZ29uYWxpemUgayB0byBqICovXG4gICAgdmFsID0geGogKiB4ayArIHlqICogeWsgKyB6aiAqIHprOyAgICAvKiBkb3QgcHJvZHVjdCBiZXR3ZWVuIGogYW5kIGsgKi9cbiAgICBpZiAoTWF0aC5hYnModmFsKSA+IDEuZS00KSB7XG4gICAgICAgIHhrIC09IHZhbCAqIHhqO1xuICAgICAgICB5ayAtPSB2YWwgKiB5ajtcbiAgICAgICAgemsgLT0gdmFsICogemo7XG4gICAgICAgIHZhbCA9IE1hdGguc3FydCh4ayAqIHhrICsgeWsgKiB5ayArIHprICogemspO1xuICAgICAgICBpZiAodmFsID09PSAwLjApIHsgICAgIC8qIGJhZCAqL1xuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgeGsgLz0gdmFsO1xuICAgICAgICB5ayAvPSB2YWw7XG4gICAgICAgIHprIC89IHZhbDtcbiAgICB9XG5cbiAgICBRWzBdWzBdID0geGk7XG4gICAgUVswXVsxXSA9IHhqO1xuICAgIFFbMF1bMl0gPSB4aztcbiAgICBRWzFdWzBdID0geWk7XG4gICAgUVsxXVsxXSA9IHlqO1xuICAgIFFbMV1bMl0gPSB5aztcbiAgICBRWzJdWzBdID0gemk7XG4gICAgUVsyXVsxXSA9IHpqO1xuICAgIFFbMl1bMl0gPSB6aztcblxuICAgIC8qIGF0IHRoaXMgcG9pbnQsIFEgaXMgdGhlIHJvdGF0aW9uIG1hdHJpeCBmcm9tIHRoZSAoaSxqLGspIHRvICh4LHkseikgYXhlcyAqL1xuXG4gICAgZGV0USA9IHRoaXMubmlmdGlfbWF0MzNfZGV0ZXJtKFEpO1xuICAgIGlmIChkZXRRID09PSAwLjApIHsgLyogc2hvdWxkbid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ICAgICAgICAgICAgICAgICBpZiAoIShpID09PSBrIHx8IGogPT09IGspKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBQWzBdWzBdID0gUFswXVsxXSA9IFBbMF1bMl0gPSBQWzFdWzBdID0gUFsxXVsxXSA9IFBbMV1bMl0gPSBQWzJdWzBdID0gUFsyXVsxXSA9IFBbMl1bMl0gPSAwLjA7XG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHAgPSAtMTsgcCA8PSAxOyBwICs9IDIpIHsgICAgLyogcCxxLHIgYXJlIC0xIG9yICsxICAgICAgKi9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHEgPSAtMTsgcSA8PSAxOyBxICs9IDIpIHsgICAvKiBhbmQgZ28gaW50byByb3dzICMxLDIsMyAqL1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHIgPSAtMTsgciA8PSAxOyByICs9IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBbMF1baSAtIDFdID0gcDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBbMV1baiAtIDFdID0gcTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBbMl1bayAtIDFdID0gcjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRldFAgPSB0aGlzLm5pZnRpX21hdDMzX2RldGVybShQKTsgICAgICAgICAgIC8qIHNpZ24gb2YgcGVybXV0YXRpb24gKi9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZGV0UCAqIGRldFEpID4gMC4wKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTSA9IHRoaXMubmlmdGlfbWF0MzNfbXVsKFAsIFEpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogYW5nbGUgb2YgTSByb3RhdGlvbiA9IDIuMCphY29zKDAuNSpzcXJ0KDEuMCt0cmFjZShNKSkpICAgICAgICovXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogd2Ugd2FudCBsYXJnZXN0IHRyYWNlKE0pID09IHNtYWxsZXN0IGFuZ2xlID09IE0gbmVhcmVzdCB0byBJICovXG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWwgPSBNWzBdWzBdICsgTVsxXVsxXSArIE1bMl1bMl07IC8qIHRyYWNlICovXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHZhbCA+IHZiZXN0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZiZXN0ID0gdmFsO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpYmVzdCA9IGk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpiZXN0ID0gajtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2Jlc3QgPSBrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYmVzdCA9IHA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHFiZXN0ID0gcTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmJlc3QgPSByO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gIC8qIGRvZXNuJ3QgbWF0Y2ggc2lnbiBvZiBRICovXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4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C8qaSA9IE5JRlRJX0wyUiovXG4gICAgICAgICAgICBpQ2hhciA9ICdYJztcbiAgICAgICAgICAgIGlTZW5zZSA9ICcrJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIC0xOiAvKmkgPSBOSUZUSV9SMkwqL1xuICAgICAgICAgICAgaUNoYXIgPSAnWCc7XG4gICAgICAgICAgICBpU2Vuc2UgPSAnLSc7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAyOiAvKmkgPSBOSUZUSV9QMkEqL1xuICAgICAgICAgICAgaUNoYXIgPSAnWSc7XG4gICAgICAgICAgICBpU2Vuc2UgPSAnKyc7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAtMjogLyppID0gTklGVElfQTJQKi9cbiAgICAgICAgICAgIGlDaGFyID0gJ1knO1xuICAgICAgICAgICAgaVNlbnNlID0gJy0nO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgMzogLyppID0gTklGVElfSTJTKi9cbiAgICAgICAgICAgIGlDaGFyID0gJ1onO1xuICAgICAgICAgICAgaVNlbnNlID0gJysnO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgLTM6IC8qaSA9IE5JRlRJX1MySSovXG4gICAgICAgICAgICBpQ2hhciA9ICdaJztcbiAgICAgICAgICAgIGlTZW5zZSA9ICctJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgIH1cblxuICAgIHN3aXRjaCAoamJlc3QgKiBxYmVzdCkge1xuICAgICAgICBjYXNlIDE6IC8qaiA9IE5JRlRJX0wyUiovXG4gICAgICAgICAgICBqQ2hhciA9ICdYJztcbiAgICAgICAgICAgIGpTZW5zZSA9ICcrJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIC0xOiAvKmogPSBOSUZUSV9SMkwqL1xuICAgICAgICAgICAgakNoYXIgPSAnWCc7XG4gICAgICAgICAgICBqU2Vuc2UgPSAnLSc7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAyOiAvKmogPSBOSUZUSV9QMkEqL1xuICAgICAgICAgICAgakNoYXIgPSAnWSc7XG4gICAgICAgICAgICBqU2Vuc2UgPSAnKyc7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAtMjogLypqID0gTklGVElfQTJQKi9cbiAgICAgICAgICAgIGpDaGFyID0gJ1knO1xuICAgICAgICAgICAgalNlbnNlID0gJy0nO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgMzogLypqID0gTklGVElfSTJTKi9cbiAgICAgICAgICAgIGpDaGFyID0gJ1onO1xuICAgICAgICAgICAgalNlbnNlID0gJysnO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgLTM6IC8qaiA9IE5JRlRJX1MySSovXG4gICAgICAgICAgICBqQ2hhciA9ICdaJztcbiAgICAgICAgICAgIGpTZW5zZSA9ICctJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgIH1cblxuICAgIHN3aXRjaCAoa2Jlc3QgKiByYmVzdCkge1xuICAgICAgICBjYXNlIDE6IC8qayA9IE5JRlRJX0wyUiovXG4gICAgICAgICAgICBrQ2hhciA9ICdYJztcbiAgICAgICAgICAgIGtTZW5zZSA9ICcrJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIC0xOiAvKmsgPSBOSUZUSV9SMkwqL1xuICAgICAgICAgICAga0NoYXIgPSAnWCc7XG4gICAgICAgICAgICBrU2Vuc2UgPSAnLSc7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAyOiAvKmsgPSBOSUZUSV9QMkEqL1xuICAgICAgICAgICAga0NoYXIgPSAnWSc7XG4gICAgICAgICAgICBrU2Vuc2UgPSAnKyc7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAtMjogLyprID0gTklGVElfQTJQKi9cbiAgICAgICAgICAgIGtDaGFyID0gJ1knO1xuICAgICAgICAgICAga1NlbnNlID0gJy0nO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgMzogLyprID0gTklGVElfSTJTKi9cbiAgICAgICAgICAgIGtDaGFyID0gJ1onO1xuICAgICAgICAgICAga1NlbnNlID0gJysnO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgLTM6IC8qayA9IE5JRlRJX1MySSovXG4gICAgICAgICAgICBrQ2hhciA9ICdaJztcbiAgICAgICAgICAgIGtTZW5zZSA9ICctJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgIH1cblxuICAgIHJldHVybiAoaUNoYXIgKyBqQ2hhciArIGtDaGFyICsgaVNlbnNlICsgalNlbnNlICsga1NlbnNlKTtcbn07XG5cblxuXG5uaWZ0aS5OSUZUSTEucHJvdG90eXBlLm5pZnRpX21hdDMzX211bCA9IGZ1bmN0aW9uIChBLCBCKSB7XG4gICAgdmFyIEMgPSBbWzAsIDAsIDBdLCBbMCwgMCwgMF0sIFswLCAwLCAwXV0sXG4gICAgICAgIGksXG4gICAgICAgIGo7XG5cbiAgICBmb3IgKGkgPSAwOyBpIDwgMzsgaSArPSAxKSB7XG4gICAgICAgIGZvciAoaiA9IDA7IGogPCAzOyBqICs9IDEpIHtcbiAgICAgICAgICAgIENbaV1bal0gPSAgQVtpXVswXSAqIEJbMF1bal0gICsgQVtpXVsxXSAqIEJbMV1bal0gKyBBW2ldWzJdICogQlsyXVtqXTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBDO1xufTtcblxuXG5cbm5pZnRpLk5JRlRJMS5wcm90b3R5cGUubmlmdGlfbWF0MzNfZGV0ZXJtID0gZnVuY3Rpb24gKFIpIHtcbiAgICB2YXIgcjExLCByMTIsIHIxMywgcjIxLCByMjIsIHIyMywgcjMxLCByMzIsIHIzMztcbiAgICAvKiAgSU5QVVQgTUFUUklYOiAgKi9cbiAgICByMTEgPSBSWzBdWzBdO1xuICAgIHIxMiA9IFJbMF1bMV07XG4gICAgcjEzID0gUlswXVsyXTtcbiAgICByMjEgPSBSWzFdWzBdO1xuICAgIHIyMiA9IFJbMV1bMV07XG4gICAgcjIzID0gUlsxXVsyXTtcbiAgICByMzEgPSBSWzJdWzBdO1xuICAgIHIzMiA9IFJbMl1bMV07XG4gICAgcjMzID0gUlsyXVsyXTtcblxuICAgIHJldHVybiAocjExICogcjIyICogcjMzIC0gcjExICogcjMyICogcjIzIC0gcjIxICogcjEyICogcjMzICsgcjIxICogcjMyICogcjEzICsgcjMxICogcjEyICogcjIzIC0gcjMxICogcjIyICogcjEzKTtcbn07XG5cblxuLyoqXG4gKiBSZXR1cm5zIHRoZSBieXRlIGluZGV4IG9mIHRoZSBleHRlbnNpb24uXG4gKiBAcmV0dXJucyB7bnVtYmVyfVxuICovXG5uaWZ0aS5OSUZUSTEucHJvdG90eXBlLmdldEV4dGVuc2lvbkxvY2F0aW9uID0gZnVuY3Rpb24oKSB7XG4gICAgcmV0dXJuIG5pZnRpLk5JRlRJMS5NQUdJQ19DT09LSUUgKyA0O1xufTtcblxuXG4vKipcbiAqIFJldHVybnMgdGhlIGV4dGVuc2lvbiBzaXplLlxuICogQHBhcmFtIHtEYXRhVmlld30gZGF0YVxuICogQHJldHVybnMge251bWJlcn1cbiAqL1xubmlmdGkuTklGVEkxLnByb3RvdHlwZS5nZXRFeHRlbnNpb25TaXplID0gZnVuY3Rpb24oZGF0YSkge1xuICAgIHJldHVybiBuaWZ0aS5VdGlscy5nZXRJbnRBdChkYXRhLCB0aGlzLmdldEV4dGVuc2lvbkxvY2F0aW9uKCksIHRoaXMubGl0dGxlRW5kaWFuKTtcbn07XG5cblxuXG4vKipcbiAqIFJldHVybnMgdGhlIGV4dGVuc2lvbiBjb2RlLlxuICogQHBhcmFtIHtEYXRhVmlld30gZGF0YVxuICogQHJldHVybnMge251bWJlcn1cbiAqL1xubmlmdGkuTklGVEkxLnByb3RvdHlwZS5nZXRFeHRlbnNpb25Db2RlID0gZnV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3XSArIFwiXFxuXCIpO1xuXG4gICAgc3RyaW5nICs9IChcIkludGVudCBQYXJhbWV0ZXJzICgxLTMpOiBcIiArXG4gICAgICAgIHRoaXMuaW50ZW50X3AxICsgXCIsIFwiICtcbiAgICAgICAgdGhpcy5pbnRlbnRfcDIgKyBcIiwgXCIgK1xuICAgICAgICB0aGlzLmludGVudF9wMykgKyBcIlxcblwiO1xuXG4gICAgc3RyaW5nICs9IChcIlZveGVsIERpbWVuc2lvbnMgKDEtOCk6IFwiICtcbiAgICAgICAgZm10KHRoaXMucGl4RGltc1swXSkgKyBcIiwgXCIgK1xuICAgICAgICBmbXQodGhpcy5waXhEaW1zWzFdKSArIFwiLCBcIiArXG4gICAgICAgIGZtdCh0aGlzLnBpeERpbXNbMl0pICsgXCIsIFwiICtcbiAgICAgICAgZm10KHRoaXMucGl4RGltc1szXSkgKyBcIiwgXCIgK1xuICAgICAgICBmbXQodGhpcy5waXhEaW1zWzRdKSArIFwiLCBcIiArXG4gICAgICAgIGZtdCh0aGlzLnBpeERpbXNbNV0pICsgXCIsIFwiICtcbiAgICAgICAgZm10KHRoaXMucGl4RGltc1s2XSkgKyBcIiwgXCIgK1xuICAgICAgICBmbXQodGhpcy5waXhEaW1zWzddKSArIFwiXFxuXCIpO1xuXG4gICAgc3RyaW5nICs9IChcIkltYWdlIE9mZnNldCA9IFwiICsgdGhpcy52b3hfb2Zmc2V0ICsgXCJcXG5cIik7XG4gICAgc3RyaW5nICs9IChcIkRhdGEgU2NhbGU6ICBTbG9wZSA9IFwiICsgZm10KHRoaXMuc2NsX3Nsb3BlKSArIFwiICBJbnRlcmNlcHQgPSBcIiArIGZtdCh0aGlzLnNjbF9pbnRlcikgKyBcIlxcblwiKTtcbiAgICBzdHJpbmcgKz0gKFwiRGlzcGxheSBSYW5nZTogIE1heCA9IFwiICsgZm10KHRoaXMuY2FsX21heCkgKyBcIiAgTWluID0gXCIgKyBmbXQodGhpcy5jYWxfbWluKSArIFwiXFxuXCIpO1xuIC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gICAgIGJyZWFrO1xuICAgICAgICBjYXNlIFwic2Nhbm5lci14eXpcIjpcbiAgICAgICAgICAgIHNwYWNlRGltZW5zaW9uID0gMztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIFwic2Nhbm5lci14eXotdGltZVwiOlxuICAgICAgICAgICAgc3BhY2VEaW1lbnNpb24gPSA0O1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgXCIzRC1yaWdodC1oYW5kZWRcIjpcbiAgICAgICAgICAgIHNwYWNlRGltZW5zaW9uID0gMztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIFwiM0QtbGVmdC1oYW5kZWRcIjpcbiAgICAgICAgICAgIHNwYWNlRGltZW5zaW9uID0gMztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIFwiM0QtcmlnaHQtaGFuZGVkLXRpbWVcIjpcbiAgICAgICAgICAgIHNwYWNlRGltZW5zaW9uID0gNDtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIFwiM0QtbGVmdC1oYW5kZWQtdGltZVwiOlxuICAgICAgICAgICAgc3BhY2VEaW1lbnNpb24gPSA0O1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICBjb25zb2xlLndhcm4oXCJVbnJlY29nbml6ZWQgc3BhY2U6IFwiICsgbnJyZC5zcGFjZSk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgXG4gICAgLy8gTm93IGNoZWNrIHRoYXQgd2UgaGF2ZSBhIHZhbGlkIG5ycmQgc3RydWN0dXJlLlxuICAgIGNoZWNrTlJSRChucnJkKTtcblxuICAgIC8vIERldGVybWluZSBudW1iZXIgb2YgZWxlbWVudHMgYW5kIGNoZWNrIHRoYXQgd2UgaGF2ZSBlbm91Z2ggZGF0YSAoaWYgcG9zc2libGUpXG4gICAgZm9yKGk9MDsgaTxucnJkLnNpemVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgIGlmIChucnJkLnNpemVzW2ldPD0wKSB0aHJvdyBuZXcgRXJyb3IoXCJTaXplcyBzaG91bGQgYmUgYSBsaXN0IG9mIHBvc2l0aXZlICg+MCkgaW50ZWdlcnMhXCIpO1xuICAgICAgICB0b3RhbExlbiAqPSBucnJkLnNpemVzW2ldO1xuICAgIH1cbiAgICBpZiAobnJyZC5kYXRhKSB7XG4gICAgICAgIGlmIChucnJkLmRhdGEubGVuZ3RoIDwgdG90YWxMZW4pIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIk1pc3NpbmcgZGF0YSB0byBzZXJpYWxpemUhXCIpO1xuICAgICAgICB9XG4gICAgfSBlbHNlIGlmIChucnJkLmJ1ZmZlcikge1xuICAgICAgICBpZiAobnJyZC5lbmNvZGluZyA9PSBcInJhd1wiKSB7XG4gICAgICAgICAgICBpZiAobnJyZC50eXBlPT1cImJsb2NrXCIgJiYgbnJyZC5ibG9ja1NpemUhPT11bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICBuYXRpdmVTaXplID0gbnJyZC5ibG9ja1NpemU7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIG5hdGl2ZVNpemUgPSBnZXROUlJEVHlwZVNpemUobnJyZC50eXBlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChucnJkLmJ1ZmZlci5ieXRlTGVuZ3RoIDwgdG90YWxMZW4qbmF0aXZlU2l6ZSkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIk1pc3NpbmcgZGF0YSB0byBzZXJpYWxpemUhXCIpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfSBlbHNlIGlmIChucnJkLmRhdGFGaWxlKSB7XG4gICAgICAgIC8vIE9rYXksIGlmIHlvdSBoYXZlIHlvdXIgZGF0YSByZWFkeSwgd2UnbGwganVzdCB3cml0ZSBhIGhlYWRlci5cbiAgICB9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XG4gICAgfVxuXG4gICAgLy8gUGFyc2UgbGluZXNcbiAgICBmb3IoaT0xOyBpPGxpbmVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgIG1hdGNoID0gbGluZVJFLmV4ZWMobGluZXNbaV0pO1xuICAgICAgICBpZiAoIW1hdGNoKSB7XG4gICAgICAgICAgICBjb25zb2xlLndhcm4oXCJVbnJlY29nbml6ZWQgbGluZSBpbiBOUlJEIGhlYWRlcjogXCIgKyBsaW5lc1tpXSk7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAobWF0Y2hbMl0gPT0gJzogJykgeyAvLyBGaWVsZCBzcGVjaWZpY2F0aW9uXG4gICAgICAgICAgICBtYXRjaFsxXSA9IG1hcE5SUkRUb0phdmFzY3JpcHQobWF0Y2hbMV0pO1xuICAgICAgICAgICAgaWYgKCBtYXRjaFsxXSA9PSAnZGF0YUZpbGUnICYmXG4gICAgICAgICAgICAgICAgIChtYXRjaDIgPSBkYXRhRmlsZUxpc3RSRS5leGVjKG1hdGNoWzNdKSkpIHtcbiAgICAgICAgICAgICAgICAvLyBUaGlzIHNob3VsZCBiZSB0aGUgbGFzdCBmaWVsZCBzcGVjaWZpY2F0aW9uLFxuICAgICAgICAgICAgICAgIC8vIGFuZCB0aGUgcmVzdCBvZiB0aGUgbGluZXMgc2hvdWxkIGNvbnRhaW4gZmlsZSBuYW1lcy5cbiAgICAgICAgICAgICAgICBpZiAobWF0Y2gyLmxlbmd0aCA9PSAyICYmIG1hdGNoMlsxXSkgeyAvLyBzdWJkaW0gc3BlY2lmaWNhdGlvblxuICAgICAgICAgICAgICAgICAgICByZXRbbWF0Y2hbMV1dID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgZmlsZXM6IGxpbmVzLnNsaWNlKGkrMSksXG4gICAgICAgICAgICAgICAgICAgICAgICBzdWJkaW06IHBhcnNlTlJSREludGVnZXIobWF0Y2gyWzFdKVxuICAgICAgICAgICAgICAgICAgIC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1hdCBzcGVjaWZpY2F0aW9uXG4gICAgICAgIGlmIChtYXRjaC5sZW5ndGggPT0gNSAmJiBtYXRjaFs0XSkgeyAvLyBzdWJkaW0gc3BlY2lmaWNhdGlvblxuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICBmb3JtYXQ6IGRhdGFGaWxlLnN1YnN0cmluZygwLCBtYXRjaC5pbmRleCksXG4gICAgICAgICAgICAgICAgbWluOiBwYXJzZU5SUkRJbnRlZ2VyKG1hdGNoWzFdKSxcbiAgICAgICAgICAgICAgICBtYXg6IHBhcnNlTlJSREludGVnZXIobWF0Y2hbMl0pLFxuICAgICAgICAgICAgICAgIHN0ZXA6IHBhcnNlTlJSREludGVnZXIobWF0Y2hbM10pLFxuICAgICAgICAgICAgICAgIHN1YmRpbTogcGFyc2VOUlJESW50ZWdlcihtYXRjaFs0XSlcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIGZvcm1hdDogZGF0YUZpbGUuc3Vic3RyaW5nKDAsIG1hdGNoLmluZGV4KSxcbiAgICAgICAgICAgICAgICBtaW46IHBhcnNlTlJSREludGVnZXIobWF0Y2hbMV0pLFxuICAgICAgICAgICAgICAgIG1heDogcGFyc2VOUlJESW50ZWdlcihtYXRjaFsyXSksXG4gICAgICAgICAgICAgICAgc3RlcDogcGFyc2VOUlJESW50ZWdlcihtYXRjaFszXSlcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICB9IGVsc2UgeyAvLyBKdXN0IGEgZmlsZVxuICAgICAgICByZXR1cm4gZGF0YUZpbGU7XG4gICAgfVxufVxuXG5mdW5jdGlvbiBzZXJpYWxpemVOUlJERGF0YUZpbGUoZGF0YUZpbGUpIHtcbiAgICBpZiAoKHR5cGVvZiBkYXRhRmlsZSkgPT0gXCJzdHJpbmdcIiB8fCBkYXRhRmlsZSBpbnN0YW5jZW9mIFN0cmluZykge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ZSBpZiAodHlwZSA9PSAnaW50OCcgfHwgdHlwZSA9PSAndWludDgnIHx8IG9wdGlvbnMuZW5kaWFuID09IHN5c3RlbUVuZGlhbm5lc3MpIHtcbiAgICAgICAgc3dpdGNoKHR5cGUpIHtcbiAgICAgICAgY2FzZSBcImludDhcIjpcbiAgICAgICAgICAgIGNoZWNrU2l6ZSgxKTtcbiAgICAgICAgICAgIHJldHVybiBuZXcgSW50OEFycmF5KGJ1ZmZlci5zbGljZSgwLHRvdGFsTGVuKSk7XG4gICAgICAgIGNhc2UgXCJ1aW50OFwiOlxuICAgICAgICAgICAgY2hlY2tTaXplKDEpO1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBVaW50OEFycmF5KGJ1ZmZlci5zbGljZSgwLHRvdGFsTGVuKSk7XG4gICAgICAgIGNhc2UgXCJpbnQxNlwiOlxuICAgICAgICAgICAgY2hlY2tTaXplKDIpO1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBJbnQxNkFycmF5KGJ1ZmZlci5zbGljZSgwLHRvdGFsTGVuKjIpKTtcbiAgICAgICAgY2FzZSBcInVpbnQxNlwiOlxuICAgICAgICAgICAgY2hlY2tTaXplKDIpO1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBVaW50MTZBcnJheShidWZmZXIuc2xpY2UoMCx0b3RhbExlbioyKSk7XG4gICAgICAgIGNhc2UgXCJpbnQzMlwiOlxuICAgICAgICAgICAgY2hlY2tTaXplKDQpO1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBJbnQzMkFycmF5KGJ1ZmZlci5zbGljZSgwLHRvdGFsTGVuKjQpKTtcbiAgICAgICAgY2FzZSBcInVpbnQzMlwiOlxuICAgICAgICAgICAgY2hlY2tTaXplKDQpO1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBVaW50MzJBcnJheShidWZmZXIuc2xpY2UoMCx0b3RhbExlbio0KSk7XG4gICAgICAgIC8vY2FzZSBcImludDY0XCI6XG4gICAgICAgIC8vICAgIGNoZWNr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lZCBlbmRpYW5uZXNzIGluIE5SUkQgZmlsZTogXCIgKyBvcHRpb25zLmVuZGlhbik7XG4gICAgICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgICAgICB9XG4gICAgICAgIHZpZXcgPSBuZXcgRGF0YVZpZXcoYnVmZmVyKTtcbiAgICAgICAgc3dpdGNoKHR5cGUpIHtcbiAgICAgICAgY2FzZSBcImludDhcIjogLy8gTm90ZSB0aGF0IGhlcmUgd2UgZG8gbm90IG5lZWQgdG8gY2hlY2sgdGhlIHNpemUgb2YgdGhlIGJ1ZmZlciwgYXMgdGhlIERhdGFWaWV3LmdldCBtZXRob2RzIHNob3VsZCB0aHJvdyBhbiBleGNlcHRpb24gaWYgd2UgcmVhZCBiZXlvbmQgdGhlIGJ1ZmZlci5cbiAgICAgICAgICAgIGFyciA9IG5ldyBJbnQ4QXJyYXkodG90YWxMZW4pO1xuICAgICAgICAgICAgZm9yKGk9MDsgaTx0b3RhbExlbjsgaSsrKSB7XG4gICAgICAgICAgICAgICAgYXJyW2ldID0gdmlldy5nZXRJbnQ4KGkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGFycjtcbiAgICAgICAgY2FzZSBcInVpbnQ4XCI6XG4gICAgICAgICAgICBhcnIgPSBuZXcgVWludDhBcnJheSh0b3RhbExlbik7XG4gICAgICAgICAgICBmb3IoaT0wOyBpPHRvdGFsTGVuOyBpKyspIHtcbiAgICAgICAgICAgICAgICBhcnJbaV0gPSB2aWV3LmdldFVpbnQ4KGkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGFycjtcbiAgICAgICAgY2FzZSBcImludDE2XCI6XG4gICAgICAgICAgICBhcnIgPSBuZXcgSW50MTZBcnJheSh0b3RhbExlbik7XG4gICAgICAgICAgICBmb3IoaT0wOyBpPHRvdGFsTGVuOyBpKyspIHtcbiAgICAgICAgICAgICAgICBhcnJbaV0gPSB2aWV3LmdldEludDE2KGkqMik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gYXJyO1xuICAgICAgICBjYXNlIFwidWludDE2XCI6XG4gICAgICAgICAgICBhcnIgPSBuZXcgVWludDE2QXJyYXkodG90YWxMZW4pO1xuICAgICAgICAgICAgZm9yKGk9MDsgaTx0b3RhbExlbjsgaSsrKSB7XG4gICAgICAgICAgICAgICAgYXJyW2ldID0gdmlldy5nZXRVaW50MTYoaSoyKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBhcnI7XG4gICAgICAgIGNhc2UgXCJpbnQzMlwiOlxuICAgICAgICAgICAgYXJyID0gbmV3IEludDMyQXJyYXkodG90YWxMZW4pO1xuICAgICAgICAgICAgZm9yKGk9MDsgaTx0b3RhbExlbjsgaSsrKSB7XG4gICAgICAgICAgICAgICAgYXJyW2ldID0gdmlldy5nZXRJbnQzMihpKjQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGFycjtcbiAgICAgICAgY2FzZSBcInVpbnQzMlwiOlxuICAgICAgICAgICAgYXJyID0gbmV3IFVpbnQzMkFycmF5KHRvdGFsTGVuKTtcbiAgICAgICAgICAgIGZvcihpPTA7IGk8dG90YWxMZW47IGkrKykge1xuICAgICAgICAgICAgICAgIGFycltpXSA9IHZpZXcuZ2V0VWludDMyKGkqNCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gYXJyO1xuICAgICAgICAvL2Nhc2UgXCJpbnQ2NFwiOlxuICAgICAgICAvLyAgICBhcnIgPSBuZXcgSW50NjRBcnJheSh0b3RhbExlbik7XG4gICAgICAgIC8vICAgIGZvcihpPTA7IGk8dG90YWxMZW47IGkrKykge1xuICAgICAgICAvLyAgICAgICAgYXJyW2ldID0gdmlldy5nZXRJbnQ2NChpKjgpO1xuICAgICAgICAvLyAgICB9XG4gICAgICAgIC8vICAgIHJldHVybiBhcnI7XG4gICAgICAgIC8vY2FzZSBcInVpbnQ2NFwiOlxuICAgICAgICAvLyAgICBhcnIgPSBuZXcgVWludDY0QXJyYXkodG90YWxMZW4pO1xuICAgICAgICAvLyAgICBmb3IoaT0wOyBpPHRvdGFsTGVuOyBpKyspIHtcbiAgICAgICAgLy8gICAgICAgIGFycltpXSA9IHZpZXcuZ2V0VWludDY0KGkqOCk7XG4gICAgICAgIC8vICAgIH1cbiAgICAgICAgLy8gICAgcmV0dXJuIGFycjtcbiAgICAgICAgY2FzZSBcImZsb2F0XCI6XG4gICAgICAgICAgICBhcnIgPSBuZXcgRmxvYXQzMkFycmF5KHRvdGFsTGVuKTtcbiAgICAgICAgICAgIGZvcihpPTA7IGk8dG90YWxMZW47IGkrKykge1xuICAgICAgICAgICAgICAgIGFycltpXSA9IHZpZXcuZ2V0RmxvYXQzMihpKjQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGFycjtcbiAgICAgICAgY2FzZSBcImRvdWJsZVwiOlxuICAgICAgICAgICAgYXJyID0gbmV3IEZsb2F0NjRBcnJheSh0b3RhbExlbik7XG4gICAgICAgICAgICBmb3IoaT0wOyBpPHRvdGFsTGVuOyBpKyspIHtcbiAgICAgICAgICAgICAgICBhcnJbaV0gPSB2aWV3LmdldEZsb2F0NjQoaSo4KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBhcnI7XG4gICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICBjb25zb2xlLndhcm4oXCJVbnN1cHBvcnRlZCBOUlJEIHR5cGU6IFwiICsgdHlwZSArIFwiLCByZXR1cm5pbmcgcmF3IGJ1ZmZlci5cIik7XG4gICAgICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgICAgICB9XG4gICAgfVxuICAgIGZ1bmN0aW9uIGNoZWNrU2l6ZShzaXplT2ZUeXBlKSB7XG4gICAgICAgIGlmIChidWZmZXIuYnl0ZUxlbmd0aDx0b3RhbExlbipzaXplT2ZUeXBlKSB0aHJvdyBuZXcgRXJyb3IoXCJOUlJE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mxhdGUnKTtcbnZhciBjb25zdGFudHMgPSByZXF1aXJlKCcuL2xpYi96bGliL2NvbnN0YW50cycpO1xuXG52YXIgcGFrbyA9IHt9O1xuXG5hc3NpZ24ocGFrbywgZGVmbGF0ZSwgaW5mbGF0ZSwgY29uc3RhbnRzKTtcblxubW9kdWxlLmV4cG9ydHMgPSBwYWtvO1xuIiwiJ3VzZSBzdHJpY3QnO1xuXG5cbnZhciB6bGliX2RlZmxhdGUgPSByZXF1aXJlKCcuL3psaWIvZGVmbGF0ZScpO1xudmFyIHV0aWxzICAgICAgICA9IHJlcXVpcmUoJy4vdXRpbHMvY29tbW9uJyk7XG52YXIgc3RyaW5ncyAgICAgID0gcmVxdWlyZSgnLi91dGlscy9zdHJpbmdzJyk7XG52YXIgbXNnICAgICAgICAgID0gcmVxdWlyZSgnLi96bGliL21lc3NhZ2VzJyk7XG52YXIgWlN0cmVhbSAgICAgID0gcmVxdWlyZSgnLi96bGliL3pzdHJlYW0nKTtcblxudmFyIHRvU3RyaW5nID0gT2JqZWN0LnByb3RvdHlwZS50b1N0cmluZztcblxuLyogUHVibGljIGNvbnN0YW50cyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG5cbnZhciBaX05PX0ZMVVNIICAgICAgPSAwO1xudmFyIFpfRklOSVNIICAgICAgICA9IDQ7XG5cbnZhciBaX09LICAgICAgICAgICAgPSAwO1xudmFyIFpfU1RSRUFNX0VORCAgICA9IDE7XG52YXIgWl9TWU5DX0ZMVVNIICAgID0gMjtcblxudmFyIFpfREVGQVVMVF9DT01QUkVTU0lPTiA9IC0xO1xuXG52YXIgWl9ERUZBVUxUX1NUUkFURUdZICAgID0gMDtcblxudmFyIFpfREVGTEFURUQgID0gODtcblxuLyogPT09PT09PT09PT09PT09P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pfU1RSRUFNX0VORDogICAgICAgMSxcbiAgWl9ORUVEX0RJQ1Q6ICAgICAgICAyLFxuICBaX0VSUk5POiAgICAgICAgICAgLTEsXG4gIFpfU1RSRUFNX0VSUk9SOiAgICAtMixcbiAgWl9EQVRBX0VSUk9SOiAgICAgIC0zLFxuICAvL1pfTUVNX0VSUk9SOiAgICAgLTQsXG4gIFpfQlVGX0VSUk9SOiAgICAgICAtNSxcbiAgLy9aX1ZFUlNJT05fRVJST1I6IC02LFxuXG4gIC8qIGNvbXByZXNzaW9uIGxldmVscyAqL1xuICBaX05PX0NPTVBSRVNTSU9OOiAgICAgICAgIDAsXG4gIFpfQkVTVF9TUEVFRDogICAgICAgICAgICAgMSxcbiAgWl9CRVNUX0NPTVBSRVNTSU9OOiAgICAgICA5LFxuICBaX0RFRkFVTFRfQ09NUFJFU1NJT046ICAgLTEsXG5cblxuICBaX0ZJTFRFUkVEOiAgICAgICAgICAgICAgIDEsXG4gIFpfSFVGRk1BTl9PTkxZOiAgICAgICAgICAgMixcbiAgWl9STEU6ICAgICAgICAgICAgICAgICAgICAzLFxuICBaX0ZJWEVEOiAgICAgICAgICAgICAgICAgIDQsXG4gIFpfREVGQVVMVF9TVFJBVEVHWTogICAgICAgMCxcblxuICAvKiBQb3NzaWJsZSB2YWx1ZXMgb2YgdGhlIGRhdGFfdHlwZSBmaWVsZCAodGhvdWdoIHNlZSBpbmZsYXRlKCkpICovXG4gIFpfQklOQVJZOiAgICAgICAgICAgICAgICAgMCxcbiAgWl9URVhUOiAgICAgICAgICAgICAgICAgICAxLFxuICAvL1pfQVNDSUk6ICAgICAgICAgICAgICAgIDEsIC8vID0gWl9URVhUIChkZXByZWNhdGVkKVxuICBaX1VOS05PV046ICAgICAgICAgICAgICAgIDIsXG5cbiAgLyogVGhlIGRlZmxhdGUgY29tcHJlc3Npb24gbWV0aG9kICovXG4gIFpfREVGTEFURUQ6ICAgICAgICAgICAgICAgOFxuICAvL1pfTlVMTDogICAgICAgICAgICAg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weEZGXTtcbiAgfVxuXG4gIHJldHVybiAoY3JjIF4gKC0xKSk7IC8vID4+PiAwO1xufVxuXG5cbm1vZHVsZS5leHBvcnRzID0gY3JjMzI7XG4iLCIndXNlIHN0cmljdCc7XG5cbnZhciB1dGlscyAgID0gcmVxdWlyZSgnLi4vdXRpbHMvY29tbW9uJyk7XG52YXIgdHJlZXMgICA9IHJlcXVpcmUoJy4vdHJlZXMnKTtcbnZhciBhZGxlcjMyID0gcmVxdWlyZSgnLi9hZGxlcjMyJyk7XG52YXIgY3JjMzIgICA9IHJlcXVpcmUoJy4vY3JjMzInKTtcbnZhciBtc2cgICAgID0gcmVxdWlyZSgnLi9tZXNzYWdlcycpO1xuXG4vKiBQdWJsaWMgY29uc3RhbnRzID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cblxuXG4vKiBBbGxvd2VkIGZsdXNoIHZhbHVlczsgc2VlIGRlZmxhdGUoKSBhbmQgaW5mbGF0ZSgpIGJlbG93IGZvciBkZXRhaWxzICovXG52YXIgWl9OT19GTFVTSCAgICAgID0gMDtcbnZhciBaX1BBUlRJQUxfRkxVU0ggPSAxO1xuLy92YXIgWl9TWU5DX0ZMVVNIICAgID0gMjtcbnZhciBaX0ZVTExfRkxVU0ggICAgPSAzO1xudmFyIFpfRklOSVNIICAgICAgICA9IDQ7XG52YXIgWl9CTE9DSyAgICAgICAgID0gNTtcbi8vdmFyIFpfVFJFRVMgICAgICAgICA9IDY7XG5cblxuLyogUmV0dXJuIGNvZGVzIGZvciB0aGUgY29tcHJlc3Npb24vZGVjb21wcmVzc2lvbiBmdW5jdGlvbnMuIE5lZ2F0aXZlIHZhbHVlc1xuICogYXJlIGVycm9ycywgcG9zaXRpdmUgdmFsdWVzIGFyZSB1c2VkIGZvciBz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fQkxPQ0socywgMCk7ICoqKi9cbiAgICBmbHVzaF9ibG9ja19vbmx5KHMsIGZhbHNlKTtcbiAgICBpZiAocy5zdHJtLmF2YWlsX291dCA9PT0gMCkge1xuICAgICAgcmV0dXJuIEJTX05FRURfTU9SRTtcbiAgICB9XG4gICAgLyoqKi9cbiAgfVxuICByZXR1cm4gQlNfQkxPQ0tfRE9ORTtcbn1cblxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBGb3IgWl9IVUZGTUFOX09OTFksIGRvIG5vdCBsb29rIGZvciBtYXRjaGVzLiAgRG8gbm90IG1haW50YWluIGEgaGFzaCB0YWJsZS5cbiAqIChJdCB3aWxsIGJlIHJlZ2VuZXJhdGVkIGlmIHRoaXMgcnVuIG9mIGRlZmxhdGUgc3dpdGNoZXMgYXdheSBmcm9tIEh1ZmZtYW4uKVxuICovXG5mdW5jdGlvbiBkZWZsYXRlX2h1ZmYocywgZmx1c2gpIHtcbiAgdmFyIGJmbHVzaDsgICAgICAgICAgICAgLyogc2V0IGlmIGN1cnJlbnQgYmxvY2sgbXVzdCBiZSBmbHVzaGVkICovXG5cbiAgZm9yICg7Oykge1xuICAgIC8qIE1ha2Ugc3VyZSB0aGF0IHdlIGhhdmUgYSBsaXRlcmFsIHRvIHdyaXRlLiAqL1xuICAgIGlmIChzLmxvb2thaGVhZCA9PT0gMCkge1xuICAgICAgZmlsbF93aW5kb3cocyk7XG4gICAgICBpZiAocy5sb29rYWhlYWQgPT09IDApIHtcbiAgICAgICAgaWYgKGZsdXNoID09PSBaX05PX0ZMVVNIKSB7XG4gICAgICAgICAgcmV0dXJuIEJTX05FRURfTU9SRTtcbiAgICAgICAgfVxuICAgICAgICBicmVhazsgICAgICAvKiBmbHVzaCB0aGUgY3VycmVudCBibG9jayAqL1xuICAgICAgfVxuICAgIH1cblxuICAgIC8qIE91dHB1dCBhIGxpdGVyYWwg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ieXRlKHMsIDMxKTtcbiAgICAgIHB1dF9ieXRlKHMsIDEzOSk7XG4gICAgICBwdXRfYnl0ZShzLCA4KTtcbiAgICAgIGlmICghcy5nemhlYWQpIHsgLy8gcy0+Z3poZWFkID09IFpfTlVMTFxuICAgICAgICBwdXRfYnl0ZShzLCAwKTtcbiAgICAgICAgcHV0X2J5dGUocywgMCk7XG4gICAgICAgIHB1dF9ieXRlKHMsIDApO1xuICAgICAgICBwdXRfYnl0ZShzLCAwKTtcbiAgICAgICAgcHV0X2J5dGUocywgMCk7XG4gICAgICAgIHB1dF9ieXRlKHMsIHMubGV2ZWwgPT09IDkgPyAyIDpcbiAgICAgICAgICAgICAgICAgICAgKHMuc3RyYXRlZ3kgPj0gWl9IVUZGTUFOX09OTFkgfHwgcy5sZXZlbCA8IDIgP1xuICAgICAgICAgICAgICAgICAgICAgNCA6IDApKTtcbiAgICAgICAgcHV0X2J5dGUocywgT1NfQ09ERSk7XG4gICAgICAgIHMuc3RhdHVzID0gQlVTWV9TVEFURTtcbiAgICAgIH1cbiAgICAgIGVsc2Uge1xuICAgICAgICBwdXRfYnl0ZShzLCAocy5nemhlYWQudGV4dCA/IDEgOiAwKSArXG4gICAgICAgICAgICAgICAgICAgIChzLmd6aGVhZC5oY3JjID8gMiA6IDApICtcbiAgICAgICAgICAgICAgICAgICAgKCFzLmd6aGVhZC5leHRyYSA/IDAgOiA0KSArXG4gICAgICAgICAgICAgICAgICAgICghcy5nemhlYWQubmFtZSA/IDAgOiA4KSArXG4gICAgICAgICAgICAgICAgICAgICghcy5nemhlYWQuY29tbWVudCA/IDAgOiAxNilcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICBwdXRfYnl0ZShzLCBzLmd6aGVhZC50aW1lICYgMHhmZik7XG4gICAgICAgIHB1dF9ieXRlKHMsIChzLmd6aGVhZC50aW1lID4+IDgpICYgMHhmZik7XG4gICAgICAgIHB1dF9ieXRlKHMsIChzLmd6aGVhZC50aW1lID4+IDE2KSAmIDB4ZmYpO1xuICAgICAgICBwdXRfYnl0ZShzLCAocy5nemhlYWQudGltZSA+PiAyNCkgJiAweGZmKTtcbiAgICAgICAgcHV0X2J5dGUocywgcy5sZXZlbCA9PT0gOSA/IDIgOlxuICAgICAgICAgICAgICAgICAgICAocy5zdHJhdGVneSA+PSBaX0hVRkZNQU5fT05MWSB8fCBzLmxldmVsIDwgMiA/XG4gICAgICAgICAgICAgICAgICAgICA0IDogMCkpO1xuICAgICAgICBwdXRfYnl0ZShzLCBzLmd6aGVhZC5vcyAmIDB4ZmYpO1xuICAgICAgICBpZiAocy5nemhlYWQuZXh0cmEgJiYgcy5nemhlYWQuZXh0cmEubGVuZ3RoKSB7XG4gICAgICAgICAgcHV0X2J5dGUocywgcy5nemhlYWQuZXh0cmEubGVuZ3RoICYgMHhmZik7XG4gICAgICAgICAgcHV0X2J5dGUocywgKHMuZ3poZWFkLmV4dHJhLmxlbmd0aCA+PiA4KSAmIDB4ZmYpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChzLmd6aGVhZC5oY3JjKSB7XG4gICAgICAgICAgc3RybS5hZGxlciA9IGNyYzMyKHN0cm0uYWRsZXIsIHMucGVuZGluZ19idWYsIHMucGVuZGluZywgMCk7XG4gICAgICAgIH1cbiAgICAgICAgcy5nemluZGV4ID0gMDtcbiAgICAgICAgcy5zdGF0dXMgPSBFWFRSQV9TVEFURTtcbiAgICAgIH1cbiAgICB9XG4gICAgZWxzZSAvLyBERUZMQVRFIGhlYWRlclxuICAgIHtcbiAgICAgIHZhciBoZWFkZXIgPSAoWl9ERUZMQVRFRCArICgocy53X2JpdHMgLSA4KSA8PCA0KSkgPDwgODtcbiAgICAgIHZhciBsZXZlbF9mbGFncyA9IC0xO1xuXG4gICAgICBpZiAocy5zdHJhdGVneSA+PSBaX0hVRkZNQU5fT05MWSB8fCBzLmxldmVsIDwgMikge1xuICAgICAgICBsZXZlbF9mbGFncyA9IDA7XG4gICAgICB9IGVsc2UgaWYgKHMubGV2ZWwgPCA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mVnKTtcbiAgICAgIH1cbiAgICAgIGlmICh2YWwgPT09IDApIHtcbiAgICAgICAgcy5nemluZGV4ID0gMDtcbiAgICAgICAgcy5zdGF0dXMgPSBDT01NRU5UX1NUQVRFO1xuICAgICAgfVxuICAgIH1cbiAgICBlbHNlIHtcbiAgICAgIHMuc3RhdHVzID0gQ09NTUVOVF9TVEFURTtcbiAgICB9XG4gIH1cbiAgaWYgKHMuc3RhdHVzID09PSBDT01NRU5UX1NUQVRFKSB7XG4gICAgaWYgKHMuZ3poZWFkLmNvbW1lbnQvKiAhPSBaX05VTEwqLykge1xuICAgICAgYmVnID0gcy5wZW5kaW5nOyAgLyogc3RhcnQgb2YgYnl0ZXMgdG8gdXBkYXRlIGNyYyAqL1xuICAgICAgLy9pbnQgdmFsO1xuXG4gICAgICBkbyB7XG4gICAgICAgIGlmIChzLnBlbmRpbmcgPT09IHMucGVuZGluZ19idWZfc2l6ZSkge1xuICAgICAgICAgIGlmIChzLmd6aGVhZC5oY3JjICYmIHMucGVuZGluZyA+IGJlZykge1xuICAgICAgICAgICAgc3RybS5hZGxlciA9IGNyYzMyKHN0cm0uYWRsZXIsIHMucGVuZGluZ19idWYsIHMucGVuZGluZyAtIGJlZywgYmVnKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgZmx1c2hfcGVuZGluZyhzdHJtKTtcbiAgICAgICAgICBiZWcgPSBzLnBlbmRpbmc7XG4gICAgICAgICAgaWYgKHMucGVuZGluZyA9PT0gcy5wZW5kaW5nX2J1Zl9zaXplKSB7XG4gICAgICAgICAgICB2YWwgPSAxO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIEpTIHNwZWNpZmljOiBsaXR0bGUgbWFnaWMgdG8gYWRkIHplcm8gdGVybWluYXRvciB0byBlbmQgb2Ygc3RyaW5nXG4gICAgICAgIGlmIChzLmd6aW5kZXggPCBzLmd6aGVhZC5jb21tZW50Lmxlbmd0aCkge1xuIC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wgYnV0IG5vcm1hbCBldmVudHMuXG4gKi9cbnZhciBaX09LICAgICAgICAgICAgPSAwO1xudmFyIFpfU1RSRUFNX0VORCAgICA9IDE7XG52YXIgWl9ORUVEX0RJQ1QgICAgID0gMjtcbi8vdmFyIFpfRVJSTk8gICAgICAgICA9IC0xO1xudmFyIFpfU1RSRUFNX0VSUk9SICA9IC0yO1xudmFyIFpfREFUQV9FUlJPUiAgICA9IC0zO1xudmFyIFpfTUVNX0VSUk9SICAgICA9IC00O1xudmFyIFpfQlVGX0VSUk9SICAgICA9IC01O1xuLy92YXIgWl9WRVJTSU9OX0VSUk9SID0gLTY7XG5cbi8qIFRoZSBkZWZsYXRlIGNvbXByZXNzaW9uIG1ldGhvZCAqL1xudmFyIFpfREVGTEFURUQgID0gODtcblxuXG4vKiBTVEFURVMgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cblxuXG52YXIgICAgSEVBRCA9IDE7ICAgICAgIC8qIGk6IHdhaXRpbmcgZm9yIG1hZ2ljIGhlYWRlciAqL1xudmFyICAgIEZMQUdTID0gMjsgICAgICAvKiBpOiB3YWl0aW5nIGZvciBtZXRob2QgYW5kIGZsYWdzIChnemlwKSAqL1xudmFyICAgIFRJTUUgPSAzOyAgICAgICAvKiBpOiB3YWl0aW5nIGZvciBtb2RpZmljYXRpb24gdGltZSAoZ3ppcCkgKi9cbnZhciAgICBPUyA9IDQ7ICAgICAgICAgLyogaTogd2FpdGluZyBmb3IgZXh0cmEgZmxhZ3MgYW5kIG9wZXJhdGluZyBzeXN0ZW0gKGd6aXApICovXG52YXIgICAgRVhMRU4gPSA1OyAgICAgIC8qIGk6IHdhaXRpbmcgZm9yIGV4dHJhIGxlbmd0aCAoZ3ppcCkgKi9cbnZhciA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O1xuICAgICAgICAvLz09PS8vXG4gICAgICAgIHN0YXRlLm1vZGUgPSBGTEFHUztcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICBzdGF0ZS5mbGFncyA9IDA7ICAgICAgICAgICAvKiBleHBlY3QgemxpYiBoZWFkZXIgKi9cbiAgICAgIGlmIChzdGF0ZS5oZWFkKSB7XG4gICAgICAgIHN0YXRlLmhlYWQuZG9uZSA9IGZhbHNlO1xuICAgICAgfVxuICAgICAgaWYgKCEoc3RhdGUud3JhcCAmIDEpIHx8ICAgLyogY2hlY2sgaWYgemxpYiBoZWFkZXIgYWxsb3dlZCAqL1xuICAgICAgICAoKChob2xkICYgMHhmZikvKkJJVFMoOCkqLyA8PCA4KSArIChob2xkID4+IDgpKSAlIDMxKSB7XG4gICAgICAgIHN0cm0ubXNnID0gJ2luY29ycmVjdCBoZWFkZXIgY2hlY2snO1xuICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICBicmVhaztcbiAgICAgIH1cbiAgICAgIGlmICgoaG9sZCAmIDB4MGYpLypCSVRTKDQpKi8gIT09IFpfREVGTEFURUQpIHtcbiAgICAgICAgc3RybS5tc2cgPSAndW5rbm93biBjb21wcmVzc2lvbiBtZXRob2QnO1xuICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICBicmVhaztcbiAgICAgIH1cbiAgICAgIC8vLS0tIERST1BCSVRTKDQpIC0tLS8vXG4gICAgICBob2xkID4+Pj0gNDtcbiAgICAgIGJpdHMgLT0gNDtcbiAgICAgIC8vLS0tLy9cbiAgICAgIGxlbiA9IChob2xkICYgMHgwZikvKkJJVFMoNCkqLyArIDg7XG4gICAgICBpZiAoc3RhdGUud2JpdHMgPT09IDApIHtcbiAgICAgICAgc3RhdGUud2JpdHMgPSBsZW47XG4gICAgICB9XG4gICAgICBlbHNlIGlmIChsZW4gPiBzdGF0ZS53Yml0cykge1xuICAgICAgICBzdHJtLm1zZyA9ICdpbnZhbGlkIHdpbmRvdyBzaXplJztcbiAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICBzdGF0ZS5kbWF4ID0gMSA8PCBsZW47XG4gICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgemxpYiBoZWFkZXIgb2tcXG5cIikpO1xuICAgICAgc3RybS5hZGxlciA9IHN0YXRlLmNoZWNrID0gMS8qYWRsZXIzMigwTCwgWl9OVUxMLCAwKSovO1xuICAgICAgc3RhdGUubW9kZSA9IGhvbGQgJiAweDIwMCA/IERJQ1RJRCA6IFRZUEU7XG4gICAgICAvLz09PSBJTklUQklUUygpO1xuICAgICAgaG9sZCA9IDA7XG4gICAgICBiaXRzID0gMDtcbiAgICAgIC8vPT09Ly9cbiAgICAgIGJyZWFrO1xuICAgIGNhc2UgRkxBR1M6XG4gICAgICAvLz09PSBORUVEQklUUygxNik7ICovXG4gICAgICB3aGlsZSAoYml0cyA8IDE2KSB7XG4gICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICBoYXZlLS07XG4gICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICBiaXRzICs9IDg7XG4gICAgICB9XG4gICAgICAvLz09PS8vXG4gICAgICBzdGF0ZS5mbGFncyA9IGhvbGQ7XG4gICAgICBpZiAoKHN0YXRlLmZsYWdzICYgMHhmZikgIT09IFpfREVGTEFURUQpIHtcbiAgICAgICAgc3RybS5tc2cgPSAndW5rbm93biBjb21wcmVzc2lvbiBtZXRob2QnO1xuICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICBicmVhaztcbiAgICAgIH1cbiAgICAgIGlmIChzdGF0ZS5mbGFncyAmIDB4ZTAwMCkge1xuICAgICAgICBzdHJtLm1zZyA9ICd1bmtub3duIGhlYWRlciBmbGFncyBzZXQnO1xuICAgICAgICBzd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IHNpemUgY2hlY2tcbiAgICAgICAgICAgICAgY29weSxcbiAgICAgICAgICAgICAgLypsZW4gKyBjb3B5ID4gc3RhdGUuaGVhZC5leHRyYV9tYXggLSBsZW4gPyBzdGF0ZS5oZWFkLmV4dHJhX21heCA6IGNvcHksKi9cbiAgICAgICAgICAgICAgbGVuXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgLy96bWVtY3B5KHN0YXRlLmhlYWQuZXh0cmEgKyBsZW4sIG5leHQsXG4gICAgICAgICAgICAvLyAgICAgICAgbGVuICsgY29weSA+IHN0YXRlLmhlYWQuZXh0cmFfbWF4ID9cbiAgICAgICAgICAgIC8vICAgICAgICBzdGF0ZS5oZWFkLmV4dHJhX21heCAtIGxlbiA6IGNvcHkpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoc3RhdGUuZmxhZ3MgJiAweDAyMDApIHtcbiAgICAgICAgICAgIHN0YXRlLmNoZWNrID0gY3JjMzIoc3RhdGUuY2hlY2ssIGlucHV0LCBjb3B5LCBuZXh0KTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaGF2ZSAtPSBjb3B5O1xuICAgICAgICAgIG5leHQgKz0gY29weTtcbiAgICAgICAgICBzdGF0ZS5sZW5ndGggLT0gY29weTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoc3RhdGUubGVuZ3RoKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgfVxuICAgICAgc3RhdGUubGVuZ3RoID0gMDtcbiAgICAgIHN0YXRlLm1vZGUgPSBOQU1FO1xuICAgICAgLyogZmFsbHMgdGhyb3VnaCAqL1xuICAgIGNhc2UgTkFNRTpcbiAgICAgIGlmIChzdGF0ZS5mbGFncyAmIDB4MDgwMCkge1xuICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgY29weSA9IDA7XG4gICAgICAgIGRvIHtcbiAgICAgICAgICAvLyBUT0RPOiAyIG9yIDEgYn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H1cbiAgICAgIC8vPT09IE5FRURCSVRTKDMpOyAqL1xuICAgICAgd2hpbGUgKGJpdHMgPCAzKSB7XG4gICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICBoYXZlLS07XG4gICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICBiaXRzICs9IDg7XG4gICAgICB9XG4gICAgICAvLz09PS8vXG4gICAgICBzdGF0ZS5sYXN0ID0gKGhvbGQgJiAweDAxKS8qQklUUygxKSovO1xuICAgICAgLy8tLS0gRFJPUEJJVFMoMSkgLS0tLy9cbiAgICAgIGhvbGQgPj4+PSAxO1xuICAgICAgYml0cyAtPSAxO1xuICAgICAgLy8tLS0vL1xuXG4gICAgICBzd2l0Y2ggKChob2xkICYgMHgwMykvKkJJVFMoMikqLykge1xuICAgICAgY2FzZSAwOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogc3RvcmVkIGJsb2NrICovXG4gICAgICAgIC8vVHJhY2V2KChzdGRlcnIsIFwiaW5mbGF0ZTogICAgIHN0b3JlZCBibG9jayVzXFxuXCIsXG4gICAgICAgIC8vICAgICAgICBzdGF0ZS5sYXN0ID8gXCIgKGxhc3QpXCIgOiBcIlwiKSk7XG4gICAgICAgIHN0YXRlLm1vZGUgPSBTVE9SRUQ7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAxOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZml4ZWQgYmxvY2sgKi9cbiAgICAgICAgZml4ZWR0YWJsZXMoc3RhdGUpO1xuICAgICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgICBmaXhlZCBjb2RlcyBibG9jayVzXFxuXCIsXG4gICAgICAgIC8vICAgICAgICBzdGF0ZS5sYXN0ID8gXCIgKGxhc3QpXCIgOiBcIlwiKSk7XG4gICAgICAgIHN0YXRlLm1vZGUgPSBMRU5fOyAg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Agc3RhdGUubGVuc1tzdGF0ZS5oYXZlKytdID0gaGVyZV92YWw7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgaWYgKGhlcmVfdmFsID09PSAxNikge1xuICAgICAgICAgICAgLy89PT0gTkVFREJJVFMoaGVyZS5iaXRzICsgMik7XG4gICAgICAgICAgICBuID0gaGVyZV9iaXRzICsgMjtcbiAgICAgICAgICAgIHdoaWxlIChiaXRzIDwgbikge1xuICAgICAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICAgICAgaGF2ZS0tO1xuICAgICAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy89PT0vL1xuICAgICAgICAgICAgLy8tLS0gRFJPUEJJVFMoaGVyZS5iaXRzKSAtLS0vL1xuICAgICAgICAgICAgaG9sZCA+Pj49IGhlcmVfYml0cztcbiAgICAgICAgICAgIGJpdHMgLT0gaGVyZV9iaXRzO1xuICAgICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgICAgaWYgKHN0YXRlLmhhdmUgPT09IDApIHtcbiAgICAgICAgICAgICAgc3RybS5tc2cgPSAnaW52YWxpZCBiaXQgbGVuZ3RoIHJlcGVhdCc7XG4gICAgICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGVuID0gc3RhdGUubGVuc1tzdGF0ZS5oYXZlIC0gMV07XG4gICAgICAgICAgICBjb3B5ID0gMyArIChob2xkICYgMHgwMyk7Ly9CSVRTKDIpO1xuICAgICAgICAgICAgLy8tLS0gRFJPUEJJVFMoMikgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSAyO1xuICAgICAgICAgICAgYml0cyAtPSAyO1xuICAgICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgIH1cbiAgICAgICAgICBlbHNlIGlmIChoZXJlX3ZhbCA9PT0gMTcpIHtcbiAgICAgICAgICAgIC8vPT09IE5FRURCSVRTKGhlcmUuYml0cyArIDMpO1xuICAgICAgICAgICAgbiA9IGhlcmVfYml0cyArIDM7XG4gICAgICAgICAgICB3aGlsZSAoYml0cyA8IG4pIHtcbiAgICAgICAgICAgICAgaWYgKGhhdmUgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vPT09Ly9cbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKGhlcmUuYml0cykgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSBoZXJlX2JpdHM7XG4gICAgICAgICAgICBiaXRzIC09IGhlcmVfYml0cztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICAgIGxlbiA9IDA7XG4gICAgICAgICAgICBjb3B5ID0gMyArIChob2xkICYgMHgwNyk7Ly9CSVRTKDMpO1xuICAgICAgICAgICAgLy8tLS0gRFJPUEJJVFMoMykgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSAzO1xuICAgICAgICAgICAgYml0cyAtPSAzO1xuICAgICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgIH1cbiAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIC8vPT09IE5FRURCSVRTKGhlcmUuYml0cyArIDcpO1xuICAgICAgICAgICAgbiA9IGhlcmVfYml0cyArIDc7XG4gICAgICAgICAgICB3aGlsZSAoYml0cyA8IG4pIHtcbiAgICAgICAgICAgICAgaWYgKGhhdmUgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vPT09Ly9cbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKGhlcmUuYml0cykgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSBoZXJlX2JpdHM7XG4gICAgICAgICAgICBiaXRzIC09IGhlcmVfYml0cztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICAgIGxlbiA9IDA7XG4gICAgICAgICAgICBjb3B5ID0gMTEgKyAoaG9sZCAmIDB4N2YpOy8vQklUUyg3KTtcbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKDcpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gNztcbiAgICAgICAgICAgIGJpdHMgLT0gNztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHN0YXRlLmhhdmUgKyBjb3B5ID4gc3RhdGUubmxlbiArIHN0YXRlLm5kaXN0KSB7XG4gICAgICAgICAgICBzdHJtLm1zZyA9ICdpbnZhbGlkIGJpdCBsZW5ndGggcmVwZWF0JztcbiAgICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgICAgd2hpbGUgKGNvcHktLSkge1xuICAgICAgICAgICAgc3RhdGUubGVuc1tzdGF0ZS5oYXZlKytdID0gbGVuO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICAvKiBoYW5kbGUgZXJyb3IgYnJlYWtzIGluIHdoaWxlICovXG4gICAgICBpZiAoc3RhdGUubW9kZSA9PT0gQkFEKSB7IGJyZWFrOyB9XG5cbiAgICAgIC8qIGNoZWNrIGZvciBlbmQtb2YtYmxvY2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IDB4ZmZmZjtcblxuICAgICAgICAgIGlmICgobGFzdF9iaXRzICsgaGVyZV9iaXRzKSA8PSBiaXRzKSB7IGJyZWFrOyB9XG4gICAgICAgICAgLy8tLS0gUFVMTEJZVEUoKSAtLS0vL1xuICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgLy8tLS0vL1xuICAgICAgICB9XG4gICAgICAgIC8vLS0tIERST1BCSVRTKGxhc3QuYml0cykgLS0tLy9cbiAgICAgICAgaG9sZCA+Pj49IGxhc3RfYml0cztcbiAgICAgICAgYml0cyAtPSBsYXN0X2JpdHM7XG4gICAgICAgIC8vLS0tLy9cbiAgICAgICAgc3RhdGUuYmFjayArPSBsYXN0X2JpdHM7XG4gICAgICB9XG4gICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICBob2xkID4+Pj0gaGVyZV9iaXRzO1xuICAgICAgYml0cyAtPSBoZXJlX2JpdHM7XG4gICAgICAvLy0tLS8vXG4gICAgICBzdGF0ZS5iYWNrICs9IGhlcmVfYml0cztcbiAgICAgIHN0YXRlLmxlbmd0aCA9IGhlcmVfdmFsO1xuICAgICAgaWYgKGhlcmVfb3AgPT09IDApIHtcbiAgICAgICAgLy9UcmFjZXZ2KChzdGRlcnIsIGhlcmUudmFsID49IDB4MjAgJiYgaGVyZS52YWwgPCAweDdmID9cbiAgICAgICAgLy8gICAgICAgIFwiaW5mbGF0ZTogICAgICAgICBsaXRlcmFsICclYydcXG5cIiA6XG4gICAgICAgIC8vICAgICAgICBcImluZmxhdGU6ICAgICAgICAgbGl0ZXJhbCAweCUwMnhcXG5cIiwgaGVyZS52YWwpKTtcbiAgICAgICAgc3RhdGUubW9kZSA9IExJVDtcbiAgICAgIC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Ly8gICAgICAgICAgVHJhY2UoKHN0ZGVyciwgXCJpbmZsYXRlLmMgdG9vIGZhclxcblwiKSk7XG4vLyAgICAgICAgICBjb3B5IC09IHN0YXRlLndoYXZlO1xuLy8gICAgICAgICAgaWYgKGNvcHkgPiBzdGF0ZS5sZW5ndGgpIHsgY29weSA9IHN0YXRlLmxlbmd0aDsgfVxuLy8gICAgICAgICAgaWYgKGNvcHkgPiBsZWZ0KSB7IGNvcHkgPSBsZWZ0OyB9XG4vLyAgICAgICAgICBsZWZ0IC09IGNvcHk7XG4vLyAgICAgICAgICBzdGF0ZS5sZW5ndGggLT0gY29weTtcbi8vICAgICAgICAgIGRvIHtcbi8vICAgICAgICAgICAgb3V0cHV0W3B1dCsrXSA9IDA7XG4vLyAgICAgICAgICB9IHdoaWxlICgtLWNvcHkpO1xuLy8gICAgICAgICAgaWYgKHN0YXRlLmxlbmd0aCA9PT0gMCkgeyBzdGF0ZS5tb2RlID0gTEVOOyB9XG4vLyAgICAgICAgICBicmVhaztcbi8vI2VuZGlmXG4gICAgICAgIH1cbiAgICAgICAgaWYgKGNvcHkgPiBzdGF0ZS53bmV4dCkge1xuICAgICAgICAgIGNvcHkgLT0gc3RhdGUud25leHQ7XG4gICAgICAgICAgZnJvbSA9IHN0YXRlLndzaXplIC0gY29weTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICBmcm9tID0gc3RhdGUud25leHQgLSBjb3B5O1xuICAgICAgICB9XG4gICAgICAgIGlmIChjb3B5ID4gc3RhdGUubGVuZ3RoKSB7IGNvcHkgPSBzdGF0ZS5sZW5ndGg7IH1cbiAgICAgICAgZnJvbV9zb3VyY2UgPSBzdGF0ZS53aW5kb3c7XG4gICAgICB9XG4gICAgICBlbHNlIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBjb3B5IGZyb20gb3V0cHV0ICovXG4gICAgICAgIGZyb21fc291cmNlID0gb3V0cHV0O1xuICAgICAgICBmcm9tID0gcHV0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Lz09PSBORUVEQklUUygzMik7XG4gICAgICAgIHdoaWxlIChiaXRzIDwgMzIpIHtcbiAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICB9XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgaWYgKGhvbGQgIT09IChzdGF0ZS50b3RhbCAmIDB4ZmZmZmZmZmYpKSB7XG4gICAgICAgICAgc3RybS5tc2cgPSAnaW5jb3JyZWN0IGxlbmd0aCBjaGVjayc7XG4gICAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICAvLz09PSBJTklUQklUUygpO1xuICAgICAgICBob2xkID0gMDtcbiAgICAgICAgYml0cyA9IDA7XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgLy9UcmFjZXYoKHN0ZGVyciwgXCJpbmZsYXRlOiAgIGxlbmd0aCBtYXRjaGVzIHRyYWlsZXJcXG5cIikpO1xuICAgICAgfVxuICAgICAgc3RhdGUubW9kZSA9IERPTkU7XG4gICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgY2FzZSBET05FOlxuICAgICAgcmV0ID0gWl9TVFJFQU1fRU5EO1xuICAgICAgYnJlYWsgaW5mX2xlYXZlO1xuICAgIGNhc2UgQkFEOlxuICAgICAgcmV0ID0gWl9EQVRBX0VSUk9SO1xuICAgICAgYnJlYWsgaW5mX2xlYXZlO1xuICAgIGNhc2UgTUVNOlxuICAgICAgcmV0dXJuIFpfTUVNX0VSUk9SO1xuICAgIGNhc2UgU1lOQzpcbiAgICAgIC8qIGZhbGxzIHRocm91Z2ggKi9cbiAgICBkZWZhdWx0OlxuICAgICAgcmV0dXJuIFpfU1RSRUFNX0VSUk9SO1xuICA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V4dCArIGh1ZmZdID0gNjQ7ICAgICAgICAgICAgLyogaW52YWxpZCBjb2RlIG1hcmtlciAqL1xuICAgIC8vdGFibGUuYml0c1tuZXh0ICsgaHVmZl0gPSBsZW4gLSBkcm9wO1xuICAgIC8vdGFibGUudmFsW25leHQgKyBodWZmXSA9IDA7XG4gICAgdGFibGVbbmV4dCArIGh1ZmZdID0gKChsZW4gLSBkcm9wKSA8PCAyNCkgfCAoNjQgPDwgMTYpIHwwO1xuICB9XG5cbiAgLyogc2V0IHJldHVybiBwYXJhbWV0ZXJzICovXG4gIC8vb3B0cy50YWJsZV9pbmRleCArPSB1c2VkO1xuICBvcHRzLmJpdHMgPSByb290O1xuICByZXR1cm4gMDtcbn07XG4iLCIndXNlIHN0cmljdCc7XG5cbm1vZHVsZS5leHBvcnRzID0ge1xuICAyOiAgICAgICduZWVkIGRpY3Rpb25hcnknLCAgICAgLyogWl9ORUVEX0RJQ1QgICAgICAgMiAgKi9cbiAgMTogICAgICAnc3RyZWFtIGVuZCcsICAgICAgICAgIC8qIFpfU1RSRUFNX0VORCAgICAgIDEgICovXG4gIDA6ICAgICAgJycsICAgICAgICAgICAgICAgICAgICAvKiBaX09LICAgICAgICAgICAgICAwICAqL1xuICAnLTEnOiAgICdmaWxlIGVycm9yJywgICAgICAgICAgLyogWl9FUlJOTyAgICAgICAgICgtMSkgKi9cbiAgJy0yJzogICAnc3RyZWFtIGVycm9yJywgICAgICAgIC8qIFpfU1RSRUFNX0VSUk9SICAoLTIpICovXG4gICctMyc6ICAgJ2RhdGEgZXJyb3InLCAgICAgICAgICAvKiBaX0RBVEFfRVJST1IgICAgKC0zKSAqL1xuICAnLTQnOiAgICdpbnN1ZmZpY2llbnQgbWVtb3J5JywgLyogWl9NRU1fRVJST1IgICAgICgtNCkgKi9cbiAgJy01JzogICAnYnVmZmVyIGVycm9yJywgICAgICAgIC8qIFpfQlVGX0VSUk9SICAgICAoLTUpICovXG4gICctNic6ICAgJ2luY29tcGF0aWJsZSB2ZXJzaW9uJyAvKiBaX1ZFUlNJT05fRVJST1IgKC02KSAqL1xufTtcbiIsIid1c2Ugc3RyaWN0JztcblxuXG52YXIgdXRpbHMgPSByZXF1aXJlKCcuLi91dGlscy9jb21tb24nKTtcblxuLyogUHVibGljIGNvbnN0YW50cyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG5cblxuLy92YXIgWl9GSUxURVJFRCAgICAgICAgICA9IDE7XG4vL3ZhciBaX0hVRkZNQU5fT05MWSAgICAgID0gMjtcbi8vdmFyIFpfUkxFICAgICAgICAgICAgICAgPSAzO1xudmFyIFpfRklYRUQgICAgICAgICAgICAgICA9IDQ7XG4vL3ZhciBaX0RFRkFVTFRfU1RSQVRFR1kgID0gMDtcblxuLyogUG9zc2libGUgdmFsdWVzIG9mIHRoZSBkYXRhX3R5cGUgZmllbGQgKHRob3VnaCBzZWUgaW5mbGF0ZSgpKSAqL1xudmFyIFpfQklOQVJZICAgICAgICAgICAgICA9IDA7XG52YXIgWl9URVhUICAgICAgICAgICAgICAgID0gMTtcbi8vdmFyIFpfQVNDSUkgICAgICAgICAgICAgPSAxOyAvLyA9IFpfVEVYVFxudmFyIFpfVU5LTk9XTiAgICAgICAgICAgICA9IDI7XG5cbi8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG5cblxuZnVuY3Rpb24gemVybyhidWYpIHsgdmFyIGxlbiA9IGJ1Zi5sZW5ndGg7IHdoaWxlICgtLWxlbiA+PSAwKSB7IGJ1ZltsZW5dID0gMDsgfSB9XG5cbi8vIEZyb20genV0aWwuaFxuXG52YXIgU1RPUkVEX0JMT0NLID0gMDtcbnZhciBTVEFUSUNfVFJFRVMg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T09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBSZXZlcnNlIHRoZSBmaXJzdCBsZW4gYml0cyBvZiBhIGNvZGUsIHVzaW5nIHN0cmFpZ2h0Zm9yd2FyZCBjb2RlIChhIGZhc3RlclxuICogbWV0aG9kIHdvdWxkIHVzZSBhIHRhYmxlKVxuICogSU4gYXNzZXJ0aW9uOiAxIDw9IGxlbiA8PSAxNVxuICovXG5mdW5jdGlvbiBiaV9yZXZlcnNlKGNvZGUsIGxlbikge1xuICB2YXIgcmVzID0gMDtcbiAgZG8ge1xuICAgIHJlcyB8PSBjb2RlICYgMTtcbiAgICBjb2RlID4+Pj0gMTtcbiAgICByZXMgPDw9IDE7XG4gIH0gd2hpbGUgKC0tbGVuID4gMCk7XG4gIHJldHVybiByZXMgPj4+IDE7XG59XG5cblxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBGbHVzaCB0aGUgYml0IGJ1ZmZlciwga2VlcGluZyBhdCBtb3N0IDcgYml0cyBpbiBpdC5cbiAqL1xuZnVuY3Rpb24gYmlfZmx1c2gocykge1xuICBpZiAocy5iaV92YWxpZCA9PT0gMTYpIHtcbiAgICBwdXRfc2hvcnQocywgcy5iaV9idWYpO1xuICAgIHMuYmlfYnVmID0gMDtcbiAgICBzLmJpX3ZhbGlkID0gMDtcblxuICB9IGVsc2UgaWYgKHMuYmlfdmFsaWQgPj0gOCkge1xuICAgIHMucGVuZGluZ19idWZbcy5wZW5kaW5nKytdID0gcy5iaV9idWYgJiAweGZmO1xuICAgIHMuYmlfYnVmID4+PSA4O1xuICAgIHMuYmlfdmFsaWQgLT0gODtcbiAgfVxufVxuXG5cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogQ29tcHV0ZSB0aGUgb3B0aW1hbCBiaXQgb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UgbGFzdCBibG9jayBmb3IgYSBmaWxlICovXG57XG4gIHNlbmRfYml0cyhzLCAoU1RPUkVEX0JMT0NLIDw8IDEpICsgKGxhc3QgPyAxIDogMCksIDMpOyAgICAvKiBzZW5kIGJsb2NrIHR5cGUgKi9cbiAgY29weV9ibG9jayhzLCBidWYsIHN0b3JlZF9sZW4sIHRydWUpOyAvKiB3aXRoIGhlYWRlciAqL1xufVxuXG5cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogU2VuZCBvbmUgZW1wdHkgc3RhdGljIGJsb2NrIHRvIGdpdmUgZW5vdWdoIGxvb2thaGVhZCBmb3IgaW5mbGF0ZS5cbiAqIFRoaXMgdGFrZXMgMTAgYml0cywgb2Ygd2hpY2ggNyBtYXkgcmVtYWluIGluIHRoZSBiaXQgYnVmZmVyLlxuICovXG5mdW5jdGlvbiBfdHJfYWxpZ24ocykge1xuICBzZW5kX2JpdHMocywgU1RBVElDX1RSRUVTIDw8IDEsIDMpO1xuICBzZW5kX2NvZGUocywgRU5EX0JMT0NLLCBzdGF0aWNfbHRyZWUpO1xuICBiaV9mbHVzaChzKTtcbn1cblxuXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIERldGVybWluZSB0aGUgYmVzdCBlbmNvZGluZyBmb3IgdGhlIGN1cnJlbnQgYmxvY2s6IGR5bmFtaWMgdHJlZXMsIHN0YXRpY1xuICogdHJlZXMgb3Igc3RvcmUsIGFuZCBvdXRwdXQgdGhlIGVuY29kZWQgYmxvY2sgdG8gdGhlIHppcCBmaWxlLlxuICovXG5mdW5jdGlvbiBfdHJfZmx1c2hfYmxvY2socywgYnVmLCBzdG9yZWRfbGVuLCBsYXN0KVxuLy9EZWZsYXRlU3RhdGUgKnM7XG4vL2NoYXJmICpidWY7ICAgIC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gICAgICAgLy8gMSBvciAyIGZpbmdlcnMsIHNtYWUgYmVoYXZpb3JcbiAgICAgICAgICAgIF9zdGF0ZSA9IFNUQVRFLlRPVUNIX1JPVEFURTtcbiAgICAgICAgICAgIF9tb3ZlQ3Vyci5jb3B5KGdldE1vdXNlT25DaXJjbGUoZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VYLCBldmVudC50b3VjaGVzWyAwIF0ucGFnZVkpKTtcbiAgICAgICAgICAgIF9tb3ZlUHJldi5jb3B5KF9tb3ZlQ3Vycik7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICBpZiAoZXZlbnQudG91Y2hlcy5sZW5ndGggPj0gMikge1xuICAgICAgICAgICAgICBfc3RhdGUgPSBTVEFURS5UT1VDSF9aT09NO1xuICAgICAgICAgICAgICB2YXIgZHggPSBldmVudC50b3VjaGVzWyAwIF0ucGFnZVggLSBldmVudC50b3VjaGVzWyAxIF0ucGFnZVg7XG4gICAgICAgICAgICAgIHZhciBkeSA9IGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWSAtIGV2ZW50LnRvdWNoZXNbIDEgXS5wYWdlWTtcbiAgICAgICAgICAgICAgX3RvdWNoWm9vbURpc3RhbmNlRW5kID0gX3RvdWNoWm9vbURpc3RhbmNlU3RhcnQgPSBNYXRoLnNxcnQoZHggKiBkeCArIGR5ICogZHkpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgX3N0YXRlID0gU1RBVEUuWk9PTTtcbiAgICAgICAgICAgICAgX3pvb21TdGFydC5jb3B5KGdldE1vdXNlT25TY3JlZW4oZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VYLCBldmVudC50b3VjaGVzWyAwIF0ucGFnZVkpKTtcbiAgICAgICAgICAgICAgX3pvb21FbmQuY29weShfem9vbVN0YXJ0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgIGlmIChldmVudC50b3VjaGVzLmxlbmd0aCA+PSAyKSB7XG4gICAgICAgICAgICAgIF9zdGF0ZSA9IFNUQVRFLlRPVUNIX1BBTjtcbiAgICAgICAgICAgICAgdmFyIHggPSAoZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VYICsgZXZlbnQudG91Y2hlc1sgMSBdLnBhZ2VYKSAvIDI7XG4gICAgICAgICAgICAgIHZhciB5ID0gKGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWSArIGV2ZW50LnRvdWNoZXNbIDEgXS5wYWdlWSkgLyAyO1xuICAgICAgICAgICAgICBfcGFuU3RhcnQuY29weShnZXRNb3VzZU9uU2NyZWVuKHgsIHkpKTtcbiAgICAgICAgICAgICAgX3BhbkVuZC5jb3B5KF9wYW5TdGFydCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBfc3RhdGUgPSBTVEFURS5QQU47XG4gICAgICAgICAgICAgIF9wYW5TdGFydC5jb3B5KGdldE1vdXNlT25TY3JlZW4oZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VYLCBldmVudC50b3VjaGVzWyAwIF0ucGFnZVkpKTtcbiAgICAgICAgICAgICAgX3BhbkVuZC5jb3B5KF9wYW5TdGFydCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgOTk6XG4gICAgICAgICAgICBfc3RhdGUgPSBTVEFURS5DVVNUT007XG4gICAgICAgICAgICB2YXIgeCA9IChldmVudC50b3VjaGVzWyAwIF0ucGFnZVggKyBldmVudC50b3VjaGVzWyAxIF0ucGFnZVgpIC8gMjtcbiAgICAgICAgICAgIHZhciB5ID0gKGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWSArIGV2ZW50LnRvdWNoZXNbIDEgXS5wYWdlWSkgLyAyO1x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XG5cbiAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICBfcGFuRW5kLmNvcHkoZ2V0TW91c2VPblNjcmVlbihldmVudC50b3VjaGVzWyAwIF0ucGFnZVgsIGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWSkpO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAvLyAyIGZpbmdlcnMhXG4gICAgICAgICAgICAvLyBUT1VDSCBaT09NXG4gICAgICAgICAgICB2YXIgZHggPSBldmVudC50b3VjaGVzWyAwIF0ucGFnZVggLSBldmVudC50b3VjaGVzWyAxIF0ucGFnZVg7XG4gICAgICAgICAgICB2YXIgZHkgPSBldmVudC50b3VjaGVzWyAwIF0ucGFnZVkgLSBldmVudC50b3VjaGVzWyAxIF0ucGFnZVk7XG4gICAgICAgICAgICBfdG91Y2hab29tRGlzdGFuY2VFbmQgPSBNYXRoLnNxcnQoZHggKiBkeCArIGR5ICogZHkpO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIDU6XG4gICAgICAgICAgICAvLyAyIGZpbmdlcnNcbiAgICAgICAgICAgIC8vIFRPVUNIX1BBTlxuICAgICAgICAgICAgdmFyIHggPSAoZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VYICsgZXZlbnQudG91Y2hlc1sgMSBdLnBhZ2VYKSAvIDI7XG4gICAgICAgICAgICB2YXIgeSA9IChldmVudC50b3VjaGVzWyAwIF0ucGFnZVkgKyBldmVudC50b3VjaGVzWyAxIF0ucGFnZVkpIC8gMjtcbiAgICAgICAgICAgIF9wYW5FbmQuY29weShnZXRNb3VzZU9uU2NyZWVuKHgsIHkpKTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSA5OTpcbiAgICAgICAgICAgIHZhciB4ID0gKGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWCArIGV2ZW50LnRvdWNoZXNbIDEgXS5wYW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LyAyO1xuICAgICAgICAgICAgX3BhbkVuZC5jb3B5KGdldE1vdXNlT25TY3JlZW4oeCwgeSkpO1xuICAgICAgICAgICAgX3BhblN0YXJ0LmNvcHkoX3BhbkVuZCk7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICB9XG5cbiAgICAgICAgX3N0YXRlID0gU1RBVEUuTk9ORTtcblxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgc3dpdGNoIChfc3RhdGUpIHtcblxuICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgIF9tb3ZlUHJldi5jb3B5KF9tb3ZlQ3Vycik7XG4gICAgICAgICAgICBfbW92ZUN1cnIuY29weShnZXRNb3VzZU9uQ2lyY2xlKGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWCwgZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VZKSk7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgNDpcbiAgICAgICAgICAgIC8vIFRPVUNIIFpPT01cbiAgICAgICAgICAgIF90b3VjaFpvb21EaXN0YW5jZVN0YXJ0ID0gX3RvdWNoWm9vbURpc3RhbmNlRW5kID0gMDtcbiAgICAgICAgICAgIF9zdGF0ZSA9IFNUQVRFLlpPT007XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgIC8vIFRPVUNIIFpPT01cbiAgICAgICAgICAgIGlmIChldmVudC50b3VjaGVzLmxlbmd0aCA+PSAyKSB7XG4gICAgICAgICAgICAgIHZhciB4ID0gKGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWCArIGV2ZW50LnRvdWNoZXNbIDEgXS5wYWdlWCkgLyAyO1xuICAgICAgICAgICAgICB2YXIgeSA9IChldmVudC50b3VjaGVzWyAwIF0ucGFnZVkgKyBldmVudC50b3VjaGVzWyAxI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29uc3QgcmVmWSA9IDEwMC4wMDtcbiAgICBjb25zdCByZWZaID0gMTA4Ljg4MztcblxuICAgIGxldCB5ID0gKCBsICsgMTYgKSAvIDExNjtcbiAgICBsZXQgeCA9IGEgLyA1MDAgKyB5O1xuICAgIGxldCB6ID0geSAtIGIgLyAyMDA7XG5cbiAgICBpZiAoIE1hdGgucG93KHksMykgPiAwLjAwODg1NiApe1xuXG4gICAgICB5ID0gTWF0aC5wb3coeSwgMyk7XG5cbiAgICB9IGVsc2Uge1xuXG4gICAgICB5ID0gKCB5IC0gMTYgLyAxMTYgKSAvIDcuNzg3O1xuXG4gICAgfVxuXG4gICAgaWYgKCBNYXRoLnBvdyh4LDMpID4gMC4wMDg4NTYgKXtcblxuICAgICAgeCA9IE1hdGgucG93KHgsIDMpO1xuXG4gICAgfSBlbHNlIHtcblxuICAgICAgeCA9ICggeCAtIDE2IC8gMTE2ICkgLyA3Ljc4NztcblxuICAgIH0gICAgICAgIFxuXG4gICAgaWYgKCBNYXRoLnBvdyh6LDMpID4gMC4wMDg4NTYgKXtcblxuICAgICAgeiA9IE1hdGgucG93KHosIDMpO1xuXG4gICAgfSBlbHNlIHtcblxuICAgICAgeiA9ICggeiAtIDE2IC8gMTE2ICkgLyA3Ljc4NztcblxuICAgIH0gICAgICBcblxuICAgIHJldHVybiBbcmVmWCAqIHgsIHJlZlkgKiB5LCByZWZaICogel07ICBcblxuICB9XG5cbiAgc3RhdGljIHh5ejJSR0IoIHgsIHksIHogKXtcblxuICAgIHggLz0gMTAwO1xuICAgIHkgLz0gMTAwO1xuICAgIHogLz0gMTAwO1xuICAgIGxldCByID0geCAqICAzLjI0MDYgKyB5ICogLTEuNTM3MiArIHogKiAtMC40OTg2O1xuICAgIGxldCBnID0geCAqIC0wLjk2ODkgKyB5ICogIDEuODc1OCArIHogKiAgMC4wNDE1O1xuICAgIGxldCBiID0geCAqICAwLjA1NTcgKyB5ICogLTAuMjA0MCArIHogKiAgMS4wNTcwO1xuXG4gICAgaWYgKCByID4gMC4wMDMxMzA4ICl7XG5cbiAgICAgIHIgPSAxLjA1NSAqICggTWF0aC5wb3coIHIgLCAxIC8gMi40ICkgKSAtIDAuMDU1O1xuXG4gICAgfSBlbHNlIHtcblxuICAgICAgciA9IDEyLjkyICogcjtcblxuICAgIH1cblxuICAgIGlmICggZyA+IDAuMDAzMTMwOCApe1xuXG4gICAgICBnID0gMS4wNTUgKiAoIE1hdGgucG93KCBnLCAxIC8gMi40ICkgKSAtIDAuMDU1O1xuXG4gICAgfSBlbHNlIHtcblxuICAgICAgZyA9IDEyLjkyICogZztcblxuICAgIH1cblxuICAgIGlmICggYiA+IDAuMDAzMTMwOCApe1xuXG4gICAgICBiID0gMS4wNTUgKiAoIE1hdGgucG93KCBiICwgMSAvIDIuNCApICkgLSAwLjA1NTtcblxuICAgIH0gZWxzZSB7XG5cbiAgICAgIGIgPSAxMi45MiAqIGI7XG5cbiAgICB9ICAgICAgICAgICAgICAgICAgICAgXG5cbiAgICByID0gciAqIDI1NTtcbiAgICBnID0gZyAqIDI1NTtcbiAgICBiID0gYiAqIDI1NTtcblxuICAgIHJldHVybiBbIHIsIGcsIGIgXTtcblxuICB9XG5cbiAgc3RhdGljIGNpZWxhYjJSR0IoIGwgPSA1MCwgYSA9IDAsIGIgPSAwKXtcblxuICAgIGlmKCAhKCBsID49IDAgJiYgbCA8PSAxMDAgKSApe1xuXG4gICAgICByZXR1cm4gbnVsbDtcblxuICAgIH1cblxuICAgIGxldCB4eXogPSB0aGlzLmNpZWxhYjJYWVooIGwsIGEsIGIgKTtcbiAgICByZXR1cm4gdGhpcy54eXoyUkdCKC4uLnh5eik7XG5cbiAgfVxuXG59IiwiaW1wb3J0IFV0aWxzICAgICAgZnJvbSAnLi9jb3JlLnV0aWxzJztcbmltcG9ydCBWYWxpZGF0b3JzIGZyb20gJy4vY29yZS52YWxpZGF0b3JzJztcblxuLyoqIFxuICogQ29tcHV0ZS90ZXN0IGludGVyc2VjdGlvbiBiZXR3ZWV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hFIFNFQ09ORCBDT1JORVJcbiAgICAvL1xuICAgIC8vICAgICAgICAgICAgICAgK1xuICAgIC8vICAgICAgICAgICAgICAgfFxuICAgIC8vICAgICAgICAgICAgICAgfFxuICAgIC8vICAgICAgICAgICAgICAgfFxuICAgIC8vICAgICAgICAgICAgICAgK1xuICAgIC8vICAgICAgICAgICAgIC4nXG4gICAgLy8gICAgICAgICAgICsnXG5cbiAgICBsZXQgcmF5MyA9IHRoaXMucG9zZGlyKFxuICAgICAgbmV3IFRIUkVFLlZlY3RvcjMoYWFiYi5jZW50ZXIueCArIGFhYmIuaGFsZkRpbWVuc2lvbnMueCwgYWFiYi5jZW50ZXIueSAtIGFhYmIuaGFsZkRpbWVuc2lvbnMueSwgYWFiYi5jZW50ZXIueiAtIGFhYmIuaGFsZkRpbWVuc2lvbnMueiksXG4gICAgICBvcmllbnRhdGlvbi55XG4gICAgKTtcbiAgICB0aGlzLnJheVBsYW5lSW5CQm94KHJheTMsIHBsYW5lQUFCQiwgYmJveCwgaW50ZXJzZWN0aW9ucyk7XG5cbiAgICByYXkzLmRpcmVjdGlvbiA9IG9yaWVudGF0aW9uLno7XG4gICAgdGhpcy5yYXlQbGFuZUluQkJveChyYXkzLCBwbGFuZUFBQkIsIGJib3gsIGludGVyc2VjdGlvbnMpO1xuXG4gICAgLy8gUkFZUyBTVEFSVElORyBGUk9NIFRIRSBUSElSRCBDT1JORVJcbiAgICAvL1xuICAgIC8vICAgICAgListLS0tLS0tKyAgXG4gICAgLy8gICAgLidcbiAgICAvLyAgICtcbiAgICAvLyAgIFxuICAgIC8vICAgXG4gICAgLy8gICBcbiAgICAvLyAgIFxuXG4gICAgbGV0IHJheTQgPSB0aGlzLnBvc2RpcihcbiAgICAgIG5ldyBUSFJFRS5WZWN0b3IzKGFhYmIuY2VudGVyLnggLSBhYWJiLmhhbGZEaW1lbnNpb25zLngsIGFhYmIuY2VudGVyLnkgKyBhYWJiLmhhbGZEaW1lbnNpb25zLnksIGFhYmIuY2V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HJheSwgYm94KSB7XG4gICAgLy8gc2hvdWxkIGFsc28gZG8gdGhlIHNwYWNlIHRyYW5zZm9ybXMgaGVyZVxuICAgIC8vIHJheToge3Bvc2l0aW9uLCBkaXJlY3Rpb259XG4gICAgLy8gYm94OiB7aGFsZkRpbWVuc2lvbnMsIGNlbnRlcn1cblxuICAgIGxldCBpbnRlcnNlY3Rpb25zID0gW107XG4gICAgXG4gICAgbGV0IGJib3ggPSBVdGlscy5iYm94KGJveC5jZW50ZXIsIGJveC5oYWxmRGltZW5zaW9ucyk7XG5cbiAgICAvLyB3aW5kb3cuY29uc29sZS5sb2coYmJveCk7XG5cbiAgICAvLyBYIG1pblxuICAgIGxldCBwbGFuZSA9IHRoaXMucG9zZGlyKFxuICAgICAgbmV3IFRIUkVFLlZlY3RvcjMoXG4gICAgICAgIGJib3gubWluLngsXG4gICAgICAgIGJveC5jZW50ZXIueSxcbiAgICAgICAgYm94LmNlbnRlci56KSxcbiAgICAgIG5ldyBUSFJFRS5WZWN0b3IzKC0xLCAwLCAwKVxuICAgICk7XG4gICAgdGhpcy5yYXlQbGFuZUluQkJveChyYXksIHBsYW5lLCBiYm94LCBpbnRlcnNlY3Rpb25zKTtcblxuICAgIC8vIFggbWF4XG4gICAgcGxhbmUgPSB0aGlzLnBvc2RpcihcbiAgICAgIG5ldyBUSFJFRS5WZWN0b3IzKFxuICAgICAgICBiYm94Lm1heC54LFxuICAgICAgICBib3guY2VudGVyLnksXG4gICAgICAgIGJveC5jZW50ZXIueiksXG4gICAgICBuZXcgVEhSRUUuVmVjdG9yMygxLCAwLCAwKVxuICAgICk7XG4gICAgdGhpcy5yYXlQbGFuZUluQkJveChyYXksIHBsYW5lLCBiYm94LCBpbnRlcnNlY3Rpb25zKTtcblxuICAgIC8vIFkgbWluXG4gICAgcGxhbmUgPSB0aGlzLnBvc2RpcihcbiAgICAgIG5ldyBUSFJFRS5WZWN0b3IzKFxuICAgICAgICBib3guY2VudGVyLngsXG4gICAgICAgIGJib3gubWluLnksXG4gICAgICAgIGJveC5jZW50ZXIueiksXG4gICAgICBuZXcgVEhSRUUuVmVjdG9yMygwLCAtMSwgMClcbiAgICApO1xuICAgIHRoaXMucmF5UGxhbmVJbkJCb3gocmF5LCBwbGFuZSwgYmJveCwgaW50ZXJzZWN0aW9ucyk7XG5cbiAgICAvLyBZIG1heFxuICAgIHBsYW5lID0gdGhpcy5wb3NkaXIoXG4gICAgICBuZXcgVEhSRUUuVmVjdG9yMyhcbiAgICAgICAgYm94LmNlbnRlci54LFxuICAgICAgICBiYm94Lm1heC55LFxuICAgICAgICBib3guY2VudGVyLnopLFxuICAgICAgbmV3IFRIUkVFLlZlY3RvcjMoMCwgMSwgMClcbiAgICApO1xuICAgIHRoaXMucmF5UGxhbmVJbkJCb3gocmF5LCBwbGFuZSwgYmJveCwgaW50ZXJzZWN0aW9ucyk7XG5cbiAgICAvLyBaIG1pblxuICAgIHBsYW5lID0gdGhpcy5wb3NkaXIoXG4gICAgICBuZXcgVEhSRUUuVmVjdG9yMyhcbiAgICAgICAgYm94LmNlbnRlci54LFxuICAgICAgICBib3guY2VudGVyLnksXG4gICAgICAgIGJib3gubWluLnopLFxuICAgICAgbmV3IFRIUkVFLlZlY3RvcjMoMCwgMCwgLTEpXG4gICAgKTtcbiAgICB0aGlzLnJheVBsYW5lSW5CQm94KHJheSwgcGxhbmUsIGJib3gsIGludGVyc2VjdGlvbnMpO1xuXG4gICAgLy8gWiBtYXhcbiAgICBwbGFuZSA9IHRoaXMucG9zZGlyKFxuICAgICAgbmV3IFRIUkVFLlZlY3RvcjMoXG4gICAgICAgIGJveC5jZW50ZXIueCxcbiAgICAgICAgYm94LmNlbnRlci55LFxuICAgICAgICBiYm94Lm1heC56KSxcbiAgICAgIG5ldyBUSFJFRS5WZWN0b3IzKDAsIDAsIDEpXG4gICAgKTtcbiAgICB0aGlzLnJheVBsYW5lSW5CQm94KHJheSwgcGxhbmUsIGJib3gsIGludGVyc2VjdGlvbnMpO1xuXG4gICAg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AgICAvLyAgICAgICAgICAgICAgICAgICAgICAgNzAsMTAgXFxcbiAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgMTMwLDcwXCIgLz5cXFxuICAgIC8vICAgXFxcbiAgICAvLyAgIDwvc3ZnPic7XG4gICAgLypqc2hpbnQgbXVsdGlzdHI6IHRydWUgKi9cbiAgICB0aGlzLl9zdmdQb2ludGVyID0gJzxzdmcgd2lkdGg9XCI0MFwiIGhlaWdodD1cIjQwXCIgXFxcbiAgICAgICAgICAgICAgICAgICAgICB2aWV3Qm94PVwiMCAwIDE0MCAxNDBcIiB2ZXJzaW9uPVwiMS4xXCIgXFxcbiAgICAgICAgICAgICAgICAgICAgICB4bWxucz1cImh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnXCI+IFxcXG4gICAgICAgICAgICAgICAgICAgICAgXFxcbiAgICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPVwiTTcwLDcwIFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTDMwLDMwIFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQTEwLDEwIDAgMSAxIDEwLDEwXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBMTAsMTAgMCAxIDEgMzAsMzBcIiAvPlxcXG4gICAgICAgICAgICAgICAgICAgICAgXFxcbiAgICAgICAgICAgICAgICAgICAgICA8L3N2Zz4nICAgICAgICAgICAgICAgICAgICAgICAgO1xuICAgICAgICAgICAgICAgICAgICAgIFxuXG4gICAgdGhpcy5jcmVhdGVNZXNoKCk7XG4gIH1cblxuICB1cGRhdGVWb3hlbCh3b3JsZENvb3JkaW5hdGVzKSB7XG4gICAgLy8gdXBkYXRlIHdvcmxkIGNvb3JkaW5hdGVzXG4gICAgdGhpcy5fdm94ZWwud29ybGRDb29yZGluYXRlcyA9IHdvcmxkQ29vcmRpbmF0ZXM7XG5cbiAgICAvLyB1cGRhdGUgZGF0YSBjb29yZGluYXRlc1xuICAgIHRoaXMuX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vbnNlO1xuICAgICAgICAgICAgICAgICAgZGF0YS5nemNvbXByZXNzZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgIGRhdGEuZmlsZW5hbWUgPSAnJztcbiAgICAgICAgICAgICAgICAgIGRhdGEuZXh0ZW5zaW9uID0gJyc7XG5cbiAgICAgICAgICAgICAgICAgIC8vIHVuY29tcHJlc3M/XG4gICAgICAgICAgICAgICAgICBkYXRhLmZpbGVuYW1lID0gcmVzcG9uc2UudXJsLnNwbGl0KCcvJykucG9wKCk7XG4gICAgICAgICAgICAgICAgICBkYXRhLmd6Y29tcHJlc3NlZCA9IGZhbHNlO1xuXG4gICAgICAgICAgICAgICAgICAvLyBmaW5kIGV4dGVuc2lvblxuICAgICAgICAgICAgICAgICAgbGV0IHNwbGl0dGVkTmFtZSA9IGRhdGEuZmlsZW5hbWUuc3BsaXQoJy4nKTtcbiAgICAgICAgICAgICAgICAgIGlmKHNwbGl0dGVkTmFtZS5sZW5ndGggPD0gMSl7XG4gICAgICAgICAgICAgICAgICAgIGRhdGEuZXh0ZW5zaW9uID0gJyc7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBlbHNle1xuICAgICAgICAgICAgICAgICAgICBkYXRhLmV4dGVuc2lvbiA9IGRhdGEuZmlsZW5hbWUuc3BsaXQoJy4nKS5wb3AoKTtcbiAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgLy8gdW56aXAgaWYgZXh0ZW5zaW9uIGlzICcuZ3onXG4gICAgICAgICAgICAgICAgICBpZiAoZGF0YS5leHRlbnNpb24gPT09ICdneicpIHtcbiAgICAgICAgICAgICAgICAgICAgZGF0YS5nemNvbXByZXNzZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICBkYXRhLmV4dGVuc2lvbiA9IGRhdGEuZmlsZW5hbWUuc3BsaXQoJy5neicpLnNoaWZ0KCkuc3BsaXQoJy4nKS5wb3AoKTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGRlY29tcHJlc3NlZERhdGEgPSBwYWtvLmluZmxhdGUoZGF0YS5idWZmZXIpO1xuICAgICAgICAgICAgICAgICAgICBkYXRhLmJ1ZmZlciA9IGRlY29tcHJlc3NlZERhdGEuYnVmZmVyO1xuICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICBsZXQgcGFyc2VyID0gdGhpcy5fcGFyc2VyKGRhdGEuZXh0ZW5zaW9uKTtcbiAgICAgICAgICAgICAgICAgIGlmICghcGFyc2VyKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlamVjdChkYXRhLmZpbGVuYW1lICsgJyBjYW4gbm90IGJlIHBhcnNlZC4nKTtcbiAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgLy8gY2hlY2sgZXh0ZW5zaW9uXG4gICAgICAgICAgICAgICAgICBsZXQgdm9sdW1lUGFyc2VyID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIHZvbHVtZVBhcnNlciA9IG5ldyBwYXJzZXIoZGF0YSwgMCk7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICB3aW5kb3cuY29uc29sZS5sb2coZSk7XG4gICAgICAgICAgICAgICAgICAgIHJlamVjdChlKTtcbiAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgLy8gY3JlYXRlIGEgc2VyaWVzXG4gICAgICAgICAgICAgICAgICBsZXQgc2VyaWVzID0gbmV3IE1vZGVsc1NlcmllcygpO1xuICAgICAgICAgICAgICAgICAgc2VyaWVzLnNlcmllc0luc3RhbmNlVUlEID0gdm9sdW1lUGFyc2VyLnNlcmllc0luc3RhbmNlVUlEKCk7XG4gICAgICAgICAgICAgICAgICBzZXJpZXMubnVtYmVyT2ZGcmFtZXMgICAgPSB2b2x1bWVQYXJzZXIubnVtYmVyT2ZGcmFtZXMoKTtcbiAgICAgICAgICAgICAgICAgIGlmICghc2VyaWVzLm51bWJlck9mRnJhbWVzKSB7XG4gICAgICAgICAgICAgICAgICAgIHNlcmllcy5udW1iZXJPZkZyYW1lcyA9IDE7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBzZXJpZXMubnVtYmVyT2ZDaGFubmVscyAgPSB2b2x1bWVQYXJzZXIubnVtYmVyT2ZDaGFubmVscygpO1xuICAgICAgICAgICAgICAgICAgc2VyaWVzLm1vZGFsaXR5ICAgICAgICAgID0gdm9sdW1lUGFyc2VyLm1vZGFsaXR5KCk7XG4gICAgICAgICAgICAgICAgICAvLyBpZiBpdCBpcyBhIHNlZ21lbnRhdGlvbiwgYXR0YWNoIGV4dHJhIGluZm9ybWF0aW9uXG4gICAgICAgICAgICAgICAgICBpZihzZXJpZXMubW9kYWxpdHkgPT09ICdTRUcnKXtcbiAgICAgICAgICAgICAgICAgICAgLy8gY29sb3JzXG4gICAgICAgICAgICAgICAgICAgIC8vIGxhYmVsc1xuICAgICAgICAgICAgICAgICAgICAvLyBldGMuXG4gICAgICAgICAgICAgICAgICAgIHNlcmllcy5zZWdtZW50YXRpb25UeXBlICAgICA9IHZvbHVtZVBhcnNlci5zZWdtZW50YXRpb25UeXBlKCk7XG4gICAgICAgICAgICAgICAgICAgIHNlcmllcy5zZWdtZW50YXRpb25TZWdtZW50cyA9IHZvbHVtZVBhcnNlci5zZWdtZW50YXRpb25TZWdtZW50cygpO1xuICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAvLyBqdXN0IGNyZWF0ZSAxIGR1bW15IHN0YWNrIGZvciBub3dcbiAgICAgICAgICAgICAgICAgIGxldCBzdGFjayA9IG5ldyBNb2RlbHNTdGFjaygpO1xuICAgICAgICAgICAgICAgICAgc3RhY2subnVtYmVyT2ZDaGFubmVscyA9IHZvbHVtZVBhcnNlci5udW1iZXJPZkNoYW5uZWxzKCk7XG4gICAgICAgICAgICAgICAgICBzdGFjay5waXhlbFR5cGUgICAgICAgID0gdm9sdW1lUGFyc2VyLnBpeGVsVHlwZSgpO1xuICAgICAgICAgICAgICAgICAgc3RhY2suaW52ZXJ0ICAgICAgICAgICA9IHZvbHVtZVBhcnNlci5pbnZlcnQoKTtcbiAgICAgICAgICAgICAgICAgIHN0YWNrLm1vZGFsaXR5ICAgICAgICAgPSBzZXJpZXMubW9kYWxpdHk7XG4gICAgICAgICAgICAgICAgICAvLyBpZiBpdCBpcyBhIHNlZ21lbnRhdGlvbiwgYXR0YWNoIGV4dHJhIGluZm9ybWF0aW9uXG4gICAgICAgICAgICAgICAgICBpZihzdGFjay5tb2RhbGl0eSA9PT0gJ1NFRycpe1xuICAgICAgICAgICAgICAgICAgICAvLyBjb2xvcnNcbiAgICAgICAgICAgICAgICAgICAgLy8gbGFiZWxzXG4gICAgICAgICAgICAgICAgICAgIC8vIGV0Yy5cbiAgICAgICAgICAgICAgICAgICAgc3RhY2suc2VnbWVudGF0aW9uVHlwZSAgICAgPSBzZXJpZXMuc2VnbWVudGF0aW9uVHlwZTtcbiAgICAgICAgICAgICAgICAgICAgc3RhY2suc2VnbWVudGF0aW9uU2VnbWVudHMgPSBzZXJpZXMuc2VnbWVudGF0aW9uU2VnbWVudHM7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBzZXJpZXMuc3RhY2sucHVzaChzdGFjayk7XG4gICAgICAgICAgICAgICAgICAvLyByZWN1cnNpdmUgY2FsbCBmb3IgZWFjaCBmcmFtZVxuICAgICAgICAgICAgICAgICAgLy8gYmV0dGVyIHRoYW4gZm9yIGxvb3AgdG8gYmUgYWJsZSB0byB1cGRhdGUgZG9tIHdpdGggXCJwcm9ncmVzc1wiIGNhbGxiYWNrXG4gICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KHRoaXMucGFyc2VGcmFtZShzZXJpZXMsIHN0YWNrLCByZXNwb25zZS51cmwsIDAsIHZvbHVtZVBhcn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aXMuX2RpbWVuc2lvbnNJSksuejsgayArPSB0aGlzLl9kaW1lbnNpb25zSUpLLnogKSB7XG5cbiAgICAgICAgICBsZXQgd29ybGQgPSBuZXcgVEhSRUUuVmVjdG9yMyggaSwgaiwgayApLmFwcGx5TWF0cml4NCggdGhpcy5faWprMkxQUyApO1xuICAgICAgICAgIGJib3ggPSBbXG4gICAgICAgICAgICBNYXRoLm1pbihiYm94WzBdLCB3b3JsZC54KSwgTWF0aC5tYXgoYmJveFsxXSwgd29ybGQueCksIC8vIHggbWluL21heFxuICAgICAgICAgICAgTWF0aC5taW4oYmJveFsyXSwgd29ybGQueSksIE1hdGgubWF4KGJib3hbM10sIHdvcmxkLnkpLFxuICAgICAgICAgICAgTWF0aC5taW4oYmJveFs0XSwgd29ybGQueiksIE1hdGgubWF4KGJib3hbNV0sIHdvcmxkLnopXG4gICAgICAgICAgICBdO1xuXG4gICAgICAgIH1cblxuICAgICAgfVxuXG4gICAgfVxuXG4gICAgcmV0dXJuIGJib3g7XG5cbiAgfVxuXG4gIEFBQkJveCgpIHtcblxuICAgIGxldCB3b3JsZDAgPSBuZXcgVEhSRUUuVmVjdG9yMygpLmFkZFNjYWxhciggLTAuNSApXG4gICAgICAuYXBwbHlNYXRyaXg0KCB0aGlzLl9pamsyTFBTIClcbiAgICAgIC5hcHBseU1hdHJpeDQoIHRoaXMuX2xwczJBQUJCICk7XG5cbiAgICBsZXQgd29ybGQ3ID0gdGhpcy5fZGltZW5zaW9uc0lKSy5jbG9uZSgpLmFkZFNjYWxhciggLTAuNSApXG4gICAgICAuYXBwbHlNYXRyaXg0KCB0aGlzLl9pamsyTFBTIClcbiAgICAgIC5hcHBseU1hdHJpeDQoIHRoaXMuX2xwczJBQUJCICk7XG5cbiAgICBsZXQgbWluQkJveCA9IG5ldyBUSFJFRS5WZWN0b3IzKFxuICAgICAgTWF0aC5hYnMoIHdvcmxkMC54IC0gd29ybGQ3LnggKSxcbiAgICAgIE1hdGguYWJzKCB3b3JsZDAueSAtIHdvcmxkNy55ICksXG4gICAgICBNYXRoLmFicyggd29ybGQwLnogLSB3b3JsZDcueiApXG4gICAgKTtcblxuICAgIHJldHVybiBtaW5CQm94O1xuXG4gIH1cblxuICBjZW50ZXJBQUJCb3goKSB7XG5cbiAgICBsZXQgY2VudGVyQkJveCA9IHRoaXMud29ybGRDZW50ZXIoKTtcbiAgICBjZW50ZXJCQm94LmFwcGx5TWF0cml4NCggdGhpcy5fbHBzMkFBQkIgKTtcbiAgICByZXR1cm4gY2VudGVyQkJveDtcblxuICB9XG5cbiAgc3RhdGljIHZhbHVlKHN0YWNrLCBpamtDb29yZGluYXRlKSB7XG5cbiAgICBpZiggaWprQ29vcmRpbmF0ZS56ID49IDAgJiYgaWprQ29vcmRpbmF0ZS56IDwgc3RhY2suX2ZyYW1lLmxlbmd0aCApIHtcblxuICAgICAgcmV0dXJuIHN0YWNrLl9mcmFtZVtpamtDb29yZGluYXRlLnpdLnZhbHVlKFxuICAgICAgICBpamtDb29yZGluYXRlLngsXG4gICAgICAgIGlqa0Nvb3JkaW5hdGUueSApO1xuXG4gICAgfSBlbHNlIHtcblxuICAgICAgcmV0dXJuIG51bGw7XG5cbiAgICB9XG5cbiAgfVxuXG4gIHN0YXRpYyB2YWx1ZVJlc2NhbGVTbG9wZUludGVyY2VwdCggdmFsdWUsIHNsb3BlLCBpbnRlcmNlcHQgKSB7XG5cbiAgICByZXR1cm4gdmFsdWUgKiBzbG9wZSArIGludGVyY2VwdDtcblxuICB9XG5cbiAgc3RhdGljIGluZGV4SW5EaW1lbnNpb25zKCBpbmRleCwgZGltZW5zaW9ucyApIHtcblxuICAgIGlmICggaW5kZXgueCA+PSAwICYmXG4gICAgICAgICBpbmRleC55ID49IDAgJiZcbiAgICAgICAgIGluZGV4LnogPj0gMCAmJlxuICAgICAgICAgaW5kZXgueCA8IGRpbWVuc2lvbnMueCAmJlxuICAgICAgICAgaW5kZXgueSA8IGRpbWVuc2lvbnMueSAmJlxuICAgICAgICAgaW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GVsRGF0YU9mZnNldCk7XG5cbiAgICAgIGZvciAodmFyIGkgPSBieXRlU3RhcnQ7IGkgPD0gYnl0ZUVuZDsgaSsrKSB7XG4gICAgICAgIHdoaWxlIChiaXRTdGFydE9mZnNldCA8IDgpIHtcblxuICAgICAgICAgIHN3aXRjaCAoYml0U3RhcnRPZmZzZXQpe1xuICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDEgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDIgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAzOlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDMgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA0OlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDQgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA1OlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDUgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA2OlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDYgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA3OlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDcgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgYml0U3RhcnRPZmZzZXQrKztcbiAgICAgICAgICBpbmRleCsrO1xuICAgICAgICAgIC8vIGlmIHJldHVybi4uXG4gICAgICAgICAgaWYgKGluZGV4ID49IG51bVBpeGVscykge1xuICAgICAgICAgICAgcmV0dXJuIG5ld0FycmF5O1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBiaXRTdGFydE9mZnNldCA9IDA7XG5cbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICBfY29udmVydENvbG9yU3BhY2UodW5jb21wcmVzc2VkRGF0YSkge1xuICAgIGxldCByZ2JEYXRhID0gbnVsbDtcbiAgICBsZXQgcGhvdG9tZXRyaWNJbnRlcnByZXRhdGlvbiA9IHRoaXMucGhvdG9tZXRyaWNJbnRlcnByZXRhdGlvbigpO1xuICAgIGxldCBwbGFuYXJDb25maWd1cmF0aW9uID0gdGhpcy5wbGFuYXJDb25maWd1cmF0aW9uKCk7XG5cbiAgICBpZiAocGhvdG9tZXRyaWNJbnRlcnByZXRhdGlvbiA9PT0gJ1JHQicgJiZcbiAgICAgICAgcGxhbmFyQ29uZmlndXJhdGlvbiA9PT0gMCkge1xuICAgICAgLy8gQUxMIEdPT0QsIEFMUkVBRFkgT1JERVJFRFxuICAgICAgLy8gcGxhbmFyIG9yIG5vbiBwbGFuYXIgcGxhbmFyQ29uZmlndXJhdGlvblxuICAgICAgcmdiRGF0YSA9IHVuY29tcHJlc3NlZERhdGE7XG5cbiAgICB9IGVsc2UgaWYgKHBob3Rvb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iB7XG4gICAgICAgIHR5cGU6ICdpJyxcbiAgICAgICAgdmFsdWU6IDEsXG4gICAgICAgIHR5cGVHTFNMOiAnaW50J1xuICAgICAgfSxcbiAgICAgICd1Qml0c0FsbG9jYXRlZCc6IHtcbiAgICAgICAgdHlwZTogJ2knLFxuICAgICAgICB2YWx1ZTogOCxcbiAgICAgICAgdHlwZUdMU0w6ICdpbnQnXG4gICAgICB9LFxuICAgICAgJ3VJbnZlcnQnOiB7XG4gICAgICAgIHR5cGU6ICdpJyxcbiAgICAgICAgdmFsdWU6IDAsXG4gICAgICAgIHR5cGVHTFNMOiAnaW50J1xuICAgICAgfSxcbiAgICAgICd1THV0Jzoge1xuICAgICAgICB0eXBlOiAnaScsXG4gICAgICAgIHZhbHVlOiAwLFxuICAgICAgICB0eXBlR0xTTDogJ2ludCdcbiAgICAgIH0sXG4gICAgICAndVRleHR1cmVMVVQnOntcbiAgICAgICAgdHlwZTogJ3QnLFxuICAgICAgICB2YWx1ZTogW10sXG4gICAgICAgIHR5cGVHTFNMOiAnc2FtcGxlcjJEJ1xuICAgICAgfSxcbiAgICAgICd1UGl4ZWxUeXBlJzoge1xuICAgICAgICB0eXBlOiAnaScsXG4gICAgICAgIHZhbHVlOiAwLFxuICAgICAgICB0eXBlR0xTTDogJ2ludCdcbiAgICAgIH0sXG4gICAgICAndVBhY2tlZFBlclBpeGVsJzoge1xuICAgICAgICB0eXBlOiAnaScsXG4gICAgICAgIHZhbHVlOiAxLFxuICAgICAgICB0eXBlR0xTTDogJ2ludCdcbiAgICAgIH0sXG4gICAgICAndUludGVycG9sYXRpb24nOiB7XG4gICAgICAgIHR5cGU6ICdpJyxcbiAgICAgICAgdmFsdWU6IDEsXG4gICAgICAgIHR5cGVHTFNMOiAnaW50J1xuICAgICAgfSxcbiAgICAgICd1V29ybGRCQm94Jzoge1xuICAgICAgICB0eXBlOiAnZnYxJyxcbiAgICAgICAgdmFsdWU6IFswLjAsIDAuMCwgMC4wLCAwLjAsIDAuMCw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VsKHNob3dWb3hlbCkge1xuICAgIHRoaXMuX3Nob3dWb3hlbCA9IHNob3dWb3hlbDtcbiAgICB0aGlzLnVwZGF0ZSgpO1xuICB9XG5cbiAgZ2V0IHNob3dWb3hlbCgpIHtcbiAgICByZXR1cm4gdGhpcy5fc2hvd1ZveGVsO1xuICB9XG5cbiAgc2V0IHNob3dEb21TVkcoc2hvd0RvbVNWRykge1xuICAgIHRoaXMuX3Nob3dEb21TVkcgPSBzaG93RG9tU1ZHO1xuICAgIHRoaXMudXBkYXRlKCk7XG4gIH1cblxuICBnZXQgc2hvd0RvbVNWRygpIHtcbiAgICByZXR1cm4gdGhpcy5fc2hvd0RvbVNWRztcbiAgfVxuXG4gIHNldCBzaG93RG9tTWVhc3VyZW1lbnRzKHNob3dEb21NZWFzdXJlbWVudHMpIHtcbiAgICB0aGlzLl9zaG93RG9tTWVhc3VyZW1lbnRzID0gc2hvd0RvbU1lYXN1cmVtZW50cztcbiAgICB0aGlzLnVwZGF0ZSgpO1xuICB9XG5cbiAgZ2V0IHNob3dEb21NZWFzdXJlbWVudHMoKSB7XG4gICAgcmV0dXJuIHRoaXMuX3Nob3dEb21NZWFzdXJlbWVudHM7XG4gIH1cbn1cbiJdfQ== diff --git a/build/ami.min.js b/build/ami.min.js index ffd72a0e3..1d43d0164 100644 --- a/build/ami.min.js +++ b/build/ami.min.js @@ -16,7 +16,7 @@ this.decodeStrings=!noDecode;this.defaultEncoding=options.defaultEncoding||"utf8 _this._back=null;_this._xCosine=null;_this._yCosine=null;_this._zCosine=null;_this._controls=null;_this._box=null;_this._canvas={width:null,height:null};_this._fromFront=true;_this._angle=0;return _this}_createClass(CamerasOrthographic,[{key:"init",value:function init(xCosine,yCosine,zCosine,controls,box,canvas){if(!(_core4.default.vector3(xCosine)&&_core4.default.vector3(yCosine)&&_core4.default.vector3(zCosine)&&_core4.default.box(box)&&controls)){window.console.log("Invalid input provided.");return false}this._xCosine=xCosine;this._yCosine=this._adjustTopDirection(xCosine,yCosine);this._zCosine=(new THREE.Vector3).crossVectors(this._xCosine,this._yCosine);this._controls=controls;this._box=box;this._canvas=canvas;var ray={position:this._box.center,direction:this._zCosine};var intersections=this._orderIntersections(_core2.default.rayBox(ray,this._box),this._zCosine);this._front=intersections[0];this._back=intersections[1];this.up.set(this._yCosine.x,this._yCosine.y,this._yCosine.z);this._updateCanvas();this._updatePositionAndTarget(this._front,this._back);this._updateMatrices()}},{key:"invertRows",value:function invertRows(){console.log("invert rows ");this.up.multiplyScalar(-1);this.invertColumns()}},{key:"invertColumns",value:function invertColumns(){console.log("invert columns ");this.center();var oppositePosition=this._oppositePosition(this.position);this._updatePositionAndTarget(oppositePosition,this.position.clone());this._updateMatrices();this._fromFront=!this._fromFront;var clockwise=1;if(!this._fromFront){clockwise=-1}this._angle%=360;this._angle=360-this._angle}},{key:"center",value:function center(){if(this._fromFront){this._updatePositionAndTarget(this._front,this._back)}else{this._updatePositionAndTarget(this._back,this._front)}this._updateMatrices()}},{key:"rotate",value:function rotate(){var angle=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;this.center();var computedAngle=90;var clockwise=1;if(!this._fromFront){clockwise=-1}if(angle===null){computedAngle*=-clockwise;this._angle+=90}else{computedAngle=360-clockwise*(angle-this._angle);this._angle=angle}this._angle%=360;var rotation=(new THREE.Matrix4).makeRotationAxis(this._zCosine,computedAngle*Math.PI/180);this.up.applyMatrix4(rotation);this._updateMatrices()}},{key:"fitBox",value:function fitBox(){var direction=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var factor=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1.5;var zoom=1;switch(direction){case 0:zoom=factor*this._computeZoom(this._canvas.width,this._xCosine);break;case 1:zoom=factor*this._computeZoom(this._canvas.height,this._yCosine);break;case 2:zoom=factor*Math.min(this._computeZoom(this._canvas.width,this._xCosine),this._computeZoom(this._canvas.height,this._yCosine));break;default:break}if(!zoom){return false}this.zoom=zoom;this.center()}},{key:"_adjustTopDirection",value:function _adjustTopDirection(horizontalDirection,verticalDirection){var hMaxIndex=this._getMaxIndex(horizontalDirection);var vMaxIndex=this._getMaxIndex(verticalDirection);if(vMaxIndex===2&&verticalDirection.getComponent(vMaxIndex)<0||vMaxIndex===1&&verticalDirection.getComponent(vMaxIndex)>0||vMaxIndex===0&&verticalDirection.getComponent(vMaxIndex)>0){verticalDirection.negate()}return verticalDirection}},{key:"_getMaxIndex",value:function _getMaxIndex(vector){if(Math.abs(Math.round(vector.x))===1){return 0}else if(Math.abs(Math.round(vector.y))===1){return 1}else if(Math.abs(Math.round(vector.z))===1){return 2}}},{key:"_orderIntersections",value:function _orderIntersections(intersections,direction){var maxIndex=this._getMaxIndex(direction);var ordered=intersections[0].dot(direction)0)){window.console.log("Invalid dimension provided.");window.console.log(dimension);return false}var ray={position:this._box.center.clone(),direction:direction};var intersections=_core2.default.rayBox(ray,this._box);if(intersections.length<2){window.console.log("Can not adjust the camera ( < 2 intersections).");window.console.log(ray);window.console.log(this._box);return false}return dimension/intersections[0].distanceTo(intersections[1])}},{key:"_updatePositionAndTarget",value:function _updatePositionAndTarget(position,target){this.position.set(position.x,position.y,position.z);this.lookAt(target.x,target.y,target.z);this._controls.target.set(target.x,target.y,target.z)}},{key:"_updateMatrices",value:function _updateMatrices(){this._controls.update();this.updateProjectionMatrix();this.updateMatrixWorld()}},{key:"xCosine",set:function set(xCosine){this._xCosine=xCosine},get:function get(){return this._xCosine}},{key:"yCosine",set:function set(yCosine){this._yCosine=yCosine},get:function get(){return this._yCosine}},{key:"zCosine",set:function set(zCosine){this._zCosine=zCosine},get:function get(){return this._zCosine}},{key:"controls",set:function set(controls){this._controls=controls},get:function get(){return this._controls}},{key:"box",set:function set(box){this._box=box},get:function get(){return this._box}},{key:"canvas",set:function set(canvas){this._canvas=canvas;this._updateCanvas()},get:function get(){return this._canvas}},{key:"angle",set:function set(angle){this.rotate(angle)},get:function get(){return this._angle}}]);return CamerasOrthographic}(THREE.OrthographicCamera);exports.default=CamerasOrthographic},{"../core/core.intersections":93,"../core/core.validators":97}],89:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _controls=require("./controls.trackball");var _controls2=_interopRequireDefault(_controls);var _controls3=require("./controls.trackballortho");var _controls4=_interopRequireDefault(_controls3);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Trackball:_controls2.default,TrackballOrtho:_controls4.default}},{"./controls.trackball":90,"./controls.trackballortho":91}],90:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return call&&((typeof call==="undefined"?"undefined":_typeof(call))==="object"||typeof call==="function")?call:self}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+(typeof superClass==="undefined"?"undefined":_typeof(superClass)))}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass}var Trackball=function(_THREE$EventDispatche){_inherits(Trackball,_THREE$EventDispatche);function Trackball(object,domElement){_classCallCheck(this,Trackball);var _this2=_possibleConstructorReturn(this,(Trackball.__proto__||Object.getPrototypeOf(Trackball)).call(this));var _this=_this2;var STATE={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM:4,TOUCH_PAN:5,CUSTOM:99};_this2.object=object;_this2.domElement=domElement!==undefined?domElement:document;_this2.enabled=true;_this2.screen={left:0,top:0,width:0,height:0};_this2.rotateSpeed=1;_this2.zoomSpeed=1.2;_this2.panSpeed=.3;_this2.noRotate=false;_this2.noZoom=false;_this2.noPan=false;_this2.noCustom=false;_this2.forceState=-1;_this2.staticMoving=false;_this2.dynamicDampingFactor=.2;_this2.minDistance=0;_this2.maxDistance=Infinity;_this2.keys=[65,83,68];_this2.target=new THREE.Vector3;var EPS=1e-6;var lastPosition=new THREE.Vector3;var _state=STATE.NONE,_prevState=STATE.NONE,_eye=new THREE.Vector3,_movePrev=new THREE.Vector2,_moveCurr=new THREE.Vector2,_lastAxis=new THREE.Vector3,_lastAngle=0,_zoomStart=new THREE.Vector2,_zoomEnd=new THREE.Vector2,_touchZoomDistanceStart=0,_touchZoomDistanceEnd=0,_panStart=new THREE.Vector2,_panEnd=new THREE.Vector2,_customStart=new THREE.Vector2,_customEnd=new THREE.Vector2;_this2.target0=_this2.target.clone();_this2.position0=_this2.object.position.clone();_this2.up0=_this2.object.up.clone();var changeEvent={type:"change"};var startEvent={type:"start"};var endEvent={type:"end"};_this2.handleResize=function(){if(this.domElement===document){this.screen.left=0;this.screen.top=0;this.screen.width=window.innerWidth;this.screen.height=window.innerHeight}else{var box=this.domElement.getBoundingClientRect();var d=this.domElement.ownerDocument.documentElement;this.screen.left=box.left+window.pageXOffset-d.clientLeft;this.screen.top=box.top+window.pageYOffset-d.clientTop;this.screen.width=box.width;this.screen.height=box.height}};_this2.handleEvent=function(event){if(typeof this[event.type]=="function"){this[event.type](event)}};var getMouseOnScreen=function(){var vector=new THREE.Vector2;return function(pageX,pageY){vector.set((pageX-_this.screen.left)/_this.screen.width,(pageY-_this.screen.top)/_this.screen.height);return vector}}();var getMouseOnCircle=function(){var vector=new THREE.Vector2;return function(pageX,pageY){vector.set((pageX-_this.screen.width*.5-_this.screen.left)/(_this.screen.width*.5),(_this.screen.height+2*(_this.screen.top-pageY))/_this.screen.width);return vector}}();_this2.rotateCamera=function(){var axis=new THREE.Vector3,quaternion=new THREE.Quaternion,eyeDirection=new THREE.Vector3,objectUpDirection=new THREE.Vector3,objectSidewaysDirection=new THREE.Vector3,moveDirection=new THREE.Vector3,angle;return function(){moveDirection.set(_moveCurr.x-_movePrev.x,_moveCurr.y-_movePrev.y,0);angle=moveDirection.length();if(angle){_eye.copy(_this.object.position).sub(_this.target);eyeDirection.copy(_eye).normalize();objectUpDirection.copy(_this.object.up).normalize();objectSidewaysDirection.crossVectors(objectUpDirection,eyeDirection).normalize();objectUpDirection.setLength(_moveCurr.y-_movePrev.y);objectSidewaysDirection.setLength(_moveCurr.x-_movePrev.x);moveDirection.copy(objectUpDirection.add(objectSidewaysDirection));axis.crossVectors(moveDirection,_eye).normalize();angle*=_this.rotateSpeed;quaternion.setFromAxisAngle(axis,angle);_eye.applyQuaternion(quaternion);_this.object.up.applyQuaternion(quaternion);_lastAxis.copy(axis);_lastAngle=angle}else if(!_this.staticMoving&&_lastAngle){_lastAngle*=Math.sqrt(1-_this.dynamicDampingFactor);_eye.copy(_this.object.position).sub(_this.target);quaternion.setFromAxisAngle(_lastAxis,_lastAngle);_eye.applyQuaternion(quaternion);_this.object.up.applyQuaternion(quaternion)}_movePrev.copy(_moveCurr)}}();_this2.zoomCamera=function(){var factor;if(_state===STATE.TOUCH_ZOOM){factor=_touchZoomDistanceStart/_touchZoomDistanceEnd;_touchZoomDistanceStart=_touchZoomDistanceEnd;_eye.multiplyScalar(factor)}else{factor=1+(_zoomEnd.y-_zoomStart.y)*_this.zoomSpeed;if(factor!==1&&factor>0){_eye.multiplyScalar(factor);if(_this.staticMoving){_zoomStart.copy(_zoomEnd)}else{_zoomStart.y+=(_zoomEnd.y-_zoomStart.y)*this.dynamicDampingFactor}}}};_this2.panCamera=function(){var mouseChange=new THREE.Vector2,objectUp=new THREE.Vector3,pan=new THREE.Vector3;return function(){mouseChange.copy(_panEnd).sub(_panStart);if(mouseChange.lengthSq()){mouseChange.multiplyScalar(_eye.length()*_this.panSpeed);pan.copy(_eye).cross(_this.object.up).setLength(mouseChange.x);pan.add(objectUp.copy(_this.object.up).setLength(mouseChange.y));_this.object.position.add(pan);_this.target.add(pan);if(_this.staticMoving){_panStart.copy(_panEnd)}else{_panStart.add(mouseChange.subVectors(_panEnd,_panStart).multiplyScalar(_this.dynamicDampingFactor))}}}}();_this2.checkDistances=function(){if(!_this.noZoom||!_this.noPan){if(_eye.lengthSq()>_this.maxDistance*_this.maxDistance){_this.object.position.addVectors(_this.target,_eye.setLength(_this.maxDistance))}if(_eye.lengthSq()<_this.minDistance*_this.minDistance){_this.object.position.addVectors(_this.target,_eye.setLength(_this.minDistance))}}};_this2.update=function(){_eye.subVectors(_this.object.position,_this.target);if(!_this.noRotate){_this.rotateCamera()}if(!_this.noZoom){_this.zoomCamera()}if(!_this.noPan){_this.panCamera()}if(!_this.noCustom){_this.custom(_customStart,_customEnd)}_this.object.position.addVectors(_this.target,_eye);_this.checkDistances();_this.object.lookAt(_this.target);if(lastPosition.distanceToSquared(_this.object.position)>EPS){_this.dispatchEvent(changeEvent);lastPosition.copy(_this.object.position)}};_this2.reset=function(){_state=STATE.NONE;_prevState=STATE.NONE;_this.target.copy(_this.target0);_this.object.position.copy(_this.position0);_this.object.up.copy(_this.up0);_eye.subVectors(_this.object.position,_this.target);_this.object.lookAt(_this.target);_this.dispatchEvent(changeEvent);lastPosition.copy(_this.object.position)};_this2.setState=function(targetState){_this.forceState=targetState;_prevState=targetState;_state=targetState};_this2.custom=function(customStart,customEnd){};function keydown(event){if(_this.enabled===false)return;window.removeEventListener("keydown",keydown);_prevState=_state;if(_state!==STATE.NONE){return}else if(event.keyCode===_this.keys[STATE.ROTATE]&&!_this.noRotate){_state=STATE.ROTATE}else if(event.keyCode===_this.keys[STATE.ZOOM]&&!_this.noZoom){_state=STATE.ZOOM}else if(event.keyCode===_this.keys[STATE.PAN]&&!_this.noPan){_state=STATE.PAN}}function keyup(event){if(_this.enabled===false)return;_state=_prevState;window.addEventListener("keydown",keydown,false)}function mousedown(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_state===STATE.NONE){_state=event.button}if(_state===STATE.ROTATE&&!_this.noRotate){_moveCurr.copy(getMouseOnCircle(event.pageX,event.pageY));_movePrev.copy(_moveCurr)}else if(_state===STATE.ZOOM&&!_this.noZoom){_zoomStart.copy(getMouseOnScreen(event.pageX,event.pageY));_zoomEnd.copy(_zoomStart)}else if(_state===STATE.PAN&&!_this.noPan){_panStart.copy(getMouseOnScreen(event.pageX,event.pageY));_panEnd.copy(_panStart)}else if(_state===STATE.CUSTOM&&!_this.noCustom){_customStart.copy(getMouseOnScreen(event.pageX,event.pageY));_customEnd.copy(_panStart)}document.addEventListener("mousemove",mousemove,false);document.addEventListener("mouseup",mouseup,false);_this.dispatchEvent(startEvent)}function mousemove(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_state===STATE.ROTATE&&!_this.noRotate){_movePrev.copy(_moveCurr);_moveCurr.copy(getMouseOnCircle(event.pageX,event.pageY))}else if(_state===STATE.ZOOM&&!_this.noZoom){_zoomEnd.copy(getMouseOnScreen(event.pageX,event.pageY))}else if(_state===STATE.PAN&&!_this.noPan){_panEnd.copy(getMouseOnScreen(event.pageX,event.pageY))}else if(_state===STATE.CUSTOM&&!_this.noCustom){_customEnd.copy(getMouseOnScreen(event.pageX,event.pageY))}}function mouseup(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_this.forceState===-1){_state=STATE.NONE}document.removeEventListener("mousemove",mousemove);document.removeEventListener("mouseup",mouseup);_this.dispatchEvent(endEvent)}function mousewheel(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();var delta=0;if(event.wheelDelta){delta=event.wheelDelta/40}else if(event.detail){delta=-event.detail/3}if(_state!==STATE.CUSTOM){_zoomStart.y+=delta*.01}else if(_state===STATE.CUSTOM){_customStart.y+=delta*.01}_this.dispatchEvent(startEvent);_this.dispatchEvent(endEvent)}function touchstart(event){if(_this.enabled===false)return;if(_this.forceState===-1){switch(event.touches.length){case 1:_state=STATE.TOUCH_ROTATE;_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));_movePrev.copy(_moveCurr);break;case 2:_state=STATE.TOUCH_ZOOM;var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=_touchZoomDistanceStart=Math.sqrt(dx*dx+dy*dy);var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panStart.copy(getMouseOnScreen(x,y));_panEnd.copy(_panStart);break;default:_state=STATE.NONE}}else{switch(_state){case 0:_state=STATE.TOUCH_ROTATE;_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));_movePrev.copy(_moveCurr);break;case 1:case 4:if(event.touches.length>=2){_state=STATE.TOUCH_ZOOM;var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=_touchZoomDistanceStart=Math.sqrt(dx*dx+dy*dy)}else{_state=STATE.ZOOM;_zoomStart.copy(getMouseOnScreen(event.touches[0].pageX,event.touches[0].pageY));_zoomEnd.copy(_zoomStart)}break;case 2:case 5:if(event.touches.length>=2){_state=STATE.TOUCH_PAN;var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panStart.copy(getMouseOnScreen(x,y));_panEnd.copy(_panStart)}else{_state=STATE.PAN;_panStart.copy(getMouseOnScreen(event.touches[0].pageX,event.touches[0].pageY));_panEnd.copy(_panStart)}break;case 99:_state=STATE.CUSTOM;var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_customStart.copy(getMouseOnScreen(x,y));_customEnd.copy(_customStart);break;default:_state=STATE.NONE}}_this.dispatchEvent(startEvent)}function touchmove(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_this.forceState===-1){switch(event.touches.length){case 1:_movePrev.copy(_moveCurr);_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));break;case 2:var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=Math.sqrt(dx*dx+dy*dy);var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));break;default:_state=STATE.NONE}}else{switch(_state){case 0:_movePrev.copy(_moveCurr);_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));break;case 1:_zoomEnd.copy(getMouseOnScreen(event.touches[0].pageX,event.touches[0].pageY));break;case 2:_panEnd.copy(getMouseOnScreen(event.touches[0].pageX,event.touches[0].pageY));break;case 4:var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=Math.sqrt(dx*dx+dy*dy);break;case 5:var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));break;case 99:var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_customEnd.copy(getMouseOnScreen(x,y));break;default:_state=STATE.NONE}}}function touchend(event){if(_this.enabled===false)return;if(_this.forceState===-1){switch(event.touches.length){case 1:_movePrev.copy(_moveCurr);_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));break;case 2:_touchZoomDistanceStart=_touchZoomDistanceEnd=0;var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));_panStart.copy(_panEnd);break}_state=STATE.NONE}else{switch(_state){case 0:_movePrev.copy(_moveCurr);_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));break;case 1:case 2:break;case 4:_touchZoomDistanceStart=_touchZoomDistanceEnd=0;_state=STATE.ZOOM;break;case 5:if(event.touches.length>=2){var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));_panStart.copy(_panEnd)}_state=STATE.PAN;break;case 99:var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_customEnd.copy(getMouseOnScreen(x,y));_customStart.copy(_customEnd);break;default:_state=STATE.NONE}}_this.dispatchEvent(endEvent)}_this2.domElement.addEventListener("contextmenu",function(event){event.preventDefault()},false);_this2.domElement.addEventListener("mousedown",mousedown,false);_this2.domElement.addEventListener("mousewheel",mousewheel,false);_this2.domElement.addEventListener("DOMMouseScroll",mousewheel,false);_this2.domElement.addEventListener("touchstart",touchstart,false);_this2.domElement.addEventListener("touchend",touchend,false);_this2.domElement.addEventListener("touchmove",touchmove,false);window.addEventListener("keydown",keydown,false);window.addEventListener("keyup",keyup,false);_this2.handleResize();_this2.update();return _this2}return Trackball}(THREE.EventDispatcher);exports.default=Trackball},{}],91:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return call&&((typeof call==="undefined"?"undefined":_typeof(call))==="object"||typeof call==="function")?call:self}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+(typeof superClass==="undefined"?"undefined":_typeof(superClass)))}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass}var Trackballortho=function(_THREE$EventDispatche){_inherits(Trackballortho,_THREE$EventDispatche);function Trackballortho(object,domElement){var state=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{NONE:-1,ROTATE:1,ZOOM:2,PAN:0,SCROLL:4,TOUCH_ROTATE:4,TOUCH_ZOOM_PAN:5};_classCallCheck(this,Trackballortho);var _this2=_possibleConstructorReturn(this,(Trackballortho.__proto__||Object.getPrototypeOf(Trackballortho)).call(this));var _this=_this2;var STATE=state;_this2.object=object;_this2.domElement=domElement!==undefined?domElement:document;_this2.enabled=true;_this2.screen={left:0,top:0,width:0,height:0};_this2.radius=0;_this2.zoomSpeed=1.2;_this2.noZoom=false;_this2.noPan=false;_this2.staticMoving=false;_this2.dynamicDampingFactor=.2;_this2.keys=[65,83,68];_this2.target=new THREE.Vector3;var EPS=1e-6;var _changed=true;var _state=STATE.NONE,_prevState=STATE.NONE,_eye=new THREE.Vector3,_zoomStart=new THREE.Vector2,_zoomEnd=new THREE.Vector2,_touchZoomDistanceStart=0,_touchZoomDistanceEnd=0,_panStart=new THREE.Vector2,_panEnd=new THREE.Vector2;_this2.target0=_this2.target.clone();_this2.position0=_this2.object.position.clone();_this2.up0=_this2.object.up.clone();_this2.left0=_this2.object.left;_this2.right0=_this2.object.right;_this2.top0=_this2.object.top;_this2.bottom0=_this2.object.bottom;var changeEvent={type:"change"};var startEvent={type:"start"};var endEvent={type:"end"};_this2.handleResize=function(){if(this.domElement===document){this.screen.left=0;this.screen.top=0;this.screen.width=window.innerWidth;this.screen.height=window.innerHeight}else{var box=this.domElement.getBoundingClientRect();var d=this.domElement.ownerDocument.documentElement;this.screen.left=box.left+window.pageXOffset-d.clientLeft;this.screen.top=box.top+window.pageYOffset-d.clientTop;this.screen.width=box.width;this.screen.height=box.height}this.radius=.5*Math.min(this.screen.width,this.screen.height);this.left0=this.object.left;this.right0=this.object.right;this.top0=this.object.top;this.bottom0=this.object.bottom};_this2.handleEvent=function(event){if(typeof this[event.type]=="function"){this[event.type](event)}};var getMouseOnScreen=function(){var vector=new THREE.Vector2;return function getMouseOnScreen(pageX,pageY){vector.set((pageX-_this.screen.left)/_this.screen.width,(pageY-_this.screen.top)/_this.screen.height);return vector}}();_this2.zoomCamera=function(){if(_state===STATE.TOUCH_ZOOM_PAN){var factor=_touchZoomDistanceEnd/_touchZoomDistanceStart;_touchZoomDistanceStart=_touchZoomDistanceEnd;_this.object.zoom*=factor;_changed=true}else{var factor=1+(_zoomEnd.y-_zoomStart.y)*_this.zoomSpeed;if(Math.abs(factor-1)>EPS&&factor>0){_this.object.zoom/=factor;if(_this.staticMoving){_zoomStart.copy(_zoomEnd)}else{_zoomStart.y+=(_zoomEnd.y-_zoomStart.y)*this.dynamicDampingFactor}_changed=true}}};_this2.panCamera=function(){var mouseChange=new THREE.Vector2,objectUp=new THREE.Vector3,pan=new THREE.Vector3;return function panCamera(){mouseChange.copy(_panEnd).sub(_panStart);if(mouseChange.lengthSq()){var scale_x=(_this.object.right-_this.object.left)/_this.object.zoom;var scale_y=(_this.object.top-_this.object.bottom)/_this.object.zoom;mouseChange.x*=scale_x;mouseChange.y*=scale_y;pan.copy(_eye).cross(_this.object.up).setLength(mouseChange.x);pan.add(objectUp.copy(_this.object.up).setLength(mouseChange.y));_this.object.position.add(pan);_this.target.add(pan);if(_this.staticMoving){_panStart.copy(_panEnd)}else{_panStart.add(mouseChange.subVectors(_panEnd,_panStart).multiplyScalar(_this.dynamicDampingFactor))}_changed=true}}}();_this2.update=function(){_eye.subVectors(_this.object.position,_this.target);if(!_this.noZoom){_this.zoomCamera();if(_changed){_this.object.updateProjectionMatrix()}}if(!_this.noPan){_this.panCamera()}_this.object.position.addVectors(_this.target,_eye);_this.object.lookAt(_this.target);if(_changed){_this.dispatchEvent(changeEvent);_changed=false}};_this2.reset=function(){_state=STATE.NONE;_prevState=STATE.NONE;_this.target.copy(_this.target0);_this.object.position.copy(_this.position0);_this.object.up.copy(_this.up0);_eye.subVectors(_this.object.position,_this.target);_this.object.left=_this.left0;_this.object.right=_this.right0;_this.object.top=_this.top0;_this.object.bottom=_this.bottom0;_this.object.lookAt(_this.target);_this.dispatchEvent(changeEvent);_changed=false};function keydown(event){if(_this.enabled===false)return;window.removeEventListener("keydown",keydown);_prevState=_state;if(_state!==STATE.NONE){return}else if(event.keyCode===_this.keys[STATE.ROTATE]&&!_this.noRotate){_state=STATE.ROTATE}else if(event.keyCode===_this.keys[STATE.ZOOM]&&!_this.noZoom){_state=STATE.ZOOM}else if(event.keyCode===_this.keys[STATE.PAN]&&!_this.noPan){_state=STATE.PAN}}function keyup(event){if(_this.enabled===false)return;_state=_prevState;window.addEventListener("keydown",keydown,false)}function mousedown(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_state===STATE.NONE){_state=event.button}if(_state===STATE.ROTATE&&!_this.noRotate){}else if(_state===STATE.ZOOM&&!_this.noZoom){_zoomStart.copy(getMouseOnScreen(event.pageX,event.pageY));_zoomEnd.copy(_zoomStart)}else if(_state===STATE.PAN&&!_this.noPan){_panStart.copy(getMouseOnScreen(event.pageX,event.pageY));_panEnd.copy(_panStart)}document.addEventListener("mousemove",mousemove,false);document.addEventListener("mouseup",mouseup,false);_this.dispatchEvent(startEvent)}function mousemove(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_state===STATE.ROTATE&&!_this.noRotate){}else if(_state===STATE.ZOOM&&!_this.noZoom){_zoomEnd.copy(getMouseOnScreen(event.pageX,event.pageY))}else if(_state===STATE.PAN&&!_this.noPan){_panEnd.copy(getMouseOnScreen(event.pageX,event.pageY))}}function mouseup(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();_state=STATE.NONE;document.removeEventListener("mousemove",mousemove);document.removeEventListener("mouseup",mouseup);_this.dispatchEvent(endEvent)}function mousewheel(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();var delta=0;if(event.wheelDelta){delta=event.wheelDelta/40}else if(event.detail){delta=-event.detail/3}_this.dispatchEvent({type:"OnScroll",delta:delta});_this.dispatchEvent(startEvent);_this.dispatchEvent(endEvent)}function touchstart(event){if(_this.enabled===false)return;switch(event.touches.length){case 1:_state=STATE.TOUCH_ROTATE;break;case 2:_state=STATE.TOUCH_ZOOM_PAN;var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=_touchZoomDistanceStart=Math.sqrt(dx*dx+dy*dy);var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panStart.copy(getMouseOnScreen(x,y));_panEnd.copy(_panStart);break;default:_state=STATE.NONE}_this.dispatchEvent(startEvent)}function touchmove(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();switch(event.touches.length){case 1:break;case 2:var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=Math.sqrt(dx*dx+dy*dy);var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));break;default:_state=STATE.NONE}}function touchend(event){if(_this.enabled===false)return;switch(event.touches.length){case 1:break;case 2:_touchZoomDistanceStart=_touchZoomDistanceEnd=0;var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));_panStart.copy(_panEnd);break}_state=STATE.NONE;_this.dispatchEvent(endEvent)}function contextmenu(event){event.preventDefault()}_this2.dispose=function(){this.domElement.removeEventListener("contextmenu",contextmenu,false);this.domElement.removeEventListener("mousedown",mousedown,false);this.domElement.removeEventListener("mousewheel",mousewheel,false);this.domElement.removeEventListener("MozMousePixelScroll",mousewheel,false);this.domElement.removeEventListener("touchstart",touchstart,false);this.domElement.removeEventListener("touchend",touchend,false);this.domElement.removeEventListener("touchmove",touchmove,false);document.removeEventListener("mousemove",mousemove,false);document.removeEventListener("mouseup",mouseup,false);window.removeEventListener("keydown",keydown,false);window.removeEventListener("keyup",keyup,false)};_this2.domElement.addEventListener("contextmenu",contextmenu,false);_this2.domElement.addEventListener("mousedown",mousedown,false);_this2.domElement.addEventListener("mousewheel",mousewheel,false);_this2.domElement.addEventListener("MozMousePixelScroll",mousewheel,false);_this2.domElement.addEventListener("touchstart",touchstart,false);_this2.domElement.addEventListener("touchend",touchend,false); _this2.domElement.addEventListener("touchmove",touchmove,false);window.addEventListener("keydown",keydown,false);window.addEventListener("keyup",keyup,false);_this2.handleResize();_this2.update();return _this2}return Trackballortho}(THREE.EventDispatcher);exports.default=Trackballortho},{}],92:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i.008856){y=Math.pow(y,3)}else{y=(y-16/116)/7.787}if(Math.pow(x,3)>.008856){x=Math.pow(x,3)}else{x=(x-16/116)/7.787}if(Math.pow(z,3)>.008856){z=Math.pow(z,3)}else{z=(z-16/116)/7.787}return[refX*x,refY*y,refZ*z]}},{key:"xyz2RGB",value:function xyz2RGB(x,y,z){x/=100;y/=100;z/=100;var r=x*3.2406+y*-1.5372+z*-.4986;var g=x*-.9689+y*1.8758+z*.0415;var b=x*.0557+y*-.204+z*1.057;if(r>.0031308){r=1.055*Math.pow(r,1/2.4)-.055}else{r=12.92*r}if(g>.0031308){g=1.055*Math.pow(g,1/2.4)-.055}else{g=12.92*g}if(b>.0031308){b=1.055*Math.pow(b,1/2.4)-.055}else{b=12.92*b}r=r*255;g=g*255;b=b*255;return[r,g,b]}},{key:"cielab2RGB",value:function cielab2RGB(){var l=arguments.length>0&&arguments[0]!==undefined?arguments[0]:50;var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var b=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;if(!(l>=0&&l<=100)){return null}var xyz=this.cielab2XYZ(l,a,b);return this.xyz2RGB.apply(this,_toConsumableArray(xyz))}}]);return Colors}();exports.default=Colors},{}],93:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i=bbox.min.x-epsilon&&point.y>=bbox.min.y-epsilon&&point.z>=bbox.min.z-epsilon&&point.x<=bbox.max.x+epsilon&&point.y<=bbox.max.y+epsilon&&point.z<=bbox.max.z+epsilon){return true}return false}},{key:"posdir",value:function posdir(position,direction){return{position:position,direction:direction}}},{key:"validatePlane",value:function validatePlane(plane){if(plane===null){window.console.log("Invalid plane.");window.console.log(plane);return false}if(!_core4.default.vector3(plane.position)){window.console.log("Invalid plane.position.");window.console.log(plane.position);return false}if(!_core4.default.vector3(plane.direction)){window.console.log("Invalid plane.direction.");window.console.log(plane.direction);return false}return true}},{key:"validateAabb",value:function validateAabb(aabb){if(aabb===null){window.console.log("Invalid aabb.");window.console.log(aabb);return false}if(!_core4.default.matrix4(aabb.toAABB)){window.console.log("Invalid aabb.toAABB: ");window.console.log(aabb.toAABB);return false}if(!_core4.default.vector3(aabb.center)){window.console.log("Invalid aabb.center.");window.console.log(aabb.center);return false}if(!(_core4.default.vector3(aabb.halfDimensions)&&aabb.halfDimensions.x>=0&&aabb.halfDimensions.y>=0&&aabb.halfDimensions.z>=0)){window.console.log("Invalid aabb.halfDimensions.");window.console.log(aabb.halfDimensions);return false}return true}}]);return Intersections}();exports.default=Intersections},{"./core.utils":96,"./core.validators":97}],94:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _core=require("./core.colors");var _core2=_interopRequireDefault(_core);var _core3=require("./core.intersections");var _core4=_interopRequireDefault(_core3);var _core5=require("./core.pack");var _core6=_interopRequireDefault(_core5);var _core7=require("./core.validators");var _core8=_interopRequireDefault(_core7);var _core9=require("./core.utils");var _core10=_interopRequireDefault(_core9);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Colors:_core2.default,Intersections:_core4.default,Utils:_core10.default,Validators:_core8.default}},{"./core.colors":92,"./core.intersections":93,"./core.pack":95,"./core.utils":96,"./core.validators":97}],95:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var Pack=function Pack(){_classCallCheck(this,Pack)};exports.default=Pack},{}],96:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i=0&&halfDimensions.y>=0&&halfDimensions.z>=0)){window.console.log("halfDimensions must be >= 0.");window.console.log(halfDimensions);return false}var min=center.clone().sub(halfDimensions);var max=center.clone().add(halfDimensions);return{min:min,max:max}}},{key:"minMaxPixelData",value:function minMaxPixelData(){var pixelData=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var minMax=[65535,-32768];var numPixels=pixelData.length;for(var index=0;index=0&&objectToTest.halfDimensions.y>=0&&objectToTest.halfDimensions.z>=0)){return false}return true}},{key:"ray",value:function ray(objectToTest){if(!(objectToTest!==null&&typeof objectToTest!=="undefined"&&objectToTest.hasOwnProperty("position")&&this.vector3(objectToTest.position)&&objectToTest.hasOwnProperty("direction")&&this.vector3(objectToTest.direction))){return false}return true}}]);return Validators}();exports.default=Validators},{}],98:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _geometries=require("./geometries.slice");var _geometries2=_interopRequireDefault(_geometries);var _geometries3=require("./geometries.voxel");var _geometries4=_interopRequireDefault(_geometries3);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Slice:_geometries2.default,Voxel:_geometries4.default}},{"./geometries.slice":99,"./geometries.voxel":100}],99:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i4&&arguments[4]!==undefined?arguments[4]:new THREE.Matrix4;_classCallCheck(this,GeometriesSlice);var aabb={halfDimensions:halfDimensions,center:center,toAABB:toAABB};var plane={position:position,direction:direction};var intersections=_core2.default.aabbPlane(aabb,plane);if(intersections.length<3){window.console.log("WARNING: Less than 3 intersections between AABB and Plane.");window.console.log("AABB");window.console.log(aabb);window.console.log("Plane");window.console.log(plane);window.console.log("exiting...");throw"geometries.slice has less than 3 intersections, can not create a valid geometry."}var orderedIntersections=GeometriesSlice.orderIntersections(intersections,direction);var sliceShape=GeometriesSlice.shape(orderedIntersections);var _this=_possibleConstructorReturn(this,(GeometriesSlice.__proto__||Object.getPrototypeOf(GeometriesSlice)).call(this,sliceShape));_this.type="SliceGeometry";_this.vertices=orderedIntersections;_this.verticesNeedUpdate=true;return _this}_createClass(GeometriesSlice,null,[{key:"shape",value:function shape(points){var shape=new THREE.Shape;shape.moveTo(points[0].xy.x,points[0].xy.y);for(var l=1;l1&&arguments[1]!==undefined?arguments[1]:"default";var lutO=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"linear";var color=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[[0,0,0,0],[1,1,1,1]];var opacity=arguments.length>4&&arguments[4]!==undefined?arguments[4]:[[0,0],[1,1]];var discrete=arguments.length>5&&arguments[5]!==undefined?arguments[5]:false;_classCallCheck(this,HelpersLut);this._containerID=containerID;this._discrete=discrete;this._color=color;this._lut=lut;this._luts=_defineProperty({},lut,color);this._opacity=opacity;this._lutO=lutO;this._lutsO=_defineProperty({},lutO,opacity);this.initCanvas();this.paintCanvas()}_createClass(HelpersLut,[{key:"initCanvas",value:function initCanvas(){this._canvasContainer=this.initCanvasContainer(this._containerID);this._canvasBg=this.createCanvas();this._canvasContainer.appendChild(this._canvasBg);this._canvas=this.createCanvas();this._canvasContainer.appendChild(this._canvas)}},{key:"initCanvasContainer",value:function initCanvasContainer(canvasContainerId){var canvasContainer=document.getElementById(canvasContainerId);canvasContainer.style.width="256 px";canvasContainer.style.height="128 px";canvasContainer.style.border="1px solid #F9F9F9";return canvasContainer}},{key:"createCanvas",value:function createCanvas(){var canvas=document.createElement("canvas");canvas.height=16;canvas.width=256;return canvas}},{key:"paintCanvas",value:function paintCanvas(){var ctx=this._canvas.getContext("2d");ctx.clearRect(0,0,this._canvas.width,this._canvas.height);ctx.globalCompositeOperation="source-over";if(!this._discrete){var color=ctx.createLinearGradient(0,0,this._canvas.width,this._canvas.height);for(var i=0;i0){previousPos=this._color[_i-1][0]}var from=previousPos+(currentPos-previousPos)/2;var to=currentPos+(nextPos-currentPos)/2;var _color=this._color[_i];var opacity=this._opacity[_i]?this._opacity[_i][1]:1;ctx.beginPath();ctx.strokeStyle="rgba( "+Math.round(_color[1]*255)+", "+Math.round(_color[2]*255)+", "+Math.round(_color[3]*255)+", "+opacity+")";ctx.moveTo(from*this._canvas.width,0);ctx.lineTo(to*this._canvas.width,0);ctx.stroke();ctx.closePath()}}if(!this._discrete){ctx.globalCompositeOperation="destination-in";var _opacity=ctx.createLinearGradient(0,0,this._canvas.width,this._canvas.height);for(var _i2=0;_i20&&arguments[0]!==undefined?arguments[0]:"color";var available=[];var luts=this._luts;if(type!=="color"){luts=this._lutsO}for(var i in luts){available.push(i)}return available}},{key:"texture",get:function get(){var texture=new THREE.Texture(this._canvas);texture.mapping=THREE.UVMapping;texture.wrapS=texture.wrapT=THREE.ClampToEdgeWrapping;texture.magFilter=texture.minFilter=THREE.NearestFilter;texture.premultiplyAlpha=true;texture.needsUpdate=true;return texture}},{key:"lut",set:function set(targetLUT){this._color=this._luts[targetLUT];this._lut=targetLUT;this.paintCanvas()},get:function get(){return this._lut}},{key:"luts",set:function set(newLuts){this._luts=newLuts},get:function get(){return this._luts}},{key:"lutO",set:function set(targetLUTO){this._opacity=this._lutsO[targetLUTO];this._lutO=targetLUTO;this.paintCanvas()},get:function get(){return this._lutO}},{key:"lutsO",set:function set(newLutsO){this._lutsO=newLutsO},get:function get(){return this._lutsO}},{key:"discrete",set:function set(discrete){this._discrete=discrete;this.paintCanvas()},get:function get(){return this._discrete}}],[{key:"presetLuts",value:function presetLuts(){return{default:[[0,0,0,0],[1,1,1,1]],spectrum:[[0,0,0,0],[.1,0,0,1],[.33,0,1,1],[.5,0,1,0],[.66,1,1,0],[.9,1,0,0],[1,1,1,1]],hot_and_cold:[[0,0,0,1],[.15,0,1,1],[.3,0,1,0],[.45,0,0,0],[.5,0,0,0],[.55,0,0,0],[.7,1,1,0],[.85,1,0,0],[1,1,1,1]],gold:[[0,0,0,0],[.13,.19,.03,0],[.25,.39,.12,0],[.38,.59,.26,0],[.5,.8,.46,.08],[.63,.99,.71,.21],[.75,.99,.88,.34],[.88,.99,.99,.48],[1,.9,.95,.61]],red:[[0,.75,0,0],[.5,1,.5,0],[.95,1,1,0],[1,1,1,1]],green:[[0,0,.75,0],[.5,.5,1,0],[.95,1,1,0],[1,1,1,1]],blue:[[0,0,0,1],[.5,0,.5,1],[.95,0,1,1],[1,1,1,1]],walking_dead:[[0,.1,1,1],[1,1,1,1]],random:[[0,0,0,0],[.27,.18,.18,.18],[.41,1,1,1],[.7,1,0,0],[1,1,1,1]]}}},{key:"presetLutsO",value:function presetLutsO(){return{linear:[[0,0],[1,1]],lowpass:[[0,.8],[.2,.6],[.3,.1],[1,0]],bandpass:[[0,0],[.4,.8],[.6,.8],[1,0]],highpass:[[0,0],[.7,.1],[.8,.6],[1,.8]],flat:[[0,.7],[1,1]],random:[[0,0],[.38,0],[.55,1],[.72,1],[1,.05]]}}}]);return HelpersLut}();exports.default=HelpersLut},{}],105:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0){progressContainers[0].parentNode.removeChild(progressContainers[0])}progressContainers=null;window.cancelAnimationFrame(this.requestAnimationFrameID)}},{key:"init",value:function init(){var progressContainer=this._domContainer();for(var mode in this._modes){if(this._modes.hasOwnProperty(mode)){var bar=this._domBar(this._modes[mode]);progressContainer.appendChild(bar);bar=null}}this._container.appendChild(progressContainer);progressContainer=null;this.updateUI()}},{key:"update",value:function update(value,total,mode){this._mode=mode;this._value=value;if(total===0){this._total=value;this._value=Math.random()*value}else{this._total=total}}},{key:"updateUI",value:function updateUI(){var _this=this;this.requestAnimationFrameID=requestAnimationFrame(function(){_this.updateUI()});if(!(this._modes.hasOwnProperty(this._mode)&&this._modes[this._mode].hasOwnProperty("name")&&this._modes[this._mode].hasOwnProperty("color"))){return false}var message="";var progress=Math.round(this._value/this._total*100);var color=this._modes[this._mode].color;var progressBar=this._container.getElementsByClassName("progress "+this._modes[this._mode].name);if(progressBar.length>0){progressBar[0].style.borderColor=color;progressBar[0].style.width=progress+"%"}progressBar=null}},{key:"_domContainer",value:function _domContainer(){var container=document.createElement("div");container.classList.add("progress");container.classList.add("container");container.style.width="100%";container.style.height="8px";container.style.position="absolute";container.style.backgroundColor="rgba(158, 158, 158, 0.5)";container.style.top="0";container.style.zIndex="1";return container}},{key:"_domBar",value:function _domBar(mode){if(!(mode.hasOwnProperty("name")&&mode.hasOwnProperty("color"))){window.console.log("Invalid mode provided.");window.console.log(mode);return false}var bar=document.createElement("div");bar.classList.add(mode.name);bar.classList.add("progress");bar.style.border="2px solid "+mode.color;bar.style.width="0%";return bar}}]);return HelpersProgressBar}();exports.default=HelpersProgressBar},{}],107:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i1&&arguments[1]!==undefined?arguments[1]:0;var position=arguments.length>2&&arguments[2]!==undefined?arguments[2]:new THREE.Vector3(0,0,0);var direction=arguments.length>3&&arguments[3]!==undefined?arguments[3]:new THREE.Vector3(0,0,1);var aabbSpace=arguments.length>4&&arguments[4]!==undefined?arguments[4]:"IJK";_classCallCheck(this,HelpersSlice);var _this=_possibleConstructorReturn(this,(HelpersSlice.__proto__||Object.getPrototypeOf(HelpersSlice)).call(this));_this._stack=stack;_this._invert=_this._stack.invert;_this._lut="none";_this._lutTexture=null;_this._intensityAuto=true;_this._interpolation=1;_this._index=index;_this._windowWidth=null;_this._windowCenter=null;_this._rescaleSlope=null;_this._rescaleIntercept=null;_this._planePosition=position;_this._planeDirection=direction;_this._aaBBspace=aabbSpace;_this._material=null;_this._textures=[];_this._shadersFragment=_shadersData6.default;_this._shadersVertex=_shadersData4.default;_this._uniforms=_shadersData2.default.uniforms();_this._geometry=null;_this._mesh=null;_this._visible=true;_this._init();_this._create();return _this}_createClass(HelpersSlice,[{key:"_init",value:function _init(){if(!this._stack||!this._stack._prepared||!this._stack._packed){return}if(this._aaBBspace==="IJK"){this._halfDimensions=this._stack.halfDimensionsIJK;this._center=new THREE.Vector3(this._stack.halfDimensionsIJK.x-.5,this._stack.halfDimensionsIJK.y-.5,this._stack.halfDimensionsIJK.z-.5);this._toAABB=new THREE.Matrix4}else{var aaBBox=this._stack.AABBox();this._halfDimensions=aaBBox.clone().multiplyScalar(.5);this._center=this._stack.centerAABBox();this._toAABB=this._stack.lps2AABB}}},{key:"_create",value:function _create(){if(!this._stack||!this._stack.prepared||!this._stack.packed){return}try{this._geometry=new _geometries2.default(this._halfDimensions,this._center,this._planePosition,this._planeDirection,this._toAABB)}catch(e){window.console.log(e);window.console.log("invalid slice geometry - exiting...");return}if(!this._geometry.vertices){return}if(!this._material){this._uniforms.uTextureSize.value=this._stack.textureSize;this._uniforms.uDataDimensions.value=[this._stack.dimensionsIJK.x,this._stack.dimensionsIJK.y,this._stack.dimensionsIJK.z];this._uniforms.uWorldToData.value=this._stack.lps2IJK;this._uniforms.uNumberOfChannels.value=this._stack.numberOfChannels;this._uniforms.uPixelType.value=this._stack.pixelType;this._uniforms.uBitsAllocated.value=this._stack.bitsAllocated;this._uniforms.uPackedPerPixel.value=this._stack.packedPerPixel;this._prepareTexture();this._uniforms.uTextureContainer.value=this._textures;this._createMaterial({side:THREE.DoubleSide})}this.updateIntensitySettings();this.updateIntensitySettingsUniforms();this._mesh=new THREE.Mesh(this._geometry,this._material);if(this._aaBBspace==="IJK"){this._mesh.applyMatrix(this._stack.ijk2LPS)}this._mesh.visible=this._visible;this.add(this._mesh)}},{key:"updateIntensitySettings",value:function updateIntensitySettings(){if(this._intensityAuto){this.updateIntensitySetting("windowCenter");this.updateIntensitySetting("windowWidth");this.updateIntensitySetting("rescaleSlope");this.updateIntensitySetting("rescaleIntercept")}else{if(this._windowCenter===null){this._windowCenter=this._stack.windowCenter}if(this.__windowWidth===null){this._windowWidth=this._stack.windowWidth}if(this._rescaleSlope===null){this._rescaleSlope=this._stack.rescaleSlope}if(this._rescaleIntercept===null){this._rescaleIntercept=this._stack.rescaleIntercept}}}},{key:"updateIntensitySettingsUniforms",value:function updateIntensitySettingsUniforms(){this._uniforms.uRescaleSlopeIntercept.value=[this._rescaleSlope,this._rescaleIntercept];this._uniforms.uWindowCenterWidth.value=[this._windowCenter,this._windowWidth];this._uniforms.uInvert.value=this._invert===true?1:0;this._uniforms.uInterpolation.value=this._interpolation;if(this._lut==="none"){this._uniforms.uLut.value=0}else{this._uniforms.uLut.value=1;this._uniforms.uTextureLUT.value=this._lutTexture}}},{key:"updateIntensitySetting",value:function updateIntensitySetting(setting){if(this._stack.frame[this._index]&&this._stack.frame[this._index][setting]){this["_"+setting]=this._stack.frame[this._index][setting]}else{this["_"+setting]=this._stack[setting]}}},{key:"_update",value:function _update(){if(this._mesh){this.remove(this._mesh);this._mesh.geometry.dispose();this._mesh.geometry=null;this._mesh=null}this._create()}},{key:"stack",get:function get(){return this._stack},set:function set(stack){this._stack=stack}},{key:"windowWidth",get:function get(){return this._windowWidth},set:function set(windowWidth){this._windowWidth=windowWidth;this.updateIntensitySettingsUniforms()}},{key:"windowCenter",get:function get(){return this._windowCenter},set:function set(windowCenter){this._windowCenter=windowCenter;this.updateIntensitySettingsUniforms()}},{key:"rescaleSlope",get:function get(){return this._rescaleSlope},set:function set(rescaleSlope){this._rescaleSlope=rescaleSlope;this.updateIntensitySettingsUniforms()}},{key:"rescaleIntercept",get:function get(){return this._rescaleIntercept},set:function set(rescaleIntercept){this._rescaleIntercept=rescaleIntercept;this.updateIntensitySettingsUniforms()}},{key:"invert",get:function get(){return this._invert},set:function set(invert){this._invert=invert;this.updateIntensitySettingsUniforms()}},{key:"lut",get:function get(){return this._lut},set:function set(lut){this._lut=lut}},{key:"lutTexture",get:function get(){return this._lutTexture},set:function set(lutTexture){this._lutTexture=lutTexture;this.updateIntensitySettingsUniforms()}},{key:"intensityAuto",get:function get(){return this._intensityAuto},set:function set(intensityAuto){this._intensityAuto=intensityAuto;this.updateIntensitySettings();this.updateIntensitySettingsUniforms()}},{key:"interpolation",get:function get(){return this._interpolation},set:function set(interpolation){this._interpolation=interpolation;this.updateIntensitySettingsUniforms();this._updateMaterial()}},{key:"index",get:function get(){return this._index},set:function set(index){this._index=index;this._update()}},{key:"planePosition",set:function set(position){this._planePosition=position;this._update()},get:function get(){return this._planePosition}},{key:"planeDirection",set:function set(direction){this._planeDirection=direction;this._update()},get:function get(){return this._planeDirection}},{key:"halfDimensions",set:function set(halfDimensions){this._halfDimensions=halfDimensions},get:function get(){return this._halfDimensions}},{key:"center",set:function set(center){this._center=center},get:function get(){return this._center}},{key:"aabbSpace",set:function set(aabbSpace){this._aaBBspace=aabbSpace;this._init()},get:function get(){return this._aaBBspace}},{key:"mesh",set:function set(mesh){this._mesh=mesh},get:function get(){return this._mesh}},{key:"geometry",set:function set(geometry){this._geometry=geometry},get:function get(){return this._geometry}}]);return HelpersSlice}((0,_helpersMaterial2.default)(THREE.Object3D));exports.default=HelpersSlice},{"../../src/geometries/geometries.slice":99,"../../src/helpers/helpers.material.mixin":105,"../../src/shaders/shaders.data.fragment":132,"../../src/shaders/shaders.data.uniform":133,"../../src/shaders/shaders.data.vertex":134}],108:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i=dimensions||this._index<0){this._outOfBounds=true}else{this._outOfBounds=false}}},{key:"_prepareStack",value:function _prepareStack(){if(!this._stack.prepared){this._stack.prepare()}if(!this._stack.packed){this._stack.pack()}}},{key:"_prepareBBox",value:function _prepareBBox(){this._bBox=new _helpers4.default(this._stack);this.add(this._bBox)}},{key:"_prepareBorder",value:function _prepareBorder(){this._border=new _helpers2.default(this._slice);this.add(this._border)}},{key:"_prepareSlice",value:function _prepareSlice(){var halfDimensionsIJK=this._stack.halfDimensionsIJK;this._index=this._prepareSliceIndex(halfDimensionsIJK);var position=this._prepareSlicePosition(halfDimensionsIJK,this._index);var direction=this._prepareDirection(this._orientation);this._slice=new _helpers6.default(this._stack,this._index,position,direction);this.add(this._slice)}},{key:"_prepareSliceIndex",value:function _prepareSliceIndex(indices){var index=0;switch(this._orientation){case 0:index=Math.floor(indices.z);break;case 1:index=Math.floor(indices.x);break;case 2:index=Math.floor(indices.y);break;default:break}return index}},{key:"_prepareSlicePosition",value:function _prepareSlicePosition(rPosition,index){var position=new THREE.Vector3(0,0,0);switch(this._orientation){case 0:position=new THREE.Vector3(Math.floor(rPosition.x),Math.floor(rPosition.y),index);break;case 1:position=new THREE.Vector3(index,Math.floor(rPosition.y),Math.floor(rPosition.z));break;case 2:position=new THREE.Vector3(Math.floor(rPosition.x),index,Math.floor(rPosition.z));break;default:break}return position}},{key:"_prepareDirection",value:function _prepareDirection(orientation){var direction=new THREE.Vector3(0,0,1);switch(orientation){case 0:direction=new THREE.Vector3(0,0,1);break;case 1:direction=new THREE.Vector3(1,0,0);break;case 2:direction=new THREE.Vector3(0,1,0);break;default:break}return direction}},{key:"stack",get:function get(){return this._stack}},{key:"bbox",get:function get(){return this._bBox}},{key:"slice",get:function get(){return this._slice}},{key:"border",get:function get(){return this._border}},{key:"index",get:function get(){return this._index},set:function set(index){this._index=index;this._slice.index=index;var halfDimensions=this._stack.halfDimensionsIJK;this._slice.planePosition=this._prepareSlicePosition(halfDimensions,this._index);this._border.helpersSlice=this._slice;this._isIndexOutOfBounds()}},{key:"orientation",set:function set(orientation){this._orientation=orientation;this._slice.planeDirection=this._prepareDirection(this._orientation);this._border.helpersSlice=this._slice},get:function get(){return this._orientation}},{key:"outOfBounds",set:function set(outOfBounds){this._outOfBounds=outOfBounds},get:function get(){return this._outOfBounds}}]);return HelpersStack}(THREE.Object3D);exports.default=HelpersStack},{"../../src/helpers/helpers.border":101,"../../src/helpers/helpers.boundingbox":102,"../../src/helpers/helpers.slice":107}],109:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:null;var stack=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;_classCallCheck(this,HelpersVoxel);var _this=_possibleConstructorReturn(this,(HelpersVoxel.__proto__||Object.getPrototypeOf(HelpersVoxel)).call(this));_this._stack=stack;_this._worldCoordinates=worldCoordinates;_this._voxel=new _models4.default;_this._voxel.id=_this.id;_this._voxel.worldCoordinates=_this._worldCoordinates;if(_this._stack&&_this._stack.prepared&&_this._worldCoordinates){_this.updateVoxel(_this._worldCoordinates)}_this._mesh=null;_this._geometry=null;_this._material=null;_this._selected=false;_this._active=false;_this._hover=false;_this._distance=null;_this._showVoxel=true;_this._showDomSVG=true;_this._showDomMeasurements=true;_this._color="#00B0FF";_this._svgPointer=' ';_this.createMesh();return _this}_createClass(HelpersVoxel,[{key:"updateVoxel",value:function updateVoxel(worldCoordinates){this._voxel.worldCoordinates=worldCoordinates;this._voxel.dataCoordinates=_models2.default.worldToData(this._stack,this._voxel.worldCoordinates);var value=_models2.default.value(this._stack,this._voxel.dataCoordinates);this._voxel.value=_models2.default.valueRescaleSlopeIntercept(value,this._stack.rescaleSlope,this._stack.rescaleIntercept)}},{key:"updateVoxelScreenCoordinates",value:function updateVoxelScreenCoordinates(camera,container){this._voxel.screenCoordinates=HelpersVoxel.worldToScreen(this._worldCoordinates,camera,container)}},{key:"createMesh",value:function createMesh(){var dataCoordinates=_models2.default.worldToData(this._stack,this._worldCoordinates);this._geometry=new _geometries2.default(dataCoordinates);this._material=new THREE.MeshBasicMaterial({wireframe:true,wireframeLinewidth:2});this._material.color.set(this._color);this._mesh=new THREE.Mesh(this._geometry,this._material);this._mesh.applyMatrix(this._stack.ijk2LPS);this._mesh.visible=this._showVoxel;this.add(this._mesh)}},{key:"createDom",value:function createDom(){var measurementsContainer=this._createDiv("VJSVoxelMeasurements",this.id,"VJSVoxelMeasurements");var rasContainer=this._createDiv("VJSVoxelProbeWorld",this.id,"VJSVoxelProbeWorld");measurementsContainer.appendChild(rasContainer);var ijkContainer=this._createDiv("VJSVoxelProbeData",this.id,"VJSVoxelProbeData");measurementsContainer.appendChild(ijkContainer);var valueContainer=this._createDiv("VJSVoxelProbeValue",this.id,"VJSVoxelProbeValue");measurementsContainer.appendChild(valueContainer);var svgContainer=this._createDiv("VJSVoxelProbeSVG",this.id,"VJSVoxelProbeSVG");svgContainer.innerHTML=this._svgPointer;var domElement=this._createDiv("VJSWidgetVoxelProbe",this.id,"VJSWidgetVoxelProbe");domElement.appendChild(svgContainer);domElement.appendChild(measurementsContainer);return domElement}},{key:"updateDom",value:function updateDom(container){if(document.getElementById("VJSVoxelProbeWorld"+this.id)===null){container.appendChild(this.createDom())}var rasContainer=document.getElementById("VJSVoxelProbeWorld"+this.id);var rasContent=this._voxel.worldCoordinates.x.toFixed(2)+" : "+this._voxel.worldCoordinates.y.toFixed(2)+" : "+this._voxel.worldCoordinates.z.toFixed(2);rasContainer.innerHTML="LPS: "+rasContent;var ijkContainer=document.getElementById("VJSVoxelProbeData"+this.id);var ijkContent=this._voxel.dataCoordinates.x+" : "+this._voxel.dataCoordinates.y+" : "+this._voxel.dataCoordinates.z;ijkContainer.innerHTML="IJK: "+ijkContent;var valueContainer=document.getElementById("VJSVoxelProbeValue"+this.id);var valueContent=this._voxel.value;valueContainer.innerHTML="Value: "+valueContent;var selectedElement=document.getElementById("VJSWidgetVoxelProbe"+this.id);selectedElement.style.top=this._voxel.screenCoordinates.y;selectedElement.style.left=this._voxel.screenCoordinates.x;this.updateDomClass(selectedElement)}},{key:"updateDomClass",value:function updateDomClass(){var element=document.getElementById("VJSWidgetVoxelProbe"+this.id);if(this._active===true){element.classList.add("VJSVoxelProbeActive")}else{element.classList.remove("VJSVoxelProbeActive")}if(this._hover===true){element.classList.add("VJSVoxelProbeHover")}else{element.classList.remove("VJSVoxelProbeHover")}if(this._selected===true){element.classList.add("VJSVoxelProbeSelect")}else{element.classList.remove("VJSVoxelProbeSelect")}this.updateDomElementDisplay("VJSVoxelMeasurements"+this.id,this._showDomMeasurements);this.updateDomElementDisplay("VJSVoxelProbeSVG"+this.id,this._showDomSVG)}},{key:"updateDomElementDisplay",value:function updateDomElementDisplay(id,show){if(show){document.getElementById(id).style.display="block"}else{document.getElementById(id).style.display="none"}}},{key:"removeTest",value:function removeTest(){var node=document.getElementById("VJSWidgetVoxelProbe"+this.id);if(node.parentNode){node.parentNode.removeChild(node)}this.remove(this._mesh);this._mesh.geometry.dispose();this._mesh.material.dispose();this._mesh=null}},{key:"_createDiv",value:function _createDiv(idPrefix,idSuffix,className){var divContainer=document.createElement("div");divContainer.setAttribute("id",idPrefix+idSuffix);divContainer.setAttribute("class",className);return divContainer}},{key:"color",set:function set(color){this._color=color;if(this._material){this._material.color.set(this._color)}var selectedElement=document.getElementById("VJSVoxelMeasurements"+this.id);if(selectedElement){selectedElement.style.borderColor=this._color.replace("0x","#")}selectedElement=document.querySelector("#VJSVoxelProbeSVG"+this.id+"> svg > path");if(selectedElement){selectedElement.style.stroke=this._color.replace("0x","#")}},get:function get(){return this._color}},{key:"worldCoordinates",set:function set(worldCoordinates){this._worldCoordinates=worldCoordinates;this._voxel._worldCoordinates=worldCoordinates;this.updateVoxel(this._worldCoordinates);if(this._mesh&&this._mesh.geometry){this._mesh.geometry.location=this._voxel.dataCoordinates}},get:function get(){return this._worldCoordinates}},{key:"voxel",get:function get(){return this._voxel},set:function set(voxel){this._voxel=voxel}},{key:"showVoxel",set:function set(showVoxel){this._showVoxel=showVoxel;if(this._mesh){this._mesh.visible=this._showVoxel}},get:function get(){return this._showVoxel}},{key:"showDomSVG",set:function set(showDomSVG){this._showDomSVG=showDomSVG;this.updateDomClass()},get:function get(){return this._showDomSVG}},{key:"showDomMeasurements",set:function set(showDomMeasurements){this._showDomMeasurements=showDomMeasurements;this.updateDomClass()},get:function get(){return this._showDomMeasurements}},{key:"distance",set:function set(distance){this._distance=distance},get:function get(){return this._distance}},{key:"selected",set:function set(selected){this._selected=selected},get:function get(){return this._selected}},{key:"hover",set:function set(hover){this._hover=hover},get:function get(){return this._hover}},{key:"active",set:function set(active){this._active=active},get:function get(){return this._active}}],[{key:"worldToScreen",value:function worldToScreen(worldCoordinate,camera,canvas){var screenCoordinates=worldCoordinate.clone();screenCoordinates.project(camera);screenCoordinates.x=Math.round((screenCoordinates.x+1)*canvas.offsetWidth/2);screenCoordinates.y=Math.round((-screenCoordinates.y+1)*canvas.offsetHeight/2);screenCoordinates.z=0;return screenCoordinates}}]);return HelpersVoxel}(THREE.Object3D);exports.default=HelpersVoxel},{"../../src/geometries/geometries.voxel":100,"../../src/models/models.stack":118,"../../src/models/models.voxel":119}],111:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:document.body;var helpersProgress=arguments.length>1&&arguments[1]!==undefined?arguments[1]:_helpers2.default;_classCallCheck(this,LoadersBase);this._loaded=-1;this._totalLoaded=-1;this._parsed=-1;this._totalParsed=-1;this._container=container;this._helpersProgressBar=helpersProgress;this._progressBar=null;if(this._container&&this._helpersProgressBar){this._progressBar=new helpersProgress(this._container)}}_createClass(LoadersBase,[{key:"free",value:function free(){this._container=null;this._helpersProgressBar=null;if(this._progressBar){this._progressBar.free();this._progressBar=null}}},{key:"fetch",value:function fetch(url){var _this=this;return new Promise(function(resolve,reject){var request=new XMLHttpRequest;request.open("GET",url);request.crossOrigin=true;request.responseType="arraybuffer";request.onload=function(event){if(request.status===200){_this._loaded=event.loaded;_this._totalLoaded=event.total;if(_this._progressBar){_this._progressBar.update(_this._loaded,_this._totalLoaded,"load")}var buffer=request.response;var response={url:url,buffer:buffer};resolve(response)}else{reject(request.statusText)}};request.onerror=function(){reject(request.statusText)};request.onprogress=function(event){_this._loaded=event.loaded;_this._totalLoaded=event.total;if(_this._progressBar){_this._progressBar.update(_this._loaded,_this._totalLoaded,"load")}};request.send()})}}]);return LoadersBase}();exports.default=LoadersBase},{"../../src/helpers/helpers.progressbar":106,"../../src/models/models.frame":115,"../../src/models/models.series":117,"../../src/models/models.stack":118}],112:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _loaders=require("./loaders.volume");var _loaders2=_interopRequireDefault(_loaders);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Volume:_loaders2.default}},{"./loaders.volume":113}],113:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&yCos.length()>0){cosines[0]=xCos;cosines[1]=yCos;cosines[2]=new THREE.Vector3(0,0,0).crossVectors(cosines[0],cosines[1]).normalize()}}else{window.console.log("No valid image orientation for frame");window.console.log(this);window.console.log("Returning default orientation.")}if(!this._rightHanded){cosines[2].negate()}return cosines}},{key:"spacingXY",value:function spacingXY(){var spacingXY=[1,1];if(this.pixelSpacing){spacingXY[0]=this.pixelSpacing[0];spacingXY[1]=this.pixelSpacing[1]}else if(this.pixelAspectRatio){spacingXY[0]=1;spacingXY[1]=1*this.pixelAspectRatio[1]/this.pixelAspectRatio[0]}return spacingXY}},{key:"value",value:function value(column,row){return this.pixelData[column+this._columns*row]}},{key:"_compareArrays",value:function _compareArrays(reference,target){if(reference===target){return true}if(reference&&target&&reference.join()===target.join()){return true}return false}},{key:"rows",get:function get(){return this._rows},set:function set(rows){this._rows=rows}},{key:"columns",get:function get(){return this._columns},set:function set(columns){this._columns=columns}},{key:"spacingBetweenSlices",get:function get(){return this._spacingBetweenSlices},set:function set(spacingBetweenSlices){this._spacingBetweenSlices=spacingBetweenSlices}},{key:"sliceThickness",get:function get(){return this._sliceThickness},set:function set(sliceThickness){this._sliceThickness=sliceThickness}},{key:"imagePosition",get:function get(){return this._imagePosition},set:function set(imagePosition){this._imagePosition=imagePosition}},{key:"imageOrientation",get:function get(){return this._imageOrientation},set:function set(imageOrientation){this._imageOrientation=imageOrientation}},{key:"windowWidth",get:function get(){return this._windowWidth},set:function set(windowWidth){this._windowWidth=windowWidth}},{key:"windowCenter",get:function get(){return this._windowCenter},set:function set(windowCenter){this._windowCenter=windowCenter}},{key:"rescaleSlope",get:function get(){return this._rescaleSlope},set:function set(rescaleSlope){this._rescaleSlope=rescaleSlope}},{key:"rescaleIntercept",get:function get(){return this._rescaleIntercept},set:function set(rescaleIntercept){this._rescaleIntercept=rescaleIntercept}},{key:"bitsAllocated",get:function get(){return this._bitsAllocated},set:function set(bitsAllocated){this._bitsAllocated=bitsAllocated}},{key:"dist",get:function get(){return this._dist},set:function set(dist){this._dist=dist}},{key:"pixelSpacing",get:function get(){return this._pixelSpacing},set:function set(pixelSpacing){this._pixelSpacing=pixelSpacing}},{key:"pixelAspectRatio",get:function get(){return this._pixelAspectRatio},set:function set(pixelAspectRatio){this._pixelAspectRatio=pixelAspectRatio}},{key:"minMax",get:function get(){return this._minMax},set:function set(minMax){this._minMax=minMax}},{key:"dimensionIndexValues",get:function get(){return this._dimensionIndexValues},set:function set(dimensionIndexValues){this._dimensionIndexValues=dimensionIndexValues}},{key:"instanceNumber",get:function get(){return this._instanceNumber},set:function set(instanceNumber){this._instanceNumber=instanceNumber}},{key:"pixelData",get:function get(){return this._pixelData},set:function set(pixelData){this._pixelData=pixelData}},{key:"sopInstanceUID",set:function set(sopInstanceUID){this._sopInstanceUID=sopInstanceUID},get:function get(){return this._sopInstanceUID; +this._uniforms.uPixelType.value=this._stack.pixelType;this._uniforms.uBitsAllocated.value=this._stack.bitsAllocated;this._uniforms.uPackedPerPixel.value=this._stack.packedPerPixel;this._uniforms.uWindowCenterWidth.value=[this._stack.windowCenter,this._stack.windowWidth*.8];this._uniforms.uRescaleSlopeIntercept.value=[this._stack.rescaleSlope,this._stack.rescaleIntercept];this._uniforms.uDataDimensions.value=[this._stack.dimensionsIJK.x,this._stack.dimensionsIJK.y,this._stack.dimensionsIJK.z];this._uniforms.uInterpolation.value=this._interpolation;this._createMaterial({side:THREE.FrontSide,transparent:true})}},{key:"_prepareGeometry",value:function _prepareGeometry(){var worldBBox=this._stack.worldBoundingBox();var centerLPS=this._stack.worldCenter();this._geometry=new THREE.BoxGeometry(worldBBox[1]-worldBBox[0],worldBBox[3]-worldBBox[2],worldBBox[5]-worldBBox[4]);this._geometry.applyMatrix((new THREE.Matrix4).makeTranslation(centerLPS.x,centerLPS.y,centerLPS.z))}},{key:"uniforms",get:function get(){return this._uniforms},set:function set(uniforms){this._uniforms=uniforms}},{key:"stack",get:function get(){return this._stack},set:function set(stack){this._stack=stack}},{key:"interpolation",get:function get(){return this._interpolation},set:function set(interpolation){this._interpolation=interpolation;this._uniforms.uInterpolation.value=this._interpolation;this._updateMaterial()}}]);return HelpersVolumeRendering}((0,_helpersMaterial2.default)(THREE.Object3D));exports.default=HelpersVolumeRendering},{"../../src/helpers/helpers.material.mixin":105,"../../src/shaders/shaders.vr.fragment":139,"../../src/shaders/shaders.vr.uniform":140,"../../src/shaders/shaders.vr.vertex":141}],110:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:null;var stack=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;_classCallCheck(this,HelpersVoxel);var _this=_possibleConstructorReturn(this,(HelpersVoxel.__proto__||Object.getPrototypeOf(HelpersVoxel)).call(this));_this._stack=stack;_this._worldCoordinates=worldCoordinates;_this._voxel=new _models4.default;_this._voxel.id=_this.id;_this._voxel.worldCoordinates=_this._worldCoordinates;if(_this._stack&&_this._stack.prepared&&_this._worldCoordinates){_this.updateVoxel(_this._worldCoordinates)}_this._mesh=null;_this._geometry=null;_this._material=null;_this._selected=false;_this._active=false;_this._hover=false;_this._distance=null;_this._showVoxel=true;_this._showDomSVG=true;_this._showDomMeasurements=true;_this._color="#00B0FF";_this._svgPointer=' ';_this.createMesh();return _this}_createClass(HelpersVoxel,[{key:"updateVoxel",value:function updateVoxel(worldCoordinates){this._voxel.worldCoordinates=worldCoordinates;this._voxel.dataCoordinates=_models2.default.worldToData(this._stack,this._voxel.worldCoordinates);var value=_models2.default.value(this._stack,this._voxel.dataCoordinates);this._voxel.value=_models2.default.valueRescaleSlopeIntercept(value,this._stack.rescaleSlope,this._stack.rescaleIntercept)}},{key:"updateVoxelScreenCoordinates",value:function updateVoxelScreenCoordinates(camera,container){this._voxel.screenCoordinates=HelpersVoxel.worldToScreen(this._worldCoordinates,camera,container)}},{key:"createMesh",value:function createMesh(){var dataCoordinates=_models2.default.worldToData(this._stack,this._worldCoordinates);this._geometry=new _geometries2.default(dataCoordinates);this._material=new THREE.MeshBasicMaterial({wireframe:true,wireframeLinewidth:2});this._material.color.set(this._color);this._mesh=new THREE.Mesh(this._geometry,this._material);this._mesh.applyMatrix(this._stack.ijk2LPS);this._mesh.visible=this._showVoxel;this.add(this._mesh)}},{key:"createDom",value:function createDom(){var measurementsContainer=this._createDiv("VJSVoxelMeasurements",this.id,"VJSVoxelMeasurements");var rasContainer=this._createDiv("VJSVoxelProbeWorld",this.id,"VJSVoxelProbeWorld");measurementsContainer.appendChild(rasContainer);var ijkContainer=this._createDiv("VJSVoxelProbeData",this.id,"VJSVoxelProbeData");measurementsContainer.appendChild(ijkContainer);var valueContainer=this._createDiv("VJSVoxelProbeValue",this.id,"VJSVoxelProbeValue");measurementsContainer.appendChild(valueContainer);var svgContainer=this._createDiv("VJSVoxelProbeSVG",this.id,"VJSVoxelProbeSVG");svgContainer.innerHTML=this._svgPointer;var domElement=this._createDiv("VJSWidgetVoxelProbe",this.id,"VJSWidgetVoxelProbe");domElement.appendChild(svgContainer);domElement.appendChild(measurementsContainer);return domElement}},{key:"updateDom",value:function updateDom(container){if(document.getElementById("VJSVoxelProbeWorld"+this.id)===null){container.appendChild(this.createDom())}var rasContainer=document.getElementById("VJSVoxelProbeWorld"+this.id);var rasContent=this._voxel.worldCoordinates.x.toFixed(2)+" : "+this._voxel.worldCoordinates.y.toFixed(2)+" : "+this._voxel.worldCoordinates.z.toFixed(2);rasContainer.innerHTML="LPS: "+rasContent;var ijkContainer=document.getElementById("VJSVoxelProbeData"+this.id);var ijkContent=this._voxel.dataCoordinates.x+" : "+this._voxel.dataCoordinates.y+" : "+this._voxel.dataCoordinates.z;ijkContainer.innerHTML="IJK: "+ijkContent;var valueContainer=document.getElementById("VJSVoxelProbeValue"+this.id);var valueContent=this._voxel.value;valueContainer.innerHTML="Value: "+valueContent;var selectedElement=document.getElementById("VJSWidgetVoxelProbe"+this.id);selectedElement.style.top=this._voxel.screenCoordinates.y;selectedElement.style.left=this._voxel.screenCoordinates.x;this.updateDomClass(selectedElement)}},{key:"updateDomClass",value:function updateDomClass(){var element=document.getElementById("VJSWidgetVoxelProbe"+this.id);if(this._active===true){element.classList.add("VJSVoxelProbeActive")}else{element.classList.remove("VJSVoxelProbeActive")}if(this._hover===true){element.classList.add("VJSVoxelProbeHover")}else{element.classList.remove("VJSVoxelProbeHover")}if(this._selected===true){element.classList.add("VJSVoxelProbeSelect")}else{element.classList.remove("VJSVoxelProbeSelect")}this.updateDomElementDisplay("VJSVoxelMeasurements"+this.id,this._showDomMeasurements);this.updateDomElementDisplay("VJSVoxelProbeSVG"+this.id,this._showDomSVG)}},{key:"updateDomElementDisplay",value:function updateDomElementDisplay(id,show){if(show){document.getElementById(id).style.display="block"}else{document.getElementById(id).style.display="none"}}},{key:"removeTest",value:function removeTest(){var node=document.getElementById("VJSWidgetVoxelProbe"+this.id);if(node.parentNode){node.parentNode.removeChild(node)}this.remove(this._mesh);this._mesh.geometry.dispose();this._mesh.material.dispose();this._mesh=null}},{key:"_createDiv",value:function _createDiv(idPrefix,idSuffix,className){var divContainer=document.createElement("div");divContainer.setAttribute("id",idPrefix+idSuffix);divContainer.setAttribute("class",className);return divContainer}},{key:"color",set:function set(color){this._color=color;if(this._material){this._material.color.set(this._color)}var selectedElement=document.getElementById("VJSVoxelMeasurements"+this.id);if(selectedElement){selectedElement.style.borderColor=this._color.replace("0x","#")}selectedElement=document.querySelector("#VJSVoxelProbeSVG"+this.id+"> svg > path");if(selectedElement){selectedElement.style.stroke=this._color.replace("0x","#")}},get:function get(){return this._color}},{key:"worldCoordinates",set:function set(worldCoordinates){this._worldCoordinates=worldCoordinates;this._voxel._worldCoordinates=worldCoordinates;this.updateVoxel(this._worldCoordinates);if(this._mesh&&this._mesh.geometry){this._mesh.geometry.location=this._voxel.dataCoordinates}},get:function get(){return this._worldCoordinates}},{key:"voxel",get:function get(){return this._voxel},set:function set(voxel){this._voxel=voxel}},{key:"showVoxel",set:function set(showVoxel){this._showVoxel=showVoxel;if(this._mesh){this._mesh.visible=this._showVoxel}},get:function get(){return this._showVoxel}},{key:"showDomSVG",set:function set(showDomSVG){this._showDomSVG=showDomSVG;this.updateDomClass()},get:function get(){return this._showDomSVG}},{key:"showDomMeasurements",set:function set(showDomMeasurements){this._showDomMeasurements=showDomMeasurements;this.updateDomClass()},get:function get(){return this._showDomMeasurements}},{key:"distance",set:function set(distance){this._distance=distance},get:function get(){return this._distance}},{key:"selected",set:function set(selected){this._selected=selected},get:function get(){return this._selected}},{key:"hover",set:function set(hover){this._hover=hover},get:function get(){return this._hover}},{key:"active",set:function set(active){this._active=active},get:function get(){return this._active}}],[{key:"worldToScreen",value:function worldToScreen(worldCoordinate,camera,canvas){var screenCoordinates=worldCoordinate.clone();screenCoordinates.project(camera);screenCoordinates.x=Math.round((screenCoordinates.x+1)*canvas.offsetWidth/2);screenCoordinates.y=Math.round((-screenCoordinates.y+1)*canvas.offsetHeight/2);screenCoordinates.z=0;return screenCoordinates}}]);return HelpersVoxel}(THREE.Object3D);exports.default=HelpersVoxel},{"../../src/geometries/geometries.voxel":100,"../../src/models/models.stack":118,"../../src/models/models.voxel":119}],111:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:document.body;var helpersProgress=arguments.length>1&&arguments[1]!==undefined?arguments[1]:_helpers2.default;_classCallCheck(this,LoadersBase);this._loaded=-1;this._totalLoaded=-1;this._parsed=-1;this._totalParsed=-1;this._container=container;this._helpersProgressBar=helpersProgress;this._progressBar=null;if(this._container&&this._helpersProgressBar){this._progressBar=new helpersProgress(this._container)}}_createClass(LoadersBase,[{key:"free",value:function free(){this._container=null;this._helpersProgressBar=null;if(this._progressBar){this._progressBar.free();this._progressBar=null}}},{key:"fetch",value:function fetch(url){var _this=this;return new Promise(function(resolve,reject){var request=new XMLHttpRequest;request.open("GET",url);request.crossOrigin=true;request.responseType="arraybuffer";request.onload=function(event){if(request.status===200){_this._loaded=event.loaded;_this._totalLoaded=event.total;if(_this._progressBar){_this._progressBar.update(_this._loaded,_this._totalLoaded,"load")}var buffer=request.response;var response={url:url,buffer:buffer};resolve(response)}else{reject(request.statusText)}};request.onerror=function(){reject(request.statusText)};request.onprogress=function(event){_this._loaded=event.loaded;_this._totalLoaded=event.total;if(_this._progressBar){_this._progressBar.update(_this._loaded,_this._totalLoaded,"load")}};request.send()})}}]);return LoadersBase}();exports.default=LoadersBase},{"../../src/helpers/helpers.progressbar":106,"../../src/models/models.frame":115,"../../src/models/models.series":117,"../../src/models/models.stack":118}],112:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _loaders=require("./loaders.volume");var _loaders2=_interopRequireDefault(_loaders);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Volume:_loaders2.default}},{"./loaders.volume":113}],113:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&yCos.length()>0){cosines[0]=xCos;cosines[1]=yCos;cosines[2]=new THREE.Vector3(0,0,0).crossVectors(cosines[0],cosines[1]).normalize()}}else{window.console.log("No valid image orientation for frame");window.console.log(this);window.console.log("Returning default orientation.")}if(!this._rightHanded){cosines[2].negate()}return cosines}},{key:"spacingXY",value:function spacingXY(){var spacingXY=[1,1];if(this.pixelSpacing){spacingXY[0]=this.pixelSpacing[0];spacingXY[1]=this.pixelSpacing[1]}else if(this.pixelAspectRatio){spacingXY[0]=1;spacingXY[1]=1*this.pixelAspectRatio[1]/this.pixelAspectRatio[0]}return spacingXY}},{key:"value",value:function value(column,row){return this.pixelData[column+this._columns*row]}},{key:"_compareArrays",value:function _compareArrays(reference,target){if(reference===target){return true}if(reference&&target&&reference.join()===target.join()){return true}return false}},{key:"rows",get:function get(){return this._rows},set:function set(rows){this._rows=rows}},{key:"columns",get:function get(){return this._columns},set:function set(columns){this._columns=columns}},{key:"spacingBetweenSlices",get:function get(){return this._spacingBetweenSlices},set:function set(spacingBetweenSlices){this._spacingBetweenSlices=spacingBetweenSlices}},{key:"sliceThickness",get:function get(){return this._sliceThickness},set:function set(sliceThickness){this._sliceThickness=sliceThickness}},{key:"imagePosition",get:function get(){return this._imagePosition},set:function set(imagePosition){this._imagePosition=imagePosition}},{key:"imageOrientation",get:function get(){return this._imageOrientation},set:function set(imageOrientation){this._imageOrientation=imageOrientation}},{key:"windowWidth",get:function get(){return this._windowWidth},set:function set(windowWidth){this._windowWidth=windowWidth}},{key:"windowCenter",get:function get(){return this._windowCenter},set:function set(windowCenter){this._windowCenter=windowCenter}},{key:"rescaleSlope",get:function get(){return this._rescaleSlope},set:function set(rescaleSlope){this._rescaleSlope=rescaleSlope}},{key:"rescaleIntercept",get:function get(){return this._rescaleIntercept},set:function set(rescaleIntercept){this._rescaleIntercept=rescaleIntercept}},{key:"bitsAllocated",get:function get(){return this._bitsAllocated},set:function set(bitsAllocated){this._bitsAllocated=bitsAllocated}},{key:"dist",get:function get(){return this._dist},set:function set(dist){this._dist=dist}},{key:"pixelSpacing",get:function get(){return this._pixelSpacing},set:function set(pixelSpacing){this._pixelSpacing=pixelSpacing}},{key:"pixelAspectRatio",get:function get(){return this._pixelAspectRatio},set:function set(pixelAspectRatio){this._pixelAspectRatio=pixelAspectRatio}},{key:"minMax",get:function get(){return this._minMax},set:function set(minMax){this._minMax=minMax}},{key:"dimensionIndexValues",get:function get(){return this._dimensionIndexValues},set:function set(dimensionIndexValues){this._dimensionIndexValues=dimensionIndexValues}},{key:"instanceNumber",get:function get(){return this._instanceNumber},set:function set(instanceNumber){this._instanceNumber=instanceNumber}},{key:"pixelData",get:function get(){return this._pixelData},set:function set(pixelData){this._pixelData=pixelData}},{key:"sopInstanceUID",set:function set(sopInstanceUID){this._sopInstanceUID=sopInstanceUID},get:function get(){return this._sopInstanceUID; }},{key:"pixelType",get:function get(){return this._pixelType},set:function set(pixelType){this._pixelType=pixelType}},{key:"url",get:function get(){return this._url},set:function set(url){this._url=url}},{key:"referencedSegmentNumber",get:function get(){return this._referencedSegmentNumber},set:function set(referencedSegmentNumber){this._referencedSegmentNumber=referencedSegmentNumber}},{key:"rightHanded",get:function get(){return this._rightHanded},set:function set(rightHanded){this._rightHanded=rightHanded}}]);return ModelsFrame}(_models2.default);exports.default=ModelsFrame},{"../../src/models/models.base":114}],116:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _models=require("./models.frame");var _models2=_interopRequireDefault(_models);var _models3=require("./models.stack");var _models4=_interopRequireDefault(_models3);var _models5=require("./models.series");var _models6=_interopRequireDefault(_models5);var _models7=require("./models.voxel");var _models8=_interopRequireDefault(_models7);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Frame:_models2.default,Stack:_models4.default,Series:_models6.default,Voxel:_models8.default}},{"./models.frame":115,"./models.series":117,"./models.stack":118,"./models.voxel":119}],117:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0){this._numberOfFrames=this._frame.length}else{window.console.log("_frame doesn't contain anything....");window.console.log(this._frame);return false}this._rows=this._frame[0].rows;this._columns=this._frame[0].columns;this._dimensionsIJK=new THREE.Vector3(this._columns,this._rows,this._numberOfFrames);this._halfDimensionsIJK=new THREE.Vector3(this._dimensionsIJK.x/2,this._dimensionsIJK.y/2,this._dimensionsIJK.z/2);this._spacingBetweenSlices=this._frame[0].spacingBetweenSlices;this._sliceThickness=this._frame[0].sliceThickness;this.computeCosines();this.orderFrames();this.computeSpacing();if(!this._frame[0].imagePosition){this._frame[0].imagePosition=[0,0,0]}if(!this._frame[0].imageOrientation){this._frame[0].imageOrientation=[1,0,0,0,1,0]}this._origin=this._vector3FromArray(this._frame[0].imagePosition,0);this.computeIJK2LPS();this.computeLPS2AABB();this._rescaleSlope=this._frame[0].rescaleSlope||1;this._rescaleIntercept=this._frame[0].rescaleIntercept||0;this.computeMinMaxIntensities();this._minMax[0]=ModelsStack.valueRescaleSlopeIntercept(this._minMax[0],this._rescaleSlope,this._rescaleIntercept);this._minMax[1]=ModelsStack.valueRescaleSlopeIntercept(this._minMax[1],this._rescaleSlope,this._rescaleIntercept);var width=this._frame[0].windowWidth||this._minMax[1]-this._minMax[0];this._windowWidth=this._rescaleSlope*width+this._rescaleIntercept;var center=this._frame[0].windowCenter||this._minMax[0]+width/2;this._windowCenter=this._rescaleSlope*center+this._rescaleIntercept;this._bitsAllocated=this._frame[0].bitsAllocated;this._prepared=true}},{key:"packEchos",value:function packEchos(){var echos=4;var packedEcho=[];for(var i=0;i1){if(this._spacingBetweenSlices){this._spacing.z=this._spacingBetweenSlices}else if(this._frame[0].pixelSpacing&&this._frame[0].pixelSpacing[2]){this._spacing.z=this._frame[0].pixelSpacing[2]}else{this._frame.map(this._computeDistanceArrayMap.bind(null,this._zCosine));this._frame.sort(this._sortDistanceArraySort);this._spacing.z=this._frame[1].dist-this._frame[0].dist}}if(this._spacing.z===0){this._spacing.z=1}}},{key:"xySpacing",value:function xySpacing(){if(this._frame&&this._frame[0]){var spacingXY=this._frame[0].spacingXY();this._spacing.x=spacingXY[0];this._spacing.y=spacingXY[1]}}},{key:"computeMinMaxIntensities",value:function computeMinMaxIntensities(){for(var i=0;inbVoxels){voxelIndexStop=nbVoxels}for(var ii=0;iinbVoxels){voxelIndexStop=nbVoxels}}this._packed=true}},{key:"_packTo8Bits",value:function _packTo8Bits(bits,pixelType,channels,frame,textureSize,startVoxel,stopVoxel){var packed={textureType:null,data:null};var packIndex=0;var frameIndex=0;var inFrameIndex=0;var frameDimension=frame[0].rows*frame[0].columns;var data=null;if(bits===8&&channels===1||bits===1){var _data=new Uint8Array(textureSize*textureSize*1);for(var i=startVoxel;i>>8&255;packIndex++;coordinate=Math.floor(packIndex/2);channelOffset=packIndex%2}packed.textureType=THREE.RGBAFormat;packed.data=_data2}else if(bits===32&&channels===1&&pixelType===0){var _data3=new Uint8Array(textureSize*textureSize*4);for(var _i4=startVoxel;_i4>>8&255;_data3[4*packIndex+2]=_raw>>>8&255;_data3[4*packIndex+3]=_raw>>>8&255;packIndex++}packed.textureType=THREE.RGBAFormat;packed.data=_data3}else if(bits===32&&channels===1&&pixelType===1){var _data4=new Uint8Array(textureSize*textureSize*4);for(var _i5=startVoxel;_i5parseInt(b.dimensionIndexValues[i],10)){return 1}if(parseInt(a.dimensionIndexValues[i],10)=0&&ijkCoordinate.z=0&&index.y>=0&&index.z>=0&&index.x0){segmentationCodeDesignator=element.items[0].dataSet.string("x00080102");segmentationCodeValue=element.items[0].dataSet.string("x00080100");segmentationCodeMeaning=element.items[0].dataSet.string("x00080104")}return{segmentationCodeDesignator:segmentationCodeDesignator,segmentationCodeValue:segmentationCodeValue,segmentationCodeMeaning:segmentationCodeMeaning}}},{key:"_recommendedDisplayCIELab",value:function _recommendedDisplayCIELab(segment){if(!segment.dataSet.elements.x0062000d){return null}var offset=segment.dataSet.elements.x0062000d.dataOffset;var length=segment.dataSet.elements.x0062000d.length;var byteArray=segment.dataSet.byteArray.slice(offset,offset+length);var CIELabScaled=new Uint16Array(length/2);for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:0;var sopInstanceUID=this._findStringEverywhere("x2005140f","x00080018",frameIndex);return sopInstanceUID}},{key:"transferSyntaxUID",value:function transferSyntaxUID(){return this._dataSet.string("x00020010")}},{key:"photometricInterpretation",value:function photometricInterpretation(){return this._dataSet.string("x00280004")}},{key:"planarConfiguration",value:function planarConfiguration(){var planarConfiguration=this._dataSet.uint16("x00280006");if(typeof planarConfiguration==="undefined"){planarConfiguration=null}return planarConfiguration}},{key:"samplesPerPixel",value:function samplesPerPixel(){return this._dataSet.uint16("x00280002")}},{key:"numberOfFrames",value:function numberOfFrames(){var numberOfFrames=this._dataSet.intString("x00280008");if(typeof numberOfFrames==="undefined"){numberOfFrames=null}return numberOfFrames}},{key:"numberOfChannels",value:function numberOfChannels(){var numberOfChannels=1;var photometricInterpretation=this.photometricInterpretation();if(!(photometricInterpretation!=="RGB"&&photometricInterpretation!=="PALETTE COLOR"&&photometricInterpretation!=="YBR_FULL"&&photometricInterpretation!=="YBR_FULL_422"&&photometricInterpretation!=="YBR_PARTIAL_422"&&photometricInterpretation!=="YBR_PARTIAL_420"&&photometricInterpretation!=="YBR_RCT")){numberOfChannels=3}return numberOfChannels}},{key:"invert",value:function invert(){var photometricInterpretation=this.photometricInterpretation();return photometricInterpretation==="MONOCHROME1"?true:false}},{key:"imageOrientation",value:function imageOrientation(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var imageOrientation=this._findStringEverywhere("x00209116","x00200037",frameIndex);if(imageOrientation){imageOrientation=imageOrientation.split("\\").map(Number)}return imageOrientation}},{key:"referencedSegmentNumber",value:function referencedSegmentNumber(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var referencedSegmentNumber=-1;var referencedSegmentNumberElement=this._findInGroupSequence("x52009230","x0062000a",frameIndex);if(referencedSegmentNumberElement!==null){referencedSegmentNumber=referencedSegmentNumberElement.uint16("x0062000b")}return referencedSegmentNumber}},{key:"pixelAspectRatio",value:function pixelAspectRatio(){var pixelAspectRatio=[this._dataSet.intString("x00280034",0),this._dataSet.intString("x00280034",1)];if(typeof pixelAspectRatio[0]==="undefined"){pixelAspectRatio=null}return pixelAspectRatio}},{key:"imagePosition",value:function imagePosition(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var imagePosition=this._findStringEverywhere("x00209113","x00200032",frameIndex);if(imagePosition){imagePosition=imagePosition.split("\\").map(Number)}return imagePosition}},{key:"instanceNumber",value:function instanceNumber(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var instanceNumber=null;var perFrameFunctionnalGroupSequence=this._dataSet.elements.x52009230;if(typeof perFrameFunctionnalGroupSequence!=="undefined"){if(perFrameFunctionnalGroupSequence.items[frameIndex].dataSet.elements.x2005140f){var planeOrientationSequence=perFrameFunctionnalGroupSequence.items[frameIndex].dataSet.elements.x2005140f.items[0].dataSet;instanceNumber=planeOrientationSequence.intString("x00200013")}else{instanceNumber=this._dataSet.intString("x00200013");if(typeof instanceNumber==="undefined"){instanceNumber=null}}}else{instanceNumber=this._dataSet.intString("x00200013");if(typeof instanceNumber==="undefined"){instanceNumber=null}}return instanceNumber}},{key:"pixelSpacing",value:function pixelSpacing(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var pixelSpacing=this._findStringEverywhere("x00289110","x00280030",frameIndex);if(pixelSpacing){pixelSpacing=pixelSpacing.split("\\").map(Number)}return pixelSpacing}},{key:"rows",value:function rows(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var rows=this._dataSet.uint16("x00280010");if(typeof rows==="undefined"){rows=null}return rows}},{key:"columns",value:function columns(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var columns=this._dataSet.uint16("x00280011");if(typeof columns==="undefined"){columns=null}return columns}},{key:"pixelType",value:function pixelType(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return 0}},{key:"pixelRepresentation",value:function pixelRepresentation(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var pixelRepresentation=this._dataSet.uint16("x00280103");return pixelRepresentation}},{key:"bitsAllocated",value:function bitsAllocated(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var bitsAllocated=this._dataSet.uint16("x00280100");return bitsAllocated}},{key:"highBit",value:function highBit(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var highBit=this._dataSet.uint16("x00280102");return highBit}},{key:"rescaleIntercept",value:function rescaleIntercept(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._findFloatStringInFrameGroupSequence("x00289145","x00281052",frameIndex)}},{key:"rescaleSlope",value:function rescaleSlope(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._findFloatStringInFrameGroupSequence("x00289145","x00281053",frameIndex)}},{key:"windowCenter",value:function windowCenter(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._findFloatStringInFrameGroupSequence("x00289132","x00281050",frameIndex)}},{key:"windowWidth",value:function windowWidth(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._findFloatStringInFrameGroupSequence("x00289132","x00281051",frameIndex)}},{key:"sliceThickness",value:function sliceThickness(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._findFloatStringInFrameGroupSequence("x00289110","x00180050",frameIndex)}},{key:"dimensionIndexValues",value:function dimensionIndexValues(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var dimensionIndexValues=[];var perFrameFunctionnalGroupSequence=this._dataSet.elements.x52009230;if(typeof perFrameFunctionnalGroupSequence!=="undefined"){var philipsPrivateSequence=perFrameFunctionnalGroupSequence.items[frameIndex].dataSet.elements.x00209111.items[0].dataSet;var element=philipsPrivateSequence.elements.x00209157;var nbValues=element.length/4;for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:0;var inStackPositionNumber=null;var perFrameFunctionnalGroupSequence=this._dataSet.elements.x52009230;if(typeof perFrameFunctionnalGroupSequence!=="undefined"){var philipsPrivateSequence=perFrameFunctionnalGroupSequence.items[frameIndex].dataSet.elements.x00209111.items[0].dataSet;inStackPositionNumber=philipsPrivateSequence.uint32("x00209057")}else{inStackPositionNumber=null}console.log("instack position "+inStackPositionNumber);return inStackPositionNumber}},{key:"stackID",value:function stackID(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var stackID=null;var perFrameFunctionnalGroupSequence=this._dataSet.elements.x52009230;if(typeof perFrameFunctionnalGroupSequence!=="undefined"){var philipsPrivateSequence=perFrameFunctionnalGroupSequence.items[frameIndex].dataSet.elements.x00209111.items[0].dataSet;stackID=philipsPrivateSequence.intString("x00209056")}else{stackID=null}return stackID}},{key:"extractPixelData",value:function extractPixelData(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var decompressedData=this._decodePixelData(frameIndex);var numberOfChannels=this.numberOfChannels();if(numberOfChannels>1){return this._convertColorSpace(decompressedData)}else{return decompressedData}}},{key:"minMaxPixelData",value:function minMaxPixelData(){var pixelData=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var minMax=[65535,-32768];var numPixels=pixelData.length;for(var index=0;index0&&arguments[0]!==undefined?arguments[0]:0;var transferSyntaxUID=this.transferSyntaxUID();if(transferSyntaxUID==="1.2.840.10008.1.2.4.90"||transferSyntaxUID==="1.2.840.10008.1.2.4.91"){return this._decodeJ2K(frameIndex)}else if(transferSyntaxUID==="1.2.840.10008.1.2.4.57"||transferSyntaxUID==="1.2.840.10008.1.2.4.70"){return this._decodeJPEGLossless(frameIndex)}else if(transferSyntaxUID==="1.2.840.10008.1.2.4.50"||transferSyntaxUID==="1.2.840.10008.1.2.4.51"){return this._decodeJPEGBaseline(frameIndex)}else if(transferSyntaxUID==="1.2.840.10008.1.2"||transferSyntaxUID==="1.2.840.10008.1.2.1"){return this._decodeUncompressed(frameIndex)}else if(transferSyntaxUID==="1.2.840.10008.1.2.2"){var frame=this._decodeUncompressed(frameIndex);return this._swapFrame(frame)}else{throw"no decoder for transfer syntax "+transferSyntaxUID}}},{key:"_decodeJ2K",value:function _decodeJ2K(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var encodedPixelData=DicomParser.readEncapsulatedPixelData(this._dataSet,this._dataSet.elements.x7fe00010,frameIndex);var jpxImage=new Jpx;jpxImage.parse(encodedPixelData);var componentsCount=jpxImage.componentsCount;if(componentsCount!==1){throw"JPEG2000 decoder returned a componentCount of ${componentsCount}, when 1 is expected"}var tileCount=jpxImage.tiles.length;if(tileCount!==1){throw"JPEG2000 decoder returned a tileCount of ${tileCount}, when 1 is expected"}var tileComponents=jpxImage.tiles[0];var pixelData=tileComponents.items;return pixelData}},{key:"_decodeJPEGLossless",value:function _decodeJPEGLossless(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var encodedPixelData=DicomParser.readEncapsulatedPixelData(this._dataSet,this._dataSet.elements.x7fe00010,frameIndex);var pixelRepresentation=this.pixelRepresentation(frameIndex);var bitsAllocated=this.bitsAllocated(frameIndex);var byteOutput=bitsAllocated<=8?1:2;var decoder=new Jpeg.lossless.Decoder;var decompressedData=decoder.decode(encodedPixelData.buffer,encodedPixelData.byteOffset,encodedPixelData.length,byteOutput);if(pixelRepresentation===0){if(byteOutput===2){return new Uint16Array(decompressedData.buffer)}else{return new Uint8Array(decompressedData.buffer)}}else{return new Int16Array(decompressedData.buffer)}}},{key:"_decodeJPEGBaseline",value:function _decodeJPEGBaseline(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var encodedPixelData=DicomParser.readEncapsulatedPixelData(this._dataSet,this._dataSet.elements.x7fe00010,frameIndex);var rows=this.rows(frameIndex);var columns=this.columns(frameIndex);var bitsAllocated=this.bitsAllocated(frameIndex);var jpegBaseline=new JpegBaseline;jpegBaseline.parse(encodedPixelData);if(bitsAllocated===8){return jpegBaseline.getData(columns,rows)}else if(bitsAllocated===16){return jpegBaseline.getData16(columns,rows)}}},{key:"_decodeUncompressed",value:function _decodeUncompressed(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var pixelRepresentation=this.pixelRepresentation(frameIndex);var bitsAllocated=this.bitsAllocated(frameIndex);var pixelDataElement=this._dataSet.elements.x7fe00010;var pixelDataOffset=pixelDataElement.dataOffset;var numberOfChannels=this.numberOfChannels();var numPixels=this.rows(frameIndex)*this.columns(frameIndex)*numberOfChannels;var frameOffset=0;var buffer=this._dataSet.byteArray.buffer;if(pixelRepresentation===0&&bitsAllocated===8){frameOffset=pixelDataOffset+frameIndex*numPixels;return new Uint8Array(buffer,frameOffset,numPixels)}else if(pixelRepresentation===0&&bitsAllocated===16){frameOffset=pixelDataOffset+frameIndex*numPixels*2;return new Uint16Array(buffer,frameOffset,numPixels)}else if(pixelRepresentation===1&&bitsAllocated===16){frameOffset=pixelDataOffset+frameIndex*numPixels*2;return new Int16Array(buffer,frameOffset,numPixels)}else if(pixelRepresentation===0&&bitsAllocated===32){frameOffset=pixelDataOffset+frameIndex*numPixels*4;return new Uint32Array(buffer,frameOffset,numPixels)}else if(pixelRepresentation===0&&bitsAllocated===1){var newBuffer=new ArrayBuffer(numPixels);var newArray=new Uint8Array(newBuffer);frameOffset=pixelDataOffset+frameIndex*numPixels;var index=0;var bitStart=frameIndex*numPixels;var bitEnd=frameIndex*numPixels+numPixels;var byteStart=Math.floor(bitStart/8);var bitStartOffset=bitStart-byteStart*8;var byteEnd=Math.ceil(bitEnd/8);var targetBuffer=new Uint8Array(buffer,pixelDataOffset);for(var i=byteStart;i<=byteEnd;i++){while(bitStartOffset<8){switch(bitStartOffset){case 0:newArray[index]=targetBuffer[i]&1;break;case 1:newArray[index]=targetBuffer[i]>>>1&1;break;case 2:newArray[index]=targetBuffer[i]>>>2&1;break;case 3:newArray[index]=targetBuffer[i]>>>3&1;break;case 4:newArray[index]=targetBuffer[i]>>>4&1;break;case 5:newArray[index]=targetBuffer[i]>>>5&1;break;case 6:newArray[index]=targetBuffer[i]>>>6&1;break;case 7:newArray[index]=targetBuffer[i]>>>7&1;break;default:break}bitStartOffset++;index++;if(index>=numPixels){return newArray}}bitStartOffset=0}}}},{key:"_convertColorSpace",value:function _convertColorSpace(uncompressedData){var rgbData=null;var photometricInterpretation=this.photometricInterpretation();var planarConfiguration=this.planarConfiguration();if(photometricInterpretation==="RGB"&&planarConfiguration===0){rgbData=uncompressedData}else if(photometricInterpretation==="RGB"&&planarConfiguration===1){if(uncompressedData instanceof Int8Array){rgbData=new Int8Array(uncompressedData.length)}else if(uncompressedData instanceof Uint8Array){rgbData=new Uint8Array(uncompressedData.length)}else if(uncompressedData instanceof Int16Array){rgbData=new Int16Array(uncompressedData.length)}else if(uncompressedData instanceof Uint16Array){rgbData=new Uint16Array(uncompressedData.length)}else{throw"unsuported typed array: ${uncompressedData}"}var numPixels=uncompressedData.length/3;var rgbaIndex=0;var rIndex=0;var gIndex=numPixels;var bIndex=numPixels*2;for(var i=0;i=5){numberOfChannels=this._dataSet.dims[5];this._ordered=false}else if(this._dataSet.datatypeCode===128){numberOfChannels=3}else if(this._dataSet.datatypeCode===2304){numberOfChannels=4}return numberOfChannels}},{key:"sopInstanceUID",value:function sopInstanceUID(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return frameIndex}},{key:"rows",value:function rows(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.dims[2]}},{key:"columns",value:function columns(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.dims[1]}},{key:"pixelType",value:function pixelType(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var pixelType=0;if(this._dataSet.datatypeCode===16||this._dataSet.datatypeCode===64||this._dataSet.datatypeCode===1536){pixelType=1}return pixelType}},{key:"bitsAllocated",value:function bitsAllocated(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.numBitsPerVoxel}},{key:"pixelSpacing",value:function pixelSpacing(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return[this._dataSet.pixDims[1],this._dataSet.pixDims[2],this._dataSet.pixDims[3]]}},{key:"sliceThickness",value:function sliceThickness(){return null}},{key:"imageOrientation",value:function imageOrientation(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;if(this._dataSet.qform_code>0){var a=0,b=this._dataSet.quatern_b,c=this._dataSet.quatern_c,d=this._dataSet.quatern_d;a=1-(b*b+c*c+d*d);if(a<1e-7){a=1/Math.sqrt(b*b+c*c+d*d);b*=a;c*=a;d*=a;a=0}else{a=Math.sqrt(a)}if(this._dataSet.pixDims[0]<0){this._rightHanded=false}return[-(a*a+b*b-c*c-d*d),-2*(b*c+a*d),2*(b*d-a*c),-2*(b*c-a*d),-(a*a+c*c-b*b-d*d),2*(c*d+a*b)]}else if(this._dataSet.sform_code>0){console.log("sform > 0");var sx=this._dataSet.srow_x,sy=this._dataSet.srow_y,sz=this._dataSet.srow_z}else if(this._dataSet.qform_code===0){console.log("qform === 0")}return[1,0,0,0,1,0]}},{key:"imagePosition",value:function imagePosition(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return[-this._dataSet.qoffset_x,-this._dataSet.qoffset_y,this._dataSet.qoffset_z]}},{key:"dimensionIndexValues",value:function dimensionIndexValues(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"instanceNumber",value:function instanceNumber(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return frameIndex}},{key:"windowCenter",value:function windowCenter(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"windowWidth",value:function windowWidth(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"rescaleSlope",value:function rescaleSlope(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.scl_slope}},{key:"rescaleIntercept",value:function rescaleIntercept(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.scl_intercept}},{key:"minMaxPixelData",value:function minMaxPixelData(){var pixelData=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var minMax=[65535,-32768];var numPixels=pixelData.length;for(var index=0;index0&&arguments[0]!==undefined?arguments[0]:0;return this._decompressUncompressed(frameIndex)}},{key:"_decompressUncompressed",value:function _decompressUncompressed(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var numberOfChannels=this.numberOfChannels();var numPixels=this.rows(frameIndex)*this.columns(frameIndex)*numberOfChannels;if(!this.rightHanded()){frameIndex=this.numberOfFrames()-1-frameIndex}var frameOffset=frameIndex*numPixels;var buffer=this._niftiImage;if(!this._ordered&&this._orderedData===null){this._reorderData()}if(this._orderedData!==null){return this._orderedData.slice(frameOffset,frameOffset+numPixels)}else if(this._dataSet.datatypeCode===2){return new Uint8Array(buffer,frameOffset,numPixels)}else if(this._dataSet.datatypeCode===256){return new Int8Array(buffer,frameOffset,numPixels)}else if(this._dataSet.datatypeCode===512){frameOffset=frameOffset*2;return new Uint16Array(buffer,frameOffset,numPixels)}else if(this._dataSet.datatypeCode===4){frameOffset=frameOffset*2;return new Int16Array(buffer,frameOffset,numPixels)}else if(this._dataSet.datatypeCode===16){frameOffset=frameOffset*4;return new Float32Array(buffer,frameOffset,numPixels)}}},{key:"_reorderData",value:function _reorderData(){window.console.log("re-order");var numberOfChannels=this.numberOfChannels();var numPixels=this.rows()*this.columns()*numberOfChannels;var buffer=this._niftiImage;var totalNumPixels=numPixels*this.numberOfFrames();var tmp=null;this._orderedData=null;if(this._dataSet.datatypeCode===2){tmp=new Uint8Array(buffer,0,totalNumPixels);this._orderedData=new Uint8Array(tmp.length)}else if(this._dataSet.datatypeCode===256){tmp=new Int8Array(buffer,0,totalNumPixels);this._orderedData=new Int8Array(tmp.length)}else if(this._dataSet.datatypeCode===512){tmp=new Uint16Array(buffer,0,totalNumPixels);this._orderedData=new Uint16Array(tmp.length)}else if(this._dataSet.datatypeCode===4){tmp=new Int16Array(buffer,0,totalNumPixels);this._orderedData=new Int16Array(tmp.length)}else if(this._dataSet.datatypeCode===16){tmp=new Float32Array(buffer,0,totalNumPixels);this._orderedData=new Float32Array(tmp.length)}var numPixels2=tmp.length/3;var rgbaIndex=0;var rIndex=0;var gIndex=numPixels2;var bIndex=numPixels2*2;for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:0;return frameIndex}},{key:"rows",value:function rows(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.sizes[1]}},{key:"columns",value:function columns(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.sizes[0]}},{key:"pixelType",value:function pixelType(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var pixelType=0;if(this._dataSet.type==="float"){pixelType=1}return pixelType}},{key:"bitsAllocated",value:function bitsAllocated(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var bitsAllocated=1;if(this._dataSet.type==="int8"||this._dataSet.type==="uint8"||this._dataSet.type==="char"){bitsAllocated=8}else if(this._dataSet.type==="int16"||this._dataSet.type==="uint16"||this._dataSet.type==="short"){bitsAllocated=16}else if(this._dataSet.type==="int32"||this._dataSet.type==="uint32"||this._dataSet.type==="float"){bitsAllocated=32}return bitsAllocated}},{key:"pixelSpacing",value:function pixelSpacing(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var x=new THREE.Vector3(this._dataSet.spaceDirections[0][0],this._dataSet.spaceDirections[0][1],this._dataSet.spaceDirections[0][2]);var y=new THREE.Vector3(this._dataSet.spaceDirections[1][0],this._dataSet.spaceDirections[1][1],this._dataSet.spaceDirections[1][2]);var z=new THREE.Vector3(this._dataSet.spaceDirections[2][0],this._dataSet.spaceDirections[2][1],this._dataSet.spaceDirections[2][2]);return[x.length(),y.length(),z.length()]}},{key:"sliceThickness",value:function sliceThickness(){return null}},{key:"imageOrientation",value:function imageOrientation(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var invertX=this._dataSet.space.match(/right/)?-1:1;var invertY=this._dataSet.space.match(/anterior/)?-1:1;var x=new THREE.Vector3(this._dataSet.spaceDirections[0][0]*invertX,this._dataSet.spaceDirections[0][1]*invertY,this._dataSet.spaceDirections[0][2]);x.normalize();var y=new THREE.Vector3(this._dataSet.spaceDirections[1][0]*invertX,this._dataSet.spaceDirections[1][1]*invertY,this._dataSet.spaceDirections[1][2]);y.normalize();return[x.x,x.y,x.z,y.x,y.y,y.z]}},{key:"imagePosition",value:function imagePosition(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return[this._dataSet.spaceOrigin[0],this._dataSet.spaceOrigin[1],this._dataSet.spaceOrigin[2]]}},{key:"dimensionIndexValues",value:function dimensionIndexValues(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"instanceNumber",value:function instanceNumber(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return frameIndex}},{key:"windowCenter",value:function windowCenter(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"windowWidth",value:function windowWidth(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"rescaleSlope",value:function rescaleSlope(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return 1}},{key:"rescaleIntercept",value:function rescaleIntercept(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return 0}},{key:"minMaxPixelData",value:function minMaxPixelData(){var pixelData=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var minMax=[65535,-32768];var numPixels=pixelData.length;for(var index=0;index0&&arguments[0]!==undefined?arguments[0]:0;return this._decompressUncompressed(frameIndex)}},{key:"_decompressUncompressed",value:function _decompressUncompressed(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var buffer=this._dataSet.buffer;var numberOfChannels=this.numberOfChannels();var numPixels=this.rows(frameIndex)*this.columns(frameIndex)*numberOfChannels;if(!this.rightHanded()){frameIndex=this.numberOfFrames()-1-frameIndex}var frameOffset=frameIndex*numPixels;if(this._unpackedData===null&&this._dataSet.encoding==="gzip"){var unpackedData=pako.inflate(this._dataSet.buffer);this._unpackedData=unpackedData.buffer;buffer=this._unpackedData}else if(this._dataSet.encoding==="gzip"){buffer=this._unpackedData}if(this._dataSet.type==="int8"||this._dataSet.type==="char"){frameOffset=frameOffset;return new Int8Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="uint8"){frameOffset=frameOffset;return new Uint8Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="int16"||this._dataSet.type==="short"){frameOffset=frameOffset*2;return new Int16Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="uint16"){frameOffset=frameOffset*2;return new Uint16Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="int32"){frameOffset=frameOffset*4;return new Int32Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="uint32"){frameOffset=frameOffset*4;return new Uint32Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="float"){frameOffset=frameOffset*4;return new Float32Array(buffer,frameOffset,numPixels)}}}]);return ParsersNifti}(_parsers2.default);exports.default=ParsersNifti},{"./parsers.volume":124,"nrrd-js":50,pako:51}],124:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i>8&255}},{key:"_swap32",value:function _swap32(val){return(val&255)<<24|(val&65280)<<8|val>>8&65280|val>>24&255}},{key:"invert",value:function invert(){return false}}]);return ParsersVolume}();exports.default=ParsersVolume},{}],125:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:this._base;var rayOrigin=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this._rayOrigin;var rayDirection=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this._rayDirection;var aabbMin=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this._aabbMin;var aabbMax=arguments.length>4&&arguments[4]!==undefined?arguments[4]:this._aabbMax;var tNear=arguments.length>5&&arguments[5]!==undefined?arguments[5]:this._tNear;var tFar=arguments.length>6&&arguments[6]!==undefined?arguments[6]:this._tFar;var intersect=arguments.length>7&&arguments[7]!==undefined?arguments[7]:this._intersect;this._base=baseFragment;return this.compute(rayOrigin,rayDirection,aabbMin,aabbMax,tNear,tFar,intersect)}},{key:"compute",value:function compute(rayOrigin,rayDirection,aabbMin,aabbMax,tNear,tFar,intersect){this.computeDefinition();this._base._functions[this._name]=this._definition;return this._name+"("+rayOrigin+", "+rayDirection+", "+aabbMin+", "+aabbMax+", "+tNear+", "+tFar+", "+intersect+");"}},{key:"computeDefinition",value:function computeDefinition(){this._definition="\nvoid "+this._name+"(vec3 rayOrigin, vec3 rayDirection, vec3 boxMin, vec3 boxMax, out float tNear, out float tFar, out bool intersect){\n // compute intersection of ray with all six bbox planes\n vec3 invRay = vec3(1.) / rayDirection;\n vec3 tBot = invRay * (boxMin - rayOrigin);\n vec3 tTop = invRay * (boxMax - rayOrigin);\n // re-order intersections to find smallest and largest on each axis\n vec3 tMin = min(tTop, tBot);\n vec3 tMax = max(tTop, tBot);\n // find the largest tMin and the smallest tMax\n float largest_tMin = max(max(tMin.x, tMin.y), max(tMin.x, tMin.z));\n float smallest_tMax = min(min(tMax.x, tMax.y), min(tMax.x, tMax.z));\n tNear = largest_tMin;\n tFar = smallest_tMax;\n intersect = smallest_tMax > largest_tMin;\n}\n\n "}}]);return IntersectBox}(_shaders2.default);exports.default=new IntersectBox},{"../shaders.base":131}],126:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:this._base;var dataCoordinates=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this._dataCoordinates;var dataValue=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this._dataValue;var offset=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this._offset;this._base=baseFragment;return this.compute(dataCoordinates,dataValue,offset)}},{key:"compute",value:function compute(dataCoordinates,dataValue,offset){this.computeDefinition();this._base._functions[this._name]=this._definition;return this._name+"("+dataCoordinates+", "+dataValue+", "+offset+");"}},{key:"computeDefinition",value:function computeDefinition(){this._definition="\nvoid "+this._name+"(in ivec3 dataCoordinates, out vec4 dataValue, out int offset){\n \n int index = dataCoordinates.x\n + dataCoordinates.y * uDataDimensions.x\n + dataCoordinates.z * uDataDimensions.y * uDataDimensions.x;\n int indexP = int(index/uPackedPerPixel);\n offset = index - 2*indexP;\n\n // Map data index to right sampler2D texture\n int voxelsPerTexture = uTextureSize*uTextureSize;\n int textureIndex = int(floor(float(indexP) / float(voxelsPerTexture)));\n // modulo seems incorrect sometimes...\n // int inTextureIndex = int(mod(float(index), float(textureSize*textureSize)));\n int inTextureIndex = indexP - voxelsPerTexture*textureIndex;\n\n // Get row and column in the texture\n int colIndex = int(mod(float(inTextureIndex), float(uTextureSize)));\n int rowIndex = int(floor(float(inTextureIndex)/float(uTextureSize)));\n\n // Map row and column to uv\n vec2 uv = vec2(0,0);\n uv.x = (0.5 + float(colIndex)) / float(uTextureSize);\n uv.y = 1. - (0.5 + float(rowIndex)) / float(uTextureSize);\n\n //\n if(textureIndex == 0){ dataValue = texture2D(uTextureContainer[0], uv); }\n else if(textureIndex == 1){dataValue = texture2D(uTextureContainer[1], uv);}\n else if(textureIndex == 2){ dataValue = texture2D(uTextureContainer[2], uv); }\n else if(textureIndex == 3){ dataValue = texture2D(uTextureContainer[3], uv); }\n else if(textureIndex == 4){ dataValue = texture2D(uTextureContainer[4], uv); }\n else if(textureIndex == 5){ dataValue = texture2D(uTextureContainer[5], uv); }\n else if(textureIndex == 6){ dataValue = texture2D(uTextureContainer[6], uv); }\n\n}\n "}}]);return Texture3d}(_shaders2.default);exports.default=new Texture3d},{"../shaders.base":131}],127:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:this._base;var packedData=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this._packedData;var offset=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this._offset;var unpackedData=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this._unpackedData;this._base=baseFragment;return this.compute(packedData,offset,unpackedData)}},{key:"compute",value:function compute(packedData,offset,unpackedData){this.computeDefinition();this._base._functions[this._name]=this._definition;return this._name+"("+packedData+", "+offset+", "+unpackedData+");"}},{key:"computeDefinition",value:function computeDefinition(){var content="";if(this._base._uniforms.uNumberOfChannels.value===1){switch(this._base._uniforms.uBitsAllocated.value){case 1:case 8:content=this.upack8();break;case 16:content=this.upack16();break;case 32:content=this.upack32();break;default:content=this.upackDefault();break}}else{content=this.upackIdentity()}this._definition="\nvoid "+this._name+"(in vec4 packedData, in int offset, out vec4 unpackedData){\n\n"+content+"\n\n} \n "}},{key:"upack8",value:function upack8(){this._base._functions["uInt8"]=this.uInt8();return"\nuInt8(\n packedData.r,\n unpackedData.x);\n "}},{key:"upack16",value:function upack16(){this._base._functions["uInt16"]=this.uInt16();return"\nuInt16(\n packedData.r * float( 1 - offset) + packedData.b * float(offset),\n packedData.g * float( 1 - offset) + packedData.a * float(offset),\n unpackedData.x);\n "}},{key:"upack32",value:function upack32(){if(this._base._uniforms.uPixelType.value===0){this._base._functions["uInt32"]=this.uInt32();return"\nuInt32(\n packedData.r,\n packedData.g,\n packedData.b,\n packedData.a,\n unpackedData.x);\n "}else{this._base._functions["uFloat32"]=this.uFloat32();return"\nuFloat32(\n packedData.r,\n packedData.g,\n packedData.b,\n packedData.a,\n unpackedData.x);\n "}}},{key:"upackIdentity",value:function upackIdentity(){return"\n\nunpackedData = packedData;\n\n "}},{key:"uInt8",value:function uInt8(){return"\nvoid uInt8(in float r, out float value){\n value = r * 256.;\n}\n "}},{key:"uInt16",value:function uInt16(){return"\nvoid uInt16(in float r, in float a, out float value){\n value = r * 256. + a * 65536.;\n}\n "}},{key:"uInt32",value:function uInt32(){return"\nvoid uInt32(in float r, in float g, in float b, in float a, out float value){\n value = r * 256. + g * 65536. + b * 16777216. + a * 4294967296.;\n}\n "}},{key:"uFloat32",value:function uFloat32(){return"\nvoid uFloat32(in float r, in float g, in float b, in float a, out float value){\n\n // create arrays containing bits for rgba values\n // value between 0 and 255\n value = r * 255.;\n int bytemeR[8];\n bytemeR[0] = int(floor(value / 128.));\n value -= float(bytemeR[0] * 128);\n bytemeR[1] = int(floor(value / 64.));\n value -= float(bytemeR[1] * 64);\n bytemeR[2] = int(floor(value / 32.));\n value -= float(bytemeR[2] * 32);\n bytemeR[3] = int(floor(value / 16.));\n value -= float(bytemeR[3] * 16);\n bytemeR[4] = int(floor(value / 8.));\n value -= float(bytemeR[4] * 8);\n bytemeR[5] = int(floor(value / 4.));\n value -= float(bytemeR[5] * 4);\n bytemeR[6] = int(floor(value / 2.));\n value -= float(bytemeR[6] * 2);\n bytemeR[7] = int(floor(value));\n\n value = g * 255.;\n int bytemeG[8];\n bytemeG[0] = int(floor(value / 128.));\n value -= float(bytemeG[0] * 128);\n bytemeG[1] = int(floor(value / 64.));\n value -= float(bytemeG[1] * 64);\n bytemeG[2] = int(floor(value / 32.));\n value -= float(bytemeG[2] * 32);\n bytemeG[3] = int(floor(value / 16.));\n value -= float(bytemeG[3] * 16);\n bytemeG[4] = int(floor(value / 8.));\n value -= float(bytemeG[4] * 8);\n bytemeG[5] = int(floor(value / 4.));\n value -= float(bytemeG[5] * 4);\n bytemeG[6] = int(floor(value / 2.));\n value -= float(bytemeG[6] * 2);\n bytemeG[7] = int(floor(value));\n\n value = b * 255.;\n int bytemeB[8];\n bytemeB[0] = int(floor(value / 128.));\n value -= float(bytemeB[0] * 128);\n bytemeB[1] = int(floor(value / 64.));\n value -= float(bytemeB[1] * 64);\n bytemeB[2] = int(floor(value / 32.));\n value -= float(bytemeB[2] * 32);\n bytemeB[3] = int(floor(value / 16.));\n value -= float(bytemeB[3] * 16);\n bytemeB[4] = int(floor(value / 8.));\n value -= float(bytemeB[4] * 8);\n bytemeB[5] = int(floor(value / 4.));\n value -= float(bytemeB[5] * 4);\n bytemeB[6] = int(floor(value / 2.));\n value -= float(bytemeB[6] * 2);\n bytemeB[7] = int(floor(value));\n\n value = a * 255.;\n int bytemeA[8];\n bytemeA[0] = int(floor(value / 128.));\n value -= float(bytemeA[0] * 128);\n bytemeA[1] = int(floor(value / 64.));\n value -= float(bytemeA[1] * 64);\n bytemeA[2] = int(floor(value / 32.));\n value -= float(bytemeA[2] * 32);\n bytemeA[3] = int(floor(value / 16.));\n value -= float(bytemeA[3] * 16);\n bytemeA[4] = int(floor(value / 8.));\n value -= float(bytemeA[4] * 8);\n bytemeA[5] = int(floor(value / 4.));\n value -= float(bytemeA[5] * 4);\n bytemeA[6] = int(floor(value / 2.));\n value -= float(bytemeA[6] * 2);\n bytemeA[7] = int(floor(value));\n\n // compute float32 value from bit arrays\n\n // sign\n int issigned = 1 - 2 * bytemeR[0];\n // issigned = int(pow(-1., float(bytemeR[0])));\n\n // exponent\n int exponent = 0;\n\n exponent += bytemeR[1] * int(pow(2., 7.));\n exponent += bytemeR[2] * int(pow(2., 6.));\n exponent += bytemeR[3] * int(pow(2., 5.));\n exponent += bytemeR[4] * int(pow(2., 4.));\n exponent += bytemeR[5] * int(pow(2., 3.));\n exponent += bytemeR[6] * int(pow(2., 2.));\n exponent += bytemeR[7] * int(pow(2., 1.));\n\n exponent += bytemeG[0];\n\n\n // fraction\n float fraction = 0.;\n\n fraction = float(bytemeG[1]) * pow(2., -1.);\n fraction += float(bytemeG[2]) * pow(2., -2.);\n fraction += float(bytemeG[3]) * pow(2., -3.);\n fraction += float(bytemeG[4]) * pow(2., -4.);\n fraction += float(bytemeG[5]) * pow(2., -5.);\n fraction += float(bytemeG[6]) * pow(2., -6.);\n fraction += float(bytemeG[7]) * pow(2., -7.);\n\n fraction += float(bytemeB[0]) * pow(2., -8.);\n fraction += float(bytemeB[1]) * pow(2., -9.);\n fraction += float(bytemeB[2]) * pow(2., -10.);\n fraction += float(bytemeB[3]) * pow(2., -11.);\n fraction += float(bytemeB[4]) * pow(2., -12.);\n fraction += float(bytemeB[5]) * pow(2., -13.);\n fraction += float(bytemeB[6]) * pow(2., -14.);\n fraction += float(bytemeB[7]) * pow(2., -15.);\n\n fraction += float(bytemeA[0]) * pow(2., -16.);\n fraction += float(bytemeA[1]) * pow(2., -17.);\n fraction += float(bytemeA[2]) * pow(2., -18.);\n fraction += float(bytemeA[3]) * pow(2., -19.);\n fraction += float(bytemeA[4]) * pow(2., -20.);\n fraction += float(bytemeA[5]) * pow(2., -21.);\n fraction += float(bytemeA[6]) * pow(2., -22.);\n fraction += float(bytemeA[7]) * pow(2., -23.);\n\n value = float(issigned) * pow( 2., float(exponent - 127)) * (1. + fraction);\n}\n "}}]);return Unpack}(_shaders2.default);exports.default=new Unpack},{"../shaders.base":131}],128:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:this._base;var currentVoxel=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this._currentVoxel;var dataValue=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this._dataValue;this._base=baseFragment;return this.compute(currentVoxel,dataValue)}},{key:"compute",value:function compute(currentVoxel,dataValue){this.computeDefinition();this._base._functions[this._name]=this._definition;return this._name+"("+currentVoxel+", "+dataValue+");"}},{key:"computeDefinition",value:function computeDefinition(){this._definition="\nvoid "+this._name+"(in vec3 currentVoxel, out vec4 dataValue){\n // lower bound\n vec3 rcurrentVoxel = vec3(floor(currentVoxel.x + 0.5 ), floor(currentVoxel.y + 0.5 ), floor(currentVoxel.z + 0.5 ));\n ivec3 voxel = ivec3(int(rcurrentVoxel.x), int(rcurrentVoxel.y), int(rcurrentVoxel.z));\n\n vec4 tmp = vec4(0., 0., 0., 0.);\n int offset = 0;\n\n "+_shadersHelpers4.default.api(this._base,"voxel","tmp","offset")+"\n "+_shadersHelpers2.default.api(this._base,"tmp","offset","dataValue")+"\n}\n "}}]);return InterpolationIdentity}(_shaders2.default);exports.default=new InterpolationIdentity},{"../helpers/shaders.helpers.texture3d":126,"../helpers/shaders.helpers.unpack":127,"../shaders.base":131}],129:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _shadersInterpolation=require("./shaders.interpolation.identity");var _shadersInterpolation2=_interopRequireDefault(_shadersInterpolation);var _shadersInterpolation3=require("./shaders.interpolation.trilinear"); From a4916c015923da9421e0679d8056daf228452335 Mon Sep 17 00:00:00 2001 From: Nicolas Rannou Date: Wed, 30 Nov 2016 11:35:10 +0100 Subject: [PATCH 13/17] Add cdnjs badge --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 5e42fabb2..608616623 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,10 @@ Code Climate + + + CDNJS Version Date: Wed, 7 Dec 2016 16:36:26 +0100 Subject: [PATCH 14/17] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 608616623..ff82e8044 100644 --- a/README.md +++ b/README.md @@ -247,7 +247,7 @@ Add AMI in your index.html **after** THREEJS. ``` # index.html - + #app.js From 949e90b312357034b37117c7ded521f89c2b9c7e Mon Sep 17 00:00:00 2001 From: nicolasrannou Date: Fri, 9 Dec 2016 12:50:51 +0100 Subject: [PATCH 15/17] update build system --- package.json | 2 +- scripts/templates/examples.js | 6 +++--- scripts/templates/lessons.js | 13 +++++++------ 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index e520b9f63..1acb017ef 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ }, "config" : { "threeVersion": "r81", - "amiCDN": "https://cdn.rawgit.com/fnndsc/ami/master/build/ami.min.js", + "amiCDN": "https://cdnjs.cloudflare.com/ajax/libs/ami.js/", "gaKey": "UA-39303022-3", "transforms" : "-t [babelify --presets [ es2015 ] ]" }, diff --git a/scripts/templates/examples.js b/scripts/templates/examples.js index cc10f8729..c04c93cbe 100644 --- a/scripts/templates/examples.js +++ b/scripts/templates/examples.js @@ -3,9 +3,9 @@ const packageJSON = require('../../package.json'); class ExampleTemplate{ constructor(options={}) { this.threeVersion = packageJSON.config.threeVersion; - this.name = ''; - this.gaKey = ''; - this.content = ''; + this.name = ''; + this.gaKey = ''; + this.content = packageJSON.config.gaKey; } scripts(){ diff --git a/scripts/templates/lessons.js b/scripts/templates/lessons.js index 2fdd80068..fb4c47b79 100644 --- a/scripts/templates/lessons.js +++ b/scripts/templates/lessons.js @@ -3,11 +3,12 @@ const packageJSON = require('../../package.json'); class LessonTemplate{ constructor(options={}) { this.threeVersion = packageJSON.config.threeVersion; - this.amiCDN = packageJSON.config.amiCDN; - this.name = ''; - this.mode = 'dist'; - this.content = ''; - this.gaKey = packageJSON.config.gaKey; + this.version = packageJSON.version; + this.amiCDN = packageJSON.config.amiCDN; + this.name = ''; + this.mode = 'dist'; + this.content = ''; + this.gaKey = packageJSON.config.gaKey; } scriptsAMI(){ @@ -20,7 +21,7 @@ class LessonTemplate{ else { return(` - + `); } } From bf38a9f2312fb1157218e0b7fcbe5b8aa2871cb7 Mon Sep 17 00:00:00 2001 From: nicolasrannou Date: Wed, 14 Dec 2016 13:58:05 +0100 Subject: [PATCH 16/17] new API for the orthographic camera to allow user easily navigate between default, axial, coronal and sagittal views --- examples/loader_nifti/loader_nifti.js | 3 +- examples/viewers_compare/viewers_compare.js | 11 +- examples/viewers_labelmap/viewers_labelmap.js | 8 +- examples/viewers_upload/viewers_upload.js | 28 +- lessons/03/demo.js | 40 +- lessons/04/demo.js | 8 +- src/cameras/cameras.orthographic.js | 417 ++++++++++++++++-- src/parsers/parsers.nifti.js | 6 +- 8 files changed, 455 insertions(+), 66 deletions(-) diff --git a/examples/loader_nifti/loader_nifti.js b/examples/loader_nifti/loader_nifti.js index b770f323f..d6fd11320 100644 --- a/examples/loader_nifti/loader_nifti.js +++ b/examples/loader_nifti/loader_nifti.js @@ -87,7 +87,7 @@ window.onload = function() { // load vtk file var loader1 = new THREE.VTKLoader(); - loader1.load( '../../data/blood.vtk', function ( geometry ) { + loader1.load( '../../blood1.vtk', function ( geometry ) { geometry.computeVertexNormals(); console.log( geometry ); var material = new THREE.MeshLambertMaterial( { @@ -114,6 +114,7 @@ window.onload = function() { var files = t2.map(function(v) { return 'https://cdn.rawgit.com/FNNDSC/data/master/nifti/fetalatlas_brain/t2/' + v; }); + files = ['../../data/MRBrainTumor1_PIL.nii']; // load sequence for each file let seriesContainer = []; diff --git a/examples/viewers_compare/viewers_compare.js b/examples/viewers_compare/viewers_compare.js index 1978089df..3b821ed15 100644 --- a/examples/viewers_compare/viewers_compare.js +++ b/examples/viewers_compare/viewers_compare.js @@ -125,6 +125,7 @@ function init() { controls = new ControlsOrthographic(camera, threeD); controls.staticMoving = true; controls.noRotate = true; + camera.controls = controls; animate(); } @@ -445,9 +446,9 @@ window.onload = function() { ); // box: {halfDimensions, center} - let bbox = { + let box = { center: stack.worldCenter().clone(), - halfDimensions: new THREE.Vector3(lpsDims.x + 500, lpsDims.y + 500, lpsDims.z + 500) + halfDimensions: new THREE.Vector3(lpsDims.x + 50, lpsDims.y + 50, lpsDims.z + 50) }; // init and zoom @@ -455,7 +456,11 @@ window.onload = function() { width: threeD.clientWidth, height: threeD.clientHeight }; - camera.init(stack.xCosine, stack.yCosine, stack.zCosine, controls, bbox, canvas); + + camera.directions = [stack.xCosine, stack.yCosine, stack.zCosine]; + camera.box = box; + camera.canvas = canvas; + camera.update(); camera.fitBox(2); // CREATE LUT diff --git a/examples/viewers_labelmap/viewers_labelmap.js b/examples/viewers_labelmap/viewers_labelmap.js index b02c68170..205a90072 100644 --- a/examples/viewers_labelmap/viewers_labelmap.js +++ b/examples/viewers_labelmap/viewers_labelmap.js @@ -97,6 +97,7 @@ function init() { controls = new ControlsOrthographic(camera, threeD); controls.staticMoving = true; controls.noRotate = true; + camera.controls = controls; animate(); } @@ -573,7 +574,7 @@ let ds2 = [ ); // box: {halfDimensions, center} - let bbox = { + let box = { center: stack.worldCenter().clone(), halfDimensions: new THREE.Vector3(lpsDims.x + 10, lpsDims.y + 10, lpsDims.z + 10) }; @@ -583,7 +584,10 @@ let ds2 = [ width: threeD.clientWidth, height: threeD.clientHeight }; - camera.init(stack.xCosine, stack.yCosine, stack.zCosine, controls, bbox, canvas); + camera.directions = [stack.xCosine, stack.yCosine, stack.zCosine]; + camera.box = box; + camera.canvas = canvas; + camera.update(); camera.fitBox(2); // CREATE LUT diff --git a/examples/viewers_upload/viewers_upload.js b/examples/viewers_upload/viewers_upload.js index 3f878f383..07d54598a 100644 --- a/examples/viewers_upload/viewers_upload.js +++ b/examples/viewers_upload/viewers_upload.js @@ -20,7 +20,9 @@ let drag = { let camUtils = { invertRows: false, invertColumns: false, - rotate: false + rotate: false, + orientation: 'default', + convention: 'radio' }; // FUNCTIONS @@ -64,6 +66,7 @@ function init() { controls = new ControlsOrthographic(camera, threeD); controls.staticMoving = true; controls.noRotate = true; + camera.controls = controls; animate(); } @@ -137,6 +140,21 @@ window.onload = function() { camera.rotate(); }); + let orientationUpdate = cameraFolder.add(camUtils, 'orientation', ['default', 'axial', 'coronal', 'sagittal']); + orientationUpdate.onChange(function(value) { + camera.orientation = value; + camera.update(); + camera.fitBox(2); + stackHelper.orientation = camera.stackOrientation; + }); + + let conventionUpdate = cameraFolder.add(camUtils, 'convention', ['radio', 'neuro']); + conventionUpdate.onChange(function(value) { + camera.convention = value; + camera.update(); + camera.fitBox(2); + }); + cameraFolder.open(); } @@ -233,7 +251,7 @@ window.onload = function() { ); // box: {halfDimensions, center} - let bbox = { + let box = { center: stack.worldCenter().clone(), halfDimensions: new THREE.Vector3(lpsDims.x + 10, lpsDims.y + 10, lpsDims.z + 10) }; @@ -243,7 +261,11 @@ window.onload = function() { width: threeD.clientWidth, height: threeD.clientHeight }; - camera.init(stack.xCosine, stack.yCosine, stack.zCosine, controls, bbox, canvas); + + camera.directions = [stack.xCosine, stack.yCosine, stack.zCosine]; + camera.box = box; + camera.canvas = canvas; + camera.update(); camera.fitBox(2); buildGUI(stackHelper); diff --git a/lessons/03/demo.js b/lessons/03/demo.js index 152be946b..100e53591 100644 --- a/lessons/03/demo.js +++ b/lessons/03/demo.js @@ -26,6 +26,7 @@ var camera = new CamerasOrthographic(container.clientWidth / -2, container.clien var controls = new ControlsOrthographic(camera, container); controls.staticMoving = true; controls.noRotate = true; +camera.controls = controls; // handle resize function onWindowResize() { @@ -46,8 +47,9 @@ window.addEventListener('resize', onWindowResize, false); function gui(stackHelper){ var gui = new dat.GUI({ - autoPlace: false + autoPlace: false }); + var customContainer = document.getElementById('my-gui-container'); customContainer.appendChild(gui.domElement); // only reason to use this object is to satusfy data.GUI @@ -55,7 +57,9 @@ function gui(stackHelper){ invertRows: false, invertColumns: false, rotate45: false, - rotate: 0 + rotate: 0, + orientation: 'default', + convention: 'radio' }; // camera @@ -77,6 +81,21 @@ function gui(stackHelper){ var rotate = cameraFolder.add(camera, 'angle', 0, 360).step(1).listen(); + let orientationUpdate = cameraFolder.add(camUtils, 'orientation', ['default', 'axial', 'coronal', 'sagittal']); + orientationUpdate.onChange(function(value) { + camera.orientation = value; + camera.update(); + camera.fitBox(2); + stackHelper.orientation = camera.stackOrientation; + }); + + let conventionUpdate = cameraFolder.add(camUtils, 'convention', ['radio', 'neuro']); + conventionUpdate.onChange(function(value) { + camera.convention = value; + camera.update(); + camera.fitBox(2); + }); + cameraFolder.open(); // of course we can do everything from lesson 01! @@ -100,13 +119,7 @@ animate(); // Setup loader var loader = new LoadersVolume(container); - -var t2 = [ - '36444280', '36444294', '36444308', '36444322', '36444336' -]; -var files = t2.map(function(v) { - return 'https://cdn.rawgit.com/FNNDSC/data/master/dicom/adi_brain/' + v; - }); +var files = ['https://cdn.rawgit.com/FNNDSC/data/master/nifti/adi_brain/adi_brain.nii.gz']; // load sequence for each file // 1- fetch @@ -173,7 +186,7 @@ Promise ); // box: {halfDimensions, center} - var bbox = { + var box = { center: stack.worldCenter().clone(), halfDimensions: new THREE.Vector3(lpsDims.x + 10, lpsDims.y + 10, lpsDims.z + 10) }; @@ -183,8 +196,13 @@ Promise width: container.clientWidth, height: container.clientHeight }; - camera.init(stack.xCosine, stack.yCosine, stack.zCosine, controls, bbox, canvas); + + camera.directions = [stack.xCosine, stack.yCosine, stack.zCosine]; + camera.box = box; + camera.canvas = canvas; + camera.update(); camera.fitBox(2); + }) .catch(function(error) { window.console.log('oops... something went wrong...'); diff --git a/lessons/04/demo.js b/lessons/04/demo.js index 8a44e8039..b0582632f 100644 --- a/lessons/04/demo.js +++ b/lessons/04/demo.js @@ -101,6 +101,7 @@ function init() { controls = new ControlsOrthographic(camera, threeD); controls.staticMoving = true; controls.noRotate = true; + camera.controls = controls; animate(); } @@ -388,7 +389,7 @@ function handleSeries() { ); // box: {halfDimensions, center} - var bbox = { + var box = { center: stack.worldCenter().clone(), halfDimensions: new THREE.Vector3(lpsDims.x + 10, lpsDims.y + 10, lpsDims.z + 10) }; @@ -398,7 +399,10 @@ function handleSeries() { width: threeD.clientWidth, height: threeD.clientHeight }; - camera.init(stack.xCosine, stack.yCosine, stack.zCosine, controls, bbox, canvas, stack.referenceSpace); + camera.directions = [stack.xCosine, stack.yCosine, stack.zCosine]; + camera.box = box; + camera.canvas = canvas; + camera.update(); camera.fitBox(2); // CREATE LUT diff --git a/src/cameras/cameras.orthographic.js b/src/cameras/cameras.orthographic.js index 490d19f88..5ecdac09f 100644 --- a/src/cameras/cameras.orthographic.js +++ b/src/cameras/cameras.orthographic.js @@ -18,9 +18,19 @@ export default class CamerasOrthographic extends THREE.OrthographicCamera{ this._front = null; this._back = null; - this._xCosine = null; - this._yCosine = null; - this._zCosine = null; + this._directions = [ + new THREE.Vector3(1, 0, 0), + new THREE.Vector3(0, 1, 0), + new THREE.Vector3(0, 0, 1) + ]; + + this._orientation = 'default'; + this._convention = 'radio'; + this._stackOrientation = 0; + + this._right = null; + this._up = null; + this._direction = null; this._controls = null; this._box = null; @@ -37,6 +47,10 @@ export default class CamerasOrthographic extends THREE.OrthographicCamera{ * Initialize orthographic camera variables */ init( xCosine, yCosine, zCosine, controls, box, canvas ){ + + // DEPRECATED + console.warn('cameras.orthographic.init(...) is deprecated. Use .cosines, .controls, .box and .canvas instead.'); + // if(!(Validators.vector3(xCosine) && Validators.vector3(yCosine) && @@ -48,27 +62,263 @@ export default class CamerasOrthographic extends THREE.OrthographicCamera{ return false; } - this._xCosine = xCosine; - this._yCosine = this._adjustTopDirection( xCosine, yCosine ); - this._zCosine = new THREE.Vector3().crossVectors(this._xCosine, this._yCosine); + this._right = xCosine; + this._up = this._adjustTopDirection( xCosine, yCosine ); + this._direction = new THREE.Vector3().crossVectors(this._right, this._up); this._controls = controls; this._box = box; this._canvas = canvas; let ray = { position: this._box.center, - direction: this._zCosine + direction: this._direction + }; + + let intersections = this._orderIntersections( Intersections.rayBox(ray, this._box), this._direction ); + this._front = intersections[0]; + this._back = intersections[1]; + + // set default values + this.up.set(this._up.x, this._up.y, this._up.z); + this._updateCanvas(); + this._updatePositionAndTarget(this._front, this._back); + this._updateMatrices(); + } + + update(){ + + // http://www.grahamwideman.com/gw/brain/orientation/orientterms.htm + // do magics depending on orientation and convention + // also needs a default mode + + if( this._orientation === 'default' ){ + + switch( this._getMaxIndex( this._directions[2] ) ){ + + case 0: + this._orientation = 'sagittal'; + break; + + case 1: + this._orientation = 'coronal'; + break; + + case 2: + this._orientation = 'axial'; + break; + + default: + this._orientation = 'free'; + break; + } + + } + + if( this._orientation === 'free' ){ + + this._right = this._directions[0]; + this._up = this._directions[1]; + this._direction = this._directions[2]; + + } else { + + // this._directions[2] = new THREE.Vector3().crossVectors( this._directions[0], this._directions[1] ); + + let leftIndex = this.leftDirection(); + let leftDirection = this._directions[leftIndex]; + let posteriorIndex = this.posteriorDirection(); + let posteriorDirection = this._directions[posteriorIndex]; + let superiorIndex = this.superiorDirection(); + let superiorDirection = this._directions[superiorIndex]; + + if( this._convention === 'radio' ){ + + switch( this._orientation ){ + + case 'axial': + // up vector is 'anterior' + if( posteriorDirection.y > 0 ){ + + posteriorDirection.negate(); + + } + + // looking towards superior + if( superiorDirection.z < 0 ){ + + superiorDirection.negate(); + + } + + // + this._right = leftDirection; // does not matter right/left + this._up = posteriorDirection; + this._direction = superiorDirection; + break; + + case 'coronal': + // up vector is 'superior' + if( superiorDirection.z < 0 ){ + + superiorDirection.negate(); + + } + + // looking towards posterior + if( posteriorDirection.y < 0 ){ + + posteriorDirection.negate(); + + } + + // + this._right = leftDirection; // does not matter right/left + this._up = superiorDirection; + this._direction = posteriorDirection; + break; + + case 'sagittal': + // up vector is 'superior' + if( superiorDirection.z < 0 ){ + + superiorDirection.negate(); + + } + + // looking towards right + if( leftDirection.x > 0 ){ + + leftDirection.negate(); + + } + + // + this._right = posteriorDirection; // does not matter right/left + this._up = superiorDirection; + this._direction = leftDirection; + + break; + + default: + console.warn(`"${this._orientation}" orientation is not valid. (choices: axial, coronal, sagittal)`); + break; + + } + + } else if ( this._convention === 'neuro' ){ + + switch( this._orientation ){ + + case 'axial': + // up vector is 'anterior' + if( posteriorDirection.y > 0 ){ + + posteriorDirection.negate(); + + } + + // looking towards inferior + if( superiorDirection.z > 0 ){ + + superiorDirection.negate(); + + } + + // + this._right = leftDirection; // does not matter right/left + this._up = posteriorDirection; + this._direction = superiorDirection; + break; + + case 'coronal': + // up vector is 'superior' + if( superiorDirection.z < 0 ){ + + superiorDirection.negate(); + + } + + // looking towards anterior + if( posteriorDirection.y > 0 ){ + + posteriorDirection.negate(); + + } + + // + this._right = leftDirection; // does not matter right/left + this._up = superiorDirection; + this._direction = posteriorDirection; + break; + + case 'sagittal': + // up vector is 'superior' + if( superiorDirection.z < 0 ){ + + superiorDirection.negate(); + + } + + // looking towards right + if( leftDirection.x > 0 ){ + + leftDirection.negate(); + + } + + // + this._right = posteriorDirection; // does not matter right/left + this._up = superiorDirection; + this._direction = leftDirection; + + break; + + default: + console.warn(`"${this._orientation}" orientation is not valid. (choices: axial, coronal, sagittal)`); + break; + } + + } + else{ + console.warn(`${this._convention} is not valid (choices: radio, neuro)`); + } + + } + + // that is what determines left/right + let ray = { + position: this._box.center, + direction: this._direction }; - let intersections = this._orderIntersections( Intersections.rayBox(ray, this._box), this._zCosine ); + let intersections = this._orderIntersections( Intersections.rayBox(ray, this._box), this._direction ); this._front = intersections[0]; this._back = intersections[1]; // set default values - this.up.set(this._yCosine.x, this._yCosine.y, this._yCosine.z); + this.up.set(this._up.x, this._up.y, this._up.z); this._updateCanvas(); this._updatePositionAndTarget(this._front, this._back); this._updateMatrices(); + + } + + leftDirection(){ + + return this._findMaxIndex( this._directions, 0 ); + + } + + posteriorDirection(){ + + return this._findMaxIndex( this._directions, 1 ); + + } + + superiorDirection(){ + + return this._findMaxIndex( this._directions, 2 ); + } /** @@ -165,7 +415,7 @@ export default class CamerasOrthographic extends THREE.OrthographicCamera{ // Rotate the up vector around the "zCosine" let rotation = new THREE.Matrix4().makeRotationAxis( - this._zCosine, + this._direction, computedAngle * Math.PI/180); this.up.applyMatrix4(rotation); @@ -191,15 +441,15 @@ export default class CamerasOrthographic extends THREE.OrthographicCamera{ // update zoom switch (direction){ case 0: - zoom = factor * this._computeZoom(this._canvas.width, this._xCosine); + zoom = factor * this._computeZoom(this._canvas.width, this._right); break; case 1: - zoom = factor * this._computeZoom(this._canvas.height, this._yCosine); + zoom = factor * this._computeZoom(this._canvas.height, this._up); break; case 2: zoom = factor * (Math.min( - this._computeZoom(this._canvas.width, this._xCosine), - this._computeZoom(this._canvas.height, this._yCosine) + this._computeZoom(this._canvas.width, this._right), + this._computeZoom(this._canvas.height, this._up) )); break; default: @@ -256,13 +506,39 @@ export default class CamerasOrthographic extends THREE.OrthographicCamera{ } + _findMaxIndex( directions, target ){ + + // get index of the most superior direction + let maxIndices = this._getMaxIndices( directions ); + + for( let i = 0; i < maxIndices.length; i++ ){ + + if( maxIndices[i] === target){ + + return i; + + } + + } + + } + + _getMaxIndices( directions ){ + + let indices = []; + indices.push( this._getMaxIndex( directions[0] ) ); + indices.push( this._getMaxIndex( directions[1] ) ); + indices.push( this._getMaxIndex( directions[2] ) ); + + return indices; + + } + _orderIntersections( intersections, direction ){ - // order intersections depending on ray direction - let maxIndex = this._getMaxIndex( direction ); let ordered = intersections[0].dot( direction ) < intersections[1].dot( direction ); - if( ordered ){ + if( !ordered ){ return [ intersections[1], intersections[0] ]; @@ -343,30 +619,6 @@ export default class CamerasOrthographic extends THREE.OrthographicCamera{ this.updateMatrixWorld(); } - set xCosine(xCosine) { - this._xCosine = xCosine; - } - - get xCosine() { - return this._xCosine; - } - - set yCosine(yCosine) { - this._yCosine = yCosine; - } - - get yCosine() { - return this._yCosine; - } - - set zCosine(zCosine) { - this._zCosine = zCosine; - } - - get zCosine() { - return this._zCosine; - } - set controls(controls) { this._controls = controls; } @@ -400,4 +652,87 @@ export default class CamerasOrthographic extends THREE.OrthographicCamera{ return this._angle; } + set directions(directions){ + this._directions = directions; + } + + get directions(){ + return this._directions; + } + + set convention(convention){ + this._convention = convention; + } + + get convention(){ + return this._convention; + } + + set orientation(orientation){ + this._orientation = orientation; + } + + get orientation(){ + return this._orientation; + } + + set stackOrientation(stackOrientation){ + + this._stackOrientation = stackOrientation; + + if( this._stackOrientation === 0){ + + this._orientation = 'default'; + + } else { + + let maxIndex = this._getMaxIndex( this._directions[ (this._stackOrientation + 2) % 3] ); + + if( maxIndex === 0 ){ + + this._orientation = 'sagittal'; + + } else if( maxIndex === 1 ){ + + this._orientation = 'coronal'; + + } else if( maxIndex === 2 ){ + + this._orientation = 'axial'; + + } + + } + } + + get stackOrientation(){ + + // + if( this._orientation === 'default' ){ + + this._stackOrientation = 0; + + } else { + + let maxIndex = this._getMaxIndex( this._direction ); + + if( maxIndex === this._getMaxIndex( this._directions[2] ) ){ + + this._stackOrientation = 0; + + } else if( maxIndex === this._getMaxIndex( this._directions[0] ) ){ + + this._stackOrientation = 1; + + } else if( maxIndex === this._getMaxIndex( this._directions[1] ) ){ + + this._stackOrientation = 2; + + } + + } + + return this._stackOrientation; + } + } diff --git a/src/parsers/parsers.nifti.js b/src/parsers/parsers.nifti.js index 37c13e247..b59d17dfb 100644 --- a/src/parsers/parsers.nifti.js +++ b/src/parsers/parsers.nifti.js @@ -290,9 +290,9 @@ export default class ParsersNifti extends ParsersVolume { let numberOfChannels = this.numberOfChannels(); let numPixels = this.rows(frameIndex) * this.columns(frameIndex) * numberOfChannels; - if( !this.rightHanded() ){ - frameIndex = this.numberOfFrames() - 1 - frameIndex; - } + // if( !this.rightHanded() ){ + // frameIndex = this.numberOfFrames() - 1 - frameIndex; + // } let frameOffset = frameIndex * numPixels; let buffer = this._niftiImage; From d8e87477daa830a208f1df72143f3f1aeab80132 Mon Sep 17 00:00:00 2001 From: nicolasrannou Date: Wed, 14 Dec 2016 14:03:42 +0100 Subject: [PATCH 17/17] v0.0.12 --- bower.json | 2 +- build/ami.js | 393 ++++++++++++++++++++++++++++++++++++++----- build/ami.min.js | 21 +-- lessons/00/demo.html | 2 +- lessons/01/demo.html | 2 +- lessons/02/demo.html | 2 +- lessons/03/demo.html | 2 +- lessons/04/demo.html | 6 +- lessons/05/demo.html | 2 +- lessons/06/demo.html | 2 +- lessons/08/demo.html | 2 +- package.json | 2 +- 12 files changed, 370 insertions(+), 68 deletions(-) diff --git a/bower.json b/bower.json index 274d63b96..64f909f95 100644 --- a/bower.json +++ b/bower.json @@ -1,5 +1,5 @@ { "name": "ami.js", - "version": "v0.0.12-dev", + "version": "v0.0.12", "dependencies": {} } \ No newline at end of file diff --git a/build/ami.js b/build/ami.js index f9454bbb9..14571c0a2 100644 --- a/build/ami.js +++ b/build/ami.js @@ -31229,7 +31229,7 @@ module.exports = isString; },{}],85:[function(require,module,exports){ module.exports={ "name": "ami.js", - "version": "v0.0.12-dev", + "version": "v0.0.12", "main": "src/ami.js", "keywords": ["ami", "ami.js","three.js", "webgl", "dicom", "nifti", "awesome", "medical", "imaging", "xtk", "nrrd", "vtk", "stl", "trk"], "author": { @@ -31244,7 +31244,7 @@ module.exports={ }, "config" : { "threeVersion": "r81", - "amiCDN": "https://cdn.rawgit.com/fnndsc/ami/master/build/ami.min.js", + "amiCDN": "https://cdnjs.cloudflare.com/ajax/libs/ami.js/", "gaKey": "UA-39303022-3", "transforms" : "-t [babelify --presets [ es2015 ] ]" }, @@ -31468,9 +31468,15 @@ var CamerasOrthographic = function (_THREE$OrthographicCa) { _this._front = null; _this._back = null; - _this._xCosine = null; - _this._yCosine = null; - _this._zCosine = null; + _this._directions = [new THREE.Vector3(1, 0, 0), new THREE.Vector3(0, 1, 0), new THREE.Vector3(0, 0, 1)]; + + _this._orientation = 'default'; + _this._convention = 'radio'; + _this._stackOrientation = 0; + + _this._right = null; + _this._up = null; + _this._direction = null; _this._controls = null; _this._box = null; @@ -31491,6 +31497,10 @@ var CamerasOrthographic = function (_THREE$OrthographicCa) { _createClass(CamerasOrthographic, [{ key: 'init', value: function init(xCosine, yCosine, zCosine, controls, box, canvas) { + + // DEPRECATED + console.warn('cameras.orthographic.init(...) is deprecated. Use .cosines, .controls, .box and .canvas instead.'); + // if (!(_core4.default.vector3(xCosine) && _core4.default.vector3(yCosine) && _core4.default.vector3(zCosine) && _core4.default.box(box) && controls)) { window.console.log('Invalid input provided.'); @@ -31498,28 +31508,246 @@ var CamerasOrthographic = function (_THREE$OrthographicCa) { return false; } - this._xCosine = xCosine; - this._yCosine = this._adjustTopDirection(xCosine, yCosine); - this._zCosine = new THREE.Vector3().crossVectors(this._xCosine, this._yCosine); + this._right = xCosine; + this._up = this._adjustTopDirection(xCosine, yCosine); + this._direction = new THREE.Vector3().crossVectors(this._right, this._up); this._controls = controls; this._box = box; this._canvas = canvas; var ray = { position: this._box.center, - direction: this._zCosine + direction: this._direction + }; + + var intersections = this._orderIntersections(_core2.default.rayBox(ray, this._box), this._direction); + this._front = intersections[0]; + this._back = intersections[1]; + + // set default values + this.up.set(this._up.x, this._up.y, this._up.z); + this._updateCanvas(); + this._updatePositionAndTarget(this._front, this._back); + this._updateMatrices(); + } + }, { + key: 'update', + value: function update() { + + // http://www.grahamwideman.com/gw/brain/orientation/orientterms.htm + // do magics depending on orientation and convention + // also needs a default mode + + if (this._orientation === 'default') { + + switch (this._getMaxIndex(this._directions[2])) { + + case 0: + this._orientation = 'sagittal'; + break; + + case 1: + this._orientation = 'coronal'; + break; + + case 2: + this._orientation = 'axial'; + break; + + default: + this._orientation = 'free'; + break; + } + } + + if (this._orientation === 'free') { + + this._right = this._directions[0]; + this._up = this._directions[1]; + this._direction = this._directions[2]; + } else { + + // this._directions[2] = new THREE.Vector3().crossVectors( this._directions[0], this._directions[1] ); + + var leftIndex = this.leftDirection(); + var leftDirection = this._directions[leftIndex]; + var posteriorIndex = this.posteriorDirection(); + var posteriorDirection = this._directions[posteriorIndex]; + var superiorIndex = this.superiorDirection(); + var superiorDirection = this._directions[superiorIndex]; + + if (this._convention === 'radio') { + + switch (this._orientation) { + + case 'axial': + // up vector is 'anterior' + if (posteriorDirection.y > 0) { + + posteriorDirection.negate(); + } + + // looking towards superior + if (superiorDirection.z < 0) { + + superiorDirection.negate(); + } + + // + this._right = leftDirection; // does not matter right/left + this._up = posteriorDirection; + this._direction = superiorDirection; + break; + + case 'coronal': + // up vector is 'superior' + if (superiorDirection.z < 0) { + + superiorDirection.negate(); + } + + // looking towards posterior + if (posteriorDirection.y < 0) { + + posteriorDirection.negate(); + } + + // + this._right = leftDirection; // does not matter right/left + this._up = superiorDirection; + this._direction = posteriorDirection; + break; + + case 'sagittal': + // up vector is 'superior' + if (superiorDirection.z < 0) { + + superiorDirection.negate(); + } + + // looking towards right + if (leftDirection.x > 0) { + + leftDirection.negate(); + } + + // + this._right = posteriorDirection; // does not matter right/left + this._up = superiorDirection; + this._direction = leftDirection; + + break; + + default: + console.warn('"' + this._orientation + '" orientation is not valid. (choices: axial, coronal, sagittal)'); + break; + + } + } else if (this._convention === 'neuro') { + + switch (this._orientation) { + + case 'axial': + // up vector is 'anterior' + if (posteriorDirection.y > 0) { + + posteriorDirection.negate(); + } + + // looking towards inferior + if (superiorDirection.z > 0) { + + superiorDirection.negate(); + } + + // + this._right = leftDirection; // does not matter right/left + this._up = posteriorDirection; + this._direction = superiorDirection; + break; + + case 'coronal': + // up vector is 'superior' + if (superiorDirection.z < 0) { + + superiorDirection.negate(); + } + + // looking towards anterior + if (posteriorDirection.y > 0) { + + posteriorDirection.negate(); + } + + // + this._right = leftDirection; // does not matter right/left + this._up = superiorDirection; + this._direction = posteriorDirection; + break; + + case 'sagittal': + // up vector is 'superior' + if (superiorDirection.z < 0) { + + superiorDirection.negate(); + } + + // looking towards right + if (leftDirection.x > 0) { + + leftDirection.negate(); + } + + // + this._right = posteriorDirection; // does not matter right/left + this._up = superiorDirection; + this._direction = leftDirection; + + break; + + default: + console.warn('"' + this._orientation + '" orientation is not valid. (choices: axial, coronal, sagittal)'); + break; + } + } else { + console.warn(this._convention + ' is not valid (choices: radio, neuro)'); + } + } + + // that is what determines left/right + var ray = { + position: this._box.center, + direction: this._direction }; - var intersections = this._orderIntersections(_core2.default.rayBox(ray, this._box), this._zCosine); + var intersections = this._orderIntersections(_core2.default.rayBox(ray, this._box), this._direction); this._front = intersections[0]; this._back = intersections[1]; // set default values - this.up.set(this._yCosine.x, this._yCosine.y, this._yCosine.z); + this.up.set(this._up.x, this._up.y, this._up.z); this._updateCanvas(); this._updatePositionAndTarget(this._front, this._back); this._updateMatrices(); } + }, { + key: 'leftDirection', + value: function leftDirection() { + + return this._findMaxIndex(this._directions, 0); + } + }, { + key: 'posteriorDirection', + value: function posteriorDirection() { + + return this._findMaxIndex(this._directions, 1); + } + }, { + key: 'superiorDirection', + value: function superiorDirection() { + + return this._findMaxIndex(this._directions, 2); + } /** * Invert rows in the current slice. @@ -31621,7 +31849,7 @@ var CamerasOrthographic = function (_THREE$OrthographicCa) { this._angle %= 360; // Rotate the up vector around the "zCosine" - var rotation = new THREE.Matrix4().makeRotationAxis(this._zCosine, computedAngle * Math.PI / 180); + var rotation = new THREE.Matrix4().makeRotationAxis(this._direction, computedAngle * Math.PI / 180); this.up.applyMatrix4(rotation); this._updateMatrices(); @@ -31652,13 +31880,13 @@ var CamerasOrthographic = function (_THREE$OrthographicCa) { // update zoom switch (direction) { case 0: - zoom = factor * this._computeZoom(this._canvas.width, this._xCosine); + zoom = factor * this._computeZoom(this._canvas.width, this._right); break; case 1: - zoom = factor * this._computeZoom(this._canvas.height, this._yCosine); + zoom = factor * this._computeZoom(this._canvas.height, this._up); break; case 2: - zoom = factor * Math.min(this._computeZoom(this._canvas.width, this._xCosine), this._computeZoom(this._canvas.height, this._yCosine)); + zoom = factor * Math.min(this._computeZoom(this._canvas.width, this._right), this._computeZoom(this._canvas.height, this._up)); break; default: break; @@ -31704,15 +31932,39 @@ var CamerasOrthographic = function (_THREE$OrthographicCa) { return 2; } } + }, { + key: '_findMaxIndex', + value: function _findMaxIndex(directions, target) { + + // get index of the most superior direction + var maxIndices = this._getMaxIndices(directions); + + for (var i = 0; i < maxIndices.length; i++) { + + if (maxIndices[i] === target) { + + return i; + } + } + } + }, { + key: '_getMaxIndices', + value: function _getMaxIndices(directions) { + + var indices = []; + indices.push(this._getMaxIndex(directions[0])); + indices.push(this._getMaxIndex(directions[1])); + indices.push(this._getMaxIndex(directions[2])); + + return indices; + } }, { key: '_orderIntersections', value: function _orderIntersections(intersections, direction) { - // order intersections depending on ray direction - var maxIndex = this._getMaxIndex(direction); var ordered = intersections[0].dot(direction) < intersections[1].dot(direction); - if (ordered) { + if (!ordered) { return [intersections[1], intersections[0]]; } @@ -31791,30 +32043,6 @@ var CamerasOrthographic = function (_THREE$OrthographicCa) { this.updateProjectionMatrix(); this.updateMatrixWorld(); } - }, { - key: 'xCosine', - set: function set(xCosine) { - this._xCosine = xCosine; - }, - get: function get() { - return this._xCosine; - } - }, { - key: 'yCosine', - set: function set(yCosine) { - this._yCosine = yCosine; - }, - get: function get() { - return this._yCosine; - } - }, { - key: 'zCosine', - set: function set(zCosine) { - this._zCosine = zCosine; - }, - get: function get() { - return this._zCosine; - } }, { key: 'controls', set: function set(controls) { @@ -31848,6 +32076,79 @@ var CamerasOrthographic = function (_THREE$OrthographicCa) { get: function get() { return this._angle; } + }, { + key: 'directions', + set: function set(directions) { + this._directions = directions; + }, + get: function get() { + return this._directions; + } + }, { + key: 'convention', + set: function set(convention) { + this._convention = convention; + }, + get: function get() { + return this._convention; + } + }, { + key: 'orientation', + set: function set(orientation) { + this._orientation = orientation; + }, + get: function get() { + return this._orientation; + } + }, { + key: 'stackOrientation', + set: function set(stackOrientation) { + + this._stackOrientation = stackOrientation; + + if (this._stackOrientation === 0) { + + this._orientation = 'default'; + } else { + + var maxIndex = this._getMaxIndex(this._directions[(this._stackOrientation + 2) % 3]); + + if (maxIndex === 0) { + + this._orientation = 'sagittal'; + } else if (maxIndex === 1) { + + this._orientation = 'coronal'; + } else if (maxIndex === 2) { + + this._orientation = 'axial'; + } + } + }, + get: function get() { + + // + if (this._orientation === 'default') { + + this._stackOrientation = 0; + } else { + + var maxIndex = this._getMaxIndex(this._direction); + + if (maxIndex === this._getMaxIndex(this._directions[2])) { + + this._stackOrientation = 0; + } else if (maxIndex === this._getMaxIndex(this._directions[0])) { + + this._stackOrientation = 1; + } else if (maxIndex === this._getMaxIndex(this._directions[1])) { + + this._stackOrientation = 2; + } + } + + return this._stackOrientation; + } }]); return CamerasOrthographic; @@ -40701,9 +41002,9 @@ var ParsersNifti = function (_ParsersVolume) { var numberOfChannels = this.numberOfChannels(); var numPixels = this.rows(frameIndex) * this.columns(frameIndex) * numberOfChannels; - if (!this.rightHanded()) { - frameIndex = this.numberOfFrames() - 1 - frameIndex; - } + // if( !this.rightHanded() ){ + // frameIndex = this.numberOfFrames() - 1 - frameIndex; + // } var frameOffset = frameIndex * numPixels; var buffer = this._niftiImage; @@ -44276,4 +44577,4 @@ exports.default = WidgetsVoxelProbe; },{"../../src/helpers/helpers.voxel":110}]},{},[86])(86) }); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJleHRlcm5hbC9zY3JpcHRzL2pwZWcuanMiLCJleHRlcm5hbC9zY3JpcHRzL2pweC5qcyIsIm5vZGVfbW9kdWxlcy9hc3NlcnQvYXNzZXJ0LmpzIiwibm9kZV9tb2R1bGVzL2Jyb3dzZXItcmVzb2x2ZS9lbXB0eS5qcyIsIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5LXpsaWIvbm9kZV9tb2R1bGVzL3Bha28vbGliL3V0aWxzL2NvbW1vbi5qcyIsIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5LXpsaWIvbm9kZV9tb2R1bGVzL3Bha28vbGliL3psaWIvYWRsZXIzMi5qcyIsIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5LXpsaWIvbm9kZV9tb2R1bGVzL3Bha28vbGliL3psaWIvY29uc3RhbnRzLmpzIiwibm9kZV9tb2R1bGVzL2Jyb3dzZXJpZnktemxpYi9ub2RlX21vZHVsZXMvcGFrby9saWIvemxpYi9jcmMzMi5qcyIsIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5LXpsaWIvbm9kZV9tb2R1bGVzL3Bha28vbGliL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H1cbiAgICAgICAgLy8gdW5zdHVmZiAwXG4gICAgICB9XG4gICAgICBiaXRzQ291bnQgPSA3O1xuICAgICAgcmV0dXJuIGJpdHNEYXRhID4+PiA3O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGRlY29kZUh1ZmZtYW4odHJlZSkge1xuICAgICAgdmFyIG5vZGUgPSB0cmVlO1xuICAgICAgdmFyIGJpdDtcbiAgICAgIHdoaWxlICgoYml0ID0gcmVhZEJpdCgpKSAhPT0gbnVsbCkge1xuICAgICAgICBub2RlID0gbm9kZVtiaXRdO1xuICAgICAgICBpZiAodHlwZW9mIG5vZGUgPT09ICdudW1iZXInKVxuICAgICAgICAgIHJldHVybiBub2RlO1xuICAgICAgICBpZiAodHlwZW9mIG5vZGUgIT09ICdvYmplY3QnKVxuICAgICAgICAgIHRocm93IFwiaW52YWxpZCBodWZmbWFuIHNlcXVlbmNlXCI7XG4gICAgICB9XG4gICAgICByZXR1cm4gbnVsbDtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiByZWNlaXZlKGxlbmd0aCkge1xuICAgICAgdmFyIG4gPSAwO1xuICAgICAgd2hpbGUgKGxlbmd0aCA+IDApIHtcbiAgICAgICAgdmFyIGJpdCA9IHJlYWRCaXQoKTtcbiAgICAgICAgaWYgKGJpdCA9PT0gbnVsbClcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIG4gPSAobiA8PCAxKSB8IGJpdDtcbiAgICAgICAgbGVuZ3RoLS07XG4gICAgICB9XG4gICAgICByZXR1cm4gbjtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiByZWNlaXZlQW5kRXh0ZW5kKGxlbmd0aCkge1xuICAgICAgdmFyIG4gPSByZWNlaXZlKGxlbmd0aCk7XG4gICAgICBpZiAobiA+PSAxIDw8IChsZW5ndGggLSAxKSlcbiAgICAgICAgcmV0dXJuIG47XG4gICAgICByZXR1cm4gbiArICgtMSA8PCBsZW5ndGgpICsgMTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBkZWNvZGVCYXNlbGluZShjb21wb25lbnQsIG9mZnNldCkge1xuICAgICAgdmFyIHQgPSBkZWNvZGVIdWZmbWFuKGNvbXBvbmVudC5odWZmbWFuVGFibGVEQyk7XG4gICAgICB2YXIgZGlmZiA9IHQgPT09IDAgPyAwIDogcmVjZWl2ZUFuZEV4dGVuZCh0KTtcbiAgICAgIGNvbXBvbmVudC5ibG9ja0RhdGFbb2Zmc2V0XSA9IChjb21wb25lbnQucHJlZCArPSBkaWZmKTtcbiAgICAgIHZhciBrID0gMTtcbiAgICAgIHdoaWxlIChrIDwgNjQpIHtcbiAgICAgICAgdmFyIHJzID0gZGVjb2RlSHVmZm1hbihjb21wb25lbnQuaHVmZm1hblRhYmxlQUMpO1xuICAgICAgICB2YXIgcyA9IHJzICYgMTUsIHIgPSBycyA+PiA0O1xuICAgICAgICBpZiAocyA9PT0gMCkge1xuICAgICAgICAgIGlmIChyIDwgMTUpXG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBrICs9IDE2O1xuICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG4gICAgICAgIGsgKz0gcjtcbiAgICAgICAgdmFyIHogPSBkY3RaaWdaYWdba107XG4gICAgICAgIGNvbXBvbmVudC5ibG9ja0RhdGFbb2Zmc2V0ICsgel0gPSByZWNlaXZlQW5kRXh0ZW5kKHMpO1xuICAgICAgICBrKys7XG4gICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZGVjb2RlRENGaXJzdChjb21wb25lbnQsIG9mZnNldCkge1xuICAgICAgdmFyIHQgPSBkZWNvZGVIdWZmbWFuKGNvbXBvbmVudC5odWZmbWFuVGFibGVEQyk7XG4gICAgICB2YXIgZGlmZiA9IHQgPT09IDAgPyAwIDogKHJlY2VpdmVBbmRFeHRlbmQodCkgPDwgc3VjY2Vzc2l2ZSk7XG4gICAgICBjb21wb25lbnQuYmxvY2tEYXRhW29mZnNldF0gPSAoY29tcG9uZW50LnByZWQgKz0gZG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AgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICBjYXNlIDE6IC8vIHNraXBwaW5nIHIgemVybyBpdGVtc1xuICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgIGlmIChjb21wb25lbnQuYmxvY2tEYXRhW29mZnNldCArIHpdKSB7XG4gICAgICAgICAgICAgIGNvbXBvbmVudC5ibG9ja0RhdGFbb2Zmc2V0ICsgel0gKz0gKHJlYWRCaXQoKSA8PCBzdWNjZXNzaXZlKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHItLTtcbiAgICAgICAgICAgICAgaWYgKHIgPT09IDApXG4gICAgICAgICAgICAgICAgc3VjY2Vzc2l2ZUFDU3RhdGUgPSBzdWNjZXNzaXZlQUNTdGF0ZSA9PSAyID8gMyA6IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlIDM6IC8vIHNldCB2YWx1ZSBmb3IgYSB6ZXJvIGl0ZW1cbiAgICAgICAgICAgIGlmIChjb21wb25lbnQuYmxvY2tEYXRhW29mZnNldCArIHpdKSB7XG4gICAgICAgICAgICAgIGNvbXBvbmVudC5ibG9ja0RhdGFbb2Zmc2V0ICsgel0gKz0gKHJlYWRCaXQoKSA8PCBzdWNjZXNzaXZlKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGNvbXBvbmVudC5ibG9ja0RhdGFbb2Zmc2V0ICsgel0gPSBzdWNjZXNzaXZlQUNOZXh0VmFsdWUgPDwgc3VjY2Vzc2l2ZTtcbiAgICAgICAgICAgICAgc3VjY2Vzc2l2ZUFDU3RhdGUgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSA0OiAvLyBlb2JcbiAgICAgICAgICAgIGlmIChjb21wb25lbnQuYmxvY2tEYXRhW29mZnNldCArIHpdKSB7XG4gICAgICAgICAgICAgIGNvbXBvbmVud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8vIHJlc2V0IGludGVydmFsIHN0dWZmXG4gICAgICBmb3IgKGkgPSAwOyBpIDwgY29tcG9uZW50c0xlbmd0aDsgaSsrKSB7XG4gICAgICAgIGNvbXBvbmVudHNbaV0ucHJlZCA9IDA7XG4gICAgICB9XG4gICAgICBlb2JydW4gPSAwO1xuXG4gICAgICBpZiAoY29tcG9uZW50c0xlbmd0aCA9PSAxKSB7XG4gICAgICAgIGNvbXBvbmVudCA9IGNvbXBvbmVudHNbMF07XG4gICAgICAgIGZvciAobiA9IDA7IG4gPCByZXNldEludGVydmFsOyBuKyspIHtcbiAgICAgICAgICBkZWNvZGVCbG9jayhjb21wb25lbnQsIGRlY29kZUZuLCBtY3UpO1xuICAgICAgICAgIG1jdSsrO1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBmb3IgKG4gPSAwOyBuIDwgcmVzZXRJbnRlcnZhbDsgbisrKSB7XG4gICAgICAgICAgZm9yIChpID0gMDsgaSA8IGNvbXBvbmVudHNMZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgY29tcG9uZW50ID0gY29tcG9uZW50c1tpXTtcbiAgICAgICAgICAgIGggPSBjb21wb25lbnQuaDtcbiAgICAgICAgICAgIHYgPSBjb21wb25lbnQudjtcbiAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCB2OyBqKyspIHtcbiAgICAgICAgICAgICAgZm9yIChrID0gMDsgayA8IGg7IGsrKykge1xuICAgICAgICAgICAgICAgIGRlY29kZU1jdShjb21wb25lbnQsIGRlY29kZUZuLCBtY3UsIGosIGspO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIG1jdSsrO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIC8vIGZpbmQgbWFya2VyXG4gICAgICBiaXRzQ291bnQgPSAwO1xuICAgICAgbWFya2VyID0gKGRhdGFbb2Zmc2V0XSA8PCA4KSB8IGRhdGFbb2Zmc2V0ICsgM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KyBpXSAqIHF0W2ldO1xuICAgIH1cblxuICAgIC8vIGludmVyc2UgRENUIG9uIHJvd3NcbiAgICBmb3IgKGkgPSAwOyBpIDwgODsgKytpKSB7XG4gICAgICB2YXIgcm93ID0gOCAqIGk7XG5cbiAgICAgIC8vIGNoZWNrIGZvciBhbGwtemVybyBBQyBjb2VmZmljaWVudHNcbiAgICAgIGlmIChwWzEgKyByb3ddID09PSAwICYmIHBbMiArIHJvd10gPT09IDAgJiYgcFszICsgcm93XSA9PT0gMCAmJlxuICAgICAgICBwWzQgKyByb3ddID09PSAwICYmIHBbNSArIHJvd10gPT09IDAgJiYgcFs2ICsgcm93XSA9PT0gMCAmJlxuICAgICAgICBwWzcgKyByb3ddID09PSAwKSB7XG4gICAgICAgIHQgPSAoZGN0U3FydDIgKiBwWzAgKyByb3ddICsgNTEyKSA+PiAxMDtcbiAgICAgICAgcFswICsgcm93XSA9IHQ7XG4gICAgICAgIHBbMSArIHJvd10gPSB0O1xuICAgICAgICBwWzIgKyByb3ddID0gdDtcbiAgICAgICAgcFszICsgcm93XSA9IHQ7XG4gICAgICAgIHBbNCArIHJvd10gPSB0O1xuICAgICAgICBwWzUgKyByb3ddID0gdDtcbiAgICAgICAgcFs2ICsgcm93XSA9IHQ7XG4gICAgICAgIHBbNyArIHJvd10gPSB0O1xuICAgICAgICBjb250aW51ZTtcbiAgICAgIH1cblxuICAgICAgLy8gc3RhZ2UgNFxuICAgICAgdjAgPSAoZGN0U3FydDIgKiBwWzAgKyByb3ddICsgMTI4KSA+PiA4O1xuICAgICAgdjEgPSAoZGN0U3FydDIgKiBwWzQgKyByb3ddICsgMTI4KSA+PiA4O1xuICAgICAgdjIgPSBwWzIgKyByb3ddO1xuICAgICAgdjMgPSBwWzYgKyByb3ddO1xuICAgICAgdjQgPSAoZGN0U3FydDFkMiAqIChwWzEgKyByb3ddIC0gcFs3ICsgcm93XSkgKyAxMjgpID4+IDg7XG4gICAgICB2NyA9IChkY3RTcXJ0MWQyICogKHB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ICAgICAgdjUgPSAodjUgKiBkY3RDb3MxIC0gdjYgKiBkY3RTaW4xICsgMjA0OCkgPj4gMTI7XG4gICAgICB2NiA9IHQ7XG5cbiAgICAgIC8vIHN0YWdlIDFcbiAgICAgIHBbMCArIHJvd10gPSB2MCArIHY3O1xuICAgICAgcFs3ICsgcm93XSA9IHYwIC0gdjc7XG4gICAgICBwWzEgKyByb3ddID0gdjEgKyB2NjtcbiAgICAgIHBbNiArIHJvd10gPSB2MSAtIHY2O1xuICAgICAgcFsyICsgcm93XSA9IHYyICsgdjU7XG4gICAgICBwWzUgKyByb3ddID0gdjIgLSB2NTtcbiAgICAgIHBbMyArIHJvd10gPSB2MyArIHY0O1xuICAgICAgcFs0ICsgcm93XSA9IHYzIC0gdjQ7XG4gICAgfVxuXG4gICAgLy8gaW52ZXJzZSBEQ1Qgb24gY29sdW1uc1xuICAgIGZvciAoaSA9IDA7IGkgPCA4OyArK2kpIHtcbiAgICAgIHZhciBjb2wgPSBpO1xuXG4gICAgICAvLyBjaGVjayBmb3IgYWxsLXplcm8gQUMgY29lZmZpY2llbnRzXG4gICAgICBpZiAocFsxICogOCArIGNvbF0gPT09IDAgJiYgcFsyICogOCArIGNvbF0gPT09IDAgJiYgcFszICogOCArIGNvbF0gPT09IDAgJiZcbiAgICAgICAgcFs0ICogOCArIGNvbF0gPT09IDAgJiYgcFs1ICogOCArIGNvbF0gPT09IDAgJiYgcFs2ICogOCArIGNvbF0gPT09IDAgJiZcbiAgICAgICAgcFs3ICogOCArIGNvbF0gPT09IDApIHtcbiAgICAgICAgdCA9IChkY3RTcXJ0MiAqIHBbaSArIDBdICsgODE5MikgPj4gMTQ7XG4gICAgICAgIHBbMCAqIDggKyBjb2xdID0gdDtcbiAgICAgICAgcFsxICogOCArIGNvbF0gPSB0O1xuICAgICAgICBwWzIgKiA4ICsgY29sXSA9IHQ7XG4gICAgICAgIHBbMyAqIDggKyBjb2xdID0gdDtcbiAgICAgICAgcFs0ICogOCArIGNvbF0gPS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zZSAweEZGRTg6IC8vIEFQUDhcbiAgICAgICAgICBjYXNlIDB4RkZFOTogLy8gQVBQOVxuICAgICAgICAgIGNhc2UgMHhGRkVBOiAvLyBBUFAxMFxuICAgICAgICAgIGNhc2UgMHhGRkVCOiAvLyBBUFAxMVxuICAgICAgICAgIGNhc2UgMHhGRkVDOiAvLyBBUFAxMlxuICAgICAgICAgIGNhc2UgMHhGRkVEOiAvLyBBUFAxM1xuICAgICAgICAgIGNhc2UgMHhGRkVFOiAvLyBBUFAxNFxuICAgICAgICAgIGNhc2UgMHhGRkVGOiAvLyBBUFAxNVxuICAgICAgICAgIGNhc2UgMHhGRkZFOiAvLyBDT00gKENvbW1lbnQpXG4gICAgICAgICAgICB2YXIgYXBwRGF0YSA9IHJlYWREYXRhQmxvY2soKTtcblxuICAgICAgICAgICAgaWYgKGZpbGVNYXJrZXIgPT09IDB4RkZFMCkge1xuICAgICAgICAgICAgICBpZiAoYXBwRGF0YVswXSA9PT0gMHg0QSAmJiBhcHBEYXRhWzFdID09PSAweDQ2ICYmIGFwcERhdGFbMl0gPT09IDB4NDkgJiZcbiAgICAgICAgICAgICAgICBhcHBEYXRhWzNdID09PSAweDQ2ICYmIGFwcERhdGFbNF0gPT09IDApIHsgLy8gJ0pGSUZcXHgwMCdcbiAgICAgICAgICAgICAgICBqZmlmID0ge1xuICAgICAgICAgICAgICAgICAgdmVyc2lvbjoge21ham9yOiBhcHBEYXRhWzVdLCBtaW5vcjogYXBwRGF0YVs2XX0sXG4gICAgICAgICAgICAgICAgICBkZW5zaXR5VW5pdHM6IGFwcERhdGFbN10sXG4gICAgICAgICAgICAgICAgICB4RGVuc2l0eTogKGFwcERhdGFbOF0gPDwgOCkgfCBhcHBEYXRhWzldLFxuICAgICAgICAgICAgICAgICAgeURlbnNpdHk6IChhcHBEYXRhWzEwXSA8PCA4KSB8IGFwcERhdGFbMTFdLFxuICAgICAgICAgICAgICAgICAgdGh1bWJXaWR0aDogYXBwRGF0YVsxMl0sXG4gICAgICAgICAgICAgICAgICB0aHVtYkhlaWdodDogYXBwRGF0YVsxM10sXG4gICAgICAgICAgICAgICAgICB0aHVtYkRhdGE6IGFwcERhdGEuc3ViYXJyYXkoMTQsIDE0ICsgMyAqIGFwcERhdGFbMTJdICogYXBwRGF0YVsxM10pXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gVE9ETyBBUFAxIC0gRXhpZlxuICAgICAgICAgICAgaWYgKGZpbGVNYXJrZXIgPT09IDB4RkZFRSkge1xuICAgICAgICAgICAgICBpZiAoYXBwRGF0YVswXSA9PT0gMHg0MSAmJiBhcHBEYXRhWzFdID09PSAweDY0ICYmIGFwcERhdGFbMl0gPT09IDB4NkYgJiZcbiAgICAgICAgICAgICAgICBhcHBEYXRhWzNdID09PSAweDYyICYmIGFwcERhdGFbNF0gPT09IDB4NjUgJiYgYXBwRGF0YVs1XSA9PT0gMCkgeyAvLyAnQWRvYmVcXHgwMCdcbiAgICAgICAgICAgICAgICBhZG9iZSA9IHtcbiAgICAgICAgICAgICAgICAgIHZlcnNpb246IGFwcERhdGFbNl0sXG4gICAgICAgICAgICAgICAgICBmbGFnczA6IChhcHBEYXRhWzddIDw8IDgpIHwgYXBwRGF0YVs4XSxcbiAgICAgICAgICAgICAgICAgIGZsYWdzMTogKGFwcERhdGFbOV0gPDwgOCkgfCBhcHBEYXRhWzEwXSxcbiAgICAgICAgICAgICAgICAgIHRyYW5zZm9ybUNvZGU6IGFwcERhdGFbMTFdXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIDB4RkZEQjogLy8gRFFUIChEZWZpbmUgUXVhbnRpemF0aW9uIFRhYmxlcylcbiAgICAgICAgICAgIHZhciBxdWFudGl6YXRpb25UYWJsZXNMZW5ndGggPSByZWFkVWludDE2KCk7XG4gICAgICAgICAgICB2YXIgcXVhbnRpemF0aW9uVGFibGVzRW5kID0gcXVhbnRpemF0aW9uVGFibGVzTGVuZ3RoICsgb2Zmc2V0IC0gMjtcbiAgICAgICAgICAgIHdoaWxlIChvZmZzZXQgPCBxdWFudGl6YXRpb25UYWJsZXNFbmQpIHtcbiAgICAgICAgICAgICAgdmFyIHF1YW50aXphdGlvblRhYmxlU3BlYyA9IGRhdGFbb2Zmc2V0KytdO1xuICAgICAgICAgICAgICB2YXIgdGFibGVEYXRhID0gbmV3IEludDMyQXJyYXkoNjQpO1xuICAgICAgICAgICAgICBpZiAoKHF1YW50aXphdGlvblRhYmxlU3BlYyA+PiA0KSA9PT0gMCkgeyAvLyA4IGJpdCB2YWx1ZXNcbiAgICAgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgNjQ7IGorKykge1xuICAgICAgICAgICAgICAgICAgdmFyIHogPSBkY3RaaWdaYWdbal07XG4gICAgICAgICAgICAgICAgICB0YWJsZURhdGFbel0gPSBkYXRhW29mZnNldCsrXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAoKHF1YW50aXphdGlvblRhYmxlU3BlYyA+PiA0KSA9PT0gMSkgeyAvLzE2IGJpdFxuICAgICAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCA2NDsgaisrKSB7XG4gICAgICAgICAgICAgICAgICB2YXIgenogPSBkY3RaaWdaYWdbal07XG4gICAgICAgICAgICAgICAgICB0YWJsZURhdGFbenpdID0gcmVhZFVpbnQxNigpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSBlbHNlXG4gICAgICAgICAgICAgICAgdGhyb3cgXCJEUVQ6IGludmFsaWQgdGFibGUgc3BlY1wiO1xuICAgICAgICAgICAgICBxdWFudGl6YXRpb25UYWJsZXNbcXVhbnRpemF0aW9uVGFibGVTcGVjICYgMTVdID0gdGFibGVEYXRhO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIDB4RkZDMDogLy8gU09GMCAoU3RhcnQgb2YgRnJhbWUsIEJhc2VsaW5lIERDVClcbiAgICAgICAgICBjYXNlIDB4RkZDMTogLy8gU09GMSAoU3RhcnQgb2YgRnJhbWUsIEV4dGVuZGVkIERDVClcbiAgICAgICAgICBjYXNlIDB4RkZDMjogLy8gU09GMiAoU3RhcnQgb2YgRnJhbWUsIFByb2dyZXNzaXZlIERDVClcbiAgICAgICAgICAgIGlmIChmcmFtZSkge1xuICAgICAgICAgICAgICB0aHJvdyBcIk9ubHkgc2luZ2xlIGZyYW1lIEpQRUdzIHN1cHBvcnRlZFwiO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVhZFVpbnQxNigpOyAvLyBza2lwIGRhdGEgbGVuZ3RoXG4gICAgICAgICAgICBmcmFtZSA9IHt9O1xuICAgICAgICAgICAgZnJhbWUuZXh0ZW5kZWQgPSAoZmlsZU1hcmtlciA9PT0gMHhGRkMxKTtcbiAgICAgICAgICAgIGZyYW1lLnByb2dyZXNzaXZlID0gKGZpbGVNYXJrZXIgPT09IDB4RkZDMik7XG4gICAgICAgICAgICBmcmFtZS5wcmVjaXNpb24gPSBkYXRhW29mZnNldCsrXTtcbiAgICAgICAgICAgIGZyYW1lLnNjYW5MaW5lcyA9IHJlYWRVaW50MTYoKTtcbiAgICAgICAgICAgIGZyYW1lLnNhbXBsZXNQZXJMaW5lID0gcmVhZFVpbnQxNigpO1xuICAgICAgICAgICAgZnJhbWUuY29tcG9uZW50cyA9IFtdO1xuICAgICAgICAgICAgZnJhbWUuY29tcG9uZW50SWRzID0ge307XG4gICAgICAgICAgICB2YXIgY29tcG9uZW50c0NvdW50ID0gZGF0YVtvZmZzZXQrK10sIGNvbXBvbmVudElkO1xuICAgICAgICAgICAgdmFyIG1heEggPSAwLCBtYXhWID0gMDtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBjb21wb25lbnRzQ291bnQ7IGkrKykge1xuICAgICAgICAgICAgICBjb21wb25lbnRJZCA9IGRhdGFbb2Zmc2V0XTtcbiAgICAgICAgICAgICAgdmFyIGggPSBkYXRhW29mZnNldCArIDFdID4+IDQ7XG4gICAgICAgICAgICAgIHZhciB2ID0gZGF0YVtvZmZzZXQgKyAxXSAmIDE1O1xuICAgICAgICAgICAgICBpZiAobWF4SCA8IGgpXG4gICAgICAgICAgICAgICAgbWF4SCA9IGg7XG4gICAgICAgICAgICAgIGlmIChtYXhWIDwgdilcbiAgICAgICAgICAgICAgICBtYXhWID0gdjtcbiAgICAgICAgICAgICAgdmFyIHFJZCA9IGRhdGFbb2Zmc2V0ICsgMl07XG4gICAgICAgICAgICAgIGwgPSBmcmFtZS5jb21wb25lbnRzLnB1c2goe1xuICAgICAgICAgICAgICAgIGg6IGgsXG4gICAgICAgICAgICAgICAgdjogdixcbiAgICAgICAgICAgICAgICBxdWFudGl6YXRpb25UYWJsZTogcXVhbnRpemF0aW9uVGFibGVzW3FJZF0sXG4gICAgICAgICAgICAgICAgcXVhbnRpemF0aW9uVGFibGVJZDogcUlkLFxuICAgICAgICAgICAgICAgIGJpdENvbnZlcnNpb246IDI1NSAvICgoMSA8PCBmcmFtZS5wcmVjaXNpb24pIC0gMSlcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIGZyYW1lLmNvbXBvbmVudElkc1tjb21wb25lbnRJZF0gPSBsIC0gMTtcbiAgICAgICAgICAgICAgb2Zmc2V0ICs9IDM7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmcmFtZS5tYXhIID0gbWF4SDtcbiAgICAgICAgICAgIGZyYW1lLm1heFYgPSBtYXhWO1xuICAgICAgICAgICAgcHJlcGFyZUNvbXBvbmVudHMoZnJhbWUpO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIDB4RkZDNDogLy8gREhUIChEZWZpbmUgSHVmZm1hbiBUYWJsZXMpXG4gICAgICAgICAgICB2YXIgaHVmZm1hbkxlbmd0aCA9IHJlYWRVaW50MTYoKTtcbiAgICAgICAgICAgIGZvciAoaSA9IDI7IGkgPCBodWZmbWFuTGVuZ3RoOyApIHtcbiAgICAgICAgICAgICAgdmFyIGh1ZmZtYW5UYWJsZVNwZWMgPSBkYXRhW29mZnNldCsrXTtcbiAgICAgICAgICAgICAgdmFyIGNvZGVMZW5ndGhzID0gbmV3IFVpbnQ4QXJyYXkoMTYpO1xuICAgICAgICAgICAgICB2YXIgY29kZUxlbmd0aFN1bSA9IDA7XG4gICAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCAxNjsgaisrLCBvZmZzZXQrKylcbiAgICAgICAgICAgICAgICBjb2RlTGVuZ3RoU3VtICs9IChjb2RlTGVuZ3Roc1tqXSA9IGRhdGFbb2Zmc2V0XSk7XG4gICAgICAgICAgICAgIHZhciBodWZmbWFuVmFsdWVzID0gbmV3IFVpbnQ4QXJyYXkoY29kZUxlbmd0aFN1bSk7XG4gICAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBjb2RlTGVuZ3RoU3VtOyBqKyssIG9mZnNldCsrKVxuICAgICAgICAgICAgICAgIGh1ZmZtYW5WYWx1ZXNbal0gPSBkYXRhW29mZnNldF07XG4gICAgICAgICAgICAgIGkgKz0gMTcgKyBjb2RlTGVuZ3RoU3VtO1xuXG4gICAgICAgICAgICAgICgoaHVmZm1hblRhYmxlU3BlYyA+PiA0KSA9PT0gMCA/XG4gICAgICAgICAgICAgICAgaHVmZm1hblRhYmxlc0RDIDogaHVmZm1hblRhYmxlc0FDKVtodWZmbWFuVGFibGVTcGVjICYgMTVdID1cbiAgICAgICAgICAgICAgICBidWlsZEh1ZmZtYW5UYWJsZShjb2RlTGVuZ3RocywgaHVmZm1hblZhbHVlcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgMHhGRkREOiAvLyBEUkkgKERlZmluZSBSZXN0YXJ0IEludGVydmFsKVxuICAgICAgICAgICAgcmVhZFVpbnQxNigpOyAvLyBza2lwIGRhdGEgbGVuZ3RoXG4gICAgICAgICAgICByZXNldEludGVydmFsID0gcmVhZFVpbnQxNigpO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIDB4RkZEQTogLy8gU09TIChTdGFydCBvZiBTY2FuKVxuICAgICAgICAgICAgdmFyIHNjYW5MZW5ndGggPSByZWFkVWludDE2KCk7XG4gICAgICAgICAgICB2YXIgc2VsZWN0b3JzQ291bnQgPSBkYXRhW29mZnNldCsrXTtcbiAgICAgICAgICAgIHZhciBjb21wb25lbnRzID0gW10sIGNvbXBvbmVudDtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBzZWxlY3RvcnNDb3VudDsgaSsrKSB7XG4gICAgICAgICAgICAgIHZhciBjb21wb25lbnRJbmRleCA9IGZyYW1lLmNvbXBvbmVudElkc1tkYXRhW29mZnNldCsrXV07XG4gICAgICAgICAgICAgIGNvbXBvbmVudCA9IGZyYW1lLmNvbXBvbmVudHNbY29tcG9uZW50SW5kZXhdO1xuICAgICAgICAgICAgICB2YXIgdGFibGVTcGVjID0gZGF0YVtvZmZzZXQrK107XG4gICAgICAgICAgICAgIGNvbXBvbmVudC5odWZmbWFuVGFibGVEQyA9IGh1ZmZtYW5UYWJsZXNEQ1t0YWJsZVNwZWMgPj4gNF07XG4gICAgICAgICAgICAgIGNvbXBvbmVudC5odWZmbWFuVGFibGVBQyA9IGh1ZmZtYW5UYWJsZXNBQ1t0YWJsZVNwZWMgJiAxNV07XG4gICAgICAgICAgICAgIGNvbXBvbmVudHMucHVzaChjb21wb25lbnQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIHNwZWN0cmFsU3RhcnQgPSBkYXRhW29mZnNldCsrXTtcbiAgICAgICAgICAgIHZhciBzcGVjdHJhbEVuZCA9IGRhdGFbb2Zmc2V0KytdO1xuICAgICAgICAgICAgdmFyIHN1Y2Nlc3NpdmVBcHByb3hpbWF0aW9uID0gZGF0YVtvZmZzZXQrK107XG4gICAgICAgICAgICB2YXIgcHJvY2Vzc2VkID0gZGVjb2RlU2NhbihkYXRhLCBvZmZzZXQsXG4gICAgICAgICAgICAgIGZyYW1lLCBjb21wb25lbnRzLCByZXNldEludGVydmFsLFxuICAgICAgICAgICAgICBzcGVjdHJhbFN0YXJ0LCBzcGVjdHJhbEVuZCxcbiAgICAgICAgICAgICAgc3VjY2Vzc2l2ZUFwcHJveGltYXRpb24gPj4gNCwgc3VjY2Vzc2l2ZUFwcHJveGltYXRpb24gJiAxNSk7XG4gICAgICAgICAgICBvZmZzZXQgKz0gcHJvY2Vzc2VkO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIGlmIChkYXRhW29mZnNldCAtIDNdID09IDB4RkYgJiZcbiAgICAgICAgICAgICAgZGF0YVtvZmZzZXQgLSAyXSA+PSAweEMwICYmIGRhdGFbb2Zmc2V0IC0gMl0gPD0gMHhGRSkge1xuICAgICAgICAgICAgICAvLyBjb3VsZCBiZSBpbmNvcnJlY3QgZW5jb2RpbmcgLS0gbGFzdCAweEZGIGJ5dGUgb2YgdGhlIHByZXZpb3VzXG4gICAgICAgICAgICAgIC8vIGJsb2NrIHdhcyBlYXRlbiBieSB0aGUgZW5jb2RlclxuICAgICAgICAgICAgICBvZmZzZXQgLT0gMztcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aHJvdyBcInVua25vd24gSlBFRyBtYXJrZXIgXCIgKyBmaWxlTWFya2VyLnRvU3RyaW5nKDE2KTtcbiAgICAgICAgfVxuICAgICAgICBmaWxlTWFya2VyID0gcmVhZFVpbnQxNigpO1xuICAgICAgfVxuXG4gICAgICB0aGlzLndpZHRoID0gZnJhbWUuc2FtcGxlc1BlckxpbmU7XG4gICAgICB0aGlzLmhlaWdodCA9IGZyYW1lLnNjYW5MaW5lcztcbiAgICAgIHRoaXMuamZpZiA9IGpmaWY7XG4gICAgICB0aGlzLmFkb2JlID0gYWRvYmU7XG4gICAgICB0aGlzLmNvbXBvbmVudHMgPSBbXTtcbiAgICAgIHN3aXRjaCAoZnJhbWUuY29tcG9uZW50cy5sZW5ndGgpXG4gICAgICB7XG4gICAgICAgIGNhc2UgMTpcbiAgICAgICAgICB0aGlzLmNvbG9yc3BhY2UgPSBDb2xvclNwYWNlLkdyYXlzY2FsZTtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAzOlxuICAgICAgICAgIGlmICh0aGlzLmFkb2JlKVxuICAgICAgICAgICAgdGhpcy5jb2xvcnNwYWNlID0gQ29sb3JTcGFjZS5BZG9iZVJHQjtcbiAgICAgICAgICBlbHNlXG4gICAgICAgICAgICB0aGlzLmNvbG9yc3BhY2UgPSBDb2xvclNwYWNlLlJHQjtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSA0OlxuICAgICAgICAgIHRoaXMuY29sb3JzcGFjZSA9IENvbG9yU3BhY2UuQ1lNSztcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICB0aGlzLmNvbG9yc3BhY2UgPSBDb2xvclNwYWNlLlVua25vd247XG4gICAgICB9XG4gICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGZyYW1lLmNvbXBvbmVudHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgdmFyIGNvbXBvbmVudCA9IGZyYW1lLmNvbXBvbmVudHNbaV07XG4gICAgICAgIGlmICghY29tcG9uZW50LnF1YW50aXphdGlvblRhYmxlICYmIGNvbXBvbmVudC5xdWFudGl6YXRpb25UYWJsZUlkICE9PSBudWxsKVxuICAgICAgICAgIGNvbXBvbmVudC5xdWFudGl6YXRpb25UYWJsZSA9IHF1YW50aXphdGlvblRhYmxlc1tjb21wb25lbnQucXVhbnRpemF0aW9uVGFibGVJZF07XG4gICAgICAgIHRoaXMuY29tcG9uZW50cy5wdXNo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bCk7XG4gICAgICAgICAgICB2YXIgb2Zmc2V0ID0gMCwgc2FtcGxlID0gYmxvY2tDb2wgPDwgMztcbiAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCA4OyBqKyspIHtcbiAgICAgICAgICAgICAgdmFyIGxpbmVPZmZzZXQgPSAoc2NhbkxpbmUgKyBqKSAqIHNhbXBsZXNQZXJMaW5lO1xuICAgICAgICAgICAgICBmb3IgKGsgPSAwOyBrIDwgODsgaysrKSB7XG4gICAgICAgICAgICAgICAgbGluZURhdGFbbGluZU9mZnNldCArIHNhbXBsZSArIGtdID1cbiAgICAgICAgICAgICAgICAgIGNvbXBvbmVudC5vdXRwdXRbYnVmZmVyT2Zmc2V0ICsgb2Zmc2V0KytdO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgY29tcG9uZW50U2NhbGVYID0gY29tcG9uZW50LnNjYWxlWCAqIHNjYWxlWDtcbiAgICAgICAgY29tcG9uZW50U2NhbGVZID0gY29tcG9uZW50LnNjYWxlWSAqIHNjYWxlWTtcbiAgICAgICAgb2Zmc2V0ID0gaTtcblxuICAgICAgICB2YXIgY3gsIGN5O1xuICAgICAgICB2YXIgaW5kZXg7XG4gICAgICAgIGZvciAoeSA9IDA7IHkgPCBoZWlnaHQ7IHkrKykge1xuICAgICAgICAgIGZvciAoeCA9IDA7IHggPCB3aWR0aDsgeCsrKSB7XG4gICAgICAgICAgICBjeSA9IDAgfCAoeSAqIGNvbXBvbmVudFNjYWxlWSk7XG4gICAgICAgICAgICBjeCA9IDAgfCAoeCAqIGNvbXBvbmVudFNjYWxlWCk7XG4gICAgICAgICAgICBpbmRleCA9IGN5ICogc2FtcGxlc1BlckxpbmUgKyBjeDtcbiAgICAgICAgICAgIGRhdGFbb2Zmc2V0XSA9IGxpbmVEYXRhW2luZGV4XTtcbiAgICAgICAgICAgIG9mZnNldCArPSBudW1Db21wb25lbnRzO1xuICAgICA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ldCArIG9mZnNldCsrXSAqIGNvbXBvbmVudC5iaXRDb252ZXJzaW9uO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgY29tcG9uZW50U2NhbGVYID0gY29tcG9uZW50LnNjYWxlWCAqIHNjYWxlWDtcbiAgICAgICAgY29tcG9uZW50U2NhbGVZID0gY29tcG9uZW50LnNjYWxlWSAqIHNjYWxlWTtcbiAgICAgICAgb2Zmc2V0ID0gaTtcblxuICAgICAgICB2YXIgY3gsIGN5O1xuICAgICAgICB2YXIgaW5kZXg7XG4gICAgICAgIGZvciAoeSA9IDA7IHkgPCBoZWlnaHQ7IHkrKykge1xuICAgICAgICAgIGZvciAoeCA9IDA7IHggPCB3aWR0aDsgeCsrKSB7XG4gICAgICAgICAgICBjeSA9IDAgfCAoeSAqIGNvbXBvbmVudFNjYWxlWSk7XG4gICAgICAgICAgICBjeCA9IDAgfCAoeCAqIGNvbXBvbmVudFNjYWxlWCk7XG4gICAgICAgICAgICBpbmRleCA9IGN5ICogc2FtcGxlc1BlckxpbmUgKyBjeDtcbiAgICAgICAgICAgIGRhdGFbb2Zmc2V0XSA9IGxpbmVEYXRhW2luZGV4XTtcbiAgICAgICAgICAgIG9mZnNldCArPSBudW1Db21wb25lbnRzO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICAvLyAuLi4gdGhlbiB0cmFuc2Zvcm0gY29sb3JzLCBpZiBuZWNlc3NhcnlcbiAgICAgIHN3aXRjaCAobnVtQ29tcG9uZW50cykge1xuICAgICAgICBjYXNlIDE6XG4gICAgICAgIGNhc2UgMjpcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgLy8gbm8gY29sb3IgY29udmVyc2lvbiBmb3Igb25lIG9yIHR3byBjb21wb2VuZW50c1xuXG4gICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAvLyBUaGUgZGVmYXVsdCB0cmFuc2Zvcm0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gICAgICAgICAgICB2YXIgY29sb3JzcGFjZSA9IHJlYWRVaW50MzIoZGF0YSwgcG9zaXRpb24gKyAzKTtcbiAgICAgICAgICAgICAgc3dpdGNoIChjb2xvcnNwYWNlKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAxNjogLy8gdGhpcyBpbmRpY2F0ZXMgYSBzUkdCIGNvbG9yc3BhY2VcbiAgICAgICAgICAgICAgICBjYXNlIDE3OiAvLyB0aGlzIGluZGljYXRlcyBhIGdyYXlzY2FsZSBjb2xvcnNwYWNlXG4gICAgICAgICAgICAgICAgY2FzZSAxODogLy8gdGhpcyBpbmRpY2F0ZXMgYSBZVVYgY29sb3JzcGFjZVxuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgIHdhcm4oJ1Vua25vd24gY29sb3JzcGFjZSAnICsgY29sb3JzcGFjZSk7XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXRob2QgPT09IDIpIHtcbiAgICAgICAgICAgICAgaW5mbygnSUNDIHByb2ZpbGUgbm90IHN1cHBvcnRlZCcpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSAweDZBNzAzMjYzOiAvLyAnanAyYydcbiAgICAgICAgICAgIHRoaXMucGFyc2VDb2Rlc3RyZWFtKGRhdGEsIHBvc2l0aW9uLCBwb3NpdGlvbiArIGRhdGFMZW5ndGgpO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSAweDZBNTAyMDIwOiAvLyAnalBcXDAyNFxcMDI0J1xuICAgICAgICAgICAgaWYgKDB4MGQwYTg3MGEgIT09IHJlYWRVaW50MzIoZGF0YSwgcG9zaXRpb24pKSB7XG4gICAgICAgICAgICAgIHdhcm4oJ0ludmFsaWQgSlAyIHNpZ25hdHVyZScpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgLy8gVGhlIGZvbGxvd2luZyBoZWFkZXIgdHlwZXMgYXJlIHZhbGlkIGJ1dCBjdXJyZW50bHkgbm90IHVzZWQ6XG4gICAgICAgICAgY2FzZSAweDZBNTAxQTFBOiAvLyAnalBcXDAzMlxcMDMyJ1xuICAgICAgICAgIGNhc2UgMHg2Njc0Nzk3MDogLy8gJ2Z0eXAnXG4gICAgICAgICAgY2FzZSAweDcyNzI2NTcxOiAvLyAncnJlcSdcbiAgICAgICAgICBjYXNlIDB4NzI2NTczMjA6IC8vICdyZXMgJ1xuICAgICAgICAgIGNhc2UgMHg2OTY4NjQ3MjogLy8gJ2loZHInXG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgdmFyIGhlYWRlclR5cGUgPSBTdHJpbmcuZnJvbUNoYXJDb2RlKCh0Ym94ID4+IDI0KSAmIDB4RkYsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRib3ggPj4gMTYpICYgMHhGRixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodGJveCA+PiA4KSAmIDB4RkYsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGJveCAmIDB4RkYpO1xuICAgICAgICAgICAgd2FybignVW5zdXBwb3J0ZWQgaGVhZGVyIHR5cGUgJyArIHRib3ggKyAnICgnICsgaGVhZGVyVHlwZSArICcpJyk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBpZiAoanVtcERhdGFMZW5ndGgpIHtcbiAgICAgICAgICBwb3NpdGlvbiArPSBkYXRhTGVuZ3RoO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSxcbiAgICBwYXJzZUltYWdlUHJvcGVydGllczogZnVuY3Rpb24gSnB4SW1h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VyQ29tcG9uZW50ID0gODtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHRocm93IG5ldyBFcnJvcignSlBYIEVycm9yOiBObyBzaXplIG1hcmtlciBmb3VuZCBpbiBKUFggc3RyZWFtJyk7XG4gICAgfSxcbiAgICBwYXJzZUNvZGVzdHJlYW06IGZ1bmN0aW9uIEpweEltYWdlX3BhcnNlQ29kZXN0cmVhbShkYXRhLCBzdGFydCwgZW5kKSB7XG4gICAgICB2YXIgY29udGV4dCA9IHt9O1xuICAgICAgdHJ5IHtcbiAgICAgICAgdmFyIGRvTm90UmVjb3ZlciA9IGZhbHNlO1xuICAgICAgICB2YXIgcG9zaXRpb24gPSBzdGFydDtcbiAgICAgICAgd2hpbGUgKHBvc2l0aW9uICsgMSA8IGVuZCkge1xuICAgICAgICAgIHZhciBjb2RlID0gcmVhZFVpbnQxNihkYXRhLCBwb3NpdGlvbik7XG4gICAgICAgICAgcG9zaXRpb24gKz0gMjtcblxuICAgICAgICAgIHZhciBsZW5ndGggPSAwLCBqLCBzcWNkLCBzcHFjZHMsIHNwcWNkU2l6ZSwgc2NhbGFyRXhwb3VuZGVkLCB0aWxlO1xuICAgICAgICAgIHN3aXRjaCAoY29kZSkge1xuICAgICAgICAgICAgY2FzZSAweEZGNEY6IC8vIFN0YXJ0IG9mIGNvZGVzdHJlYW0gKFNPQylcbiAgICAgICAgICAgICAgY29udGV4dC5tYWluSGVhZGVyID0gdHJ1ZTtcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDB4RkZEOTogLy8gRW5kIG9mIGNvZGVzdHJlYW0gKEVPQylcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDB4RkY1MTogLy8gSW1hZ2UgYW5kIHRpbGUgc2l6ZSAoU0laKVxuICAgICAgICAgICAgICBsZW5ndGggPSByZWFkVWludDE2KGRhdGEsIHBvc2l0aW9uKTtcbiAgICAgICAgICAgICAgdmFyIHNpeiA9IHt9O1xuICAgICAgICAgICAgICBzaXouWHNpeiA9IHJlYWRVaW50MzIoZGF0YSwgcG9zaXRpb24gKyA0KTtcbiAgICAgICAgICAgICAgc2l6LllzaXogPSByZWFkVWludDMyKGRhdGEsIHBvc2l0aW9uICsgOCk7XG4gICAgICAgICAgICAgIHNpei5YT3NpeiA9IHJlYWRVaW50MzIoZGF0YSwgcG9zaXRpb24gKyAxMik7XG4gICAgICAgICAgICAgIHNpei5ZT3NpeiA9IHJlYWRVaW50MzIoZGF0YSwgcG9zaXRpb24gKyAxNik7XG4gICAgICAgICAgICAgIHNpei5YVHNpeiA9IHJlYWRVaW50MzIoZGF0YSwgcG9zaXRpb24gKyAyMCk7XG4gICAgICAgICAgICAgIHNpei5ZVHNpeiA9IHJlYWRVaW50MzIoZGF0YSwgcG9zaXRpb24gKyAyNCk7XG4gICAgICAgICAgICAgIHNpei5YVE9zaXogPSByZWFkVWludDMyKGRhdGEsIHBvc2l0aW9uICsgMjgpO1xuICAgICAgICAgICAgICBzaXouWVRPc2l6ID0gcmVhZFVpbnQzMihkYXRhLCBwb3NpdGlvbiArIDMyKTtcbiAgICAgICAgICAgICAgdmFyIGNvbXBvbmVudHNDb3VudCA9IHJlYWRVaW50MTYoZGF0YSwgcG9zaXRpb24gKyAzNik7XG4gICAgICAgICAgICAgIHNpei5Dc2l6ID0gY29tcG9uZW50c0NvdW50O1xuICAgICAgICAgICAgICB2YXIgY29tcG9uZW50cyA9IFtdO1xuICAgICAgICAgICAgICBqID0gcG9zaXRpb24gKyAzODtcbiAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjb21wb25lbnRzQ291bnQ7IGkrKykge1xuICAgICAgICAgICAgICAgIHZhciBjb21wb25lbnQgPSB7XG4gICAgICAgICAgICAgICAgICBwcmVjaXNpb246IChkYXRhW2pdICYgMHg3RikgKyAxLFxuICAgICAgICAgICAgICAgICAgaXNTaWduZWQ6ICEhKGRhdGFbal0gJiAweDgwKSxcbiAgICAgICAgICAgICAgICAgIFhSc2l6OiBkYXRhW2ogKyAxXSxcbiAgICAgICAgICAgICAgICAgIFlSc2l6OiBkYXRhW2ogKyAxXVxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgY2FsY3VsYXRlQ29tcG9uZW50RGltZW5zaW9ucyhjb21wb25lbnQsIHNpeik7XG4gICAgICAgICAgICAgICAgY29tcG9uZW50cy5wdXNoKGNvbXBvbmVudCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgY29udGV4dC5TSVogPSBzaXo7XG4gICAgICAgICAgICAgIGNvbnRleHQuY29tcG9uZW50cyA9IGNvbXBvbmVudHM7XG4gICAgICAgICAgICAgIGNhbGN1bGF0ZVRpbGVHcmlkcyhjb250ZXh0LCBjb21wb25lbnRzKTtcbiAgICAgICAgICAgICAgY29udGV4dC5RQ0MgPSBbXTtcbiAgICAgICAgICAgICAgY29udGV4dC5DT0MgPSBbXTtcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDB4RkY1QzogLy8gUXVhbnRpemF0aW9uIGRlZmF1bHQgKFFDRClcbiAgICAgICAgICAgICAgbGVuZ3RoID0gcmVhZFVpbnQxNihkYXRhLCBwb3NpdGlvbik7XG4gICAgICAgICAgICAgIHZhciBxY2QgPSB7fTtcbiAgICAgICAgICAgICAgaiA9IHBvc2l0aW9uICsgMjtcbiAgICAgICAgICAgICAgc3FjZCA9IGRhdGFbaisrXTtcbiAgICAgICAgICAgICAgc3dpdGNoIChzcWNkICYgMHgxRikge1xuICAgICAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgICAgIHNwcWNkU2l6ZSA9IDg7XG4gICAgICAgICAgICAgICAgICBzY2FsYXJFeHBvdW5kZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgICAgICAgc3BxY2RTaXplID0gMTY7XG4gICAgICAgICAgICAgICAgICBzY2FsYXJFeHBvdW5kZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICAgIHNwcWNkU2l6ZSA9IDE2O1xuICAgICAgICAgICAgICAgICAgc2NhbGFyRXhwb3VuZGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0pQWCBFcnJvcjogSW52YWxpZCBTUWNkIHZhbHVlICcgKyBzcWNkKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBxY2Qubm9RdWFudGl6YXRpb24gPSAoc3BxY2RTaXplID09PSA4KTtcbiAgICAgICAgICAgICAgcWNkLnNjYWxhckV4cG91bmRlZCA9IHNjYWxhckV4cG91bmRlZDtcbiAgICAgICAgICAgICAgcWNkLmd1YXJkQml0cyA9IHNxY2QgPj4gNTtcbiAgICAgICAgICAgICAgc3BxY2RzID0gW107XG4gICAgICAgICAgICAgIHdoaWxlIChqIDwgbGVuZ3RoICsgcG9zaXRpb24pIHtcbiAgICAgICAgICAgICAgICB2YXIgc3BxY2QgPSB7fTtcbiAgICAgICAgICAgICAgICBpZiAoc3BxY2RTaXplID09PSA4KSB7XG4gICAgICAgICAgICAgICAgICBzcHFjZC5lcHNpbG9uID0gZGF0YVtqKytdID4+IDM7XG4gICAgICAgICAgICAgICAgICBzcHFjZC5tdSA9IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgIHNwcWNkLmVwc2lsb24gPSBkYXRhW2pdID4+IDM7XG4gICAgICAgICAgICAgICAgICBzcHFjZC5tdSA9ICgoZGF0YVtqXSAmIDB4NykgPDwgOCkgfCBkYXRhW2ogKyAxXTtcbiAgICAgICAgICAgICAgICAgIGogKz0gMjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgc3BxY2RzLnB1c2goc3BxY2QpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHFjZC5TUHFjZHMgPSBzcHFjZHM7XG4gICAgICAgICAgICAgIGlmIChjb250ZXh0Lm1haW5IZWFkZXIpIHtcbiAgICAgICAgICAgICAgICBjb250ZXh0LlFDRCA9IHFjZDtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb250ZXh0LmN1cnJlbnRUaWxlLlFDRCA9IHFjZDtcbiAgICAgICAgICAgICAgICBjb250ZXh0LmN1cnJlbnRUaWxlLlFDQyA9IFtdO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAweEZGNUQ6IC8vIFF1YW50aXphdGlvbiBjb21wb25lbnQgKFFDQylcbiAgICAgICAgICAgICAgbGVuZ3RoID0gcmVhZFVpbnQxNihkYXRhLCBwb3NpdGlvbik7XG4gICAgICAgICAgICAgIHZhciBxY2MgPSB7fTtcbiAgICAgICAgICAgICAgaiA9IHBvc2l0aW9uICsgMjtcbiAgICAgICAgICAgICAgdmFyIGNxY2M7XG4gICAgICAgICAgICAgIGlmIChjb250ZXh0LlNJWi5Dc2l6IDwgMjU3KSB7XG4gICAgICAgICAgICAgICAgY3FjYyA9IGRhdGFbaisrXTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjcWNjID0gcmVhZFVpbnQxNihkYXRhLCBqKTtcbiAgICAgICAgICAgICAgICBqICs9IDI7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgc3FjZCA9IGRhdGFbaisrXTtcbiAgICAgICAgICAgICAgc3dpdGNoIChzcWNkICYgMHgxRikge1xuICAgICAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgICAgIHNwcWNkU2l6ZSA9IDg7XG4gICAgICAgICAgICAgICAgICBzY2FsYXJFeHBvdW5kZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgICAgICAgc3BxY2RTaXplID0gMTY7XG4gICAgICAgICAgICAgICAgICBzY2FsYXJFeHBvdW5kZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICAgIHNwcWNkU2l6ZSA9IDE2O1xuICAgICAgICAgICAgICAgICAgc2NhbGFyRXhwb3VuZGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0pQWCBFcnJvcjogSW52YWxpZCBTUWNkIHZhbHVlICcgKyBzcWNkKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBxY2Mubm9RdWFudGl6YXRpb24gPSAoc3BxY2RTaXplID09PSA4KTtcbiAgICAgICAgICAgICAgcWNjLnNjYWxhckV4cG91bmRlZCA9IHNjYWxhckV4cG91bmRlZDtcbiAgICAgICAgICAgICAgcWNjLmd1YXJkQml0cyA9IHNxY2QgPj4gNTtcbiAgICAgICAgICAgICAgc3BxY2RzID0gW107XG4gICAgICAgICAgICAgIHdoaWxlIChqIDwgKGxlbmd0aCArIHBvc2l0aW9uKSkge1xuICAgICAgICAgICAgICAgIHNwcWNkID0ge307XG4gICAgICAgICAgICAgICAgaWYgKHNwcWNkU2l6ZSA9PT0gOCkge1xuICAgICAgICAgICAgICAgICAgc3BxY2QuZXBzaWxvbiA9IGRhdGFbaisrXSA+PiAzO1xuICAgICAgICAgICAgICAgICAgc3BxY2QubXUgPSAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICBzcHFjZC5lcHNpbG9uID0gZGF0YVtqXSA+PiAzO1xuICAgICAgICAgICAgICAgICAgc3BxY2QubXUgPSAoKGRhdGFbal0gJiAweDcpIDw8IDgpIHwgZGF0YVtqICsgMV07XG4gICAgICAgICAgICAgICAgICBqICs9IDI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHNwcWNkcy5wdXNoKHNwcWNkKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBxY2MuU1BxY2RzID0gc3BxY2RzO1xuICAgICAgICAgICAgICBpZiAoY29udGV4dC5tYWluSGVhZGVyKSB7XG4gICAgICAgICAgICAgICAgY29udGV4dC5RQ0NbY3FjY10gPSBxY2M7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgY29udGV4dC5jdXJyZW50VGlsZS5RQ0NbY3FjY10gPSBxY2M7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDB4RkY1MjogLy8gQ29kaW5nIHN0eWxlIGRlZmF1bHQgKENPRClcbiAgICAgICAgICAgICAgbGVuZ3RoID0gcmVhZFVpbnQxNihkYXRhLCBwb3NpdGlvbik7XG4gICAgICAgICAgICAgIHZhciBjb2QgPSB7fTtcbiAgICAgICAgICAgICAgaiA9IHBvc2l0aW9uICsgMjtcbiAgICAgICAgICAgICAgdmFyIHNjb2QgPSBkYXRhW2orK107XG4gICAgICAgICAgICAgIGNvZC5lbnRyb3B5Q29kZXJXaXRoQ3VzdG9tUHJlY2luY3RzID0gISEoc2NvZCAmIDEpO1xuICAgICAgICAgICAgICBjb2Quc29wTWFya2VyVXNlZCA9ICEhKHNjb2QgJiAyKTtcbiAgICAgICAgICAgICAgY29kLmVwaE1hcmtlclVzZWQgPSAhIShzY29kICYgNCk7XG4gICAgICAgICAgICAgIGNvZC5wcm9ncmVzc2lvbk9yZGVyID0gZGF0YVtqKytdO1xuICAgICAgICAgICAgICBjb2QubGF5ZXJzQ291bnQgPSByZWFkVWludDE2KGRhdGEsIGopO1xuICAgICAgICAgICAgICBqICs9IDI7XG4gICAgICAgICAgICAgIGNvZC5tdWx0aXBsZUNvbXBvbmVudFRyYW5zZm9ybSA9IGRhdGFbaisrXTtcblxuICAgICAgICAgICAgICBjb2QuZGVjb21wb3NpdGlvbkxldmVsc0NvdW50ID0gZGF0YVtqKytdO1xuICAgICAgICAgICAgICBjb2QueGNiID0gKGRhdGFbaisrXSAmIDB4RikgKyAyO1xuICAgICAgICAgICAgICBjb2QueWNiID0gKGRhdGFbaisrXSAmIDB4RikgKyAyO1xuICAgICAgICAgICAgICB2YXIgYmxvY2tTdHlsZSA9IGRhdGFbaisrXTtcbiAgICAgICAgICAgICAgY29kLnNlbGVjdGl2ZUFyaXRobWV0aWNDb2RpbmdCeXBhc3MgPSAhIShibG9ja1N0eWxlICYgMSk7XG4gICAgICAgICAgICAgIGNvZC5yZXNldENvbnRleHRQcm9iYWJpbGl0aWVzID0gISEoYmxvY2tTdHlsZSAmIDIpO1xuICAgICAgICAgICAgICBjb2QudGVybWluYXRpb25PbkVhY2hDb2RpbmdQYXNzID0gISEoYmxvY2tTdHlsZSAmIDQpO1xuICAgICAgICAgICAgICBjb2QudmVydGljYWx5U3RyaXBlID0gISEoYmxvY2tTdHlsZSAmIDgpO1xuICAgICAgICAgICAgICBjb2QucHJlZGljdGFibGVUZXJtaW5hdGlvbiA9ICEhKGJsb2NrU3R5bGUgJiAxNik7XG4gICAgICAgICAgICAgIGNvZC5zZWdtZW50YXRpb25TeW1ib2xVc2VkID0gISEoYmxvY2tTdHlsZSAmIDMyKTtcbiAgICAgICAgICAgICAgY29kLnJldmVyc2libGVUcmFuc2Zvcm1hdGlvbiA9IGRhdGFbaisrXTtcbiAgICAgICAgICAgICAgaWYgKGNvZC5lbnRyb3B5Q29kZXJXaXRoQ3VzdG9tUHJlY2luY3RzKSB7XG4gICAgICAgICAgICAgICAgdmFyIHByZWNpbmN0c1NpemVzID0gW107XG4gICAgICAgICAgICAgICAgd2hpbGUgKGogPCBsZW5ndGggKyBwb3NpdGlvbikge1xuICAgICAgICAgICAgICAgICAgdmFyIHByZWNpbmN0c1NpemUgPSBkYXRhW2orK107XG4gICAgICAgICAgICAgICAgICBwcmVjaW5jdHNTaXplcy5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgUFB4OiBwcmVjaW5jdHNTaXplICYgMHhGLFxuICAgICAgICAgICAgICAgICAgICBQUHk6IHByZWNpbmN0c1NpemUgPj4gNFxuICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNvZC5wcmVjaW5jdHNTaXplcyA9IHByZWNpbmN0c1NpemVzO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHZhciB1bnN1cHBvcnRlZCA9IFtdO1xuICAgICAgICAgICAgICBpZiAoY29kLnNlbGVjdGl2ZUFyaXRobWV0aWNDb2RpbmdCeXBhc3MpIHtcbiAgICAgICAgICAgICAgICB1bnN1cHBvcnRlZC5wdXNoKCdzZWxlY3RpdmVBcml0aG1ldGljQ29kaW5nQnlwYXNzJyk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKGNvZC5yZXNldENvbnRleHRQcm9iYWJpbGl0aWVzKSB7XG4gICAgICAgICAgICAgICAgdW5zdXBwb3J0ZWQucHVzaCgncmVzZXRDb250ZXh0UHJvYmFiaWxpdGllcycpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChjb2QudGVybWluYXRpb25PbkVhY2hDb2RpbmdQYXNzKSB7XG4gICAgICAgICAgICAgICAgdW5zdXBwb3J0ZWQucHVzaCgndGVybWluYXRpb25PbkVhY2hDb2RpbmdQYXNzJyk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKGNvZC52ZXJ0aWNhbHlTdHJpcGUpIHtcbiAgICAgICAgICAgICAgICB1bnN1cHBvcnRlZC5wdXNoKCd2ZXJ0aWNhbHlTdHJpcGUnKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAoY29kLnByZWRpY3RhYmxlVGVybWluYXRpb24pIHtcbiAgICAgICAgICAgICAgICB1bnN1cHBvcnRlZC5wdXNoKCdwcmVkaWN0YWJsZVRlcm1pbmF0aW9uJyk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKHVuc3VwcG9ydGVkLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICBkb05vdFJlY292ZXIgPSB0cnVlO1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignSlBYIEVycm9yOiBVbnN1cHBvcnRlZCBDT0Qgb3B0aW9ucyAoJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc3VwcG9ydGVkLmpvaW4oJywgJykgKyAnKScpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChjb250ZXh0Lm1haW5IZWFkZXIpIHtcbiAgICAgICAgICAgICAgICBjb250ZXh0LkNPRCA9IGNvZDtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb250ZXh0LmN1cnJlbnRUaWxlLkNPRCA9IGNvZDtcbiAgICAgICAgICAgICAgICBjb250ZXh0LmN1cnJlbnRUaWxlLkNPQyA9IFtdO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAweEZGOTA6IC8vIFN0YXJ0IG9mIHRpbGUtcGFydCAoU09UKVxuICAgICAgICAgICAgICBsZW5ndGggPSByZWFkVWludDE2KGRhdGEsIHBvc2l0aW9uKTtcbiAgICAgICAgICAgICAgdGlsZSA9IHt9O1xuICAgICAgICAgICAgICB0aWxlLmluZGV4ID0gcmVhZFVpbnQxNihkYXRhLCBwb3NpdGlvbiArIDIpO1xuICAgICAgICAgICAgICB0aWxlLmxlbmd0aCA9IHJlYWRVaW50MzIoZGF0YSwgcG9zaXRpb24gKyA0KTtcbiAgICAgICAgICAgICAgdGlsZS5kYXRhRW5kID0gdGlsZS5sZW5ndGggKyBwb3NpdGlvbiAtIDI7XG4gICAgICAgICAgICAgIHRpbGUucGFydEluZGV4ID0gZGF0YVtwb3NpdGlvbiArIDhdO1xuICAgICAgICAgICAgICB0aWxlLnBhcnRzQ291bnQgPSBkYXRhW3Bvc2l0aW9uICsgOV07XG5cbiAgICAgICAgICAgICAgY29udGV4dC5tYWluSGVhZGVyID0gZmFsc2U7XG4gICAgICAgICAgICAgIGlmICh0aWxlLnBhcnRJbmRleCA9PT0gMCkge1xuICAgICAgICAgICAgICAgIC8vIHJlc2V0IGNvbXBvbmVudCBzcGVjaWZpYyBzZXR0aW5nc1xuICAgICAgICAgICAgICAgIHRpbGUuQ09EID0gY29udGV4dC5DT0Q7XG4gICAgICAgICAgICAgICAgdGlsZS5DT0MgPSBjb250ZXh0LkNPQy5zbGljZSgwKTsgLy8gY2xvbmUgb2YgdGhlIGdsb2JhbCBDT0NcbiAgICAgICAgICAgICAgICB0aWxlLlFDRCA9IGNvbnRleHQuUUNEO1xuICAgICAgICAgICAgICAgIHRpbGUuUUNDID0gY29udGV4dC5RQ0Muc2xpY2UoMCk7IC8vIGNsb25lIG9mIHRoZSBnbG9iYWwgQ09DXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgY29udGV4dC5jdXJyZW50VGlsZSA9IHRpbGU7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAweEZGOTM6IC8vIFN0YXJ0IG9mIGRhdGEgKFNPRClcbiAgICAgICAgICAgICAgdGlsZSA9IGNvbnRleHQuY3VycmVudFRpbGU7XG4gICAgICAgICAgICAgIGlmICh0aWxlLnBhcnRJbmRleCA9PT0gMCkge1xuICAgICAgICAgICAgICAgIGluaXRpYWxpemVUaWxlKGNvbnRleHQsIHRpbGUuaW5kZXgpO1xuICAgICAgICAgICAgICAgIGJ1aWxkUGFja2V0cyhjb250ZXh0KTtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIC8vIG1vdmluZyB0byB0aGUgZW5kIG9mIHRoZSBkYXRhXG4gICAgICAgICAgICAgIGxlbmd0aCA9IHRpbGUuZGF0YUVuZCAtIHBvc2l0aW9uO1xuICAgICAgICAgICAgICBwYXJzZVRpbGVQYWNrZXRzKGNvbnRleHQsIGRhdGEsIHBvc2l0aW9uLCBsZW5ndGgpO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMHhGRjU1OiAvLyBUaWxlLXBhcnQgbGVuZ3RocywgbWFpbiBoZWFkZXIgKFRMTSlcbiAgICAgICAgICAgIGNhc2UgMHhGRjU3OiAvLyBQYWNrZXQgbGVuZ3RoLCBtYWluIGhlYWRlciAoUExNKVxuICAgICAgICAgICAgY2FzZSAweEZGNTg6IC8vIFBhY2tldCBsZW5ndGgsIHRpbGUtcGFydCBoZWFkZXIgKFBMVClcbiAgICAgICAgICAgIGNhc2UgMHhGRjY0OiAvLyBDb21tZW50IChDT00pXG4gICAgICAgICAgICAgIGxlbmd0aCA9IHJlYWRVaW50MTYoZGF0YSwgcG9zaXRpb24pO1xuICAgICAgICAgICAgICAvLyBza2lwcGluZyBjb250ZW50XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAweEZGNTM6IC8vIENvZGluZyBzdHlsZSBjb21wb25lbnQgKENPQylcbiAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdKUFggRXJyb3I6IENvZGVzdHJlYW0gY29kZSAweEZGNTMgKENPQykgaXMgJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbm90IGltcGxlbWVudGVkJyk7XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0pQWCBFcnJvcjogVW5rbm93biBjb2Rlc3RyZWFtIGNvZGU6ICcg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C8gY29tcG9uZW50LllSc2l6KTtcbiAgICBjb21wb25lbnQud2lkdGggPSBjb21wb25lbnQueDEgLSBjb21wb25lbnQueDA7XG4gICAgY29tcG9uZW50LmhlaWdodCA9IGNvbXBvbmVudC55MSAtIGNvbXBvbmVudC55MDtcbiAgfVxuICBmdW5jdGlvbiBjYWxjdWxhdGVUaWxlR3JpZHMoY29udGV4dCwgY29tcG9uZW50cykge1xuICAgIHZhciBzaXogPSBjb250ZXh0LlNJWjtcbiAgICAvLyBTZWN0aW9uIEIuMyBEaXZpc2lvbiBpbnRvIHRpbGUgYW5kIHRpbGUtY29tcG9uZW50c1xuICAgIHZhciB0aWxlLCB0aWxlcyA9IFtdO1xuICAgIHZhciBudW1YdGlsZXMgPSBNYXRoLmNlaWwoKHNpei5Yc2l6IC0gc2l6LlhUT3NpeikgLyBzaXouWFRzaXopO1xuICAgIHZhciBudW1ZdGlsZXMgPSBNYXRoLmNlaWwoKHNpei5Zc2l6IC0gc2l6LllUT3NpeikgLyBzaXouWVRzaXopO1xuICAgIGZvciAodmFyIHEgPSAwOyBxIDwgbnVtWXRpbGVzOyBxKyspIHtcbiAgICAgIGZvciAodmFyIHAgPSAwOyBwIDwgbnVtWHRpbGVzOyBwKyspIHtcbiAgICAgICAgdGlsZSA9IHt9O1xuICAgICAgICB0aWxlLnR4MCA9IE1hdGgubWF4KHNpei5YVE9zaXogKyBwICogc2l6LlhUc2l6LCBzaXouWE9zaXopO1xuICAgICAgICB0aWxlLnR5MCA9IE1hdGgubWF4KHNpei5ZVE9zaXogKyBxICogc2l6LllUc2l6LCBzaXouWU9zaXopO1xuICAgICAgICB0aWxlLnR4MSA9IE1hdGgubWluKHNpei5YVE9zaXogKyAocCArIDEpICogc2l6LlhUc2l6LCBzaXouWHNpeik7XG4gICAgICAgIHRpbGUudHkxID0gTWF0aC5taW4oc2l6LllUT3NpeiArIChxICsgMSkgKiBzaXouWVRzaXosIHNpei5Zc2l6KTtcbiAgICAgICAgdGlsZS53aWR0aCA9IHRpbGUudHgxIC0gdGlsZS50eDA7XG4gICAgICAgIHRpbGUuaGVpZ2h0ID0gdGlsZS50eTEgLSB0aWxlLnR5MDtcbiAgICAgICAgdGlsZS5jb21wb25lbnRzID0gW107XG4gICAgICAgIHRpbGVzLnB1c2godGlsZSk7XG4gICAgICB9XG4gICAgfVxuICAgIGNvbnRleHQudGlsZXMgPSB0aWxlcztcblxuICAgIHZhciBjb21wb25lbnRzQ291bnQgPSBzaXouQ3NpejtcbiAgICBmb3IgKHZhciBpID0gMCwgaWkgPSBjb21wb25lbnRzQ291bnQ7IGkgPCBpaTsgaSsrKSB7XG4gICAgICB2YXIgY29tcG9uZW50ID0gY29tcG9uZW50c1tpXTtcbiAgICAgIGZvciAodmFyIGogPSAwLCBqaiA9IHRpbGVzLmxlbmd0aDsgaiA8IGpqOyBqKyspIHtcbiAgICAgICAgdmFyIHRpbGVDb21wb25lbnQgPSB7fTtcbiAgICAgICAgdGlsZSA9IHRpbGVzW2pdO1xuICAgICAgICB0aWxlQ29tcG9uZW50LnRjeDAgPSBNYXRoLmNlaWwodGlsZS50eDAgLyBjb21wb25lbnQuWFJzaXopO1xuICAgICAgICB0aWxlQ29tcG9uZW50LnRjeTAgPSBNYXRoLmNlaWwodGlsZS50eTAgLyBjb21wb25lbnQuWVJzaXopO1xuICAgICAgICB0aWxlQ29tcG9uZW50LnRjeDEgPSBNYXRoLmNlaWwodGlsZS50eDEgLyBjb21wb25lbnQuWFJzaXopO1xuICAgICAgICB0aWxlQ29tcG9uZW50LnRjeTEgPSBNYXRoLmNlaWwodGlsZS50eTEgLyBjb21wb25lbnQuWVJzaXopO1xuICAgICAgICB0aWxlQ29tcG9uZW50LndpZHRoID0gdGlsZUNvbXBvbmVudC50Y3gxIC0gdGlsZUNvbXBvbmVudC50Y3gwO1xuICAgICAgICB0aWxlQ29tcG9uZW50LmhlaWdodCA9IHRpbGVDb21wb25lbnQudGN5MSAtIHRpbGVDb21wb25lbnQudGN5MDtcbiAgICA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Pj4geGNiXztcbiAgICB2YXIgY2J5MCA9IHN1YmJhbmQudGJ5MCA+PiB5Y2JfO1xuICAgIHZhciBjYngxID0gKHN1YmJhbmQudGJ4MSArIGNvZGVibG9ja1dpZHRoIC0gMSkgPj4geGNiXztcbiAgICB2YXIgY2J5MSA9IChzdWJiYW5kLnRieTEgKyBjb2RlYmxvY2tIZWlnaHQgLSAxKSA+PiB5Y2JfO1xuICAgIHZhciBwcmVjaW5jdFBhcmFtZXRlcnMgPSBzdWJiYW5kLnJlc29sdXRpb24ucHJlY2luY3RQYXJhbWV0ZXJzO1xuICAgIHZhciBjb2RlYmxvY2tzID0gW107XG4gICAgdmFyIHByZWNpbmN0cyA9IFtdO1xuICAgIHZhciBpLCBqLCBjb2RlYmxvY2ssIHByZWNpbmN0TnVtYmVyO1xuICAgIGZvciAoaiA9IGNieTA7IGogPCBjYnkxOyBqKyspIHtcbiAgICAgIGZvciAoaSA9IGNieDA7IGkgPCBjYngxOyBpKyspIHtcbiAgICAgICAgY29kZWJsb2NrID0ge1xuICAgICAgICAgIGNieDogaSxcbiAgICAgICAgICBjYnk6IGosXG4gICAgICAgICAgdGJ4MDogY29kZWJsb2NrV2lkdGggKiBpLFxuICAgICAgICAgIHRieTA6IGNvZGVibG9ja0hlaWdodCAqIGosXG4gICAgICAgICAgdGJ4MTogY29kZWJsb2NrV2lkdGggKiAoaSArIDEpLFxuICAgICAgICAgIHRieTE6IGNvZGVibG9ja0hlaWdodCAqIChqICsgMSlcbiAgICAgICAgfTtcblxuICAgICAgICBjb2RlYmxvY2sudGJ4MF8gPSBNYXRoLm1heChzdWJiYW5kLnRieDAsIGNvZGVibG9jay50YngwKTtcbiAgICAgICAgY29kZWJsb2NrLnRieTBfID0gTWF0aC5tYXgoc3ViYmFuZC50YnkwLCBjb2RlYmxvY2sudGJ5MCk7XG4gICAgICAgIGNvZGVibG9jay50YngxXyA9IE1hdGgubWluKHN1YmJhbmQudGJ4MSwgY29kZWJsb2NrLnRieDEpO1xu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AgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG4gICAgICAgIGNvZGVibG9ja3MucHVzaChjb2RlYmxvY2spO1xuICAgICAgICAvLyBidWlsZGluZyBwcmVjaW5jdCBmb3IgdGhlIHN1Yi1iYW5kXG4gICAgICAgIHZhciBwcmVjaW5jdCA9IHByZWNpbmN0c1twcmVjaW5jdE51bWJlcl07XG4gICAgICAgIGlmIChwcmVjaW5jdCAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgaWYgKGkgPCBwcmVjaW5jdC5jYnhNaW4pIHtcbiAgICAgICAgICAgIHByZWNpbmN0LmNieE1pbiA9IGk7XG4gICAgICAgICAgfSBlbHNlIGlmIChpID4gcHJlY2luY3QuY2J4TWF4KSB7XG4gICAgICAgICAgICBwcmVjaW5jdC5jYnhNYXggPSBpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoaiA8IHByZWNpbmN0LmNieU1pbikge1xuICAgICAgICAgICAgcHJlY2luY3QuY2J4TWluID0gajtcbiAgICAgICAgICB9IGVsc2UgaWYgKGogPiBwcmVjaW5jdC5jYnlNYXgpIHtcbiAgICAgICAgICAgIHByZWNpbmN0LmNieU1heCA9IGo7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHByZWNpbmN0c1twcmVjaW5jdE51bWJlcl0gPSBwcmVjaW5jdCA9IHtcbiAgICAgICAgICAgIGNieE1pbjogaSxcbiAgICAgICAgICAgIGNieU1pbjogaixcbiAgICAgICAgICAgIGNieE1heDogaSxcbiAgICAgICAgICAgIGNieU1heDogalxuICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgY29kZWJsb2NrLnByZWNpbmN0ID0gcHJlY2luY3Q7XG4gICAgICB9XG4gICAgfVxuICAgIHN1YmJhbmQuY29kZWJsb2NrUGFyYW1ldGVycyA9IHtcbiAgICAgIGNvZGVibG9ja1dpZHRoOiB4Y2JfLFxuICAgICAgY29kZWJsb2NrSGVpZ2h0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zQ291bnQ7IGwrKykge1xuICAgICAgICBmb3IgKDsgciA8PSBtYXhEZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQ7IHIrKykge1xuICAgICAgICAgIGZvciAoOyBpIDwgY29tcG9uZW50c0NvdW50OyBpKyspIHtcbiAgICAgICAgICAgIHZhciBjb21wb25lbnQgPSB0aWxlLmNvbXBvbmVudHNbaV07XG4gICAgICAgICAgICBpZiAociA+IGNvbXBvbmVudC5jb2RpbmdTdHlsZVBhcmFtZXRlcnMuZGVjb21wb3NpdGlvbkxldmVsc0NvdW50KSB7XG4gICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgcmVzb2x1dGlvbiA9IGNvbXBvbmVudC5yZXNvbHV0aW9uc1tyXTtcbiAgICAgICAgICAgIHZhciBudW1wcmVjaW5jdHMgPSByZXNvbHV0aW9uLnByZWNpbmN0UGFyYW1ldGVycy5udW1wcmVjaW5jdHM7XG4gICAgICAgICAgICBmb3IgKDsgayA8IG51bXByZWNpbmN0czspIHtcbiAgICAgICAgICAgICAgdmFyIHBhY2tldCA9IGNyZWF0ZVBhY2tldChyZXNvbHV0aW9uLCBrLCBsKTtcbiAgICAgICAgICAgICAgaysrO1xuICAgICAgICAgICAgICByZXR1cm4gcGFja2V0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgayA9IDA7XG4gICAgICAgICAgfVxuICAgICAgICAgIGkgPSAwO1xuICAgICAgICB9XG4gICAgICAgIHIgPSAwO1xuICAgICAgfVxuICAgIH07XG4gIH1cbiAgZnVuY3Rpb24gUmVzb2x1dGlvbkxheWVyQ29tcG9uZW50UG9zaXRpb25JdGVyYXRvcihjb250ZXh0KSB7XG4gICAgdmFyIHNpeiA9IGNvbnRleHQuU0laO1xuICAgIHZhciB0aWxlSW5kZXggPSBjb250ZXh0LmN1cnJlbnRUaWxlLmluZGV4O1xuICAgIHZhciB0aWxlID0gY29udGV4dC50aWxlc1t0aWxl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ICAgICAgICB2YXIgcmVzb2x1dGlvbiA9IGNvbXBvbmVudC5yZXNvbHV0aW9uc1tyXTtcbiAgICAgICAgICAgIHZhciBudW1wcmVjaW5jdHMgPSByZXNvbHV0aW9uLnByZWNpbmN0UGFyYW1ldGVycy5udW1wcmVjaW5jdHM7XG4gICAgICAgICAgICBmb3IgKDsgayA8IG51bXByZWNpbmN0czspIHtcbiAgICAgICAgICAgICAgdmFyIHBhY2tldCA9IGNyZWF0ZVBhY2tldChyZXNvbHV0aW9uLCBrLCBsKTtcbiAgICAgICAgICAgICAgaysrO1xuICAgICAgICAgICAgICByZXR1cm4gcGFja2V0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgayA9IDA7XG4gICAgICAgICAgfVxuICAgICAgICAgIGkgPSAwO1xuICAgICAgICB9XG4gICAgICAgIGwgPSAwO1xuICAgICAgfVxuICAgIH07XG4gIH1cbiAgZnVuY3Rpb24gUmVzb2x1dGlvblBvc2l0aW9uQ29tcG9uZW50TGF5ZXJJdGVyYXRvcihjb250ZXh0KSB7XG4gICAgdmFyIHNpeiA9IGNvbnRleHQuU0laO1xuICAgIHZhciB0aWxlSW5kZXggPSBjb250ZXh0LmN1cnJlbnRUaWxlLmluZGV4O1xuICAgIHZhciB0aWxlID0gY29udGV4dC50aWxlc1t0aWxlSW5kZXhdO1xuICAgIHZhciBsYXllcnNDb3VudCA9IHRpbGUuY29kaW5nU3R5bGVEZWZhdWx0UGFyYW1ldGVycy5sYXllcnNDb3VudDtcbiAgICB2YXIgY29tcG9uZW50c0NvdW50ID0gc2l6LkNzaXo7XG4gICAgdmFyIGwsIHIsIGMsIHA7XG4gICAgdmFyIG1heERlY29tcG9zaXRpb25MZXZlbHNDb3VudCA9IDA7XG4gICAgZm9yIChjID0gMDsgYyA8IGNvbXBvbmVudHNDb3VudDsgYysrKSB7XG4gICAgICB2YXIgY29tcG9uZW50ID0gdGlsZS5jb21wb25lbnRzW2NdO1xuICAgICAgbWF4RGVjb21wb3NpdGl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ZvciAoOyByIDw9IG1heERlY29tcG9zaXRpb25MZXZlbHNDb3VudDsgcisrKSB7XG4gICAgICAgIGZvciAoOyBwIDwgbWF4TnVtUHJlY2luY3RzSW5MZXZlbFtyXTsgcCsrKSB7XG4gICAgICAgICAgZm9yICg7IGMgPCBjb21wb25lbnRzQ291bnQ7IGMrKykge1xuICAgICAgICAgICAgdmFyIGNvbXBvbmVudCA9IHRpbGUuY29tcG9uZW50c1tjXTtcbiAgICAgICAgICAgIGlmIChyID4gY29tcG9uZW50LmNvZGluZ1N0eWxlUGFyYW1ldGVycy5kZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQpIHtcbiAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgcmVzb2x1dGlvbiA9IGNvbXBvbmVudC5yZXNvbHV0aW9uc1tyXTtcbiAgICAgICAgICAgIHZhciBudW1wcmVjaW5jdHMgPSByZXNvbHV0aW9uLnByZWNpbmN0UGFyYW1ldGVycy5udW1wcmVjaW5jdHM7XG4gICAgICAgICAgICBpZiAocCA+PSBudW1wcmVjaW5jdHMpIHtcbiAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmb3IgKDsgbCA8IGxheWVyc0NvdW50Oykge1xuICAgICAgICAgICAgICB2YXIgcGFja2V0ID0gY3JlYXRlUGFja2V0KHJlc29sdXRpb24sIHAsIGwpO1xuICAgICAgICAgICAgICBsKys7XG4gICAgICAgICAgICAgIHJldHVybiBwYWNrZXQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsID0gMDtcbiAgICAgICAgICB9XG4gICAgICAgICAgYyA9IDA7XG4gICAgICAgIH1cbiAgICAgICAgcCA9IDA7XG4gICAgICB9XG4gICAgfTtcbiAgfVxuICBmdW5jdGlvbiBQb3NpdGlvbkNvbXBvbmVudFJlc29sdXRpb25MYXllckl0ZXJhdG9yKGNvbnRleHQpIHtcbiAgICB2YXIgc2l6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ICAgICAgICAgZm9yICg7IHIgPD0gZGVjb21wb3NpdGlvbkxldmVsc0NvdW50OyByKyspIHtcbiAgICAgICAgICAgICAgdmFyIHJlc29sdXRpb24gPSBjb21wb25lbnQucmVzb2x1dGlvbnNbcl07XG4gICAgICAgICAgICAgIHZhciBzaXplSW5JbWFnZVNjYWxlID1cbiAgICAgICAgICAgICAgICBwcmVjaW5jdHNTaXplcy5jb21wb25lbnRzW2NdLnJlc29sdXRpb25zW3JdO1xuICAgICAgICAgICAgICB2YXIgayA9IGdldFByZWNpbmN0SW5kZXhJZkV4aXN0KFxuICAgICAgICAgICAgICAgIHB4LFxuICAgICAgICAgICAgICAgIHB5LFxuICAgICAgICAgICAgICAgIHNpemVJbkltYWdlU2NhbGUsXG4gICAgICAgICAgICAgICAgcHJlY2luY3RzSXRlcmF0aW9uU2l6ZXMsXG4gICAgICAgICAgICAgICAgcmVzb2x1dGlvbik7XG4gICAgICAgICAgICAgIGlmIChrID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgZm9yICg7IGwgPCBsYXllcnNDb3VudDspIHtcbiAgICAgICAgICAgICAgICB2YXIgcGFja2V0ID0gY3JlYXRlUGFja2V0KHJlc29sdXRpb24sIGssIGwpO1xuICAgICAgICAgICAgICAgIGwrKztcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFja2V0O1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGwgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgciA9IDA7XG4gICAgICAgICAgfVxuICAgICAgICAgIGMgPSAwO1xuICAgICAgICB9XG4gICAgICAgIHB4ID0gMDtcbiAgICAgIH1cbiAgICB9O1xuICB9XG4gIGZ1bmN0aW9uIENvbXBvbmVudFBvc2l0aW9uUmVzb2x1dGlvbkxheWVySXRlcmF0b3IoY29udGV4dCkge1xuICAgIHZhciBzaXogPSBjb250ZXh0LlNJWjtcbi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G4gICAgICAgICAgICBmb3IgKDsgciA8PSBkZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQ7IHIrKykge1xuICAgICAgICAgICAgICB2YXIgcmVzb2x1dGlvbiA9IGNvbXBvbmVudC5yZXNvbHV0aW9uc1tyXTtcbiAgICAgICAgICAgICAgdmFyIHNpemVJbkltYWdlU2NhbGUgPSBwcmVjaW5jdHNJdGVyYXRpb25TaXplcy5yZXNvbHV0aW9uc1tyXTtcbiAgICAgICAgICAgICAgdmFyIGsgPSBnZXRQcmVjaW5jdEluZGV4SWZFeGlzdChcbiAgICAgICAgICAgICAgICBweCxcbiAgICAgICAgICAgICAgICBweSxcbiAgICAgICAgICAgICAgICBzaXplSW5JbWFnZVNjYWxlLFxuICAgICAgICAgICAgICAgIHByZWNpbmN0c0l0ZXJhdGlvblNpemVzLFxuICAgICAgICAgICAgICAgIHJlc29sdXRpb24pO1xuICAgICAgICAgICAgICBpZiAoayA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGZvciAoOyBsIDwgbGF5ZXJzQ291bnQ7KSB7XG4gICAgICAgICAgICAgICAgdmFyIHBhY2tldCA9IGNyZWF0ZVBhY2tldChyZXNvbHV0aW9uLCBrLCBsKTtcbiAgICAgICAgICAgICAgICBsKys7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhY2tldDtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBsID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHIgPSAwO1xuICAgICAgICAgIH1cbiAgICAgICAgICBweCA9IDA7XG4gICAgICAgIH1cbiAgICAgICAgcHkgPSAwO1xuICAgICAgfVxuICAgIH07XG4gIH1cbiAgZnVuY3Rpb24gZ2V0UHJlY2luY3RJbmRleElmRXhpc3QoXG4gICAgcHhJbmRleCwgcHlJbmRleCwgc2l6ZUluSW1hZ2VTY2FsZSwgcHJlY2luY3R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Vzb2x1dGlvbik7XG4gICAgICAgIG1pbkhlaWdodEN1cnJlbnRDb21wb25lbnQgPSBNYXRoLm1pbihcbiAgICAgICAgICBtaW5IZWlnaHRDdXJyZW50Q29tcG9uZW50LFxuICAgICAgICAgIGhlaWdodEN1cnJlbnRSZXNvbHV0aW9uKTtcbiAgICAgICAgbWF4TnVtV2lkZUN1cnJlbnRDb21wb25lbnQgPSBNYXRoLm1heChtYXhOdW1XaWRlQ3VycmVudENvbXBvbmVudCxcbiAgICAgICAgICByZXNvbHV0aW9uLnByZWNpbmN0UGFyYW1ldGVycy5udW1wcmVjaW5jdHN3aWRlKTtcbiAgICAgICAgbWF4TnVtSGlnaEN1cnJlbnRDb21wb25lbnQgPSBNYXRoLm1heChtYXhOdW1IaWdoQ3VycmVudENvbXBvbmVudCxcbiAgICAgICAgICByZXNvbHV0aW9uLnByZWNpbmN0UGFyYW1ldGVycy5udW1wcmVjaW5jdHNoaWdoKTtcbiAgICAgICAgc2l6ZVBlclJlc29sdXRpb25bcl0gPSB7XG4gICAgICAgICAgd2lkdGg6IHdpZHRoQ3VycmVudFJlc29sdXRpb24sXG4gICAgICAgICAgaGVpZ2h0OiBoZWlnaHRDdXJyZW50UmVzb2x1dGlvblxuICAgICAgICB9O1xuICAgICAgICBzY2FsZSA8PD0gMTtcbiAgICAgIH1cbiAgICAgIG1pbldpZHRoID0gTWF0aC5taW4obWluV2lkdGgsIG1pbldpZHRoQ3VycmVudENvbXBvbmVudCk7XG4gICAgICBtaW5IZWlnaHQgPSBNYXRoLm1pbihtaW5IZWlnaHQsIG1pbkhlaWdodEN1cnJlbnRDb21wb25lbnQpO1xuICAgICAgbWF4TnVtV2lkZSA9IE1hdGgubWF4KG1heE51bVdpZGUsIG1heE51bVdpZGVDdXJyZW50Q29tcG9uZW50KTtcbiAgICAgIG1heE51bUhpZ2ggPSBNYXRoLm1heChtYXhOdW1IaWdoLCBtYXhOdW1IaWdoQ3VycmVudENvbXBvbmVudCk7XG4gICAgICBzaXplUGVyQ29tcG9uZW50W2NdID0ge1xuICAgICAgICByZXNvbHV0aW9uczogc2l6ZVBlclJlc29sdXRpb24sXG4gICAgICAgIG1pbldpZHRoOiBtaW5XaWR0aEN1cnJlbnRDb21wb25lbnQsXG4gICAgICAgIG1pbkhlaWdodDogbWluSGVpZ2h0Q3VycmVudENvbXBvbmVudCxcbiAgICAgICAgbWF4TnVtV2lkZTogbWF4TnVtV2lkZUN1cnJlbnRDb21wb25lbnQsXG4gICAgICAgIG1heE51bUhpZ2g6IG1heE51bUhpZ2hDdXJyZW50Q29tcG9uZW50XG4gICAgICB9O1xuICAgIH1cbiAgICByZXR1cm4ge1xuICAgICAgY29tcG9uZW50czogc2l6ZVBlckNvbXBvbmVudCxcbiAgICAgIG1pbldpZHRoOiBtaW5XaWR0aCxcbiAgICAgIG1pbkhlaWdodDogbWluSGVpZ2h0LFxuICAgICAgbWF4TnVtV2lkZTogbWF4TnVtV2lkZSxcbiAgICAgIG1heE51bUhpZ2g6IG1heE51bUhpZ2hcbiAgICB9O1xuICB9XG4gIGZ1bmN0aW9uIGJ1aWxkUGFja2V0cyhjb250ZXh0KSB7XG4gICAgdmFyIHNpeiA9IGNvbnRleHQuU0laO1xuICAgIHZhciB0aWxlSW5kZXggPSBjb250ZXh0LmN1cnJlbnRUaWxlLmluZGV4O1xuICAgIHZhciB0aWxlID0gY29udGV4dC50aWxlc1t0aWxlSW5kZXhdO1xuICAgIHZhciBjb21wb25lbnRzQ291bnQgPSBzaXouQ3NpejtcbiAgICAvLyBDcmVhdGluZyByZXNvbHV0aW9ucyBhbmQgc3ViLWJhbmRzIGZvciBlYWNoIGNvbXBvbmVudFxuICAgIGZvciAodmFyIGMgPSAwOyBjIDwgY29tcG9uZW50c0NvdW50OyBjKyspIHtcbiAgICAgIHZhciBjb21wb25lbnQgPSB0aWxlLmNvbXBvbmVudHNbY107XG4gICAgICB2YXIgZGVjb21wb3NpdGlvbkxldmVsc0NvdW50ID1cbiAgICAgICAgY29tcG9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WYgKGRhdGFbb2Zmc2V0ICsgcG9zaXRpb24gLSAxXSA9PT0gMHhGRiAmJlxuICAgICAgICAgIGRhdGFbb2Zmc2V0ICsgcG9zaXRpb25dID09PSB2YWx1ZSkge1xuICAgICAgICBza2lwQnl0ZXMoMSk7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgfSBlbHNlIGlmIChkYXRhW29mZnNldCArIHBvc2l0aW9uXSA9PT0gMHhGRiAmJlxuICAgICAgICAgICAgICAgICBkYXRhW29mZnNldCArIHBvc2l0aW9uICsgMV0gPT09IHZhbHVlKSB7XG4gICAgICAgIHNraXBCeXRlcygyKTtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICB9XG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHNraXBCeXRlcyhjb3VudCkge1xuICAgICAgcG9zaXRpb24gKz0gY291bnQ7XG4gICAgfVxuICAgIGZ1bmN0aW9uIGFsaWduVG9CeXRlKCkge1xuICAgICAgYnVmZmVyU2l6ZSA9IDA7XG4gICAgICBpZiAoc2tpcE5leHRCaXQpIHtcbiAgICAgICAgcG9zaXRpb24rKztcbiAgICAgICAgc2tpcE5leHRCaXQgPSBmYWxzZTtcbiAgICAgIH1cbiAgICB9XG4gICAgZnVuY3Rpb24gcmVhZENvZGluZ3Bhc3NlcygpIHtcbiAgICAgIGlmIChyZWFkQml0cygxKSA9PT0gMCkge1xuICAgICAgICByZXR1cm4gMTtcbiAgICAgIH1cbiAgICAgIGlmIChyZWFkQml0cygxKSA9PT0gMCkge1xuICAgICAgICByZXR1cm4gMjtcbiAgICAgIH1cbiAgICAgIHZhciB2YWx1ZSA9IHJlYWRCaXRzKDIpO1xuICAgICAgaWYgKHZhbHVlIDwgMykge1xuICAgICAgICByZXR1cm4gdmFsdWUgKyAzO1xuICAgICAgfVxuICAgICAgdmFsdWUgPSByZWFkQml0cyg1KTtcbiAgICAgIGlmICh2YWx1ZSA8IDMxKSB7XG4g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VyID0gcGFja2V0LmxheWVyTnVtYmVyO1xuICAgICAgICB2YXIgcXVldWUgPSBbXSwgY29kZWJsb2NrO1xuICAgICAgICBmb3IgKHZhciBpID0gMCwgaWkgPSBwYWNrZXQuY29kZWJsb2Nrcy5sZW5ndGg7IGkgPCBpaTsgaSsrKSB7XG4gICAgICAgICAgY29kZWJsb2NrID0gcGFja2V0LmNvZGVibG9ja3NbaV07XG4gICAgICAgICAgdmFyIHByZWNpbmN0ID0gY29kZWJsb2NrLnByZWNpbmN0O1xuICAgICAgICAgIHZhciBjb2RlYmxvY2tDb2x1bW4gPSBjb2RlYmxvY2suY2J4IC0gcHJlY2luY3QuY2J4TWluO1xuICAgICAgICAgIHZhciBjb2RlYmxvY2tSb3cgPSBjb2RlYmxvY2suY2J5IC0gcHJlY2luY3QuY2J5TWluO1xuICAgICAgICAgIHZhciBjb2RlYmxvY2tJbmNsdWRlZCA9IGZhbHNlO1xuICAgICAgICAgIHZhciBmaXJzdFRpbWVJbmNsdXNpb24gPSBmYWxzZTtcbiAgICAgICAgICB2YXIgdmFsdWVSZWFkeTtcbiAgICAgICAgICBpZiAoY29kZWJsb2NrWydpbmNsdWRlZCddICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIGNvZGVibG9ja0luY2x1ZGVkID0gISFyZWFkQml0cygxKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgLy8gcmVhZGluZyBpbmNsdXNpb24gdHJlZVxuICAgICAgICAgICAgcHJlY2luY3QgPSBjb2RlYmxvY2sucHJlY2luY3Q7XG4gICAgICAgICAgICB2YXIgaW5jbHVzaW9uVHJlZSwgemVyb0JpdFBsYW5lc1RyZWU7XG4gICAgICAgICAgICBpZiAocHJlY2luY3RbJ2luY2x1c2lvblRyZWUnXSAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgIGluY2x1c2lvblRyZWUgPSBwcmVjaW5jdC5pbmNsdXNpb25UcmVlO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgLy8gYnVpbGRpbmcgaW5jbHVzaW9uIGFuZCB6ZXJvIGJpdC1wbGFuZXMgdHJlZXNcbiAgICAgICAgICAgICAgdmFyIHdpZHRoID0gcHJlY2luY3QuY2J4TWF4IC0gcHJlY2luY3QuY2J4TWluICsgMTtcbiAgICAgICAgICAgICAgdmFyIGhlaWdodCA9IHByZWNpbmN0LmNieU1heCAtIHByZWNpbmN0LmNieU1pbiArIDE7XG4gICAgICAgICAgICAgIGluY2x1c2lvblRyZWUgPSBuZXcgSW5jbHVzaW9uVHJlZSh3aWR0aCwgaGVpZ2h0KTtcbiAgICAgICAgICAgICAgemVyb0JpdFBsYW5lc1RyZWUgPSBuZXcgVGFnVHJlZSh3aWR0aCwgaGVpZ2h0KTtcbiAgICAgICAgICAgICAgcHJlY2luY3QuaW5jbHVzaW9uVHJlZSA9IGluY2x1c2lvblRyZWU7XG4gICAgICAgICAgICAgIHByZWNpbmN0Lnplcm9CaXRQbGFuZXNUcmVlID0gemVyb0JpdFBsYW5lc1RyZWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGluY2x1c2lvblRyZWUucmVzZXQoY29kZWJsb2NrQ29sdW1uLCBjb2RlYmxvY2tSb3csIGxheWVyTnVtYmVyKTtcbiAgICAgICAgICAgIHdoaWxlICh0cnVlKSB7XG4gICAgICAgICAgICAgIGlmIChwb3NpdGlvbiA+PSBkYXRhLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAoaW5jbHVzaW9uVHJlZS5pc0Fib3ZlVGhyZXNob2xkKCkpe1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChpbmNsdXNpb25UcmVlLmlzS25vd24oKSkge1xuICAgICAgICAgICAgICAgIGluY2x1c2lvblRyZWUubmV4dExldmVsKCk7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKHJlYWRCaXRzKDEpKSB7XG4gICAgICAgICAgICAgICAgaW5jbHVzaW9uVHJlZS5zZXRLbm93bigpO1xuICAgICAgICAgICAgICAgIGlmIChpbmNsdXNpb25UcmVlLmlzTGVhZigpKSB7XG4gICAgICAgICAgICAgICAgICBjb2RlYmxvY2suaW5jbHVkZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgY29kZWJsb2NrSW5jbHVkZWQgPSBmaXJzdFRpbWVJbmNsdXNpb24gPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgIGluY2x1c2lvblRyZWUubmV4dExldmVsKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGluY2x1c2lvblRyZWUuaW5jcmVtZW50VmFsdWUoKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoIWNvZGVibG9ja0luY2x1ZGVkKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGZpcnN0VGltZUluY2x1c2lvbikge1xuICAgICAgICAgICAgemVyb0JpdFBsYW5lc1RyZWUgPSBwcmVjaW5jdC56ZXJvQml0UGxhbmVzVHJlZTtcbiAgICAgICAgICAgIHplcm9CaXRQbGFuZXNUcmVlLnJlc2V0KGNvZGVibG9ja0NvbHVtbiwgY29kZWJsb2NrUm93KTtcbiAgICAgICAgICAgIHdoaWxlICh0cnVlKSB7XG4gICAgICAgICAgICAgIGlmIChwb3NpdGlvbiA+PSBkYXRhLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAocmVh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NvbXBvbmVudDAgPSB0aWxlLmNvbXBvbmVudHNbMF07XG4gICAgICAgIHZhciBhbHBoYTAxID0gY29tcG9uZW50c0NvdW50IC0gMztcbiAgICAgICAgamogPSB5MGl0ZW1zLmxlbmd0aDtcbiAgICAgICAgaWYgKCFjb21wb25lbnQwLmNvZGluZ1N0eWxlUGFyYW1ldGVycy5yZXZlcnNpYmxlVHJhbnNmb3JtYXRpb24pIHtcbiAgICAgICAgICAvLyBpbnZlcnNlIGlycmV2ZXJzaWJsZSBtdWx0aXBsZSBjb21wb25lbnQgdHJhbnNmb3JtXG4gICAgICAgICAgZm9yIChqID0gMDsgaiA8IGpqOyBqKyssIHBvcyArPSBhbHBoYTAxKSB7XG4gICAgICAgICAgICB5MCA9IHkwaXRlbXNbal0gKyBvZmZzZXQ7XG4gICAgICAgICAgICB5MSA9IHkxaXRlbXNbal07XG4gICAgICAgICAgICB5MiA9IHkyaXRlbXNbal07XG4gICAgICAgICAgICByID0geTAgKyAxLjQwMiAqIHkyO1xuICAgICAgICAgICAgZyA9IHkwIC0gMC4zNDQxMyAqIHkxIC0gMC43MTQxNCAqIHkyO1xuICAgICAgICAgICAgYiA9IHkwICsgMS43NzIgKiB5MTtcbiAgICAgICAgICAgIG91dFtwb3MrK10gPSByIDw9IDAgPyAwIDogciA+PSBtYXggPyAyNTUgOiByID4+IHNoaWZ0O1xuICAgICAgICAgICAgb3V0W3BvcysrXSA9IGcgPD0gMCA/IDAgOiBnID49IG1heCA/IDI1NSA6IGcgPj4gc2hpZnQ7XG4gICAgICAgICAgICBvdXRbcG9zKytdID0gYiA8PSAwID8gMCA6IGIgPj0gbWF4ID8gMjU1IDogYiA+PiBzaGlmdDtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgLy8gaW52ZXJzZSByZXZlcnNpYmxlIG11bHRpcGxlIGNvbXBvbmVudCB0cmFuc2Zvcm1cbiAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgamo7IGorKywgcG9zICs9IGFscGhhMDEpIHtcbiAgICAgICAgICAgIHkwID0geTBpdGVtc1tqXSArIG9mZnNldDtcbiAgICAgICAgICAgIHkxID0geTFpdGVtc1tqXTtcbiAgICAgICAgICAgIHkyID0geTJpdGVtc1tqXTtcbiAgICAgICAgICAgIGcgPSB5MCAtICgoeTIgKyB5MSkgPj4gMik7XG4gICAgICAgICAgICByID0gZyArIHkyO1xuICAgICAgICAgICAgYiA9IGcgKyB5MTtcbiAgICAgICAgICAgIG91dFtwb3MrK10gPSByIDw9IDAgPyAwIDogciA+PSBtYXggPyAyNTUgOiByID4+IHNoaWZ0O1xuICAgICAgICAgICAgb3V0W3BvcysrXSA9IGcgPD0gMCA/IDAgOiBnID49IG1heCA/IDI1NSA6IGcgPj4gc2hpZnQ7XG4gICAgICAgICAgICBvdXRbcG9zKytdID0gYiA8PSAwID8gMCA6IGIgPj0gbWF4ID8gMjU1IDogYiA+PiBzaGlmdDtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGZvdXJDb21wb25lbnRzKSB7XG4gICAgICAgICAgZm9yIChqID0gMCwgcG9zID0gMzsgaiA8IGpqOyBqKyssIHBvcyArPSA0KSB7XG4gICAgICAgICAgICBrID0geTNpdGVtc1tqXTtcbiAgICAgICAgICAgIG91dFtwb3NdID0gayA8PSBtaW4gPyAwIDogayA+PSBtYXhLID8gMjU1IDogKGsgKyBvZmZzZXQpID4+IHNoaWZ0O1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHsgLy8gbm8gbXVsdGktY29tcG9uZW50IHRyYW5zZm9ybVxuICAgICAgICBmb3IgKGMgPSAwOyBjIDwgY29tcG9uZW50c0NvdW50OyBjKyspIHtcbiAgICAgICAgICBpZiAoY29tcG9uZW50c1tjXS5wcmVjaXNpb24gPT09IDgpe1xuICAgICAgICAgICAgdmFyIGl0ZW1zID0gdHJhbnNmb3JtZWRUaWxlc1tjXS5pdGVtcztcbiAgICAgICAgICAgIHNoaWZ0ID0gY29tcG9uZW50c1tjXS5wcmVjaXNpb24gLSA4O1xuICAgICAgICAgICAgb2Zmc2V0ID0gKDEyOCA8PCBzaGlmdCkgKyAwLjU7XG4gICAgICAgICAgICBtYXggPSAoMTI3LjUgKiAoMSA8PCBzaGlmdCkpO1xuICAgICAgICAgICAgbWluID0gLW1heDtcbiAgICAgICAgICAgIGZvciAocG9zID0gYywgaiA9IDAsIGpqID0gaXRlbXMubGVuZ3RoOyBqIDwgamo7IGorKykge1xuICAgICAgICAgICAgICB2YWwgPSBpdGVtc1tqXTtcbiAgICAgICAgICAgICAgb3V0W3Bvc10gPSB2YWwgPD0gbWluID8gMCA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgdmFsID49IG1heCA/IDI1NSA6ICh2YWwgKyBvZmZzZXQpID4+IHNoaWZ0O1xuICAgICAgICAgICAgICBwb3MgKz0gY29tcG9uZW50c0NvdW50O1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1lbHNle1xuICAgICAgICAgICAgdmFyIGlzU2lnbmVkID0gY29tcG9uZW50c1tjXS5pc1NpZ25lZDtcbiAgICAgICAgICAgIHZhciBpdGVtcyA9IHRyYW5zZm9ybWVkVGlsZXNbY10uaXRlbXM7XG5cbiAgICAgICAgICAgIGlmKGlzU2lnbmVkKXtcbiAgICAgICAgICAgICAgZm9yIChwb3MgPSBjLCBqID0gMCwgamogPSBpdGVtcy5sZW5ndGg7IGogPCBqajsgaisrKSB7XG4gICAgICAgICAgICAgICAgb3V0W3Bvc10gPSBpdGVtc1tqXTtcbiAgICAgICAgICAgICAgICBwb3MgKz0gY29tcG9uZW50c0NvdW50O1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9ZWxzZXtcbiAgICAgICAgICAgICAgc2hpZnQgPSBjb21wb25lbnRzW2NdLnByZWNpc2lvbiAtIDg7XG4gICAgICAgICAgICAgIG9mZnNldCA9ICgxMjggPDwgc2hpZnQpICsgMC41O1xuICAgICAgICAgICAgICB2YXIgcHJlY2lzaW9uTWF4ID0gTWF0aC5wb3coMixjb21wb25lbnRzW2NdLnByZWNpc2lvbiktMTtcbiAgICAgICAgICAgICAgZm9yIChwb3MgPSBjLCBqID0gMCwgamogPSBpdGVtcy5sZW5ndGg7IGogPCBqajsgaisrKSB7XG4gICAgICAgICAgICAgICAgdmFsID0gaXRlbXNbal07XG4gICAgICAgICAgICAgICAgb3V0W3Bvc10gPSBNYXRoLm1heChNYXRoLm1pbigodmFsICsgb2Zmc2V0KSxwcmVjaXNpb25NYXgpLDApO1xuICAgICAgICAgICAgICAgIHBvcyArPSBjb21wb25lbnRzQ291bnQ7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJlc3VsdEltYWdlcy5wdXNoKHJlc3VsdCk7XG4gICAgfVxuICAgIHJldHVybiByZXN1bHRJbWFnZXM7XG4gIH1cbiAgZnVuY3Rpb24gaW5pdGlhbGl6ZVRpbGUoY29udGV4dCwgdGlsZUluZGV4KSB7XG4gICAgdmFyIHNpeiA9IGNvbnRleHQuU0laO1xuICAgIHZhciBjb21wb25lbnRzQ291bnQgPSBzaXouQ3NpejtcbiAgICB2YXIgdGlsZSA9IGNvbnRleHQudGlsZXNbdGlsZUluZGV4XTtcbiAgICBmb3IgKHZhciBjID0gMDsgYyA8IGNvbXBvbmVudHNDb3VudDsgYysrKSB7XG4gICAgICB2YXIgY29tcG9uZW50ID0gdGlsZS5jb21wb25lbnRzW2NdO1xuICAgICAgdmFyIHFjZE9yUWNjID0gKGNvbnRleHQuY3VycmVudFRpbGUuUUNDW2NdICE9PSB1bmRlZmluZWQgP1xuICAgICAgICBjb250ZXh0LmN1cnJlbnRUaWxlLlFDQ1tjXSA6IGNvbnRleHQuY3VycmVudFRpbGUuUUNEKTtcbiAgICAgIGNvbXBvbmVudC5xdWFudGl6YXRpb25QYXJhbWV0ZXJzID0gcWNkT3JRY2M7XG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ICBmb3IgKHZhciBqID0gMCwgamogPSBpdGVtcy5sZW5ndGg7IGogPCBqajsgaisrKSB7XG4gICAgICAgICAgaXRlbXNbal0gPSAwO1xuICAgICAgICAgIHN0YXR1c1tqXSA9IDA7XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgbGV2ZWwgPSB7XG4gICAgICAgICAgd2lkdGg6IHdpZHRoLFxuICAgICAgICAgIGhlaWdodDogaGVpZ2h0LFxuICAgICAgICAgIGl0ZW1zOiBpdGVtcyxcbiAgICAgICAgICBzdGF0dXM6IHN0YXR1c1xuICAgICAgICB9O1xuICAgICAgICB0aGlzLmxldmVscy5wdXNoKGxldmVsKTtcblxuICAgICAgICB3aWR0aCA9IE1hdGguY2VpbCh3aWR0aCAvIDIpO1xuICAgICAgICBoZWlnaHQgPSBNYXRoLmNlaWwoaGVpZ2h0IC8gMik7XG4gICAgICB9XG4gICAgfVxuICAgIEluY2x1c2lvblRyZWUucHJvdG90eXBlID0ge1xuICAgICAgcmVzZXQ6IGZ1bmN0aW9uIEluY2x1c2lvblRyZWVfcmVzZXQoaSwgaiwgc3RvcFZhbHVlKSB7XG4gICAgICAgIHRoaXMuY3VycmVudFN0b3BWYWx1ZSA9IHN0b3BWYWx1ZTtcbiAgICAgICAgdmFyIGN1cnJlbnRMZXZlbCA9IDA7XG4gICAgICAgIHdoaWxlIChjdXJyZW50TGV2ZWwgPCB0aGlzLmxldmVscy5sZW5ndGgpIHtcbiAgICAgICAgICB2YXIgbGV2ZWwgPSB0aGlzLmxldmVsc1tjdXJyZW50TGV2ZWxdO1xuICAgICAgICAgIHZhciBpbmRleCA9IGkgKyBqICogbGV2ZWwud2lkdGg7XG4gICAgICAgICAgbGV2ZWwuaW5kZXggPSBpbmRleDtcblxuICAgICAgICAgIGkgPj49IDE7XG4gICAgICAgICAgaiA+Pj0gMTtcbiAgICAgICAgICBjdXJyZW50TGV2ZWwrKztcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuY3VycmVudExldmVsID0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h0O1xuXG4gICAgICAvLyBjb2VmZmljaWVudHMgb3V0c2lkZSB0aGUgZW5jb2RpbmcgcmVnaW9uIHRyZWF0ZWQgYXMgaW5zaWduaWZpY2FudFxuICAgICAgLy8gYWRkIGJvcmRlciBzdGF0ZSBjZWxscyBmb3Igc2lnbmlmaWNhbmNlU3RhdGVcbiAgICAgIHRoaXMubmVpZ2hib3JzU2lnbmlmaWNhbmNlID0gbmV3IFVpbnQ4QXJyYXkoY29lZmZpY2llbnRDb3VudCk7XG4gICAgICB0aGlzLmNvZWZmaWNlbnRzU2lnbiA9IG5ldyBVaW50OEFycmF5KGNvZWZmaWNpZW50Q291bnQpO1xuICAgICAgdGhpcy5jb2VmZmljZW50c01hZ25pdHVkZSA9IG1iID4gMTQgPyBuZXcgVWludDMyQXJyYXkoY29lZmZpY2llbnRDb3VudCkgOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1iID4gNiA/IG5ldyBVaW50MTZBcnJheShjb2VmZmljaWVudENvdW50KSA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IFVpbnQ4QXJyYXkoY29lZmZpY2llbnRDb3VudCk7XG4gICAgICB0aGlzLnByb2Nlc3NpbmdGbGFncyA9IG5ldyBVaW50OEFycmF5KGNvZWZmaWNpZW50Q291bnQpO1xuXG4gICAgICB2YXIgYml0c0RlY29kZWQgPSBuZXcgVWludDhBcnJheShjb2VmZmljaWVudENvdW50KTtcbiAgICAgIGlmICh6ZXJvQml0UGxhbmVzICE9PSAwKSB7XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY29lZmZpY2llbnRDb3VudDsgaSsrKSB7XG4gICAgICAgICAgYml0c0RlY29kZWRbaV0gPSB6ZXJvQml0UGxhbmVzO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICB0aGlzLmJpdHNEZWNvZGVkID0gYml0c0RlY29kZWQ7XG5cbiAgICAgIHRoaXMucmVzZXQoKTtcbiAgICB9XG5cbi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oZWlnaHQgPSB0aGlzLmhlaWdodDtcbiAgICAgICAgdmFyIGxlZnQgPSAoY29sdW1uID4gMCk7XG4gICAgICAgIHZhciByaWdodCA9IChjb2x1bW4gKyAxIDwgd2lkdGgpO1xuICAgICAgICB2YXIgaTtcblxuICAgICAgICBpZiAocm93ID4gMCkge1xuICAgICAgICAgIGkgPSBpbmRleCAtIHdpZHRoO1xuICAgICAgICAgIGlmIChsZWZ0KSB7XG4gICAgICAgICAgICBuZWlnaGJvcnNTaWduaWZpY2FuY2VbaSAtIDFdICs9IDB4MTA7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChyaWdodCkge1xuICAgICAgICAgICAgbmVpZ2hib3JzU2lnbmlmaWNhbmNlW2kgKyAxXSArPSAweDEwO1xuICAgICAgICAgIH1cbiAgICAgICAgICBuZWlnaGJvcnNTaWduaWZpY2FuY2VbaV0gKz0gMHgwNDtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChyb3cgKyAxIDwgaGVpZ2h0KSB7XG4gICAgICAgICAgaSA9IGluZGV4ICsgd2lkdGg7XG4gICAgICAgICAgaWYgKGxlZnQpIHtcbiAgICAgICAgICAgIG5laWdoYm9yc1NpZ25pZmljYW5jZVtpIC0gMV0gKz0gMHgxMDtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHJpZ2h0KSB7XG4gICAgICAgICAgICBuZWlnaGJvcnNTaWduaWZpY2FuY2VbaSArIDFdICs9IDB4MTA7XG4gICAgICAgICAgfVxuICAgICAgICAgIG5laWdoYm9yc1NpZ25pZmljYW5jZVtpXSArPSAweDA0O1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGxlZnQpIHtcbiAgICAgICAgICBuZWlnaGJvcnNTaWduaWZpY2FuY2VbaW5kZXggLSAxXSArPSAweDAxO1xuICAgICAgICB9XG4gICAgICAgIGlmIChyaWdodCkge1xuICAgICAgICAgIG5laWdoYm9yc1NpZ25pZmljYW5jZVtpbmRleCArIDFdICs9IDB4MDE7X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0aDsgaisrKSB7XG4gICAgICAgICAgICB2YXIgaW5kZXggPSBpMCAqIHdpZHRoICsgajtcbiAgICAgICAgICAgIGZvciAodmFyIGkxID0gMDsgaTEgPCA0OyBpMSsrLCBpbmRleCArPSB3aWR0aCkge1xuICAgICAgICAgICAgICB2YXIgaSA9IGkwICsgaTE7XG4gICAgICAgICAgICAgIGlmIChpID49IGhlaWdodCkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIC8vIGNsZWFyIHByb2Nlc3NlZCBmbGFnIGZpcnN0XG4gICAgICAgICAgICAgIHByb2Nlc3NpbmdGbGFnc1tpbmRleF0gJj0gcHJvY2Vzc2VkSW52ZXJzZU1hc2s7XG5cbiAgICAgICAgICAgICAgaWYgKGNvZWZmaWNlbnRzTWFnbml0dWRlW2luZGV4XSB8fFxuICAgICAgICAgICAgICAgICAgIW5laWdoYm9yc1NpZ25pZmljYW5jZVtpbmRleF0pIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHZhciBjb250ZXh0TGFiZWwgPSBsYWJlbHNbbmVpZ2hib3JzU2lnbmlmaWNhbmNlW2luZGV4XV07XG4gICAgICAgICAgICAgIHZhciBkZWNpc2lvbiA9IGRlY29kZXIucmVhZEJpdChjb250ZXh0cywgY29udGV4dExhYmVsKTtcbiAgICAgICAgICAgICAgaWYgKGRlY2lzaW9uKSB7XG4gICAgICAgICAgICAgICAgdmFyIHNpZ24gPSB0aGlzLmRlY29kZVNpZ25CaXQoaSwgaiwgaW5kZXgpO1xuICAgICAgICAgICAgICAgIGNvZWZmaWNlbnRzU2lnbltpbmRleF0gPSBzaWduO1xuICAgICAgICAgICAgICAgIGNvZWZmaWNlbnRzTWFnbml0dWRlW2luZGV4XSA9IDE7XG4gICAgICAgICAgICAgICAgdGhpcy5zZXROZWlnaGJvcnNTaWduaWZpY2FuY2UoaSwgaiwg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KHNpZ25pZmljYW5jZTEpIHtcbiAgICAgICAgICAgIHNpZ24wID0gY29lZmZpY2VudHNTaWduW2luZGV4IC0gMV07XG4gICAgICAgICAgICBjb250cmlidXRpb24gPSAxIC0gc2lnbjEgLSBzaWduMDtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgY29udHJpYnV0aW9uID0gMSAtIHNpZ24xIC0gc2lnbjE7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKHNpZ25pZmljYW5jZTEpIHtcbiAgICAgICAgICBzaWduMCA9IGNvZWZmaWNlbnRzU2lnbltpbmRleCAtIDFdO1xuICAgICAgICAgIGNvbnRyaWJ1dGlvbiA9IDEgLSBzaWduMCAtIHNpZ24wO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGNvbnRyaWJ1dGlvbiA9IDA7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIGhvcml6b250YWxDb250cmlidXRpb24gPSAzICogY29udHJpYnV0aW9uO1xuXG4gICAgICAgIC8vIGNhbGN1bGF0ZSB2ZXJ0aWNhbCBjb250cmlidXRpb24gYW5kIGNvbWJpbmUgd2l0aCB0aGUgaG9yaXpvbnRhbFxuICAgICAgICBzaWduaWZpY2FuY2UxID0gKHJvdyA+IDAgJiYgY29lZmZpY2VudHNNYWduaXR1ZGVbaW5kZXggLSB3aWR0aF0gIT09IDApO1xuICAgICAgICBpZiAocm93ICsgMSA8IGhlaWdodCAmJiBjb2VmZmljZW50c01hZ25pdHVkZVtpbmRleCArIHdpZHRoXSAhPT0gMCkge1xuICAgICAgICAgIHNpZ24xID0gY29lZmZpY2VudHNTaWduW2luZGV4ICsgd2lkdGhdO1xuICAgICAgICAgIGlmIChzaWduaWZpY2FuY2UxKSB7XG4gICAgICAgICAgICBzaWduMCA9IGNvZWZmaWNlbnRzU2lnbltpbmRleCAtIHdpZHRoXTtcbiAgICAgICAgICAgIGNvbnRyaWJ1dGlvbiA9IDEgLSBzaWduMSAtIHNpZ24wICsgaG9yaXpvbnRhbENvbnRyaWJ1dGlvbjtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgY29udHJpYnV0aW9uID0gMSAtIHNpZ24xIC0gc2lnbjEgKyBob3Jpem9udGFsQ29udHJpYnV0aW9uO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChzaWduaWZpY2FuY2UxKSB7XG4gICAgICAgICAgc2lnbjAgPSBjb2VmZmljZW50c1NpZ25baW5kZXggLSB3aWR0aF07XG4gICAgICAgICAgY29udHJpYnV0aW9uID0gMSAtIHNpZ24wIC0gc2lnbjAgKyBob3Jpem9udGFsQ29udHJpYnV0aW9uO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGNvbnRyaWJ1dGlvbiA9IGhvcml6b250YWxDb250cmlidXRpb247XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoY29udHJpYnV0aW9uID49IDApIHtcbiAgICAgICAgICBjb250ZXh0TGFiZWwgPSA5ICsgY29udHJpYnV0aW9uO1xuICAgICAgICAgIGRlY29kZWQgPSB0aGlzLmRlY29kZXIucmVhZEJpdCh0aGlzLmNvbnRleHRzLCBjb250ZXh0TGFiZWwpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGNvbnRleHRMYWJlbCA9IDkgLSBjb250cmlidXRpb247XG4gICAgICAgICAgZGVjb2RlZCA9IHRoaXMuZGVjb2Rlci5yZWFkQml0KHRoaXMuY29udGV4dHMsIGNvbnRleHRMYWJlbCkgXiAxO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBkZWNvZGVkO1xuICAgICAgfSxcbiAgICAgIHJ1bk1hZ25pdHVkZVJlZmluZW1lbnRQYXNzOlxuICAgICAgICBmdW5jdGlvbiBCaXRNb2RlbF9ydW5NYWduaXR1ZGVSZWZpbmVtZW50UGFzcygpIHtcbiAgICAgICAgdmFyIGRlY29kZXIgPSB0aGlzLmRlY29kZXI7XG4gICAgICAgIHZhciB3aWR0aC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ICAgICAgICAgKHByb2Nlc3NpbmdGbGFnc1tpbmRleF0gJiBwcm9jZXNzZWRNYXNrKSAhPT0gMCkge1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgdmFyIGNvbnRleHRMYWJlbCA9IDE2O1xuICAgICAgICAgICAgICBpZiAoKHByb2Nlc3NpbmdGbGFnc1tpbmRleF0gJiBmaXJzdE1hZ25pdHVkZUJpdE1hc2spICE9PSAwKSB7XG4gICAgICAgICAgICAgICAgcHJvY2Vzc2luZ0ZsYWdzW2luZGV4XSBePSBmaXJzdE1hZ25pdHVkZUJpdE1hc2s7XG4gICAgICAgICAgICAgICAgLy8gZmlyc3QgcmVmaW5lbWVudFxuICAgICAgICAgICAgICAgdmFyIHNpZ25pZmljYW5jZSA9IG5laWdoYm9yc1NpZ25pZmljYW5jZVtpbmRleF0gJiAxMjc7XG4gICAgICAgICAgICAgICBjb250ZXh0TGFiZWwgPSBzaWduaWZpY2FuY2UgPT09IDAgPyAxNSA6IDE0O1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgdmFyIGJpdCA9IGRlY29kZXIucmVhZEJpdChjb250ZXh0cywgY29udGV4dExhYmVsKTtcbiAgICAgICAgICAgICAgY29lZmZpY2VudHNNYWduaXR1ZGVbaW5kZXhdID1cbiAgICAgICAgICAgICAgICAoY29lZmZpY2VudHNNYWduaXR1ZGVbaW5kZXhdIDw8IDEpIHwgYml0O1xuICAgICAgICAgICAgICBiaXRzRGVjb2RlZFtpbmRleF0rKztcbiAgICAgICAgICAgICAgcHJvY2Vzc2luZ0ZsYWdzW2luZGV4XSB8PSBwcm9jZXNzZWRNYXNrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIHJ1bkNsZWFudXBQYXNzOiBmdW5jdGlvbiBCaXRNb2RlbF9ydW5DbGVhbnVwUGFzcygpIHtcbiAgICAg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aHQ7XG4gICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCB3aWR0aDsgaisrKSB7XG4gICAgICAgICAgICB2YXIgaW5kZXgwID0gaW5kZXhCYXNlICsgajtcbiAgICAgICAgICAgIC8vIHVzaW5nIHRoZSBwcm9wZXJ0eTogbGFiZWxzW25laWdoYm9yc1NpZ25pZmljYW5jZVtpbmRleF1dID09PSAwXG4gICAgICAgICAgICAvLyB3aGVuIG5laWdoYm9yc1NpZ25pZmljYW5jZVtpbmRleF0gPT09IDBcbiAgICAgICAgICAgIHZhciBhbGxFbXB0eSA9IChjaGVja0FsbEVtcHR5ICYmXG4gICAgICAgICAgICAgIHByb2Nlc3NpbmdGbGFnc1tpbmRleDBdID09PSAwICYmXG4gICAgICAgICAgICAgIHByb2Nlc3NpbmdGbGFnc1tpbmRleDAgKyBvbmVSb3dEb3duXSA9PT0gMCAmJlxuICAgICAgICAgICAgICBwcm9jZXNzaW5nRmxhZ3NbaW5kZXgwICsgdHdvUm93c0Rvd25dID09PSAwICYmXG4gICAgICAgICAgICAgIHByb2Nlc3NpbmdGbGFnc1tpbmRleDAgKyB0aHJlZVJvd3NEb3duXSA9PT0gMCAmJlxuICAgICAgICAgICAgICBuZWlnaGJvcnNTaWduaWZpY2FuY2VbaW5kZXgwXSA9PT0gMCAmJlxuICAgICAgICAgICAgICBuZWlnaGJvcnNTaWduaWZpY2FuY2VbaW5kZXgwICsgb25lUm93RG93bl0gPT09IDAgJiZcbiAgICAgICAgICAgICAgbmVpZ2hib3JzU2lnbmlmaWNhbmNlW2luZGV4MCArIHR3b1Jvd3NEb3duXSA9PT0gMCAmJlxuICAgICAgICAgICAgICBuZWlnaGJvcnNTaWduaWZpY2FuY2VbaW5kZXgwICsgdGhyZWVSb3dzRG93bl0gPT09IDApO1xuICAgICAgICAgICAgdmFyIGkxID0gMCwgaW5kZXggPSBpbmRleDA7XG4gICAgICAgICAgICB2YXIgaSA9IGkwLCBzaWduO1xuICAgICAgICAgICAgaWYgKGFsbEVtcHR5KSB7XG4gICAgICAgICAgICAgIHZhciBoYXNTaWduaWZpY2FudENvZWZmaWNlbnQgPVxuICAgICAgICAgICAgICAgIGRlY29kZXIucmVhZEJpdChjb250ZXh0cywgUlVOTEVOR1RIX0NPTlRFWFQpO1xuICAgICAgICAgICAgICBpZiAoIWhhc1NpZ25pZmljYW50Q29lZmZpY2VudCkge1xuICAgICAgICAgICAgICAgIGJpdHNEZWNvZGVkW2luZGV4MF0rKztcbiAgICAgICAgICAgICAgICBiaXRzRGVjb2RlZFtpbmRleDAgKyBvbmVSb3dEb3duXSsrO1xuICAgICAgICAgICAgICAgIGJpdHNEZWNvZGVkW2luZGV4MCArIHR3b1Jvd3NEb3duXSsrO1xuICAgICAgICAgICAgICAgIGJpdHNEZWNvZGVkW2luZGV4MCArIHRocmVlUm93c0Rvd25dKys7XG4gICAgICAgICAgICAgICAgY29udGludWU7IC8vIG5leHQgY29sdW1uXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaTEgPSAoZGVjb2Rlci5yZWFkQml0KGNvbnRleHRzLCBVTklGT1JNX0NPTlRFWFQpIDw8IDEpIHxcbiAgICAgICAgICAgICAgICAgICAgZGVjb2Rlci5yZWFkQml0KGNvbnRleHRzLCBVTklGT1JNX0NPTlRFWFQpO1xuICAgICAgICAgICAgICBpZiAoaTEgIT09IDApIHtcbiAgICAgICAgICAgICAgICBpID0gaTAgKyBpMTtcbiAgICAgICAgICAgICAgICBpbmRleCArPSBpMSAqIHdpZHRoO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgc2lnbiA9IHRoaXMuZGVjb2RlU2lnbkJpdChpLCBqLCBpbmRleCk7XG4gICAgICAgICAgICAgIGNvZWZmaWNlbnRzU2lnbltpbmRleF0gPSBzaWduO1xuICAgICAgICAgICAgICBjb2VmZmljZW50c01hZ25pdHVkZVtpbmRleF0gPSAxO1xuICAgICAgICAgICAgICB0aGlzLnNldE5laWdoYm9yc1NpZ25pZmljYW5jZShpLCBqLCBpbmRleCk7XG4gICAgICAgICAgICAgIHByb2Nlc3NpbmdGbGFnc1tpbmRleF0gfD0gZmlyc3RNYWduaXR1ZGVCaXRNYXNrO1xuXG4gICAgICAgICAgICAgIGluZGV4ID0gaW5kZXgwO1xuICAgICAgICAgICAgICBmb3IgKHZhciBpMiA9IGkwOyBpMiA8PSBpOyBpMisrLCBpbmRleCArPSB3aWR0aCkge1xuICAgICAgICAgICAgICAgIGJpdHNEZWNvZGVkW2luZGV4XSsrO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgaTErKztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZvciAoaSA9IGkwICsgaTE7IGkgPCBpTmV4dDsgaSsrLCBpbmRleCArPSB3aWR0aCkge1xuICAgICAgICAgICAgICBpZiAoY29lZmZpY2VudHNNYWduaXR1ZGVbaW5kZXhdIHx8XG4gICAgICAgICAgICAgICAgKHByb2Nlc3NpbmdGbGFnc1tpbmRleF0gJiBwcm9jZXNzZWRNYXNrKSAhPT0gMCkge1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgdmFyIGNvbnRleHRMYWJlbCA9IGxhYmVsc1tuZWlnaGJvcnNTaWduaWZpY2FuY2VbaW5kZXhdXTtcbiAgICAgICAgICAgICAgdmFyIGRlY2lzaW9uID0gZGVjb2Rlci5yZWFkQml0KGNvbnRleHRzLCBjb250ZXh0TGFiZWwpO1xuICAgICAgICAgICAgICBpZiAoZGVjaXNpb24gPT09IDEpIHtcbiAgICAgICAgICAgICAgICBzaWduID0gdGhpcy5kZWNvZGVTaWduQml0KGksIGosIGluZGV4KTtcbiAgICAgICAgICAgICAgICBjb2VmZmljZW50c1NpZ25baW5kZXhdID0gc2lnbjtcbiAgICAgICAgICAgICAgICBjb2VmZmljZW50c01hZ25pdHVkZVtpbmRleF0gPSAxO1xuICAgICAgICAgICAgICAgIHRoaXMuc2V0TmVpZ2hib3JzU2lnbmlmaWNhbmNlKGksIGosIGluZGV4KTtcbiAgICAgICAgICAgICAgICBwcm9jZXNzaW5nRmxhZ3NbaW5kZXhdIHw9IGZpcnN0TWFnbml0dWRlQml0TWFzaztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBiaXRzRGVjb2RlZFtpbmRleF0rKztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBjaGVja1NlZ21lbnRhdGlvblN5bWJvbDogZnVuY3Rpb24gQml0TW9kZWxfY2hlY2tTZWdtZW50YXRpb25TeW1ib2woKSB7XG4gICAgICAgIHZhciBkZWNvZGVyID0gdGhpcy5kZWNvZGVyO1xuICAgICAgICB2YXIgY29udGV4dHMgPSB0aGlzLmNvbnRleHRzO1xuICAgICAgICB2YXIgc3ltYm9sID0gKGRlY29kZXIucmVhZEJpdChjb250ZXh0cywgVU5JRk9STV9DT05URVhUKSA8PCAzKSB8XG4gICAgICAgICAgICAgICAgICAgICAoZGVjb2Rlci5yZWFkQml0KGNvbnRleHRzLCBVTklGT1JNX0NPTlRFWFQpIDw8IDIpIHxcbiAgICAgICAgICAgICAgICAgICAgIChkZWNvZGVyLnJlYWRCaXQoY29udGV4dHMsIFVOSUZPUk1fQ09OVEVYVCkgPDwgMSkgfFxuICAgICAgICAgICAgICAgICAgICAgIGRlY29kZXIucmVhZEJpdChjb250ZXh0cywgVU5JRk9STV9DT05URVhUKTtcbiAgICAgICAgaWYgKHN5bWJvbCAhPT0gMHhBKSB7XG4gICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdKUFggRXJyb3I6IEludmFsaWQgc2VnbWVudGF0aW9uIHN5bWJvbCcpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfTtcblxuICAgIHJldHVybiBCaXRNb2RlbDtcbiAgfSkoKTtcblxuICAvLyBTZWN0aW9uIEYsIERpc2NyZXRlIHdhdmVsZXQgdHJhbnNmb3JtYXRpb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GVuICsgMjsgbi0tOyBqICs9IDIpIHtcbiAgICAgICAgbmV4dCA9IGdhbW1hICogeFtqICsgMV07XG4gICAgICAgIHhbal0gLT0gY3VycmVudCArIG5leHQ7XG4gICAgICAgIGlmIChuLS0pIHtcbiAgICAgICAgICBqICs9IDI7XG4gICAgICAgICAgY3VycmVudCA9IGdhbW1hICogeFtqICsgMV07XG4gICAgICAgICAgeFtqXSAtPSBjdXJyZW50ICsgbmV4dDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICAvLyBzdGVwIDVcbiAgICAgIGogPSBvZmZzZXQ7XG4gICAgICBjdXJyZW50ID0gYmV0YSAqIHhbaiAtIDFdO1xuICAgICAgZm9yIChuID0gbGVuICsgMTsgbi0tOyBqICs9IDIpIHtcbiAgICAgICAgbmV4dCA9IGJldGEgKiB4W2ogKyAxXTtcbiAgICAgICAgeFtqXSAtPSBjdXJyZW50ICsgbmV4dDtcbiAgICAgICAgaWYgKG4tLSkge1xuICAgICAgICAgIGogKz0gMjtcbiAgICAgICAgICBjdXJyZW50ID0gYmV0YSAqIHhbaiArIDFdO1xuICAgICAgICAgIHhbal0gLT0gY3VycmVudCArIG5leHQ7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgLy8gc3RlcCA2XG4gICAgICBpZiAobGVuICE9PSAwKSB7XG4gICAgICAgIGogPSBvZmZzZXQgKyAxO1xuICAgICAgICBjdXJyZW50ID0gYWxwaGEgKiB4W2ogLSAxXTtcbiAgICAgICAgZm9yIChuID0gbGVuOyBuLS07IGogKz0gMikge1xuICAgICAgICAgIG5leHQgPSBhbHBoYSAqIHhbaiArIDFdO1xuICAgICAgICAgIHhbal0gLT0gY3VycmVudCArIG5leHQ7XG4gICAgICAgICAgaWYgKG4tLSkge1xuICAgICAgICAgICAgaiArPSAyO1xuICAgICAg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vKHMtPndpbmRvdyArIGN1cnIsICh1bnNpZ25lZClpbml0KTtcbi8vICAgICAgcy0+aGlnaF93YXRlciA9IGN1cnIgKyBpbml0O1xuLy8gICAgfVxuLy8gICAgZWxzZSBpZiAocy0+aGlnaF93YXRlciA8ICh1bGcpY3VyciArIFdJTl9JTklUKSB7XG4vLyAgICAgIC8qIEhpZ2ggd2F0ZXIgbWFyayBhdCBvciBhYm92ZSBjdXJyZW50IGRhdGEsIGJ1dCBiZWxvdyBjdXJyZW50IGRhdGFcbi8vICAgICAgICogcGx1cyBXSU5fSU5JVCAtLSB6ZXJvIG91dCB0byBjdXJyZW50IGRhdGEgcGx1cyBXSU5fSU5JVCwgb3IgdXBcbi8vICAgICAgICogdG8gZW5kIG9mIHdpbmRvdywgd2hpY2hldmVyIGlzIGxlc3MuXG4vLyAgICAgICAqL1xuLy8gICAgICBpbml0ID0gKHVsZyljdXJyICsgV0lOX0lOSVQgLSBzLT5oaWdoX3dhdGVyO1xuLy8gICAgICBpZiAoaW5pdCA+IHMtPndpbmRvd19zaXplIC0gcy0+aGlnaF93YXRlcilcbi8vICAgICAgICBpbml0ID0gcy0+d2luZG93X3NpemUgLSBzLT5oaWdoX3dhdGVyO1xuLy8gICAgICB6bWVtemVybyhzLT53aW5kb3cgKyBzLT5oaWdoX3dhdGVyLCAodW5zaWduZWQpaW5pdCk7XG4vLyAgICAgIHMtPmhpZ2hfd2F0ZXIgKz0gaW5pdDtcbi8vICAgIH1cbi8vICB9XG4vL1xuLy8gIEFzc2VydCgodWxnKXMtPnN0cnN0YXJ0IDw9IHMtPndpbmRvd19zaXplIC0gTUlOX0xPT0tBSEVBRCxcbi8vICAgIFwibm90IGVub3VnaCByb29tIGZvciBzZWFyY2hcIik7XG59XG5cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogQ29weSB3aXRob3V0IGNvbXByZXNzaW9uIGFzIG11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FkZXIgKi9cbiAgaWYgKHMuc3RhdHVzID09PSBJTklUX1NUQVRFKSB7XG5cbiAgICBpZiAocy53cmFwID09PSAyKSB7IC8vIEdaSVAgaGVhZGVyXG4gICAgICBzdHJtLmFkbGVyID0gMDsgIC8vY3JjMzIoMEwsIFpfTlVMTCwgMCk7XG4gICAgICBwdXRfYnl0ZShzLCAzMSk7XG4gICAgICBwdXRfYnl0ZShzLCAxMzkpO1xuICAgICAgcHV0X2J5dGUocywgOCk7XG4gICAgICBpZiAoIXMuZ3poZWFkKSB7IC8vIHMtPmd6aGVhZCA9PSBaX05VTExcbiAgICAgICAgcHV0X2J5dGUocywgMCk7XG4gICAgICAgIHB1dF9ieXRlKHMsIDApO1xuICAgICAgICBwdXRfYnl0ZShzLCAwKTtcbiAgICAgICAgcHV0X2J5dGUocywgMCk7XG4gICAgICAgIHB1dF9ieXRlKHMsIDApO1xuICAgICAgICBwdXRfYnl0ZShzLCBzLmxldmVsID09PSA5ID8gMiA6XG4gICAgICAgICAgICAgICAgICAgIChzLnN0cmF0ZWd5ID49IFpfSFVGRk1BTl9PTkxZIHx8IHMubGV2ZWwgPCAyID9cbiAgICAgICAgICAgICAgICAgICAgIDQgOiAwKSk7XG4gICAgICAgIHB1dF9ieXRlKHMsIE9TX0NPREUpO1xuICAgICAgICBzLnN0YXR1cyA9IEJVU1lfU1RBVEU7XG4gICAgICB9XG4gICAgICBlbHNlIHtcbiAgICAgICAgcHV0X2J5dGUocywgKHMuZ3poZWFkLnRleHQgPyAxIDogMCkgK1xuICAgICAgICAgICAgICAgICAgICAocy5nemhlYWQuaGNyYyA/IDIgOiAwKSArXG4gICAgICAgICAgICAgICAgICAgICghcy5nemhlYWQuZXh0cmEgPyAwIDogNCkgK1xuICAgICAgICAgICAgICAgICAgICAoIXMuZ3poZWFkLm5hbWUgPyAwIDogOCkgK1xuICAgICAgICAgICAgICAgICAgICAoIXMuZ3poZWFkLmNvbW1lbnQgPyAwIDogMTYpXG4gICAgICAgICAgIC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vZGU7ICAgICAgICAgICAgICAgICAgLyogbG9jYWwgc3RybS5sZW5jb2RlICovXG4gIHZhciBkY29kZTsgICAgICAgICAgICAgICAgICAvKiBsb2NhbCBzdHJtLmRpc3Rjb2RlICovXG4gIHZhciBsbWFzazsgICAgICAgICAgICAgICAgICAvKiBtYXNrIGZvciBmaXJzdCBsZXZlbCBvZiBsZW5ndGggY29kZXMgKi9cbiAgdmFyIGRtYXNrOyAgICAgICAgICAgICAgICAgIC8qIG1hc2sgZm9yIGZpcnN0IGxldmVsIG9mIGRpc3RhbmNlIGNvZGVzICovXG4gIHZhciBoZXJlOyAgICAgICAgICAgICAgICAgICAvKiByZXRyaWV2ZWQgdGFibGUgZW50cnkgKi9cbiAgdmFyIG9wOyAgICAgICAgICAgICAgICAgICAgIC8qIGNvZGUgYml0cywgb3BlcmF0aW9uLCBleHRyYSBiaXRzLCBvciAqL1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogIHdpbmRvdyBwb3NpdGlvbiwgd2luZG93IGJ5dGVzIHRvIGNvcHkgKi9cbiAgdmFyIGxlbjsgICAgICAgICAgICAgICAgICAgIC8qIG1hdGNoIGxlbmd0aCwgdW51c2VkIGJ5dGVzICovXG4gIHZhciBkaXN0OyAgICAgICAgICAgICAgICAgICAvKiBtYXRjaCBkaXN0YW5jZSAqL1xuICB2YXIgZnJvbTsgICAgICAgICAgICAgICAgICAgLyogd2hlcmUgdG8gY29weSBtYXRjaCBmcm9tICovXG4gIHZhciBmcm9tX3NvdXJjZTtcblxuXG4gIHZhciBpbnB1dCwgb3V0cHV0OyAvLyBKUyBzcGVjaWZpYywgYmVjYXVzZSB3ZSBoYXZlIG5vIHBvaW50ZXJzXG5cbiAgLyogY29weSBzdGF0ZSB0byBsb2NhbCB2YXJpYWJsZXMgKi9cbiAgc3RhdGUgPSBzdHJtLnN0YXRlO1xuICAvL2hlcmUgPSBzdGF0ZS5oZXJlO1xuICBfaW4gPSBzdHJtLm5leHRfaW47XG4gIGl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O1xuXG4gICAgZG9sZW46XG4gICAgZm9yICg7OykgeyAvLyBHb3RvIGVtdWxhdGlvblxuICAgICAgb3AgPSBoZXJlID4+PiAyNC8qaGVyZS5iaXRzKi87XG4gICAgICBob2xkID4+Pj0gb3A7XG4gICAgICBiaXRzIC09IG9wO1xuICAgICAgb3AgPSAoaGVyZSA+Pj4gMTYpICYgMHhmZi8qaGVyZS5vcCovO1xuICAgICAgaWYgKG9wID09PSAwKSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBsaXRlcmFsICovXG4gICAgICAgIC8vVHJhY2V2digoc3RkZXJyLCBoZXJlLnZhbCA+PSAweDIwICYmIGhlcmUudmFsIDwgMHg3ZiA/XG4gICAgICAgIC8vICAgICAgICBcImluZmxhdGU6ICAgICAgICAgbGl0ZXJhbCAnJWMnXFxuXCIgOlxuICAgICAgICAvLyAgICAgICAgXCJpbmZsYXRlOiAgICAgICAgIGxpdGVyYWwgMHglMDJ4XFxuXCIsIGhlcmUudmFsKSk7XG4gICAgICAgIG91dHB1dFtfb3V0KytdID0gaGVyZSAmIDB4ZmZmZi8qaGVyZS52YWwqLztcbiAgICAgIH1cbiAgICAgIGVsc2UgaWYgKG9wICYgMTYpIHsgICAgICAgICAgICAgICAgICAgICAvKiBsZW5ndGggYmFzZSAqL1xuICAgICAgICBsZW4gPSBoZXJlICYgMHhmZmZmLypoZXJlLnZhbCovO1xuICAgICAgICBvcCAmPSAxNTsgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBudW1iZXIgb2YgZXh0cmEgYml0cyAqL1xuICAgICAgICBpZiAob3ApIHtcbiAgICAgICAgICBpZiAoYml0cyA8IG9wKSB7XG4gICAgICAgICAgICBob2xkICs9IGlucHV0W19pbisrXSA8PCBiaXRzO1xuICAgICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICAgIH1cbiAgICAgICAgICBsZW4gKz0gaG9sZCAmICgoMSA8PCBvcCkgLSAxKTtcbiAgICAgICAgICBob2xkID4+Pj0gb3A7XG4gICAgICAgICAgYml0cyAtPSBvcDtcbiAgICAgICAgfVxuICAgICAgICAvL1RyYWNldnYoKHN0ZGVyciwgXCJpbmZsYXRlOiAgICAgICAgIGxlbmd0aCAldVxcblwiLCBsZW4pKTtcbiAgICAgICAgaWYgKGJpdHMgPCAxNSkge1xuICAgICAgICAgIGhvbGQgKz0gaW5wdXRbX2luKytdIDw8IGJpdHM7XG4gICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICAgIGhvbGQgKz0gaW5wdXRbX2luKytdIDw8IGJpdHM7XG4gICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICB9XG4gICAgICAgIGhlcmUgPSBkY29kZVtob2xkICYgZG1hc2tdO1xuXG4gICAgICAgIGRvZGlzdDpcbiAgICAgICAgZm9yICg7OykgeyAvLyBnb3RvIGVtdWxhdGlvblxuICAgICAgICAgIG9wID0gaGVyZSA+Pj4gMjQvKmhlcmUuYml0cyovO1xuICAgICAgICAgIGhvbGQgPj4+PSBvcDtcbiAgICAgICAgICBiaXRzIC09IG9wO1xuICAgICAgICAgIG9wID0gKGhlcmUgPj4+IDE2KSAmIDB4ZmYvKmhlcmUub3AqLztcblxuICAgICAgICAgIGlmIChvcCAmIDE2KSB7ICAgICAgICAgICAgICAgICAgICAgIC8qIGRpc3RhbmNlIGJhc2UgKi9cbiAgICAgICAgICAgIGRpc3QgPSBoZXJlICYgMHhmZmZmLypoZXJlLnZhbCovO1xuICAgICAgICAgICAgb3AgJj0gMTU7ICAgICAgICAgICAgICAgICAgICAgICAvKiBudW1iZXIgb2YgZXh0cmEgYml0cyAqL1xuICAgICAgICAgICAgaWYgKGJpdHMgPCBvcCkge1xuICAgICAgICAgICAgICBob2xkICs9IGlucHV0W19pbisrXSA8PCBiaXRzO1xuICAgICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgICAgIGlmIChiaXRzIDwgb3ApIHtcbiAgICAgICAgICAgICAgICBob2xkICs9IGlucHV0W19pbisrXSA8PCBiaXRzO1xuICAgICAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZGlzdCArPSBob2xkICYgKCgxIDw8IG9wKSAtIDEpO1xuLy8jaWZkZWYgSU5GTEFURV9TVFJJQ1RcbiAgICAgICAgICAgIGlmIChkaXN0ID4gZG1heCkge1xuICAgICAgICAgICAgICBzdHJtLm1zZyA9ICdpbnZhbGlkIGRpc3RhbmNlIHRvbyBmYXIgYmFjayc7XG4gICAgICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgICAgIGJyZWFrIHRvcDtcbiAgICAgICAgICAgIH1cbi8vI2VuZGlmXG4gICAgICAgICAgICBob2xkID4+Pj0gb3A7XG4gICAgICAgICAgICBiaXRzIC09IG9wO1xuICAgICAgICAgICAgLy9UcmFjZXZ2KChzdGRlcnIsIFwiaW5mbGF0ZTogICAgICAgICBkaXN0YW5jZSAldVxcblwiLCBkaXN0KSk7XG4gICAgICAgICAgICBvcCA9IF9vdXQgLSBiZWc7ICAgICAgICAgICAgICAgIC8qIG1heCBkaXN0YW5jZSBpbiBvdXRwdXQgKi9cbiAgICAgICAgICAgIGlmIChkaXN0ID4gb3ApIHsgICAgICAgICAgICAgICAgLyogc2VlIGlmIGNvcHkgZnJvbSB3aW5kb3cgKi9cbiAgICAgICAgICAgICAgb3AgPSBkaXN0IC0gb3A7ICAgICAgICAgICAgICAgLyogZGlzdGFuY2UgYmFjayBpbiB3aW5kb3cgKi9cbiAgICAgICAgICAgICAgaWYgKG9wID4gd2hhdmUpIHtcbiAgICAgICAgICAgICAgICBpZiAoc3RhdGUuc2FuZSkge1xuICAgICAgICAgICAgICAgICAgc3RybS5tc2cgPSAnaW52YWxpZCBkaXN0YW5jZSB0b28gZmFyIGJhY2snO1xuICAgICAgICAgICAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgICAgICAgICAgIGJyZWFrIHRvcDtcbiAgICAgICAgICAgICAgICB9XG5cbi8vICghKSBUaGlzIGJsb2NrIGlzIGRpc2FibGVkIGluIHpsaWIgZGVmYWlsdHMsXG4vLyBkb24ndCBlbmFibGUgaXQgZm9yIGJpbmFyeSBjb21wYXRpYmlsaXR5XG4vLyNpZmRlZiBJTkZMQVRFX0FMTE9XX0lOVkFMSURfRElTVEFOQ0VfVE9PRkFSX0FSUlJcbi8vICAgICAgICAgICAgICAgIGlmIChsZW4gPD0gb3AgLSB3aGF2ZSkge1xuLy8gICAgICAgICAgICAgICAgICBkbyB7XG4vLyAgICAgICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSAwO1xuLy8gICAgICAgICAgICAgICAgICB9IHdoaWxlICgtLWxlbik7XG4vLyAgICAgICAgICAgICAgICAgIGNvbnRpbnVlIHRvcDtcbi8vICAgICAgICAgICAgICAgIH1cbi8vICAgICAgICAgICAgICAgIGxlbiAtPSBvcCAtIHdoYXZlO1xuLy8gICAgICAgICAgICAgICAgZG8ge1xuLy8gICAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IDA7XG4vLyAgICAgICAgICAgICAgICB9IHdoaWxlICgtLW9wID4gd2hhdmUpO1xuLy8gICAgICAgICAgICAgICAgaWYgKG9wID09PSAwKSB7XG4vLyAgICAgICAgICAgICAgICAgIGZyb20gPSBfb3V0IC0gZGlzdDtcbi8vICAgICAgICAgICAgICAgICAgZG8ge1xuLy8gICAgICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gb3V0cHV0W2Zyb20rK107XG4vLyAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKC0tbGVuKTtcbi8vICAgICAgICAgICAgICAgICAgY29udGludWUgdG9wO1xuLy8gICAgICAgICAgICAgICAgfVxuLy8jZW5kaWZcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBmcm9tID0gMDsgLy8gd2luZG93IGluZGV4XG4gICAgICAgICAgICAgIGZyb21fc291cmNlID0gc193aW5kb3c7XG4gICAgICAgICAgICAgIGlmICh3bmV4dCA9PT0gMCkgeyAgICAgICAgICAgLyogdmVyeSBjb21tb24gY2FzZSAqL1xuICAgICAgICAgICAgICAgIGZyb20gKz0gd3NpemUgLSBvcDtcbiAgICAgICAgICAgICAgICBpZiAob3AgPCBsZW4pIHsgICAgICAgICAvKiBzb21lIGZyb20gd2luZG93ICovXG4gICAgICAgICAgICAgICAgICBsZW4gLT0gb3A7XG4gICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gc193aW5kb3dbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKC0tb3ApO1xuICAgICAgICAgICAgICAgICAgZnJvbSA9IF9vdXQgLSBkaXN0OyAgLyogcmVzdCBmcm9tIG91dHB1dCAqL1xuICAgICAgICAgICAgICAgICAgZnJvbV9zb3VyY2UgPSBvdXRwdXQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGVsc2UgaWYgKHduZXh0IDwgb3ApIHsgICAgICAvKiB3cmFwIGFyb3VuZCB3aW5kb3cgKi9cbiAgICAgICAgICAgICAgICBmcm9tICs9IHdzaXplICsgd25leHQgLSBvcDtcbiAgICAgICAgICAgICAgICBvcCAtPSB3bmV4dDtcbiAgICAgICAgICAgICAgICBpZiAob3AgPCBsZW4pIHsgICAgICAgICAvKiBzb21lIGZyb20gZW5kIG9mIHdpbmRvdyAqL1xuICAgICAgICAgICAgICAgICAgbGVuIC09IG9wO1xuICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IHNfd2luZG93W2Zyb20rK107XG4gICAgICAgICAgICAgICAgICB9IHdoaWxlICgtLW9wKTtcbiAgICAgICAgICAgICAgICAgIGZyb20gPSAwO1xuICAgICAgICAgICAgICAgICAgaWYgKHduZXh0IDwgbGVuKSB7ICAvKiBzb21lIGZyb20gc3RhcnQgb2Ygd2luZG93ICovXG4gICAgICAgICAgICAgICAgICAgIG9wID0gd25leHQ7XG4gICAgICAgICAgICAgICAgICAgIGxlbiAtPSBvcDtcbiAgICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gc193aW5kb3dbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoLS1vcCk7XG4gICAgICAgICAgICAgICAgICAgIGZyb20gPSBfb3V0IC0gZGlzdDsgICAgICAvKiByZXN0IGZyb20gb3V0cHV0ICovXG4gICAgICAgICAgICAgICAgICAgIGZyb21fc291cmNlID0gb3V0cHV0O1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBlbHNlIHsgICAgICAgICAgICAgICAgICAgICAgLyogY29udGlndW91cyBpbiB3aW5kb3cgKi9cbiAgICAgICAgICAgICAgICBmcm9tICs9IHduZXh0IC0gb3A7XG4gICAgICAgICAgICAgICAgaWYgKG9wIDwgbGVuKSB7ICAgICAgICAgLyogc29tZSBmcm9tIHdpbmRvdyAqL1xuICAgICAgICAgICAgICAgICAgbGVuIC09IG9wO1xuICAgICAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IHNfd2luZG93W2Zyb20rK107XG4gICAgICAgICAgICAgICAgICB9IHdoaWxlICgtLW9wKTtcbiAgICAgICAgICAgICAgICAgIGZyb20gPSBfb3V0IC0gZGlzdDsgIC8qIHJlc3QgZnJvbSBvdXRwdXQgKi9cbiAgICAgICAgICAgICAgICAgIGZyb21fc291cmNlID0gb3V0cHV0O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB3aGlsZSAobGVuID4gMikge1xuICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gZnJvbV9zb3VyY2VbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IGZyb21fc291cmNlW2Zyb20rK107XG4gICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBmcm9tX3NvdXJjZVtmcm9tKytdO1xuICAgICAgICAgICAgICAgIGxlbiAtPSAzO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChsZW4pIHtcbiAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IGZyb21fc291cmNlW2Zyb20rK107XG4gICAgICAgICAgICAgICAgaWYgKGxlbiA+IDEpIHtcbiAgICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gZnJvbV9zb3VyY2VbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICBmcm9tID0gX291dCAtIGRpc3Q7ICAgICAgICAgIC8qIGNvcHkgZGlyZWN0IGZyb20gb3V0cHV0ICovXG4gICAgICAgICAgICAgIGRvIHsgICAgICAgICAgICAgICAgICAgICAgICAvKiBtaW5pbXVtIGxlbmd0aCBpcyB0aHJlZSAqL1xuICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gb3V0cHV0W2Zyb20rK107XG4gICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBvdXRwdXRbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IG91dHB1dFtmcm9tKytdO1xuICAgICAgICAgICAgICAgIGxlbiAtPSAzO1xuICAgICAgICAgICAgICB9IHdoaWxlIChsZW4gPiAyKTtcbiAgICAgICAgICAgICAgaWYgKGxlbikge1xuICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gb3V0cHV0W2Zyb20rK107XG4gICAgICAgICAgICAgICAgaWYgKGxlbiA+IDEpIHtcbiAgICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gb3V0cHV0W2Zyb20rK107XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGVsc2UgaWYgKChvcCAmIDY0KSA9PT0gMCkgeyAgICAgICAgICAvKiAybmQgbGV2ZWwgZGlzdGFuY2UgY29kZSAqL1xuICAgICAgICAgICAgaGVyZSA9IGRjb2RlWyhoZXJlICYgMHhmZmZmKS8qaGVyZS52YWwqLyArIChob2xkICYgKCgxIDw8IG9wKSAtIDEpKV07XG4gICAgICAgICAgICBjb250aW51ZSBkb2Rpc3Q7XG4gICAgICAgICAgfVxuICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgc3RybS5tc2cgPSAnaW52YWxpZCBkaXN0YW5jZSBjb2RlJztcbiAgICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgICBicmVhayB0b3A7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgYnJlYWs7IC8vIG5lZWQgdG8gZW11bGF0ZSBnb3RvIHZpYSBcImNvbnRpbnVlXCJcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZWxzZSBpZiAoKG9wICYgNjQpID09PSAwKSB7ICAgICAgICAgICAgICAvKiAybmQgbGV2ZWwgbGVuZ3RoIGNvZGUgKi9cbiAgICAgICAgaGVyZSA9IGxjb2RlWyhoZXJlICYgMHhmZmZmKS8qaGVyZS52YWwqLyArIChob2xkICYgKCgxIDw8IG9wKSAtIDEpKV07XG4gICAgICAgIGNvbnRpbnVlIGRvbGVuO1xuICAgICAgfVxuICAgICAgZWxzZSBpZiAob3AgJiAzMikgeyAgICAgICAgICAgICAgICAgICAgIC8qIGVuZC1vZi1ibG9jayAqL1xuICAgICAgICAvL1RyYWNldnYoKHN0ZGVyciwgXCJpbmZsYXRlOiAgICAgICAgIGVuZCBvZiBibG9ja1xcblwiKSk7XG4gICAgICAgIHN0YXRlLm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hciBaX0VSUk5PICAgICAgICAgPSAtMTtcbnZhciBaX1NUUkVBTV9FUlJPUiAgPSAtMjtcbnZhciBaX0RBVEFfRVJST1IgICAgPSAtMztcbnZhciBaX01FTV9FUlJPUiAgICAgPSAtNDtcbnZhciBaX0JVRl9FUlJPUiAgICAgPSAtNTtcbi8vdmFyIFpfVkVSU0lPTl9FUlJPUiA9IC02O1xuXG4vKiBUaGUgZGVmbGF0ZSBjb21wcmVzc2lvbiBtZXRob2QgKi9cbnZhciBaX0RFRkxBVEVEICA9IDg7XG5cblxuLyogU1RBVEVTID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG5cblxudmFyICAgIEhFQUQgPSAxOyAgICAgICAvKiBpOiB3YWl0aW5nIGZvciBtYWdpYyBoZWFkZXIgKi9cbnZhciAgICBGTEFHUyA9IDI7ICAgICAgLyogaTogd2FpdGluZyBmb3IgbWV0aG9kIGFuZCBmbGFncyAoZ3ppcCkgKi9cbnZhciAgICBUSU1FID0gMzsgICAgICAgLyogaTogd2FpdGluZyBmb3IgbW9kaWZpY2F0aW9uIHRpbWUgKGd6aXApICovXG52YXIgICAgT1MgPSA0OyAgICAgICAgIC8qIGk6IHdhaXRpbmcgZm9yIGV4dHJhIGZsYWdzIGFuZCBvcGVyYXRpbmcgc3lzdGVtIChnemlwKSAqL1xudmFyICAgIEVYTEVOID0gNTsgICAgICAvKiBpOiB3YWl0aW5nIGZvciBleHRyYSBsZW5ndGggKGd6aXApICovXG52YXIgICAgRVhUUkEgPSA2OyAgICAgIC8qIGk6IHdhaXRpbmcgZm9yIGV4dHJhIGJ5dGVzIChnemlwKSAqL1xudmFyICAgIE5BTUUgPSA3OyAgICAgICAvKiBpOiB3YWl0aW5nIGZvciBlbmQgb2YgZm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ZXJlIHVudGlsIHJlc2V0ICovXG52YXIgICAgQkFEID0gMzA7ICAgICAgIC8qIGdvdCBhIGRhdGEgZXJyb3IgLS0gcmVtYWluIGhlcmUgdW50aWwgcmVzZXQgKi9cbnZhciAgICBNRU0gPSAzMTsgICAgICAgLyogZ290IGFuIGluZmxhdGUoKSBtZW1vcnkgZXJyb3IgLS0gcmVtYWluIGhlcmUgdW50aWwgcmVzZXQgKi9cbnZhciAgICBTWU5DID0gMzI7ICAgICAgLyogbG9va2luZyBmb3Igc3luY2hyb25pemF0aW9uIGJ5dGVzIHRvIHJlc3RhcnQgaW5mbGF0ZSgpICovXG5cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG5cblxuXG52YXIgRU5PVUdIX0xFTlMgPSA4NTI7XG52YXIgRU5PVUdIX0RJU1RTID0gNTkyO1xuLy92YXIgRU5PVUdIID0gIChFTk9VR0hfTEVOUytFTk9VR0hfRElTVFMpO1xuXG52YXIgTUFYX1dCSVRTID0gMTU7XG4vKiAzMksgTFo3NyB3aW5kb3cgKi9cbnZhciBERUZfV0JJVFMgPSBNQVhfV0JJVFM7XG5cblxuZnVuY3Rpb24gWlNXQVAzMihxKSB7XG4gIHJldHVybiAgKCgocSA+Pj4gMjQpICYgMHhmZikgK1xuICAgICAgICAgICgocSA+Pj4gOCkgJiAweGZmMDApICtcbiAgICAgICAgICAoKHEgJiAweGZmMDApIDw8IDgpICtcbiAgICAgICAgICAoKHEgJiAweGZmKSA8PCAyNCkpO1xufVxuXG5cbmZ1bmN0aW9uIEluZmxhdGVTdGF0ZSgpIHtcbiAgdGhpcy5tb2RlID0gMDsgICAgICAgICAgICAgLyogY3VycmVudCBpbmZsYXRlIG1vZGUgKi9cbiAgdGhpcy5sYXN0ID0gZmFsc2U7ICAgICAgICAgIC8qIHRydWUgaWYgcHJvY2Vzc2luZyBsYXN0IGJsb2NrICovXG4gIHRo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25cbiAgZm9yICg7Oykge1xuICAgIHN3aXRjaCAoc3RhdGUubW9kZSkge1xuICAgIGNhc2UgSEVBRDpcbiAgICAgIGlmIChzdGF0ZS53cmFwID09PSAwKSB7XG4gICAgICAgIHN0YXRlLm1vZGUgPSBUWVBFRE87XG4gICAgICAgIGJyZWFrO1xuICAgICAgfVxuICAgICAgLy89PT0gTkVFREJJVFMoMTYpO1xuICAgICAgd2hpbGUgKGJpdHMgPCAxNikge1xuICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgaGF2ZS0tO1xuICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgYml0cyArPSA4O1xuICAgICAgfVxuICAgICAgLy89PT0vL1xuICAgICAgaWYgKChzdGF0ZS53cmFwICYgMikgJiYgaG9sZCA9PT0gMHg4YjFmKSB7ICAvKiBnemlwIGhlYWRlciAqL1xuICAgICAgICBzdGF0ZS5jaGVjayA9IDAvKmNyYzMyKDBMLCBaX05VTEwsIDApKi87XG4gICAgICAgIC8vPT09IENSQzIoc3RhdGUuY2hlY2ssIGhvbGQpO1xuICAgICAgICBoYnVmWzBdID0gaG9sZCAmIDB4ZmY7XG4gICAgICAgIGhidWZbMV0gPSAoaG9sZCA+Pj4gOCkgJiAweGZmO1xuICAgICAgICBzdGF0ZS5jaGVjayA9IGNyYzMyKHN0YXRlLmNoZWNrLCBoYnVmLCAyLCAwKTtcbiAgICAgICAgLy89PT0vL1xuXG4gICAgICAgIC8vPT09IElOSVRCSVRTKCk7XG4gICAgICAgIGhvbGQgPSAwO1xuICAgICAgICBiaXRzID0gMDtcbiAgICAgICAgLy89PT0vL1xuICAgICAgICBzdGF0ZS5tb2RlID0gRkxBR1M7XG4gICAgICAgIGJyZWFrO1xuICAgICAgfVxuICAgICAgc3RhdGUuZmxhZ3MgPSAwOyAgICAgICAgICAgLyogZXhwZWN0IHpsaWIgaGVhZGVyICovXG4g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ICAgICAgaG9sZCA9IDA7XG4gICAgICBiaXRzID0gMDtcbiAgICAgIC8vPT09Ly9cbiAgICAgIHN0YXRlLm1vZGUgPSBFWExFTjtcbiAgICAgIC8qIGZhbGxzIHRocm91Z2ggKi9cbiAgICBjYXNlIEVYTEVOOlxuICAgICAgaWYgKHN0YXRlLmZsYWdzICYgMHgwNDAwKSB7XG4gICAgICAgIC8vPT09IE5FRURCSVRTKDE2KTsgKi9cbiAgICAgICAgd2hpbGUgKGJpdHMgPCAxNikge1xuICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgIH1cbiAgICAgICAgLy89PT0vL1xuICAgICAgICBzdGF0ZS5sZW5ndGggPSBob2xkO1xuICAgICAgICBpZiAoc3RhdGUuaGVhZCkge1xuICAgICAgICAgIHN0YXRlLmhlYWQuZXh0cmFfbGVuID0gaG9sZDtcbiAgICAgICAgfVxuICAgICAgICBpZiAoc3RhdGUuZmxhZ3MgJiAweDAyMDApIHtcbiAgICAgICAgICAvLz09PSBDUkMyKHN0YXRlLmNoZWNrLCBob2xkKTtcbiAgICAgICAgICBoYnVmWzBdID0gaG9sZCAmIDB4ZmY7XG4gICAgICAgICAgaGJ1ZlsxXSA9IChob2xkID4+PiA4KSAmIDB4ZmY7XG4gICAgICAgICAgc3RhdGUuY2hlY2sgPSBjcmMzMihzdGF0ZS5jaGVjaywgaGJ1ZiwgMiwgMCk7XG4gICAgICAgICAgLy89PT0vL1xuICAgICAgICB9XG4gICAgICAgIC8vPT09IElOSVRCSVRTKCk7XG4gICAgICAgIGhvbGQgPSAwO1xuICAgICAgICBiaXRzID0gMDtcbiAgICAgICAgLy89PT0vL1xuICAgICAgfVxuICAgICAgZWxzZSBpZiAoc3RhdGUuaGVhZCkge1xuICAg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iBjb3B5LCovXG4gICAgICAgICAgICAgIGxlblxuICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIC8vem1lbWNweShzdGF0ZS5oZWFkLmV4dHJhICsgbGVuLCBuZXh0LFxuICAgICAgICAgICAgLy8gICAgICAgIGxlbiArIGNvcHkgPiBzdGF0ZS5oZWFkLmV4dHJhX21heCA/XG4gICAgICAgICAgICAvLyAgICAgICAgc3RhdGUuaGVhZC5leHRyYV9tYXggLSBsZW4gOiBjb3B5KTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHN0YXRlLmZsYWdzICYgMHgwMjAwKSB7XG4gICAgICAgICAgICBzdGF0ZS5jaGVjayA9IGNyYzMyKHN0YXRlLmNoZWNrLCBpbnB1dCwgY29weSwgbmV4dCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGhhdmUgLT0gY29weTtcbiAgICAgICAgICBuZXh0ICs9IGNvcHk7XG4gICAgICAgICAgc3RhdGUubGVuZ3RoIC09IGNvcHk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHN0YXRlLmxlbmd0aCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgIH1cbiAgICAgIHN0YXRlLmxlbmd0aCA9IDA7XG4gICAgICBzdGF0ZS5tb2RlID0gTkFNRTtcbiAgICAgIC8qIGZhbGxzIHRocm91Z2ggKi9cbiAgICBjYXNlIE5BTUU6XG4gICAgICBpZiAoc3RhdGUuZmxhZ3MgJiAweDA4MDApIHtcbiAgICAgICAgaWYgKGhhdmUgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgIGNvcHkgPSAwO1xuICAgICAgICBkbyB7XG4gICAgICAgICAgLy8gVE9ETzogMiBvciAxIGJ5dGVzP1xuICAgICAgICAgIGxlbiA9IGlucHV0W25leHQgKyBjb3B5KytdO1xuICAgICAgICAgIC8qIHVzZSBjb25zdGFudCBsaW1pdCBiZWNhdXNlIGluIGpzIHdlIHNob3VsZCBub3QgcHJlYWxsb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GQgIT09IChzdGF0ZS5jaGVjayAmIDB4ZmZmZikpIHtcbiAgICAgICAgICBzdHJtLm1zZyA9ICdoZWFkZXIgY3JjIG1pc21hdGNoJztcbiAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIC8vPT09IElOSVRCSVRTKCk7XG4gICAgICAgIGhvbGQgPSAwO1xuICAgICAgICBiaXRzID0gMDtcbiAgICAgICAgLy89PT0vL1xuICAgICAgfVxuICAgICAgaWYgKHN0YXRlLmhlYWQpIHtcbiAgICAgICAgc3RhdGUuaGVhZC5oY3JjID0gKChzdGF0ZS5mbGFncyA+PiA5KSAmIDEpO1xuICAgICAgICBzdGF0ZS5oZWFkLmRvbmUgPSB0cnVlO1xuICAgICAgfVxuICAgICAgc3RybS5hZGxlciA9IHN0YXRlLmNoZWNrID0gMCAvKmNyYzMyKDBMLCBaX05VTEwsIDApKi87XG4gICAgICBzdGF0ZS5tb2RlID0gVFlQRTtcbiAgICAgIGJyZWFrO1xuICAgIGNhc2UgRElDVElEOlxuICAgICAgLy89PT0gTkVFREJJVFMoMzIpOyAqL1xuICAgICAgd2hpbGUgKGJpdHMgPCAzMikge1xuICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgaGF2ZS0tO1xuICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgYml0cyArPSA4O1xuICAgICAgfVxuICAgICAgLy89PT0vL1xuICAgICAgc3RybS5hZGxlciA9IHN0YXRlLmNoZWNrID0gWlNXQVAzMihob2xkKTtcbiAgICAgIC8vPT09IElOSVRCSVRTKCk7XG4gICAgICBob2xkID0gMDtcbiAgICAgIGJpdHMgPSAwO1xuICAgICAgLy89PT0vL1xuICAgICAgc3RhdGUubW9kZSA9IERJQ1Q7XG4gICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgY2F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1xuICAgICAgICAgIGhvbGQgPj4+PSAyO1xuICAgICAgICAgIGJpdHMgLT0gMjtcbiAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgYnJlYWsgaW5mX2xlYXZlO1xuICAgICAgICB9XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAyOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZHluYW1pYyBibG9jayAqL1xuICAgICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgICBkeW5hbWljIGNvZGVzIGJsb2NrJXNcXG5cIixcbiAgICAgICAgLy8gICAgICAgIHN0YXRlLmxhc3QgPyBcIiAobGFzdClcIiA6IFwiXCIpKTtcbiAgICAgICAgc3RhdGUubW9kZSA9IFRBQkxFO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgMzpcbiAgICAgICAgc3RybS5tc2cgPSAnaW52YWxpZCBibG9jayB0eXBlJztcbiAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgIH1cbiAgICAgIC8vLS0tIERST1BCSVRTKDIpIC0tLS8vXG4gICAgICBob2xkID4+Pj0gMjtcbiAgICAgIGJpdHMgLT0gMjtcbiAgICAgIC8vLS0tLy9cbiAgICAgIGJyZWFrO1xuICAgIGNhc2UgU1RPUkVEOlxuICAgICAgLy8tLS0gQllURUJJVFMoKSAtLS0vLyAvKiBnbyB0byBieXRlIGJvdW5kYXJ5ICovXG4gICAgICBob2xkID4+Pj0gYml0cyAmIDc7XG4gICAgICBiaXRzIC09IGJpdHMgJiA3O1xuICAgICAgLy8tLS0vL1xuICAgICAgLy89PT0gTkVFREJJVFMoMzIpOyAqL1xuICAgICAgd2hpbGUgKGJpdHMgPCAzMikge1xuICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgaGF2ZS0tO1xuICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgYml0c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FMoaGVyZS5iaXRzICsgMik7XG4gICAgICAgICAgICBuID0gaGVyZV9iaXRzICsgMjtcbiAgICAgICAgICAgIHdoaWxlIChiaXRzIDwgbikge1xuICAgICAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICAgICAgaGF2ZS0tO1xuICAgICAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy89PT0vL1xuICAgICAgICAgICAgLy8tLS0gRFJPUEJJVFMoaGVyZS5iaXRzKSAtLS0vL1xuICAgICAgICAgICAgaG9sZCA+Pj49IGhlcmVfYml0cztcbiAgICAgICAgICAgIGJpdHMgLT0gaGVyZV9iaXRzO1xuICAgICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgICAgaWYgKHN0YXRlLmhhdmUgPT09IDApIHtcbiAgICAgICAgICAgICAgc3RybS5tc2cgPSAnaW52YWxpZCBiaXQgbGVuZ3RoIHJlcGVhdCc7XG4gICAgICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGVuID0gc3RhdGUubGVuc1tzdGF0ZS5oYXZlIC0gMV07XG4gICAgICAgICAgICBjb3B5ID0gMyArIChob2xkICYgMHgwMyk7Ly9CSVRTKDIpO1xuICAgICAgICAgICAgLy8tLS0gRFJPUEJJVFMoMikgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSAyO1xuICAgICAgICAgICAgYml0cyAtPSAyO1xuICAgICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgIH1cbiAgICAgICAgICBlbHNlIGlmIChoZXJlX3ZhbCA9PT0gMTcpIHtcbiAgICAgICAgICAgIC8vPT09IE5FRURCSVRTKGhlcmUuYml0cyArIDMpO1xuICAgICAgICAgICAgbiA9IGhlcmVfYml0cyArIDM7XG4gICAgICAgICAgICB3aGlsZSAoYml0cyA8IG4pIHtcbiAgICAgICAgICAgICAgaWYgKGhhdmUgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vPT09Ly9cbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKGhlcmUuYml0cykgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSBoZXJlX2JpdHM7XG4gICAgICAgICAgICBiaXRzIC09IGhlcmVfYml0cztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICAgIGxlbiA9IDA7XG4gICAgICAgICAgICBjb3B5ID0gMyArIChob2xkICYgMHgwNyk7Ly9CSVRTKDMpO1xuICAgICAgICAgICAgLy8tLS0gRFJPUEJJVFMoMykgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSAzO1xuICAgICAgICAgICAgYml0cyAtPSAzO1xuICAgICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgIH1cbiAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIC8vPT09IE5FRURCSVRTKGhlcmUuYml0cyArIDcpO1xuICAgICAgICAgICAgbiA9IGhlcmVfYml0cyArIDc7XG4gICAgICAgICAgICB3aGlsZSAoYml0cyA8IG4pIHtcbiAgICAgICAgICAgICAgaWYgKGhhdmUgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vPT09Ly9cbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKGhlcmUuYml0cykgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSBoZXJlX2JpdHM7XG4gICAgICAgICAgICBiaXRzIC09IGhlcmVfYml0cztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICAgIGxlbiA9IDA7XG4gICAgICAgICAgICBjb3B5ID0gMTEgKyAoaG9sZCAmIDB4N2YpOy8vQklUUyg3KTtcbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKDcpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gNztcbiAgICAgICAgICAgIGJpdHMgLT0gNztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHN0YXRlLmhhdmUgKyBjb3B5ID4gc3RhdGUubmxlbiArIHN0YXRlLm5kaXN0KSB7XG4gICAgICAgICAgICBzdHJtLm1zZyA9ICdpbnZhbGlkIGJpdCBsZW5ndGggcmVwZWF0JztcbiAgICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgICAgd2hpbGUgKGNvcHktLSkge1xuICAgICAgICAgICAgc3RhdGUubGVuc1tzdGF0ZS5oYXZlKytdID0gbGVuO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICAvKiBoYW5kbGUgZXJyb3IgYnJlYWtzIGluIHdoaWxlICovXG4gICAgICBpZiAoc3RhdGUubW9kZSA9PT0gQkFEKSB7IGJyZWFrOyB9XG5cbiAgICAgIC8qIGNoZWNrIGZvciBlbmQtb2YtYmxvY2sgY29kZSAoYmV0dGVyIGhhdmUgb25lKSAqL1xuICAgICAgaWYgKHN0YXRlLmxlbnNbMjU2XSA9PT0gMCkge1xuICAgICAgICBzdHJtLm1zZyA9ICdpbnZhbGlkIGNvZGUgLS0gbWlzc2luZyBlbmQtb2YtYm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PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgLy8tLS0vL1xuICAgICAgICB9XG4gICAgICAgIC8vLS0tIERST1BCSVRTKGxhc3QuYml0cykgLS0tLy9cbiAgICAgICAgaG9sZCA+Pj49IGxhc3RfYml0cztcbiAgICAgICAgYml0cyAtPSBsYXN0X2JpdHM7XG4gICAgICAgIC8vLS0tLy9cbiAgICAgICAgc3RhdGUuYmFjayArPSBsYXN0X2JpdHM7XG4gICAgICB9XG4gICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICBob2xkID4+Pj0gaGVyZV9iaXRzO1xuICAgICAgYml0cyAtPSBoZXJlX2JpdHM7XG4gICAgICAvLy0tLS8vXG4gICAgICBzdGF0ZS5iYWNrICs9IGhlcmVfYml0cztcbiAgICAgIHN0YXRlLmxlbmd0aCA9IGhlcmVfdmFsO1xuICAgICAgaWYgKGhlcmVfb3AgPT09IDApIHtcbiAgICAgICAgLy9UcmFjZXZ2KChzdGRlcnIsIGhlcmUudmFsID49IDB4MjAgJiYgaGVyZS52YWwgPCAweDdmID9cbiAgICAgICAgLy8gICAgICAgIFwiaW5mbGF0ZTogICAgICAgICBsaXRlcmFsICclYydcXG5cIiA6XG4gICAgICAgIC8vICAgICAgICBcImluZmxhdGU6ICAgICAgICAgbGl0ZXJhbCAweCUwMnhcXG5cIiwgaGVyZS52YWwpKTtcbiAgICAgICAgc3RhdGUubW9kZSA9IExJVDtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICBpZiAoaGVyZV9vcCAmIDMyKSB7XG4gICAgICAgIC8vVHJhY2V2digoc3RkZXJyLCBcImluZmxhdGU6ICAgICAgICAgZW5kIG9mIGJsb2NrXFxuXCIpKTtcbiAgICAgICAgc3Rhd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gLT0gY29weTtcbiAgICAgIHN0YXRlLmxlbmd0aCAtPSBjb3B5O1xuICAgICAgZG8ge1xuICAgICAgICBvdXRwdXRbcHV0KytdID0gZnJvbV9zb3VyY2VbZnJvbSsrXTtcbiAgICAgIH0gd2hpbGUgKC0tY29weSk7XG4gICAgICBpZiAoc3RhdGUubGVuZ3RoID09PSAwKSB7IHN0YXRlLm1vZGUgPSBMRU47IH1cbiAgICAgIGJyZWFrO1xuICAgIGNhc2UgTElUOlxuICAgICAgaWYgKGxlZnQgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICBvdXRwdXRbcHV0KytdID0gc3RhdGUubGVuZ3RoO1xuICAgICAgbGVmdC0tO1xuICAgICAgc3RhdGUubW9kZSA9IExFTjtcbiAgICAgIGJyZWFrO1xuICAgIGNhc2UgQ0hFQ0s6XG4gICAgICBpZiAoc3RhdGUud3JhcCkge1xuICAgICAgICAvLz09PSBORUVEQklUUygzMik7XG4gICAgICAgIHdoaWxlIChiaXRzIDwgMzIpIHtcbiAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgLy8gVXNlICd8JyBpbnNkZWFkIG9mICcrJyB0byBtYWtlIHN1cmUgdGhhdCByZXN1bHQgaXMgc2lnbmVkXG4gICAgICAgICAgaG9sZCB8PSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICB9XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgX291dCAtPSBsZWZ0O1xuICAgICAgICBzdHJtLnRvdGFsX291dCArPSBfb3V0O1xuICAgICAgICBzdGF0ZS50b3RhbCArPSBfb3V0O1xuICAgICAgICBpZiAoX291dCkge1xuICAgICAgICAgIHN0cm0uYWRsZXIgPSBzdGF0ZS5jaGVjayA9XG4gICAgICAgICAgICAgIC8qVVBEQVRFKHN0YXRlLmNo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0gPSAwOyAgICAgICAgICAgICAgIC8qIGluZGV4IG9mIGNvZGUgc3ltYm9scyAqL1xuICB2YXIgbWluID0gMCwgbWF4ID0gMDsgICAgICAgICAgLyogbWluaW11bSBhbmQgbWF4aW11bSBjb2RlIGxlbmd0aHMgKi9cbiAgdmFyIHJvb3QgPSAwOyAgICAgICAgICAgICAgLyogbnVtYmVyIG9mIGluZGV4IGJpdHMgZm9yIHJvb3QgdGFibGUgKi9cbiAgdmFyIGN1cnIgPSAwOyAgICAgICAgICAgICAgLyogbnVtYmVyIG9mIGluZGV4IGJpdHMgZm9yIGN1cnJlbnQgdGFibGUgKi9cbiAgdmFyIGRyb3AgPSAwOyAgICAgICAgICAgICAgLyogY29kZSBiaXRzIHRvIGRyb3AgZm9yIHN1Yi10YWJsZSAqL1xuICB2YXIgbGVmdCA9IDA7ICAgICAgICAgICAgICAgICAgIC8qIG51bWJlciBvZiBwcmVmaXggY29kZXMgYXZhaWxhYmxlICovXG4gIHZhciB1c2VkID0gMDsgICAgICAgICAgICAgIC8qIGNvZGUgZW50cmllcyBpbiB0YWJsZSB1c2VkICovXG4gIHZhciBodWZmID0gMDsgICAgICAgICAgICAgIC8qIEh1ZmZtYW4gY29kZSAqL1xuICB2YXIgaW5jcjsgICAgICAgICAgICAgIC8qIGZvciBpbmNyZW1lbnRpbmcgY29kZSwgaW5kZXggKi9cbiAgdmFyIGZpbGw7ICAgICAgICAgICAgICAvKiBpbmRleCBmb3IgcmVwbGljYXRpbmcgZW50cmllcyAqL1xuICB2YXIgbG93OyAgICAgICAgICAgICAgIC8qIGxvdyBiaXRzIGZvciBjdXJyZW50IHJvb3QgZW50cnkgKi9cbiAgdmFyIG1hc2s7ICAgICAgICAgICAgICAvKiBtYXNrIGZvciBsb3cgcm9vdCBiaXRzICovXG4gIHZhciBuZXh0OyAgICAgICAgICAgICAvKiBuZXh0IGF2YWlsYWJsZSBzcGFjZSBpbiB0YWJsZSAqL1xuICB2YXIgYmFzZSA9IG51bGw7IC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3VzZSBzdHJpY3QnO1xuXG5tb2R1bGUuZXhwb3J0cyA9IHtcbiAgJzInOiAgICAnbmVlZCBkaWN0aW9uYXJ5JywgICAgIC8qIFpfTkVFRF9ESUNUICAgICAgIDIgICovXG4gICcxJzogICAgJ3N0cmVhbSBlbmQnLCAgICAgICAgICAvKiBaX1NUUkVBTV9FTkQgICAgICAxICAqL1xuICAnMCc6ICAgICcnLCAgICAgICAgICAgICAgICAgICAgLyogWl9PSyAgICAgICAgICAgICAgMCAgKi9cbiAgJy0xJzogICAnZmlsZSBlcnJvcicsICAgICAgICAgIC8qIFpfRVJSTk8gICAgICAgICAoLTEpICovXG4gICctMic6ICAgJ3N0cmVhbSBlcnJvcicsICAgICAgICAvKiBaX1NUUkVBTV9FUlJPUiAgKC0yKSAqL1xuICAnLTMnOiAgICdkYXRhIGVycm9yJywgICAgICAgICAgLyogWl9EQVRBX0VSUk9SICAgICgtMykgKi9cbiAgJy00JzogICAnaW5zdWZmaWNpZW50IG1lbW9yeScsIC8qIFpfTUVNX0VSUk9SICAgICAoLTQpICovXG4gICctNSc6ICAgJ2J1ZmZlciBlcnJvcicsICAgICAgICAvKiBaX0JVRl9FUlJPUiAgICAgKC01KSAqL1xuICAnLTYnOiAgICdpbmNvbXBhdGlibGUgdmVyc2lvbicgLyogWl9WRVJTSU9OX0VSUk9SICgtNikgKi9cbn07XG4iLCIndXNlIHN0cmljdCc7XG5cblxudmFyIHV0aWxzID0gcmVxdWlyZSgnLi4vdXRpbHMvY29tbW9uJyk7XG5cbi8qIFB1YmxpYyBjb25zdGFudHMgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuXG5cbi8vdmFyIFpfRklMVEVSRUQgICAgICAgICAgPSAxO1xuLy92YXIgWl9IVUZGTUFOX09OTFkgICAgICA9IDI7XG4vL3ZhciBaX1JMRSAgICAgICAgICAgICAgID0gMztcbnZhciBaX0ZJWEVEICAgICAgICAgICAgICAgPSA0O1xuLy92YXIgWl9ERUZBVUxUX1NUUkFURUdZICA9IDA7XG5cbi8qIFBvc3NpYmxlIHZhbHVlcyBvZiB0aGUgZGF0YV90eXBlIGZpZWxkICh0aG91Z2ggc2VlIGluZmxhdGUoKSkgKi9cbnZhciBaX0JJTkFSWSAgICAgICAgICAgICAgPSAwO1xudmFyIFpfVEVYVCAgICAgICAgICAgICAgICA9IDE7XG4vL3ZhciBaX0FTQ0lJICAgICAgICAgICAgID0gMTsgLy8gPSBaX1RFWFRcbnZhciBaX1VOS05PV04gICAgICAgICAgICAgPSAyO1xuXG4vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuXG5cbmZ1bmN0aW9uIHplcm8oYnVmKSB7IHZhciBsZW4gPSBidWYubGVuZ3RoOyB3aGlsZSAoLS1sZW4gPj0gMCkgeyBidWZbbGVuXSA9IDA7IH0gfVxuXG4vLyBGcm9tIHp1dGlsLmhcblxudmFyIFNUT1JFRF9CTE9DSyA9IDA7XG52YXIgU1RBVElDX1RSRUVTID0gMTtcbnZhciBEWU5fVFJFRVMgICAgPSAyO1xuLyogVGhlIHRocmVlIGtpbmRzIG9mIGJsb2NrIHR5cGUgKi9cblxudmFyIE1JTl9NQVRDSCAgICA9IDM7XG52YXIgTUFYX01BVENIICAgID0gMjU4O1xuLyogVGhlIG1pbmltdW0gYW5kIG1heGltdW0gbWF0Y2ggbGVuZ3RocyAqL1xuXG4vLyBGcm9tIGRlZmxhdGUuaFxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBJbnRlcm5hbCBjb21wcmVzc2lvbiBzdGF0ZS5cbiAqL1xuXG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ytdID0gcy5iaV9idWY7XG4gIH1cbiAgcy5iaV9idWYgPSAwO1xuICBzLmJpX3ZhbGlkID0gMDtcbn1cblxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBDb3B5IGEgc3RvcmVkIGJsb2NrLCBzdG9yaW5nIGZpcnN0IHRoZSBsZW5ndGggYW5kIGl0c1xuICogb25lJ3MgY29tcGxlbWVudCBpZiByZXF1ZXN0ZWQuXG4gKi9cbmZ1bmN0aW9uIGNvcHlfYmxvY2socywgYnVmLCBsZW4sIGhlYWRlcilcbi8vRGVmbGF0ZVN0YXRlICpzO1xuLy9jaGFyZiAgICAqYnVmOyAgICAvKiB0aGUgaW5wdXQgZGF0YSAqL1xuLy91bnNpZ25lZCBsZW47ICAgICAvKiBpdHMgbGVuZ3RoICovXG4vL2ludCAgICAgIGhlYWRlcjsgIC8qIHRydWUgaWYgYmxvY2sgaGVhZGVyIG11c3QgYmUgd3JpdHRlbiAqL1xue1xuICBiaV93aW5kdXAocyk7ICAgICAgICAvKiBhbGlnbiBvbiBieXRlIGJvdW5kYXJ5ICovXG5cbiAgaWYgKGhlYWRlcikge1xuICAgIHB1dF9zaG9ydChzLCBsZW4pO1xuICAgIHB1dF9zaG9ydChzLCB+bGVuKTtcbiAgfVxuLy8gIHdoaWxlIChsZW4tLSkge1xuLy8gICAgcHV0X2J5dGUocywgKmJ1ZisrKTtcbi8vICB9XG4gIHV0aWxzLmFycmF5U2V0KHMucGVuZGluZ19idWYsIHMud2luZG93LCBidWYsIGxlbiwgcy5wZW5kaW5nKTtcbiAgcy5wZW5kaW5nICs9IGxlbjtcbn1cblxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBDb21wYXJlcyB0byBzdWJ0cmVlcywgdXNpbmcgdGhlIHRyZWUgZGVwdG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udHMgKi9cbiAgdmFyIHByZXZsZW4gPSAtMTsgICAgICAgICAgLyogbGFzdCBlbWl0dGVkIGxlbmd0aCAqL1xuICB2YXIgY3VybGVuOyAgICAgICAgICAgICAgICAvKiBsZW5ndGggb2YgY3VycmVudCBjb2RlICovXG5cbiAgdmFyIG5leHRsZW4gPSB0cmVlWzAqMiArIDFdLyouTGVuKi87IC8qIGxlbmd0aCBvZiBuZXh0IGNvZGUgKi9cblxuICB2YXIgY291bnQgPSAwOyAgICAgICAgICAgICAvKiByZXBlYXQgY291bnQgb2YgdGhlIGN1cnJlbnQgY29kZSAqL1xuICB2YXIgbWF4X2NvdW50ID0gNzsgICAgICAgICAvKiBtYXggcmVwZWF0IGNvdW50ICovXG4gIHZhciBtaW5fY291bnQgPSA0OyAgICAgICAgIC8qIG1pbiByZXBlYXQgY291bnQgKi9cblxuICBpZiAobmV4dGxlbiA9PT0gMCkge1xuICAgIG1heF9jb3VudCA9IDEzODtcbiAgICBtaW5fY291bnQgPSAzO1xuICB9XG4gIHRyZWVbKG1heF9jb2RlKzEpKjIgKyAxXS8qLkxlbiovID0gMHhmZmZmOyAvKiBndWFyZCAqL1xuXG4gIGZvciAobiA9IDA7IG4gPD0gbWF4X2NvZGU7IG4rKykge1xuICAgIGN1cmxlbiA9IG5leHRsZW47XG4gICAgbmV4dGxlbiA9IHRyZWVbKG4rMSkqMiArIDFdLyouTGVuKi87XG5cbiAgICBpZiAoKytjb3VudCA8IG1heF9jb3VudCAmJiBjdXJsZW4gPT09IG5leHRsZW4pIHtcbiAgICAgIGNvbnRpbnVlO1xuXG4gICAgfSBlbHNlIGlmIChjb3VudCA8IG1pbl9jb3VudCkge1xuICAgICAgcy5ibF90cmVlW2N1cmxlbiAqIDJdLyouRnJlcSovICs9IGNvdW50O1xuXG4gICAgfSBlbHNlIGlmIChjdXJsZW4gIT09IDApIHtcblxuICAgICAgaWYgKGN1cmxlbiAhPT0gcHJldmxlbikgeyBzLmJsX3RyZWVbY3VybGVuICog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57XG4gIHZhciBuOyAgICAgICAgICAgICAgICAgICAgIC8qIGl0ZXJhdGVzIG92ZXIgYWxsIHRyZWUgZWxlbWVudHMgKi9cbiAgdmFyIHByZXZsZW4gPSAtMTsgICAgICAgICAgLyogbGFzdCBlbWl0dGVkIGxlbmd0aCAqL1xuICB2YXIgY3VybGVuOyAgICAgICAgICAgICAgICAvKiBsZW5ndGggb2YgY3VycmVudCBjb2RlICovXG5cbiAgdmFyIG5leHRsZW4gPSB0cmVlWzAqMiArIDFdLyouTGVuKi87IC8qIGxlbmd0aCBvZiBuZXh0IGNvZGUgKi9cblxuICB2YXIgY291bnQgPSAwOyAgICAgICAgICAgICAvKiByZXBlYXQgY291bnQgb2YgdGhlIGN1cnJlbnQgY29kZSAqL1xuICB2YXIgbWF4X2NvdW50ID0gNzsgICAgICAgICAvKiBtYXggcmVwZWF0IGNvdW50ICovXG4gIHZhciBtaW5fY291bnQgPSA0OyAgICAgICAgIC8qIG1pbiByZXBlYXQgY291bnQgKi9cblxuICAvKiB0cmVlW21heF9jb2RlKzFdLkxlbiA9IC0xOyAqLyAgLyogZ3VhcmQgYWxyZWFkeSBzZXQgKi9cbiAgaWYgKG5leHRsZW4gPT09IDApIHtcbiAgICBtYXhfY291bnQgPSAxMzg7XG4gICAgbWluX2NvdW50ID0gMztcbiAgfVxuXG4gIGZvciAobiA9IDA7IG4gPD0gbWF4X2NvZGU7IG4rKykge1xuICAgIGN1cmxlbiA9IG5leHRsZW47XG4gICAgbmV4dGxlbiA9IHRyZWVbKG4rMSkqMiArIDFdLyouTGVuKi87XG5cbiAgICBpZiAoKytjb3VudCA8IG1heF9jb3VudCAmJiBjdXJsZW4gPT09IG5leHRsZW4pIHtcbiAgICAgIGNvbnRpbnVlO1xuXG4gICAgfSBlbHNlIGlmIChjb3VudCA8IG1pbl9jb3VudCkge1xuICAgICAgZG8geyBzZW5kX2NvZGUocywgY3VybGVuLCBzLmJsX3RyZWUpOyB9IHdoaWxlICgtLWNvdW50ICE9PSAwKTtcblxuICAgIH0gZWxzZSBpZiAoY3VybGVuICE9PSAwKSB7XG4gICAgICBpZiAoY3VybGVuICE9PSBwcmV2bGVuKSB7XG4gICAgICAgIHNlbmRfY29kZShzLCBjdXJsZW4sIHMuYmxfdHJlZSk7XG4gICAgICAgIGNvdW50LS07XG4gICAgICB9XG4gICAgICAvL0Fzc2VydChjb3VudCA+PSAzICYmIGNvdW50IDw9IDYsIFwiIDNfNj9cIik7XG4gICAgICBzZW5kX2NvZGUocywgUkVQXzNfNiwgcy5ibF90cmVlKTtcbiAgICAgIHNlbmRfYml0cyhzLCBjb3VudC0zLCAyKTtcblxuICAgIH0gZWxzZSBpZiAoY291bnQgPD0gMTApIHtcbiAgICAgIHNlbmRfY29kZShzLCBSRVBaXzNfMTAsIHMuYmxfdHJlZSk7XG4gICAgICBzZW5kX2JpdHMocywgY291bnQtMywgMyk7XG5cbiAgICB9IGVsc2Uge1xuICAgICAgc2VuZF9jb2RlKHMsIFJFUFpfMTFfMTM4LCBzLmJsX3RyZWUpO1xuICAgICAgc2VuZF9iaXRzKHMsIGNvdW50LTExLCA3KTtcbiAgICB9XG5cbiAgICBjb3VudCA9IDA7XG4gICAgcHJldmxlbiA9IGN1cmxlbjtcbiAgICBpZiAobmV4dGxlbiA9PT0gMCkge1xuICAgICAgbWF4X2NvdW50ID0gMTM4O1xuICAgICAgbWluX2NvdW50ID0gMztcblxuICAgIH0gZWxzZSBpZiAoY3VybGVuID09PSBuZXh0bGVuKSB7XG4gICAgICBtYXhfY291bnQgPSA2O1xuICAgICAgbWluX2NvdW50ID0gMztcblxuICAgIH0gZWxzZSB7XG4gICAgICBtYXhfY291bnQgPSA3O1xuICAgICAgbWluX2NvdW50ID0gNDtcbiAgICB9XG4gIH1cbn1cblxuXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIENvbnN0cnVjdCB0aGUgSHVmZm1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IGZ1bmN0aW9uKGVyKSB7XG4gICAgICBlcnJvciA9IGVyO1xuICAgIH0pO1xuXG4gICAgZG8ge1xuICAgICAgdmFyIHJlcyA9IHRoaXMuX2JpbmRpbmcud3JpdGVTeW5jKGZsdXNoRmxhZyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaHVuaywgLy8gaW5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbk9mZiwgLy8gaW5fb2ZmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXZhaWxJbkJlZm9yZSwgLy8gaW5fbGVuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fYnVmZmVyLCAvLyBvdXRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9vZmZzZXQsIC8vb3V0X29mZlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF2YWlsT3V0QmVmb3JlKTsgLy8gb3V0X2xlblxuICAgIH0gd2hpbGUgKCF0aGlzLl9oYWRFcnJvciAmJiBjYWxsYmFjayhyZXNbMF0sIHJlc1sxXSkpO1xuXG4gICAgaWYgKHRoaXMuX2hhZEVycm9yKSB7XG4gICAgICB0aHJvdyBlcnJvcjtcbiAgICB9XG5cbiAgICB2YXIgYnVmID0gQnVmZmVyLmNvbmNhdChidWZmZXJzLCBucmVhZCk7XG4gICAgdGhpcy5jbG9zZSgpO1xuXG4gICAgcmV0dXJuIGJ1ZjtcbiAgfVxuXG4gIHZhciByZXEgPSB0aGlzLl9iaW5kaW5nLndyaXRlKGZsdXNoRmxhZyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2h1bmssIC8vIGluXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluT2ZmLCAvLyBpbl9vZmZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXZhaWx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GZ1bGxCeXRlQXJyYXkgPSBkaWNvbVBhcnNlci5hbGxvYyhieXRlQXJyYXksIGluZmxhdGVkLmxlbmd0aCArIHBvc2l0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgZnVsbEJ5dGVBcnJheS5zZXQoYnl0ZUFycmF5LnNsaWNlKDAsIHBvc2l0aW9uKSwgMCk7XG4gICAgICAgICAgICAgICAgICAgIGZ1bGxCeXRlQXJyYXkuc2V0KGluZmxhdGVkLCBwb3NpdGlvbik7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgZGljb21QYXJzZXIuQnl0ZVN0cmVhbShkaWNvbVBhcnNlci5saXR0bGVFbmRpYW5CeXRlQXJyYXlQYXJzZXIsIGZ1bGxCeXRlQXJyYXksIDApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyB0aHJvdyBleGNlcHRpb24gc2luY2Ugbm8gaW5mbGF0ZXIgaXMgYXZhaWxhYmxlXG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93ICdkaWNvbVBhcnNlci5wYXJzZURpY29tOiBubyBpbmZsYXRlciBhdmFpbGFibGUgdG8gaGFuZGxlIGRlZmxhdGUgdHJhbnNmZXIgc3ludGF4JztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZih0cmFuc2ZlclN5bnRheCA9PT0gJzEuMi44NDAuMTAwMDguMS4yLjInKSAvLyBleHBsaWNpdCBiaWcgZW5kaWFuXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBkaWNvbVBhcnNlci5CeXRlU3RyZWFtKGRpY29tUGFyc2VyLmJpZ0VuZGlhbkJ5dGVBcnJheVBhcnNlciwgYnl0ZUFycmF5LCBwb3NpdGlvbik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgLy8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ICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgZGljb21QYXJzZXIucGFyc2VEaWNvbURhdGFTZXRJbXBsaWNpdChkYXRhU2V0LCBkYXRhU2V0Qnl0ZVN0cmVhbSwgZGF0YVNldEJ5dGVTdHJlYW0uYnl0ZUFycmF5Lmxlbmd0aCwgb3B0aW9ucyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY2F0Y2goZSkge1xuICAgICAgICAgICAgICAgIHZhciBleCA9IHtcbiAgICAgICAgICAgICAgICAgICAgZXhjZXB0aW9uOiBlLFxuICAgICAgICAgICAgICAgICAgICBkYXRhU2V0OiBkYXRhU2V0XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB0aHJvdyBleDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBkYXRhU2V0O1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gbWFpbiBmdW5jdGlvbiBoZXJlXG4gICAgICAgIGZ1bmN0aW9uIHBhcnNlVGhlQnl0ZVN0cmVhbSgpIHtcbiAgICAgICAgICAgIHZhciBtZXRhSGVhZGVyRGF0YVNldCA9IGRpY29tUGFyc2VyLnJlYWRQYXJ0MTBIZWFkZXIoYnl0ZUFycmF5LCBvcHRpb25zKTtcblxuICAgICAgICAgICAgdmFyIGRhdGFTZXQgPSByZWFkRGF0YVNldChtZXRhSGVhZGVyRGF0YVNldCk7XG5cbiAgICAgICAgICAgIHJldHVybiBtZXJnZURhdGFTZXRzKG1ldGFIZWFkZXJEYXRhU2V0LCBkYXRhU2V0KTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIFRoaXMgaXMgd2hlcmUgd2UgYWN0dWFsbHkgc3RhcnQgcGFyc2luZ1xuICAgICAgICByZXR1cm4gcGFyc2VUaGVCeXRlU3RyZWFtKCk7XG4gICAgfTtcblxuICAgIHJldHVybiBkaWNvbVBhcnNlcjtcbn0pKGRpY29tUGFyc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vLyBtYXhpbXVtIGVsZW1lbnQgbGVuZ3RoIHRvIHRyeSBhbmQgY29udmVydCB0byBzdHJpbmcgZm9ybWF0XG4gICAgICAgIH07XG5cbiAgICAgICAgdmFyIHJlc3VsdCA9IHtcblxuICAgICAgICB9O1xuXG4gICAgICAgIGZvcih2YXIgdGFnIGluIGRhdGFTZXQuZWxlbWVudHMpIHtcbiAgICAgICAgICAgIHZhciBlbGVtZW50ID0gZGF0YVNldC5lbGVtZW50c1t0YWddO1xuXG4gICAgICAgICAgICAvLyBza2lwIHRoaXMgZWxlbWVudCBpZiBpdCBhIHByaXZhdGUgZWxlbWVudCBhbmQgb3VyIG9wdGlvbnMgc3BlY2lmeSB0aGF0IHdlIHNob3VsZFxuICAgICAgICAgICAgaWYob3B0aW9ucy5vbWl0UHJpdmF0ZUF0dGlidXRlcyA9PT0gdHJ1ZSAmJiBkaWNvbVBhcnNlci5pc1ByaXZhdGVUYWcodGFnKSlcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYoZWxlbWVudC5pdGVtcykge1xuICAgICAgICAgICAgICAgIC8vIGhhbmRsZSBzZXF1ZW5jZXNcbiAgICAgICAgICAgICAgICB2YXIgc2VxdWVuY2VJdGVtcyA9IFtdO1xuICAgICAgICAgICAgICAgIGZvcih2YXIgaT0wOyBpIDwgZWxlbWVudC5pdGVtcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBzZXF1ZW5jZUl0ZW1zLnB1c2goZGljb21QYXJzZXIuZXhwbGljaXREYXRhU2V0VG9KUyhlbGVtZW50Lml0ZW1zW2ldLmRhdGFTZXQsIG9wdGlvbnMpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmVzdWx0W3RhZ10gPSBzZXF1ZW5jZUl0ZW1zO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB2YXIgYXNTdHJpbmc7XG4gICAgICAgICAgICAgICAgYXNTdHJpbmcgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgaWYoZWxlbWVudC5sZW5ndGggPCBvcHRpb25zLm1heEVsZW1lbnRMZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgYXNTdHJpbmcgPSBkaWNvbVBhcnNlci5leHBsaWNpdEVsZW1lbnRUb1N0cmluZyhkYXRhU2V0LCBlbGVtZW50KTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZihhc1N0cmluZyAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdFt0YWddID0gYXNTdHJpbmc7XG4gICAgICAgICAgICAgICAgfSAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdFt0YWddID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YU9mZnNldDogZWxlbWVudC5kYXRhT2Zmc2V0LFxuICAgICAgICAgICAgICAgICAgICAgICAgbGVuZ3RoIDogZWxlbWVudC5sZW5ndGhcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH07XG5cblxuICAgIHJldHVybiBkaWNvbVBhcnNlcjtcbn0oZGljb21QYXJzZXIpKTtcbnZhciBkaWNvbVBhcnNlciA9IChmdW5jdGlvbiAoZGljb21QYXJzZXIpIHtcbiAgICBcInVzZSBzdHJpY3RcIjtcblxuICAgIGlmIChkaWNvbVBhcnNlciA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGRpY29tUGFyc2VyID0ge307XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQ29udmVydHMgYW4gZXhwbGljaXQgVlIgZWxlbWVudCB0byBhIHN0cmluZyBvciB1bmRlZmluZWQgaWYgaXQgaXMgbm90IHBvc3NpYmxlI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ICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmVzdWx0ICs9IGZ1bmMuY2FsbChkYXRhU2V0LCB0YWcsIGkpLnRvU3RyaW5nKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICB9XG5cbiAgICAgICAgaWYoZGljb21QYXJzZXIuaXNTdHJpbmdWcih2cikgPT09IHRydWUpXG4gICAgICAgIHtcbiAgICAgICAgICAgIHRleHRSZXN1bHQgPSBkYXRhU2V0LnN0cmluZyh0YWcpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHZyID09ICdBVCcpIHtcbiAgICAgICAgICAgIHZhciBudW0gPSBkYXRhU2V0LnVpbnQzMih0YWcpO1xuICAgICAgICAgICAgaWYobnVtID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG51bSA8IDApXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgbnVtID0gMHhGRkZGRkZGRiArIG51bSArIDE7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiAneCcgKyBudW0udG9TdHJpbmcoMTYpLnRvVXBwZXJDYXNlKCk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAodnIgPT0gJ1VTJylcbiAgICAgICAge1xuICAgICAgICAgICAgdGV4dFJlc3VsdCA9IG11bHRpRWxlbWVudFRvU3RyaW5nKGVsZW1lbnQubGVuZ3RoIC8gMiwgZGF0YVNldC51aW50MTYpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYodnIgPT09ICdTUycpXG4gICAgICAgIHtcbiAgICAgICAgICAgIHRleHRSZXN1bHQgPSBtdWx0aUVsZW1lbnRUb1N0cmluZyhlbGVtZW50Lmxlbmd0aCAvIDIsIGRhdGFTZXQuaW50MTYpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2U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HRvIHJlYWQgcGFzdCBlbmQgb2YgYnVmZmVyJztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFyIHVpbnQzMiA9ICgyNTYgKiAoMjU2ICogKDI1NiAqIGJ5dGVBcnJheVtwb3NpdGlvbl0gK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVBcnJheVtwb3NpdGlvbiArIDFdKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUFycmF5W3Bvc2l0aW9uICsgMl0pICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQXJyYXlbcG9zaXRpb24gKyAzXSk7XG5cbiAgICAgICAgICAgIHJldHVybiB1aW50MzI7XG4gICAgICAgIH0sXG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIFBhcnNlcyBhIHNpZ25lZCBpbnQgMzIgZnJvbSBhIGJpZy1lbmRpYW4gYnl0ZSBhcnJheVxuICAgICAgICAgKlxuICAgICAgICAgKiBAcGFyYW0gYnl0ZUFycmF5IHRoZSBieXRlIGFycmF5IHRvIHJlYWQgZnJvbVxuICAgICAgICAgKiBAcGFyYW0gcG9zaXRpb24gdGhlIHBvc2l0aW9uIGluIHRoZSBieXRlIGFycmF5IHRvIHJlYWQgZnJvbVxuICAgICAgICAgKiBAcmV0dXJucyB7Kn0gdGhlIHBhcnNlZCBzaWduZWQgaW50IDMyXG4gICAgICAgICAqIEB0aHJvd3MgZXJyb3IgaWYgYnVmZmVyIG92ZXJyZWFkIHdvdWxkIG9jY3VyXG4gICAgICAgICAqIEBhY2Nlc3MgcHJpdmF0ZVxuICAgICAgICAgKi9cbiAgICAgICAgcmVhZEludDMyOiBmdW5jdGlvbiAoYnl0ZUFycmF5LCBwb3NpdGlvbikge1xuICAgICAgICAgICAgaWYgKHBvc2l0aW9uIDwgMCkge1xuICAgICAgICAgICAgICAgIHRocm93ICdiaWdFbmRpYW5CeXRlQXJyYXlQYXJzZXIucmVhZEludDMyOiBwb3NpdGlvbiBjYW5ub3QgYmUgbGVzcyB0aGFuIDAnO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAocG9zaXRpb24gKyA0ID4gYnl0ZUFycmF5Lmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIHRocm93ICdiaWdFbmRpYW5CeXRlQXJyYXlQYXJzZXIucmVhZEludDMyOiBhdHRlbXB0IHRvIHJlYWQgcGFzdCBlbmQgb2YgYnVmZmVyJztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFyIGludDMyID0gKChieXRlQXJyYXlbcG9zaXRpb25dIDw8IDI0KSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgKGJ5dGVBcnJheVtwb3NpdGlvbiArIDFdIDw8IDE2KSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgKGJ5dGVBcnJheVtwb3NpdGlvbiArIDJdIDw8IDgpICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUFycmF5W3Bvc2l0aW9uICsgM10pO1xuXG4gICAgICAgICAgICByZXR1cm4gaW50MzI7XG4gICAgICAgIH0sXG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIFBhcnNlcyAzMi1iaXQgZmxvYXQgZnJvbSBhIGJpZy1lbmRpYW4gYnl0ZSBhcnJheVxuICAgICAgICAgKlxuICAgICAgICAgKiBAcGFyYW0gYnl0ZUFycmF5IHRoZSBieXRlIGFycmF5IHRvIHJlYWQgZnJvbVxuICAgICAgICAgKiBAcGFyYW0gcG9zaXRpb24gdGhlIHBvc2l0aW9uIGluIHRoZSBieXRlIGFycmF5IHRvIHJlYWQgZnJvbVxuICAgICAgICAgKiBAcmV0dXJucyB7Kn0gdGhlIHBhcnNlZCAzMi1iaXQgZmxvYXRcbiAgICAgICAgICogQHRocm93cyBlcnJvciBpZiBidWZmZXIgb3ZlcnJlYWQgd291bGQgb2NjdXJcbiAgICAg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xlbWVudC5sZW5ndGggPSBieXRlU3RyZWFtLnBvc2l0aW9uIC0gZWxlbWVudC5kYXRhT2Zmc2V0O1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYodGFnID09PSAneGZmZmVlMDAwJylcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBlbGVtZW50LmZyYWdtZW50cy5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgb2Zmc2V0OiBieXRlU3RyZWFtLnBvc2l0aW9uIC0gYmFzZU9mZnNldCAtIDgsXG4gICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uIDogYnl0ZVN0cmVhbS5wb3NpdGlvbixcbiAgICAgICAgICAgICAgICAgICAgbGVuZ3RoIDogbGVuZ3RoXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZih3YXJuaW5ncykge1xuICAgICAgICAgICAgICAgICAgICB3YXJuaW5ncy5wdXNoKCd1bmV4cGVjdGVkIHRhZyAnICsgdGFnICsgJyB3aGlsZSBzZWFyY2hpbmcgZm9yIGVuZCBvZiBwaXhlbCBkYXRhIGVsZW1lbnQgd2l0aCB1bmRlZmluZWQgbGVuZ3RoJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmKGxlbmd0aCA+IGJ5dGVTdHJlYW0uYnl0ZUFycmF5Lmxlbmd0aCAtIGJ5dGVTdHJlYW0ucG9zaXRpb24pXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAvLyBmaXggbGVuZ3RoXG4gICAgICAgICAgICAgICAgICAgIGxlbmd0aCA9IGJ5dGVTdHJlYW0uYnl0ZUFycmF5Lmxlbmd0aCAtIGJ5dGVTdHJlYW0ucG9zaXRpb247XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsZW1lbnQuZnJhZ21lbnRzLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICBvZmZzZXQ6IGJ5dGVTdHJlYW0ucG9zaXRpb24gLSBiYXNlT2Zmc2V0IC0gOCxcbiAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gOiBieXRlU3RyZWFtLnBvc2l0aW9uLFxuICAgICAgICAgICAgICAgICAgICBsZW5ndGggOiBsZW5ndGhcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICBieXRlU3RyZWFtLnNlZWsobGVuZ3RoKTtcbiAgICAgICAgICAgICAgICBlbGVtZW50Lmxlbmd0aCA9IGJ5dGVTdHJlYW0ucG9zaXRpb24gLSBlbGVtZW50LmRhdGFPZmZzZXQ7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBieXRlU3RyZWFtLnNlZWsobGVuZ3RoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmKHdhcm5pbmdzKSB7XG4gICAgICAgICAgICB3YXJuaW5ncy5wdXNoKFwicGl4ZWwgZGF0YSBlbGVtZW50IFwiICsgZWxlbWVudC50YWcgKyBcIiBtaXNzaW5nIHNlcXVlbmNlIGRlbGltaXRlciB0YWcgeGZmZmVlMGRkXCIpO1xuICAgICAgICB9XG4gICAgfTtcblxuXG4gICAgcmV0dXJuIGRpY29tUGFyc2VyO1xufShkaWNvbVBhcnNlcikpO1xuLyoqXG4gKiBJbnRlcm5hbCBoZWxwZXIgZnVuY3Rpb25zIGZvciBwYXJzaW5nIERJQ09NIGVsZW1lbnRzXG4gKi9cblxudmFyIGRpY29tUGFyc2VyID0gKGZ1bmN0aW9uIChkaWNvbVBhcnNlcilcbntcbiAgICBcInVzZSBzdHJpY3RcIjtcblxuICAgIGlmKGRpY29tUGFyc2VyID09PSB1bmRlZmluZWQpXG4gICAge1xuICAgICAgICBkaWNvbVBhcnNlciA9IHt9O1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIHJlY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ZS1lbmRpYW4gYnl0ZSBhcnJheVxuICAgICAgICAgKlxuICAgICAgICAgKiBAcGFyYW0gYnl0ZUFycmF5IHRoZSBieXRlIGFycmF5IHRvIHJlYWQgZnJvbVxuICAgICAgICAgKiBAcGFyYW0gcG9zaXRpb24gdGhlIHBvc2l0aW9uIGluIHRoZSBieXRlIGFycmF5IHRvIHJlYWQgZnJvbVxuICAgICAgICAgKiBAcmV0dXJucyB7Kn0gdGhlIHBhcnNlZCB1bnNpZ25lZCBpbnQgMzJcbiAgICAgICAgICogQHRocm93cyBlcnJvciBpZiBidWZmZXIgb3ZlcnJlYWQgd291bGQgb2NjdXJcbiAgICAgICAgICogQGFjY2VzcyBwcml2YXRlXG4gICAgICAgICAqL1xuICAgICAgICByZWFkVWludDMyOiBmdW5jdGlvbiAoYnl0ZUFycmF5LCBwb3NpdGlvbikge1xuICAgICAgICAgICAgaWYgKHBvc2l0aW9uIDwgMCkge1xuICAgICAgICAgICAgICAgIHRocm93ICdsaXR0bGVFbmRpYW5CeXRlQXJyYXlQYXJzZXIucmVhZFVpbnQzMjogcG9zaXRpb24gY2Fubm90IGJlIGxlc3MgdGhhbiAwJztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHBvc2l0aW9uICsgNCA+IGJ5dGVBcnJheS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyAnbGl0dGxlRW5kaWFuQnl0ZUFycmF5UGFyc2VyLnJlYWRVaW50MzI6IGF0dGVtcHQgdG8gcmVhZCBwYXN0IGVuZCBvZiBidWZmZXInO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgdWludDMyID0gKGJ5dGVBcnJheVtwb3NpdGlvbl0gK1xuICAgICAgICAgICAgKGJ5dGVBcnJheVtwb3NpdGlvbiArIDFdICogMjU2KSArXG4gICAgICAgICAgICAoYnl0ZUFycmF5W3Bvc2l0aW9uICsgMl0gKiAyNTYgKiAyNTYpICtcbiAgICAgICAgICAgIChieX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cbiAgICAgICAgICAgIGlmKGVsZW1lbnQudGFnID09PSBvcHRpb25zLnVudGlsVGFnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcblxuICAgIHJldHVybiBkaWNvbVBhcnNlcjtcbn0oZGljb21QYXJzZXIpKTtcblxuLyoqXG4gKiBJbnRlcm5hbCBoZWxwZXIgZnVuY3Rpb25zIGZvciBmb3IgcGFyc2luZyBESUNPTSBlbGVtZW50c1xuICovXG5cbnZhciBkaWNvbVBhcnNlciA9IChmdW5jdGlvbiAoZGljb21QYXJzZXIpXG57XG4gICAgXCJ1c2Ugc3RyaWN0XCI7XG5cbiAgICBpZihkaWNvbVBhcnNlciA9PT0gdW5kZWZpbmVkKVxuICAgIHtcbiAgICAgICAgZGljb21QYXJzZXIgPSB7fTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBnZXREYXRhTGVuZ3RoU2l6ZUluQnl0ZXNGb3JWUih2cilcbiAgICB7XG4gICAgICAgIGlmKCB2ciA9PT0gJ09CJyB8fFxuICAgICAgICAgICAgdnIgPT09ICdPVycgfHxcbiAgICAgICAgICAgIHZyID09PSAnU1EnIHx8XG4gICAgICAgICAgICB2ciA9PT0gJ09GJyB8fFxuICAgICAgICAgICAgdnIgPT09ICdVVCcgfHxcbiAgICAgICAgICAgIHZyID09PSAnVU4nKVxuICAgICAgICB7XG4gICAgICAgICAgICByZXR1cm4gNDtcbiAgICAgICAgfVxuICAgICAgICBlbHNlXG4gICAgICAgIHtcbiAgICAgICAgICAgIHJldHVybiAyO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZGljb21QYXJzZXIucmVhZERpY29tRWxlbWVudEV4cGxpY2l0ID0gZnVuY3Rpb24oYnl0ZVN0cmVhbSwgd2FybmluZ3MsIHVudGlsVGFnKVxuICAgIHtcbiAgICAgICAgaWYoYnl0ZVN0cmVhbSA9PT0gdW5kZWZpbmVkKVxuICAgICAgICB7XG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ZW1lbnQnXCI7XG4gICAgICAgIH1cblxuICAgICAgICBlbGVtZW50Lml0ZW1zID0gW107XG5cbiAgICAgICAgaWYoZWxlbWVudC5sZW5ndGggPT09IDQyOTQ5NjcyOTUpXG4gICAgICAgIHtcbiAgICAgICAgICAgIHJlYWRTUUVsZW1lbnRVbmRlZmluZWRMZW5ndGhFeHBsaWNpdChieXRlU3RyZWFtLCBlbGVtZW50LCB3YXJuaW5ncyk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZVxuICAgICAgICB7XG4gICAgICAgICAgICByZWFkU1FFbGVtZW50S25vd25MZW5ndGhFeHBsaWNpdChieXRlU3RyZWFtLCBlbGVtZW50LCB3YXJuaW5ncyk7XG4gICAgICAgIH1cbiAgICB9O1xuXG5cbiAgICByZXR1cm4gZGljb21QYXJzZXI7XG59KGRpY29tUGFyc2VyKSk7XG4vKipcbiAqIEludGVybmFsIGhlbHBlciBmdW5jdGlvbnMgZm9yIHBhcnNpbmcgRElDT00gZWxlbWVudHNcbiAqL1xuXG52YXIgZGljb21QYXJzZXIgPSAoZnVuY3Rpb24gKGRpY29tUGFyc2VyKVxue1xuICAgIFwidXNlIHN0cmljdFwiO1xuXG4gICAgaWYoZGljb21QYXJzZXIgPT09IHVuZGVmaW5lZClcbiAgICB7XG4gICAgICAgIGRpY29tUGFyc2VyID0ge307XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gcmVhZERpY29tRGF0YVNldEltcGxpY2l0VW5kZWZpbmVkTGVuZ3RoKGJ5dGVTdHJlYW0sIHZyQ2FsbGJhY2spXG4gICAge1xuICAgICAgICB2YXIgZWxlbWVudHMgPSB7fTtcblxuICAgICAgICB3aGlsZShieXRlU3RyZWFtLnBvc2l0aW9uIDwgYnl0ZVN0cmVhbS5ieXRlQXJyYXkubGVuZ3RoKVxuICAgICAgICB7XG4gICAgICAgICAgICB2YXIgZWxlbWVudCA9IGRpY29tUGFyc2VyLnJlYWREaWNvbUVsZW1lbnRJbXBsaWNpdChieXRl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htZXRpYyBjb2RpbmcuIChmb3JtYXQgdGhyb3cgbmV3IElPRXhjZXB0aW9uKVwiKTtcbiAgICAgICAgICAgIGNhc2UgMHhGRkRCOlxuICAgICAgICAgICAgICAgIHRoaXMucXVhbnRUYWJsZS5yZWFkKHRoaXMuc3RyZWFtLCBqcGVnLmxvc3NsZXNzLkRlY29kZXIuVEFCTEUpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAweEZGREQ6XG4gICAgICAgICAgICAgICAgdGhpcy5yZXN0YXJ0SW50ZXJ2YWwgPSB0aGlzLnJlYWROdW1iZXIoKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMHhGRkUwOlxuICAgICAgICAgICAgY2FzZSAweEZGRTE6XG4gICAgICAgICAgICBjYXNlIDB4RkZFMjpcbiAgICAgICAgICAgIGNhc2UgMHhGRkUzOlxuICAgICAgICAgICAgY2FzZSAweEZGRTQ6XG4gICAgICAgICAgICBjYXNlIDB4RkZFNTpcbiAgICAgICAgICAgIGNhc2UgMHhGRkU2OlxuICAgICAgICAgICAgY2FzZSAweEZGRTc6XG4gICAgICAgICAgICBjYXNlIDB4RkZFODpcbiAgICAgICAgICAgIGNhc2UgMHhGRkU5OlxuICAgICAgICAgICAgY2FzZSAweEZGRUE6XG4gICAgICAgICAgICBjYXNlIDB4RkZFQjpcbiAgICAgICAgICAgIGNhc2UgMHhGRkVDOlxuICAgICAgICAgICAgY2FzZSAweEZGRUQ6XG4gICAgICAgICAgICBjYXNlIDB4RkZFRTpcbiAgICAgICAgICAgIGNhc2UgMHhGRkVGOlxuICAgICAgICAgICAgICAgIHRoaXMucmVhZEFwcCgpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAweEZGRkU6XG4gICAgICAgICAgICAgICAgdGhpcy5yZWFkQ29tbWVudCgpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAg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pcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5xdWFudFRhYmxlLnJlYWQodGhpcy5zdHJlYW0sIGpwZWcubG9zc2xlc3MuRGVjb2Rlci5UQUJMRSk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgMHhGRkREOlxuICAgICAgICAgICAgICAgICAgICB0aGlzLnJlc3RhcnRJbnRlcnZhbCA9IHRoaXMucmVhZE51bWJlcigpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFMDpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFMTpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFMjpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFMzpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFNDpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFNTpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFNjpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFNzpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFODpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFOTpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFQTpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFQjpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFQzpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFRDpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFRTpcbiAgICAgICAgICAgICAgICBjYXNlIDB4RkZFRjpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yZWFkQXBwKCk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgMHhGRkZFOlxuICAgICAgICAgICAgICAgICAgICB0aGlzLnJlYWRDb21tZW50KCk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgIGlmICgoY3VycmVudCA+PiA4KSAhPT0gMHhGRikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiRVJST1I6IGZvcm1hdCB0aHJvdyBuZXcgSU9FeGNlcHRpb24hIChQYXJzZXIuZGVjb2RlKVwiKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBjdXJyZW50ID0gdGhpcy5zdHJlYW0uZ2V0MTYoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMucHJlY2lzaW9uID0gdGhpcy5mcmFtZS5wcmVjaXNpb247XG4gICAgICAgIHRoaXMuY29tcG9uZW50cyA9IHRoaXMuZnJhbWUuY29tcG9uZW50cztcblxuICAgICAgICBpZiAoIXRoaXMubnVtQnl0ZXMpIHtcbiAgICAgICAgICAgIHRoaXMubnVtQnl0ZXMgPSBwYXJzZUludChNYXRoLmNlaWwodGhpcy5wcmVjaXNpb24gLyA4KSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5udW1CeXRlcyA9PSAxKSB7XG4gICAgICAgICAgICB0aGlzLm1hc2sgPSAweEZGO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5tYXNrID0gMHhGRkZGO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5zY2FuLnJlYWQodGhpcy5zdHJlYW0pO1xuICAgICAgICB0aGlzLm51bUNvbXAgPSB0aGlzLnNjYW4ubnVtQ29tcDtcbiAgICAgICAgdGhpcy5zZWxlY3Rpb24gPSB0aGlzLnNjYW4uc2VsZWN0aW9uO1xuXG4gICAgICAgIGlmICh0aGlzLm51bUJ5dGVzID09PSAxKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5udW1Db21wID09PSAzKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5nZXR0ZXIgPSB0aGlzLmdldFZhbHVlUkdCO1xuICAgICAgICAgICAgICAgIHRoaXMuc2V0dGVyID0gdGhpcy5zZXRWYWx1ZVJHQjtcbiAgICAgICAgICAgICAgICB0aGlzLm91dHB1dCA9IHRoaXMub3V0cHV0UkdCO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLmdldHRlciA9IHRoaXMuZ2V0VmFsdWU4O1xuICAgICAgICAgICAgICAgIHRoaXMuc2V0dGVyID0gdGhpcy5zZXRWYWx1ZTg7XG4gICAgICAgICAgICAgICAgdGhpcy5vdXRwdXQgPSB0aGlzLm91dHB1dFNpbmdsZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuZ2V0dGVyID0gdGhpcy5nZXRWYWx1ZTE2O1xuICAgICAgICAgICAgdGhpcy5zZXR0ZXIgPSB0aGlzLnNldFZhbHVlMTY7XG4gICAgICAgICAgICB0aGlzLm91dHB1dCA9IHRoaXMub3V0cHV0U2luZ2xlO1xuICAgICAgICB9XG5cbiAgICAgICAgc3dpdGNoICh0aGlzLnNlbGVjdGlvbikge1xuICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgIHRoaXMuc2VsZWN0b3IgPSB0aGlzLnNlbGVjdDI7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgICAgICAgdGhpcy5zZWxlY3RvciA9IHRoaXMuc2VsZWN0MztcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgNDpcbiAgICAgICAgICAgICAgICB0aGlzLnNlbGVjdG9yID0gdGhpcy5zZWxlY3Q0O1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA1OlxuICAgICAgICAgICAgICAgIHRoaXMuc2VsZWN0b3IgPSB0aGlzLnNlbGVjdDU7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDY6XG4gICAgICAgICAgICAgICAgdGhpcy5zZWxlY3RvciA9IHRoaXMuc2VsZWN0NjtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgNzpcbiAgICAgICAgICAgICAgICB0aGlzLnNlbGVjdG9yID0gdGhpcy5zZWxlY3Q3O1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICB0aGlzLnNlbGVjdG9yID0gdGhpcy5zZWxlY3QxO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5zY2FuQ29tcHMgPSB0aGlzLnNjYW4uY29tcG9uZW50cztcbiAgICAgICAgdGhpcy5xdWFudFRhYmxlcyA9IHRoaXMucXVhbnRUYWJsZS5xdWFudFRhYmxlcztcblxuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgdGhpcy5udW1Db21wOyBpKz0xKSB7XG4gICAgICAgICAgICBjb21wTiA9IHRoaXMuc2NhbkNvbXBzW2ldLnNjYW5Db21wU2VsO1xuICAgICAgICAgICAgdGhpcy5xVGFiW2ldID0gdGhpcy5xdWFudFRhYmxlc1t0aGlzLmNvbXBvbmVudHNbY29tcE5dLnF1YW50VGFibGVTZWxdO1xuICAgICAgICAgICAgdGhpcy5uQmxvY2tbaV0gPSB0aGlzLmNvbXBvbmVudHNbY29tcE5dLnZTYW1wICogdGhpcy5jb21wb25lbnRzW2NvbXBOXS5oU2FtcDtcbiAgICAgICAgICAgIHRoaXMuZGNUYWJbaV0gPSB0aGlzLkh1ZmZUYWJbdGhpcy5zY2FuQ29tcHNbaV0uZGNUYWJTZWxdWzBdO1xuICAgICAgICAgICAgdGhpcy5hY1RhYltpXSA9IHRoaXMuSHVmZlRhYlt0aGlzLnNjYW5Db21wc1tpXS5hY1RhYlNlbF1bMV07XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnhEaW0gPSB0aGlzLmZyYW1lLmRpbVg7XG4gICAgICAgIHRoaXMueURpbSA9IHRoaXMuZnJhbWUuZGltWTtcbiAgICAgICAgdGhpcy5vdXRwdXREYXRhID0gbmV3IERhdGFWaWV3KG5ldyBBcnJheUJ1ZmZlcih0aGlzLnhEaW0gKiB0aGlzLnlEaW0gKiB0aGlzLm51bUJ5dGVzICogdGhpcy5udW1Db21wKSk7XG5cbiAgICAgICAgc2Nhbk51bSs9MTtcblxuICAgICAgICB3aGlsZSAodHJ1ZSkgeyAvLyBEZWNvZGUgb25lIHNjYW5cbiAgICAgICAgICAgIHRlbXBbMF0gPSAwO1xuICAgICAgICAgICAgaW5kZXhbMF0gPSAwO1xuXG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMTA7IGkrPTEpIHtcbiAgICAgICAgICAgICAgICBwcmVkW2ldID0gKDEgPDwgKHRoaXMucHJlY2lzaW9uIC0gMSkpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAodGhpcy5yZXN0YXJ0SW50ZXJ2YWwgPT09IDApIHtcbiAgICAgICAgICAgICAgICBjdXJyZW50ID0gdGhpcy5kZWNvZGVVbml0KHByZWQsIHRlbXAsIGluZGV4KTtcblxuICAgICAgICAgICAgICAgIHdoaWxlICgoY3VycmVudCA9PT0gMCkgJiYgKCh0aGlzLnhMb2MgPCB0aGlzLnhEaW0pICYmICh0aGlzLnlMb2MgPCB0aGlzLnlEaW0pKSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLm91dHB1dChwcmVkKTtcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudCA9IHRoaXMuZGVjb2RlVW5pdChwcmVkLCB0ZW1wLCBpbmRleCk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgYnJlYWs7IC8vY3VycmVudD1NQVJLRVJcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZm9yIChtY3VOdW0gPSAwOyBtY3VOdW0gPCB0aGlzLnJlc3RhcnRJbnRlcnZhbDsgbWN1TnVtKz0xKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5yZXN0YXJ0aW5nID0gKG1jdU51bSA9PSAwKTtcbiAgICAgICAgICAgICAgICBjdXJyZW50ID0gdGhpcy5kZWNvZGVVbml0KHByZWQsIHRlbXAsIGluZGV4KTtcbiAgICAgICAgICAgICAgICB0aGlzLm91dHB1dChwcmVkKTtcblxuICAgICAgICAgICAgICAgIGlmIChjdXJyZW50ICE9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKGN1cnJlbnQgPT09IDApIHtcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5tYXJrZXJJbmRleCAhPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBjdXJyZW50ID0gKDB4RkYwMCB8IHRoaXMubWFya2VyKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5tYXJrZXJJbmRleCA9IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudCA9IHRoaXMuc3RyZWFtLmdldDE2KCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoISgoY3VycmVudCA+PSBqcGVnLmxvc3NsZXNzLkRlY29kZXIuUkVTVEFSVF9NQVJLRVJfQkVHSU4pICYmXG4gICAgICAgICAgICAgICAgKGN1cnJlbnQgPD0ganBlZy5sb3NzbGVzcy5EZWNvZGVyLlJFU1RBUlRfTUFSS0VSX0VORCkpKSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7IC8vY3VycmVudD1NQVJLRVJcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmICgoY3VycmVudCA9PT0gMHhGRkRDKSAmJiAoc2Nhbk51bSA9PT0gMSkpIHsgLy9ETkxcbiAgIC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oaXMuSURDVF9Tb3VyY2VbMF0gKj0gcXRhYlswXTtcblxuICAgICAgICAgICAgZm9yIChqID0gMTsgaiA8IDY0OyBqKz0xKSB7XG4gICAgICAgICAgICAgICAgdmFsdWUgPSB0aGlzLmdldEh1ZmZtYW5WYWx1ZShhY3RhYiwgdGVtcCwgaW5kZXgpO1xuXG4gICAgICAgICAgICAgICAgaWYgKHZhbHVlID49IDB4RkYwMCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaiArPSAodmFsdWUgPj4gNCk7XG5cbiAgICAgICAgICAgICAgICBpZiAoKHZhbHVlICYgMHgwRikgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCh2YWx1ZSA+PiA0KSA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLklEQ1RfU291cmNlW2pwZWcubG9zc2xlc3MuRGVjb2Rlci5JRENUX1Bbal1dID0gdGhpcy5nZXRuKGluZGV4LCB2YWx1ZSAmIDB4MEYsIHRlbXAsIGluZGV4KSAqIHF0YWJbal07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIDA7XG59O1xuXG5cblxuanBlZy5sb3NzbGVzcy5EZWNvZGVyLnByb3RvdHlwZS5kZWNvZGVTaW5nbGUgPSBmdW5jdGlvbiAocHJldiwgdGVtcCwgaW5kZXgpIHtcbiAgICAvKmpzbGludCBiaXR3aXNlOiB0cnVlICovXG5cbiAgICB2YXIgdmFsdWUsIGksIG4sIG5SZXN0YXJ0O1xuXG4gICAgaWYgKHRoaXMucmVzdGFydGluZykge1xuICAgICAgICB0aGlzLnJlc3RhcnRpbmcgPSBmYWxz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uICAgIHZhciBjb2RlLCBpbnB1dCwgbWFzaztcbiAgICBtYXNrID0gMHhGRkZGO1xuXG4gICAgaWYgKGluZGV4WzBdIDwgOCkge1xuICAgICAgICB0ZW1wWzBdIDw8PSA4O1xuICAgICAgICBpbnB1dCA9IHRoaXMuc3RyZWFtLmdldDgoKTtcbiAgICAgICAgaWYgKGlucHV0ID09PSAweEZGKSB7XG4gICAgICAgICAgICB0aGlzLm1hcmtlciA9IHRoaXMuc3RyZWFtLmdldDgoKTtcbiAgICAgICAgICAgIGlmICh0aGlzLm1hcmtlciAhPT0gMCkge1xuICAgICAgICAgICAgICAgIHRoaXMubWFya2VySW5kZXggPSA5O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHRlbXBbMF0gfD0gaW5wdXQ7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgaW5kZXhbMF0gLT0gODtcbiAgICB9XG5cbiAgICBjb2RlID0gdGFibGVbdGVtcFswXSA+PiBpbmRleFswXV07XG5cbiAgICBpZiAoKGNvZGUgJiBqcGVnLmxvc3NsZXNzLkRlY29kZXIuTVNCKSAhPT0gMCkge1xuICAgICAgICBpZiAodGhpcy5tYXJrZXJJbmRleCAhPT0gMCkge1xuICAgICAgICAgICAgdGhpcy5tYXJrZXJJbmRleCA9IDA7XG4gICAgICAgICAgICByZXR1cm4gMHhGRjAwIHwgdGhpcy5tYXJrZXI7XG4gICAgICAgIH1cblxuICAgICAgICB0ZW1wWzBdICY9IChtYXNrID4+ICgxNiAtIGluZGV4WzBdKSk7XG4gICAgICAgIHRlbXBbMF0gPDw9IDg7XG4gICAgICAgIGlucHV0ID0gdGhpcy5zdHJlYW0uZ2V0OCgpO1xuXG4gICAgICAgIGlmIChpbnB1dCA9PT0gMHhGRikge1xuICAgICAgICAgICAgdGhpcy5tYXJrZXIgPSB0aGlzLnN0cmVhbS5nZXQ4KCk7XG4gICAgICAgICAgICBpZiAodGhpcy5tYXJrZXIgIT09IDApIHtcbiAgICAgICAgICAgICAgICB0aGlzLm1hcmtlckluZGV4ID0gOTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHRlbXBbMF0gfD0gaW5wdXQ7XG4gICAgICAgIGNvZGUgPSB0YWJsZVsoKGNvZGUgJiAweEZGKSAqIDI1NikgKyAodGVtcFswXSA+PiBpbmRleFswXSldO1xuICAgICAgICBpbmRleFswXSArPSA4O1xuICAgIH1cblxuICAgIGluZGV4WzBdICs9IDggLSAoY29kZSA+PiA4KTtcblxuICAgIGlmIChpbmRleFswXSA8IDApIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiaW5kZXg9XCIgKyBpbmRleFswXSArIFwiIHRlbXA9XCIgKyB0ZW1wWzBdICsgXCIgY29kZT1cIiArIGNvZGUgKyBcIiBpbiBIdWZmbWFuVmFsdWUoKVwiKTtcbiAgICB9XG5cbiAgICBpZiAoaW5kZXhbMF0gPCB0aGlzLm1hcmtlckluZGV4KSB7XG4gICAgICAgIHRoaXMubWFya2VySW5kZXggPSAwO1xuICAgICAgICByZXR1cm4gMHhGRjAwIHwgdGhpcy5tYXJrZXI7XG4gICAgfVxuXG4gICAgdGVtcFswXSAmPSAobWFzayA+PiAoMTYgLSBpbmRleFswXSkpO1xuICAgIHJldHVybiBjb2RlICYgMHhGRjtcbn07XG5cblxuXG5qcGVnLmxvc3NsZXNzLkRlY29kZXIucHJvdG90eXBlLmdldG4gPSBmdW5jdGlvbiAoUFJFRCwgbiwgdGVtcCwgaW5kZXgpIHtcbiAgICAvKmpzbGludCBiaXR3aXNlOiB0cnVlICovXG5cbiAgICB2YXIgcmVzdWx0LCBvbmUsIG5fb25lLCBtYXNrLCBpbnB1dDtcbiAgICBvbmUgPSAxO1xuICAgIG5fb25lID0gLTE7XG4gICAgbWFzayA9IDB4RkZGRjtcblxuICAgIGlmIChuID09PSAwKSB7XG4gICAgICAgIHJldHVybiAwO1xuICAgIH1cblxuICAgIGlmIChuID09PSAxNikge1xuICAgICAgICBpZiAoUFJFRFswXSA+PSAwKSB7XG4gICAgICAgICAgICByZXR1cm4gLTMyNzY4O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIDMyNzY4O1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgaW5kZXhbMF0gLT0gbjtcblxuICAgIGlmIChpbmRleFswXSA+PSAwKSB7XG4gICAgICAgIGlmICgoaW5kZXhbMF0gPCB0aGlzLm1hcmtlckluZGV4KSAmJiAhdGhpcy5pc0xhc3RQaXhlbCgpKSB7IC8vIHRoaXMgd2FzIGNvcnJ1cHRpbmcgdGhlIGxhc3QgcGl4ZWwgaW4gc29tZSBjYXNlc1xuICAgICAgICAgICAgdGhpcy5tYXJrZXJJbmRleCA9IDA7XG4gICAgICAgICAgICByZXR1cm4gKDB4RkYwMCB8IHRoaXMubWFya2VyKSA8PCA4O1xuICAgICAgICB9XG5cbiAgICAgICAgcmVzdWx0ID0gdGVtcFswXSA+PiBpbmRleFswXTtcbiAgICAgICAgdGVtcFswXSAmPSAobWFzayA+PiAoMTYgLSBpbmRleFswXSkpO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIHRlbXBbMF0gPDw9IDg7XG4gICAgICAgIGlucHV0ID0gdGhpcy5zdHJlYW0uZ2V0OCgpO1xuXG4gICAgICAgIGlmIChpbnB1dCA9PT0gMHhGRikge1xuICAgICAgICAgICAgdGhpcy5tYXJrZXIgPSB0aGlzLnN0cmVhbS5nZXQ4KCk7XG4gICAgICAgICAgICBpZiAodGhpcy5tYXJrZXIgIT09IDApIHtcbiAgICAgICAgICAgICAgICB0aGlzLm1hcmtlckluZGV4ID0gOTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHRlbXBbMF0gfD0gaW5wdXQ7XG4gICAgICAgIGluZGV4WzBdICs9IDg7XG5cbiAgICAgICAgaWYgKGluZGV4WzBdIDwgMCkge1xuICAgICAgICAgICAgaWYgKHRoaXMubWFya2VySW5kZXggIT09IDApIHtcbiAgICAgICAgICAgICAgICB0aGlzLm1hcmtlckluZGV4ID0gMDtcbiAgICAgICAgICAgICAgICByZXR1cm4gKDB4RkYwMCB8IHRoaXMubWFya2VyKSA8PCA4O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB0ZW1wWzBdIDw8PSA4O1xuICAgICAgICAgICAgaW5wdXQgPSB0aGlzLnN0cmVhbS5nZXQ4KCk7XG5cbiAgICAgICAgICAgIGlmIChpbnB1dCA9PT0gMHhGRikge1xuICAgICAgICAgICAgICAgIHRoaXMubWFya2VyID0gdGhpcy5zdHJlYW0uZ2V0OCgpO1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLm1hcmtlciAhPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLm1hcmtlckluZGV4ID0gOTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRlbXBbMF0gfD0gaW5wdXQ7XG4gICAgICAgICAgICBpbmRleFswXSArPSA4O1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGluZGV4WzBdIDwgMCkge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiaW5kZXg9XCIgKyBpbmRleFswXSArIFwiIGluIGdldG4oKVwiKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChpbmRleFswXSA8IHRoaXMubWFya2VySW5kZXgpIHtcbiAgICAgICAgICAgIHRoaXMubWFya2VySW5kZXggPSAwO1xuICAgICAgICAgICAgcmV0dXJuICgweEZGMDAgfCB0aGlzLm1hcmtlcikgPDwgODtcbiAgICAgICAgfVxuXG4gICAgICAgIHJlc3VsdCA9IHRlbXBbMF0gPj4gaW5kZXhbMF07XG4gICAgICAgIHRlbXBbMF0gJj0gKG1hc2sgPj4gKDE2IC0gaW5kZXhbMF0pKTtcbiAgICB9XG5cbiAgICBpZiAocmVzdWx0IDwgKG9uZSA8PCAobiAtIDEpKSkge1xuICAgICAgICByZXN1bHQgKz0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ludCBiaXR3aXNlOiB0cnVlICovXG5cbiAgICBpZiAodGhpcy55TG9jID4gMCkge1xuICAgICAgICByZXR1cm4gdGhpcy5nZXR0ZXIoKCgodGhpcy55TG9jIC0gMSkgKiB0aGlzLnhEaW0pICsgdGhpcy54TG9jKSwgY29tcE9mZnNldCk7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZ2V0UHJldmlvdXNYKGNvbXBPZmZzZXQpO1xuICAgIH1cbn07XG5cblxuXG5qcGVnLmxvc3NsZXNzLkRlY29kZXIucHJvdG90eXBlLmlzTGFzdFBpeGVsID0gZnVuY3Rpb24gKCkge1xuICAgIHJldHVybiAodGhpcy54TG9jID09PSAodGhpcy54RGltIC0gMSkpICYmICh0aGlzLnlMb2MgPT09ICh0aGlzLnlEaW0gLSAxKSk7XG59O1xuXG5cblxuanBlZy5sb3NzbGVzcy5EZWNvZGVyLnByb3RvdHlwZS5vdXRwdXRTaW5nbGUgPSBmdW5jdGlvbiAoUFJFRCkge1xuICAgIGlmICgodGhpcy54TG9jIDwgdGhpcy54RGltKSAmJiAodGhpcy55TG9jIDwgdGhpcy55RGltKSkge1xuICAgICAgICB0aGlzLnNldHRlcigoKCh0aGlzLnlMb2MgKiB0aGlzLnhEaW0pICsgdGhpcy54TG9jKSksIHRoaXMubWFzayAmIFBSRURbMF0pO1xuXG4gICAgICAgIHRoaXMueExvYys9MTtcblxuICAgICAgICBpZiAodGhpcy54TG9jID49IHRoaXMueERpbSkge1xuICAgICAgICAgICAgdGhpcy55TG9jKz0xO1xuICAgICAgICAgICAgdGhpcy54TG9jID0gMDtcbiAgICAgICAgfVxuICAgIH1cbn07XG5cblxuXG5qcGVnLmxvc3NsZXNzLkRlY29kZXIucHJvdG90eXBlLm91dHB1dFJHQiA9IGZ1bmN0aW9uIChQUkVEKSB7XG4gICAgdmFyIG9mZnNldCA9ICgodGhpcy55TG9jICogdGhpcy54RGltKSArIHRoaXMueExvYyk7XG5cbiAgICBpZiA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ICAgICAgIGlmIChjb3VudCA+IGxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJFUlJPUjogSHVmZm1hbiB0YWJsZSBmb3JtYXQgZXJyb3IgW2NvdW50PkxoXVwiKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB0aGlzLnZbdF1bY11baV1bal0gPSBkYXRhLmdldDgoKTtcbiAgICAgICAgICAgICAgICBjb3VudCs9MTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIGlmIChjb3VudCAhPT0gbGVuZ3RoKSB7XG4gICAgICAgIHRocm93IG5ldyBFcnJvcihcIkVSUk9SOiBIdWZmbWFuIHRhYmxlIGZvcm1hdCBlcnJvciBbY291bnQhPUxmXVwiKTtcbiAgICB9XG5cbiAgICBmb3IgKGkgPSAwOyBpIDwgNDsgaSs9MSkge1xuICAgICAgICBmb3IgKGogPSAwOyBqIDwgMjsgais9MSkge1xuICAgICAgICAgICAgaWYgKHRoaXMudGNbaV1bal0gIT09IDApIHtcbiAgICAgICAgICAgICAgICB0aGlzLmJ1aWxkSHVmZlRhYmxlKEh1ZmZUYWJbaV1bal0sIHRoaXMubFtpXVtqXSwgdGhpcy52W2ldW2pdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiAxO1xufTtcblxuXG5cbi8vXHRCdWlsZF9IdWZmVGFiKClcbi8vXHRQYXJhbWV0ZXI6ICB0ICAgICAgIHRhYmxlIElEXG4vL1x0ICAgICAgICAgICAgYyAgICAgICB0YWJsZSBjbGFzcyAoIDAgZm9yIERDLCAxIGZvciBBQyApXG4vL1x0ICAgICAgICAgICAgTFtpXSAgICAjIG9mIGNvZGV3b3JkcyB3aGljaCBsZW5ndGggaXMgaVxuLy9cdCAgICAgICAgICAgIFZbaV1bal0gSHVmZm1hbiBWYWx1ZSAobGVuZ3RoPWkpXG4vL1x0RWZmZW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V1bal0gfCAoKGkgKyAxKSA8PCA4KTtcbiAgICAgICAgICAgICAgICBrKz0xO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoayA+PSAyNTYpIHtcbiAgICAgICAgICAgICAgICBpZiAoayA+IDI1Nikge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJFUlJPUjogSHVmZm1hbiB0YWJsZSBlcnJvcigxKSFcIik7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgayA9IDA7XG4gICAgICAgICAgICAgICAgY3VycmVudFRhYmxlKz0xO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxufTtcblxuXG4vKioqIEV4cG9ydHMgKioqL1xuXG52YXIgbW9kdWxlVHlwZSA9IHR5cGVvZiBtb2R1bGU7XG5pZiAoKG1vZHVsZVR5cGUgIT09ICd1bmRlZmluZWQnKSAmJiBtb2R1bGUuZXhwb3J0cykge1xuICAgIG1vZHVsZS5leHBvcnRzID0ganBlZy5sb3NzbGVzcy5IdWZmbWFuVGFibGU7XG59XG4iLCIvKmpzbGludCBicm93c2VyOiB0cnVlLCBub2RlOiB0cnVlICovXG4vKmdsb2JhbCByZXF1aXJlLCBtb2R1bGUgKi9cblxuXCJ1c2Ugc3RyaWN0XCI7XG5cbi8qKiogSW1wb3J0cyAqKiovXG52YXIganBlZyA9IGpwZWcgfHwge307XG5qcGVnLmxvc3NsZXNzID0ganBlZy5sb3NzbGVzcyB8fCB7fTtcbmpwZWcubG9zc2xlc3MuQ29tcG9uZW50U3BlYyA9IGpwZWcubG9zc2xlc3MuQ29tcG9uZW50U3BlYyB8fCAoKHR5cGVvZiByZXF1aXJlICE9PSAndW5kZWZpbmVkJykgPyByZXF1aXJlKCcuL2NvbXBvbmVudC1zcGVjLmpzJykgOiBudWxsKTtcbmpwZWcubG9zc2xlc3MuRGF0YVN0cmVhbSA9IGpwZWcubG9zc2xlc3MuRGF0YVN0cmVhbSB8f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NlIGlmICh0aGlzLnByZWNpc2lvblt0XSA9PT0gMSkge1xuICAgICAgICAgICAgdGhpcy5wcmVjaXNpb25bdF0gPSAxNjtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkVSUk9SOiBRdWFudGl6YXRpb24gdGFibGUgcHJlY2lzaW9uIGVycm9yXCIpO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy50cVt0XSA9IDE7XG5cbiAgICAgICAgaWYgKHRoaXMucHJlY2lzaW9uW3RdID09PSA4KSB7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNjQ7IGkrPTEpIHtcbiAgICAgICAgICAgICAgICBpZiAoY291bnQgPiBsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiRVJST1I6IFF1YW50aXphdGlvbiB0YWJsZSBmb3JtYXQgZXJyb3JcIik7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdGhpcy5xdWFudFRhYmxlc1t0XVtpXSA9IGRhdGEuZ2V0OCgpO1xuICAgICAgICAgICAgICAgIGNvdW50Kz0xO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBqcGVnLmxvc3NsZXNzLlF1YW50aXphdGlvblRhYmxlLmVuaGFuY2VRdWFudGl6YXRpb25UYWJsZSh0aGlzLnF1YW50VGFibGVzW3RdLCB0YWJsZSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNjQ7IGkrPTEpIHtcbiAgICAgICAgICAgICAgICBpZiAoY291bnQgPiBsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiRVJST1I6IFF1YW50aXphdGlvbiB0YWJsZSBmb3JtYXQgZXJyb3JcIik7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdGhpcy5xdWFudFR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gYXhpcywgaWYgbmVlZGVkICovXG4gICAgdmFsID0geGkgKiB4aiArIHlpICogeWogKyB6aSAqIHpqOyAgICAvKiBkb3QgcHJvZHVjdCBiZXR3ZWVuIGkgYW5kIGogKi9cbiAgICBpZiAoTWF0aC5hYnModmFsKSA+IDEuRS00KSB7XG4gICAgICAgIHhqIC09IHZhbCAqIHhpO1xuICAgICAgICB5aiAtPSB2YWwgKiB5aTtcbiAgICAgICAgemogLT0gdmFsICogemk7XG4gICAgICAgIHZhbCA9IE1hdGguc3FydCh4aiAqIHhqICsgeWogKiB5aiArIHpqICogemopOyAgLyogbXVzdCByZW5vcm1hbGl6ZSAqL1xuICAgICAgICBpZiAodmFsID09PSAwLjApIHsgICAgICAgICAgICAgIC8qIGogd2FzIHBhcmFsbGVsIHRvIGk/ICovXG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgfVxuICAgICAgICB4aiAvPSB2YWw7XG4gICAgICAgIHlqIC89IHZhbDtcbiAgICAgICAgemogLz0gdmFsO1xuICAgIH1cblxuICAgIC8qIG5vcm1hbGl6ZSBrIGF4aXM7IGlmIGl0IGlzIHplcm8sIG1ha2UgaXQgdGhlIGNyb3NzIHByb2R1Y3QgaSB4IGogKi9cbiAgICB2YWwgPSBNYXRoLnNxcnQoeGsgKiB4ayArIHlrICogeWsgKyB6ayAqIHprKTtcbiAgICBpZiAodmFsID09PSAwLjApIHtcbiAgICAgICAgeGsgPSB5aSAqIHpqIC0gemkgKiB5ajtcbiAgICAgICAgeWsgPSB6aSAqIHhqIC0gemogKiB4aTtcbiAgICAgICAgemsgPSB4aSAqIHlqIC0geWkgKiB4ajtcbiAgICB9IGVsc2Uge1xuICAgICAgICB4ayAvPSB2YWw7XG4gICAgICAgIHlrIC89IHZhbDtcbiAgICAgICAgemsgLz0gdmFsO1xuICAgIH1cblxuICAgIC8qIG9ydGhvZ29uYWxpemUgayB0byBpICovXG4gICAgdmFsID0geGkgKiB4ayArIHlpICogeWsgKyB6aSAqIHprOyAgICAvKiBkb3QgcHJvZHVjdCBiZXR3ZWVuIGkgYW5kIGsgKi9cbiAgICBpZiAoTWF0aC5hYnModmFsKSA+IDEuRS00KSB7XG4gICAgICAgIHhrIC09IHZhbCAqIHhpO1xuICAgICAgICB5ayAtPSB2YWwgKiB5aTtcbiAgICAgICAgemsgLT0gdmFsICogemk7XG4gICAgICAgIHZhbCA9IE1hdGguc3FydCh4ayAqIHhrICsgeWsgKiB5ayArIHprICogemspO1xuICAgICAgICBpZiAodmFsID09PSAwLjApIHsgICAgLyogYmFkICovXG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgfVxuICAgICAgICB4ayAvPSB2YWw7XG4gICAgICAgIHlrIC89IHZhbDtcbiAgICAgICAgemsgLz0gdmFsO1xuICAgIH1cblxuICAgIC8qIG9ydGhvZ29uYWxpemUgayB0byBqICovXG4gICAgdmFsID0geGogKiB4ayArIHlqICogeWsgKyB6aiAqIHprOyAgICAvKiBkb3QgcHJvZHVjdCBiZXR3ZWVuIGogYW5kIGsgKi9cbiAgICBpZiAoTWF0aC5hYnModmFsKSA+IDEuZS00KSB7XG4gICAgICAgIHhrIC09IHZhbCAqIHhqO1xuICAgICAgICB5ayAtPSB2YWwgKiB5ajtcbiAgICAgICAgemsgLT0gdmFsICogemo7XG4gICAgICAgIHZhbCA9IE1hdGguc3FydCh4ayAqIHhrICsgeWsgKiB5ayArIHprICogemspO1xuICAgICAgICBpZiAodmFsID09PSAwLjApIHsgICAgIC8qIGJhZCAqL1xuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgeGsgLz0gdmFsO1xuICAgICAgICB5ayAvPSB2YWw7XG4gICAgICAgIHprIC89IHZhbDtcbiAgICB9XG5cbiAgICBRWzBdWzBdID0geGk7XG4gICAgUVswXVsxXSA9IHhqO1xuICAgIFFbMF1bMl0gPSB4aztcbiAgICBRWzFdWzBdID0geWk7XG4gICAgUVsxXVsxXSA9IHlqO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IC8qIGkgPSBjb2x1bW4gbnVtYmVyIHRvIHVzZSBmb3Igcm93ICMxICovXG4gICAgICAgIGZvciAoaiA9IDE7IGogPD0gMzsgaiArPSAxKSB7ICAgIC8qIGogPSBjb2x1bW4gbnVtYmVyIHRvIHVzZSBmb3Igcm93ICMyICovXG4gICAgICAgICAgICBpZiAoaSAhPT0gaikge1xuICAgICAgICAgICAgICAgIGZvciAoayA9IDE7IGsgPD0gMzsgayArPSAxKSB7ICAvKiBrID0gY29sdW1uIG51bWJlciB0byB1c2UgZm9yIHJvdyAjMyAqL1xuICAgICAgICAgICAgICAgICAgICBpZiAoIShpID09PSBrIHx8IGogPT09IGspKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBQWzBdWzBdID0gUFswXVsxXSA9IFBbMF1bMl0gPSBQWzFdWzBdID0gUFsxXVsxXSA9IFBbMV1bMl0gPSBQWzJdWzBdID0gUFsyXVsxXSA9IFBbMl1bMl0gPSAwLjA7XG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHAgPSAtMTsgcCA8PSAxOyBwICs9IDIpIHsgICAgLyogcCxxLHIgYXJlIC0xIG9yICsxICAgICAgKi9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHEgPSAtMTsgcSA8PSAxOyBxICs9IDIpIHsgICAvKiBhbmQgZ28gaW50byByb3dzICMxLDIsMyAqL1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHIgPSAtMTsgciA8PSAxOyByICs9IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBbMF1baSAtIDFdID0gcDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBbMV1baiAtIDFdID0gcTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBbMl1bayAtIDFdID0gcjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRldFAgPSB0aGlzLm5pZnRpX21hdDMzX2RldGVybShQKTsgICAgICAgICAgIC8qIHNpZ24gb2YgcGVybXV0YXRpb24gKi9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZGV0UCAqIGRldFEpID4gMC4wKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTSA9IHRoaXMubmlmdGlfbWF0MzNfbXVsKFAsIFEpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogYW5nbGUgb2YgTSByb3RhdGlvbiA9IDIuMCphY29zKDAuNSpzcXJ0KDEuMCt0cmFjZShNKSkpICAgICAgICovXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogd2Ugd2FudCBsYXJnZXN0IHRyYWNlKE0pID09IHNtYWxsZXN0IGFuZ2xlID09IE0gbmVhcmVzdCB0byBJICovXG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWwgPSBNWzBdWzBdICsgTVsxXVsxXSArIE1bMl1bMl07IC8qIHRyYWNlICovXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHZhbCA+IHZiZXN0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZiZXN0ID0gdmFsO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpYmVzdCA9IGk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpiZXN0ID0gajtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2Jlc3QgPSBrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYmVzdCA9IHA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHFiZXN0ID0gcTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmJlc3QgPSByO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gIC8qIGRvZXNuJ3QgbWF0Y2ggc2lnbiBvZiBRICovXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvKiBBdCB0aGlzIHBvaW50IGliZXN0IGlzIDEgb3IgMiBvciAzOyBwYmVzdCBpcyAtMSBvciArMTsgZXRjLlxuXG4gICAgIFRoZSBtYXRyaXggUCB0aGF0IGNvcnJlc3BvbmRzIGlzIHRoZSBiZXN0IHBlcm11dGF0aW9uIGFwcHJveGltYXRpb25cbiAgICAgdG8gUS1pbnZlcnNlOyB0aGF0IGlzLCBQIChhcHByb3hpbWF0ZWx5KSB0YWtlcyAoeCx5LHopIGNvb3JkaW5hdGVzXG4gICAgIHRvIHRoZSAoaSxqLGspIGF4ZXMuXG5cbiAgICAgRm9yIGV4YW1wbGUsIHRoZSBmaXJzdCByb3cgb2YgUCAod2hpY2ggY29udGFpbnMgcGJlc3QgaW4gY29sdW1uIGliZXN0KVxuICAgICBkZXRlcm1pbmVzIHRoZSB3YXkgdGhlIGkgYXhpcyBwb2ludHMgcmVsYXRpdmUgdG8gdGhlIGFuYXRvbWljYWxcbiAgICAgKHgseSx6KSBheGVzLiAgSWYgaWJlc3QgaXMgMiwgdGhlbiB0aGUgaSBheGlzIGlzIGFsb25nIHRoZSB5IGF4aXMsXG4gICAgIHdoaWNoIGlzIGRpcmVjdGlvbiBQMkEgKGlmIHBiZXN0ID4gMCkgb3IgQTJQIChpZiBwYmVzdCA8IDApLlxuXG4gICAgIFNvLCB1c2luZyBpYmVzdCBhbmQgcGJlc3QsIHdlIGNhbiBhc3NpZ24gdGhlIG91dHB1dCBjb2RlIGZvclxuICAgICB0aGUgaSBheGlzLiAgTXV0YXRpcyBtdXRhbmRpcyBmb3IgdGhlIGogYW5kIGsgYXhlcywgb2YgY291cnNlLiAqL1xuXG4gICAgaUNoYXIgPSBqQ2hhciA9IGtDaGFyID0gaVNlbnNlID0galNlbnNlID0ga1NlbnNlID0gMDtcblxuICAgIHN3aXRjaCAoaWJlc3QgKiBwYmVzdCkge1xuICAgICAgICBjYXNlIDE6IC8qaSA9IE5JRlRJX0wyUiovXG4gICAgICAgICAgICBpQ2hhciA9ICdYJztcbiAgICAgICAgICAgIGlTZW5zZSA9ICcrJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIC0xOiAvKmkgPSBOSUZUSV9SMkwqL1xuICAgICAgICAgICAgaUNoYXIgPSAnWCc7XG4gICAgICAgICAgICBpU2Vuc2UgPSAnLSc7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAyOiAvKmkgPSBOSUZUSV9QMkEqL1xuICAgICAgICAgICAgaUNoYXIgPSAnWSc7XG4gICAgICAgICAgICBpU2Vuc2UgPSAnKyc7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAtMjogLyppID0gTklGVElfQTJQKi9cbiAgICAgICAgICAgIGlDaGFyID0gJ1knO1xuICAgICAgICAgICAgaVNlbnNlID0gJy0nO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgMzogLyppID0gTklGVElfSTJTKi9cbiAgICAgICAgICAgIGlDaGFyID0gJ1onO1xuICAgICAgICAgICAgaVNlbnNlID0gJysnO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgLTM6IC8qaSA9IE5JRlRJX1MySSovXG4gICAgICAgICAgICBpQ2hhciA9ICdaJztcbiAgICAgICAgICAgIGlTZW5zZSA9ICctJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgIH1cblxuICAgIHN3aXRjaCAoamJlc3QgKiBxYmVzdCkge1xuICAgICAgICBjYXNlIDE6IC8qaiA9IE5JRlRJX0wyUiovXG4gICAgICAgICAgICBqQ2hhciA9ICdYJztcbiAgICAgICAgICAgIGpTZW5zZSA9ICcrJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIC0xOiAvKmogPSBOSUZUSV9SMkwqL1xuICAgICAgICAgICAgakNoYXIgPSAnWCc7XG4gICAgICAgICAgICBqU2Vuc2UgPSAnLSc7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAyOiAvKmogPSBOSUZUSV9QMkEqL1xuICAgICAgICAgICAgakNoYXIgPSAnWSc7XG4gICAgICAgICAgICBqU2Vuc2UgPSAnKyc7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAtMjogLypqID0gTklGVElfQTJQKi9cbiAgICAgICAgICAgIGpDaGFyID0gJ1knO1xuICAgICAgICAgICAgalNlbnNlID0gJy0nO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgMzogLypqID0gTklGVElfSTJTKi9cbiAgICAgICAgICAgIGpDaGFyID0gJ1onO1xuICAgICAgICAgICAgalNlbnNlID0gJysnO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgLTM6IC8qaiA9IE5JRlRJX1MySSovXG4gICAgICAgICAgICBqQ2hhciA9ICdaJztcbiAgICAgICAgICAgIGpTZW5zZSA9ICctJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgIH1cblxuICAgIHN3aXRjaCAoa2Jlc3QgKiByYmVzdCkge1xuICAgICAgICBjYXNlIDE6IC8qayA9IE5JRlRJX0wyUiovXG4gICAgICAgICAgICBrQ2hhciA9ICdYJztcbiAgICAgICAgICAgIGtTZW5zZSA9ICcrJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIC0xOiAvKmsgPSBOSUZUSV9SMkwqL1xuICAgICAgICAgICAga0NoYXIgPSAnWCc7XG4gICAgICAgICAgICBrU2Vuc2UgPSAnLSc7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAyOiAvKmsgPSBOSUZUSV9QMkEqL1xuICAgICAgICAgICAga0NoYXIgPSAnWSc7XG4gICAgICAgICAgICBrU2Vuc2UgPSAnKyc7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAtMjogLyprID0gTklGVElfQTJQKi9cbiAgICAgICAgICAgIGtDaGFyID0gJ1knO1xuICAgICAgICAgICAga1NlbnNlID0gJy0nO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgMzogLyprID0gTklGVElfSTJTKi9cbiAgICAgICAgICAgIGtDaGFyID0gJ1onO1xuICAgICAgICAgICAga1NlbnNlID0gJysnO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgLTM6IC8qayA9IE5JRlRJX1MySSovXG4gICAgICAgICAgICBrQ2hhciA9ICdaJztcbiAgICAgICAgICAgIGtTZW5zZSA9ICctJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgIH1cblxuICAgIHJldHVybiAoaUNoYXIgKyBqQ2hhciArIGtDaGFyICsgaVNlbnNlICsgalNlbnNlICsga1NlbnNlKTtcbn07XG5cblxuXG5uaWZ0aS5OSUZUSTEucHJvdG90eXBlLm5pZnRpX21hdDMzX211bCA9IGZ1bmN0aW9uIChBLCBCKSB7XG4gICAgdmFyIEMgPSBbWzAsIDAsIDBdLCBbMCwgMCwgMF0sIFswLCAwLCAwXV0sXG4gICAgICAgIGksXG4gICAgICAgIGo7XG5cbiAgICBmb3IgKGkgPSAwOyBpIDwgMzsgaSArPSAxKSB7XG4gICAgICAgIGZvciAoaiA9IDA7IGogPCAzOyBqICs9IDEpIHtcbiAgICAgICAgICAgIENbaV1bal0gPSAgQVtpXVswXSAqIEJbMF1bal0gICsgQVtpXVsxXSAqIEJbMV1bal0gKyBBW2ldWzJdICogQlsyXVtqXTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBDO1xufTtcblxuXG5cbm5pZnRpLk5JRlRJMS5wcm90b3R5cGUubmlmdGlfbWF0MzNfZGV0ZXJtID0gZnVuY3Rpb24gKFIpIHtcbiAgICB2YXIgcjExLCByMTIsIHIxMywgcjIxLCByMjIsIHIyMywgcjMxLCByMzIsIHIzMztcbiAgICAvKiAgSU5QVVQgTUFUUklYOiAgKi9cbiAgICByMTEgPSBSWzBdWzBdO1xuICAgIHIxMiA9IFJbMF1bMV07XG4gICAgcjEzID0gUlswXVsyXTtcbiAgICByMjEgPSBSWzFdWzBdO1xuICAgIHIyMiA9IFJbMV1bMV07XG4gICAgcjIzID0gUlsxXVsyXTtcbiAgICByMzEgPSBSWzJdWzBdO1xuICAgIHIzMiA9IFJbMl1bMV07XG4gICAgcjMzID0gUlsyXVsyXTtcblxuICAgIHJldHVybiAocjExICogcjIyICogcjMzIC0gcjExICogcjMyICogcjIzIC0gcjIxICogcjEyICogcjMzICsgcjIxICogcjMyICogcjEzICsgcjMxICogcjEyICogcjIzIC0gcjMxICogcjIyICogcjEzKTtcbn07XG5cblxuLyoqXG4gKiBSZXR1cm5zIHRoZSBieXRlIGluZGV4IG9mIHRoZSBleHRlbnNpb24uXG4gKiBAcmV0dXJucyB7bnVtYmVyfVxuICovXG5uaWZ0aS5OSUZUSTEucHJvdG90eXBlLmdldEV4dGVuc2lvbkxvY2F0aW9uID0gZnVuY3Rpb24oKSB7XG4gICAgcmV0dXJuIG5pZnRpLk5JRlRJMS5NQUdJQ19DT09LSUUgKyA0O1xufTtcblxuXG4vKipcbiAqIFJldHVybnMgdGhlIGV4dGVuc2lvbiBzaXplLlxuICogQHBhcmFtIHtEYXRhVmlld30gZGF0YVxuICogQHJldHVybnMge251bWJlcn1cbiAqL1xubmlmdGkuTklGVEkxLnByb3RvdHlwZS5nZXRFeHRlbnNpb25TaXplID0gZnVuY3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BcIiArXG4gICAgICAgIHRoaXMuZGltc1swXSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuZGltc1sxXSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuZGltc1syXSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuZGltc1szXSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuZGltc1s0XSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuZGltc1s1XSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuZGltc1s2XSArIFwiLCBcIiArXG4gICAgICAgIHRoaXMuZGltc1s3XSArIFwiXFxuXCIpO1xuXG4gICAgc3RyaW5nICs9IChcIkludGVudCBQYXJhbWV0ZXJzICgxLTMpOiBcIiArXG4gICAgICAgIHRoaXMuaW50ZW50X3AxICsgXCIsIFwiICtcbiAgICAgICAgdGhpcy5pbnRlbnRfcDIgKyBcIiwgXCIgK1xuICAgICAgICB0aGlzLmludGVudF9wMykgKyBcIlxcblwiO1xuXG4gICAgc3RyaW5nICs9IChcIlZveGVsIERpbWVuc2lvbnMgKDEtOCk6IFwiICtcbiAgICAgICAgZm10KHRoaXMucGl4RGltc1swXSkgKyBcIiwgXCIgK1xuICAgICAgICBmbXQodGhpcy5waXhEaW1zWzFdKSArIFwiLCBcIiArXG4gICAgICAgIGZtdCh0aGlzLnBpeERpbXNbMl0pICsgXCIsIFwiICtcbiAgICAgICAgZm10KHRoaXMucGl4RGltc1szXSkgKyBcIiwgXCIgK1xuICAgICAgICBmbXQodGhpcy5waXhEaW1zWzRdKSArIFwiLCBcIiArXG4gICAgICAgIGZtdCh0aGlzLnBpeERpbXNbNV0pICsgXCIsIFwiICtcbiAgICAgICAgZm10KHRoaXMucGl4RGltc1s2XSkgKyBcIiwgXCIgK1xuICAgICAgICBmbXQodGhpcy5waXhEaW1zWzddKSArIFwiXFxuXCIpO1xuXG4gICAgc3RyaW5nICs9IChcIkltYWdlIE9mZnNldCA9IFwiICsgdGhpcy52b3hfb2Zmc2V0ICs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ICAgIGJyZWFrO1xuICAgICAgICBjYXNlIFwibGVmdC1hbnRlcmlvci1zdXBlcmlvci10aW1lXCI6XG4gICAgICAgIGNhc2UgXCJMQVNUXCI6XG4gICAgICAgICAgICBzcGFjZURpbWVuc2lvbiA9IDQ7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBcImxlZnQtcG9zdGVyaW9yLXN1cGVyaW9yLXRpbWVcIjpcbiAgICAgICAgY2FzZSBcIkxQU1RcIjpcbiAgICAgICAgICAgIHNwYWNlRGltZW5zaW9uID0gNDtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIFwic2Nhbm5lci14eXpcIjpcbiAgICAgICAgICAgIHNwYWNlRGltZW5zaW9uID0gMztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIFwic2Nhbm5lci14eXotdGltZVwiOlxuICAgICAgICAgICAgc3BhY2VEaW1lbnNpb24gPSA0O1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgXCIzRC1yaWdodC1oYW5kZWRcIjpcbiAgICAgICAgICAgIHNwYWNlRGltZW5zaW9uID0gMztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIFwiM0QtbGVmdC1oYW5kZWRcIjpcbiAgICAgICAgICAgIHNwYWNlRGltZW5zaW9uID0gMztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIFwiM0QtcmlnaHQtaGFuZGVkLXRpbWVcIjpcbiAgICAgICAgICAgIHNwYWNlRGltZW5zaW9uID0gNDtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIFwiM0QtbGVmdC1oYW5kZWQtdGltZVwiOlxuICAgICAgICAgICAgc3BhY2VEaW1lbnNpb24gPSA0O1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICBjb25zb2xlLndhcm4oXCJVbnJlY29nbml6ZWQgc3BhY2U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YW1lcy5cbiAgICAgICAgICAgICAgICBpZiAobWF0Y2gyLmxlbmd0aCA9PSAyICYmIG1hdGNoMlsxXSkgeyAvLyBzdWJkaW0gc3BlY2lmaWNhdGlvblxuICAgICAgICAgICAgICAgICAgICByZXRbbWF0Y2hbMV1dID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgZmlsZXM6IGxpbmVzLnNsaWNlKGkrMSksXG4gICAgICAgICAgICAgICAgICAgICAgICBzdWJkaW06IHBhcnNlTlJSREludGVnZXIobWF0Y2gyWzFdKVxuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldFttYXRjaFsxXV0gPSBsaW5lcy5zbGljZShpKzEpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBsaW5lcy5sZW5ndGggPSBpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXRbbWF0Y2hbMV1dID0gcGFyc2VGaWVsZChtYXRjaFsxXSwgbWF0Y2hbM10pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKG1hdGNoWzJdID09ICc6PScpIHsgLy8gS2V5L3ZhbHVlIHBhaXJcbiAgICAgICAgICAgIHJldC5rZXlzW21hdGNoWzFdXSA9IHVuZXNjYXBlVmFsdWUobWF0Y2hbM10pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiTG9naWMgZXJyb3IgaW4gTlJSRCBwYXJzZXIuXCIpOyAvLyBUaGlzIHNob3VsZCBuZXZlciBoYXBwZW4gKHVubGVzcyB0aGUgTlJSRCBzeW50YXggaXMgZXh0ZW5kZWQgYW5kIHRoZSByZWdleHAgaXMgdXBkYXRlZCwgYnV0IHRoaXMgc2VjdGlvbiBpcyBub3QsIG9yIHNvbWUgb3RoZXIgcHJvZ3JhbW1lciBlcnJvcikuXG4gICAgICAgIH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gICAgICAgY2hlY2tTaXplKDQpO1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBJbnQzMkFycmF5KGJ1ZmZlci5zbGljZSgwLHRvdGFsTGVuKjQpKTtcbiAgICAgICAgY2FzZSBcInVpbnQzMlwiOlxuICAgICAgICAgICAgY2hlY2tTaXplKDQpO1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBVaW50MzJBcnJheShidWZmZXIuc2xpY2UoMCx0b3RhbExlbio0KSk7XG4gICAgICAgIC8vY2FzZSBcImludDY0XCI6XG4gICAgICAgIC8vICAgIGNoZWNrU2l6ZSg4KTtcbiAgICAgICAgLy8gICAgcmV0dXJuIG5ldyBJbnQ2NEFycmF5KGJ1ZmZlci5zbGljZSgwLHRvdGFsTGVuKjgpKTtcbiAgICAgICAgLy9jYXNlIFwidWludDY0XCI6XG4gICAgICAgIC8vICAgIGNoZWNrU2l6ZSg4KTtcbiAgICAgICAgLy8gICAgcmV0dXJuIG5ldyBVaW50NjRBcnJheShidWZmZXIuc2xpY2UoMCx0b3RhbExlbio4KSk7XG4gICAgICAgIGNhc2UgXCJmbG9hdFwiOlxuICAgICAgICAgICAgY2hlY2tTaXplKDQpO1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBGbG9hdDMyQXJyYXkoYnVmZmVyLnNsaWNlKDAsdG90YWxMZW4qNCkpO1xuICAgICAgICBjYXNlIFwiZG91YmxlXCI6XG4gICAgICAgICAgICBjaGVja1NpemUoOCk7XG4gICAgICAgICAgICByZXR1cm4gbmV3IEZsb2F0NjRBcnJheShidWZmZXIuc2xpY2UoMCx0b3RhbExlbio4KSk7XG4gICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICBjb25zb2xlLndhcm4oXCJVbnN1cHBvcnRlZCBOUlJEIHR5cGU6IFwiICsgdHlwZSArIFwiLCByZXR1cm5pbmcgcmF3IGJ1ZmZlci5cIik7XG4gICAgICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgICAgICB9XG4gICAgfS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TGVuOyBpKyspIHtcbiAgICAgICAgICAgICAgICBhcnJbaV0gPSB2aWV3LmdldFVpbnQ4KGkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGFycjtcbiAgICAgICAgY2FzZSBcImludDE2XCI6XG4gICAgICAgICAgICBhcnIgPSBuZXcgSW50MTZBcnJheSh0b3RhbExlbik7XG4gICAgICAgICAgICBmb3IoaT0wOyBpPHRvdGFsTGVuOyBpKyspIHtcbiAgICAgICAgICAgICAgICBhcnJbaV0gPSB2aWV3LmdldEludDE2KGkqMik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gYXJyO1xuICAgICAgICBjYXNlIFwidWludDE2XCI6XG4gICAgICAgICAgICBhcnIgPSBuZXcgVWludDE2QXJyYXkodG90YWxMZW4pO1xuICAgICAgICAgICAgZm9yKGk9MDsgaTx0b3RhbExlbjsgaSsrKSB7XG4gICAgICAgICAgICAgICAgYXJyW2ldID0gdmlldy5nZXRVaW50MTYoaSoyKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBhcnI7XG4gICAgICAgIGNhc2UgXCJpbnQzMlwiOlxuICAgICAgICAgICAgYXJyID0gbmV3IEludDMyQXJyYXkodG90YWxMZW4pO1xuICAgICAgICAgICAgZm9yKGk9MDsgaTx0b3RhbExlbjsgaSsrKSB7XG4gICAgICAgICAgICAgICAgYXJyW2ldID0gdmlldy5nZXRJbnQzMihpKjQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGFycjtcbiAgICAgICAgY2FzZSBcInVpbnQzMlwiOlxuICAgICAgICAgICAgYXJyID0gbmV3IFVpbnQzMkFycmF5KHRvdGFsTGVuKTtcbiAgICAgICAgICAgIGZvcihpPTA7IGk8dG90YWxMZW47IGkrKykge1xuICAgICAgICAgICAgICAgIGFycltpXSA9IHZpZXcuZ2V0VWludDMyKGkqNCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gYXJyO1xuICAgICAgICAvL2Nhc2UgXCJpbnQ2NFwiOlxuICAgICAgICAvLyAgICBhcnIgPSBuZXcgSW50NjRBcnJheSh0b3RhbExlbik7XG4gICAgICAgIC8vICAgIGZvcihpPTA7IGk8dG90YWxMZW47IGkrKykge1xuICAgICAgICAvLyAgICAgICAgYXJyW2ldID0gdmlldy5nZXRJbnQ2NChpKjgpO1xuICAgICAgICAvLyAgICB9XG4gICAgICAgIC8vICAgIHJldHVybiBhcnI7XG4gICAgICAgIC8vY2FzZSBcInVpbnQ2NFwiOlxuICAgICAgICAvLyAgICBhcnIgPSBuZXcgVWludDY0QXJyYXkodG90YWxMZW4pO1xuICAgICAgICAvLyAgICBmb3IoaT0wOyBpPHRvdGFsTGVuOyBpKyspIHtcbiAgICAgICAgLy8gICAgICAgIGFycltpXSA9IHZpZXcuZ2V0VWludDY0KGkqOCk7XG4gICAgICAgIC8vICAgIH1cbiAgICAgICAgLy8gICAgcmV0dXJuIGFycjtcbiAgICAgICAgY2FzZSBcImZsb2F0XCI6XG4gICAgICAgICAgICBhcnIgPSBuZXcgRmxvYXQzMkFycmF5KHRvdGFsTGVuKTtcbiAgICAgICAgICAgIGZvcihpPTA7IGk8dG90YWxMZW47IGkrKykge1xuICAgICAgICAgICAgICAgIGFycltpXSA9IHZpZXcuZ2V0RmxvYXQzMihpKjQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGFycjtcbiAgICAgICAgY2FzZSBcImRvdWJsZVwiOlxuICAgICAgICAgICAgYXJyID0gbmV3IEZsb2F0NjRBcnJheSh0b3RhbExlbik7XG4gICAgICAgICAgICBmb3IoaT0wOyBpPHRvdGFsTGVuOyBpKyspIHtcbiAgICAgICAgICAgICAgICBhcnJbaV0gPSB2aWV3LmdldEZsb2F0NjQoaSo4KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBhcnI7XG4gICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICBjb25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uICAgIHJldHVybiBidWZmZXI7XG59XG4iLCIvLyBUb3AgbGV2ZWwgZmlsZSBpcyBqdXN0IGEgbWl4aW4gb2Ygc3VibW9kdWxlcyAmIGNvbnN0YW50c1xuJ3VzZSBzdHJpY3QnO1xuXG52YXIgYXNzaWduICAgID0gcmVxdWlyZSgnLi9saWIvdXRpbHMvY29tbW9uJykuYXNzaWduO1xuXG52YXIgZGVmbGF0ZSAgID0gcmVxdWlyZSgnLi9saWIvZGVmbGF0ZScpO1xudmFyIGluZmxhdGUgICA9IHJlcXVpcmUoJy4vbGliL2luZmxhdGUnKTtcbnZhciBjb25zdGFudHMgPSByZXF1aXJlKCcuL2xpYi96bGliL2NvbnN0YW50cycpO1xuXG52YXIgcGFrbyA9IHt9O1xuXG5hc3NpZ24ocGFrbywgZGVmbGF0ZSwgaW5mbGF0ZSwgY29uc3RhbnRzKTtcblxubW9kdWxlLmV4cG9ydHMgPSBwYWtvO1xuIiwiJ3VzZSBzdHJpY3QnO1xuXG5cbnZhciB6bGliX2RlZmxhdGUgPSByZXF1aXJlKCcuL3psaWIvZGVmbGF0ZScpO1xudmFyIHV0aWxzICAgICAgICA9IHJlcXVpcmUoJy4vdXRpbHMvY29tbW9uJyk7XG52YXIgc3RyaW5ncyAgICAgID0gcmVxdWlyZSgnLi91dGlscy9zdHJpbmdzJyk7XG52YXIgbXNnICAgICAgICAgID0gcmVxdWlyZSgnLi96bGliL21lc3NhZ2VzJyk7XG52YXIgWlN0cmVhbSAgICAgID0gcmVxdWlyZSgnLi96bGliL3pzdHJlYW0nKTtcblxudmFyIHRvU3RyaW5nID0gT2JqZWN0LnByb3RvdHlwZS50b1N0cmluZztcblxuLyogUHVibGljIGNvbnN0YW50cyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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gICAgICAgICAgICAgICAgICAgICghcy5nemhlYWQubmFtZSA/IDAgOiA4KSArXG4gICAgICAgICAgICAgICAgICAgICghcy5nemhlYWQuY29tbWVudCA/IDAgOiAxNilcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICBwdXRfYnl0ZShzLCBzLmd6aGVhZC50aW1lICYgMHhmZik7XG4gICAgICAgIHB1dF9ieXRlKHMsIChzLmd6aGVhZC50aW1lID4+IDgpICYgMHhmZik7XG4gICAgICAgIHB1dF9ieXRlKHMsIChzLmd6aGVhZC50aW1lID4+IDE2KSAmIDB4ZmYpO1xuICAgICAgICBwdXRfYnl0ZShzLCAocy5nemhlYWQudGltZSA+PiAyNCkgJiAweGZmKTtcbiAgICAgICAgcHV0X2J5dGUocywgcy5sZXZlbCA9PT0gOSA/IDIgOlxuICAgICAgICAgICAgICAgICAgICAocy5zdHJhdGVneSA+PSBaX0hVRkZNQU5fT05MWSB8fCBzLmxldmVsIDwgMiA/XG4gICAgICAgICAgICAgICAgICAgICA0IDogMCkpO1xuICAgICAgICBwdXRfYnl0ZShzLCBzLmd6aGVhZC5vcyAmIDB4ZmYpO1xuICAgICAgICBpZiAocy5nemhlYWQuZXh0cmEgJiYgcy5nemhlYWQuZXh0cmEubGVuZ3RoKSB7XG4gICAgICAgICAgcHV0X2J5dGUocywgcy5nemhlYWQuZXh0cmEubGVuZ3RoICYgMHhmZik7XG4gICAgICAgICAgcHV0X2J5dGUocywgKHMuZ3poZWFkLmV4dHJhLmxlbmd0aCA+PiA4KSAmIDB4ZmYpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChzLmd6aGVhZC5oY3JjKSB7XG4gICAgICAgICAgc3RybS5hZGxlciA9IGNyYzMyKHN0cm0uYWRsZXIsIHMucGVuZGluZ19idWYsIHMucGVuZGluZywgMCk7XG4gICAgICAgIH1cbiAgICAgICAgcy5nemluZGV4ID0gMDtcbiAgICAgICAgcy5zdGF0dXMgPSBFWFRSQV9TVEFURTtcbiAgICAgIH1cbiA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QXQocy5nemluZGV4KyspICYgMHhmZjtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB2YWwgPSAwO1xuICAgICAgICB9XG4gICAgICAgIHB1dF9ieXRlKHMsIHZhbCk7XG4gICAgICB9IHdoaWxlICh2YWwgIT09IDApO1xuXG4gICAgICBpZiAocy5nemhlYWQuaGNyYyAmJiBzLnBlbmRpbmcgPiBiZWcpIHtcbiAgICAgICAgc3RybS5hZGxlciA9IGNyYzMyKHN0cm0uYWRsZXIsIHMucGVuZGluZ19idWYsIHMucGVuZGluZyAtIGJlZywgYmVnKTtcbiAgICAgIH1cbiAgICAgIGlmICh2YWwgPT09IDApIHtcbiAgICAgICAgcy5nemluZGV4ID0gMDtcbiAgICAgICAgcy5zdGF0dXMgPSBDT01NRU5UX1NUQVRFO1xuICAgICAgfVxuICAgIH1cbiAgICBlbHNlIHtcbiAgICAgIHMuc3RhdHVzID0gQ09NTUVOVF9TVEFURTtcbiAgICB9XG4gIH1cbiAgaWYgKHMuc3RhdHVzID09PSBDT01NRU5UX1NUQVRFKSB7XG4gICAgaWYgKHMuZ3poZWFkLmNvbW1lbnQvKiAhPSBaX05VTEwqLykge1xuICAgICAgYmVnID0gcy5wZW5kaW5nOyAgLyogc3RhcnQgb2YgYnl0ZXMgdG8gdXBkYXRlIGNyYyAqL1xuICAgICAgLy9pbnQgdmFsO1xuXG4gICAgICBkbyB7XG4gICAgICAgIGlmIChzLnBlbmRpbmcgPT09IHMucGVuZGluZ19idWZfc2l6ZSkge1xuICAgICAgICAgIGlmIChzLmd6aGVhZC5oY3JjICYmIHMucGVuZGluZyA+IGJlZykge1xuICAgICAgICAgICAgc3RybS5hZGxlciA9IGNyYzMyKHN0cm0uYWRsZXIsIHMucGVuZGluZ19idWYsIHMucGVuZGluZyAtIGJlZywgYmVnKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgZmx1c2hfcGVuZGluZyhzdHJtKTtcbiAgICAgICAgICBiZWcgPSBzLnBlbmRpbmc7XG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IgWl9GVUxMX0ZMVVNIICAgID0gMztcbnZhciBaX0ZJTklTSCAgICAgICAgPSA0O1xudmFyIFpfQkxPQ0sgICAgICAgICA9IDU7XG52YXIgWl9UUkVFUyAgICAgICAgID0gNjtcblxuXG4vKiBSZXR1cm4gY29kZXMgZm9yIHRoZSBjb21wcmVzc2lvbi9kZWNvbXByZXNzaW9uIGZ1bmN0aW9ucy4gTmVnYXRpdmUgdmFsdWVzXG4gKiBhcmUgZXJyb3JzLCBwb3NpdGl2ZSB2YWx1ZXMgYXJlIHVzZWQgZm9yIHNwZWNpYWwgYnV0IG5vcm1hbCBldmVudHMuXG4gKi9cbnZhciBaX09LICAgICAgICAgICAgPSAwO1xudmFyIFpfU1RSRUFNX0VORCAgICA9IDE7XG52YXIgWl9ORUVEX0RJQ1QgICAgID0gMjtcbi8vdmFyIFpfRVJSTk8gICAgICAgICA9IC0xO1xudmFyIFpfU1RSRUFNX0VSUk9SICA9IC0yO1xudmFyIFpfREFUQV9FUlJPUiAgICA9IC0zO1xudmFyIFpfTUVNX0VSUk9SICAgICA9IC00O1xudmFyIFpfQlVGX0VSUk9SICAgICA9IC01O1xuLy92YXIgWl9WRVJTSU9OX0VSUk9SID0gLTY7XG5cbi8qIFRoZSBkZWZsYXRlIGNvbXByZXNzaW9uIG1ldGhvZCAqL1xudmFyIFpfREVGTEFURUQgID0gODtcblxuXG4vKiBTVEFURVMgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cblxuXG52YXIgICAgSEVBRCA9IDE7ICAgICAgIC8qIGk6IHdhaXRpbmcgZm9yIG1hZ2ljIGhlYWRlciAqL1xudmFyICAgIEZMQUdTID0gMjsgICAgICAvKiBpOiB3YWl0aW5nIGZvciBtZXRob2QgYW5kIGZs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NDsgICAgLyogaTogd2FpdGluZyBmb3Igc3RvcmVkIHNpemUgKGxlbmd0aCBhbmQgY29tcGxlbWVudCkgKi9cbnZhciAgICAgICAgQ09QWV8gPSAxNTsgICAgIC8qIGkvbzogc2FtZSBhcyBDT1BZIGJlbG93LCBidXQgb25seSBmaXJzdCB0aW1lIGluICovXG52YXIgICAgICAgIENPUFkgPSAxNjsgICAgICAvKiBpL286IHdhaXRpbmcgZm9yIGlucHV0IG9yIG91dHB1dCB0byBjb3B5IHN0b3JlZCBibG9jayAqL1xudmFyICAgICAgICBUQUJMRSA9IDE3OyAgICAgLyogaTogd2FpdGluZyBmb3IgZHluYW1pYyBibG9jayB0YWJsZSBsZW5ndGhzICovXG52YXIgICAgICAgIExFTkxFTlMgPSAxODsgICAvKiBpOiB3YWl0aW5nIGZvciBjb2RlIGxlbmd0aCBjb2RlIGxlbmd0aHMgKi9cbnZhciAgICAgICAgQ09ERUxFTlMgPSAxOTsgIC8qIGk6IHdhaXRpbmcgZm9yIGxlbmd0aC9saXQgYW5kIGRpc3RhbmNlIGNvZGUgbGVuZ3RocyAqL1xudmFyICAgICAgICAgICAgTEVOXyA9IDIwOyAgICAgIC8qIGk6IHNhbWUgYXMgTEVOIGJlbG93LCBidXQgb25seSBmaXJzdCB0aW1lIGluICovXG52YXIgICAgICAgICAgICBMRU4gPSAyMTsgICAgICAgLyogaTogd2FpdGluZyBmb3IgbGVuZ3RoL2xpdC9lb2IgY29kZSAqL1xudmFyICAgICAgICAgICAgTEVORVhUID0gMjI7ICAgIC8qIGk6IHdhaXRpbmcgZm9yIGxlbmd0aCBleHRyYSBiaXRzICovXG52YXIgICAgICAgICAgICBESVNUID0gMjM7ICAgICAgLyogaTogd2FpdGluZyBmb3IgZGlzdGFuY2UgY29kZSAqL1xudmFyICAgICAgICAgICAgRElTVEVYVCA9IDI0OyAgIC8qIGk6IHdhaXRpbmcgZm9yIGRpc3RhbmNlIGV4dHJhIGJpdHMgKi9cbnZhciAgICAgICAgICA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ICAgLy89PT0gQ1JDMihzdGF0ZS5jaGVjaywgaG9sZCk7XG4gICAgICAgIGhidWZbMF0gPSBob2xkICYgMHhmZjtcbiAgICAgICAgaGJ1ZlsxXSA9IChob2xkID4+PiA4KSAmIDB4ZmY7XG4gICAgICAgIHN0YXRlLmNoZWNrID0gY3JjMzIoc3RhdGUuY2hlY2ssIGhidWYsIDIsIDApO1xuICAgICAgICAvLz09PS8vXG5cbiAgICAgICAgLy89PT0gSU5JVEJJVFMoKTtcbiAgICAgICAgaG9sZCA9IDA7XG4gICAgICAgIGJpdHMgPSAwO1xuICAgICAgICAvLz09PS8vXG4gICAgICAgIHN0YXRlLm1vZGUgPSBGTEFHUztcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICBzdGF0ZS5mbGFncyA9IDA7ICAgICAgICAgICAvKiBleHBlY3QgemxpYiBoZWFkZXIgKi9cbiAgICAgIGlmIChzdGF0ZS5oZWFkKSB7XG4gICAgICAgIHN0YXRlLmhlYWQuZG9uZSA9IGZhbHNlO1xuICAgICAgfVxuICAgICAgaWYgKCEoc3RhdGUud3JhcCAmIDEpIHx8ICAgLyogY2hlY2sgaWYgemxpYiBoZWFkZXIgYWxsb3dlZCAqL1xuICAgICAgICAoKChob2xkICYgMHhmZikvKkJJVFMoOCkqLyA8PCA4KSArIChob2xkID4+IDgpKSAlIDMxKSB7XG4gICAgICAgIHN0cm0ubXNnID0gJ2luY29ycmVjdCBoZWFkZXIgY2hlY2snO1xuICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICBicmVhaztcbiAgICAgIH1cbiAgICAgIGlmICgoaG9sZCAmIDB4MGYpLypCSVRTKDQpKi8gIT09IFpfREVGTEFURUQpIHtcbiAgICAgICAgc3RybS5tc2cgPSAndW5rbm93biBjb21wcmVzc2lvbiBtZXRob2QnO1xuICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICBicmVhaztcbiAgICAgIH1cbiAgICAgIC8vLS0tIERST1BCSVRTKDQpIC0tLS8vXG4gICAgICBob2xkID4+Pj0gNDtcbiAgICAgIGJpdHMgLT0gNDtcbiAgICAgIC8vLS0tLy9cbiAgICAgIGxlbiA9IChob2xkICYgMHgwZikvKkJJVFMoNCkqLyArIDg7XG4gICAgICBpZiAoc3RhdGUud2JpdHMgPT09IDApIHtcbiAgICAgICAgc3RhdGUud2JpdHMgPSBsZW47XG4gICAgICB9XG4gICAgICBlbHNlIGlmIChsZW4gPiBzdGF0ZS53Yml0cykge1xuICAgICAgICBzdHJtLm1zZyA9ICdpbnZhbGlkIHdpbmRvdyBzaXplJztcbiAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICBzdGF0ZS5kbWF4ID0gMSA8PCBsZW47XG4gICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgemxpYiBoZWFkZXIgb2tcXG5cIikpO1xuICAgICAgc3RybS5hZGxlciA9IHN0YXRlLmNoZWNrID0gMS8qYWRsZXIzMigwTCwgWl9OVUxMLCAwKSovO1xuICAgICAgc3RhdGUubW9kZSA9IGhvbGQgJiAweDIwMCA/IERJQ1RJRCA6IFRZUEU7XG4gICAgICAvLz09PSBJTklUQklUUygpO1xuICAgICAgaG9sZCA9IDA7XG4gICAgICBiaXRzID0gMDtcbiAgICAgIC8vPT09Ly9cbiAgICAgIGJyZWFrO1xuICAgIGNhc2UgRkxBR1M6XG4gICAgICAvLz09PSBORUVEQklUUygxNik7ICovXG4gICAgICB3aGlsZSAoYml0cyA8IDE2KSB7XG4gICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICBoYXZlLS07XG4gICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICBiaXRzICs9IDg7XG4gICAgICB9XG4gICAgICAvLz09PS8vXG4gICAgICBzdGF0ZS5mbGFncyA9IGh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gfVxuICAgICAgICBoYXZlLS07XG4gICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICBiaXRzICs9IDg7XG4gICAgICB9XG4gICAgICAvLz09PS8vXG4gICAgICBpZiAoc3RhdGUuaGVhZCkge1xuICAgICAgICBzdGF0ZS5oZWFkLnRpbWUgPSBob2xkO1xuICAgICAgfVxuICAgICAgaWYgKHN0YXRlLmZsYWdzICYgMHgwMjAwKSB7XG4gICAgICAgIC8vPT09IENSQzQoc3RhdGUuY2hlY2ssIGhvbGQpXG4gICAgICAgIGhidWZbMF0gPSBob2xkICYgMHhmZjtcbiAgICAgICAgaGJ1ZlsxXSA9IChob2xkID4+PiA4KSAmIDB4ZmY7XG4gICAgICAgIGhidWZbMl0gPSAoaG9sZCA+Pj4gMTYpICYgMHhmZjtcbiAgICAgICAgaGJ1ZlszXSA9IChob2xkID4+PiAyNCkgJiAweGZmO1xuICAgICAgICBzdGF0ZS5jaGVjayA9IGNyYzMyKHN0YXRlLmNoZWNrLCBoYnVmLCA0LCAwKTtcbiAgICAgICAgLy89PT1cbiAgICAgIH1cbiAgICAgIC8vPT09IElOSVRCSVRTKCk7XG4gICAgICBob2xkID0gMDtcbiAgICAgIGJpdHMgPSAwO1xuICAgICAgLy89PT0vL1xuICAgICAgc3RhdGUubW9kZSA9IE9TO1xuICAgICAgLyogZmFsbHMgdGhyb3VnaCAqL1xuICAgIGNhc2UgT1M6XG4gICAgICAvLz09PSBORUVEQklUUygxNik7ICovXG4gICAgICB3aGlsZSAoYml0cyA8IDE2KSB7XG4gICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICBoYXZlLS07XG4gICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICBiaXRzICs9IDg7XG4gICAgICB9XG4gICAgICAvLz09PS8vXG4gICAgICBpZiAoc3RhdGUuaGVhZCkge1x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G5ldyBBcnJheShzdGF0ZS5oZWFkLmV4dHJhX2xlbik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB1dGlscy5hcnJheVNldChcbiAgICAgICAgICAgICAgc3RhdGUuaGVhZC5leHRyYSxcbiAgICAgICAgICAgICAgaW5wdXQsXG4gICAgICAgICAgICAgIG5leHQsXG4gICAgICAgICAgICAgIC8vIGV4dHJhIGZpZWxkIGlzIGxpbWl0ZWQgdG8gNjU1MzYgYnl0ZXNcbiAgICAgICAgICAgICAgLy8gLSBubyBuZWVkIGZvciBhZGRpdGlvbmFsIHNpemUgY2hlY2tcbiAgICAgICAgICAgICAgY29weSxcbiAgICAgICAgICAgICAgLypsZW4gKyBjb3B5ID4gc3RhdGUuaGVhZC5leHRyYV9tYXggLSBsZW4gPyBzdGF0ZS5oZWFkLmV4dHJhX21heCA6IGNvcHksKi9cbiAgICAgICAgICAgICAgbGVuXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgLy96bWVtY3B5KHN0YXRlLmhlYWQuZXh0cmEgKyBsZW4sIG5leHQsXG4gICAgICAgICAgICAvLyAgICAgICAgbGVuICsgY29weSA+IHN0YXRlLmhlYWQuZXh0cmFfbWF4ID9cbiAgICAgICAgICAgIC8vICAgICAgICBzdGF0ZS5oZWFkLmV4dHJhX21heCAtIGxlbiA6IGNvcHkpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoc3RhdGUuZmxhZ3MgJiAweDAyMDApIHtcbiAgICAgICAgICAgIHN0YXRlLmNoZWNrID0gY3JjMzIoc3RhdGUuY2hlY2ssIGlucHV0LCBjb3B5LCBuZXh0KTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaGF2ZSAtPSBjb3B5O1xuICAgICAgICAgIG5leHQgKz0gY29weTtcbiAgICAgICAgICBzdGF0ZS5sZW5ndGggLT0gY29weTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoc3RhdGUubGVuZ3RoKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuIC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LmNvbW1lbnQgPSBudWxsO1xuICAgICAgfVxuICAgICAgc3RhdGUubW9kZSA9IEhDUkM7XG4gICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgY2FzZSBIQ1JDOlxuICAgICAgaWYgKHN0YXRlLmZsYWdzICYgMHgwMjAwKSB7XG4gICAgICAgIC8vPT09IE5FRURCSVRTKDE2KTsgKi9cbiAgICAgICAgd2hpbGUgKGJpdHMgPCAxNikge1xuICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgIH1cbiAgICAgICAgLy89PT0vL1xuICAgICAgICBpZiAoaG9sZCAhPT0gKHN0YXRlLmNoZWNrICYgMHhmZmZmKSkge1xuICAgICAgICAgIHN0cm0ubXNnID0gJ2hlYWRlciBjcmMgbWlzbWF0Y2gnO1xuICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgLy89PT0gSU5JVEJJVFMoKTtcbiAgICAgICAgaG9sZCA9IDA7XG4gICAgICAgIGJpdHMgPSAwO1xuICAgICAgICAvLz09PS8vXG4gICAgICB9XG4gICAgICBpZiAoc3RhdGUuaGVhZCkge1xuICAgICAgICBzdGF0ZS5oZWFkLmhjcmMgPSAoKHN0YXRlLmZsYWdzID4+IDkpICYgMSk7XG4gICAgICAgIHN0YXRlLmhlYWQuZG9uZSA9IHRydWU7XG4gICAgICB9XG4gICAgICBzdHJtLmFkbGVyID0gc3RhdGUuY2hlY2sgPSAwO1xuICAgICAgc3RhdGUubW9kZSA9IFRZUEU7XG4gICAgICBicmVhaztcbiAgICBjYXNlIERJQ1RJRDpcbiAgICAgIC8vPT09IE5FRURCSVRTKDMyKTsgKi9cbiAgICAgIHdoaW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7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgLyogZmFsbHMgdGhyb3VnaCAqL1xuICAgIGNhc2UgVFlQRURPOlxuICAgICAgaWYgKHN0YXRlLmxhc3QpIHtcbiAgICAgICAgLy8tLS0gQllURUJJVFMoKSAtLS0vL1xuICAgICAgICBob2xkID4+Pj0gYml0cyAmIDc7XG4gICAgICAgIGJpdHMgLT0gYml0cyAmIDc7XG4gICAgICAgIC8vLS0tLy9cbiAgICAgICAgc3RhdGUubW9kZSA9IENIRUNLO1xuICAgICAgICBicmVhaztcbiAgICAgIH1cbiAgICAgIC8vPT09IE5FRURCSVRTKDMpOyAqL1xuICAgICAgd2hpbGUgKGJpdHMgPCAzKSB7XG4gICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICBoYXZlLS07XG4gICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICBiaXRzICs9IDg7XG4gICAgICB9XG4gICAgICAvLz09PS8vXG4gICAgICBzdGF0ZS5sYXN0ID0gKGhvbGQgJiAweDAxKS8qQklUUygxKSovO1xuICAgICAgLy8tLS0gRFJPUEJJVFMoMSkgLS0tLy9cbiAgICAgIGhvbGQgPj4+PSAxO1xuICAgICAgYml0cyAtPSAxO1xuICAgICAgLy8tLS0vL1xuXG4gICAgICBzd2l0Y2ggKChob2xkICYgMHgwMykvKkJJVFMoMikqLykge1xuICAgICAgY2FzZSAwOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogc3RvcmVkIGJsb2NrICovXG4gICAgICAgIC8vVHJhY2V2KChzdGRlcnIsIFwiaW5mbGF0ZTogICAgIHN0b3JlZCBibG9jayVzXFxuXCIsXG4gICAgICAgIC8vICAgICAgICBzdGF0ZS5sYXN0ID8gXCIgKGxhc3QpXCIgOiBcIlwiKSk7XG4gICAgICAgIHN0YXRlLm1vZGUgPSBTVE9SRUQ7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAxOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZml4ZWQgYmxvY2sgKi9cbiAgICAgICAgZml4ZWR0YWJsZXMoc3RhdGUpO1xuICAgICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgICBmaXhlZCBjb2RlcyBibG9jayVzXFxuXCIsXG4gICAgICAgIC8vICAgICAgICBzdGF0ZS5sYXN0ID8gXCIgKGxhc3QpXCIgOiBcIlwiKSk7XG4gICAgICAgIHN0YXRlLm1vZGUgPSBMRU5fOyAgICAgICAgICAgICAvKiBkZWNvZGUgY29kZXMgKi9cbiAgICAgICAgaWYgKGZsdXNoID09PSBaX1RSRUVTKSB7XG4gICAgICAgICAgLy8tLS0gRFJPUEJJVFMoMikgLS0tLy9cbiAgICAgICAgICBob2xkID4+Pj0gMjtcbiAgICAgICAgICBiaXRzIC09IDI7XG4gICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgIGJyZWFrIGluZl9sZWF2ZTtcbiAgICAgICAgfVxuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgMjogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGR5bmFtaWMgYmxvY2sgKi9cbiAgICAgICAgLy9UcmFjZXYoKHN0ZGVyciwgXCJpbmZsYXRlOiAgICAgZHluYW1pYyBjb2RlcyBibG9jayVzXFxuXCIsXG4gICAgICAgIC8vICAgICAgICBzdGF0ZS5sYXN0ID8gXCIgKGxhc3QpXCIgOiBcIlwiKSk7XG4gICAgICAgIHN0YXRlLm1vZGUgPSBUQUJMRTtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIDM6XG4gICAgICAgIHN0cm0ubXNnID0gJ2ludmFsaWQgYmxvY2sgdHlwZSc7XG4gICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICB9XG4gICAgICAvLy0tLSBEUk9QQklUUygyKSAtLS0vL1xuICAgICAgaG9sZCA+Pj49IDI7XG4gICA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gIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAvLy0tLS8vXG4gICAgICAgIH1cbiAgICAgICAgaWYgKGhlcmVfdmFsIDwgMTYpIHtcbiAgICAgICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICAgICAgaG9sZCA+Pj49IGhlcmVfYml0cztcbiAgICAgICAgICBiaXRzIC09IGhlcmVfYml0cztcbiAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgc3RhdGUubGVuc1tzdGF0ZS5oYXZlKytdID0gaGVyZV92YWw7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgaWYgKGhlcmVfdmFsID09PSAxNikge1xuICAgICAgICAgICAgLy89PT0gTkVFREJJVFMoaGVyZS5iaXRzICsgMik7XG4gICAgICAgICAgICBuID0gaGVyZV9iaXRzICsgMjtcbiAgICAgICAgICAgIHdoaWxlIChiaXRzIDwgbikge1xuICAgICAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICAgICAgaGF2ZS0tO1xuICAgICAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy89PT0vL1xuICAgICAgICAgICAgLy8tLS0gRFJPUEJJVFMoaGVyZS5iaXRzKSAtLS0vL1xuICAgICAgICAgICAgaG9sZCA+Pj49IGhlcmVfYml0cztcbiAgICAgICAgICAgIGJpdHMgLT0gaGVyZV9iaXRzO1xuICAgICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgICAgaWYgKHN0YXRlLmhhdmUgPT09IDApIHtcbiAgICAgICAgICAgICAgc3RybS5tc2cgPSAnaW52YWxpZCBiaXQgbGVuZ3RoIHJlcGVhdCc7XG4gICAgICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGVuID0gc3RhdGUubGVuc1tzdGF0ZS5oYXZlIC0gMV07XG4gICAgICAgICAgICBjb3B5ID0gMyArIChob2xkICYgMHgwMyk7Ly9CSVRTKDIpO1xuICAgICAgICAgICAgLy8tLS0gRFJPUEJJVFMoMikgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSAyO1xuICAgICAgICAgICAgYml0cyAtPSAyO1xuICAgICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgIH1cbiAgICAgICAgICBlbHNlIGlmIChoZXJlX3ZhbCA9PT0gMTcpIHtcbiAgICAgICAgICAgIC8vPT09IE5FRURCSVRTKGhlcmUuYml0cyArIDMpO1xuICAgICAgICAgICAgbiA9IGhlcmVfYml0cyArIDM7XG4gICAgICAgICAgICB3aGlsZSAoYml0cyA8IG4pIHtcbiAgICAgICAgICAgICAgaWYgKGhhdmUgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vPT09Ly9cbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKGhlcmUuYml0cykgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSBoZXJlX2JpdHM7XG4gICAgICAgICAgICBiaXRzIC09IGhlcmVfYml0cztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICAgIGxlbiA9IDA7XG4gICAgICAgICAgICBjb3B5ID0gMyArIChob2xkICYgMHgwNyk7Ly9CSVRTKDMpO1xuICAgICAgICAgICAgLy8tLS0gRFJPUEJJVFMoMykgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSAzO1xuICAgICAgICAgICAgYml0cyAtPSAzO1xuICAgICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgIH1cbiAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIC8vPT09IE5FRURCSVRTKGhlcmUuYml0cyArIDcpO1xuICAgICAgICAgICAgbiA9IGhlcmVfYml0cyArIDc7XG4gICAgICAgICAgICB3aGlsZSAoYml0cyA8IG4pIHtcbiAgICAgICAgICAgICAgaWYgKGhhdmUgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vPT09Ly9cbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKGhlcmUuYml0cykgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSBoZXJlX2JpdHM7XG4gICAgICAgICAgICBiaXRzIC09IGhlcmVfYml0cztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICAgIGxlbiA9IDA7XG4gICAgICAgICAgICBjb3B5ID0gMTEgKyAoaG9sZCAmIDB4N2YpOy8vQklUUyg3KTtcbiAgICAgICAgICAgIC8vLS0tIERST1BCSVRTKDcpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gNztcbiAgICAgICAgICAgIGJpdHMgLT0gNztcbiAgICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHN0YXRlLmhhdmUgKyBjb3B5ID4gc3RhdGUubmxlbiArIHN0YXRlLm5kaXN0KSB7XG4gICAgICAgICAgICBzdHJtLm1zZyA9ICdpbnZhbGlkIGJpdCBsZW5ndGggcmVwZWF0JztcbiAgICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAg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DtcbiAgICAgICAgaGF2ZSA9IHN0cm0uYXZhaWxfaW47XG4gICAgICAgIGhvbGQgPSBzdGF0ZS5ob2xkO1xuICAgICAgICBiaXRzID0gc3RhdGUuYml0cztcbiAgICAgICAgLy8tLS1cblxuICAgICAgICBpZiAoc3RhdGUubW9kZSA9PT0gVFlQRSkge1xuICAgICAgICAgIHN0YXRlLmJhY2sgPSAtMTtcbiAgICAgICAgfVxuICAgICAgICBicmVhaztcbiAgICAgIH1cbiAgICAgIHN0YXRlLmJhY2sgPSAwO1xuICAgICAgZm9yICg7Oykge1xuICAgICAgICBoZXJlID0gc3RhdGUubGVuY29kZVtob2xkICYgKCgxIDw8IHN0YXRlLmxlbmJpdHMpIC0gMSldOyAgLypCSVRTKHN0YXRlLmxlbmJpdHMpKi9cbiAgICAgICAgaGVyZV9iaXRzID0gaGVyZSA+Pj4gMjQ7XG4gICAgICAgIGhlcmVfb3AgPSAoaGVyZSA+Pj4gMTYpICYgMHhmZjtcbiAgICAgICAgaGVyZV92YWwgPSBoZXJlICYgMHhmZmZmO1xuXG4gICAgICAgIGlmIChoZXJlX2JpdHMgPD0gYml0cykgeyBicmVhazsgfVxuICAgICAgICAvLy0tLSBQVUxMQllURSgpIC0tLS8vXG4gICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICBoYXZlLS07XG4gICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgIC8vLS0tLy9cbiAgICAgIH1cbiAgICAgIGlmIChoZXJlX29wICYmIChoZXJlX29wICYgMHhmMCkgPT09IDApIHtcbiAgICAgICAgbGFzdF9iaXRzID0gaGVyZV9iaXRzO1xuICAgICAgICBsYXN0X29wID0gaGVyZV9vcDtcbiAgICAgICAgbGFzdF92YWwgPSBoZXJlX3ZhbDtcbiAgICAgICAgZm9yICg7Oykge1xuICAgICAgICAgIGhlcmUgPSBzdGF0ZS5sZW5jb2RlW2xhc3RfdmFsICtcbiAgICAgICAgICAgICAgICAgICgoaG9sZCAmICgoMSA8PCAobGFzdF9iaXRzICsgbGFzdF9vcCkpIC0gMSkpLypCSVRTKGxhc3QuYml0cyArIGxhc3Qub3ApKi8gPj4gbGFzdF9iaXRzKV07XG4gICAgICAgICAgaGVyZV9iaXRzID0gaGVyZSA+Pj4gMjQ7XG4gICAgICAgICAgaGVyZV9vcCA9IChoZXJlID4+PiAxNikgJiAweGZmO1xuICAgICAgICAgIGhlcmVfdmFsID0gaGVyZSAmIDB4ZmZmZjtcblxuICAgICAgICAgIGlmICgobGFzdF9iaXRzICsgaGVyZV9iaXRzKSA8PSBiaXRzKSB7IGJyZWFrOyB9XG4gICAgICAgICAgLy8tLS0gUFVMTEJZVEUoKSAtLS0vL1xuICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgLy8tLS0vL1xuICAgICAgICB9XG4gICAgICAgIC8vLS0tIERST1BCSVRTKGxhc3QuYml0cykgLS0tLy9cbiAgICAgICAgaG9sZCA+Pj49IGxhc3RfYml0cztcbiAgICAgICAgYml0cyAtPSBsYXN0X2JpdHM7XG4gICAgICAgIC8vLS0tLy9cbiAgICAgICAgc3RhdGUuYmFjayArPSBsYXN0X2JpdHM7XG4gICAgICB9XG4gICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICBob2xkID4+Pj0gaGVyZV9iaXRzO1xuICAgICAgYml0cyAtPSBoZXJlX2JpdHM7XG4gICAgICAvLy0tLS8vXG4gICAgICBzdGF0ZS5iYWNrICs9IGhlcmVfYml0cztcbiAgICAgIHN0YXRlLmxlbmd0aCA9IGhlcmVfdmFsO1xuICAgICA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bGQgPSAwO1xuICAgICAgICBiaXRzID0gMDtcbiAgICAgICAgLy89PT0vL1xuICAgICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgY2hlY2sgbWF0Y2hlcyB0cmFpbGVyXFxuXCIpKTtcbiAgICAgIH1cbiAgICAgIHN0YXRlLm1vZGUgPSBMRU5HVEg7XG4gICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgY2FzZSBMRU5HVEg6XG4gICAgICBpZiAoc3RhdGUud3JhcCAmJiBzdGF0ZS5mbGFncykge1xuICAgICAgICAvLz09PSBORUVEQklUUygzMik7XG4gICAgICAgIHdoaWxlIChiaXRzIDwgMzIpIHtcbiAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICB9XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgaWYgKGhvbGQgIT09IChzdGF0ZS50b3RhbCAmIDB4ZmZmZmZmZmYpKSB7XG4gICAgICAgICAgc3RybS5tc2cgPSAnaW5jb3JyZWN0IGxlbmd0aCBjaGVjayc7XG4gICAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICAvLz09PSBJTklUQklUUygpO1xuICAgICAgICBob2xkID0gMDtcbiAgICAgICAgYml0cyA9IDA7XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgLy9UcmFjZXYoKHN0ZGVyciwgXCJpbmZsYXRlOiAgIGxlbmd0aCBtYXRjaGVzIHRyYWlsZXJcXG5cIikpO1xuICAgICAgfVxuICAgICAgc3RhdGUubW9kZSA9IERPTkU7XG4gICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgY2FzZSBET05FOlxuICAgICAgcmV0ID0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aW5nIHRhYmxlIGVudHJ5IGlmIGNvZGUgaXMgaW5jb21wbGV0ZSAoZ3VhcmFudGVlZCB0byBoYXZlXG4gICBhdCBtb3N0IG9uZSByZW1haW5pbmcgZW50cnksIHNpbmNlIGlmIHRoZSBjb2RlIGlzIGluY29tcGxldGUsIHRoZVxuICAgbWF4aW11bSBjb2RlIGxlbmd0aCB0aGF0IHdhcyBhbGxvd2VkIHRvIGdldCB0aGlzIGZhciBpcyBvbmUgYml0KSAqL1xuICBpZiAoaHVmZiAhPT0gMCkge1xuICAgIC8vdGFibGUub3BbbmV4dCArIGh1ZmZdID0gNjQ7ICAgICAgICAgICAgLyogaW52YWxpZCBjb2RlIG1hcmtlciAqL1xuICAgIC8vdGFibGUuYml0c1tuZXh0ICsgaHVmZl0gPSBsZW4gLSBkcm9wO1xuICAgIC8vdGFibGUudmFsW25leHQgKyBodWZmXSA9IDA7XG4gICAgdGFibGVbbmV4dCArIGh1ZmZdID0gKChsZW4gLSBkcm9wKSA8PCAyNCkgfCAoNjQgPDwgMTYpIHwwO1xuICB9XG5cbiAgLyogc2V0IHJldHVybiBwYXJhbWV0ZXJzICovXG4gIC8vb3B0cy50YWJsZV9pbmRleCArPSB1c2VkO1xuICBvcHRzLmJpdHMgPSByb290O1xuICByZXR1cm4gMDtcbn07XG4iLCIndXNlIHN0cmljdCc7XG5cbm1vZHVsZS5leHBvcnRzID0ge1xuICAyOiAgICAgICduZWVkIGRpY3Rpb25hcnknLCAgICAgLyogWl9ORUVEX0RJQ1QgICAgICAgMiAgKi9cbiAgMTogICAgICAnc3RyZWFtIGVuZCcsICAgICAgICAgIC8qIFpfU1RSRUFNX0VORCAgICAgIDEgICovXG4gIDA6ICAgICAgJycsICAgICAgICAgICAgICAgICAgICAvKiBaX09LICAgICAgICAgICAgICAwICAqL1xuICAnLTEnOiAgICdmaWxlIGVycm9yJywgICAgICAgICAgLyogWl9FUlJOTyAgICAgICAgICgtMSkgKi9cbiAgJy0yJzogICAnc3RyZWFtIGVycm9yJywgICAgICAgIC8qIFpfU1RSRUFNX0VSUk9SICAoLTIpICovXG4gICctMyc6ICAgJ2RhdGEgZXJyb3InLCAgICAgICAgICAvKiBaX0RBVEFfRVJST1IgICAgKC0zKSAqL1xuICAnLTQnOiAgICdpbnN1ZmZpY2llbnQgbWVtb3J5JywgLyogWl9NRU1fRVJST1IgICAgICgtNCkgKi9cbiAgJy01JzogICAnYnVmZmVyIGVycm9yJywgICAgICAgIC8qIFpfQlVGX0VSUk9SICAgICAoLTUpICovXG4gICctNic6ICAgJ2luY29tcGF0aWJsZSB2ZXJzaW9uJyAvKiBaX1ZFUlNJT05fRVJST1IgKC02KSAqL1xufTtcbiIsIid1c2Ugc3RyaWN0JztcblxuXG52YXIgdXRpbHMgPSByZXF1aXJlKCcuLi91dGlscy9jb21tb24nKTtcblxuLyogUHVibGljIGNvbnN0YW50cyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG5cblxuLy92YXIgWl9GSUxURVJFRCAgICAgICAgICA9IDE7XG4vL3ZhciBaX0hVRkZNQU5fT05MWSAgICAgID0gMjtcbi8vdmFyIFpfUkxFICAgICAgICAgICAgICAgPSAzO1xudmFyIFpfRklYRUQgICAgICAgICAgICAgICA9IDQ7XG4vL3ZhciBaX0RFRkFVTFRfU1RSQVRFR1kgID0gMDtcblxuLyogUG9zc2libGUgdmFsdWVzIG9mIHRoZSBkYXRhX3R5cGUgZmllbGQgKHRob3VnaCBzZWUgaW5mbGF0ZSgpKSAqL1xudmFyIFpfQklOQVJZICAgICAgICAgICAgICA9IDA7XG52YXIgWl9URVhUICAgICAgICAgICAgICAgID0gMTtcbi8vdmFyIFpfQVNDSUkgICAgICAgICAgICAgPSAxOyAvLyA9IFpfVEVYVFxudmFyIFpfVU5LTk9XTiAgICAgICAgICAgICA9IDI7XG5cbi8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG5cblxuZnVuY3Rpb24gemVybyhidWYpIHsgdmFyIGxlbiA9IGJ1Zi5sZW5ndGg7IHdoaWxlICgtLWxlbiA+PSAwKSB7IGJ1ZltsZW5dID0gMDsgfSB9XG5cbi8vIEZyb20genV0aWwuaFxuXG52YXIgU1RPUkVEX0JMT0NLID0gMDtcbnZhciBTVEFUSUNfVFJFRVMgPSAxO1xudmFyIERZTl9UUkVFUyAgICA9IDI7XG4vKiBUaGUgdGhyZWUga2luZHMgb2YgYmxvY2sgdHlwZSAqL1xuXG52YXIgTUlOX01BVENIICAgID0gMztcbnZhciBNQVhfTUFUQ0ggICAgPSAyNTg7XG4vKiBUaGUgbWluaW11bSBhbmQgbWF4aW11bSBtYXRjaCBsZW5ndGhzICovXG5cbi8vIEZyb20gZGVmbGF0ZS5oXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIEludGVybmFsIGNvbXByZXNzaW9uIHN0YXRlLlxuICovXG5cbnZhciBMRU5HVEhfQ09ERVMgID0gMjk7XG4vKiBudW1iZXIgb2YgbGVuZ3RoIGNvZGVzLCBub3QgY291bnRpbmcgdGhlIHNwZWNpYWwgRU5EX0JMT0NLIGNvZGUgKi9cblxudmFyIExJVEVSQUxTICAgICAgPSAyNTY7XG4vKiBudW1iZXIgb2YgbGl0ZXJhbCBieXRlcyAwLi4yNTUgKi9cblxudmFyIExfQ09ERVMgICAgICAgPSBMSVRFUkFMUyArIDEgKyBMRU5HVEhfQ09ERVM7XG4vKiBudW1iZXIgb2YgTGl0ZXJhbCBvciBMZW5ndGggY29kZXMsIGluY2x1ZGluZyB0aGUgRU5EX0JMT0NLIGNvZGUgKi9cblxudmFyIERfQ09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W5kX2NvZGUocywgY3VybGVuLCBzLmJsX3RyZWUpO1xuICAgICAgICBjb3VudC0tO1xuICAgICAgfVxuICAgICAgLy9Bc3NlcnQoY291bnQgPj0gMyAmJiBjb3VudCA8PSA2LCBcIiAzXzY/XCIpO1xuICAgICAgc2VuZF9jb2RlKHMsIFJFUF8zXzYsIHMuYmxfdHJlZSk7XG4gICAgICBzZW5kX2JpdHMocywgY291bnQgLSAzLCAyKTtcblxuICAgIH0gZWxzZSBpZiAoY291bnQgPD0gMTApIHtcbiAgICAgIHNlbmRfY29kZShzLCBSRVBaXzNfMTAsIHMuYmxfdHJlZSk7XG4gICAgICBzZW5kX2JpdHMocywgY291bnQgLSAzLCAzKTtcblxuICAgIH0gZWxzZSB7XG4gICAgICBzZW5kX2NvZGUocywgUkVQWl8xMV8xMzgsIHMuYmxfdHJlZSk7XG4gICAgICBzZW5kX2JpdHMocywgY291bnQgLSAxMSwgNyk7XG4gICAgfVxuXG4gICAgY291bnQgPSAwO1xuICAgIHByZXZsZW4gPSBjdXJsZW47XG4gICAgaWYgKG5leHRsZW4gPT09IDApIHtcbiAgICAgIG1heF9jb3VudCA9IDEzODtcbiAgICAgIG1pbl9jb3VudCA9IDM7XG5cbiAgICB9IGVsc2UgaWYgKGN1cmxlbiA9PT0gbmV4dGxlbikge1xuICAgICAgbWF4X2NvdW50ID0gNjtcbiAgICAgIG1pbl9jb3VudCA9IDM7XG5cbiAgICB9IGVsc2Uge1xuICAgICAgbWF4X2NvdW50ID0gNztcbiAgICAgIG1pbl9jb3VudCA9IDQ7XG4gICAgfVxuICB9XG59XG5cblxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBDb25zdHJ1Y3QgdGhlIEh1ZmZtYW4gdHJlZSBmb3IgdGhlIGJpdCBsZW5ndGhzIGFuZCByZXR1cm4gdGhlIGluZGV4IGluXG4gKiBibF9vcmRlciBvZiB0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gICAgICBpZiAoYXJyYXkpIHtcbiAgICAgICAgICBzdHIgPSBzdHIuc3BsaXQoJ1xcbicpLm1hcChmdW5jdGlvbihsaW5lKSB7XG4gICAgICAgICAgICByZXR1cm4gJyAgJyArIGxpbmU7XG4gICAgICAgICAgfSkuam9pbignXFxuJykuc3Vic3RyKDIpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHN0ciA9ICdcXG4nICsgc3RyLnNwbGl0KCdcXG4nKS5tYXAoZnVuY3Rpb24obGluZSkge1xuICAgICAgICAgICAgcmV0dXJuICcgICAnICsgbGluZTtcbiAgICAgICAgICB9KS5qb2luKCdcXG4nKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBzdHIgPSBjdHguc3R5bGl6ZSgnW0NpcmN1bGFyXScsICdzcGVjaWFsJyk7XG4gICAgfVxuICB9XG4gIGlmIChpc1VuZGVmaW5lZChuYW1lKSkge1xuICAgIGlmIChhcnJheSAmJiBrZXkubWF0Y2goL15cXGQrJC8pKSB7XG4gICAgICByZXR1cm4gc3RyO1xuICAgIH1cbiAgICBuYW1lID0gSlNPTi5zdHJpbmdpZnkoJycgKyBrZXkpO1xuICAgIGlmIChuYW1lLm1hdGNoKC9eXCIoW2EtekEtWl9dW2EtekEtWl8wLTldKilcIiQvKSkge1xuICAgICAgbmFtZSA9IG5hbWUuc3Vic3RyKDEsIG5hbWUubGVuZ3RoIC0gMik7XG4gICAgICBuYW1lID0gY3R4LnN0eWxpemUobmFtZSwgJ25hbWUnKTtcbiAgICB9IGVsc2Uge1xuICAgICAgbmFtZSA9IG5hbWUucmVwbGFjZSgvJy9nLCBcIlxcXFwnXCIpXG4gICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9cXFxcXCIvZywgJ1wiJylcbiAgICAgICAgICAgICAgICAgLnJlcGxhY2UoLyheXCJ8XCIkKS9nLCBcIidcIik7XG4gICAgICBuYW1lID0gY3R4LnN0eWxpemUobmFtZSwgJ3N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NxcnQoZHggKiBkeCArIGR5ICogZHkpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgX3N0YXRlID0gU1RBVEUuWk9PTTtcbiAgICAgICAgICAgICAgX3pvb21TdGFydC5jb3B5KGdldE1vdXNlT25TY3JlZW4oZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VYLCBldmVudC50b3VjaGVzWyAwIF0ucGFnZVkpKTtcbiAgICAgICAgICAgICAgX3pvb21FbmQuY29weShfem9vbVN0YXJ0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgIGlmIChldmVudC50b3VjaGVzLmxlbmd0aCA+PSAyKSB7XG4gICAgICAgICAgICAgIF9zdGF0ZSA9IFNUQVRFLlRPVUNIX1BBTjtcbiAgICAgICAgICAgICAgdmFyIHggPSAoZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VYICsgZXZlbnQudG91Y2hlc1sgMSBdLnBhZ2VYKSAvIDI7XG4gICAgICAgICAgICAgIHZhciB5ID0gKGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWSArIGV2ZW50LnRvdWNoZXNbIDEgXS5wYWdlWSkgLyAyO1xuICAgICAgICAgICAgICBfcGFuU3RhcnQuY29weShnZXRNb3VzZU9uU2NyZWVuKHgsIHkpKTtcbiAgICAgICAgICAgICAgX3BhbkVuZC5jb3B5KF9wYW5TdGFydCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBfc3RhdGUgPSBTVEFURS5QQU47XG4gICAgICAgICAgICAgIF9wYW5TdGFydC5jb3B5KGdldE1vdXNlT25TY3JlZW4oZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VYLCBldmVudC50b3VjaGVzWyAwIF0ucGFnZVkpKTtcbiAgICAgICAgICAgICAgX3BhbkVuZC5jb3B5KF9wYW5TdGFydCk7XG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fbW92ZUN1cnIuY29weShnZXRNb3VzZU9uQ2lyY2xlKGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWCwgZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VZKSk7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgIF96b29tRW5kLmNvcHkoZ2V0TW91c2VPblNjcmVlbihldmVudC50b3VjaGVzWyAwIF0ucGFnZVgsIGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWSkpO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICBfcGFuRW5kLmNvcHkoZ2V0TW91c2VPblNjcmVlbihldmVudC50b3VjaGVzWyAwIF0ucGFnZVgsIGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWSkpO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAvLyAyIGZpbmdlcnMhXG4gICAgICAgICAgICAvLyBUT1VDSCBaT09NXG4gICAgICAgICAgICB2YXIgZHggPSBldmVudC50b3VjaGVzWyAwIF0ucGFnZVggLSBldmVudC50b3VjaGVzWyAxIF0ucGFnZVg7XG4gICAgICAgICAgICB2YXIgZHkgPSBldmVudC50b3VjaGVzWyAwIF0ucGFnZVkgLSBldmVudC50b3VjaGVzWyAxIF0ucGFnZVk7XG4gICAgICAgICAgICBfdG91Y2hab29tRGlzdGFuY2VFbmQgPSBNYXRoLnNxcnQoZHggKiBkeCArIGR5ICogZHkpO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIDU6XG4gICAgICAgICAgICAvLyAyIGZpbmdlcnNcbiAgICAgICAgICAgIC8vIFRPVUNIX1BBTlxuICAgICAgICAgICAgdmFyIHggPSAoZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VYICsgZXZlbnQudG91Y2hlc1sgMSBdLnBhZ2VYKSAvIDI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xuXG4gICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgX3RvdWNoWm9vbURpc3RhbmNlU3RhcnQgPSBfdG91Y2hab29tRGlzdGFuY2VFbmQgPSAwO1xuXG4gICAgICAgICAgICB2YXIgeCA9IChldmVudC50b3VjaGVzWyAwIF0ucGFnZVggKyBldmVudC50b3VjaGVzWyAxIF0ucGFnZVgpIC8gMjtcbiAgICAgICAgICAgIHZhciB5ID0gKGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWSArIGV2ZW50LnRvdWNoZXNbIDEgXS5wYWdlWSkgLyAyO1xuICAgICAgICAgICAgX3BhbkVuZC5jb3B5KGdldE1vdXNlT25TY3JlZW4oeCwgeSkpO1xuICAgICAgICAgICAgX3BhblN0YXJ0LmNvcHkoX3BhbkVuZCk7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICB9XG5cbiAgICAgICAgX3N0YXRlID0gU1RBVEUuTk9ORTtcblxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgc3dpdGNoIChfc3RhdGUpIHtcblxuICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgIF9tb3ZlUHJldi5jb3B5KF9tb3ZlQ3Vycik7XG4gICAgICAgICAgICBfbW92ZUN1cnIuY29weShnZXRNb3VzZU9uQ2lyY2xlKGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWCwgZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VZKSk7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgNDpcbiAgICAgICAgICAgIC8vIFRPVUNIIFpPT01cbiAgICAgICAgICAgIF90b3VjaFpvb21EaXN0YW5jZVN0YXJ0ID0gX3RvdWNoWm9vbURpc3RhbmNlRW5kID0gMDtcbiAgICAgICAgICAgIF9zdGF0ZSA9IFNUQVRFLlpPT007XG4gICAgICAgICAgICB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B9XG5cbiAgc3RhdGljIHh5ejJSR0IoIHgsIHksIHogKXtcblxuICAgIHggLz0gMTAwO1xuICAgIHkgLz0gMTAwO1xuICAgIHogLz0gMTAwO1xuICAgIGxldCByID0geCAqICAzLjI0MDYgKyB5ICogLTEuNTM3MiArIHogKiAtMC40OTg2O1xuICAgIGxldCBnID0geCAqIC0wLjk2ODkgKyB5ICogIDEuODc1OCArIHogKiAgMC4wNDE1O1xuICAgIGxldCBiID0geCAqICAwLjA1NTcgKyB5ICogLTAuMjA0MCArIHogKiAgMS4wNTcwO1xuXG4gICAgaWYgKCByID4gMC4wMDMxMzA4ICl7XG5cbiAgICAgIHIgPSAxLjA1NSAqICggTWF0aC5wb3coIHIgLCAxIC8gMi40ICkgKSAtIDAuMDU1O1xuXG4gICAgfSBlbHNlIHtcblxuICAgICAgciA9IDEyLjkyICogcjtcblxuICAgIH1cblxuICAgIGlmICggZyA+IDAuMDAzMTMwOCApe1xuXG4gICAgICBnID0gMS4wNTUgKiAoIE1hdGgucG93KCBnLCAxIC8gMi40ICkgKSAtIDAuMDU1O1xuXG4gICAgfSBlbHNlIHtcblxuICAgICAgZyA9IDEyLjkyICogZztcblxuICAgIH1cblxuICAgIGlmICggYiA+IDAuMDAzMTMwOCApe1xuXG4gICAgICBiID0gMS4wNTUgKiAoIE1hdGgucG93KCBiICwgMSAvIDIuNCApICkgLSAwLjA1NTtcblxuICAgIH0gZWxzZSB7XG5cbiAgICAgIGIgPSAxMi45MiAqIGI7XG5cbiAgICB9ICAgICAgICAgICAgICAgICAgICAgXG5cbiAgICByID0gciAqIDI1NTtcbiAgICBnID0gZyAqIDI1NTtcbiAgICBiID0gYiAqIDI1NTtcblxuICAgIHJldHVybiBbIHIsIGcsIGIgXTtcblxuICB9XG5cbiAgc3RhdGljIGNpZWxhYjJSR0IoIGwgPSA1MCwgYSA9IDAsIGIgPSAwKXtcblxuICAgIGlmKCAhKCBsID49IDAgJiYgbCA8PSAxMDAgKSApe1xuXG4gICAgICByZ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FxuICAgICAgICBib3guY2VudGVyLnksXG4gICAgICAgIGJveC5jZW50ZXIueiksXG4gICAgICBuZXcgVEhSRUUuVmVjdG9yMygxLCAwLCAwKVxuICAgICk7XG4gICAgdGhpcy5yYXlQbGFuZUluQkJveChyYXksIHBsYW5lLCBiYm94LCBpbnRlcnNlY3Rpb25zKTtcblxuICAgIC8vIFkgbWluXG4gICAgcGxhbmUgPSB0aGlzLnBvc2RpcihcbiAgICAgIG5ldyBUSFJFRS5WZWN0b3IzKFxuICAgICAgICBib3guY2VudGVyLngsXG4gICAgICAgIGJib3gubWluLnksXG4gICAgICAgIGJveC5jZW50ZXIueiksXG4gICAgICBuZXcgVEhSRUUuVmVjdG9yMygwLCAtMSwgMClcbiAgICApO1xuICAgIHRoaXMucmF5UGxhbmVJbkJCb3gocmF5LCBwbGFuZSwgYmJveCwgaW50ZXJzZWN0aW9ucyk7XG5cbiAgICAvLyBZIG1heFxuICAgIHBsYW5lID0gdGhpcy5wb3NkaXIoXG4gICAgICBuZXcgVEhSRUUuVmVjdG9yMyhcbiAgICAgICAgYm94LmNlbnRlci54LFxuICAgICAgICBiYm94Lm1heC55LFxuICAgICAgICBib3guY2VudGVyLnopLFxuICAgICAgbmV3IFRIUkVFLlZlY3RvcjMoMCwgMSwgMClcbiAgICApO1xuICAgIHRoaXMucmF5UGxhbmVJbkJCb3gocmF5LCBwbGFuZSwgYmJveCwgaW50ZXJzZWN0aW9ucyk7XG5cbiAgICAvLyBaIG1pblxuICAgIHBsYW5lID0gdGhpcy5wb3NkaXIoXG4gICAgICBuZXcgVEhSRUUuVmVjdG9yMyhcbiAgICAgICAgYm94LmNlbnRlci54LFxuICAgICAgICBib3guY2VudGVyLnksXG4gICAgICAgIGJib3gubWluLnopLFxuICAgICAgbmV3IFRIUkVFLlZlY3RvcjMoMCwgMCwgLTEpXG4gICAgKTtcbiAgICB0aGlzLnJheVBsYW5lSW5CQm94KHJheSwgcGxhbmUsIGJib3gsIGludGVyc2VjdGlvbnMp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56ID09PSBlbGVtZW50Lnope1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cblxuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbiAgfVxuXG4gIHN0YXRpYyBpbkJCb3gocG9pbnQsIGJib3gpIHtcbiAgICAvL1xuICAgIGxldCBlcHNpbG9uID0gMC4wMDAxO1xuICAgIGlmIChwb2ludCAmJlxuICAgICAgICBwb2ludC54ID49IGJib3gubWluLnggLSBlcHNpbG9uICYmIHBvaW50LnkgPj0gYmJveC5taW4ueSAtIGVwc2lsb24gJiYgcG9pbnQueiA+PSBiYm94Lm1pbi56IC0gZXBzaWxvbiAmJlxuICAgICAgICBwb2ludC54IDw9IGJib3gubWF4LnggKyBlcHNpbG9uICYmIHBvaW50LnkgPD0gYmJveC5tYXgueSArIGVwc2lsb24gJiYgcG9pbnQueiA8PSBiYm94Lm1heC56ICsgZXBzaWxvbikge1xuICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuICAgIHJldHVybiBmYWxzZTtcbiAgfVxuXG4gIHN0YXRpYyBwb3NkaXIocG9zaXRpb24sIGRpcmVjdGlvbil7XG4gICAgcmV0dXJuIHtwb3NpdGlvbiwgZGlyZWN0aW9ufTtcbiAgfVxuXG4gIHN0YXRpYyB2YWxpZGF0ZVBsYW5lKHBsYW5lKXtcbiAgICAvL1xuICAgIGlmKHBsYW5lID09PSBudWxsKXtcblxuICAgICAgd2luZG93LmNvbnNvbGUubG9nKCdJbnZhbGlkIHBsYW5lLicpO1xuICAgICAgd2luZG93LmNvbnNvbGUubG9nKHBsYW5lKTtcblxuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cblxuICAgIGlmKCFWYWxpZGF0b3JzLnZlY3RvcjMocGxhbmUucG9zaXRpb24pKXtcblxuICAgICAgd2luZG93LmNvbnNvbGUubG9nKCdJbnZhbGlkIHBsYW5lLnBvc2l0aW9uLicpO1xuICAgICAgd2luZG93LmNvbnNvbGUubG9nKHBsYW5lLn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oaXMuX2NvbG9yW2ldWzBdO1xuICAgICAgICBsZXQgbmV4dFBvcyAgICAgPSAxO1xuICAgICAgICBpZiggaSA8IHRoaXMuX2NvbG9yLmxlbmd0aCAtIDEpe1xuXG4gICAgICAgICAgbmV4dFBvcyA9IHRoaXMuX2NvbG9yW2krMV1bMF07XG5cbiAgICAgICAgfVxuICAgICAgICBsZXQgcHJldmlvdXNQb3MgPSAwO1xuICAgICAgICBpZiggaSA+IDApe1xuXG4gICAgICAgICAgcHJldmlvdXNQb3MgPSB0aGlzLl9jb2xvcltpLTFdWzBdO1xuXG4gICAgICAgIH1cblxuICAgICAgICBsZXQgZnJvbSAgICAgICAgPSBwcmV2aW91c1BvcyArIChjdXJyZW50UG9zIC0gcHJldmlvdXNQb3MpLzI7XG4gICAgICAgIGxldCB0byAgICAgICAgICA9IGN1cnJlbnRQb3MgKyAobmV4dFBvcyAtIGN1cnJlbnRQb3MpLzI7XG4gICAgICAgIGxldCBjb2xvciAgICAgICA9IHRoaXMuX2NvbG9yW2ldO1xuICAgICAgICBsZXQgb3BhY2l0eSAgICAgPSB0aGlzLl9vcGFjaXR5W2ldID8gdGhpcy5fb3BhY2l0eVtpXVsxXSA6IDE7XG5cbiAgICAgICAgY3R4LmJlZ2luUGF0aCgpO1xuICAgICAgICBjdHguc3Ryb2tlU3R5bGUgPSBgcmdiYSggJHtNYXRoLnJvdW5kKGNvbG9yWzFdICogMjU1KX0sICR7TWF0aC5yb3VuZChjb2xvclsyXSAqIDI1NSl9LCAke01hdGgucm91bmQoY29sb3JbM10gKiAyNTUpfSwgJHtvcGFjaXR5fSlgO1xuICAgICAgICBjdHgubW92ZVRvKGZyb20qdGhpcy5fY2FudmFzLndpZHRoLDApO1xuICAgICAgICBjdHgubGluZVRvKCB0byp0aGlzLl9jYW52YXMud2lkdGgsIDApO1xuICAgICAgICBjdHguc3Ryb2tlKCk7XG4gICAgICAgIGN0eC5jbG9zZVBhdGgoKTtcbiAgICAgICAgXG4gICAgICB9XG5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FsaXphdGlvblxuICAgIC8vIHRoaXMuX3N2Z1BvaW50ZXIgPSAnPHN2ZyB3aWR0aD1cIjQwXCIgaGVpZ2h0PVwiNDBcIiBcXFxuICAgIC8vICAgICAgdmlld0JveD1cIjAgMCAxNDAgMTQwXCIgdmVyc2lvbj1cIjEuMVwiIFxcXG4gICAgLy8gICAgICB4bWxucz1cImh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnXCI+IFxcXG4gICAgLy8gICBcXFxuICAgIC8vICAgICA8cG9seWxpbmUgcG9pbnRzPVwiMTAsNzAgXFxcbiAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgNzAsMTAgXFxcbiAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgMTMwLDcwXCIgLz5cXFxuICAgIC8vICAgXFxcbiAgICAvLyAgIDwvc3ZnPic7XG4gICAgLypqc2hpbnQgbXVsdGlzdHI6IHRydWUgKi9cbiAgICB0aGlzLl9zdmdQb2ludGVyID0gJzxzdmcgd2lkdGg9XCI0MFwiIGhlaWdodD1cIjQwXCIgXFxcbiAgICAgICAgICAgICAgICAgICAgICB2aWV3Qm94PVwiMCAwIDE0MCAxNDBcIiB2ZXJzaW9uPVwiMS4xXCIgXFxcbiAgICAgICAgICAgICAgICAgICAgICB4bWxucz1cImh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnXCI+IFxcXG4gICAgICAgICAgICAgICAgICAgICAgXFxcbiAgICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPVwiTTcwLDcwIFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTDMwLDMwIFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQTEwLDEwIDAgMSAxIDEwLDEwXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBMTAsMTAgMCAxIDEgMzAsMzBcIiAvPlxcXG4gICAgICAgICAgICAgICAgICAgICAgXFxcbiAgICAgICAgICAgICAgICAgICAgICA8L3N2Zz4nICAgICAg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XBkYXRlRG9tKGNvbnRhaW5lcikge1xuXG4gICAgaWYgKGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdWSlNWb3hlbFByb2JlV29ybGQnICsgdGhpcy5pZCkgPT09IG51bGwpIHtcbiAgICAgIGNvbnRhaW5lci5hcHBlbmRDaGlsZCh0aGlzLmNyZWF0ZURvbSgpKTtcbiAgICB9XG5cbiAgICAvLyB1cGRhdGUgY29udGVudFxuICAgIGxldCByYXNDb250YWluZXIgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnVkpTVm94ZWxQcm9iZVdvcmxkJyArIHRoaXMuaWQpO1xuICAgIGxldCByYXNDb250ZW50ID0gdGhpcy5fdm94ZWwud29ybGRDb29yZGluYXRlcy54LnRvRml4ZWQoMikgKyAnIDogJyArXG4gICAgICAgICAgICAgICAgICAgICB0aGlzLl92b3hlbC53b3JsZENvb3JkaW5hdGVzLnkudG9GaXhlZCgyKSArICcgOiAnICtcbiAgICAgICAgICAgICAgICAgICAgIHRoaXMuX3ZveGVsLndvcmxkQ29vcmRpbmF0ZXMuei50b0ZpeGVkKDIpO1xuICAgIHJhc0NvbnRhaW5lci5pbm5lckhUTUwgPSAnTFBTOiAnICsgcmFzQ29udGVudDtcblxuICAgIGxldCBpamtDb250YWluZXIgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnVkpTVm94ZWxQcm9iZURhdGEnICsgdGhpcy5pZCk7XG4gICAgbGV0IGlqa0NvbnRlbnQgPSB0aGlzLl92b3hlbC5kYXRhQ29vcmRpbmF0ZXMueCArICcgOiAnICtcbiAgICAgICAgICAgICAgICAgICAgIHRoaXMuX3ZveGVsLmRhdGFDb29yZGluYXRlcy55ICsgJyA6ICcgK1xuICAgICAgICAgICAgICAgICAgICAgdGhpcy5fdm94ZWwuZGF0YUNvb3JkaW5hdGVzLno7XG4gICAgaWprQ29udGFpbmVyLmlubmVySFRNTCA9ICdJSks6ICcgKyBpamtDb250ZW50O1xuXG4gICAgbGV0IH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MuX3Byb2dyZXNzQmFyLnVwZGF0ZSgwLCAxMDAsICdwYXJzZScpO1xuXG4gICAgcmV0dXJuIG5ldyBQcm9taXNlKFxuICAgICAgICAocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG4gICAgICAgICAgICB3aW5kb3cuc2V0VGltZW91dChcbiAgICAgICAgICAgICAgKCkgPT4ge1xuICAgICAgICAgICAgICAgIHJlc29sdmUobmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuXG4gICAgICAgICAgICAgICAgICBsZXQgZGF0YSA9IHJlc3BvbnNlO1xuICAgICAgICAgICAgICAgICAgZGF0YS5nemNvbXByZXNzZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgIGRhdGEuZmlsZW5hbWUgPSAnJztcbiAgICAgICAgICAgICAgICAgIGRhdGEuZXh0ZW5zaW9uID0gJyc7XG5cbiAgICAgICAgICAgICAgICAgIC8vIHVuY29tcHJlc3M/XG4gICAgICAgICAgICAgICAgICBkYXRhLmZpbGVuYW1lID0gcmVzcG9uc2UudXJsLnNwbGl0KCcvJykucG9wKCk7XG4gICAgICAgICAgICAgICAgICBkYXRhLmd6Y29tcHJlc3NlZCA9IGZhbHNlO1xuXG4gICAgICAgICAgICAgICAgICAvLyBmaW5kIGV4dGVuc2lvblxuICAgICAgICAgICAgICAgICAgbGV0IHNwbGl0dGVkTmFtZSA9IGRhdGEuZmlsZW5hbWUuc3BsaXQoJy4nKTtcbiAgICAgICAgICAgICAgICAgIGlmKHNwbGl0dGVkTmFtZS5sZW5ndGggPD0gMSl7XG4gICAgICAgICAgICAgICAgICAgIGRhdGEuZXh0ZW5zaW9uID0gJyc7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBlbHNle1xuICAgICAgICAgICAgICAgICAgICBkYXRhLmV4dGVuc2lvbiA9IGRhdGEuZmlsZW5hbWUuc3BsaXQoJy4nKS5wb3AoKTtcbiAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgLy8gdW56aXAgaWYgZXh0ZW5zaW9uIGlzICcuZ3onXG4gICAgICAgICAgICAgICAgICBpZiAoZGF0YS5leHRlbnNpb24gPT09ICdneicpIHtcbiAgICAgICAgICAgICAgICAgICAgZGF0YS5nemNvbXByZXNzZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICBkYXRhLmV4dGVuc2lvbiA9IGRhdGEuZmlsZW5hbWUuc3BsaXQoJy5neicpLnNoaWZ0KCkuc3BsaXQoJy4nKS5wb3AoKTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGRlY29tcHJlc3NlZERhdGEgPSBwYWtvLmluZmxhdGUoZGF0YS5idWZmZXIpO1xuICAgICAgICAgICAgICAgICAgICBkYXRhLmJ1ZmZlciA9IGRlY29tcHJlc3NlZERhdGEuYnVmZmVyO1xuICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICBsZXQgcGFyc2VyID0gdGhpcy5fcGFyc2VyKGRhdGEuZXh0ZW5zaW9uKTtcbiAgICAgICAgICAgICAgICAgIGlmICghcGFyc2VyKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlamVjdChkYXRhLmZpbGVuYW1lICsgJyBjYW4gbm90IGJlIHBhcnNlZC4nKTtcbiAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgLy8gY2hlY2sgZXh0ZW5zaW9uXG4gICAgICAgICAgICAgICAgICBsZXQgdm9sdW1lUGFyc2VyID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIHZvbHVtZVBhcnNlciA9IG5ldyBwYXJzZXIoZGF0YSwgMCk7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICB3aW5kb3cuY29uc29sZS5sb2coZSk7XG4gICAgICAgICAgICAgICAgICAgIHJlamVjdChlKTtcbiAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgLy8gY3JlYXRlIGEgc2VyaWVzXG4gICAgICAgICAgICAgICAgICBsZXQgc2VyaWVzID0gbmV3IE1vZGVsc1NlcmllcygpO1xuICAgICAgICAgICAgICAgICAgc2VyaWVzLnNlcmllc0luc3RhbmNlVUlEID0gdm9sdW1lUGFyc2VyLnNlcmllc0luc3RhbmNlVUlEKCk7XG4gICAgICAgICAgICAgICAgICBzZXJpZXMubnVtYmVyT2ZGcmFtZXMgICAgPSB2b2x1bWVQYXJzZXIubnVtYmVyT2ZGcmFtZXMoKTtcbiAgICAgICAgICAgICAgICAgIGlmICghc2VyaWVzLm51bWJlck9mRnJhbWVzKSB7XG4gICAgICAgICAgICAgICAgICAgIHNlcmllcy5udW1iZXJPZkZyYW1lcyA9IDE7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBzZXJpZXMubnVtYmVyT2ZDaGFubmVscyAgPSB2b2x1bWVQYXJzZXIubnVtYmVyT2ZDaGFubmVscygpO1xuICAgICAgICAgICAgICAgICAgc2VyaWVzLm1vZGFsaXR5ICAgICAgICAgID0gdm9sdW1lUGFyc2VyLm1vZGFsaXR5KCk7XG4gICAgICAgICAgICAgICAgICAvLyBpZiBpdCBpcyBhIHNlZ21lbnRhdGlvbiwgYXR0YWNoIGV4dHJhIGluZm9ybWF0aW9uXG4gICAgICAgICAgICAgICAgICBpZihzZXJpZXMubW9kYWxpdHkgPT09ICdTRUcnKXtcbiAgICAgICAgICAgICAgICAgICAgLy8gY29sb3JzXG4gICAgICAgICAgICAgICAgICAgIC8vIGxhYmVsc1xuICAgICAgICAgICAgICAgICAgICAvLyBldGMuXG4gICAgICAgICAgICAgICAgICAgIHNlcmllcy5zZWdtZW50YXRpb25UeXBlICAgICA9IHZvbHVtZVBhcnNlci5zZWdtZW50YXRpb25UeXBlKCk7XG4gICAgICAgICAgICAgICAgICAgIHNlcmllcy5zZWdtZW50YXRpb25TZWdtZW50cyA9IHZvbHVtZVBhcnNlci5zZWdtZW50YXRpb25TZWdtZW50cygpO1xuICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAvLyBqdXN0IGNyZWF0ZSAxIGR1bW15IHN0YWNrIGZvciBub3dcbiAgICAgICAgICAgICAgICAgIGxldCBzdGFjayA9IG5ldyBNb2RlbHNTdGFjaygpO1xuICAgICAgICAgICAgICAgICAgc3RhY2subnVtYmVyT2ZDaGFubmVscyA9IHZvbHVtZVBhcnNlci5udW1iZXJPZkNoYW5uZWxzKCk7XG4gICAgICAgICAgICAgICAgICBzdGFjay5waXhlbFR5cGUgICAgICAgID0gdm9sdW1lUGFyc2VyLnBpeGVsVHlwZSgpO1xuICAgICAgICAgICAgICAgICAgc3RhY2suaW52ZXJ0ICAgICAgICAgICA9IHZvbHVtZVBhcnNlci5pbnZlcnQoKTtcbiAgICAgICAgICAgICAgICAgIHN0YWNrLm1vZGFsaXR5ICAgICAgICAgPSBzZXJpZXMubW9kYWxpdHk7XG4gICAgICAgICAgICAgICAgICAvLyBpZiBpdCBpcyBhIHNlZ21lbnRhdGlvbiwgYXR0YWNoIGV4dHJhIGluZm9ybWF0aW9uXG4gICAgICAgICAgICAgICAgICBpZihzdGFjay5tb2RhbGl0eSA9PT0gJ1NFRycpe1xuICAgICAgICAgICAgICAgICAgICAvLyBjb2xvcnNcbiAgICAgICAgICAgICAgICAgICAgLy8gbGFiZWxzXG4gICAgICAgICAgICAgICAgICAgIC8vIGV0Yy5cbiAgICAgICAgICAgICAgICAgICAgc3RhY2suc2VnbWVudGF0aW9uVHlwZSAgICAgPSBzZXJpZXMuc2VnbWVudGF0aW9uVHlwZTtcbiAgICAgICAgICAgICAgICAgICAgc3RhY2suc2VnbWVudGF0aW9uU2VnbWVudHMgPSBzZXJpZXMuc2VnbWVudGF0aW9uU2VnbWVudHM7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBzZXJpZXMuc3RhY2sucHV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OdW1iZXIuTUFYX1ZBTFVFLCBOdW1iZXIuTUlOX1ZBTFVFXG4gICAgXTtcblxuICAgIGZvciAoIGxldCBpID0gMDsgaSA8PSB0aGlzLl9kaW1lbnNpb25zSUpLLng7IGkgKz0gdGhpcy5fZGltZW5zaW9uc0lKSy54ICkge1xuICAgICAgZm9yICggbGV0IGogPSAwOyBqIDw9IHRoaXMuX2RpbWVuc2lvbnNJSksueTsgaiArPSB0aGlzLl9kaW1lbnNpb25zSUpLLnkgKSB7XG4gICAgICAgIGZvciAobGV0IGsgPSAwOyBrIDw9IHRoaXMuX2RpbWVuc2lvbnNJSksuejsgayArPSB0aGlzLl9kaW1lbnNpb25zSUpLLnogKSB7XG5cbiAgICAgICAgICBsZXQgd29ybGQgPSBuZXcgVEhSRUUuVmVjdG9yMyggaSwgaiwgayApLmFwcGx5TWF0cml4NCggdGhpcy5faWprMkxQUyApO1xuICAgICAgICAgIGJib3ggPSBbXG4gICAgICAgICAgICBNYXRoLm1pbihiYm94WzBdLCB3b3JsZC54KSwgTWF0aC5tYXgoYmJveFsxXSwgd29ybGQueCksIC8vIHggbWluL21heFxuICAgICAgICAgICAgTWF0aC5taW4oYmJveFsyXSwgd29ybGQueSksIE1hdGgubWF4KGJib3hbM10sIHdvcmxkLnkpLFxuICAgICAgICAgICAgTWF0aC5taW4oYmJveFs0XSwgd29ybGQueiksIE1hdGgubWF4KGJib3hbNV0sIHdvcmxkLnopXG4gICAgICAgICAgICBdO1xuXG4gICAgICAgIH1cblxuICAgICAgfVxuXG4gICAgfVxuXG4gICAgcmV0dXJuIGJib3g7XG5cbiAgfVxuXG4gIEFBQkJveCgpIHtcblxuICAgIGxldCB3b3JsZDAgPSBuZXcgVEhSRUUuVmVjdG9yMygpLmFkZFNjYWxhciggLTAuNSApXG4gICAgICAuYXBwbHlNYXRyaXg0KCB0aGlzLl9pamsyTFBTIClcbiAgICAgIC5hcHBseU1hdHJpeDQoIHRoaXMuX2xwczJBQUJCICk7XG5cbiAgICB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1cm4gdmFsdWUgKiBzbG9wZSArIGludGVyY2VwdDtcblxuICB9XG5cbiAgc3RhdGljIGluZGV4SW5EaW1lbnNpb25zKCBpbmRleCwgZGltZW5zaW9ucyApIHtcblxuICAgIGlmICggaW5kZXgueCA+PSAwICYmXG4gICAgICAgICBpbmRleC55ID49IDAgJiZcbiAgICAgICAgIGluZGV4LnogPj0gMCAmJlxuICAgICAgICAgaW5kZXgueCA8IGRpbWVuc2lvbnMueCAmJlxuICAgICAgICAgaW5kZXgueSA8IGRpbWVuc2lvbnMueSAmJlxuICAgICAgICAgaW5kZXgueiA8IGRpbWVuc2lvbnMueiApIHtcblxuICAgICAgcmV0dXJuIHRydWU7XG5cbiAgICB9XG5cbiAgICByZXR1cm4gZmFsc2U7XG5cbiAgfVxuXG4gIF92ZWN0b3IzRnJvbUFycmF5KGFycmF5LCBpbmRleCkge1xuICAgIHJldHVybiBuZXcgVEhSRUUuVmVjdG9yMyhcbiAgICAgIGFycmF5W2luZGV4XSxcbiAgICAgIGFycmF5W2luZGV4ICsgMV0sXG4gICAgICBhcnJheVtpbmRleCArIDJdXG4gICAgICApO1xuICB9XG5cbiAgX29yZGVyRnJhbWVPbkRpbWVuc2lvbkluZGljZXNBcnJheVNvcnQoYSwgYikge1xuXG4gICAgaWYgKCdkaW1lbnNpb25JbmRleFZhbHVlcycgaW4gYSAmJiBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwoYS5kaW1lbnNpb25JbmRleFZhbHVlcykgPT09ICdbb2JqZWN0IEFycmF5XScgJiYgJ2RpbWVuc2lvbkluZGV4VmFsdWVzJyBpbiBiICYmIE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbChiLmRpbWVuc2lvbkluZGV4VmFsdWVzKSA9PT0gJ1tvYmplY3QgQXJyYXldJykge1xuICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhLmRpbWVuc2lvbkluZGV4VmFsdWVzLmxlbmd0aDsgaSsrKSB7XG4gICAg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ZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDQgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA1OlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDUgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA2OlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDYgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA3OlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDcgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgYml0U3RhcnRPZmZzZXQrKztcbiAgICAgICAgICBpbmRleCsrO1xuICAgICAgICAgIC8vIGlmIHJldHVybi4uXG4gICAgICAgICAgaWYgKGluZGV4ID49IG51bVBpeGVscykge1xuICAgICAgICAgICAgcmV0dXJuIG5ld0FycmF5O1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBiaXRTdGFydE9mZnNldCA9IDA7XG5cbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICBfY29udmVydENvbG9yU3BhY2UodW5jb21wcmVzc2VkRGF0YSkge1xuICAgIGxldCByZ2JEYXRhID0gbnVsbDtcbiAgICBsZXQgcGhvdG9tZXRyaWNJbnRlcnByZXRhdGlvbiA9IHRoaXMucGhvdG9tZXRyaWNJbnRlcnByZXRhdGlvbigpO1xuICAgIGxldCBwbGFuYXJDb25maWd1cmF0aW9uID0gdGhpcy5wbGFuYXJDb25maWd1cmF0aW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KXsgICAgICAgICAgICAgICAgICAgLyogc3BlY2lhbCBjYXNlICovXG5cbiAgICAgICAgYSA9IDEuMCAvIE1hdGguc3FydChiKmIrYypjK2QqZCkgO1xuICAgICAgICBiICo9IGEgOyBjICo9IGEgOyBkICo9IGEgOyAgICAgICAgLyogbm9ybWFsaXplIChiLGMsZCkgdmVjdG9yICovXG4gICAgICAgIGEgPSAwLjA7ICAgICAgICAgICAgICAgICAgICAgICAvKiBhID0gMCA9PT4gMTgwIGRlZ3JlZSByb3RhdGlvbiAqL1xuXG4gICAgICB9IGVsc2Uge1xuXG4gICAgICAgIGEgPSBNYXRoLnNxcnQoYSkgOyAgICAgICAgICAgICAgICAgICAgIC8qIGFuZ2xlID0gMiphcmNjb3MoYSkgKi9cblxuICAgICAgfVxuXG4gICAgICBpZih0aGlzLl9kYXRhU2V0LnBpeERpbXNbMF0gPCAwLjApIHtcblxuICAgICAgICB0aGlzLl9yaWdodEhhbmRlZCA9IGZhbHNlO1xuXG4gICAgICB9XG5cbiAgICAgICByZXR1cm4gW1xuICAgICAgICAgIC0oYSphK2IqYi1jKmMtZCpkKSxcbiAgICAgICAgICAtMiooYipjK2EqZCksXG4gICAgICAgICAgMiooYipkLWEqYyksXG4gICAgICAgICAgLTIqKGIqYy1hKmQpLFxuICAgICAgICAgIC0oYSphK2MqYy1iKmItZCpkKSxcbiAgICAgICAgICAyKihjKmQrYSpiKVxuICAgICAgICBdO1xuXG4gICAgfWVsc2UgaWYodGhpcy5fZGF0YVNldC5zZm9ybV9jb2RlID4gMCkgeyAgXG5cbiAgICAgIGNvbnNvbGUubG9nKCAnc2Zvcm0gPiAwJyApO1xuXG4gICAgICB2YXIgc3ggPSB0aGlzLl9kYXRhU2V0LnNyb3dfeCwgc3kgPSB0aGlzLl9kYXRhU2V0LnNyb3dfeSwgc3ogPSB0aGlzLl9kYXRhU2V0LnNyb3dfejtcbiAgICAgIC8vIGZpbGwgSUpLVG9SQVNcbiAgICAgIC8vZ29vZy52ZWMuT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Wx1ZTogWzAuMCwgMC4wXSxcbiAgICAgICAgdHlwZUdMU0w6ICdmbG9hdCcsXG4gICAgICAgIGxlbmd0aDogMlxuICAgICAgfSxcbiAgICAgICd1UmVzY2FsZVNsb3BlSW50ZXJjZXB0Jzoge1xuICAgICAgICB0eXBlOiAnZnYxJyxcbiAgICAgICAgdmFsdWU6IFswLjAsIDAuMF0sXG4gICAgICAgIHR5cGVHTFNMOiAnZmxvYXQnLFxuICAgICAgICBsZW5ndGg6IDJcbiAgICAgIH0sXG4gICAgICAndU51bWJlck9mQ2hhbm5lbHMnOiB7XG4gICAgICAgIHR5cGU6ICdpJyxcbiAgICAgICAgdmFsdWU6IDEsXG4gICAgICAgIHR5cGVHTFNMOiAnaW50J1xuICAgICAgfSxcbiAgICAgICd1Qml0c0FsbG9jYXRlZCc6IHtcbiAgICAgICAgdHlwZTogJ2knLFxuICAgICAgICB2YWx1ZTogOCxcbiAgICAgICAgdHlwZUdMU0w6ICdpbnQnXG4gICAgICB9LFxuICAgICAgJ3VJbnZlcnQnOiB7XG4gICAgICAgIHR5cGU6ICdpJyxcbiAgICAgICAgdmFsdWU6IDAsXG4gICAgICAgIHR5cGVHTFNMOiAnaW50J1xuICAgICAgfSxcbiAgICAgICd1THV0Jzoge1xuICAgICAgICB0eXBlOiAnaScsXG4gICAgICAgIHZhbHVlOiAwLFxuICAgICAgICB0eXBlR0xTTDogJ2ludCdcbiAgICAgIH0sXG4gICAgICAndVRleHR1cmVMVVQnOntcbiAgICAgICAgdHlwZTogJ3QnLFxuICAgICAgICB2YWx1ZTogW10sXG4gICAgICAgIHR5cGVHTFNMOiAnc2FtcGxlcjJEJ1xuICAgICAgfSxcbiAgICAgICd1UGl4ZWxUeXBlJzoge1xuICAgICAgICB0eXBlOiAnaScsXG4gICAgICAgIHZhbHVlOiAwLFxuICAgICAgICB0eXBlR0xTTDogJ2ludCdcbiAgICAgIH0sXG4gICAgICAndVBhY2tlZFBlclBpeGVsJzoge1xuICAgICAgICB0eX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c3RhdGVcbiAgICAgICAgICAgIHZhciBycyA9IGRlY29kZUh1ZmZtYW4oY29tcG9uZW50Lmh1ZmZtYW5UYWJsZUFDKTtcbiAgICAgICAgICAgIHZhciBzID0gcnMgJiAxNTtcbiAgICAgICAgICAgIHIgPSBycyA+PiA0O1xuICAgICAgICAgICAgaWYgKHMgPT09IDApIHtcbiAgICAgICAgICAgICAgaWYgKHIgPCAxNSkge1xuICAgICAgICAgICAgICAgIGVvYnJ1biA9IHJlY2VpdmUocikgKyAoMSA8PCByKTtcbiAgICAgICAgICAgICAgICBzdWNjZXNzaXZlQUNTdGF0ZSA9IDQ7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgciA9IDE2O1xuICAgICAgICAgICAgICAgIHN1Y2Nlc3NpdmVBQ1N0YXRlID0gMTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgaWYgKHMgIT09IDEpXG4gICAgICAgICAgICAgICAgdGhyb3cgXCJpbnZhbGlkIEFDbiBlbmNvZGluZ1wiO1xuICAgICAgICAgICAgICBzdWNjZXNzaXZlQUNOZXh0VmFsdWUgPSByZWNlaXZlQW5kRXh0ZW5kKHMpO1xuICAgICAgICAgICAgICBzdWNjZXNzaXZlQUNTdGF0ZSA9IHIgPyAyIDogMztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgIGNhc2UgMTogLy8gc2tpcHBpbmcgciB6ZXJvIGl0ZW1zXG4gICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgaWYgKGNvbXBvbmVudC5ibG9ja0RhdGFbb2Zmc2V0ICsgel0pIHtcbiAgICAgICAgICAgICAgY29tcG9uZW50LmJsb2NrRGF0YVtvZmZzZXQgKyB6XSArPSAocmVhZEJpdCgpIDw8IHN1Y2Nlc3NpdmUpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgci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2V0SW50ZXJ2YWw7IG4rKykge1xuICAgICAgICAgIGRlY29kZUJsb2NrKGNvbXBvbmVudCwgZGVjb2RlRm4sIG1jdSk7XG4gICAgICAgICAgbWN1Kys7XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGZvciAobiA9IDA7IG4gPCByZXNldEludGVydmFsOyBuKyspIHtcbiAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgY29tcG9uZW50c0xlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBjb21wb25lbnQgPSBjb21wb25lbnRzW2ldO1xuICAgICAgICAgICAgaCA9IGNvbXBvbmVudC5oO1xuICAgICAgICAgICAgdiA9IGNvbXBvbmVudC52O1xuICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IHY7IGorKykge1xuICAgICAgICAgICAgICBmb3IgKGsgPSAwOyBrIDwgaDsgaysrKSB7XG4gICAgICAgICAgICAgICAgZGVjb2RlTWN1KGNvbXBvbmVudCwgZGVjb2RlRm4sIG1jdSwgaiwgayk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgbWN1Kys7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgLy8gZmluZCBtYXJrZXJcbiAgICAgIGJpdHNDb3VudCA9IDA7XG4gICAgICBtYXJrZXIgPSAoZGF0YVtvZmZzZXRdIDw8IDgpIHwgZGF0YVtvZmZzZXQgKyAxXTtcbiAgICAgIGlmIChtYXJrZXIgPD0gMHhGRjAwKSB7XG4gICAgICAgIHRocm93IFwibWFya2VyIHdhcyBub3QgZm91bmRcIjtcbiAgICAgIH1cblxuICAgICAgaWYgKG1hcmtlciA+PSAweEZGRDAgJiYgbWFya2VyIDw9IDB4RkZENykgeyAvLyBSU1R4XG4gICAgICAgIG9mZnNldCArPSAyO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgfVxuXG4gICAgcmV0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gICAgIHBbNCArIHJvd10gPT09IDAgJiYgcFs1ICsgcm93XSA9PT0gMCAmJiBwWzYgKyByb3ddID09PSAwICYmXG4gICAgICAgIHBbNyArIHJvd10gPT09IDApIHtcbiAgICAgICAgdCA9IChkY3RTcXJ0MiAqIHBbMCArIHJvd10gKyA1MTIpID4+IDEwO1xuICAgICAgICBwWzAgKyByb3ddID0gdDtcbiAgICAgICAgcFsxICsgcm93XSA9IHQ7XG4gICAgICAgIHBbMiArIHJvd10gPSB0O1xuICAgICAgICBwWzMgKyByb3ddID0gdDtcbiAgICAgICAgcFs0ICsgcm93XSA9IHQ7XG4gICAgICAgIHBbNSArIHJvd10gPSB0O1xuICAgICAgICBwWzYgKyByb3ddID0gdDtcbiAgICAgICAgcFs3ICsgcm93XSA9IHQ7XG4gICAgICAgIGNvbnRpbnVlO1xuICAgICAgfVxuXG4gICAgICAvLyBzdGFnZSA0XG4gICAgICB2MCA9IChkY3RTcXJ0MiAqIHBbMCArIHJvd10gKyAxMjgpID4+IDg7XG4gICAgICB2MSA9IChkY3RTcXJ0MiAqIHBbNCArIHJvd10gKyAxMjgpID4+IDg7XG4gICAgICB2MiA9IHBbMiArIHJvd107XG4gICAgICB2MyA9IHBbNiArIHJvd107XG4gICAgICB2NCA9IChkY3RTcXJ0MWQyICogKHBbMSArIHJvd10gLSBwWzcgKyByb3ddKSArIDEyOCkgPj4gODtcbiAgICAgIHY3ID0gKGRjdFNxcnQxZDIgKiAocFsxICsgcm93XSArIHBbNyArIHJvd10pICsgMTI4KSA+PiA4O1xuICAgICAgdjUgPSBwWzMgKyByb3ddIDw8IDQ7XG4gICAgICB2NiA9IHBbNSArIHJvd10gPDwgNDtcblxuICAgICAgLy8gc3RhZ2UgM1xuICAgICAgdCA9ICh2MCAtIHYxICsgMSkgPj4gMTtcbiAgICAgIHYwID0gKHYwICsgdjEgKyAxKSA+PiAxO1xuICAgICAgdjEgPSB0O1xuICAgICAgdCA9ICh2MiAqIGRjdFNpbjYgKyB2My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ICAgICAgICAgY2FzZSAweEZGRUY6IC8vIEFQUDE1XG4gICAgICAgICAgY2FzZSAweEZGRkU6IC8vIENPTSAoQ29tbWVudClcbiAgICAgICAgICAgIHZhciBhcHBEYXRhID0gcmVhZERhdGFCbG9jaygpO1xuXG4gICAgICAgICAgICBpZiAoZmlsZU1hcmtlciA9PT0gMHhGRkUwKSB7XG4gICAgICAgICAgICAgIGlmIChhcHBEYXRhWzBdID09PSAweDRBICYmIGFwcERhdGFbMV0gPT09IDB4NDYgJiYgYXBwRGF0YVsyXSA9PT0gMHg0OSAmJlxuICAgICAgICAgICAgICAgIGFwcERhdGFbM10gPT09IDB4NDYgJiYgYXBwRGF0YVs0XSA9PT0gMCkgeyAvLyAnSkZJRlxceDAwJ1xuICAgICAgICAgICAgICAgIGpmaWYgPSB7XG4gICAgICAgICAgICAgICAgICB2ZXJzaW9uOiB7bWFqb3I6IGFwcERhdGFbNV0sIG1pbm9yOiBhcHBEYXRhWzZdfSxcbiAgICAgICAgICAgICAgICAgIGRlbnNpdHlVbml0czogYXBwRGF0YVs3XSxcbiAgICAgICAgICAgICAgICAgIHhEZW5zaXR5OiAoYXBwRGF0YVs4XSA8PCA4KSB8IGFwcERhdGFbOV0sXG4gICAgICAgICAgICAgICAgICB5RGVuc2l0eTogKGFwcERhdGFbMTBdIDw8IDgpIHwgYXBwRGF0YVsxMV0sXG4gICAgICAgICAgICAgICAgICB0aHVtYldpZHRoOiBhcHBEYXRhWzEyXSxcbiAgICAgICAgICAgICAgICAgIHRodW1iSGVpZ2h0OiBhcHBEYXRhWzEzXSxcbiAgICAgICAgICAgICAgICAgIHRodW1iRGF0YTogYXBwRGF0YS5zdWJhcnJheSgxNCwgMTQgKyAzICogYXBwRGF0YVsxMl0gKiBhcHBEYXRhWzEzXSlcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBUT0RPIEFQUDEgLSBFeGlmXG4gICAgICAgICAgICBpZiAoZmlsZU1hcmtlciA9PT0gMHhGRkVFKSB7XG4gICAgICAgICAgICAgIGlmIChhcHBEYXRhWzBdID09PSAweDQxICYmIGFwcERhdGFbMV0gPT09IDB4NjQgJiYgYXBwRGF0YVsyXSA9PT0gMHg2RiAmJlxuICAgICAgICAgICAgICAgIGFwcERhdGFbM10gPT09IDB4NjIgJiYgYXBwRGF0YVs0XSA9PT0gMHg2NSAmJiBhcHBEYXRhWzVdID09PSAwKSB7IC8vICdBZG9iZVxceDAwJ1xuICAgICAgICAgICAgICAgIGFkb2JlID0ge1xuICAgICAgICAgICAgICAgICAgdmVyc2lvbjogYXBwRGF0YVs2XSxcbiAgICAgICAgICAgICAgICAgIGZsYWdzMDogKGFwcERhdGFbN10gPDwgOCkgfCBhcHBEYXRhWzhdLFxuICAgICAgICAgICAgICAgICAgZmxhZ3MxOiAoYXBwRGF0YVs5XSA8PCA4KSB8IGFwcERhdGFbMTBdLFxuICAgICAgICAgICAgICAgICAgdHJhbnNmb3JtQ29kZTogYXBwRGF0YVsxMV1cbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgMHhGRkRCOiAvLyBEUVQgKERlZmluZSBRdWFudGl6YXRpb24gVGFibGVzKVxuICAgICAgICAgICAgdmFyIHF1YW50aXphdGlvblRhYmxlc0xlbmd0aCA9IHJlYWRVaW50MTYoKTtcbiAgICAgICAgICAgIHZhciBxdWFudGl6YXRpb25UYWJsZXNFbmQgPSBxdWFudGl6YXRpb25UYWJsZXNMZW5ndGggKyBvZmZzZXQgLSAyO1xuICAgICAgICAgICAgd2hpbGUgKG9mZnNldCA8IHF1YW50aXphdGlvblRhYmxlc0VuZCkge1xuICAgICAgICAgICAgICB2YXIgcXVhbnRpemF0aW9uVGFibGVTcGVjID0gZGF0YVtvZmZzZXQrK107XG4gICAgICAgICAgICAgIHZhciB0YWJsZURhdGEgPSBuZXcgSW50MzJBcnJheSg2NCk7XG4gICAgICAgICAgICAgIGlmICgocXVhbnRpemF0aW9uVGFibGVTcGVjID4+IDQpID09PSAwKSB7IC8vIDggYml0IHZhbHVlc1xuICAgICAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCA2NDsgaisrKSB7XG4gICAgICAgICAgICAgICAgICB2YXIgeiA9IGRjdFppZ1phZ1tqXTtcbiAgICAgICAgICAgICAgICAgIHRhYmxlRGF0YVt6XSA9IGRhdGFbb2Zmc2V0KytdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSBlbHNlIGlmICgocXVhbnRpemF0aW9uVGFibGVTcGVjID4+IDQpID09PSAxKSB7IC8vMTYgYml0XG4gICAgICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IDY0OyBqKyspIHtcbiAgICAgICAgICAgICAgICAgIHZhciB6eiA9IGRjdFppZ1phZ1tqXTtcbiAgICAgICAgICAgICAgICAgIHRhYmxlRGF0YVt6el0gPSByZWFkVWludDE2KCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9IGVsc2VcbiAgICAgICAgICAgICAgICB0aHJvdyBcIkRRVDogaW52YWxpZCB0YWJsZSBzcGVjXCI7XG4gICAgICAgICAgICAgIHF1YW50aXphdGlvblRhYmxlc1txdWFudGl6YXRpb25UYWJsZVNwZWMgJiAxNV0gPSB0YWJsZURhdGE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgMHhGRkMwOiAvLyBTT0YwIChTdGFydCBvZiBGcmFtZSwgQmFzZWxpbmUgRENUKVxuICAgICAgICAgIGNhc2UgMHhGRkMxOiAvLyBTT0YxIChTdGFydCBvZiBGcmFtZSwgRXh0ZW5kZWQgRENUKVxuICAgICAgICAgIGNhc2UgMHhGRkMyOiAvLyBTT0YyIChTdGFydCBvZiBGcmFtZSwgUHJvZ3Jlc3NpdmUgRENUKVxuICAgICAgICAgICAgaWYgKGZyYW1lKSB7XG4gICAgICAgICAgICAgIHRocm93IFwiT25seSBzaW5nbGUgZnJhbWUgSlBFR3Mgc3VwcG9ydGVkXCI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZWFkVWludDE2KCk7IC8vIHNraXAgZGF0YSBsZW5ndGhcbiAgICAgICAgICAgIGZyYW1lID0ge307XG4gICAgICAgICAgICBmcmFtZS5leHRlbmRlZCA9IChmaWxlTWFya2VyID09PSAweEZGQzEpO1xuICAgICAgICAgICAgZnJhbWUucHJvZ3Jlc3NpdmUgPSAoZmlsZU1hcmtlciA9PT0gMHhGRkMyKTtcbiAgICAgICAgICAgIGZyYW1lLnByZWNpc2lvbiA9IGRhdGFbb2Zmc2V0KytdO1xuICAgICAgICAgICAgZnJhbWUuc2NhbkxpbmVzID0gcmVhZFVpbnQxNigpO1xuICAgICAgICAgICAgZnJhbWUuc2FtcGxlc1BlckxpbmUgPSByZWFkVWludDE2KCk7XG4gICAgICAgICAgICBmcmFtZS5jb21wb25lbnRzID0gW107XG4gICAgICAgICAgICBmcmFtZS5jb21wb25lbnRJZHMgPSB7fTtcbiAgICAgICAgICAgIHZhciBjb21wb25lbnRzQ291bnQgPSBkYXRhW29mZnNldCsrXSwgY29tcG9uZW50SWQ7XG4gICAgICAgICAgICB2YXIgbWF4SCA9IDAsIG1heFYgPSAwO1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IGNvbXBvbmVudHNDb3VudDsgaSsrKSB7XG4gICAgICAgICAgICAgIGNvbXBvbmVudElkID0gZGF0YVtvZmZzZXRdO1xuICAgICAgICAgICAgICB2YXIgaCA9IGRhdGFbb2Zmc2V0ICsgMV0gPj4gNDtcbiAgICAgICAgICAgICAgdmFyIHYgPSBkYXRhW29mZnNldCArIDFdICYgMTU7XG4gICAgICAgICAgICAgIGlmIChtYXhIIDwgaClcbiAgICAgICAgICAgICAgICBtYXhIID0gaDtcbiAgICAgICAgICAgICAgaWYgKG1heFYgPCB2KVxuICAgICAgICAgICAgICAgIG1heFYgPSB2O1xuICAgICAgICAgICAgICB2YXIgcUlkID0gZGF0YVtvZmZzZXQgKyAyXTtcbiAgICAgICAgICAgICAgbCA9IGZyYW1lLmNvbXBvbmVudHMucHVzaCh7XG4gICAgICAgICAgICAgICAgaDogaCxcbiAgICAgICAgICAgICAgICB2OiB2LFxuICAgICAgICAgICAgICAgIHF1YW50aXphdGlvblRhYmxlOiBxdWFudGl6YXRpb25UYWJsZXNbcUlkXSxcbiAgICAgICAgICAgICAgICBxdWFudGl6YXRpb25UYWJsZUlkOiBxSWQsXG4gICAgICAgICAgICAgICAgYml0Q29udmVyc2lvbjogMjU1IC8gKCgxIDw8IGZyYW1lLnByZWNpc2lvbikgLSAxKVxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgZnJhbWUuY29tcG9uZW50SWRzW2NvbXBvbmVudElkXSA9IGwgLSAxO1xuICAgICAgICAgICAgICBvZmZzZXQgKz0gMztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZyYW1lLm1heEggPSBtYXhIO1xuICAgICAgICAgICAgZnJhbWUubWF4ViA9IG1heFY7XG4gICAgICAgICAgICBwcmVwYXJlQ29tcG9uZW50cyhmcmFtZSk7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgMHhGRkM0OiAvLyBESFQgKERlZmluZSBIdWZmbWFuIFRhYmxlcylcbiAgICAgICAgICAgIHZhciBodWZmbWFuTGVuZ3RoID0gcmVhZFVpbnQxNigpO1xuICAgICAgICAgICAgZm9yIChpID0gMjsgaSA8IGh1ZmZtYW5MZW5ndGg7ICkge1xuICAgICAgICAgICAgICB2YXIgaHVmZm1hblRhYmxlU3BlYyA9IGRhdGFbb2Zmc2V0KytdO1xuICAgICAgICAgICAgICB2YXIgY29kZUxlbmd0aHMgPSBuZXcgVWludDhBcnJheSgxNik7XG4gICAgICAgICAgICAgIHZhciBjb2RlTGVuZ3RoU3VtID0gMDtcbiAgICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IDE2OyBqKyssIG9mZnNldCsrKVxuICAgICAgICAgICAgICAgIGNvZGVMZW5ndGhTdW0gKz0gKGNvZGVMZW5ndGhzW2pdID0gZGF0YVtvZmZzZXRdKTtcbiAgICAgICAgICAgICAgdmFyIGh1ZmZtYW5WYWx1ZXMgPSBuZXcgVWludDhBcnJheShjb2RlTGVuZ3RoU3VtKTtcbiAgICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IGNvZGVMZW5ndGhTdW07IGorKywgb2Zmc2V0KyspXG4gICAgICAgICAgICAgICAgaHVmZm1hblZhbHVlc1tqXSA9IGRhdGFbb2Zmc2V0XTtcbiAgICAgICAgICAgICAgaSArPSAxNyArIGNvZGVMZW5ndGhTdW07XG5cbiAgICAgICAgICAgICAgKChodWZmbWFuVGFibGVTcGVjID4+IDQpID09PSAwID9cbiAgICAgICAgICAgICAgICBodWZmbWFuVGFibGVzREMgOiBodWZmbWFuVGFibGVzQUMpW2h1ZmZtYW5UYWJsZVNwZWMgJiAxNV0gPVxuICAgICAgICAgICAgICAgIGJ1aWxkSHVmZm1hblRhYmxlKGNvZGVMZW5ndGhzLCBodWZmbWFuVmFsdWVzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSAweEZGREQ6IC8vIERSSSAoRGVmaW5lIFJlc3RhcnQgSW50ZXJ2YWwpXG4gICAgICAgICAgICByZWFkVWludDE2KCk7IC8vIHNraXAgZGF0YSBsZW5ndGhcbiAgICAgICAgICAgIHJlc2V0SW50ZXJ2YWwgPSByZWFkVWludDE2KCk7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgMHhGRkRBOiAvLyBTT1MgKFN0YXJ0IG9mIFNjYW4pXG4gICAgICAgICAgICB2YXIgc2Nhbkxlbmd0aCA9IHJlYWRVaW50MTYoKTtcbiAgICAgICAgICAgIHZhciBzZWxlY3RvcnNDb3VudCA9IGRhdGFbb2Zmc2V0KytdO1xuICAgICAgICAgICAgdmFyIGNvbXBvbmVudHMgPSBbXSwgY29tcG9uZW50O1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHNlbGVjdG9yc0NvdW50OyBpKyspIHtcbiAgICAgICAgICAgICAgdmFyIGNvbXBvbmVudEluZGV4ID0gZnJhbWUuY29tcG9uZW50SWRzW2RhdGFbb2Zmc2V0KytdXTtcbiAgICAgICAgICAgICAgY29tcG9uZW50ID0gZnJhbWUuY29tcG9uZW50c1tjb21wb25lbnRJbmRleF07XG4gICAgICAgICAgICAgIHZhciB0YWJsZVNwZWMgPSBkYXRhW29mZnNldCsrXTtcbiAgICAgICAgICAgICAgY29tcG9uZW50Lmh1ZmZtYW5UYWJsZURDID0gaHVmZm1hblRhYmxlc0RDW3RhYmxlU3BlYyA+PiA0XTtcbiAgICAgICAgICAgICAgY29tcG9uZW50Lmh1ZmZtYW5UYWJsZUFDID0gaHVmZm1hblRhYmxlc0FDW3RhYmxlU3BlYyAmIDE1XTtcbiAgICAgICAgICAgICAgY29tcG9uZW50cy5wdXNoKGNvbXBvbmVudCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgc3BlY3RyYWxTdGFydCA9IGRhdGFbb2Zmc2V0KytdO1xuICAgICAgICAgICAgdmFyIHNwZWN0cmFsRW5kID0gZGF0YVtvZmZzZXQrK107XG4gICAgICAgICAgICB2YXIgc3VjY2Vzc2l2ZUFwcHJveGltYXRpb24gPSBkYXRhW29mZnNldCsrXTtcbiAgICAgICAgICAgIHZhciBwcm9jZXNzZWQgPSBkZWNvZGVTY2FuKGRhdGEsIG9mZnNldCxcbiAgICAgICAgICAgICAgZnJhbWUsIGNvbXBvbmVudHMsIHJlc2V0SW50ZXJ2YWwsXG4gICAgICAgICAgICAgIHNwZWN0cmFsU3RhcnQsIHNwZWN0cmFsRW5kLFxuICAgICAgICAgICAgICBzdWNjZXNzaXZlQXBwcm94aW1hdGlvbiA+PiA0LCBzdWNjZXNzaXZlQXBwcm94aW1hdGlvbiAmIDE1KTtcbiAgICAgICAgICAgIG9mZnNldCArPSBwcm9jZXNzZWQ7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgaWYgKGRhdGFbb2Zmc2V0IC0gM10gPT0gMHhGRiAmJlxuICAgICAgICAgICAgICBkYXRhW29mZnNldCAtIDJdID49IDB4QzAgJiYgZGF0YVtvZmZzZXQgLSAyXSA8PSAweEZFKSB7XG4gICAgICAgICAgICAgIC8vIGNvdWxkIGJlIGluY29ycmVjdCBlbmNvZGluZyAtLSBsYXN0IDB4RkYgYnl0ZSBvZiB0aGUgcHJldmlvdXNcbiAgICAgICAgICAgICAgLy8gYmxvY2sgd2FzIGVhdGVuIGJ5IHRoZSBlbmNvZGVyXG4gICAgICAgICAgICAgIG9mZnNldCAtPSAzO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRocm93IFwidW5rbm93biBKUEVHIG1hcmtlciBcIiArIGZpbGVNYXJrZXIudG9TdHJpbmcoMTYpO1xuICAgICAgICB9XG4gICAgICAgIGZpbGVNYXJrZXIgPSByZWFkVWludDE2KCk7XG4gICAgICB9XG5cbiAgICAgIHRoaXMud2lkdGggPSBmcmFtZS5zYW1wbGVzUGVyTGluZTtcbiAgICAgIHRoaXMuaGVpZ2h0ID0gZnJhbWUuc2NhbkxpbmVzO1xuICAgICAgdGhpcy5qZmlmID0gamZpZjtcbiAgICAgIHRoaXMuYWRvYmUgPSBhZG9iZTtcbiAgICAgIHRoaXMuY29tcG9uZW50cyA9IFtdO1xuICAgICAgc3dpdGNoIChmcmFtZS5jb21wb25lbnRzLmxlbmd0aClcbiAgICAgIHtcbiAgICAgICAgY2FzZSAxOlxuICAgICAgICAgIHRoaXMuY29sb3JzcGFjZSA9IENvbG9yU3BhY2UuR3JheXNjYWxlO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgaWYgKHRoaXMuYWRvYmUpXG4gICAgICAgICAgICB0aGlzLmNvbG9yc3BhY2UgPSBDb2xvclNwYWNlLkFkb2JlUkdCO1xuICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgIHRoaXMuY29sb3JzcGFjZSA9IENvbG9yU3BhY2UuUkdCO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgdGhpcy5jb2xvcnNwYWNlID0gQ29sb3JTcGFjZS5DWU1LO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgIHRoaXMuY29sb3JzcGFjZSA9IENvbG9yU3BhY2UuVW5rbm93bjtcbiAgICAgIH1cbiAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZnJhbWUuY29tcG9uZW50cy5sZW5ndGg7IGkrKykge1xuICAgICAgICB2YXIgY29tcG9uZW50ID0gZnJhbWUuY29tcG9uZW50c1tpXTtcbiAgICAgICAgaWYgKCFjb21wb25lbnQucXVhbnRpemF0aW9uVGFibGUgJiYgY29tcG9uZW50LnF1YW50aXphdGlvblRhYmxlSWQgIT09IG51bGwpXG4gICAgICAgICAgY29tcG9uZW50LnF1YW50aXphdGlvblRhYmxlID0gcXVhbnRpemF0aW9uVGFibGVzW2NvbXBvbmVudC5xdWFudGl6YXRpb25UYWJsZUlkXTtcbiAgICAgICAgdGhpcy5jb21wb25lbnRzLnB1c2goe1xuICAgICAgICAgIG91dHB1dDogYnVpbGRDb21wb25lbnREYXRhKGZyYW1lLCBjb21wb25lbnQpLFxuICAgICAgICAgIHNjYWxlWDogY29tcG9uZW50LmggLyBmcmFtZS5tYXhILFxuICAgICAgICAgIHNjYWxlWTogY29tcG9uZW50LnYgLyBmcmFtZS5tYXhWLFxuICAgICAgICAgIGJsb2Nrc1BlckxpbmU6IGNvbXBvbmVudC5ibG9ja3NQZXJMaW5lLFxuICAgICAgICAgIGJsb2Nr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5cbiAgICAgIC8vIEZpcnN0IGNvbnN0cnVjdCBpbWFnZSBkYXRhIC4uLlxuICAgICAgZm9yIChpID0gMDsgaSA8IG51bUNvbXBvbmVudHM7IGkrKykge1xuICAgICAgICBjb21wb25lbnQgPSB0aGlzLmNvbXBvbmVudHNbaV07XG4gICAgICAgIHZhciBibG9ja3NQZXJMaW5lID0gY29tcG9uZW50LmJsb2Nrc1BlckxpbmU7XG4gICAgICAgIHZhciBibG9ja3NQZXJDb2x1bW4gPSBjb21wb25lbnQuYmxvY2tzUGVyQ29sdW1uO1xuICAgICAgICB2YXIgc2FtcGxlc1BlckxpbmUgPSBibG9ja3NQZXJMaW5lIDw8IDM7XG5cbiAgICAgICAgdmFyIGosIGssIGxsID0gMDtcbiAgICAgICAgdmFyIGxpbmVPZmZzZXQgPSAwO1xuICAgICAgICBmb3IgKHZhciBibG9ja1JvdyA9IDA7IGJsb2NrUm93IDwgYmxvY2tzUGVyQ29sdW1uOyBibG9ja1JvdysrKSB7XG4gICAgICAgICAgdmFyIHNjYW5MaW5lID0gYmxvY2tSb3cgPDwgMztcbiAgICAgICAgICBmb3IgKHZhciBibG9ja0NvbCA9IDA7IGJsb2NrQ29sIDwgYmxvY2tzUGVyTGluZTsgYmxvY2tDb2wrKykge1xuICAgICAgICAgICAgdmFyIGJ1ZmZlck9mZnNldCA9IGdldEJsb2NrQnVmZmVyT2Zmc2V0KGNvbXBvbmVudCwgYmxvY2tSb3csIGJsb2NrQ29sKTtcbiAgICAgICAgICAgIHZhciBvZmZzZXQgPSAwLCBzYW1wbGUgPSBibG9ja0NvbCA8PCAzO1xuICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IDg7IGorKykge1xuICAgICAgICAgICAgICB2YXIgbGluZU9mZnNldCA9IChzY2FuTGluZSArIGopICogc2FtcGxlc1BlckxpbmU7XG4gICAgICAgICAgICAgIGZvciAoayA9IDA7IGsgPCA4OyBrKyspIHtcbiAgICAgICAgICAgICAgICBsaW5lRGF0YVtsaW5lT2Zmc2V0ICsgc2FtcGxlICsga10gPVxuICAgICAgICAgICAgICAgICAgY29tcG9uZW50Lm91dHB1dFtidWZmZXJPZmZzZXQgKyBvZmZzZXQrK107XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBjb21wb25lbnRTY2FsZVggPSBjb21wb25lbnQuc2NhbGVYICogc2NhbGVYO1xuICAgICAgICBjb21wb25lbnRTY2FsZVkgPSBjb21wb25lbnQuc2NhbGVZICogc2NhbGVZO1xuICAgICAgICBvZmZzZXQgPSBpO1xuXG4gICAgICAgIHZhciBjeCwgY3k7XG4gICAgICAgIHZhciBpbmRleDtcbiAgICAgICAgZm9yICh5ID0gMDsgeSA8IGhlaWdodDsgeSsrKSB7XG4gICAgICAgICAgZm9yICh4ID0gMDsgeCA8IHdpZHRoOyB4KyspIHtcbiAgICAgICAgICAgIGN5ID0gMCB8ICh5ICogY29tcG9uZW50U2NhbGVZKTtcbiAgICAgICAgICAgIGN4ID0gMCB8ICh4ICogY29tcG9uZW50U2NhbGVYKTtcbiAgICAgICAgICAgIGluZGV4ID0gY3kgKiBzYW1wbGVzUGVyTGluZSArIGN4O1xuICAgICAgICAgICAgZGF0YVtvZmZzZXRdID0gbGluZURhdGFbaW5kZXhdO1xuICAgICAgICAgICAgb2Zmc2V0ICs9IG51bUNvbXBvbmVudHM7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICByZXR1cm4gZGF0YTtcbiAgICB9LFxuICAgIGdldERhdGE6IGZ1bmN0aW9uIGdldERhdGEod2lkdGgsIGhlaWdodCkge1xuICAgICAgdmFyIHNjYWxlWCA9IHRoaXMud2lkdGggLyB3aWR0aCwgc2NhbGVZID0gdGhpcy5oZWlnaHQgLyBoZWlnaHQ7XG5cbiAgICAgIHZhciBjb21wb25lbnQsIGNvbXBvbmVudFNjYWxlWCwgY29tcG9uZW50U2NhbGVZO1xuICAgICAg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CA9IDA7XG4gICAgICAgIHZhciBsaW5lT2Zmc2V0ID0gMDtcbiAgICAgICAgZm9yICh2YXIgYmxvY2tSb3cgPSAwOyBibG9ja1JvdyA8IGJsb2Nrc1BlckNvbHVtbjsgYmxvY2tSb3crKykge1xuICAgICAgICAgIHZhciBzY2FuTGluZSA9IGJsb2NrUm93IDw8IDM7XG4gICAgICAgICAgZm9yICh2YXIgYmxvY2tDb2wgPSAwOyBibG9ja0NvbCA8IGJsb2Nrc1BlckxpbmU7IGJsb2NrQ29sKyspIHtcbiAgICAgICAgICAgIHZhciBidWZmZXJPZmZzZXQgPSBnZXRCbG9ja0J1ZmZlck9mZnNldChjb21wb25lbnQsIGJsb2NrUm93LCBibG9ja0NvbCk7XG4gICAgICAgICAgICB2YXIgb2Zmc2V0ID0gMCwgc2FtcGxlID0gYmxvY2tDb2wgPDwgMztcbiAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCA4OyBqKyspIHtcbiAgICAgICAgICAgICAgdmFyIGxpbmVPZmZzZXQgPSAoc2NhbkxpbmUgKyBqKSAqIHNhbXBsZXNQZXJMaW5lO1xuICAgICAgICAgICAgICBmb3IgKGsgPSAwOyBrIDwgODsgaysrKSB7XG4gICAgICAgICAgICAgICAgbGluZURhdGFbbGluZU9mZnNldCArIHNhbXBsZSArIGtdID1cbiAgICAgICAgICAgICAgICAgIGNvbXBvbmVudC5vdXRwdXRbYnVmZmVyT2Zmc2V0ICsgb2Zmc2V0KytdICogY29tcG9uZW50LmJpdENvbnZlcnNpb247XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBjb21wb25lbnRTY2FsZVggPSBjb21wb25lbnQuc2NhbGVYICogc2NhbGVYO1xuICAgICAgICBjb21wb25lbnRTY2FsZVkgPSBjb21wb25lbnQuc2NhbGVZICogc2NhbGVZO1xuICAgICAgICBvZmZzZXQgPSBpO1xuXG4gICAgICAgIHZhciBjeCwgY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gICAgICBlbHNlIGlmICh0eXBlb2YgdGhpcy5jb2xvclRyYW5zZm9ybSAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBjb2xvclRyYW5zZm9ybSA9ICEhdGhpcy5jb2xvclRyYW5zZm9ybTtcblxuICAgICAgICAgIGlmIChjb2xvclRyYW5zZm9ybSkge1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IGRhdGFMZW5ndGg7IGkgKz0gbnVtQ29tcG9uZW50cykge1xuICAgICAgICAgICAgICBZID0gZGF0YVtpICAgIF07XG4gICAgICAgICAgICAgIENiID0gZGF0YVtpICsgMV07XG4gICAgICAgICAgICAgIENyID0gZGF0YVtpICsgMl07XG5cbiAgICAgICAgICAgICAgUiA9IGNsYW1wVG9VaW50OChZIC0gMTc5LjQ1NiArIDEuNDAyICogQ3IpO1xuICAgICAgICAgICAgICBHID0gY2xhbXBUb1VpbnQ4KFkgKyAxMzUuNDU5IC0gMC4zNDQgKiBDYiAtIDAuNzE0ICogQ3IpO1xuICAgICAgICAgICAgICBCID0gY2xhbXBUb1VpbnQ4KFkgLSAyMjYuODE2ICsgMS43NzIgKiBDYik7XG5cbiAgICAgICAgICAgICAgZGF0YVtpICAgIF0gPSBSO1xuICAgICAgICAgICAgICBkYXRhW2kgKyAxXSA9IEc7XG4gICAgICAgICAgICAgIGRhdGFbaSArIDJdID0gQjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgNDpcbiAgICAgICAgICBpZiAoIXRoaXMuYWRvYmUpXG4gICAgICAgICAgICB0aHJvdyAnVW5zdXBwb3J0ZWQgY29sb3IgbW9kZSAoNCBjb21wb25lbnRzKSc7XG4gICAgICAgICAgLy8gVGhlIGRlZmF1bHQgdHJhbnNmb3JtIGZvciBmb3VyIGNvbXBvbmVudHMgaXMgZmFsc2VcbiAgICAgICAgICBjb2xvclRyYW5zZm9ybSA9IGZhbHNlO1xuICAgICAgICAgIC8vIFRoZSBhZG9iZSB0cmFuc2Zvcm0gbWFya2VyIG92ZXJyaWRlcyBhbnkgcHJldmlvdXMgc2V0dGluZ1xuICAgICAgICAgIGlmICh0aGlzLmFkb2JlICYmIHRoaXMuYWRvYmUudHJhbnNmb3JtQ29kZSlcbiAgICAgICAgICAgIGNvbG9yVHJhbnNmb3JtID0gdHJ1ZTtcbiAgICAgICAgICBlbHNlIGlmICh0eXBlb2YgdGhpcy5jb2xvclRyYW5zZm9ybSAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBjb2xvclRyYW5zZm9ybSA9ICEhdGhpcy5jb2xvclRyYW5zZm9ybTtcblxuICAgICAgICAgIGlmIChjb2xvclRyYW5zZm9ybSkge1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IGRhdGFMZW5ndGg7IGkgKz0gbnVtQ29tcG9uZW50cykge1xuICAgICAgICAgICAgICBZID0gZGF0YVtpXTtcbiAgICAgICAgICAgICAgQ2IgPSBkYXRhW2kgKyAxXTtcbiAgICAgICAgICAgICAgQ3IgPSBkYXRhW2kgKyAyXTtcblxuICAgICAgICAgICAgICBDID0gY2xhbXBUb1VpbnQ4KDQzNC40NTYgLSBZIC0gMS40MDIgKiBDcik7XG4gICAgICAgICAgICAgIE0gPSBjbGFtcFRvVWludDgoMTE5LjU0MSAtIFkgKyAwLjM0NCAqIENiICsgMC43MTQgKiBDcik7XG4gICAgICAgICAgICAgIFkgPSBjbGFtcFRvVWludDgoNDgxLjgxNiAtIFkgLSAxLjc3MiAqIENiKTtcblxuICAgICAgICAgICAgICBkYXRhW2kgICAgXSA9IEM7XG4gICAgICAgICAgICAgIGRhdGFbaSArIDFdID0gTTtcbiAgICAgICAgICAgICAgZGF0YVtpICsgMl0gPSBZO1xuICAgICAgICAgICAgICAvLyBLIGlzIHVuY2hhbmdlZFxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBicmVhaztcbiAgICAgICAgZGVmYXVsdD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WYgKGhlYWQgPT09IDB4RkY0Rikge1xuICAgICAgICB0aGlzLnBhcnNlQ29kZXN0cmVhbShkYXRhLCAwLCBkYXRhLmxlbmd0aCk7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cblxuICAgICAgdmFyIHBvc2l0aW9uID0gMCwgbGVuZ3RoID0gZGF0YS5sZW5ndGg7XG4gICAgICB3aGlsZSAocG9zaXRpb24gPCBsZW5ndGgpIHtcbiAgICAgICAgdmFyIGhlYWRlclNpemUgPSA4O1xuICAgICAgICB2YXIgbGJveCA9IHJlYWRVaW50MzIoZGF0YSwgcG9zaXRpb24pO1xuICAgICAgICB2YXIgdGJveCA9IHJlYWRVaW50MzIoZGF0YSwgcG9zaXRpb24gKyA0KTtcbiAgICAgICAgcG9zaXRpb24gKz0gaGVhZGVyU2l6ZTtcbiAgICAgICAgaWYgKGxib3ggPT09IDEpIHtcbiAgICAgICAgICAvLyBYTEJveDogcmVhZCBVSW50NjQgYWNjb3JkaW5nIHRvIHNwZWMuXG4gICAgICAgICAgLy8gSmF2YVNjcmlwdCdzIGludCBwcmVjaXNpb24gb2YgNTMgYml0IHNob3VsZCBiZSBzdWZmaWNpZW50IGhlcmUuXG4gICAgICAgICAgbGJveCA9IHJlYWRVaW50MzIoZGF0YSwgcG9zaXRpb24pICogNDI5NDk2NzI5NiArXG4gICAgICAgICAgICAgICAgIHJlYWRVaW50MzIoZGF0YSwgcG9zaXRpb24gKyA0KTtcbiAgICAgICAgICBwb3NpdGlvbiArPSA4O1xuICAgICAgICAgIGhlYWRlclNpemUgKz0gODtcbiAgICAgICAgfVxuICAgICAgICBpZiAobGJveCA9PT0gMCkge1xuICAgICAgICAgIGxib3ggPSBsZW5ndGggLSBwb3NpdGlvbiArIGhlYWRlclNpemU7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGxib3ggPCBoZWFkZXJTaXplKSB7XG4gICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdKUFggRXJyb3I6IEludmFsaWQgYm94IGZpZWxkIHNpemUnKTtcbiAgICAgICAgfVxuICAgICAgICB2YXIgZGF0YUxlbmd0aCA9IGxib3ggLSBoZWFkZXJTaXplO1xuICAgICAgICB2YXIganVtcERhdGFMZW5ndGggPSB0cnVlO1xuICAgICAgICBzd2l0Y2ggKHRib3gpIHtcbiAgICAgICAgICBjYXNlIDB4NkE3MDMyNjg6IC8vICdqcDJoJ1xuICAgICAgICAgICAganVtcERhdGFMZW5ndGggPSBmYWxzZTsgLy8gcGFyc2luZyBjaGlsZCBib3hlc1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSAweDYzNkY2QzcyOiAvLyAnY29scidcbiAgICAgICAgICAgIC8vIENvbG9yc3BhY2VzIGFyZSBub3QgdXNlZCwgdGhlIENTIGZyb20gdGhlIFBERiBpcyB1c2VkLlxuICAgICAgICAgICAgdmFyIG1ldGhvZCA9IGRhdGFbcG9zaXRpb25dO1xuICAgICAgICAgICAgdmFyIHByZWNlZGVuY2UgPSBkYXRhW3Bvc2l0aW9uICsgMV07XG4gICAgICAgICAgICB2YXIgYXBwcm94aW1hdGlvbiA9IGRhdGFbcG9zaXRpb24gKyAyXTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT09IDEpIHtcbiAgICAgICAgICAgICAgLy8gZW51bWVyYXRlZCBjb2xvcnNwYWNlXG4gICAgICAgICAgICAgIHZhciBjb2xvcnNwYWNlID0gcmVhZFVpbnQzMihkYXRhLCBwb3NpdGlvbiArIDMpO1xuICAgICAgICAgICAgICBzd2l0Y2ggKGNvbG9yc3BhY2UpIHtcbiAgICAgICAgICAgICAgICBjYXNlIDE2OiAvLyB0aGlzIGluZGljYXRlcyBhIHNSR0IgY29sb3JzcGFjZVxuICAgICAgICAgICAgICAgIGNhc2UgMTc6IC8vIHRoaXMgaW5kaWNhdGVzIGEgZ3JheXNjYWxlIGNvbG9yc3BhY2VcbiAgICAgICAgICAgICAgICBjYXNlIDE4OiAvLyB0aGlzIGluZGljYXRlcyBhIFlVViBjb2xvcnNwYWNlXG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgd2FybignVW5rbm93biBjb2xvcnNwYWNlICcgKyBjb2xvcnNwYWNlKTtcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1ldGhvZCA9PT0gMikge1xuICAgICAgICAgICAgICBpbmZvKCdJQ0MgcHJvZmlsZSBub3Qgc3VwcG9ydGVkJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlIDB4NkE3MDMyNjM6IC8vICdqcDJjJ1xuICAgICAgICAgICAgdGhpcy5wYXJzZUNvZGVzdHJlYW0oZGF0YSwgcG9zaXRpb24sIHBvc2l0aW9uICsgZGF0YUxlbmd0aCk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlIDB4NkE1MDIwMjA6IC8vICdqUFxcMDI0XFwwMjQnXG4gICAgICAgICAgICBpZiAoMHgwZDBhODcwYSAhPT0gcmVhZFVpbnQzMihkYXRhLCBwb3NpdGlvbikpIHtcbiAgICAgICAgICAgICAgd2FybignSW52YWxpZCBKUDIgc2lnbmF0dXJlJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAvLyBUaGUgZm9sbG93aW5nIGhlYWRlciB0eXBlcyBhcmUgdmFsaWQgYnV0IGN1cnJlbnRseSBub3QgdXNlZDpcbiAgICAgICAgICBjYXNlIDB4NkE1MDFBMUE6IC8vICdqUFxcMDMyXFwwMzInXG4gICAgICAgICAgY2FzZSAweDY2NzQ3OTcwOiAvLyAnZnR5cCdcbiAgICAgICAgICBjYXNlIDB4NzI3MjY1NzE6IC8vICdycmVxJ1xuICAgICAgICAgIGNhc2UgMHg3MjY1NzMyMDogLy8gJ3JlcyAnXG4gICAgICAgICAgY2FzZSAweDY5Njg2NDcyOiAvLyAnaWhkcidcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICB2YXIgaGVhZGVyVHlwZSA9IFN0cmluZy5mcm9tQ2hhckNvZGUoKHRib3ggPj4gMjQpICYgMHhGRixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodGJveCA+PiAxNikgJiAweEZGLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0Ym94ID4+IDgpICYgMHhGRixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0Ym94ICYgMHhGRik7XG4gICAgICAgICAgICB3YXJuKCdVbnN1cHBvcnRlZCBoZWFkZXIgdHlwZSAnICsgdGJveCArICcgKCcgKyBoZWFkZXJUeXBlICsgJyknKTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIGlmIChqdW1wRGF0YUxlbmd0aCkge1xuICAgICAgICAgIHBvc2l0aW9uICs9IGRhdGFMZW5ndGg7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9LFxuICAgIHBhcnNlSW1hZ2VQcm9wZXJ0aWVzOiBmdW5jdGlvbiBKcHhJbWFnZV9wYXJzZUltYWdlUHJvcGVydGllcyhzdHJlYW0pIHtcbiAgICAgIHZhciBuZXdCeXRlID0gc3RyZWFtLmdldEJ5dGUoKTtcbiAgICAgIHdoaWxlIChuZXdCeXRlID49IDApIHtcbiAgICAgICAgdmFyIG9sZEJ5dGUgPSBuZXdCeXRlO1xuICAgICAgICBuZXdCeXRlID0gc3RyZWFtLmdldEJ5dGUoKTtcbiAgICAgICAgdmFyIGNvZGUgPSAob2xkQnl0ZSA8PCA4KSB8IG5ld0J5dGU7XG4gICAgICAgIC8vIEltYWdlIGFuZCB0aWxlIHNpemUgKFNJWilcbiAgICAgICAgaWY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mFsc2U7XG4gICAgICAgIHZhciBwb3NpdGlvbiA9IHN0YXJ0O1xuICAgICAgICB3aGlsZSAocG9zaXRpb24gKyAxIDwgZW5kKSB7XG4gICAgICAgICAgdmFyIGNvZGUgPSByZWFkVWludDE2KGRhdGEsIHBvc2l0aW9uKTtcbiAgICAgICAgICBwb3NpdGlvbiArPSAyO1xuXG4gICAgICAgICAgdmFyIGxlbmd0aCA9IDAsIGosIHNxY2QsIHNwcWNkcywgc3BxY2RTaXplLCBzY2FsYXJFeHBvdW5kZWQsIHRpbGU7XG4gICAgICAgICAgc3dpdGNoIChjb2RlKSB7XG4gICAgICAgICAgICBjYXNlIDB4RkY0RjogLy8gU3RhcnQgb2YgY29kZXN0cmVhbSAoU09DKVxuICAgICAgICAgICAgICBjb250ZXh0Lm1haW5IZWFkZXIgPSB0cnVlO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMHhGRkQ5OiAvLyBFbmQgb2YgY29kZXN0cmVhbSAoRU9DKVxuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMHhGRjUxOiAvLyBJbWFnZSBhbmQgdGlsZSBzaXplIChTSVopXG4gICAgICAgICAgICAgIGxlbmd0aCA9IHJlYWRVaW50MTYoZGF0YSwgcG9zaXRpb24pO1xuICAgICAgICAgICAgICB2YXIgc2l6ID0ge307XG4gICAgICAgICAgICAgIHNpei5Yc2l6ID0gcmVhZFVpbnQzMihkYXRhLCBwb3NpdGlvbiArIDQpO1xuICAgICAgICAgICAgICBzaXouWXNpeiA9IHJlYWRVaW50MzIoZGF0YSwgcG9zaXRpb24gKyA4KTtcbiAgICAgICAgICAgICAgc2l6LlhPc2l6ID0gcmVhZFVpbnQzMihkYXRhLCBwb3NpdGlvbiArIDEyKTtcbiAgICAgICAgICAgICAgc2l6LllPc2l6ID0gcmVhZFVpbnQzMihkYXRhLCBwb3NpdGlvbiArIDE2KTtcbiAgICAgICAgICAgICAgc2l6LlhUc2l6ID0gcmVhZFVpbnQzMihkYXRhLCBwb3NpdGlvbiArIDIwKTtcbiAgICAgICAgICAgICAgc2l6LllUc2l6ID0gcmVhZFVpbnQzMihkYXRhLCBwb3NpdGlvbiArIDI0KTtcbiAgICAgICAgICAgICAgc2l6LlhUT3NpeiA9IHJlYWRVaW50MzIoZGF0YSwgcG9zaXRpb24gKyAyOCk7XG4gICAgICAgICAgICAgIHNpei5ZVE9zaXogPSByZWFkVWludDMyKGRhdGEsIHBvc2l0aW9uICsgMzIpO1xuICAgICAgICAgICAgICB2YXIgY29tcG9uZW50c0NvdW50ID0gcmVhZFVpbnQxNihkYXRhLCBwb3NpdGlvbiArIDM2KTtcbiAgICAgICAgICAgICAgc2l6LkNzaXogPSBjb21wb25lbnRzQ291bnQ7XG4gICAgICAgICAgICAgIHZhciBjb21wb25lbnRzID0gW107XG4gICAgICAgICAgICAgIGogPSBwb3NpdGlvbiArIDM4O1xuICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGNvbXBvbmVudHNDb3VudDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgdmFyIGNvbXBvbmVudCA9IHtcbiAgICAgICAgICAgICAgICAgIHByZWNpc2lvbjogKGRhdGFbal0gJiAweDdGKSArIDEsXG4gICAgICAgICAgICAgICAgICBpc1NpZ25lZDogISEoZGF0YVtqXSAmIDB4ODApLFxuICAgICAgICAgICAgICAgICAgWFJzaXo6IGRhdGFbaiArIDFdLFxuICAgICAgICAgICAgICAgICAgWVJzaXo6IGRhdGFbaiArIDFdXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBjYWxjdWxhdGVDb21wb25lbnREaW1lbnNpb25zKGNvbXBvbmVudCwgc2l6KTtcbiAgICAgICAgICAgICAgICBjb21wb25lbnRzLnB1c2goY29tcG9uZW50KTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBjb250ZXh0LlNJWiA9IHNpejtcbiAgICAgICAgICAgICAgY29udGV4dC5jb21wb25lbnRzID0gY29tcG9uZW50cztcbiAgICAgICAgICAgICAgY2FsY3VsYXRlVGlsZUdyaWRzKGNvbnRleHQsIGNvbXBvbmVudHMpO1xuICAgICAgICAgICAgICBjb250ZXh0LlFDQyA9IFtdO1xuICAgICAgICAgICAgICBjb250ZXh0LkNPQyA9IFtdO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMHhGRjVDOiAvLyBRdWFudGl6YXRpb24gZGVmYXVsdCAoUUNEKVxuICAgICAgICAgICAgICBsZW5ndGggPSByZWFkVWludDE2KGRhdGEsIHBvc2l0aW9uKTtcbiAgICAgICAgICAgICAgdmFyIHFjZCA9IHt9O1xuICAgICAgICAgICAgICBqID0gcG9zaXRpb24gKyAyO1xuICAgICAgICAgICAgICBzcWNkID0gZGF0YVtqKytdO1xuICAgICAgICAgICAgICBzd2l0Y2ggKHNxY2QgJiAweDFGKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICAgICAgc3BxY2RTaXplID0gODtcbiAgICAgICAgICAgICAgICAgIHNjYWxhckV4cG91bmRlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgICBzcHFjZFNpemUgPSAxNjtcbiAgICAgICAgICAgICAgICAgIHNjYWxhckV4cG91bmRlZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgICAgc3BxY2RTaXplID0gMTY7XG4gICAgICAgICAgICAgICAgICBzY2FsYXJFeHBvdW5kZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignSlBYIEVycm9yOiBJbnZhbGlkIFNRY2QgdmFsdWUgJyArIHNxY2QpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHFjZC5ub1F1YW50aXphdGlvbiA9IChzcHFjZFNpemUgPT09IDgpO1xuICAgICAgICAgICAgICBxY2Quc2NhbGFyRXhwb3VuZGVkID0gc2NhbGFyRXhwb3VuZGVkO1xuICAgICAgICAgICAgICBxY2QuZ3VhcmRCaXRzID0gc3FjZCA+PiA1O1xuICAgICAgICAgICAgICBzcHFjZHMgPSBbXTtcbiAgICAgICAgICAgICAgd2hpbGUgKGogPCBsZW5ndGggKyBwb3NpdGlvbikge1xuICAgICAgICAgICAgICAgIHZhciBzcHFjZCA9IHt9O1xuICAgICAgICAgICAgICAgIGlmIChzcHFjZFNpemUgPT09IDgpIHtcbiAgICAgICAgICAgICAgICAgIHNwcWNkLmVwc2lsb24gPSBkYXRhW2orK10gPj4gMztcbiAgICAgICAgICAgICAgICAgIHNwcWNkLm11ID0gMDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgc3BxY2QuZXBzaWxvbiA9IGRhdGFbal0gPj4gMztcbiAgICAgICAgICAgICAgICAgIHNwcWNkLm11ID0gKChkYXRhW2pdICYgMHg3KSA8PCA4KSB8IGRhdGFbaiArIDFdO1xuICAgICAgICAgICAgICAgICAgaiArPSAyO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBzcHFjZHMucHVzaChzcHFjZCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgcWNkLlNQcWNkcyA9IHNwcWNkcztcbiAgICAgICAgICAgICAgaWYgKGNvbnRleHQubWFpbkhlYWRlcikge1xuICAgICAgICAgICAgICAgIGNvbnRleHQuUUNEID0gcWNkO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGNvbnRleHQuY3VycmVudFRpbGUuUUNEID0gcWNkO1xuICAgICAgICAgICAgICAgIGNvbnRleHQuY3VycmVudFRpbGUuUUNDID0gW107XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDB4RkY1RDogLy8gUXVhbnRpemF0aW9uIGNvbXBvbmVudCAoUUNDKVxuICAgICAgICAgICAgICBsZW5ndGggPSByZWFkVWludDE2KGRhdGEsIHBvc2l0aW9uKTtcbiAgICAgICAgICAgICAgdmFyIHFjYyA9IHt9O1xuICAgICAgICAgICAgICBqID0gcG9zaXRpb24gKyAyO1xuICAgICAgICAgICAgICB2YXIgY3FjYztcbiAgICAgICAgICAgICAgaWYgKGNvbnRleHQuU0laLkNzaXogPCAyNTcpIHtcbiAgICAgICAgICAgICAgICBjcWNjID0gZGF0YVtqKytdO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGNxY2MgPSByZWFkVWludDE2KGRhdGEsIGopO1xuICAgICAgICAgICAgICAgIGogKz0gMjtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBzcWNkID0gZGF0YVtqKytdO1xuICAgICAgICAgICAgICBzd2l0Y2ggKHNxY2QgJiAweDFGKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICAgICAgc3BxY2RTaXplID0gODtcbiAgICAgICAgICAgICAgICAgIHNjYWxhckV4cG91bmRlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgICBzcHFjZFNpemUgPSAxNjtcbiAgICAgICAgICAgICAgICAgIHNjYWxhckV4cG91bmRlZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgICAgc3BxY2RTaXplID0gMTY7XG4gICAgICAgICAgICAgICAgICBzY2FsYXJFeHBvdW5kZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignSlBYIEVycm9yOiBJbnZhbGlkIFNRY2QgdmFsdWUgJyArIHNxY2QpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHFjYy5ub1F1YW50aXphdGlvbiA9IChzcHFjZFNpemUgPT09IDgpO1xuICAgICAgICAgICAgICBxY2Muc2NhbGFyRXhwb3VuZGVkID0gc2NhbGFyRXhwb3VuZGVkO1xuICAgICAgICAgICAgICBxY2MuZ3VhcmRCaXRzID0gc3FjZCA+PiA1O1xuICAgICAgICAgICAgICBzcHFjZHMgPSBbXTtcbiAgICAgICAgICAgICAgd2hpbGUgKGogPCAobGVuZ3RoICsgcG9zaXRpb24pKSB7XG4gICAgICAgICAgICAgICAgc3BxY2QgPSB7fTtcbiAgICAgICAgICAgICAgICBpZiAoc3BxY2RTaXplID09PSA4KSB7XG4gICAgICAgICAgICAgICAgICBzcHFjZC5lcHNpbG9uID0gZGF0YVtqKytdID4+IDM7XG4gICAgICAgICAgICAgICAgICBzcHFjZC5tdSA9IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgIHNwcWNkLmVwc2lsb24gPSBkYXRhW2pdID4+IDM7XG4gICAgICAgICAgICAgICAgICBzcHFjZC5tdSA9ICgoZGF0YVtqXSAmIDB4NykgPDwgOCkgfCBkYXRhW2ogKyAxXTtcbiAgICAgICAgICAgICAgICAgIGogKz0gMjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgc3BxY2RzLnB1c2goc3BxY2QpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHFjYy5TUHFjZHMgPSBzcHFjZHM7XG4gICAgICAgICAgICAgIGlmIChjb250ZXh0Lm1haW5IZWFkZXIpIHtcbiAgICAgICAgICAgICAgICBjb250ZXh0LlFDQ1tjcWNjXSA9IHFjYztcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb250ZXh0LmN1cnJlbnRUaWxlLlFDQ1tjcWNjXSA9IHFjYztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMHhGRjUyOiAvLyBDb2Rpbmcgc3R5bGUgZGVmYXVsdCAoQ09EKVxuICAgICAgICAgICAgICBsZW5ndGggPSByZWFkVWludDE2KGRhdGEsIHBvc2l0aW9uKTtcbiAgICAgICAgICAgICAgdmFyIGNvZCA9IHt9O1xuICAgICAgICAgICAgICBqID0gcG9zaXRpb24gKyAyO1xuICAgICAgICAgICAgICB2YXIgc2NvZCA9IGRhdGFbaisrXTtcbiAgICAgICAgICAgICAgY29kLmVudHJvcHlDb2RlcldpdGhDdXN0b21QcmVjaW5jdHMgPSAhIShzY29kICYgMSk7XG4gICAgICAgICAgICAgIGNvZC5zb3BNYXJrZXJVc2VkID0gISEoc2NvZCAmIDIpO1xuICAgICAgICAgICAgICBjb2QuZXBoTWFya2VyVXNlZCA9ICEhKHNjb2QgJiA0KTtcbiAgICAgICAgICAgICAgY29kLnByb2dyZXNzaW9uT3JkZXIgPSBkYXRhW2orK107XG4gICAgICAgICAgICAgIGNvZC5sYXllcnNDb3VudCA9IHJlYWRVaW50MTYoZGF0YSwgaik7XG4gICAgICAgICAgICAgIGogKz0gMjtcbiAgICAgICAgICAgICAgY29kLm11bHRpcGxlQ29tcG9uZW50VHJhbnNmb3JtID0gZGF0YVtqKytdO1xuXG4gICAgICAgICAgICAgIGNvZC5kZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQgPSBkYXRhW2orK107XG4gICAgICAgICAgICAgIGNvZC54Y2IgPSAoZGF0YVtqKytdICYgMHhGKSArIDI7XG4gICAgICAgICAgICAgIGNvZC55Y2IgPSAoZGF0YVtqKytdICYgMHhGKSArIDI7XG4gICAgICAgICAgICAgIHZhciBibG9ja1N0eWxlID0gZGF0YVtqKytdO1xuICAgICAgICAgICAgICBjb2Quc2VsZWN0aXZlQXJpdGhtZXRpY0NvZGluZ0J5cGFzcyA9ICEhKGJsb2NrU3R5bGUgJiAxKTtcbiAgICAgICAgICAgICAgY29kLnJlc2V0Q29udGV4dFByb2JhYmlsaXRpZXMgPSAhIShibG9ja1N0eWxlICYgMik7XG4gICAgICAgICAgICAgIGNvZC50ZXJtaW5hdGlvbk9uRWFjaENvZGluZ1Bhc3MgPSAhIShibG9ja1N0eWxlICYgNCk7XG4gICAgICAgICAgICAgIGNvZC52ZXJ0aWNhbHlTdHJpcGUgPSAhIShibG9ja1N0eWxlICYgOCk7XG4gICAgICAgICAgICAgIGNvZC5wcmVkaWN0YWJsZVRlcm1pbmF0aW9uID0gISEoYmxvY2tTdHlsZSAmIDE2KTtcbiAgICAgICAgICAgICAgY29kLnNlZ21lbnRhdGlvblN5bWJvbFVzZWQgPSAhIShibG9ja1N0eWxlICYgMzIpO1xuICAgICAgICAgICAgICBjb2QucmV2ZXJzaWJsZVRyYW5zZm9ybWF0aW9uID0gZGF0YVtqKytdO1xuICAgICAgICAgICAgICBpZiAoY29kLmVudHJvcHlDb2RlcldpdGhDdXN0b21QcmVjaW5jdHMpIHtcbiAgICAgICAgICAgICAgICB2YXIgcHJlY2luY3RzU2l6ZXMgPSBbXTtcbiAgICAgICAgICAgICAgICB3aGlsZSAoaiA8IGxlbmd0aCArIHBvc2l0aW9uKSB7XG4gICAgICAgICAgICAgICAgICB2YXIgcHJlY2luY3RzU2l6ZSA9IGRhdGFbaisrXTtcbiAgICAgICAgICAgICAgICAgIHByZWNpbmN0c1NpemVzLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICBQUHg6IHByZWNpbmN0c1NpemUgJiAweEYsXG4gICAgICAgICAgICAgICAgICAgIFBQeTogcHJlY2luY3RzU2l6ZSA+PiA0XG4gICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY29kLnByZWNpbmN0c1NpemVzID0gcHJlY2luY3RzU2l6ZXM7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgdmFyIHVuc3VwcG9ydGVkID0gW107XG4gICAgICAgICAgICAgIGlmIChjb2Quc2VsZWN0aXZlQXJpdGhtZXRpY0NvZGluZ0J5cGFzcykge1xuICAgICAgICAgICAgICAgIHVuc3VwcG9ydGVkLnB1c2goJ3NlbGVjdGl2ZUFyaXRobWV0aWNDb2RpbmdCeXBhc3MnKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAoY29kLnJlc2V0Q29udGV4dFByb2JhYmlsaXRpZXMpIHtcbiAgICAgICAgICAgICAgICB1bnN1cHBvcnRlZC5wdXNoKCdyZXNldENvbnRleHRQcm9iYWJpbGl0aWVzJyk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKGNvZC50ZXJtaW5hdGlvbk9uRWFjaENvZGluZ1Bhc3MpIHtcbiAgICAgICAgICAgICAgICB1bnN1cHBvcnRlZC5wdXNoKCd0ZXJtaW5hdGlvbk9uRWFjaENvZGluZ1Bhc3MnKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAoY29kLnZlcnRpY2FseVN0cmlwZSkge1xuICAgICAgICAgICAgICAgIHVuc3VwcG9ydGVkLnB1c2goJ3ZlcnRpY2FseVN0cmlwZScpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChjb2QucHJlZGljdGFibGVUZXJtaW5hdGlvbikge1xuICAgICAgICAgICAgICAgIHVuc3VwcG9ydGVkLnB1c2goJ3ByZWRpY3RhYmxlVGVybWluYXRpb24nKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAodW5zdXBwb3J0ZWQubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgIGRvTm90UmVjb3ZlciA9IHRydWU7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdKUFggRXJyb3I6IFVuc3VwcG9ydGVkIENPRCBvcHRpb25zICgnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zdXBwb3J0ZWQuam9pbignLCAnKSArICcpJyk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKGNvbnRleHQubWFpbkhlYWRlcikge1xuICAgICAgICAgICAgICAgIGNvbnRleHQuQ09EID0gY29kO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGNvbnRleHQuY3VycmVudFRpbGUuQ09EID0gY29kO1xuICAgICAgICAgICAgICAgIGNvbnRleHQuY3VycmVudFRpbGUuQ09DID0gW107XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDB4RkY5MDogLy8gU3RhcnQgb2YgdGlsZS1wYXJ0IChTT1QpXG4gICAgICAgICAgICAgIGxlbmd0aCA9IHJlYWRVaW50MTYoZGF0YSwgcG9zaXRpb24pO1xuICAgICAgICAgICAgICB0aWxlID0ge307XG4gICAgICAgICAgICAgIHRpbGUuaW5kZXggPSByZWFkVWludDE2KGRhdGEsIHBvc2l0aW9uICsgMik7XG4gICAgICAgICAgICAgIHRpbGUubGVuZ3RoID0gcmVhZFVpbnQzMihkYXRhLCBwb3NpdGlvbiArIDQpO1xuICAgICAgICAgICAgICB0aWxlLmRhdGFFbmQgPSB0aWxlLmxlbmd0aCArIHBvc2l0aW9uIC0gMjtcbiAgICAgICAgICAgICAgdGlsZS5wYXJ0SW5kZXggPSBkYXRhW3Bvc2l0aW9uICsgOF07XG4gICAgICAgICAgICAgIHRpbGUucGFydHNDb3VudCA9IGRhdGFbcG9zaXRpb24gKyA5XTtcblxuICAgICAgICAgICAgICBjb250ZXh0Lm1haW5IZWFkZXIgPSBmYWxzZTtcbiAgICAgICAgICAgICAgaWYgKHRpbGUucGFydEluZGV4ID09PSAwKSB7XG4gICAgICAgICAgICAgICAgLy8gcmVzZXQgY29tcG9uZW50IHNwZWNpZmljIHNldHRpbmdzXG4gICAgICAgICAgICAgICAgdGlsZS5DT0QgPSBjb250ZXh0LkNPRDtcbiAgICAgICAgICAgICAgICB0aWxlLkNPQyA9IGNvbnRleHQuQ09DLnNsaWNlKDApOyAvLyBjbG9uZSBvZiB0aGUgZ2xvYmFsIENPQ1xuICAgICAgICAgICAgICAgIHRpbGUuUUNEID0gY29udGV4dC5RQ0Q7XG4gICAgICAgICAgICAgICAgdGlsZS5RQ0MgPSBjb250ZXh0LlFDQy5zbGljZSgwKTsgLy8gY2xvbmUgb2YgdGhlIGdsb2JhbCBDT0NcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBjb250ZXh0LmN1cnJlbnRUaWxlID0gdGlsZTtcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDB4RkY5MzogLy8gU3RhcnQgb2YgZGF0YSAoU09EKVxuICAgICAgICAgICAgICB0aWxlID0gY29udGV4dC5jdXJyZW50VGlsZTtcbiAgICAgICAgICAgICAgaWYgKHRpbGUucGFydEluZGV4ID09PSAwKSB7XG4gICAgICAgICAgICAgICAgaW5pdGlhbGl6ZVRpbGUoY29udGV4dCwgdGlsZS5pbmRleCk7XG4gICAgICAgICAgICAgICAgYnVpbGRQYWNrZXRzKGNvbnRleHQpO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgLy8gbW92aW5nIHRvIHRoZSBlbmQgb2YgdGhlIGRhdGFcbiAgICAgICAgICAgICAgbGVuZ3RoID0gdGlsZS5kYXRhRW5kIC0gcG9zaXRpb247XG4gICAgICAgICAgICAgIHBhcnNlVGlsZVBhY2tldHMoY29udGV4dCwgZGF0YSwgcG9zaXRpb24sIGxlbmd0aCk7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAweEZGNTU6IC8vIFRpbGUtcGFydCBsZW5ndGhzLCBtYWluIGhlYWRlciAoVExNKVxuICAgICAgICAgICAgY2FzZSAweEZGNTc6IC8vIFBhY2tldCBsZW5ndGgsIG1haW4gaGVhZGVyIChQTE0pXG4gICAgICAgICAgICBjYXNlIDB4RkY1ODogLy8gUGFja2V0IGxlbmd0aCwgdGlsZS1wYXJ0IGhlYWRlciAoUExUKVxuICAgICAgICAgICAgY2FzZSAweEZGNjQ6IC8vIENvbW1lbnQgKENPTSlcbiAgICAgICAgICAgICAgbGVuZ3RoID0gcmVhZFVpbnQxNihkYXRhLCBwb3NpdGlvbik7XG4gICAgICAgICAgICAgIC8vIHNraXBwaW5nIGNvbnRlbnRcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDB4RkY1MzogLy8gQ29kaW5nIHN0eWxlIGNvbXBvbmVudCAoQ09DKVxuICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0pQWCBFcnJvcjogQ29kZXN0cmVhbSBjb2RlIDB4RkY1MyAoQ09DKSBpcyAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdub3QgaW1wbGVtZW50ZWQnKTtcbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignSlBYIEVycm9yOiBVbmtub3duIGNvZGVzdHJlYW0gY29kZTogJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlLnRvU3RyaW5nKDE2KSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHBvc2l0aW9uICs9IGxlbmd0aDtcbiAgICAgICAgfVxuICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICBpZiAoZG9Ob3RSZWNvdmVyIHx8IHRoaXMuZmFpbE9uQ29ycnVwdGVkSW1hZ2UpIHtcbiAgICAgICAgICB0aHJvdyBlO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHdhcm4oJ1RyeWluZyB0byByZWNvdmVyIGZyb20gJyArIGUubWVzc2FnZSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHRoaXMudGlsZXMgPSB0cmFuc2Zv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guY2VpbCgoc2l6LlhzaXogLSBzaXouWFRPc2l6KSAvIHNpei5YVHNpeik7XG4gICAgdmFyIG51bVl0aWxlcyA9IE1hdGguY2VpbCgoc2l6LllzaXogLSBzaXouWVRPc2l6KSAvIHNpei5ZVHNpeik7XG4gICAgZm9yICh2YXIgcSA9IDA7IHEgPCBudW1ZdGlsZXM7IHErKykge1xuICAgICAgZm9yICh2YXIgcCA9IDA7IHAgPCBudW1YdGlsZXM7IHArKykge1xuICAgICAgICB0aWxlID0ge307XG4gICAgICAgIHRpbGUudHgwID0gTWF0aC5tYXgoc2l6LlhUT3NpeiArIHAgKiBzaXouWFRzaXosIHNpei5YT3Npeik7XG4gICAgICAgIHRpbGUudHkwID0gTWF0aC5tYXgoc2l6LllUT3NpeiArIHEgKiBzaXouWVRzaXosIHNpei5ZT3Npeik7XG4gICAgICAgIHRpbGUudHgxID0gTWF0aC5taW4oc2l6LlhUT3NpeiArIChwICsgMSkgKiBzaXouWFRzaXosIHNpei5Yc2l6KTtcbiAgICAgICAgdGlsZS50eTEgPSBNYXRoLm1pbihzaXouWVRPc2l6ICsgKHEgKyAxKSAqIHNpei5ZVHNpeiwgc2l6LllzaXopO1xuICAgICAgICB0aWxlLndpZHRoID0gdGlsZS50eDEgLSB0aWxlLnR4MDtcbiAgICAgICAgdGlsZS5oZWlnaHQgPSB0aWxlLnR5MSAtIHRpbGUudHkwO1xuICAgICAgICB0aWxlLmNvbXBvbmVudHMgPSBbXTtcbiAgICAgICAgdGlsZXMucHVzaCh0aWxlKTtcbiAgICAgIH1cbiAgICB9XG4gICAgY29udGV4dC50aWxlcyA9IHRpbGVzO1xuXG4gICAgdmFyIGNvbXBvbmVudHNDb3VudCA9IHNpei5Dc2l6O1xuICAgIGZvciAodmFyIGkgPSAwLCBpaSA9IGNvbXBvbmVudHNDb3VudDsgaSA8IGlpOyBpKyspIHtcbiAgICAgIHZhciBjb21wb25lbnQgPSBjb21wb25lbnRzW2ldO1xuICAgICAgZm9yICh2YXI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ViYmFuZC50YngwKSAvXG4gICAgICAgICAgcHJlY2luY3RQYXJhbWV0ZXJzLnByZWNpbmN0V2lkdGhJblN1YmJhbmQpO1xuICAgICAgICB2YXIgcGogPSBNYXRoLmZsb29yKChjb2RlYmxvY2sudGJ5MF8gLSBzdWJiYW5kLnRieTApIC9cbiAgICAgICAgICBwcmVjaW5jdFBhcmFtZXRlcnMucHJlY2luY3RIZWlnaHRJblN1YmJhbmQpO1xuICAgICAgICBwcmVjaW5jdE51bWJlciA9IHBpICsgKHBqICogcHJlY2luY3RQYXJhbWV0ZXJzLm51bXByZWNpbmN0c3dpZGUpO1xuXG4gICAgICAgIGNvZGVibG9jay5wcmVjaW5jdE51bWJlciA9IHByZWNpbmN0TnVtYmVyO1xuICAgICAgICBjb2RlYmxvY2suc3ViYmFuZFR5cGUgPSBzdWJiYW5kLnR5cGU7XG4gICAgICAgIGNvZGVibG9jay5MYmxvY2sgPSAzO1xuXG4gICAgICAgIGlmIChjb2RlYmxvY2sudGJ4MV8gPD0gY29kZWJsb2NrLnRieDBfIHx8XG4gICAgICAgICAgICBjb2RlYmxvY2sudGJ5MV8gPD0gY29kZWJsb2NrLnRieTBfKSB7XG4gICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cbiAgICAgICAgY29kZWJsb2Nrcy5wdXNoKGNvZGVibG9jayk7XG4gICAgICAgIC8vIGJ1aWxkaW5nIHByZWNpbmN0IGZvciB0aGUgc3ViLWJhbmRcbiAgICAgICAgdmFyIHByZWNpbmN0ID0gcHJlY2luY3RzW3ByZWNpbmN0TnVtYmVyXTtcbiAgICAgICAgaWYgKHByZWNpbmN0ICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICBpZiAoaSA8IHByZWNpbmN0LmNieE1pbikge1xuICAgICAgICAgICAgcHJlY2luY3QuY2J4TWluID0gaTtcbiAgICAgICAgICB9IGVsc2UgaWYgKGkgPiBwcmVjaW5jdC5jYnhNYXgpIHtcbiAgICAgICAgICAgIHByZWNpbmN0LmNieE1heCA9IGk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChqIDwgcHJlY2luY3QuY2J5TWluKSB7XG4gICAgICAgICAgICBwcmVjaW5jdC5jYnhNaW4gPSBqO1xuICAgICAgICAgIH0gZWxzZSBpZiAoaiA+IHByZWNpbmN0LmNieU1heCkge1xuICAgICAgICAgICAgcHJlY2luY3QuY2J5TWF4ID0gajtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgcHJlY2luY3RzW3ByZWNpbmN0TnVtYmVyXSA9IHByZWNpbmN0ID0ge1xuICAgICAgICAgICAgY2J4TWluOiBpLFxuICAgICAgICAgICAgY2J5TWluOiBqLFxuICAgICAgICAgICAgY2J4TWF4OiBpLFxuICAgICAgICAgICAgY2J5TWF4OiBqXG4gICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBjb2RlYmxvY2sucHJlY2luY3QgPSBwcmVjaW5jdDtcbiAgICAgIH1cbiAgICB9XG4gICAgc3ViYmFuZC5jb2RlYmxvY2tQYXJhbWV0ZXJzID0ge1xuICAgICAgY29kZWJsb2NrV2lkdGg6IHhjYl8sXG4gICAgICBjb2RlYmxvY2tIZWlnaHQ6IHljYl8sXG4gICAgICBudW1jb2RlYmxvY2t3aWRlOiBjYngxIC0gY2J4MCArIDEsXG4gICAgICBudW1jb2RlYmxvY2toaWdoOiBjYnkxIC0gY2J5MCArIDFcbiAgICB9O1xuICAgIHN1YmJhbmQuY29kZWJsb2NrcyA9IGNvZGVibG9ja3M7XG4gICAgc3ViYmFuZC5wcmVjaW5jdHMgPSBwcmVjaW5jdHM7XG4gIH1cbiAgZnVuY3Rpb24gY3JlYXRlUGFja2V0KHJlc29sdXRpb24sIHByZWNpbmN0TnVtYmVyLCBsYXllck51bWJlcikge1xuICAgIHZhciBwcmVjaW5jdENvZGVibG9ja3MgPSBbXTtcbiAgICAvLyBTZWN0aW9uIEIuMTAuOCBPcmRlciBvZiBpbmZvIGluIHBhY2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XJhbWV0ZXJzLmxheWVyc0NvdW50O1xuICAgIHZhciBjb21wb25lbnRzQ291bnQgPSBzaXouQ3NpejtcbiAgICB2YXIgbWF4RGVjb21wb3NpdGlvbkxldmVsc0NvdW50ID0gMDtcbiAgICBmb3IgKHZhciBxID0gMDsgcSA8IGNvbXBvbmVudHNDb3VudDsgcSsrKSB7XG4gICAgICBtYXhEZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQgPSBNYXRoLm1heChtYXhEZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQsXG4gICAgICAgIHRpbGUuY29tcG9uZW50c1txXS5jb2RpbmdTdHlsZVBhcmFtZXRlcnMuZGVjb21wb3NpdGlvbkxldmVsc0NvdW50KTtcbiAgICB9XG5cbiAgICB2YXIgbCA9IDAsIHIgPSAwLCBpID0gMCwgayA9IDA7XG5cbiAgICB0aGlzLm5leHRQYWNrZXQgPSBmdW5jdGlvbiBKcHhJbWFnZV9uZXh0UGFja2V0KCkge1xuICAgICAgLy8gU2VjdGlvbiBCLjEyLjEuMSBMYXllci1yZXNvbHV0aW9uLWNvbXBvbmVudC1wb3NpdGlvblxuICAgICAgZm9yICg7IGwgPCBsYXllcnNDb3VudDsgbCsrKSB7XG4gICAgICAgIGZvciAoOyByIDw9IG1heERlY29tcG9zaXRpb25MZXZlbHNDb3VudDsgcisrKSB7XG4gICAgICAgICAgZm9yICg7IGkgPCBjb21wb25lbnRzQ291bnQ7IGkrKykge1xuICAgICAgICAgICAgdmFyIGNvbXBvbmVudCA9IHRpbGUuY29tcG9uZW50c1tpXTtcbiAgICAgICAgICAgIGlmIChyID4gY29tcG9uZW50LmNvZGluZ1N0eWxlUGFyYW1ldGVycy5kZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQpIHtcbiAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciByZXNvbHV0aW9uID0gY29tcG9uZW50LnJlc29sdXRpb25zW3JdO1xuICAgICAgICAgICAgdmFyIG51bXByZWNpbmN0cyA9IHJlc29sdXRpb24ucHJlY2luY3RQYXJhbWV0ZXJzLm51bXByZWNpbmN0cztcbiAgICAgICAgICAgIGZvciAoOyBrIDwgbnVtcHJlY2luY3RzOykge1xuICAgICAgICAgICAgICB2YXIgcGFja2V0ID0gY3JlYXRlUGFja2V0KHJlc29sdXRpb24sIGssIGwpO1xuICAgICAgICAgICAgICBrKys7XG4gICAgICAgICAgICAgIHJldHVybiBwYWNrZXQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBrID0gMDtcbiAgICAgICAgICB9XG4gICAgICAgICAgaSA9IDA7XG4gICAgICAgIH1cbiAgICAgICAgciA9IDA7XG4gICAgICB9XG4gICAgfTtcbiAgfVxuICBmdW5jdGlvbiBSZXNvbHV0aW9uTGF5ZXJDb21wb25lbnRQb3NpdGlvbkl0ZXJhdG9yKGNvbnRleHQpIHtcbiAgICB2YXIgc2l6ID0gY29udGV4dC5TSVo7XG4gICAgdmFyIHRpbGVJbmRleCA9IGNvbnRleHQuY3VycmVudFRpbGUuaW5kZXg7XG4gICAgdmFyIHRpbGUgPSBjb250ZXh0LnRpbGVzW3RpbGVJbmRleF07XG4gICAgdmFyIGxheWVyc0NvdW50ID0gdGlsZS5jb2RpbmdTdHlsZURlZmF1bHRQYXJhbWV0ZXJzLmxheWVyc0NvdW50O1xuICAgIHZhciBjb21wb25lbnRzQ291bnQgPSBzaXouQ3NpejtcbiAgICB2YXIgbWF4RGVjb21wb3NpdGlvbkxldmVsc0NvdW50ID0gMDtcbiAgICBmb3IgKHZhciBxID0gMDsgcSA8IGNvbXBvbmVudHNDb3VudDsgcSsrKSB7XG4gICAgICBtYXhEZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQgPSBNYXRoLm1heChtYXhEZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQsXG4gICAgICAgIHRpbGUuY29tcG9uZW50c1txXS5jb2RpbmdTdHlsZVBhcmFtZXRlcnMuZGVjb21wb3NpdGlvbkxldmVsc0NvdW50KTtcbiAgICB9XG5cbiAgICB2YXIgciA9IDAsIGwgPSAwLCBpID0gMCwgayA9IDA7XG5cbiAgICB0aGlzLm5leHRQYWNrZXQgPSBmdW5jdGlvbiBKcHhJbWFnZV9uZXh0UGFja2V0KCkge1xuICAgICAgLy8gU2VjdGlvbiBCLjEyLjEuMiBSZXNvbHV0aW9uLWxheWVyLWNvbXBvbmVudC1wb3NpdGlvblxuICAgICAgZm9yICg7IHIgPD0gbWF4RGVjb21wb3NpdGlvbkxldmVsc0NvdW50OyByKyspIHtcbiAgICAgICAgZm9yICg7IGwgPCBsYXllcnNDb3VudDsgbCsrKSB7XG4gICAgICAgICAgZm9yICg7IGkgPCBjb21wb25lbnRzQ291bnQ7IGkrKykge1xuICAgICAgICAgICAgdmFyIGNvbXBvbmVudCA9IHRpbGUuY29tcG9uZW50c1tpXTtcbiAgICAgICAgICAgIGlmIChyID4gY29tcG9uZW50LmNvZGluZ1N0eWxlUGFyYW1ldGVycy5kZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQpIHtcbiAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciByZXNvbHV0aW9uID0gY29tcG9uZW50LnJlc29sdXRpb25zW3JdO1xuICAgICAgICAgICAgdmFyIG51bXByZWNpbmN0cyA9IHJlc29sdXRpb24ucHJlY2luY3RQYXJhbWV0ZXJzLm51bXByZWNpbmN0cztcbiAgICAgICAgICAgIGZvciAoOyBrIDwgbnVtcHJlY2luY3RzOykge1xuICAgICAgICAgICAgICB2YXIgcGFja2V0ID0gY3JlYXRlUGFja2V0KHJlc29sdXRpb24sIGssIGwpO1xuICAgICAgICAgICAgICBrKys7XG4gICAgICAgICAgICAgIHJldHVybiBwYWNrZXQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBrID0gMDtcbiAgICAgICAgICB9XG4gICAgICAgICAgaSA9IDA7XG4gICAgICAgIH1cbiAgICAg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b3VudDsgKytjKSB7XG4gICAgICAgIHZhciByZXNvbHV0aW9ucyA9IHRpbGUuY29tcG9uZW50c1tjXS5yZXNvbHV0aW9ucztcbiAgICAgICAgaWYgKHIgPCByZXNvbHV0aW9ucy5sZW5ndGgpIHtcbiAgICAgICAgICBtYXhOdW1QcmVjaW5jdHMgPSBNYXRoLm1heChtYXhOdW1QcmVjaW5jdHMsXG4gICAgICAgICAgICByZXNvbHV0aW9uc1tyXS5wcmVjaW5jdFBhcmFtZXRlcnMubnVtcHJlY2luY3RzKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgbWF4TnVtUHJlY2luY3RzSW5MZXZlbFtyXSA9IG1heE51bVByZWNpbmN0cztcbiAgICB9XG4gICAgbCA9IDA7XG4gICAgciA9IDA7XG4gICAgYyA9IDA7XG4gICAgcCA9IDA7XG5cbiAgICB0aGlzLm5leHRQYWNrZXQgPSBmdW5jdGlvbiBKcHhJbWFnZV9uZXh0UGFja2V0KCkge1xuICAgICAgLy8gU2VjdGlvbiBCLjEyLjEuMyBSZXNvbHV0aW9uLXBvc2l0aW9uLWNvbXBvbmVudC1sYXllclxuICAgICAgZm9yICg7IHIgPD0gbWF4RGVjb21wb3NpdGlvbkxldmVsc0NvdW50OyByKyspIHtcbiAgICAgICAgZm9yICg7IHAgPCBtYXhOdW1QcmVjaW5jdHNJbkxldmVsW3JdOyBwKyspIHtcbiAgICAgICAgICBmb3IgKDsgYyA8IGNvbXBvbmVudHNDb3VudDsgYysrKSB7XG4gICAgICAgICAgICB2YXIgY29tcG9uZW50ID0gdGlsZS5jb21wb25lbnRzW2NdO1xuICAgICAgICAgICAgaWYgKHIgPiBjb21wb25lbnQuY29kaW5nU3R5bGVQYXJhbWV0ZXJzLmRlY29tcG9zaXRpb25MZXZlbHNDb3VudCkge1xuICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciByZXNvbHV0aW9uID0gY29tcG9uZW50LnJlc29sdXRpb25zW3JdO1xuICAgICAgICAgICAgdmFyIG51bXByZWNpbmN0cyA9IHJlc29sdXRpb24ucHJlY2luY3RQYXJhbWV0ZXJzLm51bXByZWNpbmN0cztcbiAgICAgICAgICAgIGlmIChwID49IG51bXByZWNpbmN0cykge1xuICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZvciAoOyBsIDwgbGF5ZXJzQ291bnQ7KSB7XG4gICAgICAgICAgICAgIHZhciBwYWNrZXQgPSBjcmVhdGVQYWNrZXQocmVzb2x1dGlvbiwgcCwgbCk7XG4gICAgICAgICAgICAgIGwrKztcbiAgICAgICAgICAgICAgcmV0dXJuIHBhY2tldDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGwgPSAwO1xuICAgICAgICAgIH1cbiAgICAgICAgICBjID0gMDtcbiAgICAgICAgfVxuICAgICAgICBwID0gMDtcbiAgICAgIH1cbiAgICB9O1xuICB9XG4gIGZ1bmN0aW9uIFBvc2l0aW9uQ29tcG9uZW50UmVzb2x1dGlvbkxheWVySXRlcmF0b3IoY29udGV4dCkge1xuICAgIHZhciBzaXogPSBjb250ZXh0LlNJWjtcbiAgICB2YXIgdGlsZUluZGV4ID0gY29udGV4dC5jdXJyZW50VGlsZS5pbmRleDtcbiAgICB2YXIgdGlsZSA9IGNvbnRleHQudGlsZXNbdGlsZUluZGV4XTtcbiAgICB2YXIgbGF5ZXJzQ291bnQgPSB0aWxlLmNvZGluZ1N0eWxlRGVmYXVsdFBhcmFtZXRlcnMubGF5ZXJzQ291bnQ7XG4gICAgdmFyIGNvbXBvbmVudHNDb3VudCA9IHNpei5Dc2l6O1xuICAgIHZhciBwcmVjaW5jdHNTaXplcyA9IGdldFByZWNpbmN0U2l6ZXNJbkltYWdlU2NhbGUodGlsZSk7XG4gICAgdmFyIHByZWNpbmN0c0l0ZXJhdGlvblNpemVzID0gcHJlY2luY3RzU2l6ZXM7XG4gICAgdmFyIGwgPSAwLCByID0gMCwgYyA9IDAsIHB4ID0gMCwgcHkgPSAwO1xuXG4gICAgdGhpcy5uZXh0UGFja2V0ID0gZnVuY3Rpb24gSnB4SW1hZ2VfbmV4dFBhY2tldCgpIHtcbiAgICAgIC8vIFNlY3Rpb24gQi4xMi4xLjQgUG9zaXRpb24tY29tcG9uZW50LXJlc29sdXRpb24tbGF5ZXJcbiAgICAgIGZvciAoOyBweSA8IHByZWNpbmN0c0l0ZXJhdGlvblNpemVzLm1heE51bUhpZ2g7IHB5KyspIHtcbiAgICAgICAgZm9yICg7IHB4IDwgcHJlY2luY3RzSXRlcmF0aW9uU2l6ZXMubWF4TnVtV2lkZTsgcHgrKykge1xuICAgICAgICAgIGZvciAoOyBjIDwgY29tcG9uZW50c0NvdW50OyBjKyspIHtcbiAgICAgICAgICAgIHZhciBjb21wb25lbnQgPSB0aWxlLmNvbXBvbmVudHNbY107XG4gICAgICAgICAgICB2YXIgZGVjb21wb3NpdGlvbkxldmVsc0NvdW50ID1cbiAgICAgICAgICAgICAgY29tcG9uZW50LmNvZGluZ1N0eWxlUGFyYW1ldGVycy5kZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQ7XG4gICAgICAgICAgICBmb3IgKDsgciA8PSBkZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQ7IHIrKykge1xuICAgICAgICAgICAgICB2YXIgcmVzb2x1dGlvbiA9IGNvbXBvbmVudC5yZXNvbHV0aW9uc1tyXTtcbiAgICAgICAgICAgICAgdmFyIHNpemVJbkltYWdlU2NhbGUgPVxuICAgICAgICAgICAgICAgIHByZWNpbmN0c1NpemVzLmNvbXBvbmVudHNbY10ucmVzb2x1dGlvbnNbcl07XG4gICAgICAgICAgICAgIHZhciBrID0gZ2V0UHJlY2luY3RJbmRleElmRXhpc3QoXG4gICAgICAgICAgICAgICAgcHgsXG4gICAgICAgICAgICAgICAgcHksXG4gICAgICAgICAgICAgICAgc2l6ZUluSW1hZ2VTY2FsZSxcbiAgICAgICAgICAgICAgICBwcmVjaW5jdHNJdGVyYXRpb25TaXplcyxcbiAgICAgICAgICAgICAgICByZXNvbHV0aW9uKTtcbiAgICAgICAgICAgICAgaWYgKGsgPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBmb3IgKDsgbCA8IGxheWVyc0NvdW50Oykge1xuICAgICAgICAgICAgICAgIHZhciBwYWNrZXQgPSBjcmVhdGVQYWNrZXQocmVzb2x1dGlvbiwgaywgbCk7XG4gICAgICAgICAgICAgICAgbCsrO1xuICAgICAgICAgICAgICAgIHJldHVybiBwYWNrZXQ7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgbCA9IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByID0gMDtcbiAgICAgICAgICB9XG4gICAgICAgICAgYyA9IDA7XG4gICAgICAgIH1cbiAgICAgICAgcHggPSAwO1xuICAgICAgfVxuICAgIH07XG4gIH1cbiAgZnVuY3Rpb24gQ29tcG9uZW50UG9zaXRpb25SZXNvbHV0aW9uTGF5ZXJJdGVyYXRvcihjb250ZXh0KSB7XG4gICAgdmFyIHNpeiA9IGNvbnRleHQuU0laO1xuICAgIHZhciB0aWxlSW5kZXggPSBjb250ZXh0LmN1cnJlbnRUaWxlLmluZGV4O1xuICAgIHZhciB0aWxlID0gY29udGV4dC50aWxlc1t0aWxlSW5kZXhdO1xuICAgIHZhciBsYXllcnNDb3VudCA9IHRpbGUuY29kaW5nU3R5bGVEZWZhdWx0UGFyYW1ldGVycy5sYXllcnNDb3VudDtcbiAgICB2YXIgY29tcG9uZW50c0NvdW50ID0gc2l6LkNzaXo7XG4gICAgdmFyIHByZWNpbmN0c1NpemVzID0gZ2V0UHJlY2luY3RTaXplc0luSW1hZ2VTY2FsZSh0aWxlKTtcbiAgICB2YXIgbCA9IDAsIHIgPSAwLCBjID0gMCwgcHggPSAwLCBweSA9IDA7XG5cbiAgICB0aGlzLm5leHRQYWNrZXQgPSBmdW5jdGlvbiBKcHhJbWFnZV9uZXh0UGFja2V0KCkge1xuICAgICAgLy8gU2VjdGlvbiBCLjEyLjEuNSBDb21wb25lbnQtcG9zaXRpb24tcmVzb2x1dGlvbi1sYXllclxuICAgICAgZm9yICg7IGMgPCBjb21wb25lbnRzQ291bnQ7ICsrYykge1xuICAgICAgICB2YXIgY29tcG9uZW50ID0gdGlsZS5jb21wb25lbnRzW2NdO1xuICAgICAgICB2YXIgcHJlY2luY3RzSXRlcmF0aW9uU2l6ZXMgPSBwcmVjaW5jdHNTaXplcy5jb21wb25lbnRzW2NdO1xuICAgICAgICB2YXIgZGVjb21wb3NpdGlvbkxldmVsc0NvdW50ID1cbiAgICAgICAgICBjb21wb25lbnQuY29kaW5nU3R5bGVQYXJhbWV0ZXJzLmRlY29tcG9zaXRpb25MZXZlbHNDb3VudDtcbiAgICAgICAgZm9yICg7IHB5IDwgcHJlY2luY3RzSXRlcmF0aW9uU2l6ZXMubWF4TnVtSGlnaDsgcHkrKykge1xuICAgICAgICAgIGZvciAoOyBweCA8IHByZWNpbmN0c0l0ZXJhdGlvblNpemVzLm1heE51bVdpZGU7IHB4KyspIHtcbiAgICAgICAgICAgIGZvciAoOyByIDw9IGRlY29tcG9zaXRpb25MZXZlbHNDb3VudDsgcisrKSB7XG4gICAgICAgICAgICAgIHZhciByZXNvbHV0aW9uID0gY29tcG9uZW50LnJlc29sdXRpb25zW3JdO1xuICAgICAgICAgICAgICB2YXIgc2l6ZUluSW1hZ2VTY2FsZSA9IHByZWNpbmN0c0l0ZXJhdGlvblNpemVzLnJlc29sdXRpb25zW3JdO1xuICAgICAgICAgICAgICB2YXIgayA9IGdldFByZWNpbmN0SW5kZXhJZkV4aXN0KFxuICAgICAgICAgICAgICAgIHB4LFxuICAgICAgICAgICAgICAgIHB5LFxuICAgICAgICAgICAgICAgIHNpemVJbkltYWdlU2NhbGUsXG4gICAgICAgICAgICAgICAgcHJlY2luY3RzSXRlcmF0aW9uU2l6ZXMsXG4gICAgICAgICAgICAgICAgcmVzb2x1dGlvbik7XG4gICAgICAgICAgICAgIGlmIChrID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgZm9yICg7IGwgPCBsYXllcnNDb3VudDspIHtcbiAgICAgICAgICAgICAgICB2YXIgcGFja2V0ID0gY3JlYXRlUGFja2V0KHJlc29sdXRpb24sIGssIGwpO1xuICAgICAgICAgICAgICAgIGwrKztcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFja2V0O1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGwgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgciA9IDA7XG4gICAgICAgICAgfVxuICAgICAgICAgIHB4ID0gMDtcbiAgICAgICAgfVxuICAgICAgICBweSA9IDA7XG4gICAgICB9XG4gICAgfTtcbiAgfVxuICBmdW5jdGlvbiBnZXRQcmVjaW5jdEluZGV4SWZFeGlzdChcbiAgICBweEluZGV4LCBweUluZGV4LCBzaXplSW5JbWFnZVNjYWxlLCBwcmVjaW5jdEl0ZXJhdGlvblNpemVzLCByZXNvbHV0aW9uKSB7XG4gICAgdmFyIHBvc1ggPSBweEluZGV4ICogcHJlY2luY3RJdGVyYXRpb25TaXplcy5taW5XaWR0aDtcbiAgICB2YXIgcG9zWSA9IHB5SW5kZXggKiBwcmVjaW5jdEl0ZXJhdGlvblNpemVzLm1pbkhlaWdodDtcbiAgICBpZiAocG9zWCAlIHNpemVJbkltYWdlU2NhbGUud2lkdGggIT09IDAgfHxcbiAgICAgICAgcG9zWSAlIHNpemVJbkltYWdlU2NhbGUuaGVpZ2h0ICE9PSAwKSB7XG4gICAgICByZXR1cm4gbnVsbDtcbiAgICB9XG4gICAgdmFyIHN0YXJ0UHJlY2luY3RSb3dJbmRleCA9XG4gICAgICAocG9zWSAvIHNpemVJbkltYWdlU2NhbGUud2lkdGgpICpcbiAgICAgIHJlc29sdXRpb24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XIgbWF4TnVtSGlnaEN1cnJlbnRDb21wb25lbnQgPSAwO1xuICAgICAgdmFyIHNjYWxlID0gMTtcbiAgICAgIGZvciAodmFyIHIgPSBkZWNvbXBvc2l0aW9uTGV2ZWxzQ291bnQ7IHIgPj0gMDsgLS1yKSB7XG4gICAgICAgIHZhciByZXNvbHV0aW9uID0gY29tcG9uZW50LnJlc29sdXRpb25zW3JdO1xuICAgICAgICB2YXIgd2lkdGhDdXJyZW50UmVzb2x1dGlvbiA9XG4gICAgICAgICAgc2NhbGUgKiByZXNvbHV0aW9uLnByZWNpbmN0UGFyYW1ldGVycy5wcmVjaW5jdFdpZHRoO1xuICAgICAgICB2YXIgaGVpZ2h0Q3VycmVudFJlc29sdXRpb24gPVxuICAgICAgICAgIHNjYWxlICogcmVzb2x1dGlvbi5wcmVjaW5jdFBhcmFtZXRlcnMucHJlY2luY3RIZWlnaHQ7XG4gICAgICAgIG1pbldpZHRoQ3VycmVudENvbXBvbmVudCA9IE1hdGgubWluKFxuICAgICAgICAgIG1pbldpZHRoQ3VycmVudENvbXBvbmVudCxcbiAgICAgICAgICB3aWR0aEN1cnJlbnRSZXNvbHV0aW9uKTtcbiAgICAgICAgbWluSGVpZ2h0Q3VycmVudENvbXBvbmVudCA9IE1hdGgubWluKFxuICAgICAgICAgIG1pbkhlaWdodEN1cnJlbnRDb21wb25lbnQsXG4gICAgICAgICAgaGVpZ2h0Q3VycmVudFJlc29sdXRpb24pO1xuICAgICAgICBtYXhOdW1XaWRlQ3VycmVudENvbXBvbmVudCA9IE1hdGgubWF4KG1heE51bVdpZGVDdXJyZW50Q29tcG9uZW50LFxuICAgICAgICAgIHJlc29sdXRpb24ucHJlY2luY3RQYXJhbWV0ZXJzLm51bXByZWNpbmN0c3dpZGUpO1xuICAgICAgICBtYXhOdW1IaWdoQ3VycmVudENvbXBvbmVudCA9IE1hdGgubWF4KG1heE51bUhpZ2hDdXJyZW50Q29tcG9uZW50LFxuICAgICAgICAgIHJlc29sdXRpb24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ICAgICAgICAgICBwcmVjaW5jdC5pbmNsdXNpb25UcmVlID0gaW5jbHVzaW9uVHJlZTtcbiAgICAgICAgICAgICAgcHJlY2luY3QuemVyb0JpdFBsYW5lc1RyZWUgPSB6ZXJvQml0UGxhbmVzVHJlZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaW5jbHVzaW9uVHJlZS5yZXNldChjb2RlYmxvY2tDb2x1bW4sIGNvZGVibG9ja1JvdywgbGF5ZXJOdW1iZXIpO1xuICAgICAgICAgICAgd2hpbGUgKHRydWUpIHtcbiAgICAgICAgICAgICAgaWYgKHBvc2l0aW9uID49IGRhdGEubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChpbmNsdXNpb25UcmVlLmlzQWJvdmVUaHJlc2hvbGQoKSl7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKGluY2x1c2lvblRyZWUuaXNLbm93bigpKSB7XG4gICAgICAgICAgICAgICAgaW5jbHVzaW9uVHJlZS5uZXh0TGV2ZWwoKTtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAocmVhZEJpdHMoMSkpIHtcbiAgICAgICAgICAgICAgICBpbmNsdXNpb25UcmVlLnNldEtub3duKCk7XG4gICAgICAgICAgICAgICAgaWYgKGluY2x1c2lvblRyZWUuaXNMZWFmKCkpIHtcbiAgICAgICAgICAgICAgICAgIGNvZGVibG9jay5pbmNsdWRlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICBjb2RlYmxvY2tJbmNsdWRlZCA9IGZpcnN0VGltZUluY2x1c2lvbiA9IHRydWU7XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgaW5jbHVzaW9uVHJlZS5uZXh0TGV2ZWwoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaW5jbHVzaW9uVHJlZS5pbmNyZW1lbnRWYWx1ZSgpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmICghY29kZWJsb2NrSW5jbHVkZWQpIHtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoZmlyc3RUaW1lSW5jbHVzaW9uKSB7XG4gICAgICAgICAgICB6ZXJvQml0UGxhbmVzVHJlZSA9IHByZWNpbmN0Lnplcm9CaXRQbGFuZXNUcmVlO1xuICAgICAgICAgICAgemVyb0JpdFBsYW5lc1RyZWUucmVzZXQoY29kZWJsb2NrQ29sdW1uLCBjb2RlYmxvY2tSb3cpO1xuICAgICAgICAgICAgd2hpbGUgKHRydWUpIHtcbiAgICAgICAgICAgICAgaWYgKHBvc2l0aW9uID49IGRhdGEubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChyZWFkQml0cygxKSkge1xuICAgICAgICAgICAgICAgIHZhbHVlUmVhZHkgPSAhemVyb0JpdFBsYW5lc1RyZWUubmV4dExldmVsKCk7XG4gICAgICAgICAgICAgICAgaWYgKHZhbHVlUmVhZHkpIHtcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB6ZXJvQml0UGxhbmVzVHJlZS5pbmNyZW1lbnRWYWx1ZSgpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjb2RlYmxvY2suemVyb0JpdFBsYW5lcyA9IHplcm9CaXRQbGFuZXNUcmVlLnZhbHVlO1xuICAgICAgICAgIH1cbiAgICAgICAgICB2YXIgY29kaW5ncGFzc2VzID0gcmVhZENvZGluZ3Bhc3NlcygpO1xuICAgICAgICAgIHdoaWxlIChyZWFkQml0cygxKSkge1xuICAgICAgICAgICAgY29kZWJsb2NrLkxibG9jaysrO1xuICAgICAgICAgIH1cbiAgICAgICAgICB2YXIgY29kaW5ncGFzc2VzTG9nMiA9IGxvZzIoY29kaW5ncGFzc2VzKTtcbiAgICAgICAgICAvLyByb3VuZGluZyBkb3duIGxvZzJcbiAgICAgICAgICB2YXIgYml0cyA9ICgoY29kaW5ncGFzc2VzIDwgKDEgPDwgY29kaW5ncGFzc2VzTG9nMikpID9cbiAgICAgICAgICAgICAgICAgICAgICBjb2RpbmdwYXNzZXNMb2cyIC0gMSA6IGNvZGluZ3Bhc3Nlc0xvZzIpICsgY29kZWJsb2NrLkxibG9jaztcbiAgICAgICAgICB2YXIgY29kZWREYXRhTGVuZ3RoID0gcmVhZEJpdHMoYml0cyk7XG4gICAgICAgICAgcXVldWUucHVzaCh7XG4gICAgICAgICAgICBjb2RlYmxvY2s6IGNvZGVibG9jayxcbiAgICAgICAgICAgIGNvZGluZ3Bhc3NlczogY29kaW5ncGFzc2VzLFxuICAgICAgICAgICAgZGF0YUxlbmd0aDogY29kZWREYXRhTGVuZ3RoXG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgYWxpZ25Ub0J5dGUoKTtcbiAgICAgICAgaWYgKGVwaE1hcmtlclVzZWQpIHtcbiAgICAgICAgICBza2lwTWFya2VySWZFcXVhbCgweDkyKTtcbiAgICAgICAgfVxuICAgICAgICB3aGlsZSAocXVldWUubGVuZ3RoID4gMCkge1xuICAgICAgICAgIHZhciBwYWNrZXRJdGVtID0gcXVldWUuc2hpZnQoKTtcbiAgICAgICAgICBjb2RlYmxvY2sgPSBwYWNrZXRJdGVtLmNvZGVibG9jaztcbiAgICAgICAgICBpZiAoY29kZWJsb2NrWydkYXRhJ10gPT09IHVuZGVmaW5lZCkge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IGZvciAodmFyIGkgPSAwLCBpaSA9IGNvZGVibG9ja3MubGVuZ3RoOyBpIDwgaWk7ICsraSkge1xuICAgICAgdmFyIGNvZGVibG9jayA9IGNvZGVibG9ja3NbaV07XG4gICAgICB2YXIgYmxvY2tXaWR0aCA9IGNvZGVibG9jay50YngxXyAtIGNvZGVibG9jay50YngwXztcbiAgICAgIHZhciBibG9ja0hlaWdodCA9IGNvZGVibG9jay50YnkxXyAtIGNvZGVibG9jay50YnkwXztcbiAgICAgIGlmIChibG9ja1dpZHRoID09PSAwIHx8IGJsb2NrSGVpZ2h0ID09PSAwKSB7XG4gICAgICAgIGNvbnRpbnVlO1xuICAgICAgfVxuICAgICAgaWYgKGNvZGVibG9ja1snZGF0YSddID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgY29udGludWU7XG4gICAgICB9XG5cbiAgICAgIHZhciBiaXRNb2RlbCwgY3VycmVudENvZGluZ3Bhc3NUeXBlO1xuICAgICAgYml0TW9kZWwgPSBuZXcgQml0TW9kZWwoYmxvY2tXaWR0aCwgYmxvY2tIZWlnaHQsIGNvZGVibG9jay5zdWJiYW5kVHlwZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGVibG9jay56ZXJvQml0UGxhbmVzLCBtYik7XG4gICAgICBjdXJyZW50Q29kaW5ncGFzc1R5cGUgPSAyOyAvLyBmaXJzdCBiaXQgcGxhbmUgc3RhcnRzIGZyb20gY2xlYW51cFxuXG4gICAgICAvLyBjb2xsZWN0IGRhdGFcbiAgICAgIHZhciBkYXRhID0gY29kZWJsb2NrLmRhdGEsIHRvdGFsTGVuZ3RoID0gMCwgY29kaW5ncGFzc2VzID0gMDtcbiAgICAgIHZhciBqLCBqaiwgZGF0YUl0ZW07XG4gICAgICBmb3IgKGogPSAwLCBqaiA9IGRhdGEubGVuZ3RoOyBqIDwgamo7IGorKykge1xuICAgICAgICBkYXRhSXRlbSA9IGRhdGFbal07XG4gICAgICAgIHRvdGFsTGVuZ3RoIC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SAyOlxuICAgICAgICAgICAgYml0TW9kZWwucnVuQ2xlYW51cFBhc3MoKTtcbiAgICAgICAgICAgIGlmIChzZWdtZW50YXRpb25TeW1ib2xVc2VkKSB7XG4gICAgICAgICAgICAgIGJpdE1vZGVsLmNoZWNrU2VnbWVudGF0aW9uU3ltYm9sKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBjdXJyZW50Q29kaW5ncGFzc1R5cGUgPSAoY3VycmVudENvZGluZ3Bhc3NUeXBlICsgMSkgJSAzO1xuICAgICAgfVxuXG4gICAgICB2YXIgb2Zmc2V0ID0gKGNvZGVibG9jay50YngwXyAtIHgwKSArIChjb2RlYmxvY2sudGJ5MF8gLSB5MCkgKiB3aWR0aDtcbiAgICAgIHZhciBzaWduID0gYml0TW9kZWwuY29lZmZpY2VudHNTaWduO1xuICAgICAgdmFyIG1hZ25pdHVkZSA9IGJpdE1vZGVsLmNvZWZmaWNlbnRzTWFnbml0dWRlO1xuICAgICAgdmFyIGJpdHNEZWNvZGVkID0gYml0TW9kZWwuYml0c0RlY29kZWQ7XG4gICAgICB2YXIgbWFnbml0dWRlQ29ycmVjdGlvbiA9IHJldmVyc2libGUgPyAwIDogMC41O1xuICAgICAgdmFyIGssIG4sIG5iO1xuICAgICAgcG9zaXRpb24gPSAwO1xuICAgICAgLy8gRG8gdGhlIGludGVybGVhdmluZyBvZiBTZWN0aW9uIEYuMy4zIGhlcmUsIHNvIHdlIGRvIG5vdCBuZWVkXG4gICAgICAvLyB0byBjb3B5IGxhdGVyLiBMTCBsZXZlbCBpcyBub3QgaW50ZXJsZWF2ZWQsIGp1c3QgY29waWVkLlxuICAgICAgdmFyIGludGVybGVhdmUgPSAoc3ViYmFuZC50eXBlICE9PSAnTEwnKTtcbiAgICAgIGZvciAoaiA9IDA7IGogPCBibG9ja0hlaWdodDsgaisrKSB7XG4gICAgICAgIHZhciByb3cgPSAob2Zmc2V0IC8gd2lkdGgpIHwgMDsgLy8gcm93IGluIHRoZSBub24taW50ZXJsZWF2ZWQgc3ViYmFuZFxuICAgICAgICB2YXIgbGV2ZWxPZmZzZXQgPSAyICogcm93ICogKGxldmVsV2lkdGggLSB3aWR0aCkgKyByaWdodCArIGJvdHRvbTtcbiAgICAgICAgZm9yIChrID0gMDsgayA8IGJsb2NrV2lkdGg7IGsrKykge1xuICAgICAgICAgIG4gPSBtYWduaXR1ZGVbcG9zaXRpb25dO1xuICAgICAgICAgIGlmIChuICE9PSAwKSB7XG4gICAgICAgICAgICBuID0gKG4gKyBtYWduaXR1ZGVDb3JyZWN0aW9uKSAqIGRlbHRhO1xuICAgICAgICAgICAgaWYgKHNpZ25bcG9zaXRpb25dICE9PSAwKSB7XG4gICAgICAgICAgICAgIG4gPSAtbjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIG5iID0gYml0c0RlY29kZWRbcG9zaXRpb25dO1xuICAgICAgICAgICAgdmFyIHBvcyA9IGludGVybGVhdmUgPyAobGV2ZWxPZmZzZXQgKyAob2Zmc2V0IDw8IDEpKSA6IG9mZnNldDtcbiAgICAgICAgICAgIGlmIChyZXZlcnNpYmxlICYmIChuYiA+PSBtYikpIHtcbiAgICAgICAgICAgICAgY29lZmZpY2llbnRzW3Bvc10gPSBuO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgY29lZmZpY2llbnRzW3Bvc10gPSBuICogKDEgPDwgKG1iIC0gbmIpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgb2Zmc2V0Kys7XG4gICAgICAgICAgcG9zaXRpb24rKztcbiAgICAgICAgfVxuICAgICAgICBvZmZzZXQgKz0gd2lkdGggLSBibG9ja1dpZHRoO1xuICAgICAgfVxuICAgIH1cbiAgfVxuICBmdW5jdGlvbiB0cmFuc2Zvcm1UaWxlKGNvbnRleHQsIHRpbGUsIGMpIHtcbiAgICB2YXIgY29tcG9uZW50ID0gdGlsZS5jb21wb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WzNdLml0ZW1zIDogbnVsbDtcblxuICAgICAgICAvLyBIQUNLOiBUaGUgbXVsdGlwbGUgY29tcG9uZW50IHRyYW5zZm9ybSBmb3JtdWxhcyBiZWxvdyBhc3N1bWUgdGhhdFxuICAgICAgICAvLyBhbGwgY29tcG9uZW50cyBoYXZlIHRoZSBzYW1lIHByZWNpc2lvbi4gV2l0aCB0aGlzIGluIG1pbmQsIHdlXG4gICAgICAgIC8vIGNvbXB1dGUgc2hpZnQgYW5kIG9mZnNldCBvbmx5IG9uY2UuXG4gICAgICAgIHNoaWZ0ID0gY29tcG9uZW50c1swXS5wcmVjaXNpb24gLSA4O1xuICAgICAgICBvZmZzZXQgPSAoMTI4IDw8IHNoaWZ0KSArIDAuNTtcbiAgICAgICAgbWF4ID0gMjU1ICogKDEgPDwgc2hpZnQpO1xuICAgICAgICBtYXhLID0gbWF4ICogMC41O1xuICAgICAgICBtaW4gPSAtbWF4SztcblxuICAgICAgICB2YXIgY29tcG9uZW50MCA9IHRpbGUuY29tcG9uZW50c1swXTtcbiAgICAgICAgdmFyIGFscGhhMDEgPSBjb21wb25lbnRzQ291bnQgLSAzO1xuICAgICAgICBqaiA9IHkwaXRlbXMubGVuZ3RoO1xuICAgICAgICBpZiAoIWNvbXBvbmVudDAuY29kaW5nU3R5bGVQYXJhbWV0ZXJzLnJldmVyc2libGVUcmFuc2Zvcm1hdGlvbikge1xuICAgICAgICAgIC8vIGludmVyc2UgaXJyZXZlcnNpYmxlIG11bHRpcGxlIGNvbXBvbmVudCB0cmFuc2Zvcm1cbiAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgamo7IGorKywgcG9zICs9IGFscGhhMDEpIHtcbiAgICAgICAgICAgIHkwID0geTBpdGVtc1tqXSArIG9mZnNldDtcbiAgICAgICAgICAgIHkxID0geTFpdGVtc1tqXTtcbiAgICAgICAgICAgIHkyID0geTJpdGVtc1tqXTtcbiAgICAgICAgICAgIHIgPSB5MCArIDEuNDAyICogeTI7XG4gICAgICAgICAgICBnID0geTAgLSAwLjM0NDEzICogeTEgLSAwLjcxNDE0ICogeTI7XG4gICAgICAgICAgICBiID0geTAgKyAxLjc3MiAqIHkxO1xuICAgICAgICAgICAgb3V0W3BvcysrXSA9IHIgPD0gMCA/IDAgOiByID49IG1heCA/IDI1NSA6IHIgPj4gc2hpZnQ7XG4gICAgICAgICAgICBvdXRbcG9zKytdID0gZyA8PSAwID8gMCA6IGcgPj0gbWF4ID8gMjU1IDogZyA+PiBzaGlmdDtcbiAgICAgICAgICAgIG91dFtwb3MrK10gPSBiIDw9IDAgPyAwIDogYiA+PSBtYXggPyAyNTUgOiBiID4+IHNoaWZ0O1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAvLyBpbnZlcnNlIHJldmVyc2libGUgbXVsdGlwbGUgY29tcG9uZW50IHRyYW5zZm9ybVxuICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBqajsgaisrLCBwb3MgKz0gYWxwaGEwMSkge1xuICAgICAgICAgICAgeTAgPSB5MGl0ZW1zW2pdICsgb2Zmc2V0O1xuICAgICAgICAgICAgeTEgPSB5MWl0ZW1zW2pdO1xuICAgICAgICAgICAgeTIgPSB5Mml0ZW1zW2pdO1xuICAgICAgICAgICAgZyA9IHkwIC0gKCh5MiArIHkxKSA+PiAyKTtcbiAgICAgICAgICAgIHIgPSBnICsgeTI7XG4gICAgICAgICAgICBiID0gZyArIHkxO1xuICAgICAgICAgICAgb3V0W3BvcysrXSA9IHIgPD0gMCA/IDAgOiByID49IG1heCA/IDI1NSA6IHIgPj4gc2hpZnQ7XG4gICAgICAgICAgICBvdXRbcG9zKytdID0gZyA8PSAwID8gMCA6IGcgPj0gbWF4ID8gMjU1IDogZyA+PiBzaGlmdDtcbiAgICAgICAgICAgIG91dFtwb3MrK10gPSBiIDw9IDAgPyAwIDogYiA+PSBtYXggPyAyNTUgOiBiID4+IHNoaWZ0O1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoZm91ckNvbXBvbmVudHMpIHtcbiAgICAgICAgICBmb3IgKGogPSAwLCBwb3MgPSAzOyBqIDwgamo7IGorKywgcG9zICs9IDQpIHtcbiAgICAgICAgICAgIGsgPSB5M2l0ZW1zW2pdO1xuICAgICAgICAgICAgb3V0W3Bvc10gPSBrIDw9IG1pbiA/IDAgOiBrID49IG1heEsgPyAyNTUgOiAoayArIG9mZnNldCkgPj4gc2hpZnQ7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9IGVsc2UgeyAvLyBubyBtdWx0aS1jb21wb25lbnQgdHJhbnNmb3JtXG4gICAgICAgIGZvciAoYyA9IDA7IGMgPCBjb21wb25lbnRzQ291bnQ7IGMrKykge1xuICAgICAgICAgIGlmIChjb21wb25lbnRzW2NdLnByZWNpc2lvbiA9PT0gOCl7XG4gICAgICAgICAgICB2YXIgaXRlbXMgPSB0cmFuc2Zvcm1lZFRpbGVzW2NdLml0ZW1zO1xuICAgICAgICAgICAgc2hpZnQgPSBjb21wb25lbnRzW2NdLnByZWNpc2lvbiAtIDg7XG4gICAgICAgICAgICBvZmZzZXQgPSAoMTI4IDw8IHNoaWZ0KSArIDAuNTtcbiAgICAgICAgICAgIG1heCA9ICgxMjcuNSAqICgxIDw8IHNoaWZ0KSk7XG4gICAgICAgICAgICBtaW4gPSAtbWF4O1xuICAgICAgICAgICAgZm9yIChwb3MgPSBjLCBqID0gMCwgamogPSBpdGVtcy5sZW5ndGg7IGogPCBqajsgaisrKSB7XG4gICAgICAgICAgICAgIHZhbCA9IGl0ZW1zW2pdO1xuICAgICAgICAgICAgICBvdXRbcG9zXSA9IHZhbCA8PSBtaW4gPyAwIDpcbiAgICAgICAgICAgICAgICAgICAgICAgICB2YWwgPj0gbWF4ID8gMjU1IDogKHZhbCArIG9mZnNldCkgPj4gc2hpZnQ7XG4gICAgICAgICAgICAgIHBvcyArPSBjb21wb25lbnRzQ291bnQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfWVsc2V7XG4gICAgICAgICAgICB2YXIgaXNTaWduZWQgPSBjb21wb25lbnRzW2NdLmlzU2lnbmVkO1xuICAgICAgICAgICAgdmFyIGl0ZW1zID0gdHJhbnNmb3JtZWRUaWxlc1tjXS5pdGVtcztcblxuICAgICAgICAgICAgaWYoaXNTaWduZWQpe1xuICAgICAgICAgICAgICBmb3IgKHBvcyA9IGMsIGogPSAwLCBqaiA9IGl0ZW1zLmxlbmd0aDsgaiA8IGpqOyBqKyspIHtcbiAgICAgICAgICAgICAgICBvdXRbcG9zXSA9IGl0ZW1zW2pdO1xuICAgICAgICAgICAgICAgIHBvcyArPSBjb21wb25lbnRzQ291bnQ7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1lbHNle1xuICAgICAgICAgICAgICBzaGlmdCA9IGNvbXBvbmVudHNbY10ucHJlY2lzaW9uIC0gODtcbiAgICAgICAgICAgICAgb2Zmc2V0ID0gKDEyOCA8PCBzaGlmdCkgKyAwLjU7XG4gICAgICAgICAgICAgIHZhciBwcmVjaXNpb25NYXggPSBNYXRoLnBvdygyLGNvbXBvbmVudHNbY10ucHJlY2lzaW9uKS0xO1xuICAgICAgICAgICAgICBmb3IgKHBvcyA9IGMsIGogPSAwLCBqaiA9IGl0ZW1zLmxlbmd0aDsgaiA8IGpqOyBqKyspIHtcbiAgICAgICAgICAgICAgICB2YWwgPSBpdGVtc1tqXTtcbiAgICAgICAgICAgICAgICBvdXRbcG9zXSA9IE1hdGgubWF4KE1hdGgubWluKCh2YWwgKyBvZmZzZXQpLHByZWNpc2lvbk1heCksMCk7XG4gICAgICAgICAgICAgICAgcG9zICs9IGNvbXBvbmVudHNDb3VudDtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmVzdWx0SW1hZ2VzLnB1c2gocmVzdWx0KTtcbiAgICB9XG4gICAgcmV0dXJuIHJlc3VsdEltYWdlcztcbiAgfVx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hib3JzU2lnbmlmaWNhbmNlW2luZGV4XSkge1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgdmFyIGNvbnRleHRMYWJlbCA9IGxhYmVsc1tuZWlnaGJvcnNTaWduaWZpY2FuY2VbaW5kZXhdXTtcbiAgICAgICAgICAgICAgdmFyIGRlY2lzaW9uID0gZGVjb2Rlci5yZWFkQml0KGNvbnRleHRzLCBjb250ZXh0TGFiZWwpO1xuICAgICAgICAgICAgICBpZiAoZGVjaXNpb24pIHtcbiAgICAgICAgICAgICAgICB2YXIgc2lnbiA9IHRoaXMuZGVjb2RlU2lnbkJpdChpLCBqLCBpbmRleCk7XG4gICAgICAgICAgICAgICAgY29lZmZpY2VudHNTaWduW2luZGV4XSA9IHNpZ247XG4gICAgICAgICAgICAgICAgY29lZmZpY2VudHNNYWduaXR1ZGVbaW5kZXhdID0gMTtcbiAgICAgICAgICAgICAgICB0aGlzLnNldE5laWdoYm9yc1NpZ25pZmljYW5jZShpLCBqLCBpbmRleCk7XG4gICAgICAgICAgICAgICAgcHJvY2Vzc2luZ0ZsYWdzW2luZGV4XSB8PSBmaXJzdE1hZ25pdHVkZUJpdE1hc2s7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgYml0c0RlY29kZWRbaW5kZXhdKys7XG4gICAgICAgICAgICAgIHByb2Nlc3NpbmdGbGFnc1tpbmRleF0gfD0gcHJvY2Vzc2VkTWFzaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBkZWNvZGVTaWduQml0OiBmdW5jdGlvbiBCaXRNb2RlbF9kZWNvZGVTaWduQml0KHJvdywgY29sdW1uLCBpbmRleCkge1xuICAgICAgICB2YXIgd2lkdGggPSB0aGlzLndpZHRoLCBoZWlnaHQgPSB0aGlzLmhlaWdodDtcbiAgICAgICAgdmFyIGNvZWZmaWNlbnRzTWFnbml0dWRlID0gdGhpcy5jb2VmZmljZW50c01hZ25pdHVkZTtcbiAgICAgICAgdmFyIGNvZWZmaWNlbnRzU2lnbiA9IHRoaXMuY29lZmZpY2VudHNTaWduO1xuICAgICAgICB2YXIgY29udHJpYnV0aW9uLCBzaWduMCwgc2lnbjEsIHNpZ25pZmljYW5jZTE7XG4gICAgICAgIHZhciBjb250ZXh0TGFiZWwsIGRlY29kZWQ7XG5cbiAgICAgICAgLy8gY2FsY3VsYXRlIGhvcml6b250YWwgY29udHJpYnV0aW9uXG4gICAgICAgIHNpZ25pZmljYW5jZTEgPSAoY29sdW1uID4gMCAmJiBjb2VmZmljZW50c01hZ25pdHVkZVtpbmRleCAtIDFdICE9PSAwKTtcbiAgICAgICAgaWYgKGNvbHVtbiArIDEgPCB3aWR0aCAmJiBjb2VmZmljZW50c01hZ25pdHVkZVtpbmRleCArIDFdICE9PSAwKSB7XG4gICAgICAgICAgc2lnbjEgPSBjb2VmZmljZW50c1NpZ25baW5kZXggKyAxXTtcbiAgICAgICAgICBpZiAoc2lnbmlmaWNhbmNlMSkge1xuICAgICAgICAgICAgc2lnbjAgPSBjb2VmZmljZW50c1NpZ25baW5kZXggLSAxXTtcbiAgICAgICAgICAgIGNvbnRyaWJ1dGlvbiA9IDEgLSBzaWduMSAtIHNpZ24wO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBjb250cmlidXRpb24gPSAxIC0gc2lnbjEgLSBzaWduMTtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAoc2lnbmlmaWNhbmNlMSkge1xuICAgICAgICAgIHNpZ24wID0gY29lZmZpY2VudHNTaWduW2luZGV4IC0gMV07XG4gICAgICAgICAgY29udHJpYnV0aW9uID0gMSAtIHNpZ24wIC0gc2lnbjA7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgY29udHJpYnV0aW9uID0gMDtcbiAgICAgICAgfVxuICAgICAgICB2YXIgaG9yaXpvbnRhbENvbnRyaWJ1dGlvbiA9IDMgKiBjb250cmlidXRpb247XG5cbiAgICAgICAgLy8gY2FsY3VsYXRlIHZlcnRpY2FsIGNvbnRyaWJ1dGlvbiBhbmQgY29tYmluZSB3aXRoIHRoZSBob3Jpem9udGFsXG4gICAgICAgIHNpZ25pZmljYW5jZTEgPSAocm93ID4gMCAmJiBjb2VmZmljZW50c01hZ25pdHVkZVtpbmRleCAtIHdpZHRoXSAhPT0gMCk7XG4gICAgICAgIGlmIChyb3cgKyAxIDwgaGVpZ2h0ICYmIGNvZWZmaWNlbnRzTWFnbml0dWRlW2luZGV4ICsgd2lkdGhdICE9PSAwKSB7XG4gICAgICAgICAgc2lnbjEgPSBjb2VmZmljZW50c1NpZ25baW5kZXggKyB3aWR0aF07XG4gICAgICAgICAgaWYgKHNpZ25pZmljYW5jZTEpIHtcbiAgICAgICAgICAgIHNpZ24wID0gY29lZmZpY2VudHNTaWduW2luZGV4IC0gd2lkdGhdO1xuICAgICAgICAgICAgY29udHJpYnV0aW9uID0gMSAtIHNpZ24xIC0gc2lnbjAgKyBob3Jpem9udGFsQ29udHJpYnV0aW9uO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBjb250cmlidXRpb24gPSAxIC0gc2lnbjEgLSBzaWduMSArIGhvcml6b250YWxDb250cmlidXRpb247XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKHNpZ25pZmljYW5jZTEpIHtcbiAgICAgICAgICBzaWduMCA9IGNvZWZmaWNlbnRzU2lnbltpbmRleCAtIHdpZHRoXTtcbiAgICAgICAgICBjb250cmlidXRpb24gPSAxIC0gc2lnbjAgLSBzaWduMCArIGhvcml6b250YWxDb250cmlidXRpb247XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgY29udHJpYnV0aW9uID0gaG9yaXpvbnRhbENvbnRyaWJ1dGlvbjtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChjb250cmlidXRpb24gPj0gMCkge1xuICAgICAgICAgIGNvbn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lkdGggKiBoZWlnaHQ7XG4gICAgICAgIHZhciB3aWR0aDQgPSB3aWR0aCAqIDQ7XG5cbiAgICAgICAgZm9yICh2YXIgaW5kZXgwID0gMCwgaW5kZXhOZXh0OyBpbmRleDAgPCBsZW5ndGg7IGluZGV4MCA9IGluZGV4TmV4dCkge1xuICAgICAgICAgIGluZGV4TmV4dCA9IE1hdGgubWluKGxlbmd0aCwgaW5kZXgwICsgd2lkdGg0KTtcbiAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IHdpZHRoOyBqKyspIHtcbiAgICAgICAgICAgIGZvciAodmFyIGluZGV4ID0gaW5kZXgwICsgajsgaW5kZXggPCBpbmRleE5leHQ7IGluZGV4ICs9IHdpZHRoKSB7XG5cbiAgICAgICAgICAgICAgLy8gc2lnbmlmaWNhbnQgYnV0IG5vdCB0aG9zZSB0aGF0IGhhdmUganVzdCBiZWNvbWVcbiAgICAgICAgICAgICAgaWYgKCFjb2VmZmljZW50c01hZ25pdHVkZVtpbmRleF0gfHxcbiAgICAgICAgICAgICAgICAocHJvY2Vzc2luZ0ZsYWdzW2luZGV4XSAmIHByb2Nlc3NlZE1hc2spICE9PSAwKSB7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICB2YXIgY29udGV4dExhYmVsID0gMTY7XG4gICAgICAgICAgICAgIGlmICgocHJvY2Vzc2luZ0ZsYWdzW2luZGV4XSAmIGZpcnN0TWFnbml0dWRlQml0TWFzaykgIT09IDApIHtcbiAgICAgICAgICAgICAgICBwcm9jZXNzaW5nRmxhZ3NbaW5kZXhdIF49IGZpcnN0TWFnbml0dWRlQml0TWFzaztcbiAgICAgICAgICAgICAgICAvLyBmaXJzdCByZWZpbmVtZW50XG4gICAgICAgICAgICAgICB2YXIgc2lnbmlmaWNhbmNlID0gbmVpZ2hib3JzU2lnbmlmaWNhbmNlW2luZGV4XSAmIDEyNztcbiAgICAgICAgICAgICAgIGNvbnRleH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GbGFnc1tpbmRleDAgKyB0d29Sb3dzRG93bl0gPT09IDAgJiZcbiAgICAgICAgICAgICAgcHJvY2Vzc2luZ0ZsYWdzW2luZGV4MCArIHRocmVlUm93c0Rvd25dID09PSAwICYmXG4gICAgICAgICAgICAgIG5laWdoYm9yc1NpZ25pZmljYW5jZVtpbmRleDBdID09PSAwICYmXG4gICAgICAgICAgICAgIG5laWdoYm9yc1NpZ25pZmljYW5jZVtpbmRleDAgKyBvbmVSb3dEb3duXSA9PT0gMCAmJlxuICAgICAgICAgICAgICBuZWlnaGJvcnNTaWduaWZpY2FuY2VbaW5kZXgwICsgdHdvUm93c0Rvd25dID09PSAwICYmXG4gICAgICAgICAgICAgIG5laWdoYm9yc1NpZ25pZmljYW5jZVtpbmRleDAgKyB0aHJlZVJvd3NEb3duXSA9PT0gMCk7XG4gICAgICAgICAgICB2YXIgaTEgPSAwLCBpbmRleCA9IGluZGV4MDtcbiAgICAgICAgICAgIHZhciBpID0gaTAsIHNpZ247XG4gICAgICAgICAgICBpZiAoYWxsRW1wdHkpIHtcbiAgICAgICAgICAgICAgdmFyIGhhc1NpZ25pZmljYW50Q29lZmZpY2VudCA9XG4gICAgICAgICAgICAgICAgZGVjb2Rlci5yZWFkQml0KGNvbnRleHRzLCBSVU5MRU5HVEhfQ09OVEVYVCk7XG4gICAgICAgICAgICAgIGlmICghaGFzU2lnbmlmaWNhbnRDb2VmZmljZW50KSB7XG4gICAgICAgICAgICAgICAgYml0c0RlY29kZWRbaW5kZXgwXSsrO1xuICAgICAgICAgICAgICAgIGJpdHNEZWNvZGVkW2luZGV4MCArIG9uZVJvd0Rvd25dKys7XG4gICAgICAgICAgICAgICAgYml0c0RlY29kZWRbaW5kZXgwICsgdHdvUm93c0Rvd25dKys7XG4gICAgICAgICAgICAgICAgYml0c0RlY29kZWRbaW5kZXgwICsgdGhyZWVSb3dzRG93bl0rKztcbiAgICAgICAgICAgICAgICBjb250aW51ZTsgLy8gbmV4dCBjb2x1bW5cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpMSA9IChkZWNvZGVyLnJlYWRCaXQoY29udGV4dHMsIFVOSUZPUk1fQ09OVEVYVCkgPDwgMSkgfFxuICAgICAgICAgICAgICAgICAgICBkZWNvZGVyLnJlYWRCaXQoY29udGV4dHMsIFVOSUZPUk1fQ09OVEVYVCk7XG4gICAgICAgICAgICAgIGlmIChpMSAhPT0gMCkge1xuICAgICAgICAgICAgICAgIGkgPSBpMCArIGkxO1xuICAgICAgICAgICAgICAgIGluZGV4ICs9IGkxICogd2lkdGg7XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBzaWduID0gdGhpcy5kZWNvZGVTaWduQml0KGksIGosIGluZGV4KTtcbiAgICAgICAgICAgICAgY29lZmZpY2VudHNTaWduW2luZGV4XSA9IHNpZ247XG4gICAgICAgICAgICAgIGNvZWZmaWNlbnRzTWFnbml0dWRlW2luZGV4XSA9IDE7XG4gICAgICAgICAgICAgIHRoaXMuc2V0TmVpZ2hib3JzU2lnbmlmaWNhbmNlKGksIGosIGluZGV4KTtcbiAgICAgICAgICAgICAgcHJvY2Vzc2luZ0ZsYWdzW2luZGV4XSB8PSBmaXJzdE1hZ25pdHVkZUJpdE1hc2s7XG5cbiAgICAgICAgICAgICAgaW5kZXggPSBpbmRleDA7XG4gICAgICAgICAgICAgIGZvciAodmFyIGkyID0gaTA7IGkyIDw9IGk7IGkyKyssIGluZGV4ICs9IHdpZHRoKSB7XG4gICAgICAgICAgICAgICAgYml0c0RlY29kZWRbaW5kZXhdKys7XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBpMSsrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZm9yIChpID0gaTAgKyBpMTsgaSA8IGlOZXh0OyBpKyssIGluZGV4ICs9IHdpZHRoKSB7XG4gICAgICAgICAgICAgIGlmIChjb2VmZmljZW50c01hZ25pdHVkZVtpbmRleF0gfHxcbiAgICAgICAgICAgICAgICAocHJvY2Vzc2luZ0ZsYWdzW2luZGV4XSAmIHByb2Nlc3NlZE1hc2spICE9PSAwKSB7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICB2YXIgY29udGV4dExhYmVsID0gbGFiZWxzW25laWdoYm9yc1NpZ25pZmljYW5jZVtpbmRleF1dO1xuICAgICAgICAgICAgICB2YXIgZGVjaXNpb24gPSBkZWNvZGVyLnJlYWRCaXQoY29udGV4dHMsIGNvbnRleHRMYWJlbCk7XG4gICAgICAgICAgICAgIGlmIChkZWNpc2lvbiA9PT0gMSkge1xuICAgICAgICAgICAgICAgIHNpZ24gPSB0aGlzLmRlY29kZVNpZ25CaXQoaSwgaiwgaW5kZXgpO1xuICAgICAgICAgICAgICAgIGNvZWZmaWNlbnRzU2lnbltpbmRleF0gPSBzaWduO1xuICAgICAgICAgICAgICAgIGNvZWZmaWNlbnRzTWFnbml0dWRlW2luZGV4XSA9IDE7XG4gICAgICAgICAgICAgICAgdGhpcy5zZXROZWlnaGJvcnNTaWduaWZpY2FuY2UoaSwgaiwgaW5kZXgpO1xuICAgICAgICAgICAgICAgIHByb2Nlc3NpbmdGbGFnc1tpbmRleF0gfD0gZmlyc3RNYWduaXR1ZGVCaXRNYXNrO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGJpdHNEZWNvZGVkW2luZGV4XSsrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIGNoZWNrU2VnbWVudGF0aW9uU3ltYm9sOiBmdW5jdGlvbiBCaXRNb2RlbF9jaGVja1NlZ21lbnRhdGlvblN5bWJvbCgpIHtcbiAgICAgICAgdmFyIGRlY29kZXIgPSB0aGlzLmRlY29kZXI7XG4gICAgICAgIHZhciBjb250ZXh0cyA9IHRoaXMuY29udGV4dHM7XG4gICAgICAgIHZhciBzeW1ib2wgPSAoZGVjb2Rlci5yZWFkQml0KGNvbnRleHRzLCBV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XG4gICAgICAgIHhbal0gKj0gS187XG4gICAgICB9XG5cbiAgICAgIC8vIHN0ZXAgMSAmIDNcbiAgICAgIGogPSBvZmZzZXQgLSAyO1xuICAgICAgY3VycmVudCA9IGRlbHRhICogeFtqIC0xXTtcbiAgICAgIGZvciAobiA9IGxlbiArIDM7IG4tLTsgaiArPSAyKSB7XG4gICAgICAgIG5leHQgPSBkZWx0YSAqIHhbaiArIDFdO1xuICAgICAgICB4W2pdID0gSyAqIHhbal0gLSBjdXJyZW50IC0gbmV4dDtcbiAgICAgICAgaWYgKG4tLSkge1xuICAgICAgICAgIGogKz0gMjtcbiAgICAgICAgICBjdXJyZW50ID0gZGVsdGEgKiB4W2ogKyAxXTtcbiAgICAgICAgICB4W2pdID0gSyAqIHhbal0gLSBjdXJyZW50IC0gbmV4dDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICAvLyBzdGVwIDRcbiAgICAgIGogPSBvZmZzZXQgLSAxO1xuICAgICAgY3VycmVudCA9IGdhbW1hICogeFtqIC0gMV07XG4gICAgICBmb3IgKG4gPSBsZW4gKyAyOyBuLS07IGogKz0gMikge1xuICAgICAgICBuZXh0ID0gZ2FtbWEgKiB4W2ogKyAxXTtcbiAgICAgICAgeFtqXSAtPSBjdXJyZW50ICsgbmV4dDtcbiAgICAgICAgaWYgKG4tLSkge1xuICAgICAgICAgIGogKz0gMjtcbiAgICAgICAgICBjdXJyZW50ID0gZ2FtbWEgKiB4W2ogKyAxXTtcbiAgICAgICAgICB4W2pdIC09IGN1cnJlbnQgKyBuZXh0O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIC8vIHN0ZXAgNVxuICAgICAgaiA9IG9mZnNldDtcbiAgICAgIGN1cnJlbnQgPSBiZXRhICogeFtqIC0gMV07XG4gICAgICBmb3IgKG4gPSBsZW4gKyAxOyBuLS07IGogKz0gMikge1xuICAgICAgICBuZXh0ID0gYmV0YSAqIHhbaiArIDFdO1xuICAgICAgICB4W2pdIC09IGN1cnJlbnQgKyBuZXh0O1xuICAgICAgICBpZiAobi0tKSB7XG4gICAgICAgICAgaiArPSAyO1xuICAgICAgICAgIGN1cnJlbnQgPSBiZXRhICogeFtqICsgMV07XG4gICAgICAgICAgeFtqXSAtPSBjdXJyZW50ICsgbmV4dDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICAvLyBzdGVwIDZcbiAgICAgIGlmIChsZW4gIT09IDApIHtcbiAgICAgICAgaiA9IG9mZnNldCArIDE7XG4gICAgICAgIGN1cnJlbnQgPSBhbHBoYSAqIHhbaiAtIDFdO1xuICAgICAgICBmb3IgKG4gPSBsZW47IG4tLTsgaiArPSAyKSB7XG4gICAgICAgICAgbmV4dCA9IGFscGhhICogeFtqICsgMV07XG4gICAgICAgICAgeFtqXSAtPSBjdXJyZW50ICsgbmV4dDtcbiAgICAgICAgICBpZiAobi0tKSB7XG4gICAgICAgICAgICBqICs9IDI7XG4gICAgICAgICAgICBjdXJyZW50ID0gYWxwaGEgKiB4W2ogKyAxXTtcbiAgICAgICAgICAgIHhbal0gLT0gY3VycmVudCArIG5leHQ7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH07XG5cbiAgICByZXR1cm4gSXJyZXZlcnNpYmxlVHJhbnNmb3JtO1xuICB9KSgpO1xuXG4gIC8vIFNlY3Rpb24gMy44LjEgUmV2ZXJzaWJsZSA1LTMgZmlsdGVyXG4gIHZhciBSZXZlcnNpYmxlVHJhbnNmb3JtID0gKGZ1bmN0aW9uIFJldmVyc2libGVUcmFuc2Zvcm1DbG9zdXJlKCkge1xuICAgIGZ1bmN0aW9uIFJldmVyc2libGVUcmF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gY3gubXBzXG4gICAgICB2YXIgY3hfaW5kZXggPSBjb250ZXh0c1twb3NdID4+IDEsIGN4X21wcyA9IGNvbnRleHRzW3Bvc10gJiAxO1xuICAgICAgdmFyIHFlVGFibGVJY3ggPSBRZVRhYmxlW2N4X2luZGV4XTtcbiAgICAgIHZhciBxZUljeCA9IHFlVGFibGVJY3gucWU7XG4gICAgICB2YXIgZDtcbiAgICAgIHZhciBhID0gdGhpcy5hIC0gcWVJY3g7XG5cbiAgICAgIGlmICh0aGlzLmNoaWdoIDwgcWVJY3gpIHtcbiAgICAgICAgLy8gZXhjaGFuZ2VMcHNcbiAgICAgICAgaWYgKGEgPCBxZUljeCkge1xuICAgICAgICAgIGEgPSBxZUljeDtcbiAgICAgICAgICBkID0gY3hfbXBzO1xuICAgICAgICAgIGN4X2luZGV4ID0gcWVUYWJsZUljeC5ubXBzO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGEgPSBxZUljeDtcbiAgICAgICAgICBkID0gMSBeIGN4X21wcztcbiAgICAgICAgICBpZiAocWVUYWJsZUljeC5zd2l0Y2hGbGFnID09PSAxKSB7XG4gICAgICAgICAgICBjeF9tcHMgPSBkO1xuICAgICAgICAgIH1cbiAgICAgICAgICBjeF9pbmRleCA9IHFlVGFibGVJY3gubmxwcztcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgdGhpcy5jaGlnaCAtPSBxZUljeDtcbiAgICAgICAgaWYgKChhICYgMHg4MDAwKSAhPT0gMCkge1xuICAgICAgICAgIHRoaXMuYSA9IGE7XG4gICAgICAgICAgcmV0dXJuIGN4X21wcztcbiAgICAgICAgfVxuICAgICAgICAvLyBleGNoYW5nZU1wc1xuICAgICAgICBpZiAoYSA8IHFlSWN4KSB7XG4gICAgICAgICAgZCA9IDEgXiBjeF9tcHM7XG4gICAgICAgICAgaWYgKHFlVGFibGVJY3guc3dpdGNoRmxhZyA9PT0gMSkge1xuICAgICAgICAgICAgY3hfbXBzID0gZD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AgICAgICAgICAgIG5leHRTdGF0dXMgPSBTVEFUVVNfUkVTT0xWRUQ7XG5cbiAgICAgICAgICAgICAgaWYgKGhhbmRsZXIudGhpc1Byb21pc2UuX3VuaGFuZGxlZFJlamVjdGlvbikge1xuICAgICAgICAgICAgICAgIHRoaXMucmVtb3ZlVW5oYW5kZWxlZFJlamVjdGlvbihoYW5kbGVyLnRoaXNQcm9taXNlKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfSBjYXRjaCAoZXgpIHtcbiAgICAgICAgICBuZXh0U3RhdHVzID0gU1RBVFVTX1JFSkVDVEVEO1xuICAgICAgICAgIG5leHRWYWx1ZSA9IGV4O1xuICAgICAgICB9XG5cbiAgICAgICAgaGFuZGxlci5uZXh0UHJvbWlzZS5fdXBkYXRlU3RhdHVzKG5leHRTdGF0dXMsIG5leHRWYWx1ZSk7XG4gICAgICAgIGlmIChEYXRlLm5vdygpID49IHRpbWVvdXRBdCkge1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmICh0aGlzLmhhbmRsZXJzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgc2V0VGltZW91dCh0aGlzLnJ1bkhhbmRsZXJzLmJpbmQodGhpcyksIDApO1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG5cbiAgICAgIHRoaXMucnVubmluZyA9IGZhbHNlO1xuICAgIH0sXG5cbiAgICBhZGRVbmhhbmRsZWRSZWplY3Rpb246IGZ1bmN0aW9uIGFkZFVuaGFuZGxlZFJlamVjdGlvbihwcm9taXNlKSB7XG4gICAgICB0aGlzLnVuaGFuZGxlZFJlamVjdGlvbnMucHVzaCh7XG4gICAgICAgIHByb21pc2U6IHByb21pc2UsXG4gICAgICAgIHRpbWU6IERhdGUubm93KClcbiAgICAgIH0pO1xuICAgICAgdGhpcy5zY2hlZHVsZVJlamVjdGlvbkNoZWNrKCk7XG4gICAgfSxcblxuICAgIHJlbW92Z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YWl0IGZvci5cbiAgICogQHJldHVybiB7UHJvbWlzZX0gTmV3IGRlcGVuZGFudCBwcm9taXNlLlxuICAgKi9cbiAgUHJvbWlzZS5hbGwgPSBmdW5jdGlvbiBQcm9taXNlX2FsbChwcm9taXNlcykge1xuICAgIHZhciByZXNvbHZlQWxsLCByZWplY3RBbGw7XG4gICAgdmFyIGRlZmVycmVkID0gbmV3IFByb21pc2UoZnVuY3Rpb24gKHJlc29sdmUsIHJlamVjdCkge1xuICAgICAgcmVzb2x2ZUFsbCA9IHJlc29sdmU7XG4gICAgICByZWplY3RBbGwgPSByZWplY3Q7XG4gICAgfSk7XG4gICAgdmFyIHVucmVzb2x2ZWQgPSBwcm9taXNlcy5sZW5ndGg7XG4gICAgdmFyIHJlc3VsdHMgPSBbXTtcbiAgICBpZiAodW5yZXNvbHZlZCA9PT0gMCkge1xuICAgICAgcmVzb2x2ZUFsbChyZXN1bHRzKTtcbiAgICAgIHJldHVybiBkZWZlcnJlZDtcbiAgICB9XG4gICAgZnVuY3Rpb24gcmVqZWN0KHJlYXNvbikge1xuICAgICAgaWYgKGRlZmVycmVkLl9zdGF0dXMgPT09IFNUQVRVU19SRUpFQ1RFRCkge1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG4gICAgICByZXN1bHRzID0gW107XG4gICAgICByZWplY3RBbGwocmVhc29uKTtcbiAgICB9XG4gICAgZm9yICh2YXIgaSA9IDAsIGlpID0gcHJvbWlzZXMubGVuZ3RoOyBpIDwgaWk7ICsraSkge1xuICAgICAgdmFyIHByb21pc2UgPSBwcm9taXNlc1tpXTtcbiAgICAgIHZhciByZXNvbHZlID0gKGZ1bmN0aW9uKGkpIHtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKHZhbHVlKSB7XG4gICAgICAgICAgaWYgKGRlZmVycmVkLl9zdGF0dXMgPT09IFNUQVRVU19SRUpFQ1RFRCkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZ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IC0zLFxuICAvL1pfTUVNX0VSUk9SOiAgICAgLTQsXG4gIFpfQlVGX0VSUk9SOiAgICAgICAtNSxcbiAgLy9aX1ZFUlNJT05fRVJST1I6IC02LFxuXG4gIC8qIGNvbXByZXNzaW9uIGxldmVscyAqL1xuICBaX05PX0NPTVBSRVNTSU9OOiAgICAgICAgIDAsXG4gIFpfQkVTVF9TUEVFRDogICAgICAgICAgICAgMSxcbiAgWl9CRVNUX0NPTVBSRVNTSU9OOiAgICAgICA5LFxuICBaX0RFRkFVTFRfQ09NUFJFU1NJT046ICAgLTEsXG5cblxuICBaX0ZJTFRFUkVEOiAgICAgICAgICAgICAgIDEsXG4gIFpfSFVGRk1BTl9PTkxZOiAgICAgICAgICAgMixcbiAgWl9STEU6ICAgICAgICAgICAgICAgICAgICAzLFxuICBaX0ZJWEVEOiAgICAgICAgICAgICAgICAgIDQsXG4gIFpfREVGQVVMVF9TVFJBVEVHWTogICAgICAgMCxcblxuICAvKiBQb3NzaWJsZSB2YWx1ZXMgb2YgdGhlIGRhdGFfdHlwZSBmaWVsZCAodGhvdWdoIHNlZSBpbmZsYXRlKCkpICovXG4gIFpfQklOQVJZOiAgICAgICAgICAgICAgICAgMCxcbiAgWl9URVhUOiAgICAgICAgICAgICAgICAgICAxLFxuICAvL1pfQVNDSUk6ICAgICAgICAgICAgICAgIDEsIC8vID0gWl9URVhUIChkZXByZWNhdGVkKVxuICBaX1VOS05PV046ICAgICAgICAgICAgICAgIDIsXG5cbiAgLyogVGhlIGRlZmxhdGUgY29tcHJlc3Npb24gbWV0aG9kICovXG4gIFpfREVGTEFURUQ6ICAgICAgICAgICAgICAgOFxuICAvL1pfTlVMTDogICAgICAgICAgICAgICAgIG51bGwgLy8gVXNlIC0xIG9yIG51bGwgaW5saW5lLCBkZXBlbmRpbmcgb24gdmFyIHR5cGVcbn07XG4iLCIndXNlIHN0cmljdCc7XG5cbi8vIE5vdGU6IHdlIGNhbid0IGdldCBzaWduaWZpY2FudCBzcGVlZC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ZhciBaX0VSUk5PICAgICAgICAgPSAtMTtcbnZhciBaX1NUUkVBTV9FUlJPUiAgPSAtMjtcbnZhciBaX0RBVEFfRVJST1IgICAgPSAtMztcbi8vdmFyIFpfTUVNX0VSUk9SICAgICA9IC00O1xudmFyIFpfQlVGX0VSUk9SICAgICA9IC01O1xuLy92YXIgWl9WRVJTSU9OX0VSUk9SID0gLTY7XG5cblxuLyogY29tcHJlc3Npb24gbGV2ZWxzICovXG4vL3ZhciBaX05PX0NPTVBSRVNTSU9OICAgICAgPSAwO1xuLy92YXIgWl9CRVNUX1NQRUVEICAgICAgICAgID0gMTtcbi8vdmFyIFpfQkVTVF9DT01QUkVTU0lPTiAgICA9IDk7XG52YXIgWl9ERUZBVUxUX0NPTVBSRVNTSU9OID0gLTE7XG5cblxudmFyIFpfRklMVEVSRUQgICAgICAgICAgICA9IDE7XG52YXIgWl9IVUZGTUFOX09OTFkgICAgICAgID0gMjtcbnZhciBaX1JMRSAgICAgICAgICAgICAgICAgPSAzO1xudmFyIFpfRklYRUQgICAgICAgICAgICAgICA9IDQ7XG52YXIgWl9ERUZBVUxUX1NUUkFURUdZICAgID0gMDtcblxuLyogUG9zc2libGUgdmFsdWVzIG9mIHRoZSBkYXRhX3R5cGUgZmllbGQgKHRob3VnaCBzZWUgaW5mbGF0ZSgpKSAqL1xuLy92YXIgWl9CSU5BUlkgICAgICAgICAgICAgID0gMDtcbi8vdmFyIFpfVEVYVCAgICAgICAgICAgICAgICA9IDE7XG4vL3ZhciBaX0FTQ0lJICAgICAgICAgICAgICAgPSAxOyAvLyA9IFpfVEVYVFxudmFyIFpfVU5LTk9XTiAgICAgICAgICAgICA9IDI7XG5cblxuLyogVGhlIGRlZmxhdGUgY29tcHJlc3Npb24gbWV0aG9kICovXG52YXIgWl9ERUZMQVRFRCAgPSA4O1xuXG4vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL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AgICogdGhlIGhhc2ggdGFibGUuXG4gICAgICAgKi9cbiAgICAgIHMubG9va2FoZWFkIC09IHMucHJldl9sZW5ndGgtMTtcbiAgICAgIHMucHJldl9sZW5ndGggLT0gMjtcbiAgICAgIGRvIHtcbiAgICAgICAgaWYgKCsrcy5zdHJzdGFydCA8PSBtYXhfaW5zZXJ0KSB7XG4gICAgICAgICAgLyoqKiBJTlNFUlRfU1RSSU5HKHMsIHMuc3Ryc3RhcnQsIGhhc2hfaGVhZCk7ICoqKi9cbiAgICAgICAgICBzLmluc19oID0gKChzLmluc19oIDw8IHMuaGFzaF9zaGlmdCkgXiBzLndpbmRvd1tzLnN0cnN0YXJ0ICsgTUlOX01BVENIIC0gMV0pICYgcy5oYXNoX21hc2s7XG4gICAgICAgICAgaGFzaF9oZWFkID0gcy5wcmV2W3Muc3Ryc3RhcnQgJiBzLndfbWFza10gPSBzLmhlYWRbcy5pbnNfaF07XG4gICAgICAgICAgcy5oZWFkW3MuaW5zX2hdID0gcy5zdHJzdGFydDtcbiAgICAgICAgICAvKioqL1xuICAgICAgICB9XG4gICAgICB9IHdoaWxlICgtLXMucHJldl9sZW5ndGggIT09IDApO1xuICAgICAgcy5tYXRjaF9hdmFpbGFibGUgPSAwO1xuICAgICAgcy5tYXRjaF9sZW5ndGggPSBNSU5fTUFUQ0gtMTtcbiAgICAgIHMuc3Ryc3RhcnQrKztcblxuICAgICAgaWYgKGJmbHVzaCkge1xuICAgICAgICAvKioqIEZMVVNIX0JMT0NLKHMsIDApOyAqKiovXG4gICAgICAgIGZsdXNoX2Jsb2NrX29ubHkocywgZmFsc2UpO1xuICAgICAgICBpZiAocy5zdHJtLmF2YWlsX291dCA9PT0gMCkge1xuICAgICAgICAgIHJldHVybiBCU19ORUVEX01PUkU7XG4gICAgICAgIH1cbiAgICAgICAgLyoqKi9cbiAgICAgIH1cblxuICAgIH0gZWxzZSBpZiAocy5tYXRjaF9hdmFpbGFibGUpIHtcbiAgICAgIC8qIElmIHRoZXJ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0gTUFYX01BVENIICYmIGZsdXNoID09PSBaX05PX0ZMVVNIKSB7XG4gICAgICAgIHJldHVybiBCU19ORUVEX01PUkU7XG4gICAgICB9XG4gICAgICBpZiAocy5sb29rYWhlYWQgPT09IDApIHsgYnJlYWs7IH0gLyogZmx1c2ggdGhlIGN1cnJlbnQgYmxvY2sgKi9cbiAgICB9XG5cbiAgICAvKiBTZWUgaG93IG1hbnkgdGltZXMgdGhlIHByZXZpb3VzIGJ5dGUgcmVwZWF0cyAqL1xuICAgIHMubWF0Y2hfbGVuZ3RoID0gMDtcbiAgICBpZiAocy5sb29rYWhlYWQgPj0gTUlOX01BVENIICYmIHMuc3Ryc3RhcnQgPiAwKSB7XG4gICAgICBzY2FuID0gcy5zdHJzdGFydCAtIDE7XG4gICAgICBwcmV2ID0gX3dpbltzY2FuXTtcbiAgICAgIGlmIChwcmV2ID09PSBfd2luWysrc2Nhbl0gJiYgcHJldiA9PT0gX3dpblsrK3NjYW5dICYmIHByZXYgPT09IF93aW5bKytzY2FuXSkge1xuICAgICAgICBzdHJlbmQgPSBzLnN0cnN0YXJ0ICsgTUFYX01BVENIO1xuICAgICAgICBkbyB7XG4gICAgICAgICAgLypqc2hpbnQgbm9lbXB0eTpmYWxzZSovXG4gICAgICAgIH0gd2hpbGUgKHByZXYgPT09IF93aW5bKytzY2FuXSAmJiBwcmV2ID09PSBfd2luWysrc2Nhbl0gJiZcbiAgICAgICAgICAgICAgICAgcHJldiA9PT0gX3dpblsrK3NjYW5dICYmIHByZXYgPT09IF93aW5bKytzY2FuXSAmJlxuICAgICAgICAgICAgICAgICBwcmV2ID09PSBfd2luWysrc2Nhbl0gJiYgcHJldiA9PT0gX3dpblsrK3NjYW5dICYmXG4gICAgICAgICAgICAgICAgIHByZXYgPT09IF93aW5bKytzY2FuXSAmJiBwcmV2ID09PSBfd2luWysrc2Nhbl0gJiZcbiAgICAgICAgICAgICAgICAgc2NhbiA8IHN0cmVuZCk7XG4gICAgICAgIHMubWF0Y2hf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gMCk7XG4gICAgICAgIHB1dF9ieXRlKHMsIHMubGV2ZWwgPT09IDkgPyAyIDpcbiAgICAgICAgICAgICAgICAgICAgKHMuc3RyYXRlZ3kgPj0gWl9IVUZGTUFOX09OTFkgfHwgcy5sZXZlbCA8IDIgP1xuICAgICAgICAgICAgICAgICAgICAgNCA6IDApKTtcbiAgICAgICAgcHV0X2J5dGUocywgT1NfQ09ERSk7XG4gICAgICAgIHMuc3RhdHVzID0gQlVTWV9TVEFURTtcbiAgICAgIH1cbiAgICAgIGVsc2Uge1xuICAgICAgICBwdXRfYnl0ZShzLCAocy5nemhlYWQudGV4dCA/IDEgOiAwKSArXG4gICAgICAgICAgICAgICAgICAgIChzLmd6aGVhZC5oY3JjID8gMiA6IDApICtcbiAgICAgICAgICAgICAgICAgICAgKCFzLmd6aGVhZC5leHRyYSA/IDAgOiA0KSArXG4gICAgICAgICAgICAgICAgICAgICghcy5nemhlYWQubmFtZSA/IDAgOiA4KSArXG4gICAgICAgICAgICAgICAgICAgICghcy5nemhlYWQuY29tbWVudCA/IDAgOiAxNilcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICBwdXRfYnl0ZShzLCBzLmd6aGVhZC50aW1lICYgMHhmZik7XG4gICAgICAgIHB1dF9ieXRlKHMsIChzLmd6aGVhZC50aW1lID4+IDgpICYgMHhmZik7XG4gICAgICAgIHB1dF9ieXRlKHMsIChzLmd6aGVhZC50aW1lID4+IDE2KSAmIDB4ZmYpO1xuICAgICAgICBwdXRfYnl0ZShzLCAocy5nemhlYWQudGltZSA+PiAyNCkgJiAweGZmKTtcbiAgICAgICAgcHV0X2J5dGUocywgcy5sZXZlbCA9PT0gOSA/IDIgOlxuICAgICAgICAgICAgICAgICAgICAocy5zdHJhdGVneSA+PSBaX0hVRkZNQU5fT05MWSB8fCBzLmxldmVsIDwgMiA/XG4gICAgICAgICAgICAgICAgICAgICA0IDogMCkpO1xuICAgICAgICBwdXRfYnl0ZShzLCBzLmd6aGVhZC5vcyAmIDB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gLSBiZWcsIGJlZyk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGZsdXNoX3BlbmRpbmcoc3RybSk7XG4gICAgICAgICAgYmVnID0gcy5wZW5kaW5nO1xuICAgICAgICAgIGlmIChzLnBlbmRpbmcgPT09IHMucGVuZGluZ19idWZfc2l6ZSkge1xuICAgICAgICAgICAgdmFsID0gMTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICAvLyBKUyBzcGVjaWZpYzogbGl0dGxlIG1hZ2ljIHRvIGFkZCB6ZXJvIHRlcm1pbmF0b3IgdG8gZW5kIG9mIHN0cmluZ1xuICAgICAgICBpZiAocy5nemluZGV4IDwgcy5nemhlYWQubmFtZS5sZW5ndGgpIHtcbiAgICAgICAgICB2YWwgPSBzLmd6aGVhZC5uYW1lLmNoYXJDb2RlQXQocy5nemluZGV4KyspICYgMHhmZjtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB2YWwgPSAwO1xuICAgICAgICB9XG4gICAgICAgIHB1dF9ieXRlKHMsIHZhbCk7XG4gICAgICB9IHdoaWxlICh2YWwgIT09IDApO1xuXG4gICAgICBpZiAocy5nemhlYWQuaGNyYyAmJiBzLnBlbmRpbmcgPiBiZWcpIHtcbiAgICAgICAgc3RybS5hZGxlciA9IGNyYzMyKHN0cm0uYWRsZXIsIHMucGVuZGluZ19idWYsIHMucGVuZGluZyAtIGJlZywgYmVnKTtcbiAgICAgIH1cbiAgICAgIGlmICh2YWwgPT09IDApIHtcbiAgICAgICAgcy5nemluZGV4ID0gMDtcbiAgICAgICAgcy5zdGF0dXMgPSBDT01NRU5UX1NUQVRFO1xuICAgICAgfVxuICAgIH1cbiAgICBlbHNlIHtcbiAgICAgIHMuc3RhdHVzID0gQ09NTUVOVF9TVEFURTtcbiAgICB9XG4gIH1cbiAgaWYgKHMuc3RhdHVzID09PSBDT01NRU5UX1NUQVRFKSB7XG4gICAgaWYgKHMuZ3poZWFkLmNvbW1lbnQvKiAhPSBaX05VTEwqLykge1xuICAgICAgYmVnID0gcy5wZW5kaW5nOyAgLyogc3RhcnQgb2YgYnl0ZXMgdG8gdXBkYXRlIGNyYyAqL1xuICAgICAgLy9pbnQgdmFsO1xuXG4gICAgICBkbyB7XG4gICAgICAgIGlmIChzLnBlbmRpbmcgPT09IHMucGVuZGluZ19idWZfc2l6ZSkge1xuICAgICAgICAgIGlmIChzLmd6aGVhZC5oY3JjICYmIHMucGVuZGluZyA+IGJlZykge1xuICAgICAgICAgICAgc3RybS5hZGxlciA9IGNyYzMyKHN0cm0uYWRsZXIsIHMucGVuZGluZ19idWYsIHMucGVuZGluZyAtIGJlZywgYmVnKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgZmx1c2hfcGVuZGluZyhzdHJtKTtcbiAgICAgICAgICBiZWcgPSBzLnBlbmRpbmc7XG4gICAgICAgICAgaWYgKHMucGVuZGluZyA9PT0gcy5wZW5kaW5nX2J1Zl9zaXplKSB7XG4gICAgICAgICAgICB2YWwgPSAxO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIEpTIHNwZWNpZmljOiBsaXR0bGUgbWFnaWMgdG8gYWRkIHplcm8gdGVybWluYXRvciB0byBlbmQgb2Ygc3RyaW5nXG4gICAgICAgIGlmIChzLmd6aW5kZXggPCBzLmd6aGVhZC5jb21tZW50Lmxlbmd0aCkge1xuICAgICAgICAgIHZhbCA9IHMuZ3poZWFkLmNvbW1lbnQuY2hhckNvZGVBdChzLmd6aW5kZXgrKykgJiAweGZmO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHZhbCA9IDA7XG4gICAgICAgIH1cbiAgICAgICAgcHV0X2J5dGUocywgdmFsKTtcbiAgICAgIH0gd2hpbGUgKHZhbCAhPT0gMCk7XG5cbiAgICAgIGlmIChzLmd6aGVhZC5oY3JjICYmIHMucGVuZGluZyA+IGJlZykge1xuICAgICAgICBzdHJt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bm90IHVzaW5nIHdpbmRvdyAqL1xuICB2YXIgd2hhdmU7ICAgICAgICAgICAgICAgICAgLyogdmFsaWQgYnl0ZXMgaW4gdGhlIHdpbmRvdyAqL1xuICB2YXIgd25leHQ7ICAgICAgICAgICAgICAgICAgLyogd2luZG93IHdyaXRlIGluZGV4ICovXG4gIC8vIFVzZSBgc193aW5kb3dgIGluc3RlYWQgYHdpbmRvd2AsIGF2b2lkIGNvbmZsaWN0IHdpdGggaW5zdHJ1bWVudGF0aW9uIHRvb2xzXG4gIHZhciBzX3dpbmRvdzsgICAgICAgICAgICAgICAvKiBhbGxvY2F0ZWQgc2xpZGluZyB3aW5kb3csIGlmIHdzaXplICE9IDAgKi9cbiAgdmFyIGhvbGQ7ICAgICAgICAgICAgICAgICAgIC8qIGxvY2FsIHN0cm0uaG9sZCAqL1xuICB2YXIgYml0czsgICAgICAgICAgICAgICAgICAgLyogbG9jYWwgc3RybS5iaXRzICovXG4gIHZhciBsY29kZTsgICAgICAgICAgICAgICAgICAvKiBsb2NhbCBzdHJtLmxlbmNvZGUgKi9cbiAgdmFyIGRjb2RlOyAgICAgICAgICAgICAgICAgIC8qIGxvY2FsIHN0cm0uZGlzdGNvZGUgKi9cbiAgdmFyIGxtYXNrOyAgICAgICAgICAgICAgICAgIC8qIG1hc2sgZm9yIGZpcnN0IGxldmVsIG9mIGxlbmd0aCBjb2RlcyAqL1xuICB2YXIgZG1hc2s7ICAgICAgICAgICAgICAgICAgLyogbWFzayBmb3IgZmlyc3QgbGV2ZWwgb2YgZGlzdGFuY2UgY29kZXMgKi9cbiAgdmFyIGhlcmU7ICAgICAgICAgICAgICAgICAgIC8qIHJldHJpZXZlZCB0YWJsZSBlbnRyeSAqL1xuICB2YXIgb3A7ICAgICAgICAgICAgICAgICAgICAgLyogY29kZSBiaXRzLCBvcGVyYXRpb24sIGV4dHJhIGJpdHMsIG9yICovXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAgd2luZG93IHBvc2l0aW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JhbCAweCUwMnhcXG5cIiwgaGVyZS52YWwpKTtcbiAgICAgICAgb3V0cHV0W19vdXQrK10gPSBoZXJlICYgMHhmZmZmLypoZXJlLnZhbCovO1xuICAgICAgfVxuICAgICAgZWxzZSBpZiAob3AgJiAxNikgeyAgICAgICAgICAgICAgICAgICAgIC8qIGxlbmd0aCBiYXNlICovXG4gICAgICAgIGxlbiA9IGhlcmUgJiAweGZmZmYvKmhlcmUudmFsKi87XG4gICAgICAgIG9wICY9IDE1OyAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIG51bWJlciBvZiBleHRyYSBiaXRzICovXG4gICAgICAgIGlmIChvcCkge1xuICAgICAgICAgIGlmIChiaXRzIDwgb3ApIHtcbiAgICAgICAgICAgIGhvbGQgKz0gaW5wdXRbX2luKytdIDw8IGJpdHM7XG4gICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgfVxuICAgICAgICAgIGxlbiArPSBob2xkICYgKCgxIDw8IG9wKSAtIDEpO1xuICAgICAgICAgIGhvbGQgPj4+PSBvcDtcbiAgICAgICAgICBiaXRzIC09IG9wO1xuICAgICAgICB9XG4gICAgICAgIC8vVHJhY2V2digoc3RkZXJyLCBcImluZmxhdGU6ICAgICAgICAgbGVuZ3RoICV1XFxuXCIsIGxlbikpO1xuICAgICAgICBpZiAoYml0cyA8IDE1KSB7XG4gICAgICAgICAgaG9sZCArPSBpbnB1dFtfaW4rK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgaG9sZCArPSBpbnB1dFtfaW4rK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgIH1cbiAgICAgICAgaGVyZSA9IGRjb2RlW2hvbGQgJiBkbWFza107XG5cbiAgICAgICAgZG9kaXN0OlxuICAgICAgICBmb3IgKDs7KSB7IC8vIGdvdG8gZW11bGF0aW9uXG4gICAgICAgICAgb3AgPSBoZXJlID4+PiAyNC8qaGVyZS5iaXRzKi87XG4gICAgICAgICAgaG9sZCA+Pj49IG9wO1xuICAgICAgICAgIGJpdHMgLT0gb3A7XG4gICAgICAgICAgb3AgPSAoaGVyZSA+Pj4gMTYpICYgMHhmZi8qaGVyZS5vcCovO1xuXG4gICAgICAgICAgaWYgKG9wICYgMTYpIHsgICAgICAgICAgICAgICAgICAgICAgLyogZGlzdGFuY2UgYmFzZSAqL1xuICAgICAgICAgICAgZGlzdCA9IGhlcmUgJiAweGZmZmYvKmhlcmUudmFsKi87XG4gICAgICAgICAgICBvcCAmPSAxNTsgICAgICAgICAgICAgICAgICAgICAgIC8qIG51bWJlciBvZiBleHRyYSBiaXRzICovXG4gICAgICAgICAgICBpZiAoYml0cyA8IG9wKSB7XG4gICAgICAgICAgICAgIGhvbGQgKz0gaW5wdXRbX2luKytdIDw8IGJpdHM7XG4gICAgICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgICAgICAgaWYgKGJpdHMgPCBvcCkge1xuICAgICAgICAgICAgICAgIGhvbGQgKz0gaW5wdXRbX2luKytdIDw8IGJpdHM7XG4gICAgICAgICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBkaXN0ICs9IGhvbGQgJiAoKDEgPDwgb3ApIC0gMSk7XG4vLyNpZmRlZiBJTkZMQVRFX1NUUklDVFxuICAgICAgICAgICAgaWYgKGRpc3QgPiBkbWF4KSB7XG4gICAgICAgICAgICAgIHN0cm0ubXNnID0gJ2ludmFsaWQgZGlzdGFuY2UgdG9vIGZhciBiYWNrJztcbiAgICAgICAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgICAgICAgYnJlYWsgdG9wO1xuICAgICAgICAgICAgfVxuLy8jZW5kaWZcbiAgICAgICAgICAgIGhvbGQgPj4+PSBvcDtcbiAgICAgICAgICAgIGJpdHMgLT0gb3A7XG4gICAgICAgICAgICAvL1RyYWNldnYoKHN0ZGVyciwgXCJpbmZsYXRlOiAgICAgICAgIGRpc3RhbmNlICV1XFxuXCIsIGRpc3QpKTtcbiAgICAgICAgICAgIG9wID0gX291dCAtIGJlZzsgICAgICAgICAgICAgICAgLyogbWF4IGRpc3RhbmNlIGluIG91dHB1dCAqL1xuICAgICAgICAgICAgaWYgKGRpc3QgPiBvcCkgeyAgICAgICAgICAgICAgICAvKiBzZWUgaWYgY29weSBmcm9tIHdpbmRvdyAqL1xuICAgICAgICAgICAgICBvcCA9IGRpc3QgLSBvcDsgICAgICAgICAgICAgICAvKiBkaXN0YW5jZSBiYWNrIGluIHdpbmRvdyAqL1xuICAgICAgICAgICAgICBpZiAob3AgPiB3aGF2ZSkge1xuICAgICAgICAgICAgICAgIGlmIChzdGF0ZS5zYW5lKSB7XG4gICAgICAgICAgICAgICAgICBzdHJtLm1zZyA9ICdpbnZhbGlkIGRpc3RhbmNlIHRvbyBmYXIgYmFjayc7XG4gICAgICAgICAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgICAgICAgICAgYnJlYWsgdG9wO1xuICAgICAgICAgICAgICAgIH1cblxuLy8gKCEpIFRoaXMgYmxvY2sgaXMgZGlzYWJsZWQgaW4gemxpYiBkZWZhaWx0cyxcbi8vIGRvbid0IGVuYWJsZSBpdCBmb3IgYmluYXJ5IGNvbXBhdGliaWxpdHlcbi8vI2lmZGVmIElORkxBVEVfQUxMT1dfSU5WQUxJRF9ESVNUQU5DRV9UT09GQVJfQVJSUlxuLy8gICAgICAgICAgICAgICAgaWYgKGxlbiA8PSBvcCAtIHdoYXZlKSB7XG4vLyAgICAgICAgICAgICAgICAgIGRvIHtcbi8vICAgICAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IDA7XG4vLyAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKC0tbGVuKTtcbi8vICAgICAgICAgICAgICAgICAgY29udGludWUgdG9wO1xuLy8gICAgICAgICAgICAgICAgfVxuLy8gICAgICAgICAgICAgICAgbGVuIC09IG9wIC0gd2hhdmU7XG4vLyAgICAgICAgICAgICAgICBkbyB7XG4vLyAgICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gMDtcbi8vICAgICAgICAgICAgICAgIH0gd2hpbGUgKC0tb3AgPiB3aGF2ZSk7XG4vLyAgICAgICAgICAgICAgICBpZiAob3AgPT09IDApIHtcbi8vICAgICAgICAgICAgICAgICAgZnJvbSA9IF9vdXQgLSBkaXN0O1xuLy8gICAgICAgICAgICAgICAgICBkbyB7XG4vLyAgICAgICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBvdXRwdXRbZnJvbSsrXTtcbi8vICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoLS1sZW4pO1xuLy8gICAgICAgICAgICAgICAgICBjb250aW51ZSB0b3A7XG4vLyAgICAgICAgICAgICAgICB9XG4vLyNlbmRpZlxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGZyb20gPSAwOyAvLyB3aW5kb3cgaW5kZXhcbiAgICAgICAgICAgICAgZnJvbV9zb3VyY2UgPSBzX3dpbmRvdztcbiAgICAgICAgICAgICAgaWYgKHduZXh0ID09PSAwKSB7ICAgICAgICAgICAvKiB2ZXJ5IGNvbW1vbiBjYXNlICovXG4gICAgICAgICAgICAgICAgZnJvbSArPSB3c2l6ZSAtIG9wO1xuICAgICAgICAgICAgICAgIGlmIChvcCA8IGxlbikgeyAgICAgICAgIC8qIHNvbWUgZnJvbSB3aW5kb3cgKi9cbiAgICAgICAgICAgICAgICAgIGxlbiAtPSBvcDtcbiAgICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBzX3dpbmRvd1tmcm9tKytdO1xuICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoLS1vcCk7XG4gICAgICAgICAgICAgICAgICBmcm9tID0gX291dCAtIGRpc3Q7ICAvKiByZXN0IGZyb20gb3V0cHV0ICovXG4gICAgICAgICAgICAgICAgICBmcm9tX3NvdXJjZSA9IG91dHB1dDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgZWxzZSBpZiAod25leHQgPCBvcCkgeyAgICAgIC8qIHdyYXAgYXJvdW5kIHdpbmRvdyAqL1xuICAgICAgICAgICAgICAgIGZyb20gKz0gd3NpemUgKyB3bmV4dCAtIG9wO1xuICAgICAgICAgICAgICAgIG9wIC09IHduZXh0O1xuICAgICAgICAgICAgICAgIGlmIChvcCA8IGxlbikgeyAgICAgICAgIC8qIHNvbWUgZnJvbSBlbmQgb2Ygd2luZG93ICovXG4gICAgICAgICAgICAgICAgICBsZW4gLT0gb3A7XG4gICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gc193aW5kb3dbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKC0tb3ApO1xuICAgICAgICAgICAgICAgICAgZnJvbSA9IDA7XG4gICAgICAgICAgICAgICAgICBpZiAod25leHQgPCBsZW4pIHsgIC8qIHNvbWUgZnJvbSBzdGFydCBvZiB3aW5kb3cgKi9cbiAgICAgICAgICAgICAgICAgICAgb3AgPSB3bmV4dDtcbiAgICAgICAgICAgICAgICAgICAgbGVuIC09IG9wO1xuICAgICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBzX3dpbmRvd1tmcm9tKytdO1xuICAgICAgICAgICAgICAgICAgICB9IHdoaWxlICgtLW9wKTtcbiAgICAgICAgICAgICAgICAgICAgZnJvbSA9IF9vdXQgLSBkaXN0OyAgICAgIC8qIHJlc3QgZnJvbSBvdXRwdXQgKi9cbiAgICAgICAgICAgICAgICAgICAgZnJvbV9zb3VyY2UgPSBvdXRwdXQ7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGVsc2UgeyAgICAgICAgICAgICAgICAgICAgICAvKiBjb250aWd1b3VzIGluIHdpbmRvdyAqL1xuICAgICAgICAgICAgICAgIGZyb20gKz0gd25leHQgLSBvcDtcbiAgICAgICAgICAgICAgICBpZiAob3AgPCBsZW4pIHsgICAgICAgICAvKiBzb21lIGZyb20gd2luZG93ICovXG4gICAgICAgICAgICAgICAgICBsZW4gLT0gb3A7XG4gICAgICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gc193aW5kb3dbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKC0tb3ApO1xuICAgICAgICAgICAgICAgICAgZnJvbSA9IF9vdXQgLSBkaXN0OyAgLyogcmVzdCBmcm9tIG91dHB1dCAqL1xuICAgICAgICAgICAgICAgICAgZnJvbV9zb3VyY2UgPSBvdXRwdXQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHdoaWxlIChsZW4gPiAyKSB7XG4gICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBmcm9tX3NvdXJjZVtmcm9tKytdO1xuICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gZnJvbV9zb3VyY2VbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IGZyb21fc291cmNlW2Zyb20rK107XG4gICAgICAgICAgICAgICAgbGVuIC09IDM7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKGxlbikge1xuICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gZnJvbV9zb3VyY2VbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICBpZiAobGVuID4gMSkge1xuICAgICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBmcm9tX3NvdXJjZVtmcm9tKytdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgIGZyb20gPSBfb3V0IC0gZGlzdDsgICAgICAgICAgLyogY29weSBkaXJlY3QgZnJvbSBvdXRwdXQgKi9cbiAgICAgICAgICAgICAgZG8geyAgICAgICAgICAgICAgICAgICAgICAgIC8qIG1pbmltdW0gbGVuZ3RoIGlzIHRocmVlICovXG4gICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBvdXRwdXRbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICBvdXRwdXRbX291dCsrXSA9IG91dHB1dFtmcm9tKytdO1xuICAgICAgICAgICAgICAgIG91dHB1dFtfb3V0KytdID0gb3V0cHV0W2Zyb20rK107XG4gICAgICAgICAgICAgICAgbGVuIC09IDM7XG4gICAgICAgICAgICAgIH0gd2hpbGUgKGxlbiA+IDIpO1xuICAgICAgICAgICAgICBpZiAobGVuKSB7XG4gICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBvdXRwdXRbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICBpZiAobGVuID4gMSkge1xuICAgICAgICAgICAgICAgICAgb3V0cHV0W19vdXQrK10gPSBvdXRwdXRbZnJvbSsrXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgZWxzZSBpZiAoKG9wICYgNjQpID09PSAwKSB7ICAgICAgICAgIC8qIDJuZCBsZXZlbCBkaXN0YW5jZSBjb2RlICovXG4gICAgICAgICAgICBoZXJlID0gZGNvZGVbKGhlcmUgJiAweGZmZmYpLypoZXJlLnZhbCovICsgKGhvbGQgJiAoKDEgPDwgb3ApIC0gMSkpXTtcbiAgICAgICAgICAgIGNvbnRpbnVlIGRvZGlzdDtcbiAgICAgICAgICB9XG4gICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBzdHJtLm1zZyA9ICdpbnZhbGlkIGRpc3RhbmNlIGNvZGUnO1xuICAgICAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgICAgIGJyZWFrIHRvcDtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBicmVhazsgLy8gbmVlZCB0byBlbXVsYXRlIGdvdG8gdmlhIFwiY29udGludWVcIlxuICAgICAgICB9XG4gICAgICB9XG4gICAgICBlbHNlIGlmICgob3AgJiA2NCkgPT09IDApIHsgICAgICAgICAgICAgIC8qIDJuZCBsZXZlbCBsZW5ndGggY29kZSAqL1xuICAgICAgICBoZXJlID0gbGNvZGVbKGhlcmUgJiAweGZmZmYpLypoZXJlLnZhbCovICsgKGhvbGQgJiAoKDEgPDwgb3ApIC0gMSkpXTtcbiAgICAgICAgY29udGludWUgZG9sZW47XG4gICAgICB9XG4gICAgICBlbHNlIGlmIChvcCAmIDMyKSB7ICAgICAgICAgICAgICAgICAgICAgLyogZW5kLW9mLWJsb2NrICovXG4gICAgICAgIC8vVHJhY2V2digoc3RkZXJyLCBcImluZmxhdGU6ICAgICAgICAgZW5kIG9mIGJsb2NrXFxuXCIpKTtcbiAgICAgICAgc3RhdGUubW9kZSA9IFRZUEU7XG4gICAgICAgIGJyZWFrIHRvcDtcbiAgICAgIH1cbiAgICAgIGVsc2Uge1xuICAgICAgICBzdHJtLm1zZyA9ICdpbnZhbGlkIGxpdGVyYWwvbGVuZ3RoIGNvZGUnO1xuICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICBicmVhayB0b3A7XG4gICAgICB9XG5cbiAgICAgIGJyZWFrOyAvLyBuZWVkIHRvIGVtdWxhdGUgZ290byB2aWEgXCJjb250aW51ZVwiXG4gICAgfVxuICB9IHdoaWxlIChfaW4gPCBsYXN0ICYmIF9vdXQgPCBlbmQpO1xuXG4gIC8qIHJldHVybiB1bnVzZWQgYnl0ZXMgKG9uIGVudHJ5LCBiaXRzIDwgOCwgc28gaW4gd29uJ3QgZ28gdG9vIGZhciBiYWNrKSAqL1xuICBsZW4gPSBiaXRzID4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YW5kIGluZmxhdGUoKSBiZWxvdyBmb3IgZGV0YWlscyAqL1xuLy92YXIgWl9OT19GTFVTSCAgICAgID0gMDtcbi8vdmFyIFpfUEFSVElBTF9GTFVTSCA9IDE7XG4vL3ZhciBaX1NZTkNfRkxVU0ggICAgPSAyO1xuLy92YXIgWl9GVUxMX0ZMVVNIICAgID0gMztcbnZhciBaX0ZJTklTSCAgICAgICAgPSA0O1xudmFyIFpfQkxPQ0sgICAgICAgICA9IDU7XG52YXIgWl9UUkVFUyAgICAgICAgID0gNjtcblxuXG4vKiBSZXR1cm4gY29kZXMgZm9yIHRoZSBjb21wcmVzc2lvbi9kZWNvbXByZXNzaW9uIGZ1bmN0aW9ucy4gTmVnYXRpdmUgdmFsdWVzXG4gKiBhcmUgZXJyb3JzLCBwb3NpdGl2ZSB2YWx1ZXMgYXJlIHVzZWQgZm9yIHNwZWNpYWwgYnV0IG5vcm1hbCBldmVudHMuXG4gKi9cbnZhciBaX09LICAgICAgICAgICAgPSAwO1xudmFyIFpfU1RSRUFNX0VORCAgICA9IDE7XG52YXIgWl9ORUVEX0RJQ1QgICAgID0gMjtcbi8vdmFyIFpfRVJSTk8gICAgICAgICA9IC0xO1xudmFyIFpfU1RSRUFNX0VSUk9SICA9IC0yO1xudmFyIFpfREFUQV9FUlJPUiAgICA9IC0zO1xudmFyIFpfTUVNX0VSUk9SICAgICA9IC00O1xudmFyIFpfQlVGX0VSUk9SICAgICA9IC01O1xuLy92YXIgWl9WRVJTSU9OX0VSUk9SID0gLTY7XG5cbi8qIFRoZSBkZWZsYXRlIGNvbXByZXNzaW9uIG1ldGhvZCAqL1xudmFyIFpfREVGTEFURUQgID0gODtcblxuXG4vKiBTVEFURVMgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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mcgbGFzdC1mbGFnIGJpdCAqL1xudmFyICAgICAgICBUWVBFRE8gPSAxMzsgICAgLyogaTogc2FtZSwgYnV0IHNraXAgY2hlY2sgdG8gZXhpdCBpbmZsYXRlIG9uIG5ldyBibG9jayAqL1xudmFyICAgICAgICBTVE9SRUQgPSAxNDsgICAgLyogaTogd2FpdGluZyBmb3Igc3RvcmVkIHNpemUgKGxlbmd0aCBhbmQgY29tcGxlbWVudCkgKi9cbnZhciAgICAgICAgQ09QWV8gPSAxNTsgICAgIC8qIGkvbzogc2FtZSBhcyBDT1BZIGJlbG93LCBidXQgb25seSBmaXJzdCB0aW1lIGluICovXG52YXIgICAgICAgIENPUFkgPSAxNjsgICAgICAvKiBpL286IHdhaXRpbmcgZm9yIGlucHV0IG9yIG91dHB1dCB0byBjb3B5IHN0b3JlZCBibG9jayAqL1xudmFyICAgICAgICBUQUJMRSA9IDE3OyAgICAgLyogaTogd2FpdGluZyBmb3IgZHluYW1pYyBibG9jayB0YWJsZSBsZW5ndGhzICovXG52YXIgICAgICAgIExFTkxFTlMgPSAxODsgICAvKiBpOiB3YWl0aW5nIGZvciBjb2RlIGxlbmd0aCBjb2RlIGxlbmd0aHMgKi9cbnZhciAgICAgICAgQ09ERUxFTlMgPSAxOTsgIC8qIGk6IHdhaXRpbmcgZm9yIGxlbmd0aC9saXQgYW5kIGRpc3RhbmNlIGNvZGUgbGVuZ3RocyAqL1xudmFyICAgICAgICAgICAgTEVOXyA9IDIwOyAgICAgIC8qIGk6IHNhbWUgYXMgTEVOIGJlbG93LCBidXQgb25seSBmaXJzdCB0aW1lIGluICovXG52YXIgICAgICAgICAgICBMRU4gPSAyMTsgICAgICAgLyogaTogd2FpdGluZyBmb3IgbGVuZ3RoL2xpdC9lb2IgY29kZSAqL1xudmFyICAgICAgICAgICAgTEVORVhUID0gMjI7ICAgIC8qIGk6IHdhaXRpbmcgZm9yIGxlbmd0aCBleHRyYSBiaXRzICovXG52YXIgICAgICAgICAgICBESVNUID0gMjM7ICAgICAgLyogaTogd2FpdGluZyBmb3IgZGlzdGFuY2UgY29kZSAqL1xudmFyICAgICAgICAgICAgRElTVEVYVCA9IDI0OyAgIC8qIGk6IHdhaXRpbmcgZm9yIGRpc3RhbmNlIGV4dHJhIGJpdHMgKi9cbnZhciAgICAgICAgICAgIE1BVENIID0gMjU7ICAgICAvKiBvOiB3YWl0aW5nIGZvciBvdXRwdXQgc3BhY2UgdG8gY29weSBzdHJpbmcgKi9cbnZhciAgICAgICAgICAgIExJVCA9IDI2OyAgICAgICAvKiBvOiB3YWl0aW5nIGZvciBvdXRwdXQgc3BhY2UgdG8gd3JpdGUgbGl0ZXJhbCAqL1xudmFyICAgIENIRUNLID0gMjc7ICAgICAvKiBpOiB3YWl0aW5nIGZvciAzMi1iaXQgY2hlY2sgdmFsdWUgKi9cbnZhciAgICBMRU5HVEggPSAyODsgICAgLyogaTogd2FpdGluZyBmb3IgMzItYml0IGxlbmd0aCAoZ3ppcCkgKi9cbnZhciAgICBET05FID0gMjk7ICAgICAgLyogZmluaXNoZWQgY2hlY2ssIGRvbmUgLS0gcmVtYWluIGhlcmUgdW50aWwgcmVzZXQgKi9cbnZhciAgICBCQUQgPSAzMDsgICAgICAgLyogZ290IGEgZGF0YSBlcnJvciAtLSByZW1haW4gaGVyZSB1bnRpbCByZXNldCAqL1xudmFyICAgIE1FTSA9IDMxOyAgICAgICAvKiBnb3QgYW4gaW5mbGF0ZSgpIG1lbW9yeSBlcnJvciAtLSByZW1haW4gaGVyZSB1bnRpbCByZXNldCAqL1xudmFyICAgIFNZTkMgPSAzMjsgICAgICAvKiBsb29raW5nIGZvciBzeW5jaHJvbml6YXRpb24gYnl0ZXMgdG8gcmVzdGFydCBpbmZsYXRlKCkgKi9cblxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cblxuXG5cbnZhciBFTk9VR0hfTEVOUyA9IDg1MjtcbnZh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EFURUQpIHtcbiAgICAgICAgc3RybS5tc2cgPSAndW5rbm93biBjb21wcmVzc2lvbiBtZXRob2QnO1xuICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICBicmVhaztcbiAgICAgIH1cbiAgICAgIC8vLS0tIERST1BCSVRTKDQpIC0tLS8vXG4gICAgICBob2xkID4+Pj0gNDtcbiAgICAgIGJpdHMgLT0gNDtcbiAgICAgIC8vLS0tLy9cbiAgICAgIGxlbiA9IChob2xkICYgMHgwZikvKkJJVFMoNCkqLyArIDg7XG4gICAgICBpZiAoc3RhdGUud2JpdHMgPT09IDApIHtcbiAgICAgICAgc3RhdGUud2JpdHMgPSBsZW47XG4gICAgICB9XG4gICAgICBlbHNlIGlmIChsZW4gPiBzdGF0ZS53Yml0cykge1xuICAgICAgICBzdHJtLm1zZyA9ICdpbnZhbGlkIHdpbmRvdyBzaXplJztcbiAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICBzdGF0ZS5kbWF4ID0gMSA8PCBsZW47XG4gICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgemxpYiBoZWFkZXIgb2tcXG5cIikpO1xuICAgICAgc3RybS5hZGxlciA9IHN0YXRlLmNoZWNrID0gMS8qYWRsZXIzMigwTCwgWl9OVUxMLCAwKSovO1xuICAgICAgc3RhdGUubW9kZSA9IGhvbGQgJiAweDIwMCA/IERJQ1RJRCA6IFRZUEU7XG4gICAgICAvLz09PSBJTklUQklUUygpO1xuICAgICAgaG9sZCA9IDA7XG4gICAgICBiaXRzID0gMDtcbiAgICAgIC8vPT09Ly9cbiAgICAgIGJyZWFrO1xuICAgIGNhc2UgRkxBR1M6XG4gICAgICAvLz09PSBORUVEQklUUygxNik7ICovXG4gICAgICB3aGlsZSAoYml0cyA8IDE2KSB7XG4gICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxu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z2ggKi9cbiAgICBjYXNlIFRJTUU6XG4gICAgICAvLz09PSBORUVEQklUUygzMik7ICovXG4gICAgICB3aGlsZSAoYml0cyA8IDMyKSB7XG4gICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICBoYXZlLS07XG4gICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICBiaXRzICs9IDg7XG4gICAgICB9XG4gICAgICAvLz09PS8vXG4gICAgICBpZiAoc3RhdGUuaGVhZCkge1xuICAgICAgICBzdGF0ZS5oZWFkLnRpbWUgPSBob2xkO1xuICAgICAgfVxuICAgICAgaWYgKHN0YXRlLmZsYWdzICYgMHgwMjAwKSB7XG4gICAgICAgIC8vPT09IENSQzQoc3RhdGUuY2hlY2ssIGhvbGQpXG4gICAgICAgIGhidWZbMF0gPSBob2xkICYgMHhmZjtcbiAgICAgICAgaGJ1ZlsxXSA9IChob2xkID4+PiA4KSAmIDB4ZmY7XG4gICAgICAgIGhidWZbMl0gPSAoaG9sZCA+Pj4gMTYpICYgMHhmZjtcbiAgICAgICAgaGJ1ZlszXSA9IChob2xkID4+PiAyNCkgJiAweGZmO1xuICAgICAgICBzdGF0ZS5jaGVjayA9IGNyYzMyKHN0YXRlLmNoZWNrLCBoYnVmLCA0LCAwKTtcbiAgICAgICAgLy89PT1cbiAgICAgIH1cbiAgICAgIC8vPT09IElOSVRCSVRTKCk7XG4gICAgICBob2xkID0gMDtcbiAgICAgIGJpdHMgPSAwO1xuICAgICAgLy89PT0vL1xuICAgICAgc3RhdGUubW9kZSA9IE9TO1xuICAgICAgLyogZmFsbHMgdGhyb3VnaCAqL1xuICAgIGNhc2UgT1M6XG4gICAgICAvLz09PSBORUVEQklUUygxNik7ICovXG4gICAgICB3aGlsZSAoYml0cyA8IDE2KSB7XG4gICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAg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GVhZC5leHRyYSkge1xuICAgICAgICAgICAgICAvLyBVc2UgdW50eXBlZCBhcnJheSBmb3IgbW9yZSBjb252ZW5pZW5kIHByb2Nlc3NpbmcgbGF0ZXJcbiAgICAgICAgICAgICAgc3RhdGUuaGVhZC5leHRyYSA9IG5ldyBBcnJheShzdGF0ZS5oZWFkLmV4dHJhX2xlbik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB1dGlscy5hcnJheVNldChcbiAgICAgICAgICAgICAgc3RhdGUuaGVhZC5leHRyYSxcbiAgICAgICAgICAgICAgaW5wdXQsXG4gICAgICAgICAgICAgIG5leHQsXG4gICAgICAgICAgICAgIC8vIGV4dHJhIGZpZWxkIGlzIGxpbWl0ZWQgdG8gNjU1MzYgYnl0ZXNcbiAgICAgICAgICAgICAgLy8gLSBubyBuZWVkIGZvciBhZGRpdGlvbmFsIHNpemUgY2hlY2tcbiAgICAgICAgICAgICAgY29weSxcbiAgICAgICAgICAgICAgLypsZW4gKyBjb3B5ID4gc3RhdGUuaGVhZC5leHRyYV9tYXggLSBsZW4gPyBzdGF0ZS5oZWFkLmV4dHJhX21heCA6IGNvcHksKi9cbiAgICAgICAgICAgICAgbGVuXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgLy96bWVtY3B5KHN0YXRlLmhlYWQuZXh0cmEgKyBsZW4sIG5leHQsXG4gICAgICAgICAgICAvLyAgICAgICAgbGVuICsgY29weSA+IHN0YXRlLmhlYWQuZXh0cmFfbWF4ID9cbiAgICAgICAgICAgIC8vICAgICAgICBzdGF0ZS5oZWFkLmV4dHJhX21heCAtIGxlbiA6IGNvcHkpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoc3RhdGUuZmxhZ3MgJiAweDAyMDApIHtcbiAgICAgICAgICAgIHN0YXRlLmNoZWNrID0gY3JjMzIoc3RhdGUuY2hlY2ssIGlucHV0LCBjb3B5LCBuZXh0KTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaGF2ZSAtPSBjb3B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biAgICAgICAgbmV4dCArPSBjb3B5O1xuICAgICAgICBpZiAobGVuKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgfVxuICAgICAgZWxzZSBpZiAoc3RhdGUuaGVhZCkge1xuICAgICAgICBzdGF0ZS5oZWFkLmNvbW1lbnQgPSBudWxsO1xuICAgICAgfVxuICAgICAgc3RhdGUubW9kZSA9IEhDUkM7XG4gICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgY2FzZSBIQ1JDOlxuICAgICAgaWYgKHN0YXRlLmZsYWdzICYgMHgwMjAwKSB7XG4gICAgICAgIC8vPT09IE5FRURCSVRTKDE2KTsgKi9cbiAgICAgICAgd2hpbGUgKGJpdHMgPCAxNikge1xuICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgIH1cbiAgICAgICAgLy89PT0vL1xuICAgICAgICBpZiAoaG9sZCAhPT0gKHN0YXRlLmNoZWNrICYgMHhmZmZmKSkge1xuICAgICAgICAgIHN0cm0ubXNnID0gJ2hlYWRlciBjcmMgbWlzbWF0Y2gnO1xuICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgLy89PT0gSU5JVEJJVFMoKTtcbiAgICAgICAgaG9sZCA9IDA7XG4gICAgICAgIGJpdHMgPSAwO1xuICAgICAgICAvLz09PS8vXG4gICAgICB9XG4gICAgICBpZiAoc3RhdGUuaGVhZCkge1xuICAgICAgICBzdGF0ZS5oZWFkLmhjcmMgPSAoKHN0YXRlLmZsYWdzID4+IDkpICYgMSk7XG4gICAgICAgIHN0YXRlLmhlYWQuZG9uZSA9IHRydWU7XG4gICAgICB9XG4gICAgICBzdHJtLmFkbGV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bGVyMzIoMEwsIFpfTlVMTCwgMCkqLztcbiAgICAgIHN0YXRlLm1vZGUgPSBUWVBFO1xuICAgICAgLyogZmFsbHMgdGhyb3VnaCAqL1xuICAgIGNhc2UgVFlQRTpcbiAgICAgIGlmIChmbHVzaCA9PT0gWl9CTE9DSyB8fCBmbHVzaCA9PT0gWl9UUkVFUykgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgIC8qIGZhbGxzIHRocm91Z2ggKi9cbiAgICBjYXNlIFRZUEVETzpcbiAgICAgIGlmIChzdGF0ZS5sYXN0KSB7XG4gICAgICAgIC8vLS0tIEJZVEVCSVRTKCkgLS0tLy9cbiAgICAgICAgaG9sZCA+Pj49IGJpdHMgJiA3O1xuICAgICAgICBiaXRzIC09IGJpdHMgJiA3O1xuICAgICAgICAvLy0tLS8vXG4gICAgICAgIHN0YXRlLm1vZGUgPSBDSEVDSztcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICAvLz09PSBORUVEQklUUygzKTsgKi9cbiAgICAgIHdoaWxlIChiaXRzIDwgMykge1xuICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgaGF2ZS0tO1xuICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgYml0cyArPSA4O1xuICAgICAgfVxuICAgICAgLy89PT0vL1xuICAgICAgc3RhdGUubGFzdCA9IChob2xkICYgMHgwMSkvKkJJVFMoMSkqLztcbiAgICAgIC8vLS0tIERST1BCSVRTKDEpIC0tLS8vXG4gICAgICBob2xkID4+Pj0gMTtcbiAgICAgIGJpdHMgLT0gMTtcbiAgICAgIC8vLS0tLy9cblxuICAgICAgc3dpdGNoICgoaG9sZCAmIDB4MDMpLypCSVRTKDIpKi8pIHtcbiAgICAgIGNhc2UgMDogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHN0b3JlZCBibG9jayAqL1xuICAgICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgICBzdG9yZWQgYmxvY2slc1xcblwiLFxuICAgICAgICAvLyAgICAgICAgc3RhdGUubGFzdCA/IFwiIChsYXN0KVwiIDogXCJcIikpO1xuICAgICAgICBzdGF0ZS5tb2RlID0gU1RPUkVEO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgMTogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGZpeGVkIGJsb2NrICovXG4gICAgICAgIGZpeGVkdGFibGVzKHN0YXRlKTtcbiAgICAgICAgLy9UcmFjZXYoKHN0ZGVyciwgXCJpbmZsYXRlOiAgICAgZml4ZWQgY29kZXMgYmxvY2slc1xcblwiLFxuICAgICAgICAvLyAgICAgICAgc3RhdGUubGFzdCA/IFwiIChsYXN0KVwiIDogXCJcIikpO1xuICAgICAgICBzdGF0ZS5tb2RlID0gTEVOXzsgICAgICAgICAgICAgLyogZGVjb2RlIGNvZGVzICovXG4gICAgICAgIGlmIChmbHVzaCA9PT0gWl9UUkVFUykge1xuICAgICAgICAgIC8vLS0tIERST1BCSVRTKDIpIC0tLS8vXG4gICAgICAgICAgaG9sZCA+Pj49IDI7XG4gICAgICAgICAgYml0cyAtPSAyO1xuICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICBicmVhayBpbmZfbGVhdmU7XG4gICAgICAgIH1cbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIDI6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBkeW5hbWljIGJsb2NrICovXG4gICAgICAgIC8vVHJhY2V2KChzdGRlcnIsIFwiaW5mbGF0ZTogICAgIGR5bmFtaWMgY29kZXMgYmxvY2slc1xcblwiLFxuICAgICAgICAvLyAgICAgICAgc3RhdGUubGFzdCA/IFwiIChsYXN0KVwiIDogXCJcIikpO1xuICAgICAgICBzdGF0ZS5tb2RlID0gVEFCTEU7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAzOlxuICAgICAgICBzdHJ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LS0tIFBVTExCWVRFKCkgLS0tLy9cbiAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgaG9sZCArPSBpbnB1dFtuZXh0KytdIDw8IGJpdHM7XG4gICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgfVxuICAgICAgICBpZiAoaGVyZV92YWwgPCAxNikge1xuICAgICAgICAgIC8vLS0tIERST1BCSVRTKGhlcmUuYml0cykgLS0tLy9cbiAgICAgICAgICBob2xkID4+Pj0gaGVyZV9iaXRzO1xuICAgICAgICAgIGJpdHMgLT0gaGVyZV9iaXRzO1xuICAgICAgICAgIC8vLS0tLy9cbiAgICAgICAgICBzdGF0ZS5sZW5zW3N0YXRlLmhhdmUrK10gPSBoZXJlX3ZhbDtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICBpZiAoaGVyZV92YWwgPT09IDE2KSB7XG4gICAgICAgICAgICAvLz09PSBORUVEQklUUyhoZXJlLmJpdHMgKyAyKTtcbiAgICAgICAgICAgIG4gPSBoZXJlX2JpdHMgKyAyO1xuICAgICAgICAgICAgd2hpbGUgKGJpdHMgPCBuKSB7XG4gICAgICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLz09PS8vXG4gICAgICAgICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gaGVyZV9iaXRzO1xuICAgICAgICAgICAgYml0cyAtPSBoZXJlX2JpdHM7XG4gICAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgICBpZiAoc3RhdGUuaGF2ZSA9PT0gMCkge1xuICAgICAgICAgICAgICBzdHJtLm1zZyA9ICdpbnZhbGlkIGJpdCBsZW5ndGggcmVwZWF0JztcbiAgICAgICAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZW4gPSBzdGF0ZS5sZW5zW3N0YXRlLmhhdmUgLSAxXTtcbiAgICAgICAgICAgIGNvcHkgPSAzICsgKGhvbGQgJiAweDAzKTsvL0JJVFMoMik7XG4gICAgICAgICAgICAvLy0tLSBEUk9QQklUUygyKSAtLS0vL1xuICAgICAgICAgICAgaG9sZCA+Pj49IDI7XG4gICAgICAgICAgICBiaXRzIC09IDI7XG4gICAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgfVxuICAgICAgICAgIGVsc2UgaWYgKGhlcmVfdmFsID09PSAxNykge1xuICAgICAgICAgICAgLy89PT0gTkVFREJJVFMoaGVyZS5iaXRzICsgMyk7XG4gICAgICAgICAgICBuID0gaGVyZV9iaXRzICsgMztcbiAgICAgICAgICAgIHdoaWxlIChiaXRzIDwgbikge1xuICAgICAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICAgICAgaGF2ZS0tO1xuICAgICAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy89PT0vL1xuICAgICAgICAgICAgLy8tLS0gRFJPUEJJVFMoaGVyZS5iaXRzKSAtLS0vL1xuICAgICAgICAgICAgaG9sZCA+Pj49IGhlcmVfYml0cztcbiAgICAgICAgICAgIGJpdHMgLT0gaGVyZV9iaXRzO1xuICAgICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgICAgbGVuID0gMDtcbiAgICAgICAgICAgIGNvcHkgPSAzICsgKGhvbGQgJiAweDA3KTsvL0JJVFMoMyk7XG4gICAgICAgICAgICAvLy0tLSBEUk9QQklUUygzKSAtLS0vL1xuICAgICAgICAgICAgaG9sZCA+Pj49IDM7XG4gICAgICAgICAgICBiaXRzIC09IDM7XG4gICAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgfVxuICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgLy89PT0gTkVFREJJVFMoaGVyZS5iaXRzICsgNyk7XG4gICAgICAgICAgICBuID0gaGVyZV9iaXRzICsgNztcbiAgICAgICAgICAgIHdoaWxlIChiaXRzIDwgbikge1xuICAgICAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICAgICAgaGF2ZS0tO1xuICAgICAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy89PT0vL1xuICAgICAgICAgICAgLy8tLS0gRFJPUEJJVFMoaGVyZS5iaXRzKSAtLS0vL1xuICAgICAgICAgICAgaG9sZCA+Pj49IGhlcmVfYml0cztcbiAgICAgICAgICAgIGJpdHMgLT0gaGVyZV9iaXRzO1xuICAgICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgICAgbGVuID0gMDtcbiAgICAgICAgICAgIGNvcHkgPSAxMSArIChob2xkICYgMHg3Zik7Ly9CSVRTKDcpO1xuICAgICAgICAgICAgLy8tLS0gRFJPUEJJVFMoNykgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSA3O1xuICAgICAgICAgICAgYml0cyAtPSA3O1xuICAgICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoc3RhdGUuaGF2ZSArIGNvcHkgPiBzdGF0ZS5ubGVuICsgc3RhdGUubmRpc3QpIHtcbiAgICAgICAgICA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ID0gaGVyZSAmIDB4ZmZmZjtcblxuICAgICAgICBpZiAoKGhlcmVfYml0cykgPD0gYml0cykgeyBicmVhazsgfVxuICAgICAgICAvLy0tLSBQVUxMQllURSgpIC0tLS8vXG4gICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICBoYXZlLS07XG4gICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgIC8vLS0tLy9cbiAgICAgIH1cbiAgICAgIGlmICgoaGVyZV9vcCAmIDB4ZjApID09PSAwKSB7XG4gICAgICAgIGxhc3RfYml0cyA9IGhlcmVfYml0cztcbiAgICAgICAgbGFzdF9vcCA9IGhlcmVfb3A7XG4gICAgICAgIGxhc3RfdmFsID0gaGVyZV92YWw7XG4gICAgICAgIGZvciAoOzspIHtcbiAgICAgICAgICBoZXJlID0gc3RhdGUuZGlzdGNvZGVbbGFzdF92YWwgK1xuICAgICAgICAgICAgICAgICAgKChob2xkICYgKCgxIDw8IChsYXN0X2JpdHMgKyBsYXN0X29wKSkgLTEpKS8qQklUUyhsYXN0LmJpdHMgKyBsYXN0Lm9wKSovID4+IGxhc3RfYml0cyldO1xuICAgICAgICAgIGhlcmVfYml0cyA9IGhlcmUgPj4+IDI0O1xuICAgICAgICAgIGhlcmVfb3AgPSAoaGVyZSA+Pj4gMTYpICYgMHhmZjtcbiAgICAgICAgICBoZXJlX3ZhbCA9IGhlcmUgJiAweGZmZmY7XG5cbiAgICAgICAgICBpZiAoKGxhc3RfYml0cyArIGhlcmVfYml0cykgPD0gYml0cykgeyBicmVhazsgfVxuICAgICAgICAgIC8vLS0tIFBVTExCWVRFKCkgLS0tLy9cbiAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgaG9sZCArPSBpbnB1dFtuZ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gICAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICAvLz09PSBJTklUQklUUygpO1xuICAgICAgICBob2xkID0gMDtcbiAgICAgICAgYml0cyA9IDA7XG4gICAgICAgIC8vPT09Ly9cbiAgICAgICAgLy9UcmFjZXYoKHN0ZGVyciwgXCJpbmZsYXRlOiAgIGNoZWNrIG1hdGNoZXMgdHJhaWxlclxcblwiKSk7XG4gICAgICB9XG4gICAgICBzdGF0ZS5tb2RlID0gTEVOR1RIO1xuICAgICAgLyogZmFsbHMgdGhyb3VnaCAqL1xuICAgIGNhc2UgTEVOR1RIOlxuICAgICAgaWYgKHN0YXRlLndyYXAgJiYgc3RhdGUuZmxhZ3MpIHtcbiAgICAgICAgLy89PT0gTkVFREJJVFMoMzIpO1xuICAgICAgICB3aGlsZSAoYml0cyA8IDMyKSB7XG4gICAgICAgICAgaWYgKGhhdmUgPT09IDApIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICAgICAgaGF2ZS0tO1xuICAgICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgfVxuICAgICAgICAvLz09PS8vXG4gICAgICAgIGlmIChob2xkICE9PSAoc3RhdGUudG90YWwgJiAweGZmZmZmZmZmKSkge1xuICAgICAgICAgIHN0cm0ubXNnID0gJ2luY29ycmVjdCBsZW5ndGggY2hlY2snO1xuICAgICAgICAgIHN0YXRlLm1vZGUgPSBCQUQ7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgLy89PT0gSU5JVEJJVFMoKTtcbiAgICAgICAgaG9sZCA9IDA7XG4gICAgICAgIGJpdHMgPSAwO1xuICAgICAgICAvLz09PS8vXG4gICAgICAgIC8vVHJhY2V2KChzdGRlcnIsIFwiaW5mbGF0ZTogICBsZW5ndGggbWF0Y2hlcyB0cmFpbGV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AgIGV4dHJhX2luZGV4IC09IDI1NztcbiAgICBlbmQgPSAyNTY7XG5cbiAgfSBlbHNlIHsgICAgICAgICAgICAgICAgICAgIC8qIERJU1RTICovXG4gICAgYmFzZSA9IGRiYXNlO1xuICAgIGV4dHJhID0gZGV4dDtcbiAgICBlbmQgPSAtMTtcbiAgfVxuXG4gIC8qIGluaXRpYWxpemUgb3B0cyBmb3IgbG9vcCAqL1xuICBodWZmID0gMDsgICAgICAgICAgICAgICAgICAgLyogc3RhcnRpbmcgY29kZSAqL1xuICBzeW0gPSAwOyAgICAgICAgICAgICAgICAgICAgLyogc3RhcnRpbmcgY29kZSBzeW1ib2wgKi9cbiAgbGVuID0gbWluOyAgICAgICAgICAgICAgICAgIC8qIHN0YXJ0aW5nIGNvZGUgbGVuZ3RoICovXG4gIG5leHQgPSB0YWJsZV9pbmRleDsgICAgICAgICAgICAgIC8qIGN1cnJlbnQgdGFibGUgdG8gZmlsbCBpbiAqL1xuICBjdXJyID0gcm9vdDsgICAgICAgICAgICAgICAgLyogY3VycmVudCB0YWJsZSBpbmRleCBiaXRzICovXG4gIGRyb3AgPSAwOyAgICAgICAgICAgICAgICAgICAvKiBjdXJyZW50IGJpdHMgdG8gZHJvcCBmcm9tIGNvZGUgZm9yIGluZGV4ICovXG4gIGxvdyA9IC0xOyAgICAgICAgICAgICAgICAgICAvKiB0cmlnZ2VyIG5ldyBzdWItdGFibGUgd2hlbiBsZW4gPiByb290ICovXG4gIHVzZWQgPSAxIDw8IHJvb3Q7ICAgICAgICAgIC8qIHVzZSByb290IHRhYmxlIGVudHJpZXMgKi9cbiAgbWFzayA9IHVzZWQgLSAxOyAgICAgICAgICAgIC8qIG1hc2sgZm9yIGNvbXBhcmluZyBsb3cgKi9cblxuICAvKiBjaGVjayBhdmFpbGFibGUgdGFibGUgc3BhY2UgKi9cbiAgaWYgKCh0eXBlID09PSBMRU5TICYmIHVzZWQgPiBFTk9VR0hfTEVOUykgfHxcbiAgICAodHlwZSA9PT0gR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RvIGdldCB0aGlzIGZhciBpcyBvbmUgYml0KSAqL1xuICBpZiAoaHVmZiAhPT0gMCkge1xuICAgIC8vdGFibGUub3BbbmV4dCArIGh1ZmZdID0gNjQ7ICAgICAgICAgICAgLyogaW52YWxpZCBjb2RlIG1hcmtlciAqL1xuICAgIC8vdGFibGUuYml0c1tuZXh0ICsgaHVmZl0gPSBsZW4gLSBkcm9wO1xuICAgIC8vdGFibGUudmFsW25leHQgKyBodWZmXSA9IDA7XG4gICAgdGFibGVbbmV4dCArIGh1ZmZdID0gKChsZW4gLSBkcm9wKSA8PCAyNCkgfCAoNjQgPDwgMTYpIHwwO1xuICB9XG5cbiAgLyogc2V0IHJldHVybiBwYXJhbWV0ZXJzICovXG4gIC8vb3B0cy50YWJsZV9pbmRleCArPSB1c2VkO1xuICBvcHRzLmJpdHMgPSByb290O1xuICByZXR1cm4gMDtcbn07XG4iLCIndXNlIHN0cmljdCc7XG5cbm1vZHVsZS5leHBvcnRzID0ge1xuICAnMic6ICAgICduZWVkIGRpY3Rpb25hcnknLCAgICAgLyogWl9ORUVEX0RJQ1QgICAgICAgMiAgKi9cbiAgJzEnOiAgICAnc3RyZWFtIGVuZCcsICAgICAgICAgIC8qIFpfU1RSRUFNX0VORCAgICAgIDEgICovXG4gICcwJzogICAgJycsICAgICAgICAgICAgICAgICAgICAvKiBaX09LICAgICAgICAgICAgICAwICAqL1xuICAnLTEnOiAgICdmaWxlIGVycm9yJywgICAgICAgICAgLyogWl9FUlJOTyAgICAgICAgICgtMSkgKi9cbiAgJy0yJzogICAnc3RyZWFtIGVycm9yJywgICAgICAgIC8qIFpfU1RSRUFNX0VSUk9SICAoLTIpICovXG4gICctMyc6ICAgJ2RhdGEgZXJyb3InLCAgICAgICAgICAvKiBaX0RBVEFfRVJST1IgICAgKC0zKSAqL1xuICAnLTQnOiAgICdpbnN1ZmZpY2llbnQgbWVtb3J5JywgLyogWl9NRU1fRVJST1IgICAgICgtNCkgKi9cbiAgJy01JzogICAnYnVmZmVyIGVycm9yJywgICAgICAgIC8qIFpfQlVGX0VSUk9SICAgICAoLTUpICovXG4gICctNic6ICAgJ2luY29tcGF0aWJsZSB2ZXJzaW9uJyAvKiBaX1ZFUlNJT05fRVJST1IgKC02KSAqL1xufTtcbiIsIid1c2Ugc3RyaWN0JztcblxuXG52YXIgdXRpbHMgPSByZXF1aXJlKCcuLi91dGlscy9jb21tb24nKTtcblxuLyogUHVibGljIGNvbnN0YW50cyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG5cblxuLy92YXIgWl9GSUxURVJFRCAgICAgICAgICA9IDE7XG4vL3ZhciBaX0hVRkZNQU5fT05MWSAgICAgID0gMjtcbi8vdmFyIFpfUkxFICAgICAgICAgICAgICAgPSAzO1xudmFyIFpfRklYRUQgICAgICAgICAgICAgICA9IDQ7XG4vL3ZhciBaX0RFRkFVTFRfU1RSQVRFR1kgID0gMDtcblxuLyogUG9zc2libGUgdmFsdWVzIG9mIHRoZSBkYXRhX3R5cGUgZmllbGQgKHRob3VnaCBzZWUgaW5mbGF0ZSgpKSAqL1xudmFyIFpfQklOQVJZICAgICAgICAgICAgICA9IDA7XG52YXIgWl9URVhUICAgICAgICAgICAgICAgID0gMTtcbi8vdmFyIFpfQVNDSUkgICAgICAgICAgICAgPSAxOyAvLyA9IFpfVEVYVFxudmFyIFpfVU5LTk9XTiAgICAgICAgICAgICA9IDI7XG5cbi8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG5cblxuZnVuY3Rpb24gemVybyhidWYpIHsgdmFyIGxlbiA9IGJ1Zi5sZW5ndGg7IHdoaWxlICgtLWxlbiA+PSAwKSB7IGJ1ZltsZW5dID0gMD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PSBtYXhfY29kZTsgbisrKSB7XG4gICAgY3VybGVuID0gbmV4dGxlbjtcbiAgICBuZXh0bGVuID0gdHJlZVsobisxKSoyICsgMV0vKi5MZW4qLztcblxuICAgIGlmICgrK2NvdW50IDwgbWF4X2NvdW50ICYmIGN1cmxlbiA9PT0gbmV4dGxlbikge1xuICAgICAgY29udGludWU7XG5cbiAgICB9IGVsc2UgaWYgKGNvdW50IDwgbWluX2NvdW50KSB7XG4gICAgICBzLmJsX3RyZWVbY3VybGVuICogMl0vKi5GcmVxKi8gKz0gY291bnQ7XG5cbiAgICB9IGVsc2UgaWYgKGN1cmxlbiAhPT0gMCkge1xuXG4gICAgICBpZiAoY3VybGVuICE9PSBwcmV2bGVuKSB7IHMuYmxfdHJlZVtjdXJsZW4gKiAyXS8qLkZyZXEqLysrOyB9XG4gICAgICBzLmJsX3RyZWVbUkVQXzNfNioyXS8qLkZyZXEqLysrO1xuXG4gICAgfSBlbHNlIGlmIChjb3VudCA8PSAxMCkge1xuICAgICAgcy5ibF90cmVlW1JFUFpfM18xMCoyXS8qLkZyZXEqLysrO1xuXG4gICAgfSBlbHNlIHtcbiAgICAgIHMuYmxfdHJlZVtSRVBaXzExXzEzOCoyXS8qLkZyZXEqLysrO1xuICAgIH1cblxuICAgIGNvdW50ID0gMDtcbiAgICBwcmV2bGVuID0gY3VybGVuO1xuXG4gICAgaWYgKG5leHRsZW4gPT09IDApIHtcbiAgICAgIG1heF9jb3VudCA9IDEzODtcbiAgICAgIG1pbl9jb3VudCA9IDM7XG5cbiAgICB9IGVsc2UgaWYgKGN1cmxlbiA9PT0gbmV4dGxlbikge1xuICAgICAgbWF4X2NvdW50ID0gNjtcbiAgICAgIG1pbl9jb3VudCA9IDM7XG5cbiAgICB9IGVsc2Uge1xuICAgICAgbWF4X2NvdW50ID0gNztcbiAgICAgIG1pbl9jb3VudCA9IDQ7XG4gICAgfVxuICB9XG59XG5cblxuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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0gMCkge1xuICAgIG1heF9jb3VudCA9IDEzODtcbiAgICBtaW5fY291bnQgPSAzO1xuICB9XG5cbiAgZm9yIChuID0gMDsgbiA8PSBtYXhfY29kZTsgbisrKSB7XG4gICAgY3VybGVuID0gbmV4dGxlbjtcbiAgICBuZXh0bGVuID0gdHJlZVsobisxKSoyICsgMV0vKi5MZW4qLztcblxuICAgIGlmICgrK2NvdW50IDwgbWF4X2NvdW50ICYmIGN1cmxlbiA9PT0gbmV4dGxlbikge1xuICAgICAgY29udGludWU7XG5cbiAgICB9IGVsc2UgaWYgKGNvdW50IDwgbWluX2NvdW50KSB7XG4gICAgICBkbyB7IHNlbmRfY29kZShzLCBjdXJsZW4sIHMuYmxfdHJlZSk7IH0gd2hpbGUgKC0tY291bnQgIT09IDApO1xuXG4gICAgfSBlbHNlIGlmIChjdXJsZW4gIT09IDApIHtcbiAgICAgIGlmIChjdXJsZW4gIT09IHByZXZsZW4pIHtcbiAgICAgICAgc2VuZF9jb2RlKHMsIGN1cmxlbiwgcy5ibF90cmVlKTtcbiAgICAgICAgY291bnQtLTtcbiAgICAgIH1cbiAgICAgIC8vQXNzZXJ0KGNvdW50ID49IDMgJiYgY291bnQgPD0gNiwgXCIgM182P1wiKTtcbiAgICAgIHNlbmRfY29kZShzLCBSRVBfM182LCBzLmJsX3RyZWUpO1xuICAgICAgc2VuZF9iaXRzKHMsIGNvdW50LTMsIDIpO1xuXG4gICAgfSBlbHNlIGlmIChjb3VudCA8PSAxMCkge1xuICAgICAgc2VuZF9jb2RlKHMsIFJFUFpfM18xMCwgcy5ibF90cmVlKTtcbiAgICAgIHNlbmRfYml0cyhzLCBjb3VudC0zLCAzKTtcblxuICAgIH0gZWxzZSB7XG4gICAgICBzZW5kX2NvZGUocywgUkVQWl8xMV8xMzgsIHMuYmxfdHJlZSk7XG4gICAgICBzZW5kX2JpdHMocywgY291bnQtMTEsIDcpO1xuICAgIH1cblxuICAgIGNvdW50ID0gMDtcbiAgICBwcmV2bGVuID0g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ZywgY2IpO1xufTtcblxuWmxpYi5wcm90b3R5cGUuX3Byb2Nlc3NDaHVuayA9IGZ1bmN0aW9uKGNodW5rLCBmbHVzaEZsYWcsIGNiKSB7XG4gIHZhciBhdmFpbEluQmVmb3JlID0gY2h1bmsgJiYgY2h1bmsubGVuZ3RoO1xuICB2YXIgYXZhaWxPdXRCZWZvcmUgPSB0aGlzLl9jaHVua1NpemUgLSB0aGlzLl9vZmZzZXQ7XG4gIHZhciBpbk9mZiA9IDA7XG5cbiAgdmFyIHNlbGYgPSB0aGlzO1xuXG4gIHZhciBhc3luYyA9IHR5cGVvZiBjYiA9PT0gJ2Z1bmN0aW9uJztcblxuICBpZiAoIWFzeW5jKSB7XG4gICAgdmFyIGJ1ZmZlcnMgPSBbXTtcbiAgICB2YXIgbnJlYWQgPSAwO1xuXG4gICAgdmFyIGVycm9yO1xuICAgIHRoaXMub24oJ2Vycm9yJywgZnVuY3Rpb24oZXIpIHtcbiAgICAgIGVycm9yID0gZXI7XG4gICAgfSk7XG5cbiAgICBkbyB7XG4gICAgICB2YXIgcmVzID0gdGhpcy5fYmluZGluZy53cml0ZVN5bmMoZmx1c2hGbGFnLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNodW5rLCAvLyBpblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluT2ZmLCAvLyBpbl9vZmZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdmFpbEluQmVmb3JlLCAvLyBpbl9sZW5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9idWZmZXIsIC8vIG91dFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX29mZnNldCwgLy9vdXRfb2ZmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXZhaWxPdXRCZWZvcmUpOyAvLyBvdXRfbGVuXG4gICAgfS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xuICAgICAgaW5PZmYgKz0gKGF2YWlsSW5CZWZvcmUgLSBhdmFpbEluQWZ0ZXIpO1xuICAgICAgYXZhaWxJbkJlZm9yZSA9IGF2YWlsSW5BZnRlcjtcblxuICAgICAgaWYgKCFhc3luYylcbiAgICAgICAgcmV0dXJuIHRydWU7XG5cbiAgICAgIHZhciBuZXdSZXEgPSBzZWxmLl9iaW5kaW5nLndyaXRlKGZsdXNoRmxhZyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNodW5rLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5PZmYsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdmFpbEluQmVmb3JlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5fYnVmZmVyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5fb2Zmc2V0LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5fY2h1bmtTaXplKTtcbiAgICAgIG5ld1JlcS5jYWxsYmFjayA9IGNhbGxiYWNrOyAvLyB0aGlzIHNhbWUgZnVuY3Rpb25cbiAgICAgIG5ld1JlcS5idWZmZXIgPSBjaHVuaztcbiAgICAgIHJldHVybjtcbiAgICB9XG5cbiAgICBpZiAoIWFzeW5jKVxuICAgICAgcmV0dXJuIGZhbHNlO1xuXG4gICAgLy8gZmluaXNoZWQgd2l0aCB0aGUgY2h1bmsuXG4gICAgY2IoKTtcbiAgfVxufTtcblxudXRpbC5pbmhlcml0cyhEZWZsYXRlLCBabGliKTtcbnV0aWwuaW5oZXJpdHMoSW5mbGF0ZSwgWmxpYik7XG51dGlsLmluaGVyaXRzKEd6aXAsIFpsaWIpO1xudXRpbC5pbmhlcml0cyhHdW56aXAsIFpsaWIpO1xudXRpbC5pbmhlcml0cyhEZWZsYXRlUmF3LCBabGliKTtcbnV0a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ZhciBwcm9wZXJ0eU5hbWUgaW4gbWV0YUhlYWRlckRhdGFTZXQuZWxlbWVudHMpXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgaWYobWV0YUhlYWRlckRhdGFTZXQuZWxlbWVudHMuaGFzT3duUHJvcGVydHkocHJvcGVydHlOYW1lKSlcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIGluc3RhbmNlRGF0YVNldC5lbGVtZW50c1twcm9wZXJ0eU5hbWVdID0gbWV0YUhlYWRlckRhdGFTZXQuZWxlbWVudHNbcHJvcGVydHlOYW1lXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobWV0YUhlYWRlckRhdGFTZXQud2FybmluZ3MgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIGluc3RhbmNlRGF0YVNldC53YXJuaW5ncyA9IG1ldGFIZWFkZXJEYXRhU2V0Lndhcm5pbmdzLmNvbmNhdChpbnN0YW5jZURhdGFTZXQud2FybmluZ3MpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGluc3RhbmNlRGF0YVNldDtcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHJlYWREYXRhU2V0KG1ldGFIZWFkZXJEYXRhU2V0KVxuICAgICAgICB7XG4gICAgICAgICAgICB2YXIgdHJhbnNmZXJTeW50YXggPSByZWFkVHJhbnNmZXJTeW50YXgobWV0YUhlYWRlckRhdGFTZXQpO1xuICAgICAgICAgICAgdmFyIGV4cGxpY2l0ID0gaXNFeHBsaWNpdCh0cmFuc2ZlclN5bnRheCk7XG4gICAgICAgICAgICB2YXIgZGF0YVNldEJ5dGVTdHJlYW0gPSBnZXREYXRhU2V0Qnl0ZVN0cmVhbSh0cmFuc2ZlclN5bnRheCwgbWV0YUhlYWRlckRhdGFTZXQucG9zaXRpb24pO1xuXG4gICAgICAgICAgICB2YXIgZWxlbWVudHMgPSB7fTtcbiAgICAgICAgICAgIHZhciBkYXRhU2V0ID0gbmV3IGRpY29tUGFyc2VyLkRhdGFTZXQoZGF0YVNldEJ5dGVTdHJlYW0uYnl0ZUFycmF5UGFyc2VyLCBkYXRhU2V0Qnl0ZVN0cmVhbS5ieXRlQXJyYXksIGVsZW1lbnRzKTtcbiAgICAgICAgICAgIGRhdGFTZXQud2FybmluZ3MgPSBkYXRhU2V0Qnl0ZVN0cmVhbS53YXJuaW5ncztcblxuICAgICAgICAgICAgdHJ5e1xuICAgICAgICAgICAgICAgIGlmKGV4cGxpY2l0KSB7XG4gICAgICAgICAgICAgICAgICAgIGRpY29tUGFyc2VyLnBhcnNlRGljb21EYXRhU2V0RXhwbGljaXQoZGF0YVNldCwgZGF0YVNldEJ5dGVTdHJlYW0sIGRhdGFTZXRCeXRlU3RyZWFtLmJ5dGVBcnJheS5sZW5ndGgsIG9wdGlvbnMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBkaWNvbVBhcnNlci5wYXJzZURpY29tRGF0YVNldEltcGxpY2l0KGRhdGFTZXQsIGRhdGFTZXRCeXRlU3RyZWFtLCBkYXRhU2V0Qnl0ZVN0cmVhbS5ieXRlQXJyYXkubGVuZ3RoLCBvcHRpb25zKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXRjaChlKSB7XG4gICAgICAgICAgICAgICAgdmFyIGV4ID0ge1xuICAgICAgICAgICAgICAgICAgICBleGNlcHRpb246IGUsXG4gICAgICAgICAgICAgICAgICAgIGRhdGFTZXQ6IGRhdGFTZXRcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIHRocm93IGV4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGRhdGFTZXQ7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBtYWluIGZ1bmN0aW9u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uICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZihlbGVtZW50Lml0ZW1zKSB7XG4gICAgICAgICAgICAgICAgLy8gaGFuZGxlIHNlcXVlbmNlc1xuICAgICAgICAgICAgICAgIHZhciBzZXF1ZW5jZUl0ZW1zID0gW107XG4gICAgICAgICAgICAgICAgZm9yKHZhciBpPTA7IGkgPCBlbGVtZW50Lml0ZW1zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIHNlcXVlbmNlSXRlbXMucHVzaChkaWNvbVBhcnNlci5leHBsaWNpdERhdGFTZXRUb0pTKGVsZW1lbnQuaXRlbXNbaV0uZGF0YVNldCwgb3B0aW9ucykpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXN1bHRbdGFnXSA9IHNlcXVlbmNlSXRlbXM7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHZhciBhc1N0cmluZztcbiAgICAgICAgICAgICAgICBhc1N0cmluZyA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICBpZihlbGVtZW50Lmxlbmd0aCA8IG9wdGlvbnMubWF4RWxlbWVudExlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBhc1N0cmluZyA9IGRpY29tUGFyc2VyLmV4cGxpY2l0RWxlbWVudFRvU3RyaW5nKGRhdGFTZXQsIGVsZW1lbnQpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmKGFzU3RyaW5nICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0W3RhZ10gPSBhc1N0cmluZztcbiAgICAgICAgICAgICAgICB9ICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0W3RhZ10gPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhT2Zmc2V0OiBlbGVtZW50LmRhdGFPZmZzZXQsXG4gICAgICAgICAgICAgICAgICAgICAgICBsZW5ndGggOiBlbGVtZW50Lmxlbmd0aFxuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfTtcblxuXG4gICAgcmV0dXJuIGRpY29tUGFyc2VyO1xufShkaWNvbVBhcnNlcikpO1xudmFyIGRpY29tUGFyc2VyID0gKGZ1bmN0aW9uIChkaWNvbVBhcnNlcikge1xuICAgIFwidXNlIHN0cmljdFwiO1xuXG4gICAgaWYgKGRpY29tUGFyc2VyID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgZGljb21QYXJzZXIgPSB7fTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBDb252ZXJ0cyBhbiBleHBsaWNpdCBWUiBlbGVtZW50IHRvIGEgc3RyaW5nIG9yIHVuZGVmaW5lZCBpZiBpdCBpcyBub3QgcG9zc2libGUgdG8gY29udmVydC5cbiAgICAgKiBUaHJvd3MgYW4gZXJyb3IgaWYgYW4gaW1wbGljaXQgZWxlbWVudCBpcyBzdXBwbGllZFxuICAgICAqIEBwYXJhbSBkYXRhU2V0XG4gICAgICogQHBhcmFtIGVsZW1lbnRcbiAgICAgKiBAcmV0dXJucyB7Kn1cbiAgICAgKi9cbiAgICBkaWNvbVBhcnNlci5leHBsaWNpdEVsZW1lbnRUb1N0cmluZyA9IGZ1bmN0aW9uKGRhdGFTZXQsIGVsZW1lbnQpXG4gICAge1xuICAgICAgICBpZihkYXRhU2V0ID09PSB1bmRlZmluZWQgfHwgZWxlbWVudCA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICB0aHJvdyAnZGljb21QYXJzZXIuZXhwbGljaXRFbGVtZW50VG9TdHJpbmc6IG1pc3NpbmcgcmVxdWlyZWQgcGFyYW1ldGVycyc7XG4gICAgICAgIH1cbiAgICAgICAgaWYoZWxlbWVudC52ciA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICB0aHJvdyAnZGljb21QYXJzZXIuZXhwbGljaXRFbGVtZW50VG9TdHJpbmc6IGNhbm5vdCBjb252ZXJ0IGltcGxpY2l0IGVsZW1lbnQgdG8gc3RyaW5nJztcbiAgICAgICAgfVxuICAgICAgICB2YXIgdnIgPSBlbGVtZW50LnZyO1xuICAgICAgICB2YXIgdGFnID0gZWxlbWVudC50YWc7XG5cbiAgICAgICAgdmFyIHRleHRSZXN1bHQ7XG5cbiAgICAgICAgZnVuY3Rpb24gbXVsdGlFbGVtZW50VG9TdHJpbmcobnVtSXRlbXMsIGZ1bmMpIHtcbiAgICAgICAgICAgIHZhciByZXN1bHQgPSBcIlwiO1xuICAgICAgICAgICAgZm9yKHZhciBpPTA7IGkgPCBudW1JdGVtczsgaSsrKSB7XG4gICAgICAgICAgICAgICAgaWYoaSAhPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gJy8nO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXN1bHQgKz0gZnVuYy5jYWxsKGRhdGFTZXQsIHRhZywgaSkudG9TdHJpbmcoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgIH1cblxuICAgICAgICBpZihkaWNvbVBhcnNlci5pc1N0cmluZ1ZyKHZyKSA9PT0gdHJ1ZSlcbiAgICAgICAge1xuICAgICAgICAgICAgdGV4dFJlc3VsdCA9IGRhdGFTZXQuc3RyaW5nKHRhZyk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAodnIgPT0gJ0FUJykge1xuICAgICAgICAgICAgdmFyIG51bSA9IGRhdGFTZXQudWludDMyKHRhZyk7XG4gICAgICAgICAgICBpZihudW0gPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobnVtIDwgMClcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBudW0gPSAweEZGRkZGRkZGICsgbnVtICsgMTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuICd4JyArIG51bS50b1N0cmluZygxNikudG9VcHBlckNhc2UoKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICh2ciA9PSAnVVMnKVxuICAgICAgICB7XG4gICAgICAgICAgICB0ZXh0UmVzdWx0ID0gbXVsdGlFbGVtZW50VG9TdHJpbmcoZWxlbWVudC5sZW5ndGggLyAyLCBkYXRhU2V0LnVpbnQxNik7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZih2ciA9PT0gJ1NTJylcbiAgICAgICAge1xuICAgICAgICAgICAgdGV4dFJlc3VsdCA9IG11bHRpRWxlbWVudFRvU3RyaW5nKGVsZW1lbnQubGVuZ3RoIC8gMiwgZGF0YVNldC5pbnQxNik7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAodnIgPT0gJ1VMJylcbiAgICAgICAge1xuICAgICAgICAgICAgdGV4dFJlc3VsdCA9IG11bHRpRWxlbWVudFRvU3RyaW5nKGVsZW1lbnQubGVuZ3RoIC8gNCwgZGF0YVNldC51aW50MzIpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYodnIgPT09ICdTTCcpXG4gICAgICAgIHtcbiAgICAgICAgICAgIHRleHRSZXN1bHQgPSBtdWx0aUVsZW1lbnRUb1N0cmluZyhlbGVtZW50Lmxlbmd0aCAvIDQsIGRhdGFTZXQuaW50MzIpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYodnIgPT0gJ0ZEJylcbiAgICAgICAge1xuICAgICAgICAgICAgdGV4dFJlc3VsdCA9IG11bHRpRWxlbWVudFRvU3RyaW5nKGVsZW1lbnQubGVuZ3RoIC8gOCwgZGF0YVNldC5kb3VibGUpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYodnIgPT0gJ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MykgfHxcbiAgICAgICAgICAobW0gJiYgKG1tIDwwIHx8IG1tID4gNTkpKSAgfHxcbiAgICAgICAgICAoc3MgJiYgKHNzIDwwIHx8IHNzID4gNTkpKSAgfHxcbiAgICAgICAgICAoZmZmZmZmICYmIChmZmZmZmYgPDAgfHwgZmZmZmZmID4gOTk5OTk5KSkpXG4gICAgICAgIHtcbiAgICAgICAgICB0aHJvdyBcImludmFsaWQgVE0gJ1wiICsgdGltZSArIFwiJ1wiO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIHJldHVybiB7XG4gICAgICAgIGhvdXJzOiBoaCxcbiAgICAgICAgbWludXRlczogbW0sXG4gICAgICAgIHNlY29uZHM6IHNzLFxuICAgICAgICBmcmFjdGlvbmFsU2Vjb25kczogZmZmZmZmXG4gICAgICB9O1xuICAgIH1cblxuICAgIGlmKHZhbGlkYXRlKSB7XG4gICAgICB0aHJvdyBcImludmFsaWQgVE0gJ1wiICsgdGltZSArIFwiJ1wiO1xuICAgIH1cblxuICAgIHJldHVybiB1bmRlZmluZWQ7XG4gIH07XG5cbiAgcmV0dXJuIGRpY29tUGFyc2VyO1xufShkaWNvbVBhcnNlcikpO1xuLyoqXG4gKiBVdGlsaXR5IGZ1bmN0aW9ucyBmb3IgZGVhbGluZyB3aXRoIERJQ09NXG4gKi9cblxudmFyIGRpY29tUGFyc2VyID0gKGZ1bmN0aW9uIChkaWNvbVBhcnNlcilcbntcbiAgICBcInVzZSBzdHJpY3RcIjtcblxuICAgIGlmKGRpY29tUGFyc2VyID09PSB1bmRlZmluZWQpXG4gICAge1xuICAgICAgICBkaWNvbVBhcnNlciA9IHt9O1xuICAgIH1cblxuICAgIHZhciBzdHJpbmdWcnMgPSB7XG4gICAgICAgIEFFOiB0cnVlLFxuICAgICAgICBBUzogdHJ1ZSxcbiAgICAgICAgQVQ6IGZhbHNlLFxuICAgICAgICBDUzogdHJ1ZSxcbiAgICAgICAgREE6IHRydWUsXG4gICAgICAgIERTOiB0cnVlL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1bnNpZ25lZCBpbnQgMzJcbiAgICAgICAgICogQHRocm93cyBlcnJvciBpZiBidWZmZXIgb3ZlcnJlYWQgd291bGQgb2NjdXJcbiAgICAgICAgICogQGFjY2VzcyBwcml2YXRlXG4gICAgICAgICAqL1xuICAgICAgICByZWFkVWludDMyOiBmdW5jdGlvbiAoYnl0ZUFycmF5LCBwb3NpdGlvbikge1xuICAgICAgICAgICAgaWYgKHBvc2l0aW9uIDwgMCkge1xuICAgICAgICAgICAgICAgIHRocm93ICdiaWdFbmRpYW5CeXRlQXJyYXlQYXJzZXIucmVhZFVpbnQzMjogcG9zaXRpb24gY2Fubm90IGJlIGxlc3MgdGhhbiAwJztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHBvc2l0aW9uICsgNCA+IGJ5dGVBcnJheS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyAnYmlnRW5kaWFuQnl0ZUFycmF5UGFyc2VyLnJlYWRVaW50MzI6IGF0dGVtcHQgdG8gcmVhZCBwYXN0IGVuZCBvZiBidWZmZXInO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgdWludDMyID0gKDI1NiAqICgyNTYgKiAoMjU2ICogYnl0ZUFycmF5W3Bvc2l0aW9uXSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZUFycmF5W3Bvc2l0aW9uICsgMV0pICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlQXJyYXlbcG9zaXRpb24gKyAyXSkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVBcnJheVtwb3NpdGlvbiArIDNdKTtcblxuICAgICAgICAgICAgcmV0dXJuIHVpbnQzMjtcbiAgICAgICAgfSxcblxuICAgICAgICAvKipcbiAgICAgICAgICogUGFyc2VzIGEgc2lnbmVkIGludCAzMiBmcm9tIGEgYmlnLW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oKTtcbiAgICAgICAgICAgIGlmKGluZGV4ID49IDApXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgdmFyIHZhbHVlcyA9IGZpeGVkU3RyaW5nLnNwbGl0KCdcXFxcJyk7XG4gICAgICAgICAgICAgICAgLy8gdHJpbSB0cmFpbGluZyBzcGFjZXNcbiAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWVzW2luZGV4XS50cmltKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgLy8gdHJpbSB0cmFpbGluZyBzcGFjZXNcbiAgICAgICAgICAgICAgICByZXR1cm4gZml4ZWRTdHJpbmcudHJpbSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG4gICAgfTtcblxuICAgIC8qKlxuICAgICAqIFJldHVybnMgYSBzdHJpbmcgd2l0aCB0aGUgbGVhZGluZyBzcGFjZXMgcHJlc2VydmVkIGFuZCB0cmFpbGluZyBzcGFjZXMgcmVtb3ZlZC5cbiAgICAgKlxuICAgICAqIFVzZSB0aGlzIGZ1bmN0aW9uIHRvIGFjY2VzcyBkYXRhIGZvciBWUnMgb2YgdHlwZSBVVCwgU1QgYW5kIExUXG4gICAgICpcbiAgICAgKiBAcGFyYW0gdGFnXG4gICAgICogQHBhcmFtIGluZGV4XG4gICAgICogQHJldHVybnMgeyp9XG4gICAgICovXG4gICAgZGljb21QYXJzZXIuRGF0YVNldC5wcm90b3R5cGUudGV4dCA9IGZ1bmN0aW9uKHRhZywgaW5kZXgpXG4gICAge1xuICAgICAgICB2YXIgZWxlbWVudCA9IHRoaXMuZWxlbWVudHNbdGFnXTtcbiAgICAgICAgaWYoZWxlbWVudCAmJiBlbGVtZW50Lmxlbmd0aCA+IDApXG4gICAgICAgIHtcbiAgICAgICAgICAgIHZhciBmaXhlZFN0cmluZyA9IGRpY29tUGFyc2VyLnJlYWRGaX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ICAgIGVsZW1lbnQuYmFzaWNPZmZzZXRUYWJsZS5wdXNoKG9mZnNldCk7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIGJhc2VPZmZzZXQgPSBieXRlU3RyZWFtLnBvc2l0aW9uO1xuXG4gICAgICAgIHdoaWxlKGJ5dGVTdHJlYW0ucG9zaXRpb24gPCBieXRlU3RyZWFtLmJ5dGVBcnJheS5sZW5ndGgpXG4gICAgICAgIHtcbiAgICAgICAgICAgIHZhciB0YWcgPSBkaWNvbVBhcnNlci5yZWFkVGFnKGJ5dGVTdHJlYW0pO1xuICAgICAgICAgICAgdmFyIGxlbmd0aCA9IGJ5dGVTdHJlYW0ucmVhZFVpbnQzMigpO1xuICAgICAgICAgICAgaWYodGFnID09PSAneGZmZmVlMGRkJylcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBieXRlU3RyZWFtLnNlZWsobGVuZ3RoKTtcbiAgICAgICAgICAgICAgICBlbGVtZW50Lmxlbmd0aCA9IGJ5dGVTdHJlYW0ucG9zaXRpb24gLSBlbGVtZW50LmRhdGFPZmZzZXQ7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZih0YWcgPT09ICd4ZmZmZWUwMDAnKVxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIGVsZW1lbnQuZnJhZ21lbnRzLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICBvZmZzZXQ6IGJ5dGVTdHJlYW0ucG9zaXRpb24gLSBiYXNlT2Zmc2V0IC0gOCxcbiAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gOiBieXRlU3RyZWFtLnBvc2l0aW9uLFxuICAgICAgICAgICAgICAgICAgICBsZW5ndGggOiBsZW5ndGhcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmKHdhcm5pbmdzKSB7XG4gICAgICAgICAgICAgICAgICAgIHdhcm5pbmdzLnB1c2goJ3VuZXhwZWN0ZWQgdGFnICcgKyB0YWcgKyAnIHdoaWxlIHNlYXJjaGluZyBmb3IgZW5kIG9mIHBpeGVsIGRhdGEgZWxlbWVudCB3aXRoIHVuZGVmaW5lZCBsZW5ndGgnKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYobGVuZ3RoID4gYnl0ZVN0cmVhbS5ieXRlQXJyYXkubGVuZ3RoIC0gYnl0ZVN0cmVhbS5wb3NpdGlvbilcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGZpeCBsZW5ndGhcbiAgICAgICAgICAgICAgICAgICAgbGVuZ3RoID0gYnl0ZVN0cmVhbS5ieXRlQXJyYXkubGVuZ3RoIC0gYnl0ZVN0cmVhbS5wb3NpdGlvbjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxlbWVudC5mcmFnbWVudHMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgIG9mZnNldDogYnl0ZVN0cmVhbS5wb3NpdGlvbiAtIGJhc2VPZmZzZXQgLSA4LFxuICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA6IGJ5dGVTdHJlYW0ucG9zaXRpb24sXG4gICAgICAgICAgICAgICAgICAgIGxlbmd0aCA6IGxlbmd0aFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIGJ5dGVTdHJlYW0uc2VlayhsZW5ndGgpO1xuICAgICAgICAgICAgICAgIGVsZW1lbnQubGVuZ3RoID0gYnl0ZVN0cmVhbS5wb3NpdGlvbiAtIGVsZW1lbnQuZGF0YU9mZnNldDtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGJ5dGVTdHJlYW0uc2VlayhsZW5ndGgpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYod2FybmluZ3MpIHtcbiAgICAgICAgICA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c2VyID0gKGZ1bmN0aW9uIChkaWNvbVBhcnNlcilcbntcbiAgICBcInVzZSBzdHJpY3RcIjtcblxuICAgIGlmKGRpY29tUGFyc2VyID09PSB1bmRlZmluZWQpXG4gICAge1xuICAgICAgICBkaWNvbVBhcnNlciA9IHt9O1xuICAgIH1cblxuICAgIGRpY29tUGFyc2VyLmxpdHRsZUVuZGlhbkJ5dGVBcnJheVBhcnNlciA9IHtcbiAgICAgICAgLyoqXG4gICAgICAgICAqXG4gICAgICAgICAqIFBhcnNlcyBhbiB1bnNpZ25lZCBpbnQgMTYgZnJvbSBhIGxpdHRsZS1lbmRpYW4gYnl0ZSBhcnJheVxuICAgICAgICAgKlxuICAgICAgICAgKiBAcGFyYW0gYnl0ZUFycmF5IHRoZSBieXRlIGFycmF5IHRvIHJlYWQgZnJvbVxuICAgICAgICAgKiBAcGFyYW0gcG9zaXRpb24gdGhlIHBvc2l0aW9uIGluIHRoZSBieXRlIGFycmF5IHRvIHJlYWQgZnJvbVxuICAgICAgICAgKiBAcmV0dXJucyB7Kn0gdGhlIHBhcnNlZCB1bnNpZ25lZCBpbnQgMTZcbiAgICAgICAgICogQHRocm93cyBlcnJvciBpZiBidWZmZXIgb3ZlcnJlYWQgd291bGQgb2NjdXJcbiAgICAgICAgICogQGFjY2VzcyBwcml2YXRlXG4gICAgICAgICAqL1xuICAgICAgICByZWFkVWludDE2OiBmdW5jdGlvbiAoYnl0ZUFycmF5LCBwb3NpdGlvbikge1xuICAgICAgICAgICAgaWYgKHBvc2l0aW9uIDwgMCkge1xuICAgICAgICAgICAgICAgIHRocm93ICdsaXR0bGVFbmRpYW5CeXRlQXJyYXlQYXJzZXIucmVhZFVpbnQxNjogcG9zaXRpb24gY2Fubm90IGJlIGxlc3MgdGhhbiAwJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChwb3NpdGlvbiArIDIgPiBieXRlQXJyYXkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgJ2xpdHRsZUVuZGlhbkJ5dGVBcnJheVBhcnNlci5yZWFkVWludDE2OiBhdHRlbXB0IHRvIHJlYWQgcGFzdCBlbmQgb2YgYnVmZmVyJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBieXRlQXJyYXlbcG9zaXRpb25dICsgKGJ5dGVBcnJheVtwb3NpdGlvbiArIDFdICogMjU2KTtcbiAgICAgICAgfSxcblxuICAgICAgICAvKipcbiAgICAgICAgICpcbiAgICAgICAgICogUGFyc2VzIGEgc2lnbmVkIGludCAxNiBmcm9tIGEgbGl0dGxlLWVuZGlhbiBieXRlIGFycmF5XG4gICAgICAgICAqXG4gICAgICAgICAqIEBwYXJhbSBieXRlQXJyYXkgdGhlIGJ5dGUgYXJyYXkgdG8gcmVhZCBmcm9tXG4gICAgICAgICAqIEBwYXJhbSBwb3NpdGlvbiB0aGUgcG9zaXRpb24gaW4gdGhlIGJ5dGUgYXJyYXkgdG8gcmVhZCBmcm9tXG4gICAgICAgICAqIEByZXR1cm5zIHsqfSB0aGUgcGFyc2VkIHNpZ25lZCBpbnQgMTZcbiAgICAgICAgICogQHRocm93cyBlcnJvciBpZiBidWZmZXIgb3ZlcnJlYWQgd291bGQgb2NjdXJcbiAgICAgICAgICogQGFjY2VzcyBwcml2YXRlXG4gICAgICAgICAqL1xuICAgICAgICByZWFkSW50MTY6IGZ1bmN0aW9uIChieXRlQXJyYXksIHBvc2l0aW9uKSB7XG4gICAgICAgICAgICBpZiAocG9zaXRpb24gPCAwKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgJ2xpdHRsZUVuZGlhbkJ5dGVBcnJheVBhcnNlci5yZWFkSW50MTY6IHBvc2l0aW9uIGNhbm5vdCBiZSBsZXNzIHRoYW4gMCc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAocG9zaXRpb24gKyAyID4gYnl0ZUFycmF5Lmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIHRocm93ICdsaXR0bGVFbmRpYW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gICAgKi9cbiAgICAgICAgcmVhZEludDMyOiBmdW5jdGlvbiAoYnl0ZUFycmF5LCBwb3NpdGlvbikge1xuICAgICAgICAgICAgaWYgKHBvc2l0aW9uIDwgMCkge1xuICAgICAgICAgICAgICAgIHRocm93ICdsaXR0bGVFbmRpYW5CeXRlQXJyYXlQYXJzZXIucmVhZEludDMyOiBwb3NpdGlvbiBjYW5ub3QgYmUgbGVzcyB0aGFuIDAnO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAocG9zaXRpb24gKyA0ID4gYnl0ZUFycmF5Lmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIHRocm93ICdsaXR0bGVFbmRpYW5CeXRlQXJyYXlQYXJzZXIucmVhZEludDMyOiBhdHRlbXB0IHRvIHJlYWQgcGFzdCBlbmQgb2YgYnVmZmVyJztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFyIGludDMyID0gKGJ5dGVBcnJheVtwb3NpdGlvbl0gK1xuICAgICAgICAgICAgKGJ5dGVBcnJheVtwb3NpdGlvbiArIDFdIDw8IDgpICtcbiAgICAgICAgICAgIChieXRlQXJyYXlbcG9zaXRpb24gKyAyXSA8PCAxNikgK1xuICAgICAgICAgICAgKGJ5dGVBcnJheVtwb3NpdGlvbiArIDNdIDw8IDI0KSk7XG5cbiAgICAgICAgICAgIHJldHVybiBpbnQzMjtcblxuICAgICAgICB9LFxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBQYXJzZXMgMzItYml0IGZsb2F0IGZyb20gYSBsaXR0bGUtZW5kaWFuIGJ5dGUgYXJyYXlcbiAgICAgICAgICpcbiAgICAgICAgICogQHBhcmFtIGJ5dGVBcnJheSB0aGUgYnl0ZSBhcnJheSB0byByZWFkIGZyb21cbiAgICAgICAgICogQHBhcmFtIHBvc2l0aW9uIHRoZSBwb3NpdGlvbiBpbiB0aGUgYnl0ZSBhcnJheSB0byByZWFkIGZyb21cbiAgICAgICAgICogQHJldHVybnMgeyp9IH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pb25zID0gb3B0aW9ucyB8fCB7fTtcblxuICAgICAgICBpZihieXRlU3RyZWFtID09PSB1bmRlZmluZWQpXG4gICAgICAgIHtcbiAgICAgICAgICAgIHRocm93IFwiZGljb21QYXJzZXIucGFyc2VEaWNvbURhdGFTZXRFeHBsaWNpdDogbWlzc2luZyByZXF1aXJlZCBwYXJhbWV0ZXIgJ2J5dGVTdHJlYW0nXCI7XG4gICAgICAgIH1cbiAgICAgICAgaWYobWF4UG9zaXRpb24gPCBieXRlU3RyZWFtLnBvc2l0aW9uIHx8IG1heFBvc2l0aW9uID4gYnl0ZVN0cmVhbS5ieXRlQXJyYXkubGVuZ3RoKVxuICAgICAgICB7XG4gICAgICAgICAgICB0aHJvdyBcImRpY29tUGFyc2VyLnBhcnNlRGljb21EYXRhU2V0RXhwbGljaXQ6IGludmFsaWQgdmFsdWUgZm9yIHBhcmFtZXRlciAnbWF4UG9zaXRpb24nXCI7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIGVsZW1lbnRzID0gZGF0YVNldC5lbGVtZW50cztcblxuICAgICAgICB3aGlsZShieXRlU3RyZWFtLnBvc2l0aW9uIDwgbWF4UG9zaXRpb24pXG4gICAgICAgIHtcbiAgICAgICAgICAgIHZhciBlbGVtZW50ID0gZGljb21QYXJzZXIucmVhZERpY29tRWxlbWVudEV4cGxpY2l0KGJ5dGVTdHJlYW0sIGRhdGFTZXQud2FybmluZ3MsIG9wdGlvbnMudW50aWxUYWcpO1xuICAgICAgICAgICAgZWxlbWVudHNbZWxlbWVudC50YWddID0gZWxlbWVudDtcbiAgICAgICAgICAgIGlmKGVsZW1lbnQudGFnID09PSBvcHRpb25zLnVudGlsVGFnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmKGJ5dGVTdHJlYW0ucG9zaXRpb24gPiBtYXhQb3NpdGlvbikge1xuICAgICAgICAgICAgdGhyb3cgXCJkaWNvbVBhcnNlcj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BhcnNlci5wYXJzZURpY29tRGF0YVNldEltcGxpY2l0OiBpbnZhbGlkIHZhbHVlIGZvciBwYXJhbWV0ZXIgJ21heFBvc2l0aW9uJ1wiO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIGVsZW1lbnRzID0gZGF0YVNldC5lbGVtZW50cztcblxuICAgICAgICB3aGlsZShieXRlU3RyZWFtLnBvc2l0aW9uIDwgbWF4UG9zaXRpb24pXG4gICAgICAgIHtcbiAgICAgICAgICAgIHZhciBlbGVtZW50ID0gZGljb21QYXJzZXIucmVhZERpY29tRWxlbWVudEltcGxpY2l0KGJ5dGVTdHJlYW0sIG9wdGlvbnMudW50aWxUYWcsIG9wdGlvbnMudnJDYWxsYmFjayk7XG4gICAgICAgICAgICBlbGVtZW50c1tlbGVtZW50LnRhZ10gPSBlbGVtZW50O1xuICAgICAgICAgICAgaWYoZWxlbWVudC50YWcgPT09IG9wdGlvbnMudW50aWxUYWcpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgcmV0dXJuIGRpY29tUGFyc2VyO1xufShkaWNvbVBhcnNlcikpO1xuXG4vKipcbiAqIEludGVybmFsIGhlbHBlciBmdW5jdGlvbnMgZm9yIGZvciBwYXJzaW5nIERJQ09NIGVsZW1lbnRzXG4gKi9cblxudmFyIGRpY29tUGFyc2VyID0gKGZ1bmN0aW9uIChkaWNvbVBhcnNlcilcbntcbiAgICBcInVzZSBzdHJpY3RcIjtcblxuICAgIGlmKGRpY29tUGFyc2VyID09PSB1bmRlZmluZWQpXG4gICAge1xuICAgICAgICBkaWNvbVBhcnNlciA9IHt9O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGdldERhdGFMZW5ndGhTaXplSW5CeXRlc0ZvclZSKHZyKVxuICAgIHtcbiAgICAgICAgaWYoIHZyID09PSAnT0InIHx8XG4gICAgICAgICAgICB2ciA9PT0gJ09XJyB8fFxuICAgICAgICAgICAgdnIgPT09ICdTUScgfHxcbiAgICAgICAgICAgIHZyID09PSAnT0YnIHx8XG4gICAgICAgICAgICB2ciA9PT0gJ1VUJyB8fFxuICAgICAgICAgICAgdnIgPT09ICdVTicpXG4gICAgICAgIHtcbiAgICAgICAgICAgIHJldHVybiA0O1xuICAgICAgICB9XG4gICAgICAgIGVsc2VcbiAgICAgICAge1xuICAgICAgICAgICAgcmV0dXJuIDI7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBkaWNvbVBhcnNlci5yZWFkRGljb21FbGVtZW50RXhwbGljaXQgPSBmdW5jdGlvbihieXRlU3RyZWFtLCB3YXJuaW5ncywgdW50aWxUYWcpXG4gICAge1xuICAgICAgICBpZihieXRlU3RyZWFtID09PSB1bmRlZmluZWQpXG4gICAgICAgIHtcbiAgICAgICAgICAgIHRocm93IFwiZGljb21QYXJzZXIucmVhZERpY29tRWxlbWVudEV4cGxpY2l0OiBtaXNzaW5nIHJlcXVpcmVkIHBhcmFtZXRlciAnYnl0ZVN0cmVhbSdcIjtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBlbGVtZW50ID0ge1xuICAgICAgICAgICAgdGFnIDogZGljb21QYXJzZXIucmVhZFRhZyhieXRlU3RyZWFtKSxcbiAgICAgICAgICAgIHZyIDogYnl0ZVN0cmVhbS5yZWFkRml4ZWRTdHJpbmcoMilcbiAgICAgICAgICAgIC8vIGxlbmd0aCBzZXQgYmVsb3cgYmFzZWQgb24gVlJcbiAgICAgICAgICAgIC8vIGRhdGFPZmZzZXQgc2V0IGJlbG93IGJhc2VkIG9uIFZSIGFuZCBzaXplIG9mIGxlbmd0aFxuICAgICAgICB9O1xuXG4gICAgICAgIHZhciBkYXRhTGVuZ3RoU2l6ZUJ5dGVzID0gZ2V0RGF0YUxlbmd0aFNpemVJbkJ5dGVzRm9yVlIoZWxlbWVudC52cik7XG4gICAgICAgIGlmKGRhdGFMZW5ndGhTaXplQnl0ZXMgPT09IDIpXG4gICAgICAgIHtcbiAgICAgICAgICAgIGVsZW1lbnQubGVuZ3RoID0gYnl0ZVN0cmVhbS5yZWFkVWludDE2KCk7XG4gICAgICAgICAgICBlbGVtZW50LmRhdGFPZmZzZXQgPSBieXRlU3RyZWFtLnBvc2l0aW9uO1xuICAgICAgICB9XG4gICAgICAgIGVsc2VcbiAgICAgICAge1xuICAgICAgICAgICAgYnl0ZVN0cmVhbS5zZWVrKDIpO1xuICAgICAgICAgICAgZWxlbWVudC5sZW5ndGggPSBieXRlU3RyZWFtLnJlYWRVaW50MzIoKTtcbiAgICAgICAgICAgIGVsZW1lbnQuZGF0YU9mZnNldCA9IGJ5dGVTdHJlYW0ucG9zaXRpb247XG4gICAgICAgIH1cblxuICAgICAgICBpZihlbGVtZW50Lmxlbmd0aCA9PT0gNDI5NDk2NzI5NSlcbiAgICAgICAge1xuICAgICAgICAgICAgZWxlbWVudC5oYWRVbmRlZmluZWRMZW5ndGggPSB0cnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYoZWxlbWVudC50YWcgPT09IHVudGlsVGFnKSB7XG4gICAgICAgICAgICByZXR1cm4gZWxlbWVudDtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIGlmIFZSIGlzIFNRLCBwYXJzZSB0aGUgc2VxdWVuY2UgaXRlbXNcbiAgICAgICAgaWYoZWxlbWVudC52ciA9PT0gJ1NRJylcbiAgICAgICAge1xuICAgICAgICAgICAgZGljb21QYXJzZXIucmVhZFNlcXVlbmNlSXRlbXNFeHBsaWNpdChieXRlU3RyZWFtLCBlbGVtZW50LCB3YXJuaW5ncyk7XG4gICAgICAgICAgICByZXR1cm4gZWxlbWVudDtcbiAgICAgICAgfVxuXG5cbiAgICAgICAgaWYoZWxlbWVudC5sZW5ndGggPT09IDQyOTQ5NjcyOTUpXG4gICAgICAgIHtcbiAgICAgICAgICAgIGlmKGVsZW1lbnQudGFnID09PSAneDdmZTAwMDEwJykge1xuICAgICAgICAgICAgICAgIGRpY29tUGFyc2VyLmZpbmRFbmRP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oXCJOb3QgYSBKUEVHIGZpbGVcIik7XG4gICAgfVxuXG4gICAgY3VycmVudCA9IHRoaXMuc3RyZWFtLmdldDE2KCk7XG5cbiAgICB3aGlsZSAoKCgoY3VycmVudCA+PiA0KSAhPT0gMHgwRkZDKSB8fCAoY3VycmVudCA9PT0gMHhGRkM0KSkpIHsgLy8gU09GIDB+MTVcbiAgICAgICAgc3dpdGNoIChjdXJyZW50KSB7XG4gICAgICAgICAgICBjYXNlIDB4RkZDNDogLy8gREhUXG4gICAgICAgICAgICAgICAgdGhpcy5odWZmVGFibGUucmVhZCh0aGlzLnN0cmVhbSwgdGhpcy5IdWZmVGFiKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMHhGRkNDOiAvLyBEQUNcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJQcm9ncmFtIGRvZXNuJ3Qgc3VwcG9ydCBhcml0aG1ldGljIGNvZGluZy4gKGZvcm1hdCB0aHJvdyBuZXcgSU9FeGNlcHRpb24pXCIpO1xuICAgICAgICAgICAgY2FzZSAweEZGREI6XG4gICAgICAgICAgICAgICAgdGhpcy5xdWFudFRhYmxlLnJlYWQodGhpcy5zdHJlYW0sIGpwZWcubG9zc2xlc3MuRGVjb2Rlci5UQUJMRSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDB4RkZERDpcbiAgICAgICAgICAgICAgICB0aGlzLnJlc3RhcnRJbnRlcnZhbCA9IHRoaXMucmVhZE51bWJlcigpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAweEZGRTA6XG4gICAgICAgICAgICBjYXNlIDB4RkZFMTpcbiAgICAgICAgICAgIGNhc2UgMHhGRkUyOlxuICAgICAgICAgICAgY2FzZSAweEZGRTM6XG4gICAgICAgICAgICBjYXNlIDB4RkZFNDpcbiAgICAgICAgICAgIGNhc2UgMHhGRkU1OlxuICAgICAgICAgICAgY2FzZSAweEZGRTY6XG4gICAgICAgICAgICBjYXNlIDB4RkZFNzpcbiAgICAgICAgICAgIGNhc2UgMHhGRkU4OlxuICAgICAgICAgICAgY2FzZSAweEZGRTk6XG4gICAgICAgICAgICBjYXNlIDB4RkZFQTpcbiAgICAgICAgICAgIGNhc2UgMHhGRkVCOlxuICAgICAgICAgICAgY2FzZSAweEZGRUM6XG4gICAgICAgICAgICBjYXNlIDB4RkZFRDpcbiAgICAgICAgICAgIGNhc2UgMHhGRkVFOlxuICAgICAgICAgICAgY2FzZSAweEZGRUY6XG4gICAgICAgICAgICAgICAgdGhpcy5yZWFkQXBwKCk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDB4RkZGRTpcbiAgICAgICAgICAgICAgICB0aGlzLnJlYWRDb21tZW50KCk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIGlmICgoY3VycmVudCA+PiA4KSAhPT0gMHhGRikge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJFUlJPUjogZm9ybWF0IHRocm93IG5ldyBJT0V4Y2VwdGlvbiEgKGRlY29kZSlcIik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgY3VycmVudCA9IHRoaXMuc3RyZWFtLmdldDE2KCk7XG4gICAgfVxuXG4gICAgaWYgKChjdXJyZW50IDwgMHhGRkMwKSB8fCAoY3VycmVudCA+IDB4RkZDNykpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiRVJST1I6IGNvdWxkIG5vdCBoYW5kbGUgYXJpdGhtZXRpYyBjb2RlIVwiKTtcbiAgICB9XG5cbiAgICB0aGlzLmZyYW1lLnJlYWQodGhpcy5zdHJlYW0pO1xuICAgIGN1cnJlbnQgPSB0aGlzLnN0cmVhbS5nZXQxNigpO1xuXG4gICAgZG8ge1xuICAgICAgICB3aGlsZSAoY3VycmVudCAhPT0gMHgwRkZEQSkgeyAvLyBTT1NcbiAgICAgICAgICAgIHN3aXRjaCAoY3VycmVudCkge1xuICAgICAgICAgICAgICAgIGNhc2UgMHhGRkM0OiAvLyBESFRcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5odWZmVGFibGUucmVhZCh0aGlzLnN0cmVhbSwgdGhpcy5IdWZmVGFiKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGQ0M6IC8vIERBQ1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJQcm9ncmFtIGRvZXNuJ3Qgc3VwcG9ydCBhcml0aG1ldGljIGNvZGluZy4gKGZvcm1hdCB0aHJvdyBuZXcgSU9FeGNlcHRpb24pXCIpO1xuICAgICAgICAgICAgICAgIGNhc2UgMHhGRkRCOlxuICAgICAgICAgICAgICAgICAgICB0aGlzLnF1YW50VGFibGUucmVhZCh0aGlzLnN0cmVhbSwganBlZy5sb3NzbGVzcy5EZWNvZGVyLlRBQkxFKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGREQ6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucmVzdGFydEludGVydmFsID0gdGhpcy5yZWFkTnVtYmVyKCk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgMHhGRkUwOlxuICAgICAgICAgICAgICAgIGNhc2UgMHhGRkUxOlxuICAgICAgICAgICAgICAgIGNhc2UgMHhGRkUyOlxuICAgICAgICAgICAgICAgIGNhc2UgMHhGRkUzOlxuICAgICAgICAgICAgICAgIGNhc2UgMHhGRkU0OlxuICAgICAgICAgICAgICAgIGNhc2UgMHhGRkU1OlxuICAgICAgICAgICAgICAgIGNhc2UgMHhGRkU2OlxuICAgICAgICAgICAgICAgIGNhc2UgMHhGRkU3OlxuICAgICAgICAgICAgICAgIGNhc2UgMHhGRkU4OlxuICAgICAgICAgICAgICAgIGNhc2UgMHhGRkU5OlxuICAgICAgICAgICAgICAgIGNhc2UgMHhGRkVBOlxuICAgICAgICAgICAgICAgIGNhc2UgMHhGRkVCOlxuICAgICAgICAgICAgICAgIGNhc2UgMHhGRkVDOlxuICAgICAgICAgICAgICAgIGNhc2UgMHhGRkVEOlxuICAgICAgICAgICAgICAgIGNhc2UgMHhGRkVFOlxuICAgICAgICAgICAgICAgIGNhc2UgMHhGRkVGOlxuICAgICAgICAgICAgICAgICAgICB0aGlzLnJlYWRBcHAoKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAweEZGRkU6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucmVhZENvbW1lbnQoKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgaWYgKChjdXJyZW50ID4+IDgpICE9PSAweEZGKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJFUlJPUjogZm9ybWF0IHRocm93IG5ldyBJT0V4Y2VwdGlvbiEgKFBhcnNlci5kZWNvZGUpXCIpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGN1cnJlbnQgPSB0aGlzLnN0cmVhbS5nZXQxNigpO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5wcmVjaXNpb24gPSB0aGlzLmZyYW1lLnByZWNpc2lvbjtcbiAgICAgICAgdGhpcy5jb21wb25lbnRzID0gdGhpcy5mcmFtZS5jb21wb25lbnRzO1xuXG4gICAgICAgIGlmICghdGhpcy5udW1CeXRlcykge1xuICAgICAgICAgICAgdGhpcy5udW1CeXRlcyA9IHBhcnNlSW50KE1hdGguY2VpbCh0aGlzLnByZWNpc2lvbiAvIDgpKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLm51bUJ5dGVzID09IDEpIHtcbiAgICAgICAgICAgIHRoaXMubWFzayA9IDB4RkY7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLm1hc2sgPSAweEZGRkY7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnNjYW4ucmVhZCh0aGlzLnN0cmVhbSk7XG4gICAgICAgIHRoaXMubnVtQ29tcCA9IHRoaXMuc2Nhbi5udW1Db21wO1xuICAgICAgICB0aGlzLnNlbGVjdGlvbiA9IHRoaXMuc2Nhbi5zZWxlY3Rpb247XG5cbiAgICAgICAgaWYgKHRoaXMubnVtQnl0ZXMgPT09IDEpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLm51bUNvbXAgPT09IDMpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmdldHRlciA9IHRoaXMuZ2V0VmFsdWVSR0I7XG4gICAgICAgICAgICAgICAgdGhpcy5zZXR0ZXIgPSB0aGlzLnNldFZhbHVlUkdCO1xuICAgICAgICAgICAgICAgIHRoaXMub3V0cHV0ID0gdGhpcy5vdXRwdXRSR0I7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMuZ2V0dGVyID0gdGhpcy5nZXRWYWx1ZTg7XG4gICAgICAgICAgICAgICAgdGhpcy5zZXR0ZXIgPSB0aGlzLnNldFZhbHVlODtcbiAgICAgICAgICAgICAgICB0aGlzLm91dHB1dCA9IHRoaXMub3V0cHV0U2luZ2xlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5nZXR0ZXIgPSB0aGlzLmdldFZhbHVlMTY7XG4gICAgICAgICAgICB0aGlzLnNldHRlciA9IHRoaXMuc2V0VmFsdWUxNjtcbiAgICAgICAgICAgIHRoaXMub3V0cHV0ID0gdGhpcy5vdXRwdXRTaW5nbGU7XG4gICAgICAgIH1cblxuICAgICAgICBzd2l0Y2ggKHRoaXMuc2VsZWN0aW9uKSB7XG4gICAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICAgICAgdGhpcy5zZWxlY3RvciA9IHRoaXMuc2VsZWN0MjtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAgICAgICB0aGlzLnNlbGVjdG9yID0gdGhpcy5zZWxlY3QzO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA0OlxuICAgICAgICAgICAgICAgIHRoaXMuc2VsZWN0b3IgPSB0aGlzLnNlbGVjdDQ7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIDU6XG4gICAgICAgICAgICAgICAgdGhpcy5zZWxlY3RvciA9IHRoaXMuc2VsZWN0NTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgNjpcbiAgICAgICAgICAgICAgICB0aGlzLnNlbGVjdG9yID0gdGhpcy5zZWxlY3Q2O1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA3OlxuICAgICAgICAgICAgICAgIHRoaXMuc2VsZWN0b3IgPSB0aGlzLnNlbGVjdDc7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIHRoaXMuc2VsZWN0b3IgPSB0aGlzLnNlbGVjdDE7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnNjYW5Db21wcyA9IHRoaXMuc2Nhbi5jb21wb25lbnRzO1xuICAgICAgICB0aGlzLnF1YW50VGFibGVzID0gdGhpcy5xdWFudFRhYmxlLnF1YW50VGFibGVzO1xuXG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCB0aGlzLm51bUNvbXA7IGkrPTEpIHtcbiAgICAgICAgICAgIGNvbXBOID0gd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AgICAgICAgICAgIGN1cnJlbnQgPSB0aGlzLmRlY29kZVVuaXQocHJlZCwgdGVtcCwgaW5kZXgpO1xuXG4gICAgICAgICAgICAgICAgd2hpbGUgKChjdXJyZW50ID09PSAwKSAmJiAoKHRoaXMueExvYyA8IHRoaXMueERpbSkgJiYgKHRoaXMueUxvYyA8IHRoaXMueURpbSkpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMub3V0cHV0KHByZWQpO1xuICAgICAgICAgICAgICAgICAgICBjdXJyZW50ID0gdGhpcy5kZWNvZGVVbml0KHByZWQsIHRlbXAsIGluZGV4KTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBicmVhazsgLy9jdXJyZW50PU1BUktFUlxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmb3IgKG1jdU51bSA9IDA7IG1jdU51bSA8IHRoaXMucmVzdGFydEludGVydmFsOyBtY3VOdW0rPTEpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnJlc3RhcnRpbmcgPSAobWN1TnVtID09IDApO1xuICAgICAgICAgICAgICAgIGN1cnJlbnQgPSB0aGlzLmRlY29kZVVuaXQocHJlZCwgdGVtcCwgaW5kZXgpO1xuICAgICAgICAgICAgICAgIHRoaXMub3V0cHV0KHByZWQpO1xuXG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbnQgIT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoY3VycmVudCA9PT0gMCkge1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLm1hcmtlckluZGV4ICE9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGN1cnJlbnQgPSAoMHhGRjAwIHwgdGhpcy5tYXJrZXIpO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLm1hcmtlckluZGV4ID0gMDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBjdXJyZW50ID0gdGhpcy5zdHJlYW0uZ2V0MTYoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICghKChjdXJyZW50ID49IGpwZWcubG9zc2xlc3MuRGVjb2Rlci5SRVNUQVJUX01BUktFUl9CRUdJTikgJiZcbiAgICAgICAgICAgICAgICAoY3VycmVudCA8PSBqcGVnLmxvc3NsZXNzLkRlY29kZXIuUkVTVEFSVF9NQVJLRVJfRU5EKSkpIHtcbiAgICAgICAgICAgICAgICBicmVhazsgLy9jdXJyZW50PU1BUktFUlxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKChjdXJyZW50ID09PSAweEZGREMpICYmIChzY2FuTnVtID09PSAxKSkgeyAvL0ROTFxuICAgICAgICAgICAgdGhpcy5yZWFkTnVtYmVyKCk7XG4gICAgICAgICAgICBjdXJyZW50ID0gdGhpcy5zdHJlYW0uZ2V0MTYoKTtcbiAgICAgICAgfVxuICAgIH0gd2hpbGUgKChjdXJyZW50ICE9PSAweEZGRDkpICYmICgodGhpcy54TG9jIDwgdGhpcy54RGltKSAmJiAodGhpcy55TG9jIDwgdGhpcy55RGltKSkgJiYgKHNjYW5OdW0gPT09IDApKTtcblxuICAgIHJldHVybiB0aGlzLm91dHB1dERhdGE7XG59O1xuXG5cblxuanBlZy5sb3NzbGVzcy5EZWNvZGVyLnByb3RvdHlwZS5kZWNvZGVVbml0ID0gZnVuY3Rpb24gKHByZXYsIHRlbXAsIGluZGV4KSB7XG4gICAgaWYgKHRoaXMubnVtQ29tcCA9PSAxKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlY29kZVNpbmdsZShwcmV2LCB0ZW1wLCBpbmRleCk7XG4gICAgfSBlbHNlIGlmICh0aGlzLm51bUNvbXAgPT0gMykge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWNvZGVSR0IocHJldiwgdGVtcCwgaW5kZXgpO1x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MDsgayA8IHRoaXMuSURDVF9Tb3VyY2UubGVuZ3RoOyBrKz0xKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5JRENUX1NvdXJjZVtrXSA9IDA7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhbHVlID0gdGhpcy5nZXRIdWZmbWFuVmFsdWUoZGN0YWIsIHRlbXAsIGluZGV4KTtcblxuICAgICAgICAgICAgaWYgKHZhbHVlID49IDB4RkYwMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcHJldltjdHJDXSA9IHRoaXMuSURDVF9Tb3VyY2VbMF0gPSBwcmV2W2N0ckNdICsgdGhpcy5nZXRuKGluZGV4LCB2YWx1ZSwgdGVtcCwgaW5kZXgpO1xuICAgICAgICAgICAgdGhpcy5JRENUX1NvdXJjZVswXSAqPSBxdGFiWzBdO1xuXG4gICAgICAgICAgICBmb3IgKGogPSAxOyBqIDwgNjQ7IGorPTEpIHtcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IHRoaXMuZ2V0SHVmZm1hblZhbHVlKGFjdGFiLCB0ZW1wLCBpbmRleCk7XG5cbiAgICAgICAgICAgICAgICBpZiAodmFsdWUgPj0gMHhGRjAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBqICs9ICh2YWx1ZSA+PiA0KTtcblxuICAgICAgICAgICAgICAgIGlmICgodmFsdWUgJiAweDBGKSA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKHZhbHVlID4+IDQpID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuSURDVF9Tb3VyY2VbanBlZy5sb3NzbGVzcy5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b2Rlci5NU0IpICE9PSAwKSB7XG4gICAgICAgIGlmICh0aGlzLm1hcmtlckluZGV4ICE9PSAwKSB7XG4gICAgICAgICAgICB0aGlzLm1hcmtlckluZGV4ID0gMDtcbiAgICAgICAgICAgIHJldHVybiAweEZGMDAgfCB0aGlzLm1hcmtlcjtcbiAgICAgICAgfVxuXG4gICAgICAgIHRlbXBbMF0gJj0gKG1hc2sgPj4gKDE2IC0gaW5kZXhbMF0pKTtcbiAgICAgICAgdGVtcFswXSA8PD0gODtcbiAgICAgICAgaW5wdXQgPSB0aGlzLnN0cmVhbS5nZXQ4KCk7XG5cbiAgICAgICAgaWYgKGlucHV0ID09PSAweEZGKSB7XG4gICAgICAgICAgICB0aGlzLm1hcmtlciA9IHRoaXMuc3RyZWFtLmdldDgoKTtcbiAgICAgICAgICAgIGlmICh0aGlzLm1hcmtlciAhPT0gMCkge1xuICAgICAgICAgICAgICAgIHRoaXMubWFya2VySW5kZXggPSA5O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgdGVtcFswXSB8PSBpbnB1dDtcbiAgICAgICAgY29kZSA9IHRhYmxlWygoY29kZSAmIDB4RkYpICogMjU2KSArICh0ZW1wWzBdID4+IGluZGV4WzBdKV07XG4gICAgICAgIGluZGV4WzBdICs9IDg7XG4gICAgfVxuXG4gICAgaW5kZXhbMF0gKz0gOCAtIChjb2RlID4+IDgpO1xuXG4gICAgaWYgKGluZGV4WzBdIDwgMCkge1xuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJpbmRleD1cIiArIGluZGV4WzBdICsgXCIgdGVtcD1cIiArIHRlbXBbMF0gKyBcIiBjb2RlPVwiICsgY29kZSArIFwiIGluIEh1ZmZtYW5WYWx1ZSgpXCIpO1xuICAgIH1cblxuICAgIGlmIChpbmRleFswXSA8IHRoaXMubWFya2VySW5kZXgpIHtcbiAgICAgICAgdGhpcy5tYXJrZXJJbmRleCA9IDA7XG4gICAgICAgIHJldHVybiAweEZGMDAg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Sk7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgdGVtcFswXSA8PD0gODtcbiAgICAgICAgaW5wdXQgPSB0aGlzLnN0cmVhbS5nZXQ4KCk7XG5cbiAgICAgICAgaWYgKGlucHV0ID09PSAweEZGKSB7XG4gICAgICAgICAgICB0aGlzLm1hcmtlciA9IHRoaXMuc3RyZWFtLmdldDgoKTtcbiAgICAgICAgICAgIGlmICh0aGlzLm1hcmtlciAhPT0gMCkge1xuICAgICAgICAgICAgICAgIHRoaXMubWFya2VySW5kZXggPSA5O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgdGVtcFswXSB8PSBpbnB1dDtcbiAgICAgICAgaW5kZXhbMF0gKz0gODtcblxuICAgICAgICBpZiAoaW5kZXhbMF0gPCAwKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5tYXJrZXJJbmRleCAhPT0gMCkge1xuICAgICAgICAgICAgICAgIHRoaXMubWFya2VySW5kZXggPSAwO1xuICAgICAgICAgICAgICAgIHJldHVybiAoMHhGRjAwIHwgdGhpcy5tYXJrZXIpIDw8IDg7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRlbXBbMF0gPDw9IDg7XG4gICAgICAgICAgICBpbnB1dCA9IHRoaXMuc3RyZWFtLmdldDgoKTtcblxuICAgICAgICAgICAgaWYgKGlucHV0ID09PSAweEZGKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5tYXJrZXIgPSB0aGlzLnN0cmVhbS5nZXQ4KCk7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMubWFya2VyICE9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMubWFya2VySW5kZXggPSA5O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGVtcFswXSB8PSBpbnB1dDtcbiAgICAgICAgICAgIGluZGV4WzBdICs9IDg7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoaW5kZXhbMF0gPCAw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aGlzLnhMb2MgPCB0aGlzLnhEaW0pICYmICh0aGlzLnlMb2MgPCB0aGlzLnlEaW0pKSB7XG4gICAgICAgIHRoaXMuc2V0dGVyKCgoKHRoaXMueUxvYyAqIHRoaXMueERpbSkgKyB0aGlzLnhMb2MpKSwgdGhpcy5tYXNrICYgUFJFRFswXSk7XG5cbiAgICAgICAgdGhpcy54TG9jKz0xO1xuXG4gICAgICAgIGlmICh0aGlzLnhMb2MgPj0gdGhpcy54RGltKSB7XG4gICAgICAgICAgICB0aGlzLnlMb2MrPTE7XG4gICAgICAgICAgICB0aGlzLnhMb2MgPSAwO1xuICAgICAgICB9XG4gICAgfVxufTtcblxuXG5cbmpwZWcubG9zc2xlc3MuRGVjb2Rlci5wcm90b3R5cGUub3V0cHV0UkdCID0gZnVuY3Rpb24gKFBSRUQpIHtcbiAgICB2YXIgb2Zmc2V0ID0gKCh0aGlzLnlMb2MgKiB0aGlzLnhEaW0pICsgdGhpcy54TG9jKTtcblxuICAgIGlmICgodGhpcy54TG9jIDwgdGhpcy54RGltKSAmJiAodGhpcy55TG9jIDwgdGhpcy55RGltKSkge1xuICAgICAgICB0aGlzLnNldHRlcihvZmZzZXQsIFBSRURbMF0sIDApO1xuICAgICAgICB0aGlzLnNldHRlcihvZmZzZXQsIFBSRURbMV0sIDEpO1xuICAgICAgICB0aGlzLnNldHRlcihvZmZzZXQsIFBSRURbMl0sIDIpO1xuXG4gICAgICAgIHRoaXMueExvYys9MTtcblxuICAgICAgICBpZiAodGhpcy54TG9jID49IHRoaXMueERpbSkge1xuICAgICAgICAgICAgdGhpcy55TG9jKz0xO1xuICAgICAgICAgICAgdGhpcy54TG9jID0gMDtcbiAgICAgICAgfVxuICAgIH1cbn07XG5cblxuXG5qcGVnLmxvc3NsZXNzLkRlY29kZXIucHJvdG90eXBlLnNldFZhbHVlMTYgPSBmdW5jdGlvbiAoaW5kZXgsIHZhbCkge1xuICAgIHRoaXMub3V0cHV0RGF0YS5zZXRJbnQxNihpbmRle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j4gNDtcbiAgICAgICAgaWYgKGMgPiAyKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJFUlJPUjogSHVmZm1hbiB0YWJsZSBbVGFibGUgY2xhc3MgPiAyIF1cIik7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnRoW3RdID0gMTtcbiAgICAgICAgdGhpcy50Y1t0XVtjXSA9IDE7XG5cbiAgICAgICAgZm9yIChpID0gMDsgaSA8IDE2OyBpKz0xKSB7XG4gICAgICAgICAgICB0aGlzLmxbdF1bY11baV0gPSBkYXRhLmdldDgoKTtcbiAgICAgICAgICAgIGNvdW50Kz0xO1xuICAgICAgICB9XG5cbiAgICAgICAgZm9yIChpID0gMDsgaSA8IDE2OyBpKz0xKSB7XG4gICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgdGhpcy5sW3RdW2NdW2ldOyBqKz0xKSB7XG4gICAgICAgICAgICAgICAgaWYgKGNvdW50ID4gbGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkVSUk9SOiBIdWZmbWFuIHRhYmxlIGZvcm1hdCBlcnJvciBbY291bnQ+TGhdXCIpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHRoaXMudlt0XVtjXVtpXVtqXSA9IGRhdGEuZ2V0OCgpO1xuICAgICAgICAgICAgICAgIGNvdW50Kz0xO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgaWYgKGNvdW50ICE9PSBsZW5ndGgpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiRVJST1I6IEh1ZmZtYW4gdGFibGUgZm9ybWF0IGVycm9yIFtjb3VudCE9TGZdXCIpO1xuICAgIH1cblxuICAgIGZvciAoaSA9IDA7IGkgPCA0OyBpKz0xKSB7XG4gICAgICAgIGZvciAoaiA9IDA7IGogPCAyOyBqKz0xKSB7XG4gICAgICAgICAgICBpZiAodGhpcy50Y1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IGsrPTE7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmb3IgKGkgPSAxOyBrIDwgMjU2OyBpKz0xLCBrKz0xKSB7XG4gICAgICAgIHRhYltrXSA9IGkgfCBqcGVnLmxvc3NsZXNzLkh1ZmZtYW5UYWJsZS5NU0I7XG4gICAgfVxuXG4gICAgY3VycmVudFRhYmxlID0gMTtcbiAgICBrID0gMDtcblxuICAgIGZvciAoaSA9IDg7IGkgPCAxNjsgaSs9MSkgeyAvLyBpKzEgaXMgQ29kZSBsZW5ndGhcbiAgICAgICAgZm9yIChqID0gMDsgaiA8IExbaV07IGorPTEpIHtcbiAgICAgICAgICAgIGZvciAobiA9IDA7IG4gPCAodGVtcCA+PiAoaSAtIDcpKTsgbis9MSkge1xuICAgICAgICAgICAgICAgIHRhYlsoY3VycmVudFRhYmxlICogMjU2KSArIGtdID0gVltpXVtqXSB8ICgoaSArIDEpIDw8IDgpO1xuICAgICAgICAgICAgICAgIGsrPTE7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChrID49IDI1Nikge1xuICAgICAgICAgICAgICAgIGlmIChrID4gMjU2KSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkVSUk9SOiBIdWZmbWFuIHRhYmxlIGVycm9yKDEpIVwiKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBrID0gMDtcbiAgICAgICAgICAgICAgICBjdXJyZW50VGFibGUrPTE7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG59O1xuXG5cbi8qKiogRXhwb3J0cyAqKiovXG5cbnZhciBtb2R1bGVUeXBlID0gdHlwZW9mIG1vZHVsZTtcbmlmICgobW9kdWxlVHlwZSAhPT0gJ3VuZGVmaW5lZCcpICYmIG1vZHVsZS5leHBvcnRzKSB7XG4gICAgbW9kdWxlLmV4cG9ydHMgPSBqcGVnLmxvc3NsZXNzLkh1ZmZtYW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RhLmdldDE2KCk7XG4gICAgY291bnQgKz0gMjtcblxuICAgIHdoaWxlIChjb3VudCA8IGxlbmd0aCkge1xuICAgICAgICB0ZW1wID0gZGF0YS5nZXQ4KCk7XG4gICAgICAgIGNvdW50Kz0xO1xuICAgICAgICB0ID0gdGVtcCAmIDB4MEY7XG5cbiAgICAgICAgaWYgKHQgPiAzKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJFUlJPUjogUXVhbnRpemF0aW9uIHRhYmxlIElEID4gM1wiKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMucHJlY2lzaW9uW3RdID0gdGVtcCA+PiA0O1xuXG4gICAgICAgIGlmICh0aGlzLnByZWNpc2lvblt0XSA9PT0gMCkge1xuICAgICAgICAgICAgdGhpcy5wcmVjaXNpb25bdF0gPSA4O1xuICAgICAgICB9IGVsc2UgaWYgKHRoaXMucHJlY2lzaW9uW3RdID09PSAxKSB7XG4gICAgICAgICAgICB0aGlzLnByZWNpc2lvblt0XSA9IDE2O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiRVJST1I6IFF1YW50aXphdGlvbiB0YWJsZSBwcmVjaXNpb24gZXJyb3JcIik7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnRxW3RdID0gMTtcblxuICAgICAgICBpZiAodGhpcy5wcmVjaXNpb25bdF0gPT09IDgpIHtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCA2NDsgaSs9MSkge1xuICAgICAgICAgICAgICAgIGlmIChjb3VudCA+IGxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJFUlJPUjogUXVhbnRpemF0aW9uIHRhYmxlIGZvcm1hdCBlcnJvclwiKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB0aGlzLnF1YW50VGFibGVzW3RdW2ldID0gZGF0YS5nZXQ4KCk7XG4gICAgICAgICAgICAgICAgY291bnQrPTE7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGpwZWcubG9zc2xlc3MuUXVhbnRpemF0aW9uVGFibGUuZW5oYW5jZVF1YW50aXphdGlvblRhYmxlKHRoaXMucXVhbnRUYWJsZXNbdF0sIHRhYmxlKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCA2NDsgaSs9MSkge1xuICAgICAgICAgICAgICAgIGlmIChjb3VudCA+IGxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJFUlJPUjogUXVhbnRpemF0aW9uIHRhYmxlIGZvcm1hdCBlcnJvclwiKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB0aGlzLnF1YW50VGFibGVzW3RdW2ldID0gZGF0YS5nZXQxNigpO1xuICAgICAgICAgICAgICAgIGNvdW50ICs9IDI7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGpwZWcubG9zc2xlc3MuUXVhbnRpemF0aW9uVGFibGUuZW5oYW5jZVF1YW50aXphdGlvblRhYmxlKHRoaXMucXVhbnRUYWJsZXNbdF0sIHRhYmxlKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGlmIChjb3VudCAhPT0gbGVuZ3RoKSB7XG4gICAgICAgIHRocm93IG5ldyBFcnJvcihcIkVSUk9SOiBRdWFudGl6YXRpb24gdGFibGUgZXJyb3IgW2NvdW50IT1McV1cIik7XG4gICAgfVxuXG4gICAgcmV0dXJuIDE7XG59O1xuXG5cblxuLyoqKiBFeHBvcnRzICoqKi9cblxudmFyIG1vZHVsZVR5cGUgPSB0eXBlb2YgbW9kdWxlO1xuaWYgKChtb2R1bGVUeXBlICE9PSAndW5kZWZpbmVkJykgJiYgbW9kdWxlLmV4cG9ydHMpIHtcbiAgICBtb2R1bGUuZXhwb3J0cyA9IGpwZWcubG9zc2xlc3MuUXVhb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gICAgUlszXVswXSA9IFJbM11bMV0gPSBSWzNdWzJdID0gMC4wO1xuICAgIFJbM11bM10gPSAxLjA7XG5cbiAgICAvLyBjb21wdXRlIGEgcGFyYW1ldGVyIGZyb20gYixjLGRcbiAgICBhID0gMS4wIC0gKGIgKiBiICsgYyAqIGMgKyBkICogZCk7XG4gICAgaWYgKGEgPCAwLjAwMDAwMDEpIHsgICAgICAgICAgICAgICAgICAgLyogc3BlY2lhbCBjYXNlICovXG5cbiAgICAgICAgYSA9IDEuMCAvIE1hdGguc3FydChiICogYiArIGMgKiBjICsgZCAqIGQpO1xuICAgICAgICBiICo9IGE7XG4gICAgICAgIGMgKj0gYTtcbiAgICAgICAgZCAqPSBhOyAgICAgICAgLyogbm9ybWFsaXplIChiLGMsZCkgdmVjdG9yICovXG4gICAgICAgIGEgPSAwLjA7ICAgICAgICAgICAgICAgICAgICAgICAgLyogYSA9IDAgPT0+IDE4MCBkZWdyZWUgcm90YXRpb24gKi9cbiAgICB9IGVsc2Uge1xuXG4gICAgICAgIGEgPSBNYXRoLnNxcnQoYSk7ICAgICAgICAgICAgICAgICAgICAgLyogYW5nbGUgPSAyKmFyY2NvcyhhKSAqL1xuICAgIH1cblxuICAgIC8vIGxvYWQgcm90YXRpb24gbWF0cml4LCBpbmNsdWRpbmcgc2NhbGluZyBmYWN0b3JzIGZvciB2b3hlbCBzaXplc1xuICAgIHhkID0gKGR4ID4gMC4wKSA/IGR4IDogMS4wOyAgICAgICAvKiBtYWtlIHN1cmUgYXJlIHBvc2l0aXZlICovXG4gICAgeWQgPSAoZHkgPiAwLjApID8gZHkgOiAxLjA7XG4gICAgemQgPSAoZHogPiAwLjApID8gZHogOiAxLjA7XG5cbiAgICBpZiAocWZhYyA8IDAuMCkge1xuICAgICAgICB6ZCA9IC16ZDsgICAgICAgICAvKiBsZWZ0IGhhbmRlZG5lc3M/ICovXG4gICAgfVxuXG4gICAgUlswXVswXSA9ICAgICAgIChhICogYSArIGIgKiBiIC0gYyAqIG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FydCh4aSAqIHhpICsgeWkgKiB5aSArIHppICogemkpO1xuICAgIGlmICh2YWwgPT09IDAuMCkgeyAgLyogc3R1cGlkIGlucHV0ICovXG4gICAgICAgIHJldHVybiBudWxsO1xuICAgIH1cblxuICAgIHhpIC89IHZhbDtcbiAgICB5aSAvPSB2YWw7XG4gICAgemkgLz0gdmFsO1xuXG4gICAgLyogbm9ybWFsaXplIGogYXhpcyAqL1xuICAgIHZhbCA9IE1hdGguc3FydCh4aiAqIHhqICsgeWogKiB5aiArIHpqICogemopO1xuICAgIGlmICh2YWwgPT09IDAuMCkgeyAgLyogc3R1cGlkIGlucHV0ICovXG4gICAgICAgIHJldHVybiBudWxsO1xuICAgIH1cblxuICAgIHhqIC89IHZhbDtcbiAgICB5aiAvPSB2YWw7XG4gICAgemogLz0gdmFsO1xuXG4gICAgLyogb3J0aG9nb25hbGl6ZSBqIGF4aXMgdG8gaSBheGlzLCBpZiBuZWVkZWQgKi9cbiAgICB2YWwgPSB4aSAqIHhqICsgeWkgKiB5aiArIHppICogemo7ICAgIC8qIGRvdCBwcm9kdWN0IGJldHdlZW4gaSBhbmQgaiAqL1xuICAgIGlmIChNYXRoLmFicyh2YWwpID4gMS5FLTQpIHtcbiAgICAgICAgeGogLT0gdmFsICogeGk7XG4gICAgICAgIHlqIC09IHZhbCAqIHlpO1xuICAgICAgICB6aiAtPSB2YWwgKiB6aTtcbiAgICAgICAgdmFsID0gTWF0aC5zcXJ0KHhqICogeGogKyB5aiAqIHlqICsgemogKiB6aik7ICAvKiBtdXN0IHJlbm9ybWFsaXplICovXG4gICAgICAgIGlmICh2YWwgPT09IDAuMCkgeyAgICAgICAgICAgICAgLyogaiB3YXMgcGFyYWxsZWwgdG8gaT8gKi9cbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9XG4gICAgICAgIHhqIC89IHZhbDtcbiAgICAgICAgeWogLz0gdmFsO1xuICAgICAgICB6aiAvPSB2YWw7XG4gICAgfVxuXG4gICAgLyogbm9ybWFsaXplIGsgYXhpczsgaWYgaXQgaXMgemVybywgbWFrZSBpdCB0aGUgY3Jvc3MgcHJvZHVjdCBpIHggaiAqL1xuICAgIHZhbCA9IE1hdGguc3FydCh4ayAqIHhrICsgeWsgKiB5ayArIHprICogemspO1xuICAgIGlmICh2YWwgPT09IDAuMCkge1xuICAgICAgICB4ayA9IHlpICogemogLSB6aSAqIHlqO1xuICAgICAgICB5ayA9IHppICogeGogLSB6aiAqIHhpO1xuICAgICAgICB6ayA9IHhpICogeWogLSB5aSAqIHhqO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIHhrIC89IHZhbDtcbiAgICAgICAgeWsgLz0gdmFsO1xuICAgICAgICB6ayAvPSB2YWw7XG4gICAgfVxuXG4gICAgLyogb3J0aG9nb25hbGl6ZSBrIHRvIGkgKi9cbiAgICB2YWwgPSB4aSAqIHhrICsgeWkgKiB5ayArIHppICogems7ICAgIC8qIGRvdCBwcm9kdWN0IGJldHdlZW4gaSBhbmQgayAqL1xuICAgIGlmIChNYXRoLmFicyh2YWwpID4gMS5FLTQpIHtcbiAgICAgICAgeGsgLT0gdmFsICogeGk7XG4gICAgICAgIHlrIC09IHZhbCAqIHlpO1xuICAgICAgICB6ayAtPSB2YWwgKiB6aTtcbiAgICAgICAgdmFsID0gTWF0aC5zcXJ0KHhrICogeGsgKyB5ayAqIHlrICsgemsgKiB6ayk7XG4gICAgICAgIGlmICh2YWwgPT09IDAuMCkgeyAgICAvKiBiYWQgKi9cbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9XG4gICAgICAgIHhrIC89IHZhbDtcbiAgICAgICAgeWsgLz0gdmFsO1xuICAgICAgICB6ayAvPSB2YWw7XG4gICAgfVxuXG4gICAgLyogb3J0aG9nb25hbGl6ZSBrIHRvIGogKi9cbiAgICB2YWwgPSB4aiAqIHhrICsgeWogKiB5ayArIHpqICogems7ICAgIC8qIGRvdCBwcm9kdWN0IGJldHdlZW4gaiBhbmQgayAqL1xuIC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7IHAgKz0gMikgeyAgICAvKiBwLHEsciBhcmUgLTEgb3IgKzEgICAgICAqL1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAocSA9IC0xOyBxIDw9IDE7IHEgKz0gMikgeyAgIC8qIGFuZCBnbyBpbnRvIHJvd3MgIzEsMiwzICovXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAociA9IC0xOyByIDw9IDE7IHIgKz0gMikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUFswXVtpIC0gMV0gPSBwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUFsxXVtqIC0gMV0gPSBxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUFsyXVtrIC0gMV0gPSByO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGV0UCA9IHRoaXMubmlmdGlfbWF0MzNfZGV0ZXJtKFApOyAgICAgICAgICAgLyogc2lnbiBvZiBwZXJtdXRhdGlvbiAqL1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChkZXRQICogZGV0USkgPiAwLjApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNID0gdGhpcy5uaWZ0aV9tYXQzM19tdWwoUCwgUSk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBhbmdsZSBvZiBNIHJvdGF0aW9uID0gMi4wKmFjb3MoMC41KnNxcnQoMS4wK3RyYWNlKE0pKSkgICAgICAgKi9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB3ZSB3YW50IGxhcmdlc3QgdHJhY2UoTSkgPT0gc21hbGxlc3QgYW5nbGUgPT0gTSBuZWFyZXN0IHRvIEkgKi9cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbCA9IE1bMF1bMF0gKyBNWzFdWzFdICsgTVsyXVsyXTsgLyogdHJhY2UgKi9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodmFsID4gdmJlc3QpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmJlc3QgPSB2YWw7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGliZXN0ID0gaTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamJlc3QgPSBqO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrYmVzdCA9IGs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBiZXN0ID0gcDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcWJlc3QgPSBxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByYmVzdCA9IHI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSAgLyogZG9lc24ndCBtYXRjaCBzaWduIG9mIFEgKi9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8qIEF0IHRoaXMgcG9pbnQgaWJlc3QgaXMgMSBvciAyIG9yIDM7IHBiZXN0IGlzIC0xIG9yICsxOyBldGMuXG5cbiAgICAgVGhlIG1hdHJpeCBQIHRoYXQgY29ycmVzcG9uZHMgaXMgdGhlIGJlc3QgcGVybXV0YXRpb24gYXBwcm94aW1hdGlvblxuICAgICB0byBRLWludmVyc2U7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BjYXNlIDI6IC8qaSA9IE5JRlRJX1AyQSovXG4gICAgICAgICAgICBpQ2hhciA9ICdZJztcbiAgICAgICAgICAgIGlTZW5zZSA9ICcrJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIC0yOiAvKmkgPSBOSUZUSV9BMlAqL1xuICAgICAgICAgICAgaUNoYXIgPSAnWSc7XG4gICAgICAgICAgICBpU2Vuc2UgPSAnLSc7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAzOiAvKmkgPSBOSUZUSV9JMlMqL1xuICAgICAgICAgICAgaUNoYXIgPSAnWic7XG4gICAgICAgICAgICBpU2Vuc2UgPSAnKyc7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAtMzogLyppID0gTklGVElfUzJJKi9cbiAgICAgICAgICAgIGlDaGFyID0gJ1onO1xuICAgICAgICAgICAgaVNlbnNlID0gJy0nO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgfVxuXG4gICAgc3dpdGNoIChqYmVzdCAqIHFiZXN0KSB7XG4gICAgICAgIGNhc2UgMTogLypqID0gTklGVElfTDJSKi9cbiAgICAgICAgICAgIGpDaGFyID0gJ1gnO1xuICAgICAgICAgICAgalNlbnNlID0gJysnO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgLTE6IC8qaiA9IE5JRlRJX1IyTCovXG4gICAgICAgICAgICBqQ2hhciA9ICdYJztcbiAgICAgICAgICAgIGpTZW5zZSA9ICctJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIDI6IC8qaiA9IE5JRlRJX1AyQSovXG4gICAgICAgICAgICBqQ2hhciA9ICdZJztcbiAgICAgICAgICAgIGpTZW5zZSA9ICcrJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIC0yOiAvKmogPSBOSUZUSV9BMlAqL1xuICAgICAgICAgICAgakNoYXIgPSAnWSc7XG4gICAgICAgICAgICBqU2Vuc2UgPSAnLSc7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAzOiAvKmogPSBOSUZUSV9JMlMqL1xuICAgICAgICAgICAgakNoYXIgPSAnWic7XG4gICAgICAgICAgICBqU2Vuc2UgPSAnKyc7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAtMzogLypqID0gTklGVElfUzJJKi9cbiAgICAgICAgICAgIGpDaGFyID0gJ1onO1xuICAgICAgICAgICAgalNlbnNlID0gJy0nO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgfVxuXG4gICAgc3dpdGNoIChrYmVzdCAqIHJiZXN0KSB7XG4gICAgICAgIGNhc2UgMTogLyprID0gTklGVElfTDJSKi9cbiAgICAgICAgICAgIGtDaGFyID0gJ1gnO1xuICAgICAgICAgICAga1NlbnNlID0gJysnO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgLTE6IC8qayA9IE5JRlRJX1IyTCovXG4gICAgICAgICAgICBrQ2hhciA9ICdYJztcbiAgICAgICAgICAgIGtTZW5zZSA9ICctJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIDI6IC8qayA9IE5JRlRJX1AyQSovXG4gICAgICAgICAgICBrQ2hhciA9ICdZJztcbiAgICAgICAgICAgIGtTZW5zZSA9ICcrJztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIC0yOiAvKmsgPSBOSUZUSV9BMlAqL1xuICAgICAgICAgICAga0NoYXIgPSAnWSc7XG4gICAgICAgICAgICBrU2Vuc2UgPSAnLSc7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAzOiAvKmsgPSBOSUZUSV9JMlMqL1xuICAgICAgICAgICAga0NoYXIgPSAnWic7XG4gICAgICAgICAgICBrU2Vuc2UgPSAnKyc7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAtMzogLyprID0gTklGVElfUzJJKi9cbiAgICAgICAgICAgIG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AgICAgICAgbWF0Y2ggPSBsaW5lUkUuZXhlYyhsaW5lc1tpXSk7XG4gICAgICAgIGlmICghbWF0Y2gpIHtcbiAgICAgICAgICAgIGNvbnNvbGUud2FybihcIlVucmVjb2duaXplZCBsaW5lIGluIE5SUkQgaGVhZGVyOiBcIiArIGxpbmVzW2ldKTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG4gICAgICAgIGlmIChtYXRjaFsyXSA9PSAnOiAnKSB7IC8vIEZpZWxkIHNwZWNpZmljYXRpb25cbiAgICAgICAgICAgIG1hdGNoWzFdID0gbWFwTlJSRFRvSmF2YXNjcmlwdChtYXRjaFsxXSk7XG4gICAgICAgICAgICBpZiAoIG1hdGNoWzFdID09ICdkYXRhRmlsZScgJiZcbiAgICAgICAgICAgICAgICAgKG1hdGNoMiA9IGRhdGFGaWxlTGlzdFJFLmV4ZWMobWF0Y2hbM10pKSkge1xuICAgICAgICAgICAgICAgIC8vIFRoaXMgc2hvdWxkIGJlIHRoZSBsYXN0IGZpZWxkIHNwZWNpZmljYXRpb24sXG4gICAgICAgICAgICAgICAgLy8gYW5kIHRoZSByZXN0IG9mIHRoZSBsaW5lcyBzaG91bGQgY29udGFpbiBmaWxlIG5hbWVzLlxuICAgICAgICAgICAgICAgIGlmIChtYXRjaDIubGVuZ3RoID09IDIgJiYgbWF0Y2gyWzFdKSB7IC8vIHN1YmRpbSBzcGVjaWZpY2F0aW9uXG4gICAgICAgICAgICAgICAgICAgIHJldFttYXRjaFsxXV0gPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmaWxlczogbGluZXMuc2xpY2UoaSsxKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHN1YmRpbTogcGFyc2VOUlJESW50ZWdlcihtYXRjaDJbMV0pXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0W21hdGNoWzFdXSA9IGxpbmVzLnNsa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GVjaWZpY2F0aW9uXG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIGZvcm1hdDogZGF0YUZpbGUuc3Vic3RyaW5nKDAsIG1hdGNoLmluZGV4KSxcbiAgICAgICAgICAgICAgICBtaW46IHBhcnNlTlJSREludGVnZXIobWF0Y2hbMV0pLFxuICAgICAgICAgICAgICAgIG1heDogcGFyc2VOUlJESW50ZWdlcihtYXRjaFsyXSksXG4gICAgICAgICAgICAgICAgc3RlcDogcGFyc2VOUlJESW50ZWdlcihtYXRjaFszXSksXG4gICAgICAgICAgICAgICAgc3ViZGltOiBwYXJzZU5SUkRJbnRlZ2VyKG1hdGNoWzRdKVxuICAgICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgZm9ybWF0OiBkYXRhRmlsZS5zdWJzdHJpbmcoMCwgbWF0Y2guaW5kZXgpLFxuICAgICAgICAgICAgICAgIG1pbjogcGFyc2VOUlJESW50ZWdlcihtYXRjaFsxXSksXG4gICAgICAgICAgICAgICAgbWF4OiBwYXJzZU5SUkRJbnRlZ2VyKG1hdGNoWzJdKSxcbiAgICAgICAgICAgICAgICBzdGVwOiBwYXJzZU5SUkRJbnRlZ2VyKG1hdGNoWzNdKVxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgIH0gZWxzZSB7IC8vIEp1c3QgYSBmaWxlXG4gICAgICAgIHJldHVybiBkYXRhRmlsZTtcbiAgICB9XG59XG5cbmZ1bmN0aW9uIHNlcmlhbGl6ZU5SUkREYXRhRmlsZShkYXRhRmlsZSkge1xuICAgIGlmICgodHlwZW9mIGRhdGFGaWxlKSA9PSBcInN0cmluZ1wiIHx8IGRhdGFGaWxlIGluc3RhbmNlb2YgU3RyaW5nKSB7XG4gICAgICAgIHJldHVybiBkYXRhRmlsZTtcbiAgICB9IGVsc2UgaWYgKCdmb3JtYXQnIGluIGRhdGFGaWxlICYmICdtaW4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3lzdGVtRW5kaWFubmVzcykge1xuICAgICAgICBzd2l0Y2godHlwZSkge1xuICAgICAgICBjYXNlIFwiaW50OFwiOlxuICAgICAgICAgICAgY2hlY2tTaXplKDEpO1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBJbnQ4QXJyYXkoYnVmZmVyLnNsaWNlKDAsdG90YWxMZW4pKTtcbiAgICAgICAgY2FzZSBcInVpbnQ4XCI6XG4gICAgICAgICAgICBjaGVja1NpemUoMSk7XG4gICAgICAgICAgICByZXR1cm4gbmV3IFVpbnQ4QXJyYXkoYnVmZmVyLnNsaWNlKDAsdG90YWxMZW4pKTtcbiAgICAgICAgY2FzZSBcImludDE2XCI6XG4gICAgICAgICAgICBjaGVja1NpemUoMik7XG4gICAgICAgICAgICByZXR1cm4gbmV3IEludDE2QXJyYXkoYnVmZmVyLnNsaWNlKDAsdG90YWxMZW4qMikpO1xuICAgICAgICBjYXNlIFwidWludDE2XCI6XG4gICAgICAgICAgICBjaGVja1NpemUoMik7XG4gICAgICAgICAgICByZXR1cm4gbmV3IFVpbnQxNkFycmF5KGJ1ZmZlci5zbGljZSgwLHRvdGFsTGVuKjIpKTtcbiAgICAgICAgY2FzZSBcImludDMyXCI6XG4gICAgICAgICAgICBjaGVja1NpemUoNCk7XG4gICAgICAgICAgICByZXR1cm4gbmV3IEludDMyQXJyYXkoYnVmZmVyLnNsaWNlKDAsdG90YWxMZW4qNCkpO1xuICAgICAgICBjYXNlIFwidWludDMyXCI6XG4gICAgICAgICAgICBjaGVja1NpemUoNCk7XG4gICAgICAgICAgICByZXR1cm4gbmV3IFVpbnQzMkFycmF5KGJ1ZmZlci5zbGljZSgwLHRvdGFsTGVuKjQpKTtcbiAgICAgICAgLy9jYXNlIFwiaW50NjRcIjpcbiAgICAgICAgLy8gICAgY2hlY2tTaXplKDgpO1xuICAgICAgICAvLyAgICByZXR1cm4gbmV3IEludDY0QXJyYXkoYnVmZmVyLnNsaWNlKDAsdG90YWxMZW4qOCkpO1xuICAg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G4gICAgICAgIH1cbiAgICAgICAgdmlldyA9IG5ldyBEYXRhVmlldyhidWZmZXIpO1xuICAgICAgICBzd2l0Y2godHlwZSkge1xuICAgICAgICBjYXNlIFwiaW50OFwiOiAvLyBOb3RlIHRoYXQgaGVyZSB3ZSBkbyBub3QgbmVlZCB0byBjaGVjayB0aGUgc2l6ZSBvZiB0aGUgYnVmZmVyLCBhcyB0aGUgRGF0YVZpZXcuZ2V0IG1ldGhvZHMgc2hvdWxkIHRocm93IGFuIGV4Y2VwdGlvbiBpZiB3ZSByZWFkIGJleW9uZCB0aGUgYnVmZmVyLlxuICAgICAgICAgICAgYXJyID0gbmV3IEludDhBcnJheSh0b3RhbExlbik7XG4gICAgICAgICAgICBmb3IoaT0wOyBpPHRvdGFsTGVuOyBpKyspIHtcbiAgICAgICAgICAgICAgICBhcnJbaV0gPSB2aWV3LmdldEludDgoaSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gYXJyO1xuICAgICAgICBjYXNlIFwidWludDhcIjpcbiAgICAgICAgICAgIGFyciA9IG5ldyBVaW50OEFycmF5KHRvdGFsTGVuKTtcbiAgICAgICAgICAgIGZvcihpPTA7IGk8dG90YWxMZW47IGkrKykge1xuICAgICAgICAgICAgICAgIGFycltpXSA9IHZpZXcuZ2V0VWludDgoaSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gYXJyO1xuICAgICAgICBjYXNlIFwiaW50MTZcIjpcbiAgICAgICAgICAgIGFyciA9IG5ldyBJbnQxNkFycmF5KHRvdGFsTGVuKTtcbiAgICAgICAgICAgIGZvcihpPTA7IGk8dG90YWxMZW47IGkrKykge1xuICAgICAgICAgICAgICAgIGFycltpXSA9IHZpZXcuZ2V0SW50MTYoaSoyKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBhcnI7XG4gICAgICAgIGNhc2UgXCJ1aW50MTZcIjpcbiAgICAgICAgICAgIGFyciA9IG5ldyBVaW50MTZBcnJheSh0b3RhbExlbik7XG4gICAgICAgICAgICBmb3IoaT0wOyBpPHRvdGFsTGVuOyBpKyspIHtcbiAgICAgICAgICAgICAgICBhcnJbaV0gPSB2aWV3LmdldFVpbnQxNihpKjIpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGFycjtcbiAgICAgICAgY2FzZSBcImludDMyXCI6XG4gICAgICAgICAgICBhcnIgPSBuZXcgSW50MzJBcnJheSh0b3RhbExlbik7XG4gICAgICAgICAgICBmb3IoaT0wOyBpPHRvdGFsTGVuOyBpKyspIHtcbiAgICAgICAgICAgICAgICBhcnJbaV0gPSB2aWV3LmdldEludDMyKGkqNCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gYXJyO1xuICAgICAgICBjYXNlIFwidWludDMyXCI6XG4gICAgICAgICAgICBhcnIgPSBuZXcgVWludDMyQXJyYXkodG90YWxMZW4pO1xuICAgICAgICAgICAgZm9yKGk9MDsgaTx0b3RhbExlbjsgaSsrKSB7XG4gICAgICAgICAgICAgICAgYXJyW2ldID0gdmlldy5nZXRVaW50MzIoaSo0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBhcnI7XG4gICAgICAgIC8vY2FzZSBcImludDY0XCI6XG4gICAgICAgIC8vICAgIGFyciA9IG5ldyBJbnQ2NEFycmF5KHRvdGFsTGVuKTtcbiAgICAgICAgLy8gICAgZm9yKGk9MDsgaTx0b3RhbExlbjsgaSsrKSB7XG4gICAgICAgIC8vICAgICAgICBhcnJbaV0gPSB2aWV3LmdldEludDY0KGkqOCk7XG4gICAgICAgIC8vICAgIH1cbiAgICAgICAgLy8gICAgcmV0dXJuIGFycjtcbiAgICAgICAgLy9jYXNlIFwidWludDY0XCI6XG4gICAgICAgIC8vICAgIGFyciA9IG5ldyBVaW50NjRBcnJheSh0b3RhbExlbik7XG4gICAgICAgIC8vICAgIGZvcihpPTA7IGk8dG90YWxMZW47IGkrKykge1xuICAgICAgICAvLyAgICAgICAgYXJyW2ldID0gdmlldy5nZXRVaW50NjQoaSo4KTtcbiAgICAgICAgLy8gICAgfVxuICAgICAgICAvLyAgICByZXR1cm4gYXJyO1xuICAgICAgICBjYXNlIFwiZmxvYXRcIjpcbiAgICAgICAgICAgIGFyciA9IG5ldyBGbG9hdDMyQXJyYXkodG90YWxMZW4pO1xuICAgICAgICAgICAgZm9yKGk9MDsgaTx0b3RhbExlbjsgaSsrKSB7XG4gICAgICAgICAgICAgICAgYXJyW2ldID0gdmlldy5nZXRGbG9hdDMyKGkqNCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gYXJyO1xuICAgICAgICBjYXNlIFwiZG91YmxlXCI6XG4gICAgICAgICAgICBhcnIgPSBuZXcgRmxvYXQ2NEFycmF5KHRvdGFsTGVuKTtcbiAgICAgICAgICAgIGZvcihpPTA7IGk8dG90YWxMZW47IGkrKykge1xuICAgICAgICAgICAgICAgIGFycltpXSA9IHZpZXcuZ2V0RmxvYXQ2NChpKjgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGFycjtcbiAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIGNvbnNvbGUud2FybihcIlVuc3VwcG9ydGVkIE5SUkQgdHlwZTogXCIgKyB0eXBlICsgXCIsIHJldHVybmluZyByYXcgYnVmZmVyLlwiKTtcbiAgICAgICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG4gICAgICAgIH1cbiAgICB9XG4gICAgZnVuY3Rpb24gY2hlY2tTaXplKHNpemVPZlR5cGUpIHtcbiAgICAgICAgaWYgKGJ1ZmZlci5ieXRlTGVuZ3RoPHRvdGFsTGVuKnNpemVPZlR5cGUpIHRocm93IG5ldyBFcnJvcihcIk5SUkQgZmlsZSBkb2VzIG5vdCBjb250YWluIGVub3VnaCBkYXRhIVwiKTtcbiAgICB9XG59XG5cbnZhciB3aGl0ZXNwYWNlRGF0YVZhbHVlTGlzdFNlcGFyYXRvclJ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ZWZsYXRlLCBpbmZsYXRlLCBjb25zdGFudHMpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IHBha287XG4iLCIndXNlIHN0cmljdCc7XG5cblxudmFyIHpsaWJfZGVmbGF0ZSA9IHJlcXVpcmUoJy4vemxpYi9kZWZsYXRlJyk7XG52YXIgdXRpbHMgICAgICAgID0gcmVxdWlyZSgnLi91dGlscy9jb21tb24nKTtcbnZhciBzdHJpbmdzICAgICAgPSByZXF1aXJlKCcuL3V0aWxzL3N0cmluZ3MnKTtcbnZhciBtc2cgICAgICAgICAgPSByZXF1aXJlKCcuL3psaWIvbWVzc2FnZXMnKTtcbnZhciBaU3RyZWFtICAgICAgPSByZXF1aXJlKCcuL3psaWIvenN0cmVhbScpO1xuXG52YXIgdG9TdHJpbmcgPSBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nO1xuXG4vKiBQdWJsaWMgY29uc3RhbnRzID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cblxudmFyIFpfTk9fRkxVU0ggICAgICA9IDA7XG52YXIgWl9GSU5JU0ggICAgICAgID0gNDtcblxudmFyIFpfT0sgICAgICAgICAgICA9IDA7XG52YXIgWl9TVFJFQU1fRU5EICAgID0gMTtcbnZhciBaX1NZTkNfRkxVU0ggICAgPSAyO1xuXG52YXIgWl9ERUZBVUxUX0NPTVBSRVNTSU9OID0gLTE7XG5cbnZhciBaX0RFRkFVTFRfU1RSQVRFR1kgICAgPSAwO1xuXG52YXIgWl9ERUZMQVRFRCAgPSA4O1xuXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuXG5cbi8qKlxuICogY2xhc3MgRGVmbGF0ZVxuICpcbi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plID8gbSAtIF93X3NpemUgOiAwKTtcbiAgICAgIH0gd2hpbGUgKC0tbik7XG5cbiAgICAgIG4gPSBfd19zaXplO1xuICAgICAgcCA9IG47XG4gICAgICBkbyB7XG4gICAgICAgIG0gPSBzLnByZXZbLS1wXTtcbiAgICAgICAgcy5wcmV2W3BdID0gKG0gPj0gX3dfc2l6ZSA/IG0gLSBfd19zaXplIDogMCk7XG4gICAgICAgIC8qIElmIG4gaXMgbm90IG9uIGFueSBoYXNoIGNoYWluLCBwcmV2W25dIGlzIGdhcmJhZ2UgYnV0XG4gICAgICAgICAqIGl0cyB2YWx1ZSB3aWxsIG5ldmVyIGJlIHVzZWQuXG4gICAgICAgICAqL1xuICAgICAgfSB3aGlsZSAoLS1uKTtcblxuICAgICAgbW9yZSArPSBfd19zaXplO1xuICAgIH1cbiAgICBpZiAocy5zdHJtLmF2YWlsX2luID09PSAwKSB7XG4gICAgICBicmVhaztcbiAgICB9XG5cbiAgICAvKiBJZiB0aGVyZSB3YXMgbm8gc2xpZGluZzpcbiAgICAgKiAgICBzdHJzdGFydCA8PSBXU0laRStNQVhfRElTVC0xICYmIGxvb2thaGVhZCA8PSBNSU5fTE9PS0FIRUFEIC0gMSAmJlxuICAgICAqICAgIG1vcmUgPT0gd2luZG93X3NpemUgLSBsb29rYWhlYWQgLSBzdHJzdGFydFxuICAgICAqID0+IG1vcmUgPj0gd2luZG93X3NpemUgLSAoTUlOX0xPT0tBSEVBRC0xICsgV1NJWkUgKyBNQVhfRElTVC0xKVxuICAgICAqID0+IG1vcmUgPj0gd2luZG93X3NpemUgLSAyKldTSVpFICsgMlxuICAgICAqIEluIHRoZSBCSUdfTUVNIG9yIE1NQVAgY2FzZSAobm90IHlldCBzdXBwb3J0ZWQpLFxuICAgICAqICAgd2luZG93X3NpemUgPT0gaW5wdXRfc2l6ZSArIE1JTl9MT09LQUhFQUQgICYmXG4gICAgICogICBzdHJzdGFydCArIHMtPmxvb2thaGVhZCA8PSBpbnB1dF9zaXplID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gaWYgKCFzLmd6aGVhZCkgeyAvLyBzLT5nemhlYWQgPT0gWl9OVUxMXG4gICAgICAgIHB1dF9ieXRlKHMsIDApO1xuICAgICAgICBwdXRfYnl0ZShzLCAwKTtcbiAgICAgICAgcHV0X2J5dGUocywgMCk7XG4gICAgICAgIHB1dF9ieXRlKHMsIDApO1xuICAgICAgICBwdXRfYnl0ZShzLCAwKTtcbiAgICAgICAgcHV0X2J5dGUocywgcy5sZXZlbCA9PT0gOSA/IDIgOlxuICAgICAgICAgICAgICAgICAgICAocy5zdHJhdGVneSA+PSBaX0hVRkZNQU5fT05MWSB8fCBzLmxldmVsIDwgMiA/XG4gICAgICAgICAgICAgICAgICAgICA0IDogMCkpO1xuICAgICAgICBwdXRfYnl0ZShzLCBPU19DT0RFKTtcbiAgICAgICAgcy5zdGF0dXMgPSBCVVNZX1NUQVRFO1xuICAgICAgfVxuICAgICAgZWxzZSB7XG4gICAgICAgIHB1dF9ieXRlKHMsIChzLmd6aGVhZC50ZXh0ID8gMSA6IDApICtcbiAgICAgICAgICAgICAgICAgICAgKHMuZ3poZWFkLmhjcmMgPyAyIDogMCkgK1xuICAgICAgICAgICAgICAgICAgICAoIXMuZ3poZWFkLmV4dHJhID8gMCA6IDQpICtcbiAgICAgICAgICAgICAgICAgICAgKCFzLmd6aGVhZC5uYW1lID8gMCA6IDgpICtcbiAgICAgICAgICAgICAgICAgICAgKCFzLmd6aGVhZC5jb21tZW50ID8gMCA6IDE2KVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgIHB1dF9ieXRlKHMsIHMuZ3poZWFkLnRpbWUgJiAweGZmKTtcbiAgICAgICAgcHV0X2J5dGUocywgKHMuZ3poZWFkLnRpbWUgPj4gOCkgJiAweGZmKTtcbiAgICAgICAgcHV0X2J5dGUocywgKHMuZ3poZWFkLnRpbWUgPj4gMTYpICYgMHhmZik7XG4gICAgICAgIHB1dF9ieXRlKHMsIChzLmd6aGVhZC50aW1lID4+IDI0KSAmIDB4ZmYpO1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pbnQgdmFsO1xuXG4gICAgICBkbyB7XG4gICAgICAgIGlmIChzLnBlbmRpbmcgPT09IHMucGVuZGluZ19idWZfc2l6ZSkge1xuICAgICAgICAgIGlmIChzLmd6aGVhZC5oY3JjICYmIHMucGVuZGluZyA+IGJlZykge1xuICAgICAgICAgICAgc3RybS5hZGxlciA9IGNyYzMyKHN0cm0uYWRsZXIsIHMucGVuZGluZ19idWYsIHMucGVuZGluZyAtIGJlZywgYmVnKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgZmx1c2hfcGVuZGluZyhzdHJtKTtcbiAgICAgICAgICBiZWcgPSBzLnBlbmRpbmc7XG4gICAgICAgICAgaWYgKHMucGVuZGluZyA9PT0gcy5wZW5kaW5nX2J1Zl9zaXplKSB7XG4gICAgICAgICAgICB2YWwgPSAxO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIEpTIHNwZWNpZmljOiBsaXR0bGUgbWFnaWMgdG8gYWRkIHplcm8gdGVybWluYXRvciB0byBlbmQgb2Ygc3RyaW5nXG4gICAgICAgIGlmIChzLmd6aW5kZXggPCBzLmd6aGVhZC5uYW1lLmxlbmd0aCkge1xuICAgICAgICAgIHZhbCA9IHMuZ3poZWFkLm5hbWUuY2hhckNvZGVBdChzLmd6aW5kZXgrKykgJiAweGZmO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHZhbCA9IDA7XG4gICAgICAgIH1cbiAgICAgICAgcHV0X2J5dGUocywgdmFsKTtcbiAgICAgIH0gd2hpbGUgKHZhbCAhPT0gMCk7XG5cbiAgICAgIGlmIChzLmd6aGVhZC5oY3JjICYmIHMucGVuZGluZyA+IGJlZykge1xuICAgICAgICBzdHJtLmFkbGVyID0gY3JjMzIoc3RybS5hZGxlciwgcy5wZW5kaW5nX2J1Ziwgcy5wZW5kaW5nIC0gYmVnLCBiZWcpO1xuICAgICAgfVxuICAgICAgaWYgKHZhbCA9PT0gMCkge1x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GV2ZW50cy5cbiAqL1xudmFyIFpfT0sgICAgICAgICAgICA9IDA7XG52YXIgWl9TVFJFQU1fRU5EICAgID0gMTtcbnZhciBaX05FRURfRElDVCAgICAgPSAyO1xuLy92YXIgWl9FUlJOTyAgICAgICAgID0gLTE7XG52YXIgWl9TVFJFQU1fRVJST1IgID0gLTI7XG52YXIgWl9EQVRBX0VSUk9SICAgID0gLTM7XG52YXIgWl9NRU1fRVJST1IgICAgID0gLTQ7XG52YXIgWl9CVUZfRVJST1IgICAgID0gLTU7XG4vL3ZhciBaX1ZFUlNJT05fRVJST1IgPSAtNjtcblxuLyogVGhlIGRlZmxhdGUgY29tcHJlc3Npb24gbWV0aG9kICovXG52YXIgWl9ERUZMQVRFRCAgPSA4O1xuXG5cbi8qIFNUQVRFUyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuXG5cbnZhciAgICBIRUFEID0gMTsgICAgICAgLyogaTogd2FpdGluZyBmb3IgbWFnaWMgaGVhZGVyICovXG52YXIgICAgRkxBR1MgPSAyOyAgICAgIC8qIGk6IHdhaXRpbmcgZm9yIG1ldGhvZCBhbmQgZmxhZ3MgKGd6aXApICovXG52YXIgICAgVElNRSA9IDM7ICAgICAgIC8qIGk6IHdhaXRpbmcgZm9yIG1vZGlmaWNhdGlvbiB0aW1lIChnemlwKSAqL1xudmFyICAgIE9TID0gNDsgICAgICAgICAvKiBpOiB3YWl0aW5nIGZvciBleHRyYSBmbGFncyBhbmQgb3BlcmF0aW5nIHN5c3RlbSAoZ3ppcCkgKi9cbnZhciAgICBFWExFTiA9IDU7ICAgICAgLyogaTogd2FpdGluZyBmb3IgZXh0cmEgbGVuZ3RoIChnemlwKSAqL1xudmFyICAgIEVYVFJBID0gNjsgICAgICAv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uYWwgc2l6ZSBjaGVja1xuICAgICAgICAgICAgICBjb3B5LFxuICAgICAgICAgICAgICAvKmxlbiArIGNvcHkgPiBzdGF0ZS5oZWFkLmV4dHJhX21heCAtIGxlbiA/IHN0YXRlLmhlYWQuZXh0cmFfbWF4IDogY29weSwqL1xuICAgICAgICAgICAgICBsZW5cbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICAvL3ptZW1jcHkoc3RhdGUuaGVhZC5leHRyYSArIGxlbiwgbmV4dCxcbiAgICAgICAgICAgIC8vICAgICAgICBsZW4gKyBjb3B5ID4gc3RhdGUuaGVhZC5leHRyYV9tYXggP1xuICAgICAgICAgICAgLy8gICAgICAgIHN0YXRlLmhlYWQuZXh0cmFfbWF4IC0gbGVuIDogY29weSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChzdGF0ZS5mbGFncyAmIDB4MDIwMCkge1xuICAgICAgICAgICAgc3RhdGUuY2hlY2sgPSBjcmMzMihzdGF0ZS5jaGVjaywgaW5wdXQsIGNvcHksIG5leHQpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBoYXZlIC09IGNvcHk7XG4gICAgICAgICAgbmV4dCArPSBjb3B5O1xuICAgICAgICAgIHN0YXRlLmxlbmd0aCAtPSBjb3B5O1xuICAgICAgICB9XG4gICAgICAgIGlmIChzdGF0ZS5sZW5ndGgpIHsgYnJlYWsgaW5mX2xlYXZlOyB9XG4gICAgICB9XG4gICAgICBzdGF0ZS5sZW5ndGggPSAwO1xuICAgICAgc3RhdGUubW9kZSA9IE5BTUU7XG4gICAgICAvKiBmYWxscyB0aHJvdWdoICovXG4gICAgY2FzZSBOQU1FOlxuICAgICAgaWYgKHN0YXRlLmZsYWdzICYgMHgwODAwKSB7XG4gICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICBjb3B5ID0gMDtcbiAgICAgICAgZG8ge1xuICAgICAgICAgIC8vIFRPRE86IDIgb3IgMSBieXRl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ZS0tO1xuICAgICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICAgIGJpdHMgKz0gODtcbiAgICAgICAgfVxuICAgICAgICAvLz09PS8vXG4gICAgICAgIGlmIChob2xkICE9PSAoc3RhdGUuY2hlY2sgJiAweGZmZmYpKSB7XG4gICAgICAgICAgc3RybS5tc2cgPSAnaGVhZGVyIGNyYyBtaXNtYXRjaCc7XG4gICAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICAvLz09PSBJTklUQklUUygpO1xuICAgICAgICBob2xkID0gMDtcbiAgICAgICAgYml0cyA9IDA7XG4gICAgICAgIC8vPT09Ly9cbiAgICAgIH1cbiAgICAgIGlmIChzdGF0ZS5oZWFkKSB7XG4gICAgICAgIHN0YXRlLmhlYWQuaGNyYyA9ICgoc3RhdGUuZmxhZ3MgPj4gOSkgJiAxKTtcbiAgICAgICAgc3RhdGUuaGVhZC5kb25lID0gdHJ1ZTtcbiAgICAgIH1cbiAgICAgIHN0cm0uYWRsZXIgPSBzdGF0ZS5jaGVjayA9IDA7XG4gICAgICBzdGF0ZS5tb2RlID0gVFlQRTtcbiAgICAgIGJyZWFrO1xuICAgIGNhc2UgRElDVElEOlxuICAgICAgLy89PT0gTkVFREJJVFMoMzIpOyAqL1xuICAgICAgd2hpbGUgKGJpdHMgPCAzMikge1xuICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgaGF2ZS0tO1xuICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgYml0cyArPSA4O1xuICAgICAgfVxuICAgICAgLy89PT0vL1xuICAgICAgc3RybS5hZGxlciA9IHN0YXRlLmNoZWNrID0genN3YXAzMihob2xkKTtcbiAgICAgIC8vPT09IElOSVRCSVRTKCk7XG4gICAgICBob2xkID0gMDtcbiAg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IC8qIGRlY29kZSBjb2RlcyAqL1xuICAgICAgICBpZiAoZmx1c2ggPT09IFpfVFJFRVMpIHtcbiAgICAgICAgICAvLy0tLSBEUk9QQklUUygyKSAtLS0vL1xuICAgICAgICAgIGhvbGQgPj4+PSAyO1xuICAgICAgICAgIGJpdHMgLT0gMjtcbiAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgYnJlYWsgaW5mX2xlYXZlO1xuICAgICAgICB9XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAyOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZHluYW1pYyBibG9jayAqL1xuICAgICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgICBkeW5hbWljIGNvZGVzIGJsb2NrJXNcXG5cIixcbiAgICAgICAgLy8gICAgICAgIHN0YXRlLmxhc3QgPyBcIiAobGFzdClcIiA6IFwiXCIpKTtcbiAgICAgICAgc3RhdGUubW9kZSA9IFRBQkxFO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgMzpcbiAgICAgICAgc3RybS5tc2cgPSAnaW52YWxpZCBibG9jayB0eXBlJztcbiAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgIH1cbiAgICAgIC8vLS0tIERST1BCSVRTKDIpIC0tLS8vXG4gICAgICBob2xkID4+Pj0gMjtcbiAgICAgIGJpdHMgLT0gMjtcbiAgICAgIC8vLS0tLy9cbiAgICAgIGJyZWFrO1xuICAgIGNhc2UgU1RPUkVEOlxuICAgICAgLy8tLS0gQllURUJJVFMoKSAtLS0vLyAvKiBnbyB0byBieXRlIGJvdW5kYXJ5ICovXG4gICAgICBob2xkID4+Pj0gYml0cyAmIDc7XG4gICAgICBiaXRzIC09IGJpdHMgJiA3O1xuICAgICAgLy8tLS0vL1xuICAgICAgLy89PT0gTkVFREJJVFMoMzIpOyAqL1xuICAgICAgd2hpbGUgKGJpdHMgPCAzMikge1xuICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgaGF2ZS0tO1xuICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgYml0cyArPSA4O1xuICAgICAgfVxuICAgICAgLy89PT0vL1xuICAgICAgaWYgKChob2xkICYgMHhmZmZmKSAhPT0gKChob2xkID4+PiAxNikgXiAweGZmZmYpKSB7XG4gICAgICAgIHN0cm0ubXNnID0gJ2ludmFsaWQgc3RvcmVkIGJsb2NrIGxlbmd0aHMnO1xuICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICBicmVhaztcbiAgICAgIH1cbiAgICAgIHN0YXRlLmxlbmd0aCA9IGhvbGQgJiAweGZmZmY7XG4gICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgICAgIHN0b3JlZCBsZW5ndGggJXVcXG5cIixcbiAgICAgIC8vICAgICAgICBzdGF0ZS5sZW5ndGgpKTtcbiAgICAgIC8vPT09IElOSVRCSVRTKCk7XG4gICAgICBob2xkID0gMDtcbiAgICAgIGJpdHMgPSAwO1xuICAgICAgLy89PT0vL1xuICAgICAgc3RhdGUubW9kZSA9IENPUFlfO1xuICAgICAgaWYgKGZsdXNoID09PSBaX1RSRUVTKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgLyogZmFsbHMgdGhyb3VnaCAqL1xuICAgIGNhc2UgQ09QWV86XG4gICAgICBzdGF0ZS5tb2RlID0gQ09QWTtcbiAgICAgIC8qIGZhbGxzIHRocm91Z2ggKi9cbiAgICBjYXNlIENPUFk6XG4gICAgICBjb3B5ID0gc3RhdGUubGVuZ3RoO1xuICAgICAgaWYgKGNvcHkpIHtcbiAgICAgICAgaWYgKGNvcHkgPiBoYXZlKSB7IGNvcHkgPSBoYXZlOyB9XG4gICAgICAgIGlmIChjb3B5ID4gbGVmdCkgeyBjb3B5ID0gbGVmdDsgfVxuICAgICAgICBpZiAoY29weSA9PT0gMCkg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ICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICBpZiAoaGVyZV92YWwgPT09IDE2KSB7XG4gICAgICAgICAgICAvLz09PSBORUVEQklUUyhoZXJlLmJpdHMgKyAyKTtcbiAgICAgICAgICAgIG4gPSBoZXJlX2JpdHMgKyAyO1xuICAgICAgICAgICAgd2hpbGUgKGJpdHMgPCBuKSB7XG4gICAgICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgICAgICBoYXZlLS07XG4gICAgICAgICAgICAgIGhvbGQgKz0gaW5wdXRbbmV4dCsrXSA8PCBiaXRzO1xuICAgICAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLz09PS8vXG4gICAgICAgICAgICAvLy0tLSBEUk9QQklUUyhoZXJlLmJpdHMpIC0tLS8vXG4gICAgICAgICAgICBob2xkID4+Pj0gaGVyZV9iaXRzO1xuICAgICAgICAgICAgYml0cyAtPSBoZXJlX2JpdHM7XG4gICAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgICBpZiAoc3RhdGUuaGF2ZSA9PT0gMCkge1xuICAgICAgICAgICAgICBzdHJtLm1zZyA9ICdpbnZhbGlkIGJpdCBsZW5ndGggcmVwZWF0JztcbiAgICAgICAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZW4gPSBzdGF0ZS5sZW5zW3N0YXRlLmhhdmUgLSAxXTtcbiAgICAgICAgICAgIGNvcHkgPSAzICsgKGhvbGQgJiAweDAzKTsvL0JJVFMoMik7XG4gICAgICAgICAgICAvLy0tLSBEUk9QQklUUygyKSAtLS0vL1xuICAgICAgICAgICAgaG9sZCA+Pj49IDI7XG4gICAgICAgICAgICBiaXRzIC09IDI7XG4gICAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgfVxuICAgICAgICAgIGVsc2UgaWYgKGhlcmVfdmFsID09PSAxNykge1xuICAgICAgICAgICAgLy89PT0gTkVFREJJVFMoaGVyZS5iaXRzICsgMyk7XG4gICAgICAgICAgICBuID0gaGVyZV9iaXRzICsgMztcbiAgICAgICAgICAgIHdoaWxlIChiaXRzIDwgbikge1xuICAgICAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICAgICAgaGF2ZS0tO1xuICAgICAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy89PT0vL1xuICAgICAgICAgICAgLy8tLS0gRFJPUEJJVFMoaGVyZS5iaXRzKSAtLS0vL1xuICAgICAgICAgICAgaG9sZCA+Pj49IGhlcmVfYml0cztcbiAgICAgICAgICAgIGJpdHMgLT0gaGVyZV9iaXRzO1xuICAgICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgICAgbGVuID0gMDtcbiAgICAgICAgICAgIGNvcHkgPSAzICsgKGhvbGQgJiAweDA3KTsvL0JJVFMoMyk7XG4gICAgICAgICAgICAvLy0tLSBEUk9QQklUUygzKSAtLS0vL1xuICAgICAgICAgICAgaG9sZCA+Pj49IDM7XG4gICAgICAgICAgICBiaXRzIC09IDM7XG4gICAgICAgICAgICAvLy0tLS8vXG4gICAgICAgICAgfVxuICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgLy89PT0gTkVFREJJVFMoaGVyZS5iaXRzICsgNyk7XG4gICAgICAgICAgICBuID0gaGVyZV9iaXRzICsgNztcbiAgICAgICAgICAgIHdoaWxlIChiaXRzIDwgbikge1xuICAgICAgICAgICAgICBpZiAoaGF2ZSA9PT0gMCkgeyBicmVhayBpbmZfbGVhdmU7IH1cbiAgICAgICAgICAgICAgaGF2ZS0tO1xuICAgICAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICAgICAgYml0cyArPSA4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy89PT0vL1xuICAgICAgICAgICAgLy8tLS0gRFJPUEJJVFMoaGVyZS5iaXRzKSAtLS0vL1xuICAgICAgICAgICAgaG9sZCA+Pj49IGhlcmVfYml0cztcbiAgICAgICAgICAgIGJpdHMgLT0gaGVyZV9iaXRzO1xuICAgICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgICAgbGVuID0gMDtcbiAgICAgICAgICAgIGNvcHkgPSAxMSArIChob2xkICYgMHg3Zik7Ly9CSVRTKDcpO1xuICAgICAgICAgICAgLy8tLS0gRFJPUEJJVFMoNykgLS0tLy9cbiAgICAgICAgICAgIGhvbGQgPj4+PSA3O1xuICAgICAgICAgICAgYml0cyAtPSA3O1xuICAgICAgICAgICAgLy8tLS0vL1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoc3RhdGUuaGF2ZSArIGNvcHkgPiBzdGF0ZS5ubGVuICsgc3RhdGUubmRpc3QpIHtcbiAgICAgICAgICAgIHN0cm0ubXNnID0gJ2ludmFsaWQgYml0IGxlbmd0aCByZXBlYXQnO1xuICAgICAgICAgICAgc3RhdGUubW9kZSA9IEJBRDtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cbiAgICAgICAgICB3aGlsZSAoY29weS0tKSB7XG4gICAgICAgICAgICBzdGF0ZS5sZW5zW3N0YXRlLmhhdmUrK10gPSBsZW47XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIC8qIGhhbmRsZSBlcnJvciBicmVha3MgaW4gd2hpbGUgKi9cbiAgICAgIGlmIChzdGF0ZS5tb2RlID09PSBCQUQpIHsgYnJlYWs7IH1cblxuICAgICAgLyogY2hlY2sgZm9yIGVuZC1vZi1ibG9jayBjb2RlIChiZXR0ZXIgaGF2ZSBvbmUpICovXG4gICAgICBpZiAoc3RhdGUubGVuc1syNTZdID09PSAw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yKTtcbiAgICAgICAgd2hpbGUgKGJpdHMgPCAzMikge1xuICAgICAgICAgIGlmIChoYXZlID09PSAwKSB7IGJyZWFrIGluZl9sZWF2ZTsgfVxuICAgICAgICAgIGhhdmUtLTtcbiAgICAgICAgICBob2xkICs9IGlucHV0W25leHQrK10gPDwgYml0cztcbiAgICAgICAgICBiaXRzICs9IDg7XG4gICAgICAgIH1cbiAgICAgICAgLy89PT0vL1xuICAgICAgICBpZiAoaG9sZCAhPT0gKHN0YXRlLnRvdGFsICYgMHhmZmZmZmZmZikpIHtcbiAgICAgICAgICBzdHJtLm1zZyA9ICdpbmNvcnJlY3QgbGVuZ3RoIGNoZWNrJztcbiAgICAgICAgICBzdGF0ZS5tb2RlID0gQkFEO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIC8vPT09IElOSVRCSVRTKCk7XG4gICAgICAgIGhvbGQgPSAwO1xuICAgICAgICBiaXRzID0gMDtcbiAgICAgICAgLy89PT0vL1xuICAgICAgICAvL1RyYWNldigoc3RkZXJyLCBcImluZmxhdGU6ICAgbGVuZ3RoIG1hdGNoZXMgdHJhaWxlclxcblwiKSk7XG4gICAgICB9XG4gICAgICBzdGF0ZS5tb2RlID0gRE9ORTtcbiAgICAgIC8qIGZhbGxzIHRocm91Z2ggKi9cbiAgICBjYXNlIERPTkU6XG4gICAgICByZXQgPSBaX1NUUkVBTV9FTkQ7XG4gICAgICBicmVhayBpbmZfbGVhdmU7XG4gICAgY2FzZSBCQUQ6XG4gICAgICByZXQgPSBaX0RBVEFfRVJST1I7XG4gICAgICBicmVhayBpbmZfbGVhdmU7XG4gICAgY2FzZSBNRU06XG4gICAgICByZXR1cm4gWl9NRU1fRVJST1I7XG4gICAgY2FzZSBTWU5DOlxuICAgICAgLyogZmFsbHMgdGhyb3VnaCAqL1xuICAgIGRlZmF1bHQ6XG4gICAgICByZXR1cm4gWl9TVFJFQU1fRVJST1I7XG4gICAgfVxuICB9XG5cbiAgLy8gaW5m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jksIDY0LCA2NFxuXTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiBpbmZsYXRlX3RhYmxlKHR5cGUsIGxlbnMsIGxlbnNfaW5kZXgsIGNvZGVzLCB0YWJsZSwgdGFibGVfaW5kZXgsIHdvcmssIG9wdHMpXG57XG4gIHZhciBiaXRzID0gb3B0cy5iaXRzO1xuICAgICAgLy9oZXJlID0gb3B0cy5oZXJlOyAvKiB0YWJsZSBlbnRyeSBmb3IgZHVwbGljYXRpb24gKi9cblxuICB2YXIgbGVuID0gMDsgICAgICAgICAgICAgICAvKiBhIGNvZGUncyBsZW5ndGggaW4gYml0cyAqL1xuICB2YXIgc3ltID0gMDsgICAgICAgICAgICAgICAvKiBpbmRleCBvZiBjb2RlIHN5bWJvbHMgKi9cbiAgdmFyIG1pbiA9IDAsIG1heCA9IDA7ICAgICAgICAgIC8qIG1pbmltdW0gYW5kIG1heGltdW0gY29kZSBsZW5ndGhzICovXG4gIHZhciByb290ID0gMDsgICAgICAgICAgICAgIC8qIG51bWJlciBvZiBpbmRleCBiaXRzIGZvciByb290IHRhYmxlICovXG4gIHZhciBjdXJyID0gMDsgICAgICAgICAgICAgIC8qIG51bWJlciBvZiBpbmRleCBiaXRzIGZvciBjdXJyZW50IHRhYmxlICovXG4gIHZhciBkcm9wID0gMDsgICAgICAgICAgICAgIC8qIGNvZGUgYml0cyB0byBkcm9wIGZvciBzdWItdGFibGUgKi9cbiAgdmFyIGxlZnQgPSAwOyAgICAgICAgICAgICAgICAgICAvKiBudW1iZXIgb2YgcHJlZml4IGNvZGVzIGF2YWlsYWJsZSAqL1xuICB2YXIgdXNlZCA9IDA7ICAgICAgICAgICAgICAvKiBjb2RlIGVudHJpZXMgaW4gdGFibGUgdXNlZCAqL1xuICB2YXIgaHVmZiA9IDA7ICAgICAgICAgICAgICAvKiBIdWZmbWFuIGNvZGUgKi9cbiAgdmFyIGluY3I7ICAgICAgICAgICAgICAvKiBmb3IgaW5jcmVtZW50aW5nI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GRyb3A7XG4gICAgLy90YWJsZS52YWxbbmV4dCArIGh1ZmZdID0gMDtcbiAgICB0YWJsZVtuZXh0ICsgaHVmZl0gPSAoKGxlbiAtIGRyb3ApIDw8IDI0KSB8ICg2NCA8PCAxNikgfDA7XG4gIH1cblxuICAvKiBzZXQgcmV0dXJuIHBhcmFtZXRlcnMgKi9cbiAgLy9vcHRzLnRhYmxlX2luZGV4ICs9IHVzZWQ7XG4gIG9wdHMuYml0cyA9IHJvb3Q7XG4gIHJldHVybiAwO1xufTtcbiIsIid1c2Ugc3RyaWN0JztcblxubW9kdWxlLmV4cG9ydHMgPSB7XG4gIDI6ICAgICAgJ25lZWQgZGljdGlvbmFyeScsICAgICAvKiBaX05FRURfRElDVCAgICAgICAyICAqL1xuICAxOiAgICAgICdzdHJlYW0gZW5kJywgICAgICAgICAgLyogWl9TVFJFQU1fRU5EICAgICAgMSAgKi9cbiAgMDogICAgICAnJywgICAgICAgICAgICAgICAgICAgIC8qIFpfT0sgICAgICAgICAgICAgIDAgICovXG4gICctMSc6ICAgJ2ZpbGUgZXJyb3InLCAgICAgICAgICAvKiBaX0VSUk5PICAgICAgICAgKC0xKSAqL1xuICAnLTInOiAgICdzdHJlYW0gZXJyb3InLCAgICAgICAgLyogWl9TVFJFQU1fRVJST1IgICgtMikgKi9cbiAgJy0zJzogICAnZGF0YSBlcnJvcicsICAgICAgICAgIC8qIFpfREFUQV9FUlJPUiAgICAoLTMpICovXG4gICctNCc6ICAgJ2luc3VmZmljaWVudCBtZW1vcnknLCAvKiBaX01FTV9FUlJPUiAgICAgKC00KSAqL1xuICAnLTUnOiAgICdidWZmZXIgZXJyb3InLCAgICAgICAgLyogWl9CVUZfRVJST1IgICAgICgtNSkgKi9cbiAgJy02JzogICAnaW5jb21wYXRpYmxlIHZlcnNpb24nIC8qIFpfVkVSU0lPTl9FUlJPUiAoLTYpICovXG59O1xuIiwiJ3VzZSBzdHJpY3QnO1xuXG5cbnZhciB1dGlscyA9IHJlcXVpcmUoJy4uL3V0aWxzL2NvbW1vbicpO1xuXG4vKiBQdWJsaWMgY29uc3RhbnRzID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qL1xuLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cblxuXG4vL3ZhciBaX0ZJTFRFUkVEICAgICAgICAgID0gMTtcbi8vdmFyIFpfSFVGRk1BTl9PTkxZICAgICAgPSAyO1xuLy92YXIgWl9STEUgICAgICAgICAgICAgICA9IDM7XG52YXIgWl9GSVhFRCAgICAgICAgICAgICAgID0gNDtcbi8vdmFyIFpfREVGQVVMVF9TVFJBVEVHWSAgPSAwO1xuXG4vKiBQb3NzaWJsZSB2YWx1ZXMgb2YgdGhlIGRhdGFfdHlwZSBmaWVsZCAodGhvdWdoIHNlZSBpbmZsYXRlKCkpICovXG52YXIgWl9CSU5BUlkgICAgICAgICAgICAgID0gMDtcbnZhciBaX1RFWFQgICAgICAgICAgICAgICAgPSAxO1xuLy92YXIgWl9BU0NJSSAgICAgICAgICAgICA9IDE7IC8vID0gWl9URVhUXG52YXIgWl9VTktOT1dOICAgICAgICAgICAgID0gMjtcblxuLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki9cblxuXG5mdW5jdGlvbiB6ZXJvKGJ1ZikgeyB2YXIgbGVuID0gYnVmLmxlbmd0aDsgd2hpbGUgKC0tbGVuID49IDApIHsgYnVmW2xlbl0gPSAwOyB9IH1cblxuLy8gRnJvbSB6dXRpbC5oXG5cbnZhciBTVE9SRURfQkxPQ0sgPSAwO1xudmFyIFNUQVRJQ19UUkVFUyA9IDE7XG52YXIgRFlOX1RSRUVTICAgID0gMjtcbi8qIFRoZSB0aHJlZSBraW5kcyBvZiBibG9jayB0eXBlICovXG5cbnZhciBNS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0gdHJlZVttICogMiArIDFdLyouTGVuKi8pICogdHJlZVttICogMl0vKi5GcmVxKi87XG4gICAgICAgIHRyZWVbbSAqIDIgKyAxXS8qLkxlbiovID0gYml0cztcbiAgICAgIH1cbiAgICAgIG4tLTtcbiAgICB9XG4gIH1cbn1cblxuXG4vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIEdlbmVyYXRlIHRoZSBjb2RlcyBmb3IgYSBnaXZlbiB0cmVlIGFuZCBiaXQgY291bnRzICh3aGljaCBuZWVkIG5vdCBiZVxuICogb3B0aW1hbCkuXG4gKiBJTiBhc3NlcnRpb246IHRoZSBhcnJheSBibF9jb3VudCBjb250YWlucyB0aGUgYml0IGxlbmd0aCBzdGF0aXN0aWNzIGZvclxuICogdGhlIGdpdmVuIHRyZWUgYW5kIHRoZSBmaWVsZCBsZW4gaXMgc2V0IGZvciBhbGwgdHJlZSBlbGVtZW50cy5cbiAqIE9VVCBhc3NlcnRpb246IHRoZSBmaWVsZCBjb2RlIGlzIHNldCBmb3IgYWxsIHRyZWUgZWxlbWVudHMgb2Ygbm9uXG4gKiAgICAgemVybyBjb2RlIGxlbmd0aC5cbiAqL1xuZnVuY3Rpb24gZ2VuX2NvZGVzKHRyZWUsIG1heF9jb2RlLCBibF9jb3VudClcbi8vICAgIGN0X2RhdGEgKnRyZWU7ICAgICAgICAgICAgIC8qIHRoZSB0cmVlIHRvIGRlY29yYXRlICovXG4vLyAgICBpbnQgbWF4X2NvZGU7ICAgICAgICAgICAgICAvKiBsYXJnZXN0IGNvZGUgd2l0aCBub24gemVybyBmcmVxdWVuY3kgKi9cbi8vICAgIHVzaGYgKmJsX2NvdW50OyAgICAgICAgICAgIC8qIG51bWJlciBvZiBjb2RlcyBhdCBlYWNoIGJpdCBsZW5ndGggKi9cbntcbiAgdmFyIG5leHRfY29kZSA9IG5ldyBBcnJheShNQVhfQklUUyArIDE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IGJsb2NrIGhlYWRlciBtdXN0IGJlIHdyaXR0ZW4gKi9cbntcbiAgYmlfd2luZHVwKHMpOyAgICAgICAgLyogYWxpZ24gb24gYnl0ZSBib3VuZGFyeSAqL1xuXG4gIGlmIChoZWFkZXIpIHtcbiAgICBwdXRfc2hvcnQocywgbGVuKTtcbiAgICBwdXRfc2hvcnQocywgfmxlbik7XG4gIH1cbi8vICB3aGlsZSAobGVuLS0pIHtcbi8vICAgIHB1dF9ieXRlKHMsICpidWYrKyk7XG4vLyAgfVxuICB1dGlscy5hcnJheVNldChzLnBlbmRpbmdfYnVmLCBzLndpbmRvdywgYnVmLCBsZW4sIHMucGVuZGluZyk7XG4gIHMucGVuZGluZyArPSBsZW47XG59XG5cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogQ29tcGFyZXMgdG8gc3VidHJlZXMsIHVzaW5nIHRoZSB0cmVlIGRlcHRoIGFzIHRpZSBicmVha2VyIHdoZW5cbiAqIHRoZSBzdWJ0cmVlcyBoYXZlIGVxdWFsIGZyZXF1ZW5jeS4gVGhpcyBtaW5pbWl6ZXMgdGhlIHdvcnN0IGNhc2UgbGVuZ3RoLlxuICovXG5mdW5jdGlvbiBzbWFsbGVyKHRyZWUsIG4sIG0sIGRlcHRoKSB7XG4gIHZhciBfbjIgPSBuICogMjtcbiAgdmFyIF9tMiA9IG0gKiAyO1xuICByZXR1cm4gKHRyZWVbX24yXS8qLkZyZXEqLyA8IHRyZWVbX20yXS8qLkZyZXEqLyB8fFxuICAgICAgICAgKHRyZWVbX24yXS8qLkZyZXEqLyA9PT0gdHJlZVtfbTJdLyouRnJlcSovICYmIGRlcHRoW25dIDw9IGRlcHRoW21dKSk7XG59XG5cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogUmVzdG9yZSB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ztcbiAgfVxuICB0cmVlWyhtYXhfY29kZSArIDEpICogMiArIDFdLyouTGVuKi8gPSAweGZmZmY7IC8qIGd1YXJkICovXG5cbiAgZm9yIChuID0gMDsgbiA8PSBtYXhfY29kZTsgbisrKSB7XG4gICAgY3VybGVuID0gbmV4dGxlbjtcbiAgICBuZXh0bGVuID0gdHJlZVsobiArIDEpICogMiArIDFdLyouTGVuKi87XG5cbiAgICBpZiAoKytjb3VudCA8IG1heF9jb3VudCAmJiBjdXJsZW4gPT09IG5leHRsZW4pIHtcbiAgICAgIGNvbnRpbnVlO1xuXG4gICAgfSBlbHNlIGlmIChjb3VudCA8IG1pbl9jb3VudCkge1xuICAgICAgcy5ibF90cmVlW2N1cmxlbiAqIDJdLyouRnJlcSovICs9IGNvdW50O1xuXG4gICAgfSBlbHNlIGlmIChjdXJsZW4gIT09IDApIHtcblxuICAgICAgaWYgKGN1cmxlbiAhPT0gcHJldmxlbikgeyBzLmJsX3RyZWVbY3VybGVuICogMl0vKi5GcmVxKi8rKzsgfVxuICAgICAgcy5ibF90cmVlW1JFUF8zXzYgKiAyXS8qLkZyZXEqLysrO1xuXG4gICAgfSBlbHNlIGlmIChjb3VudCA8PSAxMCkge1xuICAgICAgcy5ibF90cmVlW1JFUFpfM18xMCAqIDJdLyouRnJlcSovKys7XG5cbiAgICB9IGVsc2Uge1xuICAgICAgcy5ibF90cmVlW1JFUFpfMTFfMTM4ICogMl0vKi5GcmVxKi8rKztcbiAgICB9XG5cbiAgICBjb3VudCA9IDA7XG4gICAgcHJldmxlbiA9IGN1cmxlbjtcblxuICAgIGlmIChuZXh0bGVuID09PSAwKSB7XG4gICAgICBtYXhfY291bnQgPSAxMzg7XG4gICAgICBtaW5fY291bnQgPSAzO1xuXG4gICAgfSBlbHNlIGlmIChjdXJsZW4gPT09IG5leHRsZW4pIHtcbiAgICAgIG1heF9jb3VudCA9IDY7XG4gICAgICBtaW5fY291bnQgPSAzO1xuXG4gICAgfSBlbHNlIHtcbiAgICAgIG1heF9jb3VudCA9IDc7XG4gICAgICBtaW5fY291bnQgPSA0O1xuICAgIH1cbiAgfVxufVxuXG5cbi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogU2VuZCBhIGxpdGVyYWwgb3IgZGlzdGFuY2UgdHJlZSBpbiBjb21wcmVzc2VkIGZvcm0sIHVzaW5nIHRoZSBjb2RlcyBpblxuICogYmxfdHJlZS5cbiAqL1xuZnVuY3Rpb24gc2VuZF90cmVlKHMsIHRyZWUsIG1heF9jb2RlKVxuLy8gICAgZGVmbGF0ZV9zdGF0ZSAqcztcbi8vICAgIGN0X2RhdGEgKnRyZWU7IC8qIHRoZSB0cmVlIHRvIGJlIHNjYW5uZWQgKi9cbi8vICAgIGludCBtYXhfY29kZTsgICAgICAgLyogYW5kIGl0cyBsYXJnZXN0IGNvZGUgb2Ygbm9uIHplcm8gZnJlcXVlbmN5ICovXG57XG4gIHZhciBuOyAgICAgICAgICAgICAgICAgICAgIC8qIGl0ZXJhdGVzIG92ZXIgYWxsIHRyZWUgZWxlbWVudHMgKi9cbiAgdmFyIHByZXZsZW4gPSAtMTsgICAgICAgICAgLyogbGFzdCBlbWl0dGVkIGxlbmd0aCAqL1xuICB2YXIgY3VybGVuOyAgICAgICAgICAgICAgICAvKiBsZW5ndGggb2YgY3VycmVudCBjb2RlICovXG5cbiAgdmFyIG5leHRsZW4gPSB0cmVlWzAgKiAyICsgMV0vKi5MZW4qLzsgLyogbGVuZ3RoIG9mIG5leHQgY29kZSAqL1xuXG4gIHZhciBjb3VudCA9IDA7ICAgICAgICAgICAgIC8qIHJlcGVhdCBjb3VudCBvZiB0aGUgY3VycmVudCBjb2RlICovXG4gIHZhciBtYXhfY291bnQgPSA3OyAgICAgICAgIC8qIG1heCByZXBlYXQgY291bnQgKi9cbiAgdmFyIG1pbl9jb3VudCA9IDQ7ICAgICAgICAgLyogbWluIHJlcGVhdCB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lY3Rpb24oKTtcbiAgICAgIGxldCBzdXBlcmlvckRpcmVjdGlvbiA9IHRoaXMuX2RpcmVjdGlvbnNbc3VwZXJpb3JJbmRleF07XG5cbiAgICAgIGlmKCB0aGlzLl9jb252ZW50aW9uID09PSAncmFkaW8nICl7XG5cbiAgICAgICAgICBzd2l0Y2goIHRoaXMuX29yaWVudGF0aW9uICl7XG5cbiAgICAgICAgICAgIGNhc2UgJ2F4aWFsJzpcbiAgICAgICAgICAgICAgLy8gdXAgdmVjdG9yIGlzICdhbnRlcmlvcidcbiAgICAgICAgICAgICAgaWYoIHBvc3RlcmlvckRpcmVjdGlvbi55ID4gMCApe1xuXG4gICAgICAgICAgICAgICAgcG9zdGVyaW9yRGlyZWN0aW9uLm5lZ2F0ZSgpO1xuXG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAvLyBsb29raW5nIHRvd2FyZHMgc3VwZXJpb3JcbiAgICAgICAgICAgICAgaWYoIHN1cGVyaW9yRGlyZWN0aW9uLnogPCAwICl7XG5cbiAgICAgICAgICAgICAgICBzdXBlcmlvckRpcmVjdGlvbi5uZWdhdGUoKTtcblxuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgLy9cbiAgICAgICAgICAgICAgdGhpcy5fcmlnaHQgPSBsZWZ0RGlyZWN0aW9uOyAvLyBkb2VzIG5vdCBtYXR0ZXIgcmlnaHQvbGVmdFxuICAgICAgICAgICAgICB0aGlzLl91cCA9IHBvc3RlcmlvckRpcmVjdGlvbjtcbiAgICAgICAgICAgICAgdGhpcy5fZGlyZWN0aW9uID0gc3VwZXJpb3JEaXJlY3Rpb247XG4gICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICBjYXNlICdjb3JvbmFsJzpcbiAgICAgICAgICAgICAgLy8gdXAgdmVjdG9yIGlzICdzdXBlcmlvcidcbiAgICAgICAgICAgICAgaWYoIHN1cGVyaW9yRGlyZWN0aW9uLnogPCAwICl7XG5cbiAgICAgICAgICAgICAgICBzdXBlcmlvckRpcmVjdGlvbi5uZWdhdGUoKTtcblxuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgLy8gbG9va2luZyB0b3dhcmRzIHBvc3RlcmlvclxuICAgICAgICAgICAgICBpZiggcG9zdGVyaW9yRGlyZWN0aW9uLnkgPCAwICl7XG5cbiAgICAgICAgICAgICAgICBwb3N0ZXJpb3JEaXJlY3Rpb24ubmVnYXRlKCk7XG5cbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgIHRoaXMuX3JpZ2h0ID0gbGVmdERpcmVjdGlvbjsgLy8gZG9lcyBub3QgbWF0dGVyIHJpZ2h0L2xlZnRcbiAgICAgICAgICAgICAgdGhpcy5fdXAgPSBzdXBlcmlvckRpcmVjdGlvbjtcbiAgICAgICAgICAgICAgdGhpcy5fZGlyZWN0aW9uID0gcG9zdGVyaW9yRGlyZWN0aW9uO1xuICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgY2FzZSAnc2FnaXR0YWwnOlxuICAgICAgICAgICAgICAvLyB1cCB2ZWN0b3IgaXMgJ3N1cGVyaW9yJ1xuICAgICAgICAgICAgICBpZiggc3VwZXJpb3JEaXJlY3Rpb24ueiA8IDAgKXtcblxuICAgICAgICAgICAgICAgIHN1cGVyaW9yRGlyZWN0aW9uLm5lZ2F0ZSgpO1xuXG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAvLyBsb29raW5nIHRvd2FyZHMgcmlnaHRcbiAgICAgICAgICAgICAgaWYoIGxlZnREaXJlY3Rpb24ueCA+IDAgKXtcblxuICAgICAgICAgICAgICAgIGxlZnREaXJlY3Rpb24ubmVnYXRlKCk7XG5cbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgIHRoaXMuX3JpZ2h0ID0gcG9zdGVyaW9yRGlyZWN0aW9uOyAvLyBkb2VzIG5vdCBtYXR0ZXIgcmlnaHQvbGVmdFxuICAgICAgICAgICAgICB0aGlzLl91cCA9IHN1cGVyaW9yRGlyZWN0aW9uO1xuICAgICAgICAgICAgICB0aGlzLl9kaXJlY3Rpb24gPSBsZWZ0RGlyZWN0aW9uO1xuXG4gICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICBjb25zb2xlLndhcm4oYFwiJHt0aGlzLl9vcmllbnRhdGlvbn1cIiBvcmllbnRhdGlvbiBpcyBub3QgdmFsaWQuIChjaG9pY2VzOiBheGlhbCwgY29yb25hbCwgc2FnaXR0YWwpYCk7XG4gICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgfVxuXG4gICAgICB9IGVsc2UgaWYgKCB0aGlzLl9jb252ZW50aW9uID09PSAnbmV1cm8nICl7XG5cbiAgICAgICAgICBzd2l0Y2goIHRoaXMuX29yaWVudGF0aW9uICl7XG5cbiAgICAgICAgICAgIGNhc2UgJ2F4aWFsJzpcbiAgICAgICAgICAgICAgLy8gdXAgdmVjdG9yIGlzICdhbnRlcmlvcidcbiAgICAgICAgICAgICAgaWYoIHBvc3RlcmlvckRpcmVjdGlvbi55ID4gMCApe1xuXG4gICAgICAgICAgICAgICAgcG9zdGVyaW9yRGlyZWN0aW9uLm5lZ2F0ZSgpO1xuXG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAvLyBsb29raW5nIHRvd2FyZHMgaW5mZXJpb3JcbiAgICAgICAgICAgICAgaWYoIHN1cGVyaW9yRGlyZWN0aW9uLnogPiAwICl7XG5cbiAgICAgICAgICAgICAgICBzdXBlcmlvckRpcmVjdGlvbi5uZWdhdGUoKTtcblxuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgLy9cbiAgICAgICAgICAgICAgdGhpcy5fcmlnaHQgPSBsZWZ0RGlyZWN0aW9uOyAvLyBkb2VzIG5vdCBtYXR0ZXIgcmlnaHQvbGVmdFxuICAgICAgICAgICAgICB0aGlzLl91cCA9IHBvc3RlcmlvckRpcmVjdGlvbjtcbiAgICAgICAgICAgICAgdGhpcy5fZGlyZWN0aW9uID0gc3VwZXJpb3JEaXJlY3Rpb247XG4gICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICBjYXNlICdjb3JvbmFsJzpcbiAgICAgICAgICAgICAgLy8gdXAgdmVjdG9yIGlzICdzdXBlcmlvcidcbiAgICAgICAgICAgICAgaWYoIHN1cGVyaW9yRGlyZWN0aW9uLnogPCAwICl7XG5cbiAgICAgICAgICAgICAgICBzdXBlcmlvckRpcmVjdGlvbi5uZWdhdGUoKTtcblxuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgLy8gbG9va2luZyB0b3dhcmRzIGFudGVyaW9yXG4gICAgICAgICAgICAgIGlmKCBwb3N0ZXJpb3JEaXJlY3Rpb24ueSA+IDAgKXtcblxuICAgICAgICAgICAgICAgIHBvc3RlcmlvckRpcmVjdGlvbi5uZWdhdGUoKTtcblxuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgLy9cbiAgICAgICAgICAgICAgdGhpcy5fcmlnaHQgPSBsZWZ0RGlyZWN0aW9uOyAvLyBkb2VzIG5vdCBtYXR0ZXIgcmlnaHQvbGVmdFxuICAgICAgICAgICAgICB0aGlzLl91cCA9IHN1cGVyaW9yRGlyZWN0aW9uO1xuICAgICAgICAgICAgICB0aGlzLl9kaXJlY3Rpb24gPSBwb3N0ZXJpb3JEaXJlY3Rpb247XG4gICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICBjYXNlICdzYWdpdHRhbCc6XG4gICAgICAgICAgICAgIC8vIHVwIHZlY3RvciBpcyAnc3VwZXJpb3InXG4gICAgICAgICAgICAgIGlmKCBzdXBlcmlvckRpcmVjdGlvbi56IDwgMCApe1xuXG4gICAgICAgICAgICAgICAgc3VwZXJpb3JEaXJlY3Rpb24ubmVnYXRlKCk7XG5cbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIC8vIGxvb2tpbmcgdG93YXJkcyByaWdodFxuICAgICAgICAgICAgICBpZiggbGVmdERpcmVjdGlvbi54ID4gMCApe1xuXG4gICAgICAgICAgICAgICAgbGVmdERpcmVjdGlvbi5uZWdhdGUoKTtcblxuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgLy9cbiAgICAgICAgICAgICAgdGhpcy5fcmlnaHQgPSBwb3N0ZXJpb3JEaXJlY3Rpb247IC8vIGRvZXMgbm90IG1hdHRlciByaWdodC9sZWZ0XG4gICAgICAgICAgICAgIHRoaXMuX3VwID0gc3VwZXJpb3JEaXJlY3Rpb247XG4gICAgICAgICAgICAgIHRoaXMuX2RpcmVjdGlvbiA9IGxlZnREaXJlY3Rpb247XG5cbiAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgIGNvbnNvbGUud2FybihgXCIke3RoaXMuX29yaWVudGF0aW9ufVwiIG9yaWVudGF0aW9uIGlzIG5vdCB2YWxpZC4gKGNob2ljZXM6IGF4aWFsLCBjb3JvbmFsLCBzYWdpdHRhbClgKTtcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuXG4gICAgICB9XG4gICAgICBlbHNle1xuICAgICAgICBjb25zb2xlLndhcm4oYCR7dGhpcy5fY29udmVudGlvbn0gaXMgbm90IHZhbGlkIChjaG9pY2VzOiByYWRpbywgbmV1cm8pYCk7XG4gICAgICB9XG5cbiAgICB9XG5cbiAgICAvLyB0aGF0IGlzIHdoYXQgZGV0ZXJtaW5lcyBsZWZ0L3JpZ2h0XG4gICAgbGV0IHJheSA9IHtcbiAgICAgIHBvc2l0aW9uOiB0aGlzLl9ib3guY2VudGVyLFxuICAgICAgZGlyZWN0aW9uOiB0aGlzLl9kaXJlY3Rpb25cbiAgICB9O1xuXG4gICAgbGV0IGludGVyc2VjdGlvbnMgPSB0aGlzLl9vcmRlckludGVyc2VjdGl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AgIH1cblxuICAgIGZ1bmN0aW9uIG1vdXNlbW92ZShldmVudCkge1xuXG4gICAgICBpZiAoX3RoaXMuZW5hYmxlZCA9PT0gZmFsc2UpIHJldHVybjtcblxuICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcbiAgICAgIGV2ZW50LnN0b3BQcm9wYWdhdGlvbigpO1xuXG4gICAgICBpZiAoX3N0YXRlID09PSBTVEFURS5ST1RBVEUgJiYgIV90aGlzLm5vUm90YXRlKSB7XG5cbiAgICAgICAgX21vdmVQcmV2LmNvcHkoX21vdmVDdXJyKTtcbiAgICAgICAgX21vdmVDdXJyLmNvcHkoZ2V0TW91c2VPbkNpcmNsZShldmVudC5wYWdlWCwgZXZlbnQucGFnZVkpKTtcblxuICAgICAgfSBlbHNlIGlmIChfc3RhdGUgPT09IFNUQVRFLlpPT00gJiYgIV90aGlzLm5vWm9vbSkge1xuXG4gICAgICAgIF96b29tRW5kLmNvcHkoZ2V0TW91c2VPblNjcmVlbihldmVudC5wYWdlWCwgZXZlbnQucGFnZVkpKTtcblxuICAgICAgfSBlbHNlIGlmIChfc3RhdGUgPT09IFNUQVRFLlBBTiAmJiAhX3RoaXMubm9QYW4pIHtcblxuICAgICAgICBfcGFuRW5kLmNvcHkoZ2V0TW91c2VPblNjcmVlbihldmVudC5wYWdlWCwgZXZlbnQucGFnZVkpKTtcblxuICAgICAgfSBlbHNlIGlmIChfc3RhdGUgPT09IFNUQVRFLkNVU1RPTSAmJiAhX3RoaXMubm9DdXN0b20pIHtcblxuICAgICAgICBfY3VzdG9tRW5kLmNvcHkoZ2V0TW91c2VPblNjcmVlbihldmVudC5wYWdlWCwgZXZlbnQucGFnZVkpKTtcblxuICAgICAgfVxuXG4gICAgfVxuXG4gICAgZnVuY3Rpb24gbW91c2V1cChldmVudCkge1xuXG4gICAgICBpZiAoX3RoaXMuZW5hYmxlZCA9PT0gZmFsc2UpIHJldHVybjtcblxuICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTt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9XG5cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIC8veyBOT05FOiAtMSwgUk9UQVRFOiAwLCBaT09NOiAxLCBQQU46IDIsIFRPVUNIX1JPVEFURTogMywgVE9VQ0hfWk9PTV9QQU46IDQsIENVU1RPTTogOTkgfTtcbiAgICAgICAgc3dpdGNoIChfc3RhdGUpIHtcblxuICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgIF9tb3ZlUHJldi5jb3B5KF9tb3ZlQ3Vycik7XG4gICAgICAgICAgICBfbW92ZUN1cnIuY29weShnZXRNb3VzZU9uQ2lyY2xlKGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWCwgZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VZKSk7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgIF96b29tRW5kLmNvcHkoZ2V0TW91c2VPblNjcmVlbihldmVudC50b3VjaGVzWyAwIF0ucGFnZVgsIGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWSkpO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICBfcGFuRW5kLmNvcHkoZ2V0TW91c2VPblNjcmVlbihldmVudC50b3VjaGVzWyAwIF0ucGFnZVgsIGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWSkpO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAvLyAyIGZpbmdlcnMhXG4gICAgICAgICAgICAvLyBUT1VDSCBaT09NXG4gICAgICAgICAgICB2YXIgZHggPSBldmVudC50b3VjaGVzWyAwIF0ucGFnZVggLSBldmVudC50b3VjaGVzWyAxIF0ucGFnZVg7XG4gICAgICAgICAgICB2YXIgZHkgPSBldmVudC50b3VjaGVzWyAwIF0ucGFnZVkgLSBldmVudC50b3VjaGVzWyAxIF0ucGFnZVk7XG4gICAgICAgICAgICBfdG91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AgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgNDpcbiAgICAgICAgICAgIC8vIFRPVUNIIFpPT01cbiAgICAgICAgICAgIF90b3VjaFpvb21EaXN0YW5jZVN0YXJ0ID0gX3RvdWNoWm9vbURpc3RhbmNlRW5kID0gMDtcbiAgICAgICAgICAgIF9zdGF0ZSA9IFNUQVRFLlpPT007XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgIC8vIFRPVUNIIFpPT01cbiAgICAgICAgICAgIGlmIChldmVudC50b3VjaGVzLmxlbmd0aCA+PSAyKSB7XG4gICAgICAgICAgICAgIHZhciB4ID0gKGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWCArIGV2ZW50LnRvdWNoZXNbIDEgXS5wYWdlWCkgLyAyO1xuICAgICAgICAgICAgICB2YXIgeSA9IChldmVudC50b3VjaGVzWyAwIF0ucGFnZVkgKyBldmVudC50b3VjaGVzWyAxIF0ucGFnZVkpIC8gMjtcbiAgICAgICAgICAgICAgX3BhbkVuZC5jb3B5KGdldE1vdXNlT25TY3JlZW4oeCwgeSkpO1xuICAgICAgICAgICAgICBfcGFuU3RhcnQuY29weShfcGFuRW5kKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIF9zdGF0ZSA9IFNUQVRFLlBBTjtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSA5OTpcbiAgICAgICAgICAgIHZhciB4ID0gKGV2ZW50LnRvdWNoZXNbIDAgXS5wYWdlWCArIGV2ZW50LnRvdWNoZXNbIDEgXS5wYWdlWCkgLyAyO1xuICAgICAgICAgICAgdmFyIHkgPSAoZXZlbnQudG91Y2hlc1sgMCBdLnBhZ2VZICsgZXZlbnQudG91Y2hlc1sgMSBdLnBhZ2VZKSAvIDI7XG4gICAgICAgICAgIC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2IC8gMTE2ICkgLyA3Ljc4NztcblxuICAgIH0gICAgICAgIFxuXG4gICAgaWYgKCBNYXRoLnBvdyh6LDMpID4gMC4wMDg4NTYgKXtcblxuICAgICAgeiA9IE1hdGgucG93KHosIDMpO1xuXG4gICAgfSBlbHNlIHtcblxuICAgICAgeiA9ICggeiAtIDE2IC8gMTE2ICkgLyA3Ljc4NztcblxuICAgIH0gICAgICBcblxuICAgIHJldHVybiBbcmVmWCAqIHgsIHJlZlkgKiB5LCByZWZaICogel07ICBcblxuICB9XG5cbiAgc3RhdGljIHh5ejJSR0IoIHgsIHksIHogKXtcblxuICAgIHggLz0gMTAwO1xuICAgIHkgLz0gMTAwO1xuICAgIHogLz0gMTAwO1xuICAgIGxldCByID0geCAqICAzLjI0MDYgKyB5ICogLTEuNTM3MiArIHogKiAtMC40OTg2O1xuICAgIGxldCBnID0geCAqIC0wLjk2ODkgKyB5ICogIDEuODc1OCArIHogKiAgMC4wNDE1O1xuICAgIGxldCBiID0geCAqICAwLjA1NTcgKyB5ICogLTAuMjA0MCArIHogKiAgMS4wNTcwO1xuXG4gICAgaWYgKCByID4gMC4wMDMxMzA4ICl7XG5cbiAgICAgIHIgPSAxLjA1NSAqICggTWF0aC5wb3coIHIgLCAxIC8gMi40ICkgKSAtIDAuMDU1O1xuXG4gICAgfSBlbHNlIHtcblxuICAgICAgciA9IDEyLjkyICogcjtcblxuICAgIH1cblxuICAgIGlmICggZyA+IDAuMDAzMTMwOCApe1xuXG4gICAgICBnID0gMS4wNTUgKiAoIE1hdGgucG93KCBnLCAxIC8gMi40ICkgKSAtIDAuMDU1O1xuXG4gICAgfSBlbHNlIHtcblxuICAgICAgZyA9IDEyLjkyICogZztcblxuICAgIH1cblxuICAgIGlmICggYiA+IDAuMDAzMTMwOCApe1xuXG4gICAgICBiID0gMS4wNTUgKiAoIE1hdGgucG93KCBiICwgMSAvIDIuNCApICkgLSAwLjA1NTtcblxuICAgIH0gZWxzZSB7XG5cbiAgICAgIGIgPSA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IDApXG4gICAgLy9cbiAgICAvLyAgICAgICArXG4gICAgLy8gICAgICAgfFxuICAgIC8vICAgICAgIHxcbiAgICAvLyAgICAgICB8IFxuICAgIC8vICAgICAgLCstLS0rLS0tK1xuICAgIC8vICAgIC4nICAgXG4gICAgLy8gICArICAgXG5cbiAgICBsZXQgcmF5ID0gdGhpcy5wb3NkaXIoXG4gICAgICBuZXcgVEhSRUUuVmVjdG9yMyhhYWJiLmNlbnRlci54IC0gYWFiYi5oYWxmRGltZW5zaW9ucy54LCBhYWJiLmNlbnRlci55IC0gYWFiYi5oYWxmRGltZW5zaW9ucy55LCBhYWJiLmNlbnRlci56IC0gYWFiYi5oYWxmRGltZW5zaW9ucy56KSxcbiAgICAgIG9yaWVudGF0aW9uLnhcbiAgICApO1xuICAgIHRoaXMucmF5UGxhbmVJbkJCb3gocmF5LCBwbGFuZUFBQkIsIGJib3gsIGludGVyc2VjdGlvbnMpO1xuXG4gICAgcmF5LmRpcmVjdGlvbiA9IG9yaWVudGF0aW9uLnk7XG4gICAgdGhpcy5yYXlQbGFuZUluQkJveChyYXksIHBsYW5lQUFCQiwgYmJveCwgaW50ZXJzZWN0aW9ucyk7XG5cbiAgICByYXkuZGlyZWN0aW9uID0gb3JpZW50YXRpb24uejtcbiAgICB0aGlzLnJheVBsYW5lSW5CQm94KHJheSwgcGxhbmVBQUJCLCBiYm94LCBpbnRlcnNlY3Rpb25zKTtcblxuICAgIC8vIFJBWVMgU1RBUlRJTkcgRlJPTSBUSEUgTEFTVCBDT1JORVJcbiAgICAvL1xuICAgIC8vICAgICAgICAgICAgICAgK1xuICAgIC8vICAgICAgICAgICAgIC4nXG4gICAgLy8gICArLS0tLS0tLSsnXG4gICAgLy8gICAgICAgICAgIHxcbiAgICAvLyAgICAgICAgICAgfFxuICAgIC8vICAgICAgICAgICB8XG4gICAgLy8gICAgICAgICAgICtcbiAgICAvL1xuXG4gICAgbGV0IHJheTIgPSB0aGlzLnBvc2RpcihcbiAgICAgIG5ldyBUSFJFRS5WZWN0b3IzKGFhYmIuY2VudGVyLnggKyBhYWJiLmhhbGZEaW1lbnNpb25zLngsIGFhYmIuY2VudGVyLnkgKyBhYWJiLmhhbGZEaW1lbnNpb25zLnksIGFhYmIuY2VudGVyLnogKyBhYWJiLmhhbGZEaW1lbnNpb25zLnopLFxuICAgICAgb3JpZW50YXRpb24ueFxuICAgICk7XG4gICAgdGhpcy5yYXlQbGFuZUluQkJveChyYXkyLCBwbGFuZUFBQkIsIGJib3gsIGludGVyc2VjdGlvbnMpO1xuXG4gICAgcmF5Mi5kaXJlY3Rpb24gPSBvcmllbnRhdGlvbi55O1xuICAgIHRoaXMucmF5UGxhbmVJbkJCb3gocmF5MiwgcGxhbmVBQUJCLCBiYm94LCBpbnRlcnNlY3Rpb25zKTtcblxuICAgIHJheTIuZGlyZWN0aW9uID0gb3JpZW50YXRpb24uejtcbiAgICB0aGlzLnJheVBsYW5lSW5CQm94KHJheTIsIHBsYW5lQUFCQiwgYmJveCwgaW50ZXJzZWN0aW9ucyk7XG5cbiAgICAvLyBSQVlTIFNUQVJUSU5HIEZST00gVEhFIFNFQ09ORCBDT1JORVJcbiAgICAvL1xuICAgIC8vICAgICAgICAgICAgICAgK1xuICAgIC8vICAgICAgICAgICAgICAgfFxuICAgIC8vICAgICAgICAgICAgICAgfFxuICAgIC8vICAgICAgICAgICAgICAgfFxuICAgIC8vICAgICAgICAgICAgICAgK1xuICAgIC8vICAgICAgICAgICAgIC4nXG4gICAgLy8gICAgICAgICAgICsnXG5cbiAgICBsZXQgcmF5MyA9IHRoaXMucG9zZGlyKFxuICAgICAgbmV3IFRIUkVFLlZlY3RvcjMoYWFiYi5jZW50ZXIueCArIGFhYmIuaGFsZkRpbWVuc2lvbnMueCwgYWFiYi5jZW50ZXIueSAtIGFhYmIuaGFsZkRpbWVuc2lvbnMueSwgYWFiYi5jZW50ZXIueiAtIGFhYmIuaGFsZkRpbWVuc2lvbnMueiksXG4gICAgICBvcmllbnRhdGlvbi55XG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ZW50ZXIueSxcbiAgICAgICAgYm94LmNlbnRlci56KSxcbiAgICAgIG5ldyBUSFJFRS5WZWN0b3IzKC0xLCAwLCAwKVxuICAgICk7XG4gICAgdGhpcy5yYXlQbGFuZUluQkJveChyYXksIHBsYW5lLCBiYm94LCBpbnRlcnNlY3Rpb25zKTtcblxuICAgIC8vIFggbWF4XG4gICAgcGxhbmUgPSB0aGlzLnBvc2RpcihcbiAgICAgIG5ldyBUSFJFRS5WZWN0b3IzKFxuICAgICAgICBiYm94Lm1heC54LFxuICAgICAgICBib3guY2VudGVyLnksXG4gICAgICAgIGJveC5jZW50ZXIueiksXG4gICAgICBuZXcgVEhSRUUuVmVjdG9yMygxLCAwLCAwKVxuICAgICk7XG4gICAgdGhpcy5yYXlQbGFuZUluQkJveChyYXksIHBsYW5lLCBiYm94LCBpbnRlcnNlY3Rpb25zKTtcblxuICAgIC8vIFkgbWluXG4gICAgcGxhbmUgPSB0aGlzLnBvc2RpcihcbiAgICAgIG5ldyBUSFJFRS5WZWN0b3IzKFxuICAgICAgICBib3guY2VudGVyLngsXG4gICAgICAgIGJib3gubWluLnksXG4gICAgICAgIGJveC5jZW50ZXIueiksXG4gICAgICBuZXcgVEhSRUUuVmVjdG9yMygwLCAtMSwgMClcbiAgICApO1xuICAgIHRoaXMucmF5UGxhbmVJbkJCb3gocmF5LCBwbGFuZSwgYmJveCwgaW50ZXJzZWN0aW9ucyk7XG5cbiAgICAvLyBZIG1heFxuICAgIHBsYW5lID0gdGhpcy5wb3NkaXIoXG4gICAgICBuZXcgVEhSRUUuVmVjdG9yMyhcbiAgICAgICAgYm94LmNlbnRlci54LFxuICAgICAgICBiYm94Lm1heC55LFxuICAgICAgICBib3guY2VudGVyLnopLFxuICAgICAgbmV3IFRIUkVFLlZlY3RvcjMoMCwgMSwgMClcbiAgICApO1xuICAgIHRoaXMucmF5UGxhbmVJbkJCb3gocmF5LCBwbGFuZSwgYmJveCwgaW50ZXJzZWN0aW9ucyk7XG5cbiAgICAv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ICAgIH1cbiAgICB9XG4gIH1cblxuICBzdGF0aWMgZmluZEludGVyc2VjdGlvbihteWludGVyc2VjdGlvbil7XG4gICAgcmV0dXJuIGZ1bmN0aW9uIGZvdW5kKGVsZW1lbnQsIGluZGV4LCBhcnJheSkge1xuICAgICAgaWYobXlpbnRlcnNlY3Rpb24ueCA9PT0gZWxlbWVudC54ICYmXG4gICAgICAgIG15aW50ZXJzZWN0aW9uLnkgPT09IGVsZW1lbnQueSAmJlxuICAgICAgICBteWludGVyc2VjdGlvbi56ID09PSBlbGVtZW50Lnope1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cblxuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbiAgfVxuXG4gIHN0YXRpYyBpbkJCb3gocG9pbnQsIGJib3gpIHtcbiAgICAvL1xuICAgIGxldCBlcHNpbG9uID0gMC4wMDAxO1xuICAgIGlmIChwb2ludCAmJlxuICAgICAgICBwb2ludC54ID49IGJib3gubWluLnggLSBlcHNpbG9uICYmIHBvaW50LnkgPj0gYmJveC5taW4ueSAtIGVwc2lsb24gJiYgcG9pbnQueiA+PSBiYm94Lm1pbi56IC0gZXBzaWxvbiAmJlxuICAgICAgICBwb2ludC54IDw9IGJib3gubWF4LnggKyBlcHNpbG9uICYmIHBvaW50LnkgPD0gYmJveC5tYXgueSArIGVwc2lsb24gJiYgcG9pbnQueiA8PSBiYm94Lm1heC56ICsgZXBzaWxvbikge1xuICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuICAgIHJldHVybiBmYWxzZTtcbiAgfVxuXG4gIHN0YXRpYyBwb3NkaXIocG9zaXRpb24sIGRpcmVjdGlvbil7XG4gICAgcmV0dXJuIHtwb3NpdGlvbiwgZGlyZWN0aW9ufTtcbiAgfVxuXG4gIHN0YXRpYyB2YWxpZGF0ZVBsYW5lKHBsYW5lKXtcbiAgICAvL1xuICAgIGlmKHBsYW5lID09PSBudWxsKXtcblxuICAgICAgd2luZG93LmNvbnNvbGU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XMuX3BsYW5lRGlyZWN0aW9uLFxuICAgICAgICB0aGlzLl90b0FBQkIpO1xuICAgIH1cbiAgICBjYXRjaCAoZSkge1xuICAgICAgd2luZG93LmNvbnNvbGUubG9nKGUpO1xuICAgICAgd2luZG93LmNvbnNvbGUubG9nKCdpbnZhbGlkIHNsaWNlIGdlb21ldHJ5IC0gZXhpdGluZy4uLicpO1xuICAgICAgcmV0dXJuO1xuICAgIH1cblxuICAgIGlmICghdGhpcy5fZ2VvbWV0cnkudmVydGljZXMpIHtcbiAgICAgIHJldHVybjtcbiAgICB9XG5cbiAgICBpZiAoIXRoaXMuX21hdGVyaWFsKSB7XG4gICAgICAvL1xuICAgICAgdGhpcy5fdW5pZm9ybXMudVRleHR1cmVTaXplLnZhbHVlICAgICA9IHRoaXMuX3N0YWNrLnRleHR1cmVTaXplO1xuICAgICAgdGhpcy5fdW5pZm9ybXMudURhdGFEaW1lbnNpb25zLnZhbHVlICA9IFsgdGhpcy5fc3RhY2suZGltZW5zaW9uc0lKSy54LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fc3RhY2suZGltZW5zaW9uc0lKSy55LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fc3RhY2suZGltZW5zaW9uc0lKSy56IF07XG4gICAgICB0aGlzLl91bmlmb3Jtcy51V29ybGRUb0RhdGEudmFsdWUgICAgICA9IHRoaXMuX3N0YWNrLmxwczJJSks7XG4gICAgICB0aGlzLl91bmlmb3Jtcy51TnVtYmVyT2ZDaGFubmVscy52YWx1ZSA9IHRoaXMuX3N0YWNrLm51bWJlck9mQ2hhbm5lbHM7XG4gICAgICB0aGlzLl91bmlmb3Jtcy51UGl4ZWxUeXBlLnZhbHVlICAgICAgICA9IHRoaXMuX3N0YWNrLnBpeGVsVHlwZTtcbiAgICAgIHRoaXMuX3VuaWZvcm1zLnVCaXRzQWxsb2NhdGVkLnZhbH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gICA8cGF0aCBkPVwiTTcwLDcwIFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTDMwLDMwIFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQTEwLDEwIDAgMSAxIDEwLDEwXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBMTAsMTAgMCAxIDEgMzAsMzBcIiAvPlxcXG4gICAgICAgICAgICAgICAgICAgICAgXFxcbiAgICAgICAgICAgICAgICAgICAgICA8L3N2Zz4nICAgICAgICAgICAgICAgICAgICAgICAgO1xuICAgICAgICAgICAgICAgICAgICAgIFxuXG4gICAgdGhpcy5jcmVhdGVNZXNoKCk7XG4gIH1cblxuICB1cGRhdGVWb3hlbCh3b3JsZENvb3JkaW5hdGVzKSB7XG4gICAgLy8gdXBkYXRlIHdvcmxkIGNvb3JkaW5hdGVzXG4gICAgdGhpcy5fdm94ZWwud29ybGRDb29yZGluYXRlcyA9IHdvcmxkQ29vcmRpbmF0ZXM7XG5cbiAgICAvLyB1cGRhdGUgZGF0YSBjb29yZGluYXRlc1xuICAgIHRoaXMuX3ZveGVsLmRhdGFDb29yZGluYXRlcyA9ICBNb2RlbHNTdGFjay53b3JsZFRvRGF0YShcbiAgICAgICAgICAgICAgICAgIHRoaXMuX3N0YWNrLFxuICAgICAgICAgICAgICAgICAgdGhpcy5fdm94ZWwud29ybGRDb29yZGluYXRlcyk7XG5cbiAgICAvLyB1cGRhdGUgdmFsdWVcbiAgICBsZXQgdmFsdWUgPSBNb2RlbHNTdGFjay52YWx1ZShcbiAgICAgIHRoaXMuX3N0YWNrLFxuICAgICAgdGhpcy5fdm94ZWwuZGF0YUNvb3JkaW5hdGVzKTtcblxuICAgIHRoaXMuX3ZveGVsLnZhbHVlID0gTW9kZWxzU3RhY2sudmFsdWVSZXNjYWxlU2xvcGVJbnRlcmNlcHQoXG4gICAgICB2YWx1ZSxcbiAgICAgIHRoaXMuX3N0YWNrLnJlc2NhbGVTbG9wZSxcbiAg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ICogICB9XG4gKiApO1xuICovXG5leHBvcnQgZGVmYXVsdCBjbGFzcyBMb2FkZXJzVm9sdW1lcyBleHRlbmRzIExvYWRlcnNCYXNle1xuXG4gIHBhcnNlKHJlc3BvbnNlKSB7XG5cbiAgICAvLyBnaXZlIGEgY2hhbmNlIHRvIHRoZSBVSSB0byB1cGRhdGUgYmVjYXVzZSBhZnRlciB0aGUgcmVuZGVyaW5nIHdpbGwgYmUgYmxvY2tlZCB3aXRoIGludGVuc2l2ZSBKU1xuICAgIHRoaXMuX3Byb2dyZXNzQmFyLnVwZGF0ZSgwLCAxMDAsICdwYXJzZScpO1xuXG4gICAgcmV0dXJuIG5ldyBQcm9taXNlKFxuICAgICAgICAocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG4gICAgICAgICAgICB3aW5kb3cuc2V0VGltZW91dChcbiAgICAgICAgICAgICAgKCkgPT4ge1xuICAgICAgICAgICAgICAgIHJlc29sdmUobmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuXG4gICAgICAgICAgICAgICAgICBsZXQgZGF0YSA9IHJlc3BvbnNlO1xuICAgICAgICAgICAgICAgICAgZGF0YS5nemNvbXByZXNzZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgIGRhdGEuZmlsZW5hbWUgPSAnJztcbiAgICAgICAgICAgICAgICAgIGRhdGEuZXh0ZW5zaW9uID0gJyc7XG5cbiAgICAgICAgICAgICAgICAgIC8vIHVuY29tcHJlc3M/XG4gICAgICAgICAgICAgICAgICBkYXRhLmZpbGVuYW1lID0gcmVzcG9uc2UudXJsLnNwbGl0KCcvJykucG9wKCk7XG4gICAgICAgICAgICAgICAgICBkYXRhLmd6Y29tcHJlc3NlZCA9IGZhbHNlO1xuXG4gICAgICAgICAgICAgICAgICAvLyBmaW5kIGV4dGVuc2lvblxuICAgICAgICAgICAgICAgICAgbGV0IHNwbGl0dGVkTmFtZSA9IGRhdGEuZmlsZW5hbWUuc3BsaXQoJy4nKTtcbiAgICAgICAgICAgICAgICAgIGlmKHNwbGl0dGVkTmFtZS5sZW5ndGggPD0gMSl7XG4gICAgICAgICAgICAgICAgICAgIGRhdGEuZXh0ZW5zaW9uID0gJyc7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBlbHNle1xuICAgICAgICAgICAgICAgICAgICBkYXRhLmV4dGVuc2lvbiA9IGRhdGEuZmlsZW5hbWUuc3BsaXQoJy4nKS5wb3AoKTtcbiAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgLy8gdW56aXAgaWYgZXh0ZW5zaW9uIGlzICcuZ3onXG4gICAgICAgICAgICAgICAgICBpZiAoZGF0YS5leHRlbnNpb24gPT09ICdneicpIHtcbiAgICAgICAgICAgICAgICAgICAgZGF0YS5nemNvbXByZXNzZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICBkYXRhLmV4dGVuc2lvbiA9IGRhdGEuZmlsZW5hbWUuc3BsaXQoJy5neicpLnNoaWZ0KCkuc3BsaXQoJy4nKS5wb3AoKTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGRlY29tcHJlc3NlZERhdGEgPSBwYWtvLmluZmxhdGUoZGF0YS5idWZmZXIpO1xuICAgICAgICAgICAgICAgICAgICBkYXRhLmJ1ZmZlciA9IGRlY29tcHJlc3NlZERhdGEuYnVmZmVyO1xuICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICBsZXQgcGFyc2VyID0gdGhpcy5fcGFyc2VyKGRhdGEuZXh0ZW5zaW9uKTtcbiAgICAgICAgICAgICAgICAgIGlmICghcGFyc2VyKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlamVjdChkYXRhLmZpbGVuYW1lICsgJyBjYW4gbm90IGJlIHBhcnNlZC4nKTtcbiAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgLy8gY2hlY2sgZXh0ZW5zaW9uXG4gICAgICAgICAgICAgICAgICBsZXQgdm9sdW1lUGFyc2VyID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIHZvbHVtZVBhcnNlciA9IG5ldyBwYXJzZXIoZGF0YSwgMCk7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICB3aW5kb3cuY29uc29sZS5sb2coZSk7XG4gICAgICAgICAgICAgICAgICAgIHJlamVjdChlKTtcbiAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgLy8gY3JlYXRlIGEgc2VyaWVzXG4gICAgICAgICAgICAgICAgICBsZXQgc2VyaWVzID0gbmV3IE1vZGVsc1NlcmllcygpO1xuICAgICAgICAgICAgICAgICAgc2VyaWVzLnNlcmllc0luc3RhbmNlVUlEID0gdm9sdW1lUGFyc2VyLnNlcmllc0luc3RhbmNlVUlEKCk7XG4gICAgICAgICAgICAgICAgICBzZXJpZXMubnVtYmVyT2ZGcmFtZXMgICAgPSB2b2x1bWVQYXJzZXIubnVtYmVyT2ZGcmFtZXMoKTtcbiAgICAgICAgICAgICAgICAgIGlmICghc2VyaWVzLm51bWJlck9mRnJhbWVzKSB7XG4gICAgICAgICAgICAgICAgICAgIHNlcmllcy5udW1iZXJPZkZyYW1lcyA9IDE7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBzZXJpZXMubnVtYmVyT2ZDaGFubmVscyAgPSB2b2x1bWVQYXJzZXIubnVtYmVyT2ZDaGFubmVscygpO1xuICAgICAgICAgICAgICAgICAgc2VyaWVzLm1vZGFsaXR5ICAgICAgICAgID0gdm9sdW1lUGFyc2VyLm1vZGFsaXR5KCk7XG4gICAgICAgICAgICAgICAgICAvLyBpZiBpdCBpcyBhIHNlZ21lbnRhdGlvbiwgYXR0YWNoIGV4dHJhIGluZm9ybWF0aW9uXG4gICAgICAgICAgICAgICAgICBpZihzZXJpZXMubW9kYWxpdHkgPT09ICdTRUcnKXtcbiAgICAgICAgICAgICAgICAgICAgLy8gY29sb3JzXG4gICAgICAgICAgICAgICAgICAgIC8vIGxhYmVsc1xuICAgICAgICAgICAgICAgICAgICAvLyBldGMuXG4gICAgICAgICAgICAgICAgICAgIHNlcmllcy5zZWdtZW50YXRpb25UeXBlICAgICA9IHZvbHVtZVBhcnNlci5zZWdtZW50YXRpb25UeXBlKCk7XG4gICAgICAgICAgICAgICAgICAgIHNlcmllcy5zZWdtZW50YXRpb25TZWdtZW50cyA9IHZvbHVtZVBhcnNlci5zZWdtZW50YXRpb25TZWdtZW50cygpO1xuICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAvLyBqdXN0IGNyZWF0ZSAxIGR1bW15IHN0YWNrIGZvciBub3dcbiAgICAgICAgICAgICAgICAgIGxldCBzdGFjayA9IG5ldyBNb2RlbHNTdGFjaygpO1xuICAgICAgICAgICAgICAgICAgc3RhY2subnVtYmVyT2ZDaGFubmVscyA9IHZvbHVtZVBhcnNlci5udW1iZXJPZkNoYW5uZWxzKCk7XG4gICAgICAgICAgICAgICAgICBzdGFjay5waXhlbFR5cGUgICAgICAgID0gdm9sdW1lUGFyc2VyLnBpeGVsVHlwZSgpO1xuICAgICAgICAgICAgICAgICAgc3RhY2suaW52ZXJ0ICAgICAgICAgICA9IHZvbHVtZVBhcnNlci5pbnZlcnQoKTtcbiAgICAgICAgICAgICAgICAgIHN0YWNrLm1vZGFsaXR5ICAgICAgICAgPSBzZXJpZXMubW9kYWxpdHk7XG4gICAgICAgICAgICAgICAgICAvLyBpZiBpdCBpcyBhIHNlZ21lbnRhdGlvbiwgYXR0YWNoIGV4dHJhIGluZm9ybWF0aW9uXG4gICAgICAgICAgICAgICAgICBpZihzdGFjay5tb2RhbGl0eSA9PT0gJ1NFRycpe1xuICAgICAgICAgICAgICAgICAgICAvLyBjb2xvcnNcbiAgICAgICAgICAgICAgICAgICAgLy8gbGFiZWxzXG4gICAgICAgICAgICAgICAgICAgIC8vIGV0Yy5cbiAgICAgICAgICAgICAgICAgICAgc3RhY2suc2VnbWVudGF0aW9uVHlwZSAgICAgPSBzZXJpZXMuc2VnbWVudGF0aW9uVHlwZTtcbiAgICAgICAgICAgICAgICAgICAgc3RhY2suc2VnbWVudGF0aW9uU2VnbWVudHMgPSBzZXJpZXMuc2VnbWVudGF0aW9uU2VnbWVudHM7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBzZXJpZXMuc3RhY2sucHVzaChzdGFjayk7XG4gICAgICAgICAgICAgICAgICAvLyByZWN1cnNpdmUgY2FsbCBmb3IgZWFjaCBmcmFtZVxuICAgICAgICAgICAgICAgICAgLy8gYmV0dGVyIHRoYW4gZm9yIGxvb3AgdG8gYmUgYWJsZSB0byB1cGRhdGUgZG9tIHdpdGggXCJwcm9ncmVzc1wiIGNhbGxiYWNrXG4gICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KHRoaXMucGFyc2VGcmFtZShzZXJpZXMsIHN0YWNrLCByZXNwb25zZS51cmwsIDAsIHZvbHVtZVBhcnNlciwgcmVzb2x2ZSwgcmVqZWN0KSwgMCk7XG4gICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgIH0sMTApO1xuICAgICAgICAgICB9XG4gICAgICAgICk7XG4gIH1cblxuICBwYXJzZUZyYW1lKHNlcmllcywgc3RhY2ssIHVybCwgaSwgZGF0YVBhcnNlciwgcmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgbGV0IGZyYW1lID0gbmV3IE1vZGVsc0ZyYW1lKCk7XG4gICAgZnJhbWUuc29wSW5zdGFuY2VVSUQgICA9IGRhdGFQYXJzZXIuc29wSW5zdGFuY2VVSUQoaSk7XG4gICAgZnJhbWUudXJsICAgICAgICAgICAgICA9IHVybDtcbiAgICBmcmFtZS5yb3dzICAgICAgICAgICAgID0gZGF0YVBhcnNlci5yb3dzKGkpO1xuICAgIGZyYW1lLmNvbHVtbnMgICAg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uYWRkU2NhbGFyKCAtMC41IClcbiAgICAgIC5hcHBseU1hdHJpeDQodGhpcy5faWprMkxQUyk7XG4gICAgcmV0dXJuIGNlbnRlcjtcblxuICB9XG5cbiAgd29ybGRCb3VuZGluZ0JveCgpIHtcblxuICAgIGxldCBiYm94ID0gW1xuICAgICAgTnVtYmVyLk1BWF9WQUxVRSwgTnVtYmVyLk1JTl9WQUxVRSxcbiAgICAgIE51bWJlci5NQVhfVkFMVUUsIE51bWJlci5NSU5fVkFMVUUsXG4gICAgICBOdW1iZXIuTUFYX1ZBTFVFLCBOdW1iZXIuTUlOX1ZBTFVFXG4gICAgXTtcblxuICAgIGZvciAoIGxldCBpID0gMDsgaSA8PSB0aGlzLl9kaW1lbnNpb25zSUpLLng7IGkgKz0gdGhpcy5fZGltZW5zaW9uc0lKSy54ICkge1xuICAgICAgZm9yICggbGV0IGogPSAwOyBqIDw9IHRoaXMuX2RpbWVuc2lvbnNJSksueTsgaiArPSB0aGlzLl9kaW1lbnNpb25zSUpLLnkgKSB7XG4gICAgICAgIGZvciAobGV0IGsgPSAwOyBrIDw9IHRoaXMuX2RpbWVuc2lvbnNJSksuejsgayArPSB0aGlzLl9kaW1lbnNpb25zSUpLLnogKSB7XG5cbiAgICAgICAgICBsZXQgd29ybGQgPSBuZXcgVEhSRUUuVmVjdG9yMyggaSwgaiwgayApLmFwcGx5TWF0cml4NCggdGhpcy5faWprMkxQUyApO1xuICAgICAgICAgIGJib3ggPSBbXG4gICAgICAgICAgICBNYXRoLm1pbihiYm94WzBdLCB3b3JsZC54KSwgTWF0aC5tYXgoYmJveFsxXSwgd29ybGQueCksIC8vIHggbWluL21heFxuICAgICAgICAgICAgTWF0aC5taW4oYmJveFsyXSwgd29ybGQueSksIE1hdGgubWF4KGJib3hbM10sIHdvcmxkLnkpLFxuICAgICAgICAgICAgTWF0aC5taW4oYmJveFs0XSwgd29ybGQueiksIE1hdGgubWF4KGJib3hbNV0sIHdvcmxkLnopXG4gICAgICAgICAgICB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WNrLl9mcmFtZVtpamtDb29yZGluYXRlLnpdLnZhbHVlKFxuICAgICAgICBpamtDb29yZGluYXRlLngsXG4gICAgICAgIGlqa0Nvb3JkaW5hdGUueSApO1xuXG4gICAgfSBlbHNlIHtcblxuICAgICAgcmV0dXJuIG51bGw7XG5cbiAgICB9XG5cbiAgfVxuXG4gIHN0YXRpYyB2YWx1ZVJlc2NhbGVTbG9wZUludGVyY2VwdCggdmFsdWUsIHNsb3BlLCBpbnRlcmNlcHQgKSB7XG5cbiAgICByZXR1cm4gdmFsdWUgKiBzbG9wZSArIGludGVyY2VwdDtcblxuICB9XG5cbiAgc3RhdGljIGluZGV4SW5EaW1lbnNpb25zKCBpbmRleCwgZGltZW5zaW9ucyApIHtcblxuICAgIGlmICggaW5kZXgueCA+PSAwICYmXG4gICAgICAgICBpbmRleC55ID49IDAgJiZcbiAgICAgICAgIGluZGV4LnogPj0gMCAmJlxuICAgICAgICAgaW5kZXgueCA8IGRpbWVuc2lvbnMueCAmJlxuICAgICAgICAgaW5kZXgueSA8IGRpbWVuc2lvbnMueSAmJlxuICAgICAgICAgaW5kZXgueiA8IGRpbWVuc2lvbnMueiApIHtcblxuICAgICAgcmV0dXJuIHRydWU7XG5cbiAgICB9XG5cbiAgICByZXR1cm4gZmFsc2U7XG5cbiAgfVxuXG4gIF92ZWN0b3IzRnJvbUFycmF5KGFycmF5LCBpbmRleCkge1xuICAgIHJldHVybiBuZXcgVEhSRUUuVmVjdG9yMyhcbiAgICAgIGFycmF5W2luZGV4XSxcbiAgICAgIGFycmF5W2luZGV4ICsgMV0sXG4gICAgICBhcnJheVtpbmRleCArIDJdXG4gICAgICApO1xuICB9XG5cbiAgX29yZGVyRnJhbWVPbkRpbWVuc2lvbkluZGljZXNBcnJheVNvcnQoYSwgYikge1xuXG4gICAgaWYgKCdkaW1lbnNpb25JbmRleFZhbHVlcycgaW4gYSAmJiBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwoYS5kaW1lbnNpb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ICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDIgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAzOlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDMgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA0OlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDQgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA1OlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDUgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA2OlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDYgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSA3OlxuICAgICAgICAgICAgICBuZXdBcnJheVtpbmRleF0gPSB0YXJnZXRCdWZmZXJbaV0gPj4+IDcgJiAweDAwMDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgYml0U3RhcnRPZmZzZXQrKztcbiAgICAgICAgICBpbmRleCsrO1xuICAgICAgICAgIC8vIGlmIHJldHVybi4uXG4gICAgICAgICAgaWYgKGluZGV4ID49IG51bVBpeGVscykge1xuICAgICAgICAgICAgcmV0dXJuIG5ld0FycmF5O1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBiaXRTdGFydE9mZnNld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Ekvc3JjL2l0a05pZnRpSW1hZ2VJTy5jeHhcbiAgICAgIHZhciBhID0gMC4wLCBiID0gdGhpcy5fZGF0YVNldC5xdWF0ZXJuX2IsIGMgPSB0aGlzLl9kYXRhU2V0LnF1YXRlcm5fYywgZCA9IHRoaXMuX2RhdGFTZXQucXVhdGVybl9kO1xuICAgICAgLy8gY29tcHV0ZSBhXG4gICAgICBhID0gMS4wIC0gKGIqYiArIGMqYyArIGQqZCkgO1xuICAgICAgaWYoIGEgPCAwLjAwMDAwMDEgKXsgICAgICAgICAgICAgICAgICAgLyogc3BlY2lhbCBjYXNlICovXG5cbiAgICAgICAgYSA9IDEuMCAvIE1hdGguc3FydChiKmIrYypjK2QqZCkgO1xuICAgICAgICBiICo9IGEgOyBjICo9IGEgOyBkICo9IGEgOyAgICAgICAgLyogbm9ybWFsaXplIChiLGMsZCkgdmVjdG9yICovXG4gICAgICAgIGEgPSAwLjA7ICAgICAgICAgICAgICAgICAgICAgICAvKiBhID0gMCA9PT4gMTgwIGRlZ3JlZSByb3RhdGlvbiAqL1xuXG4gICAgICB9IGVsc2Uge1xuXG4gICAgICAgIGEgPSBNYXRoLnNxcnQoYSkgOyAgICAgICAgICAgICAgICAgICAgIC8qIGFuZ2xlID0gMiphcmNjb3MoYSkgKi9cblxuICAgICAgfVxuXG4gICAgICBpZih0aGlzLl9kYXRhU2V0LnBpeERpbXNbMF0gPCAwLjApIHtcblxuICAgICAgICB0aGlzLl9yaWdodEhhbmRlZCA9IGZhbHNlO1xuXG4gICAgICB9XG5cbiAgICAgICByZXR1cm4gW1xuICAgICAgICAgIC0oYSphK2IqYi1jKmMtZCpkKSxcbiAgICAgICAgICAtMiooYipjK2EqZCksXG4gICAgICAgICAgMiooYipkLWEqYyksXG4gICAgICAgICAgLTIqKGIqYy1hKmQpLFxuICAgICAgICAgIC0oYSphK2MqYy1iKmItZCpkKSxcbiAgICAgICAgICAyKihjKmQrYSpiKVxuICAgICAgICBdO1xuXG4gICAgfWVsc2Ug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S5sb2codGhpcyk7XG4gIH1cblxuICBfZGVjb21wcmVzc1VuY29tcHJlc3NlZChmcmFtZUluZGV4ID0gMCkge1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9VSU5UOCAgICAgICAgICAgPSAyO1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9JTlQxNiAgICAgICAgICAgPSA0O1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9JTlQzMiAgICAgICAgICAgPSA4O1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9GTE9BVDMyICAgICAgICA9IDE2O1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9DT01QTEVYNjQgICAgICA9IDMyO1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9GTE9BVDY0ICAgICAgICA9IDY0O1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9SR0IyNCAgICAgICAgID0gMTI4O1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9JTlQ4ICAgICAgICAgID0gMjU2O1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9VSU5UMTYgICAgICAgID0gNTEyO1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9VSU5UMzIgICAgICAgID0gNzY4O1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9JTlQ2NCAgICAgICAgPSAxMDI0O1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9VSU5UNjQgICAgICAgPSAxMjgwO1xuICAgIC8vIHBhcGF5YS52b2x1bWUubmlmdGkuTklGVElfVFlQRV9GTE9BVDEyOCAgICAgPSAxNTM2O1xuICAg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ICAgICAndVRleHR1cmVMVVQnOntcbiAgICAgICAgdHlwZTogJ3QnLFxuICAgICAgICB2YWx1ZTogW10sXG4gICAgICAgIHR5cGVHTFNMOiAnc2FtcGxlcjJEJ1xuICAgICAgfSxcbiAgICAgICd1UGl4ZWxUeXBlJzoge1xuICAgICAgICB0eXBlOiAnaScsXG4gICAgICAgIHZhbHVlOiAwLFxuICAgICAgICB0eXBlR0xTTDogJ2ludCdcbiAgICAgIH0sXG4gICAgICAndVBhY2tlZFBlclBpeGVsJzoge1xuICAgICAgICB0eXBlOiAnaScsXG4gICAgICAgIHZhbHVlOiAxLFxuICAgICAgICB0eXBlR0xTTDogJ2ludCdcbiAgICAgIH0sXG4gICAgICAndUludGVycG9sYXRpb24nOiB7XG4gICAgICAgIHR5cGU6ICdpJyxcbiAgICAgICAgdmFsdWU6IDEsXG4gICAgICAgIHR5cGVHTFNMOiAnaW50J1xuICAgICAgfSxcbiAgICAgICd1V29ybGRCQm94Jzoge1xuICAgICAgICB0eXBlOiAnZnYxJyxcbiAgICAgICAgdmFsdWU6IFswLjAsIDAuMCwgMC4wLCAwLjAsIDAuMCwgMC4wXSxcbiAgICAgICAgdHlwZUdMU0w6ICdmbG9hdCcsXG4gICAgICAgIGxlbmd0aDogNlxuICAgICAgfSxcbiAgICAgICd1U3RlcHMnOiB7XG4gICAgICAgIHR5cGU6ICdpJyxcbiAgICAgICAgdmFsdWU6IDI1NixcbiAgICAgICAgdHlwZUdMU0w6ICdpbnQnXG4gICAgICB9LFxuICAgICAgJ3VBbHBoYUNvcnJlY3Rpb24nOntcbiAgICAgICAgdHlwZTogJ2YnLFxuICAgICAgICB2YWx1ZTogMC41LFxuICAgICAgICB0eXBlR0xTTDogJ2Zsb2F0J1xuICAgICAgfSxcbiAgICAgICd1RnJlcXVlbmNlJzp7XG4gICAgICAgIHR5cGU6ICdmJyxcbiAgICAgICAgdmFsdWU6IDAuMCxcbiAgICAgICAgdHlwZUdMU0w6ICdmbG9hdCdcbiAgICAg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G9tTWVhc3VyZW1lbnRzID0gc2hvd0RvbU1lYXN1cmVtZW50cztcbiAgICB0aGlzLnVwZGF0ZSgpO1xuICB9XG5cbiAgZ2V0IHNob3dEb21NZWFzdXJlbWVudHMoKSB7XG4gICAgcmV0dXJuIHRoaXMuX3Nob3dEb21NZWFzdXJlbWVudHM7XG4gIH1cbn1cbiJdfQ== diff --git a/build/ami.min.js b/build/ami.min.js index 1d43d0164..0ac2e2fd3 100644 --- a/build/ami.min.js +++ b/build/ami.min.js @@ -12,13 +12,14 @@ this.affine=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];this.magic=0;this.extensio totalLen*=sizes[i]}buf8=new Uint8Array(buffer);str=String.fromCharCode.apply(null,buf8);strList=str.split(whitespaceDataValueListSeparatorRE);if(strList.lengthtotalLen){if(strList[0]==="")strList=strList.slice(1);strList=strList.slice(0,totalLen)}switch(type){case"int8":return new Int8Array(strList.map(parseNRRDInteger));case"uint8":return new Uint8Array(strList.map(parseNRRDInteger));case"int16":return new Int16Array(strList.map(parseNRRDInteger));case"uint16":return new Uint16Array(strList.map(parseNRRDInteger));case"int32":return new Int32Array(strList.map(parseNRRDInteger));case"uint32":return new Uint32Array(strList.map(parseNRRDInteger));case"float":return new Float32Array(strList.map(parseNRRDFloat));case"double":return new Float64Array(strList.map(parseNRRDFloat));default:console.warn("Unsupported NRRD type: "+type+".");return undefined}}function getNRRDTypeSize(type){switch(type){case"int8":return 1;case"uint8":return 1;case"int16":return 2;case"uint16":return 2;case"int32":return 4;case"uint32":return 4;case"int64":return 8;case"uint64":return 8;case"float":return 4;case"double":return 8;default:throw new Error("Do not know the size of NRRD type: "+type)}}function checkNRRD(ret){if(ret.dimension===undefined){throw new Error("Dimension missing from NRRD file!")}else if(ret.type===undefined){throw new Error("Type missing from NRRD file!")}else if(ret.encoding===undefined){throw new Error("Encoding missing from NRRD file!")}else if(ret.sizes===undefined){throw new Error("Sizes missing from NRRD file!")}if(ret.type!="block"&&ret.type!="int8"&&ret.type!="uint8"&&ret.encoding!="ascii"&&ret.endian===undefined){throw new Error("Endianness missing from NRRD file!")}else if(ret.type=="block"&&ret.blockSize===undefined){throw new Error("Missing block size in NRRD file!")}if(ret.dimension===0){throw new Error("Zero-dimensional NRRD file?")}else if(ret.dimension!=ret.sizes.length){throw new Error("Length of 'sizes' is different from 'dimension' in an NRRD file!")}else if(ret.spacings&&ret.dimension!=ret.spacings.length){throw new Error("Length of 'spacings' is different from 'dimension' in an NRRD file!")}else if(ret.thicknesses&&ret.dimension!=ret.thicknesses.length){throw new Error("Length of 'thicknesses' is different from 'dimension' in an NRRD file!")}else if(ret.axisMins&&ret.dimension!=ret.axisMins.length){throw new Error("Length of 'axis mins' is different from 'dimension' in an NRRD file!")}else if(ret.axisMaxs&&ret.dimension!=ret.axisMaxs.length){throw new Error("Length of 'axis maxs' is different from 'dimension' in an NRRD file!")}else if(ret.centers&&ret.dimension!=ret.centers.length){throw new Error("Length of 'centers' is different from 'dimension' in an NRRD file!")}else if(ret.labels&&ret.dimension!=ret.labels.length){throw new Error("Length of 'labels' is different from 'dimension' in an NRRD file!")}else if(ret.units&&ret.dimension!=ret.units.length){throw new Error("Length of 'units' is different from 'dimension' in an NRRD file!")}else if(ret.kinds&&ret.dimension!=ret.kinds.length){throw new Error("Length of 'kinds' is different from 'dimension' in an NRRD file!")}if((ret.data===undefined||ret.data.length===0)&&(ret.buffer===undefined||ret.buffer.byteLength===0)&&ret.dataFile===undefined){throw new Error("NRRD file has neither inline or external data!")}}function castTypedArray(data,type){switch(type){case"int8":return new Int8Array(data);case"uint8":return new Uint8Array(data);case"int16":return new Int16Array(data);case"uint16":return new Uint16Array(data);case"int32":return new Int32Array(data);case"uint32":return new Uint32Array(data);case"float":return new Float32Array(data);case"double":return new Float64Array(data);default:throw new Error("Cannot cast to NRRD type: "+type)}}function serializeToBuffer(data,type,endian){var i,endianFlag,view,nativeSize=getNRRDTypeSize(type),buffer=new ArrayBuffer(data.length*nativeSize);switch(endian){case"big":endianFlag=false;break;case"little":endianFlag=true;break;default:console.warn("Unsupported endianness in NRRD file: "+endian);return undefined}view=new DataView(buffer);switch(type){case"int8":for(i=0;i0){opt.windowBits=-opt.windowBits}else if(opt.gzip&&opt.windowBits>0&&opt.windowBits<16){opt.windowBits+=16}this.err=0;this.msg="";this.ended=false;this.chunks=[];this.strm=new ZStream;this.strm.avail_out=0;var status=zlib_deflate.deflateInit2(this.strm,opt.level,opt.method,opt.windowBits,opt.memLevel,opt.strategy);if(status!==Z_OK){throw new Error(msg[status])}if(opt.header){zlib_deflate.deflateSetHeader(this.strm,opt.header)}if(opt.dictionary){var dict;if(typeof opt.dictionary==="string"){dict=strings.string2buf(opt.dictionary)}else if(toString.call(opt.dictionary)==="[object ArrayBuffer]"){dict=new Uint8Array(opt.dictionary)}else{dict=opt.dictionary}status=zlib_deflate.deflateSetDictionary(this.strm,dict);if(status!==Z_OK){throw new Error(msg[status])}this._dict_set=true}}Deflate.prototype.push=function(data,mode){var strm=this.strm;var chunkSize=this.options.chunkSize;var status,_mode;if(this.ended){return false}_mode=mode===~~mode?mode:mode===true?Z_FINISH:Z_NO_FLUSH;if(typeof data==="string"){strm.input=strings.string2buf(data)}else if(toString.call(data)==="[object ArrayBuffer]"){strm.input=new Uint8Array(data)}else{strm.input=data}strm.next_in=0;strm.avail_in=strm.input.length;do{if(strm.avail_out===0){strm.output=new utils.Buf8(chunkSize);strm.next_out=0;strm.avail_out=chunkSize}status=zlib_deflate.deflate(strm,_mode);if(status!==Z_STREAM_END&&status!==Z_OK){this.onEnd(status);this.ended=true;return false}if(strm.avail_out===0||strm.avail_in===0&&(_mode===Z_FINISH||_mode===Z_SYNC_FLUSH)){if(this.options.to==="string"){this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output,strm.next_out)))}else{this.onData(utils.shrinkBuf(strm.output,strm.next_out))}}}while((strm.avail_in>0||strm.avail_out===0)&&status!==Z_STREAM_END);if(_mode===Z_FINISH){status=zlib_deflate.deflateEnd(this.strm);this.onEnd(status);this.ended=true;return status===Z_OK}if(_mode===Z_SYNC_FLUSH){this.onEnd(Z_OK);strm.avail_out=0;return true}return true};Deflate.prototype.onData=function(chunk){this.chunks.push(chunk)};Deflate.prototype.onEnd=function(status){if(status===Z_OK){if(this.options.to==="string"){this.result=this.chunks.join("")}else{this.result=utils.flattenChunks(this.chunks)}}this.chunks=[];this.err=status;this.msg=this.strm.msg};function deflate(input,options){var deflator=new Deflate(options);deflator.push(input,true);if(deflator.err){throw deflator.msg}return deflator.result}function deflateRaw(input,options){options=options||{};options.raw=true;return deflate(input,options)}function gzip(input,options){options=options||{};options.gzip=true;return deflate(input,options)}exports.Deflate=Deflate;exports.deflate=deflate;exports.deflateRaw=deflateRaw;exports.gzip=gzip},{"./utils/common":54,"./utils/strings":55,"./zlib/deflate":59,"./zlib/messages":64,"./zlib/zstream":66}],53:[function(require,module,exports){"use strict";var zlib_inflate=require("./zlib/inflate");var utils=require("./utils/common");var strings=require("./utils/strings");var c=require("./zlib/constants");var msg=require("./zlib/messages");var ZStream=require("./zlib/zstream");var GZheader=require("./zlib/gzheader");var toString=Object.prototype.toString;function Inflate(options){if(!(this instanceof Inflate))return new Inflate(options);this.options=utils.assign({chunkSize:16384,windowBits:0,to:""},options||{});var opt=this.options;if(opt.raw&&opt.windowBits>=0&&opt.windowBits<16){opt.windowBits=-opt.windowBits;if(opt.windowBits===0){opt.windowBits=-15}}if(opt.windowBits>=0&&opt.windowBits<16&&!(options&&options.windowBits)){opt.windowBits+=32}if(opt.windowBits>15&&opt.windowBits<48){if((opt.windowBits&15)===0){opt.windowBits|=15}}this.err=0;this.msg="";this.ended=false;this.chunks=[];this.strm=new ZStream;this.strm.avail_out=0;var status=zlib_inflate.inflateInit2(this.strm,opt.windowBits);if(status!==c.Z_OK){throw new Error(msg[status])}this.header=new GZheader;zlib_inflate.inflateGetHeader(this.strm,this.header)}Inflate.prototype.push=function(data,mode){var strm=this.strm;var chunkSize=this.options.chunkSize;var dictionary=this.options.dictionary;var status,_mode;var next_out_utf8,tail,utf8str;var dict;var allowBufError=false;if(this.ended){return false}_mode=mode===~~mode?mode:mode===true?c.Z_FINISH:c.Z_NO_FLUSH;if(typeof data==="string"){strm.input=strings.binstring2buf(data)}else if(toString.call(data)==="[object ArrayBuffer]"){strm.input=new Uint8Array(data)}else{strm.input=data}strm.next_in=0;strm.avail_in=strm.input.length;do{if(strm.avail_out===0){strm.output=new utils.Buf8(chunkSize);strm.next_out=0;strm.avail_out=chunkSize}status=zlib_inflate.inflate(strm,c.Z_NO_FLUSH);if(status===c.Z_NEED_DICT&&dictionary){if(typeof dictionary==="string"){dict=strings.string2buf(dictionary)}else if(toString.call(dictionary)==="[object ArrayBuffer]"){dict=new Uint8Array(dictionary)}else{dict=dictionary}status=zlib_inflate.inflateSetDictionary(this.strm,dict)}if(status===c.Z_BUF_ERROR&&allowBufError===true){status=c.Z_OK;allowBufError=false}if(status!==c.Z_STREAM_END&&status!==c.Z_OK){this.onEnd(status);this.ended=true;return false}if(strm.next_out){if(strm.avail_out===0||status===c.Z_STREAM_END||strm.avail_in===0&&(_mode===c.Z_FINISH||_mode===c.Z_SYNC_FLUSH)){if(this.options.to==="string"){next_out_utf8=strings.utf8border(strm.output,strm.next_out);tail=strm.next_out-next_out_utf8;utf8str=strings.buf2string(strm.output,next_out_utf8);strm.next_out=tail;strm.avail_out=chunkSize-tail;if(tail){utils.arraySet(strm.output,strm.output,next_out_utf8,tail,0)}this.onData(utf8str)}else{this.onData(utils.shrinkBuf(strm.output,strm.next_out))}}}if(strm.avail_in===0&&strm.avail_out===0){allowBufError=true}}while((strm.avail_in>0||strm.avail_out===0)&&status!==c.Z_STREAM_END);if(status===c.Z_STREAM_END){_mode=c.Z_FINISH}if(_mode===c.Z_FINISH){status=zlib_inflate.inflateEnd(this.strm);this.onEnd(status);this.ended=true;return status===c.Z_OK}if(_mode===c.Z_SYNC_FLUSH){this.onEnd(c.Z_OK);strm.avail_out=0;return true}return true};Inflate.prototype.onData=function(chunk){this.chunks.push(chunk)};Inflate.prototype.onEnd=function(status){if(status===c.Z_OK){if(this.options.to==="string"){this.result=this.chunks.join("")}else{this.result=utils.flattenChunks(this.chunks)}}this.chunks=[];this.err=status;this.msg=this.strm.msg};function inflate(input,options){var inflator=new Inflate(options);inflator.push(input,true);if(inflator.err){throw inflator.msg}return inflator.result}function inflateRaw(input,options){options=options||{};options.raw=true;return inflate(input,options)}exports.Inflate=Inflate;exports.inflate=inflate;exports.inflateRaw=inflateRaw;exports.ungzip=inflate},{"./utils/common":54,"./utils/strings":55,"./zlib/constants":57,"./zlib/gzheader":60,"./zlib/inflate":62,"./zlib/messages":64,"./zlib/zstream":66}],54:[function(require,module,exports){"use strict";var TYPED_OK=typeof Uint8Array!=="undefined"&&typeof Uint16Array!=="undefined"&&typeof Int32Array!=="undefined";exports.assign=function(obj){var sources=Array.prototype.slice.call(arguments,1);while(sources.length){var source=sources.shift();if(!source){continue}if(typeof source!=="object"){throw new TypeError(source+"must be non-object")}for(var p in source){if(source.hasOwnProperty(p)){obj[p]=source[p]}}}return obj};exports.shrinkBuf=function(buf,size){if(buf.length===size){return buf}if(buf.subarray){return buf.subarray(0,size)}buf.length=size;return buf};var fnTyped={arraySet:function(dest,src,src_offs,len,dest_offs){if(src.subarray&&dest.subarray){dest.set(src.subarray(src_offs,src_offs+len),dest_offs);return}for(var i=0;i=252?6:q>=248?5:q>=240?4:q>=224?3:q>=192?2:1}_utf8len[254]=_utf8len[254]=1;exports.string2buf=function(str){var buf,c,c2,m_pos,i,str_len=str.length,buf_len=0;for(m_pos=0;m_pos>>6;buf[i++]=128|c&63}else if(c<65536){buf[i++]=224|c>>>12;buf[i++]=128|c>>>6&63;buf[i++]=128|c&63}else{buf[i++]=240|c>>>18;buf[i++]=128|c>>>12&63;buf[i++]=128|c>>>6&63;buf[i++]=128|c&63}}return buf};function buf2binstring(buf,len){if(len<65537){if(buf.subarray&&STR_APPLY_UIA_OK||!buf.subarray&&STR_APPLY_OK){return String.fromCharCode.apply(null,utils.shrinkBuf(buf,len))}}var result="";for(var i=0;i4){utf16buf[out++]=65533;i+=c_len-1;continue}c&=c_len===2?31:c_len===3?15:7;while(c_len>1&&i1){utf16buf[out++]=65533;continue}if(c<65536){utf16buf[out++]=c}else{c-=65536;utf16buf[out++]=55296|c>>10&1023;utf16buf[out++]=56320|c&1023}}return buf2binstring(utf16buf,out)};exports.utf8border=function(buf,max){var pos;max=max||buf.length;if(max>buf.length){max=buf.length}pos=max-1;while(pos>=0&&(buf[pos]&192)===128){pos--}if(pos<0){return max}if(pos===0){return max}return pos+_utf8len[buf[pos]]>max?pos:max}},{"./common":54}],56:[function(require,module,exports){arguments[4][6][0].apply(exports,arguments)},{dup:6}],57:[function(require,module,exports){"use strict";module.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],58:[function(require,module,exports){"use strict";function makeTable(){var c,table=[];for(var n=0;n<256;n++){c=n;for(var k=0;k<8;k++){c=c&1?3988292384^c>>>1:c>>>1}table[n]=c}return table}var crcTable=makeTable();function crc32(crc,buf,len,pos){var t=crcTable,end=pos+len;crc^=-1;for(var i=pos;i>>8^t[(crc^buf[i])&255]}return crc^-1}module.exports=crc32},{}],59:[function(require,module,exports){"use strict";var utils=require("../utils/common");var trees=require("./trees");var adler32=require("./adler32");var crc32=require("./crc32");var msg=require("./messages");var Z_NO_FLUSH=0;var Z_PARTIAL_FLUSH=1;var Z_FULL_FLUSH=3;var Z_FINISH=4;var Z_BLOCK=5;var Z_OK=0;var Z_STREAM_END=1;var Z_STREAM_ERROR=-2;var Z_DATA_ERROR=-3;var Z_BUF_ERROR=-5;var Z_DEFAULT_COMPRESSION=-1;var Z_FILTERED=1;var Z_HUFFMAN_ONLY=2;var Z_RLE=3;var Z_FIXED=4;var Z_DEFAULT_STRATEGY=0;var Z_UNKNOWN=2;var Z_DEFLATED=8;var MAX_MEM_LEVEL=9;var MAX_WBITS=15;var DEF_MEM_LEVEL=8;var LENGTH_CODES=29;var LITERALS=256;var L_CODES=LITERALS+1+LENGTH_CODES;var D_CODES=30;var BL_CODES=19;var HEAP_SIZE=2*L_CODES+1;var MAX_BITS=15;var MIN_MATCH=3;var MAX_MATCH=258;var MIN_LOOKAHEAD=MAX_MATCH+MIN_MATCH+1;var PRESET_DICT=32;var INIT_STATE=42;var EXTRA_STATE=69;var NAME_STATE=73;var COMMENT_STATE=91;var HCRC_STATE=103;var BUSY_STATE=113;var FINISH_STATE=666;var BS_NEED_MORE=1;var BS_BLOCK_DONE=2;var BS_FINISH_STARTED=3;var BS_FINISH_DONE=4;var OS_CODE=3;function err(strm,errorCode){strm.msg=msg[errorCode];return errorCode}function rank(f){return(f<<1)-(f>4?9:0)}function zero(buf){var len=buf.length;while(--len>=0){buf[len]=0}}function flush_pending(strm){var s=strm.state;var len=s.pending;if(len>strm.avail_out){len=strm.avail_out}if(len===0){return}utils.arraySet(strm.output,s.pending_buf,s.pending_out,len,strm.next_out);strm.next_out+=len;s.pending_out+=len;strm.total_out+=len;strm.avail_out-=len;s.pending-=len;if(s.pending===0){s.pending_out=0}}function flush_block_only(s,last){trees._tr_flush_block(s,s.block_start>=0?s.block_start:-1,s.strstart-s.block_start,last);s.block_start=s.strstart;flush_pending(s.strm)}function put_byte(s,b){s.pending_buf[s.pending++]=b}function putShortMSB(s,b){s.pending_buf[s.pending++]=b>>>8&255;s.pending_buf[s.pending++]=b&255}function read_buf(strm,buf,start,size){var len=strm.avail_in;if(len>size){len=size}if(len===0){return 0}strm.avail_in-=len;utils.arraySet(buf,strm.input,strm.next_in,len,start);if(strm.state.wrap===1){strm.adler=adler32(strm.adler,buf,len,start)}else if(strm.state.wrap===2){strm.adler=crc32(strm.adler,buf,len,start)}strm.next_in+=len;strm.total_in+=len;return len}function longest_match(s,cur_match){var chain_length=s.max_chain_length;var scan=s.strstart;var match;var len;var best_len=s.prev_length;var nice_match=s.nice_match;var limit=s.strstart>s.w_size-MIN_LOOKAHEAD?s.strstart-(s.w_size-MIN_LOOKAHEAD):0;var _win=s.window;var wmask=s.w_mask;var prev=s.prev;var strend=s.strstart+MAX_MATCH;var scan_end1=_win[scan+best_len-1];var scan_end=_win[scan+best_len];if(s.prev_length>=s.good_match){chain_length>>=2}if(nice_match>s.lookahead){nice_match=s.lookahead}do{match=cur_match;if(_win[match+best_len]!==scan_end||_win[match+best_len-1]!==scan_end1||_win[match]!==_win[scan]||_win[++match]!==_win[scan+1]){continue}scan+=2;match++;do{}while(_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&scanbest_len){s.match_start=cur_match;best_len=len;if(len>=nice_match){break}scan_end1=_win[scan+best_len-1];scan_end=_win[scan+best_len]}}while((cur_match=prev[cur_match&wmask])>limit&&--chain_length!==0);if(best_len<=s.lookahead){return best_len}return s.lookahead}function fill_window(s){var _w_size=s.w_size;var p,n,m,more,str;do{more=s.window_size-s.lookahead-s.strstart;if(s.strstart>=_w_size+(_w_size-MIN_LOOKAHEAD)){utils.arraySet(s.window,s.window,_w_size,_w_size,0);s.match_start-=_w_size;s.strstart-=_w_size;s.block_start-=_w_size;n=s.hash_size;p=n;do{m=s.head[--p];s.head[p]=m>=_w_size?m-_w_size:0}while(--n);n=_w_size;p=n;do{m=s.prev[--p];s.prev[p]=m>=_w_size?m-_w_size:0}while(--n);more+=_w_size}if(s.strm.avail_in===0){break}n=read_buf(s.strm,s.window,s.strstart+s.lookahead,more);s.lookahead+=n;if(s.lookahead+s.insert>=MIN_MATCH){str=s.strstart-s.insert;s.ins_h=s.window[str];s.ins_h=(s.ins_h<s.pending_buf_size-5){max_block_size=s.pending_buf_size-5}for(;;){if(s.lookahead<=1){fill_window(s);if(s.lookahead===0&&flush===Z_NO_FLUSH){return BS_NEED_MORE}if(s.lookahead===0){break}}s.strstart+=s.lookahead;s.lookahead=0;var max_start=s.block_start+max_block_size;if(s.strstart===0||s.strstart>=max_start){s.lookahead=s.strstart-max_start;s.strstart=max_start;flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE}}if(s.strstart-s.block_start>=s.w_size-MIN_LOOKAHEAD){flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE}}}s.insert=0;if(flush===Z_FINISH){flush_block_only(s,true);if(s.strm.avail_out===0){return BS_FINISH_STARTED}return BS_FINISH_DONE}if(s.strstart>s.block_start){flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE}}return BS_NEED_MORE}function deflate_fast(s,flush){var hash_head;var bflush;for(;;){if(s.lookahead=MIN_MATCH){s.ins_h=(s.ins_h<=MIN_MATCH){bflush=trees._tr_tally(s,s.strstart-s.match_start,s.match_length-MIN_MATCH);s.lookahead-=s.match_length;if(s.match_length<=s.max_lazy_match&&s.lookahead>=MIN_MATCH){s.match_length--;do{s.strstart++;s.ins_h=(s.ins_h<=MIN_MATCH){s.ins_h=(s.ins_h<4096)){s.match_length=MIN_MATCH-1}}if(s.prev_length>=MIN_MATCH&&s.match_length<=s.prev_length){max_insert=s.strstart+s.lookahead-MIN_MATCH;bflush=trees._tr_tally(s,s.strstart-1-s.prev_match,s.prev_length-MIN_MATCH);s.lookahead-=s.prev_length-1;s.prev_length-=2;do{if(++s.strstart<=max_insert){s.ins_h=(s.ins_h<=MIN_MATCH&&s.strstart>0){scan=s.strstart-1;prev=_win[scan];if(prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]){strend=s.strstart+MAX_MATCH;do{}while(prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&scans.lookahead){s.match_length=s.lookahead}}}if(s.match_length>=MIN_MATCH){bflush=trees._tr_tally(s,1,s.match_length-MIN_MATCH);s.lookahead-=s.match_length;s.strstart+=s.match_length;s.match_length=0}else{bflush=trees._tr_tally(s,0,s.window[s.strstart]);s.lookahead--;s.strstart++}if(bflush){flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE}}}s.insert=0;if(flush===Z_FINISH){flush_block_only(s,true);if(s.strm.avail_out===0){return BS_FINISH_STARTED}return BS_FINISH_DONE}if(s.last_lit){flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE}}return BS_BLOCK_DONE}function deflate_huff(s,flush){var bflush;for(;;){if(s.lookahead===0){fill_window(s);if(s.lookahead===0){if(flush===Z_NO_FLUSH){return BS_NEED_MORE}break}}s.match_length=0;bflush=trees._tr_tally(s,0,s.window[s.strstart]);s.lookahead--;s.strstart++;if(bflush){flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE}}}s.insert=0;if(flush===Z_FINISH){flush_block_only(s,true);if(s.strm.avail_out===0){return BS_FINISH_STARTED}return BS_FINISH_DONE}if(s.last_lit){flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE}}return BS_BLOCK_DONE}function Config(good_length,max_lazy,nice_length,max_chain,func){this.good_length=good_length;this.max_lazy=max_lazy;this.nice_length=nice_length;this.max_chain=max_chain;this.func=func}var configuration_table;configuration_table=[new Config(0,0,0,0,deflate_stored),new Config(4,4,8,4,deflate_fast),new Config(4,5,16,8,deflate_fast),new Config(4,6,32,32,deflate_fast),new Config(4,4,16,16,deflate_slow),new Config(8,16,32,32,deflate_slow),new Config(8,16,128,128,deflate_slow),new Config(8,32,128,256,deflate_slow),new Config(32,128,258,1024,deflate_slow),new Config(32,258,258,4096,deflate_slow)];function lm_init(s){s.window_size=2*s.w_size;zero(s.head);s.max_lazy_match=configuration_table[s.level].max_lazy;s.good_match=configuration_table[s.level].good_length;s.nice_match=configuration_table[s.level].nice_length;s.max_chain_length=configuration_table[s.level].max_chain;s.strstart=0;s.block_start=0;s.lookahead=0;s.insert=0;s.match_length=s.prev_length=MIN_MATCH-1;s.match_available=0;s.ins_h=0}function DeflateState(){this.strm=null;this.status=0;this.pending_buf=null;this.pending_buf_size=0;this.pending_out=0;this.pending=0;this.wrap=0;this.gzhead=null;this.gzindex=0;this.method=Z_DEFLATED;this.last_flush=-1;this.w_size=0;this.w_bits=0;this.w_mask=0;this.window=null;this.window_size=0;this.prev=null;this.head=null;this.ins_h=0;this.hash_size=0;this.hash_bits=0;this.hash_mask=0;this.hash_shift=0;this.block_start=0;this.match_length=0;this.prev_match=0;this.match_available=0;this.strstart=0;this.match_start=0;this.lookahead=0;this.prev_length=0;this.max_chain_length=0;this.max_lazy_match=0;this.level=0;this.strategy=0;this.good_match=0;this.nice_match=0;this.dyn_ltree=new utils.Buf16(HEAP_SIZE*2);this.dyn_dtree=new utils.Buf16((2*D_CODES+1)*2);this.bl_tree=new utils.Buf16((2*BL_CODES+1)*2);zero(this.dyn_ltree);zero(this.dyn_dtree);zero(this.bl_tree);this.l_desc=null;this.d_desc=null;this.bl_desc=null;this.bl_count=new utils.Buf16(MAX_BITS+1);this.heap=new utils.Buf16(2*L_CODES+1);zero(this.heap);this.heap_len=0;this.heap_max=0;this.depth=new utils.Buf16(2*L_CODES+1);zero(this.depth);this.l_buf=0;this.lit_bufsize=0;this.last_lit=0;this.d_buf=0;this.opt_len=0;this.static_len=0;this.matches=0;this.insert=0;this.bi_buf=0;this.bi_valid=0}function deflateResetKeep(strm){var s;if(!strm||!strm.state){return err(strm,Z_STREAM_ERROR)}strm.total_in=strm.total_out=0;strm.data_type=Z_UNKNOWN;s=strm.state;s.pending=0;s.pending_out=0;if(s.wrap<0){s.wrap=-s.wrap}s.status=s.wrap?INIT_STATE:BUSY_STATE;strm.adler=s.wrap===2?0:1;s.last_flush=Z_NO_FLUSH;trees._tr_init(s);return Z_OK}function deflateReset(strm){var ret=deflateResetKeep(strm);if(ret===Z_OK){lm_init(strm.state)}return ret}function deflateSetHeader(strm,head){if(!strm||!strm.state){return Z_STREAM_ERROR}if(strm.state.wrap!==2){return Z_STREAM_ERROR}strm.state.gzhead=head;return Z_OK}function deflateInit2(strm,level,method,windowBits,memLevel,strategy){if(!strm){return Z_STREAM_ERROR}var wrap=1;if(level===Z_DEFAULT_COMPRESSION){level=6}if(windowBits<0){wrap=0;windowBits=-windowBits}else if(windowBits>15){wrap=2;windowBits-=16}if(memLevel<1||memLevel>MAX_MEM_LEVEL||method!==Z_DEFLATED||windowBits<8||windowBits>15||level<0||level>9||strategy<0||strategy>Z_FIXED){ return err(strm,Z_STREAM_ERROR)}if(windowBits===8){windowBits=9}var s=new DeflateState;strm.state=s;s.strm=strm;s.wrap=wrap;s.gzhead=null;s.w_bits=windowBits;s.w_size=1<>1;s.l_buf=(1+2)*s.lit_bufsize;s.level=level;s.strategy=strategy;s.method=method;return deflateReset(strm)}function deflateInit(strm,level){return deflateInit2(strm,level,Z_DEFLATED,MAX_WBITS,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY)}function deflate(strm,flush){var old_flush,s;var beg,val;if(!strm||!strm.state||flush>Z_BLOCK||flush<0){return strm?err(strm,Z_STREAM_ERROR):Z_STREAM_ERROR}s=strm.state;if(!strm.output||!strm.input&&strm.avail_in!==0||s.status===FINISH_STATE&&flush!==Z_FINISH){return err(strm,strm.avail_out===0?Z_BUF_ERROR:Z_STREAM_ERROR)}s.strm=strm;old_flush=s.last_flush;s.last_flush=flush;if(s.status===INIT_STATE){if(s.wrap===2){strm.adler=0;put_byte(s,31);put_byte(s,139);put_byte(s,8);if(!s.gzhead){put_byte(s,0);put_byte(s,0);put_byte(s,0);put_byte(s,0);put_byte(s,0);put_byte(s,s.level===9?2:s.strategy>=Z_HUFFMAN_ONLY||s.level<2?4:0);put_byte(s,OS_CODE);s.status=BUSY_STATE}else{put_byte(s,(s.gzhead.text?1:0)+(s.gzhead.hcrc?2:0)+(!s.gzhead.extra?0:4)+(!s.gzhead.name?0:8)+(!s.gzhead.comment?0:16));put_byte(s,s.gzhead.time&255);put_byte(s,s.gzhead.time>>8&255);put_byte(s,s.gzhead.time>>16&255);put_byte(s,s.gzhead.time>>24&255);put_byte(s,s.level===9?2:s.strategy>=Z_HUFFMAN_ONLY||s.level<2?4:0);put_byte(s,s.gzhead.os&255);if(s.gzhead.extra&&s.gzhead.extra.length){put_byte(s,s.gzhead.extra.length&255);put_byte(s,s.gzhead.extra.length>>8&255)}if(s.gzhead.hcrc){strm.adler=crc32(strm.adler,s.pending_buf,s.pending,0)}s.gzindex=0;s.status=EXTRA_STATE}}else{var header=Z_DEFLATED+(s.w_bits-8<<4)<<8;var level_flags=-1;if(s.strategy>=Z_HUFFMAN_ONLY||s.level<2){level_flags=0}else if(s.level<6){level_flags=1}else if(s.level===6){level_flags=2}else{level_flags=3}header|=level_flags<<6;if(s.strstart!==0){header|=PRESET_DICT}header+=31-header%31;s.status=BUSY_STATE;putShortMSB(s,header);if(s.strstart!==0){putShortMSB(s,strm.adler>>>16);putShortMSB(s,strm.adler&65535)}strm.adler=1}}if(s.status===EXTRA_STATE){if(s.gzhead.extra){beg=s.pending;while(s.gzindex<(s.gzhead.extra.length&65535)){if(s.pending===s.pending_buf_size){if(s.gzhead.hcrc&&s.pending>beg){strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)}flush_pending(strm);beg=s.pending;if(s.pending===s.pending_buf_size){break}}put_byte(s,s.gzhead.extra[s.gzindex]&255);s.gzindex++}if(s.gzhead.hcrc&&s.pending>beg){strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)}if(s.gzindex===s.gzhead.extra.length){s.gzindex=0;s.status=NAME_STATE}}else{s.status=NAME_STATE}}if(s.status===NAME_STATE){if(s.gzhead.name){beg=s.pending;do{if(s.pending===s.pending_buf_size){if(s.gzhead.hcrc&&s.pending>beg){strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)}flush_pending(strm);beg=s.pending;if(s.pending===s.pending_buf_size){val=1;break}}if(s.gzindexbeg){strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)}if(val===0){s.gzindex=0;s.status=COMMENT_STATE}}else{s.status=COMMENT_STATE}}if(s.status===COMMENT_STATE){if(s.gzhead.comment){beg=s.pending;do{if(s.pending===s.pending_buf_size){if(s.gzhead.hcrc&&s.pending>beg){strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)}flush_pending(strm);beg=s.pending;if(s.pending===s.pending_buf_size){val=1;break}}if(s.gzindexbeg){strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)}if(val===0){s.status=HCRC_STATE}}else{s.status=HCRC_STATE}}if(s.status===HCRC_STATE){if(s.gzhead.hcrc){if(s.pending+2>s.pending_buf_size){flush_pending(strm)}if(s.pending+2<=s.pending_buf_size){put_byte(s,strm.adler&255);put_byte(s,strm.adler>>8&255);strm.adler=0;s.status=BUSY_STATE}}else{s.status=BUSY_STATE}}if(s.pending!==0){flush_pending(strm);if(strm.avail_out===0){s.last_flush=-1;return Z_OK}}else if(strm.avail_in===0&&rank(flush)<=rank(old_flush)&&flush!==Z_FINISH){return err(strm,Z_BUF_ERROR)}if(s.status===FINISH_STATE&&strm.avail_in!==0){return err(strm,Z_BUF_ERROR)}if(strm.avail_in!==0||s.lookahead!==0||flush!==Z_NO_FLUSH&&s.status!==FINISH_STATE){var bstate=s.strategy===Z_HUFFMAN_ONLY?deflate_huff(s,flush):s.strategy===Z_RLE?deflate_rle(s,flush):configuration_table[s.level].func(s,flush);if(bstate===BS_FINISH_STARTED||bstate===BS_FINISH_DONE){s.status=FINISH_STATE}if(bstate===BS_NEED_MORE||bstate===BS_FINISH_STARTED){if(strm.avail_out===0){s.last_flush=-1}return Z_OK}if(bstate===BS_BLOCK_DONE){if(flush===Z_PARTIAL_FLUSH){trees._tr_align(s)}else if(flush!==Z_BLOCK){trees._tr_stored_block(s,0,0,false);if(flush===Z_FULL_FLUSH){zero(s.head);if(s.lookahead===0){s.strstart=0;s.block_start=0;s.insert=0}}}flush_pending(strm);if(strm.avail_out===0){s.last_flush=-1;return Z_OK}}}if(flush!==Z_FINISH){return Z_OK}if(s.wrap<=0){return Z_STREAM_END}if(s.wrap===2){put_byte(s,strm.adler&255);put_byte(s,strm.adler>>8&255);put_byte(s,strm.adler>>16&255);put_byte(s,strm.adler>>24&255);put_byte(s,strm.total_in&255);put_byte(s,strm.total_in>>8&255);put_byte(s,strm.total_in>>16&255);put_byte(s,strm.total_in>>24&255)}else{putShortMSB(s,strm.adler>>>16);putShortMSB(s,strm.adler&65535)}flush_pending(strm);if(s.wrap>0){s.wrap=-s.wrap}return s.pending!==0?Z_OK:Z_STREAM_END}function deflateEnd(strm){var status;if(!strm||!strm.state){return Z_STREAM_ERROR}status=strm.state.status;if(status!==INIT_STATE&&status!==EXTRA_STATE&&status!==NAME_STATE&&status!==COMMENT_STATE&&status!==HCRC_STATE&&status!==BUSY_STATE&&status!==FINISH_STATE){return err(strm,Z_STREAM_ERROR)}strm.state=null;return status===BUSY_STATE?err(strm,Z_DATA_ERROR):Z_OK}function deflateSetDictionary(strm,dictionary){var dictLength=dictionary.length;var s;var str,n;var wrap;var avail;var next;var input;var tmpDict;if(!strm||!strm.state){return Z_STREAM_ERROR}s=strm.state;wrap=s.wrap;if(wrap===2||wrap===1&&s.status!==INIT_STATE||s.lookahead){return Z_STREAM_ERROR}if(wrap===1){strm.adler=adler32(strm.adler,dictionary,dictLength,0)}s.wrap=0;if(dictLength>=s.w_size){if(wrap===0){zero(s.head);s.strstart=0;s.block_start=0;s.insert=0}tmpDict=new utils.Buf8(s.w_size);utils.arraySet(tmpDict,dictionary,dictLength-s.w_size,s.w_size,0);dictionary=tmpDict;dictLength=s.w_size}avail=strm.avail_in;next=strm.next_in;input=strm.input;strm.avail_in=dictLength;strm.next_in=0;strm.input=dictionary;fill_window(s);while(s.lookahead>=MIN_MATCH){str=s.strstart;n=s.lookahead-(MIN_MATCH-1);do{s.ins_h=(s.ins_h<>>24&255)+(q>>>8&65280)+((q&65280)<<8)+((q&255)<<24)}function InflateState(){this.mode=0;this.last=false;this.wrap=0;this.havedict=false;this.flags=0;this.dmax=0;this.check=0;this.total=0;this.head=null;this.wbits=0;this.wsize=0;this.whave=0;this.wnext=0;this.window=null;this.hold=0;this.bits=0;this.length=0;this.offset=0;this.extra=0;this.lencode=null;this.distcode=null;this.lenbits=0;this.distbits=0;this.ncode=0;this.nlen=0;this.ndist=0;this.have=0;this.next=null;this.lens=new utils.Buf16(320);this.work=new utils.Buf16(288);this.lendyn=null;this.distdyn=null;this.sane=0;this.back=0;this.was=0}function inflateResetKeep(strm){var state;if(!strm||!strm.state){return Z_STREAM_ERROR}state=strm.state;strm.total_in=strm.total_out=state.total=0;strm.msg="";if(state.wrap){strm.adler=state.wrap&1}state.mode=HEAD;state.last=0;state.havedict=0;state.dmax=32768;state.head=null;state.hold=0;state.bits=0;state.lencode=state.lendyn=new utils.Buf32(ENOUGH_LENS);state.distcode=state.distdyn=new utils.Buf32(ENOUGH_DISTS);state.sane=1;state.back=-1;return Z_OK}function inflateReset(strm){var state;if(!strm||!strm.state){return Z_STREAM_ERROR}state=strm.state;state.wsize=0;state.whave=0;state.wnext=0;return inflateResetKeep(strm)}function inflateReset2(strm,windowBits){var wrap;var state;if(!strm||!strm.state){return Z_STREAM_ERROR}state=strm.state;if(windowBits<0){wrap=0;windowBits=-windowBits}else{wrap=(windowBits>>4)+1;if(windowBits<48){windowBits&=15}}if(windowBits&&(windowBits<8||windowBits>15)){return Z_STREAM_ERROR}if(state.window!==null&&state.wbits!==windowBits){state.window=null}state.wrap=wrap;state.wbits=windowBits;return inflateReset(strm)}function inflateInit2(strm,windowBits){var ret;var state;if(!strm){return Z_STREAM_ERROR}state=new InflateState;strm.state=state;state.window=null;ret=inflateReset2(strm,windowBits);if(ret!==Z_OK){strm.state=null}return ret}function inflateInit(strm){return inflateInit2(strm,DEF_WBITS)}var virgin=true;var lenfix,distfix;function fixedtables(state){if(virgin){var sym;lenfix=new utils.Buf32(512);distfix=new utils.Buf32(32);sym=0;while(sym<144){state.lens[sym++]=8}while(sym<256){state.lens[sym++]=9}while(sym<280){state.lens[sym++]=7}while(sym<288){state.lens[sym++]=8}inflate_table(LENS,state.lens,0,288,lenfix,0,state.work,{bits:9});sym=0;while(sym<32){state.lens[sym++]=5}inflate_table(DISTS,state.lens,0,32,distfix,0,state.work,{bits:5});virgin=false}state.lencode=lenfix;state.lenbits=9;state.distcode=distfix;state.distbits=5}function updatewindow(strm,src,end,copy){var dist;var state=strm.state;if(state.window===null){state.wsize=1<=state.wsize){utils.arraySet(state.window,src,end-state.wsize,state.wsize,0);state.wnext=0;state.whave=state.wsize}else{dist=state.wsize-state.wnext;if(dist>copy){dist=copy}utils.arraySet(state.window,src,end-copy,dist,state.wnext);copy-=dist;if(copy){utils.arraySet(state.window,src,end-copy,copy,0);state.wnext=copy;state.whave=state.wsize}else{state.wnext+=dist;if(state.wnext===state.wsize){state.wnext=0}if(state.whave>>8&255;state.check=crc32(state.check,hbuf,2,0);hold=0;bits=0;state.mode=FLAGS;break}state.flags=0;if(state.head){state.head.done=false}if(!(state.wrap&1)||(((hold&255)<<8)+(hold>>8))%31){strm.msg="incorrect header check";state.mode=BAD;break}if((hold&15)!==Z_DEFLATED){strm.msg="unknown compression method";state.mode=BAD;break}hold>>>=4;bits-=4;len=(hold&15)+8;if(state.wbits===0){state.wbits=len}else if(len>state.wbits){strm.msg="invalid window size";state.mode=BAD;break}state.dmax=1<>8&1}if(state.flags&512){hbuf[0]=hold&255;hbuf[1]=hold>>>8&255;state.check=crc32(state.check,hbuf,2,0)}hold=0;bits=0;state.mode=TIME;case TIME:while(bits<32){if(have===0){break inf_leave}have--;hold+=input[next++]<>>8&255;hbuf[2]=hold>>>16&255;hbuf[3]=hold>>>24&255;state.check=crc32(state.check,hbuf,4,0)}hold=0;bits=0;state.mode=OS;case OS:while(bits<16){if(have===0){break inf_leave}have--;hold+=input[next++]<>8}if(state.flags&512){hbuf[0]=hold&255;hbuf[1]=hold>>>8&255;state.check=crc32(state.check,hbuf,2,0)}hold=0;bits=0;state.mode=EXLEN;case EXLEN:if(state.flags&1024){while(bits<16){if(have===0){break inf_leave}have--;hold+=input[next++]<>>8&255;state.check=crc32(state.check,hbuf,2,0)}hold=0;bits=0}else if(state.head){state.head.extra=null}state.mode=EXTRA;case EXTRA:if(state.flags&1024){copy=state.length;if(copy>have){copy=have}if(copy){if(state.head){len=state.head.extra_len-state.length;if(!state.head.extra){state.head.extra=new Array(state.head.extra_len)}utils.arraySet(state.head.extra,input,next,copy,len)}if(state.flags&512){state.check=crc32(state.check,input,copy,next)}have-=copy;next+=copy;state.length-=copy}if(state.length){break inf_leave}}state.length=0;state.mode=NAME;case NAME:if(state.flags&2048){if(have===0){break inf_leave}copy=0;do{len=input[next+copy++];if(state.head&&len&&state.length<65536){state.head.name+=String.fromCharCode(len)}}while(len&©>9&1;state.head.done=true}strm.adler=state.check=0;state.mode=TYPE;break;case DICTID:while(bits<32){if(have===0){break inf_leave}have--;hold+=input[next++]<>>=bits&7;bits-=bits&7;state.mode=CHECK;break}while(bits<3){if(have===0){break inf_leave}have--;hold+=input[next++]<>>=1;bits-=1;switch(hold&3){case 0:state.mode=STORED;break;case 1:fixedtables(state);state.mode=LEN_;if(flush===Z_TREES){hold>>>=2;bits-=2;break inf_leave}break;case 2:state.mode=TABLE;break;case 3:strm.msg="invalid block type";state.mode=BAD}hold>>>=2;bits-=2;break;case STORED:hold>>>=bits&7;bits-=bits&7;while(bits<32){if(have===0){break inf_leave}have--;hold+=input[next++]<>>16^65535)){strm.msg="invalid stored block lengths";state.mode=BAD;break}state.length=hold&65535;hold=0;bits=0;state.mode=COPY_;if(flush===Z_TREES){break inf_leave}case COPY_:state.mode=COPY;case COPY:copy=state.length;if(copy){if(copy>have){copy=have}if(copy>left){copy=left}if(copy===0){break inf_leave}utils.arraySet(output,input,next,copy,put);have-=copy;next+=copy;left-=copy;put+=copy;state.length-=copy;break}state.mode=TYPE;break;case TABLE:while(bits<14){if(have===0){break inf_leave}have--;hold+=input[next++]<>>=5;bits-=5;state.ndist=(hold&31)+1;hold>>>=5;bits-=5;state.ncode=(hold&15)+4;hold>>>=4;bits-=4;if(state.nlen>286||state.ndist>30){strm.msg="too many length or distance symbols";state.mode=BAD;break}state.have=0;state.mode=LENLENS;case LENLENS:while(state.have>>=3;bits-=3}while(state.have<19){state.lens[order[state.have++]]=0}state.lencode=state.lendyn;state.lenbits=7;opts={bits:state.lenbits};ret=inflate_table(CODES,state.lens,0,19,state.lencode,0,state.work,opts);state.lenbits=opts.bits;if(ret){strm.msg="invalid code lengths set";state.mode=BAD;break}state.have=0;state.mode=CODELENS;case CODELENS:while(state.have>>24;here_op=here>>>16&255;here_val=here&65535;if(here_bits<=bits){break}if(have===0){break inf_leave}have--;hold+=input[next++]<>>=here_bits;bits-=here_bits;state.lens[state.have++]=here_val}else{if(here_val===16){n=here_bits+2;while(bits>>=here_bits;bits-=here_bits;if(state.have===0){strm.msg="invalid bit length repeat";state.mode=BAD;break}len=state.lens[state.have-1];copy=3+(hold&3);hold>>>=2;bits-=2}else if(here_val===17){n=here_bits+3;while(bits>>=here_bits;bits-=here_bits;len=0;copy=3+(hold&7);hold>>>=3;bits-=3}else{n=here_bits+7;while(bits>>=here_bits;bits-=here_bits;len=0;copy=11+(hold&127);hold>>>=7;bits-=7}if(state.have+copy>state.nlen+state.ndist){strm.msg="invalid bit length repeat";state.mode=BAD;break}while(copy--){state.lens[state.have++]=len}}}if(state.mode===BAD){break}if(state.lens[256]===0){strm.msg="invalid code -- missing end-of-block";state.mode=BAD;break}state.lenbits=9;opts={bits:state.lenbits};ret=inflate_table(LENS,state.lens,0,state.nlen,state.lencode,0,state.work,opts);state.lenbits=opts.bits;if(ret){strm.msg="invalid literal/lengths set";state.mode=BAD;break}state.distbits=6;state.distcode=state.distdyn;opts={bits:state.distbits};ret=inflate_table(DISTS,state.lens,state.nlen,state.ndist,state.distcode,0,state.work,opts);state.distbits=opts.bits;if(ret){strm.msg="invalid distances set";state.mode=BAD;break}state.mode=LEN_;if(flush===Z_TREES){break inf_leave}case LEN_:state.mode=LEN;case LEN:if(have>=6&&left>=258){strm.next_out=put;strm.avail_out=left;strm.next_in=next;strm.avail_in=have;state.hold=hold;state.bits=bits;inflate_fast(strm,_out);put=strm.next_out;output=strm.output;left=strm.avail_out;next=strm.next_in;input=strm.input;have=strm.avail_in;hold=state.hold;bits=state.bits;if(state.mode===TYPE){state.back=-1}break}state.back=0;for(;;){here=state.lencode[hold&(1<>>24;here_op=here>>>16&255;here_val=here&65535;if(here_bits<=bits){break}if(have===0){break inf_leave}have--;hold+=input[next++]<>last_bits)];here_bits=here>>>24;here_op=here>>>16&255;here_val=here&65535;if(last_bits+here_bits<=bits){break}if(have===0){break inf_leave}have--;hold+=input[next++]<>>=last_bits;bits-=last_bits;state.back+=last_bits}hold>>>=here_bits;bits-=here_bits;state.back+=here_bits;state.length=here_val;if(here_op===0){state.mode=LIT;break}if(here_op&32){state.back=-1;state.mode=TYPE;break}if(here_op&64){strm.msg="invalid literal/length code";state.mode=BAD;break}state.extra=here_op&15;state.mode=LENEXT;case LENEXT:if(state.extra){n=state.extra;while(bits>>=state.extra;bits-=state.extra;state.back+=state.extra}state.was=state.length;state.mode=DIST;case DIST:for(;;){here=state.distcode[hold&(1<>>24;here_op=here>>>16&255;here_val=here&65535;if(here_bits<=bits){break}if(have===0){break inf_leave}have--;hold+=input[next++]<>last_bits)];here_bits=here>>>24;here_op=here>>>16&255;here_val=here&65535;if(last_bits+here_bits<=bits){break}if(have===0){break inf_leave}have--;hold+=input[next++]<>>=last_bits;bits-=last_bits;state.back+=last_bits}hold>>>=here_bits;bits-=here_bits;state.back+=here_bits;if(here_op&64){strm.msg="invalid distance code";state.mode=BAD;break}state.offset=here_val;state.extra=here_op&15;state.mode=DISTEXT;case DISTEXT:if(state.extra){n=state.extra;while(bits>>=state.extra;bits-=state.extra;state.back+=state.extra}if(state.offset>state.dmax){strm.msg="invalid distance too far back";state.mode=BAD;break}state.mode=MATCH;case MATCH:if(left===0){break inf_leave}copy=_out-left;if(state.offset>copy){copy=state.offset-copy;if(copy>state.whave){if(state.sane){strm.msg="invalid distance too far back";state.mode=BAD;break}}if(copy>state.wnext){copy-=state.wnext;from=state.wsize-copy}else{from=state.wnext-copy}if(copy>state.length){copy=state.length}from_source=state.window}else{from_source=output;from=put-state.offset;copy=state.length}if(copy>left){copy=left}left-=copy;state.length-=copy;do{output[put++]=from_source[from++]}while(--copy);if(state.length===0){state.mode=LEN}break;case LIT:if(left===0){break inf_leave}output[put++]=state.length;left--;state.mode=LEN;break;case CHECK:if(state.wrap){while(bits<32){if(have===0){break inf_leave}have--;hold|=input[next++]<=1;max--){if(count[max]!==0){break}}if(root>max){root=max}if(max===0){table[table_index++]=1<<24|64<<16|0;table[table_index++]=1<<24|64<<16|0;opts.bits=1;return 0}for(min=1;min0&&(type===CODES||max!==1)){return-1}offs[1]=0;for(len=1;lenENOUGH_LENS||type===DISTS&&used>ENOUGH_DISTS){return 1}var i=0;for(;;){i++;here_bits=len-drop;if(work[sym]end){here_op=extra[extra_index+work[sym]];here_val=base[base_index+work[sym]]}else{here_op=32+64;here_val=0}incr=1<>drop)+fill]=here_bits<<24|here_op<<16|here_val|0}while(fill!==0);incr=1<>=1}if(incr!==0){huff&=incr-1;huff+=incr}else{huff=0}sym++;if(--count[len]===0){if(len===max){break}len=lens[lens_index+work[sym]]}if(len>root&&(huff&mask)!==low){if(drop===0){drop=root}next+=min;curr=len-drop;left=1<ENOUGH_LENS||type===DISTS&&used>ENOUGH_DISTS){return 1}low=huff&mask;table[low]=root<<24|curr<<16|next-table_index|0}}if(huff!==0){table[next+huff]=len-drop<<24|64<<16|0}opts.bits=root;return 0}},{"../utils/common":54}],64:[function(require,module,exports){"use strict";module.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],65:[function(require,module,exports){"use strict";var utils=require("../utils/common");var Z_FIXED=4;var Z_BINARY=0;var Z_TEXT=1;var Z_UNKNOWN=2;function zero(buf){var len=buf.length;while(--len>=0){buf[len]=0}}var STORED_BLOCK=0;var STATIC_TREES=1;var DYN_TREES=2;var MIN_MATCH=3;var MAX_MATCH=258;var LENGTH_CODES=29;var LITERALS=256;var L_CODES=LITERALS+1+LENGTH_CODES;var D_CODES=30;var BL_CODES=19;var HEAP_SIZE=2*L_CODES+1;var MAX_BITS=15;var Buf_size=16;var MAX_BL_BITS=7;var END_BLOCK=256;var REP_3_6=16;var REPZ_3_10=17;var REPZ_11_138=18;var extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];var extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];var extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];var bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];var DIST_CODE_LEN=512;var static_ltree=new Array((L_CODES+2)*2);zero(static_ltree);var static_dtree=new Array(D_CODES*2);zero(static_dtree);var _dist_code=new Array(DIST_CODE_LEN);zero(_dist_code);var _length_code=new Array(MAX_MATCH-MIN_MATCH+1);zero(_length_code);var base_length=new Array(LENGTH_CODES);zero(base_length);var base_dist=new Array(D_CODES);zero(base_dist);function StaticTreeDesc(static_tree,extra_bits,extra_base,elems,max_length){this.static_tree=static_tree;this.extra_bits=extra_bits;this.extra_base=extra_base;this.elems=elems;this.max_length=max_length;this.has_stree=static_tree&&static_tree.length}var static_l_desc;var static_d_desc;var static_bl_desc;function TreeDesc(dyn_tree,stat_desc){this.dyn_tree=dyn_tree;this.max_code=0;this.stat_desc=stat_desc}function d_code(dist){return dist<256?_dist_code[dist]:_dist_code[256+(dist>>>7)]; }function put_short(s,w){s.pending_buf[s.pending++]=w&255;s.pending_buf[s.pending++]=w>>>8&255}function send_bits(s,value,length){if(s.bi_valid>Buf_size-length){s.bi_buf|=value<>Buf_size-s.bi_valid;s.bi_valid+=length-Buf_size}else{s.bi_buf|=value<>>=1;res<<=1}while(--len>0);return res>>>1}function bi_flush(s){if(s.bi_valid===16){put_short(s,s.bi_buf);s.bi_buf=0;s.bi_valid=0}else if(s.bi_valid>=8){s.pending_buf[s.pending++]=s.bi_buf&255;s.bi_buf>>=8;s.bi_valid-=8}}function gen_bitlen(s,desc){var tree=desc.dyn_tree;var max_code=desc.max_code;var stree=desc.stat_desc.static_tree;var has_stree=desc.stat_desc.has_stree;var extra=desc.stat_desc.extra_bits;var base=desc.stat_desc.extra_base;var max_length=desc.stat_desc.max_length;var h;var n,m;var bits;var xbits;var f;var overflow=0;for(bits=0;bits<=MAX_BITS;bits++){s.bl_count[bits]=0}tree[s.heap[s.heap_max]*2+1]=0;for(h=s.heap_max+1;hmax_length){bits=max_length;overflow++}tree[n*2+1]=bits;if(n>max_code){continue}s.bl_count[bits]++;xbits=0;if(n>=base){xbits=extra[n-base]}f=tree[n*2];s.opt_len+=f*(bits+xbits);if(has_stree){s.static_len+=f*(stree[n*2+1]+xbits)}}if(overflow===0){return}do{bits=max_length-1;while(s.bl_count[bits]===0){bits--}s.bl_count[bits]--;s.bl_count[bits+1]+=2;s.bl_count[max_length]--;overflow-=2}while(overflow>0);for(bits=max_length;bits!==0;bits--){n=s.bl_count[bits];while(n!==0){m=s.heap[--h];if(m>max_code){continue}if(tree[m*2+1]!==bits){s.opt_len+=(bits-tree[m*2+1])*tree[m*2];tree[m*2+1]=bits}n--}}}function gen_codes(tree,max_code,bl_count){var next_code=new Array(MAX_BITS+1);var code=0;var bits;var n;for(bits=1;bits<=MAX_BITS;bits++){next_code[bits]=code=code+bl_count[bits-1]<<1}for(n=0;n<=max_code;n++){var len=tree[n*2+1];if(len===0){continue}tree[n*2]=bi_reverse(next_code[len]++,len)}}function tr_static_init(){var n;var bits;var length;var code;var dist;var bl_count=new Array(MAX_BITS+1);length=0;for(code=0;code>=7;for(;code8){put_short(s,s.bi_buf)}else if(s.bi_valid>0){s.pending_buf[s.pending++]=s.bi_buf}s.bi_buf=0;s.bi_valid=0}function copy_block(s,buf,len,header){bi_windup(s);if(header){put_short(s,len);put_short(s,~len)}utils.arraySet(s.pending_buf,s.window,buf,len,s.pending);s.pending+=len}function smaller(tree,n,m,depth){var _n2=n*2;var _m2=m*2;return tree[_n2]>1;n>=1;n--){pqdownheap(s,tree,n)}node=elems;do{n=s.heap[1];s.heap[1]=s.heap[s.heap_len--];pqdownheap(s,tree,1);m=s.heap[1];s.heap[--s.heap_max]=n;s.heap[--s.heap_max]=m;tree[node*2]=tree[n*2]+tree[m*2];s.depth[node]=(s.depth[n]>=s.depth[m]?s.depth[n]:s.depth[m])+1;tree[n*2+1]=tree[m*2+1]=node;s.heap[1]=node++;pqdownheap(s,tree,1)}while(s.heap_len>=2);s.heap[--s.heap_max]=s.heap[1];gen_bitlen(s,desc);gen_codes(tree,max_code,s.bl_count)}function scan_tree(s,tree,max_code){var n;var prevlen=-1;var curlen;var nextlen=tree[0*2+1];var count=0;var max_count=7;var min_count=4;if(nextlen===0){max_count=138;min_count=3}tree[(max_code+1)*2+1]=65535;for(n=0;n<=max_code;n++){curlen=nextlen;nextlen=tree[(n+1)*2+1];if(++count=3;max_blindex--){if(s.bl_tree[bl_order[max_blindex]*2+1]!==0){break}}s.opt_len+=3*(max_blindex+1)+5+5+4;return max_blindex}function send_all_trees(s,lcodes,dcodes,blcodes){var rank;send_bits(s,lcodes-257,5);send_bits(s,dcodes-1,5);send_bits(s,blcodes-4,4);for(rank=0;rank>>=1){if(black_mask&1&&s.dyn_ltree[n*2]!==0){return Z_BINARY}}if(s.dyn_ltree[9*2]!==0||s.dyn_ltree[10*2]!==0||s.dyn_ltree[13*2]!==0){return Z_TEXT}for(n=32;n0){if(s.strm.data_type===Z_UNKNOWN){s.strm.data_type=detect_data_type(s)}build_tree(s,s.l_desc);build_tree(s,s.d_desc);max_blindex=build_bl_tree(s);opt_lenb=s.opt_len+3+7>>>3;static_lenb=s.static_len+3+7>>>3;if(static_lenb<=opt_lenb){opt_lenb=static_lenb}}else{opt_lenb=static_lenb=stored_len+5}if(stored_len+4<=opt_lenb&&buf!==-1){_tr_stored_block(s,buf,stored_len,last)}else if(s.strategy===Z_FIXED||static_lenb===opt_lenb){send_bits(s,(STATIC_TREES<<1)+(last?1:0),3);compress_block(s,static_ltree,static_dtree)}else{send_bits(s,(DYN_TREES<<1)+(last?1:0),3);send_all_trees(s,s.l_desc.max_code+1,s.d_desc.max_code+1,max_blindex+1);compress_block(s,s.dyn_ltree,s.dyn_dtree)}init_block(s);if(last){bi_windup(s)}}function _tr_tally(s,dist,lc){s.pending_buf[s.d_buf+s.last_lit*2]=dist>>>8&255;s.pending_buf[s.d_buf+s.last_lit*2+1]=dist&255;s.pending_buf[s.l_buf+s.last_lit]=lc&255;s.last_lit++;if(dist===0){s.dyn_ltree[lc*2]++}else{s.matches++;dist--;s.dyn_ltree[(_length_code[lc]+LITERALS+1)*2]++;s.dyn_dtree[d_code(dist)*2]++}return s.last_lit===s.lit_bufsize-1}exports._tr_init=_tr_init;exports._tr_stored_block=_tr_stored_block;exports._tr_flush_block=_tr_flush_block;exports._tr_tally=_tr_tally;exports._tr_align=_tr_align},{"../utils/common":54}],66:[function(require,module,exports){arguments[4][15][0].apply(exports,arguments)},{dup:15}],67:[function(require,module,exports){(function(process){"use strict";if(!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0){module.exports=nextTick}else{module.exports=process.nextTick}function nextTick(fn,arg1,arg2,arg3){if(typeof fn!=="function"){throw new TypeError('"callback" argument must be a function')}var len=arguments.length;var args,i;switch(len){case 0:case 1:return process.nextTick(fn);case 2:return process.nextTick(function afterTickOne(){fn.call(null,arg1)});case 3:return process.nextTick(function afterTickTwo(){fn.call(null,arg1,arg2)});case 4:return process.nextTick(function afterTickThree(){fn.call(null,arg1,arg2,arg3)});default:args=new Array(len-1);i=0;while(i1){for(var i=1;i0){if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var _e=new Error("stream.unshift() after end event");stream.emit("error",_e)}else{var skipAdd;if(state.decoder&&!addToFront&&!encoding){chunk=state.decoder.write(chunk);skipAdd=!state.objectMode&&chunk.length===0}if(!addToFront)state.reading=false;if(!skipAdd){if(state.flowing&&state.length===0&&!state.sync){stream.emit("data",chunk);stream.read(0)}else{state.length+=state.objectMode?1:chunk.length;if(addToFront)state.buffer.unshift(chunk);else state.buffer.push(chunk);if(state.needReadable)emitReadable(stream)}}maybeReadMore(stream,state)}}else if(!addToFront){state.reading=false}return needMoreData(state)}function needMoreData(state){return!state.ended&&(state.needReadable||state.length=MAX_HWM){n=MAX_HWM}else{n--;n|=n>>>1;n|=n>>>2;n|=n>>>4;n|=n>>>8;n|=n>>>16;n++}return n}function howMuchToRead(n,state){if(state.length===0&&state.ended)return 0;if(state.objectMode)return n===0?0:1;if(n===null||isNaN(n)){if(state.flowing&&state.buffer.length)return state.buffer[0].length;else return state.length}if(n<=0)return 0;if(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n>state.length){if(!state.ended){state.needReadable=true;return 0}else{return state.length}}return n}Readable.prototype.read=function(n){debug("read",n);var state=this._readableState;var nOrig=n;if(typeof n!=="number"||n>0)state.emittedReadable=false;if(n===0&&state.needReadable&&(state.length>=state.highWaterMark||state.ended)){debug("read: emitReadable",state.length,state.ended);if(state.length===0&&state.ended)endReadable(this);else emitReadable(this);return null}n=howMuchToRead(n,state);if(n===0&&state.ended){if(state.length===0)endReadable(this);return null}var doRead=state.needReadable;debug("need readable",doRead);if(state.length===0||state.length-n0)ret=fromList(n,state);else ret=null;if(ret===null){state.needReadable=true;n=0}state.length-=n;if(state.length===0&&!state.ended)state.needReadable=true;if(nOrig!==n&&state.ended&&state.length===0)endReadable(this);if(ret!==null)this.emit("data",ret);return ret};function chunkInvalid(state,chunk){var er=null;if(!Buffer.isBuffer(chunk)&&typeof chunk!=="string"&&chunk!==null&&chunk!==undefined&&!state.objectMode){er=new TypeError("Invalid non-string/buffer chunk")}return er}function onEofChunk(stream,state){if(state.ended)return;if(state.decoder){var chunk=state.decoder.end();if(chunk&&chunk.length){state.buffer.push(chunk);state.length+=state.objectMode?1:chunk.length}}state.ended=true;emitReadable(stream)}function emitReadable(stream){var state=stream._readableState;state.needReadable=false;if(!state.emittedReadable){debug("emitReadable",state.flowing);state.emittedReadable=true;if(state.sync)processNextTick(emitReadable_,stream);else emitReadable_(stream)}}function emitReadable_(stream){debug("emit readable");stream.emit("readable");flow(stream)}function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state)}}function maybeReadMore_(stream,state){var len=state.length;while(!state.reading&&!state.flowing&&!state.ended&&state.length1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp){debug("false write response, pause",src._readableState.awaitDrain);src._readableState.awaitDrain++}src.pause()}}function onerror(er){debug("onerror",er);unpipe();dest.removeListener("error",onerror);if(EElistenerCount(dest,"error")===0)dest.emit("error",er)}prependListener(dest,"error",onerror);function onclose(){dest.removeListener("finish",onfinish);unpipe()}dest.once("close",onclose);function onfinish(){debug("onfinish");dest.removeListener("close",onclose);unpipe()}dest.once("finish",onfinish);function unpipe(){debug("unpipe");src.unpipe(dest)}dest.emit("pipe",src);if(!state.flowing){debug("pipe resume");src.resume()}return dest};function pipeOnDrain(src){return function(){var state=src._readableState;debug("pipeOnDrain",state.awaitDrain);if(state.awaitDrain)state.awaitDrain--;if(state.awaitDrain===0&&EElistenerCount(src,"data")){state.flowing=true;flow(src)}}}Readable.prototype.unpipe=function(dest){var state=this._readableState;if(state.pipesCount===0)return this;if(state.pipesCount===1){if(dest&&dest!==state.pipes)return this;if(!dest)dest=state.pipes;state.pipes=null;state.pipesCount=0;state.flowing=false;if(dest)dest.emit("unpipe",this);return this}if(!dest){var dests=state.pipes;var len=state.pipesCount;state.pipes=null;state.pipesCount=0;state.flowing=false;for(var _i=0;_i=length){if(stringMode)ret=list.join("");else if(list.length===1)ret=list[0];else ret=Buffer.concat(list,length);list.length=0}else{if(n0)throw new Error('"endReadable()" called on non-empty stream');if(!state.endEmitted){state.ended=true;processNextTick(endReadableNT,state,stream)}}function endReadableNT(state,stream){if(!state.endEmitted&&state.length===0){state.endEmitted=true;stream.readable=false;stream.emit("end")}}function forEach(xs,f){for(var i=0,l=xs.length;i-1?setImmediate:processNextTick;Writable.WritableState=WritableState;var util=require("core-util-is");util.inherits=require("inherits");var internalUtil={deprecate:require("util-deprecate")};var Stream;(function(){try{Stream=require("st"+"ream")}catch(_){}finally{if(!Stream)Stream=require("events").EventEmitter}})();var Buffer=require("buffer").Buffer;var bufferShim=require("buffer-shims");util.inherits(Writable,Stream);function nop(){}function WriteReq(chunk,encoding,cb){this.chunk=chunk;this.encoding=encoding;this.callback=cb;this.next=null}var Duplex;function WritableState(options,stream){Duplex=Duplex||require("./_stream_duplex");options=options||{};this.objectMode=!!options.objectMode;if(stream instanceof Duplex)this.objectMode=this.objectMode||!!options.writableObjectMode;var hwm=options.highWaterMark;var defaultHwm=this.objectMode?16:16*1024;this.highWaterMark=hwm||hwm===0?hwm:defaultHwm;this.highWaterMark=~~this.highWaterMark;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;var noDecode=options.decodeStrings===false; -this.decodeStrings=!noDecode;this.defaultEncoding=options.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(er){onwrite(stream,er)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.bufferedRequestCount=0;this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function writableStateGetBuffer(){var current=this.bufferedRequest;var out=[];while(current){out.push(current);current=current.next}return out};(function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.")})}catch(_){}})();var Duplex;function Writable(options){Duplex=Duplex||require("./_stream_duplex");if(!(this instanceof Writable)&&!(this instanceof Duplex))return new Writable(options);this._writableState=new WritableState(options,this);this.writable=true;if(options){if(typeof options.write==="function")this._write=options.write;if(typeof options.writev==="function")this._writev=options.writev}Stream.call(this)}Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function writeAfterEnd(stream,cb){var er=new Error("write after end");stream.emit("error",er);processNextTick(cb,er)}function validChunk(stream,state,chunk,cb){var valid=true;var er=false;if(chunk===null){er=new TypeError("May not write null values to stream")}else if(!Buffer.isBuffer(chunk)&&typeof chunk!=="string"&&chunk!==undefined&&!state.objectMode){er=new TypeError("Invalid non-string/buffer chunk")}if(er){stream.emit("error",er);processNextTick(cb,er);valid=false}return valid}Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState;var ret=false;if(typeof encoding==="function"){cb=encoding;encoding=null}if(Buffer.isBuffer(chunk))encoding="buffer";else if(!encoding)encoding=state.defaultEncoding;if(typeof cb!=="function")cb=nop;if(state.ended)writeAfterEnd(this,cb);else if(validChunk(this,state,chunk,cb)){state.pendingcb++;ret=writeOrBuffer(this,state,chunk,encoding,cb)}return ret};Writable.prototype.cork=function(){var state=this._writableState;state.corked++};Writable.prototype.uncork=function(){var state=this._writableState;if(state.corked){state.corked--;if(!state.writing&&!state.corked&&!state.finished&&!state.bufferProcessing&&state.bufferedRequest)clearBuffer(this,state)}};Writable.prototype.setDefaultEncoding=function setDefaultEncoding(encoding){if(typeof encoding==="string")encoding=encoding.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);this._writableState.defaultEncoding=encoding;return this};function decodeChunk(state,chunk,encoding){if(!state.objectMode&&state.decodeStrings!==false&&typeof chunk==="string"){chunk=bufferShim.from(chunk,encoding)}return chunk}function writeOrBuffer(stream,state,chunk,encoding,cb){chunk=decodeChunk(state,chunk,encoding);if(Buffer.isBuffer(chunk))encoding="buffer";var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length=this.charLength-this.charReceived?this.charLength-this.charReceived:buffer.length;buffer.copy(this.charBuffer,this.charReceived,0,available);this.charReceived+=available;if(this.charReceived=55296&&charCode<=56319){this.charLength+=this.surrogateSize;charStr="";continue}this.charReceived=this.charLength=0;if(buffer.length===0){return charStr}break}this.detectIncompleteChar(buffer);var end=buffer.length;if(this.charLength){buffer.copy(this.charBuffer,0,buffer.length-this.charReceived,end);end-=this.charReceived}charStr+=buffer.toString(this.encoding,0,end);var end=charStr.length-1;var charCode=charStr.charCodeAt(end);if(charCode>=55296&&charCode<=56319){var size=this.surrogateSize;this.charLength+=size;this.charReceived+=size;this.charBuffer.copy(this.charBuffer,size,0,size);buffer.copy(this.charBuffer,0,0,size);return charStr.substring(0,end)}return charStr};StringDecoder.prototype.detectIncompleteChar=function(buffer){var i=buffer.length>=3?3:buffer.length;for(;i>0;i--){var c=buffer[buffer.length-i];if(i==1&&c>>5==6){this.charLength=2;break}if(i<=2&&c>>4==14){this.charLength=3;break}if(i<=3&&c>>3==30){this.charLength=4;break}}this.charReceived=i};StringDecoder.prototype.end=function(buffer){var res="";if(buffer&&buffer.length)res=this.write(buffer);if(this.charReceived){var cr=this.charReceived;var buf=this.charBuffer;var enc=this.encoding;res+=buf.slice(0,cr).toString(enc)}return res};function passThroughWrite(buffer){return buffer.toString(this.encoding)}function utf16DetectIncompleteChar(buffer){this.charReceived=buffer.length%2;this.charLength=this.charReceived?2:0}function base64DetectIncompleteChar(buffer){this.charReceived=buffer.length%3;this.charLength=this.charReceived?3:0}},{buffer:19}],75:[function(require,module,exports){(function(global){module.exports=deprecate;function deprecate(fn,msg){if(config("noDeprecation")){return fn}var warned=false;function deprecated(){if(!warned){if(config("throwDeprecation")){throw new Error(msg)}else if(config("traceDeprecation")){console.trace(msg)}else{console.warn(msg)}warned=true}return fn.apply(this,arguments)}return deprecated}function config(name){try{if(!global.localStorage)return false}catch(_){return false}var val=global.localStorage[name];if(null==val)return false;return String(val).toLowerCase()==="true"}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],76:[function(require,module,exports){module.exports=function isBuffer(arg){return arg&&typeof arg==="object"&&typeof arg.copy==="function"&&typeof arg.fill==="function"&&typeof arg.readUInt8==="function"}},{}],77:[function(require,module,exports){(function(process,global){var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){var objects=[];for(var i=0;i=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}});for(var x=args[i];i=3)ctx.depth=arguments[2];if(arguments.length>=4)ctx.colors=arguments[3];if(isBoolean(opts)){ctx.showHidden=opts}else if(opts){exports._extend(ctx,opts)}if(isUndefined(ctx.showHidden))ctx.showHidden=false;if(isUndefined(ctx.depth))ctx.depth=2;if(isUndefined(ctx.colors))ctx.colors=false;if(isUndefined(ctx.customInspect))ctx.customInspect=true;if(ctx.colors)ctx.stylize=stylizeWithColor;return formatValue(ctx,obj,ctx.depth)}exports.inspect=inspect;inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];if(style){return"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m"}else{return str}}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};array.forEach(function(val,idx){hash[val]=true});return hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&!(value.constructor&&value.constructor.prototype===value)){var ret=value.inspect(recurseTimes,ctx);if(!isString(ret)){ret=formatValue(ctx,ret,recurseTimes)}return ret}var primitive=formatPrimitive(ctx,value);if(primitive){return primitive}var keys=Object.keys(value);var visibleKeys=arrayToHash(keys);if(ctx.showHidden){keys=Object.getOwnPropertyNames(value)}if(isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0)){return formatError(value)}if(keys.length===0){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}if(isDate(value)){return ctx.stylize(Date.prototype.toString.call(value),"date")}if(isError(value)){return formatError(value)}}var base="",array=false,braces=["{","}"];if(isArray(value)){array=true;braces=["[","]"]}if(isFunction(value)){var n=value.name?": "+value.name:"";base=" [Function"+n+"]"}if(isRegExp(value)){base=" "+RegExp.prototype.toString.call(value)}if(isDate(value)){base=" "+Date.prototype.toUTCString.call(value)}if(isError(value)){base=" "+formatError(value)}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1]}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}else{return ctx.stylize("[Object]","special")}}ctx.seen.push(value);var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys)}else{output=keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)})}ctx.seen.pop();return reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}if(isNumber(value))return ctx.stylize(""+value,"number");if(isBoolean(value))return ctx.stylize(""+value,"boolean");if(isNull(value))return ctx.stylize("null","null")}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i-1){if(array){str=str.split("\n").map(function(line){return" "+line}).join("\n").substr(2)}else{str="\n"+str.split("\n").map(function(line){return" "+line}).join("\n")}}}else{str=ctx.stylize("[Circular]","special")}}if(isUndefined(name)){if(array&&key.match(/^\d+$/)){return str}name=JSON.stringify(""+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.substr(1,name.length-2);name=ctx.stylize(name,"name")}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,"string")}}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=output.reduce(function(prev,cur){numLinesEst++;if(cur.indexOf("\n")>=0)numLinesEst++;return prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(length>60){return braces[0]+(base===""?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]}return braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;exports.isBuffer=require("./support/isBuffer");function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var d=new Date;var time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))};exports.inherits=require("inherits");exports._extend=function(origin,add){if(!add||!isObject(add))return origin;var keys=Object.keys(add);var i=keys.length;while(i--){origin[keys[i]]=add[keys[i]]}return origin};function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":76,_process:68,inherits:27}],78:[function(require,module,exports){"use strict";var isString=require("validate.io-string-primitive");var isNonNegativeInteger=require("validate.io-nonnegative-integer");var ceil=require("math-ceil");var repeat=require("utils-repeat-string");var MAX_SAFE_INTEGER=9007199254740991;function lpad(str,len,pad){var n;var p;if(!isString(str)){throw new TypeError("invalid input argument. First argument must be a string. Value: `"+str+"`.")}if(!isNonNegativeInteger(len)){throw new TypeError("invalid input argument. Second argument must be a nonnegative integer. Value: `"+len+"`.")}if(arguments.length>2){p=pad;if(!isString(p)){throw new TypeError("invalid input argument. Third argument must be a string. Value: `"+p+"`.")}if(p.length===0){throw new RangeError("invalid input argument. Pad string must not be an empty string.")}}else{p=" "}if(len>MAX_SAFE_INTEGER){throw new RangeError("invalid input argument. Output string length exceeds maximum allowed string length.")}n=(len-str.length)/p.length;if(n<=0){return str}n=ceil(n);return repeat(p,n)+str}module.exports=lpad},{"math-ceil":41,"utils-repeat-string":79,"validate.io-nonnegative-integer":82,"validate.io-string-primitive":84}],79:[function(require,module,exports){"use strict";var isString=require("validate.io-string-primitive");var isNonNegativeInteger=require("validate.io-nonnegative-integer");var MAX_SAFE_INTEGER=9007199254740991;function repeat(str,n){var rpt;var cnt;if(!isString(str)){throw new TypeError("invalid input argument. First argument must be a string. Value: `"+str+"`.")}if(!isNonNegativeInteger(n)){throw new TypeError("invalid input argument. Second argument must be a nonnegative integer. Value: `"+n+"`.")}if(str.length===0||n===0){return""}if(str.length*n>MAX_SAFE_INTEGER){throw new RangeError("invalid input argument. Output string length exceeds maximum allowed string length.")}rpt="";cnt=n;for(;;){if((cnt&1)===1){rpt+=str}cnt>>>=1;if(cnt===0){break}str+=str}return rpt}module.exports=repeat},{"validate.io-nonnegative-integer":82,"validate.io-string-primitive":84}],80:[function(require,module,exports){"use strict";var isString=require("validate.io-string-primitive");var isNonNegativeInteger=require("validate.io-nonnegative-integer");var ceil=require("math-ceil");var repeat=require("utils-repeat-string");var MAX_SAFE_INTEGER=9007199254740991;function rpad(str,len,pad){var n;var p;if(!isString(str)){throw new TypeError("invalid input argument. First argument must be a string. Value: `"+str+"`.")}if(!isNonNegativeInteger(len)){throw new TypeError("invalid input argument. Second argument must be a nonnegative integer. Value: `"+len+"`.")}if(arguments.length>2){p=pad;if(!isString(p)){throw new TypeError("invalid input argument. Third argument must be a string. Value: `"+p+"`.")}if(p.length===0){throw new RangeError("invalid input argument. Pad string must not be an empty string.")}}else{p=" "}if(len>MAX_SAFE_INTEGER){throw new RangeError("invalid input argument. Output string length exceeds maximum allowed string length.")}n=(len-str.length)/p.length;if(n<=0){return str}n=ceil(n);return str+repeat(p,n)}module.exports=rpad},{"math-ceil":41,"utils-repeat-string":79,"validate.io-nonnegative-integer":82,"validate.io-string-primitive":84}],81:[function(require,module,exports){"use strict";var isNumber=require("validate.io-number");function isInteger(value){return isNumber(value)&&value%1===0}module.exports=isInteger},{"validate.io-number":83}],82:[function(require,module,exports){"use strict";var isInteger=require("validate.io-integer");function isNonNegativeInteger(value){return isInteger(value)&&value>=0}module.exports=isNonNegativeInteger},{"validate.io-integer":81}],83:[function(require,module,exports){"use strict";function isNumber(value){return(typeof value==="number"||Object.prototype.toString.call(value)==="[object Number]")&&value.valueOf()===value.valueOf()}module.exports=isNumber},{}],84:[function(require,module,exports){"use strict";function isString(value){return typeof value==="string"}module.exports=isString},{}],85:[function(require,module,exports){module.exports={name:"ami.js",version:"v0.0.12-dev",main:"src/ami.js",keywords:["ami","ami.js","three.js","webgl","dicom","nifti","awesome","medical","imaging","xtk","nrrd","vtk","stl","trk"],author:{name:"Nicolas Rannou",email:"nicolas@eunate.ch",url:"https://eunate.ch"},license:"Apache-2.0",repository:{type:"git",url:"https://fnndsc.github.io/ami"},config:{threeVersion:"r81",amiCDN:"https://cdn.rawgit.com/fnndsc/ami/master/build/ami.min.js",gaKey:"UA-39303022-3",transforms:"-t [babelify --presets [ es2015 ] ]"},dependencies:{"dicom-parser":"1.7.3","image-JPEG2000":"OHIF/image-JPEG2000#master","jpeg-lossless-decoder-js":"1.2.3","math-float32-to-binary-string":"^1.0.0","nrrd-js":"^0.2.1","nifti-reader-js":"v0.5.3",pako:"1.0.1"},scripts:{"dist:prepare":"node ./scripts/$npm_package_config_mode.js --dist","dist:watchAmi":"watchify -d src/ami $npm_package_config_transforms --standalone AMI -o dist/build/ami.js -v","dist:watch":"watchify $npm_package_config_target -d $npm_package_config_transforms -o dist/$npm_package_config_target -v",dist:"npm run dist:prepare --ami.js:mode=$npm_package_config_mode && (live-server dist --open=$npm_package_config_open & npm run dist:watch --ami.js:target=$npm_package_config_target)",example:"npm run clean && node ./scripts/router.js examples ",lesson:"npm run clean && mkdir dist/build && touch dist/build/ami.js && node ./scripts/router.js lessons ",demo:"node ./scripts/lessons.js --demo",lint:"eslint **/*.js --quiet","build:examples":"npm run dist:prepare --ami.js:mode=examples && find examples -name '*.js' -print0 | xargs -0 -n1 -I{} bash -c \"echo Building {}; browserify {} -d -v $npm_package_config_transforms > dist/{} \"","build:ami":"browserify src/ami.js -d -v $npm_package_config_transforms --standalone AMI > build/ami.js && uglifyjs build/ami.js -o build/ami.min.js",build:"npm run clean && cp index.html dist/index.html && npm run build:examples && npm run doc",clean:"rm -rf dist/*",test:"karma start",doc:"jsdoc -p -r -R README.md -c jsdoc.conf -d dist/doc src",ami:"npm run lint && npm run demo && npm run build:ami && npm run test",deploy:"npm run build && gh-pages -d dist"},devDependencies:{browserify:"^13.1.0","uglify-js":"^2.7.3","live-server":"^1.1.0","babel-cli":"latest",shelljs:"latest","gh-pages":"latest",eslint:"latest","babel-polyfill":"^6.13.0","babel-preset-es2015":"^6.13.2",babelify:"7.3.0",glslify:"5.1.0",jsdoc:"jsdoc3/jsdoc#master",karma:"latest",phantomjs:"latest","karma-browserify":"latest","karma-jasmine":"latest","karma-phantomjs-launcher":"latest","karma-spec-reporter":"latest","jasmine-core":"latest",watchify:"3.7.0"},engines:{node:">=6.9.0"},browserify:{transform:["babelify"]}}},{}],86:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _cameras=require("./cameras/cameras");var _cameras2=_interopRequireDefault(_cameras);var _controls=require("./controls/controls");var _controls2=_interopRequireDefault(_controls);var _core=require("./core/core");var _core2=_interopRequireDefault(_core);var _geometries=require("./geometries/geometries");var _geometries2=_interopRequireDefault(_geometries);var _helpers=require("./helpers/helpers");var _helpers2=_interopRequireDefault(_helpers);var _loaders=require("./loaders/loaders");var _loaders2=_interopRequireDefault(_loaders);var _models=require("./models/models");var _models2=_interopRequireDefault(_models);var _parsers=require("./parsers/parsers");var _parsers2=_interopRequireDefault(_parsers);var _shaders=require("./shaders/shaders");var _shaders2=_interopRequireDefault(_shaders);var _widgets=require("./widgets/widgets");var _widgets2=_interopRequireDefault(_widgets);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var pckg=require("../package.json");exports.default={Cameras:_cameras2.default,Controls:_controls2.default,Core:_core2.default,Geometries:_geometries2.default,Helpers:_helpers2.default,Loaders:_loaders2.default,Models:_models2.default,Parsers:_parsers2.default,Shaders:_shaders2.default,Widgets:_widgets2.default};window.console.log("AMI "+pckg.version+" ( ThreeJS "+pckg.config.threeVersion+")")},{"../package.json":85,"./cameras/cameras":87,"./controls/controls":89,"./core/core":94,"./geometries/geometries":98,"./helpers/helpers":103,"./loaders/loaders":112,"./models/models":116,"./parsers/parsers":121,"./shaders/shaders":135,"./widgets/widgets":144}],87:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _cameras=require("./cameras.orthographic");var _cameras2=_interopRequireDefault(_cameras);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Orthographic:_cameras2.default}},{"./cameras.orthographic":88}],88:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:null;this.center();var computedAngle=90;var clockwise=1;if(!this._fromFront){clockwise=-1}if(angle===null){computedAngle*=-clockwise;this._angle+=90}else{computedAngle=360-clockwise*(angle-this._angle);this._angle=angle}this._angle%=360;var rotation=(new THREE.Matrix4).makeRotationAxis(this._zCosine,computedAngle*Math.PI/180);this.up.applyMatrix4(rotation);this._updateMatrices()}},{key:"fitBox",value:function fitBox(){var direction=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var factor=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1.5;var zoom=1;switch(direction){case 0:zoom=factor*this._computeZoom(this._canvas.width,this._xCosine);break;case 1:zoom=factor*this._computeZoom(this._canvas.height,this._yCosine);break;case 2:zoom=factor*Math.min(this._computeZoom(this._canvas.width,this._xCosine),this._computeZoom(this._canvas.height,this._yCosine));break;default:break}if(!zoom){return false}this.zoom=zoom;this.center()}},{key:"_adjustTopDirection",value:function _adjustTopDirection(horizontalDirection,verticalDirection){var hMaxIndex=this._getMaxIndex(horizontalDirection);var vMaxIndex=this._getMaxIndex(verticalDirection);if(vMaxIndex===2&&verticalDirection.getComponent(vMaxIndex)<0||vMaxIndex===1&&verticalDirection.getComponent(vMaxIndex)>0||vMaxIndex===0&&verticalDirection.getComponent(vMaxIndex)>0){verticalDirection.negate()}return verticalDirection}},{key:"_getMaxIndex",value:function _getMaxIndex(vector){if(Math.abs(Math.round(vector.x))===1){return 0}else if(Math.abs(Math.round(vector.y))===1){return 1}else if(Math.abs(Math.round(vector.z))===1){return 2}}},{key:"_orderIntersections",value:function _orderIntersections(intersections,direction){var maxIndex=this._getMaxIndex(direction);var ordered=intersections[0].dot(direction)0)){window.console.log("Invalid dimension provided.");window.console.log(dimension);return false}var ray={position:this._box.center.clone(),direction:direction};var intersections=_core2.default.rayBox(ray,this._box);if(intersections.length<2){window.console.log("Can not adjust the camera ( < 2 intersections).");window.console.log(ray);window.console.log(this._box);return false}return dimension/intersections[0].distanceTo(intersections[1])}},{key:"_updatePositionAndTarget",value:function _updatePositionAndTarget(position,target){this.position.set(position.x,position.y,position.z);this.lookAt(target.x,target.y,target.z);this._controls.target.set(target.x,target.y,target.z)}},{key:"_updateMatrices",value:function _updateMatrices(){this._controls.update();this.updateProjectionMatrix();this.updateMatrixWorld()}},{key:"xCosine",set:function set(xCosine){this._xCosine=xCosine},get:function get(){return this._xCosine}},{key:"yCosine",set:function set(yCosine){this._yCosine=yCosine},get:function get(){return this._yCosine}},{key:"zCosine",set:function set(zCosine){this._zCosine=zCosine},get:function get(){return this._zCosine}},{key:"controls",set:function set(controls){this._controls=controls},get:function get(){return this._controls}},{key:"box",set:function set(box){this._box=box},get:function get(){return this._box}},{key:"canvas",set:function set(canvas){this._canvas=canvas;this._updateCanvas()},get:function get(){return this._canvas}},{key:"angle",set:function set(angle){this.rotate(angle)},get:function get(){return this._angle}}]);return CamerasOrthographic}(THREE.OrthographicCamera);exports.default=CamerasOrthographic},{"../core/core.intersections":93,"../core/core.validators":97}],89:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _controls=require("./controls.trackball");var _controls2=_interopRequireDefault(_controls);var _controls3=require("./controls.trackballortho");var _controls4=_interopRequireDefault(_controls3);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Trackball:_controls2.default,TrackballOrtho:_controls4.default}},{"./controls.trackball":90,"./controls.trackballortho":91}],90:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return call&&((typeof call==="undefined"?"undefined":_typeof(call))==="object"||typeof call==="function")?call:self}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+(typeof superClass==="undefined"?"undefined":_typeof(superClass)))}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass}var Trackball=function(_THREE$EventDispatche){_inherits(Trackball,_THREE$EventDispatche);function Trackball(object,domElement){_classCallCheck(this,Trackball);var _this2=_possibleConstructorReturn(this,(Trackball.__proto__||Object.getPrototypeOf(Trackball)).call(this));var _this=_this2;var STATE={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM:4,TOUCH_PAN:5,CUSTOM:99};_this2.object=object;_this2.domElement=domElement!==undefined?domElement:document;_this2.enabled=true;_this2.screen={left:0,top:0,width:0,height:0};_this2.rotateSpeed=1;_this2.zoomSpeed=1.2;_this2.panSpeed=.3;_this2.noRotate=false;_this2.noZoom=false;_this2.noPan=false;_this2.noCustom=false;_this2.forceState=-1;_this2.staticMoving=false;_this2.dynamicDampingFactor=.2;_this2.minDistance=0;_this2.maxDistance=Infinity;_this2.keys=[65,83,68];_this2.target=new THREE.Vector3;var EPS=1e-6;var lastPosition=new THREE.Vector3;var _state=STATE.NONE,_prevState=STATE.NONE,_eye=new THREE.Vector3,_movePrev=new THREE.Vector2,_moveCurr=new THREE.Vector2,_lastAxis=new THREE.Vector3,_lastAngle=0,_zoomStart=new THREE.Vector2,_zoomEnd=new THREE.Vector2,_touchZoomDistanceStart=0,_touchZoomDistanceEnd=0,_panStart=new THREE.Vector2,_panEnd=new THREE.Vector2,_customStart=new THREE.Vector2,_customEnd=new THREE.Vector2;_this2.target0=_this2.target.clone();_this2.position0=_this2.object.position.clone();_this2.up0=_this2.object.up.clone();var changeEvent={type:"change"};var startEvent={type:"start"};var endEvent={type:"end"};_this2.handleResize=function(){if(this.domElement===document){this.screen.left=0;this.screen.top=0;this.screen.width=window.innerWidth;this.screen.height=window.innerHeight}else{var box=this.domElement.getBoundingClientRect();var d=this.domElement.ownerDocument.documentElement;this.screen.left=box.left+window.pageXOffset-d.clientLeft;this.screen.top=box.top+window.pageYOffset-d.clientTop;this.screen.width=box.width;this.screen.height=box.height}};_this2.handleEvent=function(event){if(typeof this[event.type]=="function"){this[event.type](event)}};var getMouseOnScreen=function(){var vector=new THREE.Vector2;return function(pageX,pageY){vector.set((pageX-_this.screen.left)/_this.screen.width,(pageY-_this.screen.top)/_this.screen.height);return vector}}();var getMouseOnCircle=function(){var vector=new THREE.Vector2;return function(pageX,pageY){vector.set((pageX-_this.screen.width*.5-_this.screen.left)/(_this.screen.width*.5),(_this.screen.height+2*(_this.screen.top-pageY))/_this.screen.width);return vector}}();_this2.rotateCamera=function(){var axis=new THREE.Vector3,quaternion=new THREE.Quaternion,eyeDirection=new THREE.Vector3,objectUpDirection=new THREE.Vector3,objectSidewaysDirection=new THREE.Vector3,moveDirection=new THREE.Vector3,angle;return function(){moveDirection.set(_moveCurr.x-_movePrev.x,_moveCurr.y-_movePrev.y,0);angle=moveDirection.length();if(angle){_eye.copy(_this.object.position).sub(_this.target);eyeDirection.copy(_eye).normalize();objectUpDirection.copy(_this.object.up).normalize();objectSidewaysDirection.crossVectors(objectUpDirection,eyeDirection).normalize();objectUpDirection.setLength(_moveCurr.y-_movePrev.y);objectSidewaysDirection.setLength(_moveCurr.x-_movePrev.x);moveDirection.copy(objectUpDirection.add(objectSidewaysDirection));axis.crossVectors(moveDirection,_eye).normalize();angle*=_this.rotateSpeed;quaternion.setFromAxisAngle(axis,angle);_eye.applyQuaternion(quaternion);_this.object.up.applyQuaternion(quaternion);_lastAxis.copy(axis);_lastAngle=angle}else if(!_this.staticMoving&&_lastAngle){_lastAngle*=Math.sqrt(1-_this.dynamicDampingFactor);_eye.copy(_this.object.position).sub(_this.target);quaternion.setFromAxisAngle(_lastAxis,_lastAngle);_eye.applyQuaternion(quaternion);_this.object.up.applyQuaternion(quaternion)}_movePrev.copy(_moveCurr)}}();_this2.zoomCamera=function(){var factor;if(_state===STATE.TOUCH_ZOOM){factor=_touchZoomDistanceStart/_touchZoomDistanceEnd;_touchZoomDistanceStart=_touchZoomDistanceEnd;_eye.multiplyScalar(factor)}else{factor=1+(_zoomEnd.y-_zoomStart.y)*_this.zoomSpeed;if(factor!==1&&factor>0){_eye.multiplyScalar(factor);if(_this.staticMoving){_zoomStart.copy(_zoomEnd)}else{_zoomStart.y+=(_zoomEnd.y-_zoomStart.y)*this.dynamicDampingFactor}}}};_this2.panCamera=function(){var mouseChange=new THREE.Vector2,objectUp=new THREE.Vector3,pan=new THREE.Vector3;return function(){mouseChange.copy(_panEnd).sub(_panStart);if(mouseChange.lengthSq()){mouseChange.multiplyScalar(_eye.length()*_this.panSpeed);pan.copy(_eye).cross(_this.object.up).setLength(mouseChange.x);pan.add(objectUp.copy(_this.object.up).setLength(mouseChange.y));_this.object.position.add(pan);_this.target.add(pan);if(_this.staticMoving){_panStart.copy(_panEnd)}else{_panStart.add(mouseChange.subVectors(_panEnd,_panStart).multiplyScalar(_this.dynamicDampingFactor))}}}}();_this2.checkDistances=function(){if(!_this.noZoom||!_this.noPan){if(_eye.lengthSq()>_this.maxDistance*_this.maxDistance){_this.object.position.addVectors(_this.target,_eye.setLength(_this.maxDistance))}if(_eye.lengthSq()<_this.minDistance*_this.minDistance){_this.object.position.addVectors(_this.target,_eye.setLength(_this.minDistance))}}};_this2.update=function(){_eye.subVectors(_this.object.position,_this.target);if(!_this.noRotate){_this.rotateCamera()}if(!_this.noZoom){_this.zoomCamera()}if(!_this.noPan){_this.panCamera()}if(!_this.noCustom){_this.custom(_customStart,_customEnd)}_this.object.position.addVectors(_this.target,_eye);_this.checkDistances();_this.object.lookAt(_this.target);if(lastPosition.distanceToSquared(_this.object.position)>EPS){_this.dispatchEvent(changeEvent);lastPosition.copy(_this.object.position)}};_this2.reset=function(){_state=STATE.NONE;_prevState=STATE.NONE;_this.target.copy(_this.target0);_this.object.position.copy(_this.position0);_this.object.up.copy(_this.up0);_eye.subVectors(_this.object.position,_this.target);_this.object.lookAt(_this.target);_this.dispatchEvent(changeEvent);lastPosition.copy(_this.object.position)};_this2.setState=function(targetState){_this.forceState=targetState;_prevState=targetState;_state=targetState};_this2.custom=function(customStart,customEnd){};function keydown(event){if(_this.enabled===false)return;window.removeEventListener("keydown",keydown);_prevState=_state;if(_state!==STATE.NONE){return}else if(event.keyCode===_this.keys[STATE.ROTATE]&&!_this.noRotate){_state=STATE.ROTATE}else if(event.keyCode===_this.keys[STATE.ZOOM]&&!_this.noZoom){_state=STATE.ZOOM}else if(event.keyCode===_this.keys[STATE.PAN]&&!_this.noPan){_state=STATE.PAN}}function keyup(event){if(_this.enabled===false)return;_state=_prevState;window.addEventListener("keydown",keydown,false)}function mousedown(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_state===STATE.NONE){_state=event.button}if(_state===STATE.ROTATE&&!_this.noRotate){_moveCurr.copy(getMouseOnCircle(event.pageX,event.pageY));_movePrev.copy(_moveCurr)}else if(_state===STATE.ZOOM&&!_this.noZoom){_zoomStart.copy(getMouseOnScreen(event.pageX,event.pageY));_zoomEnd.copy(_zoomStart)}else if(_state===STATE.PAN&&!_this.noPan){_panStart.copy(getMouseOnScreen(event.pageX,event.pageY));_panEnd.copy(_panStart)}else if(_state===STATE.CUSTOM&&!_this.noCustom){_customStart.copy(getMouseOnScreen(event.pageX,event.pageY));_customEnd.copy(_panStart)}document.addEventListener("mousemove",mousemove,false);document.addEventListener("mouseup",mouseup,false);_this.dispatchEvent(startEvent)}function mousemove(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_state===STATE.ROTATE&&!_this.noRotate){_movePrev.copy(_moveCurr);_moveCurr.copy(getMouseOnCircle(event.pageX,event.pageY))}else if(_state===STATE.ZOOM&&!_this.noZoom){_zoomEnd.copy(getMouseOnScreen(event.pageX,event.pageY))}else if(_state===STATE.PAN&&!_this.noPan){_panEnd.copy(getMouseOnScreen(event.pageX,event.pageY))}else if(_state===STATE.CUSTOM&&!_this.noCustom){_customEnd.copy(getMouseOnScreen(event.pageX,event.pageY))}}function mouseup(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_this.forceState===-1){_state=STATE.NONE}document.removeEventListener("mousemove",mousemove);document.removeEventListener("mouseup",mouseup);_this.dispatchEvent(endEvent)}function mousewheel(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();var delta=0;if(event.wheelDelta){delta=event.wheelDelta/40}else if(event.detail){delta=-event.detail/3}if(_state!==STATE.CUSTOM){_zoomStart.y+=delta*.01}else if(_state===STATE.CUSTOM){_customStart.y+=delta*.01}_this.dispatchEvent(startEvent);_this.dispatchEvent(endEvent)}function touchstart(event){if(_this.enabled===false)return;if(_this.forceState===-1){switch(event.touches.length){case 1:_state=STATE.TOUCH_ROTATE;_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));_movePrev.copy(_moveCurr);break;case 2:_state=STATE.TOUCH_ZOOM;var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=_touchZoomDistanceStart=Math.sqrt(dx*dx+dy*dy);var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panStart.copy(getMouseOnScreen(x,y));_panEnd.copy(_panStart);break;default:_state=STATE.NONE}}else{switch(_state){case 0:_state=STATE.TOUCH_ROTATE;_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));_movePrev.copy(_moveCurr);break;case 1:case 4:if(event.touches.length>=2){_state=STATE.TOUCH_ZOOM;var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=_touchZoomDistanceStart=Math.sqrt(dx*dx+dy*dy)}else{_state=STATE.ZOOM;_zoomStart.copy(getMouseOnScreen(event.touches[0].pageX,event.touches[0].pageY));_zoomEnd.copy(_zoomStart)}break;case 2:case 5:if(event.touches.length>=2){_state=STATE.TOUCH_PAN;var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panStart.copy(getMouseOnScreen(x,y));_panEnd.copy(_panStart)}else{_state=STATE.PAN;_panStart.copy(getMouseOnScreen(event.touches[0].pageX,event.touches[0].pageY));_panEnd.copy(_panStart)}break;case 99:_state=STATE.CUSTOM;var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_customStart.copy(getMouseOnScreen(x,y));_customEnd.copy(_customStart);break;default:_state=STATE.NONE}}_this.dispatchEvent(startEvent)}function touchmove(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_this.forceState===-1){switch(event.touches.length){case 1:_movePrev.copy(_moveCurr);_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));break;case 2:var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=Math.sqrt(dx*dx+dy*dy);var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));break;default:_state=STATE.NONE}}else{switch(_state){case 0:_movePrev.copy(_moveCurr);_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));break;case 1:_zoomEnd.copy(getMouseOnScreen(event.touches[0].pageX,event.touches[0].pageY));break;case 2:_panEnd.copy(getMouseOnScreen(event.touches[0].pageX,event.touches[0].pageY));break;case 4:var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=Math.sqrt(dx*dx+dy*dy);break;case 5:var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));break;case 99:var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_customEnd.copy(getMouseOnScreen(x,y));break;default:_state=STATE.NONE}}}function touchend(event){if(_this.enabled===false)return;if(_this.forceState===-1){switch(event.touches.length){case 1:_movePrev.copy(_moveCurr);_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));break;case 2:_touchZoomDistanceStart=_touchZoomDistanceEnd=0;var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));_panStart.copy(_panEnd);break}_state=STATE.NONE}else{switch(_state){case 0:_movePrev.copy(_moveCurr);_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));break;case 1:case 2:break;case 4:_touchZoomDistanceStart=_touchZoomDistanceEnd=0;_state=STATE.ZOOM;break;case 5:if(event.touches.length>=2){var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));_panStart.copy(_panEnd)}_state=STATE.PAN;break;case 99:var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_customEnd.copy(getMouseOnScreen(x,y));_customStart.copy(_customEnd);break;default:_state=STATE.NONE}}_this.dispatchEvent(endEvent)}_this2.domElement.addEventListener("contextmenu",function(event){event.preventDefault()},false);_this2.domElement.addEventListener("mousedown",mousedown,false);_this2.domElement.addEventListener("mousewheel",mousewheel,false);_this2.domElement.addEventListener("DOMMouseScroll",mousewheel,false);_this2.domElement.addEventListener("touchstart",touchstart,false);_this2.domElement.addEventListener("touchend",touchend,false);_this2.domElement.addEventListener("touchmove",touchmove,false);window.addEventListener("keydown",keydown,false);window.addEventListener("keyup",keyup,false);_this2.handleResize();_this2.update();return _this2}return Trackball}(THREE.EventDispatcher);exports.default=Trackball},{}],91:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return call&&((typeof call==="undefined"?"undefined":_typeof(call))==="object"||typeof call==="function")?call:self}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+(typeof superClass==="undefined"?"undefined":_typeof(superClass)))}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass}var Trackballortho=function(_THREE$EventDispatche){_inherits(Trackballortho,_THREE$EventDispatche);function Trackballortho(object,domElement){var state=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{NONE:-1,ROTATE:1,ZOOM:2,PAN:0,SCROLL:4,TOUCH_ROTATE:4,TOUCH_ZOOM_PAN:5};_classCallCheck(this,Trackballortho);var _this2=_possibleConstructorReturn(this,(Trackballortho.__proto__||Object.getPrototypeOf(Trackballortho)).call(this));var _this=_this2;var STATE=state;_this2.object=object;_this2.domElement=domElement!==undefined?domElement:document;_this2.enabled=true;_this2.screen={left:0,top:0,width:0,height:0};_this2.radius=0;_this2.zoomSpeed=1.2;_this2.noZoom=false;_this2.noPan=false;_this2.staticMoving=false;_this2.dynamicDampingFactor=.2;_this2.keys=[65,83,68];_this2.target=new THREE.Vector3;var EPS=1e-6;var _changed=true;var _state=STATE.NONE,_prevState=STATE.NONE,_eye=new THREE.Vector3,_zoomStart=new THREE.Vector2,_zoomEnd=new THREE.Vector2,_touchZoomDistanceStart=0,_touchZoomDistanceEnd=0,_panStart=new THREE.Vector2,_panEnd=new THREE.Vector2;_this2.target0=_this2.target.clone();_this2.position0=_this2.object.position.clone();_this2.up0=_this2.object.up.clone();_this2.left0=_this2.object.left;_this2.right0=_this2.object.right;_this2.top0=_this2.object.top;_this2.bottom0=_this2.object.bottom;var changeEvent={type:"change"};var startEvent={type:"start"};var endEvent={type:"end"};_this2.handleResize=function(){if(this.domElement===document){this.screen.left=0;this.screen.top=0;this.screen.width=window.innerWidth;this.screen.height=window.innerHeight}else{var box=this.domElement.getBoundingClientRect();var d=this.domElement.ownerDocument.documentElement;this.screen.left=box.left+window.pageXOffset-d.clientLeft;this.screen.top=box.top+window.pageYOffset-d.clientTop;this.screen.width=box.width;this.screen.height=box.height}this.radius=.5*Math.min(this.screen.width,this.screen.height);this.left0=this.object.left;this.right0=this.object.right;this.top0=this.object.top;this.bottom0=this.object.bottom};_this2.handleEvent=function(event){if(typeof this[event.type]=="function"){this[event.type](event)}};var getMouseOnScreen=function(){var vector=new THREE.Vector2;return function getMouseOnScreen(pageX,pageY){vector.set((pageX-_this.screen.left)/_this.screen.width,(pageY-_this.screen.top)/_this.screen.height);return vector}}();_this2.zoomCamera=function(){if(_state===STATE.TOUCH_ZOOM_PAN){var factor=_touchZoomDistanceEnd/_touchZoomDistanceStart;_touchZoomDistanceStart=_touchZoomDistanceEnd;_this.object.zoom*=factor;_changed=true}else{var factor=1+(_zoomEnd.y-_zoomStart.y)*_this.zoomSpeed;if(Math.abs(factor-1)>EPS&&factor>0){_this.object.zoom/=factor;if(_this.staticMoving){_zoomStart.copy(_zoomEnd)}else{_zoomStart.y+=(_zoomEnd.y-_zoomStart.y)*this.dynamicDampingFactor}_changed=true}}};_this2.panCamera=function(){var mouseChange=new THREE.Vector2,objectUp=new THREE.Vector3,pan=new THREE.Vector3;return function panCamera(){mouseChange.copy(_panEnd).sub(_panStart);if(mouseChange.lengthSq()){var scale_x=(_this.object.right-_this.object.left)/_this.object.zoom;var scale_y=(_this.object.top-_this.object.bottom)/_this.object.zoom;mouseChange.x*=scale_x;mouseChange.y*=scale_y;pan.copy(_eye).cross(_this.object.up).setLength(mouseChange.x);pan.add(objectUp.copy(_this.object.up).setLength(mouseChange.y));_this.object.position.add(pan);_this.target.add(pan);if(_this.staticMoving){_panStart.copy(_panEnd)}else{_panStart.add(mouseChange.subVectors(_panEnd,_panStart).multiplyScalar(_this.dynamicDampingFactor))}_changed=true}}}();_this2.update=function(){_eye.subVectors(_this.object.position,_this.target);if(!_this.noZoom){_this.zoomCamera();if(_changed){_this.object.updateProjectionMatrix()}}if(!_this.noPan){_this.panCamera()}_this.object.position.addVectors(_this.target,_eye);_this.object.lookAt(_this.target);if(_changed){_this.dispatchEvent(changeEvent);_changed=false}};_this2.reset=function(){_state=STATE.NONE;_prevState=STATE.NONE;_this.target.copy(_this.target0);_this.object.position.copy(_this.position0);_this.object.up.copy(_this.up0);_eye.subVectors(_this.object.position,_this.target);_this.object.left=_this.left0;_this.object.right=_this.right0;_this.object.top=_this.top0;_this.object.bottom=_this.bottom0;_this.object.lookAt(_this.target);_this.dispatchEvent(changeEvent);_changed=false};function keydown(event){if(_this.enabled===false)return;window.removeEventListener("keydown",keydown);_prevState=_state;if(_state!==STATE.NONE){return}else if(event.keyCode===_this.keys[STATE.ROTATE]&&!_this.noRotate){_state=STATE.ROTATE}else if(event.keyCode===_this.keys[STATE.ZOOM]&&!_this.noZoom){_state=STATE.ZOOM}else if(event.keyCode===_this.keys[STATE.PAN]&&!_this.noPan){_state=STATE.PAN}}function keyup(event){if(_this.enabled===false)return;_state=_prevState;window.addEventListener("keydown",keydown,false)}function mousedown(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_state===STATE.NONE){_state=event.button}if(_state===STATE.ROTATE&&!_this.noRotate){}else if(_state===STATE.ZOOM&&!_this.noZoom){_zoomStart.copy(getMouseOnScreen(event.pageX,event.pageY));_zoomEnd.copy(_zoomStart)}else if(_state===STATE.PAN&&!_this.noPan){_panStart.copy(getMouseOnScreen(event.pageX,event.pageY));_panEnd.copy(_panStart)}document.addEventListener("mousemove",mousemove,false);document.addEventListener("mouseup",mouseup,false);_this.dispatchEvent(startEvent)}function mousemove(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_state===STATE.ROTATE&&!_this.noRotate){}else if(_state===STATE.ZOOM&&!_this.noZoom){_zoomEnd.copy(getMouseOnScreen(event.pageX,event.pageY))}else if(_state===STATE.PAN&&!_this.noPan){_panEnd.copy(getMouseOnScreen(event.pageX,event.pageY))}}function mouseup(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();_state=STATE.NONE;document.removeEventListener("mousemove",mousemove);document.removeEventListener("mouseup",mouseup);_this.dispatchEvent(endEvent)}function mousewheel(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();var delta=0;if(event.wheelDelta){delta=event.wheelDelta/40}else if(event.detail){delta=-event.detail/3}_this.dispatchEvent({type:"OnScroll",delta:delta});_this.dispatchEvent(startEvent);_this.dispatchEvent(endEvent)}function touchstart(event){if(_this.enabled===false)return;switch(event.touches.length){case 1:_state=STATE.TOUCH_ROTATE;break;case 2:_state=STATE.TOUCH_ZOOM_PAN;var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=_touchZoomDistanceStart=Math.sqrt(dx*dx+dy*dy);var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panStart.copy(getMouseOnScreen(x,y));_panEnd.copy(_panStart);break;default:_state=STATE.NONE}_this.dispatchEvent(startEvent)}function touchmove(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();switch(event.touches.length){case 1:break;case 2:var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=Math.sqrt(dx*dx+dy*dy);var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));break;default:_state=STATE.NONE}}function touchend(event){if(_this.enabled===false)return;switch(event.touches.length){case 1:break;case 2:_touchZoomDistanceStart=_touchZoomDistanceEnd=0;var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));_panStart.copy(_panEnd);break}_state=STATE.NONE;_this.dispatchEvent(endEvent)}function contextmenu(event){event.preventDefault()}_this2.dispose=function(){this.domElement.removeEventListener("contextmenu",contextmenu,false);this.domElement.removeEventListener("mousedown",mousedown,false);this.domElement.removeEventListener("mousewheel",mousewheel,false);this.domElement.removeEventListener("MozMousePixelScroll",mousewheel,false);this.domElement.removeEventListener("touchstart",touchstart,false);this.domElement.removeEventListener("touchend",touchend,false);this.domElement.removeEventListener("touchmove",touchmove,false);document.removeEventListener("mousemove",mousemove,false);document.removeEventListener("mouseup",mouseup,false);window.removeEventListener("keydown",keydown,false);window.removeEventListener("keyup",keyup,false)};_this2.domElement.addEventListener("contextmenu",contextmenu,false);_this2.domElement.addEventListener("mousedown",mousedown,false);_this2.domElement.addEventListener("mousewheel",mousewheel,false);_this2.domElement.addEventListener("MozMousePixelScroll",mousewheel,false);_this2.domElement.addEventListener("touchstart",touchstart,false);_this2.domElement.addEventListener("touchend",touchend,false); -_this2.domElement.addEventListener("touchmove",touchmove,false);window.addEventListener("keydown",keydown,false);window.addEventListener("keyup",keyup,false);_this2.handleResize();_this2.update();return _this2}return Trackballortho}(THREE.EventDispatcher);exports.default=Trackballortho},{}],92:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i.008856){y=Math.pow(y,3)}else{y=(y-16/116)/7.787}if(Math.pow(x,3)>.008856){x=Math.pow(x,3)}else{x=(x-16/116)/7.787}if(Math.pow(z,3)>.008856){z=Math.pow(z,3)}else{z=(z-16/116)/7.787}return[refX*x,refY*y,refZ*z]}},{key:"xyz2RGB",value:function xyz2RGB(x,y,z){x/=100;y/=100;z/=100;var r=x*3.2406+y*-1.5372+z*-.4986;var g=x*-.9689+y*1.8758+z*.0415;var b=x*.0557+y*-.204+z*1.057;if(r>.0031308){r=1.055*Math.pow(r,1/2.4)-.055}else{r=12.92*r}if(g>.0031308){g=1.055*Math.pow(g,1/2.4)-.055}else{g=12.92*g}if(b>.0031308){b=1.055*Math.pow(b,1/2.4)-.055}else{b=12.92*b}r=r*255;g=g*255;b=b*255;return[r,g,b]}},{key:"cielab2RGB",value:function cielab2RGB(){var l=arguments.length>0&&arguments[0]!==undefined?arguments[0]:50;var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var b=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;if(!(l>=0&&l<=100)){return null}var xyz=this.cielab2XYZ(l,a,b);return this.xyz2RGB.apply(this,_toConsumableArray(xyz))}}]);return Colors}();exports.default=Colors},{}],93:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i=bbox.min.x-epsilon&&point.y>=bbox.min.y-epsilon&&point.z>=bbox.min.z-epsilon&&point.x<=bbox.max.x+epsilon&&point.y<=bbox.max.y+epsilon&&point.z<=bbox.max.z+epsilon){return true}return false}},{key:"posdir",value:function posdir(position,direction){return{position:position,direction:direction}}},{key:"validatePlane",value:function validatePlane(plane){if(plane===null){window.console.log("Invalid plane.");window.console.log(plane);return false}if(!_core4.default.vector3(plane.position)){window.console.log("Invalid plane.position.");window.console.log(plane.position);return false}if(!_core4.default.vector3(plane.direction)){window.console.log("Invalid plane.direction.");window.console.log(plane.direction);return false}return true}},{key:"validateAabb",value:function validateAabb(aabb){if(aabb===null){window.console.log("Invalid aabb.");window.console.log(aabb);return false}if(!_core4.default.matrix4(aabb.toAABB)){window.console.log("Invalid aabb.toAABB: ");window.console.log(aabb.toAABB);return false}if(!_core4.default.vector3(aabb.center)){window.console.log("Invalid aabb.center.");window.console.log(aabb.center);return false}if(!(_core4.default.vector3(aabb.halfDimensions)&&aabb.halfDimensions.x>=0&&aabb.halfDimensions.y>=0&&aabb.halfDimensions.z>=0)){window.console.log("Invalid aabb.halfDimensions.");window.console.log(aabb.halfDimensions);return false}return true}}]);return Intersections}();exports.default=Intersections},{"./core.utils":96,"./core.validators":97}],94:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _core=require("./core.colors");var _core2=_interopRequireDefault(_core);var _core3=require("./core.intersections");var _core4=_interopRequireDefault(_core3);var _core5=require("./core.pack");var _core6=_interopRequireDefault(_core5);var _core7=require("./core.validators");var _core8=_interopRequireDefault(_core7);var _core9=require("./core.utils");var _core10=_interopRequireDefault(_core9);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Colors:_core2.default,Intersections:_core4.default,Utils:_core10.default,Validators:_core8.default}},{"./core.colors":92,"./core.intersections":93,"./core.pack":95,"./core.utils":96,"./core.validators":97}],95:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var Pack=function Pack(){_classCallCheck(this,Pack)};exports.default=Pack},{}],96:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i=0&&halfDimensions.y>=0&&halfDimensions.z>=0)){window.console.log("halfDimensions must be >= 0.");window.console.log(halfDimensions);return false}var min=center.clone().sub(halfDimensions);var max=center.clone().add(halfDimensions);return{min:min,max:max}}},{key:"minMaxPixelData",value:function minMaxPixelData(){var pixelData=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var minMax=[65535,-32768];var numPixels=pixelData.length;for(var index=0;index=0&&objectToTest.halfDimensions.y>=0&&objectToTest.halfDimensions.z>=0)){return false}return true}},{key:"ray",value:function ray(objectToTest){if(!(objectToTest!==null&&typeof objectToTest!=="undefined"&&objectToTest.hasOwnProperty("position")&&this.vector3(objectToTest.position)&&objectToTest.hasOwnProperty("direction")&&this.vector3(objectToTest.direction))){return false}return true}}]);return Validators}();exports.default=Validators},{}],98:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _geometries=require("./geometries.slice");var _geometries2=_interopRequireDefault(_geometries);var _geometries3=require("./geometries.voxel");var _geometries4=_interopRequireDefault(_geometries3);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Slice:_geometries2.default,Voxel:_geometries4.default}},{"./geometries.slice":99,"./geometries.voxel":100}],99:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i4&&arguments[4]!==undefined?arguments[4]:new THREE.Matrix4;_classCallCheck(this,GeometriesSlice);var aabb={halfDimensions:halfDimensions,center:center,toAABB:toAABB};var plane={position:position,direction:direction};var intersections=_core2.default.aabbPlane(aabb,plane);if(intersections.length<3){window.console.log("WARNING: Less than 3 intersections between AABB and Plane.");window.console.log("AABB");window.console.log(aabb);window.console.log("Plane");window.console.log(plane);window.console.log("exiting...");throw"geometries.slice has less than 3 intersections, can not create a valid geometry."}var orderedIntersections=GeometriesSlice.orderIntersections(intersections,direction);var sliceShape=GeometriesSlice.shape(orderedIntersections);var _this=_possibleConstructorReturn(this,(GeometriesSlice.__proto__||Object.getPrototypeOf(GeometriesSlice)).call(this,sliceShape));_this.type="SliceGeometry";_this.vertices=orderedIntersections;_this.verticesNeedUpdate=true;return _this}_createClass(GeometriesSlice,null,[{key:"shape",value:function shape(points){var shape=new THREE.Shape;shape.moveTo(points[0].xy.x,points[0].xy.y);for(var l=1;l1&&arguments[1]!==undefined?arguments[1]:"default";var lutO=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"linear";var color=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[[0,0,0,0],[1,1,1,1]];var opacity=arguments.length>4&&arguments[4]!==undefined?arguments[4]:[[0,0],[1,1]];var discrete=arguments.length>5&&arguments[5]!==undefined?arguments[5]:false;_classCallCheck(this,HelpersLut);this._containerID=containerID;this._discrete=discrete;this._color=color;this._lut=lut;this._luts=_defineProperty({},lut,color);this._opacity=opacity;this._lutO=lutO;this._lutsO=_defineProperty({},lutO,opacity);this.initCanvas();this.paintCanvas()}_createClass(HelpersLut,[{key:"initCanvas",value:function initCanvas(){this._canvasContainer=this.initCanvasContainer(this._containerID);this._canvasBg=this.createCanvas();this._canvasContainer.appendChild(this._canvasBg);this._canvas=this.createCanvas();this._canvasContainer.appendChild(this._canvas)}},{key:"initCanvasContainer",value:function initCanvasContainer(canvasContainerId){var canvasContainer=document.getElementById(canvasContainerId);canvasContainer.style.width="256 px";canvasContainer.style.height="128 px";canvasContainer.style.border="1px solid #F9F9F9";return canvasContainer}},{key:"createCanvas",value:function createCanvas(){var canvas=document.createElement("canvas");canvas.height=16;canvas.width=256;return canvas}},{key:"paintCanvas",value:function paintCanvas(){var ctx=this._canvas.getContext("2d");ctx.clearRect(0,0,this._canvas.width,this._canvas.height);ctx.globalCompositeOperation="source-over";if(!this._discrete){var color=ctx.createLinearGradient(0,0,this._canvas.width,this._canvas.height);for(var i=0;i0){previousPos=this._color[_i-1][0]}var from=previousPos+(currentPos-previousPos)/2;var to=currentPos+(nextPos-currentPos)/2;var _color=this._color[_i];var opacity=this._opacity[_i]?this._opacity[_i][1]:1;ctx.beginPath();ctx.strokeStyle="rgba( "+Math.round(_color[1]*255)+", "+Math.round(_color[2]*255)+", "+Math.round(_color[3]*255)+", "+opacity+")";ctx.moveTo(from*this._canvas.width,0);ctx.lineTo(to*this._canvas.width,0);ctx.stroke();ctx.closePath()}}if(!this._discrete){ctx.globalCompositeOperation="destination-in";var _opacity=ctx.createLinearGradient(0,0,this._canvas.width,this._canvas.height);for(var _i2=0;_i20&&arguments[0]!==undefined?arguments[0]:"color";var available=[];var luts=this._luts;if(type!=="color"){luts=this._lutsO}for(var i in luts){available.push(i)}return available}},{key:"texture",get:function get(){var texture=new THREE.Texture(this._canvas);texture.mapping=THREE.UVMapping;texture.wrapS=texture.wrapT=THREE.ClampToEdgeWrapping;texture.magFilter=texture.minFilter=THREE.NearestFilter;texture.premultiplyAlpha=true;texture.needsUpdate=true;return texture}},{key:"lut",set:function set(targetLUT){this._color=this._luts[targetLUT];this._lut=targetLUT;this.paintCanvas()},get:function get(){return this._lut}},{key:"luts",set:function set(newLuts){this._luts=newLuts},get:function get(){return this._luts}},{key:"lutO",set:function set(targetLUTO){this._opacity=this._lutsO[targetLUTO];this._lutO=targetLUTO;this.paintCanvas()},get:function get(){return this._lutO}},{key:"lutsO",set:function set(newLutsO){this._lutsO=newLutsO},get:function get(){return this._lutsO}},{key:"discrete",set:function set(discrete){this._discrete=discrete;this.paintCanvas()},get:function get(){return this._discrete}}],[{key:"presetLuts",value:function presetLuts(){return{default:[[0,0,0,0],[1,1,1,1]],spectrum:[[0,0,0,0],[.1,0,0,1],[.33,0,1,1],[.5,0,1,0],[.66,1,1,0],[.9,1,0,0],[1,1,1,1]],hot_and_cold:[[0,0,0,1],[.15,0,1,1],[.3,0,1,0],[.45,0,0,0],[.5,0,0,0],[.55,0,0,0],[.7,1,1,0],[.85,1,0,0],[1,1,1,1]],gold:[[0,0,0,0],[.13,.19,.03,0],[.25,.39,.12,0],[.38,.59,.26,0],[.5,.8,.46,.08],[.63,.99,.71,.21],[.75,.99,.88,.34],[.88,.99,.99,.48],[1,.9,.95,.61]],red:[[0,.75,0,0],[.5,1,.5,0],[.95,1,1,0],[1,1,1,1]],green:[[0,0,.75,0],[.5,.5,1,0],[.95,1,1,0],[1,1,1,1]],blue:[[0,0,0,1],[.5,0,.5,1],[.95,0,1,1],[1,1,1,1]],walking_dead:[[0,.1,1,1],[1,1,1,1]],random:[[0,0,0,0],[.27,.18,.18,.18],[.41,1,1,1],[.7,1,0,0],[1,1,1,1]]}}},{key:"presetLutsO",value:function presetLutsO(){return{linear:[[0,0],[1,1]],lowpass:[[0,.8],[.2,.6],[.3,.1],[1,0]],bandpass:[[0,0],[.4,.8],[.6,.8],[1,0]],highpass:[[0,0],[.7,.1],[.8,.6],[1,.8]],flat:[[0,.7],[1,1]],random:[[0,0],[.38,0],[.55,1],[.72,1],[1,.05]]}}}]);return HelpersLut}();exports.default=HelpersLut},{}],105:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0){progressContainers[0].parentNode.removeChild(progressContainers[0])}progressContainers=null;window.cancelAnimationFrame(this.requestAnimationFrameID)}},{key:"init",value:function init(){var progressContainer=this._domContainer();for(var mode in this._modes){if(this._modes.hasOwnProperty(mode)){var bar=this._domBar(this._modes[mode]);progressContainer.appendChild(bar);bar=null}}this._container.appendChild(progressContainer);progressContainer=null;this.updateUI()}},{key:"update",value:function update(value,total,mode){this._mode=mode;this._value=value;if(total===0){this._total=value;this._value=Math.random()*value}else{this._total=total}}},{key:"updateUI",value:function updateUI(){var _this=this;this.requestAnimationFrameID=requestAnimationFrame(function(){_this.updateUI()});if(!(this._modes.hasOwnProperty(this._mode)&&this._modes[this._mode].hasOwnProperty("name")&&this._modes[this._mode].hasOwnProperty("color"))){return false}var message="";var progress=Math.round(this._value/this._total*100);var color=this._modes[this._mode].color;var progressBar=this._container.getElementsByClassName("progress "+this._modes[this._mode].name);if(progressBar.length>0){progressBar[0].style.borderColor=color;progressBar[0].style.width=progress+"%"}progressBar=null}},{key:"_domContainer",value:function _domContainer(){var container=document.createElement("div");container.classList.add("progress");container.classList.add("container");container.style.width="100%";container.style.height="8px";container.style.position="absolute";container.style.backgroundColor="rgba(158, 158, 158, 0.5)";container.style.top="0";container.style.zIndex="1";return container}},{key:"_domBar",value:function _domBar(mode){if(!(mode.hasOwnProperty("name")&&mode.hasOwnProperty("color"))){window.console.log("Invalid mode provided.");window.console.log(mode);return false}var bar=document.createElement("div");bar.classList.add(mode.name);bar.classList.add("progress");bar.style.border="2px solid "+mode.color;bar.style.width="0%";return bar}}]);return HelpersProgressBar}();exports.default=HelpersProgressBar},{}],107:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i1&&arguments[1]!==undefined?arguments[1]:0;var position=arguments.length>2&&arguments[2]!==undefined?arguments[2]:new THREE.Vector3(0,0,0);var direction=arguments.length>3&&arguments[3]!==undefined?arguments[3]:new THREE.Vector3(0,0,1);var aabbSpace=arguments.length>4&&arguments[4]!==undefined?arguments[4]:"IJK";_classCallCheck(this,HelpersSlice);var _this=_possibleConstructorReturn(this,(HelpersSlice.__proto__||Object.getPrototypeOf(HelpersSlice)).call(this));_this._stack=stack;_this._invert=_this._stack.invert;_this._lut="none";_this._lutTexture=null;_this._intensityAuto=true;_this._interpolation=1;_this._index=index;_this._windowWidth=null;_this._windowCenter=null;_this._rescaleSlope=null;_this._rescaleIntercept=null;_this._planePosition=position;_this._planeDirection=direction;_this._aaBBspace=aabbSpace;_this._material=null;_this._textures=[];_this._shadersFragment=_shadersData6.default;_this._shadersVertex=_shadersData4.default;_this._uniforms=_shadersData2.default.uniforms();_this._geometry=null;_this._mesh=null;_this._visible=true;_this._init();_this._create();return _this}_createClass(HelpersSlice,[{key:"_init",value:function _init(){if(!this._stack||!this._stack._prepared||!this._stack._packed){return}if(this._aaBBspace==="IJK"){this._halfDimensions=this._stack.halfDimensionsIJK;this._center=new THREE.Vector3(this._stack.halfDimensionsIJK.x-.5,this._stack.halfDimensionsIJK.y-.5,this._stack.halfDimensionsIJK.z-.5);this._toAABB=new THREE.Matrix4}else{var aaBBox=this._stack.AABBox();this._halfDimensions=aaBBox.clone().multiplyScalar(.5);this._center=this._stack.centerAABBox();this._toAABB=this._stack.lps2AABB}}},{key:"_create",value:function _create(){if(!this._stack||!this._stack.prepared||!this._stack.packed){return}try{this._geometry=new _geometries2.default(this._halfDimensions,this._center,this._planePosition,this._planeDirection,this._toAABB)}catch(e){window.console.log(e);window.console.log("invalid slice geometry - exiting...");return}if(!this._geometry.vertices){return}if(!this._material){this._uniforms.uTextureSize.value=this._stack.textureSize;this._uniforms.uDataDimensions.value=[this._stack.dimensionsIJK.x,this._stack.dimensionsIJK.y,this._stack.dimensionsIJK.z];this._uniforms.uWorldToData.value=this._stack.lps2IJK;this._uniforms.uNumberOfChannels.value=this._stack.numberOfChannels;this._uniforms.uPixelType.value=this._stack.pixelType;this._uniforms.uBitsAllocated.value=this._stack.bitsAllocated;this._uniforms.uPackedPerPixel.value=this._stack.packedPerPixel;this._prepareTexture();this._uniforms.uTextureContainer.value=this._textures;this._createMaterial({side:THREE.DoubleSide})}this.updateIntensitySettings();this.updateIntensitySettingsUniforms();this._mesh=new THREE.Mesh(this._geometry,this._material);if(this._aaBBspace==="IJK"){this._mesh.applyMatrix(this._stack.ijk2LPS)}this._mesh.visible=this._visible;this.add(this._mesh)}},{key:"updateIntensitySettings",value:function updateIntensitySettings(){if(this._intensityAuto){this.updateIntensitySetting("windowCenter");this.updateIntensitySetting("windowWidth");this.updateIntensitySetting("rescaleSlope");this.updateIntensitySetting("rescaleIntercept")}else{if(this._windowCenter===null){this._windowCenter=this._stack.windowCenter}if(this.__windowWidth===null){this._windowWidth=this._stack.windowWidth}if(this._rescaleSlope===null){this._rescaleSlope=this._stack.rescaleSlope}if(this._rescaleIntercept===null){this._rescaleIntercept=this._stack.rescaleIntercept}}}},{key:"updateIntensitySettingsUniforms",value:function updateIntensitySettingsUniforms(){this._uniforms.uRescaleSlopeIntercept.value=[this._rescaleSlope,this._rescaleIntercept];this._uniforms.uWindowCenterWidth.value=[this._windowCenter,this._windowWidth];this._uniforms.uInvert.value=this._invert===true?1:0;this._uniforms.uInterpolation.value=this._interpolation;if(this._lut==="none"){this._uniforms.uLut.value=0}else{this._uniforms.uLut.value=1;this._uniforms.uTextureLUT.value=this._lutTexture}}},{key:"updateIntensitySetting",value:function updateIntensitySetting(setting){if(this._stack.frame[this._index]&&this._stack.frame[this._index][setting]){this["_"+setting]=this._stack.frame[this._index][setting]}else{this["_"+setting]=this._stack[setting]}}},{key:"_update",value:function _update(){if(this._mesh){this.remove(this._mesh);this._mesh.geometry.dispose();this._mesh.geometry=null;this._mesh=null}this._create()}},{key:"stack",get:function get(){return this._stack},set:function set(stack){this._stack=stack}},{key:"windowWidth",get:function get(){return this._windowWidth},set:function set(windowWidth){this._windowWidth=windowWidth;this.updateIntensitySettingsUniforms()}},{key:"windowCenter",get:function get(){return this._windowCenter},set:function set(windowCenter){this._windowCenter=windowCenter;this.updateIntensitySettingsUniforms()}},{key:"rescaleSlope",get:function get(){return this._rescaleSlope},set:function set(rescaleSlope){this._rescaleSlope=rescaleSlope;this.updateIntensitySettingsUniforms()}},{key:"rescaleIntercept",get:function get(){return this._rescaleIntercept},set:function set(rescaleIntercept){this._rescaleIntercept=rescaleIntercept;this.updateIntensitySettingsUniforms()}},{key:"invert",get:function get(){return this._invert},set:function set(invert){this._invert=invert;this.updateIntensitySettingsUniforms()}},{key:"lut",get:function get(){return this._lut},set:function set(lut){this._lut=lut}},{key:"lutTexture",get:function get(){return this._lutTexture},set:function set(lutTexture){this._lutTexture=lutTexture;this.updateIntensitySettingsUniforms()}},{key:"intensityAuto",get:function get(){return this._intensityAuto},set:function set(intensityAuto){this._intensityAuto=intensityAuto;this.updateIntensitySettings();this.updateIntensitySettingsUniforms()}},{key:"interpolation",get:function get(){return this._interpolation},set:function set(interpolation){this._interpolation=interpolation;this.updateIntensitySettingsUniforms();this._updateMaterial()}},{key:"index",get:function get(){return this._index},set:function set(index){this._index=index;this._update()}},{key:"planePosition",set:function set(position){this._planePosition=position;this._update()},get:function get(){return this._planePosition}},{key:"planeDirection",set:function set(direction){this._planeDirection=direction;this._update()},get:function get(){return this._planeDirection}},{key:"halfDimensions",set:function set(halfDimensions){this._halfDimensions=halfDimensions},get:function get(){return this._halfDimensions}},{key:"center",set:function set(center){this._center=center},get:function get(){return this._center}},{key:"aabbSpace",set:function set(aabbSpace){this._aaBBspace=aabbSpace;this._init()},get:function get(){return this._aaBBspace}},{key:"mesh",set:function set(mesh){this._mesh=mesh},get:function get(){return this._mesh}},{key:"geometry",set:function set(geometry){this._geometry=geometry},get:function get(){return this._geometry}}]);return HelpersSlice}((0,_helpersMaterial2.default)(THREE.Object3D));exports.default=HelpersSlice},{"../../src/geometries/geometries.slice":99,"../../src/helpers/helpers.material.mixin":105,"../../src/shaders/shaders.data.fragment":132,"../../src/shaders/shaders.data.uniform":133,"../../src/shaders/shaders.data.vertex":134}],108:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i=dimensions||this._index<0){this._outOfBounds=true}else{this._outOfBounds=false}}},{key:"_prepareStack",value:function _prepareStack(){if(!this._stack.prepared){this._stack.prepare()}if(!this._stack.packed){this._stack.pack()}}},{key:"_prepareBBox",value:function _prepareBBox(){this._bBox=new _helpers4.default(this._stack);this.add(this._bBox)}},{key:"_prepareBorder",value:function _prepareBorder(){this._border=new _helpers2.default(this._slice);this.add(this._border)}},{key:"_prepareSlice",value:function _prepareSlice(){var halfDimensionsIJK=this._stack.halfDimensionsIJK;this._index=this._prepareSliceIndex(halfDimensionsIJK);var position=this._prepareSlicePosition(halfDimensionsIJK,this._index);var direction=this._prepareDirection(this._orientation);this._slice=new _helpers6.default(this._stack,this._index,position,direction);this.add(this._slice)}},{key:"_prepareSliceIndex",value:function _prepareSliceIndex(indices){var index=0;switch(this._orientation){case 0:index=Math.floor(indices.z);break;case 1:index=Math.floor(indices.x);break;case 2:index=Math.floor(indices.y);break;default:break}return index}},{key:"_prepareSlicePosition",value:function _prepareSlicePosition(rPosition,index){var position=new THREE.Vector3(0,0,0);switch(this._orientation){case 0:position=new THREE.Vector3(Math.floor(rPosition.x),Math.floor(rPosition.y),index);break;case 1:position=new THREE.Vector3(index,Math.floor(rPosition.y),Math.floor(rPosition.z));break;case 2:position=new THREE.Vector3(Math.floor(rPosition.x),index,Math.floor(rPosition.z));break;default:break}return position}},{key:"_prepareDirection",value:function _prepareDirection(orientation){var direction=new THREE.Vector3(0,0,1);switch(orientation){case 0:direction=new THREE.Vector3(0,0,1);break;case 1:direction=new THREE.Vector3(1,0,0);break;case 2:direction=new THREE.Vector3(0,1,0);break;default:break}return direction}},{key:"stack",get:function get(){return this._stack}},{key:"bbox",get:function get(){return this._bBox}},{key:"slice",get:function get(){return this._slice}},{key:"border",get:function get(){return this._border}},{key:"index",get:function get(){return this._index},set:function set(index){this._index=index;this._slice.index=index;var halfDimensions=this._stack.halfDimensionsIJK;this._slice.planePosition=this._prepareSlicePosition(halfDimensions,this._index);this._border.helpersSlice=this._slice;this._isIndexOutOfBounds()}},{key:"orientation",set:function set(orientation){this._orientation=orientation;this._slice.planeDirection=this._prepareDirection(this._orientation);this._border.helpersSlice=this._slice},get:function get(){return this._orientation}},{key:"outOfBounds",set:function set(outOfBounds){this._outOfBounds=outOfBounds},get:function get(){return this._outOfBounds}}]);return HelpersStack}(THREE.Object3D);exports.default=HelpersStack},{"../../src/helpers/helpers.border":101,"../../src/helpers/helpers.boundingbox":102,"../../src/helpers/helpers.slice":107}],109:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:null;var stack=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;_classCallCheck(this,HelpersVoxel);var _this=_possibleConstructorReturn(this,(HelpersVoxel.__proto__||Object.getPrototypeOf(HelpersVoxel)).call(this));_this._stack=stack;_this._worldCoordinates=worldCoordinates;_this._voxel=new _models4.default;_this._voxel.id=_this.id;_this._voxel.worldCoordinates=_this._worldCoordinates;if(_this._stack&&_this._stack.prepared&&_this._worldCoordinates){_this.updateVoxel(_this._worldCoordinates)}_this._mesh=null;_this._geometry=null;_this._material=null;_this._selected=false;_this._active=false;_this._hover=false;_this._distance=null;_this._showVoxel=true;_this._showDomSVG=true;_this._showDomMeasurements=true;_this._color="#00B0FF";_this._svgPointer=' ';_this.createMesh();return _this}_createClass(HelpersVoxel,[{key:"updateVoxel",value:function updateVoxel(worldCoordinates){this._voxel.worldCoordinates=worldCoordinates;this._voxel.dataCoordinates=_models2.default.worldToData(this._stack,this._voxel.worldCoordinates);var value=_models2.default.value(this._stack,this._voxel.dataCoordinates);this._voxel.value=_models2.default.valueRescaleSlopeIntercept(value,this._stack.rescaleSlope,this._stack.rescaleIntercept)}},{key:"updateVoxelScreenCoordinates",value:function updateVoxelScreenCoordinates(camera,container){this._voxel.screenCoordinates=HelpersVoxel.worldToScreen(this._worldCoordinates,camera,container)}},{key:"createMesh",value:function createMesh(){var dataCoordinates=_models2.default.worldToData(this._stack,this._worldCoordinates);this._geometry=new _geometries2.default(dataCoordinates);this._material=new THREE.MeshBasicMaterial({wireframe:true,wireframeLinewidth:2});this._material.color.set(this._color);this._mesh=new THREE.Mesh(this._geometry,this._material);this._mesh.applyMatrix(this._stack.ijk2LPS);this._mesh.visible=this._showVoxel;this.add(this._mesh)}},{key:"createDom",value:function createDom(){var measurementsContainer=this._createDiv("VJSVoxelMeasurements",this.id,"VJSVoxelMeasurements");var rasContainer=this._createDiv("VJSVoxelProbeWorld",this.id,"VJSVoxelProbeWorld");measurementsContainer.appendChild(rasContainer);var ijkContainer=this._createDiv("VJSVoxelProbeData",this.id,"VJSVoxelProbeData");measurementsContainer.appendChild(ijkContainer);var valueContainer=this._createDiv("VJSVoxelProbeValue",this.id,"VJSVoxelProbeValue");measurementsContainer.appendChild(valueContainer);var svgContainer=this._createDiv("VJSVoxelProbeSVG",this.id,"VJSVoxelProbeSVG");svgContainer.innerHTML=this._svgPointer;var domElement=this._createDiv("VJSWidgetVoxelProbe",this.id,"VJSWidgetVoxelProbe");domElement.appendChild(svgContainer);domElement.appendChild(measurementsContainer);return domElement}},{key:"updateDom",value:function updateDom(container){if(document.getElementById("VJSVoxelProbeWorld"+this.id)===null){container.appendChild(this.createDom())}var rasContainer=document.getElementById("VJSVoxelProbeWorld"+this.id);var rasContent=this._voxel.worldCoordinates.x.toFixed(2)+" : "+this._voxel.worldCoordinates.y.toFixed(2)+" : "+this._voxel.worldCoordinates.z.toFixed(2);rasContainer.innerHTML="LPS: "+rasContent;var ijkContainer=document.getElementById("VJSVoxelProbeData"+this.id);var ijkContent=this._voxel.dataCoordinates.x+" : "+this._voxel.dataCoordinates.y+" : "+this._voxel.dataCoordinates.z;ijkContainer.innerHTML="IJK: "+ijkContent;var valueContainer=document.getElementById("VJSVoxelProbeValue"+this.id);var valueContent=this._voxel.value;valueContainer.innerHTML="Value: "+valueContent;var selectedElement=document.getElementById("VJSWidgetVoxelProbe"+this.id);selectedElement.style.top=this._voxel.screenCoordinates.y;selectedElement.style.left=this._voxel.screenCoordinates.x;this.updateDomClass(selectedElement)}},{key:"updateDomClass",value:function updateDomClass(){var element=document.getElementById("VJSWidgetVoxelProbe"+this.id);if(this._active===true){element.classList.add("VJSVoxelProbeActive")}else{element.classList.remove("VJSVoxelProbeActive")}if(this._hover===true){element.classList.add("VJSVoxelProbeHover")}else{element.classList.remove("VJSVoxelProbeHover")}if(this._selected===true){element.classList.add("VJSVoxelProbeSelect")}else{element.classList.remove("VJSVoxelProbeSelect")}this.updateDomElementDisplay("VJSVoxelMeasurements"+this.id,this._showDomMeasurements);this.updateDomElementDisplay("VJSVoxelProbeSVG"+this.id,this._showDomSVG)}},{key:"updateDomElementDisplay",value:function updateDomElementDisplay(id,show){if(show){document.getElementById(id).style.display="block"}else{document.getElementById(id).style.display="none"}}},{key:"removeTest",value:function removeTest(){var node=document.getElementById("VJSWidgetVoxelProbe"+this.id);if(node.parentNode){node.parentNode.removeChild(node)}this.remove(this._mesh);this._mesh.geometry.dispose();this._mesh.material.dispose();this._mesh=null}},{key:"_createDiv",value:function _createDiv(idPrefix,idSuffix,className){var divContainer=document.createElement("div");divContainer.setAttribute("id",idPrefix+idSuffix);divContainer.setAttribute("class",className);return divContainer}},{key:"color",set:function set(color){this._color=color;if(this._material){this._material.color.set(this._color)}var selectedElement=document.getElementById("VJSVoxelMeasurements"+this.id);if(selectedElement){selectedElement.style.borderColor=this._color.replace("0x","#")}selectedElement=document.querySelector("#VJSVoxelProbeSVG"+this.id+"> svg > path");if(selectedElement){selectedElement.style.stroke=this._color.replace("0x","#")}},get:function get(){return this._color}},{key:"worldCoordinates",set:function set(worldCoordinates){this._worldCoordinates=worldCoordinates;this._voxel._worldCoordinates=worldCoordinates;this.updateVoxel(this._worldCoordinates);if(this._mesh&&this._mesh.geometry){this._mesh.geometry.location=this._voxel.dataCoordinates}},get:function get(){return this._worldCoordinates}},{key:"voxel",get:function get(){return this._voxel},set:function set(voxel){this._voxel=voxel}},{key:"showVoxel",set:function set(showVoxel){this._showVoxel=showVoxel;if(this._mesh){this._mesh.visible=this._showVoxel}},get:function get(){return this._showVoxel}},{key:"showDomSVG",set:function set(showDomSVG){this._showDomSVG=showDomSVG;this.updateDomClass()},get:function get(){return this._showDomSVG}},{key:"showDomMeasurements",set:function set(showDomMeasurements){this._showDomMeasurements=showDomMeasurements;this.updateDomClass()},get:function get(){return this._showDomMeasurements}},{key:"distance",set:function set(distance){this._distance=distance},get:function get(){return this._distance}},{key:"selected",set:function set(selected){this._selected=selected},get:function get(){return this._selected}},{key:"hover",set:function set(hover){this._hover=hover},get:function get(){return this._hover}},{key:"active",set:function set(active){this._active=active},get:function get(){return this._active}}],[{key:"worldToScreen",value:function worldToScreen(worldCoordinate,camera,canvas){var screenCoordinates=worldCoordinate.clone();screenCoordinates.project(camera);screenCoordinates.x=Math.round((screenCoordinates.x+1)*canvas.offsetWidth/2);screenCoordinates.y=Math.round((-screenCoordinates.y+1)*canvas.offsetHeight/2);screenCoordinates.z=0;return screenCoordinates}}]);return HelpersVoxel}(THREE.Object3D);exports.default=HelpersVoxel},{"../../src/geometries/geometries.voxel":100,"../../src/models/models.stack":118,"../../src/models/models.voxel":119}],111:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:document.body;var helpersProgress=arguments.length>1&&arguments[1]!==undefined?arguments[1]:_helpers2.default;_classCallCheck(this,LoadersBase);this._loaded=-1;this._totalLoaded=-1;this._parsed=-1;this._totalParsed=-1;this._container=container;this._helpersProgressBar=helpersProgress;this._progressBar=null;if(this._container&&this._helpersProgressBar){this._progressBar=new helpersProgress(this._container)}}_createClass(LoadersBase,[{key:"free",value:function free(){this._container=null;this._helpersProgressBar=null;if(this._progressBar){this._progressBar.free();this._progressBar=null}}},{key:"fetch",value:function fetch(url){var _this=this;return new Promise(function(resolve,reject){var request=new XMLHttpRequest;request.open("GET",url);request.crossOrigin=true;request.responseType="arraybuffer";request.onload=function(event){if(request.status===200){_this._loaded=event.loaded;_this._totalLoaded=event.total;if(_this._progressBar){_this._progressBar.update(_this._loaded,_this._totalLoaded,"load")}var buffer=request.response;var response={url:url,buffer:buffer};resolve(response)}else{reject(request.statusText)}};request.onerror=function(){reject(request.statusText)};request.onprogress=function(event){_this._loaded=event.loaded;_this._totalLoaded=event.total;if(_this._progressBar){_this._progressBar.update(_this._loaded,_this._totalLoaded,"load")}};request.send()})}}]);return LoadersBase}();exports.default=LoadersBase},{"../../src/helpers/helpers.progressbar":106,"../../src/models/models.frame":115,"../../src/models/models.series":117,"../../src/models/models.stack":118}],112:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _loaders=require("./loaders.volume");var _loaders2=_interopRequireDefault(_loaders);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Volume:_loaders2.default}},{"./loaders.volume":113}],113:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&yCos.length()>0){cosines[0]=xCos;cosines[1]=yCos;cosines[2]=new THREE.Vector3(0,0,0).crossVectors(cosines[0],cosines[1]).normalize()}}else{window.console.log("No valid image orientation for frame");window.console.log(this);window.console.log("Returning default orientation.")}if(!this._rightHanded){cosines[2].negate()}return cosines}},{key:"spacingXY",value:function spacingXY(){var spacingXY=[1,1];if(this.pixelSpacing){spacingXY[0]=this.pixelSpacing[0];spacingXY[1]=this.pixelSpacing[1]}else if(this.pixelAspectRatio){spacingXY[0]=1;spacingXY[1]=1*this.pixelAspectRatio[1]/this.pixelAspectRatio[0]}return spacingXY}},{key:"value",value:function value(column,row){return this.pixelData[column+this._columns*row]}},{key:"_compareArrays",value:function _compareArrays(reference,target){if(reference===target){return true}if(reference&&target&&reference.join()===target.join()){return true}return false}},{key:"rows",get:function get(){return this._rows},set:function set(rows){this._rows=rows}},{key:"columns",get:function get(){return this._columns},set:function set(columns){this._columns=columns}},{key:"spacingBetweenSlices",get:function get(){return this._spacingBetweenSlices},set:function set(spacingBetweenSlices){this._spacingBetweenSlices=spacingBetweenSlices}},{key:"sliceThickness",get:function get(){return this._sliceThickness},set:function set(sliceThickness){this._sliceThickness=sliceThickness}},{key:"imagePosition",get:function get(){return this._imagePosition},set:function set(imagePosition){this._imagePosition=imagePosition}},{key:"imageOrientation",get:function get(){return this._imageOrientation},set:function set(imageOrientation){this._imageOrientation=imageOrientation}},{key:"windowWidth",get:function get(){return this._windowWidth},set:function set(windowWidth){this._windowWidth=windowWidth}},{key:"windowCenter",get:function get(){return this._windowCenter},set:function set(windowCenter){this._windowCenter=windowCenter}},{key:"rescaleSlope",get:function get(){return this._rescaleSlope},set:function set(rescaleSlope){this._rescaleSlope=rescaleSlope}},{key:"rescaleIntercept",get:function get(){return this._rescaleIntercept},set:function set(rescaleIntercept){this._rescaleIntercept=rescaleIntercept}},{key:"bitsAllocated",get:function get(){return this._bitsAllocated},set:function set(bitsAllocated){this._bitsAllocated=bitsAllocated}},{key:"dist",get:function get(){return this._dist},set:function set(dist){this._dist=dist}},{key:"pixelSpacing",get:function get(){return this._pixelSpacing},set:function set(pixelSpacing){this._pixelSpacing=pixelSpacing}},{key:"pixelAspectRatio",get:function get(){return this._pixelAspectRatio},set:function set(pixelAspectRatio){this._pixelAspectRatio=pixelAspectRatio}},{key:"minMax",get:function get(){return this._minMax},set:function set(minMax){this._minMax=minMax}},{key:"dimensionIndexValues",get:function get(){return this._dimensionIndexValues},set:function set(dimensionIndexValues){this._dimensionIndexValues=dimensionIndexValues}},{key:"instanceNumber",get:function get(){return this._instanceNumber},set:function set(instanceNumber){this._instanceNumber=instanceNumber}},{key:"pixelData",get:function get(){return this._pixelData},set:function set(pixelData){this._pixelData=pixelData}},{key:"sopInstanceUID",set:function set(sopInstanceUID){this._sopInstanceUID=sopInstanceUID},get:function get(){return this._sopInstanceUID; -}},{key:"pixelType",get:function get(){return this._pixelType},set:function set(pixelType){this._pixelType=pixelType}},{key:"url",get:function get(){return this._url},set:function set(url){this._url=url}},{key:"referencedSegmentNumber",get:function get(){return this._referencedSegmentNumber},set:function set(referencedSegmentNumber){this._referencedSegmentNumber=referencedSegmentNumber}},{key:"rightHanded",get:function get(){return this._rightHanded},set:function set(rightHanded){this._rightHanded=rightHanded}}]);return ModelsFrame}(_models2.default);exports.default=ModelsFrame},{"../../src/models/models.base":114}],116:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _models=require("./models.frame");var _models2=_interopRequireDefault(_models);var _models3=require("./models.stack");var _models4=_interopRequireDefault(_models3);var _models5=require("./models.series");var _models6=_interopRequireDefault(_models5);var _models7=require("./models.voxel");var _models8=_interopRequireDefault(_models7);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Frame:_models2.default,Stack:_models4.default,Series:_models6.default,Voxel:_models8.default}},{"./models.frame":115,"./models.series":117,"./models.stack":118,"./models.voxel":119}],117:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0){this._numberOfFrames=this._frame.length}else{window.console.log("_frame doesn't contain anything....");window.console.log(this._frame);return false}this._rows=this._frame[0].rows;this._columns=this._frame[0].columns;this._dimensionsIJK=new THREE.Vector3(this._columns,this._rows,this._numberOfFrames);this._halfDimensionsIJK=new THREE.Vector3(this._dimensionsIJK.x/2,this._dimensionsIJK.y/2,this._dimensionsIJK.z/2);this._spacingBetweenSlices=this._frame[0].spacingBetweenSlices;this._sliceThickness=this._frame[0].sliceThickness;this.computeCosines();this.orderFrames();this.computeSpacing();if(!this._frame[0].imagePosition){this._frame[0].imagePosition=[0,0,0]}if(!this._frame[0].imageOrientation){this._frame[0].imageOrientation=[1,0,0,0,1,0]}this._origin=this._vector3FromArray(this._frame[0].imagePosition,0);this.computeIJK2LPS();this.computeLPS2AABB();this._rescaleSlope=this._frame[0].rescaleSlope||1;this._rescaleIntercept=this._frame[0].rescaleIntercept||0;this.computeMinMaxIntensities();this._minMax[0]=ModelsStack.valueRescaleSlopeIntercept(this._minMax[0],this._rescaleSlope,this._rescaleIntercept);this._minMax[1]=ModelsStack.valueRescaleSlopeIntercept(this._minMax[1],this._rescaleSlope,this._rescaleIntercept);var width=this._frame[0].windowWidth||this._minMax[1]-this._minMax[0];this._windowWidth=this._rescaleSlope*width+this._rescaleIntercept;var center=this._frame[0].windowCenter||this._minMax[0]+width/2;this._windowCenter=this._rescaleSlope*center+this._rescaleIntercept;this._bitsAllocated=this._frame[0].bitsAllocated;this._prepared=true}},{key:"packEchos",value:function packEchos(){var echos=4;var packedEcho=[];for(var i=0;i1){if(this._spacingBetweenSlices){this._spacing.z=this._spacingBetweenSlices}else if(this._frame[0].pixelSpacing&&this._frame[0].pixelSpacing[2]){this._spacing.z=this._frame[0].pixelSpacing[2]}else{this._frame.map(this._computeDistanceArrayMap.bind(null,this._zCosine));this._frame.sort(this._sortDistanceArraySort);this._spacing.z=this._frame[1].dist-this._frame[0].dist}}if(this._spacing.z===0){this._spacing.z=1}}},{key:"xySpacing",value:function xySpacing(){if(this._frame&&this._frame[0]){var spacingXY=this._frame[0].spacingXY();this._spacing.x=spacingXY[0];this._spacing.y=spacingXY[1]}}},{key:"computeMinMaxIntensities",value:function computeMinMaxIntensities(){for(var i=0;inbVoxels){voxelIndexStop=nbVoxels}for(var ii=0;iinbVoxels){voxelIndexStop=nbVoxels}}this._packed=true}},{key:"_packTo8Bits",value:function _packTo8Bits(bits,pixelType,channels,frame,textureSize,startVoxel,stopVoxel){var packed={textureType:null,data:null};var packIndex=0;var frameIndex=0;var inFrameIndex=0;var frameDimension=frame[0].rows*frame[0].columns;var data=null;if(bits===8&&channels===1||bits===1){var _data=new Uint8Array(textureSize*textureSize*1);for(var i=startVoxel;i>>8&255;packIndex++;coordinate=Math.floor(packIndex/2);channelOffset=packIndex%2}packed.textureType=THREE.RGBAFormat;packed.data=_data2}else if(bits===32&&channels===1&&pixelType===0){var _data3=new Uint8Array(textureSize*textureSize*4);for(var _i4=startVoxel;_i4>>8&255;_data3[4*packIndex+2]=_raw>>>8&255;_data3[4*packIndex+3]=_raw>>>8&255;packIndex++}packed.textureType=THREE.RGBAFormat;packed.data=_data3}else if(bits===32&&channels===1&&pixelType===1){var _data4=new Uint8Array(textureSize*textureSize*4);for(var _i5=startVoxel;_i5parseInt(b.dimensionIndexValues[i],10)){return 1}if(parseInt(a.dimensionIndexValues[i],10)=0&&ijkCoordinate.z=0&&index.y>=0&&index.z>=0&&index.x0){segmentationCodeDesignator=element.items[0].dataSet.string("x00080102");segmentationCodeValue=element.items[0].dataSet.string("x00080100");segmentationCodeMeaning=element.items[0].dataSet.string("x00080104")}return{segmentationCodeDesignator:segmentationCodeDesignator,segmentationCodeValue:segmentationCodeValue,segmentationCodeMeaning:segmentationCodeMeaning}}},{key:"_recommendedDisplayCIELab",value:function _recommendedDisplayCIELab(segment){if(!segment.dataSet.elements.x0062000d){return null}var offset=segment.dataSet.elements.x0062000d.dataOffset;var length=segment.dataSet.elements.x0062000d.length;var byteArray=segment.dataSet.byteArray.slice(offset,offset+length);var CIELabScaled=new Uint16Array(length/2);for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:0;var sopInstanceUID=this._findStringEverywhere("x2005140f","x00080018",frameIndex);return sopInstanceUID}},{key:"transferSyntaxUID",value:function transferSyntaxUID(){return this._dataSet.string("x00020010")}},{key:"photometricInterpretation",value:function photometricInterpretation(){return this._dataSet.string("x00280004")}},{key:"planarConfiguration",value:function planarConfiguration(){var planarConfiguration=this._dataSet.uint16("x00280006");if(typeof planarConfiguration==="undefined"){planarConfiguration=null}return planarConfiguration}},{key:"samplesPerPixel",value:function samplesPerPixel(){return this._dataSet.uint16("x00280002")}},{key:"numberOfFrames",value:function numberOfFrames(){var numberOfFrames=this._dataSet.intString("x00280008");if(typeof numberOfFrames==="undefined"){numberOfFrames=null}return numberOfFrames}},{key:"numberOfChannels",value:function numberOfChannels(){var numberOfChannels=1;var photometricInterpretation=this.photometricInterpretation();if(!(photometricInterpretation!=="RGB"&&photometricInterpretation!=="PALETTE COLOR"&&photometricInterpretation!=="YBR_FULL"&&photometricInterpretation!=="YBR_FULL_422"&&photometricInterpretation!=="YBR_PARTIAL_422"&&photometricInterpretation!=="YBR_PARTIAL_420"&&photometricInterpretation!=="YBR_RCT")){numberOfChannels=3}return numberOfChannels}},{key:"invert",value:function invert(){var photometricInterpretation=this.photometricInterpretation();return photometricInterpretation==="MONOCHROME1"?true:false}},{key:"imageOrientation",value:function imageOrientation(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var imageOrientation=this._findStringEverywhere("x00209116","x00200037",frameIndex);if(imageOrientation){imageOrientation=imageOrientation.split("\\").map(Number)}return imageOrientation}},{key:"referencedSegmentNumber",value:function referencedSegmentNumber(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var referencedSegmentNumber=-1;var referencedSegmentNumberElement=this._findInGroupSequence("x52009230","x0062000a",frameIndex);if(referencedSegmentNumberElement!==null){referencedSegmentNumber=referencedSegmentNumberElement.uint16("x0062000b")}return referencedSegmentNumber}},{key:"pixelAspectRatio",value:function pixelAspectRatio(){var pixelAspectRatio=[this._dataSet.intString("x00280034",0),this._dataSet.intString("x00280034",1)];if(typeof pixelAspectRatio[0]==="undefined"){pixelAspectRatio=null}return pixelAspectRatio}},{key:"imagePosition",value:function imagePosition(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var imagePosition=this._findStringEverywhere("x00209113","x00200032",frameIndex);if(imagePosition){imagePosition=imagePosition.split("\\").map(Number)}return imagePosition}},{key:"instanceNumber",value:function instanceNumber(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var instanceNumber=null;var perFrameFunctionnalGroupSequence=this._dataSet.elements.x52009230;if(typeof perFrameFunctionnalGroupSequence!=="undefined"){if(perFrameFunctionnalGroupSequence.items[frameIndex].dataSet.elements.x2005140f){var planeOrientationSequence=perFrameFunctionnalGroupSequence.items[frameIndex].dataSet.elements.x2005140f.items[0].dataSet;instanceNumber=planeOrientationSequence.intString("x00200013")}else{instanceNumber=this._dataSet.intString("x00200013");if(typeof instanceNumber==="undefined"){instanceNumber=null}}}else{instanceNumber=this._dataSet.intString("x00200013");if(typeof instanceNumber==="undefined"){instanceNumber=null}}return instanceNumber}},{key:"pixelSpacing",value:function pixelSpacing(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var pixelSpacing=this._findStringEverywhere("x00289110","x00280030",frameIndex);if(pixelSpacing){pixelSpacing=pixelSpacing.split("\\").map(Number)}return pixelSpacing}},{key:"rows",value:function rows(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var rows=this._dataSet.uint16("x00280010");if(typeof rows==="undefined"){rows=null}return rows}},{key:"columns",value:function columns(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var columns=this._dataSet.uint16("x00280011");if(typeof columns==="undefined"){columns=null}return columns}},{key:"pixelType",value:function pixelType(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return 0}},{key:"pixelRepresentation",value:function pixelRepresentation(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var pixelRepresentation=this._dataSet.uint16("x00280103");return pixelRepresentation}},{key:"bitsAllocated",value:function bitsAllocated(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var bitsAllocated=this._dataSet.uint16("x00280100");return bitsAllocated}},{key:"highBit",value:function highBit(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var highBit=this._dataSet.uint16("x00280102");return highBit}},{key:"rescaleIntercept",value:function rescaleIntercept(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._findFloatStringInFrameGroupSequence("x00289145","x00281052",frameIndex)}},{key:"rescaleSlope",value:function rescaleSlope(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._findFloatStringInFrameGroupSequence("x00289145","x00281053",frameIndex)}},{key:"windowCenter",value:function windowCenter(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._findFloatStringInFrameGroupSequence("x00289132","x00281050",frameIndex)}},{key:"windowWidth",value:function windowWidth(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._findFloatStringInFrameGroupSequence("x00289132","x00281051",frameIndex)}},{key:"sliceThickness",value:function sliceThickness(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._findFloatStringInFrameGroupSequence("x00289110","x00180050",frameIndex)}},{key:"dimensionIndexValues",value:function dimensionIndexValues(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var dimensionIndexValues=[];var perFrameFunctionnalGroupSequence=this._dataSet.elements.x52009230;if(typeof perFrameFunctionnalGroupSequence!=="undefined"){var philipsPrivateSequence=perFrameFunctionnalGroupSequence.items[frameIndex].dataSet.elements.x00209111.items[0].dataSet;var element=philipsPrivateSequence.elements.x00209157;var nbValues=element.length/4;for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:0;var inStackPositionNumber=null;var perFrameFunctionnalGroupSequence=this._dataSet.elements.x52009230;if(typeof perFrameFunctionnalGroupSequence!=="undefined"){var philipsPrivateSequence=perFrameFunctionnalGroupSequence.items[frameIndex].dataSet.elements.x00209111.items[0].dataSet;inStackPositionNumber=philipsPrivateSequence.uint32("x00209057")}else{inStackPositionNumber=null}console.log("instack position "+inStackPositionNumber);return inStackPositionNumber}},{key:"stackID",value:function stackID(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var stackID=null;var perFrameFunctionnalGroupSequence=this._dataSet.elements.x52009230;if(typeof perFrameFunctionnalGroupSequence!=="undefined"){var philipsPrivateSequence=perFrameFunctionnalGroupSequence.items[frameIndex].dataSet.elements.x00209111.items[0].dataSet;stackID=philipsPrivateSequence.intString("x00209056")}else{stackID=null}return stackID}},{key:"extractPixelData",value:function extractPixelData(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var decompressedData=this._decodePixelData(frameIndex);var numberOfChannels=this.numberOfChannels();if(numberOfChannels>1){return this._convertColorSpace(decompressedData)}else{return decompressedData}}},{key:"minMaxPixelData",value:function minMaxPixelData(){var pixelData=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var minMax=[65535,-32768];var numPixels=pixelData.length;for(var index=0;index0&&arguments[0]!==undefined?arguments[0]:0;var transferSyntaxUID=this.transferSyntaxUID();if(transferSyntaxUID==="1.2.840.10008.1.2.4.90"||transferSyntaxUID==="1.2.840.10008.1.2.4.91"){return this._decodeJ2K(frameIndex)}else if(transferSyntaxUID==="1.2.840.10008.1.2.4.57"||transferSyntaxUID==="1.2.840.10008.1.2.4.70"){return this._decodeJPEGLossless(frameIndex)}else if(transferSyntaxUID==="1.2.840.10008.1.2.4.50"||transferSyntaxUID==="1.2.840.10008.1.2.4.51"){return this._decodeJPEGBaseline(frameIndex)}else if(transferSyntaxUID==="1.2.840.10008.1.2"||transferSyntaxUID==="1.2.840.10008.1.2.1"){return this._decodeUncompressed(frameIndex)}else if(transferSyntaxUID==="1.2.840.10008.1.2.2"){var frame=this._decodeUncompressed(frameIndex);return this._swapFrame(frame)}else{throw"no decoder for transfer syntax "+transferSyntaxUID}}},{key:"_decodeJ2K",value:function _decodeJ2K(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var encodedPixelData=DicomParser.readEncapsulatedPixelData(this._dataSet,this._dataSet.elements.x7fe00010,frameIndex);var jpxImage=new Jpx;jpxImage.parse(encodedPixelData);var componentsCount=jpxImage.componentsCount;if(componentsCount!==1){throw"JPEG2000 decoder returned a componentCount of ${componentsCount}, when 1 is expected"}var tileCount=jpxImage.tiles.length;if(tileCount!==1){throw"JPEG2000 decoder returned a tileCount of ${tileCount}, when 1 is expected"}var tileComponents=jpxImage.tiles[0];var pixelData=tileComponents.items;return pixelData}},{key:"_decodeJPEGLossless",value:function _decodeJPEGLossless(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var encodedPixelData=DicomParser.readEncapsulatedPixelData(this._dataSet,this._dataSet.elements.x7fe00010,frameIndex);var pixelRepresentation=this.pixelRepresentation(frameIndex);var bitsAllocated=this.bitsAllocated(frameIndex);var byteOutput=bitsAllocated<=8?1:2;var decoder=new Jpeg.lossless.Decoder;var decompressedData=decoder.decode(encodedPixelData.buffer,encodedPixelData.byteOffset,encodedPixelData.length,byteOutput);if(pixelRepresentation===0){if(byteOutput===2){return new Uint16Array(decompressedData.buffer)}else{return new Uint8Array(decompressedData.buffer)}}else{return new Int16Array(decompressedData.buffer)}}},{key:"_decodeJPEGBaseline",value:function _decodeJPEGBaseline(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var encodedPixelData=DicomParser.readEncapsulatedPixelData(this._dataSet,this._dataSet.elements.x7fe00010,frameIndex);var rows=this.rows(frameIndex);var columns=this.columns(frameIndex);var bitsAllocated=this.bitsAllocated(frameIndex);var jpegBaseline=new JpegBaseline;jpegBaseline.parse(encodedPixelData);if(bitsAllocated===8){return jpegBaseline.getData(columns,rows)}else if(bitsAllocated===16){return jpegBaseline.getData16(columns,rows)}}},{key:"_decodeUncompressed",value:function _decodeUncompressed(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var pixelRepresentation=this.pixelRepresentation(frameIndex);var bitsAllocated=this.bitsAllocated(frameIndex);var pixelDataElement=this._dataSet.elements.x7fe00010;var pixelDataOffset=pixelDataElement.dataOffset;var numberOfChannels=this.numberOfChannels();var numPixels=this.rows(frameIndex)*this.columns(frameIndex)*numberOfChannels;var frameOffset=0;var buffer=this._dataSet.byteArray.buffer;if(pixelRepresentation===0&&bitsAllocated===8){frameOffset=pixelDataOffset+frameIndex*numPixels;return new Uint8Array(buffer,frameOffset,numPixels)}else if(pixelRepresentation===0&&bitsAllocated===16){frameOffset=pixelDataOffset+frameIndex*numPixels*2;return new Uint16Array(buffer,frameOffset,numPixels)}else if(pixelRepresentation===1&&bitsAllocated===16){frameOffset=pixelDataOffset+frameIndex*numPixels*2;return new Int16Array(buffer,frameOffset,numPixels)}else if(pixelRepresentation===0&&bitsAllocated===32){frameOffset=pixelDataOffset+frameIndex*numPixels*4;return new Uint32Array(buffer,frameOffset,numPixels)}else if(pixelRepresentation===0&&bitsAllocated===1){var newBuffer=new ArrayBuffer(numPixels);var newArray=new Uint8Array(newBuffer);frameOffset=pixelDataOffset+frameIndex*numPixels;var index=0;var bitStart=frameIndex*numPixels;var bitEnd=frameIndex*numPixels+numPixels;var byteStart=Math.floor(bitStart/8);var bitStartOffset=bitStart-byteStart*8;var byteEnd=Math.ceil(bitEnd/8);var targetBuffer=new Uint8Array(buffer,pixelDataOffset);for(var i=byteStart;i<=byteEnd;i++){while(bitStartOffset<8){switch(bitStartOffset){case 0:newArray[index]=targetBuffer[i]&1;break;case 1:newArray[index]=targetBuffer[i]>>>1&1;break;case 2:newArray[index]=targetBuffer[i]>>>2&1;break;case 3:newArray[index]=targetBuffer[i]>>>3&1;break;case 4:newArray[index]=targetBuffer[i]>>>4&1;break;case 5:newArray[index]=targetBuffer[i]>>>5&1;break;case 6:newArray[index]=targetBuffer[i]>>>6&1;break;case 7:newArray[index]=targetBuffer[i]>>>7&1;break;default:break}bitStartOffset++;index++;if(index>=numPixels){return newArray}}bitStartOffset=0}}}},{key:"_convertColorSpace",value:function _convertColorSpace(uncompressedData){var rgbData=null;var photometricInterpretation=this.photometricInterpretation();var planarConfiguration=this.planarConfiguration();if(photometricInterpretation==="RGB"&&planarConfiguration===0){rgbData=uncompressedData}else if(photometricInterpretation==="RGB"&&planarConfiguration===1){if(uncompressedData instanceof Int8Array){rgbData=new Int8Array(uncompressedData.length)}else if(uncompressedData instanceof Uint8Array){rgbData=new Uint8Array(uncompressedData.length)}else if(uncompressedData instanceof Int16Array){rgbData=new Int16Array(uncompressedData.length)}else if(uncompressedData instanceof Uint16Array){rgbData=new Uint16Array(uncompressedData.length)}else{throw"unsuported typed array: ${uncompressedData}"}var numPixels=uncompressedData.length/3;var rgbaIndex=0;var rIndex=0;var gIndex=numPixels;var bIndex=numPixels*2;for(var i=0;i=5){numberOfChannels=this._dataSet.dims[5];this._ordered=false}else if(this._dataSet.datatypeCode===128){numberOfChannels=3}else if(this._dataSet.datatypeCode===2304){numberOfChannels=4}return numberOfChannels}},{key:"sopInstanceUID",value:function sopInstanceUID(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return frameIndex}},{key:"rows",value:function rows(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.dims[2]}},{key:"columns",value:function columns(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.dims[1]}},{key:"pixelType",value:function pixelType(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var pixelType=0;if(this._dataSet.datatypeCode===16||this._dataSet.datatypeCode===64||this._dataSet.datatypeCode===1536){pixelType=1}return pixelType}},{key:"bitsAllocated",value:function bitsAllocated(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.numBitsPerVoxel}},{key:"pixelSpacing",value:function pixelSpacing(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return[this._dataSet.pixDims[1],this._dataSet.pixDims[2],this._dataSet.pixDims[3]]}},{key:"sliceThickness",value:function sliceThickness(){return null}},{key:"imageOrientation",value:function imageOrientation(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;if(this._dataSet.qform_code>0){var a=0,b=this._dataSet.quatern_b,c=this._dataSet.quatern_c,d=this._dataSet.quatern_d;a=1-(b*b+c*c+d*d);if(a<1e-7){a=1/Math.sqrt(b*b+c*c+d*d);b*=a;c*=a;d*=a;a=0}else{a=Math.sqrt(a)}if(this._dataSet.pixDims[0]<0){this._rightHanded=false}return[-(a*a+b*b-c*c-d*d),-2*(b*c+a*d),2*(b*d-a*c),-2*(b*c-a*d),-(a*a+c*c-b*b-d*d),2*(c*d+a*b)]}else if(this._dataSet.sform_code>0){console.log("sform > 0");var sx=this._dataSet.srow_x,sy=this._dataSet.srow_y,sz=this._dataSet.srow_z}else if(this._dataSet.qform_code===0){console.log("qform === 0")}return[1,0,0,0,1,0]}},{key:"imagePosition",value:function imagePosition(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return[-this._dataSet.qoffset_x,-this._dataSet.qoffset_y,this._dataSet.qoffset_z]}},{key:"dimensionIndexValues",value:function dimensionIndexValues(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"instanceNumber",value:function instanceNumber(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return frameIndex}},{key:"windowCenter",value:function windowCenter(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"windowWidth",value:function windowWidth(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"rescaleSlope",value:function rescaleSlope(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.scl_slope}},{key:"rescaleIntercept",value:function rescaleIntercept(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.scl_intercept}},{key:"minMaxPixelData",value:function minMaxPixelData(){var pixelData=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var minMax=[65535,-32768];var numPixels=pixelData.length;for(var index=0;index0&&arguments[0]!==undefined?arguments[0]:0;return this._decompressUncompressed(frameIndex)}},{key:"_decompressUncompressed",value:function _decompressUncompressed(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var numberOfChannels=this.numberOfChannels();var numPixels=this.rows(frameIndex)*this.columns(frameIndex)*numberOfChannels;if(!this.rightHanded()){frameIndex=this.numberOfFrames()-1-frameIndex}var frameOffset=frameIndex*numPixels;var buffer=this._niftiImage;if(!this._ordered&&this._orderedData===null){this._reorderData()}if(this._orderedData!==null){return this._orderedData.slice(frameOffset,frameOffset+numPixels)}else if(this._dataSet.datatypeCode===2){return new Uint8Array(buffer,frameOffset,numPixels)}else if(this._dataSet.datatypeCode===256){return new Int8Array(buffer,frameOffset,numPixels)}else if(this._dataSet.datatypeCode===512){frameOffset=frameOffset*2;return new Uint16Array(buffer,frameOffset,numPixels)}else if(this._dataSet.datatypeCode===4){frameOffset=frameOffset*2;return new Int16Array(buffer,frameOffset,numPixels)}else if(this._dataSet.datatypeCode===16){frameOffset=frameOffset*4;return new Float32Array(buffer,frameOffset,numPixels)}}},{key:"_reorderData",value:function _reorderData(){window.console.log("re-order");var numberOfChannels=this.numberOfChannels();var numPixels=this.rows()*this.columns()*numberOfChannels;var buffer=this._niftiImage;var totalNumPixels=numPixels*this.numberOfFrames();var tmp=null;this._orderedData=null;if(this._dataSet.datatypeCode===2){tmp=new Uint8Array(buffer,0,totalNumPixels);this._orderedData=new Uint8Array(tmp.length)}else if(this._dataSet.datatypeCode===256){tmp=new Int8Array(buffer,0,totalNumPixels);this._orderedData=new Int8Array(tmp.length)}else if(this._dataSet.datatypeCode===512){tmp=new Uint16Array(buffer,0,totalNumPixels);this._orderedData=new Uint16Array(tmp.length)}else if(this._dataSet.datatypeCode===4){tmp=new Int16Array(buffer,0,totalNumPixels);this._orderedData=new Int16Array(tmp.length)}else if(this._dataSet.datatypeCode===16){tmp=new Float32Array(buffer,0,totalNumPixels);this._orderedData=new Float32Array(tmp.length)}var numPixels2=tmp.length/3;var rgbaIndex=0;var rIndex=0;var gIndex=numPixels2;var bIndex=numPixels2*2;for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:0;return frameIndex}},{key:"rows",value:function rows(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.sizes[1]}},{key:"columns",value:function columns(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.sizes[0]}},{key:"pixelType",value:function pixelType(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var pixelType=0;if(this._dataSet.type==="float"){pixelType=1}return pixelType}},{key:"bitsAllocated",value:function bitsAllocated(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var bitsAllocated=1;if(this._dataSet.type==="int8"||this._dataSet.type==="uint8"||this._dataSet.type==="char"){bitsAllocated=8}else if(this._dataSet.type==="int16"||this._dataSet.type==="uint16"||this._dataSet.type==="short"){bitsAllocated=16}else if(this._dataSet.type==="int32"||this._dataSet.type==="uint32"||this._dataSet.type==="float"){bitsAllocated=32}return bitsAllocated}},{key:"pixelSpacing",value:function pixelSpacing(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var x=new THREE.Vector3(this._dataSet.spaceDirections[0][0],this._dataSet.spaceDirections[0][1],this._dataSet.spaceDirections[0][2]);var y=new THREE.Vector3(this._dataSet.spaceDirections[1][0],this._dataSet.spaceDirections[1][1],this._dataSet.spaceDirections[1][2]);var z=new THREE.Vector3(this._dataSet.spaceDirections[2][0],this._dataSet.spaceDirections[2][1],this._dataSet.spaceDirections[2][2]);return[x.length(),y.length(),z.length()]}},{key:"sliceThickness",value:function sliceThickness(){return null}},{key:"imageOrientation",value:function imageOrientation(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var invertX=this._dataSet.space.match(/right/)?-1:1;var invertY=this._dataSet.space.match(/anterior/)?-1:1;var x=new THREE.Vector3(this._dataSet.spaceDirections[0][0]*invertX,this._dataSet.spaceDirections[0][1]*invertY,this._dataSet.spaceDirections[0][2]);x.normalize();var y=new THREE.Vector3(this._dataSet.spaceDirections[1][0]*invertX,this._dataSet.spaceDirections[1][1]*invertY,this._dataSet.spaceDirections[1][2]);y.normalize();return[x.x,x.y,x.z,y.x,y.y,y.z]}},{key:"imagePosition",value:function imagePosition(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return[this._dataSet.spaceOrigin[0],this._dataSet.spaceOrigin[1],this._dataSet.spaceOrigin[2]]}},{key:"dimensionIndexValues",value:function dimensionIndexValues(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"instanceNumber",value:function instanceNumber(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return frameIndex}},{key:"windowCenter",value:function windowCenter(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"windowWidth",value:function windowWidth(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"rescaleSlope",value:function rescaleSlope(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return 1}},{key:"rescaleIntercept",value:function rescaleIntercept(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return 0}},{key:"minMaxPixelData",value:function minMaxPixelData(){var pixelData=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var minMax=[65535,-32768];var numPixels=pixelData.length;for(var index=0;index0&&arguments[0]!==undefined?arguments[0]:0;return this._decompressUncompressed(frameIndex)}},{key:"_decompressUncompressed",value:function _decompressUncompressed(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var buffer=this._dataSet.buffer;var numberOfChannels=this.numberOfChannels();var numPixels=this.rows(frameIndex)*this.columns(frameIndex)*numberOfChannels;if(!this.rightHanded()){frameIndex=this.numberOfFrames()-1-frameIndex}var frameOffset=frameIndex*numPixels;if(this._unpackedData===null&&this._dataSet.encoding==="gzip"){var unpackedData=pako.inflate(this._dataSet.buffer);this._unpackedData=unpackedData.buffer;buffer=this._unpackedData}else if(this._dataSet.encoding==="gzip"){buffer=this._unpackedData}if(this._dataSet.type==="int8"||this._dataSet.type==="char"){frameOffset=frameOffset;return new Int8Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="uint8"){frameOffset=frameOffset;return new Uint8Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="int16"||this._dataSet.type==="short"){frameOffset=frameOffset*2;return new Int16Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="uint16"){frameOffset=frameOffset*2;return new Uint16Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="int32"){frameOffset=frameOffset*4;return new Int32Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="uint32"){frameOffset=frameOffset*4;return new Uint32Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="float"){frameOffset=frameOffset*4;return new Float32Array(buffer,frameOffset,numPixels)}}}]);return ParsersNifti}(_parsers2.default);exports.default=ParsersNifti},{"./parsers.volume":124,"nrrd-js":50,pako:51}],124:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i>8&255}},{key:"_swap32",value:function _swap32(val){return(val&255)<<24|(val&65280)<<8|val>>8&65280|val>>24&255}},{key:"invert",value:function invert(){return false}}]);return ParsersVolume}();exports.default=ParsersVolume},{}],125:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:this._base;var rayOrigin=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this._rayOrigin;var rayDirection=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this._rayDirection;var aabbMin=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this._aabbMin;var aabbMax=arguments.length>4&&arguments[4]!==undefined?arguments[4]:this._aabbMax;var tNear=arguments.length>5&&arguments[5]!==undefined?arguments[5]:this._tNear;var tFar=arguments.length>6&&arguments[6]!==undefined?arguments[6]:this._tFar;var intersect=arguments.length>7&&arguments[7]!==undefined?arguments[7]:this._intersect;this._base=baseFragment;return this.compute(rayOrigin,rayDirection,aabbMin,aabbMax,tNear,tFar,intersect)}},{key:"compute",value:function compute(rayOrigin,rayDirection,aabbMin,aabbMax,tNear,tFar,intersect){this.computeDefinition();this._base._functions[this._name]=this._definition;return this._name+"("+rayOrigin+", "+rayDirection+", "+aabbMin+", "+aabbMax+", "+tNear+", "+tFar+", "+intersect+");"}},{key:"computeDefinition",value:function computeDefinition(){this._definition="\nvoid "+this._name+"(vec3 rayOrigin, vec3 rayDirection, vec3 boxMin, vec3 boxMax, out float tNear, out float tFar, out bool intersect){\n // compute intersection of ray with all six bbox planes\n vec3 invRay = vec3(1.) / rayDirection;\n vec3 tBot = invRay * (boxMin - rayOrigin);\n vec3 tTop = invRay * (boxMax - rayOrigin);\n // re-order intersections to find smallest and largest on each axis\n vec3 tMin = min(tTop, tBot);\n vec3 tMax = max(tTop, tBot);\n // find the largest tMin and the smallest tMax\n float largest_tMin = max(max(tMin.x, tMin.y), max(tMin.x, tMin.z));\n float smallest_tMax = min(min(tMax.x, tMax.y), min(tMax.x, tMax.z));\n tNear = largest_tMin;\n tFar = smallest_tMax;\n intersect = smallest_tMax > largest_tMin;\n}\n\n "}}]);return IntersectBox}(_shaders2.default);exports.default=new IntersectBox},{"../shaders.base":131}],126:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:this._base;var dataCoordinates=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this._dataCoordinates;var dataValue=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this._dataValue;var offset=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this._offset;this._base=baseFragment;return this.compute(dataCoordinates,dataValue,offset)}},{key:"compute",value:function compute(dataCoordinates,dataValue,offset){this.computeDefinition();this._base._functions[this._name]=this._definition;return this._name+"("+dataCoordinates+", "+dataValue+", "+offset+");"}},{key:"computeDefinition",value:function computeDefinition(){this._definition="\nvoid "+this._name+"(in ivec3 dataCoordinates, out vec4 dataValue, out int offset){\n \n int index = dataCoordinates.x\n + dataCoordinates.y * uDataDimensions.x\n + dataCoordinates.z * uDataDimensions.y * uDataDimensions.x;\n int indexP = int(index/uPackedPerPixel);\n offset = index - 2*indexP;\n\n // Map data index to right sampler2D texture\n int voxelsPerTexture = uTextureSize*uTextureSize;\n int textureIndex = int(floor(float(indexP) / float(voxelsPerTexture)));\n // modulo seems incorrect sometimes...\n // int inTextureIndex = int(mod(float(index), float(textureSize*textureSize)));\n int inTextureIndex = indexP - voxelsPerTexture*textureIndex;\n\n // Get row and column in the texture\n int colIndex = int(mod(float(inTextureIndex), float(uTextureSize)));\n int rowIndex = int(floor(float(inTextureIndex)/float(uTextureSize)));\n\n // Map row and column to uv\n vec2 uv = vec2(0,0);\n uv.x = (0.5 + float(colIndex)) / float(uTextureSize);\n uv.y = 1. - (0.5 + float(rowIndex)) / float(uTextureSize);\n\n //\n if(textureIndex == 0){ dataValue = texture2D(uTextureContainer[0], uv); }\n else if(textureIndex == 1){dataValue = texture2D(uTextureContainer[1], uv);}\n else if(textureIndex == 2){ dataValue = texture2D(uTextureContainer[2], uv); }\n else if(textureIndex == 3){ dataValue = texture2D(uTextureContainer[3], uv); }\n else if(textureIndex == 4){ dataValue = texture2D(uTextureContainer[4], uv); }\n else if(textureIndex == 5){ dataValue = texture2D(uTextureContainer[5], uv); }\n else if(textureIndex == 6){ dataValue = texture2D(uTextureContainer[6], uv); }\n\n}\n "}}]);return Texture3d}(_shaders2.default);exports.default=new Texture3d},{"../shaders.base":131}],127:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:this._base;var packedData=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this._packedData;var offset=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this._offset;var unpackedData=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this._unpackedData;this._base=baseFragment;return this.compute(packedData,offset,unpackedData)}},{key:"compute",value:function compute(packedData,offset,unpackedData){this.computeDefinition();this._base._functions[this._name]=this._definition;return this._name+"("+packedData+", "+offset+", "+unpackedData+");"}},{key:"computeDefinition",value:function computeDefinition(){var content="";if(this._base._uniforms.uNumberOfChannels.value===1){switch(this._base._uniforms.uBitsAllocated.value){case 1:case 8:content=this.upack8();break;case 16:content=this.upack16();break;case 32:content=this.upack32();break;default:content=this.upackDefault();break}}else{content=this.upackIdentity()}this._definition="\nvoid "+this._name+"(in vec4 packedData, in int offset, out vec4 unpackedData){\n\n"+content+"\n\n} \n "}},{key:"upack8",value:function upack8(){this._base._functions["uInt8"]=this.uInt8();return"\nuInt8(\n packedData.r,\n unpackedData.x);\n "}},{key:"upack16",value:function upack16(){this._base._functions["uInt16"]=this.uInt16();return"\nuInt16(\n packedData.r * float( 1 - offset) + packedData.b * float(offset),\n packedData.g * float( 1 - offset) + packedData.a * float(offset),\n unpackedData.x);\n "}},{key:"upack32",value:function upack32(){if(this._base._uniforms.uPixelType.value===0){this._base._functions["uInt32"]=this.uInt32();return"\nuInt32(\n packedData.r,\n packedData.g,\n packedData.b,\n packedData.a,\n unpackedData.x);\n "}else{this._base._functions["uFloat32"]=this.uFloat32();return"\nuFloat32(\n packedData.r,\n packedData.g,\n packedData.b,\n packedData.a,\n unpackedData.x);\n "}}},{key:"upackIdentity",value:function upackIdentity(){return"\n\nunpackedData = packedData;\n\n "}},{key:"uInt8",value:function uInt8(){return"\nvoid uInt8(in float r, out float value){\n value = r * 256.;\n}\n "}},{key:"uInt16",value:function uInt16(){return"\nvoid uInt16(in float r, in float a, out float value){\n value = r * 256. + a * 65536.;\n}\n "}},{key:"uInt32",value:function uInt32(){return"\nvoid uInt32(in float r, in float g, in float b, in float a, out float value){\n value = r * 256. + g * 65536. + b * 16777216. + a * 4294967296.;\n}\n "}},{key:"uFloat32",value:function uFloat32(){return"\nvoid uFloat32(in float r, in float g, in float b, in float a, out float value){\n\n // create arrays containing bits for rgba values\n // value between 0 and 255\n value = r * 255.;\n int bytemeR[8];\n bytemeR[0] = int(floor(value / 128.));\n value -= float(bytemeR[0] * 128);\n bytemeR[1] = int(floor(value / 64.));\n value -= float(bytemeR[1] * 64);\n bytemeR[2] = int(floor(value / 32.));\n value -= float(bytemeR[2] * 32);\n bytemeR[3] = int(floor(value / 16.));\n value -= float(bytemeR[3] * 16);\n bytemeR[4] = int(floor(value / 8.));\n value -= float(bytemeR[4] * 8);\n bytemeR[5] = int(floor(value / 4.));\n value -= float(bytemeR[5] * 4);\n bytemeR[6] = int(floor(value / 2.));\n value -= float(bytemeR[6] * 2);\n bytemeR[7] = int(floor(value));\n\n value = g * 255.;\n int bytemeG[8];\n bytemeG[0] = int(floor(value / 128.));\n value -= float(bytemeG[0] * 128);\n bytemeG[1] = int(floor(value / 64.));\n value -= float(bytemeG[1] * 64);\n bytemeG[2] = int(floor(value / 32.));\n value -= float(bytemeG[2] * 32);\n bytemeG[3] = int(floor(value / 16.));\n value -= float(bytemeG[3] * 16);\n bytemeG[4] = int(floor(value / 8.));\n value -= float(bytemeG[4] * 8);\n bytemeG[5] = int(floor(value / 4.));\n value -= float(bytemeG[5] * 4);\n bytemeG[6] = int(floor(value / 2.));\n value -= float(bytemeG[6] * 2);\n bytemeG[7] = int(floor(value));\n\n value = b * 255.;\n int bytemeB[8];\n bytemeB[0] = int(floor(value / 128.));\n value -= float(bytemeB[0] * 128);\n bytemeB[1] = int(floor(value / 64.));\n value -= float(bytemeB[1] * 64);\n bytemeB[2] = int(floor(value / 32.));\n value -= float(bytemeB[2] * 32);\n bytemeB[3] = int(floor(value / 16.));\n value -= float(bytemeB[3] * 16);\n bytemeB[4] = int(floor(value / 8.));\n value -= float(bytemeB[4] * 8);\n bytemeB[5] = int(floor(value / 4.));\n value -= float(bytemeB[5] * 4);\n bytemeB[6] = int(floor(value / 2.));\n value -= float(bytemeB[6] * 2);\n bytemeB[7] = int(floor(value));\n\n value = a * 255.;\n int bytemeA[8];\n bytemeA[0] = int(floor(value / 128.));\n value -= float(bytemeA[0] * 128);\n bytemeA[1] = int(floor(value / 64.));\n value -= float(bytemeA[1] * 64);\n bytemeA[2] = int(floor(value / 32.));\n value -= float(bytemeA[2] * 32);\n bytemeA[3] = int(floor(value / 16.));\n value -= float(bytemeA[3] * 16);\n bytemeA[4] = int(floor(value / 8.));\n value -= float(bytemeA[4] * 8);\n bytemeA[5] = int(floor(value / 4.));\n value -= float(bytemeA[5] * 4);\n bytemeA[6] = int(floor(value / 2.));\n value -= float(bytemeA[6] * 2);\n bytemeA[7] = int(floor(value));\n\n // compute float32 value from bit arrays\n\n // sign\n int issigned = 1 - 2 * bytemeR[0];\n // issigned = int(pow(-1., float(bytemeR[0])));\n\n // exponent\n int exponent = 0;\n\n exponent += bytemeR[1] * int(pow(2., 7.));\n exponent += bytemeR[2] * int(pow(2., 6.));\n exponent += bytemeR[3] * int(pow(2., 5.));\n exponent += bytemeR[4] * int(pow(2., 4.));\n exponent += bytemeR[5] * int(pow(2., 3.));\n exponent += bytemeR[6] * int(pow(2., 2.));\n exponent += bytemeR[7] * int(pow(2., 1.));\n\n exponent += bytemeG[0];\n\n\n // fraction\n float fraction = 0.;\n\n fraction = float(bytemeG[1]) * pow(2., -1.);\n fraction += float(bytemeG[2]) * pow(2., -2.);\n fraction += float(bytemeG[3]) * pow(2., -3.);\n fraction += float(bytemeG[4]) * pow(2., -4.);\n fraction += float(bytemeG[5]) * pow(2., -5.);\n fraction += float(bytemeG[6]) * pow(2., -6.);\n fraction += float(bytemeG[7]) * pow(2., -7.);\n\n fraction += float(bytemeB[0]) * pow(2., -8.);\n fraction += float(bytemeB[1]) * pow(2., -9.);\n fraction += float(bytemeB[2]) * pow(2., -10.);\n fraction += float(bytemeB[3]) * pow(2., -11.);\n fraction += float(bytemeB[4]) * pow(2., -12.);\n fraction += float(bytemeB[5]) * pow(2., -13.);\n fraction += float(bytemeB[6]) * pow(2., -14.);\n fraction += float(bytemeB[7]) * pow(2., -15.);\n\n fraction += float(bytemeA[0]) * pow(2., -16.);\n fraction += float(bytemeA[1]) * pow(2., -17.);\n fraction += float(bytemeA[2]) * pow(2., -18.);\n fraction += float(bytemeA[3]) * pow(2., -19.);\n fraction += float(bytemeA[4]) * pow(2., -20.);\n fraction += float(bytemeA[5]) * pow(2., -21.);\n fraction += float(bytemeA[6]) * pow(2., -22.);\n fraction += float(bytemeA[7]) * pow(2., -23.);\n\n value = float(issigned) * pow( 2., float(exponent - 127)) * (1. + fraction);\n}\n "}}]);return Unpack}(_shaders2.default);exports.default=new Unpack},{"../shaders.base":131}],128:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:this._base;var currentVoxel=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this._currentVoxel;var dataValue=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this._dataValue;this._base=baseFragment;return this.compute(currentVoxel,dataValue)}},{key:"compute",value:function compute(currentVoxel,dataValue){this.computeDefinition();this._base._functions[this._name]=this._definition;return this._name+"("+currentVoxel+", "+dataValue+");"}},{key:"computeDefinition",value:function computeDefinition(){this._definition="\nvoid "+this._name+"(in vec3 currentVoxel, out vec4 dataValue){\n // lower bound\n vec3 rcurrentVoxel = vec3(floor(currentVoxel.x + 0.5 ), floor(currentVoxel.y + 0.5 ), floor(currentVoxel.z + 0.5 ));\n ivec3 voxel = ivec3(int(rcurrentVoxel.x), int(rcurrentVoxel.y), int(rcurrentVoxel.z));\n\n vec4 tmp = vec4(0., 0., 0., 0.);\n int offset = 0;\n\n "+_shadersHelpers4.default.api(this._base,"voxel","tmp","offset")+"\n "+_shadersHelpers2.default.api(this._base,"tmp","offset","dataValue")+"\n}\n "}}]);return InterpolationIdentity}(_shaders2.default);exports.default=new InterpolationIdentity},{"../helpers/shaders.helpers.texture3d":126,"../helpers/shaders.helpers.unpack":127,"../shaders.base":131}],129:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _shadersInterpolation=require("./shaders.interpolation.identity");var _shadersInterpolation2=_interopRequireDefault(_shadersInterpolation);var _shadersInterpolation3=require("./shaders.interpolation.trilinear"); -var _shadersInterpolation4=_interopRequireDefault(_shadersInterpolation3);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function shadersInterpolation(baseFragment,currentVoxel,dataValue,gradient){switch(baseFragment._uniforms.uInterpolation.value){case 0:return _shadersInterpolation2.default.api(baseFragment,currentVoxel,dataValue);case 1:return _shadersInterpolation4.default.api(baseFragment,currentVoxel,dataValue,gradient);default:return _shadersInterpolation2.default.api(baseFragment,currentVoxel,dataValue)}}exports.default=shadersInterpolation},{"./shaders.interpolation.identity":128,"./shaders.interpolation.trilinear":130}],130:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:this._base;var currentVoxel=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this._currentVoxel;var dataValue=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this._dataValue;var gradient=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this._gradient;this._base=baseFragment;return this.compute(currentVoxel,dataValue,gradient)}},{key:"compute",value:function compute(currentVoxel,dataValue,gradient){this.computeDefinition();this._base._functions[this._name]=this._definition;return this._name+"("+currentVoxel+", "+dataValue+", "+gradient+");"}},{key:"computeDefinition",value:function computeDefinition(){this._definition="\nvoid "+this._name+"(in vec3 currentVoxel, out vec4 dataValue, out vec3 gradient){\n\n // https://en.wikipedia.org/wiki/Trilinear_interpolation\n vec3 lower_bound = vec3(floor(currentVoxel.x), floor(currentVoxel.y), floor(currentVoxel.z));\n vec3 higher_bound = lower_bound + vec3(1);\n\n float xd = ( currentVoxel.x - lower_bound.x ) / ( higher_bound.x - lower_bound.x );\n float yd = ( currentVoxel.y - lower_bound.y ) / ( higher_bound.y - lower_bound.y );\n float zd = ( currentVoxel.z - lower_bound.z ) / ( higher_bound.z - lower_bound.z );\n\n //\n // c00\n //\n\n //\n\n vec4 v000 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c000 = vec3(lower_bound.x, lower_bound.y, lower_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c000","v000")+"\n vec3 g000 = v000.r * vec3(-1., -1., -1.);\n\n //\n\n vec4 v100 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c100 = vec3(higher_bound.x, lower_bound.y, lower_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c100","v100")+"\n vec3 g100 = v100.r * vec3(1., -1., -1.);\n\n vec4 c00 = v000 * ( 1.0 - xd ) + v100 * xd;\n\n //\n // c01\n //\n vec4 v001 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c001 = vec3(lower_bound.x, lower_bound.y, higher_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c001","v001")+"\n vec3 g001 = v001.r * vec3(-1., -1., 1.);\n\n vec4 v101 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c101 = vec3(higher_bound.x, lower_bound.y, higher_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c101","v101")+"\n vec3 g101 = v101.r * vec3(1., -1., 1.);\n\n vec4 c01 = v001 * ( 1.0 - xd ) + v101 * xd;\n\n //\n // c10\n //\n vec4 v010 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c010 = vec3(lower_bound.x, higher_bound.y, lower_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c010","v010")+"\n vec3 g010 = v010.r * vec3(-1., 1., -1.);\n\n vec4 v110 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c110 = vec3(higher_bound.x, higher_bound.y, lower_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c110","v110")+"\n vec3 g110 = v110.r * vec3(1., 1., -1.);\n\n vec4 c10 = v010 * ( 1.0 - xd ) + v110 * xd;\n\n //\n // c11\n //\n vec4 v011 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c011 = vec3(lower_bound.x, higher_bound.y, higher_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c011","v011")+"\n vec3 g011 = v011.r * vec3(-1., 1., 1.);\n\n vec4 v111 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c111 = vec3(higher_bound.x, higher_bound.y, higher_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c111","v111")+"\n vec3 g111 = v111.r * vec3(1., 1., 1.);\n\n vec4 c11 = v011 * ( 1.0 - xd ) + v111 * xd;\n\n // c0 and c1\n vec4 c0 = c00 * ( 1.0 - yd) + c10 * yd;\n vec4 c1 = c01 * ( 1.0 - yd) + c11 * yd;\n\n // c\n vec4 c = c0 * ( 1.0 - zd) + c1 * zd;\n dataValue = c;\n\n // compute gradient\n gradient = g000 + g100 + g010 + g110 + g011 + g111 + g110 + g011;\n // gradientMagnitude = length(gradient);\n // // https://en.wikipedia.org/wiki/Normal_(geometry)#Transforming_normals\n // vec3 localNormal = (-1. / gradientMagnitude) * gradient;\n // normal = normalize(normalPixelToPatient"+this.id+" * localNormal);\n //normal = gradient;\n\n}\n "}}]);return InterpolationTrilinear}(_shaders2.default);exports.default=new InterpolationTrilinear},{"../shaders.base":131,"./shaders.interpolation.identity":128}],131:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i tFar || accumulatedAlpha >= 1.0 ) break;\n }\n\n gl_FragColor = vec4(accumulatedColor.xyz, accumulatedAlpha);\n}\n "}},{key:"compute",value:function compute(){var shaderInterpolation="";return"\n// uniforms\n"+this.uniforms()+"\n\n// varying (should fetch it from vertex directly)\nvarying vec4 vPos;\n\n// tailored functions\n"+this.functions()+"\n\n// main loop\n"+this._main+"\n "}}]);return ShadersFragment}();exports.default=ShadersFragment},{"./helpers/shaders.helpers.intersectBox":125,"./interpolation/shaders.interpolation":129}],140:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0){this._offset.copy(intersectsTarget[0].point).sub(this._mesh.position)}}else{var intersection=_core2.default.rayPlane(this._raycaster.ray,this._plane);if(intersection!==null){this._offset.copy(intersection).sub(this._plane.position)}}this.update()}}},{key:"onEnd",value:function onEnd(evt){evt.preventDefault();if(this._tracking===true){return}if(!this._dragged&&this._active){this._selected=!this._selected}this._active=false;this._dragged=false;this._controls.enabled=true;this.update()}},{key:"onMove",value:function onMove(evt){evt.preventDefault();this._mouse.set(event.clientX/this._container.offsetWidth*2-1,-(event.clientY/this._container.offsetHeight)*2+1);this._screenPosition=this.worldToScreen(this._worldPosition,this._camera,this._container);this._raycaster.setFromCamera(this._mouse,this._camera);this._raycaster.ray.position=this._raycaster.ray.origin;if(this._active){this._dragged=true;if(this._targetMesh!==null){var intersectsTarget=this._raycaster.intersectObject(this._targetMesh);if(intersectsTarget.length>0){this._worldPosition.copy(intersectsTarget[0].point.sub(this._offset))}}else{if(this._plane.direction.length()===0){this._plane.position.copy(this._worldPosition);this._plane.direction.copy(this._camera.getWorldDirection())}var intersection=_core2.default.rayPlane(this._raycaster.ray,this._plane);if(intersection!==null){this._worldPosition.copy(intersection.sub(this._offset))}}}else{this.onHover(null);if(this._targetMesh===null){this._plane.position.copy(this._worldPosition);this._plane.direction.copy(this._camera.getWorldDirection())}}this.update()}},{key:"onHover",value:function onHover(evt){if(evt){evt.preventDefault();this.hoverDom(evt)}this.hoverMesh();this._hovered=this._meshHovered||this._domHovered;this._container.style.cursor=this._hovered?"pointer":"default"}},{key:"update",value:function update(){this.updateColor();this.updateMeshColor();this.updateMeshPosition();this.updateDOMColor();this.updateDOMPosition()}},{key:"updateMeshColor",value:function updateMeshColor(){if(this._material){this._material.color.set(this._color)}}},{key:"updateMeshPosition",value:function updateMeshPosition(){if(this._mesh){this._mesh.position.x=this._worldPosition.x;this._mesh.position.y=this._worldPosition.y;this._mesh.position.z=this._worldPosition.z}}},{key:"hoverMesh",value:function hoverMesh(){var intersectsHandle=this._raycaster.intersectObject(this._mesh);this._meshHovered=intersectsHandle.length>0}},{key:"hoverDom",value:function hoverDom(evt){this._domHovered=evt.type==="mouseenter"}},{key:"worldToScreen",value:function worldToScreen(worldCoordinate,camera,canvas){var screenCoordinates=worldCoordinate.clone();screenCoordinates.project(camera);screenCoordinates.x=Math.round((screenCoordinates.x+1)*canvas.offsetWidth/2);screenCoordinates.y=Math.round((-screenCoordinates.y+1)*canvas.offsetHeight/2);screenCoordinates.z=0;return screenCoordinates}},{key:"createMesh",value:function createMesh(){this._geometry=new THREE.SphereGeometry(2,32,32);this._material=new THREE.MeshBasicMaterial({wireframe:true,wireframeLinewidth:2});this._mesh=new THREE.Mesh(this._geometry,this._material);this._mesh.position.x=this._worldPosition.x;this._mesh.position.y=this._worldPosition.y;this._mesh.position.z=this._worldPosition.z;this._mesh.visible=true;this.updateMeshColor();this.add(this._mesh)}},{key:"createDOM",value:function createDOM(){this._dom=document.createElement("div");this._dom.setAttribute("id",this.uuid);this._dom.setAttribute("class","widgets handle");this._dom.style.border="2px solid";this._dom.style.backgroundColor="#F9F9F9";this._dom.style.color="#F9F9F9";this._dom.style.position="absolute";this._dom.style.width="12px";this._dom.style.height="12px";this._dom.style.margin="-6px";this._dom.style.borderRadius="50%";this._dom.style.transformOrigin="0 100%";var posY=this._screenPosition.y-this._container.offsetHeight;this._dom.style.transform="translate3D("+this._screenPosition.x+"px, "+posY+"px, 0)";this.updateDOMColor();this._container.appendChild(this._dom)}},{key:"updateDOMPosition",value:function updateDOMPosition(){if(this._dom){var posY=this._screenPosition.y-this._container.offsetHeight;this._dom.style.transform="translate3D("+this._screenPosition.x+"px, "+posY+"px, 0)"}}},{key:"updateDOMColor",value:function updateDOMColor(){this._dom.style.borderColor=""+this._color}},{key:"free",value:function free(){this.removeEventListeners()}},{key:"worldPosition",set:function set(worldPosition){this._worldPosition.copy(worldPosition);this._screenPosition=this.worldToScreen(this._worldPosition,this._camera,this._container);this.update()},get:function get(){return this._worldPosition}},{key:"screenPosition",set:function set(screenPosition){this._screenPosition=screenPosition},get:function get(){return this._screenPosition}},{key:"active",get:function get(){return this._active},set:function set(active){this._active=active;this._controls.enabled=!this._active;this.update()}},{key:"tracking",get:function get(){return this._tracking},set:function set(tracking){this._tracking=tracking;this.update()}}]);return WidgetsHandle}(_widgets2.default);exports.default=WidgetsHandle},{"../../src/core/core.intersections":93,"../../src/widgets/widgets.base":142}],144:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _widgets=require("./widgets.handle");var _widgets2=_interopRequireDefault(_widgets);var _widgets3=require("./widgets.voxelProbe");var _widgets4=_interopRequireDefault(_widgets3);var _widgets5=require("./widgets.ruler");var _widgets6=_interopRequireDefault(_widgets5);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Handle:_widgets2.default,VoxelProbe:_widgets4.default,Ruler:_widgets6.default}},{"./widgets.handle":143,"./widgets.ruler":145,"./widgets.voxelProbe":146}],145:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i=0){this.activateVoxel()}}}},{key:"updateRaycaster",value:function updateRaycaster(raycaster,event,container){this._mouse={x:event.clientX/container.offsetWidth*2-1,y:-(event.clientY/container.offsetHeight)*2+1,screenX:event.clientX,screenY:event.clientY};raycaster.setFromCamera(this._mouse,this._camera)}},{key:"updateColor",value:function updateColor(voxel){if(voxel._active){voxel.color=this._activeColor}else if(voxel.hover){voxel.color=this._hoverColor}else if(voxel.selected){voxel.color=this._selectedColor}else{voxel.color=this._defaultColor}}},{key:"deleteAllSelected",value:function deleteAllSelected(){var i=this._voxels.length;while(i--){var match=this._selected.indexOf(i);if(match>=0){if(this._active===i){this._active=-1}this.remove(this._voxels[i]);this._voxels[i].removeTest();this._voxels.splice(i,1)}}this._selected=[];this._closest=null}},{key:"selectVoxel",value:function selectVoxel(){var selIndex=this._selected.indexOf(this._active);if(selIndex===-1){this._selected.push(this._active);this._voxels[this._active].selected=true;this.updateColor(this._voxels[this._active])}else{this._selected.splice(selIndex,1);this._voxels[this._active].selected=false}}},{key:"activateVoxel",value:function activateVoxel(){if(this._active===-1){var intersects=this._raycaster.intersectObject(this._targetMesh);if(intersects.length>0){if(this._hover>=0||this._closest!==null&&this._voxels[this._closest].distance<10){var index=Math.max(this._hover,this._closest);this._voxels[index]._active=true;this.updateColor(this._voxels[index]);this._active=index;this._controls.enabled=false}}}else{this._voxels[this._active].active=false;this._active=-1;this._controls.enabled=true}}},{key:"createVoxel",value:function createVoxel(){if(this._hover>=0){return}var intersects=this._raycaster.intersectObject(this._targetMesh);if(intersects.length>0){var helpersVoxel=new _helpers2.default(intersects[0].point,this._stack);this.add(helpersVoxel);this._voxels.push(helpersVoxel);helpersVoxel.updateVoxelScreenCoordinates(this._camera,this._container);this.hoverVoxel(helpersVoxel,this._mouse,this._current.voxel.dataCoordinates);this.updateColor(helpersVoxel);helpersVoxel.updateDom(this._container);helpersVoxel.showVoxel=this._showVoxel;helpersVoxel.showDomSVG=this._showDomSVG;helpersVoxel.showDomMeasurements=this._showDomMeasurements}}},{key:"update",value:function update(){if(!this._targetMesh){return}var intersects=this._raycaster.intersectObject(this._targetMesh);if(intersects.length>0){this._current.worldCoordinates=intersects[0].point;this._current.updateVoxelScreenCoordinates(this._camera,this._container);this.updateColor(this._current);this._current.updateDom(this._container);this._current.showVoxel=this._showVoxel;this._current.showDomSVG=this._showDomSVG;this._current.showDomMeasurements=this._showDomMeasurements;if(this._active>=0){this._voxels[this._active].worldCoordinates=intersects[0].point}}this.updateVoxels()}},{key:"updateVoxels",value:function updateVoxels(){var hover=-1;var closest=null;for(var i=0;i=0&&distance<10){helpersVoxel.hover=true}else{helpersVoxel.hover=false}}}},{key:"showOfIntersectsFrame",value:function showOfIntersectsFrame(voxelHelper,frameIndex){if(frameIndex===voxelHelper.voxel.dataCoordinates.z||frameIndex===-1){voxelHelper._showDomSVG=true;voxelHelper._showDomMeasurements=true}else{voxelHelper._showDomSVG=false;voxelHelper._showDomMeasurements=false}}},{key:"defaultColor",set:function set(defaultColor){this._defaultColor=defaultColor;this.update()},get:function get(){return this._defaultColor}},{key:"activeColor",set:function set(activeColor){this._activeColor=activeColor;this.update()},get:function get(){return this._activeColor}},{key:"hoverColor",set:function set(hoverColor){this._hoverColor=hoverColor;this.update()},get:function get(){return this._hoverColor}},{key:"selectedColor",set:function set(selectedColor){this._selectedColor=selectedColor;this.update()},get:function get(){return this._selectedColor}},{key:"showVoxel",set:function set(showVoxel){this._showVoxel=showVoxel;this.update()},get:function get(){return this._showVoxel}},{key:"showDomSVG",set:function set(showDomSVG){this._showDomSVG=showDomSVG;this.update()},get:function get(){return this._showDomSVG}},{key:"showDomMeasurements",set:function set(showDomMeasurements){this._showDomMeasurements=showDomMeasurements;this.update()},get:function get(){return this._showDomMeasurements}}]);return WidgetsVoxelProbe}(THREE.Object3D);exports.default=WidgetsVoxelProbe},{"../../src/helpers/helpers.voxel":110}]},{},[86])(86)}); \ No newline at end of file +this.decodeStrings=!noDecode;this.defaultEncoding=options.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(er){onwrite(stream,er)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.bufferedRequestCount=0;this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function writableStateGetBuffer(){var current=this.bufferedRequest;var out=[];while(current){out.push(current);current=current.next}return out};(function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.")})}catch(_){}})();var Duplex;function Writable(options){Duplex=Duplex||require("./_stream_duplex");if(!(this instanceof Writable)&&!(this instanceof Duplex))return new Writable(options);this._writableState=new WritableState(options,this);this.writable=true;if(options){if(typeof options.write==="function")this._write=options.write;if(typeof options.writev==="function")this._writev=options.writev}Stream.call(this)}Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function writeAfterEnd(stream,cb){var er=new Error("write after end");stream.emit("error",er);processNextTick(cb,er)}function validChunk(stream,state,chunk,cb){var valid=true;var er=false;if(chunk===null){er=new TypeError("May not write null values to stream")}else if(!Buffer.isBuffer(chunk)&&typeof chunk!=="string"&&chunk!==undefined&&!state.objectMode){er=new TypeError("Invalid non-string/buffer chunk")}if(er){stream.emit("error",er);processNextTick(cb,er);valid=false}return valid}Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState;var ret=false;if(typeof encoding==="function"){cb=encoding;encoding=null}if(Buffer.isBuffer(chunk))encoding="buffer";else if(!encoding)encoding=state.defaultEncoding;if(typeof cb!=="function")cb=nop;if(state.ended)writeAfterEnd(this,cb);else if(validChunk(this,state,chunk,cb)){state.pendingcb++;ret=writeOrBuffer(this,state,chunk,encoding,cb)}return ret};Writable.prototype.cork=function(){var state=this._writableState;state.corked++};Writable.prototype.uncork=function(){var state=this._writableState;if(state.corked){state.corked--;if(!state.writing&&!state.corked&&!state.finished&&!state.bufferProcessing&&state.bufferedRequest)clearBuffer(this,state)}};Writable.prototype.setDefaultEncoding=function setDefaultEncoding(encoding){if(typeof encoding==="string")encoding=encoding.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);this._writableState.defaultEncoding=encoding;return this};function decodeChunk(state,chunk,encoding){if(!state.objectMode&&state.decodeStrings!==false&&typeof chunk==="string"){chunk=bufferShim.from(chunk,encoding)}return chunk}function writeOrBuffer(stream,state,chunk,encoding,cb){chunk=decodeChunk(state,chunk,encoding);if(Buffer.isBuffer(chunk))encoding="buffer";var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length=this.charLength-this.charReceived?this.charLength-this.charReceived:buffer.length;buffer.copy(this.charBuffer,this.charReceived,0,available);this.charReceived+=available;if(this.charReceived=55296&&charCode<=56319){this.charLength+=this.surrogateSize;charStr="";continue}this.charReceived=this.charLength=0;if(buffer.length===0){return charStr}break}this.detectIncompleteChar(buffer);var end=buffer.length;if(this.charLength){buffer.copy(this.charBuffer,0,buffer.length-this.charReceived,end);end-=this.charReceived}charStr+=buffer.toString(this.encoding,0,end);var end=charStr.length-1;var charCode=charStr.charCodeAt(end);if(charCode>=55296&&charCode<=56319){var size=this.surrogateSize;this.charLength+=size;this.charReceived+=size;this.charBuffer.copy(this.charBuffer,size,0,size);buffer.copy(this.charBuffer,0,0,size);return charStr.substring(0,end)}return charStr};StringDecoder.prototype.detectIncompleteChar=function(buffer){var i=buffer.length>=3?3:buffer.length;for(;i>0;i--){var c=buffer[buffer.length-i];if(i==1&&c>>5==6){this.charLength=2;break}if(i<=2&&c>>4==14){this.charLength=3;break}if(i<=3&&c>>3==30){this.charLength=4;break}}this.charReceived=i};StringDecoder.prototype.end=function(buffer){var res="";if(buffer&&buffer.length)res=this.write(buffer);if(this.charReceived){var cr=this.charReceived;var buf=this.charBuffer;var enc=this.encoding;res+=buf.slice(0,cr).toString(enc)}return res};function passThroughWrite(buffer){return buffer.toString(this.encoding)}function utf16DetectIncompleteChar(buffer){this.charReceived=buffer.length%2;this.charLength=this.charReceived?2:0}function base64DetectIncompleteChar(buffer){this.charReceived=buffer.length%3;this.charLength=this.charReceived?3:0}},{buffer:19}],75:[function(require,module,exports){(function(global){module.exports=deprecate;function deprecate(fn,msg){if(config("noDeprecation")){return fn}var warned=false;function deprecated(){if(!warned){if(config("throwDeprecation")){throw new Error(msg)}else if(config("traceDeprecation")){console.trace(msg)}else{console.warn(msg)}warned=true}return fn.apply(this,arguments)}return deprecated}function config(name){try{if(!global.localStorage)return false}catch(_){return false}var val=global.localStorage[name];if(null==val)return false;return String(val).toLowerCase()==="true"}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],76:[function(require,module,exports){module.exports=function isBuffer(arg){return arg&&typeof arg==="object"&&typeof arg.copy==="function"&&typeof arg.fill==="function"&&typeof arg.readUInt8==="function"}},{}],77:[function(require,module,exports){(function(process,global){var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){var objects=[];for(var i=0;i=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}});for(var x=args[i];i=3)ctx.depth=arguments[2];if(arguments.length>=4)ctx.colors=arguments[3];if(isBoolean(opts)){ctx.showHidden=opts}else if(opts){exports._extend(ctx,opts)}if(isUndefined(ctx.showHidden))ctx.showHidden=false;if(isUndefined(ctx.depth))ctx.depth=2;if(isUndefined(ctx.colors))ctx.colors=false;if(isUndefined(ctx.customInspect))ctx.customInspect=true;if(ctx.colors)ctx.stylize=stylizeWithColor;return formatValue(ctx,obj,ctx.depth)}exports.inspect=inspect;inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];if(style){return"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m"}else{return str}}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};array.forEach(function(val,idx){hash[val]=true});return hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&!(value.constructor&&value.constructor.prototype===value)){var ret=value.inspect(recurseTimes,ctx);if(!isString(ret)){ret=formatValue(ctx,ret,recurseTimes)}return ret}var primitive=formatPrimitive(ctx,value);if(primitive){return primitive}var keys=Object.keys(value);var visibleKeys=arrayToHash(keys);if(ctx.showHidden){keys=Object.getOwnPropertyNames(value)}if(isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0)){return formatError(value)}if(keys.length===0){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}if(isDate(value)){return ctx.stylize(Date.prototype.toString.call(value),"date")}if(isError(value)){return formatError(value)}}var base="",array=false,braces=["{","}"];if(isArray(value)){array=true;braces=["[","]"]}if(isFunction(value)){var n=value.name?": "+value.name:"";base=" [Function"+n+"]"}if(isRegExp(value)){base=" "+RegExp.prototype.toString.call(value)}if(isDate(value)){base=" "+Date.prototype.toUTCString.call(value)}if(isError(value)){base=" "+formatError(value)}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1]}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}else{return ctx.stylize("[Object]","special")}}ctx.seen.push(value);var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys)}else{output=keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)})}ctx.seen.pop();return reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}if(isNumber(value))return ctx.stylize(""+value,"number");if(isBoolean(value))return ctx.stylize(""+value,"boolean");if(isNull(value))return ctx.stylize("null","null")}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i-1){if(array){str=str.split("\n").map(function(line){return" "+line}).join("\n").substr(2)}else{str="\n"+str.split("\n").map(function(line){return" "+line}).join("\n")}}}else{str=ctx.stylize("[Circular]","special")}}if(isUndefined(name)){if(array&&key.match(/^\d+$/)){return str}name=JSON.stringify(""+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.substr(1,name.length-2);name=ctx.stylize(name,"name")}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,"string")}}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=output.reduce(function(prev,cur){numLinesEst++;if(cur.indexOf("\n")>=0)numLinesEst++;return prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(length>60){return braces[0]+(base===""?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]}return braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;exports.isBuffer=require("./support/isBuffer");function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var d=new Date;var time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))};exports.inherits=require("inherits");exports._extend=function(origin,add){if(!add||!isObject(add))return origin;var keys=Object.keys(add);var i=keys.length;while(i--){origin[keys[i]]=add[keys[i]]}return origin};function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":76,_process:68,inherits:27}],78:[function(require,module,exports){"use strict";var isString=require("validate.io-string-primitive");var isNonNegativeInteger=require("validate.io-nonnegative-integer");var ceil=require("math-ceil");var repeat=require("utils-repeat-string");var MAX_SAFE_INTEGER=9007199254740991;function lpad(str,len,pad){var n;var p;if(!isString(str)){throw new TypeError("invalid input argument. First argument must be a string. Value: `"+str+"`.")}if(!isNonNegativeInteger(len)){throw new TypeError("invalid input argument. Second argument must be a nonnegative integer. Value: `"+len+"`.")}if(arguments.length>2){p=pad;if(!isString(p)){throw new TypeError("invalid input argument. Third argument must be a string. Value: `"+p+"`.")}if(p.length===0){throw new RangeError("invalid input argument. Pad string must not be an empty string.")}}else{p=" "}if(len>MAX_SAFE_INTEGER){throw new RangeError("invalid input argument. Output string length exceeds maximum allowed string length.")}n=(len-str.length)/p.length;if(n<=0){return str}n=ceil(n);return repeat(p,n)+str}module.exports=lpad},{"math-ceil":41,"utils-repeat-string":79,"validate.io-nonnegative-integer":82,"validate.io-string-primitive":84}],79:[function(require,module,exports){"use strict";var isString=require("validate.io-string-primitive");var isNonNegativeInteger=require("validate.io-nonnegative-integer");var MAX_SAFE_INTEGER=9007199254740991;function repeat(str,n){var rpt;var cnt;if(!isString(str)){throw new TypeError("invalid input argument. First argument must be a string. Value: `"+str+"`.")}if(!isNonNegativeInteger(n)){throw new TypeError("invalid input argument. Second argument must be a nonnegative integer. Value: `"+n+"`.")}if(str.length===0||n===0){return""}if(str.length*n>MAX_SAFE_INTEGER){throw new RangeError("invalid input argument. Output string length exceeds maximum allowed string length.")}rpt="";cnt=n;for(;;){if((cnt&1)===1){rpt+=str}cnt>>>=1;if(cnt===0){break}str+=str}return rpt}module.exports=repeat},{"validate.io-nonnegative-integer":82,"validate.io-string-primitive":84}],80:[function(require,module,exports){"use strict";var isString=require("validate.io-string-primitive");var isNonNegativeInteger=require("validate.io-nonnegative-integer");var ceil=require("math-ceil");var repeat=require("utils-repeat-string");var MAX_SAFE_INTEGER=9007199254740991;function rpad(str,len,pad){var n;var p;if(!isString(str)){throw new TypeError("invalid input argument. First argument must be a string. Value: `"+str+"`.")}if(!isNonNegativeInteger(len)){throw new TypeError("invalid input argument. Second argument must be a nonnegative integer. Value: `"+len+"`.")}if(arguments.length>2){p=pad;if(!isString(p)){throw new TypeError("invalid input argument. Third argument must be a string. Value: `"+p+"`.")}if(p.length===0){throw new RangeError("invalid input argument. Pad string must not be an empty string.")}}else{p=" "}if(len>MAX_SAFE_INTEGER){throw new RangeError("invalid input argument. Output string length exceeds maximum allowed string length.")}n=(len-str.length)/p.length;if(n<=0){return str}n=ceil(n);return str+repeat(p,n)}module.exports=rpad},{"math-ceil":41,"utils-repeat-string":79,"validate.io-nonnegative-integer":82,"validate.io-string-primitive":84}],81:[function(require,module,exports){"use strict";var isNumber=require("validate.io-number");function isInteger(value){return isNumber(value)&&value%1===0}module.exports=isInteger},{"validate.io-number":83}],82:[function(require,module,exports){"use strict";var isInteger=require("validate.io-integer");function isNonNegativeInteger(value){return isInteger(value)&&value>=0}module.exports=isNonNegativeInteger},{"validate.io-integer":81}],83:[function(require,module,exports){"use strict";function isNumber(value){return(typeof value==="number"||Object.prototype.toString.call(value)==="[object Number]")&&value.valueOf()===value.valueOf()}module.exports=isNumber},{}],84:[function(require,module,exports){"use strict";function isString(value){return typeof value==="string"}module.exports=isString},{}],85:[function(require,module,exports){module.exports={name:"ami.js",version:"v0.0.12",main:"src/ami.js",keywords:["ami","ami.js","three.js","webgl","dicom","nifti","awesome","medical","imaging","xtk","nrrd","vtk","stl","trk"],author:{name:"Nicolas Rannou",email:"nicolas@eunate.ch",url:"https://eunate.ch"},license:"Apache-2.0",repository:{type:"git",url:"https://fnndsc.github.io/ami"},config:{threeVersion:"r81",amiCDN:"https://cdnjs.cloudflare.com/ajax/libs/ami.js/",gaKey:"UA-39303022-3",transforms:"-t [babelify --presets [ es2015 ] ]"},dependencies:{"dicom-parser":"1.7.3","image-JPEG2000":"OHIF/image-JPEG2000#master","jpeg-lossless-decoder-js":"1.2.3","math-float32-to-binary-string":"^1.0.0","nrrd-js":"^0.2.1","nifti-reader-js":"v0.5.3",pako:"1.0.1"},scripts:{"dist:prepare":"node ./scripts/$npm_package_config_mode.js --dist","dist:watchAmi":"watchify -d src/ami $npm_package_config_transforms --standalone AMI -o dist/build/ami.js -v","dist:watch":"watchify $npm_package_config_target -d $npm_package_config_transforms -o dist/$npm_package_config_target -v",dist:"npm run dist:prepare --ami.js:mode=$npm_package_config_mode && (live-server dist --open=$npm_package_config_open & npm run dist:watch --ami.js:target=$npm_package_config_target)",example:"npm run clean && node ./scripts/router.js examples ",lesson:"npm run clean && mkdir dist/build && touch dist/build/ami.js && node ./scripts/router.js lessons ",demo:"node ./scripts/lessons.js --demo",lint:"eslint **/*.js --quiet","build:examples":"npm run dist:prepare --ami.js:mode=examples && find examples -name '*.js' -print0 | xargs -0 -n1 -I{} bash -c \"echo Building {}; browserify {} -d -v $npm_package_config_transforms > dist/{} \"","build:ami":"browserify src/ami.js -d -v $npm_package_config_transforms --standalone AMI > build/ami.js && uglifyjs build/ami.js -o build/ami.min.js",build:"npm run clean && cp index.html dist/index.html && npm run build:examples && npm run doc",clean:"rm -rf dist/*",test:"karma start",doc:"jsdoc -p -r -R README.md -c jsdoc.conf -d dist/doc src",ami:"npm run lint && npm run demo && npm run build:ami && npm run test",deploy:"npm run build && gh-pages -d dist"},devDependencies:{browserify:"^13.1.0","uglify-js":"^2.7.3","live-server":"^1.1.0","babel-cli":"latest",shelljs:"latest","gh-pages":"latest",eslint:"latest","babel-polyfill":"^6.13.0","babel-preset-es2015":"^6.13.2",babelify:"7.3.0",glslify:"5.1.0",jsdoc:"jsdoc3/jsdoc#master",karma:"latest",phantomjs:"latest","karma-browserify":"latest","karma-jasmine":"latest","karma-phantomjs-launcher":"latest","karma-spec-reporter":"latest","jasmine-core":"latest",watchify:"3.7.0"},engines:{node:">=6.9.0"},browserify:{transform:["babelify"]}}},{}],86:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _cameras=require("./cameras/cameras");var _cameras2=_interopRequireDefault(_cameras);var _controls=require("./controls/controls");var _controls2=_interopRequireDefault(_controls);var _core=require("./core/core");var _core2=_interopRequireDefault(_core);var _geometries=require("./geometries/geometries");var _geometries2=_interopRequireDefault(_geometries);var _helpers=require("./helpers/helpers");var _helpers2=_interopRequireDefault(_helpers);var _loaders=require("./loaders/loaders");var _loaders2=_interopRequireDefault(_loaders);var _models=require("./models/models");var _models2=_interopRequireDefault(_models);var _parsers=require("./parsers/parsers");var _parsers2=_interopRequireDefault(_parsers);var _shaders=require("./shaders/shaders");var _shaders2=_interopRequireDefault(_shaders);var _widgets=require("./widgets/widgets");var _widgets2=_interopRequireDefault(_widgets);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var pckg=require("../package.json");exports.default={Cameras:_cameras2.default,Controls:_controls2.default,Core:_core2.default,Geometries:_geometries2.default,Helpers:_helpers2.default,Loaders:_loaders2.default,Models:_models2.default,Parsers:_parsers2.default,Shaders:_shaders2.default,Widgets:_widgets2.default};window.console.log("AMI "+pckg.version+" ( ThreeJS "+pckg.config.threeVersion+")")},{"../package.json":85,"./cameras/cameras":87,"./controls/controls":89,"./core/core":94,"./geometries/geometries":98,"./helpers/helpers":103,"./loaders/loaders":112,"./models/models":116,"./parsers/parsers":121,"./shaders/shaders":135,"./widgets/widgets":144}],87:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _cameras=require("./cameras.orthographic");var _cameras2=_interopRequireDefault(_cameras);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Orthographic:_cameras2.default}},{"./cameras.orthographic":88}],88:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0){posteriorDirection.negate()}if(superiorDirection.z<0){superiorDirection.negate()}this._right=leftDirection;this._up=posteriorDirection;this._direction=superiorDirection;break;case"coronal":if(superiorDirection.z<0){superiorDirection.negate()}if(posteriorDirection.y<0){posteriorDirection.negate()}this._right=leftDirection;this._up=superiorDirection;this._direction=posteriorDirection;break;case"sagittal":if(superiorDirection.z<0){superiorDirection.negate()}if(leftDirection.x>0){leftDirection.negate()}this._right=posteriorDirection;this._up=superiorDirection;this._direction=leftDirection;break;default:console.warn('"'+this._orientation+'" orientation is not valid. (choices: axial, coronal, sagittal)');break}}else if(this._convention==="neuro"){switch(this._orientation){case"axial":if(posteriorDirection.y>0){posteriorDirection.negate()}if(superiorDirection.z>0){superiorDirection.negate()}this._right=leftDirection;this._up=posteriorDirection;this._direction=superiorDirection;break;case"coronal":if(superiorDirection.z<0){superiorDirection.negate()}if(posteriorDirection.y>0){posteriorDirection.negate()}this._right=leftDirection;this._up=superiorDirection;this._direction=posteriorDirection;break;case"sagittal":if(superiorDirection.z<0){superiorDirection.negate()}if(leftDirection.x>0){leftDirection.negate()}this._right=posteriorDirection;this._up=superiorDirection;this._direction=leftDirection;break;default:console.warn('"'+this._orientation+'" orientation is not valid. (choices: axial, coronal, sagittal)');break}}else{console.warn(this._convention+" is not valid (choices: radio, neuro)")}}var ray={position:this._box.center,direction:this._direction};var intersections=this._orderIntersections(_core2.default.rayBox(ray,this._box),this._direction);this._front=intersections[0];this._back=intersections[1];this.up.set(this._up.x,this._up.y,this._up.z);this._updateCanvas();this._updatePositionAndTarget(this._front,this._back);this._updateMatrices()}},{key:"leftDirection",value:function leftDirection(){return this._findMaxIndex(this._directions,0)}},{key:"posteriorDirection",value:function posteriorDirection(){return this._findMaxIndex(this._directions,1)}},{key:"superiorDirection",value:function superiorDirection(){return this._findMaxIndex(this._directions,2)}},{key:"invertRows",value:function invertRows(){console.log("invert rows ");this.up.multiplyScalar(-1);this.invertColumns()}},{key:"invertColumns",value:function invertColumns(){console.log("invert columns ");this.center();var oppositePosition=this._oppositePosition(this.position);this._updatePositionAndTarget(oppositePosition,this.position.clone());this._updateMatrices();this._fromFront=!this._fromFront;var clockwise=1;if(!this._fromFront){clockwise=-1}this._angle%=360;this._angle=360-this._angle}},{key:"center",value:function center(){if(this._fromFront){this._updatePositionAndTarget(this._front,this._back)}else{this._updatePositionAndTarget(this._back,this._front)}this._updateMatrices()}},{key:"rotate",value:function rotate(){var angle=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;this.center();var computedAngle=90;var clockwise=1;if(!this._fromFront){clockwise=-1}if(angle===null){computedAngle*=-clockwise;this._angle+=90}else{computedAngle=360-clockwise*(angle-this._angle);this._angle=angle}this._angle%=360;var rotation=(new THREE.Matrix4).makeRotationAxis(this._direction,computedAngle*Math.PI/180);this.up.applyMatrix4(rotation);this._updateMatrices()}},{key:"fitBox",value:function fitBox(){var direction=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var factor=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1.5;var zoom=1;switch(direction){case 0:zoom=factor*this._computeZoom(this._canvas.width,this._right);break;case 1:zoom=factor*this._computeZoom(this._canvas.height,this._up);break;case 2:zoom=factor*Math.min(this._computeZoom(this._canvas.width,this._right),this._computeZoom(this._canvas.height,this._up));break;default:break}if(!zoom){return false}this.zoom=zoom;this.center()}},{key:"_adjustTopDirection",value:function _adjustTopDirection(horizontalDirection,verticalDirection){var hMaxIndex=this._getMaxIndex(horizontalDirection);var vMaxIndex=this._getMaxIndex(verticalDirection);if(vMaxIndex===2&&verticalDirection.getComponent(vMaxIndex)<0||vMaxIndex===1&&verticalDirection.getComponent(vMaxIndex)>0||vMaxIndex===0&&verticalDirection.getComponent(vMaxIndex)>0){verticalDirection.negate()}return verticalDirection}},{key:"_getMaxIndex",value:function _getMaxIndex(vector){if(Math.abs(Math.round(vector.x))===1){return 0}else if(Math.abs(Math.round(vector.y))===1){return 1}else if(Math.abs(Math.round(vector.z))===1){return 2}}},{key:"_findMaxIndex",value:function _findMaxIndex(directions,target){var maxIndices=this._getMaxIndices(directions);for(var i=0;i0)){window.console.log("Invalid dimension provided.");window.console.log(dimension);return false}var ray={position:this._box.center.clone(),direction:direction};var intersections=_core2.default.rayBox(ray,this._box);if(intersections.length<2){window.console.log("Can not adjust the camera ( < 2 intersections).");window.console.log(ray);window.console.log(this._box);return false}return dimension/intersections[0].distanceTo(intersections[1])}},{key:"_updatePositionAndTarget",value:function _updatePositionAndTarget(position,target){this.position.set(position.x,position.y,position.z);this.lookAt(target.x,target.y,target.z);this._controls.target.set(target.x,target.y,target.z)}},{key:"_updateMatrices",value:function _updateMatrices(){this._controls.update();this.updateProjectionMatrix();this.updateMatrixWorld()}},{key:"controls",set:function set(controls){this._controls=controls},get:function get(){return this._controls}},{key:"box",set:function set(box){this._box=box},get:function get(){return this._box}},{key:"canvas",set:function set(canvas){this._canvas=canvas;this._updateCanvas()},get:function get(){return this._canvas}},{key:"angle",set:function set(angle){this.rotate(angle)},get:function get(){return this._angle}},{key:"directions",set:function set(directions){this._directions=directions},get:function get(){return this._directions}},{key:"convention",set:function set(convention){this._convention=convention},get:function get(){return this._convention}},{key:"orientation",set:function set(orientation){this._orientation=orientation},get:function get(){return this._orientation}},{key:"stackOrientation",set:function set(stackOrientation){this._stackOrientation=stackOrientation;if(this._stackOrientation===0){this._orientation="default"}else{var maxIndex=this._getMaxIndex(this._directions[(this._stackOrientation+2)%3]);if(maxIndex===0){this._orientation="sagittal"}else if(maxIndex===1){this._orientation="coronal"}else if(maxIndex===2){this._orientation="axial"}}},get:function get(){if(this._orientation==="default"){this._stackOrientation=0}else{var maxIndex=this._getMaxIndex(this._direction);if(maxIndex===this._getMaxIndex(this._directions[2])){this._stackOrientation=0}else if(maxIndex===this._getMaxIndex(this._directions[0])){this._stackOrientation=1}else if(maxIndex===this._getMaxIndex(this._directions[1])){this._stackOrientation=2}}return this._stackOrientation}}]);return CamerasOrthographic}(THREE.OrthographicCamera);exports.default=CamerasOrthographic},{"../core/core.intersections":93,"../core/core.validators":97}],89:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _controls=require("./controls.trackball");var _controls2=_interopRequireDefault(_controls);var _controls3=require("./controls.trackballortho");var _controls4=_interopRequireDefault(_controls3);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Trackball:_controls2.default,TrackballOrtho:_controls4.default}},{"./controls.trackball":90,"./controls.trackballortho":91}],90:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return call&&((typeof call==="undefined"?"undefined":_typeof(call))==="object"||typeof call==="function")?call:self}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+(typeof superClass==="undefined"?"undefined":_typeof(superClass)))}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass}var Trackball=function(_THREE$EventDispatche){_inherits(Trackball,_THREE$EventDispatche);function Trackball(object,domElement){_classCallCheck(this,Trackball);var _this2=_possibleConstructorReturn(this,(Trackball.__proto__||Object.getPrototypeOf(Trackball)).call(this));var _this=_this2;var STATE={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM:4,TOUCH_PAN:5,CUSTOM:99};_this2.object=object;_this2.domElement=domElement!==undefined?domElement:document;_this2.enabled=true;_this2.screen={left:0,top:0,width:0,height:0};_this2.rotateSpeed=1;_this2.zoomSpeed=1.2;_this2.panSpeed=.3;_this2.noRotate=false;_this2.noZoom=false;_this2.noPan=false;_this2.noCustom=false;_this2.forceState=-1;_this2.staticMoving=false;_this2.dynamicDampingFactor=.2;_this2.minDistance=0;_this2.maxDistance=Infinity;_this2.keys=[65,83,68];_this2.target=new THREE.Vector3;var EPS=1e-6;var lastPosition=new THREE.Vector3;var _state=STATE.NONE,_prevState=STATE.NONE,_eye=new THREE.Vector3,_movePrev=new THREE.Vector2,_moveCurr=new THREE.Vector2,_lastAxis=new THREE.Vector3,_lastAngle=0,_zoomStart=new THREE.Vector2,_zoomEnd=new THREE.Vector2,_touchZoomDistanceStart=0,_touchZoomDistanceEnd=0,_panStart=new THREE.Vector2,_panEnd=new THREE.Vector2,_customStart=new THREE.Vector2,_customEnd=new THREE.Vector2;_this2.target0=_this2.target.clone();_this2.position0=_this2.object.position.clone();_this2.up0=_this2.object.up.clone();var changeEvent={type:"change"};var startEvent={type:"start"};var endEvent={type:"end"};_this2.handleResize=function(){if(this.domElement===document){this.screen.left=0;this.screen.top=0;this.screen.width=window.innerWidth;this.screen.height=window.innerHeight}else{var box=this.domElement.getBoundingClientRect();var d=this.domElement.ownerDocument.documentElement;this.screen.left=box.left+window.pageXOffset-d.clientLeft;this.screen.top=box.top+window.pageYOffset-d.clientTop;this.screen.width=box.width;this.screen.height=box.height}};_this2.handleEvent=function(event){if(typeof this[event.type]=="function"){this[event.type](event)}};var getMouseOnScreen=function(){var vector=new THREE.Vector2;return function(pageX,pageY){vector.set((pageX-_this.screen.left)/_this.screen.width,(pageY-_this.screen.top)/_this.screen.height);return vector}}();var getMouseOnCircle=function(){var vector=new THREE.Vector2;return function(pageX,pageY){vector.set((pageX-_this.screen.width*.5-_this.screen.left)/(_this.screen.width*.5),(_this.screen.height+2*(_this.screen.top-pageY))/_this.screen.width);return vector}}();_this2.rotateCamera=function(){var axis=new THREE.Vector3,quaternion=new THREE.Quaternion,eyeDirection=new THREE.Vector3,objectUpDirection=new THREE.Vector3,objectSidewaysDirection=new THREE.Vector3,moveDirection=new THREE.Vector3,angle;return function(){moveDirection.set(_moveCurr.x-_movePrev.x,_moveCurr.y-_movePrev.y,0);angle=moveDirection.length();if(angle){_eye.copy(_this.object.position).sub(_this.target);eyeDirection.copy(_eye).normalize();objectUpDirection.copy(_this.object.up).normalize();objectSidewaysDirection.crossVectors(objectUpDirection,eyeDirection).normalize();objectUpDirection.setLength(_moveCurr.y-_movePrev.y);objectSidewaysDirection.setLength(_moveCurr.x-_movePrev.x);moveDirection.copy(objectUpDirection.add(objectSidewaysDirection));axis.crossVectors(moveDirection,_eye).normalize();angle*=_this.rotateSpeed;quaternion.setFromAxisAngle(axis,angle);_eye.applyQuaternion(quaternion);_this.object.up.applyQuaternion(quaternion);_lastAxis.copy(axis);_lastAngle=angle}else if(!_this.staticMoving&&_lastAngle){_lastAngle*=Math.sqrt(1-_this.dynamicDampingFactor);_eye.copy(_this.object.position).sub(_this.target);quaternion.setFromAxisAngle(_lastAxis,_lastAngle);_eye.applyQuaternion(quaternion);_this.object.up.applyQuaternion(quaternion)}_movePrev.copy(_moveCurr)}}();_this2.zoomCamera=function(){var factor;if(_state===STATE.TOUCH_ZOOM){factor=_touchZoomDistanceStart/_touchZoomDistanceEnd;_touchZoomDistanceStart=_touchZoomDistanceEnd;_eye.multiplyScalar(factor)}else{factor=1+(_zoomEnd.y-_zoomStart.y)*_this.zoomSpeed;if(factor!==1&&factor>0){_eye.multiplyScalar(factor);if(_this.staticMoving){_zoomStart.copy(_zoomEnd)}else{_zoomStart.y+=(_zoomEnd.y-_zoomStart.y)*this.dynamicDampingFactor}}}};_this2.panCamera=function(){var mouseChange=new THREE.Vector2,objectUp=new THREE.Vector3,pan=new THREE.Vector3;return function(){mouseChange.copy(_panEnd).sub(_panStart);if(mouseChange.lengthSq()){mouseChange.multiplyScalar(_eye.length()*_this.panSpeed);pan.copy(_eye).cross(_this.object.up).setLength(mouseChange.x);pan.add(objectUp.copy(_this.object.up).setLength(mouseChange.y));_this.object.position.add(pan);_this.target.add(pan);if(_this.staticMoving){_panStart.copy(_panEnd)}else{_panStart.add(mouseChange.subVectors(_panEnd,_panStart).multiplyScalar(_this.dynamicDampingFactor))}}}}();_this2.checkDistances=function(){if(!_this.noZoom||!_this.noPan){if(_eye.lengthSq()>_this.maxDistance*_this.maxDistance){_this.object.position.addVectors(_this.target,_eye.setLength(_this.maxDistance))}if(_eye.lengthSq()<_this.minDistance*_this.minDistance){_this.object.position.addVectors(_this.target,_eye.setLength(_this.minDistance))}}};_this2.update=function(){_eye.subVectors(_this.object.position,_this.target);if(!_this.noRotate){_this.rotateCamera()}if(!_this.noZoom){_this.zoomCamera()}if(!_this.noPan){_this.panCamera()}if(!_this.noCustom){_this.custom(_customStart,_customEnd)}_this.object.position.addVectors(_this.target,_eye);_this.checkDistances();_this.object.lookAt(_this.target);if(lastPosition.distanceToSquared(_this.object.position)>EPS){_this.dispatchEvent(changeEvent);lastPosition.copy(_this.object.position)}};_this2.reset=function(){_state=STATE.NONE;_prevState=STATE.NONE;_this.target.copy(_this.target0);_this.object.position.copy(_this.position0);_this.object.up.copy(_this.up0);_eye.subVectors(_this.object.position,_this.target);_this.object.lookAt(_this.target);_this.dispatchEvent(changeEvent);lastPosition.copy(_this.object.position)};_this2.setState=function(targetState){_this.forceState=targetState;_prevState=targetState;_state=targetState};_this2.custom=function(customStart,customEnd){};function keydown(event){if(_this.enabled===false)return;window.removeEventListener("keydown",keydown);_prevState=_state;if(_state!==STATE.NONE){return}else if(event.keyCode===_this.keys[STATE.ROTATE]&&!_this.noRotate){_state=STATE.ROTATE}else if(event.keyCode===_this.keys[STATE.ZOOM]&&!_this.noZoom){_state=STATE.ZOOM}else if(event.keyCode===_this.keys[STATE.PAN]&&!_this.noPan){_state=STATE.PAN}}function keyup(event){if(_this.enabled===false)return;_state=_prevState;window.addEventListener("keydown",keydown,false)}function mousedown(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_state===STATE.NONE){_state=event.button}if(_state===STATE.ROTATE&&!_this.noRotate){_moveCurr.copy(getMouseOnCircle(event.pageX,event.pageY));_movePrev.copy(_moveCurr)}else if(_state===STATE.ZOOM&&!_this.noZoom){_zoomStart.copy(getMouseOnScreen(event.pageX,event.pageY));_zoomEnd.copy(_zoomStart)}else if(_state===STATE.PAN&&!_this.noPan){_panStart.copy(getMouseOnScreen(event.pageX,event.pageY));_panEnd.copy(_panStart)}else if(_state===STATE.CUSTOM&&!_this.noCustom){_customStart.copy(getMouseOnScreen(event.pageX,event.pageY));_customEnd.copy(_panStart)}document.addEventListener("mousemove",mousemove,false);document.addEventListener("mouseup",mouseup,false);_this.dispatchEvent(startEvent)}function mousemove(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_state===STATE.ROTATE&&!_this.noRotate){_movePrev.copy(_moveCurr);_moveCurr.copy(getMouseOnCircle(event.pageX,event.pageY))}else if(_state===STATE.ZOOM&&!_this.noZoom){_zoomEnd.copy(getMouseOnScreen(event.pageX,event.pageY))}else if(_state===STATE.PAN&&!_this.noPan){_panEnd.copy(getMouseOnScreen(event.pageX,event.pageY))}else if(_state===STATE.CUSTOM&&!_this.noCustom){_customEnd.copy(getMouseOnScreen(event.pageX,event.pageY))}}function mouseup(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_this.forceState===-1){_state=STATE.NONE}document.removeEventListener("mousemove",mousemove);document.removeEventListener("mouseup",mouseup);_this.dispatchEvent(endEvent)}function mousewheel(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();var delta=0;if(event.wheelDelta){delta=event.wheelDelta/40}else if(event.detail){delta=-event.detail/3}if(_state!==STATE.CUSTOM){_zoomStart.y+=delta*.01}else if(_state===STATE.CUSTOM){_customStart.y+=delta*.01}_this.dispatchEvent(startEvent);_this.dispatchEvent(endEvent)}function touchstart(event){if(_this.enabled===false)return;if(_this.forceState===-1){switch(event.touches.length){case 1:_state=STATE.TOUCH_ROTATE;_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));_movePrev.copy(_moveCurr);break;case 2:_state=STATE.TOUCH_ZOOM;var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=_touchZoomDistanceStart=Math.sqrt(dx*dx+dy*dy);var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panStart.copy(getMouseOnScreen(x,y));_panEnd.copy(_panStart);break;default:_state=STATE.NONE}}else{switch(_state){case 0:_state=STATE.TOUCH_ROTATE;_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));_movePrev.copy(_moveCurr);break;case 1:case 4:if(event.touches.length>=2){_state=STATE.TOUCH_ZOOM;var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=_touchZoomDistanceStart=Math.sqrt(dx*dx+dy*dy)}else{_state=STATE.ZOOM;_zoomStart.copy(getMouseOnScreen(event.touches[0].pageX,event.touches[0].pageY));_zoomEnd.copy(_zoomStart)}break;case 2:case 5:if(event.touches.length>=2){_state=STATE.TOUCH_PAN;var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panStart.copy(getMouseOnScreen(x,y));_panEnd.copy(_panStart)}else{_state=STATE.PAN;_panStart.copy(getMouseOnScreen(event.touches[0].pageX,event.touches[0].pageY));_panEnd.copy(_panStart)}break;case 99:_state=STATE.CUSTOM;var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_customStart.copy(getMouseOnScreen(x,y));_customEnd.copy(_customStart);break;default:_state=STATE.NONE}}_this.dispatchEvent(startEvent)}function touchmove(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_this.forceState===-1){switch(event.touches.length){case 1:_movePrev.copy(_moveCurr);_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));break;case 2:var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=Math.sqrt(dx*dx+dy*dy);var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));break;default:_state=STATE.NONE}}else{switch(_state){case 0:_movePrev.copy(_moveCurr);_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));break;case 1:_zoomEnd.copy(getMouseOnScreen(event.touches[0].pageX,event.touches[0].pageY));break;case 2:_panEnd.copy(getMouseOnScreen(event.touches[0].pageX,event.touches[0].pageY));break;case 4:var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=Math.sqrt(dx*dx+dy*dy);break;case 5:var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));break;case 99:var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_customEnd.copy(getMouseOnScreen(x,y));break;default:_state=STATE.NONE}}}function touchend(event){if(_this.enabled===false)return;if(_this.forceState===-1){switch(event.touches.length){case 1:_movePrev.copy(_moveCurr);_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));break;case 2:_touchZoomDistanceStart=_touchZoomDistanceEnd=0;var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));_panStart.copy(_panEnd);break}_state=STATE.NONE}else{switch(_state){case 0:_movePrev.copy(_moveCurr);_moveCurr.copy(getMouseOnCircle(event.touches[0].pageX,event.touches[0].pageY));break;case 1:case 2:break;case 4:_touchZoomDistanceStart=_touchZoomDistanceEnd=0;_state=STATE.ZOOM;break;case 5:if(event.touches.length>=2){var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));_panStart.copy(_panEnd)}_state=STATE.PAN;break;case 99:var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_customEnd.copy(getMouseOnScreen(x,y));_customStart.copy(_customEnd);break;default:_state=STATE.NONE}}_this.dispatchEvent(endEvent)}_this2.domElement.addEventListener("contextmenu",function(event){event.preventDefault()},false);_this2.domElement.addEventListener("mousedown",mousedown,false);_this2.domElement.addEventListener("mousewheel",mousewheel,false);_this2.domElement.addEventListener("DOMMouseScroll",mousewheel,false);_this2.domElement.addEventListener("touchstart",touchstart,false);_this2.domElement.addEventListener("touchend",touchend,false);_this2.domElement.addEventListener("touchmove",touchmove,false);window.addEventListener("keydown",keydown,false);window.addEventListener("keyup",keyup,false);_this2.handleResize();_this2.update();return _this2}return Trackball}(THREE.EventDispatcher);exports.default=Trackball},{}],91:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return call&&((typeof call==="undefined"?"undefined":_typeof(call))==="object"||typeof call==="function")?call:self}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+(typeof superClass==="undefined"?"undefined":_typeof(superClass)))}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass}var Trackballortho=function(_THREE$EventDispatche){_inherits(Trackballortho,_THREE$EventDispatche);function Trackballortho(object,domElement){var state=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{NONE:-1,ROTATE:1,ZOOM:2,PAN:0,SCROLL:4,TOUCH_ROTATE:4,TOUCH_ZOOM_PAN:5};_classCallCheck(this,Trackballortho);var _this2=_possibleConstructorReturn(this,(Trackballortho.__proto__||Object.getPrototypeOf(Trackballortho)).call(this));var _this=_this2;var STATE=state;_this2.object=object;_this2.domElement=domElement!==undefined?domElement:document;_this2.enabled=true;_this2.screen={left:0,top:0,width:0,height:0};_this2.radius=0;_this2.zoomSpeed=1.2;_this2.noZoom=false;_this2.noPan=false;_this2.staticMoving=false;_this2.dynamicDampingFactor=.2;_this2.keys=[65,83,68];_this2.target=new THREE.Vector3;var EPS=1e-6;var _changed=true;var _state=STATE.NONE,_prevState=STATE.NONE,_eye=new THREE.Vector3,_zoomStart=new THREE.Vector2,_zoomEnd=new THREE.Vector2,_touchZoomDistanceStart=0,_touchZoomDistanceEnd=0,_panStart=new THREE.Vector2,_panEnd=new THREE.Vector2;_this2.target0=_this2.target.clone();_this2.position0=_this2.object.position.clone();_this2.up0=_this2.object.up.clone();_this2.left0=_this2.object.left;_this2.right0=_this2.object.right;_this2.top0=_this2.object.top;_this2.bottom0=_this2.object.bottom;var changeEvent={type:"change"};var startEvent={type:"start"};var endEvent={type:"end"};_this2.handleResize=function(){if(this.domElement===document){this.screen.left=0;this.screen.top=0;this.screen.width=window.innerWidth;this.screen.height=window.innerHeight}else{var box=this.domElement.getBoundingClientRect();var d=this.domElement.ownerDocument.documentElement;this.screen.left=box.left+window.pageXOffset-d.clientLeft;this.screen.top=box.top+window.pageYOffset-d.clientTop;this.screen.width=box.width;this.screen.height=box.height}this.radius=.5*Math.min(this.screen.width,this.screen.height);this.left0=this.object.left;this.right0=this.object.right;this.top0=this.object.top;this.bottom0=this.object.bottom};_this2.handleEvent=function(event){if(typeof this[event.type]=="function"){this[event.type](event)}};var getMouseOnScreen=function(){var vector=new THREE.Vector2;return function getMouseOnScreen(pageX,pageY){vector.set((pageX-_this.screen.left)/_this.screen.width,(pageY-_this.screen.top)/_this.screen.height);return vector}}();_this2.zoomCamera=function(){if(_state===STATE.TOUCH_ZOOM_PAN){var factor=_touchZoomDistanceEnd/_touchZoomDistanceStart;_touchZoomDistanceStart=_touchZoomDistanceEnd;_this.object.zoom*=factor;_changed=true}else{var factor=1+(_zoomEnd.y-_zoomStart.y)*_this.zoomSpeed;if(Math.abs(factor-1)>EPS&&factor>0){_this.object.zoom/=factor;if(_this.staticMoving){_zoomStart.copy(_zoomEnd)}else{_zoomStart.y+=(_zoomEnd.y-_zoomStart.y)*this.dynamicDampingFactor}_changed=true}}};_this2.panCamera=function(){var mouseChange=new THREE.Vector2,objectUp=new THREE.Vector3,pan=new THREE.Vector3;return function panCamera(){mouseChange.copy(_panEnd).sub(_panStart);if(mouseChange.lengthSq()){var scale_x=(_this.object.right-_this.object.left)/_this.object.zoom;var scale_y=(_this.object.top-_this.object.bottom)/_this.object.zoom;mouseChange.x*=scale_x;mouseChange.y*=scale_y;pan.copy(_eye).cross(_this.object.up).setLength(mouseChange.x);pan.add(objectUp.copy(_this.object.up).setLength(mouseChange.y));_this.object.position.add(pan);_this.target.add(pan);if(_this.staticMoving){_panStart.copy(_panEnd)}else{_panStart.add(mouseChange.subVectors(_panEnd,_panStart).multiplyScalar(_this.dynamicDampingFactor))}_changed=true}}}();_this2.update=function(){_eye.subVectors(_this.object.position,_this.target);if(!_this.noZoom){_this.zoomCamera();if(_changed){_this.object.updateProjectionMatrix()}}if(!_this.noPan){_this.panCamera()}_this.object.position.addVectors(_this.target,_eye);_this.object.lookAt(_this.target);if(_changed){_this.dispatchEvent(changeEvent);_changed=false}};_this2.reset=function(){_state=STATE.NONE;_prevState=STATE.NONE;_this.target.copy(_this.target0);_this.object.position.copy(_this.position0);_this.object.up.copy(_this.up0);_eye.subVectors(_this.object.position,_this.target);_this.object.left=_this.left0;_this.object.right=_this.right0;_this.object.top=_this.top0;_this.object.bottom=_this.bottom0;_this.object.lookAt(_this.target);_this.dispatchEvent(changeEvent);_changed=false};function keydown(event){ +if(_this.enabled===false)return;window.removeEventListener("keydown",keydown);_prevState=_state;if(_state!==STATE.NONE){return}else if(event.keyCode===_this.keys[STATE.ROTATE]&&!_this.noRotate){_state=STATE.ROTATE}else if(event.keyCode===_this.keys[STATE.ZOOM]&&!_this.noZoom){_state=STATE.ZOOM}else if(event.keyCode===_this.keys[STATE.PAN]&&!_this.noPan){_state=STATE.PAN}}function keyup(event){if(_this.enabled===false)return;_state=_prevState;window.addEventListener("keydown",keydown,false)}function mousedown(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_state===STATE.NONE){_state=event.button}if(_state===STATE.ROTATE&&!_this.noRotate){}else if(_state===STATE.ZOOM&&!_this.noZoom){_zoomStart.copy(getMouseOnScreen(event.pageX,event.pageY));_zoomEnd.copy(_zoomStart)}else if(_state===STATE.PAN&&!_this.noPan){_panStart.copy(getMouseOnScreen(event.pageX,event.pageY));_panEnd.copy(_panStart)}document.addEventListener("mousemove",mousemove,false);document.addEventListener("mouseup",mouseup,false);_this.dispatchEvent(startEvent)}function mousemove(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();if(_state===STATE.ROTATE&&!_this.noRotate){}else if(_state===STATE.ZOOM&&!_this.noZoom){_zoomEnd.copy(getMouseOnScreen(event.pageX,event.pageY))}else if(_state===STATE.PAN&&!_this.noPan){_panEnd.copy(getMouseOnScreen(event.pageX,event.pageY))}}function mouseup(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();_state=STATE.NONE;document.removeEventListener("mousemove",mousemove);document.removeEventListener("mouseup",mouseup);_this.dispatchEvent(endEvent)}function mousewheel(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();var delta=0;if(event.wheelDelta){delta=event.wheelDelta/40}else if(event.detail){delta=-event.detail/3}_this.dispatchEvent({type:"OnScroll",delta:delta});_this.dispatchEvent(startEvent);_this.dispatchEvent(endEvent)}function touchstart(event){if(_this.enabled===false)return;switch(event.touches.length){case 1:_state=STATE.TOUCH_ROTATE;break;case 2:_state=STATE.TOUCH_ZOOM_PAN;var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=_touchZoomDistanceStart=Math.sqrt(dx*dx+dy*dy);var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panStart.copy(getMouseOnScreen(x,y));_panEnd.copy(_panStart);break;default:_state=STATE.NONE}_this.dispatchEvent(startEvent)}function touchmove(event){if(_this.enabled===false)return;event.preventDefault();event.stopPropagation();switch(event.touches.length){case 1:break;case 2:var dx=event.touches[0].pageX-event.touches[1].pageX;var dy=event.touches[0].pageY-event.touches[1].pageY;_touchZoomDistanceEnd=Math.sqrt(dx*dx+dy*dy);var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));break;default:_state=STATE.NONE}}function touchend(event){if(_this.enabled===false)return;switch(event.touches.length){case 1:break;case 2:_touchZoomDistanceStart=_touchZoomDistanceEnd=0;var x=(event.touches[0].pageX+event.touches[1].pageX)/2;var y=(event.touches[0].pageY+event.touches[1].pageY)/2;_panEnd.copy(getMouseOnScreen(x,y));_panStart.copy(_panEnd);break}_state=STATE.NONE;_this.dispatchEvent(endEvent)}function contextmenu(event){event.preventDefault()}_this2.dispose=function(){this.domElement.removeEventListener("contextmenu",contextmenu,false);this.domElement.removeEventListener("mousedown",mousedown,false);this.domElement.removeEventListener("mousewheel",mousewheel,false);this.domElement.removeEventListener("MozMousePixelScroll",mousewheel,false);this.domElement.removeEventListener("touchstart",touchstart,false);this.domElement.removeEventListener("touchend",touchend,false);this.domElement.removeEventListener("touchmove",touchmove,false);document.removeEventListener("mousemove",mousemove,false);document.removeEventListener("mouseup",mouseup,false);window.removeEventListener("keydown",keydown,false);window.removeEventListener("keyup",keyup,false)};_this2.domElement.addEventListener("contextmenu",contextmenu,false);_this2.domElement.addEventListener("mousedown",mousedown,false);_this2.domElement.addEventListener("mousewheel",mousewheel,false);_this2.domElement.addEventListener("MozMousePixelScroll",mousewheel,false);_this2.domElement.addEventListener("touchstart",touchstart,false);_this2.domElement.addEventListener("touchend",touchend,false);_this2.domElement.addEventListener("touchmove",touchmove,false);window.addEventListener("keydown",keydown,false);window.addEventListener("keyup",keyup,false);_this2.handleResize();_this2.update();return _this2}return Trackballortho}(THREE.EventDispatcher);exports.default=Trackballortho},{}],92:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i.008856){y=Math.pow(y,3)}else{y=(y-16/116)/7.787}if(Math.pow(x,3)>.008856){x=Math.pow(x,3)}else{x=(x-16/116)/7.787}if(Math.pow(z,3)>.008856){z=Math.pow(z,3)}else{z=(z-16/116)/7.787}return[refX*x,refY*y,refZ*z]}},{key:"xyz2RGB",value:function xyz2RGB(x,y,z){x/=100;y/=100;z/=100;var r=x*3.2406+y*-1.5372+z*-.4986;var g=x*-.9689+y*1.8758+z*.0415;var b=x*.0557+y*-.204+z*1.057;if(r>.0031308){r=1.055*Math.pow(r,1/2.4)-.055}else{r=12.92*r}if(g>.0031308){g=1.055*Math.pow(g,1/2.4)-.055}else{g=12.92*g}if(b>.0031308){b=1.055*Math.pow(b,1/2.4)-.055}else{b=12.92*b}r=r*255;g=g*255;b=b*255;return[r,g,b]}},{key:"cielab2RGB",value:function cielab2RGB(){var l=arguments.length>0&&arguments[0]!==undefined?arguments[0]:50;var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var b=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;if(!(l>=0&&l<=100)){return null}var xyz=this.cielab2XYZ(l,a,b);return this.xyz2RGB.apply(this,_toConsumableArray(xyz))}}]);return Colors}();exports.default=Colors},{}],93:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i=bbox.min.x-epsilon&&point.y>=bbox.min.y-epsilon&&point.z>=bbox.min.z-epsilon&&point.x<=bbox.max.x+epsilon&&point.y<=bbox.max.y+epsilon&&point.z<=bbox.max.z+epsilon){return true}return false}},{key:"posdir",value:function posdir(position,direction){return{position:position,direction:direction}}},{key:"validatePlane",value:function validatePlane(plane){if(plane===null){window.console.log("Invalid plane.");window.console.log(plane);return false}if(!_core4.default.vector3(plane.position)){window.console.log("Invalid plane.position.");window.console.log(plane.position);return false}if(!_core4.default.vector3(plane.direction)){window.console.log("Invalid plane.direction.");window.console.log(plane.direction);return false}return true}},{key:"validateAabb",value:function validateAabb(aabb){if(aabb===null){window.console.log("Invalid aabb.");window.console.log(aabb);return false}if(!_core4.default.matrix4(aabb.toAABB)){window.console.log("Invalid aabb.toAABB: ");window.console.log(aabb.toAABB);return false}if(!_core4.default.vector3(aabb.center)){window.console.log("Invalid aabb.center.");window.console.log(aabb.center);return false}if(!(_core4.default.vector3(aabb.halfDimensions)&&aabb.halfDimensions.x>=0&&aabb.halfDimensions.y>=0&&aabb.halfDimensions.z>=0)){window.console.log("Invalid aabb.halfDimensions.");window.console.log(aabb.halfDimensions);return false}return true}}]);return Intersections}();exports.default=Intersections},{"./core.utils":96,"./core.validators":97}],94:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _core=require("./core.colors");var _core2=_interopRequireDefault(_core);var _core3=require("./core.intersections");var _core4=_interopRequireDefault(_core3);var _core5=require("./core.pack");var _core6=_interopRequireDefault(_core5);var _core7=require("./core.validators");var _core8=_interopRequireDefault(_core7);var _core9=require("./core.utils");var _core10=_interopRequireDefault(_core9);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Colors:_core2.default,Intersections:_core4.default,Utils:_core10.default,Validators:_core8.default}},{"./core.colors":92,"./core.intersections":93,"./core.pack":95,"./core.utils":96,"./core.validators":97}],95:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var Pack=function Pack(){_classCallCheck(this,Pack)};exports.default=Pack},{}],96:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i=0&&halfDimensions.y>=0&&halfDimensions.z>=0)){window.console.log("halfDimensions must be >= 0.");window.console.log(halfDimensions);return false}var min=center.clone().sub(halfDimensions);var max=center.clone().add(halfDimensions);return{min:min,max:max}}},{key:"minMaxPixelData",value:function minMaxPixelData(){var pixelData=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var minMax=[65535,-32768];var numPixels=pixelData.length;for(var index=0;index=0&&objectToTest.halfDimensions.y>=0&&objectToTest.halfDimensions.z>=0)){return false}return true}},{key:"ray",value:function ray(objectToTest){if(!(objectToTest!==null&&typeof objectToTest!=="undefined"&&objectToTest.hasOwnProperty("position")&&this.vector3(objectToTest.position)&&objectToTest.hasOwnProperty("direction")&&this.vector3(objectToTest.direction))){return false}return true}}]);return Validators}();exports.default=Validators},{}],98:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _geometries=require("./geometries.slice");var _geometries2=_interopRequireDefault(_geometries);var _geometries3=require("./geometries.voxel");var _geometries4=_interopRequireDefault(_geometries3);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Slice:_geometries2.default,Voxel:_geometries4.default}},{"./geometries.slice":99,"./geometries.voxel":100}],99:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i4&&arguments[4]!==undefined?arguments[4]:new THREE.Matrix4;_classCallCheck(this,GeometriesSlice);var aabb={halfDimensions:halfDimensions,center:center,toAABB:toAABB};var plane={position:position,direction:direction};var intersections=_core2.default.aabbPlane(aabb,plane);if(intersections.length<3){window.console.log("WARNING: Less than 3 intersections between AABB and Plane.");window.console.log("AABB");window.console.log(aabb);window.console.log("Plane");window.console.log(plane);window.console.log("exiting...");throw"geometries.slice has less than 3 intersections, can not create a valid geometry."}var orderedIntersections=GeometriesSlice.orderIntersections(intersections,direction);var sliceShape=GeometriesSlice.shape(orderedIntersections);var _this=_possibleConstructorReturn(this,(GeometriesSlice.__proto__||Object.getPrototypeOf(GeometriesSlice)).call(this,sliceShape));_this.type="SliceGeometry";_this.vertices=orderedIntersections;_this.verticesNeedUpdate=true;return _this}_createClass(GeometriesSlice,null,[{key:"shape",value:function shape(points){var shape=new THREE.Shape;shape.moveTo(points[0].xy.x,points[0].xy.y);for(var l=1;l1&&arguments[1]!==undefined?arguments[1]:"default";var lutO=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"linear";var color=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[[0,0,0,0],[1,1,1,1]];var opacity=arguments.length>4&&arguments[4]!==undefined?arguments[4]:[[0,0],[1,1]];var discrete=arguments.length>5&&arguments[5]!==undefined?arguments[5]:false;_classCallCheck(this,HelpersLut);this._containerID=containerID;this._discrete=discrete;this._color=color;this._lut=lut;this._luts=_defineProperty({},lut,color);this._opacity=opacity;this._lutO=lutO;this._lutsO=_defineProperty({},lutO,opacity);this.initCanvas();this.paintCanvas()}_createClass(HelpersLut,[{key:"initCanvas",value:function initCanvas(){this._canvasContainer=this.initCanvasContainer(this._containerID);this._canvasBg=this.createCanvas();this._canvasContainer.appendChild(this._canvasBg);this._canvas=this.createCanvas();this._canvasContainer.appendChild(this._canvas)}},{key:"initCanvasContainer",value:function initCanvasContainer(canvasContainerId){var canvasContainer=document.getElementById(canvasContainerId);canvasContainer.style.width="256 px";canvasContainer.style.height="128 px";canvasContainer.style.border="1px solid #F9F9F9";return canvasContainer}},{key:"createCanvas",value:function createCanvas(){var canvas=document.createElement("canvas");canvas.height=16;canvas.width=256;return canvas}},{key:"paintCanvas",value:function paintCanvas(){var ctx=this._canvas.getContext("2d");ctx.clearRect(0,0,this._canvas.width,this._canvas.height);ctx.globalCompositeOperation="source-over";if(!this._discrete){var color=ctx.createLinearGradient(0,0,this._canvas.width,this._canvas.height);for(var i=0;i0){previousPos=this._color[_i-1][0]}var from=previousPos+(currentPos-previousPos)/2;var to=currentPos+(nextPos-currentPos)/2;var _color=this._color[_i];var opacity=this._opacity[_i]?this._opacity[_i][1]:1;ctx.beginPath();ctx.strokeStyle="rgba( "+Math.round(_color[1]*255)+", "+Math.round(_color[2]*255)+", "+Math.round(_color[3]*255)+", "+opacity+")";ctx.moveTo(from*this._canvas.width,0);ctx.lineTo(to*this._canvas.width,0);ctx.stroke();ctx.closePath()}}if(!this._discrete){ctx.globalCompositeOperation="destination-in";var _opacity=ctx.createLinearGradient(0,0,this._canvas.width,this._canvas.height);for(var _i2=0;_i20&&arguments[0]!==undefined?arguments[0]:"color";var available=[];var luts=this._luts;if(type!=="color"){luts=this._lutsO}for(var i in luts){available.push(i)}return available}},{key:"texture",get:function get(){var texture=new THREE.Texture(this._canvas);texture.mapping=THREE.UVMapping;texture.wrapS=texture.wrapT=THREE.ClampToEdgeWrapping;texture.magFilter=texture.minFilter=THREE.NearestFilter;texture.premultiplyAlpha=true;texture.needsUpdate=true;return texture}},{key:"lut",set:function set(targetLUT){this._color=this._luts[targetLUT];this._lut=targetLUT;this.paintCanvas()},get:function get(){return this._lut}},{key:"luts",set:function set(newLuts){this._luts=newLuts},get:function get(){return this._luts}},{key:"lutO",set:function set(targetLUTO){this._opacity=this._lutsO[targetLUTO];this._lutO=targetLUTO;this.paintCanvas()},get:function get(){return this._lutO}},{key:"lutsO",set:function set(newLutsO){this._lutsO=newLutsO},get:function get(){return this._lutsO}},{key:"discrete",set:function set(discrete){this._discrete=discrete;this.paintCanvas()},get:function get(){return this._discrete}}],[{key:"presetLuts",value:function presetLuts(){return{default:[[0,0,0,0],[1,1,1,1]],spectrum:[[0,0,0,0],[.1,0,0,1],[.33,0,1,1],[.5,0,1,0],[.66,1,1,0],[.9,1,0,0],[1,1,1,1]],hot_and_cold:[[0,0,0,1],[.15,0,1,1],[.3,0,1,0],[.45,0,0,0],[.5,0,0,0],[.55,0,0,0],[.7,1,1,0],[.85,1,0,0],[1,1,1,1]],gold:[[0,0,0,0],[.13,.19,.03,0],[.25,.39,.12,0],[.38,.59,.26,0],[.5,.8,.46,.08],[.63,.99,.71,.21],[.75,.99,.88,.34],[.88,.99,.99,.48],[1,.9,.95,.61]],red:[[0,.75,0,0],[.5,1,.5,0],[.95,1,1,0],[1,1,1,1]],green:[[0,0,.75,0],[.5,.5,1,0],[.95,1,1,0],[1,1,1,1]],blue:[[0,0,0,1],[.5,0,.5,1],[.95,0,1,1],[1,1,1,1]],walking_dead:[[0,.1,1,1],[1,1,1,1]],random:[[0,0,0,0],[.27,.18,.18,.18],[.41,1,1,1],[.7,1,0,0],[1,1,1,1]]}}},{key:"presetLutsO",value:function presetLutsO(){return{linear:[[0,0],[1,1]],lowpass:[[0,.8],[.2,.6],[.3,.1],[1,0]],bandpass:[[0,0],[.4,.8],[.6,.8],[1,0]],highpass:[[0,0],[.7,.1],[.8,.6],[1,.8]],flat:[[0,.7],[1,1]],random:[[0,0],[.38,0],[.55,1],[.72,1],[1,.05]]}}}]);return HelpersLut}();exports.default=HelpersLut},{}],105:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0){progressContainers[0].parentNode.removeChild(progressContainers[0])}progressContainers=null;window.cancelAnimationFrame(this.requestAnimationFrameID)}},{key:"init",value:function init(){var progressContainer=this._domContainer();for(var mode in this._modes){if(this._modes.hasOwnProperty(mode)){var bar=this._domBar(this._modes[mode]);progressContainer.appendChild(bar);bar=null}}this._container.appendChild(progressContainer);progressContainer=null;this.updateUI()}},{key:"update",value:function update(value,total,mode){this._mode=mode;this._value=value;if(total===0){this._total=value;this._value=Math.random()*value}else{this._total=total}}},{key:"updateUI",value:function updateUI(){var _this=this;this.requestAnimationFrameID=requestAnimationFrame(function(){_this.updateUI()});if(!(this._modes.hasOwnProperty(this._mode)&&this._modes[this._mode].hasOwnProperty("name")&&this._modes[this._mode].hasOwnProperty("color"))){return false}var message="";var progress=Math.round(this._value/this._total*100);var color=this._modes[this._mode].color;var progressBar=this._container.getElementsByClassName("progress "+this._modes[this._mode].name);if(progressBar.length>0){progressBar[0].style.borderColor=color;progressBar[0].style.width=progress+"%"}progressBar=null}},{key:"_domContainer",value:function _domContainer(){var container=document.createElement("div");container.classList.add("progress");container.classList.add("container");container.style.width="100%";container.style.height="8px";container.style.position="absolute";container.style.backgroundColor="rgba(158, 158, 158, 0.5)";container.style.top="0";container.style.zIndex="1";return container}},{key:"_domBar",value:function _domBar(mode){if(!(mode.hasOwnProperty("name")&&mode.hasOwnProperty("color"))){window.console.log("Invalid mode provided.");window.console.log(mode);return false}var bar=document.createElement("div");bar.classList.add(mode.name);bar.classList.add("progress");bar.style.border="2px solid "+mode.color;bar.style.width="0%";return bar}}]);return HelpersProgressBar}();exports.default=HelpersProgressBar},{}],107:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i1&&arguments[1]!==undefined?arguments[1]:0;var position=arguments.length>2&&arguments[2]!==undefined?arguments[2]:new THREE.Vector3(0,0,0);var direction=arguments.length>3&&arguments[3]!==undefined?arguments[3]:new THREE.Vector3(0,0,1);var aabbSpace=arguments.length>4&&arguments[4]!==undefined?arguments[4]:"IJK";_classCallCheck(this,HelpersSlice);var _this=_possibleConstructorReturn(this,(HelpersSlice.__proto__||Object.getPrototypeOf(HelpersSlice)).call(this));_this._stack=stack;_this._invert=_this._stack.invert;_this._lut="none";_this._lutTexture=null;_this._intensityAuto=true;_this._interpolation=1;_this._index=index;_this._windowWidth=null;_this._windowCenter=null;_this._rescaleSlope=null;_this._rescaleIntercept=null;_this._planePosition=position;_this._planeDirection=direction;_this._aaBBspace=aabbSpace;_this._material=null;_this._textures=[];_this._shadersFragment=_shadersData6.default;_this._shadersVertex=_shadersData4.default;_this._uniforms=_shadersData2.default.uniforms();_this._geometry=null;_this._mesh=null;_this._visible=true;_this._init();_this._create();return _this}_createClass(HelpersSlice,[{key:"_init",value:function _init(){if(!this._stack||!this._stack._prepared||!this._stack._packed){return}if(this._aaBBspace==="IJK"){this._halfDimensions=this._stack.halfDimensionsIJK;this._center=new THREE.Vector3(this._stack.halfDimensionsIJK.x-.5,this._stack.halfDimensionsIJK.y-.5,this._stack.halfDimensionsIJK.z-.5);this._toAABB=new THREE.Matrix4}else{var aaBBox=this._stack.AABBox();this._halfDimensions=aaBBox.clone().multiplyScalar(.5);this._center=this._stack.centerAABBox();this._toAABB=this._stack.lps2AABB}}},{key:"_create",value:function _create(){if(!this._stack||!this._stack.prepared||!this._stack.packed){return}try{this._geometry=new _geometries2.default(this._halfDimensions,this._center,this._planePosition,this._planeDirection,this._toAABB)}catch(e){window.console.log(e);window.console.log("invalid slice geometry - exiting...");return}if(!this._geometry.vertices){return}if(!this._material){this._uniforms.uTextureSize.value=this._stack.textureSize;this._uniforms.uDataDimensions.value=[this._stack.dimensionsIJK.x,this._stack.dimensionsIJK.y,this._stack.dimensionsIJK.z];this._uniforms.uWorldToData.value=this._stack.lps2IJK;this._uniforms.uNumberOfChannels.value=this._stack.numberOfChannels;this._uniforms.uPixelType.value=this._stack.pixelType;this._uniforms.uBitsAllocated.value=this._stack.bitsAllocated;this._uniforms.uPackedPerPixel.value=this._stack.packedPerPixel;this._prepareTexture();this._uniforms.uTextureContainer.value=this._textures;this._createMaterial({side:THREE.DoubleSide})}this.updateIntensitySettings();this.updateIntensitySettingsUniforms();this._mesh=new THREE.Mesh(this._geometry,this._material);if(this._aaBBspace==="IJK"){this._mesh.applyMatrix(this._stack.ijk2LPS)}this._mesh.visible=this._visible;this.add(this._mesh)}},{key:"updateIntensitySettings",value:function updateIntensitySettings(){if(this._intensityAuto){this.updateIntensitySetting("windowCenter");this.updateIntensitySetting("windowWidth");this.updateIntensitySetting("rescaleSlope");this.updateIntensitySetting("rescaleIntercept")}else{if(this._windowCenter===null){this._windowCenter=this._stack.windowCenter}if(this.__windowWidth===null){this._windowWidth=this._stack.windowWidth}if(this._rescaleSlope===null){this._rescaleSlope=this._stack.rescaleSlope}if(this._rescaleIntercept===null){this._rescaleIntercept=this._stack.rescaleIntercept}}}},{key:"updateIntensitySettingsUniforms",value:function updateIntensitySettingsUniforms(){this._uniforms.uRescaleSlopeIntercept.value=[this._rescaleSlope,this._rescaleIntercept];this._uniforms.uWindowCenterWidth.value=[this._windowCenter,this._windowWidth];this._uniforms.uInvert.value=this._invert===true?1:0;this._uniforms.uInterpolation.value=this._interpolation;if(this._lut==="none"){this._uniforms.uLut.value=0}else{this._uniforms.uLut.value=1;this._uniforms.uTextureLUT.value=this._lutTexture}}},{key:"updateIntensitySetting",value:function updateIntensitySetting(setting){if(this._stack.frame[this._index]&&this._stack.frame[this._index][setting]){this["_"+setting]=this._stack.frame[this._index][setting]}else{this["_"+setting]=this._stack[setting]}}},{key:"_update",value:function _update(){if(this._mesh){this.remove(this._mesh);this._mesh.geometry.dispose();this._mesh.geometry=null;this._mesh=null}this._create()}},{key:"stack",get:function get(){return this._stack},set:function set(stack){this._stack=stack}},{key:"windowWidth",get:function get(){return this._windowWidth},set:function set(windowWidth){this._windowWidth=windowWidth;this.updateIntensitySettingsUniforms()}},{key:"windowCenter",get:function get(){return this._windowCenter},set:function set(windowCenter){this._windowCenter=windowCenter;this.updateIntensitySettingsUniforms()}},{key:"rescaleSlope",get:function get(){return this._rescaleSlope},set:function set(rescaleSlope){this._rescaleSlope=rescaleSlope;this.updateIntensitySettingsUniforms()}},{key:"rescaleIntercept",get:function get(){return this._rescaleIntercept},set:function set(rescaleIntercept){this._rescaleIntercept=rescaleIntercept;this.updateIntensitySettingsUniforms()}},{key:"invert",get:function get(){return this._invert},set:function set(invert){this._invert=invert;this.updateIntensitySettingsUniforms()}},{key:"lut",get:function get(){return this._lut},set:function set(lut){this._lut=lut}},{key:"lutTexture",get:function get(){return this._lutTexture},set:function set(lutTexture){this._lutTexture=lutTexture;this.updateIntensitySettingsUniforms()}},{key:"intensityAuto",get:function get(){return this._intensityAuto},set:function set(intensityAuto){this._intensityAuto=intensityAuto;this.updateIntensitySettings();this.updateIntensitySettingsUniforms()}},{key:"interpolation",get:function get(){return this._interpolation},set:function set(interpolation){this._interpolation=interpolation;this.updateIntensitySettingsUniforms();this._updateMaterial()}},{key:"index",get:function get(){return this._index},set:function set(index){this._index=index;this._update()}},{key:"planePosition",set:function set(position){this._planePosition=position;this._update()},get:function get(){return this._planePosition}},{key:"planeDirection",set:function set(direction){this._planeDirection=direction;this._update()},get:function get(){return this._planeDirection}},{key:"halfDimensions",set:function set(halfDimensions){this._halfDimensions=halfDimensions},get:function get(){return this._halfDimensions}},{key:"center",set:function set(center){this._center=center},get:function get(){return this._center}},{key:"aabbSpace",set:function set(aabbSpace){this._aaBBspace=aabbSpace;this._init()},get:function get(){return this._aaBBspace}},{key:"mesh",set:function set(mesh){this._mesh=mesh},get:function get(){return this._mesh}},{key:"geometry",set:function set(geometry){this._geometry=geometry},get:function get(){return this._geometry}}]);return HelpersSlice}((0,_helpersMaterial2.default)(THREE.Object3D));exports.default=HelpersSlice},{"../../src/geometries/geometries.slice":99,"../../src/helpers/helpers.material.mixin":105,"../../src/shaders/shaders.data.fragment":132,"../../src/shaders/shaders.data.uniform":133,"../../src/shaders/shaders.data.vertex":134}],108:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i=dimensions||this._index<0){this._outOfBounds=true}else{this._outOfBounds=false}}},{key:"_prepareStack",value:function _prepareStack(){if(!this._stack.prepared){this._stack.prepare()}if(!this._stack.packed){this._stack.pack()}}},{key:"_prepareBBox",value:function _prepareBBox(){this._bBox=new _helpers4.default(this._stack);this.add(this._bBox)}},{key:"_prepareBorder",value:function _prepareBorder(){this._border=new _helpers2.default(this._slice);this.add(this._border)}},{key:"_prepareSlice",value:function _prepareSlice(){var halfDimensionsIJK=this._stack.halfDimensionsIJK;this._index=this._prepareSliceIndex(halfDimensionsIJK);var position=this._prepareSlicePosition(halfDimensionsIJK,this._index);var direction=this._prepareDirection(this._orientation);this._slice=new _helpers6.default(this._stack,this._index,position,direction);this.add(this._slice)}},{key:"_prepareSliceIndex",value:function _prepareSliceIndex(indices){var index=0;switch(this._orientation){case 0:index=Math.floor(indices.z);break;case 1:index=Math.floor(indices.x);break;case 2:index=Math.floor(indices.y);break;default:break}return index}},{key:"_prepareSlicePosition",value:function _prepareSlicePosition(rPosition,index){var position=new THREE.Vector3(0,0,0);switch(this._orientation){case 0:position=new THREE.Vector3(Math.floor(rPosition.x),Math.floor(rPosition.y),index);break;case 1:position=new THREE.Vector3(index,Math.floor(rPosition.y),Math.floor(rPosition.z));break;case 2:position=new THREE.Vector3(Math.floor(rPosition.x),index,Math.floor(rPosition.z));break;default:break}return position}},{key:"_prepareDirection",value:function _prepareDirection(orientation){var direction=new THREE.Vector3(0,0,1);switch(orientation){case 0:direction=new THREE.Vector3(0,0,1);break;case 1:direction=new THREE.Vector3(1,0,0);break;case 2:direction=new THREE.Vector3(0,1,0);break;default:break}return direction}},{key:"stack",get:function get(){return this._stack}},{key:"bbox",get:function get(){return this._bBox}},{key:"slice",get:function get(){ +return this._slice}},{key:"border",get:function get(){return this._border}},{key:"index",get:function get(){return this._index},set:function set(index){this._index=index;this._slice.index=index;var halfDimensions=this._stack.halfDimensionsIJK;this._slice.planePosition=this._prepareSlicePosition(halfDimensions,this._index);this._border.helpersSlice=this._slice;this._isIndexOutOfBounds()}},{key:"orientation",set:function set(orientation){this._orientation=orientation;this._slice.planeDirection=this._prepareDirection(this._orientation);this._border.helpersSlice=this._slice},get:function get(){return this._orientation}},{key:"outOfBounds",set:function set(outOfBounds){this._outOfBounds=outOfBounds},get:function get(){return this._outOfBounds}}]);return HelpersStack}(THREE.Object3D);exports.default=HelpersStack},{"../../src/helpers/helpers.border":101,"../../src/helpers/helpers.boundingbox":102,"../../src/helpers/helpers.slice":107}],109:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:null;var stack=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;_classCallCheck(this,HelpersVoxel);var _this=_possibleConstructorReturn(this,(HelpersVoxel.__proto__||Object.getPrototypeOf(HelpersVoxel)).call(this));_this._stack=stack;_this._worldCoordinates=worldCoordinates;_this._voxel=new _models4.default;_this._voxel.id=_this.id;_this._voxel.worldCoordinates=_this._worldCoordinates;if(_this._stack&&_this._stack.prepared&&_this._worldCoordinates){_this.updateVoxel(_this._worldCoordinates)}_this._mesh=null;_this._geometry=null;_this._material=null;_this._selected=false;_this._active=false;_this._hover=false;_this._distance=null;_this._showVoxel=true;_this._showDomSVG=true;_this._showDomMeasurements=true;_this._color="#00B0FF";_this._svgPointer=' ';_this.createMesh();return _this}_createClass(HelpersVoxel,[{key:"updateVoxel",value:function updateVoxel(worldCoordinates){this._voxel.worldCoordinates=worldCoordinates;this._voxel.dataCoordinates=_models2.default.worldToData(this._stack,this._voxel.worldCoordinates);var value=_models2.default.value(this._stack,this._voxel.dataCoordinates);this._voxel.value=_models2.default.valueRescaleSlopeIntercept(value,this._stack.rescaleSlope,this._stack.rescaleIntercept)}},{key:"updateVoxelScreenCoordinates",value:function updateVoxelScreenCoordinates(camera,container){this._voxel.screenCoordinates=HelpersVoxel.worldToScreen(this._worldCoordinates,camera,container)}},{key:"createMesh",value:function createMesh(){var dataCoordinates=_models2.default.worldToData(this._stack,this._worldCoordinates);this._geometry=new _geometries2.default(dataCoordinates);this._material=new THREE.MeshBasicMaterial({wireframe:true,wireframeLinewidth:2});this._material.color.set(this._color);this._mesh=new THREE.Mesh(this._geometry,this._material);this._mesh.applyMatrix(this._stack.ijk2LPS);this._mesh.visible=this._showVoxel;this.add(this._mesh)}},{key:"createDom",value:function createDom(){var measurementsContainer=this._createDiv("VJSVoxelMeasurements",this.id,"VJSVoxelMeasurements");var rasContainer=this._createDiv("VJSVoxelProbeWorld",this.id,"VJSVoxelProbeWorld");measurementsContainer.appendChild(rasContainer);var ijkContainer=this._createDiv("VJSVoxelProbeData",this.id,"VJSVoxelProbeData");measurementsContainer.appendChild(ijkContainer);var valueContainer=this._createDiv("VJSVoxelProbeValue",this.id,"VJSVoxelProbeValue");measurementsContainer.appendChild(valueContainer);var svgContainer=this._createDiv("VJSVoxelProbeSVG",this.id,"VJSVoxelProbeSVG");svgContainer.innerHTML=this._svgPointer;var domElement=this._createDiv("VJSWidgetVoxelProbe",this.id,"VJSWidgetVoxelProbe");domElement.appendChild(svgContainer);domElement.appendChild(measurementsContainer);return domElement}},{key:"updateDom",value:function updateDom(container){if(document.getElementById("VJSVoxelProbeWorld"+this.id)===null){container.appendChild(this.createDom())}var rasContainer=document.getElementById("VJSVoxelProbeWorld"+this.id);var rasContent=this._voxel.worldCoordinates.x.toFixed(2)+" : "+this._voxel.worldCoordinates.y.toFixed(2)+" : "+this._voxel.worldCoordinates.z.toFixed(2);rasContainer.innerHTML="LPS: "+rasContent;var ijkContainer=document.getElementById("VJSVoxelProbeData"+this.id);var ijkContent=this._voxel.dataCoordinates.x+" : "+this._voxel.dataCoordinates.y+" : "+this._voxel.dataCoordinates.z;ijkContainer.innerHTML="IJK: "+ijkContent;var valueContainer=document.getElementById("VJSVoxelProbeValue"+this.id);var valueContent=this._voxel.value;valueContainer.innerHTML="Value: "+valueContent;var selectedElement=document.getElementById("VJSWidgetVoxelProbe"+this.id);selectedElement.style.top=this._voxel.screenCoordinates.y;selectedElement.style.left=this._voxel.screenCoordinates.x;this.updateDomClass(selectedElement)}},{key:"updateDomClass",value:function updateDomClass(){var element=document.getElementById("VJSWidgetVoxelProbe"+this.id);if(this._active===true){element.classList.add("VJSVoxelProbeActive")}else{element.classList.remove("VJSVoxelProbeActive")}if(this._hover===true){element.classList.add("VJSVoxelProbeHover")}else{element.classList.remove("VJSVoxelProbeHover")}if(this._selected===true){element.classList.add("VJSVoxelProbeSelect")}else{element.classList.remove("VJSVoxelProbeSelect")}this.updateDomElementDisplay("VJSVoxelMeasurements"+this.id,this._showDomMeasurements);this.updateDomElementDisplay("VJSVoxelProbeSVG"+this.id,this._showDomSVG)}},{key:"updateDomElementDisplay",value:function updateDomElementDisplay(id,show){if(show){document.getElementById(id).style.display="block"}else{document.getElementById(id).style.display="none"}}},{key:"removeTest",value:function removeTest(){var node=document.getElementById("VJSWidgetVoxelProbe"+this.id);if(node.parentNode){node.parentNode.removeChild(node)}this.remove(this._mesh);this._mesh.geometry.dispose();this._mesh.material.dispose();this._mesh=null}},{key:"_createDiv",value:function _createDiv(idPrefix,idSuffix,className){var divContainer=document.createElement("div");divContainer.setAttribute("id",idPrefix+idSuffix);divContainer.setAttribute("class",className);return divContainer}},{key:"color",set:function set(color){this._color=color;if(this._material){this._material.color.set(this._color)}var selectedElement=document.getElementById("VJSVoxelMeasurements"+this.id);if(selectedElement){selectedElement.style.borderColor=this._color.replace("0x","#")}selectedElement=document.querySelector("#VJSVoxelProbeSVG"+this.id+"> svg > path");if(selectedElement){selectedElement.style.stroke=this._color.replace("0x","#")}},get:function get(){return this._color}},{key:"worldCoordinates",set:function set(worldCoordinates){this._worldCoordinates=worldCoordinates;this._voxel._worldCoordinates=worldCoordinates;this.updateVoxel(this._worldCoordinates);if(this._mesh&&this._mesh.geometry){this._mesh.geometry.location=this._voxel.dataCoordinates}},get:function get(){return this._worldCoordinates}},{key:"voxel",get:function get(){return this._voxel},set:function set(voxel){this._voxel=voxel}},{key:"showVoxel",set:function set(showVoxel){this._showVoxel=showVoxel;if(this._mesh){this._mesh.visible=this._showVoxel}},get:function get(){return this._showVoxel}},{key:"showDomSVG",set:function set(showDomSVG){this._showDomSVG=showDomSVG;this.updateDomClass()},get:function get(){return this._showDomSVG}},{key:"showDomMeasurements",set:function set(showDomMeasurements){this._showDomMeasurements=showDomMeasurements;this.updateDomClass()},get:function get(){return this._showDomMeasurements}},{key:"distance",set:function set(distance){this._distance=distance},get:function get(){return this._distance}},{key:"selected",set:function set(selected){this._selected=selected},get:function get(){return this._selected}},{key:"hover",set:function set(hover){this._hover=hover},get:function get(){return this._hover}},{key:"active",set:function set(active){this._active=active},get:function get(){return this._active}}],[{key:"worldToScreen",value:function worldToScreen(worldCoordinate,camera,canvas){var screenCoordinates=worldCoordinate.clone();screenCoordinates.project(camera);screenCoordinates.x=Math.round((screenCoordinates.x+1)*canvas.offsetWidth/2);screenCoordinates.y=Math.round((-screenCoordinates.y+1)*canvas.offsetHeight/2);screenCoordinates.z=0;return screenCoordinates}}]);return HelpersVoxel}(THREE.Object3D);exports.default=HelpersVoxel},{"../../src/geometries/geometries.voxel":100,"../../src/models/models.stack":118,"../../src/models/models.voxel":119}],111:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:document.body;var helpersProgress=arguments.length>1&&arguments[1]!==undefined?arguments[1]:_helpers2.default;_classCallCheck(this,LoadersBase);this._loaded=-1;this._totalLoaded=-1;this._parsed=-1;this._totalParsed=-1;this._container=container;this._helpersProgressBar=helpersProgress;this._progressBar=null;if(this._container&&this._helpersProgressBar){this._progressBar=new helpersProgress(this._container)}}_createClass(LoadersBase,[{key:"free",value:function free(){this._container=null;this._helpersProgressBar=null;if(this._progressBar){this._progressBar.free();this._progressBar=null}}},{key:"fetch",value:function fetch(url){var _this=this;return new Promise(function(resolve,reject){var request=new XMLHttpRequest;request.open("GET",url);request.crossOrigin=true;request.responseType="arraybuffer";request.onload=function(event){if(request.status===200){_this._loaded=event.loaded;_this._totalLoaded=event.total;if(_this._progressBar){_this._progressBar.update(_this._loaded,_this._totalLoaded,"load")}var buffer=request.response;var response={url:url,buffer:buffer};resolve(response)}else{reject(request.statusText)}};request.onerror=function(){reject(request.statusText)};request.onprogress=function(event){_this._loaded=event.loaded;_this._totalLoaded=event.total;if(_this._progressBar){_this._progressBar.update(_this._loaded,_this._totalLoaded,"load")}};request.send()})}}]);return LoadersBase}();exports.default=LoadersBase},{"../../src/helpers/helpers.progressbar":106,"../../src/models/models.frame":115,"../../src/models/models.series":117,"../../src/models/models.stack":118}],112:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _loaders=require("./loaders.volume");var _loaders2=_interopRequireDefault(_loaders);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Volume:_loaders2.default}},{"./loaders.volume":113}],113:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&yCos.length()>0){cosines[0]=xCos;cosines[1]=yCos;cosines[2]=new THREE.Vector3(0,0,0).crossVectors(cosines[0],cosines[1]).normalize()}}else{window.console.log("No valid image orientation for frame");window.console.log(this);window.console.log("Returning default orientation.")}if(!this._rightHanded){cosines[2].negate()}return cosines}},{key:"spacingXY",value:function spacingXY(){var spacingXY=[1,1];if(this.pixelSpacing){spacingXY[0]=this.pixelSpacing[0];spacingXY[1]=this.pixelSpacing[1]}else if(this.pixelAspectRatio){spacingXY[0]=1;spacingXY[1]=1*this.pixelAspectRatio[1]/this.pixelAspectRatio[0]}return spacingXY}},{key:"value",value:function value(column,row){return this.pixelData[column+this._columns*row]}},{key:"_compareArrays",value:function _compareArrays(reference,target){if(reference===target){return true}if(reference&&target&&reference.join()===target.join()){return true}return false}},{key:"rows",get:function get(){return this._rows},set:function set(rows){this._rows=rows}},{key:"columns",get:function get(){return this._columns},set:function set(columns){this._columns=columns}},{key:"spacingBetweenSlices",get:function get(){return this._spacingBetweenSlices},set:function set(spacingBetweenSlices){this._spacingBetweenSlices=spacingBetweenSlices}},{key:"sliceThickness",get:function get(){return this._sliceThickness},set:function set(sliceThickness){this._sliceThickness=sliceThickness}},{key:"imagePosition",get:function get(){return this._imagePosition},set:function set(imagePosition){this._imagePosition=imagePosition}},{key:"imageOrientation",get:function get(){return this._imageOrientation},set:function set(imageOrientation){this._imageOrientation=imageOrientation}},{key:"windowWidth",get:function get(){return this._windowWidth},set:function set(windowWidth){this._windowWidth=windowWidth}},{key:"windowCenter",get:function get(){return this._windowCenter},set:function set(windowCenter){this._windowCenter=windowCenter}},{key:"rescaleSlope",get:function get(){return this._rescaleSlope},set:function set(rescaleSlope){this._rescaleSlope=rescaleSlope}},{key:"rescaleIntercept",get:function get(){return this._rescaleIntercept},set:function set(rescaleIntercept){this._rescaleIntercept=rescaleIntercept}},{key:"bitsAllocated",get:function get(){return this._bitsAllocated},set:function set(bitsAllocated){this._bitsAllocated=bitsAllocated}},{key:"dist",get:function get(){return this._dist},set:function set(dist){this._dist=dist}},{key:"pixelSpacing",get:function get(){return this._pixelSpacing},set:function set(pixelSpacing){this._pixelSpacing=pixelSpacing}},{key:"pixelAspectRatio",get:function get(){return this._pixelAspectRatio},set:function set(pixelAspectRatio){this._pixelAspectRatio=pixelAspectRatio}},{key:"minMax",get:function get(){return this._minMax},set:function set(minMax){this._minMax=minMax}},{key:"dimensionIndexValues",get:function get(){return this._dimensionIndexValues},set:function set(dimensionIndexValues){this._dimensionIndexValues=dimensionIndexValues}},{key:"instanceNumber",get:function get(){return this._instanceNumber},set:function set(instanceNumber){this._instanceNumber=instanceNumber}},{key:"pixelData",get:function get(){return this._pixelData},set:function set(pixelData){this._pixelData=pixelData}},{key:"sopInstanceUID",set:function set(sopInstanceUID){this._sopInstanceUID=sopInstanceUID},get:function get(){return this._sopInstanceUID}},{key:"pixelType",get:function get(){return this._pixelType},set:function set(pixelType){this._pixelType=pixelType}},{key:"url",get:function get(){return this._url},set:function set(url){this._url=url}},{key:"referencedSegmentNumber",get:function get(){return this._referencedSegmentNumber},set:function set(referencedSegmentNumber){this._referencedSegmentNumber=referencedSegmentNumber}},{key:"rightHanded",get:function get(){return this._rightHanded},set:function set(rightHanded){this._rightHanded=rightHanded}}]);return ModelsFrame}(_models2.default);exports.default=ModelsFrame},{"../../src/models/models.base":114}],116:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _models=require("./models.frame");var _models2=_interopRequireDefault(_models);var _models3=require("./models.stack");var _models4=_interopRequireDefault(_models3);var _models5=require("./models.series");var _models6=_interopRequireDefault(_models5);var _models7=require("./models.voxel");var _models8=_interopRequireDefault(_models7);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Frame:_models2.default,Stack:_models4.default,Series:_models6.default,Voxel:_models8.default}},{"./models.frame":115,"./models.series":117,"./models.stack":118,"./models.voxel":119}],117:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0){this._numberOfFrames=this._frame.length}else{window.console.log("_frame doesn't contain anything....");window.console.log(this._frame);return false}this._rows=this._frame[0].rows;this._columns=this._frame[0].columns;this._dimensionsIJK=new THREE.Vector3(this._columns,this._rows,this._numberOfFrames);this._halfDimensionsIJK=new THREE.Vector3(this._dimensionsIJK.x/2,this._dimensionsIJK.y/2,this._dimensionsIJK.z/2);this._spacingBetweenSlices=this._frame[0].spacingBetweenSlices;this._sliceThickness=this._frame[0].sliceThickness;this.computeCosines();this.orderFrames();this.computeSpacing();if(!this._frame[0].imagePosition){this._frame[0].imagePosition=[0,0,0]}if(!this._frame[0].imageOrientation){this._frame[0].imageOrientation=[1,0,0,0,1,0]}this._origin=this._vector3FromArray(this._frame[0].imagePosition,0);this.computeIJK2LPS();this.computeLPS2AABB();this._rescaleSlope=this._frame[0].rescaleSlope||1;this._rescaleIntercept=this._frame[0].rescaleIntercept||0;this.computeMinMaxIntensities();this._minMax[0]=ModelsStack.valueRescaleSlopeIntercept(this._minMax[0],this._rescaleSlope,this._rescaleIntercept);this._minMax[1]=ModelsStack.valueRescaleSlopeIntercept(this._minMax[1],this._rescaleSlope,this._rescaleIntercept);var width=this._frame[0].windowWidth||this._minMax[1]-this._minMax[0];this._windowWidth=this._rescaleSlope*width+this._rescaleIntercept;var center=this._frame[0].windowCenter||this._minMax[0]+width/2;this._windowCenter=this._rescaleSlope*center+this._rescaleIntercept;this._bitsAllocated=this._frame[0].bitsAllocated;this._prepared=true}},{key:"packEchos",value:function packEchos(){var echos=4;var packedEcho=[];for(var i=0;i1){if(this._spacingBetweenSlices){this._spacing.z=this._spacingBetweenSlices}else if(this._frame[0].pixelSpacing&&this._frame[0].pixelSpacing[2]){this._spacing.z=this._frame[0].pixelSpacing[2]}else{this._frame.map(this._computeDistanceArrayMap.bind(null,this._zCosine));this._frame.sort(this._sortDistanceArraySort);this._spacing.z=this._frame[1].dist-this._frame[0].dist}}if(this._spacing.z===0){this._spacing.z=1}}},{key:"xySpacing",value:function xySpacing(){if(this._frame&&this._frame[0]){var spacingXY=this._frame[0].spacingXY();this._spacing.x=spacingXY[0];this._spacing.y=spacingXY[1]}}},{key:"computeMinMaxIntensities",value:function computeMinMaxIntensities(){for(var i=0;inbVoxels){voxelIndexStop=nbVoxels}for(var ii=0;iinbVoxels){voxelIndexStop=nbVoxels}}this._packed=true}},{key:"_packTo8Bits",value:function _packTo8Bits(bits,pixelType,channels,frame,textureSize,startVoxel,stopVoxel){var packed={textureType:null,data:null};var packIndex=0;var frameIndex=0;var inFrameIndex=0;var frameDimension=frame[0].rows*frame[0].columns;var data=null;if(bits===8&&channels===1||bits===1){var _data=new Uint8Array(textureSize*textureSize*1);for(var i=startVoxel;i>>8&255;packIndex++;coordinate=Math.floor(packIndex/2);channelOffset=packIndex%2}packed.textureType=THREE.RGBAFormat;packed.data=_data2}else if(bits===32&&channels===1&&pixelType===0){var _data3=new Uint8Array(textureSize*textureSize*4);for(var _i4=startVoxel;_i4>>8&255;_data3[4*packIndex+2]=_raw>>>8&255;_data3[4*packIndex+3]=_raw>>>8&255;packIndex++}packed.textureType=THREE.RGBAFormat;packed.data=_data3}else if(bits===32&&channels===1&&pixelType===1){var _data4=new Uint8Array(textureSize*textureSize*4);for(var _i5=startVoxel;_i5parseInt(b.dimensionIndexValues[i],10)){return 1}if(parseInt(a.dimensionIndexValues[i],10)=0&&ijkCoordinate.z=0&&index.y>=0&&index.z>=0&&index.x0){segmentationCodeDesignator=element.items[0].dataSet.string("x00080102");segmentationCodeValue=element.items[0].dataSet.string("x00080100");segmentationCodeMeaning=element.items[0].dataSet.string("x00080104")}return{segmentationCodeDesignator:segmentationCodeDesignator,segmentationCodeValue:segmentationCodeValue,segmentationCodeMeaning:segmentationCodeMeaning}}},{key:"_recommendedDisplayCIELab",value:function _recommendedDisplayCIELab(segment){if(!segment.dataSet.elements.x0062000d){return null}var offset=segment.dataSet.elements.x0062000d.dataOffset;var length=segment.dataSet.elements.x0062000d.length;var byteArray=segment.dataSet.byteArray.slice(offset,offset+length);var CIELabScaled=new Uint16Array(length/2);for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:0;var sopInstanceUID=this._findStringEverywhere("x2005140f","x00080018",frameIndex);return sopInstanceUID}},{key:"transferSyntaxUID",value:function transferSyntaxUID(){return this._dataSet.string("x00020010")}},{key:"photometricInterpretation",value:function photometricInterpretation(){return this._dataSet.string("x00280004")}},{key:"planarConfiguration",value:function planarConfiguration(){var planarConfiguration=this._dataSet.uint16("x00280006");if(typeof planarConfiguration==="undefined"){planarConfiguration=null}return planarConfiguration}},{key:"samplesPerPixel",value:function samplesPerPixel(){return this._dataSet.uint16("x00280002")}},{key:"numberOfFrames",value:function numberOfFrames(){var numberOfFrames=this._dataSet.intString("x00280008");if(typeof numberOfFrames==="undefined"){numberOfFrames=null}return numberOfFrames}},{key:"numberOfChannels",value:function numberOfChannels(){var numberOfChannels=1;var photometricInterpretation=this.photometricInterpretation();if(!(photometricInterpretation!=="RGB"&&photometricInterpretation!=="PALETTE COLOR"&&photometricInterpretation!=="YBR_FULL"&&photometricInterpretation!=="YBR_FULL_422"&&photometricInterpretation!=="YBR_PARTIAL_422"&&photometricInterpretation!=="YBR_PARTIAL_420"&&photometricInterpretation!=="YBR_RCT")){numberOfChannels=3}return numberOfChannels}},{key:"invert",value:function invert(){var photometricInterpretation=this.photometricInterpretation();return photometricInterpretation==="MONOCHROME1"?true:false}},{key:"imageOrientation",value:function imageOrientation(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var imageOrientation=this._findStringEverywhere("x00209116","x00200037",frameIndex);if(imageOrientation){imageOrientation=imageOrientation.split("\\").map(Number)}return imageOrientation}},{key:"referencedSegmentNumber",value:function referencedSegmentNumber(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var referencedSegmentNumber=-1;var referencedSegmentNumberElement=this._findInGroupSequence("x52009230","x0062000a",frameIndex);if(referencedSegmentNumberElement!==null){referencedSegmentNumber=referencedSegmentNumberElement.uint16("x0062000b")}return referencedSegmentNumber}},{key:"pixelAspectRatio",value:function pixelAspectRatio(){var pixelAspectRatio=[this._dataSet.intString("x00280034",0),this._dataSet.intString("x00280034",1)];if(typeof pixelAspectRatio[0]==="undefined"){pixelAspectRatio=null}return pixelAspectRatio}},{key:"imagePosition",value:function imagePosition(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var imagePosition=this._findStringEverywhere("x00209113","x00200032",frameIndex);if(imagePosition){imagePosition=imagePosition.split("\\").map(Number)}return imagePosition}},{key:"instanceNumber",value:function instanceNumber(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var instanceNumber=null;var perFrameFunctionnalGroupSequence=this._dataSet.elements.x52009230;if(typeof perFrameFunctionnalGroupSequence!=="undefined"){if(perFrameFunctionnalGroupSequence.items[frameIndex].dataSet.elements.x2005140f){var planeOrientationSequence=perFrameFunctionnalGroupSequence.items[frameIndex].dataSet.elements.x2005140f.items[0].dataSet;instanceNumber=planeOrientationSequence.intString("x00200013")}else{instanceNumber=this._dataSet.intString("x00200013");if(typeof instanceNumber==="undefined"){instanceNumber=null}}}else{instanceNumber=this._dataSet.intString("x00200013");if(typeof instanceNumber==="undefined"){instanceNumber=null}}return instanceNumber}},{key:"pixelSpacing",value:function pixelSpacing(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var pixelSpacing=this._findStringEverywhere("x00289110","x00280030",frameIndex);if(pixelSpacing){pixelSpacing=pixelSpacing.split("\\").map(Number)}return pixelSpacing}},{key:"rows",value:function rows(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var rows=this._dataSet.uint16("x00280010");if(typeof rows==="undefined"){rows=null}return rows}},{key:"columns",value:function columns(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var columns=this._dataSet.uint16("x00280011");if(typeof columns==="undefined"){columns=null}return columns}},{key:"pixelType",value:function pixelType(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return 0}},{key:"pixelRepresentation",value:function pixelRepresentation(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var pixelRepresentation=this._dataSet.uint16("x00280103");return pixelRepresentation}},{key:"bitsAllocated",value:function bitsAllocated(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var bitsAllocated=this._dataSet.uint16("x00280100");return bitsAllocated}},{key:"highBit",value:function highBit(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var highBit=this._dataSet.uint16("x00280102");return highBit}},{key:"rescaleIntercept",value:function rescaleIntercept(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._findFloatStringInFrameGroupSequence("x00289145","x00281052",frameIndex)}},{key:"rescaleSlope",value:function rescaleSlope(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._findFloatStringInFrameGroupSequence("x00289145","x00281053",frameIndex)}},{key:"windowCenter",value:function windowCenter(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._findFloatStringInFrameGroupSequence("x00289132","x00281050",frameIndex)}},{key:"windowWidth",value:function windowWidth(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._findFloatStringInFrameGroupSequence("x00289132","x00281051",frameIndex)}},{key:"sliceThickness",value:function sliceThickness(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._findFloatStringInFrameGroupSequence("x00289110","x00180050",frameIndex)}},{key:"dimensionIndexValues",value:function dimensionIndexValues(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var dimensionIndexValues=[];var perFrameFunctionnalGroupSequence=this._dataSet.elements.x52009230;if(typeof perFrameFunctionnalGroupSequence!=="undefined"){var philipsPrivateSequence=perFrameFunctionnalGroupSequence.items[frameIndex].dataSet.elements.x00209111.items[0].dataSet;var element=philipsPrivateSequence.elements.x00209157;var nbValues=element.length/4;for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:0;var inStackPositionNumber=null;var perFrameFunctionnalGroupSequence=this._dataSet.elements.x52009230;if(typeof perFrameFunctionnalGroupSequence!=="undefined"){var philipsPrivateSequence=perFrameFunctionnalGroupSequence.items[frameIndex].dataSet.elements.x00209111.items[0].dataSet;inStackPositionNumber=philipsPrivateSequence.uint32("x00209057")}else{inStackPositionNumber=null}console.log("instack position "+inStackPositionNumber);return inStackPositionNumber}},{key:"stackID",value:function stackID(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var stackID=null;var perFrameFunctionnalGroupSequence=this._dataSet.elements.x52009230;if(typeof perFrameFunctionnalGroupSequence!=="undefined"){var philipsPrivateSequence=perFrameFunctionnalGroupSequence.items[frameIndex].dataSet.elements.x00209111.items[0].dataSet;stackID=philipsPrivateSequence.intString("x00209056")}else{stackID=null}return stackID}},{key:"extractPixelData",value:function extractPixelData(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var decompressedData=this._decodePixelData(frameIndex);var numberOfChannels=this.numberOfChannels();if(numberOfChannels>1){return this._convertColorSpace(decompressedData)}else{return decompressedData}}},{key:"minMaxPixelData",value:function minMaxPixelData(){var pixelData=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var minMax=[65535,-32768];var numPixels=pixelData.length;for(var index=0;index0&&arguments[0]!==undefined?arguments[0]:0;var transferSyntaxUID=this.transferSyntaxUID();if(transferSyntaxUID==="1.2.840.10008.1.2.4.90"||transferSyntaxUID==="1.2.840.10008.1.2.4.91"){return this._decodeJ2K(frameIndex)}else if(transferSyntaxUID==="1.2.840.10008.1.2.4.57"||transferSyntaxUID==="1.2.840.10008.1.2.4.70"){return this._decodeJPEGLossless(frameIndex)}else if(transferSyntaxUID==="1.2.840.10008.1.2.4.50"||transferSyntaxUID==="1.2.840.10008.1.2.4.51"){return this._decodeJPEGBaseline(frameIndex)}else if(transferSyntaxUID==="1.2.840.10008.1.2"||transferSyntaxUID==="1.2.840.10008.1.2.1"){return this._decodeUncompressed(frameIndex)}else if(transferSyntaxUID==="1.2.840.10008.1.2.2"){var frame=this._decodeUncompressed(frameIndex);return this._swapFrame(frame)}else{throw"no decoder for transfer syntax "+transferSyntaxUID}}},{key:"_decodeJ2K",value:function _decodeJ2K(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var encodedPixelData=DicomParser.readEncapsulatedPixelData(this._dataSet,this._dataSet.elements.x7fe00010,frameIndex);var jpxImage=new Jpx;jpxImage.parse(encodedPixelData);var componentsCount=jpxImage.componentsCount;if(componentsCount!==1){throw"JPEG2000 decoder returned a componentCount of ${componentsCount}, when 1 is expected"}var tileCount=jpxImage.tiles.length;if(tileCount!==1){throw"JPEG2000 decoder returned a tileCount of ${tileCount}, when 1 is expected"}var tileComponents=jpxImage.tiles[0];var pixelData=tileComponents.items;return pixelData}},{key:"_decodeJPEGLossless",value:function _decodeJPEGLossless(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var encodedPixelData=DicomParser.readEncapsulatedPixelData(this._dataSet,this._dataSet.elements.x7fe00010,frameIndex);var pixelRepresentation=this.pixelRepresentation(frameIndex);var bitsAllocated=this.bitsAllocated(frameIndex);var byteOutput=bitsAllocated<=8?1:2;var decoder=new Jpeg.lossless.Decoder;var decompressedData=decoder.decode(encodedPixelData.buffer,encodedPixelData.byteOffset,encodedPixelData.length,byteOutput);if(pixelRepresentation===0){if(byteOutput===2){return new Uint16Array(decompressedData.buffer)}else{return new Uint8Array(decompressedData.buffer)}}else{return new Int16Array(decompressedData.buffer)}}},{key:"_decodeJPEGBaseline",value:function _decodeJPEGBaseline(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var encodedPixelData=DicomParser.readEncapsulatedPixelData(this._dataSet,this._dataSet.elements.x7fe00010,frameIndex);var rows=this.rows(frameIndex);var columns=this.columns(frameIndex);var bitsAllocated=this.bitsAllocated(frameIndex);var jpegBaseline=new JpegBaseline;jpegBaseline.parse(encodedPixelData);if(bitsAllocated===8){return jpegBaseline.getData(columns,rows)}else if(bitsAllocated===16){return jpegBaseline.getData16(columns,rows)}}},{key:"_decodeUncompressed",value:function _decodeUncompressed(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var pixelRepresentation=this.pixelRepresentation(frameIndex);var bitsAllocated=this.bitsAllocated(frameIndex);var pixelDataElement=this._dataSet.elements.x7fe00010;var pixelDataOffset=pixelDataElement.dataOffset;var numberOfChannels=this.numberOfChannels();var numPixels=this.rows(frameIndex)*this.columns(frameIndex)*numberOfChannels;var frameOffset=0;var buffer=this._dataSet.byteArray.buffer;if(pixelRepresentation===0&&bitsAllocated===8){frameOffset=pixelDataOffset+frameIndex*numPixels;return new Uint8Array(buffer,frameOffset,numPixels)}else if(pixelRepresentation===0&&bitsAllocated===16){frameOffset=pixelDataOffset+frameIndex*numPixels*2;return new Uint16Array(buffer,frameOffset,numPixels)}else if(pixelRepresentation===1&&bitsAllocated===16){frameOffset=pixelDataOffset+frameIndex*numPixels*2;return new Int16Array(buffer,frameOffset,numPixels)}else if(pixelRepresentation===0&&bitsAllocated===32){frameOffset=pixelDataOffset+frameIndex*numPixels*4;return new Uint32Array(buffer,frameOffset,numPixels)}else if(pixelRepresentation===0&&bitsAllocated===1){var newBuffer=new ArrayBuffer(numPixels);var newArray=new Uint8Array(newBuffer);frameOffset=pixelDataOffset+frameIndex*numPixels;var index=0;var bitStart=frameIndex*numPixels;var bitEnd=frameIndex*numPixels+numPixels;var byteStart=Math.floor(bitStart/8);var bitStartOffset=bitStart-byteStart*8;var byteEnd=Math.ceil(bitEnd/8);var targetBuffer=new Uint8Array(buffer,pixelDataOffset);for(var i=byteStart;i<=byteEnd;i++){while(bitStartOffset<8){switch(bitStartOffset){case 0:newArray[index]=targetBuffer[i]&1;break;case 1:newArray[index]=targetBuffer[i]>>>1&1;break;case 2:newArray[index]=targetBuffer[i]>>>2&1;break;case 3:newArray[index]=targetBuffer[i]>>>3&1;break;case 4:newArray[index]=targetBuffer[i]>>>4&1;break;case 5:newArray[index]=targetBuffer[i]>>>5&1;break;case 6:newArray[index]=targetBuffer[i]>>>6&1;break;case 7:newArray[index]=targetBuffer[i]>>>7&1;break;default:break}bitStartOffset++;index++;if(index>=numPixels){return newArray}}bitStartOffset=0}}}},{key:"_convertColorSpace",value:function _convertColorSpace(uncompressedData){var rgbData=null;var photometricInterpretation=this.photometricInterpretation();var planarConfiguration=this.planarConfiguration();if(photometricInterpretation==="RGB"&&planarConfiguration===0){rgbData=uncompressedData}else if(photometricInterpretation==="RGB"&&planarConfiguration===1){if(uncompressedData instanceof Int8Array){rgbData=new Int8Array(uncompressedData.length)}else if(uncompressedData instanceof Uint8Array){rgbData=new Uint8Array(uncompressedData.length)}else if(uncompressedData instanceof Int16Array){rgbData=new Int16Array(uncompressedData.length)}else if(uncompressedData instanceof Uint16Array){rgbData=new Uint16Array(uncompressedData.length)}else{throw"unsuported typed array: ${uncompressedData}"}var numPixels=uncompressedData.length/3;var rgbaIndex=0;var rIndex=0;var gIndex=numPixels;var bIndex=numPixels*2;for(var i=0;i=5){numberOfChannels=this._dataSet.dims[5];this._ordered=false}else if(this._dataSet.datatypeCode===128){numberOfChannels=3}else if(this._dataSet.datatypeCode===2304){numberOfChannels=4}return numberOfChannels}},{key:"sopInstanceUID",value:function sopInstanceUID(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return frameIndex}},{key:"rows",value:function rows(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.dims[2]}},{key:"columns",value:function columns(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.dims[1]}},{key:"pixelType",value:function pixelType(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var pixelType=0;if(this._dataSet.datatypeCode===16||this._dataSet.datatypeCode===64||this._dataSet.datatypeCode===1536){pixelType=1}return pixelType}},{key:"bitsAllocated",value:function bitsAllocated(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.numBitsPerVoxel}},{key:"pixelSpacing",value:function pixelSpacing(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return[this._dataSet.pixDims[1],this._dataSet.pixDims[2],this._dataSet.pixDims[3]]}},{key:"sliceThickness",value:function sliceThickness(){return null}},{key:"imageOrientation",value:function imageOrientation(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;if(this._dataSet.qform_code>0){var a=0,b=this._dataSet.quatern_b,c=this._dataSet.quatern_c,d=this._dataSet.quatern_d;a=1-(b*b+c*c+d*d);if(a<1e-7){a=1/Math.sqrt(b*b+c*c+d*d);b*=a;c*=a;d*=a;a=0}else{a=Math.sqrt(a)}if(this._dataSet.pixDims[0]<0){this._rightHanded=false}return[-(a*a+b*b-c*c-d*d),-2*(b*c+a*d),2*(b*d-a*c),-2*(b*c-a*d),-(a*a+c*c-b*b-d*d),2*(c*d+a*b)]}else if(this._dataSet.sform_code>0){console.log("sform > 0");var sx=this._dataSet.srow_x,sy=this._dataSet.srow_y,sz=this._dataSet.srow_z}else if(this._dataSet.qform_code===0){console.log("qform === 0")}return[1,0,0,0,1,0]}},{key:"imagePosition",value:function imagePosition(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return[-this._dataSet.qoffset_x,-this._dataSet.qoffset_y,this._dataSet.qoffset_z]}},{key:"dimensionIndexValues",value:function dimensionIndexValues(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"instanceNumber",value:function instanceNumber(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return frameIndex}},{key:"windowCenter",value:function windowCenter(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"windowWidth",value:function windowWidth(){ +var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"rescaleSlope",value:function rescaleSlope(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.scl_slope}},{key:"rescaleIntercept",value:function rescaleIntercept(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.scl_intercept}},{key:"minMaxPixelData",value:function minMaxPixelData(){var pixelData=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var minMax=[65535,-32768];var numPixels=pixelData.length;for(var index=0;index0&&arguments[0]!==undefined?arguments[0]:0;return this._decompressUncompressed(frameIndex)}},{key:"_decompressUncompressed",value:function _decompressUncompressed(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var numberOfChannels=this.numberOfChannels();var numPixels=this.rows(frameIndex)*this.columns(frameIndex)*numberOfChannels;var frameOffset=frameIndex*numPixels;var buffer=this._niftiImage;if(!this._ordered&&this._orderedData===null){this._reorderData()}if(this._orderedData!==null){return this._orderedData.slice(frameOffset,frameOffset+numPixels)}else if(this._dataSet.datatypeCode===2){return new Uint8Array(buffer,frameOffset,numPixels)}else if(this._dataSet.datatypeCode===256){return new Int8Array(buffer,frameOffset,numPixels)}else if(this._dataSet.datatypeCode===512){frameOffset=frameOffset*2;return new Uint16Array(buffer,frameOffset,numPixels)}else if(this._dataSet.datatypeCode===4){frameOffset=frameOffset*2;return new Int16Array(buffer,frameOffset,numPixels)}else if(this._dataSet.datatypeCode===16){frameOffset=frameOffset*4;return new Float32Array(buffer,frameOffset,numPixels)}}},{key:"_reorderData",value:function _reorderData(){window.console.log("re-order");var numberOfChannels=this.numberOfChannels();var numPixels=this.rows()*this.columns()*numberOfChannels;var buffer=this._niftiImage;var totalNumPixels=numPixels*this.numberOfFrames();var tmp=null;this._orderedData=null;if(this._dataSet.datatypeCode===2){tmp=new Uint8Array(buffer,0,totalNumPixels);this._orderedData=new Uint8Array(tmp.length)}else if(this._dataSet.datatypeCode===256){tmp=new Int8Array(buffer,0,totalNumPixels);this._orderedData=new Int8Array(tmp.length)}else if(this._dataSet.datatypeCode===512){tmp=new Uint16Array(buffer,0,totalNumPixels);this._orderedData=new Uint16Array(tmp.length)}else if(this._dataSet.datatypeCode===4){tmp=new Int16Array(buffer,0,totalNumPixels);this._orderedData=new Int16Array(tmp.length)}else if(this._dataSet.datatypeCode===16){tmp=new Float32Array(buffer,0,totalNumPixels);this._orderedData=new Float32Array(tmp.length)}var numPixels2=tmp.length/3;var rgbaIndex=0;var rIndex=0;var gIndex=numPixels2;var bIndex=numPixels2*2;for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:0;return frameIndex}},{key:"rows",value:function rows(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.sizes[1]}},{key:"columns",value:function columns(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this._dataSet.sizes[0]}},{key:"pixelType",value:function pixelType(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var pixelType=0;if(this._dataSet.type==="float"){pixelType=1}return pixelType}},{key:"bitsAllocated",value:function bitsAllocated(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var bitsAllocated=1;if(this._dataSet.type==="int8"||this._dataSet.type==="uint8"||this._dataSet.type==="char"){bitsAllocated=8}else if(this._dataSet.type==="int16"||this._dataSet.type==="uint16"||this._dataSet.type==="short"){bitsAllocated=16}else if(this._dataSet.type==="int32"||this._dataSet.type==="uint32"||this._dataSet.type==="float"){bitsAllocated=32}return bitsAllocated}},{key:"pixelSpacing",value:function pixelSpacing(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var x=new THREE.Vector3(this._dataSet.spaceDirections[0][0],this._dataSet.spaceDirections[0][1],this._dataSet.spaceDirections[0][2]);var y=new THREE.Vector3(this._dataSet.spaceDirections[1][0],this._dataSet.spaceDirections[1][1],this._dataSet.spaceDirections[1][2]);var z=new THREE.Vector3(this._dataSet.spaceDirections[2][0],this._dataSet.spaceDirections[2][1],this._dataSet.spaceDirections[2][2]);return[x.length(),y.length(),z.length()]}},{key:"sliceThickness",value:function sliceThickness(){return null}},{key:"imageOrientation",value:function imageOrientation(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var invertX=this._dataSet.space.match(/right/)?-1:1;var invertY=this._dataSet.space.match(/anterior/)?-1:1;var x=new THREE.Vector3(this._dataSet.spaceDirections[0][0]*invertX,this._dataSet.spaceDirections[0][1]*invertY,this._dataSet.spaceDirections[0][2]);x.normalize();var y=new THREE.Vector3(this._dataSet.spaceDirections[1][0]*invertX,this._dataSet.spaceDirections[1][1]*invertY,this._dataSet.spaceDirections[1][2]);y.normalize();return[x.x,x.y,x.z,y.x,y.y,y.z]}},{key:"imagePosition",value:function imagePosition(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return[this._dataSet.spaceOrigin[0],this._dataSet.spaceOrigin[1],this._dataSet.spaceOrigin[2]]}},{key:"dimensionIndexValues",value:function dimensionIndexValues(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"instanceNumber",value:function instanceNumber(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return frameIndex}},{key:"windowCenter",value:function windowCenter(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"windowWidth",value:function windowWidth(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return null}},{key:"rescaleSlope",value:function rescaleSlope(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return 1}},{key:"rescaleIntercept",value:function rescaleIntercept(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return 0}},{key:"minMaxPixelData",value:function minMaxPixelData(){var pixelData=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var minMax=[65535,-32768];var numPixels=pixelData.length;for(var index=0;index0&&arguments[0]!==undefined?arguments[0]:0;return this._decompressUncompressed(frameIndex)}},{key:"_decompressUncompressed",value:function _decompressUncompressed(){var frameIndex=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var buffer=this._dataSet.buffer;var numberOfChannels=this.numberOfChannels();var numPixels=this.rows(frameIndex)*this.columns(frameIndex)*numberOfChannels;if(!this.rightHanded()){frameIndex=this.numberOfFrames()-1-frameIndex}var frameOffset=frameIndex*numPixels;if(this._unpackedData===null&&this._dataSet.encoding==="gzip"){var unpackedData=pako.inflate(this._dataSet.buffer);this._unpackedData=unpackedData.buffer;buffer=this._unpackedData}else if(this._dataSet.encoding==="gzip"){buffer=this._unpackedData}if(this._dataSet.type==="int8"||this._dataSet.type==="char"){frameOffset=frameOffset;return new Int8Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="uint8"){frameOffset=frameOffset;return new Uint8Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="int16"||this._dataSet.type==="short"){frameOffset=frameOffset*2;return new Int16Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="uint16"){frameOffset=frameOffset*2;return new Uint16Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="int32"){frameOffset=frameOffset*4;return new Int32Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="uint32"){frameOffset=frameOffset*4;return new Uint32Array(buffer,frameOffset,numPixels)}else if(this._dataSet.type==="float"){frameOffset=frameOffset*4;return new Float32Array(buffer,frameOffset,numPixels)}}}]);return ParsersNifti}(_parsers2.default);exports.default=ParsersNifti},{"./parsers.volume":124,"nrrd-js":50,pako:51}],124:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i>8&255}},{key:"_swap32",value:function _swap32(val){return(val&255)<<24|(val&65280)<<8|val>>8&65280|val>>24&255}},{key:"invert",value:function invert(){return false}}]);return ParsersVolume}();exports.default=ParsersVolume},{}],125:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:this._base;var rayOrigin=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this._rayOrigin;var rayDirection=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this._rayDirection;var aabbMin=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this._aabbMin;var aabbMax=arguments.length>4&&arguments[4]!==undefined?arguments[4]:this._aabbMax;var tNear=arguments.length>5&&arguments[5]!==undefined?arguments[5]:this._tNear;var tFar=arguments.length>6&&arguments[6]!==undefined?arguments[6]:this._tFar;var intersect=arguments.length>7&&arguments[7]!==undefined?arguments[7]:this._intersect;this._base=baseFragment;return this.compute(rayOrigin,rayDirection,aabbMin,aabbMax,tNear,tFar,intersect)}},{key:"compute",value:function compute(rayOrigin,rayDirection,aabbMin,aabbMax,tNear,tFar,intersect){this.computeDefinition();this._base._functions[this._name]=this._definition;return this._name+"("+rayOrigin+", "+rayDirection+", "+aabbMin+", "+aabbMax+", "+tNear+", "+tFar+", "+intersect+");"}},{key:"computeDefinition",value:function computeDefinition(){this._definition="\nvoid "+this._name+"(vec3 rayOrigin, vec3 rayDirection, vec3 boxMin, vec3 boxMax, out float tNear, out float tFar, out bool intersect){\n // compute intersection of ray with all six bbox planes\n vec3 invRay = vec3(1.) / rayDirection;\n vec3 tBot = invRay * (boxMin - rayOrigin);\n vec3 tTop = invRay * (boxMax - rayOrigin);\n // re-order intersections to find smallest and largest on each axis\n vec3 tMin = min(tTop, tBot);\n vec3 tMax = max(tTop, tBot);\n // find the largest tMin and the smallest tMax\n float largest_tMin = max(max(tMin.x, tMin.y), max(tMin.x, tMin.z));\n float smallest_tMax = min(min(tMax.x, tMax.y), min(tMax.x, tMax.z));\n tNear = largest_tMin;\n tFar = smallest_tMax;\n intersect = smallest_tMax > largest_tMin;\n}\n\n "}}]);return IntersectBox}(_shaders2.default);exports.default=new IntersectBox},{"../shaders.base":131}],126:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:this._base;var dataCoordinates=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this._dataCoordinates;var dataValue=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this._dataValue;var offset=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this._offset;this._base=baseFragment;return this.compute(dataCoordinates,dataValue,offset)}},{key:"compute",value:function compute(dataCoordinates,dataValue,offset){this.computeDefinition();this._base._functions[this._name]=this._definition;return this._name+"("+dataCoordinates+", "+dataValue+", "+offset+");"}},{key:"computeDefinition",value:function computeDefinition(){this._definition="\nvoid "+this._name+"(in ivec3 dataCoordinates, out vec4 dataValue, out int offset){\n \n int index = dataCoordinates.x\n + dataCoordinates.y * uDataDimensions.x\n + dataCoordinates.z * uDataDimensions.y * uDataDimensions.x;\n int indexP = int(index/uPackedPerPixel);\n offset = index - 2*indexP;\n\n // Map data index to right sampler2D texture\n int voxelsPerTexture = uTextureSize*uTextureSize;\n int textureIndex = int(floor(float(indexP) / float(voxelsPerTexture)));\n // modulo seems incorrect sometimes...\n // int inTextureIndex = int(mod(float(index), float(textureSize*textureSize)));\n int inTextureIndex = indexP - voxelsPerTexture*textureIndex;\n\n // Get row and column in the texture\n int colIndex = int(mod(float(inTextureIndex), float(uTextureSize)));\n int rowIndex = int(floor(float(inTextureIndex)/float(uTextureSize)));\n\n // Map row and column to uv\n vec2 uv = vec2(0,0);\n uv.x = (0.5 + float(colIndex)) / float(uTextureSize);\n uv.y = 1. - (0.5 + float(rowIndex)) / float(uTextureSize);\n\n //\n if(textureIndex == 0){ dataValue = texture2D(uTextureContainer[0], uv); }\n else if(textureIndex == 1){dataValue = texture2D(uTextureContainer[1], uv);}\n else if(textureIndex == 2){ dataValue = texture2D(uTextureContainer[2], uv); }\n else if(textureIndex == 3){ dataValue = texture2D(uTextureContainer[3], uv); }\n else if(textureIndex == 4){ dataValue = texture2D(uTextureContainer[4], uv); }\n else if(textureIndex == 5){ dataValue = texture2D(uTextureContainer[5], uv); }\n else if(textureIndex == 6){ dataValue = texture2D(uTextureContainer[6], uv); }\n\n}\n "}}]);return Texture3d}(_shaders2.default);exports.default=new Texture3d},{"../shaders.base":131}],127:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:this._base;var packedData=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this._packedData;var offset=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this._offset;var unpackedData=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this._unpackedData;this._base=baseFragment;return this.compute(packedData,offset,unpackedData)}},{key:"compute",value:function compute(packedData,offset,unpackedData){this.computeDefinition();this._base._functions[this._name]=this._definition;return this._name+"("+packedData+", "+offset+", "+unpackedData+");"}},{key:"computeDefinition",value:function computeDefinition(){var content="";if(this._base._uniforms.uNumberOfChannels.value===1){switch(this._base._uniforms.uBitsAllocated.value){case 1:case 8:content=this.upack8();break;case 16:content=this.upack16();break;case 32:content=this.upack32();break;default:content=this.upackDefault();break}}else{content=this.upackIdentity()}this._definition="\nvoid "+this._name+"(in vec4 packedData, in int offset, out vec4 unpackedData){\n\n"+content+"\n\n} \n "}},{key:"upack8",value:function upack8(){this._base._functions["uInt8"]=this.uInt8();return"\nuInt8(\n packedData.r,\n unpackedData.x);\n "}},{key:"upack16",value:function upack16(){this._base._functions["uInt16"]=this.uInt16();return"\nuInt16(\n packedData.r * float( 1 - offset) + packedData.b * float(offset),\n packedData.g * float( 1 - offset) + packedData.a * float(offset),\n unpackedData.x);\n "}},{key:"upack32",value:function upack32(){if(this._base._uniforms.uPixelType.value===0){this._base._functions["uInt32"]=this.uInt32();return"\nuInt32(\n packedData.r,\n packedData.g,\n packedData.b,\n packedData.a,\n unpackedData.x);\n "}else{this._base._functions["uFloat32"]=this.uFloat32();return"\nuFloat32(\n packedData.r,\n packedData.g,\n packedData.b,\n packedData.a,\n unpackedData.x);\n "}}},{key:"upackIdentity",value:function upackIdentity(){return"\n\nunpackedData = packedData;\n\n "}},{key:"uInt8",value:function uInt8(){return"\nvoid uInt8(in float r, out float value){\n value = r * 256.;\n}\n "}},{key:"uInt16",value:function uInt16(){return"\nvoid uInt16(in float r, in float a, out float value){\n value = r * 256. + a * 65536.;\n}\n "}},{key:"uInt32",value:function uInt32(){return"\nvoid uInt32(in float r, in float g, in float b, in float a, out float value){\n value = r * 256. + g * 65536. + b * 16777216. + a * 4294967296.;\n}\n "}},{key:"uFloat32",value:function uFloat32(){return"\nvoid uFloat32(in float r, in float g, in float b, in float a, out float value){\n\n // create arrays containing bits for rgba values\n // value between 0 and 255\n value = r * 255.;\n int bytemeR[8];\n bytemeR[0] = int(floor(value / 128.));\n value -= float(bytemeR[0] * 128);\n bytemeR[1] = int(floor(value / 64.));\n value -= float(bytemeR[1] * 64);\n bytemeR[2] = int(floor(value / 32.));\n value -= float(bytemeR[2] * 32);\n bytemeR[3] = int(floor(value / 16.));\n value -= float(bytemeR[3] * 16);\n bytemeR[4] = int(floor(value / 8.));\n value -= float(bytemeR[4] * 8);\n bytemeR[5] = int(floor(value / 4.));\n value -= float(bytemeR[5] * 4);\n bytemeR[6] = int(floor(value / 2.));\n value -= float(bytemeR[6] * 2);\n bytemeR[7] = int(floor(value));\n\n value = g * 255.;\n int bytemeG[8];\n bytemeG[0] = int(floor(value / 128.));\n value -= float(bytemeG[0] * 128);\n bytemeG[1] = int(floor(value / 64.));\n value -= float(bytemeG[1] * 64);\n bytemeG[2] = int(floor(value / 32.));\n value -= float(bytemeG[2] * 32);\n bytemeG[3] = int(floor(value / 16.));\n value -= float(bytemeG[3] * 16);\n bytemeG[4] = int(floor(value / 8.));\n value -= float(bytemeG[4] * 8);\n bytemeG[5] = int(floor(value / 4.));\n value -= float(bytemeG[5] * 4);\n bytemeG[6] = int(floor(value / 2.));\n value -= float(bytemeG[6] * 2);\n bytemeG[7] = int(floor(value));\n\n value = b * 255.;\n int bytemeB[8];\n bytemeB[0] = int(floor(value / 128.));\n value -= float(bytemeB[0] * 128);\n bytemeB[1] = int(floor(value / 64.));\n value -= float(bytemeB[1] * 64);\n bytemeB[2] = int(floor(value / 32.));\n value -= float(bytemeB[2] * 32);\n bytemeB[3] = int(floor(value / 16.));\n value -= float(bytemeB[3] * 16);\n bytemeB[4] = int(floor(value / 8.));\n value -= float(bytemeB[4] * 8);\n bytemeB[5] = int(floor(value / 4.));\n value -= float(bytemeB[5] * 4);\n bytemeB[6] = int(floor(value / 2.));\n value -= float(bytemeB[6] * 2);\n bytemeB[7] = int(floor(value));\n\n value = a * 255.;\n int bytemeA[8];\n bytemeA[0] = int(floor(value / 128.));\n value -= float(bytemeA[0] * 128);\n bytemeA[1] = int(floor(value / 64.));\n value -= float(bytemeA[1] * 64);\n bytemeA[2] = int(floor(value / 32.));\n value -= float(bytemeA[2] * 32);\n bytemeA[3] = int(floor(value / 16.));\n value -= float(bytemeA[3] * 16);\n bytemeA[4] = int(floor(value / 8.));\n value -= float(bytemeA[4] * 8);\n bytemeA[5] = int(floor(value / 4.));\n value -= float(bytemeA[5] * 4);\n bytemeA[6] = int(floor(value / 2.));\n value -= float(bytemeA[6] * 2);\n bytemeA[7] = int(floor(value));\n\n // compute float32 value from bit arrays\n\n // sign\n int issigned = 1 - 2 * bytemeR[0];\n // issigned = int(pow(-1., float(bytemeR[0])));\n\n // exponent\n int exponent = 0;\n\n exponent += bytemeR[1] * int(pow(2., 7.));\n exponent += bytemeR[2] * int(pow(2., 6.));\n exponent += bytemeR[3] * int(pow(2., 5.));\n exponent += bytemeR[4] * int(pow(2., 4.));\n exponent += bytemeR[5] * int(pow(2., 3.));\n exponent += bytemeR[6] * int(pow(2., 2.));\n exponent += bytemeR[7] * int(pow(2., 1.));\n\n exponent += bytemeG[0];\n\n\n // fraction\n float fraction = 0.;\n\n fraction = float(bytemeG[1]) * pow(2., -1.);\n fraction += float(bytemeG[2]) * pow(2., -2.);\n fraction += float(bytemeG[3]) * pow(2., -3.);\n fraction += float(bytemeG[4]) * pow(2., -4.);\n fraction += float(bytemeG[5]) * pow(2., -5.);\n fraction += float(bytemeG[6]) * pow(2., -6.);\n fraction += float(bytemeG[7]) * pow(2., -7.);\n\n fraction += float(bytemeB[0]) * pow(2., -8.);\n fraction += float(bytemeB[1]) * pow(2., -9.);\n fraction += float(bytemeB[2]) * pow(2., -10.);\n fraction += float(bytemeB[3]) * pow(2., -11.);\n fraction += float(bytemeB[4]) * pow(2., -12.);\n fraction += float(bytemeB[5]) * pow(2., -13.);\n fraction += float(bytemeB[6]) * pow(2., -14.);\n fraction += float(bytemeB[7]) * pow(2., -15.);\n\n fraction += float(bytemeA[0]) * pow(2., -16.);\n fraction += float(bytemeA[1]) * pow(2., -17.);\n fraction += float(bytemeA[2]) * pow(2., -18.);\n fraction += float(bytemeA[3]) * pow(2., -19.);\n fraction += float(bytemeA[4]) * pow(2., -20.);\n fraction += float(bytemeA[5]) * pow(2., -21.);\n fraction += float(bytemeA[6]) * pow(2., -22.);\n fraction += float(bytemeA[7]) * pow(2., -23.);\n\n value = float(issigned) * pow( 2., float(exponent - 127)) * (1. + fraction);\n}\n "; +}}]);return Unpack}(_shaders2.default);exports.default=new Unpack},{"../shaders.base":131}],128:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:this._base;var currentVoxel=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this._currentVoxel;var dataValue=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this._dataValue;this._base=baseFragment;return this.compute(currentVoxel,dataValue)}},{key:"compute",value:function compute(currentVoxel,dataValue){this.computeDefinition();this._base._functions[this._name]=this._definition;return this._name+"("+currentVoxel+", "+dataValue+");"}},{key:"computeDefinition",value:function computeDefinition(){this._definition="\nvoid "+this._name+"(in vec3 currentVoxel, out vec4 dataValue){\n // lower bound\n vec3 rcurrentVoxel = vec3(floor(currentVoxel.x + 0.5 ), floor(currentVoxel.y + 0.5 ), floor(currentVoxel.z + 0.5 ));\n ivec3 voxel = ivec3(int(rcurrentVoxel.x), int(rcurrentVoxel.y), int(rcurrentVoxel.z));\n\n vec4 tmp = vec4(0., 0., 0., 0.);\n int offset = 0;\n\n "+_shadersHelpers4.default.api(this._base,"voxel","tmp","offset")+"\n "+_shadersHelpers2.default.api(this._base,"tmp","offset","dataValue")+"\n}\n "}}]);return InterpolationIdentity}(_shaders2.default);exports.default=new InterpolationIdentity},{"../helpers/shaders.helpers.texture3d":126,"../helpers/shaders.helpers.unpack":127,"../shaders.base":131}],129:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _shadersInterpolation=require("./shaders.interpolation.identity");var _shadersInterpolation2=_interopRequireDefault(_shadersInterpolation);var _shadersInterpolation3=require("./shaders.interpolation.trilinear");var _shadersInterpolation4=_interopRequireDefault(_shadersInterpolation3);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function shadersInterpolation(baseFragment,currentVoxel,dataValue,gradient){switch(baseFragment._uniforms.uInterpolation.value){case 0:return _shadersInterpolation2.default.api(baseFragment,currentVoxel,dataValue);case 1:return _shadersInterpolation4.default.api(baseFragment,currentVoxel,dataValue,gradient);default:return _shadersInterpolation2.default.api(baseFragment,currentVoxel,dataValue)}}exports.default=shadersInterpolation},{"./shaders.interpolation.identity":128,"./shaders.interpolation.trilinear":130}],130:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:this._base;var currentVoxel=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this._currentVoxel;var dataValue=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this._dataValue;var gradient=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this._gradient;this._base=baseFragment;return this.compute(currentVoxel,dataValue,gradient)}},{key:"compute",value:function compute(currentVoxel,dataValue,gradient){this.computeDefinition();this._base._functions[this._name]=this._definition;return this._name+"("+currentVoxel+", "+dataValue+", "+gradient+");"}},{key:"computeDefinition",value:function computeDefinition(){this._definition="\nvoid "+this._name+"(in vec3 currentVoxel, out vec4 dataValue, out vec3 gradient){\n\n // https://en.wikipedia.org/wiki/Trilinear_interpolation\n vec3 lower_bound = vec3(floor(currentVoxel.x), floor(currentVoxel.y), floor(currentVoxel.z));\n vec3 higher_bound = lower_bound + vec3(1);\n\n float xd = ( currentVoxel.x - lower_bound.x ) / ( higher_bound.x - lower_bound.x );\n float yd = ( currentVoxel.y - lower_bound.y ) / ( higher_bound.y - lower_bound.y );\n float zd = ( currentVoxel.z - lower_bound.z ) / ( higher_bound.z - lower_bound.z );\n\n //\n // c00\n //\n\n //\n\n vec4 v000 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c000 = vec3(lower_bound.x, lower_bound.y, lower_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c000","v000")+"\n vec3 g000 = v000.r * vec3(-1., -1., -1.);\n\n //\n\n vec4 v100 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c100 = vec3(higher_bound.x, lower_bound.y, lower_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c100","v100")+"\n vec3 g100 = v100.r * vec3(1., -1., -1.);\n\n vec4 c00 = v000 * ( 1.0 - xd ) + v100 * xd;\n\n //\n // c01\n //\n vec4 v001 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c001 = vec3(lower_bound.x, lower_bound.y, higher_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c001","v001")+"\n vec3 g001 = v001.r * vec3(-1., -1., 1.);\n\n vec4 v101 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c101 = vec3(higher_bound.x, lower_bound.y, higher_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c101","v101")+"\n vec3 g101 = v101.r * vec3(1., -1., 1.);\n\n vec4 c01 = v001 * ( 1.0 - xd ) + v101 * xd;\n\n //\n // c10\n //\n vec4 v010 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c010 = vec3(lower_bound.x, higher_bound.y, lower_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c010","v010")+"\n vec3 g010 = v010.r * vec3(-1., 1., -1.);\n\n vec4 v110 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c110 = vec3(higher_bound.x, higher_bound.y, lower_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c110","v110")+"\n vec3 g110 = v110.r * vec3(1., 1., -1.);\n\n vec4 c10 = v010 * ( 1.0 - xd ) + v110 * xd;\n\n //\n // c11\n //\n vec4 v011 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c011 = vec3(lower_bound.x, higher_bound.y, higher_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c011","v011")+"\n vec3 g011 = v011.r * vec3(-1., 1., 1.);\n\n vec4 v111 = vec4(0.0, 0.0, 0.0, 0.0);\n vec3 c111 = vec3(higher_bound.x, higher_bound.y, higher_bound.z);\n "+_shadersInterpolation2.default.api(this._base,"c111","v111")+"\n vec3 g111 = v111.r * vec3(1., 1., 1.);\n\n vec4 c11 = v011 * ( 1.0 - xd ) + v111 * xd;\n\n // c0 and c1\n vec4 c0 = c00 * ( 1.0 - yd) + c10 * yd;\n vec4 c1 = c01 * ( 1.0 - yd) + c11 * yd;\n\n // c\n vec4 c = c0 * ( 1.0 - zd) + c1 * zd;\n dataValue = c;\n\n // compute gradient\n gradient = g000 + g100 + g010 + g110 + g011 + g111 + g110 + g011;\n // gradientMagnitude = length(gradient);\n // // https://en.wikipedia.org/wiki/Normal_(geometry)#Transforming_normals\n // vec3 localNormal = (-1. / gradientMagnitude) * gradient;\n // normal = normalize(normalPixelToPatient"+this.id+" * localNormal);\n //normal = gradient;\n\n}\n "}}]);return InterpolationTrilinear}(_shaders2.default);exports.default=new InterpolationTrilinear},{"../shaders.base":131,"./shaders.interpolation.identity":128}],131:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i tFar || accumulatedAlpha >= 1.0 ) break;\n }\n\n gl_FragColor = vec4(accumulatedColor.xyz, accumulatedAlpha);\n}\n "}},{key:"compute",value:function compute(){var shaderInterpolation="";return"\n// uniforms\n"+this.uniforms()+"\n\n// varying (should fetch it from vertex directly)\nvarying vec4 vPos;\n\n// tailored functions\n"+this.functions()+"\n\n// main loop\n"+this._main+"\n "}}]);return ShadersFragment}();exports.default=ShadersFragment},{"./helpers/shaders.helpers.intersectBox":125,"./interpolation/shaders.interpolation":129}],140:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0){this._offset.copy(intersectsTarget[0].point).sub(this._mesh.position)}}else{var intersection=_core2.default.rayPlane(this._raycaster.ray,this._plane);if(intersection!==null){this._offset.copy(intersection).sub(this._plane.position)}}this.update()}}},{key:"onEnd",value:function onEnd(evt){evt.preventDefault();if(this._tracking===true){return}if(!this._dragged&&this._active){this._selected=!this._selected}this._active=false;this._dragged=false;this._controls.enabled=true;this.update()}},{key:"onMove",value:function onMove(evt){evt.preventDefault();this._mouse.set(event.clientX/this._container.offsetWidth*2-1,-(event.clientY/this._container.offsetHeight)*2+1);this._screenPosition=this.worldToScreen(this._worldPosition,this._camera,this._container);this._raycaster.setFromCamera(this._mouse,this._camera);this._raycaster.ray.position=this._raycaster.ray.origin;if(this._active){this._dragged=true;if(this._targetMesh!==null){var intersectsTarget=this._raycaster.intersectObject(this._targetMesh);if(intersectsTarget.length>0){this._worldPosition.copy(intersectsTarget[0].point.sub(this._offset))}}else{if(this._plane.direction.length()===0){this._plane.position.copy(this._worldPosition);this._plane.direction.copy(this._camera.getWorldDirection())}var intersection=_core2.default.rayPlane(this._raycaster.ray,this._plane);if(intersection!==null){this._worldPosition.copy(intersection.sub(this._offset))}}}else{this.onHover(null);if(this._targetMesh===null){this._plane.position.copy(this._worldPosition);this._plane.direction.copy(this._camera.getWorldDirection())}}this.update()}},{key:"onHover",value:function onHover(evt){if(evt){evt.preventDefault();this.hoverDom(evt)}this.hoverMesh();this._hovered=this._meshHovered||this._domHovered;this._container.style.cursor=this._hovered?"pointer":"default"}},{key:"update",value:function update(){this.updateColor();this.updateMeshColor();this.updateMeshPosition();this.updateDOMColor();this.updateDOMPosition()}},{key:"updateMeshColor",value:function updateMeshColor(){if(this._material){this._material.color.set(this._color)}}},{key:"updateMeshPosition",value:function updateMeshPosition(){if(this._mesh){this._mesh.position.x=this._worldPosition.x;this._mesh.position.y=this._worldPosition.y;this._mesh.position.z=this._worldPosition.z}}},{key:"hoverMesh",value:function hoverMesh(){var intersectsHandle=this._raycaster.intersectObject(this._mesh);this._meshHovered=intersectsHandle.length>0}},{key:"hoverDom",value:function hoverDom(evt){this._domHovered=evt.type==="mouseenter"}},{key:"worldToScreen",value:function worldToScreen(worldCoordinate,camera,canvas){var screenCoordinates=worldCoordinate.clone();screenCoordinates.project(camera);screenCoordinates.x=Math.round((screenCoordinates.x+1)*canvas.offsetWidth/2);screenCoordinates.y=Math.round((-screenCoordinates.y+1)*canvas.offsetHeight/2);screenCoordinates.z=0;return screenCoordinates}},{key:"createMesh",value:function createMesh(){this._geometry=new THREE.SphereGeometry(2,32,32);this._material=new THREE.MeshBasicMaterial({wireframe:true,wireframeLinewidth:2});this._mesh=new THREE.Mesh(this._geometry,this._material);this._mesh.position.x=this._worldPosition.x;this._mesh.position.y=this._worldPosition.y;this._mesh.position.z=this._worldPosition.z;this._mesh.visible=true;this.updateMeshColor();this.add(this._mesh)}},{key:"createDOM",value:function createDOM(){this._dom=document.createElement("div");this._dom.setAttribute("id",this.uuid);this._dom.setAttribute("class","widgets handle");this._dom.style.border="2px solid";this._dom.style.backgroundColor="#F9F9F9";this._dom.style.color="#F9F9F9";this._dom.style.position="absolute";this._dom.style.width="12px";this._dom.style.height="12px";this._dom.style.margin="-6px";this._dom.style.borderRadius="50%";this._dom.style.transformOrigin="0 100%";var posY=this._screenPosition.y-this._container.offsetHeight;this._dom.style.transform="translate3D("+this._screenPosition.x+"px, "+posY+"px, 0)";this.updateDOMColor();this._container.appendChild(this._dom)}},{key:"updateDOMPosition",value:function updateDOMPosition(){if(this._dom){var posY=this._screenPosition.y-this._container.offsetHeight;this._dom.style.transform="translate3D("+this._screenPosition.x+"px, "+posY+"px, 0)"}}},{key:"updateDOMColor",value:function updateDOMColor(){this._dom.style.borderColor=""+this._color}},{key:"free",value:function free(){this.removeEventListeners()}},{key:"worldPosition",set:function set(worldPosition){this._worldPosition.copy(worldPosition);this._screenPosition=this.worldToScreen(this._worldPosition,this._camera,this._container);this.update()},get:function get(){return this._worldPosition}},{key:"screenPosition",set:function set(screenPosition){this._screenPosition=screenPosition},get:function get(){return this._screenPosition}},{key:"active",get:function get(){return this._active},set:function set(active){this._active=active;this._controls.enabled=!this._active;this.update()}},{key:"tracking",get:function get(){return this._tracking},set:function set(tracking){this._tracking=tracking;this.update()}}]);return WidgetsHandle}(_widgets2.default);exports.default=WidgetsHandle},{"../../src/core/core.intersections":93,"../../src/widgets/widgets.base":142}],144:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _widgets=require("./widgets.handle");var _widgets2=_interopRequireDefault(_widgets);var _widgets3=require("./widgets.voxelProbe");var _widgets4=_interopRequireDefault(_widgets3);var _widgets5=require("./widgets.ruler");var _widgets6=_interopRequireDefault(_widgets5);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Handle:_widgets2.default,VoxelProbe:_widgets4.default,Ruler:_widgets6.default}},{"./widgets.handle":143,"./widgets.ruler":145,"./widgets.voxelProbe":146}],145:[function(require,module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i=0){this.activateVoxel()}}}},{key:"updateRaycaster",value:function updateRaycaster(raycaster,event,container){this._mouse={x:event.clientX/container.offsetWidth*2-1,y:-(event.clientY/container.offsetHeight)*2+1,screenX:event.clientX,screenY:event.clientY};raycaster.setFromCamera(this._mouse,this._camera)}},{key:"updateColor",value:function updateColor(voxel){if(voxel._active){voxel.color=this._activeColor}else if(voxel.hover){voxel.color=this._hoverColor}else if(voxel.selected){voxel.color=this._selectedColor}else{voxel.color=this._defaultColor}}},{key:"deleteAllSelected",value:function deleteAllSelected(){var i=this._voxels.length;while(i--){var match=this._selected.indexOf(i);if(match>=0){if(this._active===i){this._active=-1}this.remove(this._voxels[i]);this._voxels[i].removeTest();this._voxels.splice(i,1)}}this._selected=[];this._closest=null}},{key:"selectVoxel",value:function selectVoxel(){var selIndex=this._selected.indexOf(this._active);if(selIndex===-1){this._selected.push(this._active);this._voxels[this._active].selected=true;this.updateColor(this._voxels[this._active])}else{this._selected.splice(selIndex,1);this._voxels[this._active].selected=false}}},{key:"activateVoxel",value:function activateVoxel(){if(this._active===-1){var intersects=this._raycaster.intersectObject(this._targetMesh);if(intersects.length>0){if(this._hover>=0||this._closest!==null&&this._voxels[this._closest].distance<10){var index=Math.max(this._hover,this._closest);this._voxels[index]._active=true;this.updateColor(this._voxels[index]);this._active=index;this._controls.enabled=false}}}else{this._voxels[this._active].active=false;this._active=-1;this._controls.enabled=true}}},{key:"createVoxel",value:function createVoxel(){if(this._hover>=0){return}var intersects=this._raycaster.intersectObject(this._targetMesh);if(intersects.length>0){var helpersVoxel=new _helpers2.default(intersects[0].point,this._stack);this.add(helpersVoxel);this._voxels.push(helpersVoxel);helpersVoxel.updateVoxelScreenCoordinates(this._camera,this._container);this.hoverVoxel(helpersVoxel,this._mouse,this._current.voxel.dataCoordinates);this.updateColor(helpersVoxel);helpersVoxel.updateDom(this._container);helpersVoxel.showVoxel=this._showVoxel;helpersVoxel.showDomSVG=this._showDomSVG;helpersVoxel.showDomMeasurements=this._showDomMeasurements}}},{key:"update",value:function update(){if(!this._targetMesh){return}var intersects=this._raycaster.intersectObject(this._targetMesh);if(intersects.length>0){this._current.worldCoordinates=intersects[0].point;this._current.updateVoxelScreenCoordinates(this._camera,this._container);this.updateColor(this._current);this._current.updateDom(this._container);this._current.showVoxel=this._showVoxel;this._current.showDomSVG=this._showDomSVG;this._current.showDomMeasurements=this._showDomMeasurements;if(this._active>=0){this._voxels[this._active].worldCoordinates=intersects[0].point}}this.updateVoxels()}},{key:"updateVoxels",value:function updateVoxels(){var hover=-1;var closest=null;for(var i=0;i=0&&distance<10){helpersVoxel.hover=true}else{helpersVoxel.hover=false}}}},{key:"showOfIntersectsFrame",value:function showOfIntersectsFrame(voxelHelper,frameIndex){if(frameIndex===voxelHelper.voxel.dataCoordinates.z||frameIndex===-1){voxelHelper._showDomSVG=true;voxelHelper._showDomMeasurements=true}else{voxelHelper._showDomSVG=false;voxelHelper._showDomMeasurements=false}}},{key:"defaultColor",set:function set(defaultColor){this._defaultColor=defaultColor;this.update()},get:function get(){return this._defaultColor}},{key:"activeColor",set:function set(activeColor){this._activeColor=activeColor;this.update()},get:function get(){return this._activeColor}},{key:"hoverColor",set:function set(hoverColor){this._hoverColor=hoverColor;this.update()},get:function get(){return this._hoverColor}},{key:"selectedColor",set:function set(selectedColor){this._selectedColor=selectedColor;this.update()},get:function get(){return this._selectedColor}},{key:"showVoxel",set:function set(showVoxel){this._showVoxel=showVoxel;this.update()},get:function get(){return this._showVoxel}},{key:"showDomSVG",set:function set(showDomSVG){this._showDomSVG=showDomSVG;this.update()},get:function get(){return this._showDomSVG}},{key:"showDomMeasurements",set:function set(showDomMeasurements){this._showDomMeasurements=showDomMeasurements;this.update()},get:function get(){return this._showDomMeasurements}}]);return WidgetsVoxelProbe}(THREE.Object3D);exports.default=WidgetsVoxelProbe},{"../../src/helpers/helpers.voxel":110}]},{},[86])(86)}); \ No newline at end of file diff --git a/lessons/00/demo.html b/lessons/00/demo.html index 5aa41897d..513e5ecb4 100644 --- a/lessons/00/demo.html +++ b/lessons/00/demo.html @@ -14,7 +14,7 @@ - + diff --git a/lessons/01/demo.html b/lessons/01/demo.html index dbd582944..7c0956e97 100644 --- a/lessons/01/demo.html +++ b/lessons/01/demo.html @@ -15,7 +15,7 @@ - + diff --git a/lessons/02/demo.html b/lessons/02/demo.html index 5a9089ef1..efdc23e5c 100644 --- a/lessons/02/demo.html +++ b/lessons/02/demo.html @@ -21,7 +21,7 @@ - + diff --git a/lessons/03/demo.html b/lessons/03/demo.html index 1a360fa2f..64e0c2a72 100644 --- a/lessons/03/demo.html +++ b/lessons/03/demo.html @@ -15,7 +15,7 @@ - + diff --git a/lessons/04/demo.html b/lessons/04/demo.html index 5fadc0c64..ec1c9ffc4 100644 --- a/lessons/04/demo.html +++ b/lessons/04/demo.html @@ -3,8 +3,8 @@
-
Layer 0
-
Layer 1
+
CT
+
Segmentation
@@ -20,7 +20,7 @@ - + diff --git a/lessons/05/demo.html b/lessons/05/demo.html index 841790043..cc3bc102d 100644 --- a/lessons/05/demo.html +++ b/lessons/05/demo.html @@ -16,7 +16,7 @@ - + diff --git a/lessons/06/demo.html b/lessons/06/demo.html index a6484a1bf..31f327df0 100644 --- a/lessons/06/demo.html +++ b/lessons/06/demo.html @@ -20,7 +20,7 @@ - + diff --git a/lessons/08/demo.html b/lessons/08/demo.html index 8e543be30..29378e077 100644 --- a/lessons/08/demo.html +++ b/lessons/08/demo.html @@ -14,7 +14,7 @@ - + diff --git a/package.json b/package.json index 1acb017ef..e591b91fc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ami.js", - "version": "v0.0.12-dev", + "version": "v0.0.12", "main": "src/ami.js", "keywords": ["ami", "ami.js","three.js", "webgl", "dicom", "nifti", "awesome", "medical", "imaging", "xtk", "nrrd", "vtk", "stl", "trk"], "author": {