0
{
    "tiddlers": {
        "$:/Acknowledgements": {
            "title": "$:/Acknowledgements",
            "type": "text/vnd.tiddlywiki",
            "text": "TiddlyWiki incorporates code from these fine OpenSource projects:\n\n* [[The Stanford Javascript Crypto Library|http://bitwiseshiftleft.github.io/sjcl/]]\n* [[The Jasmine JavaScript Test Framework|http://pivotal.github.io/jasmine/]]\n* [[Normalize.css by Nicolas Gallagher|http://necolas.github.io/normalize.css/]]\n\nAnd media from these projects:\n\n* World flag icons from [[Wikipedia|http://commons.wikimedia.org/wiki/Category:SVG_flags_by_country]]\n"
        },
        "$:/core/copyright.txt": {
            "title": "$:/core/copyright.txt",
            "type": "text/plain",
            "text": "TiddlyWiki created by Jeremy Ruston, (jeremy [at] jermolene [dot] com)\n\nCopyright (c) 2004-2007, Jeremy Ruston\nCopyright (c) 2007-2017, UnaMesa Association\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice,\n  this list of conditions and the following disclaimer in the documentation\n  and/or other materials provided with the distribution.\n\n* Neither the name of the copyright holder nor the names of its\n  contributors may be used to endorse or promote products derived from\n  this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
        },
        "$:/core/icon": {
            "title": "$:/core/icon",
            "tags": "$:/tags/Image",
            "text": "<svg width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\"><path d=\"M64 0l54.56 32v64L64 128 9.44 96V32L64 0zm21.127 95.408c-3.578-.103-5.15-.094-6.974-3.152l-1.42.042c-1.653-.075-.964-.04-2.067-.097-1.844-.07-1.548-1.86-1.873-2.8-.52-3.202.687-6.43.65-9.632-.014-1.14-1.593-5.17-2.157-6.61-1.768.34-3.546.406-5.34.497-4.134-.01-8.24-.527-12.317-1.183-.8 3.35-3.16 8.036-1.21 11.44 2.37 3.52 4.03 4.495 6.61 4.707 2.572.212 3.16 3.18 2.53 4.242-.55.73-1.52.864-2.346 1.04l-1.65.08c-1.296-.046-2.455-.404-3.61-.955-1.93-1.097-3.925-3.383-5.406-5.024.345.658.55 1.938.24 2.53-.878 1.27-4.665 1.26-6.4.47-1.97-.89-6.73-7.162-7.468-11.86 1.96-3.78 4.812-7.07 6.255-11.186-3.146-2.05-4.83-5.384-4.61-9.16l.08-.44c-3.097.59-1.49.37-4.82.628-10.608-.032-19.935-7.37-14.68-18.774.34-.673.664-1.287 1.243-.994.466.237.4 1.18.166 2.227-3.005 13.627 11.67 13.732 20.69 11.21.89-.25 2.67-1.936 3.905-2.495 2.016-.91 4.205-1.282 6.376-1.55 5.4-.63 11.893 2.276 15.19 2.37 3.3.096 7.99-.805 10.87-.615 2.09.098 4.143.483 6.16 1.03 1.306-6.49 1.4-11.27 4.492-12.38 1.814.293 3.213 2.818 4.25 4.167 2.112-.086 4.12.46 6.115 1.066 3.61-.522 6.642-2.593 9.833-4.203-3.234 2.69-3.673 7.075-3.303 11.127.138 2.103-.444 4.386-1.164 6.54-1.348 3.507-3.95 7.204-6.97 7.014-1.14-.036-1.805-.695-2.653-1.4-.164 1.427-.81 2.7-1.434 3.96-1.44 2.797-5.203 4.03-8.687 7.016-3.484 2.985 1.114 13.65 2.23 15.594 1.114 1.94 4.226 2.652 3.02 4.406-.37.58-.936.785-1.54 1.01l-.82.11zm-40.097-8.85l.553.14c.694-.27 2.09.15 2.83.353-1.363-1.31-3.417-3.24-4.897-4.46-.485-1.47-.278-2.96-.174-4.46l.02-.123c-.582 1.205-1.322 2.376-1.72 3.645-.465 1.71 2.07 3.557 3.052 4.615l.336.3z\" fill-rule=\"evenodd\"/></svg>"
        },
        "$:/core/images/advanced-search-button": {
            "title": "$:/core/images/advanced-search-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-advanced-search-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M74.5651535,87.9848361 C66.9581537,93.0488876 57.8237115,96 48,96 C21.490332,96 0,74.509668 0,48 C0,21.490332 21.490332,0 48,0 C74.509668,0 96,21.490332 96,48 C96,57.8541369 93.0305793,67.0147285 87.9377231,74.6357895 L122.284919,108.982985 C125.978897,112.676963 125.973757,118.65366 122.284271,122.343146 C118.593975,126.033442 112.613238,126.032921 108.92411,122.343793 L74.5651535,87.9848361 Z M48,80 C65.673112,80 80,65.673112 80,48 C80,30.326888 65.673112,16 48,16 C30.326888,16 16,30.326888 16,48 C16,65.673112 30.326888,80 48,80 Z\"></path>\n        <circle cx=\"48\" cy=\"48\" r=\"8\"></circle>\n        <circle cx=\"28\" cy=\"48\" r=\"8\"></circle>\n        <circle cx=\"68\" cy=\"48\" r=\"8\"></circle>\n    </g>\n</svg>"
        },
        "$:/core/images/auto-height": {
            "title": "$:/core/images/auto-height",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-auto-height tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <path d=\"M67.9867828,114.356363 L67.9579626,99.8785426 C67.9550688,98.4248183 67.1636987,97.087107 65.8909901,96.3845863 L49.9251455,87.5716209 L47.992126,95.0735397 L79.8995411,95.0735397 C84.1215894,95.0735397 85.4638131,89.3810359 81.686497,87.4948823 L49.7971476,71.5713518 L48.0101917,79.1500092 L79.992126,79.1500092 C84.2093753,79.1500092 85.5558421,73.4676733 81.7869993,71.5753162 L49.805065,55.517008 L48.0101916,63.0917009 L79.9921259,63.0917015 C84.2035118,63.0917016 85.5551434,57.4217887 81.7966702,55.5218807 L65.7625147,47.4166161 L67.9579705,50.9864368 L67.9579705,35.6148245 L77.1715737,44.8284272 C78.7336709,46.3905243 81.2663308,46.3905243 82.8284279,44.8284271 C84.390525,43.2663299 84.390525,40.7336699 82.8284278,39.1715728 L66.8284271,23.1715728 C65.2663299,21.6094757 62.73367,21.6094757 61.1715729,23.1715729 L45.1715729,39.1715729 C43.6094757,40.73367 43.6094757,43.26633 45.1715729,44.8284271 C46.73367,46.3905243 49.26633,46.3905243 50.8284271,44.8284271 L59.9579705,35.6988837 L59.9579705,50.9864368 C59.9579705,52.495201 60.806922,53.8755997 62.1534263,54.5562576 L78.1875818,62.6615223 L79.9921261,55.0917015 L48.0101917,55.0917009 C43.7929424,55.0917008 42.4464755,60.7740368 46.2153183,62.6663939 L78.1972526,78.7247021 L79.992126,71.1500092 L48.0101917,71.1500092 C43.7881433,71.1500092 42.4459197,76.842513 46.2232358,78.7286665 L78.1125852,94.6521971 L79.8995411,87.0735397 L47.992126,87.0735397 C43.8588276,87.0735397 42.4404876,92.5780219 46.0591064,94.5754586 L62.024951,103.388424 L59.9579785,99.8944677 L59.9867142,114.32986 L50.8284271,105.171573 C49.26633,103.609476 46.73367,103.609476 45.1715729,105.171573 C43.6094757,106.73367 43.6094757,109.26633 45.1715729,110.828427 L61.1715729,126.828427 C62.73367,128.390524 65.2663299,128.390524 66.8284271,126.828427 L82.8284278,110.828427 C84.390525,109.26633 84.390525,106.73367 82.8284279,105.171573 C81.2663308,103.609476 78.7336709,103.609476 77.1715737,105.171573 L67.9867828,114.356363 L67.9867828,114.356363 Z M16,20 L112,20 C114.209139,20 116,18.209139 116,16 C116,13.790861 114.209139,12 112,12 L16,12 C13.790861,12 12,13.790861 12,16 C12,18.209139 13.790861,20 16,20 L16,20 Z\"></path>\n</svg>"
        },
        "$:/core/images/blank": {
            "title": "$:/core/images/blank",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-blank tc-image-button\" viewBox=\"0 0 128 128\" width=\"22pt\" height=\"22pt\"></svg>"
        },
        "$:/core/images/bold": {
            "title": "$:/core/images/bold",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-bold tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M41.1456583,51.8095238 L41.1456583,21.8711485 L67.4985994,21.8711485 C70.0084159,21.8711485 72.4285598,22.0802967 74.7591036,22.4985994 C77.0896475,22.9169022 79.1512515,23.6638602 80.9439776,24.7394958 C82.7367036,25.8151314 84.170863,27.3090474 85.2464986,29.2212885 C86.3221342,31.1335296 86.859944,33.5835518 86.859944,36.5714286 C86.859944,41.9496067 85.2465147,45.8337882 82.0196078,48.2240896 C78.792701,50.614391 74.6694929,51.8095238 69.6498599,51.8095238 L41.1456583,51.8095238 Z M13,0 L13,128 L75.0280112,128 C80.7647346,128 86.3519803,127.28292 91.789916,125.848739 C97.2278517,124.414559 102.068139,122.203563 106.310924,119.215686 C110.553709,116.22781 113.929959,112.373506 116.439776,107.652661 C118.949592,102.931816 120.204482,97.3445701 120.204482,90.8907563 C120.204482,82.8832466 118.262391,76.0411115 114.378151,70.3641457 C110.493911,64.6871798 104.607883,60.7133634 96.719888,58.442577 C102.456611,55.6937304 106.788968,52.1680887 109.717087,47.8655462 C112.645206,43.5630037 114.109244,38.1849062 114.109244,31.7310924 C114.109244,25.7553389 113.123259,20.7357813 111.151261,16.6722689 C109.179262,12.6087565 106.400578,9.35201972 102.815126,6.90196078 C99.2296739,4.45190185 94.927196,2.68908101 89.907563,1.61344538 C84.8879301,0.537809748 79.3305627,0 73.2352941,0 L13,0 Z M41.1456583,106.128852 L41.1456583,70.9915966 L71.8011204,70.9915966 C77.896389,70.9915966 82.7964334,72.3958776 86.5014006,75.2044818 C90.2063677,78.0130859 92.0588235,82.7039821 92.0588235,89.2773109 C92.0588235,92.6237329 91.4911355,95.3725383 90.3557423,97.5238095 C89.2203491,99.6750808 87.6965548,101.378145 85.7843137,102.633053 C83.8720726,103.887961 81.661077,104.784311 79.1512605,105.322129 C76.641444,105.859947 74.0121519,106.128852 71.2633053,106.128852 L41.1456583,106.128852 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/cancel-button": {
            "title": "$:/core/images/cancel-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-cancel-button tc-image-button\" viewBox=\"0 0 128 128\" width=\"22pt\" height=\"22pt\">\n\t<g fill-rule=\"evenodd\">\n\t    <path d=\"M64,76.3137085 L47.0294734,93.2842351 C43.9038742,96.4098343 38.8399231,96.4084656 35.7157288,93.2842712 C32.5978915,90.166434 32.5915506,85.0947409 35.7157649,81.9705266 L52.6862915,65 L35.7157649,48.0294734 C32.5901657,44.9038742 32.5915344,39.8399231 35.7157288,36.7157288 C38.833566,33.5978915 43.9052591,33.5915506 47.0294734,36.7157649 L64,53.6862915 L80.9705266,36.7157649 C84.0961258,33.5901657 89.1600769,33.5915344 92.2842712,36.7157288 C95.4021085,39.833566 95.4084494,44.9052591 92.2842351,48.0294734 L75.3137085,65 L92.2842351,81.9705266 C95.4098343,85.0961258 95.4084656,90.1600769 92.2842712,93.2842712 C89.166434,96.4021085 84.0947409,96.4084494 80.9705266,93.2842351 L64,76.3137085 Z M64,129 C99.346224,129 128,100.346224 128,65 C128,29.653776 99.346224,1 64,1 C28.653776,1 1.13686838e-13,29.653776 1.13686838e-13,65 C1.13686838e-13,100.346224 28.653776,129 64,129 Z M64,113 C90.509668,113 112,91.509668 112,65 C112,38.490332 90.509668,17 64,17 C37.490332,17 16,38.490332 16,65 C16,91.509668 37.490332,113 64,113 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/chevron-down": {
            "title": "$:/core/images/chevron-down",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-chevron-down tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n\t<g fill-rule=\"evenodd\" transform=\"translate(64.000000, 40.500000) rotate(-270.000000) translate(-64.000000, -40.500000) translate(-22.500000, -26.500000)\">\n        <path d=\"M112.743107,112.12741 C111.310627,113.561013 109.331747,114.449239 107.145951,114.449239 L27.9777917,114.449239 C23.6126002,114.449239 20.0618714,110.904826 20.0618714,106.532572 C20.0618714,102.169214 23.6059497,98.6159054 27.9777917,98.6159054 L99.2285381,98.6159054 L99.2285381,27.365159 C99.2285381,22.9999675 102.77295,19.4492387 107.145205,19.4492387 C111.508562,19.4492387 115.061871,22.993317 115.061871,27.365159 L115.061871,106.533318 C115.061871,108.71579 114.175869,110.694669 112.743378,112.127981 Z\" transform=\"translate(67.561871, 66.949239) rotate(-45.000000) translate(-67.561871, -66.949239) \"></path>\n        <path d=\"M151.35638,112.12741 C149.923899,113.561013 147.94502,114.449239 145.759224,114.449239 L66.5910645,114.449239 C62.225873,114.449239 58.6751442,110.904826 58.6751442,106.532572 C58.6751442,102.169214 62.2192225,98.6159054 66.5910645,98.6159054 L137.841811,98.6159054 L137.841811,27.365159 C137.841811,22.9999675 141.386223,19.4492387 145.758478,19.4492387 C150.121835,19.4492387 153.675144,22.993317 153.675144,27.365159 L153.675144,106.533318 C153.675144,108.71579 152.789142,110.694669 151.356651,112.127981 Z\" transform=\"translate(106.175144, 66.949239) rotate(-45.000000) translate(-106.175144, -66.949239) \"></path>\n\t</g>\n</svg>"
        },
        "$:/core/images/chevron-left": {
            "title": "$:/core/images/chevron-left",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-chevron-left tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\" version=\"1.1\">\n    <g fill-rule=\"evenodd\" transform=\"translate(92.500000, 64.000000) rotate(-180.000000) translate(-92.500000, -64.000000) translate(6.000000, -3.000000)\">\n        <path d=\"M112.743107,112.12741 C111.310627,113.561013 109.331747,114.449239 107.145951,114.449239 L27.9777917,114.449239 C23.6126002,114.449239 20.0618714,110.904826 20.0618714,106.532572 C20.0618714,102.169214 23.6059497,98.6159054 27.9777917,98.6159054 L99.2285381,98.6159054 L99.2285381,27.365159 C99.2285381,22.9999675 102.77295,19.4492387 107.145205,19.4492387 C111.508562,19.4492387 115.061871,22.993317 115.061871,27.365159 L115.061871,106.533318 C115.061871,108.71579 114.175869,110.694669 112.743378,112.127981 Z\" transform=\"translate(67.561871, 66.949239) rotate(-45.000000) translate(-67.561871, -66.949239) \"></path>\n        <path d=\"M151.35638,112.12741 C149.923899,113.561013 147.94502,114.449239 145.759224,114.449239 L66.5910645,114.449239 C62.225873,114.449239 58.6751442,110.904826 58.6751442,106.532572 C58.6751442,102.169214 62.2192225,98.6159054 66.5910645,98.6159054 L137.841811,98.6159054 L137.841811,27.365159 C137.841811,22.9999675 141.386223,19.4492387 145.758478,19.4492387 C150.121835,19.4492387 153.675144,22.993317 153.675144,27.365159 L153.675144,106.533318 C153.675144,108.71579 152.789142,110.694669 151.356651,112.127981 Z\" transform=\"translate(106.175144, 66.949239) rotate(-45.000000) translate(-106.175144, -66.949239) \"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/chevron-right": {
            "title": "$:/core/images/chevron-right",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-chevron-right tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\" transform=\"translate(-48.000000, -3.000000)\">\n        <path d=\"M112.743107,112.12741 C111.310627,113.561013 109.331747,114.449239 107.145951,114.449239 L27.9777917,114.449239 C23.6126002,114.449239 20.0618714,110.904826 20.0618714,106.532572 C20.0618714,102.169214 23.6059497,98.6159054 27.9777917,98.6159054 L99.2285381,98.6159054 L99.2285381,27.365159 C99.2285381,22.9999675 102.77295,19.4492387 107.145205,19.4492387 C111.508562,19.4492387 115.061871,22.993317 115.061871,27.365159 L115.061871,106.533318 C115.061871,108.71579 114.175869,110.694669 112.743378,112.127981 Z\" transform=\"translate(67.561871, 66.949239) rotate(-45.000000) translate(-67.561871, -66.949239) \"></path>\n        <path d=\"M151.35638,112.12741 C149.923899,113.561013 147.94502,114.449239 145.759224,114.449239 L66.5910645,114.449239 C62.225873,114.449239 58.6751442,110.904826 58.6751442,106.532572 C58.6751442,102.169214 62.2192225,98.6159054 66.5910645,98.6159054 L137.841811,98.6159054 L137.841811,27.365159 C137.841811,22.9999675 141.386223,19.4492387 145.758478,19.4492387 C150.121835,19.4492387 153.675144,22.993317 153.675144,27.365159 L153.675144,106.533318 C153.675144,108.71579 152.789142,110.694669 151.356651,112.127981 Z\" transform=\"translate(106.175144, 66.949239) rotate(-45.000000) translate(-106.175144, -66.949239) \"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/chevron-up": {
            "title": "$:/core/images/chevron-up",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-chevron-up tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n\t<g fill-rule=\"evenodd\" transform=\"translate(64.000000, 89.500000) rotate(-90.000000) translate(-64.000000, -89.500000) translate(-22.500000, 22.500000)\">\n        <path d=\"M112.743107,112.12741 C111.310627,113.561013 109.331747,114.449239 107.145951,114.449239 L27.9777917,114.449239 C23.6126002,114.449239 20.0618714,110.904826 20.0618714,106.532572 C20.0618714,102.169214 23.6059497,98.6159054 27.9777917,98.6159054 L99.2285381,98.6159054 L99.2285381,27.365159 C99.2285381,22.9999675 102.77295,19.4492387 107.145205,19.4492387 C111.508562,19.4492387 115.061871,22.993317 115.061871,27.365159 L115.061871,106.533318 C115.061871,108.71579 114.175869,110.694669 112.743378,112.127981 Z\" transform=\"translate(67.561871, 66.949239) rotate(-45.000000) translate(-67.561871, -66.949239) \"></path>\n        <path d=\"M151.35638,112.12741 C149.923899,113.561013 147.94502,114.449239 145.759224,114.449239 L66.5910645,114.449239 C62.225873,114.449239 58.6751442,110.904826 58.6751442,106.532572 C58.6751442,102.169214 62.2192225,98.6159054 66.5910645,98.6159054 L137.841811,98.6159054 L137.841811,27.365159 C137.841811,22.9999675 141.386223,19.4492387 145.758478,19.4492387 C150.121835,19.4492387 153.675144,22.993317 153.675144,27.365159 L153.675144,106.533318 C153.675144,108.71579 152.789142,110.694669 151.356651,112.127981 Z\" transform=\"translate(106.175144, 66.949239) rotate(-45.000000) translate(-106.175144, -66.949239) \"></path>\n\t</g>\n</svg>"
        },
        "$:/core/images/clone-button": {
            "title": "$:/core/images/clone-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-clone-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M32.2650915,96 L32.2650915,120.002359 C32.2650915,124.419334 35.8432884,128 40.2627323,128 L120.002359,128 C124.419334,128 128,124.421803 128,120.002359 L128,40.2627323 C128,35.8457573 124.421803,32.2650915 120.002359,32.2650915 L96,32.2650915 L96,48 L108.858899,48 C110.519357,48 111.853018,49.3405131 111.853018,50.9941198 L111.853018,108.858899 C111.853018,110.519357 110.512505,111.853018 108.858899,111.853018 L50.9941198,111.853018 C49.333661,111.853018 48,110.512505 48,108.858899 L48,96 L32.2650915,96 Z\"></path>\n        <path d=\"M40,56 L32.0070969,56 C27.5881712,56 24,52.418278 24,48 C24,43.5907123 27.5848994,40 32.0070969,40 L40,40 L40,32.0070969 C40,27.5881712 43.581722,24 48,24 C52.4092877,24 56,27.5848994 56,32.0070969 L56,40 L63.9929031,40 C68.4118288,40 72,43.581722 72,48 C72,52.4092877 68.4151006,56 63.9929031,56 L56,56 L56,63.9929031 C56,68.4118288 52.418278,72 48,72 C43.5907123,72 40,68.4151006 40,63.9929031 L40,56 Z M7.9992458,0 C3.58138434,0 0,3.5881049 0,7.9992458 L0,88.0007542 C0,92.4186157 3.5881049,96 7.9992458,96 L88.0007542,96 C92.4186157,96 96,92.4118951 96,88.0007542 L96,7.9992458 C96,3.58138434 92.4118951,0 88.0007542,0 L7.9992458,0 Z M19.0010118,16 C17.3435988,16 16,17.336731 16,19.0010118 L16,76.9989882 C16,78.6564012 17.336731,80 19.0010118,80 L76.9989882,80 C78.6564012,80 80,78.663269 80,76.9989882 L80,19.0010118 C80,17.3435988 78.663269,16 76.9989882,16 L19.0010118,16 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/close-all-button": {
            "title": "$:/core/images/close-all-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-close-all-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\" transform=\"translate(-23.000000, -23.000000)\">\n        <path d=\"M43,131 L22.9976794,131 C18.5827987,131 15,127.418278 15,123 C15,118.590712 18.5806831,115 22.9976794,115 L43,115 L43,94.9976794 C43,90.5827987 46.581722,87 51,87 C55.4092877,87 59,90.5806831 59,94.9976794 L59,115 L79.0023206,115 C83.4172013,115 87,118.581722 87,123 C87,127.409288 83.4193169,131 79.0023206,131 L59,131 L59,151.002321 C59,155.417201 55.418278,159 51,159 C46.5907123,159 43,155.419317 43,151.002321 L43,131 Z\" transform=\"translate(51.000000, 123.000000) rotate(-45.000000) translate(-51.000000, -123.000000) \"></path>\n        <path d=\"M43,59 L22.9976794,59 C18.5827987,59 15,55.418278 15,51 C15,46.5907123 18.5806831,43 22.9976794,43 L43,43 L43,22.9976794 C43,18.5827987 46.581722,15 51,15 C55.4092877,15 59,18.5806831 59,22.9976794 L59,43 L79.0023206,43 C83.4172013,43 87,46.581722 87,51 C87,55.4092877 83.4193169,59 79.0023206,59 L59,59 L59,79.0023206 C59,83.4172013 55.418278,87 51,87 C46.5907123,87 43,83.4193169 43,79.0023206 L43,59 Z\" transform=\"translate(51.000000, 51.000000) rotate(-45.000000) translate(-51.000000, -51.000000) \"></path>\n        <path d=\"M115,59 L94.9976794,59 C90.5827987,59 87,55.418278 87,51 C87,46.5907123 90.5806831,43 94.9976794,43 L115,43 L115,22.9976794 C115,18.5827987 118.581722,15 123,15 C127.409288,15 131,18.5806831 131,22.9976794 L131,43 L151.002321,43 C155.417201,43 159,46.581722 159,51 C159,55.4092877 155.419317,59 151.002321,59 L131,59 L131,79.0023206 C131,83.4172013 127.418278,87 123,87 C118.590712,87 115,83.4193169 115,79.0023206 L115,59 Z\" transform=\"translate(123.000000, 51.000000) rotate(-45.000000) translate(-123.000000, -51.000000) \"></path>\n        <path d=\"M115,131 L94.9976794,131 C90.5827987,131 87,127.418278 87,123 C87,118.590712 90.5806831,115 94.9976794,115 L115,115 L115,94.9976794 C115,90.5827987 118.581722,87 123,87 C127.409288,87 131,90.5806831 131,94.9976794 L131,115 L151.002321,115 C155.417201,115 159,118.581722 159,123 C159,127.409288 155.419317,131 151.002321,131 L131,131 L131,151.002321 C131,155.417201 127.418278,159 123,159 C118.590712,159 115,155.419317 115,151.002321 L115,131 Z\" transform=\"translate(123.000000, 123.000000) rotate(-45.000000) translate(-123.000000, -123.000000) \"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/close-button": {
            "title": "$:/core/images/close-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-close-button tc-image-button\" viewBox=\"0 0 128 128\" width=\"22pt\" height=\"22pt\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M65.0864256,75.4091629 L14.9727349,125.522854 C11.8515951,128.643993 6.78104858,128.64922 3.65685425,125.525026 C0.539017023,122.407189 0.5336324,117.334539 3.65902635,114.209145 L53.7727171,64.0954544 L3.65902635,13.9817637 C0.537886594,10.8606239 0.532659916,5.79007744 3.65685425,2.6658831 C6.77469148,-0.451954124 11.8473409,-0.457338747 14.9727349,2.66805521 L65.0864256,52.7817459 L115.200116,2.66805521 C118.321256,-0.453084553 123.391803,-0.458311231 126.515997,2.6658831 C129.633834,5.78372033 129.639219,10.8563698 126.513825,13.9817637 L76.4001341,64.0954544 L126.513825,114.209145 C129.634965,117.330285 129.640191,122.400831 126.515997,125.525026 C123.39816,128.642863 118.32551,128.648248 115.200116,125.522854 L65.0864256,75.4091629 L65.0864256,75.4091629 Z\"></path>\n    </g>\n</svg>\n"
        },
        "$:/core/images/close-others-button": {
            "title": "$:/core/images/close-others-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-close-others-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M64,128 C99.346224,128 128,99.346224 128,64 C128,28.653776 99.346224,0 64,0 C28.653776,0 0,28.653776 0,64 C0,99.346224 28.653776,128 64,128 Z M64,112 C90.509668,112 112,90.509668 112,64 C112,37.490332 90.509668,16 64,16 C37.490332,16 16,37.490332 16,64 C16,90.509668 37.490332,112 64,112 Z M64,96 C81.673112,96 96,81.673112 96,64 C96,46.326888 81.673112,32 64,32 C46.326888,32 32,46.326888 32,64 C32,81.673112 46.326888,96 64,96 Z M64,80 C72.836556,80 80,72.836556 80,64 C80,55.163444 72.836556,48 64,48 C55.163444,48 48,55.163444 48,64 C48,72.836556 55.163444,80 64,80 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/copy-clipboard": {
            "title": "$:/core/images/copy-clipboard",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-copy-clipboard tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n\t<g fill-rule=\"evenodd\">\n\t\t<rect x=\"40\" y=\"40\" width=\"33\" height=\"8\" rx=\"4\"></rect>\n\t\t<rect x=\"40\" y=\"82\" width=\"17\" height=\"8\" rx=\"4\"></rect>\n\t\t<rect x=\"40\" y=\"54\" width=\"17\" height=\"8\" rx=\"4\"></rect>\n\t\t<rect x=\"40\" y=\"96\" width=\"33\" height=\"8\" rx=\"4\"></rect>\n\t\t<rect x=\"40\" y=\"68\" width=\"12\" height=\"8\" rx=\"4\"></rect>\n\t\t<path d=\"M40,16 L23.9992458,16 C19.5813843,16 16,19.5907123 16,24 C16,24.0016363 16.0000005,24.0032725 16.0000015,24.0049086 C16.0000005,24.0065441 16,24.0081803 16,24.0098166 L16,119.990183 C16,119.99182 16.0000005,119.993456 16.0000015,119.995092 C16.0000005,119.996727 16,119.998364 16,120 C16,124.409288 19.5813843,128 23.9992458,128 L104.000754,128 C106.205061,128 108.203844,127.105595 109.652065,125.659342 C111.102424,124.21251 112,122.214511 112,120.007595 L112,103.992405 C112,99.5776607 108.418278,96 104,96 C99.5907123,96 96,99.5783218 96,103.992405 L96,112 L32,112 L32,32 L96,32 L96,40.0075946 C96,44.4223393 99.581722,48 104,48 C108.409288,48 112,44.4216782 112,40.0075946 L112,23.9924054 C112,21.7851587 111.104671,19.7871591 109.657101,18.3409203 C108.203844,16.8944047 106.205061,16 104.000754,16 L88,16 C88,11.5907123 84.4151006,8 79.9929031,8 L48.0070969,8 C43.5881712,8 40,11.581722 40,16 Z M44,14.9958262 C44,12.7889923 45.7964248,11 48.0000255,11 L79.9999745,11 C82.2091276,11 84,12.7965212 84,14.9958262 L84,19.0041738 C84,21.2110077 82.2035752,23 79.9999745,23 L48.0000255,23 C45.7908724,23 44,21.2034788 44,19.0041738 L44,14.9958262 Z\"></path>\n\t\t<rect x=\"62\" y=\"64\" width=\"66\" height=\"16\" rx=\"8\"></rect>\n\t\t<path d=\"M60.6568542,85.6568542 L76.6568542,69.6568543 L65.3431458,69.6568542 L81.3431458,85.6568542 C84.4673401,88.7810486 89.5326599,88.7810486 92.6568542,85.6568542 C95.7810486,82.5326599 95.7810486,77.4673401 92.6568542,74.3431458 L76.6568542,58.3431458 C73.5326599,55.2189514 68.4673401,55.2189514 65.3431458,58.3431457 L49.3431458,74.3431457 C46.2189514,77.4673401 46.2189514,82.5326599 49.3431457,85.6568542 C52.4673401,88.7810486 57.5326599,88.7810486 60.6568542,85.6568542 L60.6568542,85.6568542 Z\" transform=\"translate(71.000000, 72.000000) rotate(-90.000000) translate(-71.000000, -72.000000) \"></path>\n\t</g>\n</svg>"
        },
        "$:/core/images/delete-button": {
            "title": "$:/core/images/delete-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-delete-button tc-image-button\" viewBox=\"0 0 128 128\" width=\"22pt\" height=\"22pt\">\n    <g fill-rule=\"evenodd\" transform=\"translate(12.000000, 0.000000)\">\n        <rect x=\"0\" y=\"11\" width=\"105\" height=\"16\" rx=\"8\"></rect>\n        <rect x=\"28\" y=\"0\" width=\"48\" height=\"16\" rx=\"8\"></rect>\n        <rect x=\"8\" y=\"16\" width=\"16\" height=\"112\" rx=\"8\"></rect>\n        <rect x=\"8\" y=\"112\" width=\"88\" height=\"16\" rx=\"8\"></rect>\n        <rect x=\"80\" y=\"16\" width=\"16\" height=\"112\" rx=\"8\"></rect>\n        <rect x=\"56\" y=\"16\" width=\"16\" height=\"112\" rx=\"8\"></rect>\n        <rect x=\"32\" y=\"16\" width=\"16\" height=\"112\" rx=\"8\"></rect>\n    </g>\n</svg>"
        },
        "$:/core/images/done-button": {
            "title": "$:/core/images/done-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-done-button tc-image-button\" viewBox=\"0 0 128 128\" width=\"22pt\" height=\"22pt\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M3.52445141,76.8322939 C2.07397484,75.3828178 1.17514421,73.3795385 1.17514421,71.1666288 L1.17514421,23.1836596 C1.17514421,18.7531992 4.75686621,15.1751442 9.17514421,15.1751442 C13.5844319,15.1751442 17.1751442,18.7606787 17.1751442,23.1836596 L17.1751442,63.1751442 L119.173716,63.1751442 C123.590457,63.1751442 127.175144,66.7568662 127.175144,71.1751442 C127.175144,75.5844319 123.592783,79.1751442 119.173716,79.1751442 L9.17657227,79.1751442 C6.96796403,79.1751442 4.9674142,78.279521 3.51911285,76.8315312 Z\" id=\"Rectangle-285\" transform=\"translate(64.175144, 47.175144) rotate(-45.000000) translate(-64.175144, -47.175144) \"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/down-arrow": {
            "title": "$:/core/images/down-arrow",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-down-arrow tc-image-button\" viewBox=\"0 0 128 128\" width=\"22pt\" height=\"22pt\">\n    <path d=\"M109.35638,81.3533152 C107.923899,82.7869182 105.94502,83.6751442 103.759224,83.6751442 L24.5910645,83.6751442 C20.225873,83.6751442 16.6751442,80.1307318 16.6751442,75.7584775 C16.6751442,71.3951199 20.2192225,67.8418109 24.5910645,67.8418109 L95.8418109,67.8418109 L95.8418109,-3.40893546 C95.8418109,-7.77412698 99.3862233,-11.3248558 103.758478,-11.3248558 C108.121835,-11.3248558 111.675144,-7.78077754 111.675144,-3.40893546 L111.675144,75.7592239 C111.675144,77.9416955 110.789142,79.9205745 109.356651,81.3538862 Z\" transform=\"translate(64.175144, 36.175144) rotate(45.000000) translate(-64.175144, -36.175144) \"></path>\n</svg>"
        },
        "$:/core/images/download-button": {
            "title": "$:/core/images/download-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-download-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\"><g fill-rule=\"evenodd\"><path class=\"tc-image-download-button-ring\" d=\"M64,128 C99.346224,128 128,99.346224 128,64 C128,28.653776 99.346224,0 64,0 C28.653776,0 0,28.653776 0,64 C0,99.346224 28.653776,128 64,128 Z M64,112 C90.509668,112 112,90.509668 112,64 C112,37.490332 90.509668,16 64,16 C37.490332,16 16,37.490332 16,64 C16,90.509668 37.490332,112 64,112 Z\"/><path d=\"M34.3496823,66.4308767 L61.2415823,93.634668 C63.0411536,95.4551107 65.9588502,95.4551107 67.7584215,93.634668 L94.6503215,66.4308767 C96.4498928,64.610434 96.4498928,61.6588981 94.6503215,59.8384554 C93.7861334,58.9642445 92.6140473,58.4731195 91.3919019,58.4731195 L82.9324098,58.4731195 C80.3874318,58.4731195 78.3243078,56.3860674 78.3243078,53.8115729 L78.3243078,38.6615466 C78.3243078,36.0870521 76.2611837,34 73.7162058,34 L55.283798,34 C52.7388201,34 50.675696,36.0870521 50.675696,38.6615466 L50.675696,38.6615466 L50.675696,53.8115729 C50.675696,56.3860674 48.612572,58.4731195 46.0675941,58.4731195 L37.608102,58.4731195 C35.063124,58.4731195 33,60.5601716 33,63.134666 C33,64.3709859 33.4854943,65.5566658 34.3496823,66.4308767 L34.3496823,66.4308767 Z\"/></g></svg>"
        },
        "$:/core/images/edit-button": {
            "title": "$:/core/images/edit-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-edit-button tc-image-button\" viewBox=\"0 0 128 128\" width=\"22pt\" height=\"22pt\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M116.870058,45.3431458 L108.870058,45.3431458 L108.870058,45.3431458 L108.870058,61.3431458 L116.870058,61.3431458 L116.870058,45.3431458 Z M124.870058,45.3431458 L127.649881,45.3431458 C132.066101,45.3431458 135.656854,48.9248678 135.656854,53.3431458 C135.656854,57.7524334 132.07201,61.3431458 127.649881,61.3431458 L124.870058,61.3431458 L124.870058,45.3431458 Z M100.870058,45.3431458 L15.6638275,45.3431458 C15.5064377,45.3431458 15.3501085,45.3476943 15.1949638,45.3566664 L15.1949638,45.3566664 C15.0628002,45.3477039 14.928279,45.3431458 14.7913977,45.3431458 C6.68160973,45.3431458 -8.34314575,53.3431458 -8.34314575,53.3431458 C-8.34314575,53.3431458 6.85614548,61.3431458 14.7913977,61.3431458 C14.9266533,61.3431458 15.0596543,61.3384973 15.190398,61.3293588 C15.3470529,61.3385075 15.5049057,61.3431458 15.6638275,61.3431458 L100.870058,61.3431458 L100.870058,45.3431458 L100.870058,45.3431458 Z\" transform=\"translate(63.656854, 53.343146) rotate(-45.000000) translate(-63.656854, -53.343146) \"></path>\n        <path d=\"M35.1714596,124.189544 C41.9594858,123.613403 49.068777,121.917633 58.85987,118.842282 C60.6854386,118.268877 62.4306907,117.705515 65.1957709,116.802278 C81.1962861,111.575575 87.0734839,109.994907 93.9414474,109.655721 C102.29855,109.242993 107.795169,111.785371 111.520478,118.355045 C112.610163,120.276732 115.051363,120.951203 116.97305,119.861518 C118.894737,118.771832 119.569207,116.330633 118.479522,114.408946 C113.146151,105.003414 104.734907,101.112919 93.5468356,101.66546 C85.6716631,102.054388 79.4899908,103.716944 62.7116783,109.197722 C59.9734132,110.092199 58.2519873,110.64787 56.4625698,111.20992 C37.002649,117.322218 25.6914684,118.282267 16.8654804,112.957098 C14.9739614,111.815848 12.5154166,112.424061 11.3741667,114.31558 C10.2329168,116.207099 10.84113,118.665644 12.7326489,119.806894 C19.0655164,123.627836 26.4866335,124.926678 35.1714596,124.189544 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/erase": {
            "title": "$:/core/images/erase",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-erase tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M60.0870401,127.996166 L123.102318,64.980888 C129.636723,58.4464827 129.629513,47.8655877 123.098967,41.3350425 L99.4657866,17.7018617 C92.927448,11.1635231 82.3486358,11.1698163 75.8199411,17.698511 L4.89768189,88.6207702 C-1.63672343,95.1551755 -1.6295126,105.736071 4.90103262,112.266616 L20.6305829,127.996166 L60.0870401,127.996166 Z M25.1375576,120.682546 L10.812569,106.357558 C7.5455063,103.090495 7.54523836,97.793808 10.8048093,94.5342371 L46.2691086,59.0699377 L81.7308914,94.5317205 L55.5800654,120.682546 L25.1375576,120.682546 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/excise": {
            "title": "$:/core/images/excise",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-excise tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M56,107.313709 L53.6568542,109.656854 C50.5326599,112.781049 45.4673401,112.781049 42.3431457,109.656854 C39.2189514,106.53266 39.2189514,101.46734 42.3431458,98.3431457 L58.3431458,82.3431457 C61.4673401,79.2189514 66.5326599,79.2189514 69.6568542,82.3431458 L85.6568542,98.3431458 C88.7810486,101.46734 88.7810486,106.53266 85.6568542,109.656854 C82.5326599,112.781049 77.4673401,112.781049 74.3431458,109.656854 L72,107.313708 L72,121.597798 C72,125.133636 68.418278,128 64,128 C59.581722,128 56,125.133636 56,121.597798 L56,107.313709 Z M0,40.0070969 C0,35.5848994 3.59071231,32 8,32 C12.418278,32 16,35.5881712 16,40.0070969 L16,71.9929031 C16,76.4151006 12.4092877,80 8,80 C3.581722,80 0,76.4118288 0,71.9929031 L0,40.0070969 Z M32,40.0070969 C32,35.5848994 35.5907123,32 40,32 C44.418278,32 48,35.5881712 48,40.0070969 L48,71.9929031 C48,76.4151006 44.4092877,80 40,80 C35.581722,80 32,76.4118288 32,71.9929031 L32,40.0070969 Z M80,40.0070969 C80,35.5848994 83.5907123,32 88,32 C92.418278,32 96,35.5881712 96,40.0070969 L96,71.9929031 C96,76.4151006 92.4092877,80 88,80 C83.581722,80 80,76.4118288 80,71.9929031 L80,40.0070969 Z M56,8.00709688 C56,3.58489938 59.5907123,0 64,0 C68.418278,0 72,3.58817117 72,8.00709688 L72,39.9929031 C72,44.4151006 68.4092877,48 64,48 C59.581722,48 56,44.4118288 56,39.9929031 L56,8.00709688 Z M112,40.0070969 C112,35.5848994 115.590712,32 120,32 C124.418278,32 128,35.5881712 128,40.0070969 L128,71.9929031 C128,76.4151006 124.409288,80 120,80 C115.581722,80 112,76.4118288 112,71.9929031 L112,40.0070969 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/export-button": {
            "title": "$:/core/images/export-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-export-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M8.00348646,127.999999 C8.00464867,128 8.00581094,128 8.00697327,128 L119.993027,128 C122.205254,128 124.207939,127.101378 125.657096,125.651198 L125.656838,125.65759 C127.104563,124.210109 128,122.21009 128,119.999949 L128,56.0000511 C128,51.5817449 124.409288,48 120,48 C115.581722,48 112,51.5797863 112,56.0000511 L112,112 L16,112 L16,56.0000511 C16,51.5817449 12.4092877,48 8,48 C3.581722,48 7.10542736e-15,51.5797863 7.10542736e-15,56.0000511 L7.10542736e-15,119.999949 C7.10542736e-15,124.418255 3.59071231,128 8,128 C8.00116233,128 8.0023246,128 8.00348681,127.999999 Z M56.6235633,27.3113724 L47.6580188,36.2769169 C44.5333664,39.4015692 39.4634864,39.4061295 36.339292,36.2819351 C33.2214548,33.1640979 33.2173444,28.0901742 36.3443103,24.9632084 L58.9616908,2.34582788 C60.5248533,0.782665335 62.5748436,0.000361191261 64.624516,2.38225238e-14 L64.6193616,0.00151809229 C66.6695374,0.000796251595 68.7211167,0.781508799 70.2854358,2.34582788 L92.9028163,24.9632084 C96.0274686,28.0878607 96.0320289,33.1577408 92.9078345,36.2819351 C89.7899973,39.3997724 84.7160736,39.4038827 81.5891078,36.2769169 L72.6235633,27.3113724 L72.6235633,88.5669606 C72.6235633,92.9781015 69.0418413,96.5662064 64.6235633,96.5662064 C60.2142756,96.5662064 56.6235633,92.984822 56.6235633,88.5669606 L56.6235633,27.3113724 L56.6235633,27.3113724 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/file": {
            "title": "$:/core/images/file",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-file tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"nonzero\">\n        <path d=\"M111.96811,30.5 L112,30.5 L112,119.999079 C112,124.417866 108.419113,128 104.000754,128 L23.9992458,128 C19.5813843,128 16,124.417687 16,119.999079 L16,8.00092105 C16,3.58213437 19.5808867,0 23.9992458,0 L81,0 L81,0.0201838424 C83.1589869,-0.071534047 85.3482153,0.707077645 86.9982489,2.35711116 L109.625176,24.9840387 C111.151676,26.510538 111.932942,28.4998414 111.96811,30.5 L111.96811,30.5 Z M81,8 L24,8 L24,120 L104,120 L104,30.5 L89.0003461,30.5 C84.5818769,30.5 81,26.9216269 81,22.4996539 L81,8 Z\"></path>\n        <rect x=\"32\" y=\"36\" width=\"64\" height=\"8\" rx=\"4\"></rect>\n        <rect x=\"32\" y=\"52\" width=\"64\" height=\"8\" rx=\"4\"></rect>\n        <rect x=\"32\" y=\"68\" width=\"64\" height=\"8\" rx=\"4\"></rect>\n        <rect x=\"32\" y=\"84\" width=\"64\" height=\"8\" rx=\"4\"></rect>\n        <rect x=\"32\" y=\"100\" width=\"64\" height=\"8\" rx=\"4\"></rect>\n        <rect x=\"32\" y=\"20\" width=\"40\" height=\"8\" rx=\"4\"></rect>\n    </g>\n</svg>"
        },
        "$:/core/images/fixed-height": {
            "title": "$:/core/images/fixed-height",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-fixed-height tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M60,35.6568542 L50.8284271,44.8284271 C49.26633,46.3905243 46.73367,46.3905243 45.1715729,44.8284271 C43.6094757,43.26633 43.6094757,40.73367 45.1715729,39.1715729 L61.1715729,23.1715729 C62.73367,21.6094757 65.2663299,21.6094757 66.8284271,23.1715728 L82.8284278,39.1715728 C84.390525,40.7336699 84.390525,43.2663299 82.8284279,44.8284271 C81.2663308,46.3905243 78.7336709,46.3905243 77.1715737,44.8284272 L68,35.6568539 L68,93.3431461 L77.1715737,84.1715728 C78.7336709,82.6094757 81.2663308,82.6094757 82.8284279,84.1715729 C84.390525,85.7336701 84.390525,88.2663301 82.8284278,89.8284272 L66.8284271,105.828427 C65.2663299,107.390524 62.73367,107.390524 61.1715729,105.828427 L45.1715729,89.8284271 C43.6094757,88.26633 43.6094757,85.73367 45.1715729,84.1715729 C46.73367,82.6094757 49.26633,82.6094757 50.8284271,84.1715729 L60,93.3431458 L60,35.6568542 L60,35.6568542 Z M16,116 L112,116 C114.209139,116 116,114.209139 116,112 C116,109.790861 114.209139,108 112,108 L16,108 C13.790861,108 12,109.790861 12,112 C12,114.209139 13.790861,116 16,116 L16,116 Z M16,20 L112,20 C114.209139,20 116,18.209139 116,16 C116,13.790861 114.209139,12 112,12 L16,12 C13.790861,12 12,13.790861 12,16 C12,18.209139 13.790861,20 16,20 L16,20 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/fold-all-button": {
            "title": "$:/core/images/fold-all-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-fold-all tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <rect x=\"0\" y=\"0\" width=\"128\" height=\"16\" rx=\"8\"></rect>\n        <rect x=\"0\" y=\"64\" width=\"128\" height=\"16\" rx=\"8\"></rect>\n        <path d=\"M64.0292774,58.6235628 C61.9791013,58.6242848 59.9275217,57.8435723 58.3632024,56.279253 L35.7458219,33.6618725 C32.6211696,30.5372202 32.6166093,25.4673401 35.7408036,22.3431458 C38.8586409,19.2253085 43.9325646,19.2211982 47.0595304,22.348164 L64.0250749,39.3137085 L80.9906194,22.348164 C84.1152717,19.2235117 89.1851518,19.2189514 92.3093461,22.3431458 C95.4271834,25.460983 95.4312937,30.5349067 92.3043279,33.6618725 L69.6869474,56.279253 C68.1237851,57.8424153 66.0737951,58.6247195 64.0241231,58.6250809 Z\" transform=\"translate(64.024316, 39.313708) scale(1, -1) translate(-64.024316, -39.313708) \"></path>\n        <path d=\"M64.0292774,123.621227 C61.9791013,123.621949 59.9275217,122.841236 58.3632024,121.276917 L35.7458219,98.6595365 C32.6211696,95.5348842 32.6166093,90.4650041 35.7408036,87.3408098 C38.8586409,84.2229725 43.9325646,84.2188622 47.0595304,87.345828 L64.0250749,104.311373 L80.9906194,87.345828 C84.1152717,84.2211757 89.1851518,84.2166154 92.3093461,87.3408098 C95.4271834,90.458647 95.4312937,95.5325707 92.3043279,98.6595365 L69.6869474,121.276917 C68.1237851,122.840079 66.0737951,123.622383 64.0241231,123.622745 Z\" transform=\"translate(64.024316, 104.311372) scale(1, -1) translate(-64.024316, -104.311372) \"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/fold-button": {
            "title": "$:/core/images/fold-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-fold tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <rect x=\"0\" y=\"0\" width=\"128\" height=\"16\" rx=\"8\"></rect>\n        <path d=\"M64.0292774,63.6235628 C61.9791013,63.6242848 59.9275217,62.8435723 58.3632024,61.279253 L35.7458219,38.6618725 C32.6211696,35.5372202 32.6166093,30.4673401 35.7408036,27.3431458 C38.8586409,24.2253085 43.9325646,24.2211982 47.0595304,27.348164 L64.0250749,44.3137085 L80.9906194,27.348164 C84.1152717,24.2235117 89.1851518,24.2189514 92.3093461,27.3431458 C95.4271834,30.460983 95.4312937,35.5349067 92.3043279,38.6618725 L69.6869474,61.279253 C68.1237851,62.8424153 66.0737951,63.6247195 64.0241231,63.6250809 Z\" transform=\"translate(64.024316, 44.313708) scale(1, -1) translate(-64.024316, -44.313708) \"></path>\n        <path d=\"M64.0049614,105.998482 C61.9547853,105.999204 59.9032057,105.218491 58.3388864,103.654172 L35.7215059,81.0367916 C32.5968535,77.9121393 32.5922933,72.8422592 35.7164876,69.7180649 C38.8343248,66.6002276 43.9082485,66.5961173 47.0352144,69.7230831 L64.0007589,86.6886276 L80.9663034,69.7230831 C84.0909557,66.5984308 89.1608358,66.5938705 92.2850301,69.7180649 C95.4028673,72.8359021 95.4069777,77.9098258 92.2800119,81.0367916 L69.6626314,103.654172 C68.099469,105.217334 66.0494791,105.999639 63.999807,106 Z\" transform=\"translate(64.000000, 86.688628) scale(1, -1) translate(-64.000000, -86.688628) \"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/fold-others-button": {
            "title": "$:/core/images/fold-others-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-fold-others tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <rect x=\"0\" y=\"56.0314331\" width=\"128\" height=\"16\" rx=\"8\"></rect>\n        <path d=\"M101.657101,104.948818 C100.207918,103.498614 98.2051847,102.599976 95.9929031,102.599976 L72,102.599976 L72,78.6070725 C72,76.3964271 71.1036108,74.3936927 69.6545293,72.9441002 L69.6571005,72.9488183 C68.2079177,71.4986143 66.2051847,70.5999756 63.9929031,70.5999756 L32.0070969,70.5999756 C27.5881712,70.5999756 24,74.1816976 24,78.5999756 C24,83.0092633 27.5848994,86.5999756 32.0070969,86.5999756 L56,86.5999756 L56,110.592879 C56,112.803524 56.8963895,114.806259 58.3454713,116.255852 L58.3429,116.251133 C59.7920828,117.701337 61.7948156,118.599976 64.0070969,118.599976 L88,118.599976 L88,142.592879 C88,147.011804 91.581722,150.599976 96,150.599976 C100.409288,150.599976 104,147.015076 104,142.592879 L104,110.607072 C104,108.396427 103.103611,106.393693 101.654529,104.9441 Z\" transform=\"translate(64.000000, 110.599976) rotate(-45.000000) translate(-64.000000, -110.599976) \"></path>\n        <path d=\"M101.725643,11.7488671 C100.27646,10.2986632 98.2737272,9.40002441 96.0614456,9.40002441 L72.0685425,9.40002441 L72.0685425,-14.5928787 C72.0685425,-16.8035241 71.1721533,-18.8062584 69.7230718,-20.255851 L69.725643,-20.2511329 C68.2764602,-21.7013368 66.2737272,-22.5999756 64.0614456,-22.5999756 L32.0756394,-22.5999756 C27.6567137,-22.5999756 24.0685425,-19.0182536 24.0685425,-14.5999756 C24.0685425,-10.1906879 27.6534419,-6.59997559 32.0756394,-6.59997559 L56.0685425,-6.59997559 L56.0685425,17.3929275 C56.0685425,19.6035732 56.964932,21.6063078 58.4140138,23.0559004 L58.4114425,23.0511823 C59.8606253,24.5013859 61.8633581,25.4000244 64.0756394,25.4000244 L88.0685425,25.4000244 L88.0685425,49.3929275 C88.0685425,53.8118532 91.6502645,57.4000244 96.0685425,57.4000244 C100.47783,57.4000244 104.068542,53.815125 104.068542,49.3929275 L104.068542,17.4071213 C104.068542,15.1964759 103.172153,13.1937416 101.723072,11.744149 Z\" transform=\"translate(64.068542, 17.400024) scale(1, -1) rotate(-45.000000) translate(-64.068542, -17.400024) \"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/folder": {
            "title": "$:/core/images/folder",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-folder tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M55.6943257,128.000004 L7.99859666,128.000004 C3.5810937,128.000004 0,124.413822 0,119.996384 L0,48.0036243 C0,43.5833471 3.58387508,40.0000044 7.99859666,40.0000044 L16,40.0000044 L16,31.9999914 C16,27.5817181 19.5783731,24 24.0003461,24 L55.9996539,24 C60.4181231,24 64,27.5800761 64,31.9999914 L64,40.0000044 L104.001403,40.0000044 C108.418906,40.0000044 112,43.5861868 112,48.0036243 L112,59.8298353 L104,59.7475921 L104,51.9994189 C104,49.7887607 102.207895,48.0000044 99.9972215,48.0000044 L56,48.0000044 L56,36.0000255 C56,33.7898932 54.2072328,32 51.9957423,32 L28.0042577,32 C25.7890275,32 24,33.7908724 24,36.0000255 L24,48.0000044 L12.0027785,48.0000044 C9.78987688,48.0000044 8,49.7906032 8,51.9994189 L8,116.00059 C8,118.211248 9.79210499,120.000004 12.0027785,120.000004 L58.7630167,120.000004 L55.6943257,128.000004 L55.6943257,128.000004 Z\"></path>\n        <path d=\"M23.8728955,55.5 L119.875702,55.5 C124.293205,55.5 126.87957,59.5532655 125.650111,64.5630007 L112.305967,118.936999 C111.077582,123.942356 106.497904,128 102.083183,128 L6.08037597,128 C1.66287302,128 -0.923492342,123.946735 0.305967145,118.936999 L13.650111,64.5630007 C14.878496,59.5576436 19.4581739,55.5 23.8728955,55.5 L23.8728955,55.5 L23.8728955,55.5 Z M25.6530124,64 L113.647455,64 C115.858129,64 117.151473,66.0930612 116.538306,68.6662267 L105.417772,115.333773 C104.803671,117.910859 102.515967,120 100.303066,120 L12.3086228,120 C10.0979492,120 8.8046054,117.906939 9.41777189,115.333773 L20.5383062,68.6662267 C21.1524069,66.0891409 23.4401107,64 25.6530124,64 L25.6530124,64 L25.6530124,64 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/full-screen-button": {
            "title": "$:/core/images/full-screen-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-full-screen-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g>\n        <g>\n            <path d=\"M5.29777586e-31,8 C1.59060409e-15,3.581722 3.581722,0 8,0 L40,0 C44.418278,0 48,3.581722 48,8 C48,12.418278 44.418278,16 40,16 L16,16 L16,40 C16,44.418278 12.418278,48 8,48 C3.581722,48 -3.55271368e-15,44.418278 0,40 L3.55271368e-15,8 Z\"></path>\n        </g>\n        <g transform=\"translate(104.000000, 104.000000) rotate(-180.000000) translate(-104.000000, -104.000000) translate(80.000000, 80.000000)\">\n            <path d=\"M5.29777586e-31,8 C1.59060409e-15,3.581722 3.581722,0 8,0 L40,0 C44.418278,0 48,3.581722 48,8 C48,12.418278 44.418278,16 40,16 L16,16 L16,40 C16,44.418278 12.418278,48 8,48 C3.581722,48 -3.55271368e-15,44.418278 0,40 L3.55271368e-15,8 Z\"></path>\n        </g>\n        <g transform=\"translate(24.000000, 104.000000) rotate(-90.000000) translate(-24.000000, -104.000000) translate(0.000000, 80.000000)\">\n            <path d=\"M5.29777586e-31,8 C1.59060409e-15,3.581722 3.581722,0 8,0 L40,0 C44.418278,0 48,3.581722 48,8 C48,12.418278 44.418278,16 40,16 L16,16 L16,40 C16,44.418278 12.418278,48 8,48 C3.581722,48 -3.55271368e-15,44.418278 0,40 L3.55271368e-15,8 Z\"></path>\n        </g>\n        <g transform=\"translate(104.000000, 24.000000) rotate(90.000000) translate(-104.000000, -24.000000) translate(80.000000, 0.000000)\">\n            <path d=\"M5.29777586e-31,8 C1.59060409e-15,3.581722 3.581722,0 8,0 L40,0 C44.418278,0 48,3.581722 48,8 C48,12.418278 44.418278,16 40,16 L16,16 L16,40 C16,44.418278 12.418278,48 8,48 C3.581722,48 -3.55271368e-15,44.418278 0,40 L3.55271368e-15,8 Z\"></path>\n        </g>\n    </g>\n</svg>"
        },
        "$:/core/images/github": {
            "title": "$:/core/images/github",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-github tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n        <g fill-rule=\"evenodd\">\n            <path d=\"M63.9383506,1.60695328 C28.6017227,1.60695328 -0.055756057,30.2970814 -0.055756057,65.6906208 C-0.055756057,94.003092 18.2804728,118.019715 43.7123154,126.493393 C46.9143781,127.083482 48.0812647,125.104717 48.0812647,123.405261 C48.0812647,121.886765 48.02626,117.85449 47.9948287,112.508284 C30.1929317,116.379268 26.4368926,103.916587 26.4368926,103.916587 C23.5255693,96.5129372 19.3294921,94.5420399 19.3294921,94.5420399 C13.5186324,90.5687739 19.7695302,90.6474524 19.7695302,90.6474524 C26.1933001,91.099854 29.5721638,97.2525155 29.5721638,97.2525155 C35.2808718,107.044059 44.5531024,104.215566 48.1991321,102.575118 C48.7806109,98.4366275 50.4346826,95.612068 52.2616263,94.0109598 C38.0507543,92.3941159 23.1091047,86.8944862 23.1091047,62.3389152 C23.1091047,55.3443933 25.6039634,49.6205298 29.6978889,45.1437211 C29.0378318,43.5229433 26.8415704,37.0044266 30.3265147,28.1845627 C30.3265147,28.1845627 35.6973364,26.4615028 47.9241083,34.7542205 C53.027764,33.330139 58.5046663,32.6220321 63.9462084,32.5944947 C69.3838216,32.6220321 74.856795,33.330139 79.9683085,34.7542205 C92.1872225,26.4615028 97.5501864,28.1845627 97.5501864,28.1845627 C101.042989,37.0044266 98.8467271,43.5229433 98.190599,45.1437211 C102.292382,49.6205298 104.767596,55.3443933 104.767596,62.3389152 C104.767596,86.9574291 89.8023734,92.3744463 75.5482834,93.9598188 C77.8427675,95.9385839 79.8897303,99.8489072 79.8897303,105.828476 C79.8897303,114.392635 79.8111521,121.304544 79.8111521,123.405261 C79.8111521,125.120453 80.966252,127.114954 84.2115327,126.489459 C109.623731,117.996111 127.944244,93.9952241 127.944244,65.6906208 C127.944244,30.2970814 99.2867652,1.60695328 63.9383506,1.60695328\"></path>\n        </g>\n    </svg>\n"
        },
        "$:/core/images/globe": {
            "title": "$:/core/images/globe",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-globe tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M72.8111354,37.1275855 C72.8111354,37.9789875 72.8111354,38.8303894 72.8111354,39.6817913 C72.8111354,41.8784743 73.7885604,46.5631866 72.8111354,48.5143758 C71.3445471,51.4420595 68.1617327,52.0543531 66.4170946,54.3812641 C65.2352215,55.9575873 61.7987417,64.9821523 62.7262858,67.3005778 C66.6959269,77.2228204 74.26087,70.4881886 80.6887657,76.594328 C81.5527211,77.415037 83.5758191,78.8666631 83.985137,79.8899578 C87.2742852,88.1128283 76.4086873,94.8989524 87.7419325,106.189751 C88.9872885,107.430443 91.555495,102.372895 91.8205061,101.575869 C92.6726866,99.0129203 98.5458765,96.1267309 100.908882,94.5234439 C102.928056,93.1534443 105.782168,91.8557166 107.236936,89.7775886 C109.507391,86.5342557 108.717505,82.2640435 110.334606,79.0328716 C112.473794,74.7585014 114.163418,69.3979002 116.332726,65.0674086 C120.230862,57.2857361 121.054075,67.1596684 121.400359,67.5059523 C121.757734,67.8633269 122.411167,67.5059523 122.916571,67.5059523 C123.011132,67.5059523 124.364019,67.6048489 124.432783,67.5059523 C125.0832,66.5705216 123.390209,49.5852316 123.114531,48.2089091 C121.710578,41.1996597 116.17083,32.4278331 111.249523,27.7092761 C104.975994,21.6942076 104.160516,11.5121686 92.9912146,12.7547535 C92.7872931,12.7774397 87.906794,22.9027026 85.2136766,26.2672064 C81.486311,30.9237934 82.7434931,22.1144904 78.6876623,22.1144904 C78.6065806,22.1144904 77.5045497,22.0107615 77.4353971,22.1144904 C76.8488637,22.9942905 75.9952305,26.0101404 75.1288269,26.5311533 C74.8635477,26.6906793 73.4071369,26.2924966 73.2826811,26.5311533 C71.0401728,30.8313939 81.5394677,28.7427264 79.075427,34.482926 C76.7225098,39.9642538 72.747373,32.4860199 72.747373,43.0434079\"></path>\n        <path d=\"M44.4668556,7.01044608 C54.151517,13.1403033 45.1489715,19.2084878 47.1611905,23.2253896 C48.8157833,26.5283781 51.4021933,28.6198851 48.8753629,33.038878 C46.8123257,36.6467763 42.0052989,37.0050492 39.251679,39.7621111 C36.2115749,42.8060154 33.7884281,48.7028116 32.4624592,52.6732691 C30.8452419,57.5158356 47.0088721,59.5388126 44.5246867,63.6811917 C43.1386839,65.9923513 37.7785192,65.1466282 36.0880227,63.8791519 C34.9234453,63.0059918 32.4946425,63.3331166 31.6713597,62.0997342 C29.0575851,58.1839669 29.4107339,54.0758543 28.0457962,49.9707786 C27.1076833,47.1493864 21.732611,47.8501656 20.2022714,49.3776393 C19.6790362,49.8998948 19.8723378,51.1703278 19.8723378,51.8829111 C19.8723378,57.1682405 26.9914913,55.1986414 26.9914913,58.3421973 C26.9914913,72.9792302 30.9191897,64.8771867 38.1313873,69.6793121 C48.1678018,76.3618966 45.9763926,76.981595 53.0777543,84.0829567 C56.7511941,87.7563965 60.8192437,87.7689005 62.503478,93.3767069 C64.1046972,98.7081071 53.1759798,98.7157031 50.786754,100.825053 C49.663965,101.816317 47.9736094,104.970571 46.5680513,105.439676 C44.7757187,106.037867 43.334221,105.93607 41.6242359,107.219093 C39.1967302,109.040481 37.7241465,112.151588 37.6034934,112.030935 C35.4555278,109.88297 34.0848666,96.5511248 33.7147244,93.7726273 C33.1258872,89.3524817 28.1241923,88.2337027 26.7275443,84.7420826 C25.1572737,80.8164061 28.2518481,75.223612 25.599097,70.9819941 C19.0797019,60.557804 13.7775712,56.4811506 10.2493953,44.6896152 C9.3074899,41.5416683 13.5912267,38.1609942 15.1264825,35.8570308 C17.0029359,33.0410312 17.7876232,30.0028946 19.8723378,27.2224065 C22.146793,24.1888519 40.8551166,9.46076832 43.8574051,8.63490613 L44.4668556,7.01044608 Z\"></path>\n        <path d=\"M64,126 C98.2416545,126 126,98.2416545 126,64 C126,29.7583455 98.2416545,2 64,2 C29.7583455,2 2,29.7583455 2,64 C2,98.2416545 29.7583455,126 64,126 Z M64,120 C94.927946,120 120,94.927946 120,64 C120,33.072054 94.927946,8 64,8 C33.072054,8 8,33.072054 8,64 C8,94.927946 33.072054,120 64,120 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/heading-1": {
            "title": "$:/core/images/heading-1",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-heading-1 tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M14,30 L27.25,30 L27.25,60.104 L61.7,60.104 L61.7,30 L74.95,30 L74.95,105.684 L61.7,105.684 L61.7,71.552 L27.25,71.552 L27.25,105.684 L14,105.684 L14,30 Z M84.3350766,43.78 C86.8790893,43.78 89.3523979,43.5680021 91.7550766,43.144 C94.1577553,42.7199979 96.3307336,42.0133383 98.2740766,41.024 C100.21742,40.0346617 101.87807,38.7626744 103.256077,37.208 C104.634084,35.6533256 105.535075,33.7453446 105.959077,31.484 L115.817077,31.484 L115.817077,105.684 L102.567077,105.684 L102.567077,53.32 L84.3350766,53.32 L84.3350766,43.78 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/heading-2": {
            "title": "$:/core/images/heading-2",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-heading-2 tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M6,30 L19.25,30 L19.25,60.104 L53.7,60.104 L53.7,30 L66.95,30 L66.95,105.684 L53.7,105.684 L53.7,71.552 L19.25,71.552 L19.25,105.684 L6,105.684 L6,30 Z M125.519077,105.684 L74.8510766,105.684 C74.9217436,99.5359693 76.4057288,94.1653563 79.3030766,89.572 C82.2004244,84.9786437 86.1577182,80.986017 91.1750766,77.594 C93.5777553,75.8273245 96.0863969,74.113675 98.7010766,72.453 C101.315756,70.792325 103.718399,69.0080095 105.909077,67.1 C108.099754,65.1919905 109.901736,63.1250111 111.315077,60.899 C112.728417,58.6729889 113.47041,56.1113478 113.541077,53.214 C113.541077,51.8713266 113.382078,50.4403409 113.064077,48.921 C112.746075,47.4016591 112.127748,45.9883399 111.209077,44.681 C110.290405,43.3736601 109.018418,42.2783377 107.393077,41.395 C105.767735,40.5116622 103.647756,40.07 101.033077,40.07 C98.6303979,40.07 96.6340846,40.5469952 95.0440766,41.501 C93.4540687,42.4550048 92.1820814,43.762325 91.2280766,45.423 C90.2740719,47.083675 89.5674123,49.0446554 89.1080766,51.306 C88.648741,53.5673446 88.3837436,56.0053203 88.3130766,58.62 L76.2290766,58.62 C76.2290766,54.5213128 76.7767378,50.7230175 77.8720766,47.225 C78.9674154,43.7269825 80.610399,40.7060127 82.8010766,38.162 C84.9917542,35.6179873 87.6593942,33.6216739 90.8040766,32.173 C93.948759,30.7243261 97.6057224,30 101.775077,30 C106.297766,30 110.078395,30.7419926 113.117077,32.226 C116.155758,33.7100074 118.611401,35.5826554 120.484077,37.844 C122.356753,40.1053446 123.681739,42.5609868 124.459077,45.211 C125.236414,47.8610133 125.625077,50.3873213 125.625077,52.79 C125.625077,55.7580148 125.165748,58.4433213 124.247077,60.846 C123.328405,63.2486787 122.091751,65.4569899 120.537077,67.471 C118.982402,69.4850101 117.215753,71.3399915 115.237077,73.036 C113.2584,74.7320085 111.209087,76.3219926 109.089077,77.806 C106.969066,79.2900074 104.849087,80.7033266 102.729077,82.046 C100.609066,83.3886734 98.6480856,84.7313266 96.8460766,86.074 C95.0440676,87.4166734 93.47175,88.8123261 92.1290766,90.261 C90.7864032,91.7096739 89.8677458,93.2466585 89.3730766,94.872 L125.519077,94.872 L125.519077,105.684 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/heading-3": {
            "title": "$:/core/images/heading-3",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-heading-3 tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M6,30 L19.25,30 L19.25,60.104 L53.7,60.104 L53.7,30 L66.95,30 L66.95,105.684 L53.7,105.684 L53.7,71.552 L19.25,71.552 L19.25,105.684 L6,105.684 L6,30 Z M94.8850766,62.224 C96.8637532,62.294667 98.8424001,62.1533351 100.821077,61.8 C102.799753,61.4466649 104.566402,60.8283378 106.121077,59.945 C107.675751,59.0616623 108.930072,57.8426744 109.884077,56.288 C110.838081,54.7333256 111.315077,52.8253446 111.315077,50.564 C111.315077,47.3839841 110.237421,44.8400095 108.082077,42.932 C105.926733,41.0239905 103.153094,40.07 99.7610766,40.07 C97.641066,40.07 95.8037511,40.4939958 94.2490766,41.342 C92.6944022,42.1900042 91.4047484,43.3383261 90.3800766,44.787 C89.3554048,46.2356739 88.5957458,47.860991 88.1010766,49.663 C87.6064075,51.465009 87.3944096,53.3199905 87.4650766,55.228 L75.3810766,55.228 C75.5224107,51.623982 76.1937373,48.2850154 77.3950766,45.211 C78.596416,42.1369846 80.2393995,39.4693446 82.3240766,37.208 C84.4087537,34.9466554 86.9350618,33.1800064 89.9030766,31.908 C92.8710915,30.6359936 96.2277246,30 99.9730766,30 C102.870424,30 105.714729,30.4239958 108.506077,31.272 C111.297424,32.1200042 113.806065,33.3566585 116.032077,34.982 C118.258088,36.6073415 120.042403,38.6743208 121.385077,41.183 C122.72775,43.6916792 123.399077,46.5713171 123.399077,49.822 C123.399077,53.5673521 122.551085,56.8356527 120.855077,59.627 C119.159068,62.4183473 116.509095,64.4499936 112.905077,65.722 L112.905077,65.934 C117.145098,66.7820042 120.448731,68.8843166 122.816077,72.241 C125.183422,75.5976835 126.367077,79.6786426 126.367077,84.484 C126.367077,88.017351 125.660417,91.1796527 124.247077,93.971 C122.833736,96.7623473 120.925755,99.129657 118.523077,101.073 C116.120398,103.016343 113.329093,104.517995 110.149077,105.578 C106.969061,106.638005 103.612428,107.168 100.079077,107.168 C95.7683884,107.168 92.005426,106.549673 88.7900766,105.313 C85.5747272,104.076327 82.8894207,102.327345 80.7340766,100.066 C78.5787325,97.8046554 76.9357489,95.0840159 75.8050766,91.904 C74.6744043,88.7239841 74.0737436,85.1906861 74.0030766,81.304 L86.0870766,81.304 C85.9457426,85.8266893 87.0587315,89.5896517 89.4260766,92.593 C91.7934218,95.5963483 95.3443863,97.098 100.079077,97.098 C104.107097,97.098 107.481396,95.9496782 110.202077,93.653 C112.922757,91.3563219 114.283077,88.0880212 114.283077,83.848 C114.283077,80.9506522 113.717749,78.6540085 112.587077,76.958 C111.456404,75.2619915 109.972419,73.9723378 108.135077,73.089 C106.297734,72.2056623 104.230755,71.6580011 101.934077,71.446 C99.6373985,71.2339989 97.2877553,71.163333 94.8850766,71.234 L94.8850766,62.224 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/heading-4": {
            "title": "$:/core/images/heading-4",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-heading-4 tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M8,30 L21.25,30 L21.25,60.104 L55.7,60.104 L55.7,30 L68.95,30 L68.95,105.684 L55.7,105.684 L55.7,71.552 L21.25,71.552 L21.25,105.684 L8,105.684 L8,30 Z M84.5890766,78.548 L107.061077,78.548 L107.061077,45.9 L106.849077,45.9 L84.5890766,78.548 Z M128.049077,88.088 L118.509077,88.088 L118.509077,105.684 L107.061077,105.684 L107.061077,88.088 L75.2610766,88.088 L75.2610766,76.11 L107.061077,31.484 L118.509077,31.484 L118.509077,78.548 L128.049077,78.548 L128.049077,88.088 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/heading-5": {
            "title": "$:/core/images/heading-5",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-heading-5 tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M6,30 L19.25,30 L19.25,60.104 L53.7,60.104 L53.7,30 L66.95,30 L66.95,105.684 L53.7,105.684 L53.7,71.552 L19.25,71.552 L19.25,105.684 L6,105.684 L6,30 Z M83.7550766,31.484 L122.127077,31.484 L122.127077,42.296 L92.7650766,42.296 L88.9490766,61.164 L89.1610766,61.376 C90.7864181,59.5386575 92.8533974,58.1430048 95.3620766,57.189 C97.8707558,56.2349952 100.361731,55.758 102.835077,55.758 C106.509762,55.758 109.795729,56.3763272 112.693077,57.613 C115.590424,58.8496729 118.0284,60.5809889 120.007077,62.807 C121.985753,65.0330111 123.487405,67.6653181 124.512077,70.704 C125.536748,73.7426819 126.049077,77.028649 126.049077,80.562 C126.049077,83.5300148 125.572081,86.5863176 124.618077,89.731 C123.664072,92.8756824 122.144754,95.7376538 120.060077,98.317 C117.9754,100.896346 115.30776,103.016325 112.057077,104.677 C108.806394,106.337675 104.919766,107.168 100.397077,107.168 C96.7930586,107.168 93.454092,106.691005 90.3800766,105.737 C87.3060613,104.782995 84.6030883,103.35201 82.2710766,101.444 C79.939065,99.5359905 78.0840835,97.1863473 76.7060766,94.395 C75.3280697,91.6036527 74.5684107,88.3353521 74.4270766,84.59 L86.5110766,84.59 C86.8644117,88.6180201 88.2423979,91.7096559 90.6450766,93.865 C93.0477553,96.0203441 96.2277235,97.098 100.185077,97.098 C102.729089,97.098 104.884401,96.6740042 106.651077,95.826 C108.417752,94.9779958 109.848738,93.8120074 110.944077,92.328 C112.039415,90.8439926 112.816741,89.1126766 113.276077,87.134 C113.735412,85.1553234 113.965077,83.0353446 113.965077,80.774 C113.965077,78.7246564 113.682413,76.763676 113.117077,74.891 C112.55174,73.018324 111.703749,71.3753404 110.573077,69.962 C109.442404,68.5486596 107.976086,67.4180042 106.174077,66.57 C104.372068,65.7219958 102.269755,65.298 99.8670766,65.298 C97.3230639,65.298 94.9380878,65.7749952 92.7120766,66.729 C90.4860655,67.6830048 88.8784149,69.4673203 87.8890766,72.082 L75.8050766,72.082 L83.7550766,31.484 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/heading-6": {
            "title": "$:/core/images/heading-6",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-heading-6 tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M6,30 L19.25,30 L19.25,60.104 L53.7,60.104 L53.7,30 L66.95,30 L66.95,105.684 L53.7,105.684 L53.7,71.552 L19.25,71.552 L19.25,105.684 L6,105.684 L6,30 Z M112.587077,50.246 C112.304409,47.2073181 111.226753,44.751676 109.354077,42.879 C107.481401,41.006324 104.955093,40.07 101.775077,40.07 C99.584399,40.07 97.6940846,40.4763293 96.1040766,41.289 C94.5140687,42.1016707 93.1714154,43.1793266 92.0760766,44.522 C90.9807378,45.8646734 90.0974133,47.401658 89.4260766,49.133 C88.7547399,50.864342 88.2070787,52.6839905 87.7830766,54.592 C87.3590745,56.5000095 87.0587442,58.390324 86.8820766,60.263 C86.7054091,62.135676 86.5464107,63.8846585 86.4050766,65.51 L86.6170766,65.722 C88.2424181,62.7539852 90.4860623,60.5456739 93.3480766,59.097 C96.2100909,57.6483261 99.3017267,56.924 102.623077,56.924 C106.297762,56.924 109.583729,57.5599936 112.481077,58.832 C115.378424,60.1040064 117.834067,61.8529889 119.848077,64.079 C121.862087,66.3050111 123.399071,68.9373181 124.459077,71.976 C125.519082,75.0146819 126.049077,78.300649 126.049077,81.834 C126.049077,85.438018 125.466082,88.7769846 124.300077,91.851 C123.134071,94.9250154 121.455754,97.6103219 119.265077,99.907 C117.074399,102.203678 114.459758,103.987994 111.421077,105.26 C108.382395,106.532006 105.025762,107.168 101.351077,107.168 C95.9097161,107.168 91.4400941,106.16101 87.9420766,104.147 C84.4440591,102.13299 81.6880867,99.3770175 79.6740766,95.879 C77.6600666,92.3809825 76.2644138,88.2823568 75.4870766,83.583 C74.7097394,78.8836432 74.3210766,73.8133605 74.3210766,68.372 C74.3210766,63.9199777 74.7980719,59.4326893 75.7520766,54.91 C76.7060814,50.3873107 78.278399,46.2710186 80.4690766,42.561 C82.6597542,38.8509815 85.5393921,35.8300117 89.1080766,33.498 C92.6767611,31.1659883 97.0757171,30 102.305077,30 C105.273091,30 108.064397,30.4946617 110.679077,31.484 C113.293756,32.4733383 115.608067,33.8513245 117.622077,35.618 C119.636087,37.3846755 121.27907,39.5046543 122.551077,41.978 C123.823083,44.4513457 124.529743,47.2073181 124.671077,50.246 L112.587077,50.246 Z M100.927077,97.098 C103.117754,97.098 105.025735,96.6563378 106.651077,95.773 C108.276418,94.8896623 109.636738,93.7413404 110.732077,92.328 C111.827415,90.9146596 112.640074,89.271676 113.170077,87.399 C113.700079,85.526324 113.965077,83.6006766 113.965077,81.622 C113.965077,79.6433234 113.700079,77.7353425 113.170077,75.898 C112.640074,74.0606575 111.827415,72.4530069 110.732077,71.075 C109.636738,69.6969931 108.276418,68.5840042 106.651077,67.736 C105.025735,66.8879958 103.117754,66.464 100.927077,66.464 C98.736399,66.464 96.8107516,66.8703293 95.1500766,67.683 C93.4894017,68.4956707 92.0937489,69.5909931 90.9630766,70.969 C89.8324043,72.3470069 88.9844128,73.9546575 88.4190766,75.792 C87.8537405,77.6293425 87.5710766,79.5726564 87.5710766,81.622 C87.5710766,83.6713436 87.8537405,85.6146575 88.4190766,87.452 C88.9844128,89.2893425 89.8324043,90.9323261 90.9630766,92.381 C92.0937489,93.8296739 93.4894017,94.9779958 95.1500766,95.826 C96.8107516,96.6740042 98.736399,97.098 100.927077,97.098 L100.927077,97.098 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/help": {
            "title": "$:/core/images/help",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-help tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M36.0548906,111.44117 C30.8157418,115.837088 20.8865444,118.803477 9.5,118.803477 C7.86465619,118.803477 6.25937294,118.742289 4.69372699,118.624467 C12.612543,115.984876 18.7559465,110.02454 21.0611049,102.609942 C8.74739781,92.845129 1.04940554,78.9359851 1.04940554,63.5 C1.04940554,33.9527659 29.2554663,10 64.0494055,10 C98.8433448,10 127.049406,33.9527659 127.049406,63.5 C127.049406,93.0472341 98.8433448,117 64.0494055,117 C53.9936953,117 44.48824,114.999337 36.0548906,111.44117 L36.0548906,111.44117 Z M71.4042554,77.5980086 C71.406883,77.2865764 71.4095079,76.9382011 71.4119569,76.5610548 C71.4199751,75.3262169 71.4242825,74.0811293 71.422912,72.9158546 C71.4215244,71.736154 71.4143321,70.709635 71.4001396,69.8743525 C71.4078362,68.5173028 71.9951951,67.7870427 75.1273009,65.6385471 C75.2388969,65.5619968 76.2124091,64.8981068 76.5126553,64.6910879 C79.6062455,62.5580654 81.5345849,60.9050204 83.2750652,58.5038955 C85.6146327,55.2762841 86.8327108,51.426982 86.8327108,46.8554323 C86.8327108,33.5625756 76.972994,24.9029551 65.3778484,24.9029551 C54.2752771,24.9029551 42.8794554,34.5115163 41.3121702,47.1975534 C40.9043016,50.4989536 43.2499725,53.50591 46.5513726,53.9137786 C49.8527728,54.3216471 52.8597292,51.9759763 53.2675978,48.6745761 C54.0739246,42.1479456 60.2395837,36.9492759 65.3778484,36.9492759 C70.6427674,36.9492759 74.78639,40.5885487 74.78639,46.8554323 C74.78639,50.4892974 73.6853224,52.008304 69.6746221,54.7736715 C69.4052605,54.9593956 68.448509,55.6118556 68.3131127,55.7047319 C65.6309785,57.5445655 64.0858213,58.803255 62.6123358,60.6352315 C60.5044618,63.2559399 59.3714208,66.3518252 59.3547527,69.9487679 C59.3684999,70.8407274 59.3752803,71.8084521 59.3765995,72.9300232 C59.3779294,74.0607297 59.3737237,75.2764258 59.36589,76.482835 C59.3634936,76.8518793 59.3609272,77.1924914 59.3583633,77.4963784 C59.3568319,77.6778944 59.3556368,77.8074256 59.3549845,77.8730928 C59.3219814,81.1994287 61.9917551,83.9227111 65.318091,83.9557142 C68.644427,83.9887173 71.3677093,81.3189435 71.4007124,77.9926076 C71.4014444,77.9187458 71.402672,77.7856841 71.4042554,77.5980086 Z M65.3778489,102.097045 C69.5359735,102.097045 72.9067994,98.7262189 72.9067994,94.5680944 C72.9067994,90.4099698 69.5359735,87.0391439 65.3778489,87.0391439 C61.2197243,87.0391439 57.8488984,90.4099698 57.8488984,94.5680944 C57.8488984,98.7262189 61.2197243,102.097045 65.3778489,102.097045 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/home-button": {
            "title": "$:/core/images/home-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-home-button tc-image-button\" viewBox=\"0 0 128 128\" width=\"22pt\" height=\"22pt\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M112.9847,119.501583 C112.99485,119.336814 113,119.170705 113,119.003406 L113,67.56802 C116.137461,70.5156358 121.076014,70.4518569 124.133985,67.3938855 C127.25818,64.2696912 127.260618,59.2068102 124.131541,56.0777326 L70.3963143,2.34250601 C68.8331348,0.779326498 66.7828947,-0.000743167069 64.7337457,1.61675364e-05 C62.691312,-0.00409949529 60.6426632,0.777559815 59.077717,2.34250601 L33,28.420223 L33,28.420223 L33,8.00697327 C33,3.58484404 29.4092877,0 25,0 C20.581722,0 17,3.59075293 17,8.00697327 L17,44.420223 L5.3424904,56.0777326 C2.21694607,59.2032769 2.22220878,64.2760483 5.34004601,67.3938855 C8.46424034,70.5180798 13.5271213,70.5205187 16.6561989,67.3914411 L17,67.04764 L17,119.993027 C17,119.994189 17.0000002,119.995351 17.0000007,119.996514 C17.0000002,119.997675 17,119.998838 17,120 C17,124.418278 20.5881049,128 24.9992458,128 L105.000754,128 C109.418616,128 113,124.409288 113,120 C113,119.832611 112.99485,119.666422 112.9847,119.501583 Z M97,112 L97,51.5736087 L97,51.5736087 L64.7370156,19.3106244 L33,51.04764 L33,112 L97,112 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/import-button": {
            "title": "$:/core/images/import-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-import-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M105.449437,94.2138951 C105.449437,94.2138951 110.049457,94.1897106 110.049457,99.4026111 C110.049457,104.615512 105.163246,104.615511 105.163246,104.615511 L45.0075072,105.157833 C45.0075072,105.157833 0.367531803,106.289842 0.367532368,66.6449212 C0.367532934,27.0000003 45.0428249,27.0000003 45.0428249,27.0000003 L105.532495,27.0000003 C105.532495,27.0000003 138.996741,25.6734987 138.996741,55.1771866 C138.996741,84.6808745 105.727102,82.8457535 105.727102,82.8457535 L56.1735087,82.8457535 C56.1735087,82.8457535 22.6899229,85.1500223 22.6899229,66.0913753 C22.6899229,47.0327282 56.1735087,49.3383013 56.1735087,49.3383013 L105.727102,49.3383013 C105.727102,49.3383013 111.245209,49.3383024 111.245209,54.8231115 C111.245209,60.3079206 105.727102,60.5074524 105.727102,60.5074524 L56.1735087,60.5074524 C56.1735087,60.5074524 37.48913,60.5074528 37.48913,66.6449195 C37.48913,72.7823862 56.1735087,71.6766023 56.1735087,71.6766023 L105.727102,71.6766029 C105.727102,71.6766029 127.835546,73.1411469 127.835546,55.1771866 C127.835546,35.5304025 105.727102,38.3035317 105.727102,38.3035317 L45.0428249,38.3035317 C45.0428249,38.3035317 11.5287276,38.3035313 11.5287276,66.6449208 C11.5287276,94.9863103 45.0428244,93.9579678 45.0428244,93.9579678 L105.449437,94.2138951 Z\" transform=\"translate(69.367532, 66.000000) rotate(-45.000000) translate(-69.367532, -66.000000) \"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/info-button": {
            "title": "$:/core/images/info-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-info-button tc-image-button\" viewBox=\"0 0 128 128\" width=\"22pt\" height=\"22pt\">\n    <g fill-rule=\"evenodd\">\n        <g transform=\"translate(0.049406, 0.000000)\">\n            <path d=\"M64,128 C99.346224,128 128,99.346224 128,64 C128,28.653776 99.346224,0 64,0 C28.653776,0 0,28.653776 0,64 C0,99.346224 28.653776,128 64,128 Z M64,112 C90.509668,112 112,90.509668 112,64 C112,37.490332 90.509668,16 64,16 C37.490332,16 16,37.490332 16,64 C16,90.509668 37.490332,112 64,112 Z\"></path>\n            <circle cx=\"64\" cy=\"32\" r=\"8\"></circle>\n            <rect x=\"56\" y=\"48\" width=\"16\" height=\"56\" rx=\"8\"></rect>\n        </g>\n    </g>\n</svg>"
        },
        "$:/core/images/italic": {
            "title": "$:/core/images/italic",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-italic tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n         <polygon points=\"66.7114846 0 89.1204482 0 62.4089636 128 40 128\"></polygon>\n    </g>\n</svg>"
        },
        "$:/core/images/left-arrow": {
            "created": "20150315234410875",
            "modified": "20150315235324760",
            "tags": "$:/tags/Image",
            "title": "$:/core/images/left-arrow",
            "text": "<svg class=\"tc-image-left-arrow tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <path transform=\"rotate(135, 63.8945, 64.1752)\" d=\"m109.07576,109.35336c-1.43248,1.43361 -3.41136,2.32182 -5.59717,2.32182l-79.16816,0c-4.36519,0 -7.91592,-3.5444 -7.91592,-7.91666c0,-4.36337 3.54408,-7.91667 7.91592,-7.91667l71.25075,0l0,-71.25075c0,-4.3652 3.54442,-7.91592 7.91667,-7.91592c4.36336,0 7.91667,3.54408 7.91667,7.91592l0,79.16815c0,2.1825 -0.88602,4.16136 -2.3185,5.59467l-0.00027,-0.00056z\"/>\n</svg>\n"
        },
        "$:/core/images/line-width": {
            "title": "$:/core/images/line-width",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-line-width tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M128,-97 L112.992786,-97 C112.452362,-97 112,-96.5522847 112,-96 C112,-95.4438648 112.444486,-95 112.992786,-95 L128,-95 L128,-97 Z M128,-78.6794919 L111.216185,-88.3696322 C110.748163,-88.6398444 110.132549,-88.4782926 109.856406,-88 C109.578339,-87.5183728 109.741342,-86.9117318 110.216185,-86.6375814 L128,-76.3700908 L128,-78.6794919 Z M78.6794919,-128 L88.3696322,-111.216185 C88.6437826,-110.741342 88.4816272,-110.134474 88,-109.856406 C87.5217074,-109.580264 86.9077936,-109.748163 86.6375814,-110.216185 L76.3700908,-128 L78.6794919,-128 Z M97,-128 L97,-112.992786 C97,-112.444486 96.5561352,-112 96,-112 C95.4477153,-112 95,-112.452362 95,-112.992786 L95,-128 L97,-128 Z M115.629909,-128 L105.362419,-110.216185 C105.088268,-109.741342 104.481627,-109.578339 104,-109.856406 C103.521707,-110.132549 103.360156,-110.748163 103.630368,-111.216185 L113.320508,-128 L115.629909,-128 Z M128,-113.320508 L111.216185,-103.630368 C110.741342,-103.356217 110.134474,-103.518373 109.856406,-104 C109.580264,-104.478293 109.748163,-105.092206 110.216185,-105.362419 L128,-115.629909 L128,-113.320508 Z M48,-96 C48,-96.5522847 48.4523621,-97 48.9927864,-97 L79.0072136,-97 C79.5555144,-97 80,-96.5561352 80,-96 C80,-95.4477153 79.5476379,-95 79.0072136,-95 L48.9927864,-95 C48.4444856,-95 48,-95.4438648 48,-96 Z M54.4307806,-120 C54.706923,-120.478293 55.3225377,-120.639844 55.7905589,-120.369632 L81.7838153,-105.362419 C82.2586577,-105.088268 82.4216611,-104.481627 82.1435935,-104 C81.8674512,-103.521707 81.2518365,-103.360156 80.7838153,-103.630368 L54.7905589,-118.637581 C54.3157165,-118.911732 54.152713,-119.518373 54.4307806,-120 Z M104,-82.1435935 C104.478293,-82.4197359 105.092206,-82.2518365 105.362419,-81.7838153 L120.369632,-55.7905589 C120.643783,-55.3157165 120.481627,-54.7088482 120,-54.4307806 C119.521707,-54.1546382 118.907794,-54.3225377 118.637581,-54.7905589 L103.630368,-80.7838153 C103.356217,-81.2586577 103.518373,-81.865526 104,-82.1435935 Z M96,-80 C96.5522847,-80 97,-79.5476379 97,-79.0072136 L97,-48.9927864 C97,-48.4444856 96.5561352,-48 96,-48 C95.4477153,-48 95,-48.4523621 95,-48.9927864 L95,-79.0072136 C95,-79.5555144 95.4438648,-80 96,-80 Z M88,-82.1435935 C88.4782926,-81.8674512 88.6398444,-81.2518365 88.3696322,-80.7838153 L73.3624186,-54.7905589 C73.0882682,-54.3157165 72.4816272,-54.152713 72,-54.4307806 C71.5217074,-54.706923 71.3601556,-55.3225377 71.6303678,-55.7905589 L86.6375814,-81.7838153 C86.9117318,-82.2586577 87.5183728,-82.4216611 88,-82.1435935 Z M82.1435935,-88 C82.4197359,-87.5217074 82.2518365,-86.9077936 81.7838153,-86.6375814 L55.7905589,-71.6303678 C55.3157165,-71.3562174 54.7088482,-71.5183728 54.4307806,-72 C54.1546382,-72.4782926 54.3225377,-73.0922064 54.7905589,-73.3624186 L80.7838153,-88.3696322 C81.2586577,-88.6437826 81.865526,-88.4816272 82.1435935,-88 Z M1.30626177e-08,-41.9868843 L15.0170091,-57.9923909 L20.7983821,-52.9749272 L44.7207091,-81.2095939 L73.4260467,-42.1002685 L85.984793,-56.6159488 L104.48741,-34.0310661 L127.969109,-47.4978019 L127.969109,7.99473128e-07 L1.30626177e-08,7.99473128e-07 L1.30626177e-08,-41.9868843 Z M96,-84 C102.627417,-84 108,-89.372583 108,-96 C108,-102.627417 102.627417,-108 96,-108 C89.372583,-108 84,-102.627417 84,-96 C84,-89.372583 89.372583,-84 96,-84 Z\"></path>\n        <path d=\"M16,18 L112,18 C113.104569,18 114,17.1045695 114,16 C114,14.8954305 113.104569,14 112,14 L16,14 C14.8954305,14 14,14.8954305 14,16 C14,17.1045695 14.8954305,18 16,18 L16,18 Z M16,35 L112,35 C114.209139,35 116,33.209139 116,31 C116,28.790861 114.209139,27 112,27 L16,27 C13.790861,27 12,28.790861 12,31 C12,33.209139 13.790861,35 16,35 L16,35 Z M16,56 L112,56 C115.313708,56 118,53.3137085 118,50 C118,46.6862915 115.313708,44 112,44 L16,44 C12.6862915,44 10,46.6862915 10,50 C10,53.3137085 12.6862915,56 16,56 L16,56 Z M16,85 L112,85 C117.522847,85 122,80.5228475 122,75 C122,69.4771525 117.522847,65 112,65 L16,65 C10.4771525,65 6,69.4771525 6,75 C6,80.5228475 10.4771525,85 16,85 L16,85 Z M16,128 L112,128 C120.836556,128 128,120.836556 128,112 C128,103.163444 120.836556,96 112,96 L16,96 C7.163444,96 0,103.163444 0,112 C0,120.836556 7.163444,128 16,128 L16,128 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/link": {
            "title": "$:/core/images/link",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-link tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M128.719999,57.568543 C130.219553,53.8628171 131.045202,49.8121445 131.045202,45.5685425 C131.045202,27.8915447 116.718329,13.5685425 99.0452364,13.5685425 L67.0451674,13.5685425 C49.3655063,13.5685425 35.0452019,27.8954305 35.0452019,45.5685425 C35.0452019,63.2455403 49.3720745,77.5685425 67.0451674,77.5685425 L99.0452364,77.5685425 C100.406772,77.5685425 101.748384,77.4835732 103.065066,77.3186499 C96.4792444,73.7895096 91.1190212,68.272192 87.7873041,61.5685425 L67.0506214,61.5685425 C58.2110723,61.5685425 51.0452019,54.4070414 51.0452019,45.5685425 C51.0452019,36.7319865 58.2005234,29.5685425 67.0506214,29.5685425 L99.0397824,29.5685425 C107.879331,29.5685425 115.045202,36.7300436 115.045202,45.5685425 C115.045202,48.9465282 113.99957,52.0800164 112.21335,54.6623005 C114.314383,56.4735917 117.050039,57.5685425 120.041423,57.5685425 L128.720003,57.5685425 Z\" transform=\"translate(83.045202, 45.568542) rotate(-225.000000) translate(-83.045202, -45.568542)\"></path>\n        <path d=\"M-0.106255113,71.0452019 C-1.60580855,74.7509276 -2.43145751,78.8016001 -2.43145751,83.0452019 C-2.43145751,100.7222 11.8954151,115.045202 29.568508,115.045202 L61.568577,115.045202 C79.2482381,115.045202 93.5685425,100.718314 93.5685425,83.0452019 C93.5685425,65.3682041 79.2416699,51.0452019 61.568577,51.0452019 L29.568508,51.0452019 C28.206973,51.0452019 26.8653616,51.1301711 25.5486799,51.2950943 C32.1345,54.8242347 37.4947231,60.3415524 40.8264403,67.0452019 L61.563123,67.0452019 C70.4026721,67.0452019 77.5685425,74.206703 77.5685425,83.0452019 C77.5685425,91.8817579 70.413221,99.0452019 61.563123,99.0452019 L29.573962,99.0452019 C20.7344129,99.0452019 13.5685425,91.8837008 13.5685425,83.0452019 C13.5685425,79.6672162 14.6141741,76.533728 16.4003949,73.9514439 C14.2993609,72.1401527 11.5637054,71.0452019 8.5723215,71.0452019 L-0.106255113,71.0452019 Z\" transform=\"translate(45.568542, 83.045202) rotate(-225.000000) translate(-45.568542, -83.045202)\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/list-bullet": {
            "title": "$:/core/images/list-bullet",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-list-bullet tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M11.6363636,40.2727273 C18.0629498,40.2727273 23.2727273,35.0629498 23.2727273,28.6363636 C23.2727273,22.2097775 18.0629498,17 11.6363636,17 C5.20977746,17 0,22.2097775 0,28.6363636 C0,35.0629498 5.20977746,40.2727273 11.6363636,40.2727273 Z M11.6363636,75.1818182 C18.0629498,75.1818182 23.2727273,69.9720407 23.2727273,63.5454545 C23.2727273,57.1188684 18.0629498,51.9090909 11.6363636,51.9090909 C5.20977746,51.9090909 0,57.1188684 0,63.5454545 C0,69.9720407 5.20977746,75.1818182 11.6363636,75.1818182 Z M11.6363636,110.090909 C18.0629498,110.090909 23.2727273,104.881132 23.2727273,98.4545455 C23.2727273,92.0279593 18.0629498,86.8181818 11.6363636,86.8181818 C5.20977746,86.8181818 0,92.0279593 0,98.4545455 C0,104.881132 5.20977746,110.090909 11.6363636,110.090909 Z M34.9090909,22.8181818 L128,22.8181818 L128,34.4545455 L34.9090909,34.4545455 L34.9090909,22.8181818 Z M34.9090909,57.7272727 L128,57.7272727 L128,69.3636364 L34.9090909,69.3636364 L34.9090909,57.7272727 Z M34.9090909,92.6363636 L128,92.6363636 L128,104.272727 L34.9090909,104.272727 L34.9090909,92.6363636 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/list-number": {
            "title": "$:/core/images/list-number",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-list-number tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M33.8390805,22.3563218 L128,22.3563218 L128,34.1264368 L33.8390805,34.1264368 L33.8390805,22.3563218 Z M33.8390805,57.6666667 L128,57.6666667 L128,69.4367816 L33.8390805,69.4367816 L33.8390805,57.6666667 Z M33.8390805,92.9770115 L128,92.9770115 L128,104.747126 L33.8390805,104.747126 L33.8390805,92.9770115 Z M0.379509711,42.6307008 L0.379509711,40.4082314 L1.37821948,40.4082314 C2.20382368,40.4082314 2.82301754,40.268077 3.23581964,39.9877642 C3.64862174,39.7074513 3.85501969,39.0400498 3.85501969,37.9855395 L3.85501969,22.7686318 C3.85501969,21.3270228 3.66193774,20.4327047 3.27576803,20.0856507 C2.88959832,19.7385967 1.79768657,19.5650723 0,19.5650723 L0,17.4226919 C3.50215975,17.2758613 6.25191314,16.4683055 8.24934266,15 L10.3666074,15 L10.3666074,37.865406 C10.3666074,38.786434 10.5164123,39.4404875 10.8160268,39.8275862 C11.1156412,40.2146849 11.764796,40.4082314 12.7635108,40.4082314 L13.7622206,40.4082314 L13.7622206,42.6307008 L0.379509711,42.6307008 Z M0.0798967812,77.9873934 L0.0798967812,76.0852799 C7.27064304,69.5312983 10.8659622,63.5046623 10.8659622,58.005191 C10.8659622,56.4434479 10.5397203,55.195407 9.88722667,54.2610308 C9.23473303,53.3266546 8.36253522,52.8594735 7.27060709,52.8594735 C6.3784219,52.8594735 5.61608107,53.1764892 4.98356173,53.8105302 C4.35104238,54.4445712 4.03478745,55.1753759 4.03478745,56.0029663 C4.03478745,56.9773871 4.28113339,57.8316611 4.77383268,58.5658139 C4.88036225,58.7259926 4.93362624,58.8461249 4.93362624,58.9262143 C4.93362624,59.0730449 4.77383427,59.2065252 4.45424555,59.3266593 C4.2411864,59.4067486 3.70188852,59.6336652 2.83633573,60.0074156 C1.99741533,60.3811661 1.47809145,60.5680386 1.2783485,60.5680386 C1.03865696,60.5680386 0.765679018,60.1976307 0.459406492,59.4568039 C0.153133966,58.715977 0,57.9184322 0,57.0641453 C0,55.1153036 0.848894811,53.5202138 2.5467099,52.2788283 C4.24452499,51.0374428 6.34512352,50.4167594 8.84856852,50.4167594 C11.3120649,50.4167594 13.3793735,51.0874979 15.0505562,52.4289952 C16.7217389,53.7704924 17.5573177,55.5224215 17.5573177,57.684835 C17.5573177,58.9662652 17.2743527,60.2076321 16.7084144,61.4089729 C16.142476,62.6103138 14.7875733,64.4623531 12.6436656,66.9651465 C10.4997579,69.4679398 8.40914641,71.7804862 6.3717683,73.902855 L17.8169822,73.902855 L16.7982982,79.6292176 L14.6810335,79.6292176 C14.7609307,79.3489048 14.8008787,79.0952922 14.8008787,78.8683723 C14.8008787,78.4812736 14.7010087,78.237672 14.5012658,78.1375603 C14.3015228,78.0374485 13.9020429,77.9873934 13.3028141,77.9873934 L0.0798967812,77.9873934 Z M12.2042333,97.1935484 C13.9486551,97.2335931 15.4400468,97.8309175 16.6784531,98.9855395 C17.9168594,100.140162 18.5360532,101.75861 18.5360532,103.840934 C18.5360532,106.830938 17.4041935,109.233584 15.14044,111.048943 C12.8766866,112.864303 10.1402492,113.771969 6.93104577,113.771969 C4.92030005,113.771969 3.26245842,113.388213 1.95747114,112.62069 C0.652483855,111.853166 0,110.848727 0,109.607341 C0,108.833144 0.26964894,108.209124 0.808954909,107.735261 C1.34826088,107.261399 1.93749375,107.024472 2.57667119,107.024472 C3.21584864,107.024472 3.73850152,107.224692 4.14464552,107.625139 C4.55078953,108.025586 4.92696644,108.67964 5.27318756,109.587319 C5.73925445,110.855401 6.51158227,111.489433 7.59019421,111.489433 C8.85523291,111.489433 9.87723568,111.012241 10.6562332,110.057842 C11.4352307,109.103444 11.8247236,107.371536 11.8247236,104.862069 C11.8247236,103.153495 11.7048796,101.838714 11.4651881,100.917686 C11.2254966,99.9966584 10.6728827,99.5361513 9.80732989,99.5361513 C9.22141723,99.5361513 8.62219737,99.843156 8.00965231,100.457175 C7.51695303,100.951059 7.07752513,101.197998 6.69135542,101.197998 C6.3584505,101.197998 6.08880156,101.051169 5.88240051,100.757508 C5.67599946,100.463847 5.57280049,100.183539 5.57280049,99.916574 C5.57280049,99.5962164 5.67599946,99.3225818 5.88240051,99.0956618 C6.08880156,98.8687419 6.57150646,98.5016711 7.33052967,97.9944383 C10.2068282,96.0722929 11.6449559,93.9766521 11.6449559,91.7074527 C11.6449559,90.5194601 11.3386879,89.615131 10.7261429,88.9944383 C10.1135978,88.3737455 9.37455999,88.0634038 8.5090072,88.0634038 C7.71003539,88.0634038 6.98431355,88.3270274 6.33181991,88.8542825 C5.67932627,89.3815377 5.35308434,90.0122321 5.35308434,90.7463849 C5.35308434,91.3871 5.60608828,91.9810874 6.11210376,92.5283648 C6.28521432,92.7285883 6.3717683,92.8954387 6.3717683,93.028921 C6.3717683,93.1490551 5.80250943,93.4560598 4.6639746,93.9499444 C3.52543978,94.4438289 2.80970494,94.6907675 2.51674861,94.6907675 C2.10394651,94.6907675 1.76771758,94.3570667 1.50805174,93.6896552 C1.24838591,93.0222436 1.11855494,92.4082342 1.11855494,91.8476085 C1.11855494,90.0989901 2.04734573,88.6240327 3.90495518,87.4226919 C5.76256463,86.2213511 7.86982116,85.6206897 10.226788,85.6206897 C12.2907985,85.6206897 14.0784711,86.0678487 15.5898594,86.9621802 C17.1012478,87.8565117 17.8569306,89.0778566 17.8569306,90.6262514 C17.8569306,91.987771 17.2876717,93.2491599 16.1491369,94.4104561 C15.0106021,95.5717522 13.6956474,96.4994404 12.2042333,97.1935484 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/list": {
            "title": "$:/core/images/list",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-list tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M0.719999312,185.568543 C2.21955287,181.862817 3.0452019,177.812144 3.0452019,173.568542 C3.0452019,155.891545 -11.2816707,141.568542 -28.9547636,141.568542 L-60.9548326,141.568542 C-78.6344937,141.568542 -92.9547981,155.895431 -92.9547981,173.568542 C-92.9547981,191.24554 -78.6279255,205.568542 -60.9548326,205.568542 L-28.9547636,205.568542 C-27.593228,205.568542 -26.2516158,205.483573 -24.9349335,205.31865 C-31.5207556,201.78951 -36.8809788,196.272192 -40.2126959,189.568542 L-60.9493786,189.568542 C-69.7889277,189.568542 -76.9547981,182.407041 -76.9547981,173.568542 C-76.9547981,164.731986 -69.7994766,157.568542 -60.9493786,157.568542 L-28.9602176,157.568542 C-20.1206685,157.568542 -12.9547981,164.730044 -12.9547981,173.568542 C-12.9547981,176.946528 -14.0004297,180.080016 -15.7866505,182.6623 C-13.6856165,184.473592 -10.949961,185.568542 -7.9585771,185.568542 L0.720002586,185.568542 Z\" transform=\"translate(-44.954798, 173.568542) rotate(-225.000000) translate(44.954798, -173.568542) \"></path>\n        <path d=\"M87.7480315,128 L23.9992458,128 C19.5813843,128 16,124.409247 16,119.993027 L16,8.00697327 C16,3.58484404 19.5881049,0 23.9992458,0 L104.000754,0 C108.418616,0 112,3.59075293 112,8.00697327 L112,104 L91.2492027,104 C90.2848199,104 89.410573,104.391703 88.7768998,105.025201 C88.1373658,105.661376 87.7480315,106.53563 87.7480315,107.501171 L87.7480315,128 Z M95.7480315,127.879386 L111.627417,112 L95.7480315,112 L95.7480315,127.879386 Z M40,15.5089165 C40,13.5709954 41.5636015,12 43.4998101,12 L98.5001899,12 C100.433082,12 102,13.5614718 102,15.5089165 L102,16.4910835 C102,18.4290046 100.436399,20 98.5001899,20 L43.4998101,20 C41.5669183,20 40,18.4385282 40,16.4910835 L40,15.5089165 Z M32,22 C35.3137085,22 38,19.3137085 38,16 C38,12.6862915 35.3137085,10 32,10 C28.6862915,10 26,12.6862915 26,16 C26,19.3137085 28.6862915,22 32,22 Z M40,31.5089165 C40,29.5709954 41.5636015,28 43.4998101,28 L98.5001899,28 C100.433082,28 102,29.5614718 102,31.5089165 L102,32.4910835 C102,34.4290046 100.436399,36 98.5001899,36 L43.4998101,36 C41.5669183,36 40,34.4385282 40,32.4910835 L40,31.5089165 Z M40,47.5089165 C40,45.5709954 41.5636015,44 43.4998101,44 L98.5001899,44 C100.433082,44 102,45.5614718 102,47.5089165 L102,48.4910835 C102,50.4290046 100.436399,52 98.5001899,52 L43.4998101,52 C41.5669183,52 40,50.4385282 40,48.4910835 L40,47.5089165 Z M40,63.5089165 C40,61.5709954 41.5636015,60 43.4998101,60 L98.5001899,60 C100.433082,60 102,61.5614718 102,63.5089165 L102,64.4910835 C102,66.4290046 100.436399,68 98.5001899,68 L43.4998101,68 C41.5669183,68 40,66.4385282 40,64.4910835 L40,63.5089165 Z M40,79.5089165 C40,77.5709954 41.5636015,76 43.4998101,76 L98.5001899,76 C100.433082,76 102,77.5614718 102,79.5089165 L102,80.4910835 C102,82.4290046 100.436399,84 98.5001899,84 L43.4998101,84 C41.5669183,84 40,82.4385282 40,80.4910835 L40,79.5089165 Z M40,95.5089165 C40,93.5709954 41.5636015,92 43.4998101,92 L98.5001899,92 C100.433082,92 102,93.5614718 102,95.5089165 L102,96.4910835 C102,98.4290046 100.436399,100 98.5001899,100 L43.4998101,100 C41.5669183,100 40,98.4385282 40,96.4910835 L40,95.5089165 Z M40,111.508916 C40,109.570995 41.5680474,108 43.4972017,108 L76.5027983,108 C78.4342495,108 80,109.561472 80,111.508916 L80,112.491084 C80,114.429005 78.4319526,116 76.5027983,116 L43.4972017,116 C41.5657505,116 40,114.438528 40,112.491084 L40,111.508916 Z M32,38 C35.3137085,38 38,35.3137085 38,32 C38,28.6862915 35.3137085,26 32,26 C28.6862915,26 26,28.6862915 26,32 C26,35.3137085 28.6862915,38 32,38 Z M32,54 C35.3137085,54 38,51.3137085 38,48 C38,44.6862915 35.3137085,42 32,42 C28.6862915,42 26,44.6862915 26,48 C26,51.3137085 28.6862915,54 32,54 Z M32,70 C35.3137085,70 38,67.3137085 38,64 C38,60.6862915 35.3137085,58 32,58 C28.6862915,58 26,60.6862915 26,64 C26,67.3137085 28.6862915,70 32,70 Z M32,86 C35.3137085,86 38,83.3137085 38,80 C38,76.6862915 35.3137085,74 32,74 C28.6862915,74 26,76.6862915 26,80 C26,83.3137085 28.6862915,86 32,86 Z M32,102 C35.3137085,102 38,99.3137085 38,96 C38,92.6862915 35.3137085,90 32,90 C28.6862915,90 26,92.6862915 26,96 C26,99.3137085 28.6862915,102 32,102 Z M32,118 C35.3137085,118 38,115.313708 38,112 C38,108.686292 35.3137085,106 32,106 C28.6862915,106 26,108.686292 26,112 C26,115.313708 28.6862915,118 32,118 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/locked-padlock": {
            "title": "$:/core/images/locked-padlock",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-locked-padlock tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M96.4723753,64 L105,64 L105,96.0097716 C105,113.673909 90.6736461,128 73.001193,128 L55.998807,128 C38.3179793,128 24,113.677487 24,96.0097716 L24,64 L32.0000269,64 C32.0028554,48.2766389 32.3030338,16.2688026 64.1594984,16.2688041 C95.9543927,16.2688056 96.4648869,48.325931 96.4723753,64 Z M80.5749059,64 L48.4413579,64 C48.4426205,47.71306 48.5829272,31.9999996 64.1595001,31.9999996 C79.8437473,31.9999996 81.1369461,48.1359182 80.5749059,64 Z M67.7315279,92.3641717 C70.8232551,91.0923621 73,88.0503841 73,84.5 C73,79.8055796 69.1944204,76 64.5,76 C59.8055796,76 56,79.8055796 56,84.5 C56,87.947435 58.0523387,90.9155206 61.0018621,92.2491029 L55.9067479,115.020857 L72.8008958,115.020857 L67.7315279,92.3641717 L67.7315279,92.3641717 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/mail": {
            "title": "$:/core/images/mail",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-mail tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M122.826782,104.894066 C121.945525,105.22777 120.990324,105.41043 119.993027,105.41043 L8.00697327,105.41043 C7.19458381,105.41043 6.41045219,105.289614 5.67161357,105.064967 L5.67161357,105.064967 L39.8346483,70.9019325 L60.6765759,91.7438601 C61.6118278,92.679112 62.8865166,93.0560851 64.0946097,92.8783815 C65.2975108,93.0473238 66.5641085,92.6696979 67.4899463,91.7438601 L88.5941459,70.6396605 C88.6693095,70.7292352 88.7490098,70.8162939 88.8332479,70.9005321 L122.826782,104.894066 Z M127.903244,98.6568194 C127.966933,98.2506602 128,97.8343714 128,97.4103789 L128,33.410481 C128,32.7414504 127.917877,32.0916738 127.763157,31.4706493 L94.2292399,65.0045665 C94.3188145,65.0797417 94.4058701,65.1594458 94.4901021,65.2436778 L127.903244,98.6568194 Z M0.205060636,99.2178117 C0.0709009529,98.6370366 0,98.0320192 0,97.4103789 L0,33.410481 C0,32.694007 0.0944223363,31.9995312 0.27147538,31.3387595 L0.27147538,31.3387595 L34.1777941,65.2450783 L0.205060636,99.2178117 L0.205060636,99.2178117 Z M5.92934613,25.6829218 C6.59211333,25.5051988 7.28862283,25.4104299 8.00697327,25.4104299 L119.993027,25.4104299 C120.759109,25.4104299 121.500064,25.5178649 122.201605,25.7184927 L122.201605,25.7184927 L64.0832611,83.8368368 L5.92934613,25.6829218 L5.92934613,25.6829218 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/menu-button": {
            "title": "$:/core/images/menu-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-menu-button tc-image-button\" viewBox=\"0 0 128 128\" width=\"22pt\" height=\"22pt\">\n    <rect x=\"0\" y=\"16\" width=\"128\" height=\"16\" rx=\"8\"></rect>\n    <rect x=\"0\" y=\"56\" width=\"128\" height=\"16\" rx=\"8\"></rect>\n    <rect x=\"0\" y=\"96\" width=\"128\" height=\"16\" rx=\"8\"></rect>\n</svg>"
        },
        "$:/core/images/mono-block": {
            "title": "$:/core/images/mono-block",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-mono-block tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M23.9653488,32.9670593 L24.3217888,32.9670593 C25.0766067,32.9670593 25.6497006,33.1592554 26.0410876,33.5436534 C26.4324747,33.9280514 26.6281653,34.4906619 26.6281653,35.2315017 C26.6281653,36.0562101 26.4219913,36.6502709 26.009637,37.0137017 C25.5972828,37.3771326 24.9158602,37.5588453 23.9653488,37.5588453 L17.6542639,37.5588453 C16.6897744,37.5588453 16.0048573,37.380627 15.5994921,37.0241852 C15.1941269,36.6677435 14.9914474,36.0701882 14.9914474,35.2315017 C14.9914474,34.4207713 15.1941269,33.8406885 15.5994921,33.4912358 C16.0048573,33.141783 16.6897744,32.9670593 17.6542639,32.9670593 L18.388111,32.9670593 L17.5284616,30.5139133 L8.47069195,30.5139133 L7.5691084,32.9670593 L8.30295547,32.9670593 C9.25346691,32.9670593 9.93488953,33.1452775 10.3472438,33.5017193 C10.759598,33.8581611 10.965772,34.4347494 10.965772,35.2315017 C10.965772,36.0562101 10.759598,36.6502709 10.3472438,37.0137017 C9.93488953,37.3771326 9.25346691,37.5588453 8.30295547,37.5588453 L2.89345418,37.5588453 C1.92896463,37.5588453 1.24404754,37.3771326 0.838682371,37.0137017 C0.433317198,36.6502709 0.230637652,36.0562101 0.230637652,35.2315017 C0.230637652,34.4906619 0.426328248,33.9280514 0.817715312,33.5436534 C1.20910238,33.1592554 1.78219626,32.9670593 2.53701417,32.9670593 L2.89345418,32.9670593 L8.51262607,17.3256331 L6.83526132,17.3256331 C5.88474988,17.3256331 5.20332727,17.1439204 4.79097304,16.7804895 C4.37861882,16.4170587 4.1724448,15.8299869 4.1724448,15.0192565 C4.1724448,14.1945481 4.37861882,13.6004873 4.79097304,13.2370565 C5.20332727,12.8736257 5.88474988,12.691913 6.83526132,12.691913 L14.6979086,12.691913 C15.9419603,12.691913 16.815579,13.3628521 17.318791,14.7047506 L17.318791,14.7676518 L23.9653488,32.9670593 Z M12.9786097,17.3256331 L9.9383861,26.1737321 L16.0188333,26.1737321 L12.9786097,17.3256331 Z M35.3809383,26.6979086 L35.3809383,33.0928616 L38.5259972,33.0928616 C40.7485166,33.0928616 42.3140414,32.8482484 43.2226185,32.3590146 C44.1311956,31.8697807 44.5854773,31.0520736 44.5854773,29.9058686 C44.5854773,28.7456855 44.1521624,27.9209895 43.2855197,27.4317556 C42.4188769,26.9425218 40.9022748,26.6979086 38.7356678,26.6979086 L35.3809383,26.6979086 Z M46.0741385,24.370565 C47.5977525,24.9296893 48.7159844,25.6949794 49.428868,26.666458 C50.1417516,27.6379366 50.498188,28.8784752 50.498188,30.388111 C50.498188,31.6601189 50.1906743,32.8202846 49.5756374,33.8686428 C48.9606006,34.917001 48.0799929,35.7766419 46.933788,36.4475911 C46.2628387,36.8389782 45.5115266,37.1220307 44.6798291,37.296757 C43.8481316,37.4714834 42.6704935,37.5588453 41.1468796,37.5588453 L39.3856466,37.5588453 L30.2020747,37.5588453 C29.2795194,37.5588453 28.6190637,37.3771326 28.2206876,37.0137017 C27.8223114,36.6502709 27.6231264,36.0562101 27.6231264,35.2315017 C27.6231264,34.4906619 27.811828,33.9280514 28.189237,33.5436534 C28.5666459,33.1592554 29.118773,32.9670593 29.8456347,32.9670593 L30.2020747,32.9670593 L30.2020747,17.3256331 L29.8456347,17.3256331 C29.118773,17.3256331 28.5666459,17.1299425 28.189237,16.7385554 C27.811828,16.3471683 27.6231264,15.7740744 27.6231264,15.0192565 C27.6231264,14.2085262 27.8258059,13.6179599 28.2311711,13.24754 C28.6365363,12.8771201 29.2934976,12.691913 30.2020747,12.691913 L39.8469219,12.691913 C42.796303,12.691913 45.0362615,13.2650068 46.5668644,14.4112118 C48.0974674,15.5574168 48.8627574,17.2347648 48.8627574,19.443306 C48.8627574,20.5335986 48.6286276,21.4945792 48.1603609,22.3262767 C47.6920943,23.1579742 46.9966938,23.8393968 46.0741385,24.370565 L46.0741385,24.370565 Z M35.3809383,17.1998307 L35.3809383,22.4835296 L38.2114913,22.4835296 C39.9307988,22.4835296 41.1433816,22.2808501 41.8492761,21.8754849 C42.5551706,21.4701197 42.9081126,20.7852027 42.9081126,19.8207131 C42.9081126,18.912136 42.5901154,18.2481858 41.9541114,17.8288425 C41.3181074,17.4094992 40.2872373,17.1998307 38.8614701,17.1998307 L35.3809383,17.1998307 Z M71.244119,13.3838259 C71.5236812,12.880614 71.8102281,12.5241775 72.1037684,12.3145059 C72.3973087,12.1048342 72.7677231,12 73.2150226,12 C73.8999499,12 74.3856819,12.1817127 74.6722332,12.5451435 C74.9587844,12.9085744 75.1020579,13.5305909 75.1020579,14.4112118 L75.143992,19.8626472 C75.143992,20.8271368 74.9867406,21.4771091 74.6722332,21.8125837 C74.3577257,22.1480584 73.7881263,22.3157932 72.9634178,22.3157932 C72.3763372,22.3157932 71.92555,22.1760142 71.6110425,21.896452 C71.2965351,21.6168898 71.0274605,21.0997075 70.8038107,20.3448896 C70.4403799,19.0169692 69.8602971,18.0629775 69.0635448,17.482886 C68.2667926,16.9027945 67.1625385,16.612753 65.7507494,16.612753 C63.5981206,16.612753 61.9487284,17.3396038 60.8025235,18.7933272 C59.6563185,20.2470506 59.0832246,22.3507245 59.0832246,25.104412 C59.0832246,27.8441215 59.6633074,29.9477954 60.8234905,31.4154969 C61.9836736,32.8831984 63.6400547,33.6170381 65.7926836,33.6170381 C67.2603851,33.6170381 68.878327,33.1278116 70.6465578,32.149344 C72.4147886,31.1708763 73.5295261,30.6816498 73.9908037,30.6816498 C74.53595,30.6816498 74.9937262,30.9122852 75.3641461,31.3735628 C75.734566,31.8348404 75.9197732,32.4079343 75.9197732,33.0928616 C75.9197732,34.3229353 74.836486,35.4831009 72.669879,36.5733935 C70.5032721,37.663686 68.0641285,38.2088241 65.3523753,38.2088241 C61.6901107,38.2088241 58.7267959,36.9997358 56.4623422,34.5815228 C54.1978885,32.1633099 53.0656786,29.0043046 53.0656786,25.104412 C53.0656786,21.3443006 54.2118664,18.22024 56.5042763,15.7321366 C58.7966863,13.2440331 61.7040894,12 65.226573,12 C66.2190187,12 67.1974717,12.1118232 68.1619613,12.3354729 C69.1264508,12.5591227 70.1538264,12.9085702 71.244119,13.3838259 L71.244119,13.3838259 Z M81.4645862,32.9670593 L81.4645862,17.3256331 L81.1081461,17.3256331 C80.3533282,17.3256331 79.7802344,17.1299425 79.3888473,16.7385554 C78.9974602,16.3471683 78.8017696,15.7740744 78.8017696,15.0192565 C78.8017696,14.2085262 79.0114381,13.6179599 79.4307814,13.24754 C79.8501247,12.8771201 80.5280528,12.691913 81.4645862,12.691913 L85.4063933,12.691913 L86.6434498,12.691913 C89.5648747,12.691913 91.7034933,12.8177141 93.0593699,13.06932 C94.4152465,13.320926 95.5684233,13.740263 96.5189347,14.3273436 C98.210286,15.3337675 99.5067362,16.7699967 100.408324,18.6360743 C101.309912,20.5021519 101.7607,22.6582429 101.7607,25.104412 C101.7607,27.6903623 101.247012,29.9512876 100.219621,31.8872557 C99.1922296,33.8232239 97.7350336,35.2874089 95.8479888,36.2798546 C94.9953241,36.7271541 93.9959043,37.0521403 92.8496993,37.2548229 C91.7034944,37.4575055 89.9981906,37.5588453 87.7337369,37.5588453 L85.4063933,37.5588453 L81.4645862,37.5588453 C80.5000966,37.5588453 79.8151795,37.380627 79.4098143,37.0241852 C79.0044492,36.6677435 78.8017696,36.0701882 78.8017696,35.2315017 C78.8017696,34.4906619 78.9974602,33.9280514 79.3888473,33.5436534 C79.7802344,33.1592554 80.3533282,32.9670593 81.1081461,32.9670593 L81.4645862,32.9670593 Z M86.8740874,17.2417648 L86.8740874,32.9670593 L88.0692098,32.9670593 C90.7110725,32.9670593 92.6609895,32.3205814 93.9190194,31.0276063 C95.1770492,29.7346312 95.8060547,27.7462749 95.8060547,25.0624779 C95.8060547,22.4206153 95.1665658,20.4497314 93.8875688,19.1497672 C92.6085718,17.849803 90.6831161,17.1998307 88.1111439,17.1998307 C87.7756693,17.1998307 87.5205727,17.2033252 87.3458463,17.2103142 C87.1711199,17.2173033 87.0138685,17.2277867 86.8740874,17.2417648 L86.8740874,17.2417648 Z M121.94052,17.1159625 L112.190837,17.1159625 L112.190837,22.4835296 L115.88104,22.4835296 L115.88104,22.2319249 C115.88104,21.4351727 116.055763,20.841112 116.405216,20.4497249 C116.754669,20.0583378 117.285829,19.8626472 117.998713,19.8626472 C118.627728,19.8626472 119.141415,20.0408655 119.539792,20.3973072 C119.938168,20.753749 120.137353,21.2045363 120.137353,21.7496826 C120.137353,21.7776388 120.144342,21.8684951 120.15832,22.0222543 C120.172298,22.1760135 120.179287,22.3297704 120.179287,22.4835296 L120.179287,26.8237109 C120.179287,27.7602442 120.011552,28.4311834 119.676077,28.8365486 C119.340603,29.2419138 118.795465,29.4445933 118.040647,29.4445933 C117.327763,29.4445933 116.789614,29.2558917 116.426183,28.8784827 C116.062752,28.5010738 115.88104,27.9419578 115.88104,27.201118 L115.88104,26.8237109 L112.190837,26.8237109 L112.190837,33.0928616 L121.94052,33.0928616 L121.94052,30.5977816 C121.94052,29.6612482 122.118738,28.9903091 122.47518,28.5849439 C122.831622,28.1795787 123.415199,27.9768992 124.225929,27.9768992 C125.022682,27.9768992 125.592281,28.1760842 125.934745,28.5744604 C126.277208,28.9728365 126.448438,29.6472701 126.448438,30.5977816 L126.448438,35.6718099 C126.448438,36.4266278 126.30167,36.9298322 126.008129,37.1814382 C125.714589,37.4330442 125.134506,37.5588453 124.267863,37.5588453 L107.095842,37.5588453 C106.173287,37.5588453 105.512831,37.3771326 105.114455,37.0137017 C104.716079,36.6502709 104.516894,36.0562101 104.516894,35.2315017 C104.516894,34.4906619 104.705595,33.9280514 105.083004,33.5436534 C105.460413,33.1592554 106.01254,32.9670593 106.739402,32.9670593 L107.095842,32.9670593 L107.095842,17.3256331 L106.739402,17.3256331 C106.026518,17.3256331 105.477886,17.126448 105.093488,16.7280719 C104.70909,16.3296957 104.516894,15.7600963 104.516894,15.0192565 C104.516894,14.2085262 104.719573,13.6179599 105.124938,13.24754 C105.530304,12.8771201 106.187265,12.691913 107.095842,12.691913 L124.267863,12.691913 C125.120528,12.691913 125.697116,12.8212085 125.997646,13.0798036 C126.298175,13.3383986 126.448438,13.8520864 126.448438,14.6208824 L126.448438,19.3175037 C126.448438,20.2680151 126.273714,20.9494377 125.924261,21.361792 C125.574808,21.7741462 125.008703,21.9803202 124.225929,21.9803202 C123.415199,21.9803202 122.831622,21.7706517 122.47518,21.3513084 C122.118738,20.9319652 121.94052,20.254037 121.94052,19.3175037 L121.94052,17.1159625 Z M19.7719369,47.6405477 C20.037521,47.1373358 20.3205734,46.7808993 20.6211028,46.5712277 C20.9216322,46.361556 21.295541,46.2567218 21.7428405,46.2567218 C22.4277678,46.2567218 22.9134998,46.4384345 23.2000511,46.8018653 C23.4866023,47.1652962 23.6298758,47.7873127 23.6298758,48.6679336 L23.6718099,54.119369 C23.6718099,55.0838586 23.5145586,55.7338309 23.2000511,56.0693055 C22.8855436,56.4047802 22.3089553,56.572515 21.4702687,56.572515 C20.8831881,56.572515 20.4254119,56.4292415 20.0969263,56.1426902 C19.7684407,55.856139 19.4993662,55.3424512 19.2896945,54.6016114 C18.9122856,53.2597129 18.3322027,52.3022267 17.5494286,51.7291243 C16.7666545,51.1560218 15.6693894,50.8694748 14.2576003,50.8694748 C12.1049715,50.8694748 10.4590738,51.5963256 9.31985785,53.050049 C8.18064193,54.5037724 7.61104252,56.6074463 7.61104252,59.3611338 C7.61104252,62.1148214 8.20859773,64.2429566 9.40372609,65.7456034 C10.5988544,67.2482501 12.2936748,67.9995623 14.488238,67.9995623 C14.9914499,67.9995623 15.5645438,67.9401562 16.2075368,67.8213423 C16.8505299,67.7025283 17.6053364,67.5173212 18.4719792,67.2657152 L18.4719792,63.9529198 L16.1027015,63.9529198 C15.1521901,63.9529198 14.4777564,63.7781961 14.0793803,63.4287433 C13.6810042,63.0792906 13.4818191,62.4992078 13.4818191,61.6884774 C13.4818191,60.8497908 13.6810042,60.2522356 14.0793803,59.8957938 C14.4777564,59.5393521 15.1521901,59.3611338 16.1027015,59.3611338 L23.6718099,59.3611338 C24.6502776,59.3611338 25.3386891,59.5358576 25.7370653,59.8853103 C26.1354414,60.2347631 26.3346265,60.8218348 26.3346265,61.6465433 C26.3346265,62.3873831 26.1354414,62.9569825 25.7370653,63.3553586 C25.3386891,63.7537347 24.7621008,63.9529198 24.0072829,63.9529198 L23.6718099,63.9529198 L23.6718099,68.9430799 L23.6718099,69.1946846 C23.6718099,69.6419841 23.6228873,69.9529924 23.5250405,70.1277188 C23.4271937,70.3024451 23.2315031,70.4806634 22.9379628,70.6623788 C22.1412106,71.1376345 20.8762107,71.5569715 19.1429251,71.9204023 C17.4096396,72.2838332 15.6554131,72.4655459 13.8801932,72.4655459 C10.2179286,72.4655459 7.25461383,71.2564576 4.99016011,68.8382446 C2.72570638,66.4200317 1.59349651,63.2610264 1.59349651,59.3611338 C1.59349651,55.6010224 2.73968428,52.4769618 5.03209423,49.9888583 C7.32450417,47.5007549 10.2319073,46.2567218 13.7543909,46.2567218 C14.7328585,46.2567218 15.7078171,46.368545 16.6792957,46.5921947 C17.6507743,46.8158445 18.6816444,47.165292 19.7719369,47.6405477 L19.7719369,47.6405477 Z M35.611576,51.5823548 L35.611576,56.4047785 L42.4678043,56.4047785 L42.4678043,51.5823548 L42.1323314,51.5823548 C41.3775135,51.5823548 40.8009251,51.3866642 40.402549,50.9952772 C40.0041729,50.6038901 39.8049878,50.0307962 39.8049878,49.2759783 C39.8049878,48.4512699 40.0111618,47.8572091 40.4235161,47.4937783 C40.8358703,47.1303474 41.5172929,46.9486347 42.4678043,46.9486347 L47.8773056,46.9486347 C48.8278171,46.9486347 49.5022507,47.1303474 49.9006269,47.4937783 C50.299003,47.8572091 50.498188,48.4512699 50.498188,49.2759783 C50.498188,50.0307962 50.3059919,50.6038901 49.9215939,50.9952772 C49.5371959,51.3866642 48.9745854,51.5823548 48.2337456,51.5823548 L47.8773056,51.5823548 L47.8773056,67.2237811 L48.2337456,67.2237811 C48.9885636,67.2237811 49.5616574,67.4159772 49.9530445,67.8003752 C50.3444316,68.1847732 50.5401222,68.7473837 50.5401222,69.4882235 C50.5401222,70.3129319 50.3374426,70.9069927 49.9320774,71.2704235 C49.5267123,71.6338543 48.8417952,71.815567 47.8773056,71.815567 L42.4678043,71.815567 C41.5033148,71.815567 40.8183977,71.6373488 40.4130325,71.280907 C40.0076674,70.9244652 39.8049878,70.32691 39.8049878,69.4882235 C39.8049878,68.7473837 40.0041729,68.1847732 40.402549,67.8003752 C40.8009251,67.4159772 41.3775135,67.2237811 42.1323314,67.2237811 L42.4678043,67.2237811 L42.4678043,61.0384986 L35.611576,61.0384986 L35.611576,67.2237811 L35.9470489,67.2237811 C36.7018668,67.2237811 37.2784552,67.4159772 37.6768313,67.8003752 C38.0752074,68.1847732 38.2743925,68.7473837 38.2743925,69.4882235 C38.2743925,70.3129319 38.0682185,70.9069927 37.6558642,71.2704235 C37.24351,71.6338543 36.5620874,71.815567 35.611576,71.815567 L30.2020747,71.815567 C29.2375851,71.815567 28.552668,71.6373488 28.1473029,71.280907 C27.7419377,70.9244652 27.5392581,70.32691 27.5392581,69.4882235 C27.5392581,68.7473837 27.7349487,68.1847732 28.1263358,67.8003752 C28.5177229,67.4159772 29.0908168,67.2237811 29.8456347,67.2237811 L30.2020747,67.2237811 L30.2020747,51.5823548 L29.8456347,51.5823548 C29.1047949,51.5823548 28.5421844,51.3866642 28.1577864,50.9952772 C27.7733884,50.6038901 27.5811923,50.0307962 27.5811923,49.2759783 C27.5811923,48.4512699 27.7803773,47.8572091 28.1787534,47.4937783 C28.5771296,47.1303474 29.2515632,46.9486347 30.2020747,46.9486347 L35.611576,46.9486347 C36.5481093,46.9486347 37.2260374,47.1303474 37.6453807,47.4937783 C38.064724,47.8572091 38.2743925,48.4512699 38.2743925,49.2759783 C38.2743925,50.0307962 38.0752074,50.6038901 37.6768313,50.9952772 C37.2784552,51.3866642 36.7018668,51.5823548 35.9470489,51.5823548 L35.611576,51.5823548 Z M67.365213,51.5823548 L67.365213,67.2237811 L70.887679,67.2237811 C71.8381904,67.2237811 72.519613,67.4019993 72.9319673,67.7584411 C73.3443215,68.1148829 73.5504955,68.6914712 73.5504955,69.4882235 C73.5504955,70.2989538 73.340827,70.8895201 72.9214837,71.25994 C72.5021404,71.6303599 71.8242123,71.815567 70.887679,71.815567 L58.4332458,71.815567 C57.4827343,71.815567 56.8013117,71.6338543 56.3889575,71.2704235 C55.9766033,70.9069927 55.7704292,70.3129319 55.7704292,69.4882235 C55.7704292,68.6774931 55.9731088,68.0974103 56.378474,67.7479575 C56.7838391,67.3985048 57.4687562,67.2237811 58.4332458,67.2237811 L61.9557117,67.2237811 L61.9557117,51.5823548 L58.4332458,51.5823548 C57.4827343,51.5823548 56.8013117,51.4006421 56.3889575,51.0372113 C55.9766033,50.6737805 55.7704292,50.0867087 55.7704292,49.2759783 C55.7704292,48.4512699 55.9731088,47.8641981 56.378474,47.5147453 C56.7838391,47.1652926 57.4687562,46.9905689 58.4332458,46.9905689 L70.887679,46.9905689 C71.8801247,46.9905689 72.5720308,47.1652926 72.9634178,47.5147453 C73.3548049,47.8641981 73.5504955,48.4512699 73.5504955,49.2759783 C73.5504955,50.0867087 73.347816,50.6737805 72.9424508,51.0372113 C72.5370856,51.4006421 71.8521685,51.5823548 70.887679,51.5823548 L67.365213,51.5823548 Z M97.8608265,51.5823548 L97.8608265,63.1771386 L97.8608265,63.5755127 C97.8608265,65.4485794 97.7385199,66.8044357 97.493903,67.6431222 C97.2492861,68.4818088 96.8404325,69.2296264 96.26733,69.8865976 C95.5264902,70.7392623 94.4991146,71.3822457 93.1851723,71.815567 C91.87123,72.2488884 90.2917273,72.4655459 88.4466169,72.4655459 C87.1466527,72.4655459 85.8921362,72.3397448 84.6830298,72.0881388 C83.4739233,71.8365328 82.3102631,71.4591296 81.1920144,70.9559176 C80.5769776,70.6763554 80.175113,70.31293 79.9864085,69.8656305 C79.797704,69.418331 79.7033532,68.6914802 79.7033532,67.6850564 L79.7033532,63.3658422 C79.7033532,62.1637247 79.8780769,61.3250508 80.2275297,60.849795 C80.5769824,60.3745393 81.185021,60.136915 82.0516638,60.136915 C83.2957156,60.136915 83.9806326,61.0524675 84.1064356,62.8835998 C84.1204137,63.2050963 84.1413806,63.4497096 84.1693368,63.6174469 C84.3370741,65.2389076 84.7144774,66.3466561 85.301558,66.9407258 C85.8886386,67.5347954 86.8251579,67.8318258 88.1111439,67.8318258 C89.7046484,67.8318258 90.8263749,67.4089943 91.476357,66.5633187 C92.126339,65.7176431 92.4513252,64.1765796 92.4513252,61.9400821 L92.4513252,51.5823548 L88.9288593,51.5823548 C87.9783478,51.5823548 87.2969252,51.4006421 86.884571,51.0372113 C86.4722168,50.6737805 86.2660427,50.0867087 86.2660427,49.2759783 C86.2660427,48.4512699 86.4652278,47.8641981 86.8636039,47.5147453 C87.26198,47.1652926 87.9503916,46.9905689 88.9288593,46.9905689 L99.6220595,46.9905689 C100.600527,46.9905689 101.288939,47.1652926 101.687315,47.5147453 C102.085691,47.8641981 102.284876,48.4512699 102.284876,49.2759783 C102.284876,50.0867087 102.078702,50.6737805 101.666348,51.0372113 C101.253994,51.4006421 100.572571,51.5823548 99.6220595,51.5823548 L97.8608265,51.5823548 Z M112.505343,51.5823548 L112.505343,57.9353738 L118.984165,51.4565525 C118.257303,51.3726838 117.747109,51.1665098 117.453569,50.8380242 C117.160029,50.5095387 117.013261,49.9888619 117.013261,49.2759783 C117.013261,48.4512699 117.212446,47.8572091 117.610822,47.4937783 C118.009198,47.1303474 118.683632,46.9486347 119.634143,46.9486347 L124.771073,46.9486347 C125.721584,46.9486347 126.396018,47.1303474 126.794394,47.4937783 C127.19277,47.8572091 127.391955,48.4512699 127.391955,49.2759783 C127.391955,50.0447743 127.19277,50.6213627 126.794394,51.0057607 C126.396018,51.3901587 125.812441,51.5823548 125.043645,51.5823548 L124.561402,51.5823548 L118.459988,57.641835 C119.592215,58.4805215 120.626579,59.5812811 121.563113,60.9441468 C122.499646,62.3070125 123.596911,64.400203 124.854941,67.2237811 L125.127513,67.2237811 L125.546854,67.2237811 C126.371563,67.2237811 126.98659,67.4124827 127.391955,67.7898917 C127.79732,68.1673006 128,68.7334056 128,69.4882235 C128,70.3129319 127.793826,70.9069927 127.381472,71.2704235 C126.969118,71.6338543 126.287695,71.815567 125.337183,71.815567 L122.758235,71.815567 C121.626008,71.815567 120.710456,71.0537715 120.01155,69.5301576 C119.885747,69.2505954 119.787902,69.026949 119.718012,68.8592117 C118.795456,66.9022764 117.949793,65.3926632 117.180997,64.3303269 C116.412201,63.2679906 115.510627,62.2965265 114.476247,61.4159056 L112.505343,63.302941 L112.505343,67.2237811 L112.840816,67.2237811 C113.595634,67.2237811 114.172222,67.4159772 114.570599,67.8003752 C114.968975,68.1847732 115.16816,68.7473837 115.16816,69.4882235 C115.16816,70.3129319 114.961986,70.9069927 114.549631,71.2704235 C114.137277,71.6338543 113.455855,71.815567 112.505343,71.815567 L107.095842,71.815567 C106.131352,71.815567 105.446435,71.6373488 105.04107,71.280907 C104.635705,70.9244652 104.433025,70.32691 104.433025,69.4882235 C104.433025,68.7473837 104.628716,68.1847732 105.020103,67.8003752 C105.41149,67.4159772 105.984584,67.2237811 106.739402,67.2237811 L107.095842,67.2237811 L107.095842,51.5823548 L106.739402,51.5823548 C105.998562,51.5823548 105.435952,51.3866642 105.051554,50.9952772 C104.667156,50.6038901 104.474959,50.0307962 104.474959,49.2759783 C104.474959,48.4512699 104.674145,47.8572091 105.072521,47.4937783 C105.470897,47.1303474 106.14533,46.9486347 107.095842,46.9486347 L112.505343,46.9486347 C113.441877,46.9486347 114.119805,47.1303474 114.539148,47.4937783 C114.958491,47.8572091 115.16816,48.4512699 115.16816,49.2759783 C115.16816,50.0307962 114.968975,50.6038901 114.570599,50.9952772 C114.172222,51.3866642 113.595634,51.5823548 112.840816,51.5823548 L112.505343,51.5823548 Z M13.439885,96.325622 L17.4445933,84.4372993 C17.6961993,83.6545252 18.0456468,83.0849258 18.4929463,82.728484 C18.9402458,82.3720422 19.5343065,82.193824 20.2751463,82.193824 L23.5460076,82.193824 C24.496519,82.193824 25.1779416,82.3755367 25.5902958,82.7389675 C26.0026501,83.1023984 26.2088241,83.6964591 26.2088241,84.5211676 C26.2088241,85.2759855 26.009639,85.8490794 25.6112629,86.2404664 C25.2128868,86.6318535 24.6362984,86.8275441 23.8814805,86.8275441 L23.5460076,86.8275441 L24.1330852,102.46897 L24.4895252,102.46897 C25.2443431,102.46897 25.8104481,102.661166 26.187857,103.045564 C26.565266,103.429962 26.7539676,103.992573 26.7539676,104.733413 C26.7539676,105.558121 26.5547826,106.152182 26.1564064,106.515613 C25.7580303,106.879044 25.0835967,107.060756 24.1330852,107.060756 L19.4154969,107.060756 C18.4649855,107.060756 17.7905518,106.882538 17.3921757,106.526096 C16.9937996,106.169654 16.7946145,105.572099 16.7946145,104.733413 C16.7946145,103.992573 16.9868106,103.429962 17.3712086,103.045564 C17.7556066,102.661166 18.325206,102.46897 19.0800239,102.46897 L19.4154969,102.46897 L19.1219581,89.6790642 L16.0607674,99.1981091 C15.8371177,99.9109927 15.5191204,100.42468 15.1067662,100.739188 C14.694412,101.053695 14.1248126,101.210947 13.3979509,101.210947 C12.6710892,101.210947 12.0945008,101.053695 11.6681685,100.739188 C11.2418362,100.42468 10.91685,99.9109927 10.6932002,99.1981091 L7.65297664,89.6790642 L7.35943781,102.46897 L7.69491075,102.46897 C8.44972866,102.46897 9.01932808,102.661166 9.40372609,103.045564 C9.78812409,103.429962 9.98032022,103.992573 9.98032022,104.733413 C9.98032022,105.558121 9.77764067,106.152182 9.3722755,106.515613 C8.96691032,106.879044 8.29597114,107.060756 7.35943781,107.060756 L2.62088241,107.060756 C1.68434908,107.060756 1.01340989,106.879044 0.608044719,106.515613 C0.202679546,106.152182 0,105.558121 0,104.733413 C0,103.992573 0.192196121,103.429962 0.57659413,103.045564 C0.960992139,102.661166 1.53059155,102.46897 2.28540946,102.46897 L2.62088241,102.46897 L3.22892713,86.8275441 L2.89345418,86.8275441 C2.13863627,86.8275441 1.56204791,86.6318535 1.16367179,86.2404664 C0.765295672,85.8490794 0.5661106,85.2759855 0.5661106,84.5211676 C0.5661106,83.6964591 0.772284622,83.1023984 1.18463885,82.7389675 C1.59699308,82.3755367 2.27841569,82.193824 3.22892713,82.193824 L6.49978838,82.193824 C7.22665007,82.193824 7.81022738,82.3685477 8.25053783,82.7180005 C8.69084827,83.0674532 9.05077919,83.6405471 9.33034138,84.4372993 L13.439885,96.325622 Z M43.8935644,98.3803938 L43.8935644,86.8275441 L42.7403761,86.8275441 C41.8178209,86.8275441 41.1573651,86.6458314 40.758989,86.2824006 C40.3606129,85.9189697 40.1614278,85.3318979 40.1614278,84.5211676 C40.1614278,83.7104372 40.3606129,83.119871 40.758989,82.7494511 C41.1573651,82.3790312 41.8178209,82.193824 42.7403761,82.193824 L48.6950209,82.193824 C49.6035981,82.193824 50.2605593,82.3790312 50.6659245,82.7494511 C51.0712897,83.119871 51.2739692,83.7104372 51.2739692,84.5211676 C51.2739692,85.2620074 51.0817731,85.8316068 50.6973751,86.2299829 C50.3129771,86.628359 49.7643445,86.8275441 49.051461,86.8275441 L48.6950209,86.8275441 L48.6950209,105.865634 C48.6950209,106.522605 48.6251315,106.934953 48.4853504,107.10269 C48.3455693,107.270428 48.0310665,107.354295 47.5418327,107.354295 L45.4451268,107.354295 C44.7741775,107.354295 44.3024234,107.284406 44.0298503,107.144625 C43.7572771,107.004843 43.5231473,106.76023 43.3274538,106.410777 L34.6051571,91.0838571 L34.6051571,102.46897 L35.8212466,102.46897 C36.7298237,102.46897 37.379796,102.643694 37.7711831,102.993147 C38.1625701,103.3426 38.3582607,103.922682 38.3582607,104.733413 C38.3582607,105.558121 38.1590757,106.152182 37.7606995,106.515613 C37.3623234,106.879044 36.7158456,107.060756 35.8212466,107.060756 L29.8037005,107.060756 C28.8951234,107.060756 28.2381621,106.879044 27.832797,106.515613 C27.4274318,106.152182 27.2247522,105.558121 27.2247522,104.733413 C27.2247522,103.992573 27.4134539,103.429962 27.7908629,103.045564 C28.1682718,102.661166 28.7273878,102.46897 29.4682276,102.46897 L29.8037005,102.46897 L29.8037005,86.8275441 L29.4682276,86.8275441 C28.755344,86.8275441 28.203217,86.628359 27.8118299,86.2299829 C27.4204428,85.8316068 27.2247522,85.2620074 27.2247522,84.5211676 C27.2247522,83.7104372 27.4309263,83.119871 27.8432805,82.7494511 C28.2556347,82.3790312 28.9091015,82.193824 29.8037005,82.193824 L33.2422983,82.193824 C34.0670067,82.193824 34.6261227,82.3021527 34.919663,82.5188134 C35.2132033,82.7354741 35.5416839,83.1722835 35.9051148,83.8292546 L43.8935644,98.3803938 Z M64.6604624,86.3662688 C62.8572863,86.3662688 61.4420239,87.0931196 60.4146329,88.546843 C59.3872418,90.0005663 58.873554,92.0203728 58.873554,94.6063231 C58.873554,97.1922733 59.3907363,99.2190688 60.4251164,100.68677 C61.4594965,102.154472 62.8712644,102.888312 64.6604624,102.888312 C66.4636385,102.888312 67.8823953,102.157966 68.9167754,100.697254 C69.9511555,99.2365414 70.4683378,97.2062514 70.4683378,94.6063231 C70.4683378,92.0203728 69.95465,90.0005663 68.9272589,88.546843 C67.8998679,87.0931196 66.4776166,86.3662688 64.6604624,86.3662688 L64.6604624,86.3662688 Z M64.6604624,81.501911 C68.0990773,81.501911 70.929602,82.7319662 73.1521214,85.1921135 C75.3746408,87.6522607 76.4858838,90.7902992 76.4858838,94.6063231 C76.4858838,98.4503032 75.3816297,101.595331 73.1730884,104.0415 C70.9645471,106.487669 68.1270335,107.710735 64.6604624,107.710735 C61.2358256,107.710735 58.4053009,106.477185 56.1688034,104.010049 C53.9323059,101.542913 52.8140739,98.4083688 52.8140739,94.6063231 C52.8140739,90.7763211 53.9218224,87.6347881 56.1373528,85.1816299 C58.3528831,82.7284717 61.1938912,81.501911 64.6604624,81.501911 L64.6604624,81.501911 Z M87.4611651,98.1707232 L87.4611651,102.46897 L89.6207722,102.46897 C90.5293493,102.46897 91.1758272,102.643694 91.5602252,102.993147 C91.9446232,103.3426 92.1368193,103.922682 92.1368193,104.733413 C92.1368193,105.558121 91.9411287,106.152182 91.5497417,106.515613 C91.1583546,106.879044 90.5153712,107.060756 89.6207722,107.060756 L82.3661697,107.060756 C81.4436145,107.060756 80.7831587,106.879044 80.3847826,106.515613 C79.9864065,106.152182 79.7872214,105.558121 79.7872214,104.733413 C79.7872214,103.992573 79.9759231,103.429962 80.353332,103.045564 C80.730741,102.661166 81.282868,102.46897 82.0097297,102.46897 L82.3661697,102.46897 L82.3661697,86.8275441 L82.0097297,86.8275441 C81.2968461,86.8275441 80.7482136,86.628359 80.3638155,86.2299829 C79.9794175,85.8316068 79.7872214,85.2620074 79.7872214,84.5211676 C79.7872214,83.7104372 79.989901,83.119871 80.3952661,82.7494511 C80.8006313,82.3790312 81.4575926,82.193824 82.3661697,82.193824 L91.0255652,82.193824 C94.450202,82.193824 97.0396079,82.8507853 98.7938606,84.1647276 C100.548113,85.4786699 101.425227,87.414609 101.425227,89.972603 C101.425227,92.6703781 100.551608,94.7111515 98.8043442,96.0949843 C97.0570805,97.4788171 94.4641801,98.1707232 91.0255652,98.1707232 L87.4611651,98.1707232 Z M87.4611651,86.8275441 L87.4611651,93.4531348 L90.4384875,93.4531348 C92.0879044,93.4531348 93.328443,93.1735768 94.1601405,92.6144525 C94.9918381,92.0553281 95.4076806,91.2166541 95.4076806,90.0984053 C95.4076806,89.0500471 94.9778602,88.2428234 94.1182064,87.67671 C93.2585527,87.1105966 92.031992,86.8275441 90.4384875,86.8275441 L87.4611651,86.8275441 Z M114.727851,107.396229 L113.092421,109.03166 C113.69348,108.835966 114.284046,108.689198 114.864137,108.591352 C115.444229,108.493505 116.013828,108.444582 116.572953,108.444582 C117.677223,108.444582 118.840883,108.608823 120.063968,108.937308 C121.287053,109.265794 122.031376,109.430034 122.29696,109.430034 C122.744259,109.430034 123.327837,109.279772 124.047709,108.979242 C124.767582,108.678713 125.253314,108.52845 125.50492,108.52845 C126.02211,108.52845 126.45193,108.727636 126.794394,109.126012 C127.136858,109.524388 127.308087,110.024098 127.308087,110.625156 C127.308087,111.421909 126.836333,112.099837 125.892811,112.658961 C124.949288,113.218086 123.792617,113.497643 122.422762,113.497643 C121.486229,113.497643 120.28413,113.277492 118.816428,112.837181 C117.348727,112.396871 116.286406,112.176719 115.629435,112.176719 C114.636989,112.176719 113.518757,112.449288 112.274706,112.994434 C111.030654,113.53958 110.261869,113.812149 109.968329,113.812149 C109.36727,113.812149 108.857077,113.612964 108.437734,113.214588 C108.01839,112.816212 107.808722,112.337469 107.808722,111.778345 C107.808722,111.386958 107.941512,110.971115 108.207096,110.530805 C108.47268,110.090494 108.94094,109.520895 109.611889,108.821989 L111.729562,106.683349 C109.395218,105.830685 107.536157,104.29661 106.152324,102.08108 C104.768491,99.8655494 104.076585,97.3180772 104.076585,94.4385866 C104.076585,90.6365409 105.180839,87.5299526 107.389381,85.1187288 C109.597922,82.7075049 112.442425,81.501911 115.922974,81.501911 C119.389545,81.501911 122.227059,82.7109994 124.4356,85.1292123 C126.644141,87.5474252 127.748395,90.650519 127.748395,94.4385866 C127.748395,98.2126762 126.65113,101.322759 124.456567,103.768928 C122.262004,106.215097 119.480402,107.438163 116.111677,107.438163 C115.888028,107.438163 115.660887,107.434669 115.430248,107.42768 C115.199609,107.420691 114.965479,107.410207 114.727851,107.396229 L114.727851,107.396229 Z M115.922974,86.3662688 C114.119798,86.3662688 112.704535,87.0931196 111.677144,88.546843 C110.649753,90.0005663 110.136065,92.0203728 110.136065,94.6063231 C110.136065,97.1922733 110.653248,99.2190688 111.687628,100.68677 C112.722008,102.154472 114.133776,102.888312 115.922974,102.888312 C117.72615,102.888312 119.144907,102.157966 120.179287,100.697254 C121.213667,99.2365414 121.730849,97.2062514 121.730849,94.6063231 C121.730849,92.0203728 121.217161,90.0005663 120.18977,88.546843 C119.162379,87.0931196 117.740128,86.3662688 115.922974,86.3662688 L115.922974,86.3662688 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/mono-line": {
            "title": "$:/core/images/mono-line",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-mono-line tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M60.4374591,84.522627 L61.3450888,84.522627 C63.2671377,84.522627 64.7264493,85.0120303 65.7230673,85.9908515 C66.7196852,86.9696727 67.2179868,88.4022896 67.2179868,90.288745 C67.2179868,92.3887615 66.6929905,93.9014625 65.6429823,94.8268935 C64.5929741,95.7523244 62.857817,96.215033 60.4374591,96.215033 L44.3670747,96.215033 C41.9111232,96.215033 40.1670679,95.7612227 39.1348565,94.8535884 C38.102645,93.9459542 37.586547,92.424355 37.586547,90.288745 C37.586547,88.2243221 38.102645,86.747214 39.1348565,85.8573766 C40.1670679,84.9675391 41.9111232,84.522627 44.3670747,84.522627 L46.235724,84.522627 L44.0467348,78.2759992 L20.9822627,78.2759992 L18.6864935,84.522627 L20.5551429,84.522627 C22.9755008,84.522627 24.7106579,84.9764373 25.7606661,85.8840716 C26.8106743,86.7917058 27.3356705,88.2599156 27.3356705,90.288745 C27.3356705,92.3887615 26.8106743,93.9014625 25.7606661,94.8268935 C24.7106579,95.7523244 22.9755008,96.215033 20.5551429,96.215033 L6.78052766,96.215033 C4.32457622,96.215033 2.58052094,95.7523244 1.54830946,94.8268935 C0.516097994,93.9014625 0,92.3887615 0,90.288745 C0,88.4022896 0.498301511,86.9696727 1.49491948,85.9908515 C2.49153745,85.0120303 3.95084902,84.522627 5.87289797,84.522627 L6.78052766,84.522627 L21.0890427,44.6937008 L16.8178442,44.6937008 C14.3974863,44.6937008 12.6623292,44.2309922 11.612321,43.3055613 C10.5623128,42.3801303 10.0373165,40.8852258 10.0373165,38.8208028 C10.0373165,36.7207864 10.5623128,35.2080854 11.612321,34.2826544 C12.6623292,33.3572234 14.3974863,32.8945149 16.8178442,32.8945149 L36.8390873,32.8945149 C40.0069087,32.8945149 42.231469,34.6029772 43.512835,38.0199531 L43.512835,38.180123 L60.4374591,84.522627 Z M32.4611088,44.6937008 L24.7195615,67.224273 L40.2026561,67.224273 L32.4611088,44.6937008 Z M89.5058233,68.5590225 L89.5058233,84.8429669 L97.5143205,84.8429669 C103.173687,84.8429669 107.160099,84.22009 109.473676,82.9743176 C111.787254,81.7285451 112.944025,79.6463566 112.944025,76.7276897 C112.944025,73.7734293 111.840643,71.6734444 109.633846,70.4276719 C107.427049,69.1818994 103.565213,68.5590225 98.0482204,68.5590225 L89.5058233,68.5590225 Z M116.734714,62.6327346 C120.614405,64.0564746 123.461842,66.0051894 125.277111,68.4789376 C127.092379,70.9526857 128,74.1115614 128,77.9556593 C128,81.1946677 127.216955,84.1488838 125.650841,86.8183962 C124.084727,89.4879087 121.84237,91.676876 118.923703,93.385364 C117.215215,94.3819819 115.302093,95.1027395 113.18428,95.5476582 C111.066467,95.9925769 108.06776,96.215033 104.188068,96.215033 L99.7033098,96.215033 L76.3184979,96.215033 C73.9693269,96.215033 72.2875593,95.7523244 71.2731446,94.8268935 C70.2587299,93.9014625 69.7515301,92.3887615 69.7515301,90.288745 C69.7515301,88.4022896 70.2320352,86.9696727 71.1930596,85.9908515 C72.1540841,85.0120303 73.5600062,84.522627 75.4108682,84.522627 L76.3184979,84.522627 L76.3184979,44.6937008 L75.4108682,44.6937008 C73.5600062,44.6937008 72.1540841,44.1953993 71.1930596,43.1987813 C70.2320352,42.2021633 69.7515301,40.7428518 69.7515301,38.8208028 C69.7515301,36.7563799 70.2676281,35.2525771 71.2998396,34.3093494 C72.3320511,33.3661217 74.0049204,32.8945149 76.3184979,32.8945149 L100.877889,32.8945149 C108.388118,32.8945149 114.09189,34.3538264 117.989378,37.2724934 C121.886867,40.1911603 123.835581,44.4623161 123.835581,50.0860889 C123.835581,52.8623819 123.239399,55.3093982 122.047017,57.4272114 C120.854635,59.5450246 119.083885,61.2801816 116.734714,62.6327346 L116.734714,62.6327346 Z M89.5058233,44.3733609 L89.5058233,57.8276363 L96.7134708,57.8276363 C101.091471,57.8276363 104.179161,57.3115383 105.976633,56.2793268 C107.774104,55.2471153 108.672827,53.50306 108.672827,51.0471086 C108.672827,48.7335312 107.863087,47.0428653 106.243583,45.9750604 C104.624078,44.9072554 101.999097,44.3733609 98.3685602,44.3733609 L89.5058233,44.3733609 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/new-button": {
            "title": "$:/core/images/new-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-new-button tc-image-button\" viewBox=\"0 0 128 128\" width=\"22pt\" height=\"22pt\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M56,72 L8.00697327,72 C3.59075293,72 0,68.418278 0,64 C0,59.5907123 3.58484404,56 8.00697327,56 L56,56 L56,8.00697327 C56,3.59075293 59.581722,0 64,0 C68.4092877,0 72,3.58484404 72,8.00697327 L72,56 L119.993027,56 C124.409247,56 128,59.581722 128,64 C128,68.4092877 124.415156,72 119.993027,72 L72,72 L72,119.993027 C72,124.409247 68.418278,128 64,128 C59.5907123,128 56,124.415156 56,119.993027 L56,72 L56,72 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/new-here-button": {
            "title": "$:/core/images/new-here-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-new-here-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n    \t<g transform=\"translate(52.233611, 64.389922) rotate(75.000000) translate(-52.233611, -64.389922) translate(-7.734417, 3.702450)\">\n\t        <path d=\"M18.9270186,45.959338 L18.9080585,49.6521741 C18.8884833,53.4648378 21.0574548,58.7482162 23.7526408,61.4434022 L78.5671839,116.257945 C81.2617332,118.952495 85.6348701,118.950391 88.3334363,116.251825 L115.863237,88.7220241 C118.555265,86.0299959 118.564544,81.6509578 115.869358,78.9557717 L61.0548144,24.1412286 C58.3602652,21.4466794 53.0787224,19.2788426 49.2595808,19.3006519 L25.9781737,19.4336012 C22.1633003,19.4553862 19.0471195,22.5673232 19.0275223,26.3842526 L18.9871663,34.2443819 C19.0818862,34.255617 19.1779758,34.2665345 19.2754441,34.2771502 C22.6891275,34.6489512 27.0485594,34.2348566 31.513244,33.2285542 C31.7789418,32.8671684 32.075337,32.5211298 32.4024112,32.1940556 C34.8567584,29.7397084 38.3789778,29.0128681 41.4406288,30.0213822 C41.5958829,29.9543375 41.7503946,29.8866669 41.9041198,29.8183808 L42.1110981,30.2733467 C43.1114373,30.6972371 44.0473796,31.3160521 44.8614145,32.1300869 C48.2842088,35.5528813 48.2555691,41.130967 44.7974459,44.5890903 C41.4339531,47.952583 36.0649346,48.0717177 32.6241879,44.9262969 C27.8170558,45.8919233 23.0726921,46.2881596 18.9270186,45.959338 Z\"></path>\n\t        <path d=\"M45.4903462,38.8768094 C36.7300141,42.6833154 26.099618,44.7997354 18.1909048,43.9383587 C7.2512621,42.7468685 1.50150083,35.8404432 4.66865776,24.7010202 C7.51507386,14.6896965 15.4908218,6.92103848 24.3842626,4.38423012 C34.1310219,1.60401701 42.4070208,6.15882777 42.4070209,16.3101169 L34.5379395,16.310117 C34.5379394,11.9285862 31.728784,10.3825286 26.5666962,11.8549876 C20.2597508,13.6540114 14.3453742,19.4148216 12.2444303,26.8041943 C10.4963869,32.9523565 12.6250796,35.5092726 19.0530263,36.2093718 C25.5557042,36.9176104 35.0513021,34.9907189 42.7038419,31.5913902 L42.7421786,31.6756595 C44.3874154,31.5384763 47.8846101,37.3706354 45.9274416,38.6772897 L45.9302799,38.6835285 C45.9166992,38.6895612 45.9031139,38.6955897 45.8895238,38.7016142 C45.8389288,38.7327898 45.7849056,38.7611034 45.7273406,38.7863919 C45.6506459,38.8200841 45.571574,38.8501593 45.4903462,38.8768094 Z\"></path>\n        </g>\n        <rect x=\"96\" y=\"80\" width=\"16\" height=\"48\" rx=\"8\"></rect>\n        <rect x=\"80\" y=\"96\" width=\"48\" height=\"16\" rx=\"8\"></rect>\n    </g>\n    </g>\n</svg>"
        },
        "$:/core/images/new-image-button": {
            "title": "$:/core/images/new-image-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-new-image-button tc-image-button\" viewBox=\"0 0 128 128\" width=\"22pt\" height=\"22pt\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M81.3619177,73.6270062 L97.1875317,46.2162388 C97.91364,44.9585822 97.4824378,43.3533085 96.2260476,42.6279312 L46.2162388,13.7547547 C44.9585822,13.0286463 43.3533085,13.4598485 42.6279312,14.7162388 L30.0575956,36.4886988 L40.0978909,31.2276186 C43.1404959,29.6333041 46.8692155,31.3421319 47.6479264,34.6877101 L51.2545483,52.3903732 L61.1353556,53.2399953 C63.2899974,53.4346096 65.1046382,54.9309951 65.706105,57.0091178 C65.7395572,57.1246982 65.8069154,57.3539875 65.9047035,57.6813669 C66.0696435,58.2335608 66.2581528,58.852952 66.4667073,59.5238092 C67.0618822,61.4383079 67.6960725,63.3742727 68.3393254,65.2021174 C68.5462918,65.7902259 68.7511789,66.3583016 68.953259,66.9034738 C69.5777086,68.5881157 70.1617856,70.0172008 70.6783305,71.110045 C70.9334784,71.6498566 71.1627732,72.0871602 71.4035746,72.5373068 C71.6178999,72.7492946 71.9508843,72.9623307 72.4151452,73.1586945 C73.5561502,73.6412938 75.1990755,73.899146 77.0720271,73.9171651 C77.9355886,73.9254732 78.7819239,73.8832103 79.5638842,73.8072782 C80.0123946,73.7637257 80.3172916,73.7224469 80.4352582,73.7027375 C80.7503629,73.6500912 81.0598053,73.6256267 81.3619177,73.6270062 L81.3619177,73.6270062 L81.3619177,73.6270062 L81.3619177,73.6270062 Z M37.4707881,2.64867269 C38.9217993,0.135447653 42.1388058,-0.723707984 44.6486727,0.725364314 L108.293614,37.4707881 C110.806839,38.9217993 111.665994,42.1388058 110.216922,44.6486727 L73.4714982,108.293614 C72.0204871,110.806839 68.8034805,111.665994 66.2936136,110.216922 L2.64867269,73.4714982 C0.135447653,72.0204871 -0.723707984,68.8034805 0.725364314,66.2936136 L37.4707881,2.64867269 L37.4707881,2.64867269 L37.4707881,2.64867269 L37.4707881,2.64867269 Z M80.3080975,53.1397764 C82.8191338,54.5895239 86.0299834,53.7291793 87.4797308,51.218143 C88.9294783,48.7071068 88.0691338,45.4962571 85.5580975,44.0465097 C83.0470612,42.5967622 79.8362116,43.4571068 78.3864641,45.968143 C76.9367166,48.4791793 77.7970612,51.6900289 80.3080975,53.1397764 L80.3080975,53.1397764 L80.3080975,53.1397764 L80.3080975,53.1397764 Z M96,112 L88.0070969,112 C83.5881712,112 80,108.418278 80,104 C80,99.5907123 83.5848994,96 88.0070969,96 L96,96 L96,88.0070969 C96,83.5881712 99.581722,80 104,80 C108.409288,80 112,83.5848994 112,88.0070969 L112,96 L119.992903,96 C124.411829,96 128,99.581722 128,104 C128,108.409288 124.415101,112 119.992903,112 L112,112 L112,119.992903 C112,124.411829 108.418278,128 104,128 C99.5907123,128 96,124.415101 96,119.992903 L96,112 L96,112 Z M33.3471097,51.7910932 C40.7754579,59.7394511 42.3564368,62.4818351 40.7958321,65.1848818 C39.2352273,67.8879286 26.9581062,62.8571718 24.7019652,66.7649227 C22.4458242,70.6726735 23.7947046,70.0228006 22.2648667,72.6725575 L41.9944593,84.0634431 C41.9944593,84.0634431 36.3904568,75.8079231 37.7602356,73.4353966 C40.2754811,69.0788636 46.5298923,72.1787882 48.1248275,69.4162793 C50.538989,65.234829 43.0222016,59.7770885 33.3471097,51.7910932 L33.3471097,51.7910932 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/new-journal-button": {
            "title": "$:/core/images/new-journal-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-new-journal-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M102.545455,112.818182 L102.545455,124.636364 L102.545455,124.636364 L102.545455,124.636364 C102.545455,125.941761 103.630828,127 104.969697,127 L111.030303,127 C112.369172,127 113.454545,125.941761 113.454545,124.636364 L113.454545,112.818182 L125.575758,112.818182 C126.914626,112.818182 128,111.759982 128,110.454545 L128,104.545455 C128,103.240018 126.914626,102.181818 125.575758,102.181818 L113.454545,102.181818 L113.454545,90.3636364 C113.454545,89.0582 112.369172,88 111.030303,88 L104.969697,88 L104.969697,88 C103.630828,88 102.545455,89.0582 102.545455,90.3636364 L102.545455,102.181818 L90.4242424,102.181818 L90.4242424,102.181818 C89.0853705,102.181818 88,103.240018 88,104.545455 L88,110.454545 L88,110.454545 L88,110.454545 C88,111.759982 89.0853705,112.818182 90.4242424,112.818182 L102.545455,112.818182 Z\"></path>\n        <g transform=\"translate(59.816987, 64.316987) rotate(30.000000) translate(-59.816987, -64.316987) translate(20.316987, 12.816987)\">\n            <g transform=\"translate(0.000000, 0.000000)\">\n                <path d=\"M9.99631148,0 C4.4755011,0 -2.27373675e-13,4.48070044 -2.27373675e-13,9.99759461 L-2.27373675e-13,91.6128884 C-2.27373675e-13,97.1344074 4.46966773,101.610483 9.99631148,101.610483 L68.9318917,101.610483 C74.4527021,101.610483 78.9282032,97.1297826 78.9282032,91.6128884 L78.9282032,9.99759461 C78.9282032,4.47607557 74.4585355,0 68.9318917,0 L9.99631148,0 Z M20.8885263,26 C24.2022348,26 26.8885263,23.3137085 26.8885263,20 C26.8885263,16.6862915 24.2022348,14 20.8885263,14 C17.5748178,14 14.8885263,16.6862915 14.8885263,20 C14.8885263,23.3137085 17.5748178,26 20.8885263,26 Z M57.3033321,25.6783342 C60.6170406,25.6783342 63.3033321,22.9920427 63.3033321,19.6783342 C63.3033321,16.3646258 60.6170406,13.6783342 57.3033321,13.6783342 C53.9896236,13.6783342 51.3033321,16.3646258 51.3033321,19.6783342 C51.3033321,22.9920427 53.9896236,25.6783342 57.3033321,25.6783342 Z\"></path>\n                <text font-family=\"Helvetica\" font-size=\"47.1724138\" font-weight=\"bold\" fill=\"#FFFFFF\">\n                    <tspan x=\"42\" y=\"77.4847912\" text-anchor=\"middle\"><<now \"DD\">></tspan>\n                </text>\n            </g>\n        </g>\n    </g>\n</svg>"
        },
        "$:/core/images/opacity": {
            "title": "$:/core/images/opacity",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-opacity tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M102.361773,65 C101.833691,67.051742 101.183534,69.0544767 100.419508,71 L82.5835324,71 C83.7602504,69.1098924 84.7666304,67.1027366 85.581205,65 L102.361773,65 Z M102.834311,63 C103.256674,61.0388326 103.568427,59.0365486 103.762717,57 L87.6555706,57 C87.3692052,59.0609452 86.9083652,61.0660782 86.2884493,63 L102.834311,63 Z M99.5852583,73 C98.6682925,75.0747721 97.6196148,77.0783056 96.4498253,79 L75.8124196,79 C77.8387053,77.2115633 79.6621163,75.1985844 81.2437158,73 L99.5852583,73 Z M95.1689122,81 C93.7449202,83.1155572 92.1695234,85.1207336 90.458251,87 L60.4614747,87 C65.1836162,85.86248 69.5430327,83.794147 73.3347255,81 L95.1689122,81 Z M87.6555706,47 L103.762717,47 C101.246684,20.6269305 79.0321807,0 52,0 C23.281193,0 0,23.281193 0,52 C0,77.2277755 17.9651296,98.2595701 41.8000051,103 L62.1999949,103 C67.8794003,101.870444 73.2255333,99.8158975 78.074754,97 L39,97 L39,95 L81.2493857,95 C83.8589242,93.2215015 86.2981855,91.2116653 88.5376609,89 L39,89 L39,87 L43.5385253,87 C27.7389671,83.1940333 16,68.967908 16,52 C16,32.117749 32.117749,16 52,16 C70.1856127,16 85.2217929,29.4843233 87.6555706,47 Z M87.8767787,49 L103.914907,49 C103.971379,49.9928025 104,50.9930589 104,52 C104,53.0069411 103.971379,54.0071975 103.914907,55 L87.8767787,55 C87.958386,54.0107999 88,53.0102597 88,52 C88,50.9897403 87.958386,49.9892001 87.8767787,49 Z\"></path>\n        <path d=\"M76,128 C104.718807,128 128,104.718807 128,76 C128,47.281193 104.718807,24 76,24 C47.281193,24 24,47.281193 24,76 C24,104.718807 47.281193,128 76,128 L76,128 Z M76,112 C95.882251,112 112,95.882251 112,76 C112,56.117749 95.882251,40 76,40 C56.117749,40 40,56.117749 40,76 C40,95.882251 56.117749,112 76,112 L76,112 Z\"></path>\n        <path d=\"M37,58 L90,58 L90,62 L37,62 L37,58 L37,58 Z M40,50 L93,50 L93,54 L40,54 L40,50 L40,50 Z M40,42 L93,42 L93,46 L40,46 L40,42 L40,42 Z M32,66 L85,66 L85,70 L32,70 L32,66 L32,66 Z M30,74 L83,74 L83,78 L30,78 L30,74 L30,74 Z M27,82 L80,82 L80,86 L27,86 L27,82 L27,82 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/open-window": {
            "title": "$:/core/images/open-window",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-open-window tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M16,112 L104.993898,112 C108.863261,112 112,115.590712 112,120 C112,124.418278 108.858091,128 104.993898,128 L7.00610161,128 C3.13673853,128 0,124.409288 0,120 C0,119.998364 4.30952878e-07,119.996727 1.29273572e-06,119.995091 C4.89579306e-07,119.993456 0,119.99182 0,119.990183 L0,24.0098166 C0,19.586117 3.59071231,16 8,16 C12.418278,16 16,19.5838751 16,24.0098166 L16,112 Z\"></path>\n        <path d=\"M96,43.1959595 L96,56 C96,60.418278 99.581722,64 104,64 C108.418278,64 112,60.418278 112,56 L112,24 C112,19.5907123 108.415101,16 103.992903,16 L72.0070969,16 C67.5881712,16 64,19.581722 64,24 C64,28.4092877 67.5848994,32 72.0070969,32 L84.5685425,32 L48.2698369,68.2987056 C45.1421332,71.4264093 45.1434327,76.4904296 48.267627,79.614624 C51.3854642,82.7324612 56.4581306,82.7378289 59.5835454,79.6124141 L96,43.1959595 Z M32,7.9992458 C32,3.58138434 35.5881049,0 39.9992458,0 L120.000754,0 C124.418616,0 128,3.5881049 128,7.9992458 L128,88.0007542 C128,92.4186157 124.411895,96 120.000754,96 L39.9992458,96 C35.5813843,96 32,92.4118951 32,88.0007542 L32,7.9992458 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/options-button": {
            "title": "$:/core/images/options-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-options-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M110.48779,76.0002544 C109.354214,80.4045063 107.611262,84.5641217 105.354171,88.3838625 L105.354171,88.3838625 L112.07833,95.1080219 C115.20107,98.2307613 115.210098,103.299824 112.089164,106.420759 L106.420504,112.089418 C103.301049,115.208874 98.2346851,115.205502 95.1077675,112.078585 L88.3836082,105.354425 C84.5638673,107.611516 80.4042519,109.354468 76,110.488045 L76,110.488045 L76,119.993281 C76,124.409501 72.4220153,128.000254 68.0083475,128.000254 L59.9916525,128.000254 C55.5800761,128.000254 52,124.41541 52,119.993281 L52,110.488045 C47.5957481,109.354468 43.4361327,107.611516 39.6163918,105.354425 L32.8922325,112.078585 C29.7694931,115.201324 24.7004301,115.210353 21.5794957,112.089418 L15.9108363,106.420759 C12.7913807,103.301303 12.7947522,98.2349395 15.9216697,95.1080219 L22.6458291,88.3838625 C20.3887383,84.5641217 18.6457859,80.4045063 17.5122098,76.0002544 L8.00697327,76.0002544 C3.59075293,76.0002544 2.19088375e-16,72.4222697 4.89347582e-16,68.0086019 L9.80228577e-16,59.9919069 C1.25035972e-15,55.5803305 3.58484404,52.0002544 8.00697327,52.0002544 L17.5122098,52.0002544 C18.6457859,47.5960025 20.3887383,43.4363871 22.6458291,39.6166462 L15.9216697,32.8924868 C12.7989304,29.7697475 12.7899019,24.7006845 15.9108363,21.5797501 L21.5794957,15.9110907 C24.6989513,12.7916351 29.7653149,12.7950065 32.8922325,15.9219241 L39.6163918,22.6460835 C43.4361327,20.3889927 47.5957481,18.6460403 52,17.5124642 L52,8.00722764 C52,3.5910073 55.5779847,0.000254375069 59.9916525,0.000254375069 L68.0083475,0.000254375069 C72.4199239,0.000254375069 76,3.58509841 76,8.00722764 L76,17.5124642 C80.4042519,18.6460403 84.5638673,20.3889927 88.3836082,22.6460835 L95.1077675,15.9219241 C98.2305069,12.7991848 103.29957,12.7901562 106.420504,15.9110907 L112.089164,21.5797501 C115.208619,24.6992057 115.205248,29.7655693 112.07833,32.8924868 L105.354171,39.6166462 L105.354171,39.6166462 C107.611262,43.4363871 109.354214,47.5960025 110.48779,52.0002544 L119.993027,52.0002544 C124.409247,52.0002544 128,55.5782391 128,59.9919069 L128,68.0086019 C128,72.4201783 124.415156,76.0002544 119.993027,76.0002544 L110.48779,76.0002544 L110.48779,76.0002544 Z M64,96.0002544 C81.673112,96.0002544 96,81.6733664 96,64.0002544 C96,46.3271424 81.673112,32.0002544 64,32.0002544 C46.326888,32.0002544 32,46.3271424 32,64.0002544 C32,81.6733664 46.326888,96.0002544 64,96.0002544 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/paint": {
            "title": "$:/core/images/paint",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-paint tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M83.5265806,76.1907935 C90.430962,69.2864121 91.8921169,59.0000433 87.9100453,50.6642209 L125.812763,12.7615036 C128.732035,9.84223095 128.72611,5.10322984 125.812796,2.18991592 C122.893542,-0.729338085 118.161775,-0.730617045 115.241209,2.18994966 L77.3384914,40.092667 C69.002669,36.1105954 58.7163002,37.5717503 51.8119188,44.4761317 L83.5265806,76.1907935 L83.5265806,76.1907935 L83.5265806,76.1907935 L83.5265806,76.1907935 Z M80.8836921,78.8336819 L49.1690303,47.1190201 C49.1690303,47.1190201 8.50573364,81.242543 0,80.2820711 C0,80.2820711 3.78222974,85.8744423 6.82737483,88.320684 C20.8514801,82.630792 44.1526049,63.720771 44.1526049,63.720771 L44.8144806,64.3803375 C44.8144806,64.3803375 19.450356,90.2231043 9.18040433,92.0477601 C10.4017154,93.4877138 13.5343883,96.1014812 15.4269991,97.8235871 C20.8439164,96.3356979 50.1595367,69.253789 50.1595367,69.253789 L50.8214124,69.9133555 L18.4136144,100.936036 L23.6993903,106.221812 L56.1060358,75.2002881 L56.7679115,75.8598546 C56.7679115,75.8598546 28.9040131,106.396168 28.0841366,108.291555 C28.0841366,108.291555 34.1159238,115.144621 35.6529617,116.115796 C36.3545333,113.280171 63.5365402,82.6307925 63.5365402,82.6307925 L64.1984159,83.290359 C64.1984159,83.290359 43.6013016,107.04575 39.2343772,120.022559 C42.443736,123.571575 46.7339155,125.159692 50.1595362,126.321151 C47.9699978,114.504469 80.8836921,78.8336819 80.8836921,78.8336819 L80.8836921,78.8336819 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/palette": {
            "title": "$:/core/images/palette",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-palette tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M80.2470434,39.1821571 C75.0645698,38.2680897 69.6261555,37.7814854 64.0193999,37.7814854 C28.6624616,37.7814854 0,57.1324214 0,81.0030106 C0,90.644534 4.67604329,99.5487133 12.5805659,106.738252 C23.5031767,91.1899067 26.3405471,72.3946229 36.8885698,63.5622337 C52.0716764,50.8486559 63.4268694,55.7343343 63.4268694,55.7343343 L80.2470434,39.1821571 Z M106.781666,48.8370714 C119.830962,56.749628 128.0388,68.229191 128.0388,81.0030106 C128.0388,90.3534932 128.557501,98.4142085 116.165191,106.082518 C105.367708,112.763955 112.341384,99.546808 104.321443,95.1851533 C96.3015017,90.8234987 84.3749007,96.492742 86.1084305,103.091059 C89.3087234,115.272303 105.529892,114.54645 92.4224435,119.748569 C79.3149955,124.950687 74.2201582,124.224536 64.0193999,124.224536 C56.1979176,124.224536 48.7040365,123.277578 41.7755684,121.544216 C51.620343,117.347916 69.6563669,109.006202 75.129737,102.088562 C82.7876655,92.4099199 87.3713218,80.0000002 83.3235694,72.4837191 C83.1303943,72.1250117 94.5392656,60.81569 106.781666,48.8370714 Z M1.13430476,123.866563 C0.914084026,123.867944 0.693884185,123.868637 0.473712455,123.868637 C33.9526848,108.928928 22.6351223,59.642592 59.2924543,59.6425917 C59.6085574,61.0606542 59.9358353,62.5865065 60.3541977,64.1372318 C34.4465025,59.9707319 36.7873124,112.168427 1.13429588,123.866563 L1.13430476,123.866563 Z M1.84669213,123.859694 C40.7185279,123.354338 79.9985412,101.513051 79.9985401,79.0466836 C70.7284906,79.0466835 65.9257264,75.5670082 63.1833375,71.1051511 C46.585768,64.1019718 32.81846,116.819636 1.84665952,123.859695 L1.84669213,123.859694 Z M67.1980193,59.8524981 C62.748213,63.9666823 72.0838429,76.2846822 78.5155805,71.1700593 C89.8331416,59.8524993 112.468264,37.2173758 123.785825,25.8998146 C135.103386,14.5822535 123.785825,3.26469247 112.468264,14.5822535 C101.150703,25.8998144 78.9500931,48.9868127 67.1980193,59.8524981 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/permalink-button": {
            "title": "$:/core/images/permalink-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-permalink-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M80.4834582,48 L73.0956761,80 L73.0956761,80 L47.5165418,80 L54.9043239,48 L80.4834582,48 Z M84.1773493,32 L89.8007299,7.64246248 C90.7941633,3.33942958 95.0918297,0.64641956 99.3968675,1.64031585 C103.693145,2.63218977 106.385414,6.93288901 105.390651,11.2416793 L100.598215,32 L104.000754,32 C108.411895,32 112,35.581722 112,40 C112,44.4092877 108.418616,48 104.000754,48 L96.9043239,48 L89.5165418,80 L104.000754,80 C108.411895,80 112,83.581722 112,88 C112,92.4092877 108.418616,96 104.000754,96 L85.8226507,96 L80.1992701,120.357538 C79.2058367,124.66057 74.9081703,127.35358 70.6031325,126.359684 C66.3068546,125.36781 63.6145865,121.067111 64.6093491,116.758321 L69.401785,96 L43.8226507,96 L38.1992701,120.357538 C37.2058367,124.66057 32.9081703,127.35358 28.6031325,126.359684 C24.3068546,125.36781 21.6145865,121.067111 22.6093491,116.758321 L27.401785,96 L23.9992458,96 C19.5881049,96 16,92.418278 16,88 C16,83.5907123 19.5813843,80 23.9992458,80 L31.0956761,80 L38.4834582,48 L23.9992458,48 C19.5881049,48 16,44.418278 16,40 C16,35.5907123 19.5813843,32 23.9992458,32 L42.1773493,32 L47.8007299,7.64246248 C48.7941633,3.33942958 53.0918297,0.64641956 57.3968675,1.64031585 C61.6931454,2.63218977 64.3854135,6.93288901 63.3906509,11.2416793 L58.598215,32 L84.1773493,32 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/permaview-button": {
            "title": "$:/core/images/permaview-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-permaview-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M81.4834582,48 L79.6365127,56 L79.6365127,56 L74.0573784,56 L75.9043239,48 L81.4834582,48 Z M85.1773493,32 L90.8007299,7.64246248 C91.7941633,3.33942958 96.0918297,0.64641956 100.396867,1.64031585 C104.693145,2.63218977 107.385414,6.93288901 106.390651,11.2416793 L101.598215,32 L104.000754,32 C108.411895,32 112,35.581722 112,40 C112,44.4092877 108.418616,48 104.000754,48 L97.9043239,48 L96.0573784,56 L104.000754,56 C108.411895,56 112,59.581722 112,64 C112,68.4092877 108.418616,72 104.000754,72 L92.3634873,72 L90.5165418,80 L104.000754,80 C108.411895,80 112,83.581722 112,88 C112,92.4092877 108.418616,96 104.000754,96 L86.8226507,96 L81.1992701,120.357538 C80.2058367,124.66057 75.9081703,127.35358 71.6031325,126.359684 C67.3068546,125.36781 64.6145865,121.067111 65.6093491,116.758321 L70.401785,96 L64.8226507,96 L59.1992701,120.357538 C58.2058367,124.66057 53.9081703,127.35358 49.6031325,126.359684 C45.3068546,125.36781 42.6145865,121.067111 43.6093491,116.758321 L48.401785,96 L42.8226507,96 L37.1992701,120.357538 C36.2058367,124.66057 31.9081703,127.35358 27.6031325,126.359684 C23.3068546,125.36781 20.6145865,121.067111 21.6093491,116.758321 L26.401785,96 L23.9992458,96 C19.5881049,96 16,92.418278 16,88 C16,83.5907123 19.5813843,80 23.9992458,80 L30.0956761,80 L31.9426216,72 L23.9992458,72 C19.5881049,72 16,68.418278 16,64 C16,59.5907123 19.5813843,56 23.9992458,56 L35.6365127,56 L37.4834582,48 L23.9992458,48 C19.5881049,48 16,44.418278 16,40 C16,35.5907123 19.5813843,32 23.9992458,32 L41.1773493,32 L46.8007299,7.64246248 C47.7941633,3.33942958 52.0918297,0.64641956 56.3968675,1.64031585 C60.6931454,2.63218977 63.3854135,6.93288901 62.3906509,11.2416793 L57.598215,32 L63.1773493,32 L68.8007299,7.64246248 C69.7941633,3.33942958 74.0918297,0.64641956 78.3968675,1.64031585 C82.6931454,2.63218977 85.3854135,6.93288901 84.3906509,11.2416793 L79.598215,32 L85.1773493,32 Z M53.9043239,48 L52.0573784,56 L57.6365127,56 L59.4834582,48 L53.9043239,48 Z M75.9426216,72 L74.0956761,80 L74.0956761,80 L68.5165418,80 L70.3634873,72 L75.9426216,72 L75.9426216,72 Z M48.3634873,72 L46.5165418,80 L52.0956761,80 L53.9426216,72 L48.3634873,72 L48.3634873,72 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/picture": {
            "title": "$:/core/images/picture",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-picture tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M112,68.2332211 L112,20.0027785 C112,17.7898769 110.207895,16 107.997221,16 L20.0027785,16 C17.7898769,16 16,17.792105 16,20.0027785 L16,58.312373 L25.2413115,43.7197989 C28.041793,39.297674 34.2643908,38.7118128 37.8410347,42.5335275 L56.0882845,63.1470817 L69.7748997,56.7400579 C72.766567,55.3552503 76.3013751,55.9473836 78.678437,58.2315339 C78.8106437,58.3585731 79.0742301,58.609836 79.4527088,58.9673596 C80.0910923,59.570398 80.8117772,60.2441563 81.598127,60.9705595 C83.8422198,63.043576 86.1541548,65.1151944 88.3956721,67.0372264 C89.1168795,67.6556396 89.8200801,68.2492007 90.5021258,68.8146755 C92.6097224,70.5620551 94.4693308,72.0029474 95.9836366,73.0515697 C96.7316295,73.5695379 97.3674038,73.9719282 98.0281481,74.3824999 C98.4724987,74.4989557 99.0742374,74.5263881 99.8365134,74.4317984 C101.709944,74.1993272 104.074502,73.2878514 106.559886,71.8846196 C107.705822,71.2376318 108.790494,70.5370325 109.764561,69.8410487 C110.323259,69.4418522 110.694168,69.1550757 110.834827,69.0391868 C111.210545,68.7296319 111.600264,68.4615815 112,68.2332211 L112,68.2332211 Z M0,8.00697327 C0,3.58484404 3.59075293,0 8.00697327,0 L119.993027,0 C124.415156,0 128,3.59075293 128,8.00697327 L128,119.993027 C128,124.415156 124.409247,128 119.993027,128 L8.00697327,128 C3.58484404,128 0,124.409247 0,119.993027 L0,8.00697327 L0,8.00697327 Z M95,42 C99.418278,42 103,38.418278 103,34 C103,29.581722 99.418278,26 95,26 C90.581722,26 87,29.581722 87,34 C87,38.418278 90.581722,42 95,42 L95,42 Z M32,76 C47.8587691,80.8294182 52.0345556,83.2438712 52.0345556,88 C52.0345556,92.7561288 32,95.4712486 32,102.347107 C32,109.222965 33.2849191,107.337637 33.2849191,112 L67.999999,112 C67.999999,112 54.3147136,105.375255 54.3147136,101.200691 C54.3147136,93.535181 64.9302432,92.860755 64.9302432,88 C64.9302432,80.6425555 50.8523779,79.167282 32,76 L32,76 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/plugin-generic-language": {
            "title": "$:/core/images/plugin-generic-language",
            "tags": "$:/tags/Image",
            "text": "<svg width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M61.2072232,68.1369825 C56.8829239,70.9319564 54.2082892,74.793177 54.2082892,79.0581634 C54.2082892,86.9638335 63.3980995,93.4821994 75.2498076,94.3940006 C77.412197,98.2964184 83.8475284,101.178858 91.5684735,101.403106 C86.4420125,100.27851 82.4506393,97.6624107 80.9477167,94.3948272 C92.8046245,93.4861461 102,86.9662269 102,79.0581634 C102,70.5281905 91.3014611,63.6132813 78.1041446,63.6132813 C71.5054863,63.6132813 65.5315225,65.3420086 61.2072232,68.1369825 Z M74.001066,53.9793443 C69.6767667,56.7743182 63.7028029,58.5030456 57.1041446,58.5030456 C54.4851745,58.5030456 51.9646095,58.2307276 49.6065315,57.7275105 C46.2945155,59.9778212 41.2235699,61.4171743 35.5395922,61.4171743 C35.4545771,61.4171743 35.3696991,61.4168523 35.2849622,61.4162104 C39.404008,60.5235193 42.7961717,58.6691298 44.7630507,56.286533 C37.8379411,53.5817651 33.2082892,48.669413 33.2082892,43.0581634 C33.2082892,34.5281905 43.9068281,27.6132812 57.1041446,27.6132812 C70.3014611,27.6132812 81,34.5281905 81,43.0581634 C81,47.3231498 78.3253653,51.1843704 74.001066,53.9793443 Z M64,0 L118.5596,32 L118.5596,96 L64,128 L9.44039956,96 L9.44039956,32 L64,0 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/plugin-generic-plugin": {
            "title": "$:/core/images/plugin-generic-plugin",
            "tags": "$:/tags/Image",
            "text": "<svg width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M40.3972881,76.4456988 L40.3972881,95.3404069 L54.5170166,95.3404069 L54.5170166,95.3404069 C54.5165526,95.3385183 54.516089,95.3366295 54.515626,95.3347404 C54.6093153,95.3385061 54.7034848,95.3404069 54.7980982,95.3404069 C58.6157051,95.3404069 61.710487,92.245625 61.710487,88.4280181 C61.710487,86.6197822 61.01617,84.9737128 59.8795929,83.7418666 L59.8795929,83.7418666 C59.8949905,83.7341665 59.9104102,83.7265043 59.925852,83.7188798 C58.8840576,82.5086663 58.2542926,80.9336277 58.2542926,79.2114996 C58.2542926,75.3938927 61.3490745,72.2991108 65.1666814,72.2991108 C68.9842884,72.2991108 72.0790703,75.3938927 72.0790703,79.2114996 C72.0790703,81.1954221 71.2432806,82.9841354 69.9045961,84.2447446 L69.9045961,84.2447446 C69.9333407,84.2629251 69.9619885,84.281245 69.9905383,84.2997032 L69.9905383,84.2997032 C69.1314315,85.4516923 68.6228758,86.8804654 68.6228758,88.4280181 C68.6228758,91.8584969 71.1218232,94.7053153 74.3986526,95.2474079 C74.3913315,95.2784624 74.3838688,95.3094624 74.3762652,95.3404069 L95.6963988,95.3404069 L95.6963988,75.5678578 L95.6963988,75.5678578 C95.6466539,75.5808558 95.5967614,75.5934886 95.5467242,75.6057531 C95.5504899,75.5120637 95.5523907,75.4178943 95.5523907,75.3232809 C95.5523907,71.505674 92.4576088,68.4108921 88.6400019,68.4108921 C86.831766,68.4108921 85.1856966,69.105209 83.9538504,70.2417862 L83.9538504,70.2417862 C83.9461503,70.2263886 83.938488,70.2109688 83.9308636,70.1955271 C82.7206501,71.2373215 81.1456115,71.8670865 79.4234834,71.8670865 C75.6058765,71.8670865 72.5110946,68.7723046 72.5110946,64.9546976 C72.5110946,61.1370907 75.6058765,58.0423088 79.4234834,58.0423088 C81.4074059,58.0423088 83.1961192,58.8780985 84.4567284,60.2167829 L84.4567284,60.2167829 C84.4749089,60.1880383 84.4932288,60.1593906 84.511687,60.1308407 L84.511687,60.1308407 C85.6636761,60.9899475 87.0924492,61.4985032 88.6400019,61.4985032 C92.0704807,61.4985032 94.9172991,58.9995558 95.4593917,55.7227265 C95.538755,55.7414363 95.6177614,55.761071 95.6963988,55.7816184 L95.6963988,40.0412962 L74.3762652,40.0412962 L74.3762652,40.0412962 C74.3838688,40.0103516 74.3913315,39.9793517 74.3986526,39.9482971 L74.3986526,39.9482971 C71.1218232,39.4062046 68.6228758,36.5593862 68.6228758,33.1289073 C68.6228758,31.5813547 69.1314315,30.1525815 69.9905383,29.0005925 C69.9619885,28.9821342 69.9333407,28.9638143 69.9045961,28.9456339 C71.2432806,27.6850247 72.0790703,25.8963113 72.0790703,23.9123888 C72.0790703,20.0947819 68.9842884,17 65.1666814,17 C61.3490745,17 58.2542926,20.0947819 58.2542926,23.9123888 C58.2542926,25.6345169 58.8840576,27.2095556 59.925852,28.419769 L59.925852,28.419769 C59.9104102,28.4273935 59.8949905,28.4350558 59.8795929,28.4427558 C61.01617,29.674602 61.710487,31.3206715 61.710487,33.1289073 C61.710487,36.9465143 58.6157051,40.0412962 54.7980982,40.0412962 C54.7034848,40.0412962 54.6093153,40.0393953 54.515626,40.0356296 L54.515626,40.0356296 C54.516089,40.0375187 54.5165526,40.0394075 54.5170166,40.0412962 L40.3972881,40.0412962 L40.3972881,52.887664 L40.3972881,52.887664 C40.4916889,53.3430132 40.5412962,53.8147625 40.5412962,54.2980982 C40.5412962,58.1157051 37.4465143,61.210487 33.6289073,61.210487 C32.0813547,61.210487 30.6525815,60.7019313 29.5005925,59.8428245 C29.4821342,59.8713744 29.4638143,59.9000221 29.4456339,59.9287667 C28.1850247,58.5900823 26.3963113,57.7542926 24.4123888,57.7542926 C20.5947819,57.7542926 17.5,60.8490745 17.5,64.6666814 C17.5,68.4842884 20.5947819,71.5790703 24.4123888,71.5790703 C26.134517,71.5790703 27.7095556,70.9493053 28.919769,69.9075109 L28.919769,69.9075109 C28.9273935,69.9229526 28.9350558,69.9383724 28.9427558,69.95377 C30.174602,68.8171928 31.8206715,68.1228758 33.6289073,68.1228758 C37.4465143,68.1228758 40.5412962,71.2176578 40.5412962,75.0352647 C40.5412962,75.5186004 40.4916889,75.9903496 40.3972881,76.4456988 Z M64,0 L118.5596,32 L118.5596,96 L64,128 L9.44039956,96 L9.44039956,32 L64,0 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/plugin-generic-theme": {
            "title": "$:/core/images/plugin-generic-theme",
            "tags": "$:/tags/Image",
            "text": "<svg width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M29.4078519,91.4716406 L51.4693474,69.4101451 L51.4646675,69.4054652 C50.5969502,68.5377479 50.5929779,67.1348725 51.4693474,66.2585029 C52.3396494,65.3882009 53.7499654,65.3874786 54.6163097,66.2538229 L64.0805963,75.7181095 C64.9483136,76.5858268 64.9522859,77.9887022 64.0759163,78.8650718 C63.2056143,79.7353737 61.7952984,79.736096 60.9289541,78.8697517 L60.9242741,78.8650718 L60.9242741,78.8650718 L38.8627786,100.926567 C36.2518727,103.537473 32.0187578,103.537473 29.4078519,100.926567 C26.796946,98.3156614 26.796946,94.0825465 29.4078519,91.4716406 Z M60.8017407,66.3810363 C58.3659178,63.6765806 56.3370667,61.2899536 54.9851735,59.5123615 C48.1295381,50.4979488 44.671561,55.2444054 40.7586738,59.5123614 C36.8457866,63.7803174 41.789473,67.2384487 38.0759896,70.2532832 C34.3625062,73.2681177 34.5917646,74.3131575 28.3243876,68.7977024 C22.0570105,63.2822473 21.6235306,61.7636888 24.5005999,58.6166112 C27.3776691,55.4695337 29.7823103,60.4247912 35.6595047,54.8320442 C41.5366991,49.2392972 36.5996215,44.2825646 36.5996215,44.2825646 C36.5996215,44.2825646 48.8365511,19.267683 65.1880231,21.1152173 C81.5394952,22.9627517 59.0022276,18.7228947 53.3962199,38.3410355 C50.9960082,46.7405407 53.8429162,44.7613399 58.3941742,48.3090467 C59.7875202,49.3951602 64.4244828,52.7100463 70.1884353,56.9943417 L90.8648751,36.3179019 L92.4795866,31.5515482 L100.319802,26.8629752 L103.471444,30.0146174 L98.782871,37.8548326 L94.0165173,39.4695441 L73.7934912,59.6925702 C86.4558549,69.2403631 102.104532,81.8392557 102.104532,86.4016913 C102.104533,93.6189834 99.0337832,97.9277545 92.5695848,95.5655717 C87.8765989,93.8506351 73.8015497,80.3744087 63.8173444,69.668717 L60.9242741,72.5617873 L57.7726319,69.4101451 L60.8017407,66.3810363 L60.8017407,66.3810363 Z M63.9533761,1.42108547e-13 L118.512977,32 L118.512977,96 L63.9533761,128 L9.39377563,96 L9.39377563,32 L63.9533761,1.42108547e-13 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/preview-closed": {
            "title": "$:/core/images/preview-closed",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-preview-closed tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M0.0881363238,64 C-0.210292223,65.8846266 0.249135869,67.8634737 1.4664206,69.4579969 C16.2465319,88.8184886 39.1692554,100.414336 64,100.414336 C88.8307446,100.414336 111.753468,88.8184886 126.533579,69.4579969 C127.750864,67.8634737 128.210292,65.8846266 127.911864,64 C110.582357,78.4158332 88.3036732,87.0858436 64,87.0858436 C39.6963268,87.0858436 17.4176431,78.4158332 0.0881363238,64 Z\"></path>\n        <rect x=\"62\" y=\"96\" width=\"4\" height=\"16\" rx=\"4\"></rect>\n        <rect transform=\"translate(80.000000, 101.000000) rotate(-5.000000) translate(-80.000000, -101.000000) \" x=\"78\" y=\"93\" width=\"4\" height=\"16\" rx=\"4\"></rect>\n        <rect transform=\"translate(48.000000, 101.000000) rotate(-355.000000) translate(-48.000000, -101.000000) \" x=\"46\" y=\"93\" width=\"4\" height=\"16\" rx=\"4\"></rect>\n        <rect transform=\"translate(32.000000, 96.000000) rotate(-350.000000) translate(-32.000000, -96.000000) \" x=\"30\" y=\"88\" width=\"4\" height=\"16\" rx=\"4\"></rect>\n        <rect transform=\"translate(96.000000, 96.000000) rotate(-10.000000) translate(-96.000000, -96.000000) \" x=\"94\" y=\"88\" width=\"4\" height=\"16\" rx=\"4\"></rect>\n        <rect transform=\"translate(112.000000, 88.000000) rotate(-20.000000) translate(-112.000000, -88.000000) \" x=\"110\" y=\"80\" width=\"4\" height=\"16\" rx=\"4\"></rect>\n        <rect transform=\"translate(16.000000, 88.000000) rotate(-340.000000) translate(-16.000000, -88.000000) \" x=\"14\" y=\"80\" width=\"4\" height=\"16\" rx=\"4\"></rect>\n    </g>\n</svg>"
        },
        "$:/core/images/preview-open": {
            "title": "$:/core/images/preview-open",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-preview-open tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M64.1099282,99.5876785 C39.2791836,99.5876785 16.3564602,87.9918313 1.57634884,68.6313396 C-0.378878622,66.070184 -0.378878622,62.5174945 1.57634884,59.9563389 C16.3564602,40.5958472 39.2791836,29 64.1099282,29 C88.9406729,29 111.863396,40.5958472 126.643508,59.9563389 C128.598735,62.5174945 128.598735,66.070184 126.643508,68.6313396 C111.863396,87.9918313 88.9406729,99.5876785 64.1099282,99.5876785 Z M110.213805,67.5808331 C111.654168,66.0569335 111.654168,63.9430665 110.213805,62.4191669 C99.3257042,50.8995835 82.4391647,44 64.1470385,44 C45.8549124,44 28.9683729,50.8995835 18.0802717,62.4191669 C16.6399094,63.9430665 16.6399094,66.0569335 18.0802717,67.5808331 C28.9683729,79.1004165 45.8549124,86 64.1470385,86 C82.4391647,86 99.3257042,79.1004165 110.213805,67.5808331 Z\"></path>\n        <path d=\"M63.5,88 C76.4786916,88 87,77.4786916 87,64.5 C87,51.5213084 76.4786916,41 63.5,41 C50.5213084,41 40,51.5213084 40,64.5 C40,77.4786916 50.5213084,88 63.5,88 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/print-button": {
            "title": "$:/core/images/print-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-print-button tc-image-button\" viewBox=\"0 0 128 128\" width=\"22pt\" height=\"22pt\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M112,71 L112,30.5 L111.96811,30.5 L111.96811,30.5 C111.932942,28.4998414 111.151676,26.510538 109.625176,24.9840387 L86.9982489,2.35711116 C85.3482153,0.707077645 83.1589869,-0.071534047 81,0.0201838424 L81,0 L23.9992458,0 C19.5808867,0 16,3.58213437 16,8.00092105 L16,71 L24,71 L24,8 L81,8 L81,22.4996539 C81,26.9216269 84.5818769,30.5 89.0003461,30.5 L104,30.5 L104,71 L112,71 Z\"></path>\n        <rect x=\"32\" y=\"36\" width=\"64\" height=\"8\" rx=\"4\"></rect>\n        <rect x=\"32\" y=\"52\" width=\"64\" height=\"8\" rx=\"4\"></rect>\n        <rect x=\"32\" y=\"20\" width=\"40\" height=\"8\" rx=\"4\"></rect>\n        <path d=\"M0,80.0054195 C0,71.1658704 7.15611005,64 16.0008841,64 L111.999116,64 C120.83616,64 128,71.1553215 128,80.0054195 L128,111.99458 C128,120.83413 120.84389,128 111.999116,128 L16.0008841,128 C7.16383982,128 0,120.844679 0,111.99458 L0,80.0054195 Z M104,96 C108.418278,96 112,92.418278 112,88 C112,83.581722 108.418278,80 104,80 C99.581722,80 96,83.581722 96,88 C96,92.418278 99.581722,96 104,96 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/quote": {
            "title": "$:/core/images/quote",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-quote tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M51.2188077,117.712501 L51.2188077,62.1993386 L27.4274524,62.1993386 C27.4274524,53.3075754 29.1096526,45.797753 32.4741035,39.669646 C35.8385544,33.541539 42.0867267,28.9154883 51.2188077,25.7913554 L51.2188077,2 C43.7689521,2.96127169 36.8599155,5.18417913 30.4914905,8.668789 C24.1230656,12.1533989 18.6559149,16.5391352 14.0898743,21.8261295 C9.52383382,27.1131238 5.97919764,33.2411389 3.45585945,40.2103586 C0.932521268,47.1795784 -0.208971741,54.6293222 0.0313461819,62.5598136 L0.0313461819,117.712501 L51.2188077,117.712501 Z M128,117.712501 L128,62.1993386 L104.208645,62.1993386 C104.208645,53.3075754 105.890845,45.797753 109.255296,39.669646 C112.619747,33.541539 118.867919,28.9154883 128,25.7913554 L128,2 C120.550144,2.96127169 113.641108,5.18417913 107.272683,8.668789 C100.904258,12.1533989 95.4371072,16.5391352 90.8710666,21.8261295 C86.3050261,27.1131238 82.7603899,33.2411389 80.2370517,40.2103586 C77.7137136,47.1795784 76.5722206,54.6293222 76.8125385,62.5598136 L76.8125385,117.712501 L128,117.712501 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/refresh-button": {
            "title": "$:/core/images/refresh-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-refresh-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M106.369002,39.4325143 C116.529932,60.3119371 112.939592,86.1974934 95.5979797,103.539105 C73.7286194,125.408466 38.2713806,125.408466 16.4020203,103.539105 C-5.46734008,81.6697449 -5.46734008,46.2125061 16.4020203,24.3431458 C19.5262146,21.2189514 24.5915344,21.2189514 27.7157288,24.3431458 C30.8399231,27.4673401 30.8399231,32.5326599 27.7157288,35.6568542 C12.0947571,51.2778259 12.0947571,76.6044251 27.7157288,92.2253967 C43.3367004,107.846368 68.6632996,107.846368 84.2842712,92.2253967 C97.71993,78.7897379 99.5995262,58.1740623 89.9230597,42.729491 L83.4844861,54.9932839 C81.4307001,58.9052072 76.5945372,60.4115251 72.682614,58.3577391 C68.7706907,56.3039532 67.2643728,51.4677903 69.3181587,47.555867 L84.4354914,18.7613158 C86.4966389,14.8353707 91.3577499,13.3347805 95.273202,15.415792 L124.145886,30.7612457 C128.047354,32.8348248 129.52915,37.6785572 127.455571,41.5800249 C125.381992,45.4814927 120.53826,46.9632892 116.636792,44.8897102 L106.369002,39.4325143 Z M98.1470904,27.0648707 C97.9798954,26.8741582 97.811187,26.6843098 97.6409651,26.4953413 L98.6018187,26.1987327 L98.1470904,27.0648707 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/right-arrow": {
            "title": "$:/core/images/right-arrow",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-right-arrow tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <path d=\"M80.3563798,109.353315 C78.9238993,110.786918 76.9450203,111.675144 74.7592239,111.675144 L-4.40893546,111.675144 C-8.77412698,111.675144 -12.3248558,108.130732 -12.3248558,103.758478 C-12.3248558,99.3951199 -8.78077754,95.8418109 -4.40893546,95.8418109 L66.8418109,95.8418109 L66.8418109,24.5910645 C66.8418109,20.225873 70.3862233,16.6751442 74.7584775,16.6751442 C79.1218352,16.6751442 82.6751442,20.2192225 82.6751442,24.5910645 L82.6751442,103.759224 C82.6751442,105.941695 81.7891419,107.920575 80.3566508,109.353886 Z\" transform=\"translate(35.175144, 64.175144) rotate(-45.000000) translate(-35.175144, -64.175144) \"></path>\n</svg>"
        },
        "$:/core/images/save-button": {
            "title": "$:/core/images/save-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-save-button tc-image-button\" viewBox=\"0 0 128 128\" width=\"22pt\" height=\"22pt\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M120.78304,34.329058 C125.424287,43.1924006 128.049406,53.2778608 128.049406,63.9764502 C128.049406,99.3226742 99.3956295,127.97645 64.0494055,127.97645 C28.7031816,127.97645 0.0494055385,99.3226742 0.0494055385,63.9764502 C0.0494055385,28.6302262 28.7031816,-0.0235498012 64.0494055,-0.0235498012 C82.8568763,-0.0235498012 99.769563,8.08898558 111.479045,21.0056358 L114.159581,18.3250998 C117.289194,15.1954866 122.356036,15.1939641 125.480231,18.3181584 C128.598068,21.4359957 128.601317,26.5107804 125.473289,29.6388083 L120.78304,34.329058 Z M108.72451,46.3875877 C110.870571,51.8341374 112.049406,57.767628 112.049406,63.9764502 C112.049406,90.4861182 90.5590735,111.97645 64.0494055,111.97645 C37.5397375,111.97645 16.0494055,90.4861182 16.0494055,63.9764502 C16.0494055,37.4667822 37.5397375,15.9764502 64.0494055,15.9764502 C78.438886,15.9764502 91.3495036,22.308215 100.147097,32.3375836 L58.9411255,73.5435552 L41.975581,56.5780107 C38.8486152,53.4510448 33.7746915,53.4551552 30.6568542,56.5729924 C27.5326599,59.6971868 27.5372202,64.7670668 30.6618725,67.8917192 L53.279253,90.5090997 C54.8435723,92.073419 56.8951519,92.8541315 58.9380216,92.8558261 C60.987971,92.8559239 63.0389578,92.0731398 64.6049211,90.5071765 L108.72451,46.3875877 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/size": {
            "title": "$:/core/images/size",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-size tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <path d=\"M92.3431458,26 L83.1715729,35.1715729 C81.6094757,36.73367 81.6094757,39.26633 83.1715729,40.8284271 C84.73367,42.3905243 87.26633,42.3905243 88.8284271,40.8284271 L104.828427,24.8284271 C106.390524,23.26633 106.390524,20.73367 104.828427,19.1715729 L88.8284271,3.17157288 C87.26633,1.60947571 84.73367,1.60947571 83.1715729,3.17157288 C81.6094757,4.73367004 81.6094757,7.26632996 83.1715729,8.82842712 L92.3431457,18 L22,18 C19.790861,18 18,19.790861 18,22 L18,92.3431458 L8.82842712,83.1715729 C7.26632996,81.6094757 4.73367004,81.6094757 3.17157288,83.1715729 C1.60947571,84.73367 1.60947571,87.26633 3.17157288,88.8284271 L19.1715729,104.828427 C20.73367,106.390524 23.26633,106.390524 24.8284271,104.828427 L40.8284271,88.8284271 C42.3905243,87.26633 42.3905243,84.73367 40.8284271,83.1715729 C39.26633,81.6094757 36.73367,81.6094757 35.1715729,83.1715729 L26,92.3431458 L26,22 L22,26 L92.3431458,26 L92.3431458,26 Z M112,52 L112,116 L116,112 L52,112 C49.790861,112 48,113.790861 48,116 C48,118.209139 49.790861,120 52,120 L116,120 C118.209139,120 120,118.209139 120,116 L120,52 C120,49.790861 118.209139,48 116,48 C113.790861,48 112,49.790861 112,52 L112,52 Z\"></path>\n</svg>"
        },
        "$:/core/images/spiral": {
            "title": "$:/core/images/spiral",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-spiral tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"nonzero\">\n        <path d=\"M64.534 68.348c3.39 0 6.097-2.62 6.476-5.968l-4.755-.538 4.75.583c.377-3.07-1.194-6.054-3.89-7.78-2.757-1.773-6.34-2.01-9.566-.7-3.46 1.403-6.14 4.392-7.35 8.148l-.01.026c-1.3 4.08-.72 8.64 1.58 12.52 2.5 4.2 6.77 7.2 11.76 8.27 5.37 1.15 11.11-.05 15.83-3.31 5.04-3.51 8.46-9.02 9.45-15.3 1.05-6.7-.72-13.63-4.92-19.19l.02.02c-4.42-5.93-11.2-9.82-18.78-10.78-7.96-1.01-16.13 1.31-22.59 6.43-6.81 5.39-11.18 13.41-12.11 22.26-.98 9.27 1.87 18.65 7.93 26.02 6.32 7.69 15.6 12.56 25.74 13.48 10.54.96 21.15-2.42 29.45-9.4l.01-.01c8.58-7.25 13.94-17.78 14.86-29.21.94-11.84-2.96-23.69-10.86-32.9-8.19-9.5-19.95-15.36-32.69-16.27-13.16-.94-26.24 3.49-36.34 12.34l.01-.01c-10.41 9.08-16.78 22.1-17.68 36.15-.93 14.44 4.03 28.77 13.79 39.78 10.03 11.32 24.28 18.2 39.6 19.09 15.73.92 31.31-4.56 43.24-15.234 12.23-10.954 19.61-26.44 20.5-43.074.14-2.64-1.89-4.89-4.52-5.03-2.64-.14-4.89 1.88-5.03 4.52-.75 14.1-7 27.2-17.33 36.45-10.03 8.98-23.11 13.58-36.3 12.81-12.79-.75-24.67-6.48-33-15.89-8.07-9.11-12.17-20.94-11.41-32.827.74-11.52 5.942-22.15 14.43-29.54l.01-.01c8.18-7.17 18.74-10.75 29.35-9.998 10.21.726 19.6 5.41 26.11 12.96 6.24 7.273 9.32 16.61 8.573 25.894-.718 8.9-4.88 17.064-11.504 22.66l.01-.007c-6.36 5.342-14.44 7.92-22.425 7.19-7.604-.68-14.52-4.314-19.21-10.027-4.44-5.4-6.517-12.23-5.806-18.94.67-6.3 3.76-11.977 8.54-15.766 4.46-3.54 10.05-5.128 15.44-4.44 5.03.63 9.46 3.18 12.32 7.01l.02.024c2.65 3.5 3.75 7.814 3.1 11.92-.59 3.71-2.58 6.925-5.45 8.924-2.56 1.767-5.61 2.403-8.38 1.81-2.42-.516-4.42-1.92-5.53-3.79-.93-1.56-1.15-3.3-.69-4.75l-4.56-1.446L59.325 65c.36-1.12 1.068-1.905 1.84-2.22.25-.103.48-.14.668-.13.06.006.11.015.14.025.01 0 .01 0-.01-.01-.02-.015-.054-.045-.094-.088-.06-.064-.12-.145-.17-.244-.15-.29-.23-.678-.18-1.11l-.005.04c.15-1.332 1.38-2.523 3.035-2.523-2.65 0-4.79 2.144-4.79 4.787s2.14 4.785 4.78 4.785z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/stamp": {
            "title": "$:/core/images/stamp",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-stamp tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M49.7334301,64 L16.0098166,64 C11.5838751,64 8,67.5829053 8,72.002643 L8,74.4986785 L8,97 L120,97 L120,74.4986785 L120,72.002643 C120,67.5737547 116.413883,64 111.990183,64 L78.2665699,64 C76.502049,60.7519149 75.5,57.0311962 75.5,53.0769231 C75.5,46.6017951 78.1869052,40.7529228 82.5087769,36.5800577 C85.3313113,32.7688808 87,28.0549983 87,22.952183 C87,10.2760423 76.7025492,0 64,0 C51.2974508,0 41,10.2760423 41,22.952183 C41,28.0549983 42.6686887,32.7688808 45.4912231,36.5800577 C49.8130948,40.7529228 52.5,46.6017951 52.5,53.0769231 C52.5,57.0311962 51.497951,60.7519149 49.7334301,64 Z M8,104 L120,104 L120,112 L8,112 L8,104 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/star-filled": {
            "title": "$:/core/images/star-filled",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-star-filled tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"nonzero\">\n        <path d=\"M61.8361286,96.8228569 L99.1627704,124.110219 C101.883827,126.099427 105.541968,123.420868 104.505636,120.198072 L90.2895569,75.9887263 L89.0292911,79.8977279 L126.314504,52.5528988 C129.032541,50.5595011 127.635256,46.2255025 124.273711,46.2229134 L78.1610486,46.1873965 L81.4604673,48.6032923 L67.1773543,4.41589688 C66.1361365,1.19470104 61.6144265,1.19470104 60.5732087,4.41589688 L46.2900957,48.6032923 L49.5895144,46.1873965 L3.47685231,46.2229134 C0.115307373,46.2255025 -1.28197785,50.5595011 1.43605908,52.5528988 L38.7212719,79.8977279 L37.4610061,75.9887263 L23.2449266,120.198072 C22.2085954,123.420868 25.8667356,126.099427 28.5877926,124.110219 L65.9144344,96.8228569 L61.8361286,96.8228569 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/storyview-classic": {
            "title": "$:/core/images/storyview-classic",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-storyview-classic tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M8.00697327,0 C3.58484404,0 0,3.59075293 0,8.00697327 L0,119.993027 C0,124.415156 3.59075293,128 8.00697327,128 L119.993027,128 C124.415156,128 128,124.409247 128,119.993027 L128,8.00697327 C128,3.58484404 124.409247,0 119.993027,0 L8.00697327,0 L8.00697327,0 Z M23.9992458,16 C19.5813843,16 16,19.5776607 16,23.9924054 L16,40.0075946 C16,44.4216782 19.5881049,48 23.9992458,48 L104.000754,48 C108.418616,48 112,44.4223393 112,40.0075946 L112,23.9924054 C112,19.5783218 108.411895,16 104.000754,16 L23.9992458,16 L23.9992458,16 Z M23.9992458,64 C19.5813843,64 16,67.5907123 16,72 C16,76.418278 19.5881049,80 23.9992458,80 L104.000754,80 C108.418616,80 112,76.4092877 112,72 C112,67.581722 108.411895,64 104.000754,64 L23.9992458,64 L23.9992458,64 Z M23.9992458,96 C19.5813843,96 16,99.5907123 16,104 C16,108.418278 19.5881049,112 23.9992458,112 L104.000754,112 C108.418616,112 112,108.409288 112,104 C112,99.581722 108.411895,96 104.000754,96 L23.9992458,96 L23.9992458,96 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/storyview-pop": {
            "title": "$:/core/images/storyview-pop",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-storyview-pop tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M8.00697327,0 C3.58484404,0 0,3.59075293 0,8.00697327 L0,119.993027 C0,124.415156 3.59075293,128 8.00697327,128 L119.993027,128 C124.415156,128 128,124.409247 128,119.993027 L128,8.00697327 C128,3.58484404 124.409247,0 119.993027,0 L8.00697327,0 L8.00697327,0 Z M23.9992458,16 C19.5813843,16 16,19.5776607 16,23.9924054 L16,40.0075946 C16,44.4216782 19.5881049,48 23.9992458,48 L104.000754,48 C108.418616,48 112,44.4223393 112,40.0075946 L112,23.9924054 C112,19.5783218 108.411895,16 104.000754,16 L23.9992458,16 L23.9992458,16 Z M16.0098166,56 C11.586117,56 8,59.5776607 8,63.9924054 L8,80.0075946 C8,84.4216782 11.5838751,88 16.0098166,88 L111.990183,88 C116.413883,88 120,84.4223393 120,80.0075946 L120,63.9924054 C120,59.5783218 116.416125,56 111.990183,56 L16.0098166,56 L16.0098166,56 Z M23.9992458,96 C19.5813843,96 16,99.5907123 16,104 C16,108.418278 19.5881049,112 23.9992458,112 L104.000754,112 C108.418616,112 112,108.409288 112,104 C112,99.581722 108.411895,96 104.000754,96 L23.9992458,96 L23.9992458,96 Z M23.9992458,64 C19.5813843,64 16,67.5907123 16,72 C16,76.418278 19.5881049,80 23.9992458,80 L104.000754,80 C108.418616,80 112,76.4092877 112,72 C112,67.581722 108.411895,64 104.000754,64 L23.9992458,64 L23.9992458,64 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/storyview-zoomin": {
            "title": "$:/core/images/storyview-zoomin",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-storyview-zoomin tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M8.00697327,0 C3.58484404,0 0,3.59075293 0,8.00697327 L0,119.993027 C0,124.415156 3.59075293,128 8.00697327,128 L119.993027,128 C124.415156,128 128,124.409247 128,119.993027 L128,8.00697327 C128,3.58484404 124.409247,0 119.993027,0 L8.00697327,0 L8.00697327,0 Z M23.9992458,16 C19.5813843,16 16,19.578055 16,24.0085154 L16,71.9914846 C16,76.4144655 19.5881049,80 23.9992458,80 L104.000754,80 C108.418616,80 112,76.421945 112,71.9914846 L112,24.0085154 C112,19.5855345 108.411895,16 104.000754,16 L23.9992458,16 L23.9992458,16 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/strikethrough": {
            "title": "$:/core/images/strikethrough",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-strikethrough tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M92.793842,38.7255689 L108.215529,38.7255689 C107.987058,31.985687 106.70193,26.1883331 104.360107,21.3333333 C102.018284,16.4783336 98.8197436,12.4516001 94.7643909,9.25301205 C90.7090382,6.05442399 85.9969032,3.71263572 80.6278447,2.22757697 C75.2587862,0.742518233 69.4328739,0 63.1499331,0 C57.552404,0 52.0977508,0.713959839 46.7858099,2.14190094 C41.473869,3.56984203 36.7331757,5.74027995 32.5635877,8.65327979 C28.3939997,11.5662796 25.0526676,15.2788708 22.5394913,19.7911647 C20.026315,24.3034585 18.7697456,29.6438781 18.7697456,35.8125837 C18.7697456,41.4101128 19.883523,46.0651309 22.1111111,49.7777778 C24.3386992,53.4904246 27.3087722,56.5176144 31.021419,58.8594378 C34.7340659,61.2012612 38.9321497,63.0861151 43.6157965,64.5140562 C48.2994433,65.9419973 53.068695,67.1985666 57.9236948,68.2838019 C62.7786945,69.3690371 67.5479462,70.4256977 72.231593,71.4538153 C76.9152398,72.4819329 81.1133237,73.8241773 84.8259705,75.480589 C88.5386174,77.1370007 91.5086903,79.2788802 93.7362784,81.9062918 C95.9638666,84.5337035 97.0776439,87.9607107 97.0776439,92.1874163 C97.0776439,96.6425926 96.1637753,100.298067 94.3360107,103.153949 C92.5082461,106.009831 90.109341,108.265944 87.1392236,109.922356 C84.1691061,111.578768 80.827774,112.749662 77.1151272,113.435074 C73.4024803,114.120485 69.7184476,114.463186 66.0629183,114.463186 C61.4935068,114.463186 57.0383974,113.892018 52.6974565,112.749665 C48.3565156,111.607312 44.5582492,109.836692 41.3025435,107.437751 C38.0468378,105.03881 35.4194656,101.983062 33.4203481,98.270415 C31.4212305,94.5577681 30.4216867,90.1312171 30.4216867,84.9906292 L15,84.9906292 C15,92.4159229 16.3422445,98.8415614 19.0267738,104.267738 C21.711303,109.693914 25.3667774,114.149023 29.9933066,117.633199 C34.6198357,121.117376 39.9888137,123.71619 46.1004016,125.429719 C52.2119895,127.143248 58.6947448,128 65.5488621,128 C71.1463912,128 76.7723948,127.343157 82.4270415,126.029451 C88.0816882,124.715745 93.1936407,122.602424 97.7630522,119.689424 C102.332464,116.776425 106.073613,113.006717 108.986613,108.380187 C111.899613,103.753658 113.356091,98.1847715 113.356091,91.6733601 C113.356091,85.6188899 112.242314,80.5926126 110.014726,76.5943775 C107.787137,72.5961424 104.817065,69.2833688 101.104418,66.6559572 C97.3917708,64.0285455 93.193687,61.9437828 88.5100402,60.4016064 C83.8263934,58.85943 79.0571416,57.5171855 74.2021419,56.3748327 C69.3471422,55.2324798 64.5778904,54.1758192 59.8942436,53.2048193 C55.2105968,52.2338193 51.012513,51.0058084 47.2998661,49.5207497 C43.5872193,48.0356909 40.6171463,46.1222786 38.3895582,43.7804552 C36.1619701,41.4386318 35.0481928,38.3828836 35.0481928,34.6131191 C35.0481928,30.6148841 35.8192694,27.273552 37.3614458,24.5890228 C38.9036222,21.9044935 40.9598265,19.762614 43.5301205,18.1633199 C46.1004145,16.5640259 49.041929,15.4216902 52.3547523,14.7362784 C55.6675757,14.0508667 59.0374661,13.708166 62.4645248,13.708166 C70.9179361,13.708166 77.8576257,15.6786952 83.2838019,19.6198126 C88.709978,23.56093 91.8799597,29.9294518 92.793842,38.7255689 L92.793842,38.7255689 Z\"></path>\n        <rect x=\"5\" y=\"54\" width=\"118\" height=\"16\"></rect>\n    </g>\n</svg>"
        },
        "$:/core/images/subscript": {
            "title": "$:/core/images/subscript",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-subscript tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M2.27170276,16 L22.1825093,16 L43.8305003,49.6746527 L66.4138983,16 L85.1220387,16 L53.5854592,61.9685735 L87.3937414,111.411516 L67.0820462,111.411516 L43.295982,74.9306422 L19.1090291,111.411516 L0,111.411516 L33.8082822,61.9685735 L2.27170276,16 Z M127.910914,128.411516 L85.3276227,128.411516 C85.3870139,123.24448 86.6342108,118.730815 89.0692508,114.870386 C91.5042907,111.009956 94.8301491,107.654403 99.0469256,104.803624 C101.066227,103.318844 103.174584,101.878629 105.372059,100.482935 C107.569534,99.0872413 109.588805,97.5876355 111.429933,95.9840726 C113.271061,94.3805097 114.785514,92.6433426 115.973338,90.7725192 C117.161163,88.9016958 117.784761,86.7487964 117.844152,84.3137564 C117.844152,83.1853233 117.710524,81.9826691 117.443264,80.7057579 C117.176003,79.4288467 116.656338,78.2410402 115.884252,77.1423026 C115.112166,76.0435651 114.04314,75.123015 112.677142,74.3806248 C111.311144,73.6382345 109.529434,73.267045 107.331959,73.267045 C105.312658,73.267045 103.634881,73.6679297 102.298579,74.4697112 C100.962276,75.2714926 99.8932503,76.3702137 99.0914688,77.7659073 C98.2896874,79.161601 97.6957841,80.8096826 97.3097412,82.7102016 C96.9236982,84.6107206 96.7009845,86.6596869 96.6415933,88.857162 L86.4857457,88.857162 C86.4857457,85.4124713 86.9460207,82.2202411 87.8665846,79.2803758 C88.7871485,76.3405105 90.1679736,73.801574 92.0091014,71.6634901 C93.8502292,69.5254062 96.092214,67.8476295 98.7351233,66.6301095 C101.378033,65.4125895 104.451482,64.8038386 107.955564,64.8038386 C111.756602,64.8038386 114.933984,65.4274371 117.487807,66.6746527 C120.041629,67.9218683 122.105443,69.4957119 123.67931,71.3962309 C125.253178,73.2967499 126.366746,75.3605638 127.02005,77.5877345 C127.673353,79.8149053 128,81.9381095 128,83.9574109 C128,86.4518421 127.613963,88.7086746 126.841877,90.727976 C126.069791,92.7472774 125.03046,94.6032252 123.723854,96.2958749 C122.417247,97.9885247 120.932489,99.5475208 119.269534,100.97291 C117.60658,102.398299 115.884261,103.734582 114.102524,104.981797 C112.320788,106.229013 110.539078,107.416819 108.757341,108.545253 C106.975605,109.673686 105.327523,110.802102 103.813047,111.930535 C102.298571,113.058968 100.977136,114.231927 99.8487031,115.449447 C98.7202699,116.666967 97.9481956,117.958707 97.5324571,119.324705 L127.910914,119.324705 L127.910914,128.411516 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/superscript": {
            "title": "$:/core/images/superscript",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-superscript tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M2.27170276,16 L22.1825093,16 L43.8305003,49.6746527 L66.4138983,16 L85.1220387,16 L53.5854592,61.9685735 L87.3937414,111.411516 L67.0820462,111.411516 L43.295982,74.9306422 L19.1090291,111.411516 L0,111.411516 L33.8082822,61.9685735 L2.27170276,16 Z M127.910914,63.4115159 L85.3276227,63.4115159 C85.3870139,58.2444799 86.6342108,53.7308149 89.0692508,49.8703857 C91.5042907,46.0099565 94.8301491,42.654403 99.0469256,39.8036245 C101.066227,38.318844 103.174584,36.8786285 105.372059,35.4829349 C107.569534,34.0872413 109.588805,32.5876355 111.429933,30.9840726 C113.271061,29.3805097 114.785514,27.6433426 115.973338,25.7725192 C117.161163,23.9016958 117.784761,21.7487964 117.844152,19.3137564 C117.844152,18.1853233 117.710524,16.9826691 117.443264,15.7057579 C117.176003,14.4288467 116.656338,13.2410402 115.884252,12.1423026 C115.112166,11.0435651 114.04314,10.123015 112.677142,9.38062477 C111.311144,8.63823453 109.529434,8.26704499 107.331959,8.26704499 C105.312658,8.26704499 103.634881,8.6679297 102.298579,9.46971115 C100.962276,10.2714926 99.8932503,11.3702137 99.0914688,12.7659073 C98.2896874,14.161601 97.6957841,15.8096826 97.3097412,17.7102016 C96.9236982,19.6107206 96.7009845,21.6596869 96.6415933,23.857162 L86.4857457,23.857162 C86.4857457,20.4124713 86.9460207,17.2202411 87.8665846,14.2803758 C88.7871485,11.3405105 90.1679736,8.80157397 92.0091014,6.6634901 C93.8502292,4.52540622 96.092214,2.84762946 98.7351233,1.63010947 C101.378033,0.412589489 104.451482,-0.196161372 107.955564,-0.196161372 C111.756602,-0.196161372 114.933984,0.427437071 117.487807,1.67465266 C120.041629,2.92186826 122.105443,4.49571195 123.67931,6.39623095 C125.253178,8.29674995 126.366746,10.3605638 127.02005,12.5877345 C127.673353,14.8149053 128,16.9381095 128,18.9574109 C128,21.4518421 127.613963,23.7086746 126.841877,25.727976 C126.069791,27.7472774 125.03046,29.6032252 123.723854,31.2958749 C122.417247,32.9885247 120.932489,34.5475208 119.269534,35.97291 C117.60658,37.3982993 115.884261,38.7345816 114.102524,39.9817972 C112.320788,41.2290128 110.539078,42.4168194 108.757341,43.5452525 C106.975605,44.6736857 105.327523,45.8021019 103.813047,46.9305351 C102.298571,48.0589682 100.977136,49.2319272 99.8487031,50.4494472 C98.7202699,51.6669672 97.9481956,52.9587068 97.5324571,54.3247048 L127.910914,54.3247048 L127.910914,63.4115159 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/tag-button": {
            "title": "$:/core/images/tag-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-tag-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M18.1643182,47.6600756 L18.1677196,51.7651887 C18.1708869,55.5878829 20.3581578,60.8623899 23.0531352,63.5573673 L84.9021823,125.406414 C87.5996731,128.103905 91.971139,128.096834 94.6717387,125.396234 L125.766905,94.3010679 C128.473612,91.5943612 128.472063,87.2264889 125.777085,84.5315115 L63.9280381,22.6824644 C61.2305472,19.9849735 55.9517395,17.801995 52.1318769,17.8010313 L25.0560441,17.7942007 C21.2311475,17.7932358 18.1421354,20.8872832 18.1452985,24.7049463 L18.1535504,34.6641936 C18.2481119,34.6754562 18.3439134,34.6864294 18.4409623,34.6971263 C22.1702157,35.1081705 26.9295004,34.6530132 31.806204,33.5444844 C32.1342781,33.0700515 32.5094815,32.6184036 32.9318197,32.1960654 C35.6385117,29.4893734 39.5490441,28.718649 42.94592,29.8824694 C43.0432142,29.8394357 43.1402334,29.7961748 43.2369683,29.7526887 L43.3646982,30.0368244 C44.566601,30.5115916 45.6933052,31.2351533 46.6655958,32.2074439 C50.4612154,36.0030635 50.4663097,42.1518845 46.6769742,45.94122 C43.0594074,49.5587868 37.2914155,49.7181264 33.4734256,46.422636 C28.1082519,47.5454734 22.7987486,48.0186448 18.1643182,47.6600756 Z\"></path>\n        <path d=\"M47.6333528,39.5324628 L47.6562932,39.5834939 C37.9670934,43.9391617 26.0718874,46.3819521 17.260095,45.4107025 C5.27267473,44.0894301 -1.02778744,36.4307276 2.44271359,24.0779512 C5.56175386,12.9761516 14.3014034,4.36129832 24.0466405,1.54817001 C34.7269254,-1.53487574 43.7955833,3.51606438 43.7955834,14.7730751 L35.1728168,14.7730752 C35.1728167,9.91428944 32.0946059,8.19982862 26.4381034,9.83267419 C19.5270911,11.8276553 13.046247,18.2159574 10.7440788,26.4102121 C8.82861123,33.2280582 11.161186,36.0634845 18.2047888,36.8398415 C25.3302805,37.6252244 35.7353482,35.4884477 44.1208333,31.7188498 L44.1475077,31.7781871 C44.159701,31.7725635 44.1718402,31.7671479 44.1839238,31.7619434 C45.9448098,31.0035157 50.4503245,38.3109156 47.7081571,39.5012767 C47.6834429,39.512005 47.6585061,39.5223987 47.6333528,39.5324628 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/theme-button": {
            "title": "$:/core/images/theme-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-theme-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M55.854113,66.9453198 C54.3299482,65.1432292 53.0133883,63.518995 51.9542746,62.1263761 C40.8899947,47.578055 35.3091807,55.2383404 28.9941893,62.1263758 C22.6791979,69.0144112 30.6577916,74.5954741 24.6646171,79.4611023 C18.6714426,84.3267304 19.0414417,86.0133155 8.92654943,77.1119468 C-1.18834284,68.2105781 -1.88793412,65.7597832 2.7553553,60.6807286 C7.39864472,55.601674 11.2794845,63.5989423 20.7646627,54.5728325 C30.2498409,45.5467226 22.2819131,37.5470737 22.2819131,37.5470737 C22.2819131,37.5470737 42.0310399,-2.82433362 68.4206088,0.157393922 C94.8101776,3.13912147 58.4373806,-3.70356506 49.3898693,27.958066 C45.5161782,41.5139906 50.1107906,38.3197672 57.4560458,44.0453955 C59.1625767,45.3756367 63.8839488,48.777453 70.127165,53.3625321 C63.9980513,59.2416709 58.9704753,64.0315459 55.854113,66.9453198 Z M67.4952439,79.8919946 C83.5082212,96.9282402 105.237121,117.617674 112.611591,120.312493 C123.044132,124.12481 128.000001,117.170903 128,105.522947 C127.999999,98.3705516 104.170675,78.980486 84.0760493,63.7529565 C76.6683337,70.9090328 70.7000957,76.7055226 67.4952439,79.8919946 Z\"></path>\n        <path d=\"M58.2852966,138.232794 L58.2852966,88.3943645 C56.318874,88.3923153 54.7254089,86.7952906 54.7254089,84.8344788 C54.7254089,82.8684071 56.3175932,81.2745911 58.2890859,81.2745911 L79.6408336,81.2745911 C81.608998,81.2745911 83.2045105,82.8724076 83.2045105,84.8344788 C83.2045105,86.7992907 81.614366,88.3923238 79.6446228,88.3943645 L79.6446228,88.3943646 L79.6446228,138.232794 C79.6446228,144.131009 74.8631748,148.912457 68.9649597,148.912457 C63.0667446,148.912457 58.2852966,144.131009 58.2852966,138.232794 Z M65.405072,-14.8423767 L72.5248474,-14.8423767 L76.0847351,-0.690681892 L72.5248474,6.51694947 L72.5248474,81.2745911 L65.405072,81.2745911 L65.405072,6.51694947 L61.8451843,-0.690681892 L65.405072,-14.8423767 Z\" transform=\"translate(68.964960, 67.035040) rotate(45.000000) translate(-68.964960, -67.035040) \"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/timestamp-off": {
            "title": "$:/core/images/timestamp-off",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-timestamp-off tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M58.25 11C26.08 11 0 37.082 0 69.25s26.08 58.25 58.25 58.25c32.175 0 58.25-26.082 58.25-58.25S90.425 11 58.25 11zm0 100.5C34.914 111.5 16 92.586 16 69.25 16 45.92 34.914 27 58.25 27s42.25 18.92 42.25 42.25c0 23.336-18.914 42.25-42.25 42.25zM49.704 10c-2.762 0-5-2.24-5-5-.004-2.756 2.238-5 5-5H66.69c2.762 0 5.002 2.24 5 5 .006 2.757-2.238 5-5 5H49.705z\"/><path d=\"M58.25 35.88c-18.777 0-33.998 15.224-33.998 33.998 0 18.773 15.22 34.002 33.998 34.002 18.784 0 34.002-15.23 34.002-34.002 0-18.774-15.218-33.998-34.002-33.998zm-3.03 50.123H44.196v-34H55.22v34zm16.976 0H61.17v-34h11.025v34z\"/>\n    </g>\n</svg>\n"
        },
        "$:/core/images/timestamp-on": {
            "title": "$:/core/images/timestamp-on",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-timestamp-on tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M58.25 11C26.08 11 0 37.082 0 69.25s26.08 58.25 58.25 58.25c32.175 0 58.25-26.082 58.25-58.25S90.425 11 58.25 11zm0 100.5C34.914 111.5 16 92.586 16 69.25 16 45.92 34.914 27 58.25 27s42.25 18.92 42.25 42.25c0 23.336-18.914 42.25-42.25 42.25zM49.704 10c-2.762 0-5-2.24-5-5-.004-2.756 2.238-5 5-5H66.69c2.762 0 5.002 2.24 5 5 .006 2.757-2.238 5-5 5H49.705z\"/><path d=\"M13.41 27.178c-2.116 1.775-5.27 1.498-7.045-.613-1.772-2.11-1.498-5.27.616-7.047l9.95-8.348c2.115-1.774 5.27-1.5 7.045.618 1.775 2.108 1.498 5.27-.616 7.043l-9.95 8.348zM102.983 27.178c2.116 1.775 5.27 1.498 7.045-.613 1.772-2.11 1.498-5.27-.616-7.047l-9.95-8.348c-2.114-1.774-5.27-1.5-7.044.618-1.775 2.108-1.498 5.27.616 7.043l9.95 8.348zM65.097 71.072c0 3.826-3.09 6.928-6.897 6.928-3.804.006-6.9-3.102-6.903-6.928 0 0 4.76-39.072 6.903-39.072s6.897 39.072 6.897 39.072z\"/>\n    </g>\n</svg>\n"
        },
        "$:/core/images/tip": {
            "title": "$:/core/images/tip",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-tip tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M64,128.241818 C99.346224,128.241818 128,99.5880417 128,64.2418177 C128,28.8955937 99.346224,0.241817675 64,0.241817675 C28.653776,0.241817675 0,28.8955937 0,64.2418177 C0,99.5880417 28.653776,128.241818 64,128.241818 Z M75.9358659,91.4531941 C75.3115438,95.581915 70.2059206,98.8016748 64,98.8016748 C57.7940794,98.8016748 52.6884562,95.581915 52.0641341,91.4531941 C54.3299053,94.0502127 58.8248941,95.8192805 64,95.8192805 C69.1751059,95.8192805 73.6700947,94.0502127 75.9358659,91.4531941 L75.9358659,91.4531941 Z M75.9358659,95.9453413 C75.3115438,100.074062 70.2059206,103.293822 64,103.293822 C57.7940794,103.293822 52.6884562,100.074062 52.0641341,95.9453413 C54.3299053,98.5423599 58.8248941,100.311428 64,100.311428 C69.1751059,100.311428 73.6700947,98.5423599 75.9358659,95.9453413 L75.9358659,95.9453413 Z M75.9358659,100.40119 C75.3115438,104.529911 70.2059206,107.74967 64,107.74967 C57.7940794,107.74967 52.6884562,104.529911 52.0641341,100.40119 C54.3299053,102.998208 58.8248941,104.767276 64,104.767276 C69.1751059,104.767276 73.6700947,102.998208 75.9358659,100.40119 L75.9358659,100.40119 Z M75.9358659,104.893337 C75.3115438,109.022058 70.2059206,112.241818 64,112.241818 C57.7940794,112.241818 52.6884562,109.022058 52.0641341,104.893337 C54.3299053,107.490356 58.8248941,109.259423 64,109.259423 C69.1751059,109.259423 73.6700947,107.490356 75.9358659,104.893337 L75.9358659,104.893337 Z M64.3010456,24.2418177 C75.9193117,24.2418188 88.0000013,32.0619847 88,48.4419659 C87.9999987,64.8219472 75.9193018,71.7540963 75.9193021,83.5755932 C75.9193022,89.4486648 70.0521957,92.8368862 63.9999994,92.8368862 C57.947803,92.8368862 51.9731007,89.8295115 51.9731007,83.5755932 C51.9731007,71.1469799 39.9999998,65.4700602 40,48.4419647 C40.0000002,31.4138691 52.6827796,24.2418166 64.3010456,24.2418177 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/twitter": {
            "title": "$:/core/images/twitter",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-twitter tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M41.6263422,115.803477 C27.0279663,115.803477 13.4398394,111.540813 1.99987456,104.234833 C4.02221627,104.472643 6.08004574,104.594302 8.16644978,104.594302 C20.277456,104.594302 31.4238403,100.47763 40.270894,93.5715185 C28.9590538,93.3635501 19.4123842,85.9189246 16.1230832,75.6885328 C17.7011365,75.9892376 19.320669,76.1503787 20.9862896,76.1503787 C23.344152,76.1503787 25.6278127,75.8359011 27.7971751,75.247346 C15.9709927,72.8821073 7.06079851,62.4745062 7.06079851,49.9982394 C7.06079851,49.8898938 7.06079851,49.7820074 7.06264203,49.67458 C10.5482779,51.6032228 14.5339687,52.7615103 18.7717609,52.8951059 C11.8355159,48.277565 7.2714207,40.3958845 7.2714207,31.4624258 C7.2714207,26.7434257 8.54621495,22.3200804 10.7713439,18.5169676 C23.5211299,34.0957738 42.568842,44.3472839 64.0532269,45.4210985 C63.6126256,43.5365285 63.3835682,41.5711584 63.3835682,39.5529928 C63.3835682,25.3326379 74.95811,13.8034766 89.2347917,13.8034766 C96.6697089,13.8034766 103.387958,16.930807 108.103682,21.9353619 C113.991886,20.780288 119.52429,18.6372496 124.518847,15.6866694 C122.588682,21.6993889 118.490075,26.7457211 113.152623,29.9327334 C118.381769,29.3102055 123.363882,27.926045 127.999875,25.8780385 C124.534056,31.0418981 120.151087,35.5772616 115.100763,39.2077561 C115.150538,40.3118708 115.175426,41.4224128 115.175426,42.538923 C115.175426,76.5663154 89.1744164,115.803477 41.6263422,115.803477\"></path>\n    </g>\n</svg>\n"
        },
        "$:/core/images/underline": {
            "title": "$:/core/images/underline",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-underline tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M7,117.421488 L121.247934,117.421488 L121.247934,128 L7,128 L7,117.421488 Z M104.871212,98.8958333 L104.871212,0 L88.6117424,0 L88.6117424,55.8560606 C88.6117424,60.3194668 88.0060035,64.432115 86.7945076,68.1941288 C85.5830116,71.9561425 83.7657949,75.239885 81.342803,78.0454545 C78.9198111,80.8510241 75.8911167,83.0189317 72.2566288,84.5492424 C68.6221409,86.0795531 64.3182067,86.844697 59.344697,86.844697 C53.0959284,86.844697 48.1862552,85.0593613 44.6155303,81.4886364 C41.0448054,77.9179114 39.2594697,73.0720003 39.2594697,66.9507576 L39.2594697,0 L23,0 L23,65.0378788 C23,70.3939662 23.5419769,75.2717583 24.625947,79.6714015 C25.709917,84.0710447 27.5908957,87.864883 30.2689394,91.0530303 C32.9469831,94.2411776 36.4538925,96.6960141 40.7897727,98.4176136 C45.125653,100.139213 50.545422,101 57.0492424,101 C64.3182182,101 70.630655,99.5653553 75.9867424,96.6960227 C81.3428298,93.8266902 85.742407,89.33147 89.1856061,83.2102273 L89.5681818,83.2102273 L89.5681818,98.8958333 L104.871212,98.8958333 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/unfold-all-button": {
            "title": "$:/core/images/unfold-all-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-unfold-all tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <rect x=\"0\" y=\"0\" width=\"128\" height=\"16\" rx=\"8\"></rect>\n        <rect x=\"0\" y=\"64\" width=\"128\" height=\"16\" rx=\"8\"></rect>\n        <path d=\"M85.598226,8.34884273 C84.1490432,6.89863875 82.1463102,6 79.9340286,6 L47.9482224,6 C43.5292967,6 39.9411255,9.581722 39.9411255,14 C39.9411255,18.4092877 43.5260249,22 47.9482224,22 L71.9411255,22 L71.9411255,45.9929031 C71.9411255,50.4118288 75.5228475,54 79.9411255,54 C84.3504132,54 87.9411255,50.4151006 87.9411255,45.9929031 L87.9411255,14.0070969 C87.9411255,11.7964515 87.0447363,9.79371715 85.5956548,8.34412458 Z\" transform=\"translate(63.941125, 30.000000) scale(1, -1) rotate(-45.000000) translate(-63.941125, -30.000000) \"></path>\n        <path d=\"M85.6571005,72.2899682 C84.2079177,70.8397642 82.2051847,69.9411255 79.9929031,69.9411255 L48.0070969,69.9411255 C43.5881712,69.9411255 40,73.5228475 40,77.9411255 C40,82.3504132 43.5848994,85.9411255 48.0070969,85.9411255 L72,85.9411255 L72,109.934029 C72,114.352954 75.581722,117.941125 80,117.941125 C84.4092877,117.941125 88,114.356226 88,109.934029 L88,77.9482224 C88,75.737577 87.1036108,73.7348426 85.6545293,72.2852501 Z\" transform=\"translate(64.000000, 93.941125) scale(1, -1) rotate(-45.000000) translate(-64.000000, -93.941125) \"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/unfold-button": {
            "title": "$:/core/images/unfold-button",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-unfold tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <rect x=\"0\" y=\"0\" width=\"128\" height=\"16\" rx=\"8\"></rect>\n        <path d=\"M85.598226,11.3488427 C84.1490432,9.89863875 82.1463102,9 79.9340286,9 L47.9482224,9 C43.5292967,9 39.9411255,12.581722 39.9411255,17 C39.9411255,21.4092877 43.5260249,25 47.9482224,25 L71.9411255,25 L71.9411255,48.9929031 C71.9411255,53.4118288 75.5228475,57 79.9411255,57 C84.3504132,57 87.9411255,53.4151006 87.9411255,48.9929031 L87.9411255,17.0070969 C87.9411255,14.7964515 87.0447363,12.7937171 85.5956548,11.3441246 Z\" transform=\"translate(63.941125, 33.000000) scale(1, -1) rotate(-45.000000) translate(-63.941125, -33.000000) \"></path>\n        <path d=\"M85.6571005,53.4077172 C84.2079177,51.9575133 82.2051847,51.0588745 79.9929031,51.0588745 L48.0070969,51.0588745 C43.5881712,51.0588745 40,54.6405965 40,59.0588745 C40,63.4681622 43.5848994,67.0588745 48.0070969,67.0588745 L72,67.0588745 L72,91.0517776 C72,95.4707033 75.581722,99.0588745 80,99.0588745 C84.4092877,99.0588745 88,95.4739751 88,91.0517776 L88,59.0659714 C88,56.855326 87.1036108,54.8525917 85.6545293,53.4029991 Z\" transform=\"translate(64.000000, 75.058875) scale(1, -1) rotate(-45.000000) translate(-64.000000, -75.058875) \"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/unlocked-padlock": {
            "title": "$:/core/images/unlocked-padlock",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-unlocked-padlock tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M48.6266053,64 L105,64 L105,96.0097716 C105,113.673909 90.6736461,128 73.001193,128 L55.998807,128 C38.3179793,128 24,113.677487 24,96.0097716 L24,64 L30.136303,64 C19.6806213,51.3490406 2.77158986,28.2115132 25.8366966,8.85759246 C50.4723026,-11.8141335 71.6711028,13.2108337 81.613302,25.0594855 C91.5555012,36.9081373 78.9368488,47.4964439 69.1559674,34.9513593 C59.375086,22.4062748 47.9893192,10.8049522 35.9485154,20.9083862 C23.9077117,31.0118202 34.192312,43.2685325 44.7624679,55.8655518 C47.229397,58.805523 48.403443,61.5979188 48.6266053,64 Z M67.7315279,92.3641717 C70.8232551,91.0923621 73,88.0503841 73,84.5 C73,79.8055796 69.1944204,76 64.5,76 C59.8055796,76 56,79.8055796 56,84.5 C56,87.947435 58.0523387,90.9155206 61.0018621,92.2491029 L55.9067479,115.020857 L72.8008958,115.020857 L67.7315279,92.3641717 L67.7315279,92.3641717 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/up-arrow": {
            "created": "20150316000544368",
            "modified": "20150316000831867",
            "tags": "$:/tags/Image",
            "title": "$:/core/images/up-arrow",
            "text": "<svg class=\"tc-image-up-arrow tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n<path transform=\"rotate(-135, 63.8945, 64.1752)\" d=\"m109.07576,109.35336c-1.43248,1.43361 -3.41136,2.32182 -5.59717,2.32182l-79.16816,0c-4.36519,0 -7.91592,-3.5444 -7.91592,-7.91666c0,-4.36337 3.54408,-7.91667 7.91592,-7.91667l71.25075,0l0,-71.25074c0,-4.3652 3.54442,-7.91592 7.91667,-7.91592c4.36336,0 7.91667,3.54408 7.91667,7.91592l0,79.16815c0,2.1825 -0.88602,4.16136 -2.3185,5.59467l-0.00027,-0.00056l0.00001,-0.00001z\" />\n</svg>\n \n"
        },
        "$:/core/images/video": {
            "title": "$:/core/images/video",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-video tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M64,12 C29.0909091,12 8.72727273,14.9166667 5.81818182,17.8333333 C2.90909091,20.75 1.93784382e-15,41.1666667 0,64.5 C1.93784382e-15,87.8333333 2.90909091,108.25 5.81818182,111.166667 C8.72727273,114.083333 29.0909091,117 64,117 C98.9090909,117 119.272727,114.083333 122.181818,111.166667 C125.090909,108.25 128,87.8333333 128,64.5 C128,41.1666667 125.090909,20.75 122.181818,17.8333333 C119.272727,14.9166667 98.9090909,12 64,12 Z M54.9161194,44.6182253 C51.102648,42.0759111 48.0112186,43.7391738 48.0112186,48.3159447 L48.0112186,79.6840553 C48.0112186,84.2685636 51.109784,85.9193316 54.9161194,83.3817747 L77.0838806,68.6032672 C80.897352,66.0609529 80.890216,61.9342897 77.0838806,59.3967328 L54.9161194,44.6182253 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/core/images/warning": {
            "title": "$:/core/images/warning",
            "tags": "$:/tags/Image",
            "text": "<svg class=\"tc-image-warning tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\">\n        <path d=\"M57.0717968,11 C60.1509982,5.66666667 67.8490018,5.66666667 70.9282032,11 L126.353829,107 C129.433031,112.333333 125.584029,119 119.425626,119 L8.57437416,119 C2.41597129,119 -1.43303051,112.333333 1.64617093,107 L57.0717968,11 Z M64,37 C59.581722,37 56,40.5820489 56,44.9935776 L56,73.0064224 C56,77.4211534 59.5907123,81 64,81 C68.418278,81 72,77.4179511 72,73.0064224 L72,44.9935776 C72,40.5788466 68.4092877,37 64,37 Z M64,104 C68.418278,104 72,100.418278 72,96 C72,91.581722 68.418278,88 64,88 C59.581722,88 56,91.581722 56,96 C56,100.418278 59.581722,104 64,104 Z\"></path>\n    </g>\n</svg>"
        },
        "$:/language/Buttons/AdvancedSearch/Caption": {
            "title": "$:/language/Buttons/AdvancedSearch/Caption",
            "text": "advanced search"
        },
        "$:/language/Buttons/AdvancedSearch/Hint": {
            "title": "$:/language/Buttons/AdvancedSearch/Hint",
            "text": "Advanced search"
        },
        "$:/language/Buttons/Cancel/Caption": {
            "title": "$:/language/Buttons/Cancel/Caption",
            "text": "cancel"
        },
        "$:/language/Buttons/Cancel/Hint": {
            "title": "$:/language/Buttons/Cancel/Hint",
            "text": "Discard changes to this tiddler"
        },
        "$:/language/Buttons/Clone/Caption": {
            "title": "$:/language/Buttons/Clone/Caption",
            "text": "clone"
        },
        "$:/language/Buttons/Clone/Hint": {
            "title": "$:/language/Buttons/Clone/Hint",
            "text": "Clone this tiddler"
        },
        "$:/language/Buttons/Close/Caption": {
            "title": "$:/language/Buttons/Close/Caption",
            "text": "close"
        },
        "$:/language/Buttons/Close/Hint": {
            "title": "$:/language/Buttons/Close/Hint",
            "text": "Close this tiddler"
        },
        "$:/language/Buttons/CloseAll/Caption": {
            "title": "$:/language/Buttons/CloseAll/Caption",
            "text": "close all"
        },
        "$:/language/Buttons/CloseAll/Hint": {
            "title": "$:/language/Buttons/CloseAll/Hint",
            "text": "Close all tiddlers"
        },
        "$:/language/Buttons/CloseOthers/Caption": {
            "title": "$:/language/Buttons/CloseOthers/Caption",
            "text": "close others"
        },
        "$:/language/Buttons/CloseOthers/Hint": {
            "title": "$:/language/Buttons/CloseOthers/Hint",
            "text": "Close other tiddlers"
        },
        "$:/language/Buttons/ControlPanel/Caption": {
            "title": "$:/language/Buttons/ControlPanel/Caption",
            "text": "control panel"
        },
        "$:/language/Buttons/ControlPanel/Hint": {
            "title": "$:/language/Buttons/ControlPanel/Hint",
            "text": "Open control panel"
        },
        "$:/language/Buttons/Delete/Caption": {
            "title": "$:/language/Buttons/Delete/Caption",
            "text": "delete"
        },
        "$:/language/Buttons/Delete/Hint": {
            "title": "$:/language/Buttons/Delete/Hint",
            "text": "Delete this tiddler"
        },
        "$:/language/Buttons/Edit/Caption": {
            "title": "$:/language/Buttons/Edit/Caption",
            "text": "edit"
        },
        "$:/language/Buttons/Edit/Hint": {
            "title": "$:/language/Buttons/Edit/Hint",
            "text": "Edit this tiddler"
        },
        "$:/language/Buttons/Encryption/Caption": {
            "title": "$:/language/Buttons/Encryption/Caption",
            "text": "encryption"
        },
        "$:/language/Buttons/Encryption/Hint": {
            "title": "$:/language/Buttons/Encryption/Hint",
            "text": "Set or clear a password for saving this wiki"
        },
        "$:/language/Buttons/Encryption/ClearPassword/Caption": {
            "title": "$:/language/Buttons/Encryption/ClearPassword/Caption",
            "text": "clear password"
        },
        "$:/language/Buttons/Encryption/ClearPassword/Hint": {
            "title": "$:/language/Buttons/Encryption/ClearPassword/Hint",
            "text": "Clear the password and save this wiki without encryption"
        },
        "$:/language/Buttons/Encryption/SetPassword/Caption": {
            "title": "$:/language/Buttons/Encryption/SetPassword/Caption",
            "text": "set password"
        },
        "$:/language/Buttons/Encryption/SetPassword/Hint": {
            "title": "$:/language/Buttons/Encryption/SetPassword/Hint",
            "text": "Set a password for saving this wiki with encryption"
        },
        "$:/language/Buttons/ExportPage/Caption": {
            "title": "$:/language/Buttons/ExportPage/Caption",
            "text": "export all"
        },
        "$:/language/Buttons/ExportPage/Hint": {
            "title": "$:/language/Buttons/ExportPage/Hint",
            "text": "Export all tiddlers"
        },
        "$:/language/Buttons/ExportTiddler/Caption": {
            "title": "$:/language/Buttons/ExportTiddler/Caption",
            "text": "export tiddler"
        },
        "$:/language/Buttons/ExportTiddler/Hint": {
            "title": "$:/language/Buttons/ExportTiddler/Hint",
            "text": "Export tiddler"
        },
        "$:/language/Buttons/ExportTiddlers/Caption": {
            "title": "$:/language/Buttons/ExportTiddlers/Caption",
            "text": "export tiddlers"
        },
        "$:/language/Buttons/ExportTiddlers/Hint": {
            "title": "$:/language/Buttons/ExportTiddlers/Hint",
            "text": "Export tiddlers"
        },
        "$:/language/Buttons/Fold/Caption": {
            "title": "$:/language/Buttons/Fold/Caption",
            "text": "fold tiddler"
        },
        "$:/language/Buttons/Fold/Hint": {
            "title": "$:/language/Buttons/Fold/Hint",
            "text": "Fold the body of this tiddler"
        },
        "$:/language/Buttons/Fold/FoldBar/Caption": {
            "title": "$:/language/Buttons/Fold/FoldBar/Caption",
            "text": "fold-bar"
        },
        "$:/language/Buttons/Fold/FoldBar/Hint": {
            "title": "$:/language/Buttons/Fold/FoldBar/Hint",
            "text": "Optional bars to fold and unfold tiddlers"
        },
        "$:/language/Buttons/Unfold/Caption": {
            "title": "$:/language/Buttons/Unfold/Caption",
            "text": "unfold tiddler"
        },
        "$:/language/Buttons/Unfold/Hint": {
            "title": "$:/language/Buttons/Unfold/Hint",
            "text": "Unfold the body of this tiddler"
        },
        "$:/language/Buttons/FoldOthers/Caption": {
            "title": "$:/language/Buttons/FoldOthers/Caption",
            "text": "fold other tiddlers"
        },
        "$:/language/Buttons/FoldOthers/Hint": {
            "title": "$:/language/Buttons/FoldOthers/Hint",
            "text": "Fold the bodies of other opened tiddlers"
        },
        "$:/language/Buttons/FoldAll/Caption": {
            "title": "$:/language/Buttons/FoldAll/Caption",
            "text": "fold all tiddlers"
        },
        "$:/language/Buttons/FoldAll/Hint": {
            "title": "$:/language/Buttons/FoldAll/Hint",
            "text": "Fold the bodies of all opened tiddlers"
        },
        "$:/language/Buttons/UnfoldAll/Caption": {
            "title": "$:/language/Buttons/UnfoldAll/Caption",
            "text": "unfold all tiddlers"
        },
        "$:/language/Buttons/UnfoldAll/Hint": {
            "title": "$:/language/Buttons/UnfoldAll/Hint",
            "text": "Unfold the bodies of all opened tiddlers"
        },
        "$:/language/Buttons/FullScreen/Caption": {
            "title": "$:/language/Buttons/FullScreen/Caption",
            "text": "full-screen"
        },
        "$:/language/Buttons/FullScreen/Hint": {
            "title": "$:/language/Buttons/FullScreen/Hint",
            "text": "Enter or leave full-screen mode"
        },
        "$:/language/Buttons/Help/Caption": {
            "title": "$:/language/Buttons/Help/Caption",
            "text": "help"
        },
        "$:/language/Buttons/Help/Hint": {
            "title": "$:/language/Buttons/Help/Hint",
            "text": "Show help panel"
        },
        "$:/language/Buttons/Import/Caption": {
            "title": "$:/language/Buttons/Import/Caption",
            "text": "import"
        },
        "$:/language/Buttons/Import/Hint": {
            "title": "$:/language/Buttons/Import/Hint",
            "text": "Import many types of file including text, image, TiddlyWiki or JSON"
        },
        "$:/language/Buttons/Info/Caption": {
            "title": "$:/language/Buttons/Info/Caption",
            "text": "info"
        },
        "$:/language/Buttons/Info/Hint": {
            "title": "$:/language/Buttons/Info/Hint",
            "text": "Show information for this tiddler"
        },
        "$:/language/Buttons/Home/Caption": {
            "title": "$:/language/Buttons/Home/Caption",
            "text": "home"
        },
        "$:/language/Buttons/Home/Hint": {
            "title": "$:/language/Buttons/Home/Hint",
            "text": "Open the default tiddlers"
        },
        "$:/language/Buttons/Language/Caption": {
            "title": "$:/language/Buttons/Language/Caption",
            "text": "language"
        },
        "$:/language/Buttons/Language/Hint": {
            "title": "$:/language/Buttons/Language/Hint",
            "text": "Choose the user interface language"
        },
        "$:/language/Buttons/Manager/Caption": {
            "title": "$:/language/Buttons/Manager/Caption",
            "text": "tiddler manager"
        },
        "$:/language/Buttons/Manager/Hint": {
            "title": "$:/language/Buttons/Manager/Hint",
            "text": "Open tiddler manager"
        },
        "$:/language/Buttons/More/Caption": {
            "title": "$:/language/Buttons/More/Caption",
            "text": "more"
        },
        "$:/language/Buttons/More/Hint": {
            "title": "$:/language/Buttons/More/Hint",
            "text": "More actions"
        },
        "$:/language/Buttons/NewHere/Caption": {
            "title": "$:/language/Buttons/NewHere/Caption",
            "text": "new here"
        },
        "$:/language/Buttons/NewHere/Hint": {
            "title": "$:/language/Buttons/NewHere/Hint",
            "text": "Create a new tiddler tagged with this one"
        },
        "$:/language/Buttons/NewJournal/Caption": {
            "title": "$:/language/Buttons/NewJournal/Caption",
            "text": "new journal"
        },
        "$:/language/Buttons/NewJournal/Hint": {
            "title": "$:/language/Buttons/NewJournal/Hint",
            "text": "Create a new journal tiddler"
        },
        "$:/language/Buttons/NewJournalHere/Caption": {
            "title": "$:/language/Buttons/NewJournalHere/Caption",
            "text": "new journal here"
        },
        "$:/language/Buttons/NewJournalHere/Hint": {
            "title": "$:/language/Buttons/NewJournalHere/Hint",
            "text": "Create a new journal tiddler tagged with this one"
        },
        "$:/language/Buttons/NewImage/Caption": {
            "title": "$:/language/Buttons/NewImage/Caption",
            "text": "new image"
        },
        "$:/language/Buttons/NewImage/Hint": {
            "title": "$:/language/Buttons/NewImage/Hint",
            "text": "Create a new image tiddler"
        },
        "$:/language/Buttons/NewMarkdown/Caption": {
            "title": "$:/language/Buttons/NewMarkdown/Caption",
            "text": "new Markdown tiddler"
        },
        "$:/language/Buttons/NewMarkdown/Hint": {
            "title": "$:/language/Buttons/NewMarkdown/Hint",
            "text": "Create a new Markdown tiddler"
        },
        "$:/language/Buttons/NewTiddler/Caption": {
            "title": "$:/language/Buttons/NewTiddler/Caption",
            "text": "new tiddler"
        },
        "$:/language/Buttons/NewTiddler/Hint": {
            "title": "$:/language/Buttons/NewTiddler/Hint",
            "text": "Create a new tiddler"
        },
        "$:/language/Buttons/OpenWindow/Caption": {
            "title": "$:/language/Buttons/OpenWindow/Caption",
            "text": "open in new window"
        },
        "$:/language/Buttons/OpenWindow/Hint": {
            "title": "$:/language/Buttons/OpenWindow/Hint",
            "text": "Open tiddler in new window"
        },
        "$:/language/Buttons/Palette/Caption": {
            "title": "$:/language/Buttons/Palette/Caption",
            "text": "palette"
        },
        "$:/language/Buttons/Palette/Hint": {
            "title": "$:/language/Buttons/Palette/Hint",
            "text": "Choose the colour palette"
        },
        "$:/language/Buttons/Permalink/Caption": {
            "title": "$:/language/Buttons/Permalink/Caption",
            "text": "permalink"
        },
        "$:/language/Buttons/Permalink/Hint": {
            "title": "$:/language/Buttons/Permalink/Hint",
            "text": "Set browser address bar to a direct link to this tiddler"
        },
        "$:/language/Buttons/Permaview/Caption": {
            "title": "$:/language/Buttons/Permaview/Caption",
            "text": "permaview"
        },
        "$:/language/Buttons/Permaview/Hint": {
            "title": "$:/language/Buttons/Permaview/Hint",
            "text": "Set browser address bar to a direct link to all the tiddlers in this story"
        },
        "$:/language/Buttons/Print/Caption": {
            "title": "$:/language/Buttons/Print/Caption",
            "text": "print page"
        },
        "$:/language/Buttons/Print/Hint": {
            "title": "$:/language/Buttons/Print/Hint",
            "text": "Print the current page"
        },
        "$:/language/Buttons/Refresh/Caption": {
            "title": "$:/language/Buttons/Refresh/Caption",
            "text": "refresh"
        },
        "$:/language/Buttons/Refresh/Hint": {
            "title": "$:/language/Buttons/Refresh/Hint",
            "text": "Perform a full refresh of the wiki"
        },
        "$:/language/Buttons/Save/Caption": {
            "title": "$:/language/Buttons/Save/Caption",
            "text": "ok"
        },
        "$:/language/Buttons/Save/Hint": {
            "title": "$:/language/Buttons/Save/Hint",
            "text": "Confirm changes to this tiddler"
        },
        "$:/language/Buttons/SaveWiki/Caption": {
            "title": "$:/language/Buttons/SaveWiki/Caption",
            "text": "save changes"
        },
        "$:/language/Buttons/SaveWiki/Hint": {
            "title": "$:/language/Buttons/SaveWiki/Hint",
            "text": "Save changes"
        },
        "$:/language/Buttons/StoryView/Caption": {
            "title": "$:/language/Buttons/StoryView/Caption",
            "text": "storyview"
        },
        "$:/language/Buttons/StoryView/Hint": {
            "title": "$:/language/Buttons/StoryView/Hint",
            "text": "Choose the story visualisation"
        },
        "$:/language/Buttons/HideSideBar/Caption": {
            "title": "$:/language/Buttons/HideSideBar/Caption",
            "text": "hide sidebar"
        },
        "$:/language/Buttons/HideSideBar/Hint": {
            "title": "$:/language/Buttons/HideSideBar/Hint",
            "text": "Hide sidebar"
        },
        "$:/language/Buttons/ShowSideBar/Caption": {
            "title": "$:/language/Buttons/ShowSideBar/Caption",
            "text": "show sidebar"
        },
        "$:/language/Buttons/ShowSideBar/Hint": {
            "title": "$:/language/Buttons/ShowSideBar/Hint",
            "text": "Show sidebar"
        },
        "$:/language/Buttons/TagManager/Caption": {
            "title": "$:/language/Buttons/TagManager/Caption",
            "text": "tag manager"
        },
        "$:/language/Buttons/TagManager/Hint": {
            "title": "$:/language/Buttons/TagManager/Hint",
            "text": "Open tag manager"
        },
        "$:/language/Buttons/Timestamp/Caption": {
            "title": "$:/language/Buttons/Timestamp/Caption",
            "text": "timestamps"
        },
        "$:/language/Buttons/Timestamp/Hint": {
            "title": "$:/language/Buttons/Timestamp/Hint",
            "text": "Choose whether modifications update timestamps"
        },
        "$:/language/Buttons/Timestamp/On/Caption": {
            "title": "$:/language/Buttons/Timestamp/On/Caption",
            "text": "timestamps are on"
        },
        "$:/language/Buttons/Timestamp/On/Hint": {
            "title": "$:/language/Buttons/Timestamp/On/Hint",
            "text": "Update timestamps when tiddlers are modified"
        },
        "$:/language/Buttons/Timestamp/Off/Caption": {
            "title": "$:/language/Buttons/Timestamp/Off/Caption",
            "text": "timestamps are off"
        },
        "$:/language/Buttons/Timestamp/Off/Hint": {
            "title": "$:/language/Buttons/Timestamp/Off/Hint",
            "text": "Don't update timestamps when tiddlers are modified"
        },
        "$:/language/Buttons/Theme/Caption": {
            "title": "$:/language/Buttons/Theme/Caption",
            "text": "theme"
        },
        "$:/language/Buttons/Theme/Hint": {
            "title": "$:/language/Buttons/Theme/Hint",
            "text": "Choose the display theme"
        },
        "$:/language/Buttons/Bold/Caption": {
            "title": "$:/language/Buttons/Bold/Caption",
            "text": "bold"
        },
        "$:/language/Buttons/Bold/Hint": {
            "title": "$:/language/Buttons/Bold/Hint",
            "text": "Apply bold formatting to selection"
        },
        "$:/language/Buttons/Clear/Caption": {
            "title": "$:/language/Buttons/Clear/Caption",
            "text": "clear"
        },
        "$:/language/Buttons/Clear/Hint": {
            "title": "$:/language/Buttons/Clear/Hint",
            "text": "Clear image to solid colour"
        },
        "$:/language/Buttons/EditorHeight/Caption": {
            "title": "$:/language/Buttons/EditorHeight/Caption",
            "text": "editor height"
        },
        "$:/language/Buttons/EditorHeight/Caption/Auto": {
            "title": "$:/language/Buttons/EditorHeight/Caption/Auto",
            "text": "Automatically adjust height to fit content"
        },
        "$:/language/Buttons/EditorHeight/Caption/Fixed": {
            "title": "$:/language/Buttons/EditorHeight/Caption/Fixed",
            "text": "Fixed height:"
        },
        "$:/language/Buttons/EditorHeight/Hint": {
            "title": "$:/language/Buttons/EditorHeight/Hint",
            "text": "Choose the height of the text editor"
        },
        "$:/language/Buttons/Excise/Caption": {
            "title": "$:/language/Buttons/Excise/Caption",
            "text": "excise"
        },
        "$:/language/Buttons/Excise/Caption/Excise": {
            "title": "$:/language/Buttons/Excise/Caption/Excise",
            "text": "Perform excision"
        },
        "$:/language/Buttons/Excise/Caption/MacroName": {
            "title": "$:/language/Buttons/Excise/Caption/MacroName",
            "text": "Macro name:"
        },
        "$:/language/Buttons/Excise/Caption/NewTitle": {
            "title": "$:/language/Buttons/Excise/Caption/NewTitle",
            "text": "Title of new tiddler:"
        },
        "$:/language/Buttons/Excise/Caption/Replace": {
            "title": "$:/language/Buttons/Excise/Caption/Replace",
            "text": "Replace excised text with:"
        },
        "$:/language/Buttons/Excise/Caption/Replace/Macro": {
            "title": "$:/language/Buttons/Excise/Caption/Replace/Macro",
            "text": "macro"
        },
        "$:/language/Buttons/Excise/Caption/Replace/Link": {
            "title": "$:/language/Buttons/Excise/Caption/Replace/Link",
            "text": "link"
        },
        "$:/language/Buttons/Excise/Caption/Replace/Transclusion": {
            "title": "$:/language/Buttons/Excise/Caption/Replace/Transclusion",
            "text": "transclusion"
        },
        "$:/language/Buttons/Excise/Caption/Tag": {
            "title": "$:/language/Buttons/Excise/Caption/Tag",
            "text": "Tag new tiddler with the title of this tiddler"
        },
        "$:/language/Buttons/Excise/Caption/TiddlerExists": {
            "title": "$:/language/Buttons/Excise/Caption/TiddlerExists",
            "text": "Warning: tiddler already exists"
        },
        "$:/language/Buttons/Excise/Hint": {
            "title": "$:/language/Buttons/Excise/Hint",
            "text": "Excise the selected text into a new tiddler"
        },
        "$:/language/Buttons/Heading1/Caption": {
            "title": "$:/language/Buttons/Heading1/Caption",
            "text": "heading 1"
        },
        "$:/language/Buttons/Heading1/Hint": {
            "title": "$:/language/Buttons/Heading1/Hint",
            "text": "Apply heading level 1 formatting to lines containing selection"
        },
        "$:/language/Buttons/Heading2/Caption": {
            "title": "$:/language/Buttons/Heading2/Caption",
            "text": "heading 2"
        },
        "$:/language/Buttons/Heading2/Hint": {
            "title": "$:/language/Buttons/Heading2/Hint",
            "text": "Apply heading level 2 formatting to lines containing selection"
        },
        "$:/language/Buttons/Heading3/Caption": {
            "title": "$:/language/Buttons/Heading3/Caption",
            "text": "heading 3"
        },
        "$:/language/Buttons/Heading3/Hint": {
            "title": "$:/language/Buttons/Heading3/Hint",
            "text": "Apply heading level 3 formatting to lines containing selection"
        },
        "$:/language/Buttons/Heading4/Caption": {
            "title": "$:/language/Buttons/Heading4/Caption",
            "text": "heading 4"
        },
        "$:/language/Buttons/Heading4/Hint": {
            "title": "$:/language/Buttons/Heading4/Hint",
            "text": "Apply heading level 4 formatting to lines containing selection"
        },
        "$:/language/Buttons/Heading5/Caption": {
            "title": "$:/language/Buttons/Heading5/Caption",
            "text": "heading 5"
        },
        "$:/language/Buttons/Heading5/Hint": {
            "title": "$:/language/Buttons/Heading5/Hint",
            "text": "Apply heading level 5 formatting to lines containing selection"
        },
        "$:/language/Buttons/Heading6/Caption": {
            "title": "$:/language/Buttons/Heading6/Caption",
            "text": "heading 6"
        },
        "$:/language/Buttons/Heading6/Hint": {
            "title": "$:/language/Buttons/Heading6/Hint",
            "text": "Apply heading level 6 formatting to lines containing selection"
        },
        "$:/language/Buttons/Italic/Caption": {
            "title": "$:/language/Buttons/Italic/Caption",
            "text": "italic"
        },
        "$:/language/Buttons/Italic/Hint": {
            "title": "$:/language/Buttons/Italic/Hint",
            "text": "Apply italic formatting to selection"
        },
        "$:/language/Buttons/LineWidth/Caption": {
            "title": "$:/language/Buttons/LineWidth/Caption",
            "text": "line width"
        },
        "$:/language/Buttons/LineWidth/Hint": {
            "title": "$:/language/Buttons/LineWidth/Hint",
            "text": "Set line width for painting"
        },
        "$:/language/Buttons/Link/Caption": {
            "title": "$:/language/Buttons/Link/Caption",
            "text": "link"
        },
        "$:/language/Buttons/Link/Hint": {
            "title": "$:/language/Buttons/Link/Hint",
            "text": "Create wikitext link"
        },
        "$:/language/Buttons/ListBullet/Caption": {
            "title": "$:/language/Buttons/ListBullet/Caption",
            "text": "bulleted list"
        },
        "$:/language/Buttons/ListBullet/Hint": {
            "title": "$:/language/Buttons/ListBullet/Hint",
            "text": "Apply bulleted list formatting to lines containing selection"
        },
        "$:/language/Buttons/ListNumber/Caption": {
            "title": "$:/language/Buttons/ListNumber/Caption",
            "text": "numbered list"
        },
        "$:/language/Buttons/ListNumber/Hint": {
            "title": "$:/language/Buttons/ListNumber/Hint",
            "text": "Apply numbered list formatting to lines containing selection"
        },
        "$:/language/Buttons/MonoBlock/Caption": {
            "title": "$:/language/Buttons/MonoBlock/Caption",
            "text": "monospaced block"
        },
        "$:/language/Buttons/MonoBlock/Hint": {
            "title": "$:/language/Buttons/MonoBlock/Hint",
            "text": "Apply monospaced block formatting to lines containing selection"
        },
        "$:/language/Buttons/MonoLine/Caption": {
            "title": "$:/language/Buttons/MonoLine/Caption",
            "text": "monospaced"
        },
        "$:/language/Buttons/MonoLine/Hint": {
            "title": "$:/language/Buttons/MonoLine/Hint",
            "text": "Apply monospaced character formatting to selection"
        },
        "$:/language/Buttons/Opacity/Caption": {
            "title": "$:/language/Buttons/Opacity/Caption",
            "text": "opacity"
        },
        "$:/language/Buttons/Opacity/Hint": {
            "title": "$:/language/Buttons/Opacity/Hint",
            "text": "Set painting opacity"
        },
        "$:/language/Buttons/Paint/Caption": {
            "title": "$:/language/Buttons/Paint/Caption",
            "text": "paint colour"
        },
        "$:/language/Buttons/Paint/Hint": {
            "title": "$:/language/Buttons/Paint/Hint",
            "text": "Set painting colour"
        },
        "$:/language/Buttons/Picture/Caption": {
            "title": "$:/language/Buttons/Picture/Caption",
            "text": "picture"
        },
        "$:/language/Buttons/Picture/Hint": {
            "title": "$:/language/Buttons/Picture/Hint",
            "text": "Insert picture"
        },
        "$:/language/Buttons/Preview/Caption": {
            "title": "$:/language/Buttons/Preview/Caption",
            "text": "preview"
        },
        "$:/language/Buttons/Preview/Hint": {
            "title": "$:/language/Buttons/Preview/Hint",
            "text": "Show preview pane"
        },
        "$:/language/Buttons/PreviewType/Caption": {
            "title": "$:/language/Buttons/PreviewType/Caption",
            "text": "preview type"
        },
        "$:/language/Buttons/PreviewType/Hint": {
            "title": "$:/language/Buttons/PreviewType/Hint",
            "text": "Choose preview type"
        },
        "$:/language/Buttons/Quote/Caption": {
            "title": "$:/language/Buttons/Quote/Caption",
            "text": "quote"
        },
        "$:/language/Buttons/Quote/Hint": {
            "title": "$:/language/Buttons/Quote/Hint",
            "text": "Apply quoted text formatting to lines containing selection"
        },
        "$:/language/Buttons/Size/Caption": {
            "title": "$:/language/Buttons/Size/Caption",
            "text": "image size"
        },
        "$:/language/Buttons/Size/Caption/Height": {
            "title": "$:/language/Buttons/Size/Caption/Height",
            "text": "Height:"
        },
        "$:/language/Buttons/Size/Caption/Resize": {
            "title": "$:/language/Buttons/Size/Caption/Resize",
            "text": "Resize image"
        },
        "$:/language/Buttons/Size/Caption/Width": {
            "title": "$:/language/Buttons/Size/Caption/Width",
            "text": "Width:"
        },
        "$:/language/Buttons/Size/Hint": {
            "title": "$:/language/Buttons/Size/Hint",
            "text": "Set image size"
        },
        "$:/language/Buttons/Stamp/Caption": {
            "title": "$:/language/Buttons/Stamp/Caption",
            "text": "stamp"
        },
        "$:/language/Buttons/Stamp/Caption/New": {
            "title": "$:/language/Buttons/Stamp/Caption/New",
            "text": "Add your own"
        },
        "$:/language/Buttons/Stamp/Hint": {
            "title": "$:/language/Buttons/Stamp/Hint",
            "text": "Insert a preconfigured snippet of text"
        },
        "$:/language/Buttons/Stamp/New/Title": {
            "title": "$:/language/Buttons/Stamp/New/Title",
            "text": "Name as shown in menu"
        },
        "$:/language/Buttons/Stamp/New/Text": {
            "title": "$:/language/Buttons/Stamp/New/Text",
            "text": "Text of snippet. (Remember to add a descriptive title in the caption field)."
        },
        "$:/language/Buttons/Strikethrough/Caption": {
            "title": "$:/language/Buttons/Strikethrough/Caption",
            "text": "strikethrough"
        },
        "$:/language/Buttons/Strikethrough/Hint": {
            "title": "$:/language/Buttons/Strikethrough/Hint",
            "text": "Apply strikethrough formatting to selection"
        },
        "$:/language/Buttons/Subscript/Caption": {
            "title": "$:/language/Buttons/Subscript/Caption",
            "text": "subscript"
        },
        "$:/language/Buttons/Subscript/Hint": {
            "title": "$:/language/Buttons/Subscript/Hint",
            "text": "Apply subscript formatting to selection"
        },
        "$:/language/Buttons/Superscript/Caption": {
            "title": "$:/language/Buttons/Superscript/Caption",
            "text": "superscript"
        },
        "$:/language/Buttons/Superscript/Hint": {
            "title": "$:/language/Buttons/Superscript/Hint",
            "text": "Apply superscript formatting to selection"
        },
        "$:/language/Buttons/Underline/Caption": {
            "title": "$:/language/Buttons/Underline/Caption",
            "text": "underline"
        },
        "$:/language/Buttons/Underline/Hint": {
            "title": "$:/language/Buttons/Underline/Hint",
            "text": "Apply underline formatting to selection"
        },
        "$:/language/ControlPanel/Advanced/Caption": {
            "title": "$:/language/ControlPanel/Advanced/Caption",
            "text": "Advanced"
        },
        "$:/language/ControlPanel/Advanced/Hint": {
            "title": "$:/language/ControlPanel/Advanced/Hint",
            "text": "Internal information about this TiddlyWiki"
        },
        "$:/language/ControlPanel/Appearance/Caption": {
            "title": "$:/language/ControlPanel/Appearance/Caption",
            "text": "Appearance"
        },
        "$:/language/ControlPanel/Appearance/Hint": {
            "title": "$:/language/ControlPanel/Appearance/Hint",
            "text": "Ways to customise the appearance of your TiddlyWiki."
        },
        "$:/language/ControlPanel/Basics/AnimDuration/Prompt": {
            "title": "$:/language/ControlPanel/Basics/AnimDuration/Prompt",
            "text": "Animation duration:"
        },
        "$:/language/ControlPanel/Basics/Caption": {
            "title": "$:/language/ControlPanel/Basics/Caption",
            "text": "Basics"
        },
        "$:/language/ControlPanel/Basics/DefaultTiddlers/BottomHint": {
            "title": "$:/language/ControlPanel/Basics/DefaultTiddlers/BottomHint",
            "text": "Use &#91;&#91;double square brackets&#93;&#93; for titles with spaces. Or you can choose to <$button set=\"$:/DefaultTiddlers\" setTo=\"[list[$:/StoryList]]\">retain story ordering</$button>"
        },
        "$:/language/ControlPanel/Basics/DefaultTiddlers/Prompt": {
            "title": "$:/language/ControlPanel/Basics/DefaultTiddlers/Prompt",
            "text": "Default tiddlers:"
        },
        "$:/language/ControlPanel/Basics/DefaultTiddlers/TopHint": {
            "title": "$:/language/ControlPanel/Basics/DefaultTiddlers/TopHint",
            "text": "Choose which tiddlers are displayed at startup:"
        },
        "$:/language/ControlPanel/Basics/Language/Prompt": {
            "title": "$:/language/ControlPanel/Basics/Language/Prompt",
            "text": "Hello! Current language:"
        },
        "$:/language/ControlPanel/Basics/NewJournal/Title/Prompt": {
            "title": "$:/language/ControlPanel/Basics/NewJournal/Title/Prompt",
            "text": "Title of new journal tiddlers"
        },
        "$:/language/ControlPanel/Basics/NewJournal/Text/Prompt": {
            "title": "$:/language/ControlPanel/Basics/NewJournal/Text/Prompt",
            "text": "Text for new journal tiddlers"
        },
        "$:/language/ControlPanel/Basics/NewJournal/Tags/Prompt": {
            "title": "$:/language/ControlPanel/Basics/NewJournal/Tags/Prompt",
            "text": "Tags for new journal tiddlers"
        },
        "$:/language/ControlPanel/Basics/OverriddenShadowTiddlers/Prompt": {
            "title": "$:/language/ControlPanel/Basics/OverriddenShadowTiddlers/Prompt",
            "text": "Number of overridden shadow tiddlers:"
        },
        "$:/language/ControlPanel/Basics/ShadowTiddlers/Prompt": {
            "title": "$:/language/ControlPanel/Basics/ShadowTiddlers/Prompt",
            "text": "Number of shadow tiddlers:"
        },
        "$:/language/ControlPanel/Basics/Subtitle/Prompt": {
            "title": "$:/language/ControlPanel/Basics/Subtitle/Prompt",
            "text": "Subtitle:"
        },
        "$:/language/ControlPanel/Basics/SystemTiddlers/Prompt": {
            "title": "$:/language/ControlPanel/Basics/SystemTiddlers/Prompt",
            "text": "Number of system tiddlers:"
        },
        "$:/language/ControlPanel/Basics/Tags/Prompt": {
            "title": "$:/language/ControlPanel/Basics/Tags/Prompt",
            "text": "Number of tags:"
        },
        "$:/language/ControlPanel/Basics/Tiddlers/Prompt": {
            "title": "$:/language/ControlPanel/Basics/Tiddlers/Prompt",
            "text": "Number of tiddlers:"
        },
        "$:/language/ControlPanel/Basics/Title/Prompt": {
            "title": "$:/language/ControlPanel/Basics/Title/Prompt",
            "text": "Title of this ~TiddlyWiki:"
        },
        "$:/language/ControlPanel/Basics/Username/Prompt": {
            "title": "$:/language/ControlPanel/Basics/Username/Prompt",
            "text": "Username for signing edits:"
        },
        "$:/language/ControlPanel/Basics/Version/Prompt": {
            "title": "$:/language/ControlPanel/Basics/Version/Prompt",
            "text": "~TiddlyWiki version:"
        },
        "$:/language/ControlPanel/EditorTypes/Caption": {
            "title": "$:/language/ControlPanel/EditorTypes/Caption",
            "text": "Editor Types"
        },
        "$:/language/ControlPanel/EditorTypes/Editor/Caption": {
            "title": "$:/language/ControlPanel/EditorTypes/Editor/Caption",
            "text": "Editor"
        },
        "$:/language/ControlPanel/EditorTypes/Hint": {
            "title": "$:/language/ControlPanel/EditorTypes/Hint",
            "text": "These tiddlers determine which editor is used to edit specific tiddler types."
        },
        "$:/language/ControlPanel/EditorTypes/Type/Caption": {
            "title": "$:/language/ControlPanel/EditorTypes/Type/Caption",
            "text": "Type"
        },
        "$:/language/ControlPanel/Info/Caption": {
            "title": "$:/language/ControlPanel/Info/Caption",
            "text": "Info"
        },
        "$:/language/ControlPanel/Info/Hint": {
            "title": "$:/language/ControlPanel/Info/Hint",
            "text": "Information about this TiddlyWiki"
        },
        "$:/language/ControlPanel/KeyboardShortcuts/Add/Prompt": {
            "title": "$:/language/ControlPanel/KeyboardShortcuts/Add/Prompt",
            "text": "Type shortcut here"
        },
        "$:/language/ControlPanel/KeyboardShortcuts/Add/Caption": {
            "title": "$:/language/ControlPanel/KeyboardShortcuts/Add/Caption",
            "text": "add shortcut"
        },
        "$:/language/ControlPanel/KeyboardShortcuts/Caption": {
            "title": "$:/language/ControlPanel/KeyboardShortcuts/Caption",
            "text": "Keyboard Shortcuts"
        },
        "$:/language/ControlPanel/KeyboardShortcuts/Hint": {
            "title": "$:/language/ControlPanel/KeyboardShortcuts/Hint",
            "text": "Manage keyboard shortcut assignments"
        },
        "$:/language/ControlPanel/KeyboardShortcuts/NoShortcuts/Caption": {
            "title": "$:/language/ControlPanel/KeyboardShortcuts/NoShortcuts/Caption",
            "text": "No keyboard shortcuts assigned"
        },
        "$:/language/ControlPanel/KeyboardShortcuts/Remove/Hint": {
            "title": "$:/language/ControlPanel/KeyboardShortcuts/Remove/Hint",
            "text": "remove keyboard shortcut"
        },
        "$:/language/ControlPanel/KeyboardShortcuts/Platform/All": {
            "title": "$:/language/ControlPanel/KeyboardShortcuts/Platform/All",
            "text": "All platforms"
        },
        "$:/language/ControlPanel/KeyboardShortcuts/Platform/Mac": {
            "title": "$:/language/ControlPanel/KeyboardShortcuts/Platform/Mac",
            "text": "Macintosh platform only"
        },
        "$:/language/ControlPanel/KeyboardShortcuts/Platform/NonMac": {
            "title": "$:/language/ControlPanel/KeyboardShortcuts/Platform/NonMac",
            "text": "Non-Macintosh platforms only"
        },
        "$:/language/ControlPanel/KeyboardShortcuts/Platform/Linux": {
            "title": "$:/language/ControlPanel/KeyboardShortcuts/Platform/Linux",
            "text": "Linux platform only"
        },
        "$:/language/ControlPanel/KeyboardShortcuts/Platform/NonLinux": {
            "title": "$:/language/ControlPanel/KeyboardShortcuts/Platform/NonLinux",
            "text": "Non-Linux platforms only"
        },
        "$:/language/ControlPanel/KeyboardShortcuts/Platform/Windows": {
            "title": "$:/language/ControlPanel/KeyboardShortcuts/Platform/Windows",
            "text": "Windows platform only"
        },
        "$:/language/ControlPanel/KeyboardShortcuts/Platform/NonWindows": {
            "title": "$:/language/ControlPanel/KeyboardShortcuts/Platform/NonWindows",
            "text": "Non-Windows platforms only"
        },
        "$:/language/ControlPanel/LoadedModules/Caption": {
            "title": "$:/language/ControlPanel/LoadedModules/Caption",
            "text": "Loaded Modules"
        },
        "$:/language/ControlPanel/LoadedModules/Hint": {
            "title": "$:/language/ControlPanel/LoadedModules/Hint",
            "text": "These are the currently loaded tiddler modules linked to their source tiddlers. Any italicised modules lack a source tiddler, typically because they were setup during the boot process."
        },
        "$:/language/ControlPanel/Palette/Caption": {
            "title": "$:/language/ControlPanel/Palette/Caption",
            "text": "Palette"
        },
        "$:/language/ControlPanel/Palette/Editor/Clone/Caption": {
            "title": "$:/language/ControlPanel/Palette/Editor/Clone/Caption",
            "text": "clone"
        },
        "$:/language/ControlPanel/Palette/Editor/Clone/Prompt": {
            "title": "$:/language/ControlPanel/Palette/Editor/Clone/Prompt",
            "text": "It is recommended that you clone this shadow palette before editing it"
        },
        "$:/language/ControlPanel/Palette/Editor/Prompt/Modified": {
            "title": "$:/language/ControlPanel/Palette/Editor/Prompt/Modified",
            "text": "This shadow palette has been modified"
        },
        "$:/language/ControlPanel/Palette/Editor/Prompt": {
            "title": "$:/language/ControlPanel/Palette/Editor/Prompt",
            "text": "Editing"
        },
        "$:/language/ControlPanel/Palette/Editor/Reset/Caption": {
            "title": "$:/language/ControlPanel/Palette/Editor/Reset/Caption",
            "text": "reset"
        },
        "$:/language/ControlPanel/Palette/HideEditor/Caption": {
            "title": "$:/language/ControlPanel/Palette/HideEditor/Caption",
            "text": "hide editor"
        },
        "$:/language/ControlPanel/Palette/Prompt": {
            "title": "$:/language/ControlPanel/Palette/Prompt",
            "text": "Current palette:"
        },
        "$:/language/ControlPanel/Palette/ShowEditor/Caption": {
            "title": "$:/language/ControlPanel/Palette/ShowEditor/Caption",
            "text": "show editor"
        },
        "$:/language/ControlPanel/Parsing/Caption": {
            "title": "$:/language/ControlPanel/Parsing/Caption",
            "text": "Parsing"
        },
        "$:/language/ControlPanel/Parsing/Hint": {
            "title": "$:/language/ControlPanel/Parsing/Hint",
            "text": "Here you can globally disable/enable wiki parser rules. For changes to take effect, save and reload your wiki. Disabling certain parser rules can prevent <$text text=\"TiddlyWiki\"/> from functioning correctly. Use [[safe mode|http://tiddlywiki.com/#SafeMode]] to restore normal operation."
        },
        "$:/language/ControlPanel/Parsing/Block/Caption": {
            "title": "$:/language/ControlPanel/Parsing/Block/Caption",
            "text": "Block Parse Rules"
        },
        "$:/language/ControlPanel/Parsing/Inline/Caption": {
            "title": "$:/language/ControlPanel/Parsing/Inline/Caption",
            "text": "Inline Parse Rules"
        },
        "$:/language/ControlPanel/Parsing/Pragma/Caption": {
            "title": "$:/language/ControlPanel/Parsing/Pragma/Caption",
            "text": "Pragma Parse Rules"
        },
        "$:/language/ControlPanel/Plugins/Add/Caption": {
            "title": "$:/language/ControlPanel/Plugins/Add/Caption",
            "text": "Get more plugins"
        },
        "$:/language/ControlPanel/Plugins/Add/Hint": {
            "title": "$:/language/ControlPanel/Plugins/Add/Hint",
            "text": "Install plugins from the official library"
        },
        "$:/language/ControlPanel/Plugins/AlreadyInstalled/Hint": {
            "title": "$:/language/ControlPanel/Plugins/AlreadyInstalled/Hint",
            "text": "This plugin is already installed at version <$text text=<<installedVersion>>/>"
        },
        "$:/language/ControlPanel/Plugins/Caption": {
            "title": "$:/language/ControlPanel/Plugins/Caption",
            "text": "Plugins"
        },
        "$:/language/ControlPanel/Plugins/Disable/Caption": {
            "title": "$:/language/ControlPanel/Plugins/Disable/Caption",
            "text": "disable"
        },
        "$:/language/ControlPanel/Plugins/Disable/Hint": {
            "title": "$:/language/ControlPanel/Plugins/Disable/Hint",
            "text": "Disable this plugin when reloading page"
        },
        "$:/language/ControlPanel/Plugins/Disabled/Status": {
            "title": "$:/language/ControlPanel/Plugins/Disabled/Status",
            "text": "(disabled)"
        },
        "$:/language/ControlPanel/Plugins/Empty/Hint": {
            "title": "$:/language/ControlPanel/Plugins/Empty/Hint",
            "text": "None"
        },
        "$:/language/ControlPanel/Plugins/Enable/Caption": {
            "title": "$:/language/ControlPanel/Plugins/Enable/Caption",
            "text": "enable"
        },
        "$:/language/ControlPanel/Plugins/Enable/Hint": {
            "title": "$:/language/ControlPanel/Plugins/Enable/Hint",
            "text": "Enable this plugin when reloading page"
        },
        "$:/language/ControlPanel/Plugins/Install/Caption": {
            "title": "$:/language/ControlPanel/Plugins/Install/Caption",
            "text": "install"
        },
        "$:/language/ControlPanel/Plugins/Installed/Hint": {
            "title": "$:/language/ControlPanel/Plugins/Installed/Hint",
            "text": "Currently installed plugins:"
        },
        "$:/language/ControlPanel/Plugins/Languages/Caption": {
            "title": "$:/language/ControlPanel/Plugins/Languages/Caption",
            "text": "Languages"
        },
        "$:/language/ControlPanel/Plugins/Languages/Hint": {
            "title": "$:/language/ControlPanel/Plugins/Languages/Hint",
            "text": "Language pack plugins"
        },
        "$:/language/ControlPanel/Plugins/NoInfoFound/Hint": {
            "title": "$:/language/ControlPanel/Plugins/NoInfoFound/Hint",
            "text": "No ''\"<$text text=<<currentTab>>/>\"'' found"
        },
        "$:/language/ControlPanel/Plugins/NoInformation/Hint": {
            "title": "$:/language/ControlPanel/Plugins/NoInformation/Hint",
            "text": "No information provided"
        },
        "$:/language/ControlPanel/Plugins/NotInstalled/Hint": {
            "title": "$:/language/ControlPanel/Plugins/NotInstalled/Hint",
            "text": "This plugin is not currently installed"
        },
        "$:/language/ControlPanel/Plugins/OpenPluginLibrary": {
            "title": "$:/language/ControlPanel/Plugins/OpenPluginLibrary",
            "text": "open plugin library"
        },
        "$:/language/ControlPanel/Plugins/ClosePluginLibrary": {
            "title": "$:/language/ControlPanel/Plugins/ClosePluginLibrary",
            "text": "close plugin library"
        },
        "$:/language/ControlPanel/Plugins/Plugins/Caption": {
            "title": "$:/language/ControlPanel/Plugins/Plugins/Caption",
            "text": "Plugins"
        },
        "$:/language/ControlPanel/Plugins/Plugins/Hint": {
            "title": "$:/language/ControlPanel/Plugins/Plugins/Hint",
            "text": "Plugins"
        },
        "$:/language/ControlPanel/Plugins/Reinstall/Caption": {
            "title": "$:/language/ControlPanel/Plugins/Reinstall/Caption",
            "text": "reinstall"
        },
        "$:/language/ControlPanel/Plugins/Themes/Caption": {
            "title": "$:/language/ControlPanel/Plugins/Themes/Caption",
            "text": "Themes"
        },
        "$:/language/ControlPanel/Plugins/Themes/Hint": {
            "title": "$:/language/ControlPanel/Plugins/Themes/Hint",
            "text": "Theme plugins"
        },
        "$:/language/ControlPanel/Saving/Caption": {
            "title": "$:/language/ControlPanel/Saving/Caption",
            "text": "Saving"
        },
        "$:/language/ControlPanel/Saving/DownloadSaver/AutoSave/Description": {
            "title": "$:/language/ControlPanel/Saving/DownloadSaver/AutoSave/Description",
            "text": "Permit automatic saving for the download saver"
        },
        "$:/language/ControlPanel/Saving/DownloadSaver/AutoSave/Hint": {
            "title": "$:/language/ControlPanel/Saving/DownloadSaver/AutoSave/Hint",
            "text": "Enable Autosave for Download Saver"
        },
        "$:/language/ControlPanel/Saving/DownloadSaver/Caption": {
            "title": "$:/language/ControlPanel/Saving/DownloadSaver/Caption",
            "text": "Download Saver"
        },
        "$:/language/ControlPanel/Saving/DownloadSaver/Hint": {
            "title": "$:/language/ControlPanel/Saving/DownloadSaver/Hint",
            "text": "These settings apply to the HTML5-compatible download saver"
        },
        "$:/language/ControlPanel/Saving/General/Caption": {
            "title": "$:/language/ControlPanel/Saving/General/Caption",
            "text": "General"
        },
        "$:/language/ControlPanel/Saving/General/Hint": {
            "title": "$:/language/ControlPanel/Saving/General/Hint",
            "text": "These settings apply to all the loaded savers"
        },
        "$:/language/ControlPanel/Saving/Hint": {
            "title": "$:/language/ControlPanel/Saving/Hint",
            "text": "Settings used for saving the entire TiddlyWiki as a single file via a saver module"
        },
        "$:/language/ControlPanel/Saving/TiddlySpot/Advanced/Heading": {
            "title": "$:/language/ControlPanel/Saving/TiddlySpot/Advanced/Heading",
            "text": "Advanced Settings"
        },
        "$:/language/ControlPanel/Saving/TiddlySpot/BackupDir": {
            "title": "$:/language/ControlPanel/Saving/TiddlySpot/BackupDir",
            "text": "Backup Directory"
        },
        "$:/language/ControlPanel/Saving/TiddlySpot/Backups": {
            "title": "$:/language/ControlPanel/Saving/TiddlySpot/Backups",
            "text": "Backups"
        },
        "$:/language/ControlPanel/Saving/TiddlySpot/Caption": {
            "title": "$:/language/ControlPanel/Saving/TiddlySpot/Caption",
            "text": "~TiddlySpot Saver"
        },
        "$:/language/ControlPanel/Saving/TiddlySpot/Description": {
            "title": "$:/language/ControlPanel/Saving/TiddlySpot/Description",
            "text": "These settings are only used when saving to http://tiddlyspot.com or a compatible remote server"
        },
        "$:/language/ControlPanel/Saving/TiddlySpot/Filename": {
            "title": "$:/language/ControlPanel/Saving/TiddlySpot/Filename",
            "text": "Upload Filename"
        },
        "$:/language/ControlPanel/Saving/TiddlySpot/Heading": {
            "title": "$:/language/ControlPanel/Saving/TiddlySpot/Heading",
            "text": "~TiddlySpot"
        },
        "$:/language/ControlPanel/Saving/TiddlySpot/Hint": {
            "title": "$:/language/ControlPanel/Saving/TiddlySpot/Hint",
            "text": "//The server URL defaults to `http://<wikiname>.tiddlyspot.com/store.cgi` and can be changed to use a custom server address, e.g. `http://example.com/store.php`.//"
        },
        "$:/language/ControlPanel/Saving/TiddlySpot/Password": {
            "title": "$:/language/ControlPanel/Saving/TiddlySpot/Password",
            "text": "Password"
        },
        "$:/language/ControlPanel/Saving/TiddlySpot/ServerURL": {
            "title": "$:/language/ControlPanel/Saving/TiddlySpot/ServerURL",
            "text": "Server URL"
        },
        "$:/language/ControlPanel/Saving/TiddlySpot/UploadDir": {
            "title": "$:/language/ControlPanel/Saving/TiddlySpot/UploadDir",
            "text": "Upload Directory"
        },
        "$:/language/ControlPanel/Saving/TiddlySpot/UserName": {
            "title": "$:/language/ControlPanel/Saving/TiddlySpot/UserName",
            "text": "Wiki Name"
        },
        "$:/language/ControlPanel/Settings/AutoSave/Caption": {
            "title": "$:/language/ControlPanel/Settings/AutoSave/Caption",
            "text": "Autosave"
        },
        "$:/language/ControlPanel/Settings/AutoSave/Disabled/Description": {
            "title": "$:/language/ControlPanel/Settings/AutoSave/Disabled/Description",
            "text": "Do not save changes automatically"
        },
        "$:/language/ControlPanel/Settings/AutoSave/Enabled/Description": {
            "title": "$:/language/ControlPanel/Settings/AutoSave/Enabled/Description",
            "text": "Save changes automatically"
        },
        "$:/language/ControlPanel/Settings/AutoSave/Hint": {
            "title": "$:/language/ControlPanel/Settings/AutoSave/Hint",
            "text": "Attempt to automatically save changes during editing when using a supporting saver"
        },
        "$:/language/ControlPanel/Settings/CamelCase/Caption": {
            "title": "$:/language/ControlPanel/Settings/CamelCase/Caption",
            "text": "Camel Case Wiki Links"
        },
        "$:/language/ControlPanel/Settings/CamelCase/Hint": {
            "title": "$:/language/ControlPanel/Settings/CamelCase/Hint",
            "text": "You can globally disable automatic linking of ~CamelCase phrases. Requires reload to take effect"
        },
        "$:/language/ControlPanel/Settings/CamelCase/Description": {
            "title": "$:/language/ControlPanel/Settings/CamelCase/Description",
            "text": "Enable automatic ~CamelCase linking"
        },
        "$:/language/ControlPanel/Settings/Caption": {
            "title": "$:/language/ControlPanel/Settings/Caption",
            "text": "Settings"
        },
        "$:/language/ControlPanel/Settings/EditorToolbar/Caption": {
            "title": "$:/language/ControlPanel/Settings/EditorToolbar/Caption",
            "text": "Editor Toolbar"
        },
        "$:/language/ControlPanel/Settings/EditorToolbar/Hint": {
            "title": "$:/language/ControlPanel/Settings/EditorToolbar/Hint",
            "text": "Enable or disable the editor toolbar:"
        },
        "$:/language/ControlPanel/Settings/EditorToolbar/Description": {
            "title": "$:/language/ControlPanel/Settings/EditorToolbar/Description",
            "text": "Show editor toolbar"
        },
        "$:/language/ControlPanel/Settings/InfoPanelMode/Caption": {
            "title": "$:/language/ControlPanel/Settings/InfoPanelMode/Caption",
            "text": "Tiddler Info Panel Mode"
        },
        "$:/language/ControlPanel/Settings/InfoPanelMode/Hint": {
            "title": "$:/language/ControlPanel/Settings/InfoPanelMode/Hint",
            "text": "Control when the tiddler info panel closes:"
        },
        "$:/language/ControlPanel/Settings/InfoPanelMode/Popup/Description": {
            "title": "$:/language/ControlPanel/Settings/InfoPanelMode/Popup/Description",
            "text": "Tiddler info panel closes automatically"
        },
        "$:/language/ControlPanel/Settings/InfoPanelMode/Sticky/Description": {
            "title": "$:/language/ControlPanel/Settings/InfoPanelMode/Sticky/Description",
            "text": "Tiddler info panel stays open until explicitly closed"
        },
        "$:/language/ControlPanel/Settings/Hint": {
            "title": "$:/language/ControlPanel/Settings/Hint",
            "text": "These settings let you customise the behaviour of TiddlyWiki."
        },
        "$:/language/ControlPanel/Settings/NavigationAddressBar/Caption": {
            "title": "$:/language/ControlPanel/Settings/NavigationAddressBar/Caption",
            "text": "Navigation Address Bar"
        },
        "$:/language/ControlPanel/Settings/NavigationAddressBar/Hint": {
            "title": "$:/language/ControlPanel/Settings/NavigationAddressBar/Hint",
            "text": "Behaviour of the browser address bar when navigating to a tiddler:"
        },
        "$:/language/ControlPanel/Settings/NavigationAddressBar/No/Description": {
            "title": "$:/language/ControlPanel/Settings/NavigationAddressBar/No/Description",
            "text": "Do not update the address bar"
        },
        "$:/language/ControlPanel/Settings/NavigationAddressBar/Permalink/Description": {
            "title": "$:/language/ControlPanel/Settings/NavigationAddressBar/Permalink/Description",
            "text": "Include the target tiddler"
        },
        "$:/language/ControlPanel/Settings/NavigationAddressBar/Permaview/Description": {
            "title": "$:/language/ControlPanel/Settings/NavigationAddressBar/Permaview/Description",
            "text": "Include the target tiddler and the current story sequence"
        },
        "$:/language/ControlPanel/Settings/NavigationHistory/Caption": {
            "title": "$:/language/ControlPanel/Settings/NavigationHistory/Caption",
            "text": "Navigation History"
        },
        "$:/language/ControlPanel/Settings/NavigationHistory/Hint": {
            "title": "$:/language/ControlPanel/Settings/NavigationHistory/Hint",
            "text": "Update browser history when navigating to a tiddler:"
        },
        "$:/language/ControlPanel/Settings/NavigationHistory/No/Description": {
            "title": "$:/language/ControlPanel/Settings/NavigationHistory/No/Description",
            "text": "Do not update history"
        },
        "$:/language/ControlPanel/Settings/NavigationHistory/Yes/Description": {
            "title": "$:/language/ControlPanel/Settings/NavigationHistory/Yes/Description",
            "text": "Update history"
        },
        "$:/language/ControlPanel/Settings/PerformanceInstrumentation/Caption": {
            "title": "$:/language/ControlPanel/Settings/PerformanceInstrumentation/Caption",
            "text": "Performance Instrumentation"
        },
        "$:/language/ControlPanel/Settings/PerformanceInstrumentation/Hint": {
            "title": "$:/language/ControlPanel/Settings/PerformanceInstrumentation/Hint",
            "text": "Displays performance statistics in the browser developer console. Requires reload to take effect"
        },
        "$:/language/ControlPanel/Settings/PerformanceInstrumentation/Description": {
            "title": "$:/language/ControlPanel/Settings/PerformanceInstrumentation/Description",
            "text": "Enable performance instrumentation"
        },
        "$:/language/ControlPanel/Settings/ToolbarButtonStyle/Caption": {
            "title": "$:/language/ControlPanel/Settings/ToolbarButtonStyle/Caption",
            "text": "Toolbar Button Style"
        },
        "$:/language/ControlPanel/Settings/ToolbarButtonStyle/Hint": {
            "title": "$:/language/ControlPanel/Settings/ToolbarButtonStyle/Hint",
            "text": "Choose the style for toolbar buttons:"
        },
        "$:/language/ControlPanel/Settings/ToolbarButtonStyle/Styles/Borderless": {
            "title": "$:/language/ControlPanel/Settings/ToolbarButtonStyle/Styles/Borderless",
            "text": "Borderless"
        },
        "$:/language/ControlPanel/Settings/ToolbarButtonStyle/Styles/Boxed": {
            "title": "$:/language/ControlPanel/Settings/ToolbarButtonStyle/Styles/Boxed",
            "text": "Boxed"
        },
        "$:/language/ControlPanel/Settings/ToolbarButtonStyle/Styles/Rounded": {
            "title": "$:/language/ControlPanel/Settings/ToolbarButtonStyle/Styles/Rounded",
            "text": "Rounded"
        },
        "$:/language/ControlPanel/Settings/ToolbarButtons/Caption": {
            "title": "$:/language/ControlPanel/Settings/ToolbarButtons/Caption",
            "text": "Toolbar Buttons"
        },
        "$:/language/ControlPanel/Settings/ToolbarButtons/Hint": {
            "title": "$:/language/ControlPanel/Settings/ToolbarButtons/Hint",
            "text": "Default toolbar button appearance:"
        },
        "$:/language/ControlPanel/Settings/ToolbarButtons/Icons/Description": {
            "title": "$:/language/ControlPanel/Settings/ToolbarButtons/Icons/Description",
            "text": "Include icon"
        },
        "$:/language/ControlPanel/Settings/ToolbarButtons/Text/Description": {
            "title": "$:/language/ControlPanel/Settings/ToolbarButtons/Text/Description",
            "text": "Include text"
        },
        "$:/language/ControlPanel/Settings/DefaultSidebarTab/Caption": {
            "title": "$:/language/ControlPanel/Settings/DefaultSidebarTab/Caption",
            "text": "Default Sidebar Tab"
        },
        "$:/language/ControlPanel/Settings/DefaultSidebarTab/Hint": {
            "title": "$:/language/ControlPanel/Settings/DefaultSidebarTab/Hint",
            "text": "Specify which sidebar tab is displayed by default"
        },
        "$:/language/ControlPanel/Settings/LinkToBehaviour/Caption": {
            "title": "$:/language/ControlPanel/Settings/LinkToBehaviour/Caption",
            "text": "Tiddler Opening Behaviour"
        },
        "$:/language/ControlPanel/Settings/LinkToBehaviour/InsideRiver/Hint": {
            "title": "$:/language/ControlPanel/Settings/LinkToBehaviour/InsideRiver/Hint",
            "text": "Navigation from //within// the story river"
        },
        "$:/language/ControlPanel/Settings/LinkToBehaviour/OutsideRiver/Hint": {
            "title": "$:/language/ControlPanel/Settings/LinkToBehaviour/OutsideRiver/Hint",
            "text": "Navigation from //outside// the story river"
        },
        "$:/language/ControlPanel/Settings/LinkToBehaviour/OpenAbove": {
            "title": "$:/language/ControlPanel/Settings/LinkToBehaviour/OpenAbove",
            "text": "Open above the current tiddler"
        },
        "$:/language/ControlPanel/Settings/LinkToBehaviour/OpenBelow": {
            "title": "$:/language/ControlPanel/Settings/LinkToBehaviour/OpenBelow",
            "text": "Open below the current tiddler"
        },
        "$:/language/ControlPanel/Settings/LinkToBehaviour/OpenAtTop": {
            "title": "$:/language/ControlPanel/Settings/LinkToBehaviour/OpenAtTop",
            "text": "Open at the top of the story river"
        },
        "$:/language/ControlPanel/Settings/LinkToBehaviour/OpenAtBottom": {
            "title": "$:/language/ControlPanel/Settings/LinkToBehaviour/OpenAtBottom",
            "text": "Open at the bottom of the story river"
        },
        "$:/language/ControlPanel/Settings/TitleLinks/Caption": {
            "title": "$:/language/ControlPanel/Settings/TitleLinks/Caption",
            "text": "Tiddler Titles"
        },
        "$:/language/ControlPanel/Settings/TitleLinks/Hint": {
            "title": "$:/language/ControlPanel/Settings/TitleLinks/Hint",
            "text": "Optionally display tiddler titles as links"
        },
        "$:/language/ControlPanel/Settings/TitleLinks/No/Description": {
            "title": "$:/language/ControlPanel/Settings/TitleLinks/No/Description",
            "text": "Do not display tiddler titles as links"
        },
        "$:/language/ControlPanel/Settings/TitleLinks/Yes/Description": {
            "title": "$:/language/ControlPanel/Settings/TitleLinks/Yes/Description",
            "text": "Display tiddler titles as links"
        },
        "$:/language/ControlPanel/Settings/MissingLinks/Caption": {
            "title": "$:/language/ControlPanel/Settings/MissingLinks/Caption",
            "text": "Wiki Links"
        },
        "$:/language/ControlPanel/Settings/MissingLinks/Hint": {
            "title": "$:/language/ControlPanel/Settings/MissingLinks/Hint",
            "text": "Choose whether to link to tiddlers that do not exist yet"
        },
        "$:/language/ControlPanel/Settings/MissingLinks/Description": {
            "title": "$:/language/ControlPanel/Settings/MissingLinks/Description",
            "text": "Enable links to missing tiddlers"
        },
        "$:/language/ControlPanel/StoryView/Caption": {
            "title": "$:/language/ControlPanel/StoryView/Caption",
            "text": "Story View"
        },
        "$:/language/ControlPanel/StoryView/Prompt": {
            "title": "$:/language/ControlPanel/StoryView/Prompt",
            "text": "Current view:"
        },
        "$:/language/ControlPanel/Theme/Caption": {
            "title": "$:/language/ControlPanel/Theme/Caption",
            "text": "Theme"
        },
        "$:/language/ControlPanel/Theme/Prompt": {
            "title": "$:/language/ControlPanel/Theme/Prompt",
            "text": "Current theme:"
        },
        "$:/language/ControlPanel/TiddlerFields/Caption": {
            "title": "$:/language/ControlPanel/TiddlerFields/Caption",
            "text": "Tiddler Fields"
        },
        "$:/language/ControlPanel/TiddlerFields/Hint": {
            "title": "$:/language/ControlPanel/TiddlerFields/Hint",
            "text": "This is the full set of TiddlerFields in use in this wiki (including system tiddlers but excluding shadow tiddlers)."
        },
        "$:/language/ControlPanel/Toolbars/Caption": {
            "title": "$:/language/ControlPanel/Toolbars/Caption",
            "text": "Toolbars"
        },
        "$:/language/ControlPanel/Toolbars/EditToolbar/Caption": {
            "title": "$:/language/ControlPanel/Toolbars/EditToolbar/Caption",
            "text": "Edit Toolbar"
        },
        "$:/language/ControlPanel/Toolbars/EditToolbar/Hint": {
            "title": "$:/language/ControlPanel/Toolbars/EditToolbar/Hint",
            "text": "Choose which buttons are displayed for tiddlers in edit mode. Drag and drop to change the ordering"
        },
        "$:/language/ControlPanel/Toolbars/Hint": {
            "title": "$:/language/ControlPanel/Toolbars/Hint",
            "text": "Select which toolbar buttons are displayed"
        },
        "$:/language/ControlPanel/Toolbars/PageControls/Caption": {
            "title": "$:/language/ControlPanel/Toolbars/PageControls/Caption",
            "text": "Page Toolbar"
        },
        "$:/language/ControlPanel/Toolbars/PageControls/Hint": {
            "title": "$:/language/ControlPanel/Toolbars/PageControls/Hint",
            "text": "Choose which buttons are displayed on the main page toolbar. Drag and drop to change the ordering"
        },
        "$:/language/ControlPanel/Toolbars/EditorToolbar/Caption": {
            "title": "$:/language/ControlPanel/Toolbars/EditorToolbar/Caption",
            "text": "Editor Toolbar"
        },
        "$:/language/ControlPanel/Toolbars/EditorToolbar/Hint": {
            "title": "$:/language/ControlPanel/Toolbars/EditorToolbar/Hint",
            "text": "Choose which buttons are displayed in the editor toolbar. Note that some buttons will only appear when editing tiddlers of a certain type. Drag and drop to change the ordering"
        },
        "$:/language/ControlPanel/Toolbars/ViewToolbar/Caption": {
            "title": "$:/language/ControlPanel/Toolbars/ViewToolbar/Caption",
            "text": "View Toolbar"
        },
        "$:/language/ControlPanel/Toolbars/ViewToolbar/Hint": {
            "title": "$:/language/ControlPanel/Toolbars/ViewToolbar/Hint",
            "text": "Choose which buttons are displayed for tiddlers in view mode. Drag and drop to change the ordering"
        },
        "$:/language/ControlPanel/Tools/Download/Full/Caption": {
            "title": "$:/language/ControlPanel/Tools/Download/Full/Caption",
            "text": "Download full wiki"
        },
        "$:/language/Date/DaySuffix/1": {
            "title": "$:/language/Date/DaySuffix/1",
            "text": "st"
        },
        "$:/language/Date/DaySuffix/2": {
            "title": "$:/language/Date/DaySuffix/2",
            "text": "nd"
        },
        "$:/language/Date/DaySuffix/3": {
            "title": "$:/language/Date/DaySuffix/3",
            "text": "rd"
        },
        "$:/language/Date/DaySuffix/4": {
            "title": "$:/language/Date/DaySuffix/4",
            "text": "th"
        },
        "$:/language/Date/DaySuffix/5": {
            "title": "$:/language/Date/DaySuffix/5",
            "text": "th"
        },
        "$:/language/Date/DaySuffix/6": {
            "title": "$:/language/Date/DaySuffix/6",
            "text": "th"
        },
        "$:/language/Date/DaySuffix/7": {
            "title": "$:/language/Date/DaySuffix/7",
            "text": "th"
        },
        "$:/language/Date/DaySuffix/8": {
            "title": "$:/language/Date/DaySuffix/8",
            "text": "th"
        },
        "$:/language/Date/DaySuffix/9": {
            "title": "$:/language/Date/DaySuffix/9",
            "text": "th"
        },
        "$:/language/Date/DaySuffix/10": {
            "title": "$:/language/Date/DaySuffix/10",
            "text": "th"
        },
        "$:/language/Date/DaySuffix/11": {
            "title": "$:/language/Date/DaySuffix/11",
            "text": "th"
        },
        "$:/language/Date/DaySuffix/12": {
            "title": "$:/language/Date/DaySuffix/12",
            "text": "th"
        },
        "$:/language/Date/DaySuffix/13": {
            "title": "$:/language/Date/DaySuffix/13",
            "text": "th"
        },
        "$:/language/Date/DaySuffix/14": {
            "title": "$:/language/Date/DaySuffix/14",
            "text": "th"
        },
        "$:/language/Date/DaySuffix/15": {
            "title": "$:/language/Date/DaySuffix/15",
            "text": "th"
        },
        "$:/language/Date/DaySuffix/16": {
            "title": "$:/language/Date/DaySuffix/16",
            "text": "th"
        },
        "$:/language/Date/DaySuffix/17": {
            "title": "$:/language/Date/DaySuffix/17",
            "text": "th"
        },
        "$:/language/Date/DaySuffix/18": {
            "title": "$:/language/Date/DaySuffix/18",
            "text": "th"
        },
        "$:/language/Date/DaySuffix/19": {
            "title": "$:/language/Date/DaySuffix/19",
            "text": "th"
        },
        "$:/language/Date/DaySuffix/20": {
            "title": "$:/language/Date/DaySuffix/20",
            "text": "th"
        },
        "$:/language/Date/DaySuffix/21": {
            "title": "$:/language/Date/DaySuffix/21",
            "text": "st"
        },
        "$:/language/Date/DaySuffix/22": {
            "title": "$:/language/Date/DaySuffix/22",
            "text": "nd"
        },
        "$:/language/Date/DaySuffix/23": {
            "title": "$:/language/Date/DaySuffix/23",
            "text": "rd"
        },
        "$:/language/Date/DaySuffix/24": {
            "title": "$:/language/Date/DaySuffix/24",
            "text": "th"
        },
        "$:/language/Date/DaySuffix/25": {
            "title": "$:/language/Date/DaySuffix/25",
            "text": "th"
        },
        "$:/language/Date/DaySuffix/26": {
            "title": "$:/language/Date/DaySuffix/26",
            "text": "th"
        },
        "$:/language/Date/DaySuffix/27": {
            "title": "$:/language/Date/DaySuffix/27",
            "text": "th"
        },
        "$:/language/Date/DaySuffix/28": {
            "title": "$:/language/Date/DaySuffix/28",
            "text": "th"
        },
        "$:/language/Date/DaySuffix/29": {
            "title": "$:/language/Date/DaySuffix/29",
            "text": "th"
        },
        "$:/language/Date/DaySuffix/30": {
            "title": "$:/language/Date/DaySuffix/30",
            "text": "th"
        },
        "$:/language/Date/DaySuffix/31": {
            "title": "$:/language/Date/DaySuffix/31",
            "text": "st"
        },
        "$:/language/Date/Long/Day/0": {
            "title": "$:/language/Date/Long/Day/0",
            "text": "Sunday"
        },
        "$:/language/Date/Long/Day/1": {
            "title": "$:/language/Date/Long/Day/1",
            "text": "Monday"
        },
        "$:/language/Date/Long/Day/2": {
            "title": "$:/language/Date/Long/Day/2",
            "text": "Tuesday"
        },
        "$:/language/Date/Long/Day/3": {
            "title": "$:/language/Date/Long/Day/3",
            "text": "Wednesday"
        },
        "$:/language/Date/Long/Day/4": {
            "title": "$:/language/Date/Long/Day/4",
            "text": "Thursday"
        },
        "$:/language/Date/Long/Day/5": {
            "title": "$:/language/Date/Long/Day/5",
            "text": "Friday"
        },
        "$:/language/Date/Long/Day/6": {
            "title": "$:/language/Date/Long/Day/6",
            "text": "Saturday"
        },
        "$:/language/Date/Long/Month/1": {
            "title": "$:/language/Date/Long/Month/1",
            "text": "January"
        },
        "$:/language/Date/Long/Month/2": {
            "title": "$:/language/Date/Long/Month/2",
            "text": "February"
        },
        "$:/language/Date/Long/Month/3": {
            "title": "$:/language/Date/Long/Month/3",
            "text": "March"
        },
        "$:/language/Date/Long/Month/4": {
            "title": "$:/language/Date/Long/Month/4",
            "text": "April"
        },
        "$:/language/Date/Long/Month/5": {
            "title": "$:/language/Date/Long/Month/5",
            "text": "May"
        },
        "$:/language/Date/Long/Month/6": {
            "title": "$:/language/Date/Long/Month/6",
            "text": "June"
        },
        "$:/language/Date/Long/Month/7": {
            "title": "$:/language/Date/Long/Month/7",
            "text": "July"
        },
        "$:/language/Date/Long/Month/8": {
            "title": "$:/language/Date/Long/Month/8",
            "text": "August"
        },
        "$:/language/Date/Long/Month/9": {
            "title": "$:/language/Date/Long/Month/9",
            "text": "September"
        },
        "$:/language/Date/Long/Month/10": {
            "title": "$:/language/Date/Long/Month/10",
            "text": "October"
        },
        "$:/language/Date/Long/Month/11": {
            "title": "$:/language/Date/Long/Month/11",
            "text": "November"
        },
        "$:/language/Date/Long/Month/12": {
            "title": "$:/language/Date/Long/Month/12",
            "text": "December"
        },
        "$:/language/Date/Period/am": {
            "title": "$:/language/Date/Period/am",
            "text": "am"
        },
        "$:/language/Date/Period/pm": {
            "title": "$:/language/Date/Period/pm",
            "text": "pm"
        },
        "$:/language/Date/Short/Day/0": {
            "title": "$:/language/Date/Short/Day/0",
            "text": "Sun"
        },
        "$:/language/Date/Short/Day/1": {
            "title": "$:/language/Date/Short/Day/1",
            "text": "Mon"
        },
        "$:/language/Date/Short/Day/2": {
            "title": "$:/language/Date/Short/Day/2",
            "text": "Tue"
        },
        "$:/language/Date/Short/Day/3": {
            "title": "$:/language/Date/Short/Day/3",
            "text": "Wed"
        },
        "$:/language/Date/Short/Day/4": {
            "title": "$:/language/Date/Short/Day/4",
            "text": "Thu"
        },
        "$:/language/Date/Short/Day/5": {
            "title": "$:/language/Date/Short/Day/5",
            "text": "Fri"
        },
        "$:/language/Date/Short/Day/6": {
            "title": "$:/language/Date/Short/Day/6",
            "text": "Sat"
        },
        "$:/language/Date/Short/Month/1": {
            "title": "$:/language/Date/Short/Month/1",
            "text": "Jan"
        },
        "$:/language/Date/Short/Month/2": {
            "title": "$:/language/Date/Short/Month/2",
            "text": "Feb"
        },
        "$:/language/Date/Short/Month/3": {
            "title": "$:/language/Date/Short/Month/3",
            "text": "Mar"
        },
        "$:/language/Date/Short/Month/4": {
            "title": "$:/language/Date/Short/Month/4",
            "text": "Apr"
        },
        "$:/language/Date/Short/Month/5": {
            "title": "$:/language/Date/Short/Month/5",
            "text": "May"
        },
        "$:/language/Date/Short/Month/6": {
            "title": "$:/language/Date/Short/Month/6",
            "text": "Jun"
        },
        "$:/language/Date/Short/Month/7": {
            "title": "$:/language/Date/Short/Month/7",
            "text": "Jul"
        },
        "$:/language/Date/Short/Month/8": {
            "title": "$:/language/Date/Short/Month/8",
            "text": "Aug"
        },
        "$:/language/Date/Short/Month/9": {
            "title": "$:/language/Date/Short/Month/9",
            "text": "Sep"
        },
        "$:/language/Date/Short/Month/10": {
            "title": "$:/language/Date/Short/Month/10",
            "text": "Oct"
        },
        "$:/language/Date/Short/Month/11": {
            "title": "$:/language/Date/Short/Month/11",
            "text": "Nov"
        },
        "$:/language/Date/Short/Month/12": {
            "title": "$:/language/Date/Short/Month/12",
            "text": "Dec"
        },
        "$:/language/RelativeDate/Future/Days": {
            "title": "$:/language/RelativeDate/Future/Days",
            "text": "<<period>> days from now"
        },
        "$:/language/RelativeDate/Future/Hours": {
            "title": "$:/language/RelativeDate/Future/Hours",
            "text": "<<period>> hours from now"
        },
        "$:/language/RelativeDate/Future/Minutes": {
            "title": "$:/language/RelativeDate/Future/Minutes",
            "text": "<<period>> minutes from now"
        },
        "$:/language/RelativeDate/Future/Months": {
            "title": "$:/language/RelativeDate/Future/Months",
            "text": "<<period>> months from now"
        },
        "$:/language/RelativeDate/Future/Second": {
            "title": "$:/language/RelativeDate/Future/Second",
            "text": "1 second from now"
        },
        "$:/language/RelativeDate/Future/Seconds": {
            "title": "$:/language/RelativeDate/Future/Seconds",
            "text": "<<period>> seconds from now"
        },
        "$:/language/RelativeDate/Future/Years": {
            "title": "$:/language/RelativeDate/Future/Years",
            "text": "<<period>> years from now"
        },
        "$:/language/RelativeDate/Past/Days": {
            "title": "$:/language/RelativeDate/Past/Days",
            "text": "<<period>> days ago"
        },
        "$:/language/RelativeDate/Past/Hours": {
            "title": "$:/language/RelativeDate/Past/Hours",
            "text": "<<period>> hours ago"
        },
        "$:/language/RelativeDate/Past/Minutes": {
            "title": "$:/language/RelativeDate/Past/Minutes",
            "text": "<<period>> minutes ago"
        },
        "$:/language/RelativeDate/Past/Months": {
            "title": "$:/language/RelativeDate/Past/Months",
            "text": "<<period>> months ago"
        },
        "$:/language/RelativeDate/Past/Second": {
            "title": "$:/language/RelativeDate/Past/Second",
            "text": "1 second ago"
        },
        "$:/language/RelativeDate/Past/Seconds": {
            "title": "$:/language/RelativeDate/Past/Seconds",
            "text": "<<period>> seconds ago"
        },
        "$:/language/RelativeDate/Past/Years": {
            "title": "$:/language/RelativeDate/Past/Years",
            "text": "<<period>> years ago"
        },
        "$:/language/Docs/ModuleTypes/allfilteroperator": {
            "title": "$:/language/Docs/ModuleTypes/allfilteroperator",
            "text": "A sub-operator for the ''all'' filter operator."
        },
        "$:/language/Docs/ModuleTypes/animation": {
            "title": "$:/language/Docs/ModuleTypes/animation",
            "text": "Animations that may be used with the RevealWidget."
        },
        "$:/language/Docs/ModuleTypes/bitmapeditoroperation": {
            "title": "$:/language/Docs/ModuleTypes/bitmapeditoroperation",
            "text": "A bitmap editor toolbar operation."
        },
        "$:/language/Docs/ModuleTypes/command": {
            "title": "$:/language/Docs/ModuleTypes/command",
            "text": "Commands that can be executed under Node.js."
        },
        "$:/language/Docs/ModuleTypes/config": {
            "title": "$:/language/Docs/ModuleTypes/config",
            "text": "Data to be inserted into `$tw.config`."
        },
        "$:/language/Docs/ModuleTypes/filteroperator": {
            "title": "$:/language/Docs/ModuleTypes/filteroperator",
            "text": "Individual filter operator methods."
        },
        "$:/language/Docs/ModuleTypes/global": {
            "title": "$:/language/Docs/ModuleTypes/global",
            "text": "Global data to be inserted into `$tw`."
        },
        "$:/language/Docs/ModuleTypes/info": {
            "title": "$:/language/Docs/ModuleTypes/info",
            "text": "Publishes system information via the [[$:/temp/info-plugin]] pseudo-plugin."
        },
        "$:/language/Docs/ModuleTypes/isfilteroperator": {
            "title": "$:/language/Docs/ModuleTypes/isfilteroperator",
            "text": "Operands for the ''is'' filter operator."
        },
        "$:/language/Docs/ModuleTypes/library": {
            "title": "$:/language/Docs/ModuleTypes/library",
            "text": "Generic module type for general purpose JavaScript modules."
        },
        "$:/language/Docs/ModuleTypes/macro": {
            "title": "$:/language/Docs/ModuleTypes/macro",
            "text": "JavaScript macro definitions."
        },
        "$:/language/Docs/ModuleTypes/parser": {
            "title": "$:/language/Docs/ModuleTypes/parser",
            "text": "Parsers for different content types."
        },
        "$:/language/Docs/ModuleTypes/saver": {
            "title": "$:/language/Docs/ModuleTypes/saver",
            "text": "Savers handle different methods for saving files from the browser."
        },
        "$:/language/Docs/ModuleTypes/startup": {
            "title": "$:/language/Docs/ModuleTypes/startup",
            "text": "Startup functions."
        },
        "$:/language/Docs/ModuleTypes/storyview": {
            "title": "$:/language/Docs/ModuleTypes/storyview",
            "text": "Story views customise the animation and behaviour of list widgets."
        },
        "$:/language/Docs/ModuleTypes/texteditoroperation": {
            "title": "$:/language/Docs/ModuleTypes/texteditoroperation",
            "text": "A text editor toolbar operation."
        },
        "$:/language/Docs/ModuleTypes/tiddlerdeserializer": {
            "title": "$:/language/Docs/ModuleTypes/tiddlerdeserializer",
            "text": "Converts different content types into tiddlers."
        },
        "$:/language/Docs/ModuleTypes/tiddlerfield": {
            "title": "$:/language/Docs/ModuleTypes/tiddlerfield",
            "text": "Defines the behaviour of an individual tiddler field."
        },
        "$:/language/Docs/ModuleTypes/tiddlermethod": {
            "title": "$:/language/Docs/ModuleTypes/tiddlermethod",
            "text": "Adds methods to the `$tw.Tiddler` prototype."
        },
        "$:/language/Docs/ModuleTypes/upgrader": {
            "title": "$:/language/Docs/ModuleTypes/upgrader",
            "text": "Applies upgrade processing to tiddlers during an upgrade/import."
        },
        "$:/language/Docs/ModuleTypes/utils": {
            "title": "$:/language/Docs/ModuleTypes/utils",
            "text": "Adds methods to `$tw.utils`."
        },
        "$:/language/Docs/ModuleTypes/utils-node": {
            "title": "$:/language/Docs/ModuleTypes/utils-node",
            "text": "Adds Node.js-specific methods to `$tw.utils`."
        },
        "$:/language/Docs/ModuleTypes/widget": {
            "title": "$:/language/Docs/ModuleTypes/widget",
            "text": "Widgets encapsulate DOM rendering and refreshing."
        },
        "$:/language/Docs/ModuleTypes/wikimethod": {
            "title": "$:/language/Docs/ModuleTypes/wikimethod",
            "text": "Adds methods to `$tw.Wiki`."
        },
        "$:/language/Docs/ModuleTypes/wikirule": {
            "title": "$:/language/Docs/ModuleTypes/wikirule",
            "text": "Individual parser rules for the main WikiText parser."
        },
        "$:/language/Docs/PaletteColours/alert-background": {
            "title": "$:/language/Docs/PaletteColours/alert-background",
            "text": "Alert background"
        },
        "$:/language/Docs/PaletteColours/alert-border": {
            "title": "$:/language/Docs/PaletteColours/alert-border",
            "text": "Alert border"
        },
        "$:/language/Docs/PaletteColours/alert-highlight": {
            "title": "$:/language/Docs/PaletteColours/alert-highlight",
            "text": "Alert highlight"
        },
        "$:/language/Docs/PaletteColours/alert-muted-foreground": {
            "title": "$:/language/Docs/PaletteColours/alert-muted-foreground",
            "text": "Alert muted foreground"
        },
        "$:/language/Docs/PaletteColours/background": {
            "title": "$:/language/Docs/PaletteColours/background",
            "text": "General background"
        },
        "$:/language/Docs/PaletteColours/blockquote-bar": {
            "title": "$:/language/Docs/PaletteColours/blockquote-bar",
            "text": "Blockquote bar"
        },
        "$:/language/Docs/PaletteColours/button-background": {
            "title": "$:/language/Docs/PaletteColours/button-background",
            "text": "Default button background"
        },
        "$:/language/Docs/PaletteColours/button-border": {
            "title": "$:/language/Docs/PaletteColours/button-border",
            "text": "Default button border"
        },
        "$:/language/Docs/PaletteColours/button-foreground": {
            "title": "$:/language/Docs/PaletteColours/button-foreground",
            "text": "Default button foreground"
        },
        "$:/language/Docs/PaletteColours/dirty-indicator": {
            "title": "$:/language/Docs/PaletteColours/dirty-indicator",
            "text": "Unsaved changes indicator"
        },
        "$:/language/Docs/PaletteColours/code-background": {
            "title": "$:/language/Docs/PaletteColours/code-background",
            "text": "Code background"
        },
        "$:/language/Docs/PaletteColours/code-border": {
            "title": "$:/language/Docs/PaletteColours/code-border",
            "text": "Code border"
        },
        "$:/language/Docs/PaletteColours/code-foreground": {
            "title": "$:/language/Docs/PaletteColours/code-foreground",
            "text": "Code foreground"
        },
        "$:/language/Docs/PaletteColours/download-background": {
            "title": "$:/language/Docs/PaletteColours/download-background",
            "text": "Download button background"
        },
        "$:/language/Docs/PaletteColours/download-foreground": {
            "title": "$:/language/Docs/PaletteColours/download-foreground",
            "text": "Download button foreground"
        },
        "$:/language/Docs/PaletteColours/dragger-background": {
            "title": "$:/language/Docs/PaletteColours/dragger-background",
            "text": "Dragger background"
        },
        "$:/language/Docs/PaletteColours/dragger-foreground": {
            "title": "$:/language/Docs/PaletteColours/dragger-foreground",
            "text": "Dragger foreground"
        },
        "$:/language/Docs/PaletteColours/dropdown-background": {
            "title": "$:/language/Docs/PaletteColours/dropdown-background",
            "text": "Dropdown background"
        },
        "$:/language/Docs/PaletteColours/dropdown-border": {
            "title": "$:/language/Docs/PaletteColours/dropdown-border",
            "text": "Dropdown border"
        },
        "$:/language/Docs/PaletteColours/dropdown-tab-background-selected": {
            "title": "$:/language/Docs/PaletteColours/dropdown-tab-background-selected",
            "text": "Dropdown tab background for selected tabs"
        },
        "$:/language/Docs/PaletteColours/dropdown-tab-background": {
            "title": "$:/language/Docs/PaletteColours/dropdown-tab-background",
            "text": "Dropdown tab background"
        },
        "$:/language/Docs/PaletteColours/dropzone-background": {
            "title": "$:/language/Docs/PaletteColours/dropzone-background",
            "text": "Dropzone background"
        },
        "$:/language/Docs/PaletteColours/external-link-background-hover": {
            "title": "$:/language/Docs/PaletteColours/external-link-background-hover",
            "text": "External link background hover"
        },
        "$:/language/Docs/PaletteColours/external-link-background-visited": {
            "title": "$:/language/Docs/PaletteColours/external-link-background-visited",
            "text": "External link background visited"
        },
        "$:/language/Docs/PaletteColours/external-link-background": {
            "title": "$:/language/Docs/PaletteColours/external-link-background",
            "text": "External link background"
        },
        "$:/language/Docs/PaletteColours/external-link-foreground-hover": {
            "title": "$:/language/Docs/PaletteColours/external-link-foreground-hover",
            "text": "External link foreground hover"
        },
        "$:/language/Docs/PaletteColours/external-link-foreground-visited": {
            "title": "$:/language/Docs/PaletteColours/external-link-foreground-visited",
            "text": "External link foreground visited"
        },
        "$:/language/Docs/PaletteColours/external-link-foreground": {
            "title": "$:/language/Docs/PaletteColours/external-link-foreground",
            "text": "External link foreground"
        },
        "$:/language/Docs/PaletteColours/foreground": {
            "title": "$:/language/Docs/PaletteColours/foreground",
            "text": "General foreground"
        },
        "$:/language/Docs/PaletteColours/message-background": {
            "title": "$:/language/Docs/PaletteColours/message-background",
            "text": "Message box background"
        },
        "$:/language/Docs/PaletteColours/message-border": {
            "title": "$:/language/Docs/PaletteColours/message-border",
            "text": "Message box border"
        },
        "$:/language/Docs/PaletteColours/message-foreground": {
            "title": "$:/language/Docs/PaletteColours/message-foreground",
            "text": "Message box foreground"
        },
        "$:/language/Docs/PaletteColours/modal-backdrop": {
            "title": "$:/language/Docs/PaletteColours/modal-backdrop",
            "text": "Modal backdrop"
        },
        "$:/language/Docs/PaletteColours/modal-background": {
            "title": "$:/language/Docs/PaletteColours/modal-background",
            "text": "Modal background"
        },
        "$:/language/Docs/PaletteColours/modal-border": {
            "title": "$:/language/Docs/PaletteColours/modal-border",
            "text": "Modal border"
        },
        "$:/language/Docs/PaletteColours/modal-footer-background": {
            "title": "$:/language/Docs/PaletteColours/modal-footer-background",
            "text": "Modal footer background"
        },
        "$:/language/Docs/PaletteColours/modal-footer-border": {
            "title": "$:/language/Docs/PaletteColours/modal-footer-border",
            "text": "Modal footer border"
        },
        "$:/language/Docs/PaletteColours/modal-header-border": {
            "title": "$:/language/Docs/PaletteColours/modal-header-border",
            "text": "Modal header border"
        },
        "$:/language/Docs/PaletteColours/muted-foreground": {
            "title": "$:/language/Docs/PaletteColours/muted-foreground",
            "text": "General muted foreground"
        },
        "$:/language/Docs/PaletteColours/notification-background": {
            "title": "$:/language/Docs/PaletteColours/notification-background",
            "text": "Notification background"
        },
        "$:/language/Docs/PaletteColours/notification-border": {
            "title": "$:/language/Docs/PaletteColours/notification-border",
            "text": "Notification border"
        },
        "$:/language/Docs/PaletteColours/page-background": {
            "title": "$:/language/Docs/PaletteColours/page-background",
            "text": "Page background"
        },
        "$:/language/Docs/PaletteColours/pre-background": {
            "title": "$:/language/Docs/PaletteColours/pre-background",
            "text": "Preformatted code background"
        },
        "$:/language/Docs/PaletteColours/pre-border": {
            "title": "$:/language/Docs/PaletteColours/pre-border",
            "text": "Preformatted code border"
        },
        "$:/language/Docs/PaletteColours/primary": {
            "title": "$:/language/Docs/PaletteColours/primary",
            "text": "General primary"
        },
        "$:/language/Docs/PaletteColours/sidebar-button-foreground": {
            "title": "$:/language/Docs/PaletteColours/sidebar-button-foreground",
            "text": "Sidebar button foreground"
        },
        "$:/language/Docs/PaletteColours/sidebar-controls-foreground-hover": {
            "title": "$:/language/Docs/PaletteColours/sidebar-controls-foreground-hover",
            "text": "Sidebar controls foreground hover"
        },
        "$:/language/Docs/PaletteColours/sidebar-controls-foreground": {
            "title": "$:/language/Docs/PaletteColours/sidebar-controls-foreground",
            "text": "Sidebar controls foreground"
        },
        "$:/language/Docs/PaletteColours/sidebar-foreground-shadow": {
            "title": "$:/language/Docs/PaletteColours/sidebar-foreground-shadow",
            "text": "Sidebar foreground shadow"
        },
        "$:/language/Docs/PaletteColours/sidebar-foreground": {
            "title": "$:/language/Docs/PaletteColours/sidebar-foreground",
            "text": "Sidebar foreground"
        },
        "$:/language/Docs/PaletteColours/sidebar-muted-foreground-hover": {
            "title": "$:/language/Docs/PaletteColours/sidebar-muted-foreground-hover",
            "text": "Sidebar muted foreground hover"
        },
        "$:/language/Docs/PaletteColours/sidebar-muted-foreground": {
            "title": "$:/language/Docs/PaletteColours/sidebar-muted-foreground",
            "text": "Sidebar muted foreground"
        },
        "$:/language/Docs/PaletteColours/sidebar-tab-background-selected": {
            "title": "$:/language/Docs/PaletteColours/sidebar-tab-background-selected",
            "text": "Sidebar tab background for selected tabs"
        },
        "$:/language/Docs/PaletteColours/sidebar-tab-background": {
            "title": "$:/language/Docs/PaletteColours/sidebar-tab-background",
            "text": "Sidebar tab background"
        },
        "$:/language/Docs/PaletteColours/sidebar-tab-border-selected": {
            "title": "$:/language/Docs/PaletteColours/sidebar-tab-border-selected",
            "text": "Sidebar tab border for selected tabs"
        },
        "$:/language/Docs/PaletteColours/sidebar-tab-border": {
            "title": "$:/language/Docs/PaletteColours/sidebar-tab-border",
            "text": "Sidebar tab border"
        },
        "$:/language/Docs/PaletteColours/sidebar-tab-divider": {
            "title": "$:/language/Docs/PaletteColours/sidebar-tab-divider",
            "text": "Sidebar tab divider"
        },
        "$:/language/Docs/PaletteColours/sidebar-tab-foreground-selected": {
            "title": "$:/language/Docs/PaletteColours/sidebar-tab-foreground-selected",
            "text": "Sidebar tab foreground for selected tabs"
        },
        "$:/language/Docs/PaletteColours/sidebar-tab-foreground": {
            "title": "$:/language/Docs/PaletteColours/sidebar-tab-foreground",
            "text": "Sidebar tab foreground"
        },
        "$:/language/Docs/PaletteColours/sidebar-tiddler-link-foreground-hover": {
            "title": "$:/language/Docs/PaletteColours/sidebar-tiddler-link-foreground-hover",
            "text": "Sidebar tiddler link foreground hover"
        },
        "$:/language/Docs/PaletteColours/sidebar-tiddler-link-foreground": {
            "title": "$:/language/Docs/PaletteColours/sidebar-tiddler-link-foreground",
            "text": "Sidebar tiddler link foreground"
        },
        "$:/language/Docs/PaletteColours/site-title-foreground": {
            "title": "$:/language/Docs/PaletteColours/site-title-foreground",
            "text": "Site title foreground"
        },
        "$:/language/Docs/PaletteColours/static-alert-foreground": {
            "title": "$:/language/Docs/PaletteColours/static-alert-foreground",
            "text": "Static alert foreground"
        },
        "$:/language/Docs/PaletteColours/tab-background-selected": {
            "title": "$:/language/Docs/PaletteColours/tab-background-selected",
            "text": "Tab background for selected tabs"
        },
        "$:/language/Docs/PaletteColours/tab-background": {
            "title": "$:/language/Docs/PaletteColours/tab-background",
            "text": "Tab background"
        },
        "$:/language/Docs/PaletteColours/tab-border-selected": {
            "title": "$:/language/Docs/PaletteColours/tab-border-selected",
            "text": "Tab border for selected tabs"
        },
        "$:/language/Docs/PaletteColours/tab-border": {
            "title": "$:/language/Docs/PaletteColours/tab-border",
            "text": "Tab border"
        },
        "$:/language/Docs/PaletteColours/tab-divider": {
            "title": "$:/language/Docs/PaletteColours/tab-divider",
            "text": "Tab divider"
        },
        "$:/language/Docs/PaletteColours/tab-foreground-selected": {
            "title": "$:/language/Docs/PaletteColours/tab-foreground-selected",
            "text": "Tab foreground for selected tabs"
        },
        "$:/language/Docs/PaletteColours/tab-foreground": {
            "title": "$:/language/Docs/PaletteColours/tab-foreground",
            "text": "Tab foreground"
        },
        "$:/language/Docs/PaletteColours/table-border": {
            "title": "$:/language/Docs/PaletteColours/table-border",
            "text": "Table border"
        },
        "$:/language/Docs/PaletteColours/table-footer-background": {
            "title": "$:/language/Docs/PaletteColours/table-footer-background",
            "text": "Table footer background"
        },
        "$:/language/Docs/PaletteColours/table-header-background": {
            "title": "$:/language/Docs/PaletteColours/table-header-background",
            "text": "Table header background"
        },
        "$:/language/Docs/PaletteColours/tag-background": {
            "title": "$:/language/Docs/PaletteColours/tag-background",
            "text": "Tag background"
        },
        "$:/language/Docs/PaletteColours/tag-foreground": {
            "title": "$:/language/Docs/PaletteColours/tag-foreground",
            "text": "Tag foreground"
        },
        "$:/language/Docs/PaletteColours/tiddler-background": {
            "title": "$:/language/Docs/PaletteColours/tiddler-background",
            "text": "Tiddler background"
        },
        "$:/language/Docs/PaletteColours/tiddler-border": {
            "title": "$:/language/Docs/PaletteColours/tiddler-border",
            "text": "Tiddler border"
        },
        "$:/language/Docs/PaletteColours/tiddler-controls-foreground-hover": {
            "title": "$:/language/Docs/PaletteColours/tiddler-controls-foreground-hover",
            "text": "Tiddler controls foreground hover"
        },
        "$:/language/Docs/PaletteColours/tiddler-controls-foreground-selected": {
            "title": "$:/language/Docs/PaletteColours/tiddler-controls-foreground-selected",
            "text": "Tiddler controls foreground for selected controls"
        },
        "$:/language/Docs/PaletteColours/tiddler-controls-foreground": {
            "title": "$:/language/Docs/PaletteColours/tiddler-controls-foreground",
            "text": "Tiddler controls foreground"
        },
        "$:/language/Docs/PaletteColours/tiddler-editor-background": {
            "title": "$:/language/Docs/PaletteColours/tiddler-editor-background",
            "text": "Tiddler editor background"
        },
        "$:/language/Docs/PaletteColours/tiddler-editor-border-image": {
            "title": "$:/language/Docs/PaletteColours/tiddler-editor-border-image",
            "text": "Tiddler editor border image"
        },
        "$:/language/Docs/PaletteColours/tiddler-editor-border": {
            "title": "$:/language/Docs/PaletteColours/tiddler-editor-border",
            "text": "Tiddler editor border"
        },
        "$:/language/Docs/PaletteColours/tiddler-editor-fields-even": {
            "title": "$:/language/Docs/PaletteColours/tiddler-editor-fields-even",
            "text": "Tiddler editor background for even fields"
        },
        "$:/language/Docs/PaletteColours/tiddler-editor-fields-odd": {
            "title": "$:/language/Docs/PaletteColours/tiddler-editor-fields-odd",
            "text": "Tiddler editor background for odd fields"
        },
        "$:/language/Docs/PaletteColours/tiddler-info-background": {
            "title": "$:/language/Docs/PaletteColours/tiddler-info-background",
            "text": "Tiddler info panel background"
        },
        "$:/language/Docs/PaletteColours/tiddler-info-border": {
            "title": "$:/language/Docs/PaletteColours/tiddler-info-border",
            "text": "Tiddler info panel border"
        },
        "$:/language/Docs/PaletteColours/tiddler-info-tab-background": {
            "title": "$:/language/Docs/PaletteColours/tiddler-info-tab-background",
            "text": "Tiddler info panel tab background"
        },
        "$:/language/Docs/PaletteColours/tiddler-link-background": {
            "title": "$:/language/Docs/PaletteColours/tiddler-link-background",
            "text": "Tiddler link background"
        },
        "$:/language/Docs/PaletteColours/tiddler-link-foreground": {
            "title": "$:/language/Docs/PaletteColours/tiddler-link-foreground",
            "text": "Tiddler link foreground"
        },
        "$:/language/Docs/PaletteColours/tiddler-subtitle-foreground": {
            "title": "$:/language/Docs/PaletteColours/tiddler-subtitle-foreground",
            "text": "Tiddler subtitle foreground"
        },
        "$:/language/Docs/PaletteColours/tiddler-title-foreground": {
            "title": "$:/language/Docs/PaletteColours/tiddler-title-foreground",
            "text": "Tiddler title foreground"
        },
        "$:/language/Docs/PaletteColours/toolbar-new-button": {
            "title": "$:/language/Docs/PaletteColours/toolbar-new-button",
            "text": "Toolbar 'new tiddler' button foreground"
        },
        "$:/language/Docs/PaletteColours/toolbar-options-button": {
            "title": "$:/language/Docs/PaletteColours/toolbar-options-button",
            "text": "Toolbar 'options' button foreground"
        },
        "$:/language/Docs/PaletteColours/toolbar-save-button": {
            "title": "$:/language/Docs/PaletteColours/toolbar-save-button",
            "text": "Toolbar 'save' button foreground"
        },
        "$:/language/Docs/PaletteColours/toolbar-info-button": {
            "title": "$:/language/Docs/PaletteColours/toolbar-info-button",
            "text": "Toolbar 'info' button foreground"
        },
        "$:/language/Docs/PaletteColours/toolbar-edit-button": {
            "title": "$:/language/Docs/PaletteColours/toolbar-edit-button",
            "text": "Toolbar 'edit' button foreground"
        },
        "$:/language/Docs/PaletteColours/toolbar-close-button": {
            "title": "$:/language/Docs/PaletteColours/toolbar-close-button",
            "text": "Toolbar 'close' button foreground"
        },
        "$:/language/Docs/PaletteColours/toolbar-delete-button": {
            "title": "$:/language/Docs/PaletteColours/toolbar-delete-button",
            "text": "Toolbar 'delete' button foreground"
        },
        "$:/language/Docs/PaletteColours/toolbar-cancel-button": {
            "title": "$:/language/Docs/PaletteColours/toolbar-cancel-button",
            "text": "Toolbar 'cancel' button foreground"
        },
        "$:/language/Docs/PaletteColours/toolbar-done-button": {
            "title": "$:/language/Docs/PaletteColours/toolbar-done-button",
            "text": "Toolbar 'done' button foreground"
        },
        "$:/language/Docs/PaletteColours/untagged-background": {
            "title": "$:/language/Docs/PaletteColours/untagged-background",
            "text": "Untagged pill background"
        },
        "$:/language/Docs/PaletteColours/very-muted-foreground": {
            "title": "$:/language/Docs/PaletteColours/very-muted-foreground",
            "text": "Very muted foreground"
        },
        "$:/language/EditTemplate/Body/External/Hint": {
            "title": "$:/language/EditTemplate/Body/External/Hint",
            "text": "This is an external tiddler stored outside of the main TiddlyWiki file. You can edit the tags and fields but cannot directly edit the content itself"
        },
        "$:/language/EditTemplate/Body/Placeholder": {
            "title": "$:/language/EditTemplate/Body/Placeholder",
            "text": "Type the text for this tiddler"
        },
        "$:/language/EditTemplate/Body/Preview/Type/Output": {
            "title": "$:/language/EditTemplate/Body/Preview/Type/Output",
            "text": "output"
        },
        "$:/language/EditTemplate/Field/Remove/Caption": {
            "title": "$:/language/EditTemplate/Field/Remove/Caption",
            "text": "remove field"
        },
        "$:/language/EditTemplate/Field/Remove/Hint": {
            "title": "$:/language/EditTemplate/Field/Remove/Hint",
            "text": "Remove field"
        },
        "$:/language/EditTemplate/Fields/Add/Button": {
            "title": "$:/language/EditTemplate/Fields/Add/Button",
            "text": "add"
        },
        "$:/language/EditTemplate/Fields/Add/Name/Placeholder": {
            "title": "$:/language/EditTemplate/Fields/Add/Name/Placeholder",
            "text": "field name"
        },
        "$:/language/EditTemplate/Fields/Add/Prompt": {
            "title": "$:/language/EditTemplate/Fields/Add/Prompt",
            "text": "Add a new field:"
        },
        "$:/language/EditTemplate/Fields/Add/Value/Placeholder": {
            "title": "$:/language/EditTemplate/Fields/Add/Value/Placeholder",
            "text": "field value"
        },
        "$:/language/EditTemplate/Fields/Add/Dropdown/System": {
            "title": "$:/language/EditTemplate/Fields/Add/Dropdown/System",
            "text": "System fields"
        },
        "$:/language/EditTemplate/Fields/Add/Dropdown/User": {
            "title": "$:/language/EditTemplate/Fields/Add/Dropdown/User",
            "text": "User fields"
        },
        "$:/language/EditTemplate/Shadow/Warning": {
            "title": "$:/language/EditTemplate/Shadow/Warning",
            "text": "This is a shadow tiddler. Any changes you make will override the default version from the plugin <<pluginLink>>"
        },
        "$:/language/EditTemplate/Shadow/OverriddenWarning": {
            "title": "$:/language/EditTemplate/Shadow/OverriddenWarning",
            "text": "This is a modified shadow tiddler. You can revert to the default version in the plugin <<pluginLink>> by deleting this tiddler"
        },
        "$:/language/EditTemplate/Tags/Add/Button": {
            "title": "$:/language/EditTemplate/Tags/Add/Button",
            "text": "add"
        },
        "$:/language/EditTemplate/Tags/Add/Placeholder": {
            "title": "$:/language/EditTemplate/Tags/Add/Placeholder",
            "text": "tag name"
        },
        "$:/language/EditTemplate/Tags/Dropdown/Caption": {
            "title": "$:/language/EditTemplate/Tags/Dropdown/Caption",
            "text": "tag list"
        },
        "$:/language/EditTemplate/Tags/Dropdown/Hint": {
            "title": "$:/language/EditTemplate/Tags/Dropdown/Hint",
            "text": "Show tag list"
        },
        "$:/language/EditTemplate/Title/BadCharacterWarning": {
            "title": "$:/language/EditTemplate/Title/BadCharacterWarning",
            "text": "Warning: avoid using any of the characters <<bad-chars>> in tiddler titles"
        },
        "$:/language/EditTemplate/Title/Exists/Prompt": {
            "title": "$:/language/EditTemplate/Title/Exists/Prompt",
            "text": "Target tiddler already exists"
        },
        "$:/language/EditTemplate/Title/Relink/Prompt": {
            "title": "$:/language/EditTemplate/Title/Relink/Prompt",
            "text": "Update ''<$text text=<<fromTitle>>/>'' to ''<$text text=<<toTitle>>/>'' in the //tags// and //list// fields of other tiddlers"
        },
        "$:/language/EditTemplate/Type/Dropdown/Caption": {
            "title": "$:/language/EditTemplate/Type/Dropdown/Caption",
            "text": "content type list"
        },
        "$:/language/EditTemplate/Type/Dropdown/Hint": {
            "title": "$:/language/EditTemplate/Type/Dropdown/Hint",
            "text": "Show content type list"
        },
        "$:/language/EditTemplate/Type/Delete/Caption": {
            "title": "$:/language/EditTemplate/Type/Delete/Caption",
            "text": "delete content type"
        },
        "$:/language/EditTemplate/Type/Delete/Hint": {
            "title": "$:/language/EditTemplate/Type/Delete/Hint",
            "text": "Delete content type"
        },
        "$:/language/EditTemplate/Type/Placeholder": {
            "title": "$:/language/EditTemplate/Type/Placeholder",
            "text": "content type"
        },
        "$:/language/EditTemplate/Type/Prompt": {
            "title": "$:/language/EditTemplate/Type/Prompt",
            "text": "Type:"
        },
        "$:/language/Exporters/StaticRiver": {
            "title": "$:/language/Exporters/StaticRiver",
            "text": "Static HTML"
        },
        "$:/language/Exporters/JsonFile": {
            "title": "$:/language/Exporters/JsonFile",
            "text": "JSON file"
        },
        "$:/language/Exporters/CsvFile": {
            "title": "$:/language/Exporters/CsvFile",
            "text": "CSV file"
        },
        "$:/language/Exporters/TidFile": {
            "title": "$:/language/Exporters/TidFile",
            "text": "\".tid\" file"
        },
        "$:/language/Docs/Fields/_canonical_uri": {
            "title": "$:/language/Docs/Fields/_canonical_uri",
            "text": "The full URI of an external image tiddler"
        },
        "$:/language/Docs/Fields/bag": {
            "title": "$:/language/Docs/Fields/bag",
            "text": "The name of the bag from which a tiddler came"
        },
        "$:/language/Docs/Fields/caption": {
            "title": "$:/language/Docs/Fields/caption",
            "text": "The text to be displayed on a tab or button"
        },
        "$:/language/Docs/Fields/color": {
            "title": "$:/language/Docs/Fields/color",
            "text": "The CSS color value associated with a tiddler"
        },
        "$:/language/Docs/Fields/component": {
            "title": "$:/language/Docs/Fields/component",
            "text": "The name of the component responsible for an [[alert tiddler|AlertMechanism]]"
        },
        "$:/language/Docs/Fields/current-tiddler": {
            "title": "$:/language/Docs/Fields/current-tiddler",
            "text": "Used to cache the top tiddler in a [[history list|HistoryMechanism]]"
        },
        "$:/language/Docs/Fields/created": {
            "title": "$:/language/Docs/Fields/created",
            "text": "The date a tiddler was created"
        },
        "$:/language/Docs/Fields/creator": {
            "title": "$:/language/Docs/Fields/creator",
            "text": "The name of the person who created a tiddler"
        },
        "$:/language/Docs/Fields/dependents": {
            "title": "$:/language/Docs/Fields/dependents",
            "text": "For a plugin, lists the dependent plugin titles"
        },
        "$:/language/Docs/Fields/description": {
            "title": "$:/language/Docs/Fields/description",
            "text": "The descriptive text for a plugin, or a modal dialogue"
        },
        "$:/language/Docs/Fields/draft.of": {
            "title": "$:/language/Docs/Fields/draft.of",
            "text": "For draft tiddlers, contains the title of the tiddler of which this is a draft"
        },
        "$:/language/Docs/Fields/draft.title": {
            "title": "$:/language/Docs/Fields/draft.title",
            "text": "For draft tiddlers, contains the proposed new title of the tiddler"
        },
        "$:/language/Docs/Fields/footer": {
            "title": "$:/language/Docs/Fields/footer",
            "text": "The footer text for a wizard"
        },
        "$:/language/Docs/Fields/hack-to-give-us-something-to-compare-against": {
            "title": "$:/language/Docs/Fields/hack-to-give-us-something-to-compare-against",
            "text": "A temporary storage field used in [[$:/core/templates/static.content]]"
        },
        "$:/language/Docs/Fields/icon": {
            "title": "$:/language/Docs/Fields/icon",
            "text": "The title of the tiddler containing the icon associated with a tiddler"
        },
        "$:/language/Docs/Fields/library": {
            "title": "$:/language/Docs/Fields/library",
            "text": "If set to \"yes\" indicates that a tiddler should be saved as a JavaScript library"
        },
        "$:/language/Docs/Fields/list": {
            "title": "$:/language/Docs/Fields/list",
            "text": "An ordered list of tiddler titles associated with a tiddler"
        },
        "$:/language/Docs/Fields/list-before": {
            "title": "$:/language/Docs/Fields/list-before",
            "text": "If set, the title of a tiddler before which this tiddler should be added to the ordered list of tiddler titles, or at the start of the list if this field is present but empty"
        },
        "$:/language/Docs/Fields/list-after": {
            "title": "$:/language/Docs/Fields/list-after",
            "text": "If set, the title of the tiddler after which this tiddler should be added to the ordered list of tiddler titles"
        },
        "$:/language/Docs/Fields/modified": {
            "title": "$:/language/Docs/Fields/modified",
            "text": "The date and time at which a tiddler was last modified"
        },
        "$:/language/Docs/Fields/modifier": {
            "title": "$:/language/Docs/Fields/modifier",
            "text": "The tiddler title associated with the person who last modified a tiddler"
        },
        "$:/language/Docs/Fields/name": {
            "title": "$:/language/Docs/Fields/name",
            "text": "The human readable name associated with a plugin tiddler"
        },
        "$:/language/Docs/Fields/plugin-priority": {
            "title": "$:/language/Docs/Fields/plugin-priority",
            "text": "A numerical value indicating the priority of a plugin tiddler"
        },
        "$:/language/Docs/Fields/plugin-type": {
            "title": "$:/language/Docs/Fields/plugin-type",
            "text": "The type of plugin in a plugin tiddler"
        },
        "$:/language/Docs/Fields/revision": {
            "title": "$:/language/Docs/Fields/revision",
            "text": "The revision of the tiddler held at the server"
        },
        "$:/language/Docs/Fields/released": {
            "title": "$:/language/Docs/Fields/released",
            "text": "Date of a TiddlyWiki release"
        },
        "$:/language/Docs/Fields/source": {
            "title": "$:/language/Docs/Fields/source",
            "text": "The source URL associated with a tiddler"
        },
        "$:/language/Docs/Fields/subtitle": {
            "title": "$:/language/Docs/Fields/subtitle",
            "text": "The subtitle text for a wizard"
        },
        "$:/language/Docs/Fields/tags": {
            "title": "$:/language/Docs/Fields/tags",
            "text": "A list of tags associated with a tiddler"
        },
        "$:/language/Docs/Fields/text": {
            "title": "$:/language/Docs/Fields/text",
            "text": "The body text of a tiddler"
        },
        "$:/language/Docs/Fields/title": {
            "title": "$:/language/Docs/Fields/title",
            "text": "The unique name of a tiddler"
        },
        "$:/language/Docs/Fields/type": {
            "title": "$:/language/Docs/Fields/type",
            "text": "The content type of a tiddler"
        },
        "$:/language/Docs/Fields/version": {
            "title": "$:/language/Docs/Fields/version",
            "text": "Version information for a plugin"
        },
        "$:/language/Filters/AllTiddlers": {
            "title": "$:/language/Filters/AllTiddlers",
            "text": "All tiddlers except system tiddlers"
        },
        "$:/language/Filters/RecentSystemTiddlers": {
            "title": "$:/language/Filters/RecentSystemTiddlers",
            "text": "Recently modified tiddlers, including system tiddlers"
        },
        "$:/language/Filters/RecentTiddlers": {
            "title": "$:/language/Filters/RecentTiddlers",
            "text": "Recently modified tiddlers"
        },
        "$:/language/Filters/AllTags": {
            "title": "$:/language/Filters/AllTags",
            "text": "All tags except system tags"
        },
        "$:/language/Filters/Missing": {
            "title": "$:/language/Filters/Missing",
            "text": "Missing tiddlers"
        },
        "$:/language/Filters/Drafts": {
            "title": "$:/language/Filters/Drafts",
            "text": "Draft tiddlers"
        },
        "$:/language/Filters/Orphans": {
            "title": "$:/language/Filters/Orphans",
            "text": "Orphan tiddlers"
        },
        "$:/language/Filters/SystemTiddlers": {
            "title": "$:/language/Filters/SystemTiddlers",
            "text": "System tiddlers"
        },
        "$:/language/Filters/ShadowTiddlers": {
            "title": "$:/language/Filters/ShadowTiddlers",
            "text": "Shadow tiddlers"
        },
        "$:/language/Filters/OverriddenShadowTiddlers": {
            "title": "$:/language/Filters/OverriddenShadowTiddlers",
            "text": "Overridden shadow tiddlers"
        },
        "$:/language/Filters/SystemTags": {
            "title": "$:/language/Filters/SystemTags",
            "text": "System tags"
        },
        "$:/language/Filters/StoryList": {
            "title": "$:/language/Filters/StoryList",
            "text": "Tiddlers in the story river, excluding <$text text=\"$:/AdvancedSearch\"/>"
        },
        "$:/language/Filters/TypedTiddlers": {
            "title": "$:/language/Filters/TypedTiddlers",
            "text": "Non wiki-text tiddlers"
        },
        "GettingStarted": {
            "title": "GettingStarted",
            "text": "\\define lingo-base() $:/language/ControlPanel/Basics/\nWelcome to ~TiddlyWiki and the ~TiddlyWiki community\n\nBefore you start storing important information in ~TiddlyWiki it is important to make sure that you can reliably save changes. See http://tiddlywiki.com/#GettingStarted for details\n\n!! Set up this ~TiddlyWiki\n\n<div class=\"tc-control-panel\">\n\n|<$link to=\"$:/SiteTitle\"><<lingo Title/Prompt>></$link> |<$edit-text tiddler=\"$:/SiteTitle\" default=\"\" tag=\"input\"/> |\n|<$link to=\"$:/SiteSubtitle\"><<lingo Subtitle/Prompt>></$link> |<$edit-text tiddler=\"$:/SiteSubtitle\" default=\"\" tag=\"input\"/> |\n|<$link to=\"$:/DefaultTiddlers\"><<lingo DefaultTiddlers/Prompt>></$link> |<<lingo DefaultTiddlers/TopHint>><br> <$edit tag=\"textarea\" tiddler=\"$:/DefaultTiddlers\"/><br>//<<lingo DefaultTiddlers/BottomHint>>// |\n</div>\n\nSee the [[control panel|$:/ControlPanel]] for more options.\n"
        },
        "$:/language/Help/build": {
            "title": "$:/language/Help/build",
            "description": "Automatically run configured commands",
            "text": "Build the specified build targets for the current wiki. If no build targets are specified then all available targets will be built.\n\n```\n--build <target> [<target> ...]\n```\n\nBuild targets are defined in the `tiddlywiki.info` file of a wiki folder.\n\n"
        },
        "$:/language/Help/clearpassword": {
            "title": "$:/language/Help/clearpassword",
            "description": "Clear a password for subsequent crypto operations",
            "text": "Clear the password for subsequent crypto operations\n\n```\n--clearpassword\n```\n"
        },
        "$:/language/Help/default": {
            "title": "$:/language/Help/default",
            "text": "\\define commandTitle()\n$:/language/Help/$(command)$\n\\end\n```\nusage: tiddlywiki [<wikifolder>] [--<command> [<args>...]...]\n```\n\nAvailable commands:\n\n<ul>\n<$list filter=\"[commands[]sort[title]]\" variable=\"command\">\n<li><$link to=<<commandTitle>>><$macrocall $name=\"command\" $type=\"text/plain\" $output=\"text/plain\"/></$link>: <$transclude tiddler=<<commandTitle>> field=\"description\"/></li>\n</$list>\n</ul>\n\nTo get detailed help on a command:\n\n```\ntiddlywiki --help <command>\n```\n"
        },
        "$:/language/Help/editions": {
            "title": "$:/language/Help/editions",
            "description": "Lists the available editions of TiddlyWiki",
            "text": "Lists the names and descriptions of the available editions. You can create a new wiki of a specified edition with the `--init` command.\n\n```\n--editions\n```\n"
        },
        "$:/language/Help/fetch": {
            "title": "$:/language/Help/fetch",
            "description": "Fetch tiddlers from wiki by URL",
            "text": "Fetch one or more files over HTTP/HTTPS, and import the tiddlers matching a filter, optionally transforming the incoming titles.\n\n```\n--fetch file <url> <import-filter> <transform-filter>\n--fetch files <url-filter> <import-filter> <transform-filter>\n```\n\nWith the \"file\" variant only a single file is fetched and the first parameter is the URL of the file to read.\n\nWith the \"files\" variant, multiple files are fetched and the first parameter is a filter yielding a list of URLs of the files to read. For example, given a set of tiddlers tagged \"remote-server\" that have a field \"url\" the filter `[tag[remote-server]get[url]]` will retrieve all the available URLs.\n\nThe `<import-filter>` parameter specifies a filter determining which tiddlers are imported. It defaults to `[all[tiddlers]]` if not provided.\n\nThe `<transform-filter>` parameter specifies an optional filter that transforms the titles of the imported tiddlers. For example, `[addprefix[$:/myimports/]]` would add the prefix `$:/myimports/` to each title.\n\nPreceding the `--fetch` command with `--verbose` will output progress information during the import.\n\nNote that TiddlyWiki will not fetch an older version of an already loaded plugin.\n\nThe following example retrieves all the non-system tiddlers from http://tiddlywiki.com and saves them to a JSON file:\n\n```\ntiddlywiki --verbose --fetch file \"http://tiddlywiki.com/\" \"[!is[system]]\" \"\" --rendertiddler \"$:/core/templates/exporters/JsonFile\" output.json text/plain \"\" exportFilter \"[!is[system]]\"\n```\n\n"
        },
        "$:/language/Help/help": {
            "title": "$:/language/Help/help",
            "description": "Display help for TiddlyWiki commands",
            "text": "Displays help text for a command:\n\n```\n--help [<command>]\n```\n\nIf the command name is omitted then a list of available commands is displayed.\n"
        },
        "$:/language/Help/init": {
            "title": "$:/language/Help/init",
            "description": "Initialise a new wiki folder",
            "text": "Initialise an empty [[WikiFolder|WikiFolders]] with a copy of the specified edition.\n\n```\n--init <edition> [<edition> ...]\n```\n\nFor example:\n\n```\ntiddlywiki ./MyWikiFolder --init empty\n```\n\nNote:\n\n* The wiki folder directory will be created if necessary\n* The \"edition\" defaults to ''empty''\n* The init command will fail if the wiki folder is not empty\n* The init command removes any `includeWikis` definitions in the edition's `tiddlywiki.info` file\n* When multiple editions are specified, editions initialised later will overwrite any files shared with earlier editions (so, the final `tiddlywiki.info` file will be copied from the last edition)\n* `--editions` returns a list of available editions\n"
        },
        "$:/language/Help/load": {
            "title": "$:/language/Help/load",
            "description": "Load tiddlers from a file",
            "text": "Load tiddlers from 2.x.x TiddlyWiki files (`.html`), `.tiddler`, `.tid`, `.json` or other files\n\n```\n--load <filepath>\n```\n\nTo load tiddlers from an encrypted TiddlyWiki file you should first specify the password with the PasswordCommand. For example:\n\n```\ntiddlywiki ./MyWiki --password pa55w0rd --load my_encrypted_wiki.html\n```\n\nNote that TiddlyWiki will not load an older version of an already loaded plugin.\n"
        },
        "$:/language/Help/makelibrary": {
            "title": "$:/language/Help/makelibrary",
            "description": "Construct library plugin required by upgrade process",
            "text": "Constructs the `$:/UpgradeLibrary` tiddler for the upgrade process.\n\nThe upgrade library is formatted as an ordinary plugin tiddler with the plugin type `library`. It contains a copy of each of the plugins, themes and language packs available within the TiddlyWiki5 repository.\n\nThis command is intended for internal use; it is only relevant to users constructing a custom upgrade procedure.\n\n```\n--makelibrary <title>\n```\n\nThe title argument defaults to `$:/UpgradeLibrary`.\n"
        },
        "$:/language/Help/notfound": {
            "title": "$:/language/Help/notfound",
            "text": "No such help item"
        },
        "$:/language/Help/output": {
            "title": "$:/language/Help/output",
            "description": "Set the base output directory for subsequent commands",
            "text": "Sets the base output directory for subsequent commands. The default output directory is the `output` subdirectory of the edition directory.\n\n```\n--output <pathname>\n```\n\nIf the specified pathname is relative then it is resolved relative to the current working directory. For example `--output .` sets the output directory to the current working directory.\n\n"
        },
        "$:/language/Help/password": {
            "title": "$:/language/Help/password",
            "description": "Set a password for subsequent crypto operations",
            "text": "Set a password for subsequent crypto operations\n\n```\n--password <password>\n```\n\n''Note'': This should not be used for serving TiddlyWiki with password protection. Instead, see the password option under the [[ServerCommand]].\n"
        },
        "$:/language/Help/rendertiddler": {
            "title": "$:/language/Help/rendertiddler",
            "description": "Render an individual tiddler as a specified ContentType",
            "text": "Render an individual tiddler as a specified ContentType, defaulting to `text/html` and save it to the specified filename.\n\nOptionally the title of a template tiddler can be specified, in which case the template tiddler is rendered with the \"currentTiddler\" variable set to the tiddler that is being rendered (the first parameter value).\n\nA name and value for an additional variable may optionally also be specified.\n\n```\n--rendertiddler <title> <filename> [<type>] [<template>] [<name>] [<value>]\n```\n\nBy default, the filename is resolved relative to the `output` subdirectory of the edition directory. The `--output` command can be used to direct output to a different directory.\n\nAny missing directories in the path to the filename are automatically created.\n\nFor example, the following command saves all tiddlers matching the filter `[tag[done]]` to a JSON file titled `output.json` by employing the core template `$:/core/templates/exporters/JsonFile`.\n\n```\n--rendertiddler \"$:/core/templates/exporters/JsonFile\" output.json text/plain \"\" exportFilter \"[tag[done]]\"\n```\n"
        },
        "$:/language/Help/rendertiddlers": {
            "title": "$:/language/Help/rendertiddlers",
            "description": "Render tiddlers matching a filter to a specified ContentType",
            "text": "Render a set of tiddlers matching a filter to separate files of a specified ContentType (defaults to `text/html`) and extension (defaults to `.html`).\n\n```\n--rendertiddlers <filter> <template> <pathname> [<type>] [<extension>] [\"noclean\"]\n```\n\nFor example:\n\n```\n--rendertiddlers [!is[system]] $:/core/templates/static.tiddler.html ./static text/plain\n```\n\nBy default, the pathname is resolved relative to the `output` subdirectory of the edition directory. The `--output` command can be used to direct output to a different directory.\n\nAny files in the target directory are deleted unless the ''noclean'' flag is specified. The target directory is recursively created if it is missing.\n"
        },
        "$:/language/Help/savetiddler": {
            "title": "$:/language/Help/savetiddler",
            "description": "Saves a raw tiddler to a file",
            "text": "Saves an individual tiddler in its raw text or binary format to the specified filename.\n\n```\n--savetiddler <title> <filename>\n```\n\nBy default, the filename is resolved relative to the `output` subdirectory of the edition directory. The `--output` command can be used to direct output to a different directory.\n\nAny missing directories in the path to the filename are automatically created.\n"
        },
        "$:/language/Help/savetiddlers": {
            "title": "$:/language/Help/savetiddlers",
            "description": "Saves a group of raw tiddlers to a directory",
            "text": "Saves a group of tiddlers in their raw text or binary format to the specified directory.\n\n```\n--savetiddlers <filter> <pathname> [\"noclean\"]\n```\n\nBy default, the pathname is resolved relative to the `output` subdirectory of the edition directory. The `--output` command can be used to direct output to a different directory.\n\nThe output directory is cleared of existing files before saving the specified files. The deletion can be disabled by specifying the ''noclean'' flag.\n\nAny missing directories in the pathname are automatically created.\n"
        },
        "$:/language/Help/server": {
            "title": "$:/language/Help/server",
            "description": "Provides an HTTP server interface to TiddlyWiki",
            "text": "The server built in to TiddlyWiki5 is very simple. Although compatible with TiddlyWeb it doesn't support many of the features needed for robust Internet-facing usage.\n\nAt the root, it serves a rendering of a specified tiddler. Away from the root, it serves individual tiddlers encoded in JSON, and supports the basic HTTP operations for `GET`, `PUT` and `DELETE`.\n\n```\n--server <port> <roottiddler> <rendertype> <servetype> <username> <password> <host> <pathprefix>\n```\n\nThe parameters are:\n\n* ''port'' - port number to serve from (defaults to \"8080\")\n* ''roottiddler'' - the tiddler to serve at the root (defaults to \"$:/core/save/all\")\n* ''rendertype'' - the content type to which the root tiddler should be rendered (defaults to \"text/plain\")\n* ''servetype'' - the content type with which the root tiddler should be served (defaults to \"text/html\")\n* ''username'' - the default username for signing edits\n* ''password'' - optional password for basic authentication\n* ''host'' - optional hostname to serve from (defaults to \"127.0.0.1\" aka \"localhost\")\n* ''pathprefix'' - optional prefix for paths\n\nIf the password parameter is specified then the browser will prompt the user for the username and password. Note that the password is transmitted in plain text so this implementation isn't suitable for general use.\n\nFor example:\n\n```\n--server 8080 $:/core/save/all text/plain text/html MyUserName passw0rd\n```\n\nThe username and password can be specified as empty strings if you need to set the hostname or pathprefix and don't want to require a password:\n\n```\n--server 8080 $:/core/save/all text/plain text/html \"\" \"\" 192.168.0.245\n```\n\nTo run multiple TiddlyWiki servers at the same time you'll need to put each one on a different port.\n"
        },
        "$:/language/Help/setfield": {
            "title": "$:/language/Help/setfield",
            "description": "Prepares external tiddlers for use",
            "text": "//Note that this command is experimental and may change or be replaced before being finalised//\n\nSets the specified field of a group of tiddlers to the result of wikifying a template tiddler with the `currentTiddler` variable set to the tiddler.\n\n```\n--setfield <filter> <fieldname> <templatetitle> <rendertype>\n```\n\nThe parameters are:\n\n* ''filter'' - filter identifying the tiddlers to be affected\n* ''fieldname'' - the field to modify (defaults to \"text\")\n* ''templatetitle'' - the tiddler to wikify into the specified field. If blank or missing then the specified field is deleted\n* ''rendertype'' - the text type to render (defaults to \"text/plain\"; \"text/html\" can be used to include HTML tags)\n"
        },
        "$:/language/Help/unpackplugin": {
            "title": "$:/language/Help/unpackplugin",
            "description": "Unpack the payload tiddlers from a plugin",
            "text": "Extract the payload tiddlers from a plugin, creating them as ordinary tiddlers:\n\n```\n--unpackplugin <title>\n```\n"
        },
        "$:/language/Help/verbose": {
            "title": "$:/language/Help/verbose",
            "description": "Triggers verbose output mode",
            "text": "Triggers verbose output, useful for debugging\n\n```\n--verbose\n```\n"
        },
        "$:/language/Help/version": {
            "title": "$:/language/Help/version",
            "description": "Displays the version number of TiddlyWiki",
            "text": "Displays the version number of TiddlyWiki.\n\n```\n--version\n```\n"
        },
        "$:/language/Import/Imported/Hint": {
            "title": "$:/language/Import/Imported/Hint",
            "text": "The following tiddlers were imported:"
        },
        "$:/language/Import/Listing/Cancel/Caption": {
            "title": "$:/language/Import/Listing/Cancel/Caption",
            "text": "Cancel"
        },
        "$:/language/Import/Listing/Hint": {
            "title": "$:/language/Import/Listing/Hint",
            "text": "These tiddlers are ready to import:"
        },
        "$:/language/Import/Listing/Import/Caption": {
            "title": "$:/language/Import/Listing/Import/Caption",
            "text": "Import"
        },
        "$:/language/Import/Listing/Select/Caption": {
            "title": "$:/language/Import/Listing/Select/Caption",
            "text": "Select"
        },
        "$:/language/Import/Listing/Status/Caption": {
            "title": "$:/language/Import/Listing/Status/Caption",
            "text": "Status"
        },
        "$:/language/Import/Listing/Title/Caption": {
            "title": "$:/language/Import/Listing/Title/Caption",
            "text": "Title"
        },
        "$:/language/Import/Upgrader/Plugins/Suppressed/Incompatible": {
            "title": "$:/language/Import/Upgrader/Plugins/Suppressed/Incompatible",
            "text": "Blocked incompatible or obsolete plugin"
        },
        "$:/language/Import/Upgrader/Plugins/Suppressed/Version": {
            "title": "$:/language/Import/Upgrader/Plugins/Suppressed/Version",
            "text": "Blocked plugin (due to incoming <<incoming>> being older than existing <<existing>>)"
        },
        "$:/language/Import/Upgrader/Plugins/Upgraded": {
            "title": "$:/language/Import/Upgrader/Plugins/Upgraded",
            "text": "Upgraded plugin from <<incoming>> to <<upgraded>>"
        },
        "$:/language/Import/Upgrader/State/Suppressed": {
            "title": "$:/language/Import/Upgrader/State/Suppressed",
            "text": "Blocked temporary state tiddler"
        },
        "$:/language/Import/Upgrader/System/Suppressed": {
            "title": "$:/language/Import/Upgrader/System/Suppressed",
            "text": "Blocked system tiddler"
        },
        "$:/language/Import/Upgrader/ThemeTweaks/Created": {
            "title": "$:/language/Import/Upgrader/ThemeTweaks/Created",
            "text": "Migrated theme tweak from <$text text=<<from>>/>"
        },
        "$:/language/AboveStory/ClassicPlugin/Warning": {
            "title": "$:/language/AboveStory/ClassicPlugin/Warning",
            "text": "It looks like you are trying to load a plugin designed for ~TiddlyWiki Classic. Please note that [[these plugins do not work with TiddlyWiki version 5.x.x|http://tiddlywiki.com/#TiddlyWikiClassic]]. ~TiddlyWiki Classic plugins detected:"
        },
        "$:/language/BinaryWarning/Prompt": {
            "title": "$:/language/BinaryWarning/Prompt",
            "text": "This tiddler contains binary data"
        },
        "$:/language/ClassicWarning/Hint": {
            "title": "$:/language/ClassicWarning/Hint",
            "text": "This tiddler is written in TiddlyWiki Classic wiki text format, which is not fully compatible with TiddlyWiki version 5. See http://tiddlywiki.com/static/Upgrading.html for more details."
        },
        "$:/language/ClassicWarning/Upgrade/Caption": {
            "title": "$:/language/ClassicWarning/Upgrade/Caption",
            "text": "upgrade"
        },
        "$:/language/CloseAll/Button": {
            "title": "$:/language/CloseAll/Button",
            "text": "close all"
        },
        "$:/language/ColourPicker/Recent": {
            "title": "$:/language/ColourPicker/Recent",
            "text": "Recent:"
        },
        "$:/language/ConfirmCancelTiddler": {
            "title": "$:/language/ConfirmCancelTiddler",
            "text": "Do you wish to discard changes to the tiddler \"<$text text=<<title>>/>\"?"
        },
        "$:/language/ConfirmDeleteTiddler": {
            "title": "$:/language/ConfirmDeleteTiddler",
            "text": "Do you wish to delete the tiddler \"<$text text=<<title>>/>\"?"
        },
        "$:/language/ConfirmOverwriteTiddler": {
            "title": "$:/language/ConfirmOverwriteTiddler",
            "text": "Do you wish to overwrite the tiddler \"<$text text=<<title>>/>\"?"
        },
        "$:/language/ConfirmEditShadowTiddler": {
            "title": "$:/language/ConfirmEditShadowTiddler",
            "text": "You are about to edit a ShadowTiddler. Any changes will override the default system making future upgrades non-trivial. Are you sure you want to edit \"<$text text=<<title>>/>\"?"
        },
        "$:/language/Count": {
            "title": "$:/language/Count",
            "text": "count"
        },
        "$:/language/DefaultNewTiddlerTitle": {
            "title": "$:/language/DefaultNewTiddlerTitle",
            "text": "New Tiddler"
        },
        "$:/language/DropMessage": {
            "title": "$:/language/DropMessage",
            "text": "Drop here (or use the 'Escape' key to cancel)"
        },
        "$:/language/Encryption/Cancel": {
            "title": "$:/language/Encryption/Cancel",
            "text": "Cancel"
        },
        "$:/language/Encryption/ConfirmClearPassword": {
            "title": "$:/language/Encryption/ConfirmClearPassword",
            "text": "Do you wish to clear the password? This will remove the encryption applied when saving this wiki"
        },
        "$:/language/Encryption/PromptSetPassword": {
            "title": "$:/language/Encryption/PromptSetPassword",
            "text": "Set a new password for this TiddlyWiki"
        },
        "$:/language/Encryption/Username": {
            "title": "$:/language/Encryption/Username",
            "text": "Username"
        },
        "$:/language/Encryption/Password": {
            "title": "$:/language/Encryption/Password",
            "text": "Password"
        },
        "$:/language/Encryption/RepeatPassword": {
            "title": "$:/language/Encryption/RepeatPassword",
            "text": "Repeat password"
        },
        "$:/language/Encryption/PasswordNoMatch": {
            "title": "$:/language/Encryption/PasswordNoMatch",
            "text": "Passwords do not match"
        },
        "$:/language/Encryption/SetPassword": {
            "title": "$:/language/Encryption/SetPassword",
            "text": "Set password"
        },
        "$:/language/Error/Caption": {
            "title": "$:/language/Error/Caption",
            "text": "Error"
        },
        "$:/language/Error/EditConflict": {
            "title": "$:/language/Error/EditConflict",
            "text": "File changed on server"
        },
        "$:/language/Error/Filter": {
            "title": "$:/language/Error/Filter",
            "text": "Filter error"
        },
        "$:/language/Error/FilterSyntax": {
            "title": "$:/language/Error/FilterSyntax",
            "text": "Syntax error in filter expression"
        },
        "$:/language/Error/IsFilterOperator": {
            "title": "$:/language/Error/IsFilterOperator",
            "text": "Filter Error: Unknown operand for the 'is' filter operator"
        },
        "$:/language/Error/LoadingPluginLibrary": {
            "title": "$:/language/Error/LoadingPluginLibrary",
            "text": "Error loading plugin library"
        },
        "$:/language/Error/RecursiveTransclusion": {
            "title": "$:/language/Error/RecursiveTransclusion",
            "text": "Recursive transclusion error in transclude widget"
        },
        "$:/language/Error/RetrievingSkinny": {
            "title": "$:/language/Error/RetrievingSkinny",
            "text": "Error retrieving skinny tiddler list"
        },
        "$:/language/Error/SavingToTWEdit": {
            "title": "$:/language/Error/SavingToTWEdit",
            "text": "Error saving to TWEdit"
        },
        "$:/language/Error/WhileSaving": {
            "title": "$:/language/Error/WhileSaving",
            "text": "Error while saving"
        },
        "$:/language/Error/XMLHttpRequest": {
            "title": "$:/language/Error/XMLHttpRequest",
            "text": "XMLHttpRequest error code"
        },
        "$:/language/InternalJavaScriptError/Title": {
            "title": "$:/language/InternalJavaScriptError/Title",
            "text": "Internal JavaScript Error"
        },
        "$:/language/InternalJavaScriptError/Hint": {
            "title": "$:/language/InternalJavaScriptError/Hint",
            "text": "Well, this is embarrassing. It is recommended that you restart TiddlyWiki by refreshing your browser"
        },
        "$:/language/InvalidFieldName": {
            "title": "$:/language/InvalidFieldName",
            "text": "Illegal characters in field name \"<$text text=<<fieldName>>/>\". Fields can only contain lowercase letters, digits and the characters underscore (`_`), hyphen (`-`) and period (`.`)"
        },
        "$:/language/LazyLoadingWarning": {
            "title": "$:/language/LazyLoadingWarning",
            "text": "<p>Loading external text from ''<$text text={{!!_canonical_uri}}/>''</p><p>If this message doesn't disappear you may be using a browser that doesn't support external text in this configuration. See http://tiddlywiki.com/#ExternalText</p>"
        },
        "$:/language/LoginToTiddlySpace": {
            "title": "$:/language/LoginToTiddlySpace",
            "text": "Login to TiddlySpace"
        },
        "$:/language/Manager/Controls/FilterByTag/None": {
            "title": "$:/language/Manager/Controls/FilterByTag/None",
            "text": "(none)"
        },
        "$:/language/Manager/Controls/FilterByTag/Prompt": {
            "title": "$:/language/Manager/Controls/FilterByTag/Prompt",
            "text": "Filter by tag:"
        },
        "$:/language/Manager/Controls/Order/Prompt": {
            "title": "$:/language/Manager/Controls/Order/Prompt",
            "text": "Reverse order"
        },
        "$:/language/Manager/Controls/Search/Placeholder": {
            "title": "$:/language/Manager/Controls/Search/Placeholder",
            "text": "Search"
        },
        "$:/language/Manager/Controls/Search/Prompt": {
            "title": "$:/language/Manager/Controls/Search/Prompt",
            "text": "Search:"
        },
        "$:/language/Manager/Controls/Show/Option/Tags": {
            "title": "$:/language/Manager/Controls/Show/Option/Tags",
            "text": "tags"
        },
        "$:/language/Manager/Controls/Show/Option/Tiddlers": {
            "title": "$:/language/Manager/Controls/Show/Option/Tiddlers",
            "text": "tiddlers"
        },
        "$:/language/Manager/Controls/Show/Prompt": {
            "title": "$:/language/Manager/Controls/Show/Prompt",
            "text": "Show:"
        },
        "$:/language/Manager/Controls/Sort/Prompt": {
            "title": "$:/language/Manager/Controls/Sort/Prompt",
            "text": "Sort by:"
        },
        "$:/language/Manager/Item/Colour": {
            "title": "$:/language/Manager/Item/Colour",
            "text": "Colour"
        },
        "$:/language/Manager/Item/Fields": {
            "title": "$:/language/Manager/Item/Fields",
            "text": "Fields"
        },
        "$:/language/Manager/Item/Icon/None": {
            "title": "$:/language/Manager/Item/Icon/None",
            "text": "(none)"
        },
        "$:/language/Manager/Item/Icon": {
            "title": "$:/language/Manager/Item/Icon",
            "text": "Icon"
        },
        "$:/language/Manager/Item/RawText": {
            "title": "$:/language/Manager/Item/RawText",
            "text": "Raw text"
        },
        "$:/language/Manager/Item/Tags": {
            "title": "$:/language/Manager/Item/Tags",
            "text": "Tags"
        },
        "$:/language/Manager/Item/Tools": {
            "title": "$:/language/Manager/Item/Tools",
            "text": "Tools"
        },
        "$:/language/Manager/Item/WikifiedText": {
            "title": "$:/language/Manager/Item/WikifiedText",
            "text": "Wikified text"
        },
        "$:/language/MissingTiddler/Hint": {
            "title": "$:/language/MissingTiddler/Hint",
            "text": "Missing tiddler \"<$text text=<<currentTiddler>>/>\" - click {{$:/core/images/edit-button}} to create"
        },
        "$:/language/No": {
            "title": "$:/language/No",
            "text": "No"
        },
        "$:/language/OfficialPluginLibrary": {
            "title": "$:/language/OfficialPluginLibrary",
            "text": "Official ~TiddlyWiki Plugin Library"
        },
        "$:/language/OfficialPluginLibrary/Hint": {
            "title": "$:/language/OfficialPluginLibrary/Hint",
            "text": "The official ~TiddlyWiki plugin library at tiddlywiki.com. Plugins, themes and language packs are maintained by the core team."
        },
        "$:/language/PluginReloadWarning": {
            "title": "$:/language/PluginReloadWarning",
            "text": "Please save {{$:/core/ui/Buttons/save-wiki}} and reload {{$:/core/ui/Buttons/refresh}} to allow changes to plugins to take effect"
        },
        "$:/language/RecentChanges/DateFormat": {
            "title": "$:/language/RecentChanges/DateFormat",
            "text": "DDth MMM YYYY"
        },
        "$:/language/SystemTiddler/Tooltip": {
            "title": "$:/language/SystemTiddler/Tooltip",
            "text": "This is a system tiddler"
        },
        "$:/language/SystemTiddlers/Include/Prompt": {
            "title": "$:/language/SystemTiddlers/Include/Prompt",
            "text": "Include system tiddlers"
        },
        "$:/language/TagManager/Colour/Heading": {
            "title": "$:/language/TagManager/Colour/Heading",
            "text": "Colour"
        },
        "$:/language/TagManager/Count/Heading": {
            "title": "$:/language/TagManager/Count/Heading",
            "text": "Count"
        },
        "$:/language/TagManager/Icon/Heading": {
            "title": "$:/language/TagManager/Icon/Heading",
            "text": "Icon"
        },
        "$:/language/TagManager/Info/Heading": {
            "title": "$:/language/TagManager/Info/Heading",
            "text": "Info"
        },
        "$:/language/TagManager/Tag/Heading": {
            "title": "$:/language/TagManager/Tag/Heading",
            "text": "Tag"
        },
        "$:/language/Tiddler/DateFormat": {
            "title": "$:/language/Tiddler/DateFormat",
            "text": "DDth MMM YYYY at hh12:0mmam"
        },
        "$:/language/UnsavedChangesWarning": {
            "title": "$:/language/UnsavedChangesWarning",
            "text": "You have unsaved changes in TiddlyWiki"
        },
        "$:/language/Yes": {
            "title": "$:/language/Yes",
            "text": "Yes"
        },
        "$:/language/Modals/Download": {
            "title": "$:/language/Modals/Download",
            "type": "text/vnd.tiddlywiki",
            "subtitle": "Download changes",
            "footer": "<$button message=\"tm-close-tiddler\">Close</$button>",
            "help": "http://tiddlywiki.com/static/DownloadingChanges.html",
            "text": "Your browser only supports manual saving.\n\nTo save your modified wiki, right click on the download link below and select \"Download file\" or \"Save file\", and then choose the folder and filename.\n\n//You can marginally speed things up by clicking the link with the control key (Windows) or the options/alt key (Mac OS X). You will not be prompted for the folder or filename, but your browser is likely to give it an unrecognisable name -- you may need to rename the file to include an `.html` extension before you can do anything useful with it.//\n\nOn smartphones that do not allow files to be downloaded you can instead bookmark the link, and then sync your bookmarks to a desktop computer from where the wiki can be saved normally.\n"
        },
        "$:/language/Modals/SaveInstructions": {
            "title": "$:/language/Modals/SaveInstructions",
            "type": "text/vnd.tiddlywiki",
            "subtitle": "Save your work",
            "footer": "<$button message=\"tm-close-tiddler\">Close</$button>",
            "help": "http://tiddlywiki.com/static/SavingChanges.html",
            "text": "Your changes to this wiki need to be saved as a ~TiddlyWiki HTML file.\n\n!!! Desktop browsers\n\n# Select ''Save As'' from the ''File'' menu\n# Choose a filename and location\n#* Some browsers also require you to explicitly specify the file saving format as ''Webpage, HTML only'' or similar\n# Close this tab\n\n!!! Smartphone browsers\n\n# Create a bookmark to this page\n#* If you've got iCloud or Google Sync set up then the bookmark will automatically sync to your desktop where you can open it and save it as above\n# Close this tab\n\n//If you open the bookmark again in Mobile Safari you will see this message again. If you want to go ahead and use the file, just click the ''close'' button below//\n"
        },
        "$:/config/NewJournal/Title": {
            "title": "$:/config/NewJournal/Title",
            "text": "DDth MMM YYYY"
        },
        "$:/config/NewJournal/Text": {
            "title": "$:/config/NewJournal/Text",
            "text": ""
        },
        "$:/config/NewJournal/Tags": {
            "title": "$:/config/NewJournal/Tags",
            "text": "Journal"
        },
        "$:/language/Notifications/Save/Done": {
            "title": "$:/language/Notifications/Save/Done",
            "text": "Saved wiki"
        },
        "$:/language/Notifications/Save/Starting": {
            "title": "$:/language/Notifications/Save/Starting",
            "text": "Starting to save wiki"
        },
        "$:/language/Search/DefaultResults/Caption": {
            "title": "$:/language/Search/DefaultResults/Caption",
            "text": "List"
        },
        "$:/language/Search/Filter/Caption": {
            "title": "$:/language/Search/Filter/Caption",
            "text": "Filter"
        },
        "$:/language/Search/Filter/Hint": {
            "title": "$:/language/Search/Filter/Hint",
            "text": "Search via a [[filter expression|http://tiddlywiki.com/static/Filters.html]]"
        },
        "$:/language/Search/Filter/Matches": {
            "title": "$:/language/Search/Filter/Matches",
            "text": "//<small><<resultCount>> matches</small>//"
        },
        "$:/language/Search/Matches": {
            "title": "$:/language/Search/Matches",
            "text": "//<small><<resultCount>> matches</small>//"
        },
        "$:/language/Search/Matches/All": {
            "title": "$:/language/Search/Matches/All",
            "text": "All matches:"
        },
        "$:/language/Search/Matches/Title": {
            "title": "$:/language/Search/Matches/Title",
            "text": "Title matches:"
        },
        "$:/language/Search/Search": {
            "title": "$:/language/Search/Search",
            "text": "Search"
        },
        "$:/language/Search/Search/TooShort": {
            "title": "$:/language/Search/Search/TooShort",
            "text": "Search text too short"
        },
        "$:/language/Search/Shadows/Caption": {
            "title": "$:/language/Search/Shadows/Caption",
            "text": "Shadows"
        },
        "$:/language/Search/Shadows/Hint": {
            "title": "$:/language/Search/Shadows/Hint",
            "text": "Search for shadow tiddlers"
        },
        "$:/language/Search/Shadows/Matches": {
            "title": "$:/language/Search/Shadows/Matches",
            "text": "//<small><<resultCount>> matches</small>//"
        },
        "$:/language/Search/Standard/Caption": {
            "title": "$:/language/Search/Standard/Caption",
            "text": "Standard"
        },
        "$:/language/Search/Standard/Hint": {
            "title": "$:/language/Search/Standard/Hint",
            "text": "Search for standard tiddlers"
        },
        "$:/language/Search/Standard/Matches": {
            "title": "$:/language/Search/Standard/Matches",
            "text": "//<small><<resultCount>> matches</small>//"
        },
        "$:/language/Search/System/Caption": {
            "title": "$:/language/Search/System/Caption",
            "text": "System"
        },
        "$:/language/Search/System/Hint": {
            "title": "$:/language/Search/System/Hint",
            "text": "Search for system tiddlers"
        },
        "$:/language/Search/System/Matches": {
            "title": "$:/language/Search/System/Matches",
            "text": "//<small><<resultCount>> matches</small>//"
        },
        "$:/language/SideBar/All/Caption": {
            "title": "$:/language/SideBar/All/Caption",
            "text": "All"
        },
        "$:/language/SideBar/Contents/Caption": {
            "title": "$:/language/SideBar/Contents/Caption",
            "text": "Contents"
        },
        "$:/language/SideBar/Drafts/Caption": {
            "title": "$:/language/SideBar/Drafts/Caption",
            "text": "Drafts"
        },
        "$:/language/SideBar/Missing/Caption": {
            "title": "$:/language/SideBar/Missing/Caption",
            "text": "Missing"
        },
        "$:/language/SideBar/More/Caption": {
            "title": "$:/language/SideBar/More/Caption",
            "text": "More"
        },
        "$:/language/SideBar/Open/Caption": {
            "title": "$:/language/SideBar/Open/Caption",
            "text": "Open"
        },
        "$:/language/SideBar/Orphans/Caption": {
            "title": "$:/language/SideBar/Orphans/Caption",
            "text": "Orphans"
        },
        "$:/language/SideBar/Recent/Caption": {
            "title": "$:/language/SideBar/Recent/Caption",
            "text": "Recent"
        },
        "$:/language/SideBar/Shadows/Caption": {
            "title": "$:/language/SideBar/Shadows/Caption",
            "text": "Shadows"
        },
        "$:/language/SideBar/System/Caption": {
            "title": "$:/language/SideBar/System/Caption",
            "text": "System"
        },
        "$:/language/SideBar/Tags/Caption": {
            "title": "$:/language/SideBar/Tags/Caption",
            "text": "Tags"
        },
        "$:/language/SideBar/Tags/Untagged/Caption": {
            "title": "$:/language/SideBar/Tags/Untagged/Caption",
            "text": "untagged"
        },
        "$:/language/SideBar/Tools/Caption": {
            "title": "$:/language/SideBar/Tools/Caption",
            "text": "Tools"
        },
        "$:/language/SideBar/Types/Caption": {
            "title": "$:/language/SideBar/Types/Caption",
            "text": "Types"
        },
        "$:/SiteSubtitle": {
            "title": "$:/SiteSubtitle",
            "text": "a non-linear personal web notebook"
        },
        "$:/SiteTitle": {
            "title": "$:/SiteTitle",
            "text": "My ~TiddlyWiki"
        },
        "$:/language/Snippets/ListByTag": {
            "title": "$:/language/Snippets/ListByTag",
            "tags": "$:/tags/TextEditor/Snippet",
            "caption": "List of tiddlers by tag",
            "text": "<<list-links \"[tag[task]sort[title]]\">>\n"
        },
        "$:/language/Snippets/MacroDefinition": {
            "title": "$:/language/Snippets/MacroDefinition",
            "tags": "$:/tags/TextEditor/Snippet",
            "caption": "Macro definition",
            "text": "\\define macroName(param1:\"default value\",param2)\nText of the macro\n\\end\n"
        },
        "$:/language/Snippets/Table4x3": {
            "title": "$:/language/Snippets/Table4x3",
            "tags": "$:/tags/TextEditor/Snippet",
            "caption": "Table with 4 columns by 3 rows",
            "text": "|! |!Alpha |!Beta |!Gamma |!Delta |\n|!One | | | | |\n|!Two | | | | |\n|!Three | | | | |\n"
        },
        "$:/language/Snippets/TableOfContents": {
            "title": "$:/language/Snippets/TableOfContents",
            "tags": "$:/tags/TextEditor/Snippet",
            "caption": "Table of Contents",
            "text": "<div class=\"tc-table-of-contents\">\n\n<<toc-selective-expandable 'TableOfContents'>>\n\n</div>"
        },
        "$:/language/ThemeTweaks/ThemeTweaks": {
            "title": "$:/language/ThemeTweaks/ThemeTweaks",
            "text": "Theme Tweaks"
        },
        "$:/language/ThemeTweaks/ThemeTweaks/Hint": {
            "title": "$:/language/ThemeTweaks/ThemeTweaks/Hint",
            "text": "You can tweak certain aspects of the ''Vanilla'' theme."
        },
        "$:/language/ThemeTweaks/Options": {
            "title": "$:/language/ThemeTweaks/Options",
            "text": "Options"
        },
        "$:/language/ThemeTweaks/Options/SidebarLayout": {
            "title": "$:/language/ThemeTweaks/Options/SidebarLayout",
            "text": "Sidebar layout"
        },
        "$:/language/ThemeTweaks/Options/SidebarLayout/Fixed-Fluid": {
            "title": "$:/language/ThemeTweaks/Options/SidebarLayout/Fixed-Fluid",
            "text": "Fixed story, fluid sidebar"
        },
        "$:/language/ThemeTweaks/Options/SidebarLayout/Fluid-Fixed": {
            "title": "$:/language/ThemeTweaks/Options/SidebarLayout/Fluid-Fixed",
            "text": "Fluid story, fixed sidebar"
        },
        "$:/language/ThemeTweaks/Options/StickyTitles": {
            "title": "$:/language/ThemeTweaks/Options/StickyTitles",
            "text": "Sticky titles"
        },
        "$:/language/ThemeTweaks/Options/StickyTitles/Hint": {
            "title": "$:/language/ThemeTweaks/Options/StickyTitles/Hint",
            "text": "Causes tiddler titles to \"stick\" to the top of the browser window. Caution: Does not work at all with Chrome, and causes some layout issues in Firefox"
        },
        "$:/language/ThemeTweaks/Options/CodeWrapping": {
            "title": "$:/language/ThemeTweaks/Options/CodeWrapping",
            "text": "Wrap long lines in code blocks"
        },
        "$:/language/ThemeTweaks/Settings": {
            "title": "$:/language/ThemeTweaks/Settings",
            "text": "Settings"
        },
        "$:/language/ThemeTweaks/Settings/FontFamily": {
            "title": "$:/language/ThemeTweaks/Settings/FontFamily",
            "text": "Font family"
        },
        "$:/language/ThemeTweaks/Settings/CodeFontFamily": {
            "title": "$:/language/ThemeTweaks/Settings/CodeFontFamily",
            "text": "Code font family"
        },
        "$:/language/ThemeTweaks/Settings/BackgroundImage": {
            "title": "$:/language/ThemeTweaks/Settings/BackgroundImage",
            "text": "Page background image"
        },
        "$:/language/ThemeTweaks/Settings/BackgroundImageAttachment": {
            "title": "$:/language/ThemeTweaks/Settings/BackgroundImageAttachment",
            "text": "Page background image attachment"
        },
        "$:/language/ThemeTweaks/Settings/BackgroundImageAttachment/Scroll": {
            "title": "$:/language/ThemeTweaks/Settings/BackgroundImageAttachment/Scroll",
            "text": "Scroll with tiddlers"
        },
        "$:/language/ThemeTweaks/Settings/BackgroundImageAttachment/Fixed": {
            "title": "$:/language/ThemeTweaks/Settings/BackgroundImageAttachment/Fixed",
            "text": "Fixed to window"
        },
        "$:/language/ThemeTweaks/Settings/BackgroundImageSize": {
            "title": "$:/language/ThemeTweaks/Settings/BackgroundImageSize",
            "text": "Page background image size"
        },
        "$:/language/ThemeTweaks/Settings/BackgroundImageSize/Auto": {
            "title": "$:/language/ThemeTweaks/Settings/BackgroundImageSize/Auto",
            "text": "Auto"
        },
        "$:/language/ThemeTweaks/Settings/BackgroundImageSize/Cover": {
            "title": "$:/language/ThemeTweaks/Settings/BackgroundImageSize/Cover",
            "text": "Cover"
        },
        "$:/language/ThemeTweaks/Settings/BackgroundImageSize/Contain": {
            "title": "$:/language/ThemeTweaks/Settings/BackgroundImageSize/Contain",
            "text": "Contain"
        },
        "$:/language/ThemeTweaks/Metrics": {
            "title": "$:/language/ThemeTweaks/Metrics",
            "text": "Sizes"
        },
        "$:/language/ThemeTweaks/Metrics/FontSize": {
            "title": "$:/language/ThemeTweaks/Metrics/FontSize",
            "text": "Font size"
        },
        "$:/language/ThemeTweaks/Metrics/LineHeight": {
            "title": "$:/language/ThemeTweaks/Metrics/LineHeight",
            "text": "Line height"
        },
        "$:/language/ThemeTweaks/Metrics/BodyFontSize": {
            "title": "$:/language/ThemeTweaks/Metrics/BodyFontSize",
            "text": "Font size for tiddler body"
        },
        "$:/language/ThemeTweaks/Metrics/BodyLineHeight": {
            "title": "$:/language/ThemeTweaks/Metrics/BodyLineHeight",
            "text": "Line height for tiddler body"
        },
        "$:/language/ThemeTweaks/Metrics/StoryLeft": {
            "title": "$:/language/ThemeTweaks/Metrics/StoryLeft",
            "text": "Story left position"
        },
        "$:/language/ThemeTweaks/Metrics/StoryLeft/Hint": {
            "title": "$:/language/ThemeTweaks/Metrics/StoryLeft/Hint",
            "text": "how far the left margin of the story river<br>(tiddler area) is from the left of the page"
        },
        "$:/language/ThemeTweaks/Metrics/StoryTop": {
            "title": "$:/language/ThemeTweaks/Metrics/StoryTop",
            "text": "Story top position"
        },
        "$:/language/ThemeTweaks/Metrics/StoryTop/Hint": {
            "title": "$:/language/ThemeTweaks/Metrics/StoryTop/Hint",
            "text": "how far the top margin of the story river<br>is from the top of the page"
        },
        "$:/language/ThemeTweaks/Metrics/StoryRight": {
            "title": "$:/language/ThemeTweaks/Metrics/StoryRight",
            "text": "Story right"
        },
        "$:/language/ThemeTweaks/Metrics/StoryRight/Hint": {
            "title": "$:/language/ThemeTweaks/Metrics/StoryRight/Hint",
            "text": "how far the left margin of the sidebar <br>is from the left of the page"
        },
        "$:/language/ThemeTweaks/Metrics/StoryWidth": {
            "title": "$:/language/ThemeTweaks/Metrics/StoryWidth",
            "text": "Story width"
        },
        "$:/language/ThemeTweaks/Metrics/StoryWidth/Hint": {
            "title": "$:/language/ThemeTweaks/Metrics/StoryWidth/Hint",
            "text": "the overall width of the story river"
        },
        "$:/language/ThemeTweaks/Metrics/TiddlerWidth": {
            "title": "$:/language/ThemeTweaks/Metrics/TiddlerWidth",
            "text": "Tiddler width"
        },
        "$:/language/ThemeTweaks/Metrics/TiddlerWidth/Hint": {
            "title": "$:/language/ThemeTweaks/Metrics/TiddlerWidth/Hint",
            "text": "within the story river"
        },
        "$:/language/ThemeTweaks/Metrics/SidebarBreakpoint": {
            "title": "$:/language/ThemeTweaks/Metrics/SidebarBreakpoint",
            "text": "Sidebar breakpoint"
        },
        "$:/language/ThemeTweaks/Metrics/SidebarBreakpoint/Hint": {
            "title": "$:/language/ThemeTweaks/Metrics/SidebarBreakpoint/Hint",
            "text": "the minimum page width at which the story<br>river and sidebar will appear side by side"
        },
        "$:/language/ThemeTweaks/Metrics/SidebarWidth": {
            "title": "$:/language/ThemeTweaks/Metrics/SidebarWidth",
            "text": "Sidebar width"
        },
        "$:/language/ThemeTweaks/Metrics/SidebarWidth/Hint": {
            "title": "$:/language/ThemeTweaks/Metrics/SidebarWidth/Hint",
            "text": "the width of the sidebar in fluid-fixed layout"
        },
        "$:/language/TiddlerInfo/Advanced/Caption": {
            "title": "$:/language/TiddlerInfo/Advanced/Caption",
            "text": "Advanced"
        },
        "$:/language/TiddlerInfo/Advanced/PluginInfo/Empty/Hint": {
            "title": "$:/language/TiddlerInfo/Advanced/PluginInfo/Empty/Hint",
            "text": "none"
        },
        "$:/language/TiddlerInfo/Advanced/PluginInfo/Heading": {
            "title": "$:/language/TiddlerInfo/Advanced/PluginInfo/Heading",
            "text": "Plugin Details"
        },
        "$:/language/TiddlerInfo/Advanced/PluginInfo/Hint": {
            "title": "$:/language/TiddlerInfo/Advanced/PluginInfo/Hint",
            "text": "This plugin contains the following shadow tiddlers:"
        },
        "$:/language/TiddlerInfo/Advanced/ShadowInfo/Heading": {
            "title": "$:/language/TiddlerInfo/Advanced/ShadowInfo/Heading",
            "text": "Shadow Status"
        },
        "$:/language/TiddlerInfo/Advanced/ShadowInfo/NotShadow/Hint": {
            "title": "$:/language/TiddlerInfo/Advanced/ShadowInfo/NotShadow/Hint",
            "text": "The tiddler <$link to=<<infoTiddler>>><$text text=<<infoTiddler>>/></$link> is not a shadow tiddler"
        },
        "$:/language/TiddlerInfo/Advanced/ShadowInfo/Shadow/Hint": {
            "title": "$:/language/TiddlerInfo/Advanced/ShadowInfo/Shadow/Hint",
            "text": "The tiddler <$link to=<<infoTiddler>>><$text text=<<infoTiddler>>/></$link> is a shadow tiddler"
        },
        "$:/language/TiddlerInfo/Advanced/ShadowInfo/Shadow/Source": {
            "title": "$:/language/TiddlerInfo/Advanced/ShadowInfo/Shadow/Source",
            "text": "It is defined in the plugin <$link to=<<pluginTiddler>>><$text text=<<pluginTiddler>>/></$link>"
        },
        "$:/language/TiddlerInfo/Advanced/ShadowInfo/OverriddenShadow/Hint": {
            "title": "$:/language/TiddlerInfo/Advanced/ShadowInfo/OverriddenShadow/Hint",
            "text": "It is overridden by an ordinary tiddler"
        },
        "$:/language/TiddlerInfo/Fields/Caption": {
            "title": "$:/language/TiddlerInfo/Fields/Caption",
            "text": "Fields"
        },
        "$:/language/TiddlerInfo/List/Caption": {
            "title": "$:/language/TiddlerInfo/List/Caption",
            "text": "List"
        },
        "$:/language/TiddlerInfo/List/Empty": {
            "title": "$:/language/TiddlerInfo/List/Empty",
            "text": "This tiddler does not have a list"
        },
        "$:/language/TiddlerInfo/Listed/Caption": {
            "title": "$:/language/TiddlerInfo/Listed/Caption",
            "text": "Listed"
        },
        "$:/language/TiddlerInfo/Listed/Empty": {
            "title": "$:/language/TiddlerInfo/Listed/Empty",
            "text": "This tiddler is not listed by any others"
        },
        "$:/language/TiddlerInfo/References/Caption": {
            "title": "$:/language/TiddlerInfo/References/Caption",
            "text": "References"
        },
        "$:/language/TiddlerInfo/References/Empty": {
            "title": "$:/language/TiddlerInfo/References/Empty",
            "text": "No tiddlers link to this one"
        },
        "$:/language/TiddlerInfo/Tagging/Caption": {
            "title": "$:/language/TiddlerInfo/Tagging/Caption",
            "text": "Tagging"
        },
        "$:/language/TiddlerInfo/Tagging/Empty": {
            "title": "$:/language/TiddlerInfo/Tagging/Empty",
            "text": "No tiddlers are tagged with this one"
        },
        "$:/language/TiddlerInfo/Tools/Caption": {
            "title": "$:/language/TiddlerInfo/Tools/Caption",
            "text": "Tools"
        },
        "$:/language/Docs/Types/application/javascript": {
            "title": "$:/language/Docs/Types/application/javascript",
            "description": "JavaScript code",
            "name": "application/javascript",
            "group": "Developer",
            "group-sort": "2"
        },
        "$:/language/Docs/Types/application/json": {
            "title": "$:/language/Docs/Types/application/json",
            "description": "JSON data",
            "name": "application/json",
            "group": "Developer",
            "group-sort": "2"
        },
        "$:/language/Docs/Types/application/x-tiddler-dictionary": {
            "title": "$:/language/Docs/Types/application/x-tiddler-dictionary",
            "description": "Data dictionary",
            "name": "application/x-tiddler-dictionary",
            "group": "Developer",
            "group-sort": "2"
        },
        "$:/language/Docs/Types/image/gif": {
            "title": "$:/language/Docs/Types/image/gif",
            "description": "GIF image",
            "name": "image/gif",
            "group": "Image",
            "group-sort": "1"
        },
        "$:/language/Docs/Types/image/jpeg": {
            "title": "$:/language/Docs/Types/image/jpeg",
            "description": "JPEG image",
            "name": "image/jpeg",
            "group": "Image",
            "group-sort": "1"
        },
        "$:/language/Docs/Types/image/png": {
            "title": "$:/language/Docs/Types/image/png",
            "description": "PNG image",
            "name": "image/png",
            "group": "Image",
            "group-sort": "1"
        },
        "$:/language/Docs/Types/image/svg+xml": {
            "title": "$:/language/Docs/Types/image/svg+xml",
            "description": "Structured Vector Graphics image",
            "name": "image/svg+xml",
            "group": "Image",
            "group-sort": "1"
        },
        "$:/language/Docs/Types/image/x-icon": {
            "title": "$:/language/Docs/Types/image/x-icon",
            "description": "ICO format icon file",
            "name": "image/x-icon",
            "group": "Image",
            "group-sort": "1"
        },
        "$:/language/Docs/Types/text/css": {
            "title": "$:/language/Docs/Types/text/css",
            "description": "Static stylesheet",
            "name": "text/css",
            "group": "Developer",
            "group-sort": "2"
        },
        "$:/language/Docs/Types/text/html": {
            "title": "$:/language/Docs/Types/text/html",
            "description": "HTML markup",
            "name": "text/html",
            "group": "Text",
            "group-sort": "0"
        },
        "$:/language/Docs/Types/text/plain": {
            "title": "$:/language/Docs/Types/text/plain",
            "description": "Plain text",
            "name": "text/plain",
            "group": "Text",
            "group-sort": "0"
        },
        "$:/language/Docs/Types/text/vnd.tiddlywiki": {
            "title": "$:/language/Docs/Types/text/vnd.tiddlywiki",
            "description": "TiddlyWiki 5",
            "name": "text/vnd.tiddlywiki",
            "group": "Text",
            "group-sort": "0"
        },
        "$:/language/Docs/Types/text/x-tiddlywiki": {
            "title": "$:/language/Docs/Types/text/x-tiddlywiki",
            "description": "TiddlyWiki Classic",
            "name": "text/x-tiddlywiki",
            "group": "Text",
            "group-sort": "0"
        },
        "$:/languages/en-GB/icon": {
            "title": "$:/languages/en-GB/icon",
            "type": "image/svg+xml",
            "text": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 60 30\" width=\"1200\" height=\"600\">\n<clipPath id=\"t\">\n\t<path d=\"M30,15 h30 v15 z v15 h-30 z h-30 v-15 z v-15 h30 z\"/>\n</clipPath>\n<path d=\"M0,0 v30 h60 v-30 z\" fill=\"#00247d\"/>\n<path d=\"M0,0 L60,30 M60,0 L0,30\" stroke=\"#fff\" stroke-width=\"6\"/>\n<path d=\"M0,0 L60,30 M60,0 L0,30\" clip-path=\"url(#t)\" stroke=\"#cf142b\" stroke-width=\"4\"/>\n<path d=\"M30,0 v30 M0,15 h60\" stroke=\"#fff\" stroke-width=\"10\"/>\n<path d=\"M30,0 v30 M0,15 h60\" stroke=\"#cf142b\" stroke-width=\"6\"/>\n</svg>\n"
        },
        "$:/languages/en-GB": {
            "title": "$:/languages/en-GB",
            "name": "en-GB",
            "description": "English (British)",
            "author": "JeremyRuston",
            "core-version": ">=5.0.0\"",
            "text": "Stub pseudo-plugin for the default language"
        },
        "$:/core/modules/commander.js": {
            "text": "/*\\\ntitle: $:/core/modules/commander.js\ntype: application/javascript\nmodule-type: global\n\nThe $tw.Commander class is a command interpreter\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nParse a sequence of commands\n\tcommandTokens: an array of command string tokens\n\twiki: reference to the wiki store object\n\tstreams: {output:, error:}, each of which has a write(string) method\n\tcallback: a callback invoked as callback(err) where err is null if there was no error\n*/\nvar Commander = function(commandTokens,callback,wiki,streams) {\n\tvar path = require(\"path\");\n\tthis.commandTokens = commandTokens;\n\tthis.nextToken = 0;\n\tthis.callback = callback;\n\tthis.wiki = wiki;\n\tthis.streams = streams;\n\tthis.outputPath = path.resolve($tw.boot.wikiPath,$tw.config.wikiOutputSubDir);\n};\n\n/*\nLog a string if verbose flag is set\n*/\nCommander.prototype.log = function(str) {\n\tif(this.verbose) {\n\t\tthis.streams.output.write(str + \"\\n\");\n\t}\n};\n\n/*\nWrite a string if verbose flag is set\n*/\nCommander.prototype.write = function(str) {\n\tif(this.verbose) {\n\t\tthis.streams.output.write(str);\n\t}\n};\n\n/*\nAdd a string of tokens to the command queue\n*/\nCommander.prototype.addCommandTokens = function(commandTokens) {\n\tvar params = commandTokens.slice(0);\n\tparams.unshift(0);\n\tparams.unshift(this.nextToken);\n\tArray.prototype.splice.apply(this.commandTokens,params);\n};\n\n/*\nExecute the sequence of commands and invoke a callback on completion\n*/\nCommander.prototype.execute = function() {\n\tthis.executeNextCommand();\n};\n\n/*\nExecute the next command in the sequence\n*/\nCommander.prototype.executeNextCommand = function() {\n\tvar self = this;\n\t// Invoke the callback if there are no more commands\n\tif(this.nextToken >= this.commandTokens.length) {\n\t\tthis.callback(null);\n\t} else {\n\t\t// Get and check the command token\n\t\tvar commandName = this.commandTokens[this.nextToken++];\n\t\tif(commandName.substr(0,2) !== \"--\") {\n\t\t\tthis.callback(\"Missing command: \" + commandName);\n\t\t} else {\n\t\t\tcommandName = commandName.substr(2); // Trim off the --\n\t\t\t// Accumulate the parameters to the command\n\t\t\tvar params = [];\n\t\t\twhile(this.nextToken < this.commandTokens.length && \n\t\t\t\tthis.commandTokens[this.nextToken].substr(0,2) !== \"--\") {\n\t\t\t\tparams.push(this.commandTokens[this.nextToken++]);\n\t\t\t}\n\t\t\t// Get the command info\n\t\t\tvar command = $tw.commands[commandName],\n\t\t\t\tc,err;\n\t\t\tif(!command) {\n\t\t\t\tthis.callback(\"Unknown command: \" + commandName);\n\t\t\t} else {\n\t\t\t\tif(this.verbose) {\n\t\t\t\t\tthis.streams.output.write(\"Executing command: \" + commandName + \" \" + params.join(\" \") + \"\\n\");\n\t\t\t\t}\n\t\t\t\tif(command.info.synchronous) {\n\t\t\t\t\t// Synchronous command\n\t\t\t\t\tc = new command.Command(params,this);\n\t\t\t\t\terr = c.execute();\n\t\t\t\t\tif(err) {\n\t\t\t\t\t\tthis.callback(err);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.executeNextCommand();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Asynchronous command\n\t\t\t\t\tc = new command.Command(params,this,function(err) {\n\t\t\t\t\t\tif(err) {\n\t\t\t\t\t\t\tself.callback(err);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tself.executeNextCommand();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\terr = c.execute();\n\t\t\t\t\tif(err) {\n\t\t\t\t\t\tthis.callback(err);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\nCommander.initCommands = function(moduleType) {\n\tmoduleType = moduleType || \"command\";\n\t$tw.commands = {};\n\t$tw.modules.forEachModuleOfType(moduleType,function(title,module) {\n\t\tvar c = $tw.commands[module.info.name] = {};\n\t\t// Add the methods defined by the module\n\t\tfor(var f in module) {\n\t\t\tif($tw.utils.hop(module,f)) {\n\t\t\t\tc[f] = module[f];\n\t\t\t}\n\t\t}\n\t});\n};\n\nexports.Commander = Commander;\n\n})();\n",
            "title": "$:/core/modules/commander.js",
            "type": "application/javascript",
            "module-type": "global"
        },
        "$:/core/modules/commands/build.js": {
            "text": "/*\\\ntitle: $:/core/modules/commands/build.js\ntype: application/javascript\nmodule-type: command\n\nCommand to build a build target\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"build\",\n\tsynchronous: true\n};\n\nvar Command = function(params,commander) {\n\tthis.params = params;\n\tthis.commander = commander;\n};\n\nCommand.prototype.execute = function() {\n\t// Get the build targets defined in the wiki\n\tvar buildTargets = $tw.boot.wikiInfo.build;\n\tif(!buildTargets) {\n\t\treturn \"No build targets defined\";\n\t}\n\t// Loop through each of the specified targets\n\tvar targets;\n\tif(this.params.length > 0) {\n\t\ttargets = this.params;\n\t} else {\n\t\ttargets = Object.keys(buildTargets);\n\t}\n\tfor(var targetIndex=0; targetIndex<targets.length; targetIndex++) {\n\t\tvar target = targets[targetIndex],\n\t\t\tcommands = buildTargets[target];\n\t\tif(!commands) {\n\t\t\treturn \"Build target '\" + target + \"' not found\";\n\t\t}\n\t\t// Add the commands to the queue\n\t\tthis.commander.addCommandTokens(commands);\n\t}\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
            "title": "$:/core/modules/commands/build.js",
            "type": "application/javascript",
            "module-type": "command"
        },
        "$:/core/modules/commands/clearpassword.js": {
            "text": "/*\\\ntitle: $:/core/modules/commands/clearpassword.js\ntype: application/javascript\nmodule-type: command\n\nClear password for crypto operations\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"clearpassword\",\n\tsynchronous: true\n};\n\nvar Command = function(params,commander,callback) {\n\tthis.params = params;\n\tthis.commander = commander;\n\tthis.callback = callback;\n};\n\nCommand.prototype.execute = function() {\n\t$tw.crypto.setPassword(null);\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
            "title": "$:/core/modules/commands/clearpassword.js",
            "type": "application/javascript",
            "module-type": "command"
        },
        "$:/core/modules/commands/editions.js": {
            "text": "/*\\\ntitle: $:/core/modules/commands/editions.js\ntype: application/javascript\nmodule-type: command\n\nCommand to list the available editions\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"editions\",\n\tsynchronous: true\n};\n\nvar Command = function(params,commander) {\n\tthis.params = params;\n\tthis.commander = commander;\n};\n\nCommand.prototype.execute = function() {\n\tvar self = this;\n\t// Output the list\n\tthis.commander.streams.output.write(\"Available editions:\\n\\n\");\n\tvar editionInfo = $tw.utils.getEditionInfo();\n\t$tw.utils.each(editionInfo,function(info,name) {\n\t\tself.commander.streams.output.write(\"    \" + name + \": \" + info.description + \"\\n\");\n\t});\n\tthis.commander.streams.output.write(\"\\n\");\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
            "title": "$:/core/modules/commands/editions.js",
            "type": "application/javascript",
            "module-type": "command"
        },
        "$:/core/modules/commands/fetch.js": {
            "text": "/*\\\ntitle: $:/core/modules/commands/fetch.js\ntype: application/javascript\nmodule-type: command\n\nCommands to fetch external tiddlers\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"fetch\",\n\tsynchronous: false\n};\n\nvar Command = function(params,commander,callback) {\n\tthis.params = params;\n\tthis.commander = commander;\n\tthis.callback = callback;\n};\n\nCommand.prototype.execute = function() {\n\tif(this.params.length < 2) {\n\t\treturn \"Missing subcommand and url\";\n\t}\n\tvar subcommand = this.params[0],\n\t\turl = this.params[1],\n\t\timportFilter = this.params[2] || \"[all[tiddlers]]\",\n\t\ttransformFilter = this.params[3] || \"\";\n\tswitch(subcommand) {\n\t\tcase \"file\":\n\t\t\treturn this.fetchFiles({\n\t\t\t\turl: url,\n\t\t\t\timportFilter: importFilter,\n\t\t\t\ttransformFilter: transformFilter,\n\t\t\t\tcallback: this.callback\n\t\t\t});\n\t\t\tbreak;\n\t\tcase \"files\":\n\t\t\treturn this.fetchFiles({\n\t\t\t\turlFilter: url,\n\t\t\t\timportFilter: importFilter,\n\t\t\t\ttransformFilter: transformFilter,\n\t\t\t\tcallback: this.callback\n\t\t\t});\n\t\t\tbreak;\n\t}\n\treturn null;\n};\n\nCommand.prototype.fetchFiles = function(options) {\n\tvar self = this;\n\t// Get the list of URLs\n\tvar urls;\n\tif(options.url) {\n\t\turls = [options.url]\n\t} else if(options.urlFilter) {\n\t\turls = $tw.wiki.filterTiddlers(options.urlFilter);\n\t} else {\n\t\treturn \"Missing URL\";\n\t}\n\t// Process each URL in turn\n\tvar next = 0;\n\tvar getNextFile = function(err) {\n\t\tif(err) {\n\t\t\treturn options.callback(err);\n\t\t}\n\t\tif(next < urls.length) {\n\t\t\tself.fetchFile(urls[next++],options,getNextFile);\n\t\t} else {\n\t\t\toptions.callback(null);\n\t\t}\n\t};\n\tgetNextFile(null);\n\t// Success\n\treturn null;\n};\n\nCommand.prototype.fetchFile = function(url,options,callback) {\n\tvar self = this,\n\t\tlib = url.substr(0,8) === \"https://\" ? require(\"https\") : require(\"http\");\n\tlib.get(url).on(\"response\",function(response) {\n\t    var type = (response.headers[\"content-type\"] || \"\").split(\";\")[0],\n\t    \tbody = \"\";\n\t    self.commander.write(\"Reading \" + url + \": \");\n\t    response.on(\"data\",function(chunk) {\n\t        body += chunk;\n\t        self.commander.write(\".\");\n\t    });\n\t    response.on(\"end\",function() {\n\t        self.commander.write(\"\\n\");\n\t        if(response.statusCode === 200) {\n\t\t        self.processBody(body,type,options);\n\t\t        callback(null);\n\t        } else {\n\t        \tcallback(\"Error \" + response.statusCode + \" retrieving \" + url)\n\t        }\n\t   \t});\n\t   \tresponse.on(\"error\",function(e) {\n\t\t\tconsole.log(\"Error on GET request: \" + e);\n\t\t\tcallback(e);\n\t   \t});\n\t});\n\treturn null;\n};\n\nCommand.prototype.processBody = function(body,type,options) {\n\t// Deserialise the HTML file and put the tiddlers in their own wiki\n\tvar self = this,\n\t\tincomingWiki = new $tw.Wiki(),\n\t\ttiddlers = this.commander.wiki.deserializeTiddlers(type || \"text/html\",body,{});\n\t$tw.utils.each(tiddlers,function(tiddler) {\n\t\tincomingWiki.addTiddler(new $tw.Tiddler(tiddler));\n\t});\n\t// Filter the tiddlers to select the ones we want\n\tvar filteredTitles = incomingWiki.filterTiddlers(options.importFilter);\n\t// Import the selected tiddlers\n\tvar count = 0;\n\tincomingWiki.each(function(tiddler,title) {\n\t\tif(filteredTitles.indexOf(title) !== -1) {\n\t\t\tvar newTiddler;\n\t\t\tif(options.transformFilter) {\n\t\t\t\tvar transformedTitle = (incomingWiki.filterTiddlers(options.transformFilter,null,self.commander.wiki.makeTiddlerIterator([title])) || [\"\"])[0];\n\t\t\t\tif(transformedTitle) {\n\t\t\t\t\tself.commander.log(\"Importing \" + title + \" as \" + transformedTitle)\n\t\t\t\t\tnewTiddler = new $tw.Tiddler(tiddler,{title: transformedTitle});\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tself.commander.log(\"Importing \" + title)\n\t\t\t\tnewTiddler = tiddler;\n\t\t\t}\n\t\t\tself.commander.wiki.importTiddler(newTiddler);\n\t\t\tcount++;\n\t\t}\n\t});\n\tself.commander.log(\"Imported \" + count + \" tiddlers\")\n};\n\nexports.Command = Command;\n\n})();\n",
            "title": "$:/core/modules/commands/fetch.js",
            "type": "application/javascript",
            "module-type": "command"
        },
        "$:/core/modules/commands/help.js": {
            "text": "/*\\\ntitle: $:/core/modules/commands/help.js\ntype: application/javascript\nmodule-type: command\n\nHelp command\n\n\\*/\n(function(){\n\n/*jshint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"help\",\n\tsynchronous: true\n};\n\nvar Command = function(params,commander) {\n\tthis.params = params;\n\tthis.commander = commander;\n};\n\nCommand.prototype.execute = function() {\n\tvar subhelp = this.params[0] || \"default\",\n\t\thelpBase = \"$:/language/Help/\",\n\t\ttext;\n\tif(!this.commander.wiki.getTiddler(helpBase + subhelp)) {\n\t\tsubhelp = \"notfound\";\n\t}\n\t// Wikify the help as formatted text (ie block elements generate newlines)\n\ttext = this.commander.wiki.renderTiddler(\"text/plain-formatted\",helpBase + subhelp);\n\t// Remove any leading linebreaks\n\ttext = text.replace(/^(\\r?\\n)*/g,\"\");\n\tthis.commander.streams.output.write(text);\n};\n\nexports.Command = Command;\n\n})();\n",
            "title": "$:/core/modules/commands/help.js",
            "type": "application/javascript",
            "module-type": "command"
        },
        "$:/core/modules/commands/init.js": {
            "text": "/*\\\ntitle: $:/core/modules/commands/init.js\ntype: application/javascript\nmodule-type: command\n\nCommand to initialise an empty wiki folder\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"init\",\n\tsynchronous: true\n};\n\nvar Command = function(params,commander) {\n\tthis.params = params;\n\tthis.commander = commander;\n};\n\nCommand.prototype.execute = function() {\n\tvar fs = require(\"fs\"),\n\t\tpath = require(\"path\");\n\t// Check that we don't already have a valid wiki folder\n\tif($tw.boot.wikiTiddlersPath || ($tw.utils.isDirectory($tw.boot.wikiPath) && !$tw.utils.isDirectoryEmpty($tw.boot.wikiPath))) {\n\t\treturn \"Wiki folder is not empty\";\n\t}\n\t// Loop through each of the specified editions\n\tvar editions = this.params.length > 0 ? this.params : [\"empty\"];\n\tfor(var editionIndex=0; editionIndex<editions.length; editionIndex++) {\n\t\tvar editionName = editions[editionIndex];\n\t\t// Check the edition exists\n\t\tvar editionPath = $tw.findLibraryItem(editionName,$tw.getLibraryItemSearchPaths($tw.config.editionsPath,$tw.config.editionsEnvVar));\n\t\tif(!$tw.utils.isDirectory(editionPath)) {\n\t\t\treturn \"Edition '\" + editionName + \"' not found\";\n\t\t}\n\t\t// Copy the edition content\n\t\tvar err = $tw.utils.copyDirectory(editionPath,$tw.boot.wikiPath);\n\t\tif(!err) {\n\t\t\tthis.commander.streams.output.write(\"Copied edition '\" + editionName + \"' to \" + $tw.boot.wikiPath + \"\\n\");\n\t\t} else {\n\t\t\treturn err;\n\t\t}\n\t}\n\t// Tweak the tiddlywiki.info to remove any included wikis\n\tvar packagePath = $tw.boot.wikiPath + \"/tiddlywiki.info\",\n\t\tpackageJson = JSON.parse(fs.readFileSync(packagePath));\n\tdelete packageJson.includeWikis;\n\tfs.writeFileSync(packagePath,JSON.stringify(packageJson,null,$tw.config.preferences.jsonSpaces));\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
            "title": "$:/core/modules/commands/init.js",
            "type": "application/javascript",
            "module-type": "command"
        },
        "$:/core/modules/commands/load.js": {
            "text": "/*\\\ntitle: $:/core/modules/commands/load.js\ntype: application/javascript\nmodule-type: command\n\nCommand to load tiddlers from a file\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"load\",\n\tsynchronous: false\n};\n\nvar Command = function(params,commander,callback) {\n\tthis.params = params;\n\tthis.commander = commander;\n\tthis.callback = callback;\n};\n\nCommand.prototype.execute = function() {\n\tvar self = this,\n\t\tfs = require(\"fs\"),\n\t\tpath = require(\"path\");\n\tif(this.params.length < 1) {\n\t\treturn \"Missing filename\";\n\t}\n\tvar ext = path.extname(self.params[0]),\n\t\tstat = fs.statSync(self.params[0]),\n\t\ttiddlers = $tw.loadTiddlersFromPath(self.params[0]),\n\t\tcount = 0;\n\t$tw.utils.each(tiddlers,function(tiddlerInfo) {\n\t\t$tw.utils.each(tiddlerInfo.tiddlers,function(tiddler) {\n\t\t\tself.commander.wiki.importTiddler(new $tw.Tiddler(tiddler));\n\t\t\tcount++;\n\t\t});\n\t});\n\tif(!count) {\n\t\tself.callback(\"No tiddlers found in file \\\"\" + self.params[0] + \"\\\"\");\n\t} else {\n\t\tself.callback(null);\n\t}\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
            "title": "$:/core/modules/commands/load.js",
            "type": "application/javascript",
            "module-type": "command"
        },
        "$:/core/modules/commands/makelibrary.js": {
            "text": "/*\\\ntitle: $:/core/modules/commands/makelibrary.js\ntype: application/javascript\nmodule-type: command\n\nCommand to pack all of the plugins in the library into a plugin tiddler of type \"library\"\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"makelibrary\",\n\tsynchronous: true\n};\n\nvar UPGRADE_LIBRARY_TITLE = \"$:/UpgradeLibrary\";\n\nvar Command = function(params,commander,callback) {\n\tthis.params = params;\n\tthis.commander = commander;\n\tthis.callback = callback;\n};\n\nCommand.prototype.execute = function() {\n\tvar wiki = this.commander.wiki,\n\t\tfs = require(\"fs\"),\n\t\tpath = require(\"path\"),\n\t\tupgradeLibraryTitle = this.params[0] || UPGRADE_LIBRARY_TITLE,\n\t\ttiddlers = {};\n\t// Collect up the library plugins\n\tvar collectPlugins = function(folder) {\n\t\t\tvar pluginFolders = fs.readdirSync(folder);\n\t\t\tfor(var p=0; p<pluginFolders.length; p++) {\n\t\t\t\tif(!$tw.boot.excludeRegExp.test(pluginFolders[p])) {\n\t\t\t\t\tpluginFields = $tw.loadPluginFolder(path.resolve(folder,\"./\" + pluginFolders[p]));\n\t\t\t\t\tif(pluginFields && pluginFields.title) {\n\t\t\t\t\t\ttiddlers[pluginFields.title] = pluginFields;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tcollectPublisherPlugins = function(folder) {\n\t\t\tvar publisherFolders = fs.readdirSync(folder);\n\t\t\tfor(var t=0; t<publisherFolders.length; t++) {\n\t\t\t\tif(!$tw.boot.excludeRegExp.test(publisherFolders[t])) {\n\t\t\t\t\tcollectPlugins(path.resolve(folder,\"./\" + publisherFolders[t]));\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\tcollectPublisherPlugins(path.resolve($tw.boot.corePath,$tw.config.pluginsPath));\n\tcollectPublisherPlugins(path.resolve($tw.boot.corePath,$tw.config.themesPath));\n\tcollectPlugins(path.resolve($tw.boot.corePath,$tw.config.languagesPath));\n\t// Save the upgrade library tiddler\n\tvar pluginFields = {\n\t\ttitle: upgradeLibraryTitle,\n\t\ttype: \"application/json\",\n\t\t\"plugin-type\": \"library\",\n\t\t\"text\": JSON.stringify({tiddlers: tiddlers},null,$tw.config.preferences.jsonSpaces)\n\t};\n\twiki.addTiddler(new $tw.Tiddler(pluginFields));\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
            "title": "$:/core/modules/commands/makelibrary.js",
            "type": "application/javascript",
            "module-type": "command"
        },
        "$:/core/modules/commands/output.js": {
            "text": "/*\\\ntitle: $:/core/modules/commands/output.js\ntype: application/javascript\nmodule-type: command\n\nCommand to set the default output location (defaults to current working directory)\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"output\",\n\tsynchronous: true\n};\n\nvar Command = function(params,commander,callback) {\n\tthis.params = params;\n\tthis.commander = commander;\n\tthis.callback = callback;\n};\n\nCommand.prototype.execute = function() {\n\tvar fs = require(\"fs\"),\n\t\tpath = require(\"path\");\n\tif(this.params.length < 1) {\n\t\treturn \"Missing output path\";\n\t}\n\tthis.commander.outputPath = path.resolve(process.cwd(),this.params[0]);\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
            "title": "$:/core/modules/commands/output.js",
            "type": "application/javascript",
            "module-type": "command"
        },
        "$:/core/modules/commands/password.js": {
            "text": "/*\\\ntitle: $:/core/modules/commands/password.js\ntype: application/javascript\nmodule-type: command\n\nSave password for crypto operations\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"password\",\n\tsynchronous: true\n};\n\nvar Command = function(params,commander,callback) {\n\tthis.params = params;\n\tthis.commander = commander;\n\tthis.callback = callback;\n};\n\nCommand.prototype.execute = function() {\n\tif(this.params.length < 1) {\n\t\treturn \"Missing password\";\n\t}\n\t$tw.crypto.setPassword(this.params[0]);\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
            "title": "$:/core/modules/commands/password.js",
            "type": "application/javascript",
            "module-type": "command"
        },
        "$:/core/modules/commands/rendertiddler.js": {
            "text": "/*\\\ntitle: $:/core/modules/commands/rendertiddler.js\ntype: application/javascript\nmodule-type: command\n\nCommand to render a tiddler and save it to a file\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"rendertiddler\",\n\tsynchronous: false\n};\n\nvar Command = function(params,commander,callback) {\n\tthis.params = params;\n\tthis.commander = commander;\n\tthis.callback = callback;\n};\n\nCommand.prototype.execute = function() {\n\tif(this.params.length < 2) {\n\t\treturn \"Missing filename\";\n\t}\n\tvar self = this,\n\t\tfs = require(\"fs\"),\n\t\tpath = require(\"path\"),\n\t\ttitle = this.params[0],\n\t\tfilename = path.resolve(this.commander.outputPath,this.params[1]),\n\t\ttype = this.params[2] || \"text/html\",\n\t\ttemplate = this.params[3],\n\t\tname = this.params[4],\n\t\tvalue = this.params[5],\n\t\tvariables = {};\n\t$tw.utils.createFileDirectories(filename);\n\tif(template) {\n\t\tvariables.currentTiddler = title;\n\t\ttitle = template;\n\t}\n\tif(name && value) {\n\t\tvariables[name] = value;\n\t}\n\tfs.writeFile(filename,this.commander.wiki.renderTiddler(type,title,{variables: variables}),\"utf8\",function(err) {\n\t\tself.callback(err);\n\t});\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
            "title": "$:/core/modules/commands/rendertiddler.js",
            "type": "application/javascript",
            "module-type": "command"
        },
        "$:/core/modules/commands/rendertiddlers.js": {
            "text": "/*\\\ntitle: $:/core/modules/commands/rendertiddlers.js\ntype: application/javascript\nmodule-type: command\n\nCommand to render several tiddlers to a folder of files\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar widget = require(\"$:/core/modules/widgets/widget.js\");\n\nexports.info = {\n\tname: \"rendertiddlers\",\n\tsynchronous: true\n};\n\nvar Command = function(params,commander,callback) {\n\tthis.params = params;\n\tthis.commander = commander;\n\tthis.callback = callback;\n};\n\nCommand.prototype.execute = function() {\n\tif(this.params.length < 2) {\n\t\treturn \"Missing filename\";\n\t}\n\tvar self = this,\n\t\tfs = require(\"fs\"),\n\t\tpath = require(\"path\"),\n\t\twiki = this.commander.wiki,\n\t\tfilter = this.params[0],\n\t\ttemplate = this.params[1],\n\t\toutputPath = this.commander.outputPath,\n\t\tpathname = path.resolve(outputPath,this.params[2]),\t\t\n\t\ttype = this.params[3] || \"text/html\",\n\t\textension = this.params[4] || \".html\",\n\t\tdeleteDirectory = (this.params[5] || \"\").toLowerCase() !== \"noclean\",\n\t\ttiddlers = wiki.filterTiddlers(filter);\n\tif(deleteDirectory) {\n\t\t$tw.utils.deleteDirectory(pathname);\n\t}\n\t$tw.utils.each(tiddlers,function(title) {\n\t\tvar parser = wiki.parseTiddler(template),\n\t\t\twidgetNode = wiki.makeWidget(parser,{variables: {currentTiddler: title}}),\n\t\t\tcontainer = $tw.fakeDocument.createElement(\"div\");\n\t\twidgetNode.render(container,null);\n\t\tvar text = type === \"text/html\" ? container.innerHTML : container.textContent,\n\t\t\texportPath = null;\n\t\tif($tw.utils.hop($tw.macros,\"tv-get-export-path\")) {\n\t\t\tvar macroPath = $tw.macros[\"tv-get-export-path\"].run.apply(self,[title]);\n\t\t\tif(macroPath) {\n\t\t\t\texportPath = path.resolve(outputPath,macroPath + extension);\n\t\t\t}\n\t\t}\n\t\tvar finalPath = exportPath || path.resolve(pathname,encodeURIComponent(title) + extension);\n\t\t$tw.utils.createFileDirectories(finalPath);\n\t\tfs.writeFileSync(finalPath,text,\"utf8\");\n\t});\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
            "title": "$:/core/modules/commands/rendertiddlers.js",
            "type": "application/javascript",
            "module-type": "command"
        },
        "$:/core/modules/commands/savelibrarytiddlers.js": {
            "text": "/*\\\ntitle: $:/core/modules/commands/savelibrarytiddlers.js\ntype: application/javascript\nmodule-type: command\n\nCommand to save the subtiddlers of a bundle tiddler as a series of JSON files\n\n--savelibrarytiddlers <tiddler> <pathname> <skinnylisting>\n\nThe tiddler identifies the bundle tiddler that contains the subtiddlers.\n\nThe pathname specifies the pathname to the folder in which the JSON files should be saved. The filename is the URL encoded title of the subtiddler.\n\nThe skinnylisting specifies the title of the tiddler to which a JSON catalogue of the subtiddlers will be saved. The JSON file contains the same data as the bundle tiddler but with the `text` field removed.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"savelibrarytiddlers\",\n\tsynchronous: true\n};\n\nvar Command = function(params,commander,callback) {\n\tthis.params = params;\n\tthis.commander = commander;\n\tthis.callback = callback;\n};\n\nCommand.prototype.execute = function() {\n\tif(this.params.length < 2) {\n\t\treturn \"Missing filename\";\n\t}\n\tvar self = this,\n\t\tfs = require(\"fs\"),\n\t\tpath = require(\"path\"),\n\t\tcontainerTitle = this.params[0],\n\t\tfilter = this.params[1],\n\t\tbasepath = this.params[2],\n\t\tskinnyListTitle = this.params[3];\n\t// Get the container tiddler as data\n\tvar containerData = self.commander.wiki.getTiddlerDataCached(containerTitle,undefined);\n\tif(!containerData) {\n\t\treturn \"'\" + containerTitle + \"' is not a tiddler bundle\";\n\t}\n\t// Filter the list of plugins\n\tvar pluginList = [];\n\t$tw.utils.each(containerData.tiddlers,function(tiddler,title) {\n\t\tpluginList.push(title);\n\t});\n\tvar filteredPluginList;\n\tif(filter) {\n\t\tfilteredPluginList = self.commander.wiki.filterTiddlers(filter,null,self.commander.wiki.makeTiddlerIterator(pluginList));\n\t} else {\n\t\tfilteredPluginList = pluginList;\n\t}\n\t// Iterate through the plugins\n\tvar skinnyList = [];\n\t$tw.utils.each(filteredPluginList,function(title) {\n\t\tvar tiddler = containerData.tiddlers[title];\n\t\t// Save each JSON file and collect the skinny data\n\t\tvar pathname = path.resolve(self.commander.outputPath,basepath + encodeURIComponent(title) + \".json\");\n\t\t$tw.utils.createFileDirectories(pathname);\n\t\tfs.writeFileSync(pathname,JSON.stringify(tiddler,null,$tw.config.preferences.jsonSpaces),\"utf8\");\n\t\t// Collect the skinny list data\n\t\tvar pluginTiddlers = JSON.parse(tiddler.text),\n\t\t\treadmeContent = (pluginTiddlers.tiddlers[title + \"/readme\"] || {}).text,\n\t\t\ticonTiddler = pluginTiddlers.tiddlers[title + \"/icon\"] || {},\n\t\t\ticonType = iconTiddler.type,\n\t\t\ticonText = iconTiddler.text,\n\t\t\ticonContent;\n\t\tif(iconType && iconText) {\n\t\t\ticonContent = $tw.utils.makeDataUri(iconText,iconType);\n\t\t}\n\t\tskinnyList.push($tw.utils.extend({},tiddler,{text: undefined, readme: readmeContent, icon: iconContent}));\n\t});\n\t// Save the catalogue tiddler\n\tif(skinnyListTitle) {\n\t\tself.commander.wiki.setTiddlerData(skinnyListTitle,skinnyList);\n\t}\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
            "title": "$:/core/modules/commands/savelibrarytiddlers.js",
            "type": "application/javascript",
            "module-type": "command"
        },
        "$:/core/modules/commands/savetiddler.js": {
            "text": "/*\\\ntitle: $:/core/modules/commands/savetiddler.js\ntype: application/javascript\nmodule-type: command\n\nCommand to save the content of a tiddler to a file\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"savetiddler\",\n\tsynchronous: false\n};\n\nvar Command = function(params,commander,callback) {\n\tthis.params = params;\n\tthis.commander = commander;\n\tthis.callback = callback;\n};\n\nCommand.prototype.execute = function() {\n\tif(this.params.length < 2) {\n\t\treturn \"Missing filename\";\n\t}\n\tvar self = this,\n\t\tfs = require(\"fs\"),\n\t\tpath = require(\"path\"),\n\t\ttitle = this.params[0],\n\t\tfilename = path.resolve(this.commander.outputPath,this.params[1]),\n\t\ttiddler = this.commander.wiki.getTiddler(title);\n\tif(tiddler) {\n\t\tvar type = tiddler.fields.type || \"text/vnd.tiddlywiki\",\n\t\t\tcontentTypeInfo = $tw.config.contentTypeInfo[type] || {encoding: \"utf8\"};\n\t\t$tw.utils.createFileDirectories(filename);\n\t\tfs.writeFile(filename,tiddler.fields.text,contentTypeInfo.encoding,function(err) {\n\t\t\tself.callback(err);\n\t\t});\n\t} else {\n\t\treturn \"Missing tiddler: \" + title;\n\t}\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
            "title": "$:/core/modules/commands/savetiddler.js",
            "type": "application/javascript",
            "module-type": "command"
        },
        "$:/core/modules/commands/savetiddlers.js": {
            "text": "/*\\\ntitle: $:/core/modules/commands/savetiddlers.js\ntype: application/javascript\nmodule-type: command\n\nCommand to save several tiddlers to a folder of files\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar widget = require(\"$:/core/modules/widgets/widget.js\");\n\nexports.info = {\n\tname: \"savetiddlers\",\n\tsynchronous: true\n};\n\nvar Command = function(params,commander,callback) {\n\tthis.params = params;\n\tthis.commander = commander;\n\tthis.callback = callback;\n};\n\nCommand.prototype.execute = function() {\n\tif(this.params.length < 1) {\n\t\treturn \"Missing filename\";\n\t}\n\tvar self = this,\n\t\tfs = require(\"fs\"),\n\t\tpath = require(\"path\"),\n\t\twiki = this.commander.wiki,\n\t\tfilter = this.params[0],\n\t\tpathname = path.resolve(this.commander.outputPath,this.params[1]),\n\t\tdeleteDirectory = (this.params[2] || \"\").toLowerCase() !== \"noclean\",\n\t\ttiddlers = wiki.filterTiddlers(filter);\n\tif(deleteDirectory) {\n\t\t$tw.utils.deleteDirectory(pathname);\n\t}\n\t$tw.utils.createDirectory(pathname);\n\t$tw.utils.each(tiddlers,function(title) {\n\t\tvar tiddler = self.commander.wiki.getTiddler(title),\n\t\t\ttype = tiddler.fields.type || \"text/vnd.tiddlywiki\",\n\t\t\tcontentTypeInfo = $tw.config.contentTypeInfo[type] || {encoding: \"utf8\"},\n\t\t\tfilename = path.resolve(pathname,encodeURIComponent(title));\n\t\tfs.writeFileSync(filename,tiddler.fields.text,contentTypeInfo.encoding);\n\t});\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
            "title": "$:/core/modules/commands/savetiddlers.js",
            "type": "application/javascript",
            "module-type": "command"
        },
        "$:/core/modules/commands/server.js": {
            "text": "/*\\\ntitle: $:/core/modules/commands/server.js\ntype: application/javascript\nmodule-type: command\n\nServe tiddlers over http\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nif($tw.node) {\n\tvar util = require(\"util\"),\n\t\tfs = require(\"fs\"),\n\t\turl = require(\"url\"),\n\t\tpath = require(\"path\"),\n\t\thttp = require(\"http\");\n}\n\nexports.info = {\n\tname: \"server\",\n\tsynchronous: true\n};\n\n/*\nA simple HTTP server with regexp-based routes\n*/\nfunction SimpleServer(options) {\n\tthis.routes = options.routes || [];\n\tthis.wiki = options.wiki;\n\tthis.variables = options.variables || {};\n}\n\nSimpleServer.prototype.set = function(obj) {\n\tvar self = this;\n\t$tw.utils.each(obj,function(value,name) {\n\t\tself.variables[name] = value;\n\t});\n};\n\nSimpleServer.prototype.get = function(name) {\n\treturn this.variables[name];\n};\n\nSimpleServer.prototype.addRoute = function(route) {\n\tthis.routes.push(route);\n};\n\nSimpleServer.prototype.findMatchingRoute = function(request,state) {\n\tvar pathprefix = this.get(\"pathprefix\") || \"\";\n\tfor(var t=0; t<this.routes.length; t++) {\n\t\tvar potentialRoute = this.routes[t],\n\t\t\tpathRegExp = potentialRoute.path,\n\t\t\tpathname = state.urlInfo.pathname,\n\t\t\tmatch;\n\t\tif(pathprefix) {\n\t\t\tif(pathname.substr(0,pathprefix.length) === pathprefix) {\n\t\t\t\tpathname = pathname.substr(pathprefix.length);\n\t\t\t\tmatch = potentialRoute.path.exec(pathname);\n\t\t\t} else {\n\t\t\t\tmatch = false;\n\t\t\t}\n\t\t} else {\n\t\t\tmatch = potentialRoute.path.exec(pathname);\n\t\t}\n\t\tif(match && request.method === potentialRoute.method) {\n\t\t\tstate.params = [];\n\t\t\tfor(var p=1; p<match.length; p++) {\n\t\t\t\tstate.params.push(match[p]);\n\t\t\t}\n\t\t\treturn potentialRoute;\n\t\t}\n\t}\n\treturn null;\n};\n\nSimpleServer.prototype.checkCredentials = function(request,incomingUsername,incomingPassword) {\n\tvar header = request.headers.authorization || \"\",\n\t\ttoken = header.split(/\\s+/).pop() || \"\",\n\t\tauth = $tw.utils.base64Decode(token),\n\t\tparts = auth.split(/:/),\n\t\tusername = parts[0],\n\t\tpassword = parts[1];\n\tif(incomingUsername === username && incomingPassword === password) {\n\t\treturn \"ALLOWED\";\n\t} else {\n\t\treturn \"DENIED\";\n\t}\n};\n\nSimpleServer.prototype.requestHandler = function(request,response) {\n\t// Compose the state object\n\tvar self = this;\n\tvar state = {};\n\tstate.wiki = self.wiki;\n\tstate.server = self;\n\tstate.urlInfo = url.parse(request.url);\n\t// Find the route that matches this path\n\tvar route = self.findMatchingRoute(request,state);\n\t// Check for the username and password if we've got one\n\tvar username = self.get(\"username\"),\n\t\tpassword = self.get(\"password\");\n\tif(username && password) {\n\t\t// Check they match\n\t\tif(self.checkCredentials(request,username,password) !== \"ALLOWED\") {\n\t\t\tvar servername = state.wiki.getTiddlerText(\"$:/SiteTitle\") || \"TiddlyWiki5\";\n\t\t\tresponse.writeHead(401,\"Authentication required\",{\n\t\t\t\t\"WWW-Authenticate\": 'Basic realm=\"Please provide your username and password to login to ' + servername + '\"'\n\t\t\t});\n\t\t\tresponse.end();\n\t\t\treturn;\n\t\t}\n\t}\n\t// Return a 404 if we didn't find a route\n\tif(!route) {\n\t\tresponse.writeHead(404);\n\t\tresponse.end();\n\t\treturn;\n\t}\n\t// Set the encoding for the incoming request\n\t// TODO: Presumably this would need tweaking if we supported PUTting binary tiddlers\n\trequest.setEncoding(\"utf8\");\n\t// Dispatch the appropriate method\n\tswitch(request.method) {\n\t\tcase \"GET\": // Intentional fall-through\n\t\tcase \"DELETE\":\n\t\t\troute.handler(request,response,state);\n\t\t\tbreak;\n\t\tcase \"PUT\":\n\t\t\tvar data = \"\";\n\t\t\trequest.on(\"data\",function(chunk) {\n\t\t\t\tdata += chunk.toString();\n\t\t\t});\n\t\t\trequest.on(\"end\",function() {\n\t\t\t\tstate.data = data;\n\t\t\t\troute.handler(request,response,state);\n\t\t\t});\n\t\t\tbreak;\n\t}\n};\n\t\nSimpleServer.prototype.listen = function(port,host) {\n\thttp.createServer(this.requestHandler.bind(this)).listen(port,host);\n};\n\nvar Command = function(params,commander,callback) {\n\tthis.params = params;\n\tthis.commander = commander;\n\tthis.callback = callback;\n\t// Set up server\n\tthis.server = new SimpleServer({\n\t\twiki: this.commander.wiki\n\t});\n\t// Add route handlers\n\tthis.server.addRoute({\n\t\tmethod: \"PUT\",\n\t\tpath: /^\\/recipes\\/default\\/tiddlers\\/(.+)$/,\n\t\thandler: function(request,response,state) {\n\t\t\tvar title = decodeURIComponent(state.params[0]),\n\t\t\t\tfields = JSON.parse(state.data);\n\t\t\t// Pull up any subfields in the `fields` object\n\t\t\tif(fields.fields) {\n\t\t\t\t$tw.utils.each(fields.fields,function(field,name) {\n\t\t\t\t\tfields[name] = field;\n\t\t\t\t});\n\t\t\t\tdelete fields.fields;\n\t\t\t}\n\t\t\t// Remove any revision field\n\t\t\tif(fields.revision) {\n\t\t\t\tdelete fields.revision;\n\t\t\t}\n\t\t\tstate.wiki.addTiddler(new $tw.Tiddler(state.wiki.getCreationFields(),fields,{title: title},state.wiki.getModificationFields()));\n\t\t\tvar changeCount = state.wiki.getChangeCount(title).toString();\n\t\t\tresponse.writeHead(204, \"OK\",{\n\t\t\t\tEtag: \"\\\"default/\" + encodeURIComponent(title) + \"/\" + changeCount + \":\\\"\",\n\t\t\t\t\"Content-Type\": \"text/plain\"\n\t\t\t});\n\t\t\tresponse.end();\n\t\t}\n\t});\n\tthis.server.addRoute({\n\t\tmethod: \"DELETE\",\n\t\tpath: /^\\/bags\\/default\\/tiddlers\\/(.+)$/,\n\t\thandler: function(request,response,state) {\n\t\t\tvar title = decodeURIComponent(state.params[0]);\n\t\t\tstate.wiki.deleteTiddler(title);\n\t\t\tresponse.writeHead(204, \"OK\", {\n\t\t\t\t\"Content-Type\": \"text/plain\"\n\t\t\t});\n\t\t\tresponse.end();\n\t\t}\n\t});\n\tthis.server.addRoute({\n\t\tmethod: \"GET\",\n\t\tpath: /^\\/$/,\n\t\thandler: function(request,response,state) {\n\t\t\tresponse.writeHead(200, {\"Content-Type\": state.server.get(\"serveType\")});\n\t\t\tvar text = state.wiki.renderTiddler(state.server.get(\"renderType\"),state.server.get(\"rootTiddler\"));\n\t\t\tresponse.end(text,\"utf8\");\n\t\t}\n\t});\n\tthis.server.addRoute({\n\t\tmethod: \"GET\",\n\t\tpath: /^\\/status$/,\n\t\thandler: function(request,response,state) {\n\t\t\tresponse.writeHead(200, {\"Content-Type\": \"application/json\"});\n\t\t\tvar text = JSON.stringify({\n\t\t\t\tusername: state.server.get(\"username\"),\n\t\t\t\tspace: {\n\t\t\t\t\trecipe: \"default\"\n\t\t\t\t},\n\t\t\t\ttiddlywiki_version: $tw.version\n\t\t\t});\n\t\t\tresponse.end(text,\"utf8\");\n\t\t}\n\t});\n\tthis.server.addRoute({\n\t\tmethod: \"GET\",\n\t\tpath: /^\\/favicon.ico$/,\n\t\thandler: function(request,response,state) {\n\t\t\tresponse.writeHead(200, {\"Content-Type\": \"image/x-icon\"});\n\t\t\tvar buffer = state.wiki.getTiddlerText(\"$:/favicon.ico\",\"\");\n\t\t\tresponse.end(buffer,\"base64\");\n\t\t}\n\t});\n\tthis.server.addRoute({\n\t\tmethod: \"GET\",\n\t\tpath: /^\\/recipes\\/default\\/tiddlers.json$/,\n\t\thandler: function(request,response,state) {\n\t\t\tresponse.writeHead(200, {\"Content-Type\": \"application/json\"});\n\t\t\tvar tiddlers = [];\n\t\t\tstate.wiki.forEachTiddler({sortField: \"title\"},function(title,tiddler) {\n\t\t\t\tvar tiddlerFields = {};\n\t\t\t\t$tw.utils.each(tiddler.fields,function(field,name) {\n\t\t\t\t\tif(name !== \"text\") {\n\t\t\t\t\t\ttiddlerFields[name] = tiddler.getFieldString(name);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\ttiddlerFields.revision = state.wiki.getChangeCount(title);\n\t\t\t\ttiddlerFields.type = tiddlerFields.type || \"text/vnd.tiddlywiki\";\n\t\t\t\ttiddlers.push(tiddlerFields);\n\t\t\t});\n\t\t\tvar text = JSON.stringify(tiddlers);\n\t\t\tresponse.end(text,\"utf8\");\n\t\t}\n\t});\n\tthis.server.addRoute({\n\t\tmethod: \"GET\",\n\t\tpath: /^\\/recipes\\/default\\/tiddlers\\/(.+)$/,\n\t\thandler: function(request,response,state) {\n\t\t\tvar title = decodeURIComponent(state.params[0]),\n\t\t\t\ttiddler = state.wiki.getTiddler(title),\n\t\t\t\ttiddlerFields = {},\n\t\t\t\tknownFields = [\n\t\t\t\t\t\"bag\", \"created\", \"creator\", \"modified\", \"modifier\", \"permissions\", \"recipe\", \"revision\", \"tags\", \"text\", \"title\", \"type\", \"uri\"\n\t\t\t\t];\n\t\t\tif(tiddler) {\n\t\t\t\t$tw.utils.each(tiddler.fields,function(field,name) {\n\t\t\t\t\tvar value = tiddler.getFieldString(name);\n\t\t\t\t\tif(knownFields.indexOf(name) !== -1) {\n\t\t\t\t\t\ttiddlerFields[name] = value;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttiddlerFields.fields = tiddlerFields.fields || {};\n\t\t\t\t\t\ttiddlerFields.fields[name] = value;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\ttiddlerFields.revision = state.wiki.getChangeCount(title);\n\t\t\t\ttiddlerFields.type = tiddlerFields.type || \"text/vnd.tiddlywiki\";\n\t\t\t\tresponse.writeHead(200, {\"Content-Type\": \"application/json\"});\n\t\t\t\tresponse.end(JSON.stringify(tiddlerFields),\"utf8\");\n\t\t\t} else {\n\t\t\t\tresponse.writeHead(404);\n\t\t\t\tresponse.end();\n\t\t\t}\n\t\t}\n\t});\n};\n\nCommand.prototype.execute = function() {\n\tif(!$tw.boot.wikiTiddlersPath) {\n\t\t$tw.utils.warning(\"Warning: Wiki folder '\" + $tw.boot.wikiPath + \"' does not exist or is missing a tiddlywiki.info file\");\n\t}\n\tvar port = this.params[0] || \"8080\",\n\t\trootTiddler = this.params[1] || \"$:/core/save/all\",\n\t\trenderType = this.params[2] || \"text/plain\",\n\t\tserveType = this.params[3] || \"text/html\",\n\t\tusername = this.params[4],\n\t\tpassword = this.params[5],\n\t\thost = this.params[6] || \"127.0.0.1\",\n\t\tpathprefix = this.params[7];\n\tthis.server.set({\n\t\trootTiddler: rootTiddler,\n\t\trenderType: renderType,\n\t\tserveType: serveType,\n\t\tusername: username,\n\t\tpassword: password,\n\t\tpathprefix: pathprefix\n\t});\n\tthis.server.listen(port,host);\n\tconsole.log(\"Serving on \" + host + \":\" + port);\n\tconsole.log(\"(press ctrl-C to exit)\");\n\t// Warn if required plugins are missing\n\tif(!$tw.wiki.getTiddler(\"$:/plugins/tiddlywiki/tiddlyweb\") || !$tw.wiki.getTiddler(\"$:/plugins/tiddlywiki/filesystem\")) {\n\t\t$tw.utils.warning(\"Warning: Plugins required for client-server operation (\\\"tiddlywiki/filesystem\\\" and \\\"tiddlywiki/tiddlyweb\\\") are missing from tiddlywiki.info file\");\n\t}\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
            "title": "$:/core/modules/commands/server.js",
            "type": "application/javascript",
            "module-type": "command"
        },
        "$:/core/modules/commands/setfield.js": {
            "text": "/*\\\ntitle: $:/core/modules/commands/setfield.js\ntype: application/javascript\nmodule-type: command\n\nCommand to modify selected tiddlers to set a field to the text of a template tiddler that has been wikified with the selected tiddler as the current tiddler.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar widget = require(\"$:/core/modules/widgets/widget.js\");\n\nexports.info = {\n\tname: \"setfield\",\n\tsynchronous: true\n};\n\nvar Command = function(params,commander,callback) {\n\tthis.params = params;\n\tthis.commander = commander;\n\tthis.callback = callback;\n};\n\nCommand.prototype.execute = function() {\n\tif(this.params.length < 4) {\n\t\treturn \"Missing parameters\";\n\t}\n\tvar self = this,\n\t\twiki = this.commander.wiki,\n\t\tfilter = this.params[0],\n\t\tfieldname = this.params[1] || \"text\",\n\t\ttemplatetitle = this.params[2],\n\t\trendertype = this.params[3] || \"text/plain\",\n\t\ttiddlers = wiki.filterTiddlers(filter);\n\t$tw.utils.each(tiddlers,function(title) {\n\t\tvar parser = wiki.parseTiddler(templatetitle),\n\t\t\tnewFields = {},\n\t\t\ttiddler = wiki.getTiddler(title);\n\t\tif(parser) {\n\t\t\tvar widgetNode = wiki.makeWidget(parser,{variables: {currentTiddler: title}});\n\t\t\tvar container = $tw.fakeDocument.createElement(\"div\");\n\t\t\twidgetNode.render(container,null);\n\t\t\tnewFields[fieldname] = rendertype === \"text/html\" ? container.innerHTML : container.textContent;\n\t\t} else {\n\t\t\tnewFields[fieldname] = undefined;\n\t\t}\n\t\twiki.addTiddler(new $tw.Tiddler(tiddler,newFields));\n\t});\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
            "title": "$:/core/modules/commands/setfield.js",
            "type": "application/javascript",
            "module-type": "command"
        },
        "$:/core/modules/commands/unpackplugin.js": {
            "text": "/*\\\ntitle: $:/core/modules/commands/unpackplugin.js\ntype: application/javascript\nmodule-type: command\n\nCommand to extract the shadow tiddlers from within a plugin\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"unpackplugin\",\n\tsynchronous: true\n};\n\nvar Command = function(params,commander,callback) {\n\tthis.params = params;\n\tthis.commander = commander;\n\tthis.callback = callback;\n};\n\nCommand.prototype.execute = function() {\n\tif(this.params.length < 1) {\n\t\treturn \"Missing plugin name\";\n\t}\n\tvar self = this,\n\t\ttitle = this.params[0],\n\t\tpluginData = this.commander.wiki.getTiddlerDataCached(title);\n\tif(!pluginData) {\n\t\treturn \"Plugin '\" + title + \"' not found\";\n\t}\n\t$tw.utils.each(pluginData.tiddlers,function(tiddler) {\n\t\tself.commander.wiki.addTiddler(new $tw.Tiddler(tiddler));\n\t});\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
            "title": "$:/core/modules/commands/unpackplugin.js",
            "type": "application/javascript",
            "module-type": "command"
        },
        "$:/core/modules/commands/verbose.js": {
            "text": "/*\\\ntitle: $:/core/modules/commands/verbose.js\ntype: application/javascript\nmodule-type: command\n\nVerbose command\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"verbose\",\n\tsynchronous: true\n};\n\nvar Command = function(params,commander) {\n\tthis.params = params;\n\tthis.commander = commander;\n};\n\nCommand.prototype.execute = function() {\n\tthis.commander.verbose = true;\n\t// Output the boot message log\n\tthis.commander.streams.output.write(\"Boot log:\\n  \" + $tw.boot.logMessages.join(\"\\n  \") + \"\\n\");\n\treturn null; // No error\n};\n\nexports.Command = Command;\n\n})();\n",
            "title": "$:/core/modules/commands/verbose.js",
            "type": "application/javascript",
            "module-type": "command"
        },
        "$:/core/modules/commands/version.js": {
            "text": "/*\\\ntitle: $:/core/modules/commands/version.js\ntype: application/javascript\nmodule-type: command\n\nVersion command\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"version\",\n\tsynchronous: true\n};\n\nvar Command = function(params,commander) {\n\tthis.params = params;\n\tthis.commander = commander;\n};\n\nCommand.prototype.execute = function() {\n\tthis.commander.streams.output.write($tw.version + \"\\n\");\n\treturn null; // No error\n};\n\nexports.Command = Command;\n\n})();\n",
            "title": "$:/core/modules/commands/version.js",
            "type": "application/javascript",
            "module-type": "command"
        },
        "$:/core/modules/config.js": {
            "text": "/*\\\ntitle: $:/core/modules/config.js\ntype: application/javascript\nmodule-type: config\n\nCore configuration constants\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.preferences = {};\n\nexports.preferences.notificationDuration = 3 * 1000;\nexports.preferences.jsonSpaces = 4;\n\nexports.textPrimitives = {\n\tupperLetter: \"[A-Z\\u00c0-\\u00d6\\u00d8-\\u00de\\u0150\\u0170]\",\n\tlowerLetter: \"[a-z\\u00df-\\u00f6\\u00f8-\\u00ff\\u0151\\u0171]\",\n\tanyLetter:   \"[A-Za-z0-9\\u00c0-\\u00d6\\u00d8-\\u00de\\u00df-\\u00f6\\u00f8-\\u00ff\\u0150\\u0170\\u0151\\u0171]\",\n\tblockPrefixLetters:\t\"[A-Za-z0-9-_\\u00c0-\\u00d6\\u00d8-\\u00de\\u00df-\\u00f6\\u00f8-\\u00ff\\u0150\\u0170\\u0151\\u0171]\"\n};\n\nexports.textPrimitives.unWikiLink = \"~\";\nexports.textPrimitives.wikiLink = exports.textPrimitives.upperLetter + \"+\" +\n\texports.textPrimitives.lowerLetter + \"+\" +\n\texports.textPrimitives.upperLetter +\n\texports.textPrimitives.anyLetter + \"*\";\n\nexports.htmlEntities = {quot:34, amp:38, apos:39, lt:60, gt:62, nbsp:160, iexcl:161, cent:162, pound:163, curren:164, yen:165, brvbar:166, sect:167, uml:168, copy:169, ordf:170, laquo:171, not:172, shy:173, reg:174, macr:175, deg:176, plusmn:177, sup2:178, sup3:179, acute:180, micro:181, para:182, middot:183, cedil:184, sup1:185, ordm:186, raquo:187, frac14:188, frac12:189, frac34:190, iquest:191, Agrave:192, Aacute:193, Acirc:194, Atilde:195, Auml:196, Aring:197, AElig:198, Ccedil:199, Egrave:200, Eacute:201, Ecirc:202, Euml:203, Igrave:204, Iacute:205, Icirc:206, Iuml:207, ETH:208, Ntilde:209, Ograve:210, Oacute:211, Ocirc:212, Otilde:213, Ouml:214, times:215, Oslash:216, Ugrave:217, Uacute:218, Ucirc:219, Uuml:220, Yacute:221, THORN:222, szlig:223, agrave:224, aacute:225, acirc:226, atilde:227, auml:228, aring:229, aelig:230, ccedil:231, egrave:232, eacute:233, ecirc:234, euml:235, igrave:236, iacute:237, icirc:238, iuml:239, eth:240, ntilde:241, ograve:242, oacute:243, ocirc:244, otilde:245, ouml:246, divide:247, oslash:248, ugrave:249, uacute:250, ucirc:251, uuml:252, yacute:253, thorn:254, yuml:255, OElig:338, oelig:339, Scaron:352, scaron:353, Yuml:376, fnof:402, circ:710, tilde:732, Alpha:913, Beta:914, Gamma:915, Delta:916, Epsilon:917, Zeta:918, Eta:919, Theta:920, Iota:921, Kappa:922, Lambda:923, Mu:924, Nu:925, Xi:926, Omicron:927, Pi:928, Rho:929, Sigma:931, Tau:932, Upsilon:933, Phi:934, Chi:935, Psi:936, Omega:937, alpha:945, beta:946, gamma:947, delta:948, epsilon:949, zeta:950, eta:951, theta:952, iota:953, kappa:954, lambda:955, mu:956, nu:957, xi:958, omicron:959, pi:960, rho:961, sigmaf:962, sigma:963, tau:964, upsilon:965, phi:966, chi:967, psi:968, omega:969, thetasym:977, upsih:978, piv:982, ensp:8194, emsp:8195, thinsp:8201, zwnj:8204, zwj:8205, lrm:8206, rlm:8207, ndash:8211, mdash:8212, lsquo:8216, rsquo:8217, sbquo:8218, ldquo:8220, rdquo:8221, bdquo:8222, dagger:8224, Dagger:8225, bull:8226, hellip:8230, permil:8240, prime:8242, Prime:8243, lsaquo:8249, rsaquo:8250, oline:8254, frasl:8260, euro:8364, image:8465, weierp:8472, real:8476, trade:8482, alefsym:8501, larr:8592, uarr:8593, rarr:8594, darr:8595, harr:8596, crarr:8629, lArr:8656, uArr:8657, rArr:8658, dArr:8659, hArr:8660, forall:8704, part:8706, exist:8707, empty:8709, nabla:8711, isin:8712, notin:8713, ni:8715, prod:8719, sum:8721, minus:8722, lowast:8727, radic:8730, prop:8733, infin:8734, ang:8736, and:8743, or:8744, cap:8745, cup:8746, int:8747, there4:8756, sim:8764, cong:8773, asymp:8776, ne:8800, equiv:8801, le:8804, ge:8805, sub:8834, sup:8835, nsub:8836, sube:8838, supe:8839, oplus:8853, otimes:8855, perp:8869, sdot:8901, lceil:8968, rceil:8969, lfloor:8970, rfloor:8971, lang:9001, rang:9002, loz:9674, spades:9824, clubs:9827, hearts:9829, diams:9830 };\n\nexports.htmlVoidElements = \"area,base,br,col,command,embed,hr,img,input,keygen,link,meta,param,source,track,wbr\".split(\",\");\n\nexports.htmlBlockElements = \"address,article,aside,audio,blockquote,canvas,dd,div,dl,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,li,noscript,ol,output,p,pre,section,table,tfoot,ul,video\".split(\",\");\n\nexports.htmlUnsafeElements = \"script\".split(\",\");\n\n})();\n",
            "title": "$:/core/modules/config.js",
            "type": "application/javascript",
            "module-type": "config"
        },
        "$:/core/modules/deserializers.js": {
            "text": "/*\\\ntitle: $:/core/modules/deserializers.js\ntype: application/javascript\nmodule-type: tiddlerdeserializer\n\nFunctions to deserialise tiddlers from a block of text\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nUtility function to parse an old-style tiddler DIV in a *.tid file. It looks like this:\n\n<div title=\"Title\" creator=\"JoeBloggs\" modifier=\"JoeBloggs\" created=\"201102111106\" modified=\"201102111310\" tags=\"myTag [[my long tag]]\">\n<pre>The text of the tiddler (without the expected HTML encoding).\n</pre>\n</div>\n\nNote that the field attributes are HTML encoded, but that the body of the <PRE> tag is not encoded.\n\nWhen these tiddler DIVs are encountered within a TiddlyWiki HTML file then the body is encoded in the usual way.\n*/\nvar parseTiddlerDiv = function(text /* [,fields] */) {\n\t// Slot together the default results\n\tvar result = {};\n\tif(arguments.length > 1) {\n\t\tfor(var f=1; f<arguments.length; f++) {\n\t\t\tvar fields = arguments[f];\n\t\t\tfor(var t in fields) {\n\t\t\t\tresult[t] = fields[t];\t\t\n\t\t\t}\n\t\t}\n\t}\n\t// Parse the DIV body\n\tvar startRegExp = /^\\s*<div\\s+([^>]*)>(\\s*<pre>)?/gi,\n\t\tendRegExp,\n\t\tmatch = startRegExp.exec(text);\n\tif(match) {\n\t\t// Old-style DIVs don't have the <pre> tag\n\t\tif(match[2]) {\n\t\t\tendRegExp = /<\\/pre>\\s*<\\/div>\\s*$/gi;\n\t\t} else {\n\t\t\tendRegExp = /<\\/div>\\s*$/gi;\n\t\t}\n\t\tvar endMatch = endRegExp.exec(text);\n\t\tif(endMatch) {\n\t\t\t// Extract the text\n\t\t\tresult.text = text.substring(match.index + match[0].length,endMatch.index);\n\t\t\t// Process the attributes\n\t\t\tvar attrRegExp = /\\s*([^=\\s]+)\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)')/gi,\n\t\t\t\tattrMatch;\n\t\t\tdo {\n\t\t\t\tattrMatch = attrRegExp.exec(match[1]);\n\t\t\t\tif(attrMatch) {\n\t\t\t\t\tvar name = attrMatch[1];\n\t\t\t\t\tvar value = attrMatch[2] !== undefined ? attrMatch[2] : attrMatch[3];\n\t\t\t\t\tresult[name] = value;\n\t\t\t\t}\n\t\t\t} while(attrMatch);\n\t\t\treturn result;\n\t\t}\n\t}\n\treturn undefined;\n};\n\nexports[\"application/x-tiddler-html-div\"] = function(text,fields) {\n\treturn [parseTiddlerDiv(text,fields)];\n};\n\nexports[\"application/json\"] = function(text,fields) {\n\tvar incoming,\n\t\tresults = [];\n\ttry {\n\t\tincoming = JSON.parse(text);\n\t} catch(e) {\n\t\tincoming = [{\n\t\t\ttitle: \"JSON error: \" + e,\n\t\t\ttext: \"\"\n\t\t}]\n\t}\n\tif(!$tw.utils.isArray(incoming)) {\n\t\tincoming = [incoming];\n\t}\n\tfor(var t=0; t<incoming.length; t++) {\n\t\tvar incomingFields = incoming[t],\n\t\t\tfields = {};\n\t\tfor(var f in incomingFields) {\n\t\t\tif(typeof incomingFields[f] === \"string\") {\n\t\t\t\tfields[f] = incomingFields[f];\n\t\t\t}\n\t\t}\n\t\tresults.push(fields);\n\t}\n\treturn results;\n};\n\n/*\nParse an HTML file into tiddlers. There are three possibilities:\n# A TiddlyWiki classic HTML file containing `text/x-tiddlywiki` tiddlers\n# A TiddlyWiki5 HTML file containing `text/vnd.tiddlywiki` tiddlers\n# An ordinary HTML file\n*/\nexports[\"text/html\"] = function(text,fields) {\n\t// Check if we've got a store area\n\tvar storeAreaMarkerRegExp = /<div id=[\"']?storeArea['\"]?( style=[\"']?display:none;[\"']?)?>/gi,\n\t\tmatch = storeAreaMarkerRegExp.exec(text);\n\tif(match) {\n\t\t// If so, it's either a classic TiddlyWiki file or an unencrypted TW5 file\n\t\t// First read the normal tiddlers\n\t\tvar results = deserializeTiddlyWikiFile(text,storeAreaMarkerRegExp.lastIndex,!!match[1],fields);\n\t\t// Then any system tiddlers\n\t\tvar systemAreaMarkerRegExp = /<div id=[\"']?systemArea['\"]?( style=[\"']?display:none;[\"']?)?>/gi,\n\t\t\tsysMatch = systemAreaMarkerRegExp.exec(text);\n\t\tif(sysMatch) {\n\t\t\tresults.push.apply(results,deserializeTiddlyWikiFile(text,systemAreaMarkerRegExp.lastIndex,!!sysMatch[1],fields));\n\t\t}\n\t\treturn results;\n\t} else {\n\t\t// Check whether we've got an encrypted file\n\t\tvar encryptedStoreArea = $tw.utils.extractEncryptedStoreArea(text);\n\t\tif(encryptedStoreArea) {\n\t\t\t// If so, attempt to decrypt it using the current password\n\t\t\treturn $tw.utils.decryptStoreArea(encryptedStoreArea);\n\t\t} else {\n\t\t\t// It's not a TiddlyWiki so we'll return the entire HTML file as a tiddler\n\t\t\treturn deserializeHtmlFile(text,fields);\n\t\t}\n\t}\n};\n\nfunction deserializeHtmlFile(text,fields) {\n\tvar result = {};\n\t$tw.utils.each(fields,function(value,name) {\n\t\tresult[name] = value;\n\t});\n\tresult.text = text;\n\tresult.type = \"text/html\";\n\treturn [result];\n}\n\nfunction deserializeTiddlyWikiFile(text,storeAreaEnd,isTiddlyWiki5,fields) {\n\tvar results = [],\n\t\tendOfDivRegExp = /(<\\/div>\\s*)/gi,\n\t\tstartPos = storeAreaEnd,\n\t\tdefaultType = isTiddlyWiki5 ? undefined : \"text/x-tiddlywiki\";\n\tendOfDivRegExp.lastIndex = startPos;\n\tvar match = endOfDivRegExp.exec(text);\n\twhile(match) {\n\t\tvar endPos = endOfDivRegExp.lastIndex,\n\t\t\ttiddlerFields = parseTiddlerDiv(text.substring(startPos,endPos),fields,{type: defaultType});\n\t\tif(!tiddlerFields) {\n\t\t\tbreak;\n\t\t}\n\t\t$tw.utils.each(tiddlerFields,function(value,name) {\n\t\t\tif(typeof value === \"string\") {\n\t\t\t\ttiddlerFields[name] = $tw.utils.htmlDecode(value);\n\t\t\t}\n\t\t});\n\t\tif(tiddlerFields.text !== null) {\n\t\t\tresults.push(tiddlerFields);\n\t\t}\n\t\tstartPos = endPos;\n\t\tmatch = endOfDivRegExp.exec(text);\n\t}\n\treturn results;\n}\n\n})();\n",
            "title": "$:/core/modules/deserializers.js",
            "type": "application/javascript",
            "module-type": "tiddlerdeserializer"
        },
        "$:/core/modules/editor/engines/framed.js": {
            "text": "/*\\\ntitle: $:/core/modules/editor/engines/framed.js\ntype: application/javascript\nmodule-type: library\n\nText editor engine based on a simple input or textarea within an iframe. This is done so that the selection is preserved even when clicking away from the textarea\n\n\\*/\n(function(){\n\n/*jslint node: true,browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar HEIGHT_VALUE_TITLE = \"$:/config/TextEditor/EditorHeight/Height\";\n\nfunction FramedEngine(options) {\n\t// Save our options\n\toptions = options || {};\n\tthis.widget = options.widget;\n\tthis.value = options.value;\n\tthis.parentNode = options.parentNode;\n\tthis.nextSibling = options.nextSibling;\n\t// Create our hidden dummy text area for reading styles\n\tthis.dummyTextArea = this.widget.document.createElement(\"textarea\");\n\tif(this.widget.editClass) {\n\t\tthis.dummyTextArea.className = this.widget.editClass;\n\t}\n\tthis.dummyTextArea.setAttribute(\"hidden\",\"true\");\n\tthis.parentNode.insertBefore(this.dummyTextArea,this.nextSibling);\n\tthis.widget.domNodes.push(this.dummyTextArea);\n\t// Create the iframe\n\tthis.iframeNode = this.widget.document.createElement(\"iframe\");\n\tthis.parentNode.insertBefore(this.iframeNode,this.nextSibling);\n\tthis.iframeDoc = this.iframeNode.contentWindow.document;\n\t// (Firefox requires us to put some empty content in the iframe)\n\tthis.iframeDoc.open();\n\tthis.iframeDoc.write(\"\");\n\tthis.iframeDoc.close();\n\t// Style the iframe\n\tthis.iframeNode.className = this.dummyTextArea.className;\n\tthis.iframeNode.style.border = \"none\";\n\tthis.iframeNode.style.padding = \"0\";\n\tthis.iframeNode.style.resize = \"none\";\n\tthis.iframeDoc.body.style.margin = \"0\";\n\tthis.iframeDoc.body.style.padding = \"0\";\n\tthis.widget.domNodes.push(this.iframeNode);\n\t// Construct the textarea or input node\n\tvar tag = this.widget.editTag;\n\tif($tw.config.htmlUnsafeElements.indexOf(tag) !== -1) {\n\t\ttag = \"input\";\n\t}\n\tthis.domNode = this.iframeDoc.createElement(tag);\n\t// Set the text\n\tif(this.widget.editTag === \"textarea\") {\n\t\tthis.domNode.appendChild(this.iframeDoc.createTextNode(this.value));\n\t} else {\n\t\tthis.domNode.value = this.value;\n\t}\n\t// Set the attributes\n\tif(this.widget.editType) {\n\t\tthis.domNode.setAttribute(\"type\",this.widget.editType);\n\t}\n\tif(this.widget.editPlaceholder) {\n\t\tthis.domNode.setAttribute(\"placeholder\",this.widget.editPlaceholder);\n\t}\n\tif(this.widget.editSize) {\n\t\tthis.domNode.setAttribute(\"size\",this.widget.editSize);\n\t}\n\tif(this.widget.editRows) {\n\t\tthis.domNode.setAttribute(\"rows\",this.widget.editRows);\n\t}\n\t// Copy the styles from the dummy textarea\n\tthis.copyStyles();\n\t// Add event listeners\n\t$tw.utils.addEventListeners(this.domNode,[\n\t\t{name: \"input\",handlerObject: this,handlerMethod: \"handleInputEvent\"},\n\t\t{name: \"keydown\",handlerObject: this.widget,handlerMethod: \"handleKeydownEvent\"}\n\t]);\n\t// Insert the element into the DOM\n\tthis.iframeDoc.body.appendChild(this.domNode);\n}\n\n/*\nCopy styles from the dummy text area to the textarea in the iframe\n*/\nFramedEngine.prototype.copyStyles = function() {\n\t// Copy all styles\n\t$tw.utils.copyStyles(this.dummyTextArea,this.domNode);\n\t// Override the ones that should not be set the same as the dummy textarea\n\tthis.domNode.style.display = \"block\";\n\tthis.domNode.style.width = \"100%\";\n\tthis.domNode.style.margin = \"0\";\n\t// In Chrome setting -webkit-text-fill-color overrides the placeholder text colour\n\tthis.domNode.style[\"-webkit-text-fill-color\"] = \"currentcolor\";\n};\n\n/*\nSet the text of the engine if it doesn't currently have focus\n*/\nFramedEngine.prototype.setText = function(text,type) {\n\tif(!this.domNode.isTiddlyWikiFakeDom) {\n\t\tif(this.domNode.ownerDocument.activeElement !== this.domNode) {\n\t\t\tthis.domNode.value = text;\n\t\t}\n\t\t// Fix the height if needed\n\t\tthis.fixHeight();\n\t}\n};\n\n/*\nGet the text of the engine\n*/\nFramedEngine.prototype.getText = function() {\n\treturn this.domNode.value;\n};\n\n/*\nFix the height of textarea to fit content\n*/\nFramedEngine.prototype.fixHeight = function() {\n\t// Make sure styles are updated\n\tthis.copyStyles();\n\t// Adjust height\n\tif(this.widget.editTag === \"textarea\") {\n\t\tif(this.widget.editAutoHeight) {\n\t\t\tif(this.domNode && !this.domNode.isTiddlyWikiFakeDom) {\n\t\t\t\tvar newHeight = $tw.utils.resizeTextAreaToFit(this.domNode,this.widget.editMinHeight);\n\t\t\t\tthis.iframeNode.style.height = (newHeight + 14) + \"px\"; // +14 for the border on the textarea\n\t\t\t}\n\t\t} else {\n\t\t\tvar fixedHeight = parseInt(this.widget.wiki.getTiddlerText(HEIGHT_VALUE_TITLE,\"400px\"),10);\n\t\t\tfixedHeight = Math.max(fixedHeight,20);\n\t\t\tthis.domNode.style.height = fixedHeight + \"px\";\n\t\t\tthis.iframeNode.style.height = (fixedHeight + 14) + \"px\";\n\t\t}\n\t}\n};\n\n/*\nFocus the engine node\n*/\nFramedEngine.prototype.focus  = function() {\n\tif(this.domNode.focus && this.domNode.select) {\n\t\tthis.domNode.focus();\n\t\tthis.domNode.select();\n\t}\n};\n\n/*\nHandle a dom \"input\" event which occurs when the text has changed\n*/\nFramedEngine.prototype.handleInputEvent = function(event) {\n\tthis.widget.saveChanges(this.getText());\n\tthis.fixHeight();\n\treturn true;\n};\n\n/*\nCreate a blank structure representing a text operation\n*/\nFramedEngine.prototype.createTextOperation = function() {\n\tvar operation = {\n\t\ttext: this.domNode.value,\n\t\tselStart: this.domNode.selectionStart,\n\t\tselEnd: this.domNode.selectionEnd,\n\t\tcutStart: null,\n\t\tcutEnd: null,\n\t\treplacement: null,\n\t\tnewSelStart: null,\n\t\tnewSelEnd: null\n\t};\n\toperation.selection = operation.text.substring(operation.selStart,operation.selEnd);\n\treturn operation;\n};\n\n/*\nExecute a text operation\n*/\nFramedEngine.prototype.executeTextOperation = function(operation) {\n\t// Perform the required changes to the text area and the underlying tiddler\n\tvar newText = operation.text;\n\tif(operation.replacement !== null) {\n\t\tnewText = operation.text.substring(0,operation.cutStart) + operation.replacement + operation.text.substring(operation.cutEnd);\n\t\t// Attempt to use a execCommand to modify the value of the control\n\t\tif(this.iframeDoc.queryCommandSupported(\"insertText\") && this.iframeDoc.queryCommandSupported(\"delete\") && !$tw.browser.isFirefox) {\n\t\t\tthis.domNode.focus();\n\t\t\tthis.domNode.setSelectionRange(operation.cutStart,operation.cutEnd);\n\t\t\tif(operation.replacement === \"\") {\n\t\t\t\tthis.iframeDoc.execCommand(\"delete\",false,\"\");\n\t\t\t} else {\n\t\t\t\tthis.iframeDoc.execCommand(\"insertText\",false,operation.replacement);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.domNode.value = newText;\n\t\t}\n\t\tthis.domNode.focus();\n\t\tthis.domNode.setSelectionRange(operation.newSelStart,operation.newSelEnd);\n\t}\n\tthis.domNode.focus();\n\treturn newText;\n};\n\nexports.FramedEngine = FramedEngine;\n\n})();\n",
            "title": "$:/core/modules/editor/engines/framed.js",
            "type": "application/javascript",
            "module-type": "library"
        },
        "$:/core/modules/editor/engines/simple.js": {
            "text": "/*\\\ntitle: $:/core/modules/editor/engines/simple.js\ntype: application/javascript\nmodule-type: library\n\nText editor engine based on a simple input or textarea tag\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar HEIGHT_VALUE_TITLE = \"$:/config/TextEditor/EditorHeight/Height\";\n\nfunction SimpleEngine(options) {\n\t// Save our options\n\toptions = options || {};\n\tthis.widget = options.widget;\n\tthis.value = options.value;\n\tthis.parentNode = options.parentNode;\n\tthis.nextSibling = options.nextSibling;\n\t// Construct the textarea or input node\n\tvar tag = this.widget.editTag;\n\tif($tw.config.htmlUnsafeElements.indexOf(tag) !== -1) {\n\t\ttag = \"input\";\n\t}\n\tthis.domNode = this.widget.document.createElement(tag);\n\t// Set the text\n\tif(this.widget.editTag === \"textarea\") {\n\t\tthis.domNode.appendChild(this.widget.document.createTextNode(this.value));\n\t} else {\n\t\tthis.domNode.value = this.value;\n\t}\n\t// Set the attributes\n\tif(this.widget.editType) {\n\t\tthis.domNode.setAttribute(\"type\",this.widget.editType);\n\t}\n\tif(this.widget.editPlaceholder) {\n\t\tthis.domNode.setAttribute(\"placeholder\",this.widget.editPlaceholder);\n\t}\n\tif(this.widget.editSize) {\n\t\tthis.domNode.setAttribute(\"size\",this.widget.editSize);\n\t}\n\tif(this.widget.editRows) {\n\t\tthis.domNode.setAttribute(\"rows\",this.widget.editRows);\n\t}\n\tif(this.widget.editClass) {\n\t\tthis.domNode.className = this.widget.editClass;\n\t}\n\t// Add an input event handler\n\t$tw.utils.addEventListeners(this.domNode,[\n\t\t{name: \"focus\", handlerObject: this, handlerMethod: \"handleFocusEvent\"},\n\t\t{name: \"input\", handlerObject: this, handlerMethod: \"handleInputEvent\"}\n\t]);\n\t// Insert the element into the DOM\n\tthis.parentNode.insertBefore(this.domNode,this.nextSibling);\n\tthis.widget.domNodes.push(this.domNode);\n}\n\n/*\nSet the text of the engine if it doesn't currently have focus\n*/\nSimpleEngine.prototype.setText = function(text,type) {\n\tif(!this.domNode.isTiddlyWikiFakeDom) {\n\t\tif(this.domNode.ownerDocument.activeElement !== this.domNode || text === \"\") {\n\t\t\tthis.domNode.value = text;\n\t\t}\n\t\t// Fix the height if needed\n\t\tthis.fixHeight();\n\t}\n};\n\n/*\nGet the text of the engine\n*/\nSimpleEngine.prototype.getText = function() {\n\treturn this.domNode.value;\n};\n\n/*\nFix the height of textarea to fit content\n*/\nSimpleEngine.prototype.fixHeight = function() {\n\tif(this.widget.editTag === \"textarea\") {\n\t\tif(this.widget.editAutoHeight) {\n\t\t\tif(this.domNode && !this.domNode.isTiddlyWikiFakeDom) {\n\t\t\t\t$tw.utils.resizeTextAreaToFit(this.domNode,this.widget.editMinHeight);\n\t\t\t}\n\t\t} else {\n\t\t\tvar fixedHeight = parseInt(this.widget.wiki.getTiddlerText(HEIGHT_VALUE_TITLE,\"400px\"),10);\n\t\t\tfixedHeight = Math.max(fixedHeight,20);\n\t\t\tthis.domNode.style.height = fixedHeight + \"px\";\n\t\t}\n\t}\n};\n\n/*\nFocus the engine node\n*/\nSimpleEngine.prototype.focus  = function() {\n\tif(this.domNode.focus && this.domNode.select) {\n\t\tthis.domNode.focus();\n\t\tthis.domNode.select();\n\t}\n};\n\n/*\nHandle a dom \"input\" event which occurs when the text has changed\n*/\nSimpleEngine.prototype.handleInputEvent = function(event) {\n\tthis.widget.saveChanges(this.getText());\n\tthis.fixHeight();\n\treturn true;\n};\n\n/*\nHandle a dom \"focus\" event\n*/\nSimpleEngine.prototype.handleFocusEvent = function(event) {\n\tif(this.widget.editFocusPopup) {\n\t\t$tw.popup.triggerPopup({\n\t\t\tdomNode: this.domNode,\n\t\t\ttitle: this.widget.editFocusPopup,\n\t\t\twiki: this.widget.wiki,\n\t\t\tforce: true\n\t\t});\n\t}\n\treturn true;\n};\n\n/*\nCreate a blank structure representing a text operation\n*/\nSimpleEngine.prototype.createTextOperation = function() {\n\treturn null;\n};\n\n/*\nExecute a text operation\n*/\nSimpleEngine.prototype.executeTextOperation = function(operation) {\n};\n\nexports.SimpleEngine = SimpleEngine;\n\n})();\n",
            "title": "$:/core/modules/editor/engines/simple.js",
            "type": "application/javascript",
            "module-type": "library"
        },
        "$:/core/modules/editor/factory.js": {
            "text": "/*\\\ntitle: $:/core/modules/editor/factory.js\ntype: application/javascript\nmodule-type: library\n\nFactory for constructing text editor widgets with specified engines for the toolbar and non-toolbar cases\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar DEFAULT_MIN_TEXT_AREA_HEIGHT = \"100px\"; // Minimum height of textareas in pixels\n\n// Configuration tiddlers\nvar HEIGHT_MODE_TITLE = \"$:/config/TextEditor/EditorHeight/Mode\";\nvar ENABLE_TOOLBAR_TITLE = \"$:/config/TextEditor/EnableToolbar\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nfunction editTextWidgetFactory(toolbarEngine,nonToolbarEngine) {\n\n\tvar EditTextWidget = function(parseTreeNode,options) {\n\t\t// Initialise the editor operations if they've not been done already\n\t\tif(!this.editorOperations) {\n\t\t\tEditTextWidget.prototype.editorOperations = {};\n\t\t\t$tw.modules.applyMethods(\"texteditoroperation\",this.editorOperations);\n\t\t}\n\t\tthis.initialise(parseTreeNode,options);\n\t};\n\n\t/*\n\tInherit from the base widget class\n\t*/\n\tEditTextWidget.prototype = new Widget();\n\n\t/*\n\tRender this widget into the DOM\n\t*/\n\tEditTextWidget.prototype.render = function(parent,nextSibling) {\n\t\t// Save the parent dom node\n\t\tthis.parentDomNode = parent;\n\t\t// Compute our attributes\n\t\tthis.computeAttributes();\n\t\t// Execute our logic\n\t\tthis.execute();\n\t\t// Create the wrapper for the toolbar and render its content\n\t\tif(this.editShowToolbar) {\n\t\t\tthis.toolbarNode = this.document.createElement(\"div\");\n\t\t\tthis.toolbarNode.className = \"tc-editor-toolbar\";\n\t\t\tparent.insertBefore(this.toolbarNode,nextSibling);\n\t\t\tthis.renderChildren(this.toolbarNode,null);\n\t\t\tthis.domNodes.push(this.toolbarNode);\n\t\t}\n\t\t// Create our element\n\t\tvar editInfo = this.getEditInfo(),\n\t\t\tEngine = this.editShowToolbar ? toolbarEngine : nonToolbarEngine;\n\t\tthis.engine = new Engine({\n\t\t\t\twidget: this,\n\t\t\t\tvalue: editInfo.value,\n\t\t\t\ttype: editInfo.type,\n\t\t\t\tparentNode: parent,\n\t\t\t\tnextSibling: nextSibling\n\t\t\t});\n\t\t// Call the postRender hook\n\t\tif(this.postRender) {\n\t\t\tthis.postRender();\n\t\t}\n\t\t// Fix height\n\t\tthis.engine.fixHeight();\n\t\t// Focus if required\n\t\tif(this.editFocus === \"true\" || this.editFocus === \"yes\") {\n\t\t\tthis.engine.focus();\n\t\t}\n\t\t// Add widget message listeners\n\t\tthis.addEventListeners([\n\t\t\t{type: \"tm-edit-text-operation\", handler: \"handleEditTextOperationMessage\"}\n\t\t]);\n\t};\n\n\t/*\n\tGet the tiddler being edited and current value\n\t*/\n\tEditTextWidget.prototype.getEditInfo = function() {\n\t\t// Get the edit value\n\t\tvar self = this,\n\t\t\tvalue,\n\t\t\ttype = \"text/plain\",\n\t\t\tupdate;\n\t\tif(this.editIndex) {\n\t\t\tvalue = this.wiki.extractTiddlerDataItem(this.editTitle,this.editIndex,this.editDefault);\n\t\t\tupdate = function(value) {\n\t\t\t\tvar data = self.wiki.getTiddlerData(self.editTitle,{});\n\t\t\t\tif(data[self.editIndex] !== value) {\n\t\t\t\t\tdata[self.editIndex] = value;\n\t\t\t\t\tself.wiki.setTiddlerData(self.editTitle,data);\n\t\t\t\t}\n\t\t\t};\n\t\t} else {\n\t\t\t// Get the current tiddler and the field name\n\t\t\tvar tiddler = this.wiki.getTiddler(this.editTitle);\n\t\t\tif(tiddler) {\n\t\t\t\t// If we've got a tiddler, the value to display is the field string value\n\t\t\t\tvalue = tiddler.getFieldString(this.editField);\n\t\t\t\tif(this.editField === \"text\") {\n\t\t\t\t\ttype = tiddler.fields.type || \"text/vnd.tiddlywiki\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Otherwise, we need to construct a default value for the editor\n\t\t\t\tswitch(this.editField) {\n\t\t\t\t\tcase \"text\":\n\t\t\t\t\t\tvalue = \"Type the text for the tiddler '\" + this.editTitle + \"'\";\n\t\t\t\t\t\ttype = \"text/vnd.tiddlywiki\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"title\":\n\t\t\t\t\t\tvalue = this.editTitle;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tvalue = \"\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(this.editDefault !== undefined) {\n\t\t\t\t\tvalue = this.editDefault;\n\t\t\t\t}\n\t\t\t}\n\t\t\tupdate = function(value) {\n\t\t\t\tvar tiddler = self.wiki.getTiddler(self.editTitle),\n\t\t\t\t\tupdateFields = {\n\t\t\t\t\t\ttitle: self.editTitle\n\t\t\t\t\t};\n\t\t\t\tupdateFields[self.editField] = value;\n\t\t\t\tself.wiki.addTiddler(new $tw.Tiddler(self.wiki.getCreationFields(),tiddler,updateFields,self.wiki.getModificationFields()));\n\t\t\t};\n\t\t}\n\t\tif(this.editType) {\n\t\t\ttype = this.editType;\n\t\t}\n\t\treturn {value: value || \"\", type: type, update: update};\n\t};\n\n\t/*\n\tHandle an edit text operation message from the toolbar\n\t*/\n\tEditTextWidget.prototype.handleEditTextOperationMessage = function(event) {\n\t\t// Prepare information about the operation\n\t\tvar operation = this.engine.createTextOperation();\n\t\t// Invoke the handler for the selected operation\n\t\tvar handler = this.editorOperations[event.param];\n\t\tif(handler) {\n\t\t\thandler.call(this,event,operation);\n\t\t}\n\t\t// Execute the operation via the engine\n\t\tvar newText = this.engine.executeTextOperation(operation);\n\t\t// Fix the tiddler height and save changes\n\t\tthis.engine.fixHeight();\n\t\tthis.saveChanges(newText);\n\t};\n\n\t/*\n\tCompute the internal state of the widget\n\t*/\n\tEditTextWidget.prototype.execute = function() {\n\t\t// Get our parameters\n\t\tthis.editTitle = this.getAttribute(\"tiddler\",this.getVariable(\"currentTiddler\"));\n\t\tthis.editField = this.getAttribute(\"field\",\"text\");\n\t\tthis.editIndex = this.getAttribute(\"index\");\n\t\tthis.editDefault = this.getAttribute(\"default\");\n\t\tthis.editClass = this.getAttribute(\"class\");\n\t\tthis.editPlaceholder = this.getAttribute(\"placeholder\");\n\t\tthis.editSize = this.getAttribute(\"size\");\n\t\tthis.editRows = this.getAttribute(\"rows\");\n\t\tthis.editAutoHeight = this.wiki.getTiddlerText(HEIGHT_MODE_TITLE,\"auto\");\n\t\tthis.editAutoHeight = this.getAttribute(\"autoHeight\",this.editAutoHeight === \"auto\" ? \"yes\" : \"no\") === \"yes\";\n\t\tthis.editMinHeight = this.getAttribute(\"minHeight\",DEFAULT_MIN_TEXT_AREA_HEIGHT);\n\t\tthis.editFocusPopup = this.getAttribute(\"focusPopup\");\n\t\tthis.editFocus = this.getAttribute(\"focus\");\n\t\t// Get the default editor element tag and type\n\t\tvar tag,type;\n\t\tif(this.editField === \"text\") {\n\t\t\ttag = \"textarea\";\n\t\t} else {\n\t\t\ttag = \"input\";\n\t\t\tvar fieldModule = $tw.Tiddler.fieldModules[this.editField];\n\t\t\tif(fieldModule && fieldModule.editTag) {\n\t\t\t\ttag = fieldModule.editTag;\n\t\t\t}\n\t\t\tif(fieldModule && fieldModule.editType) {\n\t\t\t\ttype = fieldModule.editType;\n\t\t\t}\n\t\t\ttype = type || \"text\";\n\t\t}\n\t\t// Get the rest of our parameters\n\t\tthis.editTag = this.getAttribute(\"tag\",tag);\n\t\tthis.editType = this.getAttribute(\"type\",type);\n\t\t// Make the child widgets\n\t\tthis.makeChildWidgets();\n\t\t// Determine whether to show the toolbar\n\t\tthis.editShowToolbar = this.wiki.getTiddlerText(ENABLE_TOOLBAR_TITLE,\"yes\");\n\t\tthis.editShowToolbar = (this.editShowToolbar === \"yes\") && !!(this.children && this.children.length > 0);\n\t};\n\n\t/*\n\tSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n\t*/\n\tEditTextWidget.prototype.refresh = function(changedTiddlers) {\n\t\tvar changedAttributes = this.computeAttributes();\n\t\t// Completely rerender if any of our attributes have changed\n\t\tif(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes[\"default\"] || changedAttributes[\"class\"] || changedAttributes.placeholder || changedAttributes.size || changedAttributes.autoHeight || changedAttributes.minHeight || changedAttributes.focusPopup ||  changedAttributes.rows || changedTiddlers[HEIGHT_MODE_TITLE] || changedTiddlers[ENABLE_TOOLBAR_TITLE]) {\n\t\t\tthis.refreshSelf();\n\t\t\treturn true;\n\t\t} else if(changedTiddlers[this.editTitle]) {\n\t\t\tvar editInfo = this.getEditInfo();\n\t\t\tthis.updateEditor(editInfo.value,editInfo.type);\n\t\t}\n\t\tthis.engine.fixHeight();\n\t\tif(this.editShowToolbar) {\n\t\t\treturn this.refreshChildren(changedTiddlers);\t\t\t\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\t/*\n\tUpdate the editor with new text. This method is separate from updateEditorDomNode()\n\tso that subclasses can override updateEditor() and still use updateEditorDomNode()\n\t*/\n\tEditTextWidget.prototype.updateEditor = function(text,type) {\n\t\tthis.updateEditorDomNode(text,type);\n\t};\n\n\t/*\n\tUpdate the editor dom node with new text\n\t*/\n\tEditTextWidget.prototype.updateEditorDomNode = function(text,type) {\n\t\tthis.engine.setText(text,type);\n\t};\n\n\t/*\n\tSave changes back to the tiddler store\n\t*/\n\tEditTextWidget.prototype.saveChanges = function(text) {\n\t\tvar editInfo = this.getEditInfo();\n\t\tif(text !== editInfo.value) {\n\t\t\teditInfo.update(text);\n\t\t}\n\t};\n\n\t/*\n\tHandle a dom \"keydown\" event, which we'll bubble up to our container for the keyboard widgets benefit\n\t*/\n\tEditTextWidget.prototype.handleKeydownEvent = function(event) {\n\t\t// Check for a keyboard shortcut\n\t\tif(this.toolbarNode) {\n\t\t\tvar shortcutElements = this.toolbarNode.querySelectorAll(\"[data-tw-keyboard-shortcut]\");\n\t\t\tfor(var index=0; index<shortcutElements.length; index++) {\n\t\t\t\tvar el = shortcutElements[index],\n\t\t\t\t\tshortcutData = el.getAttribute(\"data-tw-keyboard-shortcut\"),\n\t\t\t\t\tkeyInfoArray = $tw.keyboardManager.parseKeyDescriptors(shortcutData,{\n\t\t\t\t\t\twiki: this.wiki\n\t\t\t\t\t});\n\t\t\t\tif($tw.keyboardManager.checkKeyDescriptors(event,keyInfoArray)) {\n\t\t\t\t\tvar clickEvent = this.document.createEvent(\"Events\");\n\t\t\t\t    clickEvent.initEvent(\"click\",true,false);\n\t\t\t\t    el.dispatchEvent(clickEvent);\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\treturn true;\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Propogate the event to the container\n\t\tif(this.propogateKeydownEvent(event)) {\n\t\t\t// Ignore the keydown if it was already handled\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t\treturn true;\n\t\t}\n\t\t// Otherwise, process the keydown normally\n\t\treturn false;\n\t};\n\n\t/*\n\tPropogate keydown events to our container for the keyboard widgets benefit\n\t*/\n\tEditTextWidget.prototype.propogateKeydownEvent = function(event) {\n\t\tvar newEvent = this.document.createEventObject ? this.document.createEventObject() : this.document.createEvent(\"Events\");\n\t\tif(newEvent.initEvent) {\n\t\t\tnewEvent.initEvent(\"keydown\", true, true);\n\t\t}\n\t\tnewEvent.keyCode = event.keyCode;\n\t\tnewEvent.which = event.which;\n\t\tnewEvent.metaKey = event.metaKey;\n\t\tnewEvent.ctrlKey = event.ctrlKey;\n\t\tnewEvent.altKey = event.altKey;\n\t\tnewEvent.shiftKey = event.shiftKey;\n\t\treturn !this.parentDomNode.dispatchEvent(newEvent);\n\t};\n\n\treturn EditTextWidget;\n\n}\n\nexports.editTextWidgetFactory = editTextWidgetFactory;\n\n})();\n",
            "title": "$:/core/modules/editor/factory.js",
            "type": "application/javascript",
            "module-type": "library"
        },
        "$:/core/modules/editor/operations/bitmap/clear.js": {
            "text": "/*\\\ntitle: $:/core/modules/editor/operations/bitmap/clear.js\ntype: application/javascript\nmodule-type: bitmapeditoroperation\n\nBitmap editor operation to clear the image\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports[\"clear\"] = function(event) {\n\tvar ctx = this.canvasDomNode.getContext(\"2d\");\n\tctx.globalAlpha = 1;\n\tctx.fillStyle = event.paramObject.colour || \"white\";\n\tctx.fillRect(0,0,this.canvasDomNode.width,this.canvasDomNode.height);\n\t// Save changes\n\tthis.strokeEnd();\n};\n\n})();\n",
            "title": "$:/core/modules/editor/operations/bitmap/clear.js",
            "type": "application/javascript",
            "module-type": "bitmapeditoroperation"
        },
        "$:/core/modules/editor/operations/bitmap/resize.js": {
            "text": "/*\\\ntitle: $:/core/modules/editor/operations/bitmap/resize.js\ntype: application/javascript\nmodule-type: bitmapeditoroperation\n\nBitmap editor operation to resize the image\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports[\"resize\"] = function(event) {\n\t// Get the new width\n\tvar newWidth = parseInt(event.paramObject.width || this.canvasDomNode.width,10),\n\t\tnewHeight = parseInt(event.paramObject.height || this.canvasDomNode.height,10);\n\t// Update if necessary\n\tif(newWidth > 0 && newHeight > 0 && !(newWidth === this.currCanvas.width && newHeight === this.currCanvas.height)) {\n\t\tthis.changeCanvasSize(newWidth,newHeight);\n\t}\n\t// Update the input controls\n\tthis.refreshToolbar();\n\t// Save the image into the tiddler\n\tthis.saveChanges();\n};\n\n})();\n",
            "title": "$:/core/modules/editor/operations/bitmap/resize.js",
            "type": "application/javascript",
            "module-type": "bitmapeditoroperation"
        },
        "$:/core/modules/editor/operations/text/excise.js": {
            "text": "/*\\\ntitle: $:/core/modules/editor/operations/text/excise.js\ntype: application/javascript\nmodule-type: texteditoroperation\n\nText editor operation to excise the selection to a new tiddler\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports[\"excise\"] = function(event,operation) {\n\tvar editTiddler = this.wiki.getTiddler(this.editTitle),\n\t\teditTiddlerTitle = this.editTitle;\n\tif(editTiddler && editTiddler.fields[\"draft.of\"]) {\n\t\teditTiddlerTitle = editTiddler.fields[\"draft.of\"];\n\t}\n\tvar excisionTitle = event.paramObject.title || this.wiki.generateNewTitle(\"New Excision\");\n\tthis.wiki.addTiddler(new $tw.Tiddler(\n\t\tthis.wiki.getCreationFields(),\n\t\tthis.wiki.getModificationFields(),\n\t\t{\n\t\t\ttitle: excisionTitle,\n\t\t\ttext: operation.selection,\n\t\t\ttags: event.paramObject.tagnew === \"yes\" ?  [editTiddlerTitle] : []\n\t\t}\n\t));\n\toperation.replacement = excisionTitle;\n\tswitch(event.paramObject.type || \"transclude\") {\n\t\tcase \"transclude\":\n\t\t\toperation.replacement = \"{{\" + operation.replacement+ \"}}\";\n\t\t\tbreak;\n\t\tcase \"link\":\n\t\t\toperation.replacement = \"[[\" + operation.replacement+ \"]]\";\n\t\t\tbreak;\n\t\tcase \"macro\":\n\t\t\toperation.replacement = \"<<\" + (event.paramObject.macro || \"translink\") + \" \\\"\\\"\\\"\" + operation.replacement + \"\\\"\\\"\\\">>\";\n\t\t\tbreak;\n\t}\n\toperation.cutStart = operation.selStart;\n\toperation.cutEnd = operation.selEnd;\n\toperation.newSelStart = operation.selStart;\n\toperation.newSelEnd = operation.selStart + operation.replacement.length;\n};\n\n})();\n",
            "title": "$:/core/modules/editor/operations/text/excise.js",
            "type": "application/javascript",
            "module-type": "texteditoroperation"
        },
        "$:/core/modules/editor/operations/text/make-link.js": {
            "text": "/*\\\ntitle: $:/core/modules/editor/operations/text/make-link.js\ntype: application/javascript\nmodule-type: texteditoroperation\n\nText editor operation to make a link\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports[\"make-link\"] = function(event,operation) {\n\tif(operation.selection) {\n\t\toperation.replacement = \"[[\" + operation.selection + \"|\" + event.paramObject.text + \"]]\";\n\t\toperation.cutStart = operation.selStart;\n\t\toperation.cutEnd = operation.selEnd;\n\t} else {\n\t\toperation.replacement = \"[[\" + event.paramObject.text + \"]]\";\n\t\toperation.cutStart = operation.selStart;\n\t\toperation.cutEnd = operation.selEnd;\n\t}\n\toperation.newSelStart = operation.selStart + operation.replacement.length;\n\toperation.newSelEnd = operation.newSelStart;\n};\n\n})();\n",
            "title": "$:/core/modules/editor/operations/text/make-link.js",
            "type": "application/javascript",
            "module-type": "texteditoroperation"
        },
        "$:/core/modules/editor/operations/text/prefix-lines.js": {
            "text": "/*\\\ntitle: $:/core/modules/editor/operations/text/prefix-lines.js\ntype: application/javascript\nmodule-type: texteditoroperation\n\nText editor operation to add a prefix to the selected lines\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports[\"prefix-lines\"] = function(event,operation) {\n\t// Cut just past the preceding line break, or the start of the text\n\toperation.cutStart = $tw.utils.findPrecedingLineBreak(operation.text,operation.selStart);\n\t// Cut to just past the following line break, or to the end of the text\n\toperation.cutEnd = $tw.utils.findFollowingLineBreak(operation.text,operation.selEnd);\n\t// Compose the required prefix\n\tvar prefix = $tw.utils.repeat(event.paramObject.character,event.paramObject.count);\n\t// Process each line\n\tvar lines = operation.text.substring(operation.cutStart,operation.cutEnd).split(/\\r?\\n/mg);\n\t$tw.utils.each(lines,function(line,index) {\n\t\t// Remove and count any existing prefix characters\n\t\tvar count = 0;\n\t\twhile(line.charAt(0) === event.paramObject.character) {\n\t\t\tline = line.substring(1);\n\t\t\tcount++;\n\t\t}\n\t\t// Remove any whitespace\n\t\twhile(line.charAt(0) === \" \") {\n\t\t\tline = line.substring(1);\n\t\t}\n\t\t// We're done if we removed the exact required prefix, otherwise add it\n\t\tif(count !== event.paramObject.count) {\n\t\t\t// Apply the prefix\n\t\t\tline =  prefix + \" \" + line;\n\t\t}\n\t\t// Save the modified line\n\t\tlines[index] = line;\n\t});\n\t// Stitch the replacement text together and set the selection\n\toperation.replacement = lines.join(\"\\n\");\n\tif(lines.length === 1) {\n\t\toperation.newSelStart = operation.cutStart + operation.replacement.length;\n\t\toperation.newSelEnd = operation.newSelStart;\n\t} else {\n\t\toperation.newSelStart = operation.cutStart;\n\t\toperation.newSelEnd = operation.newSelStart + operation.replacement.length;\n\t}\n};\n\n})();\n",
            "title": "$:/core/modules/editor/operations/text/prefix-lines.js",
            "type": "application/javascript",
            "module-type": "texteditoroperation"
        },
        "$:/core/modules/editor/operations/text/replace-all.js": {
            "text": "/*\\\ntitle: $:/core/modules/editor/operations/text/replace-all.js\ntype: application/javascript\nmodule-type: texteditoroperation\n\nText editor operation to replace the entire text\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports[\"replace-all\"] = function(event,operation) {\n\toperation.cutStart = 0;\n\toperation.cutEnd = operation.text.length;\n\toperation.replacement = event.paramObject.text;\n\toperation.newSelStart = 0;\n\toperation.newSelEnd = operation.replacement.length;\n};\n\n})();\n",
            "title": "$:/core/modules/editor/operations/text/replace-all.js",
            "type": "application/javascript",
            "module-type": "texteditoroperation"
        },
        "$:/core/modules/editor/operations/text/replace-selection.js": {
            "text": "/*\\\ntitle: $:/core/modules/editor/operations/text/replace-selection.js\ntype: application/javascript\nmodule-type: texteditoroperation\n\nText editor operation to replace the selection\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports[\"replace-selection\"] = function(event,operation) {\n\toperation.replacement = event.paramObject.text;\n\toperation.cutStart = operation.selStart;\n\toperation.cutEnd = operation.selEnd;\n\toperation.newSelStart = operation.selStart;\n\toperation.newSelEnd = operation.selStart + operation.replacement.length;\n};\n\n})();\n",
            "title": "$:/core/modules/editor/operations/text/replace-selection.js",
            "type": "application/javascript",
            "module-type": "texteditoroperation"
        },
        "$:/core/modules/editor/operations/text/wrap-lines.js": {
            "text": "/*\\\ntitle: $:/core/modules/editor/operations/text/wrap-lines.js\ntype: application/javascript\nmodule-type: texteditoroperation\n\nText editor operation to wrap the selected lines with a prefix and suffix\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports[\"wrap-lines\"] = function(event,operation) {\n\t// Cut just past the preceding line break, or the start of the text\n\toperation.cutStart = $tw.utils.findPrecedingLineBreak(operation.text,operation.selStart);\n\t// Cut to just past the following line break, or to the end of the text\n\toperation.cutEnd = $tw.utils.findFollowingLineBreak(operation.text,operation.selEnd);\n\t// Add the prefix and suffix\n\toperation.replacement = event.paramObject.prefix + \"\\n\" +\n\t\t\t\toperation.text.substring(operation.cutStart,operation.cutEnd) + \"\\n\" +\n\t\t\t\tevent.paramObject.suffix + \"\\n\";\n\toperation.newSelStart = operation.cutStart + event.paramObject.prefix.length + 1;\n\toperation.newSelEnd = operation.newSelStart + (operation.cutEnd - operation.cutStart);\n};\n\n})();\n",
            "title": "$:/core/modules/editor/operations/text/wrap-lines.js",
            "type": "application/javascript",
            "module-type": "texteditoroperation"
        },
        "$:/core/modules/editor/operations/text/wrap-selection.js": {
            "text": "/*\\\ntitle: $:/core/modules/editor/operations/text/wrap-selection.js\ntype: application/javascript\nmodule-type: texteditoroperation\n\nText editor operation to wrap the selection with the specified prefix and suffix\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports[\"wrap-selection\"] = function(event,operation) {\n\tif(operation.selStart === operation.selEnd) {\n\t\t// No selection; check if we're within the prefix/suffix\n\t\tif(operation.text.substring(operation.selStart - event.paramObject.prefix.length,operation.selStart + event.paramObject.suffix.length) === event.paramObject.prefix + event.paramObject.suffix) {\n\t\t\t// Remove the prefix and suffix unless they comprise the entire text\n\t\t\tif(operation.selStart > event.paramObject.prefix.length || (operation.selEnd + event.paramObject.suffix.length) < operation.text.length ) {\n\t\t\t\toperation.cutStart = operation.selStart - event.paramObject.prefix.length;\n\t\t\t\toperation.cutEnd = operation.selEnd + event.paramObject.suffix.length;\n\t\t\t\toperation.replacement = \"\";\n\t\t\t\toperation.newSelStart = operation.cutStart;\n\t\t\t\toperation.newSelEnd = operation.newSelStart;\n\t\t\t}\n\t\t} else {\n\t\t\t// Wrap the cursor instead\n\t\t\toperation.cutStart = operation.selStart;\n\t\t\toperation.cutEnd = operation.selEnd;\n\t\t\toperation.replacement = event.paramObject.prefix + event.paramObject.suffix;\n\t\t\toperation.newSelStart = operation.selStart + event.paramObject.prefix.length;\n\t\t\toperation.newSelEnd = operation.newSelStart;\n\t\t}\n\t} else if(operation.text.substring(operation.selStart,operation.selStart + event.paramObject.prefix.length) === event.paramObject.prefix && operation.text.substring(operation.selEnd - event.paramObject.suffix.length,operation.selEnd) === event.paramObject.suffix) {\n\t\t// Prefix and suffix are already present, so remove them\n\t\toperation.cutStart = operation.selStart;\n\t\toperation.cutEnd = operation.selEnd;\n\t\toperation.replacement = operation.selection.substring(event.paramObject.prefix.length,operation.selection.length - event.paramObject.suffix.length);\n\t\toperation.newSelStart = operation.selStart;\n\t\toperation.newSelEnd = operation.selStart + operation.replacement.length;\n\t} else {\n\t\t// Add the prefix and suffix\n\t\toperation.cutStart = operation.selStart;\n\t\toperation.cutEnd = operation.selEnd;\n\t\toperation.replacement = event.paramObject.prefix + operation.selection + event.paramObject.suffix;\n\t\toperation.newSelStart = operation.selStart;\n\t\toperation.newSelEnd = operation.selStart + operation.replacement.length;\n\t}\n};\n\n})();\n",
            "title": "$:/core/modules/editor/operations/text/wrap-selection.js",
            "type": "application/javascript",
            "module-type": "texteditoroperation"
        },
        "$:/core/modules/filters/addprefix.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/addprefix.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for adding a prefix to each title in the list. This is\nespecially useful in contexts where only a filter expression is allowed\nand macro substitution isn't available.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.addprefix = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push(operator.operand + title);\n\t});\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/addprefix.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/addsuffix.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/addsuffix.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for adding a suffix to each title in the list. This is\nespecially useful in contexts where only a filter expression is allowed\nand macro substitution isn't available.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.addsuffix = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push(title + operator.operand);\n\t});\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/addsuffix.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/after.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/after.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator returning the tiddler from the current list that is after the tiddler named in the operand.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.after = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push(title);\n\t});\n\tvar index = results.indexOf(operator.operand);\n\tif(index === -1 || index > (results.length - 2)) {\n\t\treturn [];\n\t} else {\n\t\treturn [results[index + 1]];\n\t}\n};\n\n})();\n",
            "title": "$:/core/modules/filters/after.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/all/current.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/all/current.js\ntype: application/javascript\nmodule-type: allfilteroperator\n\nFilter function for [all[current]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.current = function(source,prefix,options) {\n\tvar currTiddlerTitle = options.widget && options.widget.getVariable(\"currentTiddler\");\n\tif(currTiddlerTitle) {\n\t\treturn [currTiddlerTitle];\n\t} else {\n\t\treturn [];\n\t}\n};\n\n})();\n",
            "title": "$:/core/modules/filters/all/current.js",
            "type": "application/javascript",
            "module-type": "allfilteroperator"
        },
        "$:/core/modules/filters/all/missing.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/all/missing.js\ntype: application/javascript\nmodule-type: allfilteroperator\n\nFilter function for [all[missing]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.missing = function(source,prefix,options) {\n\treturn options.wiki.getMissingTitles();\n};\n\n})();\n",
            "title": "$:/core/modules/filters/all/missing.js",
            "type": "application/javascript",
            "module-type": "allfilteroperator"
        },
        "$:/core/modules/filters/all/orphans.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/all/orphans.js\ntype: application/javascript\nmodule-type: allfilteroperator\n\nFilter function for [all[orphans]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.orphans = function(source,prefix,options) {\n\treturn options.wiki.getOrphanTitles();\n};\n\n})();\n",
            "title": "$:/core/modules/filters/all/orphans.js",
            "type": "application/javascript",
            "module-type": "allfilteroperator"
        },
        "$:/core/modules/filters/all/shadows.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/all/shadows.js\ntype: application/javascript\nmodule-type: allfilteroperator\n\nFilter function for [all[shadows]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.shadows = function(source,prefix,options) {\n\treturn options.wiki.allShadowTitles();\n};\n\n})();\n",
            "title": "$:/core/modules/filters/all/shadows.js",
            "type": "application/javascript",
            "module-type": "allfilteroperator"
        },
        "$:/core/modules/filters/all/tags.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/all/tags.js\ntype: application/javascript\nmodule-type: allfilteroperator\n\nFilter function for [all[tags]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.tags = function(source,prefix,options) {\n\treturn Object.keys(options.wiki.getTagMap());\n};\n\n})();\n",
            "title": "$:/core/modules/filters/all/tags.js",
            "type": "application/javascript",
            "module-type": "allfilteroperator"
        },
        "$:/core/modules/filters/all/tiddlers.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/all/tiddlers.js\ntype: application/javascript\nmodule-type: allfilteroperator\n\nFilter function for [all[tiddlers]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.tiddlers = function(source,prefix,options) {\n\treturn options.wiki.allTitles();\n};\n\n})();\n",
            "title": "$:/core/modules/filters/all/tiddlers.js",
            "type": "application/javascript",
            "module-type": "allfilteroperator"
        },
        "$:/core/modules/filters/all.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/all.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for selecting tiddlers\n\n[all[shadows+tiddlers]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar allFilterOperators;\n\nfunction getAllFilterOperators() {\n\tif(!allFilterOperators) {\n\t\tallFilterOperators = {};\n\t\t$tw.modules.applyMethods(\"allfilteroperator\",allFilterOperators);\n\t}\n\treturn allFilterOperators;\n}\n\n/*\nExport our filter function\n*/\nexports.all = function(source,operator,options) {\n\t// Get our suboperators\n\tvar allFilterOperators = getAllFilterOperators();\n\t// Cycle through the suboperators accumulating their results\n\tvar results = [],\n\t\tsubops = operator.operand.split(\"+\");\n\t// Check for common optimisations\n\tif(subops.length === 1 && subops[0] === \"\") {\n\t\treturn source;\n\t} else if(subops.length === 1 && subops[0] === \"tiddlers\") {\n\t\treturn options.wiki.each;\n\t} else if(subops.length === 1 && subops[0] === \"shadows\") {\n\t\treturn options.wiki.eachShadow;\n\t} else if(subops.length === 2 && subops[0] === \"tiddlers\" && subops[1] === \"shadows\") {\n\t\treturn options.wiki.eachTiddlerPlusShadows;\n\t} else if(subops.length === 2 && subops[0] === \"shadows\" && subops[1] === \"tiddlers\") {\n\t\treturn options.wiki.eachShadowPlusTiddlers;\n\t}\n\t// Do it the hard way\n\tfor(var t=0; t<subops.length; t++) {\n\t\tvar subop = allFilterOperators[subops[t]];\n\t\tif(subop) {\n\t\t\t$tw.utils.pushTop(results,subop(source,operator.prefix,options));\n\t\t}\n\t}\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/all.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/backlinks.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/backlinks.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for returning all the backlinks from a tiddler\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.backlinks = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\t$tw.utils.pushTop(results,options.wiki.getTiddlerBacklinks(title));\n\t});\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/backlinks.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/before.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/before.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator returning the tiddler from the current list that is before the tiddler named in the operand.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.before = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push(title);\n\t});\n\tvar index = results.indexOf(operator.operand);\n\tif(index <= 0) {\n\t\treturn [];\n\t} else {\n\t\treturn [results[index - 1]];\n\t}\n};\n\n})();\n",
            "title": "$:/core/modules/filters/before.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/commands.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/commands.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for returning the names of the commands available in this wiki\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.commands = function(source,operator,options) {\n\tvar results = [];\n\t$tw.utils.each($tw.commands,function(commandInfo,name) {\n\t\tresults.push(name);\n\t});\n\tresults.sort();\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/commands.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/count.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/count.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator returning the number of entries in the current list.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.count = function(source,operator,options) {\n\tvar count = 0;\n\tsource(function(tiddler,title) {\n\t\tcount++;\n\t});\n\treturn [count + \"\"];\n};\n\n})();\n",
            "title": "$:/core/modules/filters/count.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/days.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/days.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator that selects tiddlers with a specified date field within a specified date interval.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.days = function(source,operator,options) {\n\tvar results = [],\n\t\tfieldName = operator.suffix || \"modified\",\n\t\tdayInterval = (parseInt(operator.operand,10)||0),\n\t\tdayIntervalSign = $tw.utils.sign(dayInterval),\n\t\ttargetTimeStamp = (new Date()).setHours(0,0,0,0) + 1000*60*60*24*dayInterval,\n\t\tisWithinDays = function(dateField) {\n\t\t\tvar sign = $tw.utils.sign(targetTimeStamp - (new Date(dateField)).setHours(0,0,0,0));\n\t\t\treturn sign === 0 || sign === dayIntervalSign;\n\t\t};\n\n\tif(operator.prefix === \"!\") {\n\t\ttargetTimeStamp = targetTimeStamp - 1000*60*60*24*dayIntervalSign;\n\t\tsource(function(tiddler,title) {\n\t\t\tif(tiddler && tiddler.fields[fieldName]) {\n\t\t\t\tif(!isWithinDays($tw.utils.parseDate(tiddler.fields[fieldName]))) {\n\t\t\t\t\tresults.push(title);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(tiddler && tiddler.fields[fieldName]) {\n\t\t\t\tif(isWithinDays($tw.utils.parseDate(tiddler.fields[fieldName]))) {\n\t\t\t\t\tresults.push(title);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/days.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/each.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/each.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator that selects one tiddler for each unique value of the specified field.\nWith suffix \"list\", selects all tiddlers that are values in a specified list field.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.each = function(source,operator,options) {\n\tvar results =[] ,\n\t\tvalue,values = {},\n\t\tfield = operator.operand || \"title\";\n\tif(operator.suffix !== \"list-item\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(tiddler) {\n\t\t\t\tvalue = (field === \"title\") ? title : tiddler.getFieldString(field);\n\t\t\t\tif(!$tw.utils.hop(values,value)) {\n\t\t\t\t\tvalues[value] = true;\n\t\t\t\t\tresults.push(title);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(tiddler) {\n\t\t\t\t$tw.utils.each(\n\t\t\t\t\toptions.wiki.getTiddlerList(title,field),\n\t\t\t\t\tfunction(value) {\n\t\t\t\t\t\tif(!$tw.utils.hop(values,value)) {\n\t\t\t\t\t\t\tvalues[value] = true;\n\t\t\t\t\t\t\tresults.push(value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/each.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/eachday.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/eachday.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator that selects one tiddler for each unique day covered by the specified date field\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.eachday = function(source,operator,options) {\n\tvar results = [],\n\t\tvalues = [],\n\t\tfieldName = operator.operand || \"modified\";\n\t// Function to convert a date/time to a date integer\n\tvar toDate = function(value) {\n\t\tvalue = (new Date(value)).setHours(0,0,0,0);\n\t\treturn value+0;\n\t};\n\tsource(function(tiddler,title) {\n\t\tif(tiddler && tiddler.fields[fieldName]) {\n\t\t\tvar value = toDate($tw.utils.parseDate(tiddler.fields[fieldName]));\n\t\t\tif(values.indexOf(value) === -1) {\n\t\t\t\tvalues.push(value);\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t}\n\t});\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/eachday.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/editiondescription.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/editiondescription.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for returning the descriptions of the specified edition names\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.editiondescription = function(source,operator,options) {\n\tvar results = [],\n\t\teditionInfo = $tw.utils.getEditionInfo();\n\tif(editionInfo) {\n\t\tsource(function(tiddler,title) {\n\t\t\tif($tw.utils.hop(editionInfo,title)) {\n\t\t\t\tresults.push(editionInfo[title].description || \"\");\t\t\t\t\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/editiondescription.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/editions.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/editions.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for returning the names of the available editions in this wiki\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.editions = function(source,operator,options) {\n\tvar results = [],\n\t\teditionInfo = $tw.utils.getEditionInfo();\n\tif(editionInfo) {\n\t\t$tw.utils.each(editionInfo,function(info,name) {\n\t\t\tresults.push(name);\n\t\t});\n\t}\n\tresults.sort();\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/editions.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/decodeuricomponent.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/decodeuricomponent.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for applying decodeURIComponent() to each item.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter functions\n*/\n\nexports.decodeuricomponent = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push(decodeURIComponent(title));\n\t});\n\treturn results;\n};\n\nexports.encodeuricomponent = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push(encodeURIComponent(title));\n\t});\n\treturn results;\n};\n\nexports.decodeuri = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push(decodeURI(title));\n\t});\n\treturn results;\n};\n\nexports.encodeuri = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push(encodeURI(title));\n\t});\n\treturn results;\n};\n\nexports.decodehtml = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push($tw.utils.htmlDecode(title));\n\t});\n\treturn results;\n};\n\nexports.encodehtml = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push($tw.utils.htmlEncode(title));\n\t});\n\treturn results;\n};\n\nexports.stringify = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push($tw.utils.stringify(title));\n\t});\n\treturn results;\n};\n\nexports.escaperegexp = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push($tw.utils.escapeRegExp(title));\n\t});\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/decodeuricomponent.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/enlist.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/enlist.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator returning its operand parsed as a list\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.enlist = function(source,operator,options) {\n\tvar list = $tw.utils.parseStringArray(operator.operand);\n\tif(operator.prefix === \"!\") {\n\t\tvar results = [];\n\t\tsource(function(tiddler,title) {\n\t\t\tif(list.indexOf(title) === -1) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t\treturn results;\n\t} else {\n\t\treturn list;\n\t}\n};\n\n})();\n",
            "title": "$:/core/modules/filters/enlist.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/field.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/field.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for comparing fields for equality\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.field = function(source,operator,options) {\n\tvar results = [],\n\t\tfieldname = (operator.suffix || operator.operator || \"title\").toLowerCase();\n\tif(operator.prefix === \"!\") {\n\t\tif(operator.regexp) {\n\t\t\tsource(function(tiddler,title) {\n\t\t\t\tif(tiddler) {\n\t\t\t\t\tvar text = tiddler.getFieldString(fieldname);\n\t\t\t\t\tif(text !== null && !operator.regexp.exec(text)) {\n\t\t\t\t\t\tresults.push(title);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tresults.push(title);\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tsource(function(tiddler,title) {\n\t\t\t\tif(tiddler) {\n\t\t\t\t\tvar text = tiddler.getFieldString(fieldname);\n\t\t\t\t\tif(text !== null && text !== operator.operand) {\n\t\t\t\t\t\tresults.push(title);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tresults.push(title);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t} else {\n\t\tif(operator.regexp) {\n\t\t\tsource(function(tiddler,title) {\n\t\t\t\tif(tiddler) {\n\t\t\t\t\tvar text = tiddler.getFieldString(fieldname);\n\t\t\t\t\tif(text !== null && !!operator.regexp.exec(text)) {\n\t\t\t\t\t\tresults.push(title);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tsource(function(tiddler,title) {\n\t\t\t\tif(tiddler) {\n\t\t\t\t\tvar text = tiddler.getFieldString(fieldname);\n\t\t\t\t\tif(text !== null && text === operator.operand) {\n\t\t\t\t\t\tresults.push(title);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/field.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/fields.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/fields.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for returning the names of the fields on the selected tiddlers\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.fields = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tif(tiddler) {\n\t\t\tfor(var fieldName in tiddler.fields) {\n\t\t\t\t$tw.utils.pushTop(results,fieldName);\n\t\t\t}\n\t\t}\n\t});\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/fields.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/get.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/get.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for replacing tiddler titles by the value of the field specified in the operand.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.get = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tif(tiddler) {\n\t\t\tvar value = tiddler.getFieldString(operator.operand);\n\t\t\tif(value) {\n\t\t\t\tresults.push(value);\n\t\t\t}\n\t\t}\n\t});\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/get.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/getindex.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/getindex.js\ntype: application/javascript\nmodule-type: filteroperator\n\nreturns the value at a given index of datatiddlers\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.getindex = function(source,operator,options) {\n\tvar data,title,results = [];\n\tif(operator.operand){\n\t\tsource(function(tiddler,title) {\n\t\t\ttitle = tiddler ? tiddler.fields.title : title;\n\t\t\tdata = options.wiki.extractTiddlerDataItem(tiddler,operator.operand);\n\t\t\tif(data) {\n\t\t\t\tresults.push(data);\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/getindex.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/has.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/has.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for checking if a tiddler has the specified field\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.has = function(source,operator,options) {\n\tvar results = [],\n\t\tinvert = operator.prefix === \"!\";\n\n\tif(operator.suffix === \"field\") {\n\t\tif(invert) {\n\t\t\tsource(function(tiddler,title) {\n\t\t\t\tif(!tiddler || (tiddler && (!$tw.utils.hop(tiddler.fields,operator.operand)))) {\n\t\t\t\t\tresults.push(title);\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tsource(function(tiddler,title) {\n\t\t\t\tif(tiddler && $tw.utils.hop(tiddler.fields,operator.operand)) {\n\t\t\t\t\tresults.push(title);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t} else {\n\t\tif(invert) {\n\t\t\tsource(function(tiddler,title) {\n\t\t\t\tif(!tiddler || !$tw.utils.hop(tiddler.fields,operator.operand) || (tiddler.fields[operator.operand] === \"\")) {\n\t\t\t\t\tresults.push(title);\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tsource(function(tiddler,title) {\n\t\t\t\tif(tiddler && $tw.utils.hop(tiddler.fields,operator.operand) && !(tiddler.fields[operator.operand] === \"\" || tiddler.fields[operator.operand].length === 0)) {\n\t\t\t\t\tresults.push(title);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/has.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/haschanged.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/haschanged.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator returns tiddlers from the list that have a non-zero changecount.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.haschanged = function(source,operator,options) {\n\tvar results = [];\n\tif(operator.prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(options.wiki.getChangeCount(title) === 0) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(options.wiki.getChangeCount(title) > 0) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/haschanged.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/indexes.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/indexes.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for returning the indexes of a data tiddler\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.indexes = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tvar data = options.wiki.getTiddlerDataCached(title);\n\t\tif(data) {\n\t\t\t$tw.utils.pushTop(results,Object.keys(data));\n\t\t}\n\t});\n\tresults.sort();\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/indexes.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/insertbefore.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/insertbefore.js\ntype: application/javascript\nmodule-type: filteroperator\n\nInsert an item before another item in a list\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nOrder a list\n*/\nexports.insertbefore = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push(title);\n\t});\n\tvar target = options.widget && options.widget.getVariable(operator.suffix || \"currentTiddler\");\n\tif(target !== operator.operand) {\n\t\t// Remove the entry from the list if it is present\n\t\tvar pos = results.indexOf(operator.operand);\n\t\tif(pos !== -1) {\n\t\t\tresults.splice(pos,1);\n\t\t}\n\t\t// Insert the entry before the target marker\n\t\tpos = results.indexOf(target);\n\t\tif(pos !== -1) {\n\t\t\tresults.splice(pos,0,operator.operand);\n\t\t} else {\n\t\t\tresults.push(operator.operand);\n\t\t}\n\t}\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/insertbefore.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/is/current.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/is/current.js\ntype: application/javascript\nmodule-type: isfilteroperator\n\nFilter function for [is[current]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.current = function(source,prefix,options) {\n\tvar results = [],\n\t\tcurrTiddlerTitle = options.widget && options.widget.getVariable(\"currentTiddler\");\n\tif(prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(title !== currTiddlerTitle) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(title === currTiddlerTitle) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/is/current.js",
            "type": "application/javascript",
            "module-type": "isfilteroperator"
        },
        "$:/core/modules/filters/is/image.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/is/image.js\ntype: application/javascript\nmodule-type: isfilteroperator\n\nFilter function for [is[image]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.image = function(source,prefix,options) {\n\tvar results = [];\n\tif(prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(!options.wiki.isImageTiddler(title)) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(options.wiki.isImageTiddler(title)) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/is/image.js",
            "type": "application/javascript",
            "module-type": "isfilteroperator"
        },
        "$:/core/modules/filters/is/missing.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/is/missing.js\ntype: application/javascript\nmodule-type: isfilteroperator\n\nFilter function for [is[missing]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.missing = function(source,prefix,options) {\n\tvar results = [];\n\tif(prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(options.wiki.tiddlerExists(title)) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(!options.wiki.tiddlerExists(title)) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/is/missing.js",
            "type": "application/javascript",
            "module-type": "isfilteroperator"
        },
        "$:/core/modules/filters/is/orphan.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/is/orphan.js\ntype: application/javascript\nmodule-type: isfilteroperator\n\nFilter function for [is[orphan]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.orphan = function(source,prefix,options) {\n\tvar results = [],\n\t\torphanTitles = options.wiki.getOrphanTitles();\n\tif(prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(orphanTitles.indexOf(title) === -1) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(orphanTitles.indexOf(title) !== -1) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/is/orphan.js",
            "type": "application/javascript",
            "module-type": "isfilteroperator"
        },
        "$:/core/modules/filters/is/shadow.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/is/shadow.js\ntype: application/javascript\nmodule-type: isfilteroperator\n\nFilter function for [is[shadow]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.shadow = function(source,prefix,options) {\n\tvar results = [];\n\tif(prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(!options.wiki.isShadowTiddler(title)) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(options.wiki.isShadowTiddler(title)) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/is/shadow.js",
            "type": "application/javascript",
            "module-type": "isfilteroperator"
        },
        "$:/core/modules/filters/is/system.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/is/system.js\ntype: application/javascript\nmodule-type: isfilteroperator\n\nFilter function for [is[system]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.system = function(source,prefix,options) {\n\tvar results = [];\n\tif(prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(!options.wiki.isSystemTiddler(title)) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(options.wiki.isSystemTiddler(title)) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/is/system.js",
            "type": "application/javascript",
            "module-type": "isfilteroperator"
        },
        "$:/core/modules/filters/is/tag.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/is/tag.js\ntype: application/javascript\nmodule-type: isfilteroperator\n\nFilter function for [is[tag]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.tag = function(source,prefix,options) {\n\tvar results = [],\n\t\ttagMap = options.wiki.getTagMap();\n\tif(prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(!$tw.utils.hop(tagMap,title)) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tif($tw.utils.hop(tagMap,title)) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/is/tag.js",
            "type": "application/javascript",
            "module-type": "isfilteroperator"
        },
        "$:/core/modules/filters/is/tiddler.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/is/tiddler.js\ntype: application/javascript\nmodule-type: isfilteroperator\n\nFilter function for [is[tiddler]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.tiddler = function(source,prefix,options) {\n\tvar results = [];\n\tif(prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(!options.wiki.tiddlerExists(title)) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(options.wiki.tiddlerExists(title)) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/is/tiddler.js",
            "type": "application/javascript",
            "module-type": "isfilteroperator"
        },
        "$:/core/modules/filters/is.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/is.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for checking tiddler properties\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar isFilterOperators;\n\nfunction getIsFilterOperators() {\n\tif(!isFilterOperators) {\n\t\tisFilterOperators = {};\n\t\t$tw.modules.applyMethods(\"isfilteroperator\",isFilterOperators);\n\t}\n\treturn isFilterOperators;\n}\n\n/*\nExport our filter function\n*/\nexports.is = function(source,operator,options) {\n\t// Dispatch to the correct isfilteroperator\n\tvar isFilterOperators = getIsFilterOperators();\n\tif(operator.operand) {\n\t\tvar isFilterOperator = isFilterOperators[operator.operand];\n\t\tif(isFilterOperator) {\n\t\t\treturn isFilterOperator(source,operator.prefix,options);\n\t\t} else {\n\t\t\treturn [$tw.language.getString(\"Error/IsFilterOperator\")];\n\t\t}\n\t} else {\n\t\t// Return all tiddlers if the operand is missing\n\t\tvar results = [];\n\t\tsource(function(tiddler,title) {\n\t\t\tresults.push(title);\n\t\t});\n\t\treturn results;\n\t}\n};\n\n})();\n",
            "title": "$:/core/modules/filters/is.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/limit.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/limit.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for chopping the results to a specified maximum number of entries\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.limit = function(source,operator,options) {\n\tvar results = [];\n\t// Convert to an array\n\tsource(function(tiddler,title) {\n\t\tresults.push(title);\n\t});\n\t// Slice the array if necessary\n\tvar limit = Math.min(results.length,parseInt(operator.operand,10));\n\tif(operator.prefix === \"!\") {\n\t\tresults = results.slice(-limit);\n\t} else {\n\t\tresults = results.slice(0,limit);\n\t}\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/limit.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/links.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/links.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for returning all the links from a tiddler\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.links = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\t$tw.utils.pushTop(results,options.wiki.getTiddlerLinks(title));\n\t});\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/links.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/list.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/list.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator returning the tiddlers whose title is listed in the operand tiddler\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.list = function(source,operator,options) {\n\tvar results = [],\n\t\ttr = $tw.utils.parseTextReference(operator.operand),\n\t\tcurrTiddlerTitle = options.widget && options.widget.getVariable(\"currentTiddler\"),\n\t\tlist = options.wiki.getTiddlerList(tr.title || currTiddlerTitle,tr.field,tr.index);\n\tif(operator.prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(list.indexOf(title) === -1) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tresults = list;\n\t}\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/list.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/listed.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/listed.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator returning all tiddlers that have the selected tiddlers in a list\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.listed = function(source,operator,options) {\n\tvar field = operator.operand || \"list\",\n\t\tresults = [];\n\tsource(function(tiddler,title) {\n\t\t$tw.utils.pushTop(results,options.wiki.findListingsOfTiddler(title,field));\n\t});\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/listed.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/listops.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/listops.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operators for manipulating the current selection list\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nOrder a list\n*/\nexports.order = function(source,operator,options) {\n\tvar results = [];\n\tif(operator.operand.toLowerCase() === \"reverse\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tresults.unshift(title);\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tresults.push(title);\n\t\t});\t\t\n\t}\n\treturn results;\n};\n\n/*\nReverse list\n*/\nexports.reverse = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tresults.unshift(title);\n\t});\n\treturn results;\n};\n\n/*\nFirst entry/entries in list\n*/\nexports.first = function(source,operator,options) {\n\tvar count = parseInt(operator.operand) || 1,\n\t\tresults = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push(title);\n\t});\n\treturn results.slice(0,count);\n};\n\n/*\nLast entry/entries in list\n*/\nexports.last = function(source,operator,options) {\n\tvar count = parseInt(operator.operand) || 1,\n\t\tresults = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push(title);\n\t});\n\treturn results.slice(-count);\n};\n\n/*\nAll but the first entry/entries of the list\n*/\nexports.rest = function(source,operator,options) {\n\tvar count = parseInt(operator.operand) || 1,\n\t\tresults = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push(title);\n\t});\n\treturn results.slice(count);\n};\nexports.butfirst = exports.rest;\nexports.bf = exports.rest;\n\n/*\nAll but the last entry/entries of the list\n*/\nexports.butlast = function(source,operator,options) {\n\tvar count = parseInt(operator.operand) || 1,\n\t\tresults = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push(title);\n\t});\n\treturn results.slice(0,-count);\n};\nexports.bl = exports.butlast;\n\n/*\nThe nth member of the list\n*/\nexports.nth = function(source,operator,options) {\n\tvar count = parseInt(operator.operand) || 1,\n\t\tresults = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push(title);\n\t});\n\treturn results.slice(count - 1,count);\n};\n\n})();\n",
            "title": "$:/core/modules/filters/listops.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/minlength.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/minlength.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for filtering out titles that don't meet the minimum length in the operand\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.minlength = function(source,operator,options) {\n\tvar results = [],\n\t\tminLength = parseInt(operator.operand || \"\",10) || 0;\n\tsource(function(tiddler,title) {\n\t\tif(title.length >= minLength) {\n\t\t\tresults.push(title);\n\t\t}\n\t});\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/minlength.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/modules.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/modules.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for returning the titles of the modules of a given type in this wiki\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.modules = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\t$tw.utils.each($tw.modules.types[title],function(moduleInfo,moduleName) {\n\t\t\tresults.push(moduleName);\n\t\t});\n\t});\n\tresults.sort();\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/modules.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/moduletypes.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/moduletypes.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for returning the names of the module types in this wiki\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.moduletypes = function(source,operator,options) {\n\tvar results = [];\n\t$tw.utils.each($tw.modules.types,function(moduleInfo,type) {\n\t\tresults.push(type);\n\t});\n\tresults.sort();\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/moduletypes.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/next.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/next.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator returning the tiddler whose title occurs next in the list supplied in the operand tiddler\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.next = function(source,operator,options) {\n\tvar results = [],\n\t\tlist = options.wiki.getTiddlerList(operator.operand);\n\tsource(function(tiddler,title) {\n\t\tvar match = list.indexOf(title);\n\t\t// increment match and then test if result is in range\n\t\tmatch++;\n\t\tif(match > 0 && match < list.length) {\n\t\t\tresults.push(list[match]);\n\t\t}\n\t});\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/next.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/plugintiddlers.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/plugintiddlers.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for returning the titles of the shadow tiddlers within a plugin\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.plugintiddlers = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tvar pluginInfo = options.wiki.getPluginInfo(title) || options.wiki.getTiddlerDataCached(title,{tiddlers:[]});\n\t\tif(pluginInfo && pluginInfo.tiddlers) {\n\t\t\t$tw.utils.each(pluginInfo.tiddlers,function(fields,title) {\n\t\t\t\tresults.push(title);\n\t\t\t});\n\t\t}\n\t});\n\tresults.sort();\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/plugintiddlers.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/prefix.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/prefix.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for checking if a title starts with a prefix\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.prefix = function(source,operator,options) {\n\tvar results = [];\n\tif(operator.prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(title.substr(0,operator.operand.length) !== operator.operand) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(title.substr(0,operator.operand.length) === operator.operand) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/prefix.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/previous.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/previous.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator returning the tiddler whose title occurs immediately prior in the list supplied in the operand tiddler\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.previous = function(source,operator,options) {\n\tvar results = [],\n\t\tlist = options.wiki.getTiddlerList(operator.operand);\n\tsource(function(tiddler,title) {\n\t\tvar match = list.indexOf(title);\n\t\t// increment match and then test if result is in range\n\t\tmatch--;\n\t\tif(match >= 0) {\n\t\t\tresults.push(list[match]);\n\t\t}\n\t});\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/previous.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/regexp.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/regexp.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for regexp matching\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.regexp = function(source,operator,options) {\n\tvar results = [],\n\t\tfieldname = (operator.suffix || \"title\").toLowerCase(),\n\t\tregexpString, regexp, flags = \"\", match,\n\t\tgetFieldString = function(tiddler,title) {\n\t\t\tif(tiddler) {\n\t\t\t\treturn tiddler.getFieldString(fieldname);\n\t\t\t} else if(fieldname === \"title\") {\n\t\t\t\treturn title;\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t};\n\t// Process flags and construct regexp\n\tregexpString = operator.operand;\n\tmatch = /^\\(\\?([gim]+)\\)/.exec(regexpString);\n\tif(match) {\n\t\tflags = match[1];\n\t\tregexpString = regexpString.substr(match[0].length);\n\t} else {\n\t\tmatch = /\\(\\?([gim]+)\\)$/.exec(regexpString);\n\t\tif(match) {\n\t\t\tflags = match[1];\n\t\t\tregexpString = regexpString.substr(0,regexpString.length - match[0].length);\n\t\t}\n\t}\n\ttry {\n\t\tregexp = new RegExp(regexpString,flags);\n\t} catch(e) {\n\t\treturn [\"\" + e];\n\t}\n\t// Process the incoming tiddlers\n\tif(operator.prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tvar text = getFieldString(tiddler,title);\n\t\t\tif(text !== null) {\n\t\t\t\tif(!regexp.exec(text)) {\n\t\t\t\t\tresults.push(title);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tvar text = getFieldString(tiddler,title);\n\t\t\tif(text !== null) {\n\t\t\t\tif(!!regexp.exec(text)) {\n\t\t\t\t\tresults.push(title);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/regexp.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/removeprefix.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/removeprefix.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for removing a prefix from each title in the list. Titles that do not start with the prefix are removed.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.removeprefix = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tif(title.substr(0,operator.operand.length) === operator.operand) {\n\t\t\tresults.push(title.substr(operator.operand.length));\n\t\t}\n\t});\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/removeprefix.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/removesuffix.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/removesuffix.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for removing a suffix from each title in the list. Titles that do not end with the suffix are removed.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.removesuffix = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tif(title.substr(-operator.operand.length) === operator.operand) {\n\t\t\tresults.push(title.substr(0,title.length - operator.operand.length));\n\t\t}\n\t});\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/removesuffix.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/sameday.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/sameday.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator that selects tiddlers with a modified date field on the same day as the provided value.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.sameday = function(source,operator,options) {\n\tvar results = [],\n\t\tfieldName = operator.suffix || \"modified\",\n\t\ttargetDate = (new Date($tw.utils.parseDate(operator.operand))).setHours(0,0,0,0);\n\t// Function to convert a date/time to a date integer\n\tsource(function(tiddler,title) {\n\t\tif(tiddler) {\n\t\t\tif(tiddler.getFieldDay(fieldName) === targetDate) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t}\n\t});\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/sameday.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/search.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/search.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for searching for the text in the operand tiddler\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.search = function(source,operator,options) {\n\tvar invert = operator.prefix === \"!\";\n\tif(operator.suffix) {\n\t\treturn options.wiki.search(operator.operand,{\n\t\t\tsource: source,\n\t\t\tinvert: invert,\n\t\t\tfield: operator.suffix\n\t\t});\n\t} else {\n\t\treturn options.wiki.search(operator.operand,{\n\t\t\tsource: source,\n\t\t\tinvert: invert\n\t\t});\n\t}\n};\n\n})();\n",
            "title": "$:/core/modules/filters/search.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/shadowsource.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/shadowsource.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for returning the source plugins for shadow tiddlers\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.shadowsource = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tvar source = options.wiki.getShadowSource(title);\n\t\tif(source) {\n\t\t\t$tw.utils.pushTop(results,source);\n\t\t}\n\t});\n\tresults.sort();\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/shadowsource.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/sort.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/sort.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for sorting\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.sort = function(source,operator,options) {\n\tvar results = prepare_results(source);\n\toptions.wiki.sortTiddlers(results,operator.operand || \"title\",operator.prefix === \"!\",false,false);\n\treturn results;\n};\n\nexports.nsort = function(source,operator,options) {\n\tvar results = prepare_results(source);\n\toptions.wiki.sortTiddlers(results,operator.operand || \"title\",operator.prefix === \"!\",false,true);\n\treturn results;\n};\n\nexports.sortcs = function(source,operator,options) {\n\tvar results = prepare_results(source);\n\toptions.wiki.sortTiddlers(results,operator.operand || \"title\",operator.prefix === \"!\",true,false);\n\treturn results;\n};\n\nexports.nsortcs = function(source,operator,options) {\n\tvar results = prepare_results(source);\n\toptions.wiki.sortTiddlers(results,operator.operand || \"title\",operator.prefix === \"!\",true,true);\n\treturn results;\n};\n\nvar prepare_results = function (source) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push(title);\n\t});\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/sort.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/splitbefore.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/splitbefore.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator that splits each result on the first occurance of the specified separator and returns the unique values.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.splitbefore = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tvar parts = title.split(operator.operand);\n\t\tif(parts.length === 1) {\n\t\t\t$tw.utils.pushTop(results,parts[0]);\n\t\t} else {\n\t\t\t$tw.utils.pushTop(results,parts[0] + operator.operand);\n\t\t}\n\t});\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/splitbefore.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/storyviews.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/storyviews.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for returning the names of the story views in this wiki\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.storyviews = function(source,operator,options) {\n\tvar results = [],\n\t\tstoryviews = {};\n\t$tw.modules.applyMethods(\"storyview\",storyviews);\n\t$tw.utils.each(storyviews,function(info,name) {\n\t\tresults.push(name);\n\t});\n\tresults.sort();\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/storyviews.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/suffix.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/suffix.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for checking if a title ends with a suffix\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.suffix = function(source,operator,options) {\n\tvar results = [];\n\tif(operator.prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(title.substr(-operator.operand.length) !== operator.operand) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(title.substr(-operator.operand.length) === operator.operand) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/suffix.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/tag.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/tag.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for checking for the presence of a tag\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.tag = function(source,operator,options) {\n\tvar results = [];\n\tif((operator.suffix || \"\").toLowerCase() === \"strict\" && !operator.operand) {\n\t\t// New semantics:\n\t\t// Always return copy of input if operator.operand is missing\n\t\tsource(function(tiddler,title) {\n\t\t\tresults.push(title);\n\t\t});\n\t} else {\n\t\t// Old semantics:\n\t\tif(operator.prefix === \"!\") {\n\t\t\t// Returns a copy of the input if operator.operand is missing\n\t\t\tsource(function(tiddler,title) {\n\t\t\t\tif(tiddler && !tiddler.hasTag(operator.operand)) {\n\t\t\t\t\tresults.push(title);\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\t// Returns empty results if operator.operand is missing\n\t\t\tsource(function(tiddler,title) {\n\t\t\t\tif(tiddler && tiddler.hasTag(operator.operand)) {\n\t\t\t\t\tresults.push(title);\n\t\t\t\t}\n\t\t\t});\n\t\t\tresults = options.wiki.sortByList(results,operator.operand);\n\t\t}\t\t\n\t}\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/tag.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/tagging.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/tagging.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator returning all tiddlers that are tagged with the selected tiddlers\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.tagging = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\t$tw.utils.pushTop(results,options.wiki.getTiddlersWithTag(title));\n\t});\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/tagging.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/tags.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/tags.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator returning all the tags of the selected tiddlers\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.tags = function(source,operator,options) {\n\tvar tags = {};\n\tsource(function(tiddler,title) {\n\t\tvar t, length;\n\t\tif(tiddler && tiddler.fields.tags) {\n\t\t\tfor(t=0, length=tiddler.fields.tags.length; t<length; t++) {\n\t\t\t\ttags[tiddler.fields.tags[t]] = true;\n\t\t\t}\n\t\t}\n\t});\n\treturn Object.keys(tags);\n};\n\n})();\n",
            "title": "$:/core/modules/filters/tags.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/title.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/title.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for comparing title fields for equality\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.title = function(source,operator,options) {\n\tvar results = [];\n\tif(operator.prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(tiddler && tiddler.fields.title !== operator.operand) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tresults.push(operator.operand);\n\t}\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/title.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/untagged.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/untagged.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator returning all the selected tiddlers that are untagged\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.untagged = function(source,operator,options) {\n\tvar results = [];\n\tif(operator.prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(tiddler && $tw.utils.isArray(tiddler.fields.tags) && tiddler.fields.tags.length > 0) {\n\t\t\t\t$tw.utils.pushTop(results,title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(!tiddler || !tiddler.hasField(\"tags\") || ($tw.utils.isArray(tiddler.fields.tags) && tiddler.fields.tags.length === 0)) {\n\t\t\t\t$tw.utils.pushTop(results,title);\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/untagged.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/wikiparserrules.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/wikiparserrules.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for returning the names of the wiki parser rules in this wiki\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.wikiparserrules = function(source,operator,options) {\n\tvar results = [],\n\t\toperand = operator.operand;\n\t$tw.utils.each($tw.modules.types.wikirule,function(mod) {\n\t\tvar exp = mod.exports;\n\t\tif(!operand || exp.types[operand]) {\n\t\t\tresults.push(exp.name);\n\t\t}\n\t});\n\tresults.sort();\n\treturn results;\n};\n\n})();\n",
            "title": "$:/core/modules/filters/wikiparserrules.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters/x-listops.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters/x-listops.js\ntype: application/javascript\nmodule-type: filteroperator\n\nExtended filter operators to manipulate the current list.\n\n\\*/\n(function () {\n\n    /*jslint node: true, browser: true */\n    /*global $tw: false */\n    \"use strict\";\n\n    /*\n    Fetch titles from the current list\n    */\n    var prepare_results = function (source) {\n    var results = [];\n        source(function (tiddler, title) {\n            results.push(title);\n        });\n        return results;\n    };\n\n    /*\n    Moves a number of items from the tail of the current list before the item named in the operand\n    */\n    exports.putbefore = function (source, operator) {\n        var results = prepare_results(source),\n            index = results.indexOf(operator.operand),\n            count = parseInt(operator.suffix) || 1;\n        return (index === -1) ?\n            results.slice(0, -1) :\n            results.slice(0, index).concat(results.slice(-count)).concat(results.slice(index, -count));\n    };\n\n    /*\n    Moves a number of items from the tail of the current list after the item named in the operand\n    */\n    exports.putafter = function (source, operator) {\n        var results = prepare_results(source),\n            index = results.indexOf(operator.operand),\n            count = parseInt(operator.suffix) || 1;\n        return (index === -1) ?\n            results.slice(0, -1) :\n            results.slice(0, index + 1).concat(results.slice(-count)).concat(results.slice(index + 1, -count));\n    };\n\n    /*\n    Replaces the item named in the operand with a number of items from the tail of the current list\n    */\n    exports.replace = function (source, operator) {\n        var results = prepare_results(source),\n            index = results.indexOf(operator.operand),\n            count = parseInt(operator.suffix) || 1;\n        return (index === -1) ?\n            results.slice(0, -count) :\n            results.slice(0, index).concat(results.slice(-count)).concat(results.slice(index + 1, -count));\n    };\n\n    /*\n    Moves a number of items from the tail of the current list to the head of the list\n    */\n    exports.putfirst = function (source, operator) {\n        var results = prepare_results(source),\n            count = parseInt(operator.suffix) || 1;\n        return results.slice(-count).concat(results.slice(0, -count));\n    };\n\n    /*\n    Moves a number of items from the head of the current list to the tail of the list\n    */\n    exports.putlast = function (source, operator) {\n        var results = prepare_results(source),\n            count = parseInt(operator.suffix) || 1;\n        return results.slice(count).concat(results.slice(0, count));\n    };\n\n    /*\n    Moves the item named in the operand a number of places forward or backward in the list\n    */\n    exports.move = function (source, operator) {\n        var results = prepare_results(source),\n            index = results.indexOf(operator.operand),\n            count = parseInt(operator.suffix) || 1,\n            marker = results.splice(index, 1),\n            offset =  (index + count) > 0 ? index + count : 0;\n        return results.slice(0, offset).concat(marker).concat(results.slice(offset));\n    };\n\n    /*\n    Returns the items from the current list that are after the item named in the operand\n    */\n    exports.allafter = function (source, operator) {\n        var results = prepare_results(source),\n            index = results.indexOf(operator.operand);\n        return (index === -1 || index > (results.length - 2)) ? [] :\n            (operator.suffix) ? results.slice(index) :\n            results.slice(index + 1);\n    };\n\n    /*\n    Returns the items from the current list that are before the item named in the operand\n    */\n    exports.allbefore = function (source, operator) {\n        var results = prepare_results(source),\n            index = results.indexOf(operator.operand);\n        return (index <= 0) ? [] :\n            (operator.suffix) ? results.slice(0, index + 1) :\n            results.slice(0, index);\n    };\n\n    /*\n    Appends the items listed in the operand array to the tail of the current list\n    */\n    exports.append = function (source, operator) {\n        var append = $tw.utils.parseStringArray(operator.operand, \"true\"),\n            results = prepare_results(source),\n            count = parseInt(operator.suffix) || append.length;\n        return (append.length === 0) ? results :\n            (operator.prefix) ? results.concat(append.slice(-count)) :\n            results.concat(append.slice(0, count));\n    };\n\n    /*\n    Prepends the items listed in the operand array to the head of the current list\n    */\n    exports.prepend = function (source, operator) {\n        var prepend = $tw.utils.parseStringArray(operator.operand, \"true\"),\n            results = prepare_results(source),\n            count = parseInt(operator.suffix) || prepend.length;\n        return (prepend.length === 0) ? results :\n            (operator.prefix) ? prepend.slice(-count).concat(results) :\n            prepend.slice(0, count).concat(results);\n    };\n\n    /*\n    Returns all items from the current list except the items listed in the operand array\n    */\n    exports.remove = function (source, operator) {\n        var array = $tw.utils.parseStringArray(operator.operand, \"true\"),\n            results = prepare_results(source),\n            count = parseInt(operator.suffix) || array.length,\n            p,\n            len,\n            index;\n        len = array.length - 1;\n        for (p = 0; p < count; ++p) {\n            if (operator.prefix) {\n                index = results.indexOf(array[len - p]);\n            } else {\n                index = results.indexOf(array[p]);\n            }\n            if (index !== -1) {\n                results.splice(index, 1);\n            }\n        }\n        return results;\n    };\n\n    /*\n    Returns all items from the current list sorted in the order of the items in the operand array\n    */\n    exports.sortby = function (source, operator) {\n        var results = prepare_results(source);\n        if (!results || results.length < 2) {\n            return results;\n        }\n        var lookup = $tw.utils.parseStringArray(operator.operand, \"true\");\n        results.sort(function (a, b) {\n            return lookup.indexOf(a) - lookup.indexOf(b);\n        });\n        return results;\n    };\n\n    /*\n    Removes all duplicate items from the current list\n    */\n    exports.unique = function (source, operator) {\n        var results = prepare_results(source);\n        var set = results.reduce(function (a, b) {\n            if (a.indexOf(b) < 0) {\n                a.push(b);\n            }\n            return a;\n        }, []);\n        return set;\n    };\n})();\n",
            "title": "$:/core/modules/filters/x-listops.js",
            "type": "application/javascript",
            "module-type": "filteroperator"
        },
        "$:/core/modules/filters.js": {
            "text": "/*\\\ntitle: $:/core/modules/filters.js\ntype: application/javascript\nmodule-type: wikimethod\n\nAdds tiddler filtering methods to the $tw.Wiki object.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nParses an operation (i.e. a run) within a filter string\n\toperators: Array of array of operator nodes into which results should be inserted\n\tfilterString: filter string\n\tp: start position within the string\nReturns the new start position, after the parsed operation\n*/\nfunction parseFilterOperation(operators,filterString,p) {\n\tvar nextBracketPos, operator;\n\t// Skip the starting square bracket\n\tif(filterString.charAt(p++) !== \"[\") {\n\t\tthrow \"Missing [ in filter expression\";\n\t}\n\t// Process each operator in turn\n\tdo {\n\t\toperator = {};\n\t\t// Check for an operator prefix\n\t\tif(filterString.charAt(p) === \"!\") {\n\t\t\toperator.prefix = filterString.charAt(p++);\n\t\t}\n\t\t// Get the operator name\n\t\tnextBracketPos = filterString.substring(p).search(/[\\[\\{<\\/]/);\n\t\tif(nextBracketPos === -1) {\n\t\t\tthrow \"Missing [ in filter expression\";\n\t\t}\n\t\tnextBracketPos += p;\n\t\tvar bracket = filterString.charAt(nextBracketPos);\n\t\toperator.operator = filterString.substring(p,nextBracketPos);\n\n\t\t// Any suffix?\n\t\tvar colon = operator.operator.indexOf(':');\n\t\tif(colon > -1) {\n\t\t\toperator.suffix = operator.operator.substring(colon + 1);\n\t\t\toperator.operator = operator.operator.substring(0,colon) || \"field\";\n\t\t}\n\t\t// Empty operator means: title\n\t\telse if(operator.operator === \"\") {\n\t\t\toperator.operator = \"title\";\n\t\t}\n\n\t\tp = nextBracketPos + 1;\n\t\tswitch (bracket) {\n\t\t\tcase \"{\": // Curly brackets\n\t\t\t\toperator.indirect = true;\n\t\t\t\tnextBracketPos = filterString.indexOf(\"}\",p);\n\t\t\t\tbreak;\n\t\t\tcase \"[\": // Square brackets\n\t\t\t\tnextBracketPos = filterString.indexOf(\"]\",p);\n\t\t\t\tbreak;\n\t\t\tcase \"<\": // Angle brackets\n\t\t\t\toperator.variable = true;\n\t\t\t\tnextBracketPos = filterString.indexOf(\">\",p);\n\t\t\t\tbreak;\n\t\t\tcase \"/\": // regexp brackets\n\t\t\t\tvar rex = /^((?:[^\\\\\\/]*|\\\\.)*)\\/(?:\\(([mygi]+)\\))?/g,\n\t\t\t\t\trexMatch = rex.exec(filterString.substring(p));\n\t\t\t\tif(rexMatch) {\n\t\t\t\t\toperator.regexp = new RegExp(rexMatch[1], rexMatch[2]);\n// DEPRECATION WARNING\nconsole.log(\"WARNING: Filter\",operator.operator,\"has a deprecated regexp operand\",operator.regexp);\n\t\t\t\t\tnextBracketPos = p + rex.lastIndex - 1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthrow \"Unterminated regular expression in filter expression\";\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif(nextBracketPos === -1) {\n\t\t\tthrow \"Missing closing bracket in filter expression\";\n\t\t}\n\t\tif(!operator.regexp) {\n\t\t\toperator.operand = filterString.substring(p,nextBracketPos);\n\t\t}\n\t\tp = nextBracketPos + 1;\n\n\t\t// Push this operator\n\t\toperators.push(operator);\n\t} while(filterString.charAt(p) !== \"]\");\n\t// Skip the ending square bracket\n\tif(filterString.charAt(p++) !== \"]\") {\n\t\tthrow \"Missing ] in filter expression\";\n\t}\n\t// Return the parsing position\n\treturn p;\n}\n\n/*\nParse a filter string\n*/\nexports.parseFilter = function(filterString) {\n\tfilterString = filterString || \"\";\n\tvar results = [], // Array of arrays of operator nodes {operator:,operand:}\n\t\tp = 0, // Current position in the filter string\n\t\tmatch;\n\tvar whitespaceRegExp = /(\\s+)/mg,\n\t\toperandRegExp = /((?:\\+|\\-)?)(?:(\\[)|(?:\"([^\"]*)\")|(?:'([^']*)')|([^\\s\\[\\]]+))/mg;\n\twhile(p < filterString.length) {\n\t\t// Skip any whitespace\n\t\twhitespaceRegExp.lastIndex = p;\n\t\tmatch = whitespaceRegExp.exec(filterString);\n\t\tif(match && match.index === p) {\n\t\t\tp = p + match[0].length;\n\t\t}\n\t\t// Match the start of the operation\n\t\tif(p < filterString.length) {\n\t\t\toperandRegExp.lastIndex = p;\n\t\t\tmatch = operandRegExp.exec(filterString);\n\t\t\tif(!match || match.index !== p) {\n\t\t\t\tthrow $tw.language.getString(\"Error/FilterSyntax\");\n\t\t\t}\n\t\t\tvar operation = {\n\t\t\t\tprefix: \"\",\n\t\t\t\toperators: []\n\t\t\t};\n\t\t\tif(match[1]) {\n\t\t\t\toperation.prefix = match[1];\n\t\t\t\tp++;\n\t\t\t}\n\t\t\tif(match[2]) { // Opening square bracket\n\t\t\t\tp = parseFilterOperation(operation.operators,filterString,p);\n\t\t\t} else {\n\t\t\t\tp = match.index + match[0].length;\n\t\t\t}\n\t\t\tif(match[3] || match[4] || match[5]) { // Double quoted string, single quoted string or unquoted title\n\t\t\t\toperation.operators.push(\n\t\t\t\t\t{operator: \"title\", operand: match[3] || match[4] || match[5]}\n\t\t\t\t);\n\t\t\t}\n\t\t\tresults.push(operation);\n\t\t}\n\t}\n\treturn results;\n};\n\nexports.getFilterOperators = function() {\n\tif(!this.filterOperators) {\n\t\t$tw.Wiki.prototype.filterOperators = {};\n\t\t$tw.modules.applyMethods(\"filteroperator\",this.filterOperators);\n\t}\n\treturn this.filterOperators;\n};\n\nexports.filterTiddlers = function(filterString,widget,source) {\n\tvar fn = this.compileFilter(filterString);\n\treturn fn.call(this,source,widget);\n};\n\n/*\nCompile a filter into a function with the signature fn(source,widget) where:\nsource: an iterator function for the source tiddlers, called source(iterator), where iterator is called as iterator(tiddler,title)\nwidget: an optional widget node for retrieving the current tiddler etc.\n*/\nexports.compileFilter = function(filterString) {\n\tvar filterParseTree;\n\ttry {\n\t\tfilterParseTree = this.parseFilter(filterString);\n\t} catch(e) {\n\t\treturn function(source,widget) {\n\t\t\treturn [$tw.language.getString(\"Error/Filter\") + \": \" + e];\n\t\t};\n\t}\n\t// Get the hashmap of filter operator functions\n\tvar filterOperators = this.getFilterOperators();\n\t// Assemble array of functions, one for each operation\n\tvar operationFunctions = [];\n\t// Step through the operations\n\tvar self = this;\n\t$tw.utils.each(filterParseTree,function(operation) {\n\t\t// Create a function for the chain of operators in the operation\n\t\tvar operationSubFunction = function(source,widget) {\n\t\t\tvar accumulator = source,\n\t\t\t\tresults = [],\n\t\t\t\tcurrTiddlerTitle = widget && widget.getVariable(\"currentTiddler\");\n\t\t\t$tw.utils.each(operation.operators,function(operator) {\n\t\t\t\tvar operand = operator.operand,\n\t\t\t\t\toperatorFunction;\n\t\t\t\tif(!operator.operator) {\n\t\t\t\t\toperatorFunction = filterOperators.title;\n\t\t\t\t} else if(!filterOperators[operator.operator]) {\n\t\t\t\t\toperatorFunction = filterOperators.field;\n\t\t\t\t} else {\n\t\t\t\t\toperatorFunction = filterOperators[operator.operator];\n\t\t\t\t}\n\t\t\t\tif(operator.indirect) {\n\t\t\t\t\toperand = self.getTextReference(operator.operand,\"\",currTiddlerTitle);\n\t\t\t\t}\n\t\t\t\tif(operator.variable) {\n\t\t\t\t\toperand = widget.getVariable(operator.operand,{defaultValue: \"\"});\n\t\t\t\t}\n\t\t\t\t// Invoke the appropriate filteroperator module\n\t\t\t\tresults = operatorFunction(accumulator,{\n\t\t\t\t\t\t\toperator: operator.operator,\n\t\t\t\t\t\t\toperand: operand,\n\t\t\t\t\t\t\tprefix: operator.prefix,\n\t\t\t\t\t\t\tsuffix: operator.suffix,\n\t\t\t\t\t\t\tregexp: operator.regexp\n\t\t\t\t\t\t},{\n\t\t\t\t\t\t\twiki: self,\n\t\t\t\t\t\t\twidget: widget\n\t\t\t\t\t\t});\n\t\t\t\tif($tw.utils.isArray(results)) {\n\t\t\t\t\taccumulator = self.makeTiddlerIterator(results);\n\t\t\t\t} else {\n\t\t\t\t\taccumulator = results;\n\t\t\t\t}\n\t\t\t});\n\t\t\tif($tw.utils.isArray(results)) {\n\t\t\t\treturn results;\n\t\t\t} else {\n\t\t\t\tvar resultArray = [];\n\t\t\t\tresults(function(tiddler,title) {\n\t\t\t\t\tresultArray.push(title);\n\t\t\t\t});\n\t\t\t\treturn resultArray;\n\t\t\t}\n\t\t};\n\t\t// Wrap the operator functions in a wrapper function that depends on the prefix\n\t\toperationFunctions.push((function() {\n\t\t\tswitch(operation.prefix || \"\") {\n\t\t\t\tcase \"\": // No prefix means that the operation is unioned into the result\n\t\t\t\t\treturn function(results,source,widget) {\n\t\t\t\t\t\t$tw.utils.pushTop(results,operationSubFunction(source,widget));\n\t\t\t\t\t};\n\t\t\t\tcase \"-\": // The results of this operation are removed from the main result\n\t\t\t\t\treturn function(results,source,widget) {\n\t\t\t\t\t\t$tw.utils.removeArrayEntries(results,operationSubFunction(source,widget));\n\t\t\t\t\t};\n\t\t\t\tcase \"+\": // This operation is applied to the main results so far\n\t\t\t\t\treturn function(results,source,widget) {\n\t\t\t\t\t\t// This replaces all the elements of the array, but keeps the actual array so that references to it are preserved\n\t\t\t\t\t\tsource = self.makeTiddlerIterator(results);\n\t\t\t\t\t\tresults.splice(0,results.length);\n\t\t\t\t\t\t$tw.utils.pushTop(results,operationSubFunction(source,widget));\n\t\t\t\t\t};\n\t\t\t}\n\t\t})());\n\t});\n\t// Return a function that applies the operations to a source iterator of tiddler titles\n\treturn $tw.perf.measure(\"filter\",function filterFunction(source,widget) {\n\t\tif(!source) {\n\t\t\tsource = self.each;\n\t\t} else if(typeof source === \"object\") { // Array or hashmap\n\t\t\tsource = self.makeTiddlerIterator(source);\n\t\t}\n\t\tvar results = [];\n\t\t$tw.utils.each(operationFunctions,function(operationFunction) {\n\t\t\toperationFunction(results,source,widget);\n\t\t});\n\t\treturn results;\n\t});\n};\n\n})();\n",
            "title": "$:/core/modules/filters.js",
            "type": "application/javascript",
            "module-type": "wikimethod"
        },
        "$:/core/modules/info/platform.js": {
            "text": "/*\\\ntitle: $:/core/modules/info/platform.js\ntype: application/javascript\nmodule-type: info\n\nInitialise basic platform $:/info/ tiddlers\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.getInfoTiddlerFields = function() {\n\tvar mapBoolean = function(value) {return value ? \"yes\" : \"no\";},\n\t\tinfoTiddlerFields = [];\n\t// Basics\n\tinfoTiddlerFields.push({title: \"$:/info/browser\", text: mapBoolean(!!$tw.browser)});\n\tinfoTiddlerFields.push({title: \"$:/info/node\", text: mapBoolean(!!$tw.node)});\n\t// Document location\n\tif($tw.browser) {\n\t\tvar setLocationProperty = function(name,value) {\n\t\t\t\tinfoTiddlerFields.push({title: \"$:/info/url/\" + name, text: value});\t\t\t\n\t\t\t},\n\t\t\tlocation = document.location;\n\t\tsetLocationProperty(\"full\", (location.toString()).split(\"#\")[0]);\n\t\tsetLocationProperty(\"host\", location.host);\n\t\tsetLocationProperty(\"hostname\", location.hostname);\n\t\tsetLocationProperty(\"protocol\", location.protocol);\n\t\tsetLocationProperty(\"port\", location.port);\n\t\tsetLocationProperty(\"pathname\", location.pathname);\n\t\tsetLocationProperty(\"search\", location.search);\n\t\tsetLocationProperty(\"origin\", location.origin);\n\t}\n\treturn infoTiddlerFields;\n};\n\n})();\n",
            "title": "$:/core/modules/info/platform.js",
            "type": "application/javascript",
            "module-type": "info"
        },
        "$:/core/modules/keyboard.js": {
            "text": "/*\\\ntitle: $:/core/modules/keyboard.js\ntype: application/javascript\nmodule-type: global\n\nKeyboard handling utilities\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar namedKeys = {\n\t\"cancel\": 3,\n\t\"help\": 6,\n\t\"backspace\": 8,\n\t\"tab\": 9,\n\t\"clear\": 12,\n\t\"return\": 13,\n\t\"enter\": 13,\n\t\"pause\": 19,\n\t\"escape\": 27,\n\t\"space\": 32,\n\t\"page_up\": 33,\n\t\"page_down\": 34,\n\t\"end\": 35,\n\t\"home\": 36,\n\t\"left\": 37,\n\t\"up\": 38,\n\t\"right\": 39,\n\t\"down\": 40,\n\t\"printscreen\": 44,\n\t\"insert\": 45,\n\t\"delete\": 46,\n\t\"0\": 48,\n\t\"1\": 49,\n\t\"2\": 50,\n\t\"3\": 51,\n\t\"4\": 52,\n\t\"5\": 53,\n\t\"6\": 54,\n\t\"7\": 55,\n\t\"8\": 56,\n\t\"9\": 57,\n\t\"firefoxsemicolon\": 59,\n\t\"firefoxequals\": 61,\n\t\"a\": 65,\n\t\"b\": 66,\n\t\"c\": 67,\n\t\"d\": 68,\n\t\"e\": 69,\n\t\"f\": 70,\n\t\"g\": 71,\n\t\"h\": 72,\n\t\"i\": 73,\n\t\"j\": 74,\n\t\"k\": 75,\n\t\"l\": 76,\n\t\"m\": 77,\n\t\"n\": 78,\n\t\"o\": 79,\n\t\"p\": 80,\n\t\"q\": 81,\n\t\"r\": 82,\n\t\"s\": 83,\n\t\"t\": 84,\n\t\"u\": 85,\n\t\"v\": 86,\n\t\"w\": 87,\n\t\"x\": 88,\n\t\"y\": 89,\n\t\"z\": 90,\n\t\"numpad0\": 96,\n\t\"numpad1\": 97,\n\t\"numpad2\": 98,\n\t\"numpad3\": 99,\n\t\"numpad4\": 100,\n\t\"numpad5\": 101,\n\t\"numpad6\": 102,\n\t\"numpad7\": 103,\n\t\"numpad8\": 104,\n\t\"numpad9\": 105,\n\t\"multiply\": 106,\n\t\"add\": 107,\n\t\"separator\": 108,\n\t\"subtract\": 109,\n\t\"decimal\": 110,\n\t\"divide\": 111,\n\t\"f1\": 112,\n\t\"f2\": 113,\n\t\"f3\": 114,\n\t\"f4\": 115,\n\t\"f5\": 116,\n\t\"f6\": 117,\n\t\"f7\": 118,\n\t\"f8\": 119,\n\t\"f9\": 120,\n\t\"f10\": 121,\n\t\"f11\": 122,\n\t\"f12\": 123,\n\t\"f13\": 124,\n\t\"f14\": 125,\n\t\"f15\": 126,\n\t\"f16\": 127,\n\t\"f17\": 128,\n\t\"f18\": 129,\n\t\"f19\": 130,\n\t\"f20\": 131,\n\t\"f21\": 132,\n\t\"f22\": 133,\n\t\"f23\": 134,\n\t\"f24\": 135,\n\t\"firefoxminus\": 173,\n\t\"semicolon\": 186,\n\t\"equals\": 187,\n\t\"comma\": 188,\n\t\"dash\": 189,\n\t\"period\": 190,\n\t\"slash\": 191,\n\t\"backquote\": 192,\n\t\"openbracket\": 219,\n\t\"backslash\": 220,\n\t\"closebracket\": 221,\n\t\"quote\": 222\n};\n\nfunction KeyboardManager(options) {\n\tvar self = this;\n\toptions = options || \"\";\n\t// Save the named key hashmap\n\tthis.namedKeys = namedKeys;\n\t// Create a reverse mapping of code to keyname\n\tthis.keyNames = [];\n\t$tw.utils.each(namedKeys,function(keyCode,name) {\n\t\tself.keyNames[keyCode] = name.substr(0,1).toUpperCase() + name.substr(1);\n\t});\n\t// Save the platform-specific name of the \"meta\" key\n\tthis.metaKeyName = $tw.platform.isMac ? \"cmd-\" : \"win-\";\n}\n\n/*\nReturn an array of keycodes for the modifier keys ctrl, shift, alt, meta\n*/\nKeyboardManager.prototype.getModifierKeys = function() {\n\treturn [\n\t\t16, // Shift\n\t\t17, // Ctrl\n\t\t18, // Alt\n\t\t20, // CAPS LOCK\n\t\t91, // Meta (left)\n\t\t93, // Meta (right)\n\t\t224 // Meta (Firefox)\n\t]\n};\n\n/*\nParses a key descriptor into the structure:\n{\n\tkeyCode: numeric keycode\n\tshiftKey: boolean\n\taltKey: boolean\n\tctrlKey: boolean\n\tmetaKey: boolean\n}\nKey descriptors have the following format:\n\tctrl+enter\n\tctrl+shift+alt+A\n*/\nKeyboardManager.prototype.parseKeyDescriptor = function(keyDescriptor) {\n\tvar components = keyDescriptor.split(/\\+|\\-/),\n\t\tinfo = {\n\t\t\tkeyCode: 0,\n\t\t\tshiftKey: false,\n\t\t\taltKey: false,\n\t\t\tctrlKey: false,\n\t\t\tmetaKey: false\n\t\t};\n\tfor(var t=0; t<components.length; t++) {\n\t\tvar s = components[t].toLowerCase(),\n\t\t\tc = s.charCodeAt(0);\n\t\t// Look for modifier keys\n\t\tif(s === \"ctrl\") {\n\t\t\tinfo.ctrlKey = true;\n\t\t} else if(s === \"shift\") {\n\t\t\tinfo.shiftKey = true;\n\t\t} else if(s === \"alt\") {\n\t\t\tinfo.altKey = true;\n\t\t} else if(s === \"meta\" || s === \"cmd\" || s === \"win\") {\n\t\t\tinfo.metaKey = true;\n\t\t}\n\t\t// Replace named keys with their code\n\t\tif(this.namedKeys[s]) {\n\t\t\tinfo.keyCode = this.namedKeys[s];\n\t\t}\n\t}\n\tif(info.keyCode) {\n\t\treturn info;\n\t} else {\n\t\treturn null;\n\t}\n};\n\n/*\nParse a list of key descriptors into an array of keyInfo objects. The key descriptors can be passed as an array of strings or a space separated string\n*/\nKeyboardManager.prototype.parseKeyDescriptors = function(keyDescriptors,options) {\n\tvar self = this;\n\toptions = options || {};\n\toptions.stack = options.stack || [];\n\tvar wiki = options.wiki || $tw.wiki;\n\tif(typeof keyDescriptors === \"string\" && keyDescriptors === \"\") {\n\t\treturn [];\n\t}\n\tif(!$tw.utils.isArray(keyDescriptors)) {\n\t\tkeyDescriptors = keyDescriptors.split(\" \");\n\t}\n\tvar result = [];\n\t$tw.utils.each(keyDescriptors,function(keyDescriptor) {\n\t\t// Look for a named shortcut\n\t\tif(keyDescriptor.substr(0,2) === \"((\" && keyDescriptor.substr(-2,2) === \"))\") {\n\t\t\tif(options.stack.indexOf(keyDescriptor) === -1) {\n\t\t\t\toptions.stack.push(keyDescriptor);\n\t\t\t\tvar name = keyDescriptor.substring(2,keyDescriptor.length - 2),\n\t\t\t\t\tlookupName = function(configName) {\n\t\t\t\t\t\tvar keyDescriptors = wiki.getTiddlerText(\"$:/config/\" + configName + \"/\" + name);\n\t\t\t\t\t\tif(keyDescriptors) {\n\t\t\t\t\t\t\tresult.push.apply(result,self.parseKeyDescriptors(keyDescriptors,options));\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\tlookupName(\"shortcuts\");\n\t\t\t\tlookupName($tw.platform.isMac ? \"shortcuts-mac\" : \"shortcuts-not-mac\");\n\t\t\t\tlookupName($tw.platform.isWindows ? \"shortcuts-windows\" : \"shortcuts-not-windows\");\n\t\t\t\tlookupName($tw.platform.isLinux ? \"shortcuts-linux\" : \"shortcuts-not-linux\");\n\t\t\t}\n\t\t} else {\n\t\t\tresult.push(self.parseKeyDescriptor(keyDescriptor));\n\t\t}\n\t});\n\treturn result;\n};\n\nKeyboardManager.prototype.getPrintableShortcuts = function(keyInfoArray) {\n\tvar self = this,\n\t\tresult = [];\n\t$tw.utils.each(keyInfoArray,function(keyInfo) {\n\t\tif(keyInfo) {\n\t\t\tresult.push((keyInfo.ctrlKey ? \"ctrl-\" : \"\") + \n\t\t\t\t   (keyInfo.shiftKey ? \"shift-\" : \"\") + \n\t\t\t\t   (keyInfo.altKey ? \"alt-\" : \"\") + \n\t\t\t\t   (keyInfo.metaKey ? self.metaKeyName : \"\") + \n\t\t\t\t   (self.keyNames[keyInfo.keyCode]));\n\t\t}\n\t});\n\treturn result;\n}\n\nKeyboardManager.prototype.checkKeyDescriptor = function(event,keyInfo) {\n\treturn keyInfo &&\n\t\t\tevent.keyCode === keyInfo.keyCode && \n\t\t\tevent.shiftKey === keyInfo.shiftKey && \n\t\t\tevent.altKey === keyInfo.altKey && \n\t\t\tevent.ctrlKey === keyInfo.ctrlKey && \n\t\t\tevent.metaKey === keyInfo.metaKey;\n};\n\nKeyboardManager.prototype.checkKeyDescriptors = function(event,keyInfoArray) {\n\tfor(var t=0; t<keyInfoArray.length; t++) {\n\t\tif(this.checkKeyDescriptor(event,keyInfoArray[t])) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n};\n\nexports.KeyboardManager = KeyboardManager;\n\n})();\n",
            "title": "$:/core/modules/keyboard.js",
            "type": "application/javascript",
            "module-type": "global"
        },
        "$:/core/modules/language.js": {
            "text": "/*\\\ntitle: $:/core/modules/language.js\ntype: application/javascript\nmodule-type: global\n\nThe $tw.Language() manages translateable strings\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nCreate an instance of the language manager. Options include:\nwiki: wiki from which to retrieve translation tiddlers\n*/\nfunction Language(options) {\n\toptions = options || \"\";\n\tthis.wiki = options.wiki || $tw.wiki;\n}\n\n/*\nReturn a wikified translateable string. The title is automatically prefixed with \"$:/language/\"\nOptions include:\nvariables: optional hashmap of variables to supply to the language wikification\n*/\nLanguage.prototype.getString = function(title,options) {\n\toptions = options || {};\n\ttitle = \"$:/language/\" + title;\n\treturn this.wiki.renderTiddler(\"text/plain\",title,{variables: options.variables});\n};\n\n/*\nReturn a raw, unwikified translateable string. The title is automatically prefixed with \"$:/language/\"\n*/\nLanguage.prototype.getRawString = function(title) {\n\ttitle = \"$:/language/\" + title;\n\treturn this.wiki.getTiddlerText(title);\n};\n\nexports.Language = Language;\n\n})();\n",
            "title": "$:/core/modules/language.js",
            "type": "application/javascript",
            "module-type": "global"
        },
        "$:/core/modules/macros/changecount.js": {
            "text": "/*\\\ntitle: $:/core/modules/macros/changecount.js\ntype: application/javascript\nmodule-type: macro\n\nMacro to return the changecount for the current tiddler\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nInformation about this macro\n*/\n\nexports.name = \"changecount\";\n\nexports.params = [];\n\n/*\nRun the macro\n*/\nexports.run = function() {\n\treturn this.wiki.getChangeCount(this.getVariable(\"currentTiddler\")) + \"\";\n};\n\n})();\n",
            "title": "$:/core/modules/macros/changecount.js",
            "type": "application/javascript",
            "module-type": "macro"
        },
        "$:/core/modules/macros/contrastcolour.js": {
            "text": "/*\\\ntitle: $:/core/modules/macros/contrastcolour.js\ntype: application/javascript\nmodule-type: macro\n\nMacro to choose which of two colours has the highest contrast with a base colour\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nInformation about this macro\n*/\n\nexports.name = \"contrastcolour\";\n\nexports.params = [\n\t{name: \"target\"},\n\t{name: \"fallbackTarget\"},\n\t{name: \"colourA\"},\n\t{name: \"colourB\"}\n];\n\n/*\nRun the macro\n*/\nexports.run = function(target,fallbackTarget,colourA,colourB) {\n\tvar rgbTarget = $tw.utils.parseCSSColor(target) || $tw.utils.parseCSSColor(fallbackTarget);\n\tif(!rgbTarget) {\n\t\treturn colourA;\n\t}\n\tvar rgbColourA = $tw.utils.parseCSSColor(colourA),\n\t\trgbColourB = $tw.utils.parseCSSColor(colourB);\n\tif(rgbColourA && !rgbColourB) {\n\t\treturn rgbColourA;\n\t}\n\tif(rgbColourB && !rgbColourA) {\n\t\treturn rgbColourB;\n\t}\n\tif(!rgbColourA && !rgbColourB) {\n\t\t// If neither colour is readable, return a crude inverse of the target\n\t\treturn [255 - rgbTarget[0],255 - rgbTarget[1],255 - rgbTarget[2],rgbTarget[3]];\n\t}\n\t// Colour brightness formula derived from http://www.w3.org/WAI/ER/WD-AERT/#color-contrast\n\tvar brightnessTarget = rgbTarget[0] * 0.299 + rgbTarget[1] * 0.587 + rgbTarget[2] * 0.114,\n\t\tbrightnessA = rgbColourA[0] * 0.299 + rgbColourA[1] * 0.587 + rgbColourA[2] * 0.114,\n\t\tbrightnessB = rgbColourB[0] * 0.299 + rgbColourB[1] * 0.587 + rgbColourB[2] * 0.114;\n\treturn Math.abs(brightnessTarget - brightnessA) > Math.abs(brightnessTarget - brightnessB) ? colourA : colourB;\n};\n\n})();\n",
            "title": "$:/core/modules/macros/contrastcolour.js",
            "type": "application/javascript",
            "module-type": "macro"
        },
        "$:/core/modules/macros/csvtiddlers.js": {
            "text": "/*\\\ntitle: $:/core/modules/macros/csvtiddlers.js\ntype: application/javascript\nmodule-type: macro\n\nMacro to output tiddlers matching a filter to CSV\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nInformation about this macro\n*/\n\nexports.name = \"csvtiddlers\";\n\nexports.params = [\n\t{name: \"filter\"},\n\t{name: \"format\"},\n];\n\n/*\nRun the macro\n*/\nexports.run = function(filter,format) {\n\tvar self = this,\n\t\ttiddlers = this.wiki.filterTiddlers(filter),\n\t\ttiddler,\n\t\tfields = [],\n\t\tt,f;\n\t// Collect all the fields\n\tfor(t=0;t<tiddlers.length; t++) {\n\t\ttiddler = this.wiki.getTiddler(tiddlers[t]);\n\t\tfor(f in tiddler.fields) {\n\t\t\tif(fields.indexOf(f) === -1) {\n\t\t\t\tfields.push(f);\n\t\t\t}\n\t\t}\n\t}\n\t// Sort the fields and bring the standard ones to the front\n\tfields.sort();\n\t\"title text modified modifier created creator\".split(\" \").reverse().forEach(function(value,index) {\n\t\tvar p = fields.indexOf(value);\n\t\tif(p !== -1) {\n\t\t\tfields.splice(p,1);\n\t\t\tfields.unshift(value)\n\t\t}\n\t});\n\t// Output the column headings\n\tvar output = [], row = [];\n\tfields.forEach(function(value) {\n\t\trow.push(quoteAndEscape(value))\n\t});\n\toutput.push(row.join(\",\"));\n\t// Output each tiddler\n\tfor(var t=0;t<tiddlers.length; t++) {\n\t\trow = [];\n\t\ttiddler = this.wiki.getTiddler(tiddlers[t]);\n\t\t\tfor(f=0; f<fields.length; f++) {\n\t\t\t\trow.push(quoteAndEscape(tiddler ? tiddler.getFieldString(fields[f]) || \"\" : \"\"));\n\t\t\t}\n\t\toutput.push(row.join(\",\"));\n\t}\n\treturn output.join(\"\\n\");\n};\n\nfunction quoteAndEscape(value) {\n\treturn \"\\\"\" + value.replace(/\"/mg,\"\\\"\\\"\") + \"\\\"\";\n}\n\n})();\n",
            "title": "$:/core/modules/macros/csvtiddlers.js",
            "type": "application/javascript",
            "module-type": "macro"
        },
        "$:/core/modules/macros/displayshortcuts.js": {
            "text": "/*\\\ntitle: $:/core/modules/macros/displayshortcuts.js\ntype: application/javascript\nmodule-type: macro\n\nMacro to display a list of keyboard shortcuts in human readable form. Notably, it resolves named shortcuts like `((bold))` to the underlying keystrokes.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nInformation about this macro\n*/\n\nexports.name = \"displayshortcuts\";\n\nexports.params = [\n\t{name: \"shortcuts\"},\n\t{name: \"prefix\"},\n\t{name: \"separator\"},\n\t{name: \"suffix\"}\n];\n\n/*\nRun the macro\n*/\nexports.run = function(shortcuts,prefix,separator,suffix) {\n\tvar shortcutArray = $tw.keyboardManager.getPrintableShortcuts($tw.keyboardManager.parseKeyDescriptors(shortcuts,{\n\t\twiki: this.wiki\n\t}));\n\tif(shortcutArray.length > 0) {\n\t\tshortcutArray.sort(function(a,b) {\n\t\t    return a.toLowerCase().localeCompare(b.toLowerCase());\n\t\t})\n\t\treturn prefix + shortcutArray.join(separator) + suffix;\n\t} else {\n\t\treturn \"\";\n\t}\n};\n\n})();\n",
            "title": "$:/core/modules/macros/displayshortcuts.js",
            "type": "application/javascript",
            "module-type": "macro"
        },
        "$:/core/modules/macros/dumpvariables.js": {
            "text": "/*\\\ntitle: $:/core/modules/macros/dumpvariables.js\ntype: application/javascript\nmodule-type: macro\n\nMacro to dump all active variable values\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nInformation about this macro\n*/\n\nexports.name = \"dumpvariables\";\n\nexports.params = [\n];\n\n/*\nRun the macro\n*/\nexports.run = function() {\n\tvar output = [\"|!Variable |!Value |\"],\n\t\tvariables = [], variable;\n\tfor(variable in this.variables) {\n\t\tvariables.push(variable);\n\t}\n\tvariables.sort();\n\tfor(var index=0; index<variables.length; index++) {\n\t\tvar variable = variables[index];\n\t\toutput.push(\"|\" + variable + \" |<input size=50 value=<<\" + variable + \">>/> |\")\n\t}\n\treturn output.join(\"\\n\");\n};\n\n})();\n",
            "title": "$:/core/modules/macros/dumpvariables.js",
            "type": "application/javascript",
            "module-type": "macro"
        },
        "$:/core/modules/macros/jsontiddler.js": {
            "text": "/*\\\ntitle: $:/core/modules/macros/jsontiddler.js\ntype: application/javascript\nmodule-type: macro\n\nMacro to output a single tiddler to JSON\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nInformation about this macro\n*/\n\nexports.name = \"jsontiddler\";\n\nexports.params = [\n\t{name: \"title\"}\n];\n\n/*\nRun the macro\n*/\nexports.run = function(title) {\n\ttitle = title || this.getVariable(\"currentTiddler\");\n\tvar tiddler = !!title && this.wiki.getTiddler(title),\n\t\tfields = new Object();\n\tif(tiddler) {\n\t\tfor(var field in tiddler.fields) {\n\t\t\tfields[field] = tiddler.getFieldString(field);\n\t\t}\n\t}\n\treturn JSON.stringify(fields,null,$tw.config.preferences.jsonSpaces);\n};\n\n})();\n",
            "title": "$:/core/modules/macros/jsontiddler.js",
            "type": "application/javascript",
            "module-type": "macro"
        },
        "$:/core/modules/macros/jsontiddlers.js": {
            "text": "/*\\\ntitle: $:/core/modules/macros/jsontiddlers.js\ntype: application/javascript\nmodule-type: macro\n\nMacro to output tiddlers matching a filter to JSON\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nInformation about this macro\n*/\n\nexports.name = \"jsontiddlers\";\n\nexports.params = [\n\t{name: \"filter\"}\n];\n\n/*\nRun the macro\n*/\nexports.run = function(filter) {\n\tvar tiddlers = this.wiki.filterTiddlers(filter),\n\t\tdata = [];\n\tfor(var t=0;t<tiddlers.length; t++) {\n\t\tvar tiddler = this.wiki.getTiddler(tiddlers[t]);\n\t\tif(tiddler) {\n\t\t\tvar fields = new Object();\n\t\t\tfor(var field in tiddler.fields) {\n\t\t\t\tfields[field] = tiddler.getFieldString(field);\n\t\t\t}\n\t\t\tdata.push(fields);\n\t\t}\n\t}\n\treturn JSON.stringify(data,null,$tw.config.preferences.jsonSpaces);\n};\n\n})();\n",
            "title": "$:/core/modules/macros/jsontiddlers.js",
            "type": "application/javascript",
            "module-type": "macro"
        },
        "$:/core/modules/macros/makedatauri.js": {
            "text": "/*\\\ntitle: $:/core/modules/macros/makedatauri.js\ntype: application/javascript\nmodule-type: macro\n\nMacro to convert a string of text to a data URI\n\n<<makedatauri text:\"Text to be converted\" type:\"text/vnd.tiddlywiki\">>\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nInformation about this macro\n*/\n\nexports.name = \"makedatauri\";\n\nexports.params = [\n\t{name: \"text\"},\n\t{name: \"type\"}\n];\n\n/*\nRun the macro\n*/\nexports.run = function(text,type) {\n\treturn $tw.utils.makeDataUri(text,type);\n};\n\n})();\n",
            "title": "$:/core/modules/macros/makedatauri.js",
            "type": "application/javascript",
            "module-type": "macro"
        },
        "$:/core/modules/macros/now.js": {
            "text": "/*\\\ntitle: $:/core/modules/macros/now.js\ntype: application/javascript\nmodule-type: macro\n\nMacro to return a formatted version of the current time\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nInformation about this macro\n*/\n\nexports.name = \"now\";\n\nexports.params = [\n\t{name: \"format\"}\n];\n\n/*\nRun the macro\n*/\nexports.run = function(format) {\n\treturn $tw.utils.formatDateString(new Date(),format || \"0hh:0mm, DDth MMM YYYY\");\n};\n\n})();\n",
            "title": "$:/core/modules/macros/now.js",
            "type": "application/javascript",
            "module-type": "macro"
        },
        "$:/core/modules/macros/qualify.js": {
            "text": "/*\\\ntitle: $:/core/modules/macros/qualify.js\ntype: application/javascript\nmodule-type: macro\n\nMacro to qualify a state tiddler title according\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nInformation about this macro\n*/\n\nexports.name = \"qualify\";\n\nexports.params = [\n\t{name: \"title\"}\n];\n\n/*\nRun the macro\n*/\nexports.run = function(title) {\n\treturn title + \"-\" + this.getStateQualifier();\n};\n\n})();\n",
            "title": "$:/core/modules/macros/qualify.js",
            "type": "application/javascript",
            "module-type": "macro"
        },
        "$:/core/modules/macros/resolvepath.js": {
            "text": "/*\\\ntitle: $:/core/modules/macros/resolvepath.js\ntype: application/javascript\nmodule-type: macro\n\nResolves a relative path for an absolute rootpath.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"resolvepath\";\n\nexports.params = [\n\t{name: \"source\"},\n\t{name: \"root\"}\n];\n\n/*\nRun the macro\n*/\nexports.run = function(source, root) {\n\treturn $tw.utils.resolvePath(source, root);\n};\n\n})();\n",
            "title": "$:/core/modules/macros/resolvepath.js",
            "type": "application/javascript",
            "module-type": "macro"
        },
        "$:/core/modules/macros/version.js": {
            "text": "/*\\\ntitle: $:/core/modules/macros/version.js\ntype: application/javascript\nmodule-type: macro\n\nMacro to return the TiddlyWiki core version number\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nInformation about this macro\n*/\n\nexports.name = \"version\";\n\nexports.params = [];\n\n/*\nRun the macro\n*/\nexports.run = function() {\n\treturn $tw.version;\n};\n\n})();\n",
            "title": "$:/core/modules/macros/version.js",
            "type": "application/javascript",
            "module-type": "macro"
        },
        "$:/core/modules/parsers/audioparser.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/audioparser.js\ntype: application/javascript\nmodule-type: parser\n\nThe audio parser parses an audio tiddler into an embeddable HTML element\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar AudioParser = function(type,text,options) {\n\tvar element = {\n\t\t\ttype: \"element\",\n\t\t\ttag: \"audio\",\n\t\t\tattributes: {\n\t\t\t\tcontrols: {type: \"string\", value: \"controls\"}\n\t\t\t}\n\t\t},\n\t\tsrc;\n\tif(options._canonical_uri) {\n\t\telement.attributes.src = {type: \"string\", value: options._canonical_uri};\n\t} else if(text) {\n\t\telement.attributes.src = {type: \"string\", value: \"data:\" + type + \";base64,\" + text};\n\t}\n\tthis.tree = [element];\n};\n\nexports[\"audio/ogg\"] = AudioParser;\nexports[\"audio/mpeg\"] = AudioParser;\nexports[\"audio/mp3\"] = AudioParser;\nexports[\"audio/mp4\"] = AudioParser;\n\n})();\n\n",
            "title": "$:/core/modules/parsers/audioparser.js",
            "type": "application/javascript",
            "module-type": "parser"
        },
        "$:/core/modules/parsers/csvparser.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/csvparser.js\ntype: application/javascript\nmodule-type: parser\n\nThe CSV text parser processes CSV files into a table wrapped in a scrollable widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar CsvParser = function(type,text,options) {\n\t// Table framework\n\tthis.tree = [{\n\t\t\"type\": \"scrollable\", \"children\": [{\n\t\t\t\"type\": \"element\", \"tag\": \"table\", \"children\": [{\n\t\t\t\t\"type\": \"element\", \"tag\": \"tbody\", \"children\": []\n\t\t\t}], \"attributes\": {\n\t\t\t\t\"class\": {\"type\": \"string\", \"value\": \"tc-csv-table\"}\n\t\t\t}\n\t\t}]\n\t}];\n\t// Split the text into lines\n\tvar lines = text.split(/\\r?\\n/mg),\n\t\ttag = \"th\";\n\tfor(var line=0; line<lines.length; line++) {\n\t\tvar lineText = lines[line];\n\t\tif(lineText) {\n\t\t\tvar row = {\n\t\t\t\t\t\"type\": \"element\", \"tag\": \"tr\", \"children\": []\n\t\t\t\t};\n\t\t\tvar columns = lineText.split(\",\");\n\t\t\tfor(var column=0; column<columns.length; column++) {\n\t\t\t\trow.children.push({\n\t\t\t\t\t\t\"type\": \"element\", \"tag\": tag, \"children\": [{\n\t\t\t\t\t\t\t\"type\": \"text\",\n\t\t\t\t\t\t\t\"text\": columns[column]\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t}\n\t\t\ttag = \"td\";\n\t\t\tthis.tree[0].children[0].children[0].children.push(row);\n\t\t}\n\t}\n};\n\nexports[\"text/csv\"] = CsvParser;\n\n})();\n\n",
            "title": "$:/core/modules/parsers/csvparser.js",
            "type": "application/javascript",
            "module-type": "parser"
        },
        "$:/core/modules/parsers/htmlparser.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/htmlparser.js\ntype: application/javascript\nmodule-type: parser\n\nThe HTML parser displays text as raw HTML\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar HtmlParser = function(type,text,options) {\n\tvar src;\n\tif(options._canonical_uri) {\n\t\tsrc = options._canonical_uri;\n\t} else if(text) {\n\t\tsrc = \"data:text/html;charset=utf-8,\" + encodeURIComponent(text);\n\t}\n\tthis.tree = [{\n\t\ttype: \"element\",\n\t\ttag: \"iframe\",\n\t\tattributes: {\n\t\t\tsrc: {type: \"string\", value: src},\n\t\t\tsandbox: {type: \"string\", value: \"\"}\n\t\t}\n\t}];\n};\n\nexports[\"text/html\"] = HtmlParser;\n\n})();\n\n",
            "title": "$:/core/modules/parsers/htmlparser.js",
            "type": "application/javascript",
            "module-type": "parser"
        },
        "$:/core/modules/parsers/imageparser.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/imageparser.js\ntype: application/javascript\nmodule-type: parser\n\nThe image parser parses an image into an embeddable HTML element\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar ImageParser = function(type,text,options) {\n\tvar element = {\n\t\t\ttype: \"element\",\n\t\t\ttag: \"img\",\n\t\t\tattributes: {}\n\t\t},\n\t\tsrc;\n\tif(options._canonical_uri) {\n\t\telement.attributes.src = {type: \"string\", value: options._canonical_uri};\n\t} else if(text) {\n\t\tif(type === \"image/svg+xml\" || type === \".svg\") {\n\t\t\telement.attributes.src = {type: \"string\", value: \"data:image/svg+xml,\" + encodeURIComponent(text)};\n\t\t} else {\n\t\t\telement.attributes.src = {type: \"string\", value: \"data:\" + type + \";base64,\" + text};\n\t\t}\n\t}\n\tthis.tree = [element];\n};\n\nexports[\"image/svg+xml\"] = ImageParser;\nexports[\"image/jpg\"] = ImageParser;\nexports[\"image/jpeg\"] = ImageParser;\nexports[\"image/png\"] = ImageParser;\nexports[\"image/gif\"] = ImageParser;\nexports[\"image/x-icon\"] = ImageParser;\n\n})();\n\n",
            "title": "$:/core/modules/parsers/imageparser.js",
            "type": "application/javascript",
            "module-type": "parser"
        },
        "$:/core/modules/utils/parseutils.js": {
            "text": "/*\\\ntitle: $:/core/modules/utils/parseutils.js\ntype: application/javascript\nmodule-type: utils\n\nUtility functions concerned with parsing text into tokens.\n\nMost functions have the following pattern:\n\n* The parameters are:\n** `source`: the source string being parsed\n** `pos`: the current parse position within the string\n** Any further parameters are used to identify the token that is being parsed\n* The return value is:\n** null if the token was not found at the specified position\n** an object representing the token with the following standard fields:\n*** `type`: string indicating the type of the token\n*** `start`: start position of the token in the source string\n*** `end`: end position of the token in the source string\n*** Any further fields required to describe the token\n\nThe exception is `skipWhiteSpace`, which just returns the position after the whitespace.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nLook for a whitespace token. Returns null if not found, otherwise returns {type: \"whitespace\", start:, end:,}\n*/\nexports.parseWhiteSpace = function(source,pos) {\n\tvar p = pos,c;\n\twhile(true) {\n\t\tc = source.charAt(p);\n\t\tif((c === \" \") || (c === \"\\f\") || (c === \"\\n\") || (c === \"\\r\") || (c === \"\\t\") || (c === \"\\v\") || (c === \"\\u00a0\")) { // Ignores some obscure unicode spaces\n\t\t\tp++;\n\t\t} else {\n\t\t\tbreak;\n\t\t}\n\t}\n\tif(p === pos) {\n\t\treturn null;\n\t} else {\n\t\treturn {\n\t\t\ttype: \"whitespace\",\n\t\t\tstart: pos,\n\t\t\tend: p\n\t\t}\n\t}\n};\n\n/*\nConvenience wrapper for parseWhiteSpace. Returns the position after the whitespace\n*/\nexports.skipWhiteSpace = function(source,pos) {\n\tvar c;\n\twhile(true) {\n\t\tc = source.charAt(pos);\n\t\tif((c === \" \") || (c === \"\\f\") || (c === \"\\n\") || (c === \"\\r\") || (c === \"\\t\") || (c === \"\\v\") || (c === \"\\u00a0\")) { // Ignores some obscure unicode spaces\n\t\t\tpos++;\n\t\t} else {\n\t\t\treturn pos;\n\t\t}\n\t}\n};\n\n/*\nLook for a given string token. Returns null if not found, otherwise returns {type: \"token\", value:, start:, end:,}\n*/\nexports.parseTokenString = function(source,pos,token) {\n\tvar match = source.indexOf(token,pos) === pos;\n\tif(match) {\n\t\treturn {\n\t\t\ttype: \"token\",\n\t\t\tvalue: token,\n\t\t\tstart: pos,\n\t\t\tend: pos + token.length\n\t\t};\n\t}\n\treturn null;\n};\n\n/*\nLook for a token matching a regex. Returns null if not found, otherwise returns {type: \"regexp\", match:, start:, end:,}\n*/\nexports.parseTokenRegExp = function(source,pos,reToken) {\n\tvar node = {\n\t\ttype: \"regexp\",\n\t\tstart: pos\n\t};\n\treToken.lastIndex = pos;\n\tnode.match = reToken.exec(source);\n\tif(node.match && node.match.index === pos) {\n\t\tnode.end = pos + node.match[0].length;\n\t\treturn node;\n\t} else {\n\t\treturn null;\n\t}\n};\n\n/*\nLook for a string literal. Returns null if not found, otherwise returns {type: \"string\", value:, start:, end:,}\n*/\nexports.parseStringLiteral = function(source,pos) {\n\tvar node = {\n\t\ttype: \"string\",\n\t\tstart: pos\n\t};\n\tvar reString = /(?:\"\"\"([\\s\\S]*?)\"\"\"|\"([^\"]*)\")|(?:'([^']*)')/g;\n\treString.lastIndex = pos;\n\tvar match = reString.exec(source);\n\tif(match && match.index === pos) {\n\t\tnode.value = match[1] !== undefined ? match[1] :(\n\t\t\tmatch[2] !== undefined ? match[2] : match[3] \n\t\t\t\t\t);\n\t\tnode.end = pos + match[0].length;\n\t\treturn node;\n\t} else {\n\t\treturn null;\n\t}\n};\n\n/*\nLook for a macro invocation parameter. Returns null if not found, or {type: \"macro-parameter\", name:, value:, start:, end:}\n*/\nexports.parseMacroParameter = function(source,pos) {\n\tvar node = {\n\t\ttype: \"macro-parameter\",\n\t\tstart: pos\n\t};\n\t// Define our regexp\n\tvar reMacroParameter = /(?:([A-Za-z0-9\\-_]+)\\s*:)?(?:\\s*(?:\"\"\"([\\s\\S]*?)\"\"\"|\"([^\"]*)\"|'([^']*)'|\\[\\[([^\\]]*)\\]\\]|([^\\s>\"'=]+)))/g;\n\t// Skip whitespace\n\tpos = $tw.utils.skipWhiteSpace(source,pos);\n\t// Look for the parameter\n\tvar token = $tw.utils.parseTokenRegExp(source,pos,reMacroParameter);\n\tif(!token) {\n\t\treturn null;\n\t}\n\tpos = token.end;\n\t// Get the parameter details\n\tnode.value = token.match[2] !== undefined ? token.match[2] : (\n\t\t\t\t\ttoken.match[3] !== undefined ? token.match[3] : (\n\t\t\t\t\t\ttoken.match[4] !== undefined ? token.match[4] : (\n\t\t\t\t\t\t\ttoken.match[5] !== undefined ? token.match[5] : (\n\t\t\t\t\t\t\t\ttoken.match[6] !== undefined ? token.match[6] : (\n\t\t\t\t\t\t\t\t\t\"\"\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\tif(token.match[1]) {\n\t\tnode.name = token.match[1];\n\t}\n\t// Update the end position\n\tnode.end = pos;\n\treturn node;\n};\n\n/*\nLook for a macro invocation. Returns null if not found, or {type: \"macrocall\", name:, parameters:, start:, end:}\n*/\nexports.parseMacroInvocation = function(source,pos) {\n\tvar node = {\n\t\ttype: \"macrocall\",\n\t\tstart: pos,\n\t\tparams: []\n\t};\n\t// Define our regexps\n\tvar reMacroName = /([^\\s>\"'=]+)/g;\n\t// Skip whitespace\n\tpos = $tw.utils.skipWhiteSpace(source,pos);\n\t// Look for a double less than sign\n\tvar token = $tw.utils.parseTokenString(source,pos,\"<<\");\n\tif(!token) {\n\t\treturn null;\n\t}\n\tpos = token.end;\n\t// Get the macro name\n\tvar name = $tw.utils.parseTokenRegExp(source,pos,reMacroName);\n\tif(!name) {\n\t\treturn null;\n\t}\n\tnode.name = name.match[1];\n\tpos = name.end;\n\t// Process parameters\n\tvar parameter = $tw.utils.parseMacroParameter(source,pos);\n\twhile(parameter) {\n\t\tnode.params.push(parameter);\n\t\tpos = parameter.end;\n\t\t// Get the next parameter\n\t\tparameter = $tw.utils.parseMacroParameter(source,pos);\n\t}\n\t// Skip whitespace\n\tpos = $tw.utils.skipWhiteSpace(source,pos);\n\t// Look for a double greater than sign\n\ttoken = $tw.utils.parseTokenString(source,pos,\">>\");\n\tif(!token) {\n\t\treturn null;\n\t}\n\tpos = token.end;\n\t// Update the end position\n\tnode.end = pos;\n\treturn node;\n};\n\n/*\nLook for an HTML attribute definition. Returns null if not found, otherwise returns {type: \"attribute\", name:, valueType: \"string|indirect|macro\", value:, start:, end:,}\n*/\nexports.parseAttribute = function(source,pos) {\n\tvar node = {\n\t\tstart: pos\n\t};\n\t// Define our regexps\n\tvar reAttributeName = /([^\\/\\s>\"'=]+)/g,\n\t\treUnquotedAttribute = /([^\\/\\s<>\"'=]+)/g,\n\t\treFilteredValue = /\\{\\{\\{(.+?)\\}\\}\\}/g,\n\t\treIndirectValue = /\\{\\{([^\\}]+)\\}\\}/g;\n\t// Skip whitespace\n\tpos = $tw.utils.skipWhiteSpace(source,pos);\n\t// Get the attribute name\n\tvar name = $tw.utils.parseTokenRegExp(source,pos,reAttributeName);\n\tif(!name) {\n\t\treturn null;\n\t}\n\tnode.name = name.match[1];\n\tpos = name.end;\n\t// Skip whitespace\n\tpos = $tw.utils.skipWhiteSpace(source,pos);\n\t// Look for an equals sign\n\tvar token = $tw.utils.parseTokenString(source,pos,\"=\");\n\tif(token) {\n\t\tpos = token.end;\n\t\t// Skip whitespace\n\t\tpos = $tw.utils.skipWhiteSpace(source,pos);\n\t\t// Look for a string literal\n\t\tvar stringLiteral = $tw.utils.parseStringLiteral(source,pos);\n\t\tif(stringLiteral) {\n\t\t\tpos = stringLiteral.end;\n\t\t\tnode.type = \"string\";\n\t\t\tnode.value = stringLiteral.value;\n\t\t} else {\n\t\t\t// Look for a filtered value\n\t\t\tvar filteredValue = $tw.utils.parseTokenRegExp(source,pos,reFilteredValue);\n\t\t\tif(filteredValue) {\n\t\t\t\tpos = filteredValue.end;\n\t\t\t\tnode.type = \"filtered\";\n\t\t\t\tnode.filter = filteredValue.match[1];\n\t\t\t} else {\n\t\t\t\t// Look for an indirect value\n\t\t\t\tvar indirectValue = $tw.utils.parseTokenRegExp(source,pos,reIndirectValue);\n\t\t\t\tif(indirectValue) {\n\t\t\t\t\tpos = indirectValue.end;\n\t\t\t\t\tnode.type = \"indirect\";\n\t\t\t\t\tnode.textReference = indirectValue.match[1];\n\t\t\t\t} else {\n\t\t\t\t\t// Look for a unquoted value\n\t\t\t\t\tvar unquotedValue = $tw.utils.parseTokenRegExp(source,pos,reUnquotedAttribute);\n\t\t\t\t\tif(unquotedValue) {\n\t\t\t\t\t\tpos = unquotedValue.end;\n\t\t\t\t\t\tnode.type = \"string\";\n\t\t\t\t\t\tnode.value = unquotedValue.match[1];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Look for a macro invocation value\n\t\t\t\t\t\tvar macroInvocation = $tw.utils.parseMacroInvocation(source,pos);\n\t\t\t\t\t\tif(macroInvocation) {\n\t\t\t\t\t\t\tpos = macroInvocation.end;\n\t\t\t\t\t\t\tnode.type = \"macro\";\n\t\t\t\t\t\t\tnode.value = macroInvocation;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnode.type = \"string\";\n\t\t\t\t\t\t\tnode.value = \"true\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tnode.type = \"string\";\n\t\tnode.value = \"true\";\n\t}\n\t// Update the end position\n\tnode.end = pos;\n\treturn node;\n};\n\n})();\n",
            "title": "$:/core/modules/utils/parseutils.js",
            "type": "application/javascript",
            "module-type": "utils"
        },
        "$:/core/modules/parsers/pdfparser.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/pdfparser.js\ntype: application/javascript\nmodule-type: parser\n\nThe PDF parser embeds a PDF viewer\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar ImageParser = function(type,text,options) {\n\tvar element = {\n\t\t\ttype: \"element\",\n\t\t\ttag: \"embed\",\n\t\t\tattributes: {}\n\t\t},\n\t\tsrc;\n\tif(options._canonical_uri) {\n\t\telement.attributes.src = {type: \"string\", value: options._canonical_uri};\n\t} else if(text) {\n\t\telement.attributes.src = {type: \"string\", value: \"data:application/pdf;base64,\" + text};\n\t}\n\tthis.tree = [element];\n};\n\nexports[\"application/pdf\"] = ImageParser;\n\n})();\n\n",
            "title": "$:/core/modules/parsers/pdfparser.js",
            "type": "application/javascript",
            "module-type": "parser"
        },
        "$:/core/modules/parsers/textparser.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/textparser.js\ntype: application/javascript\nmodule-type: parser\n\nThe plain text parser processes blocks of source text into a degenerate parse tree consisting of a single text node\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar TextParser = function(type,text,options) {\n\tthis.tree = [{\n\t\ttype: \"codeblock\",\n\t\tattributes: {\n\t\t\tcode: {type: \"string\", value: text},\n\t\t\tlanguage: {type: \"string\", value: type}\n\t\t}\n\t}];\n};\n\nexports[\"text/plain\"] = TextParser;\nexports[\"text/x-tiddlywiki\"] = TextParser;\nexports[\"application/javascript\"] = TextParser;\nexports[\"application/json\"] = TextParser;\nexports[\"text/css\"] = TextParser;\nexports[\"application/x-tiddler-dictionary\"] = TextParser;\n\n})();\n\n",
            "title": "$:/core/modules/parsers/textparser.js",
            "type": "application/javascript",
            "module-type": "parser"
        },
        "$:/core/modules/parsers/videoparser.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/videoparser.js\ntype: application/javascript\nmodule-type: parser\n\nThe video parser parses a video tiddler into an embeddable HTML element\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar VideoParser = function(type,text,options) {\n\tvar element = {\n\t\t\ttype: \"element\",\n\t\t\ttag: \"video\",\n\t\t\tattributes: {\n\t\t\t\tcontrols: {type: \"string\", value: \"controls\"}\n\t\t\t}\n\t\t},\n\t\tsrc;\n\tif(options._canonical_uri) {\n\t\telement.attributes.src = {type: \"string\", value: options._canonical_uri};\n\t} else if(text) {\n\t\telement.attributes.src = {type: \"string\", value: \"data:\" + type + \";base64,\" + text};\n\t}\n\tthis.tree = [element];\n};\n\nexports[\"video/mp4\"] = VideoParser;\nexports[\"video/quicktime\"] = VideoParser;\n\n})();\n\n",
            "title": "$:/core/modules/parsers/videoparser.js",
            "type": "application/javascript",
            "module-type": "parser"
        },
        "$:/core/modules/parsers/wikiparser/rules/codeblock.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/codeblock.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text rule for code blocks. For example:\n\n```\n\t```\n\tThis text will not be //wikified//\n\t```\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"codeblock\";\nexports.types = {block: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match and get language if defined\n\tthis.matchRegExp = /```([\\w-]*)\\r?\\n/mg;\n};\n\nexports.parse = function() {\n\tvar reEnd = /(\\r?\\n```$)/mg;\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\n\t// Look for the end of the block\n\treEnd.lastIndex = this.parser.pos;\n\tvar match = reEnd.exec(this.parser.source),\n\t\ttext;\n\t// Process the block\n\tif(match) {\n\t\ttext = this.parser.source.substring(this.parser.pos,match.index);\n\t\tthis.parser.pos = match.index + match[0].length;\n\t} else {\n\t\ttext = this.parser.source.substr(this.parser.pos);\n\t\tthis.parser.pos = this.parser.sourceLength;\n\t}\n\t// Return the $codeblock widget\n\treturn [{\n\t\t\ttype: \"codeblock\",\n\t\t\tattributes: {\n\t\t\t\t\tcode: {type: \"string\", value: text},\n\t\t\t\t\tlanguage: {type: \"string\", value: this.match[1]}\n\t\t\t}\n\t}];\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/codeblock.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/codeinline.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/codeinline.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for code runs. For example:\n\n```\n\tThis is a `code run`.\n\tThis is another ``code run``\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"codeinline\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /(``?)/mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\tvar reEnd = new RegExp(this.match[1], \"mg\");\n\t// Look for the end marker\n\treEnd.lastIndex = this.parser.pos;\n\tvar match = reEnd.exec(this.parser.source),\n\t\ttext;\n\t// Process the text\n\tif(match) {\n\t\ttext = this.parser.source.substring(this.parser.pos,match.index);\n\t\tthis.parser.pos = match.index + match[0].length;\n\t} else {\n\t\ttext = this.parser.source.substr(this.parser.pos);\n\t\tthis.parser.pos = this.parser.sourceLength;\n\t}\n\treturn [{\n\t\ttype: \"element\",\n\t\ttag: \"code\",\n\t\tchildren: [{\n\t\t\ttype: \"text\",\n\t\t\ttext: text\n\t\t}]\n\t}];\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/codeinline.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/commentblock.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/commentblock.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text block rule for HTML comments. For example:\n\n```\n<!-- This is a comment -->\n```\n\nNote that the syntax for comments is simplified to an opening \"<!--\" sequence and a closing \"-->\" sequence -- HTML itself implements a more complex format (see http://ostermiller.org/findhtmlcomment.html)\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"commentblock\";\nexports.types = {block: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\tthis.matchRegExp = /<!--/mg;\n\tthis.endMatchRegExp = /-->/mg;\n};\n\nexports.findNextMatch = function(startPos) {\n\tthis.matchRegExp.lastIndex = startPos;\n\tthis.match = this.matchRegExp.exec(this.parser.source);\n\tif(this.match) {\n\t\tthis.endMatchRegExp.lastIndex = startPos + this.match[0].length;\n\t\tthis.endMatch = this.endMatchRegExp.exec(this.parser.source);\n\t\tif(this.endMatch) {\n\t\t\treturn this.match.index;\n\t\t}\n\t}\n\treturn undefined;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.endMatchRegExp.lastIndex;\n\t// Don't return any elements\n\treturn [];\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/commentblock.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/commentinline.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/commentinline.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for HTML comments. For example:\n\n```\n<!-- This is a comment -->\n```\n\nNote that the syntax for comments is simplified to an opening \"<!--\" sequence and a closing \"-->\" sequence -- HTML itself implements a more complex format (see http://ostermiller.org/findhtmlcomment.html)\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"commentinline\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\tthis.matchRegExp = /<!--/mg;\n\tthis.endMatchRegExp = /-->/mg;\n};\n\nexports.findNextMatch = function(startPos) {\n\tthis.matchRegExp.lastIndex = startPos;\n\tthis.match = this.matchRegExp.exec(this.parser.source);\n\tif(this.match) {\n\t\tthis.endMatchRegExp.lastIndex = startPos + this.match[0].length;\n\t\tthis.endMatch = this.endMatchRegExp.exec(this.parser.source);\n\t\tif(this.endMatch) {\n\t\t\treturn this.match.index;\n\t\t}\n\t}\n\treturn undefined;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.endMatchRegExp.lastIndex;\n\t// Don't return any elements\n\treturn [];\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/commentinline.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/dash.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/dash.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for dashes. For example:\n\n```\nThis is an en-dash: --\n\nThis is an em-dash: ---\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"dash\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /-{2,3}(?!-)/mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\tvar dash = this.match[0].length === 2 ? \"&ndash;\" : \"&mdash;\";\n\treturn [{\n\t\ttype: \"entity\",\n\t\tentity: dash\n\t}];\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/dash.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/emphasis/bold.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/emphasis/bold.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for emphasis - bold. For example:\n\n```\n\tThis is ''bold'' text\n```\n\nThis wikiparser can be modified using the rules eg:\n\n```\n\\rules except bold \n\\rules only bold \n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"bold\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /''/mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\n\t// Parse the run including the terminator\n\tvar tree = this.parser.parseInlineRun(/''/mg,{eatTerminator: true});\n\n\t// Return the classed span\n\treturn [{\n\t\ttype: \"element\",\n\t\ttag: \"strong\",\n\t\tchildren: tree\n\t}];\n};\n\n})();",
            "title": "$:/core/modules/parsers/wikiparser/rules/emphasis/bold.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/emphasis/italic.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/emphasis/italic.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for emphasis - italic. For example:\n\n```\n\tThis is //italic// text\n```\n\nThis wikiparser can be modified using the rules eg:\n\n```\n\\rules except italic\n\\rules only italic\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"italic\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /\\/\\//mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\n\t// Parse the run including the terminator\n\tvar tree = this.parser.parseInlineRun(/\\/\\//mg,{eatTerminator: true});\n\n\t// Return the classed span\n\treturn [{\n\t\ttype: \"element\",\n\t\ttag: \"em\",\n\t\tchildren: tree\n\t}];\n};\n\n})();",
            "title": "$:/core/modules/parsers/wikiparser/rules/emphasis/italic.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/emphasis/strikethrough.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/emphasis/strikethrough.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for emphasis - strikethrough. For example:\n\n```\n\tThis is ~~strikethrough~~ text\n```\n\nThis wikiparser can be modified using the rules eg:\n\n```\n\\rules except strikethrough \n\\rules only strikethrough \n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"strikethrough\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /~~/mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\n\t// Parse the run including the terminator\n\tvar tree = this.parser.parseInlineRun(/~~/mg,{eatTerminator: true});\n\n\t// Return the classed span\n\treturn [{\n\t\ttype: \"element\",\n\t\ttag: \"strike\",\n\t\tchildren: tree\n\t}];\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/emphasis/strikethrough.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/emphasis/subscript.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/emphasis/subscript.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for emphasis - subscript. For example:\n\n```\n\tThis is ,,subscript,, text\n```\n\nThis wikiparser can be modified using the rules eg:\n\n```\n\\rules except subscript \n\\rules only subscript \n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"subscript\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /,,/mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\n\t// Parse the run including the terminator\n\tvar tree = this.parser.parseInlineRun(/,,/mg,{eatTerminator: true});\n\n\t// Return the classed span\n\treturn [{\n\t\ttype: \"element\",\n\t\ttag: \"sub\",\n\t\tchildren: tree\n\t}];\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/emphasis/subscript.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/emphasis/superscript.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/emphasis/superscript.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for emphasis - superscript. For example:\n\n```\n\tThis is ^^superscript^^ text\n```\n\nThis wikiparser can be modified using the rules eg:\n\n```\n\\rules except superscript \n\\rules only superscript \n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"superscript\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /\\^\\^/mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\n\t// Parse the run including the terminator\n\tvar tree = this.parser.parseInlineRun(/\\^\\^/mg,{eatTerminator: true});\n\n\t// Return the classed span\n\treturn [{\n\t\ttype: \"element\",\n\t\ttag: \"sup\",\n\t\tchildren: tree\n\t}];\n};\n\n})();",
            "title": "$:/core/modules/parsers/wikiparser/rules/emphasis/superscript.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/emphasis/underscore.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/emphasis/underscore.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for emphasis - underscore. For example:\n\n```\n\tThis is __underscore__ text\n```\n\nThis wikiparser can be modified using the rules eg:\n\n```\n\\rules except underscore \n\\rules only underscore\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"underscore\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /__/mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\n\t// Parse the run including the terminator\n\tvar tree = this.parser.parseInlineRun(/__/mg,{eatTerminator: true});\n\n\t// Return the classed span\n\treturn [{\n\t\ttype: \"element\",\n\t\ttag: \"u\",\n\t\tchildren: tree\n\t}];\n};\n\n})();",
            "title": "$:/core/modules/parsers/wikiparser/rules/emphasis/underscore.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/entity.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/entity.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for HTML entities. For example:\n\n```\n\tThis is a copyright symbol: &copy;\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"entity\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /(&#?[a-zA-Z0-9]{2,8};)/mg;\n};\n\n/*\nParse the most recent match\n*/\nexports.parse = function() {\n\t// Get all the details of the match\n\tvar entityString = this.match[1];\n\t// Move past the macro call\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Return the entity\n\treturn [{type: \"entity\", entity: this.match[0]}];\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/entity.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/extlink.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/extlink.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for external links. For example:\n\n```\nAn external link: http://www.tiddlywiki.com/\n\nA suppressed external link: ~http://www.tiddlyspace.com/\n```\n\nExternal links can be suppressed by preceding them with `~`.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"extlink\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /~?(?:file|http|https|mailto|ftp|irc|news|data|skype):[^\\s<>{}\\[\\]`|\"\\\\^]+(?:\\/|\\b)/mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Create the link unless it is suppressed\n\tif(this.match[0].substr(0,1) === \"~\") {\n\t\treturn [{type: \"text\", text: this.match[0].substr(1)}];\n\t} else {\n\t\treturn [{\n\t\t\ttype: \"element\",\n\t\t\ttag: \"a\",\n\t\t\tattributes: {\n\t\t\t\thref: {type: \"string\", value: this.match[0]},\n\t\t\t\t\"class\": {type: \"string\", value: \"tc-tiddlylink-external\"},\n\t\t\t\ttarget: {type: \"string\", value: \"_blank\"},\n\t\t\t\trel: {type: \"string\", value: \"noopener noreferrer\"}\n\t\t\t},\n\t\t\tchildren: [{\n\t\t\t\ttype: \"text\", text: this.match[0]\n\t\t\t}]\n\t\t}];\n\t}\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/extlink.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/filteredtranscludeblock.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/filteredtranscludeblock.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text rule for block-level filtered transclusion. For example:\n\n```\n{{{ [tag[docs]] }}}\n{{{ [tag[docs]] |tooltip}}}\n{{{ [tag[docs]] ||TemplateTitle}}}\n{{{ [tag[docs]] |tooltip||TemplateTitle}}}\n{{{ [tag[docs]] }}width:40;height:50;}.class.class\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"filteredtranscludeblock\";\nexports.types = {block: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /\\{\\{\\{([^\\|]+?)(?:\\|([^\\|\\{\\}]+))?(?:\\|\\|([^\\|\\{\\}]+))?\\}\\}([^\\}]*)\\}(?:\\.(\\S+))?(?:\\r?\\n|$)/mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Get the match details\n\tvar filter = this.match[1],\n\t\ttooltip = this.match[2],\n\t\ttemplate = $tw.utils.trim(this.match[3]),\n\t\tstyle = this.match[4],\n\t\tclasses = this.match[5];\n\t// Return the list widget\n\tvar node = {\n\t\ttype: \"list\",\n\t\tattributes: {\n\t\t\tfilter: {type: \"string\", value: filter}\n\t\t},\n\t\tisBlock: true\n\t};\n\tif(tooltip) {\n\t\tnode.attributes.tooltip = {type: \"string\", value: tooltip};\n\t}\n\tif(template) {\n\t\tnode.attributes.template = {type: \"string\", value: template};\n\t}\n\tif(style) {\n\t\tnode.attributes.style = {type: \"string\", value: style};\n\t}\n\tif(classes) {\n\t\tnode.attributes.itemClass = {type: \"string\", value: classes.split(\".\").join(\" \")};\n\t}\n\treturn [node];\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/filteredtranscludeblock.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/filteredtranscludeinline.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/filteredtranscludeinline.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text rule for inline filtered transclusion. For example:\n\n```\n{{{ [tag[docs]] }}}\n{{{ [tag[docs]] |tooltip}}}\n{{{ [tag[docs]] ||TemplateTitle}}}\n{{{ [tag[docs]] |tooltip||TemplateTitle}}}\n{{{ [tag[docs]] }}width:40;height:50;}.class.class\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"filteredtranscludeinline\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /\\{\\{\\{([^\\|]+?)(?:\\|([^\\|\\{\\}]+))?(?:\\|\\|([^\\|\\{\\}]+))?\\}\\}([^\\}]*)\\}(?:\\.(\\S+))?/mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Get the match details\n\tvar filter = this.match[1],\n\t\ttooltip = this.match[2],\n\t\ttemplate = $tw.utils.trim(this.match[3]),\n\t\tstyle = this.match[4],\n\t\tclasses = this.match[5];\n\t// Return the list widget\n\tvar node = {\n\t\ttype: \"list\",\n\t\tattributes: {\n\t\t\tfilter: {type: \"string\", value: filter}\n\t\t}\n\t};\n\tif(tooltip) {\n\t\tnode.attributes.tooltip = {type: \"string\", value: tooltip};\n\t}\n\tif(template) {\n\t\tnode.attributes.template = {type: \"string\", value: template};\n\t}\n\tif(style) {\n\t\tnode.attributes.style = {type: \"string\", value: style};\n\t}\n\tif(classes) {\n\t\tnode.attributes.itemClass = {type: \"string\", value: classes.split(\".\").join(\" \")};\n\t}\n\treturn [node];\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/filteredtranscludeinline.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/hardlinebreaks.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/hardlinebreaks.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for marking areas with hard line breaks. For example:\n\n```\n\"\"\"\nThis is some text\nThat is set like\nIt is a Poem\nWhen it is\nClearly\nNot\n\"\"\"\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"hardlinebreaks\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /\"\"\"(?:\\r?\\n)?/mg;\n};\n\nexports.parse = function() {\n\tvar reEnd = /(\"\"\")|(\\r?\\n)/mg,\n\t\ttree = [],\n\t\tmatch;\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\tdo {\n\t\t// Parse the run up to the terminator\n\t\ttree.push.apply(tree,this.parser.parseInlineRun(reEnd,{eatTerminator: false}));\n\t\t// Redo the terminator match\n\t\treEnd.lastIndex = this.parser.pos;\n\t\tmatch = reEnd.exec(this.parser.source);\n\t\tif(match) {\n\t\t\tthis.parser.pos = reEnd.lastIndex;\n\t\t\t// Add a line break if the terminator was a line break\n\t\t\tif(match[2]) {\n\t\t\t\ttree.push({type: \"element\", tag: \"br\"});\n\t\t\t}\n\t\t}\n\t} while(match && !match[1]);\n\t// Return the nodes\n\treturn tree;\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/hardlinebreaks.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/heading.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/heading.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text block rule for headings\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"heading\";\nexports.types = {block: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /(!{1,6})/mg;\n};\n\n/*\nParse the most recent match\n*/\nexports.parse = function() {\n\t// Get all the details of the match\n\tvar headingLevel = this.match[1].length;\n\t// Move past the !s\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Parse any classes, whitespace and then the heading itself\n\tvar classes = this.parser.parseClasses();\n\tthis.parser.skipWhitespace({treatNewlinesAsNonWhitespace: true});\n\tvar tree = this.parser.parseInlineRun(/(\\r?\\n)/mg);\n\t// Return the heading\n\treturn [{\n\t\ttype: \"element\",\n\t\ttag: \"h\" + headingLevel, \n\t\tattributes: {\n\t\t\t\"class\": {type: \"string\", value: classes.join(\" \")}\n\t\t},\n\t\tchildren: tree\n\t}];\n};\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/heading.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/horizrule.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/horizrule.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text block rule for rules. For example:\n\n```\n---\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"horizrule\";\nexports.types = {block: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /-{3,}\\r?(?:\\n|$)/mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\treturn [{type: \"element\", tag: \"hr\"}];\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/horizrule.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/html.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/html.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki rule for HTML elements and widgets. For example:\n\n{{{\n<aside>\nThis is an HTML5 aside element\n</aside>\n\n<$slider target=\"MyTiddler\">\nThis is a widget invocation\n</$slider>\n\n}}}\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"html\";\nexports.types = {inline: true, block: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n};\n\nexports.findNextMatch = function(startPos) {\n\t// Find the next tag\n\tthis.nextTag = this.findNextTag(this.parser.source,startPos,{\n\t\trequireLineBreak: this.is.block\n\t});\n\treturn this.nextTag ? this.nextTag.start : undefined;\n};\n\n/*\nParse the most recent match\n*/\nexports.parse = function() {\n\t// Retrieve the most recent match so that recursive calls don't overwrite it\n\tvar tag = this.nextTag;\n\tthis.nextTag = null;\n\t// Advance the parser position to past the tag\n\tthis.parser.pos = tag.end;\n\t// Check for an immediately following double linebreak\n\tvar hasLineBreak = !tag.isSelfClosing && !!$tw.utils.parseTokenRegExp(this.parser.source,this.parser.pos,/([^\\S\\n\\r]*\\r?\\n(?:[^\\S\\n\\r]*\\r?\\n|$))/g);\n\t// Set whether we're in block mode\n\ttag.isBlock = this.is.block || hasLineBreak;\n\t// Parse the body if we need to\n\tif(!tag.isSelfClosing && $tw.config.htmlVoidElements.indexOf(tag.tag) === -1) {\n\t\t\tvar reEndString = \"</\" + $tw.utils.escapeRegExp(tag.tag) + \">\",\n\t\t\t\treEnd = new RegExp(\"(\" + reEndString + \")\",\"mg\");\n\t\tif(hasLineBreak) {\n\t\t\ttag.children = this.parser.parseBlocks(reEndString);\n\t\t} else {\n\t\t\ttag.children = this.parser.parseInlineRun(reEnd);\n\t\t}\n\t\treEnd.lastIndex = this.parser.pos;\n\t\tvar endMatch = reEnd.exec(this.parser.source);\n\t\tif(endMatch && endMatch.index === this.parser.pos) {\n\t\t\tthis.parser.pos = endMatch.index + endMatch[0].length;\n\t\t}\n\t}\n\t// Return the tag\n\treturn [tag];\n};\n\n/*\nLook for an HTML tag. Returns null if not found, otherwise returns {type: \"element\", name:, attributes: [], isSelfClosing:, start:, end:,}\n*/\nexports.parseTag = function(source,pos,options) {\n\toptions = options || {};\n\tvar token,\n\t\tnode = {\n\t\t\ttype: \"element\",\n\t\t\tstart: pos,\n\t\t\tattributes: {}\n\t\t};\n\t// Define our regexps\n\tvar reTagName = /([a-zA-Z0-9\\-\\$]+)/g;\n\t// Skip whitespace\n\tpos = $tw.utils.skipWhiteSpace(source,pos);\n\t// Look for a less than sign\n\ttoken = $tw.utils.parseTokenString(source,pos,\"<\");\n\tif(!token) {\n\t\treturn null;\n\t}\n\tpos = token.end;\n\t// Get the tag name\n\ttoken = $tw.utils.parseTokenRegExp(source,pos,reTagName);\n\tif(!token) {\n\t\treturn null;\n\t}\n\tnode.tag = token.match[1];\n\tif(node.tag.charAt(0) === \"$\") {\n\t\tnode.type = node.tag.substr(1);\n\t}\n\tpos = token.end;\n\t// Check that the tag is terminated by a space, / or >\n\tif(!$tw.utils.parseWhiteSpace(source,pos) && !(source.charAt(pos) === \"/\") && !(source.charAt(pos) === \">\") ) {\n\t\treturn null;\n\t}\n\t// Process attributes\n\tvar attribute = $tw.utils.parseAttribute(source,pos);\n\twhile(attribute) {\n\t\tnode.attributes[attribute.name] = attribute;\n\t\tpos = attribute.end;\n\t\t// Get the next attribute\n\t\tattribute = $tw.utils.parseAttribute(source,pos);\n\t}\n\t// Skip whitespace\n\tpos = $tw.utils.skipWhiteSpace(source,pos);\n\t// Look for a closing slash\n\ttoken = $tw.utils.parseTokenString(source,pos,\"/\");\n\tif(token) {\n\t\tpos = token.end;\n\t\tnode.isSelfClosing = true;\n\t}\n\t// Look for a greater than sign\n\ttoken = $tw.utils.parseTokenString(source,pos,\">\");\n\tif(!token) {\n\t\treturn null;\n\t}\n\tpos = token.end;\n\t// Check for a required line break\n\tif(options.requireLineBreak) {\n\t\ttoken = $tw.utils.parseTokenRegExp(source,pos,/([^\\S\\n\\r]*\\r?\\n(?:[^\\S\\n\\r]*\\r?\\n|$))/g);\n\t\tif(!token) {\n\t\t\treturn null;\n\t\t}\n\t}\n\t// Update the end position\n\tnode.end = pos;\n\treturn node;\n};\n\nexports.findNextTag = function(source,pos,options) {\n\t// A regexp for finding candidate HTML tags\n\tvar reLookahead = /<([a-zA-Z\\-\\$]+)/g;\n\t// Find the next candidate\n\treLookahead.lastIndex = pos;\n\tvar match = reLookahead.exec(source);\n\twhile(match) {\n\t\t// Try to parse the candidate as a tag\n\t\tvar tag = this.parseTag(source,match.index,options);\n\t\t// Return success\n\t\tif(tag && this.isLegalTag(tag)) {\n\t\t\treturn tag;\n\t\t}\n\t\t// Look for the next match\n\t\treLookahead.lastIndex = match.index + 1;\n\t\tmatch = reLookahead.exec(source);\n\t}\n\t// Failed\n\treturn null;\n};\n\nexports.isLegalTag = function(tag) {\n\t// Widgets are always OK\n\tif(tag.type !== \"element\") {\n\t\treturn true;\n\t// If it's an HTML tag that starts with a dash then it's not legal\n\t} else if(tag.tag.charAt(0) === \"-\") {\n\t\treturn false;\n\t} else {\n\t\t// Otherwise it's OK\n\t\treturn true;\n\t}\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/html.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/image.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/image.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for embedding images. For example:\n\n```\n[img[http://tiddlywiki.com/fractalveg.jpg]]\n[img width=23 height=24 [http://tiddlywiki.com/fractalveg.jpg]]\n[img width={{!!width}} height={{!!height}} [http://tiddlywiki.com/fractalveg.jpg]]\n[img[Description of image|http://tiddlywiki.com/fractalveg.jpg]]\n[img[TiddlerTitle]]\n[img[Description of image|TiddlerTitle]]\n```\n\nGenerates the `<$image>` widget.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"image\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n};\n\nexports.findNextMatch = function(startPos) {\n\t// Find the next tag\n\tthis.nextImage = this.findNextImage(this.parser.source,startPos);\n\treturn this.nextImage ? this.nextImage.start : undefined;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.nextImage.end;\n\tvar node = {\n\t\ttype: \"image\",\n\t\tattributes: this.nextImage.attributes\n\t};\n\treturn [node];\n};\n\n/*\nFind the next image from the current position\n*/\nexports.findNextImage = function(source,pos) {\n\t// A regexp for finding candidate HTML tags\n\tvar reLookahead = /(\\[img)/g;\n\t// Find the next candidate\n\treLookahead.lastIndex = pos;\n\tvar match = reLookahead.exec(source);\n\twhile(match) {\n\t\t// Try to parse the candidate as a tag\n\t\tvar tag = this.parseImage(source,match.index);\n\t\t// Return success\n\t\tif(tag) {\n\t\t\treturn tag;\n\t\t}\n\t\t// Look for the next match\n\t\treLookahead.lastIndex = match.index + 1;\n\t\tmatch = reLookahead.exec(source);\n\t}\n\t// Failed\n\treturn null;\n};\n\n/*\nLook for an image at the specified position. Returns null if not found, otherwise returns {type: \"image\", attributes: [], isSelfClosing:, start:, end:,}\n*/\nexports.parseImage = function(source,pos) {\n\tvar token,\n\t\tnode = {\n\t\t\ttype: \"image\",\n\t\t\tstart: pos,\n\t\t\tattributes: {}\n\t\t};\n\t// Skip whitespace\n\tpos = $tw.utils.skipWhiteSpace(source,pos);\n\t// Look for the `[img`\n\ttoken = $tw.utils.parseTokenString(source,pos,\"[img\");\n\tif(!token) {\n\t\treturn null;\n\t}\n\tpos = token.end;\n\t// Skip whitespace\n\tpos = $tw.utils.skipWhiteSpace(source,pos);\n\t// Process attributes\n\tif(source.charAt(pos) !== \"[\") {\n\t\tvar attribute = $tw.utils.parseAttribute(source,pos);\n\t\twhile(attribute) {\n\t\t\tnode.attributes[attribute.name] = attribute;\n\t\t\tpos = attribute.end;\n\t\t\tpos = $tw.utils.skipWhiteSpace(source,pos);\n\t\t\tif(source.charAt(pos) !== \"[\") {\n\t\t\t\t// Get the next attribute\n\t\t\t\tattribute = $tw.utils.parseAttribute(source,pos);\n\t\t\t} else {\n\t\t\t\tattribute = null;\n\t\t\t}\n\t\t}\n\t}\n\t// Skip whitespace\n\tpos = $tw.utils.skipWhiteSpace(source,pos);\n\t// Look for the `[` after the attributes\n\ttoken = $tw.utils.parseTokenString(source,pos,\"[\");\n\tif(!token) {\n\t\treturn null;\n\t}\n\tpos = token.end;\n\t// Skip whitespace\n\tpos = $tw.utils.skipWhiteSpace(source,pos);\n\t// Get the source up to the terminating `]]`\n\ttoken = $tw.utils.parseTokenRegExp(source,pos,/(?:([^|\\]]*?)\\|)?([^\\]]+?)\\]\\]/g);\n\tif(!token) {\n\t\treturn null;\n\t}\n\tpos = token.end;\n\tif(token.match[1]) {\n\t\tnode.attributes.tooltip = {type: \"string\", value: token.match[1].trim()};\n\t}\n\tnode.attributes.source = {type: \"string\", value: (token.match[2] || \"\").trim()};\n\t// Update the end position\n\tnode.end = pos;\n\treturn node;\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/image.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/list.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/list.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text block rule for lists. For example:\n\n```\n* This is an unordered list\n* It has two items\n\n# This is a numbered list\n## With a subitem\n# And a third item\n\n; This is a term that is being defined\n: This is the definition of that term\n```\n\nNote that lists can be nested arbitrarily:\n\n```\n#** One\n#* Two\n#** Three\n#**** Four\n#**# Five\n#**## Six\n## Seven\n### Eight\n## Nine\n```\n\nA CSS class can be applied to a list item as follows:\n\n```\n* List item one\n*.active List item two has the class `active`\n* List item three\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"list\";\nexports.types = {block: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /([\\*#;:>]+)/mg;\n};\n\nvar listTypes = {\n\t\"*\": {listTag: \"ul\", itemTag: \"li\"},\n\t\"#\": {listTag: \"ol\", itemTag: \"li\"},\n\t\";\": {listTag: \"dl\", itemTag: \"dt\"},\n\t\":\": {listTag: \"dl\", itemTag: \"dd\"},\n\t\">\": {listTag: \"blockquote\", itemTag: \"p\"}\n};\n\n/*\nParse the most recent match\n*/\nexports.parse = function() {\n\t// Array of parse tree nodes for the previous row of the list\n\tvar listStack = [];\n\t// Cycle through the items in the list\n\twhile(true) {\n\t\t// Match the list marker\n\t\tvar reMatch = /([\\*#;:>]+)/mg;\n\t\treMatch.lastIndex = this.parser.pos;\n\t\tvar match = reMatch.exec(this.parser.source);\n\t\tif(!match || match.index !== this.parser.pos) {\n\t\t\tbreak;\n\t\t}\n\t\t// Check whether the list type of the top level matches\n\t\tvar listInfo = listTypes[match[0].charAt(0)];\n\t\tif(listStack.length > 0 && listStack[0].tag !== listInfo.listTag) {\n\t\t\tbreak;\n\t\t}\n\t\t// Move past the list marker\n\t\tthis.parser.pos = match.index + match[0].length;\n\t\t// Walk through the list markers for the current row\n\t\tfor(var t=0; t<match[0].length; t++) {\n\t\t\tlistInfo = listTypes[match[0].charAt(t)];\n\t\t\t// Remove any stacked up element if we can't re-use it because the list type doesn't match\n\t\t\tif(listStack.length > t && listStack[t].tag !== listInfo.listTag) {\n\t\t\t\tlistStack.splice(t,listStack.length - t);\n\t\t\t}\n\t\t\t// Construct the list element or reuse the previous one at this level\n\t\t\tif(listStack.length <= t) {\n\t\t\t\tvar listElement = {type: \"element\", tag: listInfo.listTag, children: [\n\t\t\t\t\t{type: \"element\", tag: listInfo.itemTag, children: []}\n\t\t\t\t]};\n\t\t\t\t// Link this list element into the last child item of the parent list item\n\t\t\t\tif(t) {\n\t\t\t\t\tvar prevListItem = listStack[t-1].children[listStack[t-1].children.length-1];\n\t\t\t\t\tprevListItem.children.push(listElement);\n\t\t\t\t}\n\t\t\t\t// Save this element in the stack\n\t\t\t\tlistStack[t] = listElement;\n\t\t\t} else if(t === (match[0].length - 1)) {\n\t\t\t\tlistStack[t].children.push({type: \"element\", tag: listInfo.itemTag, children: []});\n\t\t\t}\n\t\t}\n\t\tif(listStack.length > match[0].length) {\n\t\t\tlistStack.splice(match[0].length,listStack.length - match[0].length);\n\t\t}\n\t\t// Process the body of the list item into the last list item\n\t\tvar lastListChildren = listStack[listStack.length-1].children,\n\t\t\tlastListItem = lastListChildren[lastListChildren.length-1],\n\t\t\tclasses = this.parser.parseClasses();\n\t\tthis.parser.skipWhitespace({treatNewlinesAsNonWhitespace: true});\n\t\tvar tree = this.parser.parseInlineRun(/(\\r?\\n)/mg);\n\t\tlastListItem.children.push.apply(lastListItem.children,tree);\n\t\tif(classes.length > 0) {\n\t\t\t$tw.utils.addClassToParseTreeNode(lastListItem,classes.join(\" \"));\n\t\t}\n\t\t// Consume any whitespace following the list item\n\t\tthis.parser.skipWhitespace();\n\t}\n\t// Return the root element of the list\n\treturn [listStack[0]];\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/list.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/macrocallblock.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/macrocallblock.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki rule for block macro calls\n\n```\n<<name value value2>>\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"macrocallblock\";\nexports.types = {block: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /<<([^>\\s]+)(?:\\s*)((?:[^>]|(?:>(?!>)))*?)>>(?:\\r?\\n|$)/mg;\n};\n\n/*\nParse the most recent match\n*/\nexports.parse = function() {\n\t// Get all the details of the match\n\tvar macroName = this.match[1],\n\t\tparamString = this.match[2];\n\t// Move past the macro call\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\tvar params = [],\n\t\treParam = /\\s*(?:([A-Za-z0-9\\-_]+)\\s*:)?(?:\\s*(?:\"\"\"([\\s\\S]*?)\"\"\"|\"([^\"]*)\"|'([^']*)'|\\[\\[([^\\]]*)\\]\\]|([^\"'\\s]+)))/mg,\n\t\tparamMatch = reParam.exec(paramString);\n\twhile(paramMatch) {\n\t\t// Process this parameter\n\t\tvar paramInfo = {\n\t\t\tvalue: paramMatch[2] || paramMatch[3] || paramMatch[4] || paramMatch[5] || paramMatch[6]\n\t\t};\n\t\tif(paramMatch[1]) {\n\t\t\tparamInfo.name = paramMatch[1];\n\t\t}\n\t\tparams.push(paramInfo);\n\t\t// Find the next match\n\t\tparamMatch = reParam.exec(paramString);\n\t}\n\treturn [{\n\t\ttype: \"macrocall\",\n\t\tname: macroName,\n\t\tparams: params,\n\t\tisBlock: true\n\t}];\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/macrocallblock.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/macrocallinline.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/macrocallinline.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki rule for macro calls\n\n```\n<<name value value2>>\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"macrocallinline\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /<<([^\\s>]+)\\s*([\\s\\S]*?)>>/mg;\n};\n\n/*\nParse the most recent match\n*/\nexports.parse = function() {\n\t// Get all the details of the match\n\tvar macroName = this.match[1],\n\t\tparamString = this.match[2];\n\t// Move past the macro call\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\tvar params = [],\n\t\treParam = /\\s*(?:([A-Za-z0-9\\-_]+)\\s*:)?(?:\\s*(?:\"\"\"([\\s\\S]*?)\"\"\"|\"([^\"]*)\"|'([^']*)'|\\[\\[([^\\]]*)\\]\\]|([^\"'\\s]+)))/mg,\n\t\tparamMatch = reParam.exec(paramString);\n\twhile(paramMatch) {\n\t\t// Process this parameter\n\t\tvar paramInfo = {\n\t\t\tvalue: paramMatch[2] || paramMatch[3] || paramMatch[4] || paramMatch[5]|| paramMatch[6]\n\t\t};\n\t\tif(paramMatch[1]) {\n\t\t\tparamInfo.name = paramMatch[1];\n\t\t}\n\t\tparams.push(paramInfo);\n\t\t// Find the next match\n\t\tparamMatch = reParam.exec(paramString);\n\t}\n\treturn [{\n\t\ttype: \"macrocall\",\n\t\tname: macroName,\n\t\tparams: params\n\t}];\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/macrocallinline.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/macrodef.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/macrodef.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki pragma rule for macro definitions\n\n```\n\\define name(param:defaultvalue,param2:defaultvalue)\ndefinition text, including $param$ markers\n\\end\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"macrodef\";\nexports.types = {pragma: true};\n\n/*\nInstantiate parse rule\n*/\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /^\\\\define\\s+([^(\\s]+)\\(\\s*([^)]*)\\)(\\s*\\r?\\n)?/mg;\n};\n\n/*\nParse the most recent match\n*/\nexports.parse = function() {\n\t// Move past the macro name and parameters\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Parse the parameters\n\tvar paramString = this.match[2],\n\t\tparams = [];\n\tif(paramString !== \"\") {\n\t\tvar reParam = /\\s*([A-Za-z0-9\\-_]+)(?:\\s*:\\s*(?:\"\"\"([\\s\\S]*?)\"\"\"|\"([^\"]*)\"|'([^']*)'|\\[\\[([^\\]]*)\\]\\]|([^\"'\\s]+)))?/mg,\n\t\t\tparamMatch = reParam.exec(paramString);\n\t\twhile(paramMatch) {\n\t\t\t// Save the parameter details\n\t\t\tvar paramInfo = {name: paramMatch[1]},\n\t\t\t\tdefaultValue = paramMatch[2] || paramMatch[3] || paramMatch[4] || paramMatch[5] || paramMatch[6];\n\t\t\tif(defaultValue) {\n\t\t\t\tparamInfo[\"default\"] = defaultValue;\n\t\t\t}\n\t\t\tparams.push(paramInfo);\n\t\t\t// Look for the next parameter\n\t\t\tparamMatch = reParam.exec(paramString);\n\t\t}\n\t}\n\t// Is this a multiline definition?\n\tvar reEnd;\n\tif(this.match[3]) {\n\t\t// If so, the end of the body is marked with \\end\n\t\treEnd = /(\\r?\\n\\\\end[^\\S\\n\\r]*(?:$|\\r?\\n))/mg;\n\t} else {\n\t\t// Otherwise, the end of the definition is marked by the end of the line\n\t\treEnd = /($|\\r?\\n)/mg;\n\t\t// Move past any whitespace\n\t\tthis.parser.pos = $tw.utils.skipWhiteSpace(this.parser.source,this.parser.pos);\n\t}\n\t// Find the end of the definition\n\treEnd.lastIndex = this.parser.pos;\n\tvar text,\n\t\tendMatch = reEnd.exec(this.parser.source);\n\tif(endMatch) {\n\t\ttext = this.parser.source.substring(this.parser.pos,endMatch.index);\n\t\tthis.parser.pos = endMatch.index + endMatch[0].length;\n\t} else {\n\t\t// We didn't find the end of the definition, so we'll make it blank\n\t\ttext = \"\";\n\t}\n\t// Save the macro definition\n\treturn [{\n\t\ttype: \"set\",\n\t\tattributes: {\n\t\t\tname: {type: \"string\", value: this.match[1]},\n\t\t\tvalue: {type: \"string\", value: text}\n\t\t},\n\t\tchildren: [],\n\t\tparams: params\n\t}];\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/macrodef.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/prettyextlink.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/prettyextlink.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for external links. For example:\n\n```\n[ext[http://tiddlywiki.com/fractalveg.jpg]]\n[ext[Tooltip|http://tiddlywiki.com/fractalveg.jpg]]\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"prettyextlink\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n};\n\nexports.findNextMatch = function(startPos) {\n\t// Find the next tag\n\tthis.nextLink = this.findNextLink(this.parser.source,startPos);\n\treturn this.nextLink ? this.nextLink.start : undefined;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.nextLink.end;\n\treturn [this.nextLink];\n};\n\n/*\nFind the next link from the current position\n*/\nexports.findNextLink = function(source,pos) {\n\t// A regexp for finding candidate links\n\tvar reLookahead = /(\\[ext\\[)/g;\n\t// Find the next candidate\n\treLookahead.lastIndex = pos;\n\tvar match = reLookahead.exec(source);\n\twhile(match) {\n\t\t// Try to parse the candidate as a link\n\t\tvar link = this.parseLink(source,match.index);\n\t\t// Return success\n\t\tif(link) {\n\t\t\treturn link;\n\t\t}\n\t\t// Look for the next match\n\t\treLookahead.lastIndex = match.index + 1;\n\t\tmatch = reLookahead.exec(source);\n\t}\n\t// Failed\n\treturn null;\n};\n\n/*\nLook for an link at the specified position. Returns null if not found, otherwise returns {type: \"element\", tag: \"a\", attributes: [], isSelfClosing:, start:, end:,}\n*/\nexports.parseLink = function(source,pos) {\n\tvar token,\n\t\ttextNode = {\n\t\t\ttype: \"text\"\n\t\t},\n\t\tnode = {\n\t\t\ttype: \"element\",\n\t\t\ttag: \"a\",\n\t\t\tstart: pos,\n\t\t\tattributes: {\n\t\t\t\t\"class\": {type: \"string\", value: \"tc-tiddlylink-external\"},\n\t\t\t},\n\t\t\tchildren: [textNode]\n\t\t};\n\t// Skip whitespace\n\tpos = $tw.utils.skipWhiteSpace(source,pos);\n\t// Look for the `[ext[`\n\ttoken = $tw.utils.parseTokenString(source,pos,\"[ext[\");\n\tif(!token) {\n\t\treturn null;\n\t}\n\tpos = token.end;\n\t// Look ahead for the terminating `]]`\n\tvar closePos = source.indexOf(\"]]\",pos);\n\tif(closePos === -1) {\n\t\treturn null;\n\t}\n\t// Look for a `|` separating the tooltip\n\tvar splitPos = source.indexOf(\"|\",pos);\n\tif(splitPos === -1 || splitPos > closePos) {\n\t\tsplitPos = null;\n\t}\n\t// Pull out the tooltip and URL\n\tvar tooltip, URL;\n\tif(splitPos) {\n\t\tURL = source.substring(splitPos + 1,closePos).trim();\n\t\ttextNode.text = source.substring(pos,splitPos).trim();\n\t} else {\n\t\tURL = source.substring(pos,closePos).trim();\n\t\ttextNode.text = URL;\n\t}\n\tnode.attributes.href = {type: \"string\", value: URL};\n\tnode.attributes.target = {type: \"string\", value: \"_blank\"};\n\tnode.attributes.rel = {type: \"string\", value: \"noopener noreferrer\"};\n\t// Update the end position\n\tnode.end = closePos + 2;\n\treturn node;\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/prettyextlink.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/prettylink.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/prettylink.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for pretty links. For example:\n\n```\n[[Introduction]]\n\n[[Link description|TiddlerTitle]]\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"prettylink\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /\\[\\[(.*?)(?:\\|(.*?))?\\]\\]/mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Process the link\n\tvar text = this.match[1],\n\t\tlink = this.match[2] || text;\n\tif($tw.utils.isLinkExternal(link)) {\n\t\treturn [{\n\t\t\ttype: \"element\",\n\t\t\ttag: \"a\",\n\t\t\tattributes: {\n\t\t\t\thref: {type: \"string\", value: link},\n\t\t\t\t\"class\": {type: \"string\", value: \"tc-tiddlylink-external\"},\n\t\t\t\ttarget: {type: \"string\", value: \"_blank\"},\n\t\t\t\trel: {type: \"string\", value: \"noopener noreferrer\"}\n\t\t\t},\n\t\t\tchildren: [{\n\t\t\t\ttype: \"text\", text: text\n\t\t\t}]\n\t\t}];\n\t} else {\n\t\treturn [{\n\t\t\ttype: \"link\",\n\t\t\tattributes: {\n\t\t\t\tto: {type: \"string\", value: link}\n\t\t\t},\n\t\t\tchildren: [{\n\t\t\t\ttype: \"text\", text: text\n\t\t\t}]\n\t\t}];\n\t}\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/prettylink.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/quoteblock.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/quoteblock.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text rule for quote blocks. For example:\n\n```\n\t<<<.optionalClass(es) optional cited from\n\ta quote\n\t<<<\n\t\n\t<<<.optionalClass(es)\n\ta quote\n\t<<< optional cited from\n```\n\nQuotes can be quoted by putting more <s\n\n```\n\t<<<\n\tQuote Level 1\n\t\n\t<<<<\n\tQuoteLevel 2\n\t<<<<\n\t\n\t<<<\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"quoteblock\";\nexports.types = {block: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /(<<<+)/mg;\n};\n\nexports.parse = function() {\n\tvar classes = [\"tc-quote\"];\n\t// Get all the details of the match\n\tvar reEndString = \"^\" + this.match[1] + \"(?!<)\";\n\t// Move past the <s\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t\n\t// Parse any classes, whitespace and then the optional cite itself\n\tclasses.push.apply(classes, this.parser.parseClasses());\n\tthis.parser.skipWhitespace({treatNewlinesAsNonWhitespace: true});\n\tvar cite = this.parser.parseInlineRun(/(\\r?\\n)/mg);\n\t// before handling the cite, parse the body of the quote\n\tvar tree= this.parser.parseBlocks(reEndString);\n\t// If we got a cite, put it before the text\n\tif(cite.length > 0) {\n\t\ttree.unshift({\n\t\t\ttype: \"element\",\n\t\t\ttag: \"cite\",\n\t\t\tchildren: cite\n\t\t});\n\t}\n\t// Parse any optional cite\n\tthis.parser.skipWhitespace({treatNewlinesAsNonWhitespace: true});\n\tcite = this.parser.parseInlineRun(/(\\r?\\n)/mg);\n\t// If we got a cite, push it\n\tif(cite.length > 0) {\n\t\ttree.push({\n\t\t\ttype: \"element\",\n\t\t\ttag: \"cite\",\n\t\t\tchildren: cite\n\t\t});\n\t}\n\t// Return the blockquote element\n\treturn [{\n\t\ttype: \"element\",\n\t\ttag: \"blockquote\",\n\t\tattributes: {\n\t\t\tclass: { type: \"string\", value: classes.join(\" \") },\n\t\t},\n\t\tchildren: tree\n\t}];\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/quoteblock.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/rules.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/rules.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki pragma rule for rules specifications\n\n```\n\\rules except ruleone ruletwo rulethree\n\\rules only ruleone ruletwo rulethree\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"rules\";\nexports.types = {pragma: true};\n\n/*\nInstantiate parse rule\n*/\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /^\\\\rules[^\\S\\n]/mg;\n};\n\n/*\nParse the most recent match\n*/\nexports.parse = function() {\n\t// Move past the pragma invocation\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Parse whitespace delimited tokens terminated by a line break\n\tvar reMatch = /[^\\S\\n]*(\\S+)|(\\r?\\n)/mg,\n\t\ttokens = [];\n\treMatch.lastIndex = this.parser.pos;\n\tvar match = reMatch.exec(this.parser.source);\n\twhile(match && match.index === this.parser.pos) {\n\t\tthis.parser.pos = reMatch.lastIndex;\n\t\t// Exit if we've got the line break\n\t\tif(match[2]) {\n\t\t\tbreak;\n\t\t}\n\t\t// Process the token\n\t\tif(match[1]) {\n\t\t\ttokens.push(match[1]);\n\t\t}\n\t\t// Match the next token\n\t\tmatch = reMatch.exec(this.parser.source);\n\t}\n\t// Process the tokens\n\tif(tokens.length > 0) {\n\t\tthis.parser.amendRules(tokens[0],tokens.slice(1));\n\t}\n\t// No parse tree nodes to return\n\treturn [];\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/rules.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/styleblock.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/styleblock.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text block rule for assigning styles and classes to paragraphs and other blocks. For example:\n\n```\n@@.myClass\n@@background-color:red;\nThis paragraph will have the CSS class `myClass`.\n\n* The `<ul>` around this list will also have the class `myClass`\n* List item 2\n\n@@\n```\n\nNote that classes and styles can be mixed subject to the rule that styles must precede classes. For example\n\n```\n@@.myFirstClass.mySecondClass\n@@width:100px;.myThirdClass\nThis is a paragraph\n@@\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"styleblock\";\nexports.types = {block: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /@@((?:[^\\.\\r\\n\\s:]+:[^\\r\\n;]+;)+)?(?:\\.([^\\r\\n\\s]+))?\\r?\\n/mg;\n};\n\nexports.parse = function() {\n\tvar reEndString = \"^@@(?:\\\\r?\\\\n)?\";\n\tvar classes = [], styles = [];\n\tdo {\n\t\t// Get the class and style\n\t\tif(this.match[1]) {\n\t\t\tstyles.push(this.match[1]);\n\t\t}\n\t\tif(this.match[2]) {\n\t\t\tclasses.push(this.match[2].split(\".\").join(\" \"));\n\t\t}\n\t\t// Move past the match\n\t\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t\t// Look for another line of classes and styles\n\t\tthis.match = this.matchRegExp.exec(this.parser.source);\n\t} while(this.match && this.match.index === this.parser.pos);\n\t// Parse the body\n\tvar tree = this.parser.parseBlocks(reEndString);\n\tfor(var t=0; t<tree.length; t++) {\n\t\tif(classes.length > 0) {\n\t\t\t$tw.utils.addClassToParseTreeNode(tree[t],classes.join(\" \"));\n\t\t}\n\t\tif(styles.length > 0) {\n\t\t\t$tw.utils.addAttributeToParseTreeNode(tree[t],\"style\",styles.join(\"\"));\n\t\t}\n\t}\n\treturn tree;\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/styleblock.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/styleinline.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/styleinline.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for assigning styles and classes to inline runs. For example:\n\n```\n@@.myClass This is some text with a class@@\n@@background-color:red;This is some text with a background colour@@\n@@width:100px;.myClass This is some text with a class and a width@@\n```\n\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"styleinline\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /@@((?:[^\\.\\r\\n\\s:]+:[^\\r\\n;]+;)+)?(\\.(?:[^\\r\\n\\s]+)\\s+)?/mg;\n};\n\nexports.parse = function() {\n\tvar reEnd = /@@/g;\n\t// Get the styles and class\n\tvar stylesString = this.match[1],\n\t\tclassString = this.match[2] ? this.match[2].split(\".\").join(\" \") : undefined;\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Parse the run up to the terminator\n\tvar tree = this.parser.parseInlineRun(reEnd,{eatTerminator: true});\n\t// Return the classed span\n\tvar node = {\n\t\ttype: \"element\",\n\t\ttag: \"span\",\n\t\tattributes: {\n\t\t\t\"class\": {type: \"string\", value: \"tc-inline-style\"}\n\t\t},\n\t\tchildren: tree\n\t};\n\tif(classString) {\n\t\t$tw.utils.addClassToParseTreeNode(node,classString);\n\t}\n\tif(stylesString) {\n\t\t$tw.utils.addAttributeToParseTreeNode(node,\"style\",stylesString);\n\t}\n\treturn [node];\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/styleinline.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/syslink.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/syslink.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for system tiddler links.\nCan be suppressed preceding them with `~`.\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"syslink\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = new RegExp(\n\t\t\"~?\\\\$:\\\\/[\" +\n\t\t$tw.config.textPrimitives.anyLetter.substr(1,$tw.config.textPrimitives.anyLetter.length - 2) +\n\t\t\"\\/._-]+\",\n\t\t\"mg\"\n\t);\n};\n\nexports.parse = function() {\n\tvar match = this.match[0];\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Create the link unless it is suppressed\n\tif(match.substr(0,1) === \"~\") {\n\t\treturn [{type: \"text\", text: match.substr(1)}];\n\t} else {\n\t\treturn [{\n\t\t\ttype: \"link\",\n\t\t\tattributes: {\n\t\t\t\tto: {type: \"string\", value: match}\n\t\t\t},\n\t\t\tchildren: [{\n\t\t\t\ttype: \"text\",\n\t\t\t\ttext: match\n\t\t\t}]\n\t\t}];\n\t}\n};\n\n})();",
            "title": "$:/core/modules/parsers/wikiparser/rules/syslink.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/table.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/table.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text block rule for tables.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"table\";\nexports.types = {block: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /^\\|(?:[^\\n]*)\\|(?:[fhck]?)\\r?(?:\\n|$)/mg;\n};\n\nvar processRow = function(prevColumns) {\n\tvar cellRegExp = /(?:\\|([^\\n\\|]*)\\|)|(\\|[fhck]?\\r?(?:\\n|$))/mg,\n\t\tcellTermRegExp = /((?:\\x20*)\\|)/mg,\n\t\ttree = [],\n\t\tcol = 0,\n\t\tcolSpanCount = 1,\n\t\tprevCell,\n\t\tvAlign;\n\t// Match a single cell\n\tcellRegExp.lastIndex = this.parser.pos;\n\tvar cellMatch = cellRegExp.exec(this.parser.source);\n\twhile(cellMatch && cellMatch.index === this.parser.pos) {\n\t\tif(cellMatch[1] === \"~\") {\n\t\t\t// Rowspan\n\t\t\tvar last = prevColumns[col];\n\t\t\tif(last) {\n\t\t\t\tlast.rowSpanCount++;\n\t\t\t\t$tw.utils.addAttributeToParseTreeNode(last.element,\"rowspan\",last.rowSpanCount);\n\t\t\t\tvAlign = $tw.utils.getAttributeValueFromParseTreeNode(last.element,\"valign\",\"center\");\n\t\t\t\t$tw.utils.addAttributeToParseTreeNode(last.element,\"valign\",vAlign);\n\t\t\t\tif(colSpanCount > 1) {\n\t\t\t\t\t$tw.utils.addAttributeToParseTreeNode(last.element,\"colspan\",colSpanCount);\n\t\t\t\t\tcolSpanCount = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Move to just before the `|` terminating the cell\n\t\t\tthis.parser.pos = cellRegExp.lastIndex - 1;\n\t\t} else if(cellMatch[1] === \">\") {\n\t\t\t// Colspan\n\t\t\tcolSpanCount++;\n\t\t\t// Move to just before the `|` terminating the cell\n\t\t\tthis.parser.pos = cellRegExp.lastIndex - 1;\n\t\t} else if(cellMatch[1] === \"<\" && prevCell) {\n\t\t\tcolSpanCount = 1 + $tw.utils.getAttributeValueFromParseTreeNode(prevCell,\"colspan\",1);\n\t\t\t$tw.utils.addAttributeToParseTreeNode(prevCell,\"colspan\",colSpanCount);\n\t\t\tcolSpanCount = 1;\n\t\t\t// Move to just before the `|` terminating the cell\n\t\t\tthis.parser.pos = cellRegExp.lastIndex - 1;\n\t\t} else if(cellMatch[2]) {\n\t\t\t// End of row\n\t\t\tif(prevCell && colSpanCount > 1) {\n\t\t\t\tif(prevCell.attributes && prevCell.attributes && prevCell.attributes.colspan) {\n\t\t\t\t\t\tcolSpanCount += prevCell.attributes.colspan.value;\n\t\t\t\t} else {\n\t\t\t\t\tcolSpanCount -= 1;\n\t\t\t\t}\n\t\t\t\t$tw.utils.addAttributeToParseTreeNode(prevCell,\"colspan\",colSpanCount);\n\t\t\t}\n\t\t\tthis.parser.pos = cellRegExp.lastIndex - 1;\n\t\t\tbreak;\n\t\t} else {\n\t\t\t// For ordinary cells, step beyond the opening `|`\n\t\t\tthis.parser.pos++;\n\t\t\t// Look for a space at the start of the cell\n\t\t\tvar spaceLeft = false;\n\t\t\tvAlign = null;\n\t\t\tif(this.parser.source.substr(this.parser.pos).search(/^\\^([^\\^]|\\^\\^)/) === 0) {\n\t\t\t\tvAlign = \"top\";\n\t\t\t} else if(this.parser.source.substr(this.parser.pos).search(/^,([^,]|,,)/) === 0) {\n\t\t\t\tvAlign = \"bottom\";\n\t\t\t}\n\t\t\tif(vAlign) {\n\t\t\t\tthis.parser.pos++;\n\t\t\t}\n\t\t\tvar chr = this.parser.source.substr(this.parser.pos,1);\n\t\t\twhile(chr === \" \") {\n\t\t\t\tspaceLeft = true;\n\t\t\t\tthis.parser.pos++;\n\t\t\t\tchr = this.parser.source.substr(this.parser.pos,1);\n\t\t\t}\n\t\t\t// Check whether this is a heading cell\n\t\t\tvar cell;\n\t\t\tif(chr === \"!\") {\n\t\t\t\tthis.parser.pos++;\n\t\t\t\tcell = {type: \"element\", tag: \"th\", children: []};\n\t\t\t} else {\n\t\t\t\tcell = {type: \"element\", tag: \"td\", children: []};\n\t\t\t}\n\t\t\ttree.push(cell);\n\t\t\t// Record information about this cell\n\t\t\tprevCell = cell;\n\t\t\tprevColumns[col] = {rowSpanCount:1,element:cell};\n\t\t\t// Check for a colspan\n\t\t\tif(colSpanCount > 1) {\n\t\t\t\t$tw.utils.addAttributeToParseTreeNode(cell,\"colspan\",colSpanCount);\n\t\t\t\tcolSpanCount = 1;\n\t\t\t}\n\t\t\t// Parse the cell\n\t\t\tcell.children = this.parser.parseInlineRun(cellTermRegExp,{eatTerminator: true});\n\t\t\t// Set the alignment for the cell\n\t\t\tif(vAlign) {\n\t\t\t\t$tw.utils.addAttributeToParseTreeNode(cell,\"valign\",vAlign);\n\t\t\t}\n\t\t\tif(this.parser.source.substr(this.parser.pos - 2,1) === \" \") { // spaceRight\n\t\t\t\t$tw.utils.addAttributeToParseTreeNode(cell,\"align\",spaceLeft ? \"center\" : \"left\");\n\t\t\t} else if(spaceLeft) {\n\t\t\t\t$tw.utils.addAttributeToParseTreeNode(cell,\"align\",\"right\");\n\t\t\t}\n\t\t\t// Move back to the closing `|`\n\t\t\tthis.parser.pos--;\n\t\t}\n\t\tcol++;\n\t\tcellRegExp.lastIndex = this.parser.pos;\n\t\tcellMatch = cellRegExp.exec(this.parser.source);\n\t}\n\treturn tree;\n};\n\nexports.parse = function() {\n\tvar rowContainerTypes = {\"c\":\"caption\", \"h\":\"thead\", \"\":\"tbody\", \"f\":\"tfoot\"},\n\t\ttable = {type: \"element\", tag: \"table\", children: []},\n\t\trowRegExp = /^\\|([^\\n]*)\\|([fhck]?)\\r?(?:\\n|$)/mg,\n\t\trowTermRegExp = /(\\|(?:[fhck]?)\\r?(?:\\n|$))/mg,\n\t\tprevColumns = [],\n\t\tcurrRowType,\n\t\trowContainer,\n\t\trowCount = 0;\n\t// Match the row\n\trowRegExp.lastIndex = this.parser.pos;\n\tvar rowMatch = rowRegExp.exec(this.parser.source);\n\twhile(rowMatch && rowMatch.index === this.parser.pos) {\n\t\tvar rowType = rowMatch[2];\n\t\t// Check if it is a class assignment\n\t\tif(rowType === \"k\") {\n\t\t\t$tw.utils.addClassToParseTreeNode(table,rowMatch[1]);\n\t\t\tthis.parser.pos = rowMatch.index + rowMatch[0].length;\n\t\t} else {\n\t\t\t// Otherwise, create a new row if this one is of a different type\n\t\t\tif(rowType !== currRowType) {\n\t\t\t\trowContainer = {type: \"element\", tag: rowContainerTypes[rowType], children: []};\n\t\t\t\ttable.children.push(rowContainer);\n\t\t\t\tcurrRowType = rowType;\n\t\t\t}\n\t\t\t// Is this a caption row?\n\t\t\tif(currRowType === \"c\") {\n\t\t\t\t// If so, move past the opening `|` of the row\n\t\t\t\tthis.parser.pos++;\n\t\t\t\t// Move the caption to the first row if it isn't already\n\t\t\t\tif(table.children.length !== 1) {\n\t\t\t\t\ttable.children.pop(); // Take rowContainer out of the children array\n\t\t\t\t\ttable.children.splice(0,0,rowContainer); // Insert it at the bottom\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t// Set the alignment - TODO: figure out why TW did this\n//\t\t\t\trowContainer.attributes.align = rowCount === 0 ? \"top\" : \"bottom\";\n\t\t\t\t// Parse the caption\n\t\t\t\trowContainer.children = this.parser.parseInlineRun(rowTermRegExp,{eatTerminator: true});\n\t\t\t} else {\n\t\t\t\t// Create the row\n\t\t\t\tvar theRow = {type: \"element\", tag: \"tr\", children: []};\n\t\t\t\t$tw.utils.addClassToParseTreeNode(theRow,rowCount%2 ? \"oddRow\" : \"evenRow\");\n\t\t\t\trowContainer.children.push(theRow);\n\t\t\t\t// Process the row\n\t\t\t\ttheRow.children = processRow.call(this,prevColumns);\n\t\t\t\tthis.parser.pos = rowMatch.index + rowMatch[0].length;\n\t\t\t\t// Increment the row count\n\t\t\t\trowCount++;\n\t\t\t}\n\t\t}\n\t\trowMatch = rowRegExp.exec(this.parser.source);\n\t}\n\treturn [table];\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/table.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/transcludeblock.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/transcludeblock.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text rule for block-level transclusion. For example:\n\n```\n{{MyTiddler}}\n{{MyTiddler||TemplateTitle}}\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"transcludeblock\";\nexports.types = {block: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /\\{\\{([^\\{\\}\\|]*)(?:\\|\\|([^\\|\\{\\}]+))?\\}\\}(?:\\r?\\n|$)/mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Get the match details\n\tvar template = $tw.utils.trim(this.match[2]),\n\t\ttextRef = $tw.utils.trim(this.match[1]);\n\t// Prepare the transclude widget\n\tvar transcludeNode = {\n\t\t\ttype: \"transclude\",\n\t\t\tattributes: {},\n\t\t\tisBlock: true\n\t\t};\n\t// Prepare the tiddler widget\n\tvar tr, targetTitle, targetField, targetIndex, tiddlerNode;\n\tif(textRef) {\n\t\ttr = $tw.utils.parseTextReference(textRef);\n\t\ttargetTitle = tr.title;\n\t\ttargetField = tr.field;\n\t\ttargetIndex = tr.index;\n\t\ttiddlerNode = {\n\t\t\ttype: \"tiddler\",\n\t\t\tattributes: {\n\t\t\t\ttiddler: {type: \"string\", value: targetTitle}\n\t\t\t},\n\t\t\tisBlock: true,\n\t\t\tchildren: [transcludeNode]\n\t\t};\n\t}\n\tif(template) {\n\t\ttranscludeNode.attributes.tiddler = {type: \"string\", value: template};\n\t\tif(textRef) {\n\t\t\treturn [tiddlerNode];\n\t\t} else {\n\t\t\treturn [transcludeNode];\n\t\t}\n\t} else {\n\t\tif(textRef) {\n\t\t\ttranscludeNode.attributes.tiddler = {type: \"string\", value: targetTitle};\n\t\t\tif(targetField) {\n\t\t\t\ttranscludeNode.attributes.field = {type: \"string\", value: targetField};\n\t\t\t}\n\t\t\tif(targetIndex) {\n\t\t\t\ttranscludeNode.attributes.index = {type: \"string\", value: targetIndex};\n\t\t\t}\n\t\t\treturn [tiddlerNode];\n\t\t} else {\n\t\t\treturn [transcludeNode];\n\t\t}\n\t}\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/transcludeblock.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/transcludeinline.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/transcludeinline.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text rule for inline-level transclusion. For example:\n\n```\n{{MyTiddler}}\n{{MyTiddler||TemplateTitle}}\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"transcludeinline\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /\\{\\{([^\\{\\}\\|]*)(?:\\|\\|([^\\|\\{\\}]+))?\\}\\}/mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Get the match details\n\tvar template = $tw.utils.trim(this.match[2]),\n\t\ttextRef = $tw.utils.trim(this.match[1]);\n\t// Prepare the transclude widget\n\tvar transcludeNode = {\n\t\t\ttype: \"transclude\",\n\t\t\tattributes: {}\n\t\t};\n\t// Prepare the tiddler widget\n\tvar tr, targetTitle, targetField, targetIndex, tiddlerNode;\n\tif(textRef) {\n\t\ttr = $tw.utils.parseTextReference(textRef);\n\t\ttargetTitle = tr.title;\n\t\ttargetField = tr.field;\n\t\ttargetIndex = tr.index;\n\t\ttiddlerNode = {\n\t\t\ttype: \"tiddler\",\n\t\t\tattributes: {\n\t\t\t\ttiddler: {type: \"string\", value: targetTitle}\n\t\t\t},\n\t\t\tchildren: [transcludeNode]\n\t\t};\n\t}\n\tif(template) {\n\t\ttranscludeNode.attributes.tiddler = {type: \"string\", value: template};\n\t\tif(textRef) {\n\t\t\treturn [tiddlerNode];\n\t\t} else {\n\t\t\treturn [transcludeNode];\n\t\t}\n\t} else {\n\t\tif(textRef) {\n\t\t\ttranscludeNode.attributes.tiddler = {type: \"string\", value: targetTitle};\n\t\t\tif(targetField) {\n\t\t\t\ttranscludeNode.attributes.field = {type: \"string\", value: targetField};\n\t\t\t}\n\t\t\tif(targetIndex) {\n\t\t\t\ttranscludeNode.attributes.index = {type: \"string\", value: targetIndex};\n\t\t\t}\n\t\t\treturn [tiddlerNode];\n\t\t} else {\n\t\t\treturn [transcludeNode];\n\t\t}\n\t}\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/transcludeinline.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/typedblock.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/typedblock.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text rule for typed blocks. For example:\n\n```\n$$$.js\nThis will be rendered as JavaScript\n$$$\n\n$$$.svg\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"150\" height=\"100\">\n  <circle cx=\"100\" cy=\"50\" r=\"40\" stroke=\"black\" stroke-width=\"2\" fill=\"red\" />\n</svg>\n$$$\n\n$$$text/vnd.tiddlywiki>text/html\nThis will be rendered as an //HTML representation// of WikiText\n$$$\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar widget = require(\"$:/core/modules/widgets/widget.js\");\n\nexports.name = \"typedblock\";\nexports.types = {block: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /\\$\\$\\$([^ >\\r\\n]*)(?: *> *([^ \\r\\n]+))?\\r?\\n/mg;\n};\n\nexports.parse = function() {\n\tvar reEnd = /\\r?\\n\\$\\$\\$\\r?(?:\\n|$)/mg;\n\t// Save the type\n\tvar parseType = this.match[1],\n\t\trenderType = this.match[2];\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Look for the end of the block\n\treEnd.lastIndex = this.parser.pos;\n\tvar match = reEnd.exec(this.parser.source),\n\t\ttext;\n\t// Process the block\n\tif(match) {\n\t\ttext = this.parser.source.substring(this.parser.pos,match.index);\n\t\tthis.parser.pos = match.index + match[0].length;\n\t} else {\n\t\ttext = this.parser.source.substr(this.parser.pos);\n\t\tthis.parser.pos = this.parser.sourceLength;\n\t}\n\t// Parse the block according to the specified type\n\tvar parser = this.parser.wiki.parseText(parseType,text,{defaultType: \"text/plain\"});\n\t// If there's no render type, just return the parse tree\n\tif(!renderType) {\n\t\treturn parser.tree;\n\t} else {\n\t\t// Otherwise, render to the rendertype and return in a <PRE> tag\n\t\tvar widgetNode = this.parser.wiki.makeWidget(parser),\n\t\t\tcontainer = $tw.fakeDocument.createElement(\"div\");\n\t\twidgetNode.render(container,null);\n\t\ttext = renderType === \"text/html\" ? container.innerHTML : container.textContent;\n\t\treturn [{\n\t\t\ttype: \"element\",\n\t\t\ttag: \"pre\",\n\t\t\tchildren: [{\n\t\t\t\ttype: \"text\",\n\t\t\t\ttext: text\n\t\t\t}]\n\t\t}];\n\t}\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/typedblock.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/rules/wikilink.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/wikilink.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for wiki links. For example:\n\n```\nAWikiLink\nAnotherLink\n~SuppressedLink\n```\n\nPrecede a camel case word with `~` to prevent it from being recognised as a link.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"wikilink\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = new RegExp($tw.config.textPrimitives.unWikiLink + \"?\" + $tw.config.textPrimitives.wikiLink,\"mg\");\n};\n\n/*\nParse the most recent match\n*/\nexports.parse = function() {\n\t// Get the details of the match\n\tvar linkText = this.match[0];\n\t// Move past the macro call\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// If the link starts with the unwikilink character then just output it as plain text\n\tif(linkText.substr(0,1) === $tw.config.textPrimitives.unWikiLink) {\n\t\treturn [{type: \"text\", text: linkText.substr(1)}];\n\t}\n\t// If the link has been preceded with a blocked letter then don't treat it as a link\n\tif(this.match.index > 0) {\n\t\tvar preRegExp = new RegExp($tw.config.textPrimitives.blockPrefixLetters,\"mg\");\n\t\tpreRegExp.lastIndex = this.match.index-1;\n\t\tvar preMatch = preRegExp.exec(this.parser.source);\n\t\tif(preMatch && preMatch.index === this.match.index-1) {\n\t\t\treturn [{type: \"text\", text: linkText}];\n\t\t}\n\t}\n\treturn [{\n\t\ttype: \"link\",\n\t\tattributes: {\n\t\t\tto: {type: \"string\", value: linkText}\n\t\t},\n\t\tchildren: [{\n\t\t\ttype: \"text\",\n\t\t\ttext: linkText\n\t\t}]\n\t}];\n};\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/wikilink.js",
            "type": "application/javascript",
            "module-type": "wikirule"
        },
        "$:/core/modules/parsers/wikiparser/wikiparser.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/wikiparser.js\ntype: application/javascript\nmodule-type: parser\n\nThe wiki text parser processes blocks of source text into a parse tree.\n\nThe parse tree is made up of nested arrays of these JavaScript objects:\n\n\t{type: \"element\", tag: <string>, attributes: {}, children: []} - an HTML element\n\t{type: \"text\", text: <string>} - a text node\n\t{type: \"entity\", value: <string>} - an entity\n\t{type: \"raw\", html: <string>} - raw HTML\n\nAttributes are stored as hashmaps of the following objects:\n\n\t{type: \"string\", value: <string>} - literal string\n\t{type: \"indirect\", textReference: <textReference>} - indirect through a text reference\n\t{type: \"macro\", macro: <TBD>} - indirect through a macro invocation\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar WikiParser = function(type,text,options) {\n\tthis.wiki = options.wiki;\n\tvar self = this;\n\t// Check for an externally linked tiddler\n\tif($tw.browser && (text || \"\") === \"\" && options._canonical_uri) {\n\t\tthis.loadRemoteTiddler(options._canonical_uri);\n\t\ttext = $tw.language.getRawString(\"LazyLoadingWarning\");\n\t}\n\t// Initialise the classes if we don't have them already\n\tif(!this.pragmaRuleClasses) {\n\t\tWikiParser.prototype.pragmaRuleClasses = $tw.modules.createClassesFromModules(\"wikirule\",\"pragma\",$tw.WikiRuleBase);\n\t\tthis.setupRules(WikiParser.prototype.pragmaRuleClasses,\"$:/config/WikiParserRules/Pragmas/\");\n\t}\n\tif(!this.blockRuleClasses) {\n\t\tWikiParser.prototype.blockRuleClasses = $tw.modules.createClassesFromModules(\"wikirule\",\"block\",$tw.WikiRuleBase);\n\t\tthis.setupRules(WikiParser.prototype.blockRuleClasses,\"$:/config/WikiParserRules/Block/\");\n\t}\n\tif(!this.inlineRuleClasses) {\n\t\tWikiParser.prototype.inlineRuleClasses = $tw.modules.createClassesFromModules(\"wikirule\",\"inline\",$tw.WikiRuleBase);\n\t\tthis.setupRules(WikiParser.prototype.inlineRuleClasses,\"$:/config/WikiParserRules/Inline/\");\n\t}\n\t// Save the parse text\n\tthis.type = type || \"text/vnd.tiddlywiki\";\n\tthis.source = text || \"\";\n\tthis.sourceLength = this.source.length;\n\t// Set current parse position\n\tthis.pos = 0;\n\t// Instantiate the pragma parse rules\n\tthis.pragmaRules = this.instantiateRules(this.pragmaRuleClasses,\"pragma\",0);\n\t// Instantiate the parser block and inline rules\n\tthis.blockRules = this.instantiateRules(this.blockRuleClasses,\"block\",0);\n\tthis.inlineRules = this.instantiateRules(this.inlineRuleClasses,\"inline\",0);\n\t// Parse any pragmas\n\tthis.tree = [];\n\tvar topBranch = this.parsePragmas();\n\t// Parse the text into inline runs or blocks\n\tif(options.parseAsInline) {\n\t\ttopBranch.push.apply(topBranch,this.parseInlineRun());\n\t} else {\n\t\ttopBranch.push.apply(topBranch,this.parseBlocks());\n\t}\n\t// Return the parse tree\n};\n\n/*\n*/\nWikiParser.prototype.loadRemoteTiddler = function(url) {\n\tvar self = this;\n\t$tw.utils.httpRequest({\n\t\turl: url,\n\t\ttype: \"GET\",\n\t\tcallback: function(err,data) {\n\t\t\tif(!err) {\n\t\t\t\tvar tiddlers = self.wiki.deserializeTiddlers(\".tid\",data,self.wiki.getCreationFields());\n\t\t\t\t$tw.utils.each(tiddlers,function(tiddler) {\n\t\t\t\t\ttiddler[\"_canonical_uri\"] = url;\n\t\t\t\t});\n\t\t\t\tif(tiddlers) {\n\t\t\t\t\tself.wiki.addTiddlers(tiddlers);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n};\n\n/*\n*/\nWikiParser.prototype.setupRules = function(proto,configPrefix) {\n\tvar self = this;\n\tif(!$tw.safemode) {\n\t\t$tw.utils.each(proto,function(object,name) {\n\t\t\tif(self.wiki.getTiddlerText(configPrefix + name,\"enable\") !== \"enable\") {\n\t\t\t\tdelete proto[name];\n\t\t\t}\n\t\t});\n\t}\n};\n\n/*\nInstantiate an array of parse rules\n*/\nWikiParser.prototype.instantiateRules = function(classes,type,startPos) {\n\tvar rulesInfo = [],\n\t\tself = this;\n\t$tw.utils.each(classes,function(RuleClass) {\n\t\t// Instantiate the rule\n\t\tvar rule = new RuleClass(self);\n\t\trule.is = {};\n\t\trule.is[type] = true;\n\t\trule.init(self);\n\t\tvar matchIndex = rule.findNextMatch(startPos);\n\t\tif(matchIndex !== undefined) {\n\t\t\trulesInfo.push({\n\t\t\t\trule: rule,\n\t\t\t\tmatchIndex: matchIndex\n\t\t\t});\n\t\t}\n\t});\n\treturn rulesInfo;\n};\n\n/*\nSkip any whitespace at the current position. Options are:\n\ttreatNewlinesAsNonWhitespace: true if newlines are NOT to be treated as whitespace\n*/\nWikiParser.prototype.skipWhitespace = function(options) {\n\toptions = options || {};\n\tvar whitespaceRegExp = options.treatNewlinesAsNonWhitespace ? /([^\\S\\n]+)/mg : /(\\s+)/mg;\n\twhitespaceRegExp.lastIndex = this.pos;\n\tvar whitespaceMatch = whitespaceRegExp.exec(this.source);\n\tif(whitespaceMatch && whitespaceMatch.index === this.pos) {\n\t\tthis.pos = whitespaceRegExp.lastIndex;\n\t}\n};\n\n/*\nGet the next match out of an array of parse rule instances\n*/\nWikiParser.prototype.findNextMatch = function(rules,startPos) {\n\t// Find the best matching rule by finding the closest match position\n\tvar matchingRule,\n\t\tmatchingRulePos = this.sourceLength;\n\t// Step through each rule\n\tfor(var t=0; t<rules.length; t++) {\n\t\tvar ruleInfo = rules[t];\n\t\t// Ask the rule to get the next match if we've moved past the current one\n\t\tif(ruleInfo.matchIndex !== undefined  && ruleInfo.matchIndex < startPos) {\n\t\t\truleInfo.matchIndex = ruleInfo.rule.findNextMatch(startPos);\n\t\t}\n\t\t// Adopt this match if it's closer than the current best match\n\t\tif(ruleInfo.matchIndex !== undefined && ruleInfo.matchIndex <= matchingRulePos) {\n\t\t\tmatchingRule = ruleInfo;\n\t\t\tmatchingRulePos = ruleInfo.matchIndex;\n\t\t}\n\t}\n\treturn matchingRule;\n};\n\n/*\nParse any pragmas at the beginning of a block of parse text\n*/\nWikiParser.prototype.parsePragmas = function() {\n\tvar currentTreeBranch = this.tree;\n\twhile(true) {\n\t\t// Skip whitespace\n\t\tthis.skipWhitespace();\n\t\t// Check for the end of the text\n\t\tif(this.pos >= this.sourceLength) {\n\t\t\tbreak;\n\t\t}\n\t\t// Check if we've arrived at a pragma rule match\n\t\tvar nextMatch = this.findNextMatch(this.pragmaRules,this.pos);\n\t\t// If not, just exit\n\t\tif(!nextMatch || nextMatch.matchIndex !== this.pos) {\n\t\t\tbreak;\n\t\t}\n\t\t// Process the pragma rule\n\t\tvar subTree = nextMatch.rule.parse();\n\t\tif(subTree.length > 0) {\n\t\t\t// Quick hack; we only cope with a single parse tree node being returned, which is true at the moment\n\t\t\tcurrentTreeBranch.push.apply(currentTreeBranch,subTree);\n\t\t\tsubTree[0].children = [];\n\t\t\tcurrentTreeBranch = subTree[0].children;\n\t\t}\n\t}\n\treturn currentTreeBranch;\n};\n\n/*\nParse a block from the current position\n\tterminatorRegExpString: optional regular expression string that identifies the end of plain paragraphs. Must not include capturing parenthesis\n*/\nWikiParser.prototype.parseBlock = function(terminatorRegExpString) {\n\tvar terminatorRegExp = terminatorRegExpString ? new RegExp(\"(\" + terminatorRegExpString + \"|\\\\r?\\\\n\\\\r?\\\\n)\",\"mg\") : /(\\r?\\n\\r?\\n)/mg;\n\tthis.skipWhitespace();\n\tif(this.pos >= this.sourceLength) {\n\t\treturn [];\n\t}\n\t// Look for a block rule that applies at the current position\n\tvar nextMatch = this.findNextMatch(this.blockRules,this.pos);\n\tif(nextMatch && nextMatch.matchIndex === this.pos) {\n\t\treturn nextMatch.rule.parse();\n\t}\n\t// Treat it as a paragraph if we didn't find a block rule\n\treturn [{type: \"element\", tag: \"p\", children: this.parseInlineRun(terminatorRegExp)}];\n};\n\n/*\nParse a series of blocks of text until a terminating regexp is encountered or the end of the text\n\tterminatorRegExpString: terminating regular expression\n*/\nWikiParser.prototype.parseBlocks = function(terminatorRegExpString) {\n\tif(terminatorRegExpString) {\n\t\treturn this.parseBlocksTerminated(terminatorRegExpString);\n\t} else {\n\t\treturn this.parseBlocksUnterminated();\n\t}\n};\n\n/*\nParse a block from the current position to the end of the text\n*/\nWikiParser.prototype.parseBlocksUnterminated = function() {\n\tvar tree = [];\n\twhile(this.pos < this.sourceLength) {\n\t\ttree.push.apply(tree,this.parseBlock());\n\t}\n\treturn tree;\n};\n\n/*\nParse blocks of text until a terminating regexp is encountered\n*/\nWikiParser.prototype.parseBlocksTerminated = function(terminatorRegExpString) {\n\tvar terminatorRegExp = new RegExp(\"(\" + terminatorRegExpString + \")\",\"mg\"),\n\t\ttree = [];\n\t// Skip any whitespace\n\tthis.skipWhitespace();\n\t//  Check if we've got the end marker\n\tterminatorRegExp.lastIndex = this.pos;\n\tvar match = terminatorRegExp.exec(this.source);\n\t// Parse the text into blocks\n\twhile(this.pos < this.sourceLength && !(match && match.index === this.pos)) {\n\t\tvar blocks = this.parseBlock(terminatorRegExpString);\n\t\ttree.push.apply(tree,blocks);\n\t\t// Skip any whitespace\n\t\tthis.skipWhitespace();\n\t\t//  Check if we've got the end marker\n\t\tterminatorRegExp.lastIndex = this.pos;\n\t\tmatch = terminatorRegExp.exec(this.source);\n\t}\n\tif(match && match.index === this.pos) {\n\t\tthis.pos = match.index + match[0].length;\n\t}\n\treturn tree;\n};\n\n/*\nParse a run of text at the current position\n\tterminatorRegExp: a regexp at which to stop the run\n\toptions: see below\nOptions available:\n\teatTerminator: move the parse position past any encountered terminator (default false)\n*/\nWikiParser.prototype.parseInlineRun = function(terminatorRegExp,options) {\n\tif(terminatorRegExp) {\n\t\treturn this.parseInlineRunTerminated(terminatorRegExp,options);\n\t} else {\n\t\treturn this.parseInlineRunUnterminated(options);\n\t}\n};\n\nWikiParser.prototype.parseInlineRunUnterminated = function(options) {\n\tvar tree = [];\n\t// Find the next occurrence of an inline rule\n\tvar nextMatch = this.findNextMatch(this.inlineRules,this.pos);\n\t// Loop around the matches until we've reached the end of the text\n\twhile(this.pos < this.sourceLength && nextMatch) {\n\t\t// Process the text preceding the run rule\n\t\tif(nextMatch.matchIndex > this.pos) {\n\t\t\ttree.push({type: \"text\", text: this.source.substring(this.pos,nextMatch.matchIndex)});\n\t\t\tthis.pos = nextMatch.matchIndex;\n\t\t}\n\t\t// Process the run rule\n\t\ttree.push.apply(tree,nextMatch.rule.parse());\n\t\t// Look for the next run rule\n\t\tnextMatch = this.findNextMatch(this.inlineRules,this.pos);\n\t}\n\t// Process the remaining text\n\tif(this.pos < this.sourceLength) {\n\t\ttree.push({type: \"text\", text: this.source.substr(this.pos)});\n\t}\n\tthis.pos = this.sourceLength;\n\treturn tree;\n};\n\nWikiParser.prototype.parseInlineRunTerminated = function(terminatorRegExp,options) {\n\toptions = options || {};\n\tvar tree = [];\n\t// Find the next occurrence of the terminator\n\tterminatorRegExp.lastIndex = this.pos;\n\tvar terminatorMatch = terminatorRegExp.exec(this.source);\n\t// Find the next occurrence of a inlinerule\n\tvar inlineRuleMatch = this.findNextMatch(this.inlineRules,this.pos);\n\t// Loop around until we've reached the end of the text\n\twhile(this.pos < this.sourceLength && (terminatorMatch || inlineRuleMatch)) {\n\t\t// Return if we've found the terminator, and it precedes any inline rule match\n\t\tif(terminatorMatch) {\n\t\t\tif(!inlineRuleMatch || inlineRuleMatch.matchIndex >= terminatorMatch.index) {\n\t\t\t\tif(terminatorMatch.index > this.pos) {\n\t\t\t\t\ttree.push({type: \"text\", text: this.source.substring(this.pos,terminatorMatch.index)});\n\t\t\t\t}\n\t\t\t\tthis.pos = terminatorMatch.index;\n\t\t\t\tif(options.eatTerminator) {\n\t\t\t\t\tthis.pos += terminatorMatch[0].length;\n\t\t\t\t}\n\t\t\t\treturn tree;\n\t\t\t}\n\t\t}\n\t\t// Process any inline rule, along with the text preceding it\n\t\tif(inlineRuleMatch) {\n\t\t\t// Preceding text\n\t\t\tif(inlineRuleMatch.matchIndex > this.pos) {\n\t\t\t\ttree.push({type: \"text\", text: this.source.substring(this.pos,inlineRuleMatch.matchIndex)});\n\t\t\t\tthis.pos = inlineRuleMatch.matchIndex;\n\t\t\t}\n\t\t\t// Process the inline rule\n\t\t\ttree.push.apply(tree,inlineRuleMatch.rule.parse());\n\t\t\t// Look for the next inline rule\n\t\t\tinlineRuleMatch = this.findNextMatch(this.inlineRules,this.pos);\n\t\t\t// Look for the next terminator match\n\t\t\tterminatorRegExp.lastIndex = this.pos;\n\t\t\tterminatorMatch = terminatorRegExp.exec(this.source);\n\t\t}\n\t}\n\t// Process the remaining text\n\tif(this.pos < this.sourceLength) {\n\t\ttree.push({type: \"text\", text: this.source.substr(this.pos)});\n\t}\n\tthis.pos = this.sourceLength;\n\treturn tree;\n};\n\n/*\nParse zero or more class specifiers `.classname`\n*/\nWikiParser.prototype.parseClasses = function() {\n\tvar classRegExp = /\\.([^\\s\\.]+)/mg,\n\t\tclassNames = [];\n\tclassRegExp.lastIndex = this.pos;\n\tvar match = classRegExp.exec(this.source);\n\twhile(match && match.index === this.pos) {\n\t\tthis.pos = match.index + match[0].length;\n\t\tclassNames.push(match[1]);\n\t\tmatch = classRegExp.exec(this.source);\n\t}\n\treturn classNames;\n};\n\n/*\nAmend the rules used by this instance of the parser\n\ttype: `only` keeps just the named rules, `except` keeps all but the named rules\n\tnames: array of rule names\n*/\nWikiParser.prototype.amendRules = function(type,names) {\n\tnames = names || [];\n\t// Define the filter function\n\tvar keepFilter;\n\tif(type === \"only\") {\n\t\tkeepFilter = function(name) {\n\t\t\treturn names.indexOf(name) !== -1;\n\t\t};\n\t} else if(type === \"except\") {\n\t\tkeepFilter = function(name) {\n\t\t\treturn names.indexOf(name) === -1;\n\t\t};\n\t} else {\n\t\treturn;\n\t}\n\t// Define a function to process each of our rule arrays\n\tvar processRuleArray = function(ruleArray) {\n\t\tfor(var t=ruleArray.length-1; t>=0; t--) {\n\t\t\tif(!keepFilter(ruleArray[t].rule.name)) {\n\t\t\t\truleArray.splice(t,1);\n\t\t\t}\n\t\t}\n\t};\n\t// Process each rule array\n\tprocessRuleArray(this.pragmaRules);\n\tprocessRuleArray(this.blockRules);\n\tprocessRuleArray(this.inlineRules);\n};\n\nexports[\"text/vnd.tiddlywiki\"] = WikiParser;\n\n})();\n\n",
            "title": "$:/core/modules/parsers/wikiparser/wikiparser.js",
            "type": "application/javascript",
            "module-type": "parser"
        },
        "$:/core/modules/parsers/wikiparser/rules/wikirulebase.js": {
            "text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/wikirulebase.js\ntype: application/javascript\nmodule-type: global\n\nBase class for wiki parser rules\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nThis constructor is always overridden with a blank constructor, and so shouldn't be used\n*/\nvar WikiRuleBase = function() {\n};\n\n/*\nTo be overridden by individual rules\n*/\nWikiRuleBase.prototype.init = function(parser) {\n\tthis.parser = parser;\n};\n\n/*\nDefault implementation of findNextMatch uses RegExp matching\n*/\nWikiRuleBase.prototype.findNextMatch = function(startPos) {\n\tthis.matchRegExp.lastIndex = startPos;\n\tthis.match = this.matchRegExp.exec(this.parser.source);\n\treturn this.match ? this.match.index : undefined;\n};\n\nexports.WikiRuleBase = WikiRuleBase;\n\n})();\n",
            "title": "$:/core/modules/parsers/wikiparser/rules/wikirulebase.js",
            "type": "application/javascript",
            "module-type": "global"
        },
        "$:/core/modules/pluginswitcher.js": {
            "text": "/*\\\ntitle: $:/core/modules/pluginswitcher.js\ntype: application/javascript\nmodule-type: global\n\nManages switching plugins for themes and languages.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\noptions:\nwiki: wiki store to be used\npluginType: type of plugin to be switched\ncontrollerTitle: title of tiddler used to control switching of this resource\ndefaultPlugins: array of default plugins to be used if nominated plugin isn't found\nonSwitch: callback when plugin is switched (single parameter is array of plugin titles)\n*/\nfunction PluginSwitcher(options) {\n\tthis.wiki = options.wiki;\n\tthis.pluginType = options.pluginType;\n\tthis.controllerTitle = options.controllerTitle;\n\tthis.defaultPlugins = options.defaultPlugins || [];\n\tthis.onSwitch = options.onSwitch;\n\t// Switch to the current plugin\n\tthis.switchPlugins();\n\t// Listen for changes to the selected plugin\n\tvar self = this;\n\tthis.wiki.addEventListener(\"change\",function(changes) {\n\t\tif($tw.utils.hop(changes,self.controllerTitle)) {\n\t\t\tself.switchPlugins();\n\t\t}\n\t});\n}\n\nPluginSwitcher.prototype.switchPlugins = function() {\n\t// Get the name of the current theme\n\tvar selectedPluginTitle = this.wiki.getTiddlerText(this.controllerTitle);\n\t// If it doesn't exist, then fallback to one of the default themes\n\tvar index = 0;\n\twhile(!this.wiki.getTiddler(selectedPluginTitle) && index < this.defaultPlugins.length) {\n\t\tselectedPluginTitle = this.defaultPlugins[index++];\n\t}\n\t// Accumulate the titles of the plugins that we need to load\n\tvar plugins = [],\n\t\tself = this,\n\t\taccumulatePlugin = function(title) {\n\t\t\tvar tiddler = self.wiki.getTiddler(title);\n\t\t\tif(tiddler && tiddler.isPlugin() && plugins.indexOf(title) === -1) {\n\t\t\t\tplugins.push(title);\n\t\t\t\tvar pluginInfo = JSON.parse(self.wiki.getTiddlerText(title)),\n\t\t\t\t\tdependents = $tw.utils.parseStringArray(tiddler.fields.dependents || \"\");\n\t\t\t\t$tw.utils.each(dependents,function(title) {\n\t\t\t\t\taccumulatePlugin(title);\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\taccumulatePlugin(selectedPluginTitle);\n\t// Unregister any existing theme tiddlers\n\tvar unregisteredTiddlers = $tw.wiki.unregisterPluginTiddlers(this.pluginType);\n\t// Register any new theme tiddlers\n\tvar registeredTiddlers = $tw.wiki.registerPluginTiddlers(this.pluginType,plugins);\n\t// Unpack the current theme tiddlers\n\t$tw.wiki.unpackPluginTiddlers();\n\t// Call the switch handler\n\tif(this.onSwitch) {\n\t\tthis.onSwitch(plugins);\n\t}\n};\n\nexports.PluginSwitcher = PluginSwitcher;\n\n})();\n",
            "title": "$:/core/modules/pluginswitcher.js",
            "type": "application/javascript",
            "module-type": "global"
        },
        "$:/core/modules/saver-handler.js": {
            "text": "/*\\\ntitle: $:/core/modules/saver-handler.js\ntype: application/javascript\nmodule-type: global\n\nThe saver handler tracks changes to the store and handles saving the entire wiki via saver modules.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nInstantiate the saver handler with the following options:\nwiki: wiki to be synced\ndirtyTracking: true if dirty tracking should be performed\n*/\nfunction SaverHandler(options) {\n\tvar self = this;\n\tthis.wiki = options.wiki;\n\tthis.dirtyTracking = options.dirtyTracking;\n\tthis.pendingAutoSave = false;\n\t// Make a logger\n\tthis.logger = new $tw.utils.Logger(\"saver-handler\");\n\t// Initialise our savers\n\tif($tw.browser) {\n\t\tthis.initSavers();\n\t}\n\t// Only do dirty tracking if required\n\tif($tw.browser && this.dirtyTracking) {\n\t\t// Compile the dirty tiddler filter\n\t\tthis.filterFn = this.wiki.compileFilter(this.wiki.getTiddlerText(this.titleSyncFilter));\n\t\t// Count of changes that have not yet been saved\n\t\tthis.numChanges = 0;\n\t\t// Listen out for changes to tiddlers\n\t\tthis.wiki.addEventListener(\"change\",function(changes) {\n\t\t\t// Filter the changes so that we only count changes to tiddlers that we care about\n\t\t\tvar filteredChanges = self.filterFn.call(self.wiki,function(iterator) {\n\t\t\t\t$tw.utils.each(changes,function(change,title) {\n\t\t\t\t\tvar tiddler = self.wiki.getTiddler(title);\n\t\t\t\t\titerator(tiddler,title);\n\t\t\t\t});\n\t\t\t});\n\t\t\t// Adjust the number of changes\n\t\t\tself.numChanges += filteredChanges.length;\n\t\t\tself.updateDirtyStatus();\n\t\t\t// Do any autosave if one is pending and there's no more change events\n\t\t\tif(self.pendingAutoSave && self.wiki.getSizeOfTiddlerEventQueue() === 0) {\n\t\t\t\t// Check if we're dirty\n\t\t\t\tif(self.numChanges > 0) {\n\t\t\t\t\tself.saveWiki({\n\t\t\t\t\t\tmethod: \"autosave\",\n\t\t\t\t\t\tdownloadType: \"text/plain\"\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tself.pendingAutoSave = false;\n\t\t\t}\n\t\t});\n\t\t// Listen for the autosave event\n\t\t$tw.rootWidget.addEventListener(\"tm-auto-save-wiki\",function(event) {\n\t\t\t// Do the autosave unless there are outstanding tiddler change events\n\t\t\tif(self.wiki.getSizeOfTiddlerEventQueue() === 0) {\n\t\t\t\t// Check if we're dirty\n\t\t\t\tif(self.numChanges > 0) {\n\t\t\t\t\tself.saveWiki({\n\t\t\t\t\t\tmethod: \"autosave\",\n\t\t\t\t\t\tdownloadType: \"text/plain\"\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Otherwise put ourselves in the \"pending autosave\" state and wait for the change event before we do the autosave\n\t\t\t\tself.pendingAutoSave = true;\n\t\t\t}\n\t\t});\n\t\t// Set up our beforeunload handler\n\t\t$tw.addUnloadTask(function(event) {\n\t\t\tvar confirmationMessage;\n\t\t\tif(self.isDirty()) {\n\t\t\t\tconfirmationMessage = $tw.language.getString(\"UnsavedChangesWarning\");\n\t\t\t\tevent.returnValue = confirmationMessage; // Gecko\n\t\t\t}\n\t\t\treturn confirmationMessage;\n\t\t});\n\t}\n\t// Install the save action handlers\n\tif($tw.browser) {\n\t\t$tw.rootWidget.addEventListener(\"tm-save-wiki\",function(event) {\n\t\t\tself.saveWiki({\n\t\t\t\ttemplate: event.param,\n\t\t\t\tdownloadType: \"text/plain\",\n\t\t\t\tvariables: event.paramObject\n\t\t\t});\n\t\t});\n\t\t$tw.rootWidget.addEventListener(\"tm-download-file\",function(event) {\n\t\t\tself.saveWiki({\n\t\t\t\tmethod: \"download\",\n\t\t\t\ttemplate: event.param,\n\t\t\t\tdownloadType: \"text/plain\",\n\t\t\t\tvariables: event.paramObject\n\t\t\t});\n\t\t});\n\t}\n}\n\nSaverHandler.prototype.titleSyncFilter = \"$:/config/SaverFilter\";\nSaverHandler.prototype.titleAutoSave = \"$:/config/AutoSave\";\nSaverHandler.prototype.titleSavedNotification = \"$:/language/Notifications/Save/Done\";\n\n/*\nSelect the appropriate saver modules and set them up\n*/\nSaverHandler.prototype.initSavers = function(moduleType) {\n\tmoduleType = moduleType || \"saver\";\n\t// Instantiate the available savers\n\tthis.savers = [];\n\tvar self = this;\n\t$tw.modules.forEachModuleOfType(moduleType,function(title,module) {\n\t\tif(module.canSave(self)) {\n\t\t\tself.savers.push(module.create(self.wiki));\n\t\t}\n\t});\n\t// Sort the savers into priority order\n\tthis.savers.sort(function(a,b) {\n\t\tif(a.info.priority < b.info.priority) {\n\t\t\treturn -1;\n\t\t} else {\n\t\t\tif(a.info.priority > b.info.priority) {\n\t\t\t\treturn +1;\n\t\t\t} else {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t});\n};\n\n/*\nSave the wiki contents. Options are:\n\tmethod: \"save\", \"autosave\" or \"download\"\n\ttemplate: the tiddler containing the template to save\n\tdownloadType: the content type for the saved file\n*/\nSaverHandler.prototype.saveWiki = function(options) {\n\toptions = options || {};\n\tvar self = this,\n\t\tmethod = options.method || \"save\",\n\t\tvariables = options.variables || {},\n\t\ttemplate = options.template || \"$:/core/save/all\",\n\t\tdownloadType = options.downloadType || \"text/plain\",\n\t\ttext = this.wiki.renderTiddler(downloadType,template,options),\n\t\tcallback = function(err) {\n\t\t\tif(err) {\n\t\t\t\talert($tw.language.getString(\"Error/WhileSaving\") + \":\\n\\n\" + err);\n\t\t\t} else {\n\t\t\t\t// Clear the task queue if we're saving (rather than downloading)\n\t\t\t\tif(method !== \"download\") {\n\t\t\t\t\tself.numChanges = 0;\n\t\t\t\t\tself.updateDirtyStatus();\n\t\t\t\t}\n\t\t\t\t$tw.notifier.display(self.titleSavedNotification);\n\t\t\t\tif(options.callback) {\n\t\t\t\t\toptions.callback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t// Ignore autosave if disabled\n\tif(method === \"autosave\" && this.wiki.getTiddlerText(this.titleAutoSave,\"yes\") !== \"yes\") {\n\t\treturn false;\n\t}\n\t// Call the highest priority saver that supports this method\n\tfor(var t=this.savers.length-1; t>=0; t--) {\n\t\tvar saver = this.savers[t];\n\t\tif(saver.info.capabilities.indexOf(method) !== -1 && saver.save(text,method,callback,{variables: {filename: variables.filename}})) {\n\t\t\tthis.logger.log(\"Saving wiki with method\",method,\"through saver\",saver.info.name);\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n};\n\n/*\nChecks whether the wiki is dirty (ie the window shouldn't be closed)\n*/\nSaverHandler.prototype.isDirty = function() {\n\treturn this.numChanges > 0;\n};\n\n/*\nUpdate the document body with the class \"tc-dirty\" if the wiki has unsaved/unsynced changes\n*/\nSaverHandler.prototype.updateDirtyStatus = function() {\n\tif($tw.browser) {\n\t\t$tw.utils.toggleClass(document.body,\"tc-dirty\",this.isDirty());\n\t}\n};\n\nexports.SaverHandler = SaverHandler;\n\n})();\n",
            "title": "$:/core/modules/saver-handler.js",
            "type": "application/javascript",
            "module-type": "global"
        },
        "$:/core/modules/savers/andtidwiki.js": {
            "text": "/*\\\ntitle: $:/core/modules/savers/andtidwiki.js\ntype: application/javascript\nmodule-type: saver\n\nHandles saving changes via the AndTidWiki Android app\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false, netscape: false, Components: false */\n\"use strict\";\n\nvar AndTidWiki = function(wiki) {\n};\n\nAndTidWiki.prototype.save = function(text,method,callback) {\n\t// Get the pathname of this document\n\tvar pathname = decodeURIComponent(document.location.toString().split(\"#\")[0]);\n\t// Strip the file://\n\tif(pathname.indexOf(\"file://\") === 0) {\n\t\tpathname = pathname.substr(7);\n\t}\n\t// Strip any query or location part\n\tvar p = pathname.indexOf(\"?\");\n\tif(p !== -1) {\n\t\tpathname = pathname.substr(0,p);\n\t}\n\tp = pathname.indexOf(\"#\");\n\tif(p !== -1) {\n\t\tpathname = pathname.substr(0,p);\n\t}\n\t// Save the file\n\twindow.twi.saveFile(pathname,text);\n\t// Call the callback\n\tcallback(null);\n\treturn true;\n};\n\n/*\nInformation about this saver\n*/\nAndTidWiki.prototype.info = {\n\tname: \"andtidwiki\",\n\tpriority: 1600,\n\tcapabilities: [\"save\", \"autosave\"]\n};\n\n/*\nStatic method that returns true if this saver is capable of working\n*/\nexports.canSave = function(wiki) {\n\treturn !!window.twi && !!window.twi.saveFile;\n};\n\n/*\nCreate an instance of this saver\n*/\nexports.create = function(wiki) {\n\treturn new AndTidWiki(wiki);\n};\n\n})();\n",
            "title": "$:/core/modules/savers/andtidwiki.js",
            "type": "application/javascript",
            "module-type": "saver"
        },
        "$:/core/modules/savers/beaker.js": {
            "text": "/*\\\ntitle: $:/core/modules/savers/beaker.js\ntype: application/javascript\nmodule-type: saver\n\nSaves files using the Beaker browser's (https://beakerbrowser.com) Dat protocol (https://datproject.org/)\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nSet up the saver\n*/\nvar BeakerSaver = function(wiki) {\n\tthis.wiki = wiki;\n};\n\nBeakerSaver.prototype.save = function(text,method,callback) {\n\tvar url = (location.toString()).split(\"#\")[0];\n\tdat.stat(url).then(function(value) {\n\t\tif(value.type === \"directory\") {\n\t\t\turl = url + \"/index.html\";\n\t\t}\n\t\tdat.writeFile(url,text,\"utf8\").then(function(value) {\n\t\t\tcallback(null);\n\t\t},function(reason) {\n\t\t\tcallback(\"Beaker Saver Write Error: \" + reason);\n\t\t});\t\t\n\t},function(reason) {\n\t\tcallback(\"Beaker Saver Stat Error: \" + reason);\n\t});\n\treturn true;\n};\n\n/*\nInformation about this saver\n*/\nBeakerSaver.prototype.info = {\n\tname: \"beaker\",\n\tpriority: 3000,\n\tcapabilities: [\"save\", \"autosave\"]\n};\n\n/*\nStatic method that returns true if this saver is capable of working\n*/\nexports.canSave = function(wiki) {\n\treturn !!window.dat;\n};\n\n/*\nCreate an instance of this saver\n*/\nexports.create = function(wiki) {\n\treturn new BeakerSaver(wiki);\n};\n\n})();\n",
            "title": "$:/core/modules/savers/beaker.js",
            "type": "application/javascript",
            "module-type": "saver"
        },
        "$:/core/modules/savers/download.js": {
            "text": "/*\\\ntitle: $:/core/modules/savers/download.js\ntype: application/javascript\nmodule-type: saver\n\nHandles saving changes via HTML5's download APIs\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nSelect the appropriate saver module and set it up\n*/\nvar DownloadSaver = function(wiki) {\n};\n\nDownloadSaver.prototype.save = function(text,method,callback,options) {\n\toptions = options || {};\n\t// Get the current filename\n\tvar filename = options.variables.filename;\n\tif(!filename) {\n\t\tvar p = document.location.pathname.lastIndexOf(\"/\");\n\t\tif(p !== -1) {\n\t\t\tfilename = document.location.pathname.substr(p+1);\n\t\t}\n\t}\n\tif(!filename) {\n\t\tfilename = \"tiddlywiki.html\";\n\t}\n\t// Set up the link\n\tvar link = document.createElement(\"a\");\n\tif(Blob !== undefined) {\n\t\tvar blob = new Blob([text], {type: \"text/html\"});\n\t\tlink.setAttribute(\"href\", URL.createObjectURL(blob));\n\t} else {\n\t\tlink.setAttribute(\"href\",\"data:text/html,\" + encodeURIComponent(text));\n\t}\n\tlink.setAttribute(\"download\",filename);\n\tdocument.body.appendChild(link);\n\tlink.click();\n\tdocument.body.removeChild(link);\n\t// Callback that we succeeded\n\tcallback(null);\n\treturn true;\n};\n\n/*\nInformation about this saver\n*/\nDownloadSaver.prototype.info = {\n\tname: \"download\",\n\tpriority: 100\n};\n\nObject.defineProperty(DownloadSaver.prototype.info, \"capabilities\", {\n\tget: function() {\n\t\tvar capabilities = [\"save\", \"download\"];\n\t\tif(($tw.wiki.getTextReference(\"$:/config/DownloadSaver/AutoSave\") || \"\").toLowerCase() === \"yes\") {\n\t\t\tcapabilities.push(\"autosave\");\n\t\t}\n\t\treturn capabilities;\n\t}\n});\n\n/*\nStatic method that returns true if this saver is capable of working\n*/\nexports.canSave = function(wiki) {\n\treturn document.createElement(\"a\").download !== undefined;\n};\n\n/*\nCreate an instance of this saver\n*/\nexports.create = function(wiki) {\n\treturn new DownloadSaver(wiki);\n};\n\n})();\n",
            "title": "$:/core/modules/savers/download.js",
            "type": "application/javascript",
            "module-type": "saver"
        },
        "$:/core/modules/savers/fsosaver.js": {
            "text": "/*\\\ntitle: $:/core/modules/savers/fsosaver.js\ntype: application/javascript\nmodule-type: saver\n\nHandles saving changes via MS FileSystemObject ActiveXObject\n\nNote: Since TiddlyWiki's markup contains the MOTW, the FileSystemObject normally won't be available. \nHowever, if the wiki is loaded as an .HTA file (Windows HTML Applications) then the FSO can be used.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nSelect the appropriate saver module and set it up\n*/\nvar FSOSaver = function(wiki) {\n};\n\nFSOSaver.prototype.save = function(text,method,callback) {\n\t// Get the pathname of this document\n\tvar pathname = unescape(document.location.pathname);\n\t// Test for a Windows path of the form /x:\\blah...\n\tif(/^\\/[A-Z]\\:\\\\[^\\\\]+/i.test(pathname)) {\t// ie: ^/[a-z]:/[^/]+\n\t\t// Remove the leading slash\n\t\tpathname = pathname.substr(1);\n\t} else if(document.location.hostname !== \"\" && /^\\/\\\\[^\\\\]+\\\\[^\\\\]+/i.test(pathname)) {\t// test for \\\\server\\share\\blah... - ^/[^/]+/[^/]+\n\t\t// Remove the leading slash\n\t\tpathname = pathname.substr(1);\n\t\t// reconstruct UNC path\n\t\tpathname = \"\\\\\\\\\" + document.location.hostname + pathname;\n\t} else {\n\t\treturn false;\n\t}\n\t// Save the file (as UTF-16)\n\tvar fso = new ActiveXObject(\"Scripting.FileSystemObject\");\n\tvar file = fso.OpenTextFile(pathname,2,-1,-1);\n\tfile.Write(text);\n\tfile.Close();\n\t// Callback that we succeeded\n\tcallback(null);\n\treturn true;\n};\n\n/*\nInformation about this saver\n*/\nFSOSaver.prototype.info = {\n\tname: \"FSOSaver\",\n\tpriority: 120,\n\tcapabilities: [\"save\", \"autosave\"]\n};\n\n/*\nStatic method that returns true if this saver is capable of working\n*/\nexports.canSave = function(wiki) {\n\ttry {\n\t\treturn (window.location.protocol === \"file:\") && !!(new ActiveXObject(\"Scripting.FileSystemObject\"));\n\t} catch(e) { return false; }\n};\n\n/*\nCreate an instance of this saver\n*/\nexports.create = function(wiki) {\n\treturn new FSOSaver(wiki);\n};\n\n})();\n",
            "title": "$:/core/modules/savers/fsosaver.js",
            "type": "application/javascript",
            "module-type": "saver"
        },
        "$:/core/modules/savers/manualdownload.js": {
            "text": "/*\\\ntitle: $:/core/modules/savers/manualdownload.js\ntype: application/javascript\nmodule-type: saver\n\nHandles saving changes via HTML5's download APIs\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n// Title of the tiddler containing the download message\nvar downloadInstructionsTitle = \"$:/language/Modals/Download\";\n\n/*\nSelect the appropriate saver module and set it up\n*/\nvar ManualDownloadSaver = function(wiki) {\n};\n\nManualDownloadSaver.prototype.save = function(text,method,callback) {\n\t$tw.modal.display(downloadInstructionsTitle,{\n\t\tdownloadLink: \"data:text/html,\" + encodeURIComponent(text)\n\t});\n\t// Callback that we succeeded\n\tcallback(null);\n\treturn true;\n};\n\n/*\nInformation about this saver\n*/\nManualDownloadSaver.prototype.info = {\n\tname: \"manualdownload\",\n\tpriority: 0,\n\tcapabilities: [\"save\", \"download\"]\n};\n\n/*\nStatic method that returns true if this saver is capable of working\n*/\nexports.canSave = function(wiki) {\n\treturn true;\n};\n\n/*\nCreate an instance of this saver\n*/\nexports.create = function(wiki) {\n\treturn new ManualDownloadSaver(wiki);\n};\n\n})();\n",
            "title": "$:/core/modules/savers/manualdownload.js",
            "type": "application/javascript",
            "module-type": "saver"
        },
        "$:/core/modules/savers/msdownload.js": {
            "text": "/*\\\ntitle: $:/core/modules/savers/msdownload.js\ntype: application/javascript\nmodule-type: saver\n\nHandles saving changes via window.navigator.msSaveBlob()\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nSelect the appropriate saver module and set it up\n*/\nvar MsDownloadSaver = function(wiki) {\n};\n\nMsDownloadSaver.prototype.save = function(text,method,callback) {\n\t// Get the current filename\n\tvar filename = \"tiddlywiki.html\",\n\t\tp = document.location.pathname.lastIndexOf(\"/\");\n\tif(p !== -1) {\n\t\tfilename = document.location.pathname.substr(p+1);\n\t}\n\t// Set up the link\n\tvar blob = new Blob([text], {type: \"text/html\"});\n\twindow.navigator.msSaveBlob(blob,filename);\n\t// Callback that we succeeded\n\tcallback(null);\n\treturn true;\n};\n\n/*\nInformation about this saver\n*/\nMsDownloadSaver.prototype.info = {\n\tname: \"msdownload\",\n\tpriority: 110,\n\tcapabilities: [\"save\", \"download\"]\n};\n\n/*\nStatic method that returns true if this saver is capable of working\n*/\nexports.canSave = function(wiki) {\n\treturn !!window.navigator.msSaveBlob;\n};\n\n/*\nCreate an instance of this saver\n*/\nexports.create = function(wiki) {\n\treturn new MsDownloadSaver(wiki);\n};\n\n})();\n",
            "title": "$:/core/modules/savers/msdownload.js",
            "type": "application/javascript",
            "module-type": "saver"
        },
        "$:/core/modules/savers/put.js": {
            "text": "/*\\\ntitle: $:/core/modules/savers/put.js\ntype: application/javascript\nmodule-type: saver\n\nSaves wiki by performing a PUT request to the server\n\nWorks with any server which accepts a PUT request\nto the current URL, such as a WebDAV server.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nSelect the appropriate saver module and set it up\n*/\nvar PutSaver = function(wiki) {\n\tthis.wiki = wiki;\n\tvar self = this;\n\tvar uri = this.uri();\n\t// Async server probe. Until probe finishes, save will fail fast\n\t// See also https://github.com/Jermolene/TiddlyWiki5/issues/2276\n\t$tw.utils.httpRequest({\n\t\turl: uri,\n\t\ttype: \"OPTIONS\",\n\t\tcallback: function(err, data, xhr) {\n\t\t\t// Check DAV header http://www.webdav.org/specs/rfc2518.html#rfc.section.9.1\n\t\t\tif(!err) {\n\t\t\t\tself.serverAcceptsPuts = xhr.status === 200 && !!xhr.getResponseHeader(\"dav\");\n\t\t\t}\n\t\t}\n\t});\n\t// Retrieve ETag if available\n\t$tw.utils.httpRequest({\n\t\turl: uri,\n\t\ttype: \"HEAD\",\n\t\tcallback: function(err, data, xhr) {\n\t\t\tif(!err) {\n\t\t\t\tself.etag = xhr.getResponseHeader(\"ETag\");\n\t\t\t}\n\t\t}\n\t});\n};\n\nPutSaver.prototype.uri = function() {\n\treturn encodeURI(document.location.toString().split(\"#\")[0]);\n};\n\n// TODO: in case of edit conflict\n// Prompt: Do you want to save over this? Y/N\n// Merging would be ideal, and may be possible using future generic merge flow\nPutSaver.prototype.save = function(text, method, callback) {\n\tif(!this.serverAcceptsPuts) {\n\t\treturn false;\n\t}\n\tvar self = this;\n\tvar headers = { \"Content-Type\": \"text/html;charset=UTF-8\" };\n\tif(this.etag) {\n\t\theaders[\"If-Match\"] = this.etag;\n\t}\n\t$tw.utils.httpRequest({\n\t\turl: this.uri(),\n\t\ttype: \"PUT\",\n\t\theaders: headers,\n\t\tdata: text,\n\t\tcallback: function(err, data, xhr) {\n\t\t\tif(err) {\n\t\t\t\tcallback(err);\n\t\t\t} if(xhr.status === 200 || xhr.status === 201) {\n\t\t\t\tself.etag = xhr.getResponseHeader(\"ETag\");\n\t\t\t\tcallback(null); // success\n\t\t\t} else if(xhr.status === 412) { // edit conflict\n\t\t\t\tvar message = $tw.language.getString(\"Error/EditConflict\");\n\t\t\t\tcallback(message);\n\t\t\t} else {\n\t\t\t\tcallback(xhr.responseText); // fail\n\t\t\t}\n\t\t}\n\t});\n\treturn true;\n};\n\n/*\nInformation about this saver\n*/\nPutSaver.prototype.info = {\n\tname: \"put\",\n\tpriority: 2000,\n\tcapabilities: [\"save\", \"autosave\"]\n};\n\n/*\nStatic method that returns true if this saver is capable of working\n*/\nexports.canSave = function(wiki) {\n\treturn /^https?:/.test(location.protocol);\n};\n\n/*\nCreate an instance of this saver\n*/\nexports.create = function(wiki) {\n\treturn new PutSaver(wiki);\n};\n\n})();\n",
            "title": "$:/core/modules/savers/put.js",
            "type": "application/javascript",
            "module-type": "saver"
        },
        "$:/core/modules/savers/tiddlyfox.js": {
            "text": "/*\\\ntitle: $:/core/modules/savers/tiddlyfox.js\ntype: application/javascript\nmodule-type: saver\n\nHandles saving changes via the TiddlyFox file extension\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false, netscape: false, Components: false */\n\"use strict\";\n\nvar TiddlyFoxSaver = function(wiki) {\n};\n\nTiddlyFoxSaver.prototype.save = function(text,method,callback) {\n\tvar messageBox = document.getElementById(\"tiddlyfox-message-box\");\n\tif(messageBox) {\n\t\t// Get the pathname of this document\n\t\tvar pathname = document.location.toString().split(\"#\")[0];\n\t\t// Replace file://localhost/ with file:///\n\t\tif(pathname.indexOf(\"file://localhost/\") === 0) {\n\t\t\tpathname = \"file://\" + pathname.substr(16);\n\t\t}\n\t\t// Windows path file:///x:/blah/blah --> x:\\blah\\blah\n\t\tif(/^file\\:\\/\\/\\/[A-Z]\\:\\//i.test(pathname)) {\n\t\t\t// Remove the leading slash and convert slashes to backslashes\n\t\t\tpathname = pathname.substr(8).replace(/\\//g,\"\\\\\");\n\t\t// Firefox Windows network path file://///server/share/blah/blah --> //server/share/blah/blah\n\t\t} else if(pathname.indexOf(\"file://///\") === 0) {\n\t\t\tpathname = \"\\\\\\\\\" + unescape(pathname.substr(10)).replace(/\\//g,\"\\\\\");\n\t\t// Mac/Unix local path file:///path/path --> /path/path\n\t\t} else if(pathname.indexOf(\"file:///\") === 0) {\n\t\t\tpathname = unescape(pathname.substr(7));\n\t\t// Mac/Unix local path file:/path/path --> /path/path\n\t\t} else if(pathname.indexOf(\"file:/\") === 0) {\n\t\t\tpathname = unescape(pathname.substr(5));\n\t\t// Otherwise Windows networth path file://server/share/path/path --> \\\\server\\share\\path\\path\n\t\t} else {\n\t\t\tpathname = \"\\\\\\\\\" + unescape(pathname.substr(7)).replace(new RegExp(\"/\",\"g\"),\"\\\\\");\n\t\t}\n\t\t// Create the message element and put it in the message box\n\t\tvar message = document.createElement(\"div\");\n\t\tmessage.setAttribute(\"data-tiddlyfox-path\",decodeURIComponent(pathname));\n\t\tmessage.setAttribute(\"data-tiddlyfox-content\",text);\n\t\tmessageBox.appendChild(message);\n\t\t// Add an event handler for when the file has been saved\n\t\tmessage.addEventListener(\"tiddlyfox-have-saved-file\",function(event) {\n\t\t\tcallback(null);\n\t\t}, false);\n\t\t// Create and dispatch the custom event to the extension\n\t\tvar event = document.createEvent(\"Events\");\n\t\tevent.initEvent(\"tiddlyfox-save-file\",true,false);\n\t\tmessage.dispatchEvent(event);\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n};\n\n/*\nInformation about this saver\n*/\nTiddlyFoxSaver.prototype.info = {\n\tname: \"tiddlyfox\",\n\tpriority: 1500,\n\tcapabilities: [\"save\", \"autosave\"]\n};\n\n/*\nStatic method that returns true if this saver is capable of working\n*/\nexports.canSave = function(wiki) {\n\treturn true;\n};\n\n/*\nCreate an instance of this saver\n*/\nexports.create = function(wiki) {\n\treturn new TiddlyFoxSaver(wiki);\n};\n\n})();\n",
            "title": "$:/core/modules/savers/tiddlyfox.js",
            "type": "application/javascript",
            "module-type": "saver"
        },
        "$:/core/modules/savers/tiddlyie.js": {
            "text": "/*\\\ntitle: $:/core/modules/savers/tiddlyie.js\ntype: application/javascript\nmodule-type: saver\n\nHandles saving changes via Internet Explorer BHO extenion (TiddlyIE)\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nSelect the appropriate saver module and set it up\n*/\nvar TiddlyIESaver = function(wiki) {\n};\n\nTiddlyIESaver.prototype.save = function(text,method,callback) {\n\t// Check existence of TiddlyIE BHO extension (note: only works after document is complete)\n\tif(typeof(window.TiddlyIE) != \"undefined\") {\n\t\t// Get the pathname of this document\n\t\tvar pathname = unescape(document.location.pathname);\n\t\t// Test for a Windows path of the form /x:/blah...\n\t\tif(/^\\/[A-Z]\\:\\/[^\\/]+/i.test(pathname)) {\t// ie: ^/[a-z]:/[^/]+ (is this better?: ^/[a-z]:/[^/]+(/[^/]+)*\\.[^/]+ )\n\t\t\t// Remove the leading slash\n\t\t\tpathname = pathname.substr(1);\n\t\t\t// Convert slashes to backslashes\n\t\t\tpathname = pathname.replace(/\\//g,\"\\\\\");\n\t\t} else if(document.hostname !== \"\" && /^\\/[^\\/]+\\/[^\\/]+/i.test(pathname)) {\t// test for \\\\server\\share\\blah... - ^/[^/]+/[^/]+\n\t\t\t// Convert slashes to backslashes\n\t\t\tpathname = pathname.replace(/\\//g,\"\\\\\");\n\t\t\t// reconstruct UNC path\n\t\t\tpathname = \"\\\\\\\\\" + document.location.hostname + pathname;\n\t\t} else return false;\n\t\t// Prompt the user to save the file\n\t\twindow.TiddlyIE.save(pathname, text);\n\t\t// Callback that we succeeded\n\t\tcallback(null);\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n};\n\n/*\nInformation about this saver\n*/\nTiddlyIESaver.prototype.info = {\n\tname: \"tiddlyiesaver\",\n\tpriority: 1500,\n\tcapabilities: [\"save\"]\n};\n\n/*\nStatic method that returns true if this saver is capable of working\n*/\nexports.canSave = function(wiki) {\n\treturn (window.location.protocol === \"file:\");\n};\n\n/*\nCreate an instance of this saver\n*/\nexports.create = function(wiki) {\n\treturn new TiddlyIESaver(wiki);\n};\n\n})();\n",
            "title": "$:/core/modules/savers/tiddlyie.js",
            "type": "application/javascript",
            "module-type": "saver"
        },
        "$:/core/modules/savers/twedit.js": {
            "text": "/*\\\ntitle: $:/core/modules/savers/twedit.js\ntype: application/javascript\nmodule-type: saver\n\nHandles saving changes via the TWEdit iOS app\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false, netscape: false, Components: false */\n\"use strict\";\n\nvar TWEditSaver = function(wiki) {\n};\n\nTWEditSaver.prototype.save = function(text,method,callback) {\n\t// Bail if we're not running under TWEdit\n\tif(typeof DeviceInfo !== \"object\") {\n\t\treturn false;\n\t}\n\t// Get the pathname of this document\n\tvar pathname = decodeURIComponent(document.location.pathname);\n\t// Strip any query or location part\n\tvar p = pathname.indexOf(\"?\");\n\tif(p !== -1) {\n\t\tpathname = pathname.substr(0,p);\n\t}\n\tp = pathname.indexOf(\"#\");\n\tif(p !== -1) {\n\t\tpathname = pathname.substr(0,p);\n\t}\n\t// Remove the leading \"/Documents\" from path\n\tvar prefix = \"/Documents\";\n\tif(pathname.indexOf(prefix) === 0) {\n\t\tpathname = pathname.substr(prefix.length);\n\t}\n\t// Error handler\n\tvar errorHandler = function(event) {\n\t\t// Error\n\t\tcallback($tw.language.getString(\"Error/SavingToTWEdit\") + \": \" + event.target.error.code);\n\t};\n\t// Get the file system\n\twindow.requestFileSystem(LocalFileSystem.PERSISTENT,0,function(fileSystem) {\n\t\t// Now we've got the filesystem, get the fileEntry\n\t\tfileSystem.root.getFile(pathname, {create: true}, function(fileEntry) {\n\t\t\t// Now we've got the fileEntry, create the writer\n\t\t\tfileEntry.createWriter(function(writer) {\n\t\t\t\twriter.onerror = errorHandler;\n\t\t\t\twriter.onwrite = function() {\n\t\t\t\t\tcallback(null);\n\t\t\t\t};\n\t\t\t\twriter.position = 0;\n\t\t\t\twriter.write(text);\n\t\t\t},errorHandler);\n\t\t}, errorHandler);\n\t}, errorHandler);\n\treturn true;\n};\n\n/*\nInformation about this saver\n*/\nTWEditSaver.prototype.info = {\n\tname: \"twedit\",\n\tpriority: 1600,\n\tcapabilities: [\"save\", \"autosave\"]\n};\n\n/*\nStatic method that returns true if this saver is capable of working\n*/\nexports.canSave = function(wiki) {\n\treturn true;\n};\n\n/*\nCreate an instance of this saver\n*/\nexports.create = function(wiki) {\n\treturn new TWEditSaver(wiki);\n};\n\n/////////////////////////// Hack\n// HACK: This ensures that TWEdit recognises us as a TiddlyWiki document\nif($tw.browser) {\n\twindow.version = {title: \"TiddlyWiki\"};\n}\n\n})();\n",
            "title": "$:/core/modules/savers/twedit.js",
            "type": "application/javascript",
            "module-type": "saver"
        },
        "$:/core/modules/savers/upload.js": {
            "text": "/*\\\ntitle: $:/core/modules/savers/upload.js\ntype: application/javascript\nmodule-type: saver\n\nHandles saving changes via upload to a server.\n\nDesigned to be compatible with BidiX's UploadPlugin at http://tiddlywiki.bidix.info/#UploadPlugin\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nSelect the appropriate saver module and set it up\n*/\nvar UploadSaver = function(wiki) {\n\tthis.wiki = wiki;\n};\n\nUploadSaver.prototype.save = function(text,method,callback) {\n\t// Get the various parameters we need\n\tvar backupDir = this.wiki.getTextReference(\"$:/UploadBackupDir\") || \".\",\n\t\tusername = this.wiki.getTextReference(\"$:/UploadName\"),\n\t\tpassword = $tw.utils.getPassword(\"upload\"),\n\t\tuploadDir = this.wiki.getTextReference(\"$:/UploadDir\") || \".\",\n\t\tuploadFilename = this.wiki.getTextReference(\"$:/UploadFilename\") || \"index.html\",\n\t\turl = this.wiki.getTextReference(\"$:/UploadURL\");\n\t// Bail out if we don't have the bits we need\n\tif(!username || username.toString().trim() === \"\" || !password || password.toString().trim() === \"\") {\n\t\treturn false;\n\t}\n\t// Construct the url if not provided\n\tif(!url) {\n\t\turl = \"http://\" + username + \".tiddlyspot.com/store.cgi\";\n\t}\n\t// Assemble the header\n\tvar boundary = \"---------------------------\" + \"AaB03x\";\t\n\tvar uploadFormName = \"UploadPlugin\";\n\tvar head = [];\n\thead.push(\"--\" + boundary + \"\\r\\nContent-disposition: form-data; name=\\\"UploadPlugin\\\"\\r\\n\");\n\thead.push(\"backupDir=\" + backupDir + \";user=\" + username + \";password=\" + password + \";uploaddir=\" + uploadDir + \";;\"); \n\thead.push(\"\\r\\n\" + \"--\" + boundary);\n\thead.push(\"Content-disposition: form-data; name=\\\"userfile\\\"; filename=\\\"\" + uploadFilename + \"\\\"\");\n\thead.push(\"Content-Type: text/html;charset=UTF-8\");\n\thead.push(\"Content-Length: \" + text.length + \"\\r\\n\");\n\thead.push(\"\");\n\t// Assemble the tail and the data itself\n\tvar tail = \"\\r\\n--\" + boundary + \"--\\r\\n\",\n\t\tdata = head.join(\"\\r\\n\") + text + tail;\n\t// Do the HTTP post\n\tvar http = new XMLHttpRequest();\n\thttp.open(\"POST\",url,true,username,password);\n\thttp.setRequestHeader(\"Content-Type\",\"multipart/form-data; charset=UTF-8; boundary=\" + boundary);\n\thttp.onreadystatechange = function() {\n\t\tif(http.readyState == 4 && http.status == 200) {\n\t\t\tif(http.responseText.substr(0,4) === \"0 - \") {\n\t\t\t\tcallback(null);\n\t\t\t} else {\n\t\t\t\tcallback(http.responseText);\n\t\t\t}\n\t\t}\n\t};\n\ttry {\n\t\thttp.send(data);\n\t} catch(ex) {\n\t\treturn callback($tw.language.getString(\"Error/Caption\") + \":\" + ex);\n\t}\n\t$tw.notifier.display(\"$:/language/Notifications/Save/Starting\");\n\treturn true;\n};\n\n/*\nInformation about this saver\n*/\nUploadSaver.prototype.info = {\n\tname: \"upload\",\n\tpriority: 2000,\n\tcapabilities: [\"save\", \"autosave\"]\n};\n\n/*\nStatic method that returns true if this saver is capable of working\n*/\nexports.canSave = function(wiki) {\n\treturn true;\n};\n\n/*\nCreate an instance of this saver\n*/\nexports.create = function(wiki) {\n\treturn new UploadSaver(wiki);\n};\n\n})();\n",
            "title": "$:/core/modules/savers/upload.js",
            "type": "application/javascript",
            "module-type": "saver"
        },
        "$:/core/modules/browser-messaging.js": {
            "text": "/*\\\ntitle: $:/core/modules/browser-messaging.js\ntype: application/javascript\nmodule-type: startup\n\nBrowser message handling\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n// Export name and synchronous status\nexports.name = \"browser-messaging\";\nexports.platforms = [\"browser\"];\nexports.after = [\"startup\"];\nexports.synchronous = true;\n\n/*\nLoad a specified url as an iframe and call the callback when it is loaded. If the url is already loaded then the existing iframe instance is used\n*/\nfunction loadIFrame(url,callback) {\n\t// Check if iframe already exists\n\tvar iframeInfo = $tw.browserMessaging.iframeInfoMap[url];\n\tif(iframeInfo) {\n\t\t// We've already got the iframe\n\t\tcallback(null,iframeInfo);\n\t} else {\n\t\t// Create the iframe and save it in the list\n\t\tvar iframe = document.createElement(\"iframe\");\n\t\tiframeInfo = {\n\t\t\turl: url,\n\t\t\tstatus: \"loading\",\n\t\t\tdomNode: iframe\n\t\t};\n\t\t$tw.browserMessaging.iframeInfoMap[url] = iframeInfo;\n\t\tsaveIFrameInfoTiddler(iframeInfo);\n\t\t// Add the iframe to the DOM and hide it\n\t\tiframe.style.display = \"none\";\n\t\tiframe.setAttribute(\"library\",\"true\");\n\t\tdocument.body.appendChild(iframe);\n\t\t// Set up onload\n\t\tiframe.onload = function() {\n\t\t\tiframeInfo.status = \"loaded\";\n\t\t\tsaveIFrameInfoTiddler(iframeInfo);\n\t\t\tcallback(null,iframeInfo);\n\t\t};\n\t\tiframe.onerror = function() {\n\t\t\tcallback(\"Cannot load iframe\");\n\t\t};\n\t\ttry {\n\t\t\tiframe.src = url;\n\t\t} catch(ex) {\n\t\t\tcallback(ex);\n\t\t}\n\t}\n}\n\n/*\nUnload library iframe for given url\n*/\nfunction unloadIFrame(url){\n\t$tw.utils.each(document.getElementsByTagName('iframe'), function(iframe) {\n\t\tif(iframe.getAttribute(\"library\") === \"true\" &&\n\t\t  iframe.getAttribute(\"src\") === url) {\n\t\t\tiframe.parentNode.removeChild(iframe);\n\t\t}\n\t});\n}\n\nfunction saveIFrameInfoTiddler(iframeInfo) {\n\t$tw.wiki.addTiddler(new $tw.Tiddler($tw.wiki.getCreationFields(),{\n\t\ttitle: \"$:/temp/ServerConnection/\" + iframeInfo.url,\n\t\ttext: iframeInfo.status,\n\t\ttags: [\"$:/tags/ServerConnection\"],\n\t\turl: iframeInfo.url\n\t},$tw.wiki.getModificationFields()));\n}\n\nexports.startup = function() {\n\t// Initialise the store of iframes we've created\n\t$tw.browserMessaging = {\n\t\tiframeInfoMap: {} // Hashmap by URL of {url:,status:\"loading/loaded\",domNode:}\n\t};\n\t// Listen for widget messages to control loading the plugin library\n\t$tw.rootWidget.addEventListener(\"tm-load-plugin-library\",function(event) {\n\t\tvar paramObject = event.paramObject || {},\n\t\t\turl = paramObject.url;\n\t\tif(url) {\n\t\t\tloadIFrame(url,function(err,iframeInfo) {\n\t\t\t\tif(err) {\n\t\t\t\t\talert($tw.language.getString(\"Error/LoadingPluginLibrary\") + \": \" + url);\n\t\t\t\t} else {\n\t\t\t\t\tiframeInfo.domNode.contentWindow.postMessage({\n\t\t\t\t\t\tverb: \"GET\",\n\t\t\t\t\t\turl: \"recipes/library/tiddlers.json\",\n\t\t\t\t\t\tcookies: {\n\t\t\t\t\t\t\ttype: \"save-info\",\n\t\t\t\t\t\t\tinfoTitlePrefix: paramObject.infoTitlePrefix || \"$:/temp/RemoteAssetInfo/\",\n\t\t\t\t\t\t\turl: url\n\t\t\t\t\t\t}\n\t\t\t\t\t},\"*\");\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n\t// Listen for widget messages to control unloading the plugin library\n\t$tw.rootWidget.addEventListener(\"tm-unload-plugin-library\",function(event) {\n\t\tvar paramObject = event.paramObject || {},\n\t\t\turl = paramObject.url;\n\t\t$tw.browserMessaging.iframeInfoMap[url] = undefined;\n\t\tif(url) {\n\t\t\tunloadIFrame(url);\n\t\t\t$tw.utils.each(\n\t\t\t\t$tw.wiki.filterTiddlers(\"[[$:/temp/ServerConnection/\" + url + \"]] [prefix[$:/temp/RemoteAssetInfo/\" + url + \"/]]\"),\n\t\t\t\tfunction(title) {\n\t\t\t\t\t$tw.wiki.deleteTiddler(title);\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t});\n\t$tw.rootWidget.addEventListener(\"tm-load-plugin-from-library\",function(event) {\n\t\tvar paramObject = event.paramObject || {},\n\t\t\turl = paramObject.url,\n\t\t\ttitle = paramObject.title;\n\t\tif(url && title) {\n\t\t\tloadIFrame(url,function(err,iframeInfo) {\n\t\t\t\tif(err) {\n\t\t\t\t\talert($tw.language.getString(\"Error/LoadingPluginLibrary\") + \": \" + url);\n\t\t\t\t} else {\n\t\t\t\t\tiframeInfo.domNode.contentWindow.postMessage({\n\t\t\t\t\t\tverb: \"GET\",\n\t\t\t\t\t\turl: \"recipes/library/tiddlers/\" + encodeURIComponent(title) + \".json\",\n\t\t\t\t\t\tcookies: {\n\t\t\t\t\t\t\ttype: \"save-tiddler\",\n\t\t\t\t\t\t\turl: url\n\t\t\t\t\t\t}\n\t\t\t\t\t},\"*\");\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n\t// Listen for window messages from other windows\n\twindow.addEventListener(\"message\",function listener(event){\n\t\tconsole.log(\"browser-messaging: \",document.location.toString())\n\t\tconsole.log(\"browser-messaging: Received message from\",event.origin);\n\t\tconsole.log(\"browser-messaging: Message content\",event.data);\n\t\tswitch(event.data.verb) {\n\t\t\tcase \"GET-RESPONSE\":\n\t\t\t\tif(event.data.status.charAt(0) === \"2\") {\n\t\t\t\t\tif(event.data.cookies) {\n\t\t\t\t\t\tif(event.data.cookies.type === \"save-info\") {\n\t\t\t\t\t\t\tvar tiddlers = JSON.parse(event.data.body);\n\t\t\t\t\t\t\t$tw.utils.each(tiddlers,function(tiddler) {\n\t\t\t\t\t\t\t\t$tw.wiki.addTiddler(new $tw.Tiddler($tw.wiki.getCreationFields(),tiddler,{\n\t\t\t\t\t\t\t\t\ttitle: event.data.cookies.infoTitlePrefix + event.data.cookies.url + \"/\" + tiddler.title,\n\t\t\t\t\t\t\t\t\t\"original-title\": tiddler.title,\n\t\t\t\t\t\t\t\t\ttext: \"\",\n\t\t\t\t\t\t\t\t\ttype: \"text/vnd.tiddlywiki\",\n\t\t\t\t\t\t\t\t\t\"original-type\": tiddler.type,\n\t\t\t\t\t\t\t\t\t\"plugin-type\": undefined,\n\t\t\t\t\t\t\t\t\t\"original-plugin-type\": tiddler[\"plugin-type\"],\n\t\t\t\t\t\t\t\t\t\"module-type\": undefined,\n\t\t\t\t\t\t\t\t\t\"original-module-type\": tiddler[\"module-type\"],\n\t\t\t\t\t\t\t\t\ttags: [\"$:/tags/RemoteAssetInfo\"],\n\t\t\t\t\t\t\t\t\t\"original-tags\": $tw.utils.stringifyList(tiddler.tags || []),\n\t\t\t\t\t\t\t\t\t\"server-url\": event.data.cookies.url\n\t\t\t\t\t\t\t\t},$tw.wiki.getModificationFields()));\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} else if(event.data.cookies.type === \"save-tiddler\") {\n\t\t\t\t\t\t\tvar tiddler = JSON.parse(event.data.body);\n\t\t\t\t\t\t\t$tw.wiki.addTiddler(new $tw.Tiddler(tiddler));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t},false);\n};\n\n})();\n",
            "title": "$:/core/modules/browser-messaging.js",
            "type": "application/javascript",
            "module-type": "startup"
        },
        "$:/core/modules/startup/commands.js": {
            "text": "/*\\\ntitle: $:/core/modules/startup/commands.js\ntype: application/javascript\nmodule-type: startup\n\nCommand processing\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n// Export name and synchronous status\nexports.name = \"commands\";\nexports.platforms = [\"node\"];\nexports.after = [\"story\"];\nexports.synchronous = false;\n\nexports.startup = function(callback) {\n\t// On the server, start a commander with the command line arguments\n\tvar commander = new $tw.Commander(\n\t\t$tw.boot.argv,\n\t\tfunction(err) {\n\t\t\tif(err) {\n\t\t\t\treturn $tw.utils.error(\"Error: \" + err);\n\t\t\t}\n\t\t\tcallback();\n\t\t},\n\t\t$tw.wiki,\n\t\t{output: process.stdout, error: process.stderr}\n\t);\n\tcommander.execute();\n};\n\n})();\n",
            "title": "$:/core/modules/startup/commands.js",
            "type": "application/javascript",
            "module-type": "startup"
        },
        "$:/core/modules/startup/favicon.js": {
            "text": "/*\\\ntitle: $:/core/modules/startup/favicon.js\ntype: application/javascript\nmodule-type: startup\n\nFavicon handling\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n// Export name and synchronous status\nexports.name = \"favicon\";\nexports.platforms = [\"browser\"];\nexports.after = [\"startup\"];\nexports.synchronous = true;\n\t\t\n// Favicon tiddler\nvar FAVICON_TITLE = \"$:/favicon.ico\";\n\nexports.startup = function() {\n\t// Set up the favicon\n\tsetFavicon();\n\t// Reset the favicon when the tiddler changes\n\t$tw.wiki.addEventListener(\"change\",function(changes) {\n\t\tif($tw.utils.hop(changes,FAVICON_TITLE)) {\n\t\t\tsetFavicon();\n\t\t}\n\t});\n};\n\nfunction setFavicon() {\n\tvar tiddler = $tw.wiki.getTiddler(FAVICON_TITLE);\n\tif(tiddler) {\n\t\tvar faviconLink = document.getElementById(\"faviconLink\");\n\t\tfaviconLink.setAttribute(\"href\",\"data:\" + tiddler.fields.type + \";base64,\" + tiddler.fields.text);\n\t}\n}\n\n})();\n",
            "title": "$:/core/modules/startup/favicon.js",
            "type": "application/javascript",
            "module-type": "startup"
        },
        "$:/core/modules/startup/info.js": {
            "text": "/*\\\ntitle: $:/core/modules/startup/info.js\ntype: application/javascript\nmodule-type: startup\n\nInitialise $:/info tiddlers via $:/temp/info-plugin pseudo-plugin\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n// Export name and synchronous status\nexports.name = \"info\";\nexports.before = [\"startup\"];\nexports.after = [\"load-modules\"];\nexports.synchronous = true;\n\nexports.startup = function() {\n\t// Collect up the info tiddlers\n\tvar infoTiddlerFields = {};\n\t// Give each info module a chance to fill in as many info tiddlers as they want\n\t$tw.modules.forEachModuleOfType(\"info\",function(title,moduleExports) {\n\t\tif(moduleExports && moduleExports.getInfoTiddlerFields) {\n\t\t\tvar tiddlerFieldsArray = moduleExports.getInfoTiddlerFields(infoTiddlerFields);\n\t\t\t$tw.utils.each(tiddlerFieldsArray,function(fields) {\n\t\t\t\tif(fields) {\n\t\t\t\t\tinfoTiddlerFields[fields.title] = fields;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n\t// Bake the info tiddlers into a plugin\n\tvar fields = {\n\t\ttitle: \"$:/temp/info-plugin\",\n\t\ttype: \"application/json\",\n\t\t\"plugin-type\": \"info\",\n\t\ttext: JSON.stringify({tiddlers: infoTiddlerFields},null,$tw.config.preferences.jsonSpaces)\n\t};\n\t$tw.wiki.addTiddler(new $tw.Tiddler(fields));\n\t$tw.wiki.readPluginInfo();\n\t$tw.wiki.registerPluginTiddlers(\"info\");\n\t$tw.wiki.unpackPluginTiddlers();\n};\n\n})();\n",
            "title": "$:/core/modules/startup/info.js",
            "type": "application/javascript",
            "module-type": "startup"
        },
        "$:/core/modules/startup/load-modules.js": {
            "text": "/*\\\ntitle: $:/core/modules/startup/load-modules.js\ntype: application/javascript\nmodule-type: startup\n\nLoad core modules\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n// Export name and synchronous status\nexports.name = \"load-modules\";\nexports.synchronous = true;\n\nexports.startup = function() {\n\t// Load modules\n\t$tw.modules.applyMethods(\"utils\",$tw.utils);\n\tif($tw.node) {\n\t\t$tw.modules.applyMethods(\"utils-node\",$tw.utils);\n\t}\n\t$tw.modules.applyMethods(\"global\",$tw);\n\t$tw.modules.applyMethods(\"config\",$tw.config);\n\t$tw.Tiddler.fieldModules = $tw.modules.getModulesByTypeAsHashmap(\"tiddlerfield\");\n\t$tw.modules.applyMethods(\"tiddlermethod\",$tw.Tiddler.prototype);\n\t$tw.modules.applyMethods(\"wikimethod\",$tw.Wiki.prototype);\n\t$tw.modules.applyMethods(\"tiddlerdeserializer\",$tw.Wiki.tiddlerDeserializerModules);\n\t$tw.macros = $tw.modules.getModulesByTypeAsHashmap(\"macro\");\n\t$tw.wiki.initParsers();\n\t$tw.Commander.initCommands();\n};\n\n})();\n",
            "title": "$:/core/modules/startup/load-modules.js",
            "type": "application/javascript",
            "module-type": "startup"
        },
        "$:/core/modules/startup/password.js": {
            "text": "/*\\\ntitle: $:/core/modules/startup/password.js\ntype: application/javascript\nmodule-type: startup\n\nPassword handling\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n// Export name and synchronous status\nexports.name = \"password\";\nexports.platforms = [\"browser\"];\nexports.after = [\"startup\"];\nexports.synchronous = true;\n\nexports.startup = function() {\n\t$tw.rootWidget.addEventListener(\"tm-set-password\",function(event) {\n\t\t$tw.passwordPrompt.createPrompt({\n\t\t\tserviceName: $tw.language.getString(\"Encryption/PromptSetPassword\"),\n\t\t\tnoUserName: true,\n\t\t\tsubmitText: $tw.language.getString(\"Encryption/SetPassword\"),\n\t\t\tcanCancel: true,\n\t\t\trepeatPassword: true,\n\t\t\tcallback: function(data) {\n\t\t\t\tif(data) {\n\t\t\t\t\t$tw.crypto.setPassword(data.password);\n\t\t\t\t}\n\t\t\t\treturn true; // Get rid of the password prompt\n\t\t\t}\n\t\t});\n\t});\n\t$tw.rootWidget.addEventListener(\"tm-clear-password\",function(event) {\n\t\tif($tw.browser) {\n\t\t\tif(!confirm($tw.language.getString(\"Encryption/ConfirmClearPassword\"))) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t$tw.crypto.setPassword(null);\n\t});\n\t// Ensure that $:/isEncrypted is maintained properly\n\t$tw.wiki.addEventListener(\"change\",function(changes) {\n\t\tif($tw.utils.hop(changes,\"$:/isEncrypted\")) {\n\t\t\t$tw.crypto.updateCryptoStateTiddler();\n\t\t}\n\t});\n};\n\n})();\n",
            "title": "$:/core/modules/startup/password.js",
            "type": "application/javascript",
            "module-type": "startup"
        },
        "$:/core/modules/startup/render.js": {
            "text": "/*\\\ntitle: $:/core/modules/startup/render.js\ntype: application/javascript\nmodule-type: startup\n\nTitle, stylesheet and page rendering\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n// Export name and synchronous status\nexports.name = \"render\";\nexports.platforms = [\"browser\"];\nexports.after = [\"story\"];\nexports.synchronous = true;\n\n// Default story and history lists\nvar PAGE_TITLE_TITLE = \"$:/core/wiki/title\";\nvar PAGE_STYLESHEET_TITLE = \"$:/core/ui/PageStylesheet\";\nvar PAGE_TEMPLATE_TITLE = \"$:/core/ui/PageTemplate\";\n\n// Time (in ms) that we defer refreshing changes to draft tiddlers\nvar DRAFT_TIDDLER_TIMEOUT_TITLE = \"$:/config/Drafts/TypingTimeout\";\nvar DRAFT_TIDDLER_TIMEOUT = 400;\n\nexports.startup = function() {\n\t// Set up the title\n\t$tw.titleWidgetNode = $tw.wiki.makeTranscludeWidget(PAGE_TITLE_TITLE,{document: $tw.fakeDocument, parseAsInline: true});\n\t$tw.titleContainer = $tw.fakeDocument.createElement(\"div\");\n\t$tw.titleWidgetNode.render($tw.titleContainer,null);\n\tdocument.title = $tw.titleContainer.textContent;\n\t$tw.wiki.addEventListener(\"change\",function(changes) {\n\t\tif($tw.titleWidgetNode.refresh(changes,$tw.titleContainer,null)) {\n\t\t\tdocument.title = $tw.titleContainer.textContent;\n\t\t}\n\t});\n\t// Set up the styles\n\t$tw.styleWidgetNode = $tw.wiki.makeTranscludeWidget(PAGE_STYLESHEET_TITLE,{document: $tw.fakeDocument});\n\t$tw.styleContainer = $tw.fakeDocument.createElement(\"style\");\n\t$tw.styleWidgetNode.render($tw.styleContainer,null);\n\t$tw.styleElement = document.createElement(\"style\");\n\t$tw.styleElement.innerHTML = $tw.styleContainer.textContent;\n\tdocument.head.insertBefore($tw.styleElement,document.head.firstChild);\n\t$tw.wiki.addEventListener(\"change\",$tw.perf.report(\"styleRefresh\",function(changes) {\n\t\tif($tw.styleWidgetNode.refresh(changes,$tw.styleContainer,null)) {\n\t\t\t$tw.styleElement.innerHTML = $tw.styleContainer.textContent;\n\t\t}\n\t}));\n\t// Display the $:/core/ui/PageTemplate tiddler to kick off the display\n\t$tw.perf.report(\"mainRender\",function() {\n\t\t$tw.pageWidgetNode = $tw.wiki.makeTranscludeWidget(PAGE_TEMPLATE_TITLE,{document: document, parentWidget: $tw.rootWidget});\n\t\t$tw.pageContainer = document.createElement(\"div\");\n\t\t$tw.utils.addClass($tw.pageContainer,\"tc-page-container-wrapper\");\n\t\tdocument.body.insertBefore($tw.pageContainer,document.body.firstChild);\n\t\t$tw.pageWidgetNode.render($tw.pageContainer,null);\n\t})();\n\t// Prepare refresh mechanism\n\tvar deferredChanges = Object.create(null),\n\t\ttimerId;\n\tfunction refresh() {\n\t\t// Process the refresh\n\t\t$tw.pageWidgetNode.refresh(deferredChanges);\n\t\tdeferredChanges = Object.create(null);\n\t}\n\t// Add the change event handler\n\t$tw.wiki.addEventListener(\"change\",$tw.perf.report(\"mainRefresh\",function(changes) {\n\t\t// Check if only drafts have changed\n\t\tvar onlyDraftsHaveChanged = true;\n\t\tfor(var title in changes) {\n\t\t\tvar tiddler = $tw.wiki.getTiddler(title);\n\t\t\tif(!tiddler || !tiddler.hasField(\"draft.of\")) {\n\t\t\t\tonlyDraftsHaveChanged = false;\n\t\t\t}\n\t\t}\n\t\t// Defer the change if only drafts have changed\n\t\tif(timerId) {\n\t\t\tclearTimeout(timerId);\n\t\t}\n\t\ttimerId = null;\n\t\tif(onlyDraftsHaveChanged) {\n\t\t\tvar timeout = parseInt($tw.wiki.getTiddlerText(DRAFT_TIDDLER_TIMEOUT_TITLE,\"\"),10);\n\t\t\tif(isNaN(timeout)) {\n\t\t\t\ttimeout = DRAFT_TIDDLER_TIMEOUT;\n\t\t\t}\n\t\t\ttimerId = setTimeout(refresh,timeout);\n\t\t\t$tw.utils.extend(deferredChanges,changes);\n\t\t} else {\n\t\t\t$tw.utils.extend(deferredChanges,changes);\n\t\t\trefresh();\n\t\t}\n\t}));\n\t// Fix up the link between the root widget and the page container\n\t$tw.rootWidget.domNodes = [$tw.pageContainer];\n\t$tw.rootWidget.children = [$tw.pageWidgetNode];\n};\n\n})();\n",
            "title": "$:/core/modules/startup/render.js",
            "type": "application/javascript",
            "module-type": "startup"
        },
        "$:/core/modules/startup/rootwidget.js": {
            "text": "/*\\\ntitle: $:/core/modules/startup/rootwidget.js\ntype: application/javascript\nmodule-type: startup\n\nSetup the root widget and the core root widget handlers\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n// Export name and synchronous status\nexports.name = \"rootwidget\";\nexports.platforms = [\"browser\"];\nexports.after = [\"startup\"];\nexports.before = [\"story\"];\nexports.synchronous = true;\n\nexports.startup = function() {\n\t// Install the modal message mechanism\n\t$tw.modal = new $tw.utils.Modal($tw.wiki);\n\t$tw.rootWidget.addEventListener(\"tm-modal\",function(event) {\n\t\t$tw.modal.display(event.param,{variables: event.paramObject});\n\t});\n\t// Install the notification  mechanism\n\t$tw.notifier = new $tw.utils.Notifier($tw.wiki);\n\t$tw.rootWidget.addEventListener(\"tm-notify\",function(event) {\n\t\t$tw.notifier.display(event.param,{variables: event.paramObject});\n\t});\n\t// Install the scroller\n\t$tw.pageScroller = new $tw.utils.PageScroller();\n\t$tw.rootWidget.addEventListener(\"tm-scroll\",function(event) {\n\t\t$tw.pageScroller.handleEvent(event);\n\t});\n\tvar fullscreen = $tw.utils.getFullScreenApis();\n\tif(fullscreen) {\n\t\t$tw.rootWidget.addEventListener(\"tm-full-screen\",function(event) {\n\t\t\tif(document[fullscreen._fullscreenElement]) {\n\t\t\t\tdocument[fullscreen._exitFullscreen]();\n\t\t\t} else {\n\t\t\t\tdocument.documentElement[fullscreen._requestFullscreen](Element.ALLOW_KEYBOARD_INPUT);\n\t\t\t}\n\t\t});\n\t}\n\t// If we're being viewed on a data: URI then give instructions for how to save\n\tif(document.location.protocol === \"data:\") {\n\t\t$tw.rootWidget.dispatchEvent({\n\t\t\ttype: \"tm-modal\",\n\t\t\tparam: \"$:/language/Modals/SaveInstructions\"\n\t\t});\n\t}\n};\n\n})();\n",
            "title": "$:/core/modules/startup/rootwidget.js",
            "type": "application/javascript",
            "module-type": "startup"
        },
        "$:/core/modules/startup.js": {
            "text": "/*\\\ntitle: $:/core/modules/startup.js\ntype: application/javascript\nmodule-type: startup\n\nMiscellaneous startup logic for both the client and server.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n// Export name and synchronous status\nexports.name = \"startup\";\nexports.after = [\"load-modules\"];\nexports.synchronous = true;\n\n// Set to `true` to enable performance instrumentation\nvar PERFORMANCE_INSTRUMENTATION_CONFIG_TITLE = \"$:/config/Performance/Instrumentation\";\n\nvar widget = require(\"$:/core/modules/widgets/widget.js\");\n\nexports.startup = function() {\n\tvar modules,n,m,f;\n\t// Minimal browser detection\n\tif($tw.browser) {\n\t\t$tw.browser.isIE = (/msie|trident/i.test(navigator.userAgent));\n\t\t$tw.browser.isFirefox = !!document.mozFullScreenEnabled;\n\t}\n\t// Platform detection\n\t$tw.platform = {};\n\tif($tw.browser) {\n\t\t$tw.platform.isMac = /Mac/.test(navigator.platform);\n\t\t$tw.platform.isWindows = /win/i.test(navigator.platform);\n\t\t$tw.platform.isLinux = /Linux/i.test(navigator.appVersion);\n\t} else {\n\t\tswitch(require(\"os\").platform()) {\n\t\t\tcase \"darwin\":\n\t\t\t\t$tw.platform.isMac = true;\n\t\t\t\tbreak;\n\t\t\tcase \"win32\":\n\t\t\t\t$tw.platform.isWindows = true;\n\t\t\t\tbreak;\n\t\t\tcase \"freebsd\":\n\t\t\t\t$tw.platform.isLinux = true;\n\t\t\t\tbreak;\n\t\t\tcase \"linux\":\n\t\t\t\t$tw.platform.isLinux = true;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\t// Initialise version\n\t$tw.version = $tw.utils.extractVersionInfo();\n\t// Set up the performance framework\n\t$tw.perf = new $tw.Performance($tw.wiki.getTiddlerText(PERFORMANCE_INSTRUMENTATION_CONFIG_TITLE,\"no\") === \"yes\");\n\t// Kick off the language manager and switcher\n\t$tw.language = new $tw.Language();\n\t$tw.languageSwitcher = new $tw.PluginSwitcher({\n\t\twiki: $tw.wiki,\n\t\tpluginType: \"language\",\n\t\tcontrollerTitle: \"$:/language\",\n\t\tdefaultPlugins: [\n\t\t\t\"$:/languages/en-US\"\n\t\t],\n\t\tonSwitch: function(plugins) {\n\t\t\tif($tw.browser) {\n\t\t\t\tvar pluginTiddler = $tw.wiki.getTiddler(plugins[0]);\n\t\t\t\tif(pluginTiddler) {\n\t\t\t\t\tdocument.documentElement.setAttribute(\"dir\",pluginTiddler.getFieldString(\"text-direction\") || \"auto\");\n\t\t\t\t} else {\n\t\t\t\t\tdocument.documentElement.removeAttribute(\"dir\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\t// Kick off the theme manager\n\t$tw.themeManager = new $tw.PluginSwitcher({\n\t\twiki: $tw.wiki,\n\t\tpluginType: \"theme\",\n\t\tcontrollerTitle: \"$:/theme\",\n\t\tdefaultPlugins: [\n\t\t\t\"$:/themes/tiddlywiki/snowwhite\",\n\t\t\t\"$:/themes/tiddlywiki/vanilla\"\n\t\t]\n\t});\n\t// Kick off the keyboard manager\n\t$tw.keyboardManager = new $tw.KeyboardManager();\n\t// Clear outstanding tiddler store change events to avoid an unnecessary refresh cycle at startup\n\t$tw.wiki.clearTiddlerEventQueue();\n\t// Create a root widget for attaching event handlers. By using it as the parentWidget for another widget tree, one can reuse the event handlers\n\tif($tw.browser) {\n\t\t$tw.rootWidget = new widget.widget({\n\t\t\ttype: \"widget\",\n\t\t\tchildren: []\n\t\t},{\n\t\t\twiki: $tw.wiki,\n\t\t\tdocument: document\n\t\t});\n\t}\n\t// Find a working syncadaptor\n\t$tw.syncadaptor = undefined;\n\t$tw.modules.forEachModuleOfType(\"syncadaptor\",function(title,module) {\n\t\tif(!$tw.syncadaptor && module.adaptorClass) {\n\t\t\t$tw.syncadaptor = new module.adaptorClass({wiki: $tw.wiki});\n\t\t}\n\t});\n\t// Set up the syncer object if we've got a syncadaptor\n\tif($tw.syncadaptor) {\n\t\t$tw.syncer = new $tw.Syncer({wiki: $tw.wiki, syncadaptor: $tw.syncadaptor});\n\t} \n\t// Setup the saver handler\n\t$tw.saverHandler = new $tw.SaverHandler({wiki: $tw.wiki, dirtyTracking: !$tw.syncadaptor});\n\t// Host-specific startup\n\tif($tw.browser) {\n\t\t// Install the popup manager\n\t\t$tw.popup = new $tw.utils.Popup();\n\t\t// Install the animator\n\t\t$tw.anim = new $tw.utils.Animator();\n\t}\n};\n\n})();\n",
            "title": "$:/core/modules/startup.js",
            "type": "application/javascript",
            "module-type": "startup"
        },
        "$:/core/modules/startup/story.js": {
            "text": "/*\\\ntitle: $:/core/modules/startup/story.js\ntype: application/javascript\nmodule-type: startup\n\nLoad core modules\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n// Export name and synchronous status\nexports.name = \"story\";\nexports.after = [\"startup\"];\nexports.synchronous = true;\n\n// Default story and history lists\nvar DEFAULT_STORY_TITLE = \"$:/StoryList\";\nvar DEFAULT_HISTORY_TITLE = \"$:/HistoryList\";\n\n// Default tiddlers\nvar DEFAULT_TIDDLERS_TITLE = \"$:/DefaultTiddlers\";\n\n// Config\nvar CONFIG_UPDATE_ADDRESS_BAR = \"$:/config/Navigation/UpdateAddressBar\"; // Can be \"no\", \"permalink\", \"permaview\"\nvar CONFIG_UPDATE_HISTORY = \"$:/config/Navigation/UpdateHistory\"; // Can be \"yes\" or \"no\"\n\nexports.startup = function() {\n\t// Open startup tiddlers\n\topenStartupTiddlers();\n\tif($tw.browser) {\n\t\t// Set up location hash update\n\t\t$tw.wiki.addEventListener(\"change\",function(changes) {\n\t\t\tif($tw.utils.hop(changes,DEFAULT_STORY_TITLE) || $tw.utils.hop(changes,DEFAULT_HISTORY_TITLE)) {\n\t\t\t\tupdateLocationHash({\n\t\t\t\t\tupdateAddressBar: $tw.wiki.getTiddlerText(CONFIG_UPDATE_ADDRESS_BAR,\"permaview\").trim(),\n\t\t\t\t\tupdateHistory: $tw.wiki.getTiddlerText(CONFIG_UPDATE_HISTORY,\"no\").trim()\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\t// Listen for changes to the browser location hash\n\t\twindow.addEventListener(\"hashchange\",function() {\n\t\t\tvar hash = $tw.utils.getLocationHash();\n\t\t\tif(hash !== $tw.locationHash) {\n\t\t\t\t$tw.locationHash = hash;\n\t\t\t\topenStartupTiddlers({defaultToCurrentStory: true});\n\t\t\t}\n\t\t},false);\n\t\t// Listen for the tm-browser-refresh message\n\t\t$tw.rootWidget.addEventListener(\"tm-browser-refresh\",function(event) {\n\t\t\twindow.location.reload(true);\n\t\t});\n\t\t// Listen for the tm-print message\n\t\t$tw.rootWidget.addEventListener(\"tm-print\",function(event) {\n\t\t\t(event.event.view || window).print();\n\t\t});\n\t\t// Listen for the tm-home message\n\t\t$tw.rootWidget.addEventListener(\"tm-home\",function(event) {\n\t\t\twindow.location.hash = \"\";\n\t\t\tvar storyFilter = $tw.wiki.getTiddlerText(DEFAULT_TIDDLERS_TITLE),\n\t\t\t\tstoryList = $tw.wiki.filterTiddlers(storyFilter);\n\t\t\t//invoke any hooks that might change the default story list\n\t\t\tstoryList = $tw.hooks.invokeHook(\"th-opening-default-tiddlers-list\",storyList);\n\t\t\t$tw.wiki.addTiddler({title: DEFAULT_STORY_TITLE, text: \"\", list: storyList},$tw.wiki.getModificationFields());\n\t\t\tif(storyList[0]) {\n\t\t\t\t$tw.wiki.addToHistory(storyList[0]);\t\t\t\t\n\t\t\t}\n\t\t});\n\t\t// Listen for the tm-permalink message\n\t\t$tw.rootWidget.addEventListener(\"tm-permalink\",function(event) {\n\t\t\tupdateLocationHash({\n\t\t\t\tupdateAddressBar: \"permalink\",\n\t\t\t\tupdateHistory: $tw.wiki.getTiddlerText(CONFIG_UPDATE_HISTORY,\"no\").trim(),\n\t\t\t\ttargetTiddler: event.param || event.tiddlerTitle\n\t\t\t});\n\t\t});\n\t\t// Listen for the tm-permaview message\n\t\t$tw.rootWidget.addEventListener(\"tm-permaview\",function(event) {\n\t\t\tupdateLocationHash({\n\t\t\t\tupdateAddressBar: \"permaview\",\n\t\t\t\tupdateHistory: $tw.wiki.getTiddlerText(CONFIG_UPDATE_HISTORY,\"no\").trim(),\n\t\t\t\ttargetTiddler: event.param || event.tiddlerTitle\n\t\t\t});\n\t\t});\n\t}\n};\n\n/*\nProcess the location hash to open the specified tiddlers. Options:\ndefaultToCurrentStory: If true, the current story is retained as the default, instead of opening the default tiddlers\n*/\nfunction openStartupTiddlers(options) {\n\toptions = options || {};\n\t// Work out the target tiddler and the story filter. \"null\" means \"unspecified\"\n\tvar target = null,\n\t\tstoryFilter = null;\n\tif($tw.locationHash.length > 1) {\n\t\tvar hash = $tw.locationHash.substr(1),\n\t\t\tsplit = hash.indexOf(\":\");\n\t\tif(split === -1) {\n\t\t\ttarget = decodeURIComponent(hash.trim());\n\t\t} else {\n\t\t\ttarget = decodeURIComponent(hash.substr(0,split).trim());\n\t\t\tstoryFilter = decodeURIComponent(hash.substr(split + 1).trim());\n\t\t}\n\t}\n\t// If the story wasn't specified use the current tiddlers or a blank story\n\tif(storyFilter === null) {\n\t\tif(options.defaultToCurrentStory) {\n\t\t\tvar currStoryList = $tw.wiki.getTiddlerList(DEFAULT_STORY_TITLE);\n\t\t\tstoryFilter = $tw.utils.stringifyList(currStoryList);\n\t\t} else {\n\t\t\tif(target && target !== \"\") {\n\t\t\t\tstoryFilter = \"\";\n\t\t\t} else {\n\t\t\t\tstoryFilter = $tw.wiki.getTiddlerText(DEFAULT_TIDDLERS_TITLE);\n\t\t\t}\n\t\t}\n\t}\n\t// Process the story filter to get the story list\n\tvar storyList = $tw.wiki.filterTiddlers(storyFilter);\n\t// Invoke any hooks that want to change the default story list\n\tstoryList = $tw.hooks.invokeHook(\"th-opening-default-tiddlers-list\",storyList);\n\t// If the target tiddler isn't included then splice it in at the top\n\tif(target && storyList.indexOf(target) === -1) {\n\t\tstoryList.unshift(target);\n\t}\n\t// Save the story list\n\t$tw.wiki.addTiddler({title: DEFAULT_STORY_TITLE, text: \"\", list: storyList},$tw.wiki.getModificationFields());\n\t// If a target tiddler was specified add it to the history stack\n\tif(target && target !== \"\") {\n\t\t// The target tiddler doesn't need double square brackets, but we'll silently remove them if they're present\n\t\tif(target.indexOf(\"[[\") === 0 && target.substr(-2) === \"]]\") {\n\t\t\ttarget = target.substr(2,target.length - 4);\n\t\t}\n\t\t$tw.wiki.addToHistory(target);\n\t} else if(storyList.length > 0) {\n\t\t$tw.wiki.addToHistory(storyList[0]);\n\t}\n}\n\n/*\noptions: See below\noptions.updateAddressBar: \"permalink\", \"permaview\" or \"no\" (defaults to \"permaview\")\noptions.updateHistory: \"yes\" or \"no\" (defaults to \"no\")\noptions.targetTiddler: optional title of target tiddler for permalink\n*/\nfunction updateLocationHash(options) {\n\tif(options.updateAddressBar !== \"no\") {\n\t\t// Get the story and the history stack\n\t\tvar storyList = $tw.wiki.getTiddlerList(DEFAULT_STORY_TITLE),\n\t\t\thistoryList = $tw.wiki.getTiddlerData(DEFAULT_HISTORY_TITLE,[]),\n\t\t\ttargetTiddler = \"\";\n\t\tif(options.targetTiddler) {\n\t\t\ttargetTiddler = options.targetTiddler;\n\t\t} else {\n\t\t\t// The target tiddler is the one at the top of the stack\n\t\t\tif(historyList.length > 0) {\n\t\t\t\ttargetTiddler = historyList[historyList.length-1].title;\n\t\t\t}\n\t\t\t// Blank the target tiddler if it isn't present in the story\n\t\t\tif(storyList.indexOf(targetTiddler) === -1) {\n\t\t\t\ttargetTiddler = \"\";\n\t\t\t}\n\t\t}\n\t\t// Assemble the location hash\n\t\tif(options.updateAddressBar === \"permalink\") {\n\t\t\t$tw.locationHash = \"#\" + encodeURIComponent(targetTiddler);\n\t\t} else {\n\t\t\t$tw.locationHash = \"#\" + encodeURIComponent(targetTiddler) + \":\" + encodeURIComponent($tw.utils.stringifyList(storyList));\n\t\t}\n\t\t// Only change the location hash if we must, thus avoiding unnecessary onhashchange events\n\t\tif($tw.utils.getLocationHash() !== $tw.locationHash) {\n\t\t\tif(options.updateHistory === \"yes\") {\n\t\t\t\t// Assign the location hash so that history is updated\n\t\t\t\twindow.location.hash = $tw.locationHash;\n\t\t\t} else {\n\t\t\t\t// We use replace so that browser history isn't affected\n\t\t\t\twindow.location.replace(window.location.toString().split(\"#\")[0] + $tw.locationHash);\n\t\t\t}\n\t\t}\n\t}\n}\n\n})();\n",
            "title": "$:/core/modules/startup/story.js",
            "type": "application/javascript",
            "module-type": "startup"
        },
        "$:/core/modules/startup/windows.js": {
            "text": "/*\\\ntitle: $:/core/modules/startup/windows.js\ntype: application/javascript\nmodule-type: startup\n\nSetup root widget handlers for the messages concerned with opening external browser windows\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n// Export name and synchronous status\nexports.name = \"windows\";\nexports.platforms = [\"browser\"];\nexports.after = [\"startup\"];\nexports.synchronous = true;\n\n// Global to keep track of open windows (hashmap by title)\nvar windows = {};\n\nexports.startup = function() {\n\t// Handle open window message\n\t$tw.rootWidget.addEventListener(\"tm-open-window\",function(event) {\n\t\t// Get the parameters\n\t\tvar refreshHandler,\n\t\t\ttitle = event.param || event.tiddlerTitle,\n\t\t\tparamObject = event.paramObject || {},\n\t\t\ttemplate = paramObject.template || \"$:/core/templates/single.tiddler.window\",\n\t\t\twidth = paramObject.width || \"700\",\n\t\t\theight = paramObject.height || \"600\",\n\t\t\tvariables = $tw.utils.extend({},paramObject,{currentTiddler: title});\n\t\t// Open the window\n\t\tvar srcWindow = window.open(\"\",\"external-\" + title,\"scrollbars,width=\" + width + \",height=\" + height),\n\t\t\tsrcDocument = srcWindow.document;\n\t\twindows[title] = srcWindow;\n\t\t// Check for reopening the same window\n\t\tif(srcWindow.haveInitialisedWindow) {\n\t\t\treturn;\n\t\t}\n\t\t// Initialise the document\n\t\tsrcDocument.write(\"<html><head></head><body class='tc-body tc-single-tiddler-window'></body></html>\");\n\t\tsrcDocument.close();\n\t\tsrcDocument.title = title;\n\t\tsrcWindow.addEventListener(\"beforeunload\",function(event) {\n\t\t\tdelete windows[title];\n\t\t\t$tw.wiki.removeEventListener(\"change\",refreshHandler);\n\t\t},false);\n\t\t// Set up the styles\n\t\tvar styleWidgetNode = $tw.wiki.makeTranscludeWidget(\"$:/core/ui/PageStylesheet\",{\n\t\t\t\tdocument: $tw.fakeDocument,\n\t\t\t\tvariables: variables,\n\t\t\t\timportPageMacros: true}),\n\t\t\tstyleContainer = $tw.fakeDocument.createElement(\"style\");\n\t\tstyleWidgetNode.render(styleContainer,null);\n\t\tvar styleElement = srcDocument.createElement(\"style\");\n\t\tstyleElement.innerHTML = styleContainer.textContent;\n\t\tsrcDocument.head.insertBefore(styleElement,srcDocument.head.firstChild);\n\t\t// Render the text of the tiddler\n\t\tvar parser = $tw.wiki.parseTiddler(template),\n\t\t\twidgetNode = $tw.wiki.makeWidget(parser,{document: srcDocument, parentWidget: $tw.rootWidget, variables: variables});\n\t\twidgetNode.render(srcDocument.body,srcDocument.body.firstChild);\n\t\t// Function to handle refreshes\n\t\trefreshHandler = function(changes) {\n\t\t\tif(styleWidgetNode.refresh(changes,styleContainer,null)) {\n\t\t\t\tstyleElement.innerHTML = styleContainer.textContent;\n\t\t\t}\n\t\t\twidgetNode.refresh(changes);\n\t\t};\n\t\t$tw.wiki.addEventListener(\"change\",refreshHandler);\n\t\tsrcWindow.haveInitialisedWindow = true;\n\t});\n\t// Close open windows when unloading main window\n\t$tw.addUnloadTask(function() {\n\t\t$tw.utils.each(windows,function(win) {\n\t\t\twin.close();\n\t\t});\n\t});\n\n};\n\n})();\n",
            "title": "$:/core/modules/startup/windows.js",
            "type": "application/javascript",
            "module-type": "startup"
        },
        "$:/core/modules/story.js": {
            "text": "/*\\\ntitle: $:/core/modules/story.js\ntype: application/javascript\nmodule-type: global\n\nLightweight object for managing interactions with the story and history lists.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nConstruct Story object with options:\nwiki: reference to wiki object to use to resolve tiddler titles\nstoryTitle: title of story list tiddler\nhistoryTitle: title of history list tiddler\n*/\nfunction Story(options) {\n\toptions = options || {};\n\tthis.wiki = options.wiki || $tw.wiki;\n\tthis.storyTitle = options.storyTitle || \"$:/StoryList\";\n\tthis.historyTitle = options.historyTitle || \"$:/HistoryList\";\n};\n\nStory.prototype.navigateTiddler = function(navigateTo,navigateFromTitle,navigateFromClientRect) {\n\tthis.addToStory(navigateTo,navigateFromTitle);\n\tthis.addToHistory(navigateTo,navigateFromClientRect);\n};\n\nStory.prototype.getStoryList = function() {\n\treturn this.wiki.getTiddlerList(this.storyTitle) || [];\n};\n\nStory.prototype.addToStory = function(navigateTo,navigateFromTitle,options) {\n\toptions = options || {};\n\tvar storyList = this.getStoryList();\n\t// See if the tiddler is already there\n\tvar slot = storyList.indexOf(navigateTo);\n\t// Quit if it already exists in the story river\n\tif(slot >= 0) {\n\t\treturn;\n\t}\n\t// First we try to find the position of the story element we navigated from\n\tvar fromIndex = storyList.indexOf(navigateFromTitle);\n\tif(fromIndex >= 0) {\n\t\t// The tiddler is added from inside the river\n\t\t// Determine where to insert the tiddler; Fallback is \"below\"\n\t\tswitch(options.openLinkFromInsideRiver) {\n\t\t\tcase \"top\":\n\t\t\t\tslot = 0;\n\t\t\t\tbreak;\n\t\t\tcase \"bottom\":\n\t\t\t\tslot = storyList.length;\n\t\t\t\tbreak;\n\t\t\tcase \"above\":\n\t\t\t\tslot = fromIndex;\n\t\t\t\tbreak;\n\t\t\tcase \"below\": // Intentional fall-through\n\t\t\tdefault:\n\t\t\t\tslot = fromIndex + 1;\n\t\t\t\tbreak;\n\t\t}\n\t} else {\n\t\t// The tiddler is opened from outside the river. Determine where to insert the tiddler; default is \"top\"\n\t\tif(options.openLinkFromOutsideRiver === \"bottom\") {\n\t\t\t// Insert at bottom\n\t\t\tslot = storyList.length;\n\t\t} else {\n\t\t\t// Insert at top\n\t\t\tslot = 0;\n\t\t}\n\t}\n\t// Add the tiddler\n\tstoryList.splice(slot,0,navigateTo);\n\t// Save the story\n\tthis.saveStoryList(storyList);\n};\n\nStory.prototype.saveStoryList = function(storyList) {\n\tvar storyTiddler = this.wiki.getTiddler(this.storyTitle);\n\tthis.wiki.addTiddler(new $tw.Tiddler(\n\t\tthis.wiki.getCreationFields(),\n\t\t{title: this.storyTitle},\n\t\tstoryTiddler,\n\t\t{list: storyList},\n\t\tthis.wiki.getModificationFields()\n\t));\n};\n\nStory.prototype.addToHistory = function(navigateTo,navigateFromClientRect) {\n\tvar titles = $tw.utils.isArray(navigateTo) ? navigateTo : [navigateTo];\n\t// Add a new record to the top of the history stack\n\tvar historyList = this.wiki.getTiddlerData(this.historyTitle,[]);\n\t$tw.utils.each(titles,function(title) {\n\t\thistoryList.push({title: title, fromPageRect: navigateFromClientRect});\n\t});\n\tthis.wiki.setTiddlerData(this.historyTitle,historyList,{\"current-tiddler\": titles[titles.length-1]});\n};\n\nStory.prototype.storyCloseTiddler = function(targetTitle) {\n// TBD\n};\n\nStory.prototype.storyCloseAllTiddlers = function() {\n// TBD\n};\n\nStory.prototype.storyCloseOtherTiddlers = function(targetTitle) {\n// TBD\n};\n\nStory.prototype.storyEditTiddler = function(targetTitle) {\n// TBD\n};\n\nStory.prototype.storyDeleteTiddler = function(targetTitle) {\n// TBD\n};\n\nStory.prototype.storySaveTiddler = function(targetTitle) {\n// TBD\n};\n\nStory.prototype.storyCancelTiddler = function(targetTitle) {\n// TBD\n};\n\nStory.prototype.storyNewTiddler = function(targetTitle) {\n// TBD\n};\n\nexports.Story = Story;\n\n\n})();\n",
            "title": "$:/core/modules/story.js",
            "type": "application/javascript",
            "module-type": "global"
        },
        "$:/core/modules/storyviews/classic.js": {
            "text": "/*\\\ntitle: $:/core/modules/storyviews/classic.js\ntype: application/javascript\nmodule-type: storyview\n\nViews the story as a linear sequence\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar easing = \"cubic-bezier(0.645, 0.045, 0.355, 1)\"; // From http://easings.net/#easeInOutCubic\n\nvar ClassicStoryView = function(listWidget) {\n\tthis.listWidget = listWidget;\n};\n\nClassicStoryView.prototype.navigateTo = function(historyInfo) {\n\tvar listElementIndex = this.listWidget.findListItem(0,historyInfo.title);\n\tif(listElementIndex === undefined) {\n\t\treturn;\n\t}\n\tvar listItemWidget = this.listWidget.children[listElementIndex],\n\t\ttargetElement = listItemWidget.findFirstDomNode();\n\t// Abandon if the list entry isn't a DOM element (it might be a text node)\n\tif(!(targetElement instanceof Element)) {\n\t\treturn;\n\t}\n\t// Scroll the node into view\n\tthis.listWidget.dispatchEvent({type: \"tm-scroll\", target: targetElement});\n};\n\nClassicStoryView.prototype.insert = function(widget) {\n\tvar targetElement = widget.findFirstDomNode(),\n\t\tduration = $tw.utils.getAnimationDuration();\n\t// Abandon if the list entry isn't a DOM element (it might be a text node)\n\tif(!(targetElement instanceof Element)) {\n\t\treturn;\n\t}\n\t// Get the current height of the tiddler\n\tvar computedStyle = window.getComputedStyle(targetElement),\n\t\tcurrMarginBottom = parseInt(computedStyle.marginBottom,10),\n\t\tcurrMarginTop = parseInt(computedStyle.marginTop,10),\n\t\tcurrHeight = targetElement.offsetHeight + currMarginTop;\n\t// Reset the margin once the transition is over\n\tsetTimeout(function() {\n\t\t$tw.utils.setStyle(targetElement,[\n\t\t\t{transition: \"none\"},\n\t\t\t{marginBottom: \"\"}\n\t\t]);\n\t},duration);\n\t// Set up the initial position of the element\n\t$tw.utils.setStyle(targetElement,[\n\t\t{transition: \"none\"},\n\t\t{marginBottom: (-currHeight) + \"px\"},\n\t\t{opacity: \"0.0\"}\n\t]);\n\t$tw.utils.forceLayout(targetElement);\n\t// Transition to the final position\n\t$tw.utils.setStyle(targetElement,[\n\t\t{transition: \"opacity \" + duration + \"ms \" + easing + \", \" +\n\t\t\t\t\t\"margin-bottom \" + duration + \"ms \" + easing},\n\t\t{marginBottom: currMarginBottom + \"px\"},\n\t\t{opacity: \"1.0\"}\n\t]);\n};\n\nClassicStoryView.prototype.remove = function(widget) {\n\tvar targetElement = widget.findFirstDomNode(),\n\t\tduration = $tw.utils.getAnimationDuration(),\n\t\tremoveElement = function() {\n\t\t\twidget.removeChildDomNodes();\n\t\t};\n\t// Abandon if the list entry isn't a DOM element (it might be a text node)\n\tif(!(targetElement instanceof Element)) {\n\t\tremoveElement();\n\t\treturn;\n\t}\n\t// Get the current height of the tiddler\n\tvar currWidth = targetElement.offsetWidth,\n\t\tcomputedStyle = window.getComputedStyle(targetElement),\n\t\tcurrMarginBottom = parseInt(computedStyle.marginBottom,10),\n\t\tcurrMarginTop = parseInt(computedStyle.marginTop,10),\n\t\tcurrHeight = targetElement.offsetHeight + currMarginTop;\n\t// Remove the dom nodes of the widget at the end of the transition\n\tsetTimeout(removeElement,duration);\n\t// Animate the closure\n\t$tw.utils.setStyle(targetElement,[\n\t\t{transition: \"none\"},\n\t\t{transform: \"translateX(0px)\"},\n\t\t{marginBottom:  currMarginBottom + \"px\"},\n\t\t{opacity: \"1.0\"}\n\t]);\n\t$tw.utils.forceLayout(targetElement);\n\t$tw.utils.setStyle(targetElement,[\n\t\t{transition: $tw.utils.roundTripPropertyName(\"transform\") + \" \" + duration + \"ms \" + easing + \", \" +\n\t\t\t\t\t\"opacity \" + duration + \"ms \" + easing + \", \" +\n\t\t\t\t\t\"margin-bottom \" + duration + \"ms \" + easing},\n\t\t{transform: \"translateX(-\" + currWidth + \"px)\"},\n\t\t{marginBottom: (-currHeight) + \"px\"},\n\t\t{opacity: \"0.0\"}\n\t]);\n};\n\nexports.classic = ClassicStoryView;\n\n})();",
            "title": "$:/core/modules/storyviews/classic.js",
            "type": "application/javascript",
            "module-type": "storyview"
        },
        "$:/core/modules/storyviews/pop.js": {
            "text": "/*\\\ntitle: $:/core/modules/storyviews/pop.js\ntype: application/javascript\nmodule-type: storyview\n\nAnimates list insertions and removals\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar PopStoryView = function(listWidget) {\n\tthis.listWidget = listWidget;\n};\n\nPopStoryView.prototype.navigateTo = function(historyInfo) {\n\tvar listElementIndex = this.listWidget.findListItem(0,historyInfo.title);\n\tif(listElementIndex === undefined) {\n\t\treturn;\n\t}\n\tvar listItemWidget = this.listWidget.children[listElementIndex],\n\t\ttargetElement = listItemWidget.findFirstDomNode();\n\t// Abandon if the list entry isn't a DOM element (it might be a text node)\n\tif(!(targetElement instanceof Element)) {\n\t\treturn;\n\t}\n\t// Scroll the node into view\n\tthis.listWidget.dispatchEvent({type: \"tm-scroll\", target: targetElement});\n};\n\nPopStoryView.prototype.insert = function(widget) {\n\tvar targetElement = widget.findFirstDomNode(),\n\t\tduration = $tw.utils.getAnimationDuration();\n\t// Abandon if the list entry isn't a DOM element (it might be a text node)\n\tif(!(targetElement instanceof Element)) {\n\t\treturn;\n\t}\n\t// Reset once the transition is over\n\tsetTimeout(function() {\n\t\t$tw.utils.setStyle(targetElement,[\n\t\t\t{transition: \"none\"},\n\t\t\t{transform: \"none\"}\n\t\t]);\n\t},duration);\n\t// Set up the initial position of the element\n\t$tw.utils.setStyle(targetElement,[\n\t\t{transition: \"none\"},\n\t\t{transform: \"scale(2)\"},\n\t\t{opacity: \"0.0\"}\n\t]);\n\t$tw.utils.forceLayout(targetElement);\n\t// Transition to the final position\n\t$tw.utils.setStyle(targetElement,[\n\t\t{transition: $tw.utils.roundTripPropertyName(\"transform\") + \" \" + duration + \"ms ease-in-out, \" +\n\t\t\t\t\t\"opacity \" + duration + \"ms ease-in-out\"},\n\t\t{transform: \"scale(1)\"},\n\t\t{opacity: \"1.0\"}\n\t]);\n};\n\nPopStoryView.prototype.remove = function(widget) {\n\tvar targetElement = widget.findFirstDomNode(),\n\t\tduration = $tw.utils.getAnimationDuration(),\n\t\tremoveElement = function() {\n\t\t\tif(targetElement.parentNode) {\n\t\t\t\twidget.removeChildDomNodes();\n\t\t\t}\n\t\t};\n\t// Abandon if the list entry isn't a DOM element (it might be a text node)\n\tif(!(targetElement instanceof Element)) {\n\t\tremoveElement();\n\t\treturn;\n\t}\n\t// Remove the element at the end of the transition\n\tsetTimeout(removeElement,duration);\n\t// Animate the closure\n\t$tw.utils.setStyle(targetElement,[\n\t\t{transition: \"none\"},\n\t\t{transform: \"scale(1)\"},\n\t\t{opacity: \"1.0\"}\n\t]);\n\t$tw.utils.forceLayout(targetElement);\n\t$tw.utils.setStyle(targetElement,[\n\t\t{transition: $tw.utils.roundTripPropertyName(\"transform\") + \" \" + duration + \"ms ease-in-out, \" +\n\t\t\t\t\t\"opacity \" + duration + \"ms ease-in-out\"},\n\t\t{transform: \"scale(0.1)\"},\n\t\t{opacity: \"0.0\"}\n\t]);\n};\n\nexports.pop = PopStoryView;\n\n})();\n",
            "title": "$:/core/modules/storyviews/pop.js",
            "type": "application/javascript",
            "module-type": "storyview"
        },
        "$:/core/modules/storyviews/zoomin.js": {
            "text": "/*\\\ntitle: $:/core/modules/storyviews/zoomin.js\ntype: application/javascript\nmodule-type: storyview\n\nZooms between individual tiddlers\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar easing = \"cubic-bezier(0.645, 0.045, 0.355, 1)\"; // From http://easings.net/#easeInOutCubic\n\nvar ZoominListView = function(listWidget) {\n\tvar self = this;\n\tthis.listWidget = listWidget;\n\t// Get the index of the tiddler that is at the top of the history\n\tvar history = this.listWidget.wiki.getTiddlerDataCached(this.listWidget.historyTitle,[]),\n\t\ttargetTiddler;\n\tif(history.length > 0) {\n\t\ttargetTiddler = history[history.length-1].title;\n\t}\n\t// Make all the tiddlers position absolute, and hide all but the top (or first) one\n\t$tw.utils.each(this.listWidget.children,function(itemWidget,index) {\n\t\tvar domNode = itemWidget.findFirstDomNode();\n\t\t// Abandon if the list entry isn't a DOM element (it might be a text node)\n\t\tif(!(domNode instanceof Element)) {\n\t\t\treturn;\n\t\t}\n\t\tif((targetTiddler && targetTiddler !== itemWidget.parseTreeNode.itemTitle) || (!targetTiddler && index)) {\n\t\t\tdomNode.style.display = \"none\";\n\t\t} else {\n\t\t\tself.currentTiddlerDomNode = domNode;\n\t\t}\n\t\t$tw.utils.addClass(domNode,\"tc-storyview-zoomin-tiddler\");\n\t});\n};\n\nZoominListView.prototype.navigateTo = function(historyInfo) {\n\tvar duration = $tw.utils.getAnimationDuration(),\n\t\tlistElementIndex = this.listWidget.findListItem(0,historyInfo.title);\n\tif(listElementIndex === undefined) {\n\t\treturn;\n\t}\n\tvar listItemWidget = this.listWidget.children[listElementIndex],\n\t\ttargetElement = listItemWidget.findFirstDomNode();\n\t// Abandon if the list entry isn't a DOM element (it might be a text node)\n\tif(!(targetElement instanceof Element)) {\n\t\treturn;\n\t}\n\t// Make the new tiddler be position absolute and visible so that we can measure it\n\t$tw.utils.addClass(targetElement,\"tc-storyview-zoomin-tiddler\");\n\t$tw.utils.setStyle(targetElement,[\n\t\t{display: \"block\"},\n\t\t{transformOrigin: \"0 0\"},\n\t\t{transform: \"translateX(0px) translateY(0px) scale(1)\"},\n\t\t{transition: \"none\"},\n\t\t{opacity: \"0.0\"}\n\t]);\n\t// Get the position of the source node, or use the centre of the window as the source position\n\tvar sourceBounds = historyInfo.fromPageRect || {\n\t\t\tleft: window.innerWidth/2 - 2,\n\t\t\ttop: window.innerHeight/2 - 2,\n\t\t\twidth: window.innerWidth/8,\n\t\t\theight: window.innerHeight/8\n\t\t};\n\t// Try to find the title node in the target tiddler\n\tvar titleDomNode = findTitleDomNode(listItemWidget) || listItemWidget.findFirstDomNode(),\n\t\tzoomBounds = titleDomNode.getBoundingClientRect();\n\t// Compute the transform for the target tiddler to make the title lie over the source rectange\n\tvar targetBounds = targetElement.getBoundingClientRect(),\n\t\tscale = sourceBounds.width / zoomBounds.width,\n\t\tx = sourceBounds.left - targetBounds.left - (zoomBounds.left - targetBounds.left) * scale,\n\t\ty = sourceBounds.top - targetBounds.top - (zoomBounds.top - targetBounds.top) * scale;\n\t// Transform the target tiddler to its starting position\n\t$tw.utils.setStyle(targetElement,[\n\t\t{transform: \"translateX(\" + x + \"px) translateY(\" + y + \"px) scale(\" + scale + \")\"}\n\t]);\n\t// Force layout\n\t$tw.utils.forceLayout(targetElement);\n\t// Apply the ending transitions with a timeout to ensure that the previously applied transformations are applied first\n\tvar self = this,\n\t\tprevCurrentTiddler = this.currentTiddlerDomNode;\n\tthis.currentTiddlerDomNode = targetElement;\n\t// Transform the target tiddler to its natural size\n\t$tw.utils.setStyle(targetElement,[\n\t\t{transition: $tw.utils.roundTripPropertyName(\"transform\") + \" \" + duration + \"ms \" + easing + \", opacity \" + duration + \"ms \" + easing},\n\t\t{opacity: \"1.0\"},\n\t\t{transform: \"translateX(0px) translateY(0px) scale(1)\"},\n\t\t{zIndex: \"500\"},\n\t]);\n\t// Transform the previous tiddler out of the way and then hide it\n\tif(prevCurrentTiddler && prevCurrentTiddler !== targetElement) {\n\t\tscale = zoomBounds.width / sourceBounds.width;\n\t\tx =  zoomBounds.left - targetBounds.left - (sourceBounds.left - targetBounds.left) * scale;\n\t\ty =  zoomBounds.top - targetBounds.top - (sourceBounds.top - targetBounds.top) * scale;\n\t\t$tw.utils.setStyle(prevCurrentTiddler,[\n\t\t\t{transition: $tw.utils.roundTripPropertyName(\"transform\") + \" \" + duration + \"ms \" + easing + \", opacity \" + duration + \"ms \" + easing},\n\t\t\t{opacity: \"0.0\"},\n\t\t\t{transformOrigin: \"0 0\"},\n\t\t\t{transform: \"translateX(\" + x + \"px) translateY(\" + y + \"px) scale(\" + scale + \")\"},\n\t\t\t{zIndex: \"0\"}\n\t\t]);\n\t\t// Hide the tiddler when the transition has finished\n\t\tsetTimeout(function() {\n\t\t\tif(self.currentTiddlerDomNode !== prevCurrentTiddler) {\n\t\t\t\tprevCurrentTiddler.style.display = \"none\";\n\t\t\t}\n\t\t},duration);\n\t}\n\t// Scroll the target into view\n//\t$tw.pageScroller.scrollIntoView(targetElement);\n};\n\n/*\nFind the first child DOM node of a widget that has the class \"tc-title\"\n*/\nfunction findTitleDomNode(widget,targetClass) {\n\ttargetClass = targetClass || \"tc-title\";\n\tvar domNode = widget.findFirstDomNode();\n\tif(domNode && domNode.querySelector) {\n\t\treturn domNode.querySelector(\".\" + targetClass);\n\t}\n\treturn null;\n}\n\nZoominListView.prototype.insert = function(widget) {\n\tvar targetElement = widget.findFirstDomNode();\n\t// Abandon if the list entry isn't a DOM element (it might be a text node)\n\tif(!(targetElement instanceof Element)) {\n\t\treturn;\n\t}\n\t// Make the newly inserted node position absolute and hidden\n\t$tw.utils.addClass(targetElement,\"tc-storyview-zoomin-tiddler\");\n\t$tw.utils.setStyle(targetElement,[\n\t\t{display: \"none\"}\n\t]);\n};\n\nZoominListView.prototype.remove = function(widget) {\n\tvar targetElement = widget.findFirstDomNode(),\n\t\tduration = $tw.utils.getAnimationDuration(),\n\t\tremoveElement = function() {\n\t\t\twidget.removeChildDomNodes();\n\t\t};\n\t// Abandon if the list entry isn't a DOM element (it might be a text node)\n\tif(!(targetElement instanceof Element)) {\n\t\tremoveElement();\n\t\treturn;\n\t}\n\t// Abandon if hidden\n\tif(targetElement.style.display != \"block\" ) {\n\t\tremoveElement();\n\t\treturn;\n\t}\n\t// Set up the tiddler that is being closed\n\t$tw.utils.addClass(targetElement,\"tc-storyview-zoomin-tiddler\");\n\t$tw.utils.setStyle(targetElement,[\n\t\t{display: \"block\"},\n\t\t{transformOrigin: \"50% 50%\"},\n\t\t{transform: \"translateX(0px) translateY(0px) scale(1)\"},\n\t\t{transition: \"none\"},\n\t\t{zIndex: \"0\"}\n\t]);\n\t// We'll move back to the previous or next element in the story\n\tvar toWidget = widget.previousSibling();\n\tif(!toWidget) {\n\t\ttoWidget = widget.nextSibling();\n\t}\n\tvar toWidgetDomNode = toWidget && toWidget.findFirstDomNode();\n\t// Set up the tiddler we're moving back in\n\tif(toWidgetDomNode) {\n\t\t$tw.utils.addClass(toWidgetDomNode,\"tc-storyview-zoomin-tiddler\");\n\t\t$tw.utils.setStyle(toWidgetDomNode,[\n\t\t\t{display: \"block\"},\n\t\t\t{transformOrigin: \"50% 50%\"},\n\t\t\t{transform: \"translateX(0px) translateY(0px) scale(10)\"},\n\t\t\t{transition: $tw.utils.roundTripPropertyName(\"transform\") + \" \" + duration + \"ms \" + easing + \", opacity \" + duration + \"ms \" + easing},\n\t\t\t{opacity: \"0\"},\n\t\t\t{zIndex: \"500\"}\n\t\t]);\n\t\tthis.currentTiddlerDomNode = toWidgetDomNode;\n\t}\n\t// Animate them both\n\t// Force layout\n\t$tw.utils.forceLayout(this.listWidget.parentDomNode);\n\t// First, the tiddler we're closing\n\t$tw.utils.setStyle(targetElement,[\n\t\t{transformOrigin: \"50% 50%\"},\n\t\t{transform: \"translateX(0px) translateY(0px) scale(0.1)\"},\n\t\t{transition: $tw.utils.roundTripPropertyName(\"transform\") + \" \" + duration + \"ms \" + easing + \", opacity \" + duration + \"ms \" + easing},\n\t\t{opacity: \"0\"},\n\t\t{zIndex: \"0\"}\n\t]);\n\tsetTimeout(removeElement,duration);\n\t// Now the tiddler we're going back to\n\tif(toWidgetDomNode) {\n\t\t$tw.utils.setStyle(toWidgetDomNode,[\n\t\t\t{transform: \"translateX(0px) translateY(0px) scale(1)\"},\n\t\t\t{opacity: \"1\"}\n\t\t]);\n\t}\n\treturn true; // Indicate that we'll delete the DOM node\n};\n\nexports.zoomin = ZoominListView;\n\n})();\n",
            "title": "$:/core/modules/storyviews/zoomin.js",
            "type": "application/javascript",
            "module-type": "storyview"
        },
        "$:/core/modules/syncer.js": {
            "text": "/*\\\ntitle: $:/core/modules/syncer.js\ntype: application/javascript\nmodule-type: global\n\nThe syncer tracks changes to the store. If a syncadaptor is used then individual tiddlers are synchronised through it. If there is no syncadaptor then the entire wiki is saved via saver modules.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nDefaults\n*/\nSyncer.prototype.titleIsLoggedIn = \"$:/status/IsLoggedIn\";\nSyncer.prototype.titleUserName = \"$:/status/UserName\";\nSyncer.prototype.titleSyncFilter = \"$:/config/SyncFilter\";\nSyncer.prototype.titleSavedNotification = \"$:/language/Notifications/Save/Done\";\nSyncer.prototype.taskTimerInterval = 1 * 1000; // Interval for sync timer\nSyncer.prototype.throttleInterval = 1 * 1000; // Defer saving tiddlers if they've changed in the last 1s...\nSyncer.prototype.fallbackInterval = 10 * 1000; // Unless the task is older than 10s\nSyncer.prototype.pollTimerInterval = 60 * 1000; // Interval for polling for changes from the adaptor\n\n/*\nInstantiate the syncer with the following options:\nsyncadaptor: reference to syncadaptor to be used\nwiki: wiki to be synced\n*/\nfunction Syncer(options) {\n\tvar self = this;\n\tthis.wiki = options.wiki;\n\tthis.syncadaptor = options.syncadaptor;\n\tthis.titleIsLoggedIn = options.titleIsLoggedIn || this.titleIsLoggedIn;\n\tthis.titleUserName = options.titleUserName || this.titleUserName;\n\tthis.titleSyncFilter = options.titleSyncFilter || this.titleSyncFilter;\n\tthis.titleSavedNotification = options.titleSavedNotification || this.titleSavedNotification;\n\tthis.taskTimerInterval = options.taskTimerInterval || this.taskTimerInterval;\n\tthis.throttleInterval = options.throttleInterval || this.throttleInterval;\n\tthis.fallbackInterval = options.fallbackInterval || this.fallbackInterval;\n\tthis.pollTimerInterval = options.pollTimerInterval || this.pollTimerInterval;\n\t// Make a logger\n\tthis.logger = new $tw.utils.Logger(\"syncer\" + ($tw.browser ? \"-browser\" : \"\") + ($tw.node ? \"-server\" : \"\")  + (this.syncadaptor.name ? (\"-\" + this.syncadaptor.name) : \"\"));\n\t// Compile the dirty tiddler filter\n\tthis.filterFn = this.wiki.compileFilter(this.wiki.getTiddlerText(this.titleSyncFilter));\n\t// Record information for known tiddlers\n\tthis.readTiddlerInfo();\n\t// Tasks are {type: \"load\"/\"save\"/\"delete\", title:, queueTime:, lastModificationTime:}\n\tthis.taskQueue = {}; // Hashmap of tasks yet to be performed\n\tthis.taskInProgress = {}; // Hash of tasks in progress\n\tthis.taskTimerId = null; // Timer for task dispatch\n\tthis.pollTimerId = null; // Timer for polling server\n\t// Listen out for changes to tiddlers\n\tthis.wiki.addEventListener(\"change\",function(changes) {\n\t\tself.syncToServer(changes);\n\t});\n\t// Browser event handlers\n\tif($tw.browser) {\n\t\t// Set up our beforeunload handler\n\t\t$tw.addUnloadTask(function(event) {\n\t\t\tvar confirmationMessage;\n\t\t\tif(self.isDirty()) {\n\t\t\t\tconfirmationMessage = $tw.language.getString(\"UnsavedChangesWarning\");\n\t\t\t\tevent.returnValue = confirmationMessage; // Gecko\n\t\t\t}\n\t\t\treturn confirmationMessage;\n\t\t});\n\t\t// Listen out for login/logout/refresh events in the browser\n\t\t$tw.rootWidget.addEventListener(\"tm-login\",function() {\n\t\t\tself.handleLoginEvent();\n\t\t});\n\t\t$tw.rootWidget.addEventListener(\"tm-logout\",function() {\n\t\t\tself.handleLogoutEvent();\n\t\t});\n\t\t$tw.rootWidget.addEventListener(\"tm-server-refresh\",function() {\n\t\t\tself.handleRefreshEvent();\n\t\t});\n\t}\n\t// Listen out for lazyLoad events\n\tthis.wiki.addEventListener(\"lazyLoad\",function(title) {\n\t\tself.handleLazyLoadEvent(title);\n\t});\n\t// Get the login status\n\tthis.getStatus(function(err,isLoggedIn) {\n\t\t// Do a sync from the server\n\t\tself.syncFromServer();\n\t});\n}\n\n/*\nRead (or re-read) the latest tiddler info from the store\n*/\nSyncer.prototype.readTiddlerInfo = function() {\n\t// Hashmap by title of {revision:,changeCount:,adaptorInfo:}\n\tthis.tiddlerInfo = {};\n\t// Record information for known tiddlers\n\tvar self = this,\n\t\ttiddlers = this.filterFn.call(this.wiki);\n\t$tw.utils.each(tiddlers,function(title) {\n\t\tvar tiddler = self.wiki.getTiddler(title);\n\t\tself.tiddlerInfo[title] = {\n\t\t\trevision: tiddler.fields.revision,\n\t\t\tadaptorInfo: self.syncadaptor && self.syncadaptor.getTiddlerInfo(tiddler),\n\t\t\tchangeCount: self.wiki.getChangeCount(title),\n\t\t\thasBeenLazyLoaded: false\n\t\t};\n\t});\n};\n\n/*\nCreate an tiddlerInfo structure if it doesn't already exist\n*/\nSyncer.prototype.createTiddlerInfo = function(title) {\n\tif(!$tw.utils.hop(this.tiddlerInfo,title)) {\n\t\tthis.tiddlerInfo[title] = {\n\t\t\trevision: null,\n\t\t\tadaptorInfo: {},\n\t\t\tchangeCount: -1,\n\t\t\thasBeenLazyLoaded: false\n\t\t};\n\t}\n};\n\n/*\nChecks whether the wiki is dirty (ie the window shouldn't be closed)\n*/\nSyncer.prototype.isDirty = function() {\n\treturn (this.numTasksInQueue() > 0) || (this.numTasksInProgress() > 0);\n};\n\n/*\nUpdate the document body with the class \"tc-dirty\" if the wiki has unsaved/unsynced changes\n*/\nSyncer.prototype.updateDirtyStatus = function() {\n\tif($tw.browser) {\n\t\t$tw.utils.toggleClass(document.body,\"tc-dirty\",this.isDirty());\n\t}\n};\n\n/*\nSave an incoming tiddler in the store, and updates the associated tiddlerInfo\n*/\nSyncer.prototype.storeTiddler = function(tiddlerFields,hasBeenLazyLoaded) {\n\t// Save the tiddler\n\tvar tiddler = new $tw.Tiddler(this.wiki.getTiddler(tiddlerFields.title),tiddlerFields);\n\tthis.wiki.addTiddler(tiddler);\n\t// Save the tiddler revision and changeCount details\n\tthis.tiddlerInfo[tiddlerFields.title] = {\n\t\trevision: tiddlerFields.revision,\n\t\tadaptorInfo: this.syncadaptor.getTiddlerInfo(tiddler),\n\t\tchangeCount: this.wiki.getChangeCount(tiddlerFields.title),\n\t\thasBeenLazyLoaded: hasBeenLazyLoaded !== undefined ? hasBeenLazyLoaded : true\n\t};\n};\n\nSyncer.prototype.getStatus = function(callback) {\n\tvar self = this;\n\t// Check if the adaptor supports getStatus()\n\tif(this.syncadaptor && this.syncadaptor.getStatus) {\n\t\t// Mark us as not logged in\n\t\tthis.wiki.addTiddler({title: this.titleIsLoggedIn,text: \"no\"});\n\t\t// Get login status\n\t\tthis.syncadaptor.getStatus(function(err,isLoggedIn,username) {\n\t\t\tif(err) {\n\t\t\t\tself.logger.alert(err);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Set the various status tiddlers\n\t\t\tself.wiki.addTiddler({title: self.titleIsLoggedIn,text: isLoggedIn ? \"yes\" : \"no\"});\n\t\t\tif(isLoggedIn) {\n\t\t\t\tself.wiki.addTiddler({title: self.titleUserName,text: username || \"\"});\n\t\t\t} else {\n\t\t\t\tself.wiki.deleteTiddler(self.titleUserName);\n\t\t\t}\n\t\t\t// Invoke the callback\n\t\t\tif(callback) {\n\t\t\t\tcallback(err,isLoggedIn,username);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tcallback(null,true,\"UNAUTHENTICATED\");\n\t}\n};\n\n/*\nSynchronise from the server by reading the skinny tiddler list and queuing up loads for any tiddlers that we don't already have up to date\n*/\nSyncer.prototype.syncFromServer = function() {\n\tif(this.syncadaptor && this.syncadaptor.getSkinnyTiddlers) {\n\t\tthis.logger.log(\"Retrieving skinny tiddler list\");\n\t\tvar self = this;\n\t\tif(this.pollTimerId) {\n\t\t\tclearTimeout(this.pollTimerId);\n\t\t\tthis.pollTimerId = null;\n\t\t}\n\t\tthis.syncadaptor.getSkinnyTiddlers(function(err,tiddlers) {\n\t\t\t// Trigger the next sync\n\t\t\tself.pollTimerId = setTimeout(function() {\n\t\t\t\tself.pollTimerId = null;\n\t\t\t\tself.syncFromServer.call(self);\n\t\t\t},self.pollTimerInterval);\n\t\t\t// Check for errors\n\t\t\tif(err) {\n\t\t\t\tself.logger.alert($tw.language.getString(\"Error/RetrievingSkinny\") + \":\",err);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Process each incoming tiddler\n\t\t\tfor(var t=0; t<tiddlers.length; t++) {\n\t\t\t\t// Get the incoming tiddler fields, and the existing tiddler\n\t\t\t\tvar tiddlerFields = tiddlers[t],\n\t\t\t\t\tincomingRevision = tiddlerFields.revision + \"\",\n\t\t\t\t\ttiddler = self.wiki.getTiddler(tiddlerFields.title),\n\t\t\t\t\ttiddlerInfo = self.tiddlerInfo[tiddlerFields.title],\n\t\t\t\t\tcurrRevision = tiddlerInfo ? tiddlerInfo.revision : null;\n\t\t\t\t// Ignore the incoming tiddler if it's the same as the revision we've already got\n\t\t\t\tif(currRevision !== incomingRevision) {\n\t\t\t\t\t// Do a full load if we've already got a fat version of the tiddler\n\t\t\t\t\tif(tiddler && tiddler.fields.text !== undefined) {\n\t\t\t\t\t\t// Do a full load of this tiddler\n\t\t\t\t\t\tself.enqueueSyncTask({\n\t\t\t\t\t\t\ttype: \"load\",\n\t\t\t\t\t\t\ttitle: tiddlerFields.title\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Load the skinny version of the tiddler\n\t\t\t\t\t\tself.storeTiddler(tiddlerFields,false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n};\n\n/*\nSynchronise a set of changes to the server\n*/\nSyncer.prototype.syncToServer = function(changes) {\n\tvar self = this,\n\t\tnow = Date.now(),\n\t\tfilteredChanges = this.filterFn.call(this.wiki,function(callback) {\n\t\t\t$tw.utils.each(changes,function(change,title) {\n\t\t\t\tvar tiddler = self.wiki.getTiddler(title);\n\t\t\t\tcallback(tiddler,title);\n\t\t\t});\n\t\t});\n\t$tw.utils.each(changes,function(change,title,object) {\n\t\t// Process the change if it is a deletion of a tiddler we're already syncing, or is on the filtered change list\n\t\tif((change.deleted && $tw.utils.hop(self.tiddlerInfo,title)) || filteredChanges.indexOf(title) !== -1) {\n\t\t\t// Queue a task to sync this tiddler\n\t\t\tself.enqueueSyncTask({\n\t\t\t\ttype: change.deleted ? \"delete\" : \"save\",\n\t\t\t\ttitle: title\n\t\t\t});\n\t\t}\n\t});\n};\n\n/*\nLazily load a skinny tiddler if we can\n*/\nSyncer.prototype.handleLazyLoadEvent = function(title) {\n\t// Don't lazy load the same tiddler twice\n\tvar info = this.tiddlerInfo[title];\n\tif(!info || !info.hasBeenLazyLoaded) {\n\t\tthis.createTiddlerInfo(title);\n\t\tthis.tiddlerInfo[title].hasBeenLazyLoaded = true;\n\t\t// Queue up a sync task to load this tiddler\n\t\tthis.enqueueSyncTask({\n\t\t\ttype: \"load\",\n\t\t\ttitle: title\n\t\t});\t\t\n\t}\n};\n\n/*\nDispay a password prompt and allow the user to login\n*/\nSyncer.prototype.handleLoginEvent = function() {\n\tvar self = this;\n\tthis.getStatus(function(err,isLoggedIn,username) {\n\t\tif(!isLoggedIn) {\n\t\t\t$tw.passwordPrompt.createPrompt({\n\t\t\t\tserviceName: $tw.language.getString(\"LoginToTiddlySpace\"),\n\t\t\t\tcallback: function(data) {\n\t\t\t\t\tself.login(data.username,data.password,function(err,isLoggedIn) {\n\t\t\t\t\t\tself.syncFromServer();\n\t\t\t\t\t});\n\t\t\t\t\treturn true; // Get rid of the password prompt\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n};\n\n/*\nAttempt to login to TiddlyWeb.\n\tusername: username\n\tpassword: password\n\tcallback: invoked with arguments (err,isLoggedIn)\n*/\nSyncer.prototype.login = function(username,password,callback) {\n\tthis.logger.log(\"Attempting to login as\",username);\n\tvar self = this;\n\tif(this.syncadaptor.login) {\n\t\tthis.syncadaptor.login(username,password,function(err) {\n\t\t\tif(err) {\n\t\t\t\treturn callback(err);\n\t\t\t}\n\t\t\tself.getStatus(function(err,isLoggedIn,username) {\n\t\t\t\tif(callback) {\n\t\t\t\t\tcallback(null,isLoggedIn);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t} else {\n\t\tcallback(null,true);\n\t}\n};\n\n/*\nAttempt to log out of TiddlyWeb\n*/\nSyncer.prototype.handleLogoutEvent = function() {\n\tthis.logger.log(\"Attempting to logout\");\n\tvar self = this;\n\tif(this.syncadaptor.logout) {\n\t\tthis.syncadaptor.logout(function(err) {\n\t\t\tif(err) {\n\t\t\t\tself.logger.alert(err);\n\t\t\t} else {\n\t\t\t\tself.getStatus();\n\t\t\t}\n\t\t});\n\t}\n};\n\n/*\nImmediately refresh from the server\n*/\nSyncer.prototype.handleRefreshEvent = function() {\n\tthis.syncFromServer();\n};\n\n/*\nQueue up a sync task. If there is already a pending task for the tiddler, just update the last modification time\n*/\nSyncer.prototype.enqueueSyncTask = function(task) {\n\tvar self = this,\n\t\tnow = Date.now();\n\t// Set the timestamps on this task\n\ttask.queueTime = now;\n\ttask.lastModificationTime = now;\n\t// Fill in some tiddlerInfo if the tiddler is one we haven't seen before\n\tthis.createTiddlerInfo(task.title);\n\t// Bail if this is a save and the tiddler is already at the changeCount that the server has\n\tif(task.type === \"save\" && this.wiki.getChangeCount(task.title) <= this.tiddlerInfo[task.title].changeCount) {\n\t\treturn;\n\t}\n\t// Check if this tiddler is already in the queue\n\tif($tw.utils.hop(this.taskQueue,task.title)) {\n\t\t// this.logger.log(\"Re-queueing up sync task with type:\",task.type,\"title:\",task.title);\n\t\tvar existingTask = this.taskQueue[task.title];\n\t\t// If so, just update the last modification time\n\t\texistingTask.lastModificationTime = task.lastModificationTime;\n\t\t// If the new task is a save then we upgrade the existing task to a save. Thus a pending load is turned into a save if the tiddler changes locally in the meantime. But a pending save is not modified to become a load\n\t\tif(task.type === \"save\" || task.type === \"delete\") {\n\t\t\texistingTask.type = task.type;\n\t\t}\n\t} else {\n\t\t// this.logger.log(\"Queuing up sync task with type:\",task.type,\"title:\",task.title);\n\t\t// If it is not in the queue, insert it\n\t\tthis.taskQueue[task.title] = task;\n\t\tthis.updateDirtyStatus();\n\t}\n\t// Process the queue\n\t$tw.utils.nextTick(function() {self.processTaskQueue.call(self);});\n};\n\n/*\nReturn the number of tasks in progress\n*/\nSyncer.prototype.numTasksInProgress = function() {\n\treturn $tw.utils.count(this.taskInProgress);\n};\n\n/*\nReturn the number of tasks in the queue\n*/\nSyncer.prototype.numTasksInQueue = function() {\n\treturn $tw.utils.count(this.taskQueue);\n};\n\n/*\nTrigger a timeout if one isn't already outstanding\n*/\nSyncer.prototype.triggerTimeout = function() {\n\tvar self = this;\n\tif(!this.taskTimerId) {\n\t\tthis.taskTimerId = setTimeout(function() {\n\t\t\tself.taskTimerId = null;\n\t\t\tself.processTaskQueue.call(self);\n\t\t},self.taskTimerInterval);\n\t}\n};\n\n/*\nProcess the task queue, performing the next task if appropriate\n*/\nSyncer.prototype.processTaskQueue = function() {\n\tvar self = this;\n\t// Only process a task if the sync adaptor is fully initialised and we're not already performing a task. If we are already performing a task then we'll dispatch the next one when it completes\n\tif((!this.syncadaptor.isReady || this.syncadaptor.isReady()) && this.numTasksInProgress() === 0) {\n\t\t// Choose the next task to perform\n\t\tvar task = this.chooseNextTask();\n\t\t// Perform the task if we had one\n\t\tif(task) {\n\t\t\t// Remove the task from the queue and add it to the in progress list\n\t\t\tdelete this.taskQueue[task.title];\n\t\t\tthis.taskInProgress[task.title] = task;\n\t\t\tthis.updateDirtyStatus();\n\t\t\t// Dispatch the task\n\t\t\tthis.dispatchTask(task,function(err) {\n\t\t\t\tif(err) {\n\t\t\t\t\tself.logger.alert(\"Sync error while processing '\" + task.title + \"':\\n\" + err);\n\t\t\t\t}\n\t\t\t\t// Mark that this task is no longer in progress\n\t\t\t\tdelete self.taskInProgress[task.title];\n\t\t\t\tself.updateDirtyStatus();\n\t\t\t\t// Process the next task\n\t\t\t\tself.processTaskQueue.call(self);\n\t\t\t});\n\t\t} else {\n\t\t\t// Make sure we've set a time if there wasn't a task to perform, but we've still got tasks in the queue\n\t\t\tif(this.numTasksInQueue() > 0) {\n\t\t\t\tthis.triggerTimeout();\n\t\t\t}\n\t\t}\n\t}\n};\n\n/*\nChoose the next applicable task\n*/\nSyncer.prototype.chooseNextTask = function() {\n\tvar self = this,\n\t\tcandidateTask = null,\n\t\tnow = Date.now();\n\t// Select the best candidate task\n\t$tw.utils.each(this.taskQueue,function(task,title) {\n\t\t// Exclude the task if there's one of the same name in progress\n\t\tif($tw.utils.hop(self.taskInProgress,title)) {\n\t\t\treturn;\n\t\t}\n\t\t// Exclude the task if it is a save and the tiddler has been modified recently, but not hit the fallback time\n\t\tif(task.type === \"save\" && (now - task.lastModificationTime) < self.throttleInterval &&\n\t\t\t(now - task.queueTime) < self.fallbackInterval) {\n\t\t\treturn;\n\t\t}\n\t\t// Exclude the task if it is newer than the current best candidate\n\t\tif(candidateTask && candidateTask.queueTime < task.queueTime) {\n\t\t\treturn;\n\t\t}\n\t\t// Now this is our best candidate\n\t\tcandidateTask = task;\n\t});\n\treturn candidateTask;\n};\n\n/*\nDispatch a task and invoke the callback\n*/\nSyncer.prototype.dispatchTask = function(task,callback) {\n\tvar self = this;\n\tif(task.type === \"save\") {\n\t\tvar changeCount = this.wiki.getChangeCount(task.title),\n\t\t\ttiddler = this.wiki.getTiddler(task.title);\n\t\tthis.logger.log(\"Dispatching 'save' task:\",task.title);\n\t\tif(tiddler) {\n\t\t\tthis.syncadaptor.saveTiddler(tiddler,function(err,adaptorInfo,revision) {\n\t\t\t\tif(err) {\n\t\t\t\t\treturn callback(err);\n\t\t\t\t}\n\t\t\t\t// Adjust the info stored about this tiddler\n\t\t\t\tself.tiddlerInfo[task.title] = {\n\t\t\t\t\tchangeCount: changeCount,\n\t\t\t\t\tadaptorInfo: adaptorInfo,\n\t\t\t\t\trevision: revision\n\t\t\t\t};\n\t\t\t\t// Invoke the callback\n\t\t\t\tcallback(null);\n\t\t\t},{\n\t\t\t\ttiddlerInfo: self.tiddlerInfo[task.title]\n\t\t\t});\n\t\t} else {\n\t\t\tthis.logger.log(\" Not Dispatching 'save' task:\",task.title,\"tiddler does not exist\");\n\t\t\treturn callback(null);\n\t\t}\n\t} else if(task.type === \"load\") {\n\t\t// Load the tiddler\n\t\tthis.logger.log(\"Dispatching 'load' task:\",task.title);\n\t\tthis.syncadaptor.loadTiddler(task.title,function(err,tiddlerFields) {\n\t\t\tif(err) {\n\t\t\t\treturn callback(err);\n\t\t\t}\n\t\t\t// Store the tiddler\n\t\t\tif(tiddlerFields) {\n\t\t\t\tself.storeTiddler(tiddlerFields,true);\n\t\t\t}\n\t\t\t// Invoke the callback\n\t\t\tcallback(null);\n\t\t});\n\t} else if(task.type === \"delete\") {\n\t\t// Delete the tiddler\n\t\tthis.logger.log(\"Dispatching 'delete' task:\",task.title);\n\t\tthis.syncadaptor.deleteTiddler(task.title,function(err) {\n\t\t\tif(err) {\n\t\t\t\treturn callback(err);\n\t\t\t}\n\t\t\tdelete self.tiddlerInfo[task.title];\n\t\t\t// Invoke the callback\n\t\t\tcallback(null);\n\t\t},{\n\t\t\ttiddlerInfo: self.tiddlerInfo[task.title]\n\t\t});\n\t}\n};\n\nexports.Syncer = Syncer;\n\n})();\n",
            "title": "$:/core/modules/syncer.js",
            "type": "application/javascript",
            "module-type": "global"
        },
        "$:/core/modules/tiddler.js": {
            "text": "/*\\\ntitle: $:/core/modules/tiddler.js\ntype: application/javascript\nmodule-type: tiddlermethod\n\nExtension methods for the $tw.Tiddler object (constructor and methods required at boot time are in boot/boot.js)\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.hasTag = function(tag) {\n\treturn this.fields.tags && this.fields.tags.indexOf(tag) !== -1;\n};\n\nexports.isPlugin = function() {\n\treturn this.fields.type === \"application/json\" && this.hasField(\"plugin-type\");\n};\n\nexports.isDraft = function() {\n\treturn this.hasField(\"draft.of\");\n};\n\nexports.getFieldString = function(field) {\n\tvar value = this.fields[field];\n\t// Check for a missing field\n\tif(value === undefined || value === null) {\n\t\treturn \"\";\n\t}\n\t// Parse the field with the associated module (if any)\n\tvar fieldModule = $tw.Tiddler.fieldModules[field];\n\tif(fieldModule && fieldModule.stringify) {\n\t\treturn fieldModule.stringify.call(this,value);\n\t} else {\n\t\treturn value.toString();\n\t}\n};\n\n/*\nGet all the fields as a hashmap of strings. Options:\n\texclude: an array of field names to exclude\n*/\nexports.getFieldStrings = function(options) {\n\toptions = options || {};\n\tvar exclude = options.exclude || [];\n\tvar fields = {};\n\tfor(var field in this.fields) {\n\t\tif($tw.utils.hop(this.fields,field)) {\n\t\t\tif(exclude.indexOf(field) === -1) {\n\t\t\t\tfields[field] = this.getFieldString(field);\n\t\t\t}\n\t\t}\n\t}\n\treturn fields;\n};\n\n/*\nGet all the fields as a name:value block. Options:\n\texclude: an array of field names to exclude\n*/\nexports.getFieldStringBlock = function(options) {\n\toptions = options || {};\n\tvar exclude = options.exclude || [];\n\tvar fields = [];\n\tfor(var field in this.fields) {\n\t\tif($tw.utils.hop(this.fields,field)) {\n\t\t\tif(exclude.indexOf(field) === -1) {\n\t\t\t\tfields.push(field + \": \" + this.getFieldString(field));\n\t\t\t}\n\t\t}\n\t}\n\treturn fields.join(\"\\n\");\n};\n\n/*\nCompare two tiddlers for equality\ntiddler: the tiddler to compare\nexcludeFields: array of field names to exclude from the comparison\n*/\nexports.isEqual = function(tiddler,excludeFields) {\n\tif(!(tiddler instanceof $tw.Tiddler)) {\n\t\treturn false;\n\t}\n\texcludeFields = excludeFields || [];\n\tvar self = this,\n\t\tdifferences = []; // Fields that have differences\n\t// Add to the differences array\n\tfunction addDifference(fieldName) {\n\t\t// Check for this field being excluded\n\t\tif(excludeFields.indexOf(fieldName) === -1) {\n\t\t\t// Save the field as a difference\n\t\t\t$tw.utils.pushTop(differences,fieldName);\n\t\t}\n\t}\n\t// Returns true if the two values of this field are equal\n\tfunction isFieldValueEqual(fieldName) {\n\t\tvar valueA = self.fields[fieldName],\n\t\t\tvalueB = tiddler.fields[fieldName];\n\t\t// Check for identical string values\n\t\tif(typeof(valueA) === \"string\" && typeof(valueB) === \"string\" && valueA === valueB) {\n\t\t\treturn true;\n\t\t}\n\t\t// Check for identical array values\n\t\tif($tw.utils.isArray(valueA) && $tw.utils.isArray(valueB) && $tw.utils.isArrayEqual(valueA,valueB)) {\n\t\t\treturn true;\n\t\t}\n\t\t// Otherwise the fields must be different\n\t\treturn false;\n\t}\n\t// Compare our fields\n\tfor(var fieldName in this.fields) {\n\t\tif(!isFieldValueEqual(fieldName)) {\n\t\t\taddDifference(fieldName);\n\t\t}\n\t}\n\t// There's a difference for every field in the other tiddler that we don't have\n\tfor(fieldName in tiddler.fields) {\n\t\tif(!(fieldName in this.fields)) {\n\t\t\taddDifference(fieldName);\n\t\t}\n\t}\n\t// Return whether there were any differences\n\treturn differences.length === 0;\n};\n\nexports.getFieldDay = function(field) {\n\tif(this.cache && this.cache.day && $tw.utils.hop(this.cache.day,field) ) {\n\t\treturn this.cache.day[field];\n\t}\n\tvar day = \"\";\n\tif(this.fields[field]) {\n\t\tday = (new Date($tw.utils.parseDate(this.fields[field]))).setHours(0,0,0,0);\n\t}\n\tthis.cache.day = this.cache.day || {};\n\tthis.cache.day[field] = day;\n\treturn day;\n};\n\n})();\n",
            "title": "$:/core/modules/tiddler.js",
            "type": "application/javascript",
            "module-type": "tiddlermethod"
        },
        "$:/core/modules/upgraders/plugins.js": {
            "text": "/*\\\ntitle: $:/core/modules/upgraders/plugins.js\ntype: application/javascript\nmodule-type: upgrader\n\nUpgrader module that checks that plugins are newer than any already installed version\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar UPGRADE_LIBRARY_TITLE = \"$:/UpgradeLibrary\";\n\nvar BLOCKED_PLUGINS = {\n\t\"$:/themes/tiddlywiki/stickytitles\": {\n\t\tversions: [\"*\"]\n\t},\n\t\"$:/plugins/tiddlywiki/fullscreen\": {\n\t\tversions: [\"*\"]\n\t}\n};\n\nexports.upgrade = function(wiki,titles,tiddlers) {\n\tvar self = this,\n\t\tmessages = {},\n\t\tupgradeLibrary,\n\t\tgetLibraryTiddler = function(title) {\n\t\t\tif(!upgradeLibrary) {\n\t\t\t\tupgradeLibrary = wiki.getTiddlerData(UPGRADE_LIBRARY_TITLE,{});\n\t\t\t\tupgradeLibrary.tiddlers = upgradeLibrary.tiddlers || {};\n\t\t\t}\n\t\t\treturn upgradeLibrary.tiddlers[title];\n\t\t};\n\n\t// Go through all the incoming tiddlers\n\t$tw.utils.each(titles,function(title) {\n\t\tvar incomingTiddler = tiddlers[title];\n\t\t// Check if we're dealing with a plugin\n\t\tif(incomingTiddler && incomingTiddler[\"plugin-type\"] && incomingTiddler.version) {\n\t\t\t// Upgrade the incoming plugin if it is in the upgrade library\n\t\t\tvar libraryTiddler = getLibraryTiddler(title);\n\t\t\tif(libraryTiddler && libraryTiddler[\"plugin-type\"] && libraryTiddler.version) {\n\t\t\t\ttiddlers[title] = libraryTiddler;\n\t\t\t\tmessages[title] = $tw.language.getString(\"Import/Upgrader/Plugins/Upgraded\",{variables: {incoming: incomingTiddler.version, upgraded: libraryTiddler.version}});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Suppress the incoming plugin if it is older than the currently installed one\n\t\t\tvar existingTiddler = wiki.getTiddler(title);\n\t\t\tif(existingTiddler && existingTiddler.hasField(\"plugin-type\") && existingTiddler.hasField(\"version\")) {\n\t\t\t\t// Reject the incoming plugin by blanking all its fields\n\t\t\t\tif($tw.utils.checkVersions(existingTiddler.fields.version,incomingTiddler.version)) {\n\t\t\t\t\ttiddlers[title] = Object.create(null);\n\t\t\t\t\tmessages[title] = $tw.language.getString(\"Import/Upgrader/Plugins/Suppressed/Version\",{variables: {incoming: incomingTiddler.version, existing: existingTiddler.fields.version}});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(incomingTiddler && incomingTiddler[\"plugin-type\"]) {\n\t\t\t// Check whether the plugin is on the blocked list\n\t\t\tvar blockInfo = BLOCKED_PLUGINS[title];\n\t\t\tif(blockInfo) {\n\t\t\t\tif(blockInfo.versions.indexOf(\"*\") !== -1 || (incomingTiddler.version && blockInfo.versions.indexOf(incomingTiddler.version) !== -1)) {\n\t\t\t\t\ttiddlers[title] = Object.create(null);\n\t\t\t\t\tmessages[title] = $tw.language.getString(\"Import/Upgrader/Plugins/Suppressed/Incompatible\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\treturn messages;\n};\n\n})();\n",
            "title": "$:/core/modules/upgraders/plugins.js",
            "type": "application/javascript",
            "module-type": "upgrader"
        },
        "$:/core/modules/upgraders/system.js": {
            "text": "/*\\\ntitle: $:/core/modules/upgraders/system.js\ntype: application/javascript\nmodule-type: upgrader\n\nUpgrader module that suppresses certain system tiddlers that shouldn't be imported\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar DONT_IMPORT_LIST = [\"$:/StoryList\",\"$:/HistoryList\"],\n\tDONT_IMPORT_PREFIX_LIST = [\"$:/temp/\",\"$:/state/\"];\n\nexports.upgrade = function(wiki,titles,tiddlers) {\n\tvar self = this,\n\t\tmessages = {};\n\t// Check for tiddlers on our list\n\t$tw.utils.each(titles,function(title) {\n\t\tif(DONT_IMPORT_LIST.indexOf(title) !== -1) {\n\t\t\ttiddlers[title] = Object.create(null);\n\t\t\tmessages[title] = $tw.language.getString(\"Import/Upgrader/System/Suppressed\");\n\t\t} else {\n\t\t\tfor(var t=0; t<DONT_IMPORT_PREFIX_LIST.length; t++) {\n\t\t\t\tvar prefix = DONT_IMPORT_PREFIX_LIST[t];\n\t\t\t\tif(title.substr(0,prefix.length) === prefix) {\n\t\t\t\t\ttiddlers[title] = Object.create(null);\n\t\t\t\t\tmessages[title] = $tw.language.getString(\"Import/Upgrader/State/Suppressed\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\treturn messages;\n};\n\n})();\n",
            "title": "$:/core/modules/upgraders/system.js",
            "type": "application/javascript",
            "module-type": "upgrader"
        },
        "$:/core/modules/upgraders/themetweaks.js": {
            "text": "/*\\\ntitle: $:/core/modules/upgraders/themetweaks.js\ntype: application/javascript\nmodule-type: upgrader\n\nUpgrader module that handles the change in theme tweak storage introduced in 5.0.14-beta.\n\nPreviously, theme tweaks were stored in two data tiddlers:\n\n* $:/themes/tiddlywiki/vanilla/metrics\n* $:/themes/tiddlywiki/vanilla/settings\n\nNow, each tweak is stored in its own separate tiddler.\n\nThis upgrader copies any values from the old format to the new. The old data tiddlers are not deleted in case they have been used to store additional indexes.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar MAPPINGS = {\n\t\"$:/themes/tiddlywiki/vanilla/metrics\": {\n\t\t\"fontsize\": \"$:/themes/tiddlywiki/vanilla/metrics/fontsize\",\n\t\t\"lineheight\": \"$:/themes/tiddlywiki/vanilla/metrics/lineheight\",\n\t\t\"storyleft\": \"$:/themes/tiddlywiki/vanilla/metrics/storyleft\",\n\t\t\"storytop\": \"$:/themes/tiddlywiki/vanilla/metrics/storytop\",\n\t\t\"storyright\": \"$:/themes/tiddlywiki/vanilla/metrics/storyright\",\n\t\t\"storywidth\": \"$:/themes/tiddlywiki/vanilla/metrics/storywidth\",\n\t\t\"tiddlerwidth\": \"$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth\"\n\t},\n\t\"$:/themes/tiddlywiki/vanilla/settings\": {\n\t\t\"fontfamily\": \"$:/themes/tiddlywiki/vanilla/settings/fontfamily\"\n\t}\n};\n\nexports.upgrade = function(wiki,titles,tiddlers) {\n\tvar self = this,\n\t\tmessages = {};\n\t// Check for tiddlers on our list\n\t$tw.utils.each(titles,function(title) {\n\t\tvar mapping = MAPPINGS[title];\n\t\tif(mapping) {\n\t\t\tvar tiddler = new $tw.Tiddler(tiddlers[title]),\n\t\t\t\ttiddlerData = wiki.getTiddlerDataCached(tiddler,{});\n\t\t\tfor(var index in mapping) {\n\t\t\t\tvar mappedTitle = mapping[index];\n\t\t\t\tif(!tiddlers[mappedTitle] || tiddlers[mappedTitle].title !== mappedTitle) {\n\t\t\t\t\ttiddlers[mappedTitle] = {\n\t\t\t\t\t\ttitle: mappedTitle,\n\t\t\t\t\t\ttext: tiddlerData[index]\n\t\t\t\t\t};\n\t\t\t\t\tmessages[mappedTitle] = $tw.language.getString(\"Import/Upgrader/ThemeTweaks/Created\",{variables: {\n\t\t\t\t\t\tfrom: title + \"##\" + index\n\t\t\t\t\t}});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\treturn messages;\n};\n\n})();\n",
            "title": "$:/core/modules/upgraders/themetweaks.js",
            "type": "application/javascript",
            "module-type": "upgrader"
        },
        "$:/core/modules/utils/crypto.js": {
            "text": "/*\\\ntitle: $:/core/modules/utils/crypto.js\ntype: application/javascript\nmodule-type: utils\n\nUtility functions related to crypto.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nLook for an encrypted store area in the text of a TiddlyWiki file\n*/\nexports.extractEncryptedStoreArea = function(text) {\n\tvar encryptedStoreAreaStartMarker = \"<pre id=\\\"encryptedStoreArea\\\" type=\\\"text/plain\\\" style=\\\"display:none;\\\">\",\n\t\tencryptedStoreAreaStart = text.indexOf(encryptedStoreAreaStartMarker);\n\tif(encryptedStoreAreaStart !== -1) {\n\t\tvar encryptedStoreAreaEnd = text.indexOf(\"</pre>\",encryptedStoreAreaStart);\n\t\tif(encryptedStoreAreaEnd !== -1) {\n\t\t\treturn $tw.utils.htmlDecode(text.substring(encryptedStoreAreaStart + encryptedStoreAreaStartMarker.length,encryptedStoreAreaEnd-1));\n\t\t}\n\t}\n\treturn null;\n};\n\n/*\nAttempt to extract the tiddlers from an encrypted store area using the current password. If the password is not provided then the password in the password store will be used\n*/\nexports.decryptStoreArea = function(encryptedStoreArea,password) {\n\tvar decryptedText = $tw.crypto.decrypt(encryptedStoreArea,password);\n\tif(decryptedText) {\n\t\tvar json = JSON.parse(decryptedText),\n\t\t\ttiddlers = [];\n\t\tfor(var title in json) {\n\t\t\tif(title !== \"$:/isEncrypted\") {\n\t\t\t\ttiddlers.push(json[title]);\n\t\t\t}\n\t\t}\n\t\treturn tiddlers;\n\t} else {\n\t\treturn null;\n\t}\n};\n\n\n/*\nAttempt to extract the tiddlers from an encrypted store area using the current password. If that fails, the user is prompted for a password.\nencryptedStoreArea: text of the TiddlyWiki encrypted store area\ncallback: function(tiddlers) called with the array of decrypted tiddlers\n\nThe following configuration settings are supported:\n\n$tw.config.usePasswordVault: causes any password entered by the user to also be put into the system password vault\n*/\nexports.decryptStoreAreaInteractive = function(encryptedStoreArea,callback,options) {\n\t// Try to decrypt with the current password\n\tvar tiddlers = $tw.utils.decryptStoreArea(encryptedStoreArea);\n\tif(tiddlers) {\n\t\tcallback(tiddlers);\n\t} else {\n\t\t// Prompt for a new password and keep trying\n\t\t$tw.passwordPrompt.createPrompt({\n\t\t\tserviceName: \"Enter a password to decrypt the imported TiddlyWiki\",\n\t\t\tnoUserName: true,\n\t\t\tcanCancel: true,\n\t\t\tsubmitText: \"Decrypt\",\n\t\t\tcallback: function(data) {\n\t\t\t\t// Exit if the user cancelled\n\t\t\t\tif(!data) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// Attempt to decrypt the tiddlers\n\t\t\t\tvar tiddlers = $tw.utils.decryptStoreArea(encryptedStoreArea,data.password);\n\t\t\t\tif(tiddlers) {\n\t\t\t\t\tif($tw.config.usePasswordVault) {\n\t\t\t\t\t\t$tw.crypto.setPassword(data.password);\n\t\t\t\t\t}\n\t\t\t\t\tcallback(tiddlers);\n\t\t\t\t\t// Exit and remove the password prompt\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\t// We didn't decrypt everything, so continue to prompt for password\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n};\n\n})();\n",
            "title": "$:/core/modules/utils/crypto.js",
            "type": "application/javascript",
            "module-type": "utils"
        },
        "$:/core/modules/utils/dom/animations/slide.js": {
            "text": "/*\\\ntitle: $:/core/modules/utils/dom/animations/slide.js\ntype: application/javascript\nmodule-type: animation\n\nA simple slide animation that varies the height of the element\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nfunction slideOpen(domNode,options) {\n\toptions = options || {};\n\tvar duration = options.duration || $tw.utils.getAnimationDuration();\n\t// Get the current height of the domNode\n\tvar computedStyle = window.getComputedStyle(domNode),\n\t\tcurrMarginBottom = parseInt(computedStyle.marginBottom,10),\n\t\tcurrMarginTop = parseInt(computedStyle.marginTop,10),\n\t\tcurrPaddingBottom = parseInt(computedStyle.paddingBottom,10),\n\t\tcurrPaddingTop = parseInt(computedStyle.paddingTop,10),\n\t\tcurrHeight = domNode.offsetHeight;\n\t// Reset the margin once the transition is over\n\tsetTimeout(function() {\n\t\t$tw.utils.setStyle(domNode,[\n\t\t\t{transition: \"none\"},\n\t\t\t{marginBottom: \"\"},\n\t\t\t{marginTop: \"\"},\n\t\t\t{paddingBottom: \"\"},\n\t\t\t{paddingTop: \"\"},\n\t\t\t{height: \"auto\"},\n\t\t\t{opacity: \"\"}\n\t\t]);\n\t\tif(options.callback) {\n\t\t\toptions.callback();\n\t\t}\n\t},duration);\n\t// Set up the initial position of the element\n\t$tw.utils.setStyle(domNode,[\n\t\t{transition: \"none\"},\n\t\t{marginTop: \"0px\"},\n\t\t{marginBottom: \"0px\"},\n\t\t{paddingTop: \"0px\"},\n\t\t{paddingBottom: \"0px\"},\n\t\t{height: \"0px\"},\n\t\t{opacity: \"0\"}\n\t]);\n\t$tw.utils.forceLayout(domNode);\n\t// Transition to the final position\n\t$tw.utils.setStyle(domNode,[\n\t\t{transition: \"margin-top \" + duration + \"ms ease-in-out, \" +\n\t\t\t\t\t\"margin-bottom \" + duration + \"ms ease-in-out, \" +\n\t\t\t\t\t\"padding-top \" + duration + \"ms ease-in-out, \" +\n\t\t\t\t\t\"padding-bottom \" + duration + \"ms ease-in-out, \" +\n\t\t\t\t\t\"height \" + duration + \"ms ease-in-out, \" +\n\t\t\t\t\t\"opacity \" + duration + \"ms ease-in-out\"},\n\t\t{marginBottom: currMarginBottom + \"px\"},\n\t\t{marginTop: currMarginTop + \"px\"},\n\t\t{paddingBottom: currPaddingBottom + \"px\"},\n\t\t{paddingTop: currPaddingTop + \"px\"},\n\t\t{height: currHeight + \"px\"},\n\t\t{opacity: \"1\"}\n\t]);\n}\n\nfunction slideClosed(domNode,options) {\n\toptions = options || {};\n\tvar duration = options.duration || $tw.utils.getAnimationDuration(),\n\t\tcurrHeight = domNode.offsetHeight;\n\t// Clear the properties we've set when the animation is over\n\tsetTimeout(function() {\n\t\t$tw.utils.setStyle(domNode,[\n\t\t\t{transition: \"none\"},\n\t\t\t{marginBottom: \"\"},\n\t\t\t{marginTop: \"\"},\n\t\t\t{paddingBottom: \"\"},\n\t\t\t{paddingTop: \"\"},\n\t\t\t{height: \"auto\"},\n\t\t\t{opacity: \"\"}\n\t\t]);\n\t\tif(options.callback) {\n\t\t\toptions.callback();\n\t\t}\n\t},duration);\n\t// Set up the initial position of the element\n\t$tw.utils.setStyle(domNode,[\n\t\t{height: currHeight + \"px\"},\n\t\t{opacity: \"1\"}\n\t]);\n\t$tw.utils.forceLayout(domNode);\n\t// Transition to the final position\n\t$tw.utils.setStyle(domNode,[\n\t\t{transition: \"margin-top \" + duration + \"ms ease-in-out, \" +\n\t\t\t\t\t\"margin-bottom \" + duration + \"ms ease-in-out, \" +\n\t\t\t\t\t\"padding-top \" + duration + \"ms ease-in-out, \" +\n\t\t\t\t\t\"padding-bottom \" + duration + \"ms ease-in-out, \" +\n\t\t\t\t\t\"height \" + duration + \"ms ease-in-out, \" +\n\t\t\t\t\t\"opacity \" + duration + \"ms ease-in-out\"},\n\t\t{marginTop: \"0px\"},\n\t\t{marginBottom: \"0px\"},\n\t\t{paddingTop: \"0px\"},\n\t\t{paddingBottom: \"0px\"},\n\t\t{height: \"0px\"},\n\t\t{opacity: \"0\"}\n\t]);\n}\n\nexports.slide = {\n\topen: slideOpen,\n\tclose: slideClosed\n};\n\n})();\n",
            "title": "$:/core/modules/utils/dom/animations/slide.js",
            "type": "application/javascript",
            "module-type": "animation"
        },
        "$:/core/modules/utils/dom/animator.js": {
            "text": "/*\\\ntitle: $:/core/modules/utils/dom/animator.js\ntype: application/javascript\nmodule-type: utils\n\nOrchestrates animations and transitions\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nfunction Animator() {\n\t// Get the registered animation modules\n\tthis.animations = {};\n\t$tw.modules.applyMethods(\"animation\",this.animations);\n}\n\nAnimator.prototype.perform = function(type,domNode,options) {\n\toptions = options || {};\n\t// Find an animation that can handle this type\n\tvar chosenAnimation;\n\t$tw.utils.each(this.animations,function(animation,name) {\n\t\tif($tw.utils.hop(animation,type)) {\n\t\t\tchosenAnimation = animation[type];\n\t\t}\n\t});\n\tif(!chosenAnimation) {\n\t\tchosenAnimation = function(domNode,options) {\n\t\t\tif(options.callback) {\n\t\t\t\toptions.callback();\n\t\t\t}\n\t\t};\n\t}\n\t// Call the animation\n\tchosenAnimation(domNode,options);\n};\n\nexports.Animator = Animator;\n\n})();\n",
            "title": "$:/core/modules/utils/dom/animator.js",
            "type": "application/javascript",
            "module-type": "utils"
        },
        "$:/core/modules/utils/dom/browser.js": {
            "text": "/*\\\ntitle: $:/core/modules/utils/dom/browser.js\ntype: application/javascript\nmodule-type: utils\n\nBrowser feature detection\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nSet style properties of an element\n\telement: dom node\n\tstyles: ordered array of {name: value} pairs\n*/\nexports.setStyle = function(element,styles) {\n\tif(element.nodeType === 1) { // Element.ELEMENT_NODE\n\t\tfor(var t=0; t<styles.length; t++) {\n\t\t\tfor(var styleName in styles[t]) {\n\t\t\t\telement.style[$tw.utils.convertStyleNameToPropertyName(styleName)] = styles[t][styleName];\n\t\t\t}\n\t\t}\n\t}\n};\n\n/*\nConverts a standard CSS property name into the local browser-specific equivalent. For example:\n\t\"background-color\" --> \"backgroundColor\"\n\t\"transition\" --> \"webkitTransition\"\n*/\n\nvar styleNameCache = {}; // We'll cache the style name conversions\n\nexports.convertStyleNameToPropertyName = function(styleName) {\n\t// Return from the cache if we can\n\tif(styleNameCache[styleName]) {\n\t\treturn styleNameCache[styleName];\n\t}\n\t// Convert it by first removing any hyphens\n\tvar propertyName = $tw.utils.unHyphenateCss(styleName);\n\t// Then check if it needs a prefix\n\tif($tw.browser && document.body.style[propertyName] === undefined) {\n\t\tvar prefixes = [\"O\",\"MS\",\"Moz\",\"webkit\"];\n\t\tfor(var t=0; t<prefixes.length; t++) {\n\t\t\tvar prefixedName = prefixes[t] + propertyName.substr(0,1).toUpperCase() + propertyName.substr(1);\n\t\t\tif(document.body.style[prefixedName] !== undefined) {\n\t\t\t\tpropertyName = prefixedName;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\t// Put it in the cache too\n\tstyleNameCache[styleName] = propertyName;\n\treturn propertyName;\n};\n\n/*\nConverts a JS format CSS property name back into the dashed form used in CSS declarations. For example:\n\t\"backgroundColor\" --> \"background-color\"\n\t\"webkitTransform\" --> \"-webkit-transform\"\n*/\nexports.convertPropertyNameToStyleName = function(propertyName) {\n\t// Rehyphenate the name\n\tvar styleName = $tw.utils.hyphenateCss(propertyName);\n\t// If there's a webkit prefix, add a dash (other browsers have uppercase prefixes, and so get the dash automatically)\n\tif(styleName.indexOf(\"webkit\") === 0) {\n\t\tstyleName = \"-\" + styleName;\n\t} else if(styleName.indexOf(\"-m-s\") === 0) {\n\t\tstyleName = \"-ms\" + styleName.substr(4);\n\t}\n\treturn styleName;\n};\n\n/*\nRound trip a stylename to a property name and back again. For example:\n\t\"transform\" --> \"webkitTransform\" --> \"-webkit-transform\"\n*/\nexports.roundTripPropertyName = function(propertyName) {\n\treturn $tw.utils.convertPropertyNameToStyleName($tw.utils.convertStyleNameToPropertyName(propertyName));\n};\n\n/*\nConverts a standard event name into the local browser specific equivalent. For example:\n\t\"animationEnd\" --> \"webkitAnimationEnd\"\n*/\n\nvar eventNameCache = {}; // We'll cache the conversions\n\nvar eventNameMappings = {\n\t\"transitionEnd\": {\n\t\tcorrespondingCssProperty: \"transition\",\n\t\tmappings: {\n\t\t\ttransition: \"transitionend\",\n\t\t\tOTransition: \"oTransitionEnd\",\n\t\t\tMSTransition: \"msTransitionEnd\",\n\t\t\tMozTransition: \"transitionend\",\n\t\t\twebkitTransition: \"webkitTransitionEnd\"\n\t\t}\n\t},\n\t\"animationEnd\": {\n\t\tcorrespondingCssProperty: \"animation\",\n\t\tmappings: {\n\t\t\tanimation: \"animationend\",\n\t\t\tOAnimation: \"oAnimationEnd\",\n\t\t\tMSAnimation: \"msAnimationEnd\",\n\t\t\tMozAnimation: \"animationend\",\n\t\t\twebkitAnimation: \"webkitAnimationEnd\"\n\t\t}\n\t}\n};\n\nexports.convertEventName = function(eventName) {\n\tif(eventNameCache[eventName]) {\n\t\treturn eventNameCache[eventName];\n\t}\n\tvar newEventName = eventName,\n\t\tmappings = eventNameMappings[eventName];\n\tif(mappings) {\n\t\tvar convertedProperty = $tw.utils.convertStyleNameToPropertyName(mappings.correspondingCssProperty);\n\t\tif(mappings.mappings[convertedProperty]) {\n\t\t\tnewEventName = mappings.mappings[convertedProperty];\n\t\t}\n\t}\n\t// Put it in the cache too\n\teventNameCache[eventName] = newEventName;\n\treturn newEventName;\n};\n\n/*\nReturn the names of the fullscreen APIs\n*/\nexports.getFullScreenApis = function() {\n\tvar d = document,\n\t\tdb = d.body,\n\t\tresult = {\n\t\t\"_requestFullscreen\": db.webkitRequestFullscreen !== undefined ? \"webkitRequestFullscreen\" :\n\t\t\t\t\t\t\tdb.mozRequestFullScreen !== undefined ? \"mozRequestFullScreen\" :\n\t\t\t\t\t\t\tdb.msRequestFullscreen !== undefined ? \"msRequestFullscreen\" :\n\t\t\t\t\t\t\tdb.requestFullscreen !== undefined ? \"requestFullscreen\" : \"\",\n\t\t\"_exitFullscreen\": d.webkitExitFullscreen !== undefined ? \"webkitExitFullscreen\" :\n\t\t\t\t\t\t\td.mozCancelFullScreen !== undefined ? \"mozCancelFullScreen\" :\n\t\t\t\t\t\t\td.msExitFullscreen !== undefined ? \"msExitFullscreen\" :\n\t\t\t\t\t\t\td.exitFullscreen !== undefined ? \"exitFullscreen\" : \"\",\n\t\t\"_fullscreenElement\": d.webkitFullscreenElement !== undefined ? \"webkitFullscreenElement\" :\n\t\t\t\t\t\t\td.mozFullScreenElement !== undefined ? \"mozFullScreenElement\" :\n\t\t\t\t\t\t\td.msFullscreenElement !== undefined ? \"msFullscreenElement\" :\n\t\t\t\t\t\t\td.fullscreenElement !== undefined ? \"fullscreenElement\" : \"\",\n\t\t\"_fullscreenChange\": d.webkitFullscreenElement !== undefined ? \"webkitfullscreenchange\" :\n\t\t\t\t\t\t\td.mozFullScreenElement !== undefined ? \"mozfullscreenchange\" :\n\t\t\t\t\t\t\td.msFullscreenElement !== undefined ? \"MSFullscreenChange\" :\n\t\t\t\t\t\t\td.fullscreenElement !== undefined ? \"fullscreenchange\" : \"\"\n\t};\n\tif(!result._requestFullscreen || !result._exitFullscreen || !result._fullscreenElement || !result._fullscreenChange) {\n\t\treturn null;\n\t} else {\n\t\treturn result;\n\t}\n};\n\n})();\n",
            "title": "$:/core/modules/utils/dom/browser.js",
            "type": "application/javascript",
            "module-type": "utils"
        },
        "$:/core/modules/utils/dom/csscolorparser.js": {
            "text": "// (c) Dean McNamee <dean@gmail.com>, 2012.\n//\n// https://github.com/deanm/css-color-parser-js\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n// IN THE SOFTWARE.\n\n// http://www.w3.org/TR/css3-color/\nvar kCSSColorTable = {\n  \"transparent\": [0,0,0,0], \"aliceblue\": [240,248,255,1],\n  \"antiquewhite\": [250,235,215,1], \"aqua\": [0,255,255,1],\n  \"aquamarine\": [127,255,212,1], \"azure\": [240,255,255,1],\n  \"beige\": [245,245,220,1], \"bisque\": [255,228,196,1],\n  \"black\": [0,0,0,1], \"blanchedalmond\": [255,235,205,1],\n  \"blue\": [0,0,255,1], \"blueviolet\": [138,43,226,1],\n  \"brown\": [165,42,42,1], \"burlywood\": [222,184,135,1],\n  \"cadetblue\": [95,158,160,1], \"chartreuse\": [127,255,0,1],\n  \"chocolate\": [210,105,30,1], \"coral\": [255,127,80,1],\n  \"cornflowerblue\": [100,149,237,1], \"cornsilk\": [255,248,220,1],\n  \"crimson\": [220,20,60,1], \"cyan\": [0,255,255,1],\n  \"darkblue\": [0,0,139,1], \"darkcyan\": [0,139,139,1],\n  \"darkgoldenrod\": [184,134,11,1], \"darkgray\": [169,169,169,1],\n  \"darkgreen\": [0,100,0,1], \"darkgrey\": [169,169,169,1],\n  \"darkkhaki\": [189,183,107,1], \"darkmagenta\": [139,0,139,1],\n  \"darkolivegreen\": [85,107,47,1], \"darkorange\": [255,140,0,1],\n  \"darkorchid\": [153,50,204,1], \"darkred\": [139,0,0,1],\n  \"darksalmon\": [233,150,122,1], \"darkseagreen\": [143,188,143,1],\n  \"darkslateblue\": [72,61,139,1], \"darkslategray\": [47,79,79,1],\n  \"darkslategrey\": [47,79,79,1], \"darkturquoise\": [0,206,209,1],\n  \"darkviolet\": [148,0,211,1], \"deeppink\": [255,20,147,1],\n  \"deepskyblue\": [0,191,255,1], \"dimgray\": [105,105,105,1],\n  \"dimgrey\": [105,105,105,1], \"dodgerblue\": [30,144,255,1],\n  \"firebrick\": [178,34,34,1], \"floralwhite\": [255,250,240,1],\n  \"forestgreen\": [34,139,34,1], \"fuchsia\": [255,0,255,1],\n  \"gainsboro\": [220,220,220,1], \"ghostwhite\": [248,248,255,1],\n  \"gold\": [255,215,0,1], \"goldenrod\": [218,165,32,1],\n  \"gray\": [128,128,128,1], \"green\": [0,128,0,1],\n  \"greenyellow\": [173,255,47,1], \"grey\": [128,128,128,1],\n  \"honeydew\": [240,255,240,1], \"hotpink\": [255,105,180,1],\n  \"indianred\": [205,92,92,1], \"indigo\": [75,0,130,1],\n  \"ivory\": [255,255,240,1], \"khaki\": [240,230,140,1],\n  \"lavender\": [230,230,250,1], \"lavenderblush\": [255,240,245,1],\n  \"lawngreen\": [124,252,0,1], \"lemonchiffon\": [255,250,205,1],\n  \"lightblue\": [173,216,230,1], \"lightcoral\": [240,128,128,1],\n  \"lightcyan\": [224,255,255,1], \"lightgoldenrodyellow\": [250,250,210,1],\n  \"lightgray\": [211,211,211,1], \"lightgreen\": [144,238,144,1],\n  \"lightgrey\": [211,211,211,1], \"lightpink\": [255,182,193,1],\n  \"lightsalmon\": [255,160,122,1], \"lightseagreen\": [32,178,170,1],\n  \"lightskyblue\": [135,206,250,1], \"lightslategray\": [119,136,153,1],\n  \"lightslategrey\": [119,136,153,1], \"lightsteelblue\": [176,196,222,1],\n  \"lightyellow\": [255,255,224,1], \"lime\": [0,255,0,1],\n  \"limegreen\": [50,205,50,1], \"linen\": [250,240,230,1],\n  \"magenta\": [255,0,255,1], \"maroon\": [128,0,0,1],\n  \"mediumaquamarine\": [102,205,170,1], \"mediumblue\": [0,0,205,1],\n  \"mediumorchid\": [186,85,211,1], \"mediumpurple\": [147,112,219,1],\n  \"mediumseagreen\": [60,179,113,1], \"mediumslateblue\": [123,104,238,1],\n  \"mediumspringgreen\": [0,250,154,1], \"mediumturquoise\": [72,209,204,1],\n  \"mediumvioletred\": [199,21,133,1], \"midnightblue\": [25,25,112,1],\n  \"mintcream\": [245,255,250,1], \"mistyrose\": [255,228,225,1],\n  \"moccasin\": [255,228,181,1], \"navajowhite\": [255,222,173,1],\n  \"navy\": [0,0,128,1], \"oldlace\": [253,245,230,1],\n  \"olive\": [128,128,0,1], \"olivedrab\": [107,142,35,1],\n  \"orange\": [255,165,0,1], \"orangered\": [255,69,0,1],\n  \"orchid\": [218,112,214,1], \"palegoldenrod\": [238,232,170,1],\n  \"palegreen\": [152,251,152,1], \"paleturquoise\": [175,238,238,1],\n  \"palevioletred\": [219,112,147,1], \"papayawhip\": [255,239,213,1],\n  \"peachpuff\": [255,218,185,1], \"peru\": [205,133,63,1],\n  \"pink\": [255,192,203,1], \"plum\": [221,160,221,1],\n  \"powderblue\": [176,224,230,1], \"purple\": [128,0,128,1],\n  \"red\": [255,0,0,1], \"rosybrown\": [188,143,143,1],\n  \"royalblue\": [65,105,225,1], \"saddlebrown\": [139,69,19,1],\n  \"salmon\": [250,128,114,1], \"sandybrown\": [244,164,96,1],\n  \"seagreen\": [46,139,87,1], \"seashell\": [255,245,238,1],\n  \"sienna\": [160,82,45,1], \"silver\": [192,192,192,1],\n  \"skyblue\": [135,206,235,1], \"slateblue\": [106,90,205,1],\n  \"slategray\": [112,128,144,1], \"slategrey\": [112,128,144,1],\n  \"snow\": [255,250,250,1], \"springgreen\": [0,255,127,1],\n  \"steelblue\": [70,130,180,1], \"tan\": [210,180,140,1],\n  \"teal\": [0,128,128,1], \"thistle\": [216,191,216,1],\n  \"tomato\": [255,99,71,1], \"turquoise\": [64,224,208,1],\n  \"violet\": [238,130,238,1], \"wheat\": [245,222,179,1],\n  \"white\": [255,255,255,1], \"whitesmoke\": [245,245,245,1],\n  \"yellow\": [255,255,0,1], \"yellowgreen\": [154,205,50,1]}\n\nfunction clamp_css_byte(i) {  // Clamp to integer 0 .. 255.\n  i = Math.round(i);  // Seems to be what Chrome does (vs truncation).\n  return i < 0 ? 0 : i > 255 ? 255 : i;\n}\n\nfunction clamp_css_float(f) {  // Clamp to float 0.0 .. 1.0.\n  return f < 0 ? 0 : f > 1 ? 1 : f;\n}\n\nfunction parse_css_int(str) {  // int or percentage.\n  if (str[str.length - 1] === '%')\n    return clamp_css_byte(parseFloat(str) / 100 * 255);\n  return clamp_css_byte(parseInt(str));\n}\n\nfunction parse_css_float(str) {  // float or percentage.\n  if (str[str.length - 1] === '%')\n    return clamp_css_float(parseFloat(str) / 100);\n  return clamp_css_float(parseFloat(str));\n}\n\nfunction css_hue_to_rgb(m1, m2, h) {\n  if (h < 0) h += 1;\n  else if (h > 1) h -= 1;\n\n  if (h * 6 < 1) return m1 + (m2 - m1) * h * 6;\n  if (h * 2 < 1) return m2;\n  if (h * 3 < 2) return m1 + (m2 - m1) * (2/3 - h) * 6;\n  return m1;\n}\n\nfunction parseCSSColor(css_str) {\n  // Remove all whitespace, not compliant, but should just be more accepting.\n  var str = css_str.replace(/ /g, '').toLowerCase();\n\n  // Color keywords (and transparent) lookup.\n  if (str in kCSSColorTable) return kCSSColorTable[str].slice();  // dup.\n\n  // #abc and #abc123 syntax.\n  if (str[0] === '#') {\n    if (str.length === 4) {\n      var iv = parseInt(str.substr(1), 16);  // TODO(deanm): Stricter parsing.\n      if (!(iv >= 0 && iv <= 0xfff)) return null;  // Covers NaN.\n      return [((iv & 0xf00) >> 4) | ((iv & 0xf00) >> 8),\n              (iv & 0xf0) | ((iv & 0xf0) >> 4),\n              (iv & 0xf) | ((iv & 0xf) << 4),\n              1];\n    } else if (str.length === 7) {\n      var iv = parseInt(str.substr(1), 16);  // TODO(deanm): Stricter parsing.\n      if (!(iv >= 0 && iv <= 0xffffff)) return null;  // Covers NaN.\n      return [(iv & 0xff0000) >> 16,\n              (iv & 0xff00) >> 8,\n              iv & 0xff,\n              1];\n    }\n\n    return null;\n  }\n\n  var op = str.indexOf('('), ep = str.indexOf(')');\n  if (op !== -1 && ep + 1 === str.length) {\n    var fname = str.substr(0, op);\n    var params = str.substr(op+1, ep-(op+1)).split(',');\n    var alpha = 1;  // To allow case fallthrough.\n    switch (fname) {\n      case 'rgba':\n        if (params.length !== 4) return null;\n        alpha = parse_css_float(params.pop());\n        // Fall through.\n      case 'rgb':\n        if (params.length !== 3) return null;\n        return [parse_css_int(params[0]),\n                parse_css_int(params[1]),\n                parse_css_int(params[2]),\n                alpha];\n      case 'hsla':\n        if (params.length !== 4) return null;\n        alpha = parse_css_float(params.pop());\n        // Fall through.\n      case 'hsl':\n        if (params.length !== 3) return null;\n        var h = (((parseFloat(params[0]) % 360) + 360) % 360) / 360;  // 0 .. 1\n        // NOTE(deanm): According to the CSS spec s/l should only be\n        // percentages, but we don't bother and let float or percentage.\n        var s = parse_css_float(params[1]);\n        var l = parse_css_float(params[2]);\n        var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\n        var m1 = l * 2 - m2;\n        return [clamp_css_byte(css_hue_to_rgb(m1, m2, h+1/3) * 255),\n                clamp_css_byte(css_hue_to_rgb(m1, m2, h) * 255),\n                clamp_css_byte(css_hue_to_rgb(m1, m2, h-1/3) * 255),\n                alpha];\n      default:\n        return null;\n    }\n  }\n\n  return null;\n}\n\ntry { exports.parseCSSColor = parseCSSColor } catch(e) { }\n",
            "title": "$:/core/modules/utils/dom/csscolorparser.js",
            "type": "application/javascript",
            "module-type": "utils"
        },
        "$:/core/modules/utils/dom.js": {
            "text": "/*\\\ntitle: $:/core/modules/utils/dom.js\ntype: application/javascript\nmodule-type: utils\n\nVarious static DOM-related utility functions.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nDetermines whether element 'a' contains element 'b'\nCode thanks to John Resig, http://ejohn.org/blog/comparing-document-position/\n*/\nexports.domContains = function(a,b) {\n\treturn a.contains ?\n\t\ta !== b && a.contains(b) :\n\t\t!!(a.compareDocumentPosition(b) & 16);\n};\n\nexports.removeChildren = function(node) {\n\twhile(node.hasChildNodes()) {\n\t\tnode.removeChild(node.firstChild);\n\t}\n};\n\nexports.hasClass = function(el,className) {\n\treturn el && el.className && el.className.toString().split(\" \").indexOf(className) !== -1;\n};\n\nexports.addClass = function(el,className) {\n\tvar c = el.className.split(\" \");\n\tif(c.indexOf(className) === -1) {\n\t\tc.push(className);\n\t}\n\tel.className = c.join(\" \");\n};\n\nexports.removeClass = function(el,className) {\n\tvar c = el.className.split(\" \"),\n\t\tp = c.indexOf(className);\n\tif(p !== -1) {\n\t\tc.splice(p,1);\n\t\tel.className = c.join(\" \");\n\t}\n};\n\nexports.toggleClass = function(el,className,status) {\n\tif(status === undefined) {\n\t\tstatus = !exports.hasClass(el,className);\n\t}\n\tif(status) {\n\t\texports.addClass(el,className);\n\t} else {\n\t\texports.removeClass(el,className);\n\t}\n};\n\n/*\nGet the first parent element that has scrollbars or use the body as fallback.\n*/\nexports.getScrollContainer = function(el) {\n\tvar doc = el.ownerDocument;\n\twhile(el.parentNode) {\t\n\t\tel = el.parentNode;\n\t\tif(el.scrollTop) {\n\t\t\treturn el;\n\t\t}\n\t}\n\treturn doc.body;\n};\n\n/*\nGet the scroll position of the viewport\nReturns:\n\t{\n\t\tx: horizontal scroll position in pixels,\n\t\ty: vertical scroll position in pixels\n\t}\n*/\nexports.getScrollPosition = function() {\n\tif(\"scrollX\" in window) {\n\t\treturn {x: window.scrollX, y: window.scrollY};\n\t} else {\n\t\treturn {x: document.documentElement.scrollLeft, y: document.documentElement.scrollTop};\n\t}\n};\n\n/*\nAdjust the height of a textarea to fit its content, preserving scroll position, and return the height\n*/\nexports.resizeTextAreaToFit = function(domNode,minHeight) {\n\t// Get the scroll container and register the current scroll position\n\tvar container = $tw.utils.getScrollContainer(domNode),\n\t\tscrollTop = container.scrollTop;\n    // Measure the specified minimum height\n\tdomNode.style.height = minHeight;\n\tvar measuredHeight = domNode.offsetHeight;\n\t// Set its height to auto so that it snaps to the correct height\n\tdomNode.style.height = \"auto\";\n\t// Calculate the revised height\n\tvar newHeight = Math.max(domNode.scrollHeight + domNode.offsetHeight - domNode.clientHeight,measuredHeight);\n\t// Only try to change the height if it has changed\n\tif(newHeight !== domNode.offsetHeight) {\n\t\tdomNode.style.height = newHeight + \"px\";\n\t\t// Make sure that the dimensions of the textarea are recalculated\n\t\t$tw.utils.forceLayout(domNode);\n\t\t// Set the container to the position we registered at the beginning\n\t\tcontainer.scrollTop = scrollTop;\n\t}\n\treturn newHeight;\n};\n\n/*\nGets the bounding rectangle of an element in absolute page coordinates\n*/\nexports.getBoundingPageRect = function(element) {\n\tvar scrollPos = $tw.utils.getScrollPosition(),\n\t\tclientRect = element.getBoundingClientRect();\n\treturn {\n\t\tleft: clientRect.left + scrollPos.x,\n\t\twidth: clientRect.width,\n\t\tright: clientRect.right + scrollPos.x,\n\t\ttop: clientRect.top + scrollPos.y,\n\t\theight: clientRect.height,\n\t\tbottom: clientRect.bottom + scrollPos.y\n\t};\n};\n\n/*\nSaves a named password in the browser\n*/\nexports.savePassword = function(name,password) {\n\ttry {\n\t\tif(window.localStorage) {\n\t\t\tlocalStorage.setItem(\"tw5-password-\" + name,password);\n\t\t}\n\t} catch(e) {\n\t}\n};\n\n/*\nRetrieve a named password from the browser\n*/\nexports.getPassword = function(name) {\n\ttry {\n\t\treturn window.localStorage ? localStorage.getItem(\"tw5-password-\" + name) : \"\";\n\t} catch(e) {\n\t\treturn \"\";\n\t}\n};\n\n/*\nForce layout of a dom node and its descendents\n*/\nexports.forceLayout = function(element) {\n\tvar dummy = element.offsetWidth;\n};\n\n/*\nPulse an element for debugging purposes\n*/\nexports.pulseElement = function(element) {\n\t// Event handler to remove the class at the end\n\telement.addEventListener($tw.browser.animationEnd,function handler(event) {\n\t\telement.removeEventListener($tw.browser.animationEnd,handler,false);\n\t\t$tw.utils.removeClass(element,\"pulse\");\n\t},false);\n\t// Apply the pulse class\n\t$tw.utils.removeClass(element,\"pulse\");\n\t$tw.utils.forceLayout(element);\n\t$tw.utils.addClass(element,\"pulse\");\n};\n\n/*\nAttach specified event handlers to a DOM node\ndomNode: where to attach the event handlers\nevents: array of event handlers to be added (see below)\nEach entry in the events array is an object with these properties:\nhandlerFunction: optional event handler function\nhandlerObject: optional event handler object\nhandlerMethod: optionally specifies object handler method name (defaults to `handleEvent`)\n*/\nexports.addEventListeners = function(domNode,events) {\n\t$tw.utils.each(events,function(eventInfo) {\n\t\tvar handler;\n\t\tif(eventInfo.handlerFunction) {\n\t\t\thandler = eventInfo.handlerFunction;\n\t\t} else if(eventInfo.handlerObject) {\n\t\t\tif(eventInfo.handlerMethod) {\n\t\t\t\thandler = function(event) {\n\t\t\t\t\teventInfo.handlerObject[eventInfo.handlerMethod].call(eventInfo.handlerObject,event);\n\t\t\t\t};\t\n\t\t\t} else {\n\t\t\t\thandler = eventInfo.handlerObject;\n\t\t\t}\n\t\t}\n\t\tdomNode.addEventListener(eventInfo.name,handler,false);\n\t});\n};\n\n/*\nGet the computed styles applied to an element as an array of strings of individual CSS properties\n*/\nexports.getComputedStyles = function(domNode) {\n\tvar textAreaStyles = window.getComputedStyle(domNode,null),\n\t\tstyleDefs = [],\n\t\tname;\n\tfor(var t=0; t<textAreaStyles.length; t++) {\n\t\tname = textAreaStyles[t];\n\t\tstyleDefs.push(name + \": \" + textAreaStyles.getPropertyValue(name) + \";\");\n\t}\n\treturn styleDefs;\n};\n\n/*\nApply a set of styles passed as an array of strings of individual CSS properties\n*/\nexports.setStyles = function(domNode,styleDefs) {\n\tdomNode.style.cssText = styleDefs.join(\"\");\n};\n\n/*\nCopy the computed styles from a source element to a destination element\n*/\nexports.copyStyles = function(srcDomNode,dstDomNode) {\n\t$tw.utils.setStyles(dstDomNode,$tw.utils.getComputedStyles(srcDomNode));\n};\n\n})();\n",
            "title": "$:/core/modules/utils/dom.js",
            "type": "application/javascript",
            "module-type": "utils"
        },
        "$:/core/modules/utils/dom/dragndrop.js": {
            "text": "/*\\\ntitle: $:/core/modules/utils/dom/dragndrop.js\ntype: application/javascript\nmodule-type: utils\n\nBrowser data transfer utilities, used with the clipboard and drag and drop\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nOptions:\n\ndomNode: dom node to make draggable\ndragImageType: \"pill\" or \"dom\"\ndragTiddlerFn: optional function to retrieve the title of tiddler to drag\ndragFilterFn: optional function to retreive the filter defining a list of tiddlers to drag\nwidget: widget to use as the contect for the filter\n*/\nexports.makeDraggable = function(options) {\n\tvar dragImageType = options.dragImageType || \"dom\",\n\t\tdragImage,\n\t\tdomNode = options.domNode;\n\t// Make the dom node draggable (not necessary for anchor tags)\n\tif((domNode.tagName || \"\").toLowerCase() !== \"a\") {\n\t\tdomNode.setAttribute(\"draggable\",\"true\");\t\t\n\t}\n\t// Add event handlers\n\t$tw.utils.addEventListeners(domNode,[\n\t\t{name: \"dragstart\", handlerFunction: function(event) {\n\t\t\t// Collect the tiddlers being dragged\n\t\t\tvar dragTiddler = options.dragTiddlerFn && options.dragTiddlerFn(),\n\t\t\t\tdragFilter = options.dragFilterFn && options.dragFilterFn(),\n\t\t\t\ttitles = dragTiddler ? [dragTiddler] : [];\n\t\t\tif(dragFilter) {\n\t\t\t\ttitles.push.apply(titles,options.widget.wiki.filterTiddlers(dragFilter,options.widget));\n\t\t\t}\n\t\t\tvar titleString = $tw.utils.stringifyList(titles);\n\t\t\t// Check that we've something to drag\n\t\t\tif(titles.length > 0 && event.target === domNode) {\n\t\t\t\t// Mark the drag in progress\n\t\t\t\t$tw.dragInProgress = domNode;\n\t\t\t\t// Set the dragging class on the element being dragged\n\t\t\t\t$tw.utils.addClass(event.target,\"tc-dragging\");\n\t\t\t\t// Create the drag image elements\n\t\t\t\tdragImage = options.widget.document.createElement(\"div\");\n\t\t\t\tdragImage.className = \"tc-tiddler-dragger\";\n\t\t\t\tvar inner = options.widget.document.createElement(\"div\");\n\t\t\t\tinner.className = \"tc-tiddler-dragger-inner\";\n\t\t\t\tinner.appendChild(options.widget.document.createTextNode(\n\t\t\t\t\ttitles.length === 1 ? \n\t\t\t\t\t\ttitles[0] :\n\t\t\t\t\t\ttitles.length + \" tiddlers\"\n\t\t\t\t));\n\t\t\t\tdragImage.appendChild(inner);\n\t\t\t\toptions.widget.document.body.appendChild(dragImage);\n\t\t\t\t// Set the data transfer properties\n\t\t\t\tvar dataTransfer = event.dataTransfer;\n\t\t\t\t// Set up the image\n\t\t\t\tdataTransfer.effectAllowed = \"all\";\n\t\t\t\tif(dataTransfer.setDragImage) {\n\t\t\t\t\tif(dragImageType === \"pill\") {\n\t\t\t\t\t\tdataTransfer.setDragImage(dragImage.firstChild,-16,-16);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar r = domNode.getBoundingClientRect();\n\t\t\t\t\t\tdataTransfer.setDragImage(domNode,event.clientX-r.left,event.clientY-r.top);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Set up the data transfer\n\t\t\t\tif(dataTransfer.clearData) {\n\t\t\t\t\tdataTransfer.clearData();\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tvar jsonData = [];\n\t\t\t\tif(titles.length > 1) {\n\t\t\t\t\ttitles.forEach(function(title) {\n\t\t\t\t\t\tjsonData.push(options.widget.wiki.getTiddlerAsJson(title));\n\t\t\t\t\t});\n\t\t\t\t\tjsonData = \"[\" + jsonData.join(\",\") + \"]\";\n\t\t\t\t} else {\n\t\t\t\t\tjsonData = options.widget.wiki.getTiddlerAsJson(titles[0]);\n\t\t\t\t}\n\t\t\t\t// IE doesn't like these content types\n\t\t\t\tif(!$tw.browser.isIE) {\n\t\t\t\t\tdataTransfer.setData(\"text/vnd.tiddler\",jsonData);\n\t\t\t\t\tdataTransfer.setData(\"text/plain\",titleString);\n\t\t\t\t\tdataTransfer.setData(\"text/x-moz-url\",\"data:text/vnd.tiddler,\" + encodeURIComponent(jsonData));\n\t\t\t\t}\n\t\t\t\tdataTransfer.setData(\"URL\",\"data:text/vnd.tiddler,\" + encodeURIComponent(jsonData));\n\t\t\t\tdataTransfer.setData(\"Text\",titleString);\n\t\t\t\tevent.stopPropagation();\n\t\t\t}\n\t\t\treturn false;\n\t\t}},\n\t\t{name: \"dragend\", handlerFunction: function(event) {\n\t\t\tif(event.target === domNode) {\n\t\t\t\t$tw.dragInProgress = null;\n\t\t\t\t// Remove the dragging class on the element being dragged\n\t\t\t\t$tw.utils.removeClass(event.target,\"tc-dragging\");\n\t\t\t\t// Delete the drag image element\n\t\t\t\tif(dragImage) {\n\t\t\t\t\tdragImage.parentNode.removeChild(dragImage);\n\t\t\t\t\tdragImage = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}}\n\t]);\n};\n\nexports.importDataTransfer = function(dataTransfer,fallbackTitle,callback) {\n\t// Try each provided data type in turn\n\tfor(var t=0; t<importDataTypes.length; t++) {\n\t\tif(!$tw.browser.isIE || importDataTypes[t].IECompatible) {\n\t\t\t// Get the data\n\t\t\tvar dataType = importDataTypes[t];\n\t\t\t\tvar data = dataTransfer.getData(dataType.type);\n\t\t\t// Import the tiddlers in the data\n\t\t\tif(data !== \"\" && data !== null) {\n\t\t\t\tif($tw.log.IMPORT) {\n\t\t\t\t\tconsole.log(\"Importing data type '\" + dataType.type + \"', data: '\" + data + \"'\")\n\t\t\t\t}\n\t\t\t\tvar tiddlerFields = dataType.toTiddlerFieldsArray(data,fallbackTitle);\n\t\t\t\tcallback(tiddlerFields);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n};\n\nvar importDataTypes = [\n\t{type: \"text/vnd.tiddler\", IECompatible: false, toTiddlerFieldsArray: function(data,fallbackTitle) {\n\t\treturn parseJSONTiddlers(data,fallbackTitle);\n\t}},\n\t{type: \"URL\", IECompatible: true, toTiddlerFieldsArray: function(data,fallbackTitle) {\n\t\t// Check for tiddler data URI\n\t\tvar match = decodeURIComponent(data).match(/^data\\:text\\/vnd\\.tiddler,(.*)/i);\n\t\tif(match) {\n\t\t\treturn parseJSONTiddlers(match[1],fallbackTitle);\n\t\t} else {\n\t\t\treturn [{title: fallbackTitle, text: data}]; // As URL string\n\t\t}\n\t}},\n\t{type: \"text/x-moz-url\", IECompatible: false, toTiddlerFieldsArray: function(data,fallbackTitle) {\n\t\t// Check for tiddler data URI\n\t\tvar match = decodeURIComponent(data).match(/^data\\:text\\/vnd\\.tiddler,(.*)/i);\n\t\tif(match) {\n\t\t\treturn parseJSONTiddlers(match[1],fallbackTitle);\n\t\t} else {\n\t\t\treturn [{title: fallbackTitle, text: data}]; // As URL string\n\t\t}\n\t}},\n\t{type: \"text/html\", IECompatible: false, toTiddlerFieldsArray: function(data,fallbackTitle) {\n\t\treturn [{title: fallbackTitle, text: data}];\n\t}},\n\t{type: \"text/plain\", IECompatible: false, toTiddlerFieldsArray: function(data,fallbackTitle) {\n\t\treturn [{title: fallbackTitle, text: data}];\n\t}},\n\t{type: \"Text\", IECompatible: true, toTiddlerFieldsArray: function(data,fallbackTitle) {\n\t\treturn [{title: fallbackTitle, text: data}];\n\t}},\n\t{type: \"text/uri-list\", IECompatible: false, toTiddlerFieldsArray: function(data,fallbackTitle) {\n\t\treturn [{title: fallbackTitle, text: data}];\n\t}}\n];\n\nfunction parseJSONTiddlers(json,fallbackTitle) {\n\tvar data = JSON.parse(json);\n\tif(!$tw.utils.isArray(data)) {\n\t\tdata = [data];\n\t}\n\tdata.forEach(function(fields) {\n\t\tfields.title = fields.title || fallbackTitle;\n\t});\n\treturn data;\n};\n\n})();\n",
            "title": "$:/core/modules/utils/dom/dragndrop.js",
            "type": "application/javascript",
            "module-type": "utils"
        },
        "$:/core/modules/utils/dom/http.js": {
            "text": "/*\\\ntitle: $:/core/modules/utils/dom/http.js\ntype: application/javascript\nmodule-type: utils\n\nBrowser HTTP support\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nA quick and dirty HTTP function; to be refactored later. Options are:\n\turl: URL to retrieve\n\ttype: GET, PUT, POST etc\n\tcallback: function invoked with (err,data)\n\treturnProp: string name of the property to return as first argument of callback\n*/\nexports.httpRequest = function(options) {\n\tvar type = options.type || \"GET\",\n\t\theaders = options.headers || {accept: \"application/json\"},\n\t\treturnProp = options.returnProp || \"responseText\",\n\t\trequest = new XMLHttpRequest(),\n\t\tdata = \"\",\n\t\tf,results;\n\t// Massage the data hashmap into a string\n\tif(options.data) {\n\t\tif(typeof options.data === \"string\") { // Already a string\n\t\t\tdata = options.data;\n\t\t} else { // A hashmap of strings\n\t\t\tresults = [];\n\t\t\t$tw.utils.each(options.data,function(dataItem,dataItemTitle) {\n\t\t\t\tresults.push(dataItemTitle + \"=\" + encodeURIComponent(dataItem));\n\t\t\t});\n\t\t\tdata = results.join(\"&\");\n\t\t}\n\t}\n\t// Set up the state change handler\n\trequest.onreadystatechange = function() {\n\t\tif(this.readyState === 4) {\n\t\t\tif(this.status === 200 || this.status === 201 || this.status === 204) {\n\t\t\t\t// Success!\n\t\t\t\toptions.callback(null,this[returnProp],this);\n\t\t\t\treturn;\n\t\t\t}\n\t\t// Something went wrong\n\t\toptions.callback($tw.language.getString(\"Error/XMLHttpRequest\") + \": \" + this.status);\n\t\t}\n\t};\n\t// Make the request\n\trequest.open(type,options.url,true);\n\tif(headers) {\n\t\t$tw.utils.each(headers,function(header,headerTitle,object) {\n\t\t\trequest.setRequestHeader(headerTitle,header);\n\t\t});\n\t}\n\tif(data && !$tw.utils.hop(headers,\"Content-type\")) {\n\t\trequest.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded; charset=UTF-8\");\n\t}\n\ttry {\n\t\trequest.send(data);\n\t} catch(e) {\n\t\toptions.callback(e);\n\t}\n\treturn request;\n};\n\n})();\n",
            "title": "$:/core/modules/utils/dom/http.js",
            "type": "application/javascript",
            "module-type": "utils"
        },
        "$:/core/modules/utils/dom/keyboard.js": {
            "text": "/*\\\ntitle: $:/core/modules/utils/dom/keyboard.js\ntype: application/javascript\nmodule-type: utils\n\nKeyboard utilities; now deprecated. Instead, use $tw.keyboardManager\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n[\"parseKeyDescriptor\",\"checkKeyDescriptor\"].forEach(function(method) {\n\texports[method] = function() {\n\t\tif($tw.keyboardManager) {\n\t\t\treturn $tw.keyboardManager[method].apply($tw.keyboardManager,Array.prototype.slice.call(arguments,0));\n\t\t} else {\n\t\t\treturn null\n\t\t}\n\t};\n});\n\n})();\n",
            "title": "$:/core/modules/utils/dom/keyboard.js",
            "type": "application/javascript",
            "module-type": "utils"
        },
        "$:/core/modules/utils/dom/modal.js": {
            "text": "/*\\\ntitle: $:/core/modules/utils/dom/modal.js\ntype: application/javascript\nmodule-type: utils\n\nModal message mechanism\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar widget = require(\"$:/core/modules/widgets/widget.js\");\n\nvar Modal = function(wiki) {\n\tthis.wiki = wiki;\n\tthis.modalCount = 0;\n};\n\n/*\nDisplay a modal dialogue\n\ttitle: Title of tiddler to display\n\toptions: see below\nOptions include:\n\tdownloadLink: Text of a big download link to include\n*/\nModal.prototype.display = function(title,options) {\n\toptions = options || {};\n\tvar self = this,\n\t\trefreshHandler,\n\t\tduration = $tw.utils.getAnimationDuration(),\n\t\ttiddler = this.wiki.getTiddler(title);\n\t// Don't do anything if the tiddler doesn't exist\n\tif(!tiddler) {\n\t\treturn;\n\t}\n\t// Create the variables\n\tvar variables = $tw.utils.extend({currentTiddler: title},options.variables);\n\t// Create the wrapper divs\n\tvar wrapper = document.createElement(\"div\"),\n\t\tmodalBackdrop = document.createElement(\"div\"),\n\t\tmodalWrapper = document.createElement(\"div\"),\n\t\tmodalHeader = document.createElement(\"div\"),\n\t\theaderTitle = document.createElement(\"h3\"),\n\t\tmodalBody = document.createElement(\"div\"),\n\t\tmodalLink = document.createElement(\"a\"),\n\t\tmodalFooter = document.createElement(\"div\"),\n\t\tmodalFooterHelp = document.createElement(\"span\"),\n\t\tmodalFooterButtons = document.createElement(\"span\");\n\t// Up the modal count and adjust the body class\n\tthis.modalCount++;\n\tthis.adjustPageClass();\n\t// Add classes\n\t$tw.utils.addClass(wrapper,\"tc-modal-wrapper\");\n\t$tw.utils.addClass(modalBackdrop,\"tc-modal-backdrop\");\n\t$tw.utils.addClass(modalWrapper,\"tc-modal\");\n\t$tw.utils.addClass(modalHeader,\"tc-modal-header\");\n\t$tw.utils.addClass(modalBody,\"tc-modal-body\");\n\t$tw.utils.addClass(modalFooter,\"tc-modal-footer\");\n\t// Join them together\n\twrapper.appendChild(modalBackdrop);\n\twrapper.appendChild(modalWrapper);\n\tmodalHeader.appendChild(headerTitle);\n\tmodalWrapper.appendChild(modalHeader);\n\tmodalWrapper.appendChild(modalBody);\n\tmodalFooter.appendChild(modalFooterHelp);\n\tmodalFooter.appendChild(modalFooterButtons);\n\tmodalWrapper.appendChild(modalFooter);\n\t// Render the title of the message\n\tvar headerWidgetNode = this.wiki.makeTranscludeWidget(title,{\n\t\tfield: \"subtitle\",\n\t\tmode: \"inline\",\n\t\tchildren: [{\n\t\t\ttype: \"text\",\n\t\t\tattributes: {\n\t\t\t\ttext: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tvalue: title\n\t\t}}}],\n\t\tparentWidget: $tw.rootWidget,\n\t\tdocument: document,\n\t\tvariables: variables,\n\t\timportPageMacros: true\n\t});\n\theaderWidgetNode.render(headerTitle,null);\n\t// Render the body of the message\n\tvar bodyWidgetNode = this.wiki.makeTranscludeWidget(title,{\n\t\tparentWidget: $tw.rootWidget,\n\t\tdocument: document,\n\t\tvariables: variables,\n\t\timportPageMacros: true\n\t});\n\tbodyWidgetNode.render(modalBody,null);\n\t// Setup the link if present\n\tif(options.downloadLink) {\n\t\tmodalLink.href = options.downloadLink;\n\t\tmodalLink.appendChild(document.createTextNode(\"Right-click to save changes\"));\n\t\tmodalBody.appendChild(modalLink);\n\t}\n\t// Render the footer of the message\n\tif(tiddler && tiddler.fields && tiddler.fields.help) {\n\t\tvar link = document.createElement(\"a\");\n\t\tlink.setAttribute(\"href\",tiddler.fields.help);\n\t\tlink.setAttribute(\"target\",\"_blank\");\n\t\tlink.setAttribute(\"rel\",\"noopener noreferrer\");\n\t\tlink.appendChild(document.createTextNode(\"Help\"));\n\t\tmodalFooterHelp.appendChild(link);\n\t\tmodalFooterHelp.style.float = \"left\";\n\t}\n\tvar footerWidgetNode = this.wiki.makeTranscludeWidget(title,{\n\t\tfield: \"footer\",\n\t\tmode: \"inline\",\n\t\tchildren: [{\n\t\t\ttype: \"button\",\n\t\t\tattributes: {\n\t\t\t\tmessage: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tvalue: \"tm-close-tiddler\"\n\t\t\t\t}\n\t\t\t},\n\t\t\tchildren: [{\n\t\t\t\ttype: \"text\",\n\t\t\t\tattributes: {\n\t\t\t\t\ttext: {\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tvalue: $tw.language.getString(\"Buttons/Close/Caption\")\n\t\t\t}}}\n\t\t]}],\n\t\tparentWidget: $tw.rootWidget,\n\t\tdocument: document,\n\t\tvariables: variables,\n\t\timportPageMacros: true\n\t});\n\tfooterWidgetNode.render(modalFooterButtons,null);\n\t// Set up the refresh handler\n\trefreshHandler = function(changes) {\n\t\theaderWidgetNode.refresh(changes,modalHeader,null);\n\t\tbodyWidgetNode.refresh(changes,modalBody,null);\n\t\tfooterWidgetNode.refresh(changes,modalFooterButtons,null);\n\t};\n\tthis.wiki.addEventListener(\"change\",refreshHandler);\n\t// Add the close event handler\n\tvar closeHandler = function(event) {\n\t\t// Remove our refresh handler\n\t\tself.wiki.removeEventListener(\"change\",refreshHandler);\n\t\t// Decrease the modal count and adjust the body class\n\t\tself.modalCount--;\n\t\tself.adjustPageClass();\n\t\t// Force layout and animate the modal message away\n\t\t$tw.utils.forceLayout(modalBackdrop);\n\t\t$tw.utils.forceLayout(modalWrapper);\n\t\t$tw.utils.setStyle(modalBackdrop,[\n\t\t\t{opacity: \"0\"}\n\t\t]);\n\t\t$tw.utils.setStyle(modalWrapper,[\n\t\t\t{transform: \"translateY(\" + window.innerHeight + \"px)\"}\n\t\t]);\n\t\t// Set up an event for the transition end\n\t\twindow.setTimeout(function() {\n\t\t\tif(wrapper.parentNode) {\n\t\t\t\t// Remove the modal message from the DOM\n\t\t\t\tdocument.body.removeChild(wrapper);\n\t\t\t}\n\t\t},duration);\n\t\t// Don't let anyone else handle the tm-close-tiddler message\n\t\treturn false;\n\t};\n\theaderWidgetNode.addEventListener(\"tm-close-tiddler\",closeHandler,false);\n\tbodyWidgetNode.addEventListener(\"tm-close-tiddler\",closeHandler,false);\n\tfooterWidgetNode.addEventListener(\"tm-close-tiddler\",closeHandler,false);\n\t// Set the initial styles for the message\n\t$tw.utils.setStyle(modalBackdrop,[\n\t\t{opacity: \"0\"}\n\t]);\n\t$tw.utils.setStyle(modalWrapper,[\n\t\t{transformOrigin: \"0% 0%\"},\n\t\t{transform: \"translateY(\" + (-window.innerHeight) + \"px)\"}\n\t]);\n\t// Put the message into the document\n\tdocument.body.appendChild(wrapper);\n\t// Set up animation for the styles\n\t$tw.utils.setStyle(modalBackdrop,[\n\t\t{transition: \"opacity \" + duration + \"ms ease-out\"}\n\t]);\n\t$tw.utils.setStyle(modalWrapper,[\n\t\t{transition: $tw.utils.roundTripPropertyName(\"transform\") + \" \" + duration + \"ms ease-in-out\"}\n\t]);\n\t// Force layout\n\t$tw.utils.forceLayout(modalBackdrop);\n\t$tw.utils.forceLayout(modalWrapper);\n\t// Set final animated styles\n\t$tw.utils.setStyle(modalBackdrop,[\n\t\t{opacity: \"0.7\"}\n\t]);\n\t$tw.utils.setStyle(modalWrapper,[\n\t\t{transform: \"translateY(0px)\"}\n\t]);\n};\n\nModal.prototype.adjustPageClass = function() {\n\tif($tw.pageContainer) {\n\t\t$tw.utils.toggleClass($tw.pageContainer,\"tc-modal-displayed\",this.modalCount > 0);\n\t}\n};\n\nexports.Modal = Modal;\n\n})();\n",
            "title": "$:/core/modules/utils/dom/modal.js",
            "type": "application/javascript",
            "module-type": "utils"
        },
        "$:/core/modules/utils/dom/notifier.js": {
            "text": "/*\\\ntitle: $:/core/modules/utils/dom/notifier.js\ntype: application/javascript\nmodule-type: utils\n\nNotifier mechanism\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar widget = require(\"$:/core/modules/widgets/widget.js\");\n\nvar Notifier = function(wiki) {\n\tthis.wiki = wiki;\n};\n\n/*\nDisplay a notification\n\ttitle: Title of tiddler containing the notification text\n\toptions: see below\nOptions include:\n*/\nNotifier.prototype.display = function(title,options) {\n\toptions = options || {};\n\t// Create the wrapper divs\n\tvar self = this,\n\t\tnotification = document.createElement(\"div\"),\n\t\ttiddler = this.wiki.getTiddler(title),\n\t\tduration = $tw.utils.getAnimationDuration(),\n\t\trefreshHandler;\n\t// Don't do anything if the tiddler doesn't exist\n\tif(!tiddler) {\n\t\treturn;\n\t}\n\t// Add classes\n\t$tw.utils.addClass(notification,\"tc-notification\");\n\t// Create the variables\n\tvar variables = $tw.utils.extend({currentTiddler: title},options.variables);\n\t// Render the body of the notification\n\tvar widgetNode = this.wiki.makeTranscludeWidget(title,{\n\t\tparentWidget: $tw.rootWidget,\n\t\tdocument: document,\n\t\tvariables: variables,\n\t\timportPageMacros: true});\n\twidgetNode.render(notification,null);\n\trefreshHandler = function(changes) {\n\t\twidgetNode.refresh(changes,notification,null);\n\t};\n\tthis.wiki.addEventListener(\"change\",refreshHandler);\n\t// Set the initial styles for the notification\n\t$tw.utils.setStyle(notification,[\n\t\t{opacity: \"0\"},\n\t\t{transformOrigin: \"0% 0%\"},\n\t\t{transform: \"translateY(\" + (-window.innerHeight) + \"px)\"},\n\t\t{transition: \"opacity \" + duration + \"ms ease-out, \" + $tw.utils.roundTripPropertyName(\"transform\") + \" \" + duration + \"ms ease-in-out\"}\n\t]);\n\t// Add the notification to the DOM\n\tdocument.body.appendChild(notification);\n\t// Force layout\n\t$tw.utils.forceLayout(notification);\n\t// Set final animated styles\n\t$tw.utils.setStyle(notification,[\n\t\t{opacity: \"1.0\"},\n\t\t{transform: \"translateY(0px)\"}\n\t]);\n\t// Set a timer to remove the notification\n\twindow.setTimeout(function() {\n\t\t// Remove our change event handler\n\t\tself.wiki.removeEventListener(\"change\",refreshHandler);\n\t\t// Force layout and animate the notification away\n\t\t$tw.utils.forceLayout(notification);\n\t\t$tw.utils.setStyle(notification,[\n\t\t\t{opacity: \"0.0\"},\n\t\t\t{transform: \"translateX(\" + (notification.offsetWidth) + \"px)\"}\n\t\t]);\n\t\t// Remove the modal message from the DOM once the transition ends\n\t\tsetTimeout(function() {\n\t\t\tif(notification.parentNode) {\n\t\t\t\tdocument.body.removeChild(notification);\n\t\t\t}\n\t\t},duration);\n\t},$tw.config.preferences.notificationDuration);\n};\n\nexports.Notifier = Notifier;\n\n})();\n",
            "title": "$:/core/modules/utils/dom/notifier.js",
            "type": "application/javascript",
            "module-type": "utils"
        },
        "$:/core/modules/utils/dom/popup.js": {
            "text": "/*\\\ntitle: $:/core/modules/utils/dom/popup.js\ntype: application/javascript\nmodule-type: utils\n\nModule that creates a $tw.utils.Popup object prototype that manages popups in the browser\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nCreates a Popup object with these options:\n\trootElement: the DOM element to which the popup zapper should be attached\n*/\nvar Popup = function(options) {\n\toptions = options || {};\n\tthis.rootElement = options.rootElement || document.documentElement;\n\tthis.popups = []; // Array of {title:,wiki:,domNode:} objects\n};\n\n/*\nTrigger a popup open or closed. Parameters are in a hashmap:\n\ttitle: title of the tiddler where the popup details are stored\n\tdomNode: dom node to which the popup will be positioned\n\twiki: wiki\n\tforce: if specified, forces the popup state to true or false (instead of toggling it)\n*/\nPopup.prototype.triggerPopup = function(options) {\n\t// Check if this popup is already active\n\tvar index = this.findPopup(options.title);\n\t// Compute the new state\n\tvar state = index === -1;\n\tif(options.force !== undefined) {\n\t\tstate = options.force;\n\t}\n\t// Show or cancel the popup according to the new state\n\tif(state) {\n\t\tthis.show(options);\n\t} else {\n\t\tthis.cancel(index);\n\t}\n};\n\nPopup.prototype.findPopup = function(title) {\n\tvar index = -1;\n\tfor(var t=0; t<this.popups.length; t++) {\n\t\tif(this.popups[t].title === title) {\n\t\t\tindex = t;\n\t\t}\n\t}\n\treturn index;\n};\n\nPopup.prototype.handleEvent = function(event) {\n\tif(event.type === \"click\") {\n\t\t// Find out what was clicked on\n\t\tvar info = this.popupInfo(event.target),\n\t\t\tcancelLevel = info.popupLevel - 1;\n\t\t// Don't remove the level that was clicked on if we clicked on a handle\n\t\tif(info.isHandle) {\n\t\t\tcancelLevel++;\n\t\t}\n\t\t// Cancel\n\t\tthis.cancel(cancelLevel);\n\t}\n};\n\n/*\nFind the popup level containing a DOM node. Returns:\npopupLevel: count of the number of nested popups containing the specified element\nisHandle: true if the specified element is within a popup handle\n*/\nPopup.prototype.popupInfo = function(domNode) {\n\tvar isHandle = false,\n\t\tpopupCount = 0,\n\t\tnode = domNode;\n\t// First check ancestors to see if we're within a popup handle\n\twhile(node) {\n\t\tif($tw.utils.hasClass(node,\"tc-popup-handle\")) {\n\t\t\tisHandle = true;\n\t\t\tpopupCount++;\n\t\t}\n\t\tif($tw.utils.hasClass(node,\"tc-popup-keep\")) {\n\t\t\tisHandle = true;\n\t\t}\n\t\tnode = node.parentNode;\n\t}\n\t// Then count the number of ancestor popups\n\tnode = domNode;\n\twhile(node) {\n\t\tif($tw.utils.hasClass(node,\"tc-popup\")) {\n\t\t\tpopupCount++;\n\t\t}\n\t\tnode = node.parentNode;\n\t}\n\tvar info = {\n\t\tpopupLevel: popupCount,\n\t\tisHandle: isHandle\n\t};\n\treturn info;\n};\n\n/*\nDisplay a popup by adding it to the stack\n*/\nPopup.prototype.show = function(options) {\n\t// Find out what was clicked on\n\tvar info = this.popupInfo(options.domNode);\n\t// Cancel any higher level popups\n\tthis.cancel(info.popupLevel);\n\t// Store the popup details if not already there\n\tif(this.findPopup(options.title) === -1) {\n\t\tthis.popups.push({\n\t\t\ttitle: options.title,\n\t\t\twiki: options.wiki,\n\t\t\tdomNode: options.domNode\n\t\t});\n\t}\n\t// Set the state tiddler\n\toptions.wiki.setTextReference(options.title,\n\t\t\t\"(\" + options.domNode.offsetLeft + \",\" + options.domNode.offsetTop + \",\" + \n\t\t\t\toptions.domNode.offsetWidth + \",\" + options.domNode.offsetHeight + \")\");\n\t// Add the click handler if we have any popups\n\tif(this.popups.length > 0) {\n\t\tthis.rootElement.addEventListener(\"click\",this,true);\t\t\n\t}\n};\n\n/*\nCancel all popups at or above a specified level or DOM node\nlevel: popup level to cancel (0 cancels all popups)\n*/\nPopup.prototype.cancel = function(level) {\n\tvar numPopups = this.popups.length;\n\tlevel = Math.max(0,Math.min(level,numPopups));\n\tfor(var t=level; t<numPopups; t++) {\n\t\tvar popup = this.popups.pop();\n\t\tif(popup.title) {\n\t\t\tpopup.wiki.deleteTiddler(popup.title);\n\t\t}\n\t}\n\tif(this.popups.length === 0) {\n\t\tthis.rootElement.removeEventListener(\"click\",this,false);\n\t}\n};\n\n/*\nReturns true if the specified title and text identifies an active popup\n*/\nPopup.prototype.readPopupState = function(text) {\n\tvar popupLocationRegExp = /^\\((-?[0-9\\.E]+),(-?[0-9\\.E]+),(-?[0-9\\.E]+),(-?[0-9\\.E]+)\\)$/;\n\treturn popupLocationRegExp.test(text);\n};\n\nexports.Popup = Popup;\n\n})();\n",
            "title": "$:/core/modules/utils/dom/popup.js",
            "type": "application/javascript",
            "module-type": "utils"
        },
        "$:/core/modules/utils/dom/scroller.js": {
            "text": "/*\\\ntitle: $:/core/modules/utils/dom/scroller.js\ntype: application/javascript\nmodule-type: utils\n\nModule that creates a $tw.utils.Scroller object prototype that manages scrolling in the browser\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nEvent handler for when the `tm-scroll` event hits the document body\n*/\nvar PageScroller = function() {\n\tthis.idRequestFrame = null;\n\tthis.requestAnimationFrame = window.requestAnimationFrame ||\n\t\twindow.webkitRequestAnimationFrame ||\n\t\twindow.mozRequestAnimationFrame ||\n\t\tfunction(callback) {\n\t\t\treturn window.setTimeout(callback, 1000/60);\n\t\t};\n\tthis.cancelAnimationFrame = window.cancelAnimationFrame ||\n\t\twindow.webkitCancelAnimationFrame ||\n\t\twindow.webkitCancelRequestAnimationFrame ||\n\t\twindow.mozCancelAnimationFrame ||\n\t\twindow.mozCancelRequestAnimationFrame ||\n\t\tfunction(id) {\n\t\t\twindow.clearTimeout(id);\n\t\t};\n};\n\nPageScroller.prototype.cancelScroll = function() {\n\tif(this.idRequestFrame) {\n\t\tthis.cancelAnimationFrame.call(window,this.idRequestFrame);\n\t\tthis.idRequestFrame = null;\n\t}\n};\n\n/*\nHandle an event\n*/\nPageScroller.prototype.handleEvent = function(event) {\n\tif(event.type === \"tm-scroll\") {\n\t\treturn this.scrollIntoView(event.target);\n\t}\n\treturn true;\n};\n\n/*\nHandle a scroll event hitting the page document\n*/\nPageScroller.prototype.scrollIntoView = function(element) {\n\tvar duration = $tw.utils.getAnimationDuration();\n\t// Now get ready to scroll the body\n\tthis.cancelScroll();\n\tthis.startTime = Date.now();\n\tvar scrollPosition = $tw.utils.getScrollPosition();\n\t// Get the client bounds of the element and adjust by the scroll position\n\tvar clientBounds = element.getBoundingClientRect(),\n\t\tbounds = {\n\t\t\tleft: clientBounds.left + scrollPosition.x,\n\t\t\ttop: clientBounds.top + scrollPosition.y,\n\t\t\twidth: clientBounds.width,\n\t\t\theight: clientBounds.height\n\t\t};\n\t// We'll consider the horizontal and vertical scroll directions separately via this function\n\t// targetPos/targetSize - position and size of the target element\n\t// currentPos/currentSize - position and size of the current scroll viewport\n\t// returns: new position of the scroll viewport\n\tvar getEndPos = function(targetPos,targetSize,currentPos,currentSize) {\n\t\t\tvar newPos = currentPos;\n\t\t\t// If the target is above/left of the current view, then scroll to it's top/left\n\t\t\tif(targetPos <= currentPos) {\n\t\t\t\tnewPos = targetPos;\n\t\t\t// If the target is smaller than the window and the scroll position is too far up, then scroll till the target is at the bottom of the window\n\t\t\t} else if(targetSize < currentSize && currentPos < (targetPos + targetSize - currentSize)) {\n\t\t\t\tnewPos = targetPos + targetSize - currentSize;\n\t\t\t// If the target is big, then just scroll to the top\n\t\t\t} else if(currentPos < targetPos) {\n\t\t\t\tnewPos = targetPos;\n\t\t\t// Otherwise, stay where we are\n\t\t\t} else {\n\t\t\t\tnewPos = currentPos;\n\t\t\t}\n\t\t\t// If we are scrolling within 50 pixels of the top/left then snap to zero\n\t\t\tif(newPos < 50) {\n\t\t\t\tnewPos = 0;\n\t\t\t}\n\t\t\treturn newPos;\n\t\t},\n\t\tendX = getEndPos(bounds.left,bounds.width,scrollPosition.x,window.innerWidth),\n\t\tendY = getEndPos(bounds.top,bounds.height,scrollPosition.y,window.innerHeight);\n\t// Only scroll if the position has changed\n\tif(endX !== scrollPosition.x || endY !== scrollPosition.y) {\n\t\tvar self = this,\n\t\t\tdrawFrame;\n\t\tdrawFrame = function () {\n\t\t\tvar t;\n\t\t\tif(duration <= 0) {\n\t\t\t\tt = 1;\n\t\t\t} else {\n\t\t\t\tt = ((Date.now()) - self.startTime) / duration;\t\n\t\t\t}\n\t\t\tif(t >= 1) {\n\t\t\t\tself.cancelScroll();\n\t\t\t\tt = 1;\n\t\t\t}\n\t\t\tt = $tw.utils.slowInSlowOut(t);\n\t\t\twindow.scrollTo(scrollPosition.x + (endX - scrollPosition.x) * t,scrollPosition.y + (endY - scrollPosition.y) * t);\n\t\t\tif(t < 1) {\n\t\t\t\tself.idRequestFrame = self.requestAnimationFrame.call(window,drawFrame);\n\t\t\t}\n\t\t};\n\t\tdrawFrame();\n\t}\n};\n\nexports.PageScroller = PageScroller;\n\n})();\n",
            "title": "$:/core/modules/utils/dom/scroller.js",
            "type": "application/javascript",
            "module-type": "utils"
        },
        "$:/core/modules/utils/edition-info.js": {
            "text": "/*\\\ntitle: $:/core/modules/utils/edition-info.js\ntype: application/javascript\nmodule-type: utils-node\n\nInformation about the available editions\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar fs = require(\"fs\"),\n\tpath = require(\"path\");\n\nvar editionInfo;\n\nexports.getEditionInfo = function() {\n\tif(!editionInfo) {\n\t\t// Enumerate the edition paths\n\t\tvar editionPaths = $tw.getLibraryItemSearchPaths($tw.config.editionsPath,$tw.config.editionsEnvVar);\n\t\teditionInfo = {};\n\t\tfor(var editionIndex=0; editionIndex<editionPaths.length; editionIndex++) {\n\t\t\tvar editionPath = editionPaths[editionIndex];\n\t\t\t// Enumerate the folders\n\t\t\tvar entries = fs.readdirSync(editionPath);\n\t\t\tfor(var entryIndex=0; entryIndex<entries.length; entryIndex++) {\n\t\t\t\tvar entry = entries[entryIndex];\n\t\t\t\t// Check if directories have a valid tiddlywiki.info\n\t\t\t\tif(!editionInfo[entry] && $tw.utils.isDirectory(path.resolve(editionPath,entry))) {\n\t\t\t\t\tvar info;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tinfo = JSON.parse(fs.readFileSync(path.resolve(editionPath,entry,\"tiddlywiki.info\"),\"utf8\"));\n\t\t\t\t\t} catch(ex) {\n\t\t\t\t\t}\n\t\t\t\t\tif(info) {\n\t\t\t\t\t\teditionInfo[entry] = info;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn editionInfo;\n};\n\n})();\n",
            "title": "$:/core/modules/utils/edition-info.js",
            "type": "application/javascript",
            "module-type": "utils-node"
        },
        "$:/core/modules/utils/fakedom.js": {
            "text": "/*\\\ntitle: $:/core/modules/utils/fakedom.js\ntype: application/javascript\nmodule-type: global\n\nA barebones implementation of DOM interfaces needed by the rendering mechanism.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n// Sequence number used to enable us to track objects for testing\nvar sequenceNumber = null;\n\nvar bumpSequenceNumber = function(object) {\n\tif(sequenceNumber !== null) {\n\t\tobject.sequenceNumber = sequenceNumber++;\n\t}\n};\n\nvar TW_TextNode = function(text) {\n\tbumpSequenceNumber(this);\n\tthis.textContent = text + \"\";\n};\n\nObject.defineProperty(TW_TextNode.prototype, \"nodeType\", {\n\tget: function() {\n\t\treturn 3;\n\t}\n});\n\nObject.defineProperty(TW_TextNode.prototype, \"formattedTextContent\", {\n\tget: function() {\n\t\treturn this.textContent.replace(/(\\r?\\n)/g,\"\");\n\t}\n});\n\nvar TW_Element = function(tag,namespace) {\n\tbumpSequenceNumber(this);\n\tthis.isTiddlyWikiFakeDom = true;\n\tthis.tag = tag;\n\tthis.attributes = {};\n\tthis.isRaw = false;\n\tthis.children = [];\n\tthis.style = {};\n\tthis.namespaceURI = namespace || \"http://www.w3.org/1999/xhtml\";\n};\n\nObject.defineProperty(TW_Element.prototype, \"nodeType\", {\n\tget: function() {\n\t\treturn 1;\n\t}\n});\n\nTW_Element.prototype.getAttribute = function(name) {\n\tif(this.isRaw) {\n\t\tthrow \"Cannot getAttribute on a raw TW_Element\";\n\t}\n\treturn this.attributes[name];\n};\n\nTW_Element.prototype.setAttribute = function(name,value) {\n\tif(this.isRaw) {\n\t\tthrow \"Cannot setAttribute on a raw TW_Element\";\n\t}\n\tthis.attributes[name] = value + \"\";\n};\n\nTW_Element.prototype.setAttributeNS = function(namespace,name,value) {\n\tthis.setAttribute(name,value);\n};\n\nTW_Element.prototype.removeAttribute = function(name) {\n\tif(this.isRaw) {\n\t\tthrow \"Cannot removeAttribute on a raw TW_Element\";\n\t}\n\tif($tw.utils.hop(this.attributes,name)) {\n\t\tdelete this.attributes[name];\n\t}\n};\n\nTW_Element.prototype.appendChild = function(node) {\n\tthis.children.push(node);\n\tnode.parentNode = this;\n};\n\nTW_Element.prototype.insertBefore = function(node,nextSibling) {\n\tif(nextSibling) {\n\t\tvar p = this.children.indexOf(nextSibling);\n\t\tif(p !== -1) {\n\t\t\tthis.children.splice(p,0,node);\n\t\t\tnode.parentNode = this;\n\t\t} else {\n\t\t\tthis.appendChild(node);\n\t\t}\n\t} else {\n\t\tthis.appendChild(node);\n\t}\n};\n\nTW_Element.prototype.removeChild = function(node) {\n\tvar p = this.children.indexOf(node);\n\tif(p !== -1) {\n\t\tthis.children.splice(p,1);\n\t}\n};\n\nTW_Element.prototype.hasChildNodes = function() {\n\treturn !!this.children.length;\n};\n\nObject.defineProperty(TW_Element.prototype, \"childNodes\", {\n\tget: function() {\n\t\treturn this.children;\n\t}\n});\n\nObject.defineProperty(TW_Element.prototype, \"firstChild\", {\n\tget: function() {\n\t\treturn this.children[0];\n\t}\n});\n\nTW_Element.prototype.addEventListener = function(type,listener,useCapture) {\n\t// Do nothing\n};\n\nObject.defineProperty(TW_Element.prototype, \"tagName\", {\n\tget: function() {\n\t\treturn this.tag || \"\";\n\t}\n});\n\nObject.defineProperty(TW_Element.prototype, \"className\", {\n\tget: function() {\n\t\treturn this.attributes[\"class\"] || \"\";\n\t},\n\tset: function(value) {\n\t\tthis.attributes[\"class\"] = value + \"\";\n\t}\n});\n\nObject.defineProperty(TW_Element.prototype, \"value\", {\n\tget: function() {\n\t\treturn this.attributes.value || \"\";\n\t},\n\tset: function(value) {\n\t\tthis.attributes.value = value + \"\";\n\t}\n});\n\nObject.defineProperty(TW_Element.prototype, \"outerHTML\", {\n\tget: function() {\n\t\tvar output = [],attr,a,v;\n\t\toutput.push(\"<\",this.tag);\n\t\tif(this.attributes) {\n\t\t\tattr = [];\n\t\t\tfor(a in this.attributes) {\n\t\t\t\tattr.push(a);\n\t\t\t}\n\t\t\tattr.sort();\n\t\t\tfor(a=0; a<attr.length; a++) {\n\t\t\t\tv = this.attributes[attr[a]];\n\t\t\t\tif(v !== undefined) {\n\t\t\t\t\toutput.push(\" \",attr[a],\"=\\\"\",$tw.utils.htmlEncode(v),\"\\\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(this.style) {\n\t\t\tvar style = [];\n\t\t\tfor(var s in this.style) {\n\t\t\t\tstyle.push(s + \":\" + this.style[s] + \";\");\n\t\t\t}\n\t\t\tif(style.length > 0) {\n\t\t\t\toutput.push(\" style=\\\"\",style.join(\"\"),\"\\\"\")\n\t\t\t}\n\t\t}\n\t\toutput.push(\">\");\n\t\tif($tw.config.htmlVoidElements.indexOf(this.tag) === -1) {\n\t\t\toutput.push(this.innerHTML);\n\t\t\toutput.push(\"</\",this.tag,\">\");\n\t\t}\n\t\treturn output.join(\"\");\n\t}\n});\n\nObject.defineProperty(TW_Element.prototype, \"innerHTML\", {\n\tget: function() {\n\t\tif(this.isRaw) {\n\t\t\treturn this.rawHTML;\n\t\t} else {\n\t\t\tvar b = [];\n\t\t\t$tw.utils.each(this.children,function(node) {\n\t\t\t\tif(node instanceof TW_Element) {\n\t\t\t\t\tb.push(node.outerHTML);\n\t\t\t\t} else if(node instanceof TW_TextNode) {\n\t\t\t\t\tb.push($tw.utils.htmlEncode(node.textContent));\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn b.join(\"\");\n\t\t}\n\t},\n\tset: function(value) {\n\t\tthis.isRaw = true;\n\t\tthis.rawHTML = value;\n\t\tthis.rawTextContent = null;\n\t}\n});\n\nObject.defineProperty(TW_Element.prototype, \"textInnerHTML\", {\n\tset: function(value) {\n\t\tif(this.isRaw) {\n\t\t\tthis.rawTextContent = value;\n\t\t} else {\n\t\t\tthrow \"Cannot set textInnerHTML of a non-raw TW_Element\";\n\t\t}\n\t}\n});\n\nObject.defineProperty(TW_Element.prototype, \"textContent\", {\n\tget: function() {\n\t\tif(this.isRaw) {\n\t\t\tif(this.rawTextContent === null) {\n\t\t\t\tconsole.log(booboo)\n\t\t\t\tthrow \"Cannot get textContent on a raw TW_Element\";\t\t\t\t\n\t\t\t} else {\n\t\t\t\treturn this.rawTextContent;\n\t\t\t}\n\t\t} else {\n\t\t\tvar b = [];\n\t\t\t$tw.utils.each(this.children,function(node) {\n\t\t\t\tb.push(node.textContent);\n\t\t\t});\n\t\t\treturn b.join(\"\");\n\t\t}\n\t},\n\tset: function(value) {\n\t\tthis.children = [new TW_TextNode(value)];\n\t}\n});\n\nObject.defineProperty(TW_Element.prototype, \"formattedTextContent\", {\n\tget: function() {\n\t\tif(this.isRaw) {\n\t\t\tthrow \"Cannot get formattedTextContent on a raw TW_Element\";\n\t\t} else {\n\t\t\tvar b = [],\n\t\t\t\tisBlock = $tw.config.htmlBlockElements.indexOf(this.tag) !== -1;\n\t\t\tif(isBlock) {\n\t\t\t\tb.push(\"\\n\");\n\t\t\t}\n\t\t\tif(this.tag === \"li\") {\n\t\t\t\tb.push(\"* \");\n\t\t\t}\n\t\t\t$tw.utils.each(this.children,function(node) {\n\t\t\t\tb.push(node.formattedTextContent);\n\t\t\t});\n\t\t\tif(isBlock) {\n\t\t\t\tb.push(\"\\n\");\n\t\t\t}\n\t\t\treturn b.join(\"\");\n\t\t}\n\t}\n});\n\nvar document = {\n\tsetSequenceNumber: function(value) {\n\t\tsequenceNumber = value;\n\t},\n\tcreateElementNS: function(namespace,tag) {\n\t\treturn new TW_Element(tag,namespace);\n\t},\n\tcreateElement: function(tag) {\n\t\treturn new TW_Element(tag);\n\t},\n\tcreateTextNode: function(text) {\n\t\treturn new TW_TextNode(text);\n\t},\n\tcompatMode: \"CSS1Compat\", // For KaTeX to know that we're not a browser in quirks mode\n\tisTiddlyWikiFakeDom: true\n};\n\nexports.fakeDocument = document;\n\n})();\n",
            "title": "$:/core/modules/utils/fakedom.js",
            "type": "application/javascript",
            "module-type": "global"
        },
        "$:/core/modules/utils/filesystem.js": {
            "text": "/*\\\ntitle: $:/core/modules/utils/filesystem.js\ntype: application/javascript\nmodule-type: utils-node\n\nFile system utilities\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar fs = require(\"fs\"),\n\tpath = require(\"path\");\n\n/*\nRecursively (and synchronously) copy a directory and all its content\n*/\nexports.copyDirectory = function(srcPath,dstPath) {\n\t// Remove any trailing path separators\n\tsrcPath = $tw.utils.removeTrailingSeparator(srcPath);\n\tdstPath = $tw.utils.removeTrailingSeparator(dstPath);\n\t// Create the destination directory\n\tvar err = $tw.utils.createDirectory(dstPath);\n\tif(err) {\n\t\treturn err;\n\t}\n\t// Function to copy a folder full of files\n\tvar copy = function(srcPath,dstPath) {\n\t\tvar srcStats = fs.lstatSync(srcPath),\n\t\t\tdstExists = fs.existsSync(dstPath);\n\t\tif(srcStats.isFile()) {\n\t\t\t$tw.utils.copyFile(srcPath,dstPath);\n\t\t} else if(srcStats.isDirectory()) {\n\t\t\tvar items = fs.readdirSync(srcPath);\n\t\t\tfor(var t=0; t<items.length; t++) {\n\t\t\t\tvar item = items[t],\n\t\t\t\t\terr = copy(srcPath + path.sep + item,dstPath + path.sep + item);\n\t\t\t\tif(err) {\n\t\t\t\t\treturn err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\tcopy(srcPath,dstPath);\n\treturn null;\n};\n\n/*\nCopy a file\n*/\nvar FILE_BUFFER_LENGTH = 64 * 1024,\n\tfileBuffer;\n\nexports.copyFile = function(srcPath,dstPath) {\n\t// Create buffer if required\n\tif(!fileBuffer) {\n\t\tfileBuffer = new Buffer(FILE_BUFFER_LENGTH);\n\t}\n\t// Create any directories in the destination\n\t$tw.utils.createDirectory(path.dirname(dstPath));\n\t// Copy the file\n\tvar srcFile = fs.openSync(srcPath,\"r\"),\n\t\tdstFile = fs.openSync(dstPath,\"w\"),\n\t\tbytesRead = 1,\n\t\tpos = 0;\n\twhile (bytesRead > 0) {\n\t\tbytesRead = fs.readSync(srcFile,fileBuffer,0,FILE_BUFFER_LENGTH,pos);\n\t\tfs.writeSync(dstFile,fileBuffer,0,bytesRead);\n\t\tpos += bytesRead;\n\t}\n\tfs.closeSync(srcFile);\n\tfs.closeSync(dstFile);\n\treturn null;\n};\n\n/*\nRemove trailing path separator\n*/\nexports.removeTrailingSeparator = function(dirPath) {\n\tvar len = dirPath.length;\n\tif(dirPath.charAt(len-1) === path.sep) {\n\t\tdirPath = dirPath.substr(0,len-1);\n\t}\n\treturn dirPath;\n};\n\n/*\nRecursively create a directory\n*/\nexports.createDirectory = function(dirPath) {\n\tif(dirPath.substr(dirPath.length-1,1) !== path.sep) {\n\t\tdirPath = dirPath + path.sep;\n\t}\n\tvar pos = 1;\n\tpos = dirPath.indexOf(path.sep,pos);\n\twhile(pos !== -1) {\n\t\tvar subDirPath = dirPath.substr(0,pos);\n\t\tif(!$tw.utils.isDirectory(subDirPath)) {\n\t\t\ttry {\n\t\t\t\tfs.mkdirSync(subDirPath);\n\t\t\t} catch(e) {\n\t\t\t\treturn \"Error creating directory '\" + subDirPath + \"'\";\n\t\t\t}\n\t\t}\n\t\tpos = dirPath.indexOf(path.sep,pos + 1);\n\t}\n\treturn null;\n};\n\n/*\nRecursively create directories needed to contain a specified file\n*/\nexports.createFileDirectories = function(filePath) {\n\treturn $tw.utils.createDirectory(path.dirname(filePath));\n};\n\n/*\nRecursively delete a directory\n*/\nexports.deleteDirectory = function(dirPath) {\n\tif(fs.existsSync(dirPath)) {\n\t\tvar entries = fs.readdirSync(dirPath);\n\t\tfor(var entryIndex=0; entryIndex<entries.length; entryIndex++) {\n\t\t\tvar currPath = dirPath + path.sep + entries[entryIndex];\n\t\t\tif(fs.lstatSync(currPath).isDirectory()) {\n\t\t\t\t$tw.utils.deleteDirectory(currPath);\n\t\t\t} else {\n\t\t\t\tfs.unlinkSync(currPath);\n\t\t\t}\n\t\t}\n\tfs.rmdirSync(dirPath);\n\t}\n\treturn null;\n};\n\n/*\nCheck if a path identifies a directory\n*/\nexports.isDirectory = function(dirPath) {\n\treturn fs.existsSync(dirPath) && fs.statSync(dirPath).isDirectory();\n};\n\n/*\nCheck if a path identifies a directory that is empty\n*/\nexports.isDirectoryEmpty = function(dirPath) {\n\tif(!$tw.utils.isDirectory(dirPath)) {\n\t\treturn false;\n\t}\n\tvar files = fs.readdirSync(dirPath),\n\t\tempty = true;\n\t$tw.utils.each(files,function(file,index) {\n\t\tif(file.charAt(0) !== \".\") {\n\t\t\tempty = false;\n\t\t}\n\t});\n\treturn empty;\n};\n\n/*\nRecursively delete a tree of empty directories\n*/\nexports.deleteEmptyDirs = function(dirpath,callback) {\n\tvar self = this;\n\tfs.readdir(dirpath,function(err,files) {\n\t\tif(err) {\n\t\t\treturn callback(err);\n\t\t}\n\t\tif(files.length > 0) {\n\t\t\treturn callback(null);\n\t\t}\n\t\tfs.rmdir(dirpath,function(err) {\n\t\t\tif(err) {\n\t\t\t\treturn callback(err);\n\t\t\t}\n\t\t\tself.deleteEmptyDirs(path.dirname(dirpath),callback);\n\t\t});\n\t});\n};\n\n})();\n",
            "title": "$:/core/modules/utils/filesystem.js",
            "type": "application/javascript",
            "module-type": "utils-node"
        },
        "$:/core/modules/utils/logger.js": {
            "text": "/*\\\ntitle: $:/core/modules/utils/logger.js\ntype: application/javascript\nmodule-type: utils\n\nA basic logging implementation\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar ALERT_TAG = \"$:/tags/Alert\";\n\n/*\nMake a new logger\n*/\nfunction Logger(componentName) {\n\tthis.componentName = componentName || \"\";\n}\n\n/*\nLog a message\n*/\nLogger.prototype.log = function(/* args */) {\n\tif(console !== undefined && console.log !== undefined) {\n\t\treturn Function.apply.call(console.log, console, [this.componentName + \":\"].concat(Array.prototype.slice.call(arguments,0)));\n\t}\n};\n\n/*\nAlert a message\n*/\nLogger.prototype.alert = function(/* args */) {\n\t// Prepare the text of the alert\n\tvar text = Array.prototype.join.call(arguments,\" \");\n\t// Create alert tiddlers in the browser\n\tif($tw.browser) {\n\t\t// Check if there is an existing alert with the same text and the same component\n\t\tvar existingAlerts = $tw.wiki.getTiddlersWithTag(ALERT_TAG),\n\t\t\talertFields,\n\t\t\texistingCount,\n\t\t\tself = this;\n\t\t$tw.utils.each(existingAlerts,function(title) {\n\t\t\tvar tiddler = $tw.wiki.getTiddler(title);\n\t\t\tif(tiddler.fields.text === text && tiddler.fields.component === self.componentName && tiddler.fields.modified && (!alertFields || tiddler.fields.modified < alertFields.modified)) {\n\t\t\t\t\talertFields = $tw.utils.extend({},tiddler.fields);\n\t\t\t}\n\t\t});\n\t\tif(alertFields) {\n\t\t\texistingCount = alertFields.count || 1;\n\t\t} else {\n\t\t\talertFields = {\n\t\t\t\ttitle: $tw.wiki.generateNewTitle(\"$:/temp/alerts/alert\",{prefix: \"\"}),\n\t\t\t\ttext: text,\n\t\t\t\ttags: [ALERT_TAG],\n\t\t\t\tcomponent: this.componentName\n\t\t\t};\n\t\t\texistingCount = 0;\n\t\t}\n\t\talertFields.modified = new Date();\n\t\tif(++existingCount > 1) {\n\t\t\talertFields.count = existingCount;\n\t\t} else {\n\t\t\talertFields.count = undefined;\n\t\t}\n\t\t$tw.wiki.addTiddler(new $tw.Tiddler(alertFields));\n\t\t// Log the alert as well\n\t\tthis.log.apply(this,Array.prototype.slice.call(arguments,0));\n\t} else {\n\t\t// Print an orange message to the console if not in the browser\n\t\tconsole.error(\"\\x1b[1;33m\" + text + \"\\x1b[0m\");\n\t}\n};\n\nexports.Logger = Logger;\n\n})();\n",
            "title": "$:/core/modules/utils/logger.js",
            "type": "application/javascript",
            "module-type": "utils"
        },
        "$:/core/modules/utils/parsetree.js": {
            "text": "/*\\\ntitle: $:/core/modules/utils/parsetree.js\ntype: application/javascript\nmodule-type: utils\n\nParse tree utility functions.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.addAttributeToParseTreeNode = function(node,name,value) {\n\tnode.attributes = node.attributes || {};\n\tnode.attributes[name] = {type: \"string\", value: value};\n};\n\nexports.getAttributeValueFromParseTreeNode = function(node,name,defaultValue) {\n\tif(node.attributes && node.attributes[name] && node.attributes[name].value !== undefined) {\n\t\treturn node.attributes[name].value;\n\t}\n\treturn defaultValue;\n};\n\nexports.addClassToParseTreeNode = function(node,classString) {\n\tvar classes = [];\n\tnode.attributes = node.attributes || {};\n\tnode.attributes[\"class\"] = node.attributes[\"class\"] || {type: \"string\", value: \"\"};\n\tif(node.attributes[\"class\"].type === \"string\") {\n\t\tif(node.attributes[\"class\"].value !== \"\") {\n\t\t\tclasses = node.attributes[\"class\"].value.split(\" \");\n\t\t}\n\t\tif(classString !== \"\") {\n\t\t\t$tw.utils.pushTop(classes,classString.split(\" \"));\n\t\t}\n\t\tnode.attributes[\"class\"].value = classes.join(\" \");\n\t}\n};\n\nexports.addStyleToParseTreeNode = function(node,name,value) {\n\t\tnode.attributes = node.attributes || {};\n\t\tnode.attributes.style = node.attributes.style || {type: \"string\", value: \"\"};\n\t\tif(node.attributes.style.type === \"string\") {\n\t\t\tnode.attributes.style.value += name + \":\" + value + \";\";\n\t\t}\n};\n\nexports.findParseTreeNode = function(nodeArray,search) {\n\tfor(var t=0; t<nodeArray.length; t++) {\n\t\tif(nodeArray[t].type === search.type && nodeArray[t].tag === search.tag) {\n\t\t\treturn nodeArray[t];\n\t\t}\n\t}\n\treturn undefined;\n};\n\n/*\nHelper to get the text of a parse tree node or array of nodes\n*/\nexports.getParseTreeText = function getParseTreeText(tree) {\n\tvar output = [];\n\tif($tw.utils.isArray(tree)) {\n\t\t$tw.utils.each(tree,function(node) {\n\t\t\toutput.push(getParseTreeText(node));\n\t\t});\n\t} else {\n\t\tif(tree.type === \"text\") {\n\t\t\toutput.push(tree.text);\n\t\t}\n\t\tif(tree.children) {\n\t\t\treturn getParseTreeText(tree.children);\n\t\t}\n\t}\n\treturn output.join(\"\");\n};\n\n})();\n",
            "title": "$:/core/modules/utils/parsetree.js",
            "type": "application/javascript",
            "module-type": "utils"
        },
        "$:/core/modules/utils/performance.js": {
            "text": "/*\\\ntitle: $:/core/modules/utils/performance.js\ntype: application/javascript\nmodule-type: global\n\nPerformance measurement.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nfunction Performance(enabled) {\n\tthis.enabled = !!enabled;\n\tthis.measures = {}; // Hashmap of current values of measurements\n\tthis.logger = new $tw.utils.Logger(\"performance\");\n}\n\n/*\nWrap performance reporting around a top level function\n*/\nPerformance.prototype.report = function(name,fn) {\n\tvar self = this;\n\tif(this.enabled) {\n\t\treturn function() {\n\t\t\tself.measures = {};\n\t\t\tvar startTime = $tw.utils.timer(),\n\t\t\t\tresult = fn.apply(this,arguments);\n\t\t\tself.logger.log(name + \": \" + $tw.utils.timer(startTime).toFixed(2) + \"ms\");\n\t\t\tfor(var m in self.measures) {\n\t\t\t\tself.logger.log(\"+\" + m + \": \" + self.measures[m].toFixed(2) + \"ms\");\n\t\t\t}\n\t\t\treturn result;\n\t\t};\n\t} else {\n\t\treturn fn;\n\t}\n};\n\n/*\nWrap performance measurements around a subfunction\n*/\nPerformance.prototype.measure = function(name,fn) {\n\tvar self = this;\n\tif(this.enabled) {\n\t\treturn function() {\n\t\t\tvar startTime = $tw.utils.timer(),\n\t\t\t\tresult = fn.apply(this,arguments),\n\t\t\t\tvalue = self.measures[name] || 0;\n\t\t\tself.measures[name] = value + $tw.utils.timer(startTime);\n\t\t\treturn result;\n\t\t};\n\t} else {\n\t\treturn fn;\n\t}\n};\n\nexports.Performance = Performance;\n\n})();\n",
            "title": "$:/core/modules/utils/performance.js",
            "type": "application/javascript",
            "module-type": "global"
        },
        "$:/core/modules/utils/pluginmaker.js": {
            "text": "/*\\\ntitle: $:/core/modules/utils/pluginmaker.js\ntype: application/javascript\nmodule-type: utils\n\nA quick and dirty way to pack up plugins within the browser.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nRepack a plugin, and then delete any non-shadow payload tiddlers\n*/\nexports.repackPlugin = function(title,additionalTiddlers,excludeTiddlers) {\n\tadditionalTiddlers = additionalTiddlers || [];\n\texcludeTiddlers = excludeTiddlers || [];\n\t// Get the plugin tiddler\n\tvar pluginTiddler = $tw.wiki.getTiddler(title);\n\tif(!pluginTiddler) {\n\t\tthrow \"No such tiddler as \" + title;\n\t}\n\t// Extract the JSON\n\tvar jsonPluginTiddler;\n\ttry {\n\t\tjsonPluginTiddler = JSON.parse(pluginTiddler.fields.text);\n\t} catch(e) {\n\t\tthrow \"Cannot parse plugin tiddler \" + title + \"\\n\" + $tw.language.getString(\"Error/Caption\") + \": \" + e;\n\t}\n\t// Get the list of tiddlers\n\tvar tiddlers = Object.keys(jsonPluginTiddler.tiddlers);\n\t// Add the additional tiddlers\n\t$tw.utils.pushTop(tiddlers,additionalTiddlers);\n\t// Remove any excluded tiddlers\n\tfor(var t=tiddlers.length-1; t>=0; t--) {\n\t\tif(excludeTiddlers.indexOf(tiddlers[t]) !== -1) {\n\t\t\ttiddlers.splice(t,1);\n\t\t}\n\t}\n\t// Pack up the tiddlers into a block of JSON\n\tvar plugins = {};\n\t$tw.utils.each(tiddlers,function(title) {\n\t\tvar tiddler = $tw.wiki.getTiddler(title),\n\t\t\tfields = {};\n\t\t$tw.utils.each(tiddler.fields,function (value,name) {\n\t\t\tfields[name] = tiddler.getFieldString(name);\n\t\t});\n\t\tplugins[title] = fields;\n\t});\n\t// Retrieve and bump the version number\n\tvar pluginVersion = $tw.utils.parseVersion(pluginTiddler.getFieldString(\"version\") || \"0.0.0\") || {\n\t\t\tmajor: \"0\",\n\t\t\tminor: \"0\",\n\t\t\tpatch: \"0\"\n\t\t};\n\tpluginVersion.patch++;\n\tvar version = pluginVersion.major + \".\" + pluginVersion.minor + \".\" + pluginVersion.patch;\n\tif(pluginVersion.prerelease) {\n\t\tversion += \"-\" + pluginVersion.prerelease;\n\t}\n\tif(pluginVersion.build) {\n\t\tversion += \"+\" + pluginVersion.build;\n\t}\n\t// Save the tiddler\n\t$tw.wiki.addTiddler(new $tw.Tiddler(pluginTiddler,{text: JSON.stringify({tiddlers: plugins},null,4), version: version}));\n\t// Delete any non-shadow constituent tiddlers\n\t$tw.utils.each(tiddlers,function(title) {\n\t\tif($tw.wiki.tiddlerExists(title)) {\n\t\t\t$tw.wiki.deleteTiddler(title);\n\t\t}\n\t});\n\t// Trigger an autosave\n\t$tw.rootWidget.dispatchEvent({type: \"tm-auto-save-wiki\"});\n\t// Return a heartwarming confirmation\n\treturn \"Plugin \" + title + \" successfully saved\";\n};\n\n})();\n",
            "title": "$:/core/modules/utils/pluginmaker.js",
            "type": "application/javascript",
            "module-type": "utils"
        },
        "$:/core/modules/utils/utils.js": {
            "text": "/*\\\ntitle: $:/core/modules/utils/utils.js\ntype: application/javascript\nmodule-type: utils\n\nVarious static utility functions.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nDisplay a warning, in colour if we're on a terminal\n*/\nexports.warning = function(text) {\n\tconsole.log($tw.node ? \"\\x1b[1;33m\" + text + \"\\x1b[0m\" : text);\n};\n\n/*\nRepeatedly replaces a substring within a string. Like String.prototype.replace, but without any of the default special handling of $ sequences in the replace string\n*/\nexports.replaceString = function(text,search,replace) {\n\treturn text.replace(search,function() {\n\t\treturn replace;\n\t});\n};\n\n/*\nRepeats a string\n*/\nexports.repeat = function(str,count) {\n\tvar result = \"\";\n\tfor(var t=0;t<count;t++) {\n\t\tresult += str;\n\t}\n\treturn result;\n};\n\n/*\nTrim whitespace from the start and end of a string\nThanks to Steven Levithan, http://blog.stevenlevithan.com/archives/faster-trim-javascript\n*/\nexports.trim = function(str) {\n\tif(typeof str === \"string\") {\n\t\treturn str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n\t} else {\n\t\treturn str;\n\t}\n};\n\n/*\nFind the line break preceding a given position in a string\nReturns position immediately after that line break, or the start of the string\n*/\nexports.findPrecedingLineBreak = function(text,pos) {\n\tvar result = text.lastIndexOf(\"\\n\",pos - 1);\n\tif(result === -1) {\n\t\tresult = 0;\n\t} else {\n\t\tresult++;\n\t\tif(text.charAt(result) === \"\\r\") {\n\t\t\tresult++;\n\t\t}\n\t}\n\treturn result;\n};\n\n/*\nFind the line break following a given position in a string\n*/\nexports.findFollowingLineBreak = function(text,pos) {\n\t// Cut to just past the following line break, or to the end of the text\n\tvar result = text.indexOf(\"\\n\",pos);\n\tif(result === -1) {\n\t\tresult = text.length;\n\t} else {\n\t\tif(text.charAt(result) === \"\\r\") {\n\t\t\tresult++;\n\t\t}\n\t}\n\treturn result;\n};\n\n/*\nReturn the number of keys in an object\n*/\nexports.count = function(object) {\n\treturn Object.keys(object || {}).length;\n};\n\n/*\nCheck if an array is equal by value and by reference.\n*/\nexports.isArrayEqual = function(array1,array2) {\n\tif(array1 === array2) {\n\t\treturn true;\n\t}\n\tarray1 = array1 || [];\n\tarray2 = array2 || [];\n\tif(array1.length !== array2.length) {\n\t\treturn false;\n\t}\n\treturn array1.every(function(value,index) {\n\t\treturn value === array2[index];\n\t});\n};\n\n/*\nPush entries onto an array, removing them first if they already exist in the array\n\tarray: array to modify (assumed to be free of duplicates)\n\tvalue: a single value to push or an array of values to push\n*/\nexports.pushTop = function(array,value) {\n\tvar t,p;\n\tif($tw.utils.isArray(value)) {\n\t\t// Remove any array entries that are duplicated in the new values\n\t\tif(value.length !== 0) {\n\t\t\tif(array.length !== 0) {\n\t\t\t\tif(value.length < array.length) {\n\t\t\t\t\tfor(t=0; t<value.length; t++) {\n\t\t\t\t\t\tp = array.indexOf(value[t]);\n\t\t\t\t\t\tif(p !== -1) {\n\t\t\t\t\t\t\tarray.splice(p,1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfor(t=array.length-1; t>=0; t--) {\n\t\t\t\t\t\tp = value.indexOf(array[t]);\n\t\t\t\t\t\tif(p !== -1) {\n\t\t\t\t\t\t\tarray.splice(t,1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Push the values on top of the main array\n\t\t\tarray.push.apply(array,value);\n\t\t}\n\t} else {\n\t\tp = array.indexOf(value);\n\t\tif(p !== -1) {\n\t\t\tarray.splice(p,1);\n\t\t}\n\t\tarray.push(value);\n\t}\n\treturn array;\n};\n\n/*\nRemove entries from an array\n\tarray: array to modify\n\tvalue: a single value to remove, or an array of values to remove\n*/\nexports.removeArrayEntries = function(array,value) {\n\tvar t,p;\n\tif($tw.utils.isArray(value)) {\n\t\tfor(t=0; t<value.length; t++) {\n\t\t\tp = array.indexOf(value[t]);\n\t\t\tif(p !== -1) {\n\t\t\t\tarray.splice(p,1);\n\t\t\t}\n\t\t}\n\t} else {\n\t\tp = array.indexOf(value);\n\t\tif(p !== -1) {\n\t\t\tarray.splice(p,1);\n\t\t}\n\t}\n};\n\n/*\nCheck whether any members of a hashmap are present in another hashmap\n*/\nexports.checkDependencies = function(dependencies,changes) {\n\tvar hit = false;\n\t$tw.utils.each(changes,function(change,title) {\n\t\tif($tw.utils.hop(dependencies,title)) {\n\t\t\thit = true;\n\t\t}\n\t});\n\treturn hit;\n};\n\nexports.extend = function(object /* [, src] */) {\n\t$tw.utils.each(Array.prototype.slice.call(arguments, 1), function(source) {\n\t\tif(source) {\n\t\t\tfor(var property in source) {\n\t\t\t\tobject[property] = source[property];\n\t\t\t}\n\t\t}\n\t});\n\treturn object;\n};\n\nexports.deepCopy = function(object) {\n\tvar result,t;\n\tif($tw.utils.isArray(object)) {\n\t\t// Copy arrays\n\t\tresult = object.slice(0);\n\t} else if(typeof object === \"object\") {\n\t\tresult = {};\n\t\tfor(t in object) {\n\t\t\tif(object[t] !== undefined) {\n\t\t\t\tresult[t] = $tw.utils.deepCopy(object[t]);\n\t\t\t}\n\t\t}\n\t} else {\n\t\tresult = object;\n\t}\n\treturn result;\n};\n\nexports.extendDeepCopy = function(object,extendedProperties) {\n\tvar result = $tw.utils.deepCopy(object),t;\n\tfor(t in extendedProperties) {\n\t\tif(extendedProperties[t] !== undefined) {\n\t\t\tresult[t] = $tw.utils.deepCopy(extendedProperties[t]);\n\t\t}\n\t}\n\treturn result;\n};\n\nexports.deepFreeze = function deepFreeze(object) {\n\tvar property, key;\n\tif(object) {\n\t\tObject.freeze(object);\n\t\tfor(key in object) {\n\t\t\tproperty = object[key];\n\t\t\tif($tw.utils.hop(object,key) && (typeof property === \"object\") && !Object.isFrozen(property)) {\n\t\t\t\tdeepFreeze(property);\n\t\t\t}\n\t\t}\n\t}\n};\n\nexports.slowInSlowOut = function(t) {\n\treturn (1 - ((Math.cos(t * Math.PI) + 1) / 2));\n};\n\nexports.formatDateString = function(date,template) {\n\tvar result = \"\",\n\t\tt = template,\n\t\tmatches = [\n\t\t\t[/^0hh12/, function() {\n\t\t\t\treturn $tw.utils.pad($tw.utils.getHours12(date));\n\t\t\t}],\n\t\t\t[/^wYYYY/, function() {\n\t\t\t\treturn $tw.utils.getYearForWeekNo(date);\n\t\t\t}],\n\t\t\t[/^hh12/, function() {\n\t\t\t\treturn $tw.utils.getHours12(date);\n\t\t\t}],\n\t\t\t[/^DDth/, function() {\n\t\t\t\treturn date.getDate() + $tw.utils.getDaySuffix(date);\n\t\t\t}],\n\t\t\t[/^YYYY/, function() {\n\t\t\t\treturn date.getFullYear();\n\t\t\t}],\n\t\t\t[/^0hh/, function() {\n\t\t\t\treturn $tw.utils.pad(date.getHours());\n\t\t\t}],\n\t\t\t[/^0mm/, function() {\n\t\t\t\treturn $tw.utils.pad(date.getMinutes());\n\t\t\t}],\n\t\t\t[/^0ss/, function() {\n\t\t\t\treturn $tw.utils.pad(date.getSeconds());\n\t\t\t}],\n\t\t\t[/^0DD/, function() {\n\t\t\t\treturn $tw.utils.pad(date.getDate());\n\t\t\t}],\n\t\t\t[/^0MM/, function() {\n\t\t\t\treturn $tw.utils.pad(date.getMonth()+1);\n\t\t\t}],\n\t\t\t[/^0WW/, function() {\n\t\t\t\treturn $tw.utils.pad($tw.utils.getWeek(date));\n\t\t\t}],\n\t\t\t[/^ddd/, function() {\n\t\t\t\treturn $tw.language.getString(\"Date/Short/Day/\" + date.getDay());\n\t\t\t}],\n\t\t\t[/^mmm/, function() {\n\t\t\t\treturn $tw.language.getString(\"Date/Short/Month/\" + (date.getMonth() + 1));\n\t\t\t}],\n\t\t\t[/^DDD/, function() {\n\t\t\t\treturn $tw.language.getString(\"Date/Long/Day/\" + date.getDay());\n\t\t\t}],\n\t\t\t[/^MMM/, function() {\n\t\t\t\treturn $tw.language.getString(\"Date/Long/Month/\" + (date.getMonth() + 1));\n\t\t\t}],\n\t\t\t[/^TZD/, function() {\n\t\t\t\tvar tz = date.getTimezoneOffset(),\n\t\t\t\tatz = Math.abs(tz);\n\t\t\t\treturn (tz < 0 ? '+' : '-') + $tw.utils.pad(Math.floor(atz / 60)) + ':' + $tw.utils.pad(atz % 60);\n\t\t\t}],\n\t\t\t[/^wYY/, function() {\n\t\t\t\treturn $tw.utils.pad($tw.utils.getYearForWeekNo(date) - 2000);\n\t\t\t}],\n\t\t\t[/^[ap]m/, function() {\n\t\t\t\treturn $tw.utils.getAmPm(date).toLowerCase();\n\t\t\t}],\n\t\t\t[/^hh/, function() {\n\t\t\t\treturn date.getHours();\n\t\t\t}],\n\t\t\t[/^mm/, function() {\n\t\t\t\treturn date.getMinutes();\n\t\t\t}],\n\t\t\t[/^ss/, function() {\n\t\t\t\treturn date.getSeconds();\n\t\t\t}],\n\t\t\t[/^[AP]M/, function() {\n\t\t\t\treturn $tw.utils.getAmPm(date).toUpperCase();\n\t\t\t}],\n\t\t\t[/^DD/, function() {\n\t\t\t\treturn date.getDate();\n\t\t\t}],\n\t\t\t[/^MM/, function() {\n\t\t\t\treturn date.getMonth() + 1;\n\t\t\t}],\n\t\t\t[/^WW/, function() {\n\t\t\t\treturn $tw.utils.getWeek(date);\n\t\t\t}],\n\t\t\t[/^YY/, function() {\n\t\t\t\treturn $tw.utils.pad(date.getFullYear() - 2000);\n\t\t\t}]\n\t\t];\n\twhile(t.length){\n\t\tvar matchString = \"\";\n\t\t$tw.utils.each(matches, function(m) {\n\t\t\tvar match = m[0].exec(t);\n\t\t\tif(match) {\n\t\t\t\tmatchString = m[1].call();\n\t\t\t\tt = t.substr(match[0].length);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t\tif(matchString) {\n\t\t\tresult += matchString;\n\t\t} else {\n\t\t\tresult += t.charAt(0);\n\t\t\tt = t.substr(1);\n\t\t}\n\t}\n\tresult = result.replace(/\\\\(.)/g,\"$1\");\n\treturn result;\n};\n\nexports.getAmPm = function(date) {\n\treturn $tw.language.getString(\"Date/Period/\" + (date.getHours() >= 12 ? \"pm\" : \"am\"));\n};\n\nexports.getDaySuffix = function(date) {\n\treturn $tw.language.getString(\"Date/DaySuffix/\" + date.getDate());\n};\n\nexports.getWeek = function(date) {\n\tvar dt = new Date(date.getTime());\n\tvar d = dt.getDay();\n\tif(d === 0) {\n\t\td = 7; // JavaScript Sun=0, ISO Sun=7\n\t}\n\tdt.setTime(dt.getTime() + (4 - d) * 86400000);// shift day to Thurs of same week to calculate weekNo\n\tvar x = new Date(dt.getFullYear(),0,1);\n\tvar n = Math.floor((dt.getTime() - x.getTime()) / 86400000);\n\treturn Math.floor(n / 7) + 1;\n};\n\nexports.getYearForWeekNo = function(date) {\n\tvar dt = new Date(date.getTime());\n\tvar d = dt.getDay();\n\tif(d === 0) {\n\t\td = 7; // JavaScript Sun=0, ISO Sun=7\n\t}\n\tdt.setTime(dt.getTime() + (4 - d) * 86400000);// shift day to Thurs of same week\n\treturn dt.getFullYear();\n};\n\nexports.getHours12 = function(date) {\n\tvar h = date.getHours();\n\treturn h > 12 ? h-12 : ( h > 0 ? h : 12 );\n};\n\n/*\nConvert a date delta in milliseconds into a string representation of \"23 seconds ago\", \"27 minutes ago\" etc.\n\tdelta: delta in milliseconds\nReturns an object with these members:\n\tdescription: string describing the delta period\n\tupdatePeriod: time in millisecond until the string will be inaccurate\n*/\nexports.getRelativeDate = function(delta) {\n\tvar futurep = false;\n\tif(delta < 0) {\n\t\tdelta = -1 * delta;\n\t\tfuturep = true;\n\t}\n\tvar units = [\n\t\t{name: \"Years\",   duration:      365 * 24 * 60 * 60 * 1000},\n\t\t{name: \"Months\",  duration: (365/12) * 24 * 60 * 60 * 1000},\n\t\t{name: \"Days\",    duration:            24 * 60 * 60 * 1000},\n\t\t{name: \"Hours\",   duration:                 60 * 60 * 1000},\n\t\t{name: \"Minutes\", duration:                      60 * 1000},\n\t\t{name: \"Seconds\", duration:                           1000}\n\t];\n\tfor(var t=0; t<units.length; t++) {\n\t\tvar result = Math.floor(delta / units[t].duration);\n\t\tif(result >= 2) {\n\t\t\treturn {\n\t\t\t\tdelta: delta,\n\t\t\t\tdescription: $tw.language.getString(\n\t\t\t\t\t\"RelativeDate/\" + (futurep ? \"Future\" : \"Past\") + \"/\" + units[t].name,\n\t\t\t\t\t{variables:\n\t\t\t\t\t\t{period: result.toString()}\n\t\t\t\t\t}\n\t\t\t\t),\n\t\t\t\tupdatePeriod: units[t].duration\n\t\t\t};\n\t\t}\n\t}\n\treturn {\n\t\tdelta: delta,\n\t\tdescription: $tw.language.getString(\n\t\t\t\"RelativeDate/\" + (futurep ? \"Future\" : \"Past\") + \"/Second\",\n\t\t\t{variables:\n\t\t\t\t{period: \"1\"}\n\t\t\t}\n\t\t),\n\t\tupdatePeriod: 1000\n\t};\n};\n\n// Convert & to \"&amp;\", < to \"&lt;\", > to \"&gt;\", \" to \"&quot;\"\nexports.htmlEncode = function(s) {\n\tif(s) {\n\t\treturn s.toString().replace(/&/mg,\"&amp;\").replace(/</mg,\"&lt;\").replace(/>/mg,\"&gt;\").replace(/\\\"/mg,\"&quot;\");\n\t} else {\n\t\treturn \"\";\n\t}\n};\n\n// Converts all HTML entities to their character equivalents\nexports.entityDecode = function(s) {\n\tvar converter = String.fromCodePoint || String.fromCharCode,\n\t\te = s.substr(1,s.length-2); // Strip the & and the ;\n\tif(e.charAt(0) === \"#\") {\n\t\tif(e.charAt(1) === \"x\" || e.charAt(1) === \"X\") {\n\t\t\treturn converter(parseInt(e.substr(2),16));\t\n\t\t} else {\n\t\t\treturn converter(parseInt(e.substr(1),10));\n\t\t}\n\t} else {\n\t\tvar c = $tw.config.htmlEntities[e];\n\t\tif(c) {\n\t\t\treturn converter(c);\n\t\t} else {\n\t\t\treturn s; // Couldn't convert it as an entity, just return it raw\n\t\t}\n\t}\n};\n\nexports.unescapeLineBreaks = function(s) {\n\treturn s.replace(/\\\\n/mg,\"\\n\").replace(/\\\\b/mg,\" \").replace(/\\\\s/mg,\"\\\\\").replace(/\\r/mg,\"\");\n};\n\n/*\n * Returns an escape sequence for given character. Uses \\x for characters <=\n * 0xFF to save space, \\u for the rest.\n *\n * The code needs to be in sync with th code template in the compilation\n * function for \"action\" nodes.\n */\n// Copied from peg.js, thanks to David Majda\nexports.escape = function(ch) {\n\tvar charCode = ch.charCodeAt(0);\n\tif(charCode <= 0xFF) {\n\t\treturn '\\\\x' + $tw.utils.pad(charCode.toString(16).toUpperCase());\n\t} else {\n\t\treturn '\\\\u' + $tw.utils.pad(charCode.toString(16).toUpperCase(),4);\n\t}\n};\n\n// Turns a string into a legal JavaScript string\n// Copied from peg.js, thanks to David Majda\nexports.stringify = function(s) {\n\t/*\n\t* ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a string\n\t* literal except for the closing quote character, backslash, carriage return,\n\t* line separator, paragraph separator, and line feed. Any character may\n\t* appear in the form of an escape sequence.\n\t*\n\t* For portability, we also escape all non-ASCII characters.\n\t*/\n\treturn (s || \"\")\n\t\t.replace(/\\\\/g, '\\\\\\\\')            // backslash\n\t\t.replace(/\"/g, '\\\\\"')              // double quote character\n\t\t.replace(/'/g, \"\\\\'\")              // single quote character\n\t\t.replace(/\\r/g, '\\\\r')             // carriage return\n\t\t.replace(/\\n/g, '\\\\n')             // line feed\n\t\t.replace(/[\\x80-\\uFFFF]/g, exports.escape); // non-ASCII characters\n};\n\n/*\nEscape the RegExp special characters with a preceding backslash\n*/\nexports.escapeRegExp = function(s) {\n    return s.replace(/[\\-\\/\\\\\\^\\$\\*\\+\\?\\.\\(\\)\\|\\[\\]\\{\\}]/g, '\\\\$&');\n};\n\n// Checks whether a link target is external, i.e. not a tiddler title\nexports.isLinkExternal = function(to) {\n\tvar externalRegExp = /^(?:file|http|https|mailto|ftp|irc|news|data|skype):[^\\s<>{}\\[\\]`|\"\\\\^]+(?:\\/|\\b)/i;\n\treturn externalRegExp.test(to);\n};\n\nexports.nextTick = function(fn) {\n/*global window: false */\n\tif(typeof process === \"undefined\") {\n\t\t// Apparently it would be faster to use postMessage - http://dbaron.org/log/20100309-faster-timeouts\n\t\twindow.setTimeout(fn,4);\n\t} else {\n\t\tprocess.nextTick(fn);\n\t}\n};\n\n/*\nConvert a hyphenated CSS property name into a camel case one\n*/\nexports.unHyphenateCss = function(propName) {\n\treturn propName.replace(/-([a-z])/gi, function(match0,match1) {\n\t\treturn match1.toUpperCase();\n\t});\n};\n\n/*\nConvert a camelcase CSS property name into a dashed one (\"backgroundColor\" --> \"background-color\")\n*/\nexports.hyphenateCss = function(propName) {\n\treturn propName.replace(/([A-Z])/g, function(match0,match1) {\n\t\treturn \"-\" + match1.toLowerCase();\n\t});\n};\n\n/*\nParse a text reference of one of these forms:\n* title\n* !!field\n* title!!field\n* title##index\n* etc\nReturns an object with the following fields, all optional:\n* title: tiddler title\n* field: tiddler field name\n* index: JSON property index\n*/\nexports.parseTextReference = function(textRef) {\n\t// Separate out the title, field name and/or JSON indices\n\tvar reTextRef = /(?:(.*?)!!(.+))|(?:(.*?)##(.+))|(.*)/mg,\n\t\tmatch = reTextRef.exec(textRef),\n\t\tresult = {};\n\tif(match && reTextRef.lastIndex === textRef.length) {\n\t\t// Return the parts\n\t\tif(match[1]) {\n\t\t\tresult.title = match[1];\n\t\t}\n\t\tif(match[2]) {\n\t\t\tresult.field = match[2];\n\t\t}\n\t\tif(match[3]) {\n\t\t\tresult.title = match[3];\n\t\t}\n\t\tif(match[4]) {\n\t\t\tresult.index = match[4];\n\t\t}\n\t\tif(match[5]) {\n\t\t\tresult.title = match[5];\n\t\t}\n\t} else {\n\t\t// If we couldn't parse it\n\t\tresult.title = textRef\n\t}\n\treturn result;\n};\n\n/*\nChecks whether a string is a valid fieldname\n*/\nexports.isValidFieldName = function(name) {\n\tif(!name || typeof name !== \"string\") {\n\t\treturn false;\n\t}\n\tname = name.toLowerCase().trim();\n\tvar fieldValidatorRegEx = /^[a-z0-9\\-\\._]+$/mg;\n\treturn fieldValidatorRegEx.test(name);\n};\n\n/*\nExtract the version number from the meta tag or from the boot file\n*/\n\n// Browser version\nexports.extractVersionInfo = function() {\n\tif($tw.packageInfo) {\n\t\treturn $tw.packageInfo.version;\n\t} else {\n\t\tvar metatags = document.getElementsByTagName(\"meta\");\n\t\tfor(var t=0; t<metatags.length; t++) {\n\t\t\tvar m = metatags[t];\n\t\t\tif(m.name === \"tiddlywiki-version\") {\n\t\t\t\treturn m.content;\n\t\t\t}\n\t\t}\n\t}\n\treturn null;\n};\n\n/*\nGet the animation duration in ms\n*/\nexports.getAnimationDuration = function() {\n\treturn parseInt($tw.wiki.getTiddlerText(\"$:/config/AnimationDuration\",\"400\"),10);\n};\n\n/*\nHash a string to a number\nDerived from http://stackoverflow.com/a/15710692\n*/\nexports.hashString = function(str) {\n\treturn str.split(\"\").reduce(function(a,b) {\n\t\ta = ((a << 5) - a) + b.charCodeAt(0);\n\t\treturn a & a;\n\t},0);\n};\n\n/*\nDecode a base64 string\n*/\nexports.base64Decode = function(string64) {\n\tif($tw.browser) {\n\t\t// TODO\n\t\tthrow \"$tw.utils.base64Decode() doesn't work in the browser\";\n\t} else {\n\t\treturn (new Buffer(string64,\"base64\")).toString();\n\t}\n};\n\n/*\nConvert a hashmap into a tiddler dictionary format sequence of name:value pairs\n*/\nexports.makeTiddlerDictionary = function(data) {\n\tvar output = [];\n\tfor(var name in data) {\n\t\toutput.push(name + \": \" + data[name]);\n\t}\n\treturn output.join(\"\\n\");\n};\n\n/*\nHigh resolution microsecond timer for profiling\n*/\nexports.timer = function(base) {\n\tvar m;\n\tif($tw.node) {\n\t\tvar r = process.hrtime();\t\t\n\t\tm =  r[0] * 1e3 + (r[1] / 1e6);\n\t} else if(window.performance) {\n\t\tm = performance.now();\n\t} else {\n\t\tm = Date.now();\n\t}\n\tif(typeof base !== \"undefined\") {\n\t\tm = m - base;\n\t}\n\treturn m;\n};\n\n/*\nConvert text and content type to a data URI\n*/\nexports.makeDataUri = function(text,type) {\n\ttype = type || \"text/vnd.tiddlywiki\";\n\tvar typeInfo = $tw.config.contentTypeInfo[type] || $tw.config.contentTypeInfo[\"text/plain\"],\n\t\tisBase64 = typeInfo.encoding === \"base64\",\n\t\tparts = [];\n\tparts.push(\"data:\");\n\tparts.push(type);\n\tparts.push(isBase64 ? \";base64\" : \"\");\n\tparts.push(\",\");\n\tparts.push(isBase64 ? text : encodeURIComponent(text));\n\treturn parts.join(\"\");\n};\n\n/*\nUseful for finding out the fully escaped CSS selector equivalent to a given tag. For example:\n\n$tw.utils.tagToCssSelector(\"$:/tags/Stylesheet\") --> tc-tagged-\\%24\\%3A\\%2Ftags\\%2FStylesheet\n*/\nexports.tagToCssSelector = function(tagName) {\n\treturn \"tc-tagged-\" + encodeURIComponent(tagName).replace(/[!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^`{\\|}~,]/mg,function(c) {\n\t\treturn \"\\\\\" + c;\n\t});\n};\n\n/*\nIE does not have sign function\n*/\nexports.sign = Math.sign || function(x) {\n\tx = +x; // convert to a number\n\tif (x === 0 || isNaN(x)) {\n\t\treturn x;\n\t}\n\treturn x > 0 ? 1 : -1;\n};\n\n/*\nIE does not have an endsWith function\n*/\nexports.strEndsWith = function(str,ending,position) {\n\tif(str.endsWith) {\n\t\treturn str.endsWith(ending,position);\n\t} else {\n\t\tif (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > str.length) {\n\t\t\tposition = str.length;\n\t\t}\n\t\tposition -= ending.length;\n\t\tvar lastIndex = str.indexOf(ending, position);\n\t\treturn lastIndex !== -1 && lastIndex === position;\n\t}\n};\n\n/*\nTransliterate string from eg. Cyrillic Russian to Latin\n*/\nvar transliterationPairs = {\n\t\"Ё\":\"YO\",\n\t\"Й\":\"I\",\n\t\"Ц\":\"TS\",\n\t\"У\":\"U\",\n\t\"К\":\"K\",\n\t\"Е\":\"E\",\n\t\"Н\":\"N\",\n\t\"Г\":\"G\",\n\t\"Ш\":\"SH\",\n\t\"Щ\":\"SCH\",\n\t\"З\":\"Z\",\n\t\"Х\":\"H\",\n\t\"Ъ\":\"'\",\n\t\"ё\":\"yo\",\n\t\"й\":\"i\",\n\t\"ц\":\"ts\",\n\t\"у\":\"u\",\n\t\"к\":\"k\",\n\t\"е\":\"e\",\n\t\"н\":\"n\",\n\t\"г\":\"g\",\n\t\"ш\":\"sh\",\n\t\"щ\":\"sch\",\n\t\"з\":\"z\",\n\t\"х\":\"h\",\n\t\"ъ\":\"'\",\n\t\"Ф\":\"F\",\n\t\"Ы\":\"I\",\n\t\"В\":\"V\",\n\t\"А\":\"a\",\n\t\"П\":\"P\",\n\t\"Р\":\"R\",\n\t\"О\":\"O\",\n\t\"Л\":\"L\",\n\t\"Д\":\"D\",\n\t\"Ж\":\"ZH\",\n\t\"Э\":\"E\",\n\t\"ф\":\"f\",\n\t\"ы\":\"i\",\n\t\"в\":\"v\",\n\t\"а\":\"a\",\n\t\"п\":\"p\",\n\t\"р\":\"r\",\n\t\"о\":\"o\",\n\t\"л\":\"l\",\n\t\"д\":\"d\",\n\t\"ж\":\"zh\",\n\t\"э\":\"e\",\n\t\"Я\":\"Ya\",\n\t\"Ч\":\"CH\",\n\t\"С\":\"S\",\n\t\"М\":\"M\",\n\t\"И\":\"I\",\n\t\"Т\":\"T\",\n\t\"Ь\":\"'\",\n\t\"Б\":\"B\",\n\t\"Ю\":\"YU\",\n\t\"я\":\"ya\",\n\t\"ч\":\"ch\",\n\t\"с\":\"s\",\n\t\"м\":\"m\",\n\t\"и\":\"i\",\n\t\"т\":\"t\",\n\t\"ь\":\"'\",\n\t\"б\":\"b\",\n\t\"ю\":\"yu\"\n};\n\nexports.transliterate = function(str) {\n\treturn str.split(\"\").map(function(char) {\n\t\treturn transliterationPairs[char] || char;\n\t}).join(\"\");\n};\n\n})();\n",
            "title": "$:/core/modules/utils/utils.js",
            "type": "application/javascript",
            "module-type": "utils"
        },
        "$:/core/modules/widgets/action-createtiddler.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/action-createtiddler.js\ntype: application/javascript\nmodule-type: widget\n\nAction widget to create a new tiddler with a unique name and specified fields.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar CreateTiddlerWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nCreateTiddlerWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nCreateTiddlerWidget.prototype.render = function(parent,nextSibling) {\n\tthis.computeAttributes();\n\tthis.execute();\n};\n\n/*\nCompute the internal state of the widget\n*/\nCreateTiddlerWidget.prototype.execute = function() {\n\tthis.actionBaseTitle = this.getAttribute(\"$basetitle\");\n\tthis.actionSaveTitle = this.getAttribute(\"$savetitle\");\n\tthis.actionTimestamp = this.getAttribute(\"$timestamp\",\"yes\") === \"yes\";\n};\n\n/*\nRefresh the widget by ensuring our attributes are up to date\n*/\nCreateTiddlerWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif($tw.utils.count(changedAttributes) > 0) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t}\n\treturn this.refreshChildren(changedTiddlers);\n};\n\n/*\nInvoke the action associated with this widget\n*/\nCreateTiddlerWidget.prototype.invokeAction = function(triggeringWidget,event) {\n\tvar title = this.wiki.generateNewTitle(this.actionBaseTitle),\n\t\tfields = {},\n\t\tcreationFields,\n\t\tmodificationFields;\n\t$tw.utils.each(this.attributes,function(attribute,name) {\n\t\tif(name.charAt(0) !== \"$\") {\n\t\t\tfields[name] = attribute;\n\t\t}\n\t});\n\tif(this.actionTimestamp) {\n\t\tcreationFields = this.wiki.getCreationFields();\n\t\tmodificationFields = this.wiki.getModificationFields();\n\t}\n\tvar tiddler = this.wiki.addTiddler(new $tw.Tiddler(creationFields,fields,modificationFields,{title: title}));\n\tif(this.actionSaveTitle) {\n\t\tthis.wiki.setTextReference(this.actionSaveTitle,title,this.getVariable(\"currentTiddler\"));\n\t}\n\treturn true; // Action was invoked\n};\n\nexports[\"action-createtiddler\"] = CreateTiddlerWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/action-createtiddler.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/action-deletefield.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/action-deletefield.js\ntype: application/javascript\nmodule-type: widget\n\nAction widget to delete fields of a tiddler.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar DeleteFieldWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nDeleteFieldWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nDeleteFieldWidget.prototype.render = function(parent,nextSibling) {\n\tthis.computeAttributes();\n\tthis.execute();\n};\n\n/*\nCompute the internal state of the widget\n*/\nDeleteFieldWidget.prototype.execute = function() {\n\tthis.actionTiddler = this.getAttribute(\"$tiddler\",this.getVariable(\"currentTiddler\"));\n\tthis.actionField = this.getAttribute(\"$field\");\n};\n\n/*\nRefresh the widget by ensuring our attributes are up to date\n*/\nDeleteFieldWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes[\"$tiddler\"]) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t}\n\treturn this.refreshChildren(changedTiddlers);\n};\n\n/*\nInvoke the action associated with this widget\n*/\nDeleteFieldWidget.prototype.invokeAction = function(triggeringWidget,event) {\n\tvar self = this,\n\t\ttiddler = this.wiki.getTiddler(self.actionTiddler),\n\t\tremoveFields = {},\n\t\thasChanged = false;\n\tif(this.actionField) {\n\t\tremoveFields[this.actionField] = undefined;\n\t\tif(this.actionField in tiddler.fields) {\n\t\t\thasChanged = true;\n\t\t}\n\t}\n\tif(tiddler) {\n\t\t$tw.utils.each(this.attributes,function(attribute,name) {\n\t\t\tif(name.charAt(0) !== \"$\" && name !== \"title\") {\n\t\t\t\tremoveFields[name] = undefined;\n\t\t\t\thasChanged = true;\n\t\t\t}\n\t\t});\n\t\tif(hasChanged) {\n\t\t\tthis.wiki.addTiddler(new $tw.Tiddler(this.wiki.getCreationFields(),tiddler,removeFields,this.wiki.getModificationFields()));\t\t\t\n\t\t}\n\t}\n\treturn true; // Action was invoked\n};\n\nexports[\"action-deletefield\"] = DeleteFieldWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/action-deletefield.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/action-deletetiddler.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/action-deletetiddler.js\ntype: application/javascript\nmodule-type: widget\n\nAction widget to delete a tiddler.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar DeleteTiddlerWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nDeleteTiddlerWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nDeleteTiddlerWidget.prototype.render = function(parent,nextSibling) {\n\tthis.computeAttributes();\n\tthis.execute();\n};\n\n/*\nCompute the internal state of the widget\n*/\nDeleteTiddlerWidget.prototype.execute = function() {\n\tthis.actionFilter = this.getAttribute(\"$filter\");\n\tthis.actionTiddler = this.getAttribute(\"$tiddler\");\n};\n\n/*\nRefresh the widget by ensuring our attributes are up to date\n*/\nDeleteTiddlerWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes[\"$filter\"] || changedAttributes[\"$tiddler\"]) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t}\n\treturn this.refreshChildren(changedTiddlers);\n};\n\n/*\nInvoke the action associated with this widget\n*/\nDeleteTiddlerWidget.prototype.invokeAction = function(triggeringWidget,event) {\n\tvar tiddlers = [];\n\tif(this.actionFilter) {\n\t\ttiddlers = this.wiki.filterTiddlers(this.actionFilter,this);\n\t}\n\tif(this.actionTiddler) {\n\t\ttiddlers.push(this.actionTiddler);\n\t}\n\tfor(var t=0; t<tiddlers.length; t++) {\n\t\tthis.wiki.deleteTiddler(tiddlers[t]);\n\t}\n\treturn true; // Action was invoked\n};\n\nexports[\"action-deletetiddler\"] = DeleteTiddlerWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/action-deletetiddler.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/action-listops.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/action-listops.js\ntype: application/javascript\nmodule-type: widget\n\nAction widget to apply list operations to any tiddler field (defaults to the 'list' field of the current tiddler)\n\n\\*/\n(function() {\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\nvar ActionListopsWidget = function(parseTreeNode, options) {\n\tthis.initialise(parseTreeNode, options);\n};\n/**\n * Inherit from the base widget class\n */\nActionListopsWidget.prototype = new Widget();\n/**\n * Render this widget into the DOM\n */\nActionListopsWidget.prototype.render = function(parent, nextSibling) {\n\tthis.computeAttributes();\n\tthis.execute();\n};\n/**\n * Compute the internal state of the widget\n */\nActionListopsWidget.prototype.execute = function() {\n\t// Get our parameters\n\tthis.target = this.getAttribute(\"$tiddler\", this.getVariable(\n\t\t\"currentTiddler\"));\n\tthis.filter = this.getAttribute(\"$filter\");\n\tthis.subfilter = this.getAttribute(\"$subfilter\");\n\tthis.listField = this.getAttribute(\"$field\", \"list\");\n\tthis.listIndex = this.getAttribute(\"$index\");\n\tthis.filtertags = this.getAttribute(\"$tags\");\n};\n/**\n * \tRefresh the widget by ensuring our attributes are up to date\n */\nActionListopsWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.$tiddler || changedAttributes.$filter ||\n\t\tchangedAttributes.$subfilter || changedAttributes.$field ||\n\t\tchangedAttributes.$index || changedAttributes.$tags) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t}\n\treturn this.refreshChildren(changedTiddlers);\n};\n/**\n * \tInvoke the action associated with this widget\n */\nActionListopsWidget.prototype.invokeAction = function(triggeringWidget,\n\tevent) {\n\t//Apply the specified filters to the lists\n\tvar field = this.listField,\n\t\tindex,\n\t\ttype = \"!!\",\n\t\tlist = this.listField;\n\tif(this.listIndex) {\n\t\tfield = undefined;\n\t\tindex = this.listIndex;\n\t\ttype = \"##\";\n\t\tlist = this.listIndex;\n\t}\n\tif(this.filter) {\n\t\tthis.wiki.setText(this.target, field, index, $tw.utils.stringifyList(\n\t\t\tthis.wiki\n\t\t\t.filterTiddlers(this.filter, this)));\n\t}\n\tif(this.subfilter) {\n\t\tvar subfilter = \"[list[\" + this.target + type + list + \"]] \" + this.subfilter;\n\t\tthis.wiki.setText(this.target, field, index, $tw.utils.stringifyList(\n\t\t\tthis.wiki\n\t\t\t.filterTiddlers(subfilter, this)));\n\t}\n\tif(this.filtertags) {\n\t\tvar tiddler = this.wiki.getTiddler(this.target),\n\t\t\toldtags = tiddler ? (tiddler.fields.tags || []).slice(0) : [],\n\t\t\ttagfilter = \"[list[\" + this.target + \"!!tags]] \" + this.filtertags,\n\t\t\tnewtags = this.wiki.filterTiddlers(tagfilter,this);\n\t\tif($tw.utils.stringifyList(oldtags.sort()) !== $tw.utils.stringifyList(newtags.sort())) {\n\t\t\tthis.wiki.setText(this.target,\"tags\",undefined,$tw.utils.stringifyList(newtags));\t\t\t\n\t\t}\n\t}\n\treturn true; // Action was invoked\n};\n\nexports[\"action-listops\"] = ActionListopsWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/action-listops.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/action-navigate.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/action-navigate.js\ntype: application/javascript\nmodule-type: widget\n\nAction widget to navigate to a tiddler\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar NavigateWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nNavigateWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nNavigateWidget.prototype.render = function(parent,nextSibling) {\n\tthis.computeAttributes();\n\tthis.execute();\n};\n\n/*\nCompute the internal state of the widget\n*/\nNavigateWidget.prototype.execute = function() {\n\tthis.actionTo = this.getAttribute(\"$to\");\n\tthis.actionScroll = this.getAttribute(\"$scroll\");\n};\n\n/*\nRefresh the widget by ensuring our attributes are up to date\n*/\nNavigateWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes[\"$to\"] || changedAttributes[\"$scroll\"]) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t}\n\treturn this.refreshChildren(changedTiddlers);\n};\n\n/*\nInvoke the action associated with this widget\n*/\nNavigateWidget.prototype.invokeAction = function(triggeringWidget,event) {\n\tvar bounds = triggeringWidget && triggeringWidget.getBoundingClientRect && triggeringWidget.getBoundingClientRect(),\n\t\tsuppressNavigation = event.metaKey || event.ctrlKey || (event.button === 1);\n\tif(this.actionScroll === \"yes\") {\n\t\tsuppressNavigation = false;\n\t} else if(this.actionScroll === \"no\") {\n\t\tsuppressNavigation = true;\n\t}\n\tthis.dispatchEvent({\n\t\ttype: \"tm-navigate\",\n\t\tnavigateTo: this.actionTo === undefined ? this.getVariable(\"currentTiddler\") : this.actionTo,\n\t\tnavigateFromTitle: this.getVariable(\"storyTiddler\"),\n\t\tnavigateFromNode: triggeringWidget,\n\t\tnavigateFromClientRect: bounds && { top: bounds.top, left: bounds.left, width: bounds.width, right: bounds.right, bottom: bounds.bottom, height: bounds.height\n\t\t},\n\t\tnavigateSuppressNavigation: suppressNavigation\n\t});\n\treturn true; // Action was invoked\n};\n\nexports[\"action-navigate\"] = NavigateWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/action-navigate.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/action-sendmessage.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/action-sendmessage.js\ntype: application/javascript\nmodule-type: widget\n\nAction widget to send a message\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar SendMessageWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nSendMessageWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nSendMessageWidget.prototype.render = function(parent,nextSibling) {\n\tthis.computeAttributes();\n\tthis.execute();\n};\n\n/*\nCompute the internal state of the widget\n*/\nSendMessageWidget.prototype.execute = function() {\n\tthis.actionMessage = this.getAttribute(\"$message\");\n\tthis.actionParam = this.getAttribute(\"$param\");\n\tthis.actionName = this.getAttribute(\"$name\");\n\tthis.actionValue = this.getAttribute(\"$value\",\"\");\n};\n\n/*\nRefresh the widget by ensuring our attributes are up to date\n*/\nSendMessageWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(Object.keys(changedAttributes).length) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t}\n\treturn this.refreshChildren(changedTiddlers);\n};\n\n/*\nInvoke the action associated with this widget\n*/\nSendMessageWidget.prototype.invokeAction = function(triggeringWidget,event) {\n\t// Get the string parameter\n\tvar param = this.actionParam;\n\t// Assemble the attributes as a hashmap\n\tvar paramObject = Object.create(null);\n\tvar count = 0;\n\t$tw.utils.each(this.attributes,function(attribute,name) {\n\t\tif(name.charAt(0) !== \"$\") {\n\t\t\tparamObject[name] = attribute;\n\t\t\tcount++;\n\t\t}\n\t});\n\t// Add name/value pair if present\n\tif(this.actionName) {\n\t\tparamObject[this.actionName] = this.actionValue;\n\t}\n\t// Dispatch the message\n\tthis.dispatchEvent({\n\t\ttype: this.actionMessage,\n\t\tparam: param,\n\t\tparamObject: paramObject,\n\t\ttiddlerTitle: this.getVariable(\"currentTiddler\"),\n\t\tnavigateFromTitle: this.getVariable(\"storyTiddler\"),\n\t\tevent: event\n\t});\n\treturn true; // Action was invoked\n};\n\nexports[\"action-sendmessage\"] = SendMessageWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/action-sendmessage.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/action-setfield.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/action-setfield.js\ntype: application/javascript\nmodule-type: widget\n\nAction widget to set a single field or index on a tiddler.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar SetFieldWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nSetFieldWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nSetFieldWidget.prototype.render = function(parent,nextSibling) {\n\tthis.computeAttributes();\n\tthis.execute();\n};\n\n/*\nCompute the internal state of the widget\n*/\nSetFieldWidget.prototype.execute = function() {\n\tthis.actionTiddler = this.getAttribute(\"$tiddler\",this.getVariable(\"currentTiddler\"));\n\tthis.actionField = this.getAttribute(\"$field\");\n\tthis.actionIndex = this.getAttribute(\"$index\");\n\tthis.actionValue = this.getAttribute(\"$value\");\n\tthis.actionTimestamp = this.getAttribute(\"$timestamp\",\"yes\") === \"yes\";\n};\n\n/*\nRefresh the widget by ensuring our attributes are up to date\n*/\nSetFieldWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes[\"$tiddler\"] || changedAttributes[\"$field\"] || changedAttributes[\"$index\"] || changedAttributes[\"$value\"]) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t}\n\treturn this.refreshChildren(changedTiddlers);\n};\n\n/*\nInvoke the action associated with this widget\n*/\nSetFieldWidget.prototype.invokeAction = function(triggeringWidget,event) {\n\tvar self = this,\n\t\toptions = {};\n\toptions.suppressTimestamp = !this.actionTimestamp;\n\tif((typeof this.actionField == \"string\") || (typeof this.actionIndex == \"string\")  || (typeof this.actionValue == \"string\")) {\n\t\tthis.wiki.setText(this.actionTiddler,this.actionField,this.actionIndex,this.actionValue,options);\n\t}\n\t$tw.utils.each(this.attributes,function(attribute,name) {\n\t\tif(name.charAt(0) !== \"$\") {\n\t\t\tself.wiki.setText(self.actionTiddler,name,undefined,attribute,options);\n\t\t}\n\t});\n\treturn true; // Action was invoked\n};\n\nexports[\"action-setfield\"] = SetFieldWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/action-setfield.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/browse.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/browse.js\ntype: application/javascript\nmodule-type: widget\n\nBrowse widget for browsing for files to import\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar BrowseWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nBrowseWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nBrowseWidget.prototype.render = function(parent,nextSibling) {\n\tvar self = this;\n\t// Remember parent\n\tthis.parentDomNode = parent;\n\t// Compute attributes and execute state\n\tthis.computeAttributes();\n\tthis.execute();\n\t// Create element\n\tvar domNode = this.document.createElement(\"input\");\n\tdomNode.setAttribute(\"type\",\"file\");\n\tif(this.browseMultiple) {\n\t\tdomNode.setAttribute(\"multiple\",\"multiple\");\n\t}\n\tif(this.tooltip) {\n\t\tdomNode.setAttribute(\"title\",this.tooltip);\n\t}\n\t// Nw.js supports \"nwsaveas\" to force a \"save as\" dialogue that allows a new or existing file to be selected\n\tif(this.nwsaveas) {\n\t\tdomNode.setAttribute(\"nwsaveas\",this.nwsaveas);\n\t}\n\t// Nw.js supports \"webkitdirectory\" to allow a directory to be selected\n\tif(this.webkitdirectory) {\n\t\tdomNode.setAttribute(\"webkitdirectory\",this.webkitdirectory);\n\t}\n\t// Add a click event handler\n\tdomNode.addEventListener(\"change\",function (event) {\n\t\tif(self.message) {\n\t\t\tself.dispatchEvent({type: self.message, param: self.param, files: event.target.files});\n\t\t} else {\n\t\t\tself.wiki.readFiles(event.target.files,function(tiddlerFieldsArray) {\n\t\t\t\tself.dispatchEvent({type: \"tm-import-tiddlers\", param: JSON.stringify(tiddlerFieldsArray)});\n\t\t\t});\n\t\t}\n\t\treturn false;\n\t},false);\n\t// Insert element\n\tparent.insertBefore(domNode,nextSibling);\n\tthis.renderChildren(domNode,null);\n\tthis.domNodes.push(domNode);\n};\n\n/*\nCompute the internal state of the widget\n*/\nBrowseWidget.prototype.execute = function() {\n\tthis.browseMultiple = this.getAttribute(\"multiple\");\n\tthis.message = this.getAttribute(\"message\");\n\tthis.param = this.getAttribute(\"param\");\n\tthis.tooltip = this.getAttribute(\"tooltip\");\n\tthis.nwsaveas = this.getAttribute(\"nwsaveas\");\n\tthis.webkitdirectory = this.getAttribute(\"webkitdirectory\");\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nBrowseWidget.prototype.refresh = function(changedTiddlers) {\n\treturn false;\n};\n\nexports.browse = BrowseWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/browse.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/button.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/button.js\ntype: application/javascript\nmodule-type: widget\n\nButton widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar ButtonWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nButtonWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nButtonWidget.prototype.render = function(parent,nextSibling) {\n\tvar self = this;\n\t// Remember parent\n\tthis.parentDomNode = parent;\n\t// Compute attributes and execute state\n\tthis.computeAttributes();\n\tthis.execute();\n\t// Create element\n\tvar tag = \"button\";\n\tif(this.buttonTag && $tw.config.htmlUnsafeElements.indexOf(this.buttonTag) === -1) {\n\t\ttag = this.buttonTag;\n\t}\n\tvar domNode = this.document.createElement(tag);\n\t// Assign classes\n\tvar classes = this[\"class\"].split(\" \") || [],\n\t\tisPoppedUp = this.popup && this.isPoppedUp();\n\tif(this.selectedClass) {\n\t\tif(this.set && this.setTo && this.isSelected()) {\n\t\t\t$tw.utils.pushTop(classes,this.selectedClass.split(\" \"));\n\t\t}\n\t\tif(isPoppedUp) {\n\t\t\t$tw.utils.pushTop(classes,this.selectedClass.split(\" \"));\n\t\t}\n\t}\n\tif(isPoppedUp) {\n\t\t$tw.utils.pushTop(classes,\"tc-popup-handle\");\n\t}\n\tdomNode.className = classes.join(\" \");\n\t// Assign other attributes\n\tif(this.style) {\n\t\tdomNode.setAttribute(\"style\",this.style);\n\t}\n\tif(this.tooltip) {\n\t\tdomNode.setAttribute(\"title\",this.tooltip);\n\t}\n\tif(this[\"aria-label\"]) {\n\t\tdomNode.setAttribute(\"aria-label\",this[\"aria-label\"]);\n\t}\n\t// Add a click event handler\n\tdomNode.addEventListener(\"click\",function (event) {\n\t\tvar handled = false;\n\t\tif(self.invokeActions(this,event)) {\n\t\t\thandled = true;\n\t\t}\n\t\tif(self.to) {\n\t\t\tself.navigateTo(event);\n\t\t\thandled = true;\n\t\t}\n\t\tif(self.message) {\n\t\t\tself.dispatchMessage(event);\n\t\t\thandled = true;\n\t\t}\n\t\tif(self.popup) {\n\t\t\tself.triggerPopup(event);\n\t\t\thandled = true;\n\t\t}\n\t\tif(self.set) {\n\t\t\tself.setTiddler();\n\t\t\thandled = true;\n\t\t}\n\t\tif(self.actions) {\n\t\t\tself.invokeActionString(self.actions,self,event);\n\t\t}\n\t\tif(handled) {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t}\n\t\treturn handled;\n\t},false);\n\t// Make it draggable if required\n\tif(this.dragTiddler || this.dragFilter) {\n\t\t$tw.utils.makeDraggable({\n\t\t\tdomNode: domNode,\n\t\t\tdragTiddlerFn: function() {return self.dragTiddler;},\n\t\t\tdragFilterFn: function() {return self.dragFilter;},\n\t\t\twidget: this\n\t\t});\n\t}\n\t// Insert element\n\tparent.insertBefore(domNode,nextSibling);\n\tthis.renderChildren(domNode,null);\n\tthis.domNodes.push(domNode);\n};\n\n/*\nWe don't allow actions to propagate because we trigger actions ourselves\n*/\nButtonWidget.prototype.allowActionPropagation = function() {\n\treturn false;\n};\n\nButtonWidget.prototype.getBoundingClientRect = function() {\n\treturn this.domNodes[0].getBoundingClientRect();\n};\n\nButtonWidget.prototype.isSelected = function() {\n    return this.wiki.getTextReference(this.set,this.defaultSetValue,this.getVariable(\"currentTiddler\")) === this.setTo;\n};\n\nButtonWidget.prototype.isPoppedUp = function() {\n\tvar tiddler = this.wiki.getTiddler(this.popup);\n\tvar result = tiddler && tiddler.fields.text ? $tw.popup.readPopupState(tiddler.fields.text) : false;\n\treturn result;\n};\n\nButtonWidget.prototype.navigateTo = function(event) {\n\tvar bounds = this.getBoundingClientRect();\n\tthis.dispatchEvent({\n\t\ttype: \"tm-navigate\",\n\t\tnavigateTo: this.to,\n\t\tnavigateFromTitle: this.getVariable(\"storyTiddler\"),\n\t\tnavigateFromNode: this,\n\t\tnavigateFromClientRect: { top: bounds.top, left: bounds.left, width: bounds.width, right: bounds.right, bottom: bounds.bottom, height: bounds.height\n\t\t},\n\t\tnavigateSuppressNavigation: event.metaKey || event.ctrlKey || (event.button === 1),\n\t\tevent: event\n\t});\n};\n\nButtonWidget.prototype.dispatchMessage = function(event) {\n\tthis.dispatchEvent({type: this.message, param: this.param, tiddlerTitle: this.getVariable(\"currentTiddler\"), event: event});\n};\n\nButtonWidget.prototype.triggerPopup = function(event) {\n\t$tw.popup.triggerPopup({\n\t\tdomNode: this.domNodes[0],\n\t\ttitle: this.popup,\n\t\twiki: this.wiki\n\t});\n};\n\nButtonWidget.prototype.setTiddler = function() {\n\tthis.wiki.setTextReference(this.set,this.setTo,this.getVariable(\"currentTiddler\"));\n};\n\n/*\nCompute the internal state of the widget\n*/\nButtonWidget.prototype.execute = function() {\n\t// Get attributes\n\tthis.actions = this.getAttribute(\"actions\");\n\tthis.to = this.getAttribute(\"to\");\n\tthis.message = this.getAttribute(\"message\");\n\tthis.param = this.getAttribute(\"param\");\n\tthis.set = this.getAttribute(\"set\");\n\tthis.setTo = this.getAttribute(\"setTo\");\n\tthis.popup = this.getAttribute(\"popup\");\n\tthis.hover = this.getAttribute(\"hover\");\n\tthis[\"class\"] = this.getAttribute(\"class\",\"\");\n\tthis[\"aria-label\"] = this.getAttribute(\"aria-label\");\n\tthis.tooltip = this.getAttribute(\"tooltip\");\n\tthis.style = this.getAttribute(\"style\");\n\tthis.selectedClass = this.getAttribute(\"selectedClass\");\n\tthis.defaultSetValue = this.getAttribute(\"default\",\"\");\n\tthis.buttonTag = this.getAttribute(\"tag\");\n\tthis.dragTiddler = this.getAttribute(\"dragTiddler\");\n\tthis.dragFilter = this.getAttribute(\"dragFilter\");\n\t// Make child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nButtonWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.to || changedAttributes.message || changedAttributes.param || changedAttributes.set || changedAttributes.setTo || changedAttributes.popup || changedAttributes.hover || changedAttributes[\"class\"] || changedAttributes.selectedClass || changedAttributes.style || changedAttributes.dragFilter || changedAttributes.dragTiddler || (this.set && changedTiddlers[this.set]) || (this.popup && changedTiddlers[this.popup])) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t}\n\treturn this.refreshChildren(changedTiddlers);\n};\n\nexports.button = ButtonWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/button.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/checkbox.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/checkbox.js\ntype: application/javascript\nmodule-type: widget\n\nCheckbox widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar CheckboxWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nCheckboxWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nCheckboxWidget.prototype.render = function(parent,nextSibling) {\n\t// Save the parent dom node\n\tthis.parentDomNode = parent;\n\t// Compute our attributes\n\tthis.computeAttributes();\n\t// Execute our logic\n\tthis.execute();\n\t// Create our elements\n\tthis.labelDomNode = this.document.createElement(\"label\");\n\tthis.labelDomNode.setAttribute(\"class\",this.checkboxClass);\n\tthis.inputDomNode = this.document.createElement(\"input\");\n\tthis.inputDomNode.setAttribute(\"type\",\"checkbox\");\n\tif(this.getValue()) {\n\t\tthis.inputDomNode.setAttribute(\"checked\",\"true\");\n\t}\n\tthis.labelDomNode.appendChild(this.inputDomNode);\n\tthis.spanDomNode = this.document.createElement(\"span\");\n\tthis.labelDomNode.appendChild(this.spanDomNode);\n\t// Add a click event handler\n\t$tw.utils.addEventListeners(this.inputDomNode,[\n\t\t{name: \"change\", handlerObject: this, handlerMethod: \"handleChangeEvent\"}\n\t]);\n\t// Insert the label into the DOM and render any children\n\tparent.insertBefore(this.labelDomNode,nextSibling);\n\tthis.renderChildren(this.spanDomNode,null);\n\tthis.domNodes.push(this.labelDomNode);\n};\n\nCheckboxWidget.prototype.getValue = function() {\n\tvar tiddler = this.wiki.getTiddler(this.checkboxTitle);\n\tif(tiddler) {\n\t\tif(this.checkboxTag) {\n\t\t\tif(this.checkboxInvertTag) {\n\t\t\t\treturn !tiddler.hasTag(this.checkboxTag);\n\t\t\t} else {\n\t\t\t\treturn tiddler.hasTag(this.checkboxTag);\n\t\t\t}\n\t\t}\n\t\tif(this.checkboxField) {\n\t\t\tvar value;\n\t\t\tif($tw.utils.hop(tiddler.fields,this.checkboxField)) {\n\t\t\t\tvalue = tiddler.fields[this.checkboxField] || \"\";\n\t\t\t} else {\n\t\t\t\tvalue = this.checkboxDefault || \"\";\n\t\t\t}\n\t\t\tif(value === this.checkboxChecked) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif(value === this.checkboxUnchecked) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif(this.checkboxIndex) {\n\t\t\tvar value = this.wiki.extractTiddlerDataItem(tiddler,this.checkboxIndex,this.checkboxDefault || \"\");\n\t\t\tif(value === this.checkboxChecked) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif(value === this.checkboxUnchecked) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif(this.checkboxTag) {\n\t\t\treturn false;\n\t\t}\n\t\tif(this.checkboxField) {\n\t\t\tif(this.checkboxDefault === this.checkboxChecked) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif(this.checkboxDefault === this.checkboxUnchecked) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n};\n\nCheckboxWidget.prototype.handleChangeEvent = function(event) {\n\tvar checked = this.inputDomNode.checked,\n\t\ttiddler = this.wiki.getTiddler(this.checkboxTitle),\n\t\tfallbackFields = {text: \"\"},\n\t\tnewFields = {title: this.checkboxTitle},\n\t\thasChanged = false,\n\t\ttagCheck = false,\n\t\thasTag = tiddler && tiddler.hasTag(this.checkboxTag),\n\t\tvalue = checked ? this.checkboxChecked : this.checkboxUnchecked;\n\tif(this.checkboxTag && this.checkboxInvertTag === \"yes\") {\n\t\ttagCheck = hasTag === checked;\n\t} else {\n\t\ttagCheck = hasTag !== checked;\n\t}\n\t// Set the tag if specified\n\tif(this.checkboxTag && (!tiddler || tagCheck)) {\n\t\tnewFields.tags = tiddler ? (tiddler.fields.tags || []).slice(0) : [];\n\t\tvar pos = newFields.tags.indexOf(this.checkboxTag);\n\t\tif(pos !== -1) {\n\t\t\tnewFields.tags.splice(pos,1);\n\t\t}\n\t\tif(this.checkboxInvertTag === \"yes\" && !checked) {\n\t\t\tnewFields.tags.push(this.checkboxTag);\n\t\t} else if(this.checkboxInvertTag !== \"yes\" && checked) {\n\t\t\tnewFields.tags.push(this.checkboxTag);\n\t\t}\n\t\thasChanged = true;\n\t}\n\t// Set the field if specified\n\tif(this.checkboxField) {\n\t\tif(!tiddler || tiddler.fields[this.checkboxField] !== value) {\n\t\t\tnewFields[this.checkboxField] = value;\n\t\t\thasChanged = true;\n\t\t}\n\t}\n\t// Set the index if specified\n\tif(this.checkboxIndex) {\n\t\tvar indexValue = this.wiki.extractTiddlerDataItem(this.checkboxTitle,this.checkboxIndex);\n\t\tif(!tiddler || indexValue !== value) {\n\t\t\thasChanged = true;\n\t\t}\n\t}\n\tif(hasChanged) {\n\t\tif(this.checkboxIndex) {\n\t\t\tthis.wiki.setText(this.checkboxTitle,\"\",this.checkboxIndex,value);\n\t\t} else {\n\t\t\tthis.wiki.addTiddler(new $tw.Tiddler(this.wiki.getCreationFields(),fallbackFields,tiddler,newFields,this.wiki.getModificationFields()));\n\t\t}\n\t}\n\t// Trigger actions\n\tif(this.checkboxActions) {\n\t\tthis.invokeActionString(this.checkboxActions,this,event);\n\t}\n};\n\n/*\nCompute the internal state of the widget\n*/\nCheckboxWidget.prototype.execute = function() {\n\t// Get the parameters from the attributes\n\tthis.checkboxActions = this.getAttribute(\"actions\");\n\tthis.checkboxTitle = this.getAttribute(\"tiddler\",this.getVariable(\"currentTiddler\"));\n\tthis.checkboxTag = this.getAttribute(\"tag\");\n\tthis.checkboxField = this.getAttribute(\"field\");\n\tthis.checkboxIndex = this.getAttribute(\"index\");\n\tthis.checkboxChecked = this.getAttribute(\"checked\");\n\tthis.checkboxUnchecked = this.getAttribute(\"unchecked\");\n\tthis.checkboxDefault = this.getAttribute(\"default\");\n\tthis.checkboxClass = this.getAttribute(\"class\",\"\");\n\tthis.checkboxInvertTag = this.getAttribute(\"invertTag\",\"\");\n\t// Make the child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nCheckboxWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.tiddler || changedAttributes.tag || changedAttributes.invertTag || changedAttributes.field || changedAttributes.index || changedAttributes.checked || changedAttributes.unchecked || changedAttributes[\"default\"] || changedAttributes[\"class\"]) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\tvar refreshed = false;\n\t\tif(changedTiddlers[this.checkboxTitle]) {\n\t\t\tthis.inputDomNode.checked = this.getValue();\n\t\t\trefreshed = true;\n\t\t}\n\t\treturn this.refreshChildren(changedTiddlers) || refreshed;\n\t}\n};\n\nexports.checkbox = CheckboxWidget;\n\n})();",
            "title": "$:/core/modules/widgets/checkbox.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/codeblock.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/codeblock.js\ntype: application/javascript\nmodule-type: widget\n\nCode block node widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar CodeBlockWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nCodeBlockWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nCodeBlockWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tvar codeNode = this.document.createElement(\"code\"),\n\t\tdomNode = this.document.createElement(\"pre\");\n\tcodeNode.appendChild(this.document.createTextNode(this.getAttribute(\"code\")));\n\tdomNode.appendChild(codeNode);\n\tparent.insertBefore(domNode,nextSibling);\n\tthis.domNodes.push(domNode);\n\tif(this.postRender) {\n\t\tthis.postRender();\n\t}\n};\n\n/*\nCompute the internal state of the widget\n*/\nCodeBlockWidget.prototype.execute = function() {\n\tthis.language = this.getAttribute(\"language\");\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nCodeBlockWidget.prototype.refresh = function(changedTiddlers) {\n\treturn false;\n};\n\nexports.codeblock = CodeBlockWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/codeblock.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/count.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/count.js\ntype: application/javascript\nmodule-type: widget\n\nCount widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar CountWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nCountWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nCountWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tvar textNode = this.document.createTextNode(this.currentCount);\n\tparent.insertBefore(textNode,nextSibling);\n\tthis.domNodes.push(textNode);\n};\n\n/*\nCompute the internal state of the widget\n*/\nCountWidget.prototype.execute = function() {\n\t// Get parameters from our attributes\n\tthis.filter = this.getAttribute(\"filter\");\n\t// Execute the filter\n\tif(this.filter) {\n\t\tthis.currentCount = this.wiki.filterTiddlers(this.filter,this).length;\n\t} else {\n\t\tthis.currentCount = undefined;\n\t}\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nCountWidget.prototype.refresh = function(changedTiddlers) {\n\t// Re-execute the filter to get the count\n\tthis.computeAttributes();\n\tvar oldCount = this.currentCount;\n\tthis.execute();\n\tif(this.currentCount !== oldCount) {\n\t\t// Regenerate and rerender the widget and replace the existing DOM node\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n\n};\n\nexports.count = CountWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/count.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/draggable.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/draggable.js\ntype: application/javascript\nmodule-type: widget\n\nDraggable widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar DraggableWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nDraggableWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nDraggableWidget.prototype.render = function(parent,nextSibling) {\n\tvar self = this;\n\t// Save the parent dom node\n\tthis.parentDomNode = parent;\n\t// Compute our attributes\n\tthis.computeAttributes();\n\t// Execute our logic\n\tthis.execute();\n\t// Sanitise the specified tag\n\tvar tag = this.draggableTag;\n\tif($tw.config.htmlUnsafeElements.indexOf(tag) !== -1) {\n\t\ttag = \"div\";\n\t}\n\t// Create our element\n\tvar domNode = this.document.createElement(tag);\n\t// Assign classes\n\tvar classes = [\"tc-draggable\"];\n\tif(this.draggableClasses) {\n\t\tclasses.push(this.draggableClasses);\n\t}\n\tdomNode.setAttribute(\"class\",classes.join(\" \"));\n\t// Add event handlers\n\t$tw.utils.makeDraggable({\n\t\tdomNode: domNode,\n\t\tdragTiddlerFn: function() {return self.getAttribute(\"tiddler\");},\n\t\tdragFilterFn: function() {return self.getAttribute(\"filter\");},\n\t\twidget: this\n\t});\n\t// Insert the link into the DOM and render any children\n\tparent.insertBefore(domNode,nextSibling);\n\tthis.renderChildren(domNode,null);\n\tthis.domNodes.push(domNode);\n};\n\n/*\nCompute the internal state of the widget\n*/\nDraggableWidget.prototype.execute = function() {\n\t// Pick up our attributes\n\tthis.draggableTag = this.getAttribute(\"tag\",\"div\");\n\tthis.draggableClasses = this.getAttribute(\"class\");\n\t// Make the child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nDraggableWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedTiddlers.tag || changedTiddlers[\"class\"]) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t}\n\treturn this.refreshChildren(changedTiddlers);\n};\n\nexports.draggable = DraggableWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/draggable.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/droppable.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/droppable.js\ntype: application/javascript\nmodule-type: widget\n\nDroppable widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar DroppableWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nDroppableWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nDroppableWidget.prototype.render = function(parent,nextSibling) {\n\tvar self = this;\n\t// Remember parent\n\tthis.parentDomNode = parent;\n\t// Compute attributes and execute state\n\tthis.computeAttributes();\n\tthis.execute();\n\tvar tag = this.parseTreeNode.isBlock ? \"div\" : \"span\";\n\tif(this.droppableTag && $tw.config.htmlUnsafeElements.indexOf(this.droppableTag) === -1) {\n\t\ttag = this.droppableTag;\n\t}\n\t// Create element and assign classes\n\tvar domNode = this.document.createElement(tag),\n\t\tclasses = (this[\"class\"] || \"\").split(\" \");\n\tclasses.push(\"tc-droppable\");\n\tdomNode.className = classes.join(\" \");\n\t// Add event handlers\n\t$tw.utils.addEventListeners(domNode,[\n\t\t{name: \"dragenter\", handlerObject: this, handlerMethod: \"handleDragEnterEvent\"},\n\t\t{name: \"dragover\", handlerObject: this, handlerMethod: \"handleDragOverEvent\"},\n\t\t{name: \"dragleave\", handlerObject: this, handlerMethod: \"handleDragLeaveEvent\"},\n\t\t{name: \"drop\", handlerObject: this, handlerMethod: \"handleDropEvent\"}\n\t]);\n\t// Insert element\n\tparent.insertBefore(domNode,nextSibling);\n\tthis.renderChildren(domNode,null);\n\tthis.domNodes.push(domNode);\n\t// Stack of outstanding enter/leave events\n\tthis.currentlyEntered = [];\n};\n\nDroppableWidget.prototype.enterDrag = function(event) {\n\tif(this.currentlyEntered.indexOf(event.target) === -1) {\n\t\tthis.currentlyEntered.push(event.target);\n\t}\n\t// If we're entering for the first time we need to apply highlighting\n\t$tw.utils.addClass(this.domNodes[0],\"tc-dragover\");\n};\n\nDroppableWidget.prototype.leaveDrag = function(event) {\n\tvar pos = this.currentlyEntered.indexOf(event.target);\n\tif(pos !== -1) {\n\t\tthis.currentlyEntered.splice(pos,1);\n\t}\n\t// Remove highlighting if we're leaving externally. The hacky second condition is to resolve a problem with Firefox whereby there is an erroneous dragenter event if the node being dragged is within the dropzone\n\tif(this.currentlyEntered.length === 0 || (this.currentlyEntered.length === 1 && this.currentlyEntered[0] === $tw.dragInProgress)) {\n\t\tthis.currentlyEntered = [];\n\t\t$tw.utils.removeClass(this.domNodes[0],\"tc-dragover\");\n\t}\n};\n\nDroppableWidget.prototype.handleDragEnterEvent  = function(event) {\n\tthis.enterDrag(event);\n\t// Tell the browser that we're ready to handle the drop\n\tevent.preventDefault();\n\t// Tell the browser not to ripple the drag up to any parent drop handlers\n\tevent.stopPropagation();\n\treturn false;\n};\n\nDroppableWidget.prototype.handleDragOverEvent  = function(event) {\n\t// Check for being over a TEXTAREA or INPUT\n\tif([\"TEXTAREA\",\"INPUT\"].indexOf(event.target.tagName) !== -1) {\n\t\treturn false;\n\t}\n\t// Tell the browser that we're still interested in the drop\n\tevent.preventDefault();\n\t// Set the drop effect\n\tevent.dataTransfer.dropEffect = this.droppableEffect;\n\treturn false;\n};\n\nDroppableWidget.prototype.handleDragLeaveEvent  = function(event) {\n\tthis.leaveDrag(event);\n\treturn false;\n};\n\nDroppableWidget.prototype.handleDropEvent  = function(event) {\n\tvar self = this;\n\tthis.leaveDrag(event);\n\t// Check for being over a TEXTAREA or INPUT\n\tif([\"TEXTAREA\",\"INPUT\"].indexOf(event.target.tagName) !== -1) {\n\t\treturn false;\n\t}\n\tvar dataTransfer = event.dataTransfer;\n\t// Remove highlighting\n\t$tw.utils.removeClass(this.domNodes[0],\"tc-dragover\");\n\t// Try to import the various data types we understand\n\t$tw.utils.importDataTransfer(dataTransfer,null,function(fieldsArray) {\n\t\tfieldsArray.forEach(function(fields) {\n\t\t\tself.performActions(fields.title || fields.text,event);\n\t\t});\n\t});\n\t// Tell the browser that we handled the drop\n\tevent.preventDefault();\n\t// Stop the drop ripple up to any parent handlers\n\tevent.stopPropagation();\n\treturn false;\n};\n\nDroppableWidget.prototype.performActions = function(title,event) {\n\tif(this.droppableActions) {\n\t\tthis.invokeActionString(this.droppableActions,this,event,{actionTiddler: title});\n\t}\n};\n\n/*\nCompute the internal state of the widget\n*/\nDroppableWidget.prototype.execute = function() {\n\tthis.droppableActions = this.getAttribute(\"actions\");\n\tthis.droppableEffect = this.getAttribute(\"effect\",\"copy\");\n\tthis.droppableTag = this.getAttribute(\"tag\");\n\tthis.droppableClass = this.getAttribute(\"class\");\n\t// Make child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nDroppableWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes[\"class\"] || changedAttributes.tag) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t}\n\treturn this.refreshChildren(changedTiddlers);\n};\n\nexports.droppable = DroppableWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/droppable.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/dropzone.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/dropzone.js\ntype: application/javascript\nmodule-type: widget\n\nDropzone widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar DropZoneWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nDropZoneWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nDropZoneWidget.prototype.render = function(parent,nextSibling) {\n\tvar self = this;\n\t// Remember parent\n\tthis.parentDomNode = parent;\n\t// Compute attributes and execute state\n\tthis.computeAttributes();\n\tthis.execute();\n\t// Create element\n\tvar domNode = this.document.createElement(\"div\");\n\tdomNode.className = \"tc-dropzone\";\n\t// Add event handlers\n\t$tw.utils.addEventListeners(domNode,[\n\t\t{name: \"dragenter\", handlerObject: this, handlerMethod: \"handleDragEnterEvent\"},\n\t\t{name: \"dragover\", handlerObject: this, handlerMethod: \"handleDragOverEvent\"},\n\t\t{name: \"dragleave\", handlerObject: this, handlerMethod: \"handleDragLeaveEvent\"},\n\t\t{name: \"drop\", handlerObject: this, handlerMethod: \"handleDropEvent\"},\n\t\t{name: \"paste\", handlerObject: this, handlerMethod: \"handlePasteEvent\"}\n\t]);\n\tdomNode.addEventListener(\"click\",function (event) {\n\t},false);\n\t// Insert element\n\tparent.insertBefore(domNode,nextSibling);\n\tthis.renderChildren(domNode,null);\n\tthis.domNodes.push(domNode);\n\t// Stack of outstanding enter/leave events\n\tthis.currentlyEntered = [];\n};\n\nDropZoneWidget.prototype.enterDrag = function(event) {\n\tif(this.currentlyEntered.indexOf(event.target) === -1) {\n\t\tthis.currentlyEntered.push(event.target);\n\t}\n\t// If we're entering for the first time we need to apply highlighting\n\t$tw.utils.addClass(this.domNodes[0],\"tc-dragover\");\n};\n\nDropZoneWidget.prototype.leaveDrag = function(event) {\n\tvar pos = this.currentlyEntered.indexOf(event.target);\n\tif(pos !== -1) {\n\t\tthis.currentlyEntered.splice(pos,1);\n\t}\n\t// Remove highlighting if we're leaving externally\n\tif(this.currentlyEntered.length === 0) {\n\t\t$tw.utils.removeClass(this.domNodes[0],\"tc-dragover\");\n\t}\n};\n\nDropZoneWidget.prototype.handleDragEnterEvent  = function(event) {\n\t// Check for this window being the source of the drag\n\tif($tw.dragInProgress) {\n\t\treturn false;\n\t}\n\tthis.enterDrag(event);\n\t// Tell the browser that we're ready to handle the drop\n\tevent.preventDefault();\n\t// Tell the browser not to ripple the drag up to any parent drop handlers\n\tevent.stopPropagation();\n};\n\nDropZoneWidget.prototype.handleDragOverEvent  = function(event) {\n\t// Check for being over a TEXTAREA or INPUT\n\tif([\"TEXTAREA\",\"INPUT\"].indexOf(event.target.tagName) !== -1) {\n\t\treturn false;\n\t}\n\t// Check for this window being the source of the drag\n\tif($tw.dragInProgress) {\n\t\treturn false;\n\t}\n\t// Tell the browser that we're still interested in the drop\n\tevent.preventDefault();\n\tevent.dataTransfer.dropEffect = \"copy\"; // Explicitly show this is a copy\n};\n\nDropZoneWidget.prototype.handleDragLeaveEvent  = function(event) {\n\tthis.leaveDrag(event);\n};\n\nDropZoneWidget.prototype.handleDropEvent  = function(event) {\n\tvar self = this;\n\tthis.leaveDrag(event);\n\t// Check for being over a TEXTAREA or INPUT\n\tif([\"TEXTAREA\",\"INPUT\"].indexOf(event.target.tagName) !== -1) {\n\t\treturn false;\n\t}\n\t// Check for this window being the source of the drag\n\tif($tw.dragInProgress) {\n\t\treturn false;\n\t}\n\tvar self = this,\n\t\tdataTransfer = event.dataTransfer;\n\t// Remove highlighting\n\t$tw.utils.removeClass(this.domNodes[0],\"tc-dragover\");\n\t// Import any files in the drop\n\tvar numFiles = 0;\n\tif(dataTransfer.files) {\n\t\tnumFiles = this.wiki.readFiles(dataTransfer.files,function(tiddlerFieldsArray) {\n\t\t\tself.dispatchEvent({type: \"tm-import-tiddlers\", param: JSON.stringify(tiddlerFieldsArray)});\n\t\t});\n\t}\n\t// Try to import the various data types we understand\n\tif(numFiles === 0) {\n\t\t$tw.utils.importDataTransfer(dataTransfer,this.wiki.generateNewTitle(\"Untitled\"),function(fieldsArray) {\n\t\t\tself.dispatchEvent({type: \"tm-import-tiddlers\", param: JSON.stringify(fieldsArray)});\n\t\t});\n\t}\n\t// Tell the browser that we handled the drop\n\tevent.preventDefault();\n\t// Stop the drop ripple up to any parent handlers\n\tevent.stopPropagation();\n};\n\nDropZoneWidget.prototype.handlePasteEvent  = function(event) {\n\t// Let the browser handle it if we're in a textarea or input box\n\tif([\"TEXTAREA\",\"INPUT\"].indexOf(event.target.tagName) == -1) {\n\t\tvar self = this,\n\t\t\titems = event.clipboardData.items;\n\t\t// Enumerate the clipboard items\n\t\tfor(var t = 0; t<items.length; t++) {\n\t\t\tvar item = items[t];\n\t\t\tif(item.kind === \"file\") {\n\t\t\t\t// Import any files\n\t\t\t\tthis.wiki.readFile(item.getAsFile(),function(tiddlerFieldsArray) {\n\t\t\t\t\tself.dispatchEvent({type: \"tm-import-tiddlers\", param: JSON.stringify(tiddlerFieldsArray)});\n\t\t\t\t});\n\t\t\t} else if(item.kind === \"string\") {\n\t\t\t\t// Create tiddlers from string items\n\t\t\t\tvar type = item.type;\n\t\t\t\titem.getAsString(function(str) {\n\t\t\t\t\tvar tiddlerFields = {\n\t\t\t\t\t\ttitle: self.wiki.generateNewTitle(\"Untitled\"),\n\t\t\t\t\t\ttext: str,\n\t\t\t\t\t\ttype: type\n\t\t\t\t\t};\n\t\t\t\t\tif($tw.log.IMPORT) {\n\t\t\t\t\t\tconsole.log(\"Importing string '\" + str + \"', type: '\" + type + \"'\");\n\t\t\t\t\t}\n\t\t\t\t\tself.dispatchEvent({type: \"tm-import-tiddlers\", param: JSON.stringify([tiddlerFields])});\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\t// Tell the browser that we've handled the paste\n\t\tevent.stopPropagation();\n\t\tevent.preventDefault();\n\t}\n};\n\n/*\nCompute the internal state of the widget\n*/\nDropZoneWidget.prototype.execute = function() {\n\t// Make child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nDropZoneWidget.prototype.refresh = function(changedTiddlers) {\n\treturn this.refreshChildren(changedTiddlers);\n};\n\nexports.dropzone = DropZoneWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/dropzone.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/edit-binary.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/edit-binary.js\ntype: application/javascript\nmodule-type: widget\n\nEdit-binary widget; placeholder for editing binary tiddlers\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar BINARY_WARNING_MESSAGE = \"$:/core/ui/BinaryWarning\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar EditBinaryWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nEditBinaryWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nEditBinaryWidget.prototype.render = function(parent,nextSibling) {\n\tvar self = this;\n\t// Save the parent dom node\n\tthis.parentDomNode = parent;\n\t// Compute our attributes\n\tthis.computeAttributes();\n\t// Execute our logic\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n};\n\n/*\nCompute the internal state of the widget\n*/\nEditBinaryWidget.prototype.execute = function() {\n\t// Construct the child widgets\n\tthis.makeChildWidgets([{\n\t\ttype: \"transclude\",\n\t\tattributes: {\n\t\t\ttiddler: {type: \"string\", value: BINARY_WARNING_MESSAGE}\n\t\t}\n\t}]);\n};\n\n/*\nRefresh by refreshing our child widget\n*/\nEditBinaryWidget.prototype.refresh = function(changedTiddlers) {\n\treturn this.refreshChildren(changedTiddlers);\n};\n\nexports[\"edit-binary\"] = EditBinaryWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/edit-binary.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/edit-bitmap.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/edit-bitmap.js\ntype: application/javascript\nmodule-type: widget\n\nEdit-bitmap widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n// Default image sizes\nvar DEFAULT_IMAGE_WIDTH = 600,\n\tDEFAULT_IMAGE_HEIGHT = 370;\n\n// Configuration tiddlers\nvar LINE_WIDTH_TITLE = \"$:/config/BitmapEditor/LineWidth\",\n\tLINE_COLOUR_TITLE = \"$:/config/BitmapEditor/Colour\",\n\tLINE_OPACITY_TITLE = \"$:/config/BitmapEditor/Opacity\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar EditBitmapWidget = function(parseTreeNode,options) {\n\t// Initialise the editor operations if they've not been done already\n\tif(!this.editorOperations) {\n\t\tEditBitmapWidget.prototype.editorOperations = {};\n\t\t$tw.modules.applyMethods(\"bitmapeditoroperation\",this.editorOperations);\n\t}\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nEditBitmapWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nEditBitmapWidget.prototype.render = function(parent,nextSibling) {\n\tvar self = this;\n\t// Save the parent dom node\n\tthis.parentDomNode = parent;\n\t// Compute our attributes\n\tthis.computeAttributes();\n\t// Execute our logic\n\tthis.execute();\n\t// Create the wrapper for the toolbar and render its content\n\tthis.toolbarNode = this.document.createElement(\"div\");\n\tthis.toolbarNode.className = \"tc-editor-toolbar\";\n\tparent.insertBefore(this.toolbarNode,nextSibling);\n\tthis.domNodes.push(this.toolbarNode);\n\t// Create the on-screen canvas\n\tthis.canvasDomNode = $tw.utils.domMaker(\"canvas\",{\n\t\tdocument: this.document,\n\t\t\"class\":\"tc-edit-bitmapeditor\",\n\t\teventListeners: [{\n\t\t\tname: \"touchstart\", handlerObject: this, handlerMethod: \"handleTouchStartEvent\"\n\t\t},{\n\t\t\tname: \"touchmove\", handlerObject: this, handlerMethod: \"handleTouchMoveEvent\"\n\t\t},{\n\t\t\tname: \"touchend\", handlerObject: this, handlerMethod: \"handleTouchEndEvent\"\n\t\t},{\n\t\t\tname: \"mousedown\", handlerObject: this, handlerMethod: \"handleMouseDownEvent\"\n\t\t},{\n\t\t\tname: \"mousemove\", handlerObject: this, handlerMethod: \"handleMouseMoveEvent\"\n\t\t},{\n\t\t\tname: \"mouseup\", handlerObject: this, handlerMethod: \"handleMouseUpEvent\"\n\t\t}]\n\t});\n\t// Set the width and height variables\n\tthis.setVariable(\"tv-bitmap-editor-width\",this.canvasDomNode.width + \"px\");\n\tthis.setVariable(\"tv-bitmap-editor-height\",this.canvasDomNode.height + \"px\");\n\t// Render toolbar child widgets\n\tthis.renderChildren(this.toolbarNode,null);\n\t// // Insert the elements into the DOM\n\tparent.insertBefore(this.canvasDomNode,nextSibling);\n\tthis.domNodes.push(this.canvasDomNode);\n\t// Load the image into the canvas\n\tif($tw.browser) {\n\t\tthis.loadCanvas();\n\t}\n\t// Add widget message listeners\n\tthis.addEventListeners([\n\t\t{type: \"tm-edit-bitmap-operation\", handler: \"handleEditBitmapOperationMessage\"}\n\t]);\n};\n\n/*\nHandle an edit bitmap operation message from the toolbar\n*/\nEditBitmapWidget.prototype.handleEditBitmapOperationMessage = function(event) {\n\t// Invoke the handler\n\tvar handler = this.editorOperations[event.param];\n\tif(handler) {\n\t\thandler.call(this,event);\n\t}\n};\n\n/*\nCompute the internal state of the widget\n*/\nEditBitmapWidget.prototype.execute = function() {\n\t// Get our parameters\n\tthis.editTitle = this.getAttribute(\"tiddler\",this.getVariable(\"currentTiddler\"));\n\t// Make the child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nJust refresh the toolbar\n*/\nEditBitmapWidget.prototype.refresh = function(changedTiddlers) {\n\treturn this.refreshChildren(changedTiddlers);\n};\n\n/*\nSet the bitmap size variables and refresh the toolbar\n*/\nEditBitmapWidget.prototype.refreshToolbar = function() {\n\t// Set the width and height variables\n\tthis.setVariable(\"tv-bitmap-editor-width\",this.canvasDomNode.width + \"px\");\n\tthis.setVariable(\"tv-bitmap-editor-height\",this.canvasDomNode.height + \"px\");\n\t// Refresh each of our child widgets\n\t$tw.utils.each(this.children,function(childWidget) {\n\t\tchildWidget.refreshSelf();\n\t});\n};\n\nEditBitmapWidget.prototype.loadCanvas = function() {\n\tvar tiddler = this.wiki.getTiddler(this.editTitle),\n\t\tcurrImage = new Image();\n\t// Set up event handlers for loading the image\n\tvar self = this;\n\tcurrImage.onload = function() {\n\t\t// Copy the image to the on-screen canvas\n\t\tself.initCanvas(self.canvasDomNode,currImage.width,currImage.height,currImage);\n\t\t// And also copy the current bitmap to the off-screen canvas\n\t\tself.currCanvas = self.document.createElement(\"canvas\");\n\t\tself.initCanvas(self.currCanvas,currImage.width,currImage.height,currImage);\n\t\t// Set the width and height input boxes\n\t\tself.refreshToolbar();\n\t};\n\tcurrImage.onerror = function() {\n\t\t// Set the on-screen canvas size and clear it\n\t\tself.initCanvas(self.canvasDomNode,DEFAULT_IMAGE_WIDTH,DEFAULT_IMAGE_HEIGHT);\n\t\t// Set the off-screen canvas size and clear it\n\t\tself.currCanvas = self.document.createElement(\"canvas\");\n\t\tself.initCanvas(self.currCanvas,DEFAULT_IMAGE_WIDTH,DEFAULT_IMAGE_HEIGHT);\n\t\t// Set the width and height input boxes\n\t\tself.refreshToolbar();\n\t};\n\t// Get the current bitmap into an image object\n\tcurrImage.src = \"data:\" + tiddler.fields.type + \";base64,\" + tiddler.fields.text;\n};\n\nEditBitmapWidget.prototype.initCanvas = function(canvas,width,height,image) {\n\tcanvas.width = width;\n\tcanvas.height = height;\n\tvar ctx = canvas.getContext(\"2d\");\n\tif(image) {\n\t\tctx.drawImage(image,0,0);\n\t} else {\n\t\tctx.fillStyle = \"#fff\";\n\t\tctx.fillRect(0,0,canvas.width,canvas.height);\n\t}\n};\n\n/*\n** Change the size of the canvas, preserving the current image\n*/\nEditBitmapWidget.prototype.changeCanvasSize = function(newWidth,newHeight) {\n\t// Create and size a new canvas\n\tvar newCanvas = this.document.createElement(\"canvas\");\n\tthis.initCanvas(newCanvas,newWidth,newHeight);\n\t// Copy the old image\n\tvar ctx = newCanvas.getContext(\"2d\");\n\tctx.drawImage(this.currCanvas,0,0);\n\t// Set the new canvas as the current one\n\tthis.currCanvas = newCanvas;\n\t// Set the size of the onscreen canvas\n\tthis.canvasDomNode.width = newWidth;\n\tthis.canvasDomNode.height = newHeight;\n\t// Paint the onscreen canvas with the offscreen canvas\n\tctx = this.canvasDomNode.getContext(\"2d\");\n\tctx.drawImage(this.currCanvas,0,0);\n};\n\nEditBitmapWidget.prototype.handleTouchStartEvent = function(event) {\n\tthis.brushDown = true;\n\tthis.strokeStart(event.touches[0].clientX,event.touches[0].clientY);\n\tevent.preventDefault();\n\tevent.stopPropagation();\n\treturn false;\n};\n\nEditBitmapWidget.prototype.handleTouchMoveEvent = function(event) {\n\tif(this.brushDown) {\n\t\tthis.strokeMove(event.touches[0].clientX,event.touches[0].clientY);\n\t}\n\tevent.preventDefault();\n\tevent.stopPropagation();\n\treturn false;\n};\n\nEditBitmapWidget.prototype.handleTouchEndEvent = function(event) {\n\tif(this.brushDown) {\n\t\tthis.brushDown = false;\n\t\tthis.strokeEnd();\n\t}\n\tevent.preventDefault();\n\tevent.stopPropagation();\n\treturn false;\n};\n\nEditBitmapWidget.prototype.handleMouseDownEvent = function(event) {\n\tthis.strokeStart(event.clientX,event.clientY);\n\tthis.brushDown = true;\n\tevent.preventDefault();\n\tevent.stopPropagation();\n\treturn false;\n};\n\nEditBitmapWidget.prototype.handleMouseMoveEvent = function(event) {\n\tif(this.brushDown) {\n\t\tthis.strokeMove(event.clientX,event.clientY);\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\treturn false;\n\t}\n\treturn true;\n};\n\nEditBitmapWidget.prototype.handleMouseUpEvent = function(event) {\n\tif(this.brushDown) {\n\t\tthis.brushDown = false;\n\t\tthis.strokeEnd();\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\treturn false;\n\t}\n\treturn true;\n};\n\nEditBitmapWidget.prototype.adjustCoordinates = function(x,y) {\n\tvar canvasRect = this.canvasDomNode.getBoundingClientRect(),\n\t\tscale = this.canvasDomNode.width/canvasRect.width;\n\treturn {x: (x - canvasRect.left) * scale, y: (y - canvasRect.top) * scale};\n};\n\nEditBitmapWidget.prototype.strokeStart = function(x,y) {\n\t// Start off a new stroke\n\tthis.stroke = [this.adjustCoordinates(x,y)];\n};\n\nEditBitmapWidget.prototype.strokeMove = function(x,y) {\n\tvar ctx = this.canvasDomNode.getContext(\"2d\"),\n\t\tt;\n\t// Add the new position to the end of the stroke\n\tthis.stroke.push(this.adjustCoordinates(x,y));\n\t// Redraw the previous image\n\tctx.drawImage(this.currCanvas,0,0);\n\t// Render the stroke\n\tctx.globalAlpha = parseFloat(this.wiki.getTiddlerText(LINE_OPACITY_TITLE,\"1.0\"));\n\tctx.strokeStyle = this.wiki.getTiddlerText(LINE_COLOUR_TITLE,\"#ff0\");\n\tctx.lineWidth = parseFloat(this.wiki.getTiddlerText(LINE_WIDTH_TITLE,\"3\"));\n\tctx.lineCap = \"round\";\n\tctx.lineJoin = \"round\";\n\tctx.beginPath();\n\tctx.moveTo(this.stroke[0].x,this.stroke[0].y);\n\tfor(t=1; t<this.stroke.length-1; t++) {\n\t\tvar s1 = this.stroke[t],\n\t\t\ts2 = this.stroke[t-1],\n\t\t\ttx = (s1.x + s2.x)/2,\n\t\t\tty = (s1.y + s2.y)/2;\n\t\tctx.quadraticCurveTo(s2.x,s2.y,tx,ty);\n\t}\n\tctx.stroke();\n};\n\nEditBitmapWidget.prototype.strokeEnd = function() {\n\t// Copy the bitmap to the off-screen canvas\n\tvar ctx = this.currCanvas.getContext(\"2d\");\n\tctx.drawImage(this.canvasDomNode,0,0);\n\t// Save the image into the tiddler\n\tthis.saveChanges();\n};\n\nEditBitmapWidget.prototype.saveChanges = function() {\n\tvar tiddler = this.wiki.getTiddler(this.editTitle);\n\tif(tiddler) {\n\t\t// data URIs look like \"data:<type>;base64,<text>\"\n\t\tvar dataURL = this.canvasDomNode.toDataURL(tiddler.fields.type),\n\t\t\tposColon = dataURL.indexOf(\":\"),\n\t\t\tposSemiColon = dataURL.indexOf(\";\"),\n\t\t\tposComma = dataURL.indexOf(\",\"),\n\t\t\ttype = dataURL.substring(posColon+1,posSemiColon),\n\t\t\ttext = dataURL.substring(posComma+1);\n\t\tvar update = {type: type, text: text};\n\t\tthis.wiki.addTiddler(new $tw.Tiddler(this.wiki.getModificationFields(),tiddler,update,this.wiki.getCreationFields()));\n\t}\n};\n\nexports[\"edit-bitmap\"] = EditBitmapWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/edit-bitmap.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/edit-shortcut.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/edit-shortcut.js\ntype: application/javascript\nmodule-type: widget\n\nWidget to display an editable keyboard shortcut\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar EditShortcutWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nEditShortcutWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nEditShortcutWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tthis.inputNode = this.document.createElement(\"input\");\n\t// Assign classes\n\tif(this.shortcutClass) {\n\t\tthis.inputNode.className = this.shortcutClass;\t\t\n\t}\n\t// Assign other attributes\n\tif(this.shortcutStyle) {\n\t\tthis.inputNode.setAttribute(\"style\",this.shortcutStyle);\n\t}\n\tif(this.shortcutTooltip) {\n\t\tthis.inputNode.setAttribute(\"title\",this.shortcutTooltip);\n\t}\n\tif(this.shortcutPlaceholder) {\n\t\tthis.inputNode.setAttribute(\"placeholder\",this.shortcutPlaceholder);\n\t}\n\tif(this.shortcutAriaLabel) {\n\t\tthis.inputNode.setAttribute(\"aria-label\",this.shortcutAriaLabel);\n\t}\n\t// Assign the current shortcut\n\tthis.updateInputNode();\n\t// Add event handlers\n\t$tw.utils.addEventListeners(this.inputNode,[\n\t\t{name: \"keydown\", handlerObject: this, handlerMethod: \"handleKeydownEvent\"}\n\t]);\n\t// Link into the DOM\n\tparent.insertBefore(this.inputNode,nextSibling);\n\tthis.domNodes.push(this.inputNode);\n};\n\n/*\nCompute the internal state of the widget\n*/\nEditShortcutWidget.prototype.execute = function() {\n\tthis.shortcutTiddler = this.getAttribute(\"tiddler\");\n\tthis.shortcutField = this.getAttribute(\"field\");\n\tthis.shortcutIndex = this.getAttribute(\"index\");\n\tthis.shortcutPlaceholder = this.getAttribute(\"placeholder\");\n\tthis.shortcutDefault = this.getAttribute(\"default\",\"\");\n\tthis.shortcutClass = this.getAttribute(\"class\");\n\tthis.shortcutStyle = this.getAttribute(\"style\");\n\tthis.shortcutTooltip = this.getAttribute(\"tooltip\");\n\tthis.shortcutAriaLabel = this.getAttribute(\"aria-label\");\n};\n\n/*\nUpdate the value of the input node\n*/\nEditShortcutWidget.prototype.updateInputNode = function() {\n\tif(this.shortcutField) {\n\t\tvar tiddler = this.wiki.getTiddler(this.shortcutTiddler);\n\t\tif(tiddler && $tw.utils.hop(tiddler.fields,this.shortcutField)) {\n\t\t\tthis.inputNode.value = tiddler.getFieldString(this.shortcutField);\n\t\t} else {\n\t\t\tthis.inputNode.value = this.shortcutDefault;\n\t\t}\n\t} else if(this.shortcutIndex) {\n\t\tthis.inputNode.value = this.wiki.extractTiddlerDataItem(this.shortcutTiddler,this.shortcutIndex,this.shortcutDefault);\n\t} else {\n\t\tthis.inputNode.value = this.wiki.getTiddlerText(this.shortcutTiddler,this.shortcutDefault);\n\t}\n};\n\n/*\nHandle a dom \"keydown\" event\n*/\nEditShortcutWidget.prototype.handleKeydownEvent = function(event) {\n\t// Ignore shift, ctrl, meta, alt\n\tif(event.keyCode && $tw.keyboardManager.getModifierKeys().indexOf(event.keyCode) === -1) {\n\t\t// Get the shortcut text representation\n\t\tvar value = $tw.keyboardManager.getPrintableShortcuts([{\n\t\t\tctrlKey: event.ctrlKey,\n\t\t\tshiftKey: event.shiftKey,\n\t\t\taltKey: event.altKey,\n\t\t\tmetaKey: event.metaKey,\n\t\t\tkeyCode: event.keyCode\n\t\t}]);\n\t\tif(value.length > 0) {\n\t\t\tthis.wiki.setText(this.shortcutTiddler,this.shortcutField,this.shortcutIndex,value[0]);\n\t\t}\n\t\t// Ignore the keydown if it was already handled\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\treturn true;\t\t\n\t} else {\n\t\treturn false;\n\t}\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget needed re-rendering\n*/\nEditShortcutWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes.placeholder || changedAttributes[\"default\"] || changedAttributes[\"class\"] || changedAttributes.style || changedAttributes.tooltip || changedAttributes[\"aria-label\"]) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else if(changedTiddlers[this.shortcutTiddler]) {\n\t\tthis.updateInputNode();\n\t\treturn true;\n\t} else {\n\t\treturn false;\t\n\t}\n};\n\nexports[\"edit-shortcut\"] = EditShortcutWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/edit-shortcut.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/edit-text.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/edit-text.js\ntype: application/javascript\nmodule-type: widget\n\nEdit-text widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar editTextWidgetFactory = require(\"$:/core/modules/editor/factory.js\").editTextWidgetFactory,\n\tFramedEngine = require(\"$:/core/modules/editor/engines/framed.js\").FramedEngine,\n\tSimpleEngine = require(\"$:/core/modules/editor/engines/simple.js\").SimpleEngine;\n\nexports[\"edit-text\"] = editTextWidgetFactory(FramedEngine,SimpleEngine);\n\n})();\n",
            "title": "$:/core/modules/widgets/edit-text.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/edit.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/edit.js\ntype: application/javascript\nmodule-type: widget\n\nEdit widget is a meta-widget chooses the appropriate actual editting widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar EditWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nEditWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nEditWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n};\n\n// Mappings from content type to editor type are stored in tiddlers with this prefix\nvar EDITOR_MAPPING_PREFIX = \"$:/config/EditorTypeMappings/\";\n\n/*\nCompute the internal state of the widget\n*/\nEditWidget.prototype.execute = function() {\n\t// Get our parameters\n\tthis.editTitle = this.getAttribute(\"tiddler\",this.getVariable(\"currentTiddler\"));\n\tthis.editField = this.getAttribute(\"field\",\"text\");\n\tthis.editIndex = this.getAttribute(\"index\");\n\tthis.editClass = this.getAttribute(\"class\");\n\tthis.editPlaceholder = this.getAttribute(\"placeholder\");\n\t// Choose the appropriate edit widget\n\tthis.editorType = this.getEditorType();\n\t// Make the child widgets\n\tthis.makeChildWidgets([{\n\t\ttype: \"edit-\" + this.editorType,\n\t\tattributes: {\n\t\t\ttiddler: {type: \"string\", value: this.editTitle},\n\t\t\tfield: {type: \"string\", value: this.editField},\n\t\t\tindex: {type: \"string\", value: this.editIndex},\n\t\t\t\"class\": {type: \"string\", value: this.editClass},\n\t\t\t\"placeholder\": {type: \"string\", value: this.editPlaceholder}\n\t\t},\n\t\tchildren: this.parseTreeNode.children\n\t}]);\n};\n\nEditWidget.prototype.getEditorType = function() {\n\t// Get the content type of the thing we're editing\n\tvar type;\n\tif(this.editField === \"text\") {\n\t\tvar tiddler = this.wiki.getTiddler(this.editTitle);\n\t\tif(tiddler) {\n\t\t\ttype = tiddler.fields.type;\n\t\t}\n\t}\n\ttype = type || \"text/vnd.tiddlywiki\";\n\tvar editorType = this.wiki.getTiddlerText(EDITOR_MAPPING_PREFIX + type);\n\tif(!editorType) {\n\t\tvar typeInfo = $tw.config.contentTypeInfo[type];\n\t\tif(typeInfo && typeInfo.encoding === \"base64\") {\n\t\t\teditorType = \"binary\";\n\t\t} else {\n\t\t\teditorType = \"text\";\n\t\t}\n\t}\n\treturn editorType;\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nEditWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\t// Refresh if an attribute has changed, or the type associated with the target tiddler has changed\n\tif(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || (changedTiddlers[this.editTitle] && this.getEditorType() !== this.editorType)) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn this.refreshChildren(changedTiddlers);\t\t\n\t}\n};\n\nexports.edit = EditWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/edit.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/element.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/element.js\ntype: application/javascript\nmodule-type: widget\n\nElement widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar ElementWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nElementWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nElementWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\t// Neuter blacklisted elements\n\tvar tag = this.parseTreeNode.tag;\n\tif($tw.config.htmlUnsafeElements.indexOf(tag) !== -1) {\n\t\ttag = \"safe-\" + tag;\n\t}\n\tvar domNode = this.document.createElementNS(this.namespace,tag);\n\tthis.assignAttributes(domNode,{excludeEventAttributes: true});\n\tparent.insertBefore(domNode,nextSibling);\n\tthis.renderChildren(domNode,null);\n\tthis.domNodes.push(domNode);\n};\n\n/*\nCompute the internal state of the widget\n*/\nElementWidget.prototype.execute = function() {\n\t// Select the namespace for the tag\n\tvar tagNamespaces = {\n\t\t\tsvg: \"http://www.w3.org/2000/svg\",\n\t\t\tmath: \"http://www.w3.org/1998/Math/MathML\",\n\t\t\tbody: \"http://www.w3.org/1999/xhtml\"\n\t\t};\n\tthis.namespace = tagNamespaces[this.parseTreeNode.tag];\n\tif(this.namespace) {\n\t\tthis.setVariable(\"namespace\",this.namespace);\n\t} else {\n\t\tthis.namespace = this.getVariable(\"namespace\",{defaultValue: \"http://www.w3.org/1999/xhtml\"});\n\t}\n\t// Make the child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nElementWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes(),\n\t\thasChangedAttributes = $tw.utils.count(changedAttributes) > 0;\n\tif(hasChangedAttributes) {\n\t\t// Update our attributes\n\t\tthis.assignAttributes(this.domNodes[0],{excludeEventAttributes: true});\n\t}\n\treturn this.refreshChildren(changedTiddlers) || hasChangedAttributes;\n};\n\nexports.element = ElementWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/element.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/encrypt.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/encrypt.js\ntype: application/javascript\nmodule-type: widget\n\nEncrypt widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar EncryptWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nEncryptWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nEncryptWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tvar textNode = this.document.createTextNode(this.encryptedText);\n\tparent.insertBefore(textNode,nextSibling);\n\tthis.domNodes.push(textNode);\n};\n\n/*\nCompute the internal state of the widget\n*/\nEncryptWidget.prototype.execute = function() {\n\t// Get parameters from our attributes\n\tthis.filter = this.getAttribute(\"filter\",\"[!is[system]]\");\n\t// Encrypt the filtered tiddlers\n\tvar tiddlers = this.wiki.filterTiddlers(this.filter),\n\t\tjson = {},\n\t\tself = this;\n\t$tw.utils.each(tiddlers,function(title) {\n\t\tvar tiddler = self.wiki.getTiddler(title),\n\t\t\tjsonTiddler = {};\n\t\tfor(var f in tiddler.fields) {\n\t\t\tjsonTiddler[f] = tiddler.getFieldString(f);\n\t\t}\n\t\tjson[title] = jsonTiddler;\n\t});\n\tthis.encryptedText = $tw.utils.htmlEncode($tw.crypto.encrypt(JSON.stringify(json)));\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nEncryptWidget.prototype.refresh = function(changedTiddlers) {\n\t// We don't need to worry about refreshing because the encrypt widget isn't for interactive use\n\treturn false;\n};\n\nexports.encrypt = EncryptWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/encrypt.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/entity.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/entity.js\ntype: application/javascript\nmodule-type: widget\n\nHTML entity widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar EntityWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nEntityWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nEntityWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.execute();\n\tvar entityString = this.getAttribute(\"entity\",this.parseTreeNode.entity || \"\"),\n\t\ttextNode = this.document.createTextNode($tw.utils.entityDecode(entityString));\n\tparent.insertBefore(textNode,nextSibling);\n\tthis.domNodes.push(textNode);\n};\n\n/*\nCompute the internal state of the widget\n*/\nEntityWidget.prototype.execute = function() {\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nEntityWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.entity) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn false;\t\n\t}\n};\n\nexports.entity = EntityWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/entity.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/fieldmangler.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/fieldmangler.js\ntype: application/javascript\nmodule-type: widget\n\nField mangler widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar FieldManglerWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n\tthis.addEventListeners([\n\t\t{type: \"tm-remove-field\", handler: \"handleRemoveFieldEvent\"},\n\t\t{type: \"tm-add-field\", handler: \"handleAddFieldEvent\"},\n\t\t{type: \"tm-remove-tag\", handler: \"handleRemoveTagEvent\"},\n\t\t{type: \"tm-add-tag\", handler: \"handleAddTagEvent\"}\n\t]);\n};\n\n/*\nInherit from the base widget class\n*/\nFieldManglerWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nFieldManglerWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n};\n\n/*\nCompute the internal state of the widget\n*/\nFieldManglerWidget.prototype.execute = function() {\n\t// Get our parameters\n\tthis.mangleTitle = this.getAttribute(\"tiddler\",this.getVariable(\"currentTiddler\"));\n\t// Construct the child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nFieldManglerWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.tiddler) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn this.refreshChildren(changedTiddlers);\t\t\n\t}\n};\n\nFieldManglerWidget.prototype.handleRemoveFieldEvent = function(event) {\n\tvar tiddler = this.wiki.getTiddler(this.mangleTitle),\n\t\tdeletion = {};\n\tdeletion[event.param] = undefined;\n\tthis.wiki.addTiddler(new $tw.Tiddler(tiddler,deletion));\n\treturn true;\n};\n\nFieldManglerWidget.prototype.handleAddFieldEvent = function(event) {\n\tvar tiddler = this.wiki.getTiddler(this.mangleTitle),\n\t\taddition = this.wiki.getModificationFields(),\n\t\thadInvalidFieldName = false,\n\t\taddField = function(name,value) {\n\t\t\tvar trimmedName = name.toLowerCase().trim();\n\t\t\tif(!$tw.utils.isValidFieldName(trimmedName)) {\n\t\t\t\tif(!hadInvalidFieldName) {\n\t\t\t\t\talert($tw.language.getString(\n\t\t\t\t\t\t\"InvalidFieldName\",\n\t\t\t\t\t\t{variables:\n\t\t\t\t\t\t\t{fieldName: trimmedName}\n\t\t\t\t\t\t}\n\t\t\t\t\t));\n\t\t\t\t\thadInvalidFieldName = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(!value && tiddler) {\n\t\t\t\t\tvalue = tiddler.fields[trimmedName];\n\t\t\t\t}\n\t\t\t\taddition[trimmedName] = value || \"\";\n\t\t\t}\n\t\t\treturn;\n\t\t};\n\taddition.title = this.mangleTitle;\n\tif(typeof event.param === \"string\") {\n\t\taddField(event.param,\"\");\n\t}\n\tif(typeof event.paramObject === \"object\") {\n\t\tfor(var name in event.paramObject) {\n\t\t\taddField(name,event.paramObject[name]);\n\t\t}\n\t}\n\tthis.wiki.addTiddler(new $tw.Tiddler(tiddler,addition));\n\treturn true;\n};\n\nFieldManglerWidget.prototype.handleRemoveTagEvent = function(event) {\n\tvar tiddler = this.wiki.getTiddler(this.mangleTitle);\n\tif(tiddler && tiddler.fields.tags) {\n\t\tvar p = tiddler.fields.tags.indexOf(event.param);\n\t\tif(p !== -1) {\n\t\t\tvar modification = this.wiki.getModificationFields();\n\t\t\tmodification.tags = (tiddler.fields.tags || []).slice(0);\n\t\t\tmodification.tags.splice(p,1);\n\t\t\tif(modification.tags.length === 0) {\n\t\t\t\tmodification.tags = undefined;\n\t\t\t}\n\t\tthis.wiki.addTiddler(new $tw.Tiddler(tiddler,modification));\n\t\t}\n\t}\n\treturn true;\n};\n\nFieldManglerWidget.prototype.handleAddTagEvent = function(event) {\n\tvar tiddler = this.wiki.getTiddler(this.mangleTitle);\n\tif(tiddler && typeof event.param === \"string\") {\n\t\tvar tag = event.param.trim();\n\t\tif(tag !== \"\") {\n\t\t\tvar modification = this.wiki.getModificationFields();\n\t\t\tmodification.tags = (tiddler.fields.tags || []).slice(0);\n\t\t\t$tw.utils.pushTop(modification.tags,tag);\n\t\t\tthis.wiki.addTiddler(new $tw.Tiddler(tiddler,modification));\t\t\t\n\t\t}\n\t} else if(typeof event.param === \"string\" && event.param.trim() !== \"\" && this.mangleTitle.trim() !== \"\") {\n\t\tvar tag = [];\n\t\ttag.push(event.param.trim());\n\t\tthis.wiki.addTiddler({title: this.mangleTitle, tags: tag});\t\t\n\t}\n\treturn true;\n};\n\nexports.fieldmangler = FieldManglerWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/fieldmangler.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/fields.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/fields.js\ntype: application/javascript\nmodule-type: widget\n\nFields widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar FieldsWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nFieldsWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nFieldsWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tvar textNode = this.document.createTextNode(this.text);\n\tparent.insertBefore(textNode,nextSibling);\n\tthis.domNodes.push(textNode);\n};\n\n/*\nCompute the internal state of the widget\n*/\nFieldsWidget.prototype.execute = function() {\n\t// Get parameters from our attributes\n\tthis.tiddlerTitle = this.getAttribute(\"tiddler\",this.getVariable(\"currentTiddler\"));\n\tthis.template = this.getAttribute(\"template\");\n\tthis.exclude = this.getAttribute(\"exclude\");\n\tthis.stripTitlePrefix = this.getAttribute(\"stripTitlePrefix\",\"no\") === \"yes\";\n\t// Get the value to display\n\tvar tiddler = this.wiki.getTiddler(this.tiddlerTitle);\n\t// Get the exclusion list\n\tvar exclude;\n\tif(this.exclude) {\n\t\texclude = this.exclude.split(\" \");\n\t} else {\n\t\texclude = [\"text\"]; \n\t}\n\t// Compose the template\n\tvar text = [];\n\tif(this.template && tiddler) {\n\t\tvar fields = [];\n\t\tfor(var fieldName in tiddler.fields) {\n\t\t\tif(exclude.indexOf(fieldName) === -1) {\n\t\t\t\tfields.push(fieldName);\n\t\t\t}\n\t\t}\n\t\tfields.sort();\n\t\tfor(var f=0; f<fields.length; f++) {\n\t\t\tfieldName = fields[f];\n\t\t\tif(exclude.indexOf(fieldName) === -1) {\n\t\t\t\tvar row = this.template,\n\t\t\t\t\tvalue = tiddler.getFieldString(fieldName);\n\t\t\t\tif(this.stripTitlePrefix && fieldName === \"title\") {\n\t\t\t\t\tvar reStrip = /^\\{[^\\}]+\\}(.+)/mg,\n\t\t\t\t\t\treMatch = reStrip.exec(value);\n\t\t\t\t\tif(reMatch) {\n\t\t\t\t\t\tvalue = reMatch[1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\trow = $tw.utils.replaceString(row,\"$name$\",fieldName);\n\t\t\t\trow = $tw.utils.replaceString(row,\"$value$\",value);\n\t\t\t\trow = $tw.utils.replaceString(row,\"$encoded_value$\",$tw.utils.htmlEncode(value));\n\t\t\t\ttext.push(row);\n\t\t\t}\n\t\t}\n\t}\n\tthis.text = text.join(\"\");\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nFieldsWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.tiddler || changedAttributes.template || changedAttributes.exclude || changedAttributes.stripTitlePrefix || changedTiddlers[this.tiddlerTitle]) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn false;\t\n\t}\n};\n\nexports.fields = FieldsWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/fields.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/image.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/image.js\ntype: application/javascript\nmodule-type: widget\n\nThe image widget displays an image referenced with an external URI or with a local tiddler title.\n\n```\n<$image src=\"TiddlerTitle\" width=\"320\" height=\"400\" class=\"classnames\">\n```\n\nThe image source can be the title of an existing tiddler or the URL of an external image.\n\nExternal images always generate an HTML `<img>` tag.\n\nTiddlers that have a _canonical_uri field generate an HTML `<img>` tag with the src attribute containing the URI.\n\nTiddlers that contain image data generate an HTML `<img>` tag with the src attribute containing a base64 representation of the image.\n\nTiddlers that contain wikitext could be rendered to a DIV of the usual size of a tiddler, and then transformed to the size requested.\n\nThe width and height attributes are interpreted as a number of pixels, and do not need to include the \"px\" suffix.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar ImageWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nImageWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nImageWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\t// Create element\n\t// Determine what type of image it is\n\tvar tag = \"img\", src = \"\",\n\t\ttiddler = this.wiki.getTiddler(this.imageSource);\n\tif(!tiddler) {\n\t\t// The source isn't the title of a tiddler, so we'll assume it's a URL\n\t\tsrc = this.getVariable(\"tv-get-export-image-link\",{params: [{name: \"src\",value: this.imageSource}],defaultValue: this.imageSource});\n\t} else {\n\t\t// Check if it is an image tiddler\n\t\tif(this.wiki.isImageTiddler(this.imageSource)) {\n\t\t\tvar type = tiddler.fields.type,\n\t\t\t\ttext = tiddler.fields.text,\n\t\t\t\t_canonical_uri = tiddler.fields._canonical_uri;\n\t\t\t// If the tiddler has body text then it doesn't need to be lazily loaded\n\t\t\tif(text) {\n\t\t\t\t// Render the appropriate element for the image type\n\t\t\t\tswitch(type) {\n\t\t\t\t\tcase \"application/pdf\":\n\t\t\t\t\t\ttag = \"embed\";\n\t\t\t\t\t\tsrc = \"data:application/pdf;base64,\" + text;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/svg+xml\":\n\t\t\t\t\t\tsrc = \"data:image/svg+xml,\" + encodeURIComponent(text);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tsrc = \"data:\" + type + \";base64,\" + text;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else if(_canonical_uri) {\n\t\t\t\tswitch(type) {\n\t\t\t\t\tcase \"application/pdf\":\n\t\t\t\t\t\ttag = \"embed\";\n\t\t\t\t\t\tsrc = _canonical_uri;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/svg+xml\":\n\t\t\t\t\t\tsrc = _canonical_uri;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tsrc = _canonical_uri;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\t\n\t\t\t} else {\n\t\t\t\t// Just trigger loading of the tiddler\n\t\t\t\tthis.wiki.getTiddlerText(this.imageSource);\n\t\t\t}\n\t\t}\n\t}\n\t// Create the element and assign the attributes\n\tvar domNode = this.document.createElement(tag);\n\tdomNode.setAttribute(\"src\",src);\n\tif(this.imageClass) {\n\t\tdomNode.setAttribute(\"class\",this.imageClass);\t\t\n\t}\n\tif(this.imageWidth) {\n\t\tdomNode.setAttribute(\"width\",this.imageWidth);\n\t}\n\tif(this.imageHeight) {\n\t\tdomNode.setAttribute(\"height\",this.imageHeight);\n\t}\n\tif(this.imageTooltip) {\n\t\tdomNode.setAttribute(\"title\",this.imageTooltip);\t\t\n\t}\n\tif(this.imageAlt) {\n\t\tdomNode.setAttribute(\"alt\",this.imageAlt);\t\t\n\t}\n\t// Insert element\n\tparent.insertBefore(domNode,nextSibling);\n\tthis.domNodes.push(domNode);\n};\n\n/*\nCompute the internal state of the widget\n*/\nImageWidget.prototype.execute = function() {\n\t// Get our parameters\n\tthis.imageSource = this.getAttribute(\"source\");\n\tthis.imageWidth = this.getAttribute(\"width\");\n\tthis.imageHeight = this.getAttribute(\"height\");\n\tthis.imageClass = this.getAttribute(\"class\");\n\tthis.imageTooltip = this.getAttribute(\"tooltip\");\n\tthis.imageAlt = this.getAttribute(\"alt\");\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nImageWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.source || changedAttributes.width || changedAttributes.height || changedAttributes[\"class\"] || changedAttributes.tooltip || changedTiddlers[this.imageSource]) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn false;\t\t\n\t}\n};\n\nexports.image = ImageWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/image.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/importvariables.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/importvariables.js\ntype: application/javascript\nmodule-type: widget\n\nImport variable definitions from other tiddlers\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar ImportVariablesWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nImportVariablesWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nImportVariablesWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n};\n\n/*\nCompute the internal state of the widget\n*/\nImportVariablesWidget.prototype.execute = function(tiddlerList) {\n\tvar self = this;\n\t// Get our parameters\n\tthis.filter = this.getAttribute(\"filter\");\n\t// Compute the filter\n\tthis.tiddlerList = tiddlerList || this.wiki.filterTiddlers(this.filter,this);\n\t// Accumulate the <$set> widgets from each tiddler\n\tvar widgetStackStart,widgetStackEnd;\n\tfunction addWidgetNode(widgetNode) {\n\t\tif(widgetNode) {\n\t\t\tif(!widgetStackStart && !widgetStackEnd) {\n\t\t\t\twidgetStackStart = widgetNode;\n\t\t\t\twidgetStackEnd = widgetNode;\n\t\t\t} else {\n\t\t\t\twidgetStackEnd.children = [widgetNode];\n\t\t\t\twidgetStackEnd = widgetNode;\n\t\t\t}\n\t\t}\n\t}\n\t$tw.utils.each(this.tiddlerList,function(title) {\n\t\tvar parser = self.wiki.parseTiddler(title);\n\t\tif(parser) {\n\t\t\tvar parseTreeNode = parser.tree[0];\n\t\t\twhile(parseTreeNode && parseTreeNode.type === \"set\") {\n\t\t\t\taddWidgetNode({\n\t\t\t\t\ttype: \"set\",\n\t\t\t\t\tattributes: parseTreeNode.attributes,\n\t\t\t\t\tparams: parseTreeNode.params\n\t\t\t\t});\n\t\t\t\tparseTreeNode = parseTreeNode.children[0];\n\t\t\t}\n\t\t} \n\t});\n\t// Add our own children to the end of the pile\n\tvar parseTreeNodes;\n\tif(widgetStackStart && widgetStackEnd) {\n\t\tparseTreeNodes = [widgetStackStart];\n\t\twidgetStackEnd.children = this.parseTreeNode.children;\n\t} else {\n\t\tparseTreeNodes = this.parseTreeNode.children;\n\t}\n\t// Construct the child widgets\n\tthis.makeChildWidgets(parseTreeNodes);\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nImportVariablesWidget.prototype.refresh = function(changedTiddlers) {\n\t// Recompute our attributes and the filter list\n\tvar changedAttributes = this.computeAttributes(),\n\t\ttiddlerList = this.wiki.filterTiddlers(this.getAttribute(\"filter\"),this);\n\t// Refresh if the filter has changed, or the list of tiddlers has changed, or any of the tiddlers in the list has changed\n\tfunction haveListedTiddlersChanged() {\n\t\tvar changed = false;\n\t\ttiddlerList.forEach(function(title) {\n\t\t\tif(changedTiddlers[title]) {\n\t\t\t\tchanged = true;\n\t\t\t}\n\t\t});\n\t\treturn changed;\n\t}\n\tif(changedAttributes.filter || !$tw.utils.isArrayEqual(this.tiddlerList,tiddlerList) || haveListedTiddlersChanged()) {\n\t\t// Compute the filter\n\t\tthis.removeChildDomNodes();\n\t\tthis.execute(tiddlerList);\n\t\tthis.renderChildren(this.parentDomNode,this.findNextSiblingDomNode());\n\t\treturn true;\n\t} else {\n\t\treturn this.refreshChildren(changedTiddlers);\t\t\n\t}\n};\n\nexports.importvariables = ImportVariablesWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/importvariables.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/keyboard.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/keyboard.js\ntype: application/javascript\nmodule-type: widget\n\nKeyboard shortcut widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar KeyboardWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nKeyboardWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nKeyboardWidget.prototype.render = function(parent,nextSibling) {\n\tvar self = this;\n\t// Remember parent\n\tthis.parentDomNode = parent;\n\t// Compute attributes and execute state\n\tthis.computeAttributes();\n\tthis.execute();\n\tvar tag = this.parseTreeNode.isBlock ? \"div\" : \"span\";\n\tif(this.tag && $tw.config.htmlUnsafeElements.indexOf(this.tag) === -1) {\n\t\ttag = this.tag;\n\t}\n\t// Create element\n\tvar domNode = this.document.createElement(tag);\n\t// Assign classes\n\tvar classes = (this[\"class\"] || \"\").split(\" \");\n\tclasses.push(\"tc-keyboard\");\n\tdomNode.className = classes.join(\" \");\n\t// Add a keyboard event handler\n\tdomNode.addEventListener(\"keydown\",function (event) {\n\t\tif($tw.keyboardManager.checkKeyDescriptors(event,self.keyInfoArray)) {\n\t\t\tself.invokeActions(self,event);\n\t\t\tif(self.actions) {\n\t\t\t\tself.invokeActionString(self.actions,self,event);\n\t\t\t}\n\t\t\tself.dispatchMessage(event);\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t},false);\n\t// Insert element\n\tparent.insertBefore(domNode,nextSibling);\n\tthis.renderChildren(domNode,null);\n\tthis.domNodes.push(domNode);\n};\n\nKeyboardWidget.prototype.dispatchMessage = function(event) {\n\tthis.dispatchEvent({type: this.message, param: this.param, tiddlerTitle: this.getVariable(\"currentTiddler\")});\n};\n\n/*\nCompute the internal state of the widget\n*/\nKeyboardWidget.prototype.execute = function() {\n\t// Get attributes\n\tthis.actions = this.getAttribute(\"actions\");\n\tthis.message = this.getAttribute(\"message\");\n\tthis.param = this.getAttribute(\"param\");\n\tthis.key = this.getAttribute(\"key\");\n\tthis.tag = this.getAttribute(\"tag\");\n\tthis.keyInfoArray = $tw.keyboardManager.parseKeyDescriptors(this.key);\n\tthis[\"class\"] = this.getAttribute(\"class\");\n\t// Make child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nKeyboardWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.message || changedAttributes.param || changedAttributes.key || changedAttributes[\"class\"] || changedAttributes.tag) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t}\n\treturn this.refreshChildren(changedTiddlers);\n};\n\nexports.keyboard = KeyboardWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/keyboard.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/link.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/link.js\ntype: application/javascript\nmodule-type: widget\n\nLink widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\nvar MISSING_LINK_CONFIG_TITLE = \"$:/config/MissingLinks\";\n\nvar LinkWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nLinkWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nLinkWidget.prototype.render = function(parent,nextSibling) {\n\t// Save the parent dom node\n\tthis.parentDomNode = parent;\n\t// Compute our attributes\n\tthis.computeAttributes();\n\t// Execute our logic\n\tthis.execute();\n\t// Get the value of the tv-wikilinks configuration macro\n\tvar wikiLinksMacro = this.getVariable(\"tv-wikilinks\"),\n\t\tuseWikiLinks = wikiLinksMacro ? (wikiLinksMacro.trim() !== \"no\") : true,\n\t\tmissingLinksEnabled = !(this.hideMissingLinks && this.isMissing && !this.isShadow);\n\t// Render the link if required\n\tif(useWikiLinks && missingLinksEnabled) {\n\t\tthis.renderLink(parent,nextSibling);\n\t} else {\n\t\t// Just insert the link text\n\t\tvar domNode = this.document.createElement(\"span\");\n\t\tparent.insertBefore(domNode,nextSibling);\n\t\tthis.renderChildren(domNode,null);\n\t\tthis.domNodes.push(domNode);\n\t}\n};\n\n/*\nRender this widget into the DOM\n*/\nLinkWidget.prototype.renderLink = function(parent,nextSibling) {\n\tvar self = this;\n\t// Sanitise the specified tag\n\tvar tag = this.linkTag;\n\tif($tw.config.htmlUnsafeElements.indexOf(tag) !== -1) {\n\t\ttag = \"a\";\n\t}\n\t// Create our element\n\tvar domNode = this.document.createElement(tag);\n\t// Assign classes\n\tvar classes = [];\n\tif(this.linkClasses) {\n\t\tclasses.push(this.linkClasses);\n\t}\n\tclasses.push(\"tc-tiddlylink\");\n\tif(this.isShadow) {\n\t\tclasses.push(\"tc-tiddlylink-shadow\");\n\t}\n\tif(this.isMissing && !this.isShadow) {\n\t\tclasses.push(\"tc-tiddlylink-missing\");\n\t} else {\n\t\tif(!this.isMissing) {\n\t\t\tclasses.push(\"tc-tiddlylink-resolves\");\n\t\t}\n\t}\n\tdomNode.setAttribute(\"class\",classes.join(\" \"));\n\t// Set an href\n\tvar wikiLinkTemplateMacro = this.getVariable(\"tv-wikilink-template\"),\n\t\twikiLinkTemplate = wikiLinkTemplateMacro ? wikiLinkTemplateMacro.trim() : \"#$uri_encoded$\",\n\t\twikiLinkText = $tw.utils.replaceString(wikiLinkTemplate,\"$uri_encoded$\",encodeURIComponent(this.to));\n\twikiLinkText = $tw.utils.replaceString(wikiLinkText,\"$uri_doubleencoded$\",encodeURIComponent(encodeURIComponent(this.to)));\n\twikiLinkText = this.getVariable(\"tv-get-export-link\",{params: [{name: \"to\",value: this.to}],defaultValue: wikiLinkText});\n\tif(tag === \"a\") {\n\t\tdomNode.setAttribute(\"href\",wikiLinkText);\n\t}\n\tif(this.tabIndex) {\n\t\tdomNode.setAttribute(\"tabindex\",this.tabIndex);\n\t}\n\t// Set the tooltip\n\t// HACK: Performance issues with re-parsing the tooltip prevent us defaulting the tooltip to \"<$transclude field='tooltip'><$transclude field='title'/></$transclude>\"\n\tvar tooltipWikiText = this.tooltip || this.getVariable(\"tv-wikilink-tooltip\");\n\tif(tooltipWikiText) {\n\t\tvar tooltipText = this.wiki.renderText(\"text/plain\",\"text/vnd.tiddlywiki\",tooltipWikiText,{\n\t\t\t\tparseAsInline: true,\n\t\t\t\tvariables: {\n\t\t\t\t\tcurrentTiddler: this.to\n\t\t\t\t},\n\t\t\t\tparentWidget: this\n\t\t\t});\n\t\tdomNode.setAttribute(\"title\",tooltipText);\n\t}\n\tif(this[\"aria-label\"]) {\n\t\tdomNode.setAttribute(\"aria-label\",this[\"aria-label\"]);\n\t}\n\t// Add a click event handler\n\t$tw.utils.addEventListeners(domNode,[\n\t\t{name: \"click\", handlerObject: this, handlerMethod: \"handleClickEvent\"},\n\t]);\n\t// Make the link draggable if required\n\tif(this.draggable === \"yes\") {\n\t\t$tw.utils.makeDraggable({\n\t\t\tdomNode: domNode,\n\t\t\tdragTiddlerFn: function() {return self.to;},\n\t\t\twidget: this\n\t\t});\n\t}\n\t// Insert the link into the DOM and render any children\n\tparent.insertBefore(domNode,nextSibling);\n\tthis.renderChildren(domNode,null);\n\tthis.domNodes.push(domNode);\n};\n\nLinkWidget.prototype.handleClickEvent = function(event) {\n\t// Send the click on its way as a navigate event\n\tvar bounds = this.domNodes[0].getBoundingClientRect();\n\tthis.dispatchEvent({\n\t\ttype: \"tm-navigate\",\n\t\tnavigateTo: this.to,\n\t\tnavigateFromTitle: this.getVariable(\"storyTiddler\"),\n\t\tnavigateFromNode: this,\n\t\tnavigateFromClientRect: { top: bounds.top, left: bounds.left, width: bounds.width, right: bounds.right, bottom: bounds.bottom, height: bounds.height\n\t\t},\n\t\tnavigateSuppressNavigation: event.metaKey || event.ctrlKey || (event.button === 1)\n\t});\n\tif(this.domNodes[0].hasAttribute(\"href\")) {\n\t\tevent.preventDefault();\n\t}\n\tevent.stopPropagation();\n\treturn false;\n};\n\n/*\nCompute the internal state of the widget\n*/\nLinkWidget.prototype.execute = function() {\n\t// Pick up our attributes\n\tthis.to = this.getAttribute(\"to\",this.getVariable(\"currentTiddler\"));\n\tthis.tooltip = this.getAttribute(\"tooltip\");\n\tthis[\"aria-label\"] = this.getAttribute(\"aria-label\");\n\tthis.linkClasses = this.getAttribute(\"class\");\n\tthis.tabIndex = this.getAttribute(\"tabindex\");\n\tthis.draggable = this.getAttribute(\"draggable\",\"yes\");\n\tthis.linkTag = this.getAttribute(\"tag\",\"a\");\n\t// Determine the link characteristics\n\tthis.isMissing = !this.wiki.tiddlerExists(this.to);\n\tthis.isShadow = this.wiki.isShadowTiddler(this.to);\n\tthis.hideMissingLinks = ($tw.wiki.getTiddlerText(MISSING_LINK_CONFIG_TITLE,\"yes\") === \"no\");\n\t// Make the child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nLinkWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.to || changedTiddlers[this.to] || changedAttributes[\"aria-label\"] || changedAttributes.tooltip || changedTiddlers[MISSING_LINK_CONFIG_TITLE]) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t}\n\treturn this.refreshChildren(changedTiddlers);\n};\n\nexports.link = LinkWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/link.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/linkcatcher.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/linkcatcher.js\ntype: application/javascript\nmodule-type: widget\n\nLinkcatcher widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar LinkCatcherWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n\tthis.addEventListeners([\n\t\t{type: \"tm-navigate\", handler: \"handleNavigateEvent\"}\n\t]);\n};\n\n/*\nInherit from the base widget class\n*/\nLinkCatcherWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nLinkCatcherWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n};\n\n/*\nCompute the internal state of the widget\n*/\nLinkCatcherWidget.prototype.execute = function() {\n\t// Get our parameters\n\tthis.catchTo = this.getAttribute(\"to\");\n\tthis.catchMessage = this.getAttribute(\"message\");\n\tthis.catchSet = this.getAttribute(\"set\");\n\tthis.catchSetTo = this.getAttribute(\"setTo\");\n\tthis.catchActions = this.getAttribute(\"actions\");\n\t// Construct the child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nLinkCatcherWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.to || changedAttributes.message || changedAttributes.set || changedAttributes.setTo) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn this.refreshChildren(changedTiddlers);\t\t\n\t}\n};\n\n/*\nHandle a tm-navigate event\n*/\nLinkCatcherWidget.prototype.handleNavigateEvent = function(event) {\n\tif(this.catchTo) {\n\t\tthis.wiki.setTextReference(this.catchTo,event.navigateTo,this.getVariable(\"currentTiddler\"));\n\t}\n\tif(this.catchMessage && this.parentWidget) {\n\t\tthis.parentWidget.dispatchEvent({\n\t\t\ttype: this.catchMessage,\n\t\t\tparam: event.navigateTo,\n\t\t\tnavigateTo: event.navigateTo\n\t\t});\n\t}\n\tif(this.catchSet) {\n\t\tvar tiddler = this.wiki.getTiddler(this.catchSet);\n\t\tthis.wiki.addTiddler(new $tw.Tiddler(tiddler,{title: this.catchSet, text: this.catchSetTo}));\n\t}\n\tif(this.catchActions) {\n\t\tthis.invokeActionString(this.catchActions,this);\n\t}\n\treturn false;\n};\n\nexports.linkcatcher = LinkCatcherWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/linkcatcher.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/list.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/list.js\ntype: application/javascript\nmodule-type: widget\n\nList and list item widgets\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\n/*\nThe list widget creates list element sub-widgets that reach back into the list widget for their configuration\n*/\n\nvar ListWidget = function(parseTreeNode,options) {\n\t// Initialise the storyviews if they've not been done already\n\tif(!this.storyViews) {\n\t\tListWidget.prototype.storyViews = {};\n\t\t$tw.modules.applyMethods(\"storyview\",this.storyViews);\n\t}\n\t// Main initialisation inherited from widget.js\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nListWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nListWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n\t// Construct the storyview\n\tvar StoryView = this.storyViews[this.storyViewName];\n\tif(this.storyViewName && !StoryView) {\n\t\tStoryView = this.storyViews[\"classic\"];\n\t}\n\tif(StoryView && !this.document.isTiddlyWikiFakeDom) {\n\t\tthis.storyview = new StoryView(this);\n\t} else {\n\t\tthis.storyview = null;\n\t}\n};\n\n/*\nCompute the internal state of the widget\n*/\nListWidget.prototype.execute = function() {\n\t// Get our attributes\n\tthis.template = this.getAttribute(\"template\");\n\tthis.editTemplate = this.getAttribute(\"editTemplate\");\n\tthis.variableName = this.getAttribute(\"variable\",\"currentTiddler\");\n\tthis.storyViewName = this.getAttribute(\"storyview\");\n\tthis.historyTitle = this.getAttribute(\"history\");\n\t// Compose the list elements\n\tthis.list = this.getTiddlerList();\n\tvar members = [],\n\t\tself = this;\n\t// Check for an empty list\n\tif(this.list.length === 0) {\n\t\tmembers = this.getEmptyMessage();\n\t} else {\n\t\t$tw.utils.each(this.list,function(title,index) {\n\t\t\tmembers.push(self.makeItemTemplate(title));\n\t\t});\n\t}\n\t// Construct the child widgets\n\tthis.makeChildWidgets(members);\n\t// Clear the last history\n\tthis.history = [];\n};\n\nListWidget.prototype.getTiddlerList = function() {\n\tvar defaultFilter = \"[!is[system]sort[title]]\";\n\treturn this.wiki.filterTiddlers(this.getAttribute(\"filter\",defaultFilter),this);\n};\n\nListWidget.prototype.getEmptyMessage = function() {\n\tvar emptyMessage = this.getAttribute(\"emptyMessage\",\"\"),\n\t\tparser = this.wiki.parseText(\"text/vnd.tiddlywiki\",emptyMessage,{parseAsInline: true});\n\tif(parser) {\n\t\treturn parser.tree;\n\t} else {\n\t\treturn [];\n\t}\n};\n\n/*\nCompose the template for a list item\n*/\nListWidget.prototype.makeItemTemplate = function(title) {\n\t// Check if the tiddler is a draft\n\tvar tiddler = this.wiki.getTiddler(title),\n\t\tisDraft = tiddler && tiddler.hasField(\"draft.of\"),\n\t\ttemplate = this.template,\n\t\ttemplateTree;\n\tif(isDraft && this.editTemplate) {\n\t\ttemplate = this.editTemplate;\n\t}\n\t// Compose the transclusion of the template\n\tif(template) {\n\t\ttemplateTree = [{type: \"transclude\", attributes: {tiddler: {type: \"string\", value: template}}}];\n\t} else {\n\t\tif(this.parseTreeNode.children && this.parseTreeNode.children.length > 0) {\n\t\t\ttemplateTree = this.parseTreeNode.children;\n\t\t} else {\n\t\t\t// Default template is a link to the title\n\t\t\ttemplateTree = [{type: \"element\", tag: this.parseTreeNode.isBlock ? \"div\" : \"span\", children: [{type: \"link\", attributes: {to: {type: \"string\", value: title}}, children: [\n\t\t\t\t\t{type: \"text\", text: title}\n\t\t\t]}]}];\n\t\t}\n\t}\n\t// Return the list item\n\treturn {type: \"listitem\", itemTitle: title, variableName: this.variableName, children: templateTree};\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nListWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes(),\n\t\tresult;\n\t// Call the storyview\n\tif(this.storyview && this.storyview.refreshStart) {\n\t\tthis.storyview.refreshStart(changedTiddlers,changedAttributes);\n\t}\n\t// Completely refresh if any of our attributes have changed\n\tif(changedAttributes.filter || changedAttributes.template || changedAttributes.editTemplate || changedAttributes.emptyMessage || changedAttributes.storyview || changedAttributes.history) {\n\t\tthis.refreshSelf();\n\t\tresult = true;\n\t} else {\n\t\t// Handle any changes to the list\n\t\tresult = this.handleListChanges(changedTiddlers);\n\t\t// Handle any changes to the history stack\n\t\tif(this.historyTitle && changedTiddlers[this.historyTitle]) {\n\t\t\tthis.handleHistoryChanges();\n\t\t}\n\t}\n\t// Call the storyview\n\tif(this.storyview && this.storyview.refreshEnd) {\n\t\tthis.storyview.refreshEnd(changedTiddlers,changedAttributes);\n\t}\n\treturn result;\n};\n\n/*\nHandle any changes to the history list\n*/\nListWidget.prototype.handleHistoryChanges = function() {\n\t// Get the history data\n\tvar newHistory = this.wiki.getTiddlerDataCached(this.historyTitle,[]);\n\t// Ignore any entries of the history that match the previous history\n\tvar entry = 0;\n\twhile(entry < newHistory.length && entry < this.history.length && newHistory[entry].title === this.history[entry].title) {\n\t\tentry++;\n\t}\n\t// Navigate forwards to each of the new tiddlers\n\twhile(entry < newHistory.length) {\n\t\tif(this.storyview && this.storyview.navigateTo) {\n\t\t\tthis.storyview.navigateTo(newHistory[entry]);\n\t\t}\n\t\tentry++;\n\t}\n\t// Update the history\n\tthis.history = newHistory;\n};\n\n/*\nProcess any changes to the list\n*/\nListWidget.prototype.handleListChanges = function(changedTiddlers) {\n\t// Get the new list\n\tvar prevList = this.list;\n\tthis.list = this.getTiddlerList();\n\t// Check for an empty list\n\tif(this.list.length === 0) {\n\t\t// Check if it was empty before\n\t\tif(prevList.length === 0) {\n\t\t\t// If so, just refresh the empty message\n\t\t\treturn this.refreshChildren(changedTiddlers);\n\t\t} else {\n\t\t\t// Replace the previous content with the empty message\n\t\t\tfor(t=this.children.length-1; t>=0; t--) {\n\t\t\t\tthis.removeListItem(t);\n\t\t\t}\n\t\t\tvar nextSibling = this.findNextSiblingDomNode();\n\t\t\tthis.makeChildWidgets(this.getEmptyMessage());\n\t\t\tthis.renderChildren(this.parentDomNode,nextSibling);\n\t\t\treturn true;\n\t\t}\n\t} else {\n\t\t// If the list was empty then we need to remove the empty message\n\t\tif(prevList.length === 0) {\n\t\t\tthis.removeChildDomNodes();\n\t\t\tthis.children = [];\n\t\t}\n\t\t// Cycle through the list, inserting and removing list items as needed\n\t\tvar hasRefreshed = false;\n\t\tfor(var t=0; t<this.list.length; t++) {\n\t\t\tvar index = this.findListItem(t,this.list[t]);\n\t\t\tif(index === undefined) {\n\t\t\t\t// The list item must be inserted\n\t\t\t\tthis.insertListItem(t,this.list[t]);\n\t\t\t\thasRefreshed = true;\n\t\t\t} else {\n\t\t\t\t// There are intervening list items that must be removed\n\t\t\t\tfor(var n=index-1; n>=t; n--) {\n\t\t\t\t\tthis.removeListItem(n);\n\t\t\t\t\thasRefreshed = true;\n\t\t\t\t}\n\t\t\t\t// Refresh the item we're reusing\n\t\t\t\tvar refreshed = this.children[t].refresh(changedTiddlers);\n\t\t\t\thasRefreshed = hasRefreshed || refreshed;\n\t\t\t}\n\t\t}\n\t\t// Remove any left over items\n\t\tfor(t=this.children.length-1; t>=this.list.length; t--) {\n\t\t\tthis.removeListItem(t);\n\t\t\thasRefreshed = true;\n\t\t}\n\t\treturn hasRefreshed;\n\t}\n};\n\n/*\nFind the list item with a given title, starting from a specified position\n*/\nListWidget.prototype.findListItem = function(startIndex,title) {\n\twhile(startIndex < this.children.length) {\n\t\tif(this.children[startIndex].parseTreeNode.itemTitle === title) {\n\t\t\treturn startIndex;\n\t\t}\n\t\tstartIndex++;\n\t}\n\treturn undefined;\n};\n\n/*\nInsert a new list item at the specified index\n*/\nListWidget.prototype.insertListItem = function(index,title) {\n\t// Create, insert and render the new child widgets\n\tvar widget = this.makeChildWidget(this.makeItemTemplate(title));\n\twidget.parentDomNode = this.parentDomNode; // Hack to enable findNextSiblingDomNode() to work\n\tthis.children.splice(index,0,widget);\n\tvar nextSibling = widget.findNextSiblingDomNode();\n\twidget.render(this.parentDomNode,nextSibling);\n\t// Animate the insertion if required\n\tif(this.storyview && this.storyview.insert) {\n\t\tthis.storyview.insert(widget);\n\t}\n\treturn true;\n};\n\n/*\nRemove the specified list item\n*/\nListWidget.prototype.removeListItem = function(index) {\n\tvar widget = this.children[index];\n\t// Animate the removal if required\n\tif(this.storyview && this.storyview.remove) {\n\t\tthis.storyview.remove(widget);\n\t} else {\n\t\twidget.removeChildDomNodes();\n\t}\n\t// Remove the child widget\n\tthis.children.splice(index,1);\n};\n\nexports.list = ListWidget;\n\nvar ListItemWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nListItemWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nListItemWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n};\n\n/*\nCompute the internal state of the widget\n*/\nListItemWidget.prototype.execute = function() {\n\t// Set the current list item title\n\tthis.setVariable(this.parseTreeNode.variableName,this.parseTreeNode.itemTitle);\n\t// Construct the child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nListItemWidget.prototype.refresh = function(changedTiddlers) {\n\treturn this.refreshChildren(changedTiddlers);\n};\n\nexports.listitem = ListItemWidget;\n\n})();",
            "title": "$:/core/modules/widgets/list.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/macrocall.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/macrocall.js\ntype: application/javascript\nmodule-type: widget\n\nMacrocall widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar MacroCallWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nMacroCallWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nMacroCallWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n};\n\n/*\nCompute the internal state of the widget\n*/\nMacroCallWidget.prototype.execute = function() {\n\t// Get the parse type if specified\n\tthis.parseType = this.getAttribute(\"$type\",\"text/vnd.tiddlywiki\");\n\tthis.renderOutput = this.getAttribute(\"$output\",\"text/html\");\n\t// Merge together the parameters specified in the parse tree with the specified attributes\n\tvar params = this.parseTreeNode.params ? this.parseTreeNode.params.slice(0) : [];\n\t$tw.utils.each(this.attributes,function(attribute,name) {\n\t\tif(name.charAt(0) !== \"$\") {\n\t\t\tparams.push({name: name, value: attribute});\t\t\t\n\t\t}\n\t});\n\t// Get the macro value\n\tvar text = this.getVariable(this.parseTreeNode.name || this.getAttribute(\"$name\"),{params: params}),\n\t\tparseTreeNodes;\n\t// Are we rendering to HTML?\n\tif(this.renderOutput === \"text/html\") {\n\t\t// If so we'll return the parsed macro\n\t\tvar parser = this.wiki.parseText(this.parseType,text,\n\t\t\t\t\t\t\t{parseAsInline: !this.parseTreeNode.isBlock});\n\t\tparseTreeNodes = parser ? parser.tree : [];\n\t} else {\n\t\t// Otherwise, we'll render the text\n\t\tvar plainText = this.wiki.renderText(\"text/plain\",this.parseType,text,{parentWidget: this});\n\t\tparseTreeNodes = [{type: \"text\", text: plainText}];\n\t}\n\t// Construct the child widgets\n\tthis.makeChildWidgets(parseTreeNodes);\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nMacroCallWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif($tw.utils.count(changedAttributes) > 0) {\n\t\t// Rerender ourselves\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn this.refreshChildren(changedTiddlers);\n\t}\n};\n\nexports.macrocall = MacroCallWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/macrocall.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/navigator.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/navigator.js\ntype: application/javascript\nmodule-type: widget\n\nNavigator widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar IMPORT_TITLE = \"$:/Import\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar NavigatorWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n\tthis.addEventListeners([\n\t\t{type: \"tm-navigate\", handler: \"handleNavigateEvent\"},\n\t\t{type: \"tm-edit-tiddler\", handler: \"handleEditTiddlerEvent\"},\n\t\t{type: \"tm-delete-tiddler\", handler: \"handleDeleteTiddlerEvent\"},\n\t\t{type: \"tm-save-tiddler\", handler: \"handleSaveTiddlerEvent\"},\n\t\t{type: \"tm-cancel-tiddler\", handler: \"handleCancelTiddlerEvent\"},\n\t\t{type: \"tm-close-tiddler\", handler: \"handleCloseTiddlerEvent\"},\n\t\t{type: \"tm-close-all-tiddlers\", handler: \"handleCloseAllTiddlersEvent\"},\n\t\t{type: \"tm-close-other-tiddlers\", handler: \"handleCloseOtherTiddlersEvent\"},\n\t\t{type: \"tm-new-tiddler\", handler: \"handleNewTiddlerEvent\"},\n\t\t{type: \"tm-import-tiddlers\", handler: \"handleImportTiddlersEvent\"},\n\t\t{type: \"tm-perform-import\", handler: \"handlePerformImportEvent\"},\n\t\t{type: \"tm-fold-tiddler\", handler: \"handleFoldTiddlerEvent\"},\n\t\t{type: \"tm-fold-other-tiddlers\", handler: \"handleFoldOtherTiddlersEvent\"},\n\t\t{type: \"tm-fold-all-tiddlers\", handler: \"handleFoldAllTiddlersEvent\"},\n\t\t{type: \"tm-unfold-all-tiddlers\", handler: \"handleUnfoldAllTiddlersEvent\"},\n\t\t{type: \"tm-rename-tiddler\", handler: \"handleRenameTiddlerEvent\"}\n\t]);\n};\n\n/*\nInherit from the base widget class\n*/\nNavigatorWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nNavigatorWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n};\n\n/*\nCompute the internal state of the widget\n*/\nNavigatorWidget.prototype.execute = function() {\n\t// Get our parameters\n\tthis.storyTitle = this.getAttribute(\"story\");\n\tthis.historyTitle = this.getAttribute(\"history\");\n\t// Construct the child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nNavigatorWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.story || changedAttributes.history) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn this.refreshChildren(changedTiddlers);\n\t}\n};\n\nNavigatorWidget.prototype.getStoryList = function() {\n\treturn this.storyTitle ? this.wiki.getTiddlerList(this.storyTitle) : null;\n};\n\nNavigatorWidget.prototype.saveStoryList = function(storyList) {\n\tvar storyTiddler = this.wiki.getTiddler(this.storyTitle);\n\tthis.wiki.addTiddler(new $tw.Tiddler(\n\t\t{title: this.storyTitle},\n\t\tstoryTiddler,\n\t\t{list: storyList}\n\t));\n};\n\nNavigatorWidget.prototype.removeTitleFromStory = function(storyList,title) {\n\tvar p = storyList.indexOf(title);\n\twhile(p !== -1) {\n\t\tstoryList.splice(p,1);\n\t\tp = storyList.indexOf(title);\n\t}\n};\n\nNavigatorWidget.prototype.replaceFirstTitleInStory = function(storyList,oldTitle,newTitle) {\n\tvar pos = storyList.indexOf(oldTitle);\n\tif(pos !== -1) {\n\t\tstoryList[pos] = newTitle;\n\t\tdo {\n\t\t\tpos = storyList.indexOf(oldTitle,pos + 1);\n\t\t\tif(pos !== -1) {\n\t\t\t\tstoryList.splice(pos,1);\n\t\t\t}\n\t\t} while(pos !== -1);\n\t} else {\n\t\tstoryList.splice(0,0,newTitle);\n\t}\n};\n\nNavigatorWidget.prototype.addToStory = function(title,fromTitle) {\n\tvar storyList = this.getStoryList();\n\t// Quit if we cannot get hold of the story list\n\tif(!storyList) {\n\t\treturn;\n\t}\n\t// See if the tiddler is already there\n\tvar slot = storyList.indexOf(title);\n\t// Quit if it already exists in the story river\n\tif(slot >= 0) {\n\t\treturn;\n\t}\n\t// First we try to find the position of the story element we navigated from\n\tvar fromIndex = storyList.indexOf(fromTitle);\n\tif(fromIndex >= 0) {\n\t\t// The tiddler is added from inside the river\n\t\t// Determine where to insert the tiddler; Fallback is \"below\"\n\t\tswitch(this.getAttribute(\"openLinkFromInsideRiver\",\"below\")) {\n\t\t\tcase \"top\":\n\t\t\t\tslot = 0;\n\t\t\t\tbreak;\n\t\t\tcase \"bottom\":\n\t\t\t\tslot = storyList.length;\n\t\t\t\tbreak;\n\t\t\tcase \"above\":\n\t\t\t\tslot = fromIndex;\n\t\t\t\tbreak;\n\t\t\tcase \"below\": // Intentional fall-through\n\t\t\tdefault:\n\t\t\t\tslot = fromIndex + 1;\n\t\t\t\tbreak;\n\t\t}\n\t} else {\n\t\t// The tiddler is opened from outside the river. Determine where to insert the tiddler; default is \"top\"\n\t\tif(this.getAttribute(\"openLinkFromOutsideRiver\",\"top\") === \"bottom\") {\n\t\t\t// Insert at bottom\n\t\t\tslot = storyList.length;\n\t\t} else {\n\t\t\t// Insert at top\n\t\t\tslot = 0;\n\t\t}\n\t}\n\t// Add the tiddler\n\tstoryList.splice(slot,0,title);\n\t// Save the story\n\tthis.saveStoryList(storyList);\n};\n\n/*\nAdd a new record to the top of the history stack\ntitle: a title string or an array of title strings\nfromPageRect: page coordinates of the origin of the navigation\n*/\nNavigatorWidget.prototype.addToHistory = function(title,fromPageRect) {\n\tthis.wiki.addToHistory(title,fromPageRect,this.historyTitle);\n};\n\n/*\nHandle a tm-navigate event\n*/\nNavigatorWidget.prototype.handleNavigateEvent = function(event) {\n\tevent = $tw.hooks.invokeHook(\"th-navigating\",event);\n\tif(event.navigateTo) {\n\t\tthis.addToStory(event.navigateTo,event.navigateFromTitle);\n\t\tif(!event.navigateSuppressNavigation) {\n\t\t\tthis.addToHistory(event.navigateTo,event.navigateFromClientRect);\n\t\t}\n\t}\n\treturn false;\n};\n\n// Close a specified tiddler\nNavigatorWidget.prototype.handleCloseTiddlerEvent = function(event) {\n\tvar title = event.param || event.tiddlerTitle,\n\t\tstoryList = this.getStoryList();\n\t// Look for tiddlers with this title to close\n\tthis.removeTitleFromStory(storyList,title);\n\tthis.saveStoryList(storyList);\n\treturn false;\n};\n\n// Close all tiddlers\nNavigatorWidget.prototype.handleCloseAllTiddlersEvent = function(event) {\n\tthis.saveStoryList([]);\n\treturn false;\n};\n\n// Close other tiddlers\nNavigatorWidget.prototype.handleCloseOtherTiddlersEvent = function(event) {\n\tvar title = event.param || event.tiddlerTitle;\n\tthis.saveStoryList([title]);\n\treturn false;\n};\n\n// Place a tiddler in edit mode\nNavigatorWidget.prototype.handleEditTiddlerEvent = function(event) {\n\tvar self = this;\n\tfunction isUnmodifiedShadow(title) {\n\t\treturn self.wiki.isShadowTiddler(title) && !self.wiki.tiddlerExists(title);\n\t}\n\tfunction confirmEditShadow(title) {\n\t\treturn confirm($tw.language.getString(\n\t\t\t\"ConfirmEditShadowTiddler\",\n\t\t\t{variables:\n\t\t\t\t{title: title}\n\t\t\t}\n\t\t));\n\t}\n\tvar title = event.param || event.tiddlerTitle;\n\tif(isUnmodifiedShadow(title) && !confirmEditShadow(title)) {\n\t\treturn false;\n\t}\n\t// Replace the specified tiddler with a draft in edit mode\n\tvar draftTiddler = this.makeDraftTiddler(title);\n\t// Update the story and history if required\n\tif(!event.paramObject || event.paramObject.suppressNavigation !== \"yes\") {\n\t\tvar draftTitle = draftTiddler.fields.title,\n\t\t\tstoryList = this.getStoryList();\n\t\tthis.removeTitleFromStory(storyList,draftTitle);\n\t\tthis.replaceFirstTitleInStory(storyList,title,draftTitle);\n\t\tthis.addToHistory(draftTitle,event.navigateFromClientRect);\n\t\tthis.saveStoryList(storyList);\n\t\treturn false;\n\t}\n};\n\n// Delete a tiddler\nNavigatorWidget.prototype.handleDeleteTiddlerEvent = function(event) {\n\t// Get the tiddler we're deleting\n\tvar title = event.param || event.tiddlerTitle,\n\t\ttiddler = this.wiki.getTiddler(title),\n\t\tstoryList = this.getStoryList(),\n\t\toriginalTitle = tiddler ? tiddler.fields[\"draft.of\"] : \"\",\n\t\toriginalTiddler = originalTitle ? this.wiki.getTiddler(originalTitle) : undefined,\n\t\tconfirmationTitle;\n\tif(!tiddler) {\n\t\treturn false;\n\t}\n\t// Check if the tiddler we're deleting is in draft mode\n\tif(originalTitle) {\n\t\t// If so, we'll prompt for confirmation referencing the original tiddler\n\t\tconfirmationTitle = originalTitle;\n\t} else {\n\t\t// If not a draft, then prompt for confirmation referencing the specified tiddler\n\t\tconfirmationTitle = title;\n\t}\n\t// Seek confirmation\n\tif((this.wiki.getTiddler(originalTitle) || (tiddler.fields.text || \"\") !== \"\") && !confirm($tw.language.getString(\n\t\t\t\t\"ConfirmDeleteTiddler\",\n\t\t\t\t{variables:\n\t\t\t\t\t{title: confirmationTitle}\n\t\t\t\t}\n\t\t\t))) {\n\t\treturn false;\n\t}\n\t// Delete the original tiddler\n\tif(originalTitle) {\n\t\tif(originalTiddler) {\n\t\t\t$tw.hooks.invokeHook(\"th-deleting-tiddler\",originalTiddler);\n\t\t}\n\t\tthis.wiki.deleteTiddler(originalTitle);\n\t\tthis.removeTitleFromStory(storyList,originalTitle);\n\t}\n\t// Invoke the hook function and delete this tiddler\n\t$tw.hooks.invokeHook(\"th-deleting-tiddler\",tiddler);\n\tthis.wiki.deleteTiddler(title);\n\t// Remove the closed tiddler from the story\n\tthis.removeTitleFromStory(storyList,title);\n\tthis.saveStoryList(storyList);\n\t// Trigger an autosave\n\t$tw.rootWidget.dispatchEvent({type: \"tm-auto-save-wiki\"});\n\treturn false;\n};\n\n/*\nCreate/reuse the draft tiddler for a given title\n*/\nNavigatorWidget.prototype.makeDraftTiddler = function(targetTitle) {\n\t// See if there is already a draft tiddler for this tiddler\n\tvar draftTitle = this.wiki.findDraft(targetTitle);\n\tif(draftTitle) {\n\t\treturn this.wiki.getTiddler(draftTitle);\n\t}\n\t// Get the current value of the tiddler we're editing\n\tvar tiddler = this.wiki.getTiddler(targetTitle);\n\t// Save the initial value of the draft tiddler\n\tdraftTitle = this.generateDraftTitle(targetTitle);\n\tvar draftTiddler = new $tw.Tiddler(\n\t\t\ttiddler,\n\t\t\t{\n\t\t\t\ttitle: draftTitle,\n\t\t\t\t\"draft.title\": targetTitle,\n\t\t\t\t\"draft.of\": targetTitle\n\t\t\t},\n\t\t\tthis.wiki.getModificationFields()\n\t\t);\n\tthis.wiki.addTiddler(draftTiddler);\n\treturn draftTiddler;\n};\n\n/*\nGenerate a title for the draft of a given tiddler\n*/\nNavigatorWidget.prototype.generateDraftTitle = function(title) {\n\tvar c = 0,\n\t\tdraftTitle;\n\tdo {\n\t\tdraftTitle = \"Draft \" + (c ? (c + 1) + \" \" : \"\") + \"of '\" + title + \"'\";\n\t\tc++;\n\t} while(this.wiki.tiddlerExists(draftTitle));\n\treturn draftTitle;\n};\n\n// Take a tiddler out of edit mode, saving the changes\nNavigatorWidget.prototype.handleSaveTiddlerEvent = function(event) {\n\tvar title = event.param || event.tiddlerTitle,\n\t\ttiddler = this.wiki.getTiddler(title),\n\t\tstoryList = this.getStoryList();\n\t// Replace the original tiddler with the draft\n\tif(tiddler) {\n\t\tvar draftTitle = (tiddler.fields[\"draft.title\"] || \"\").trim(),\n\t\t\tdraftOf = (tiddler.fields[\"draft.of\"] || \"\").trim();\n\t\tif(draftTitle) {\n\t\t\tvar isRename = draftOf !== draftTitle,\n\t\t\t\tisConfirmed = true;\n\t\t\tif(isRename && this.wiki.tiddlerExists(draftTitle)) {\n\t\t\t\tisConfirmed = confirm($tw.language.getString(\n\t\t\t\t\t\"ConfirmOverwriteTiddler\",\n\t\t\t\t\t{variables:\n\t\t\t\t\t\t{title: draftTitle}\n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t}\n\t\t\tif(isConfirmed) {\n\t\t\t\t// Create the new tiddler and pass it through the th-saving-tiddler hook\n\t\t\t\tvar newTiddler = new $tw.Tiddler(this.wiki.getCreationFields(),tiddler,{\n\t\t\t\t\ttitle: draftTitle,\n\t\t\t\t\t\"draft.title\": undefined,\n\t\t\t\t\t\"draft.of\": undefined\n\t\t\t\t},this.wiki.getModificationFields());\n\t\t\t\tnewTiddler = $tw.hooks.invokeHook(\"th-saving-tiddler\",newTiddler);\n\t\t\t\tthis.wiki.addTiddler(newTiddler);\n\t\t\t\t// If enabled, relink references to renamed tiddler\n\t\t\t\tvar shouldRelink = this.getAttribute(\"relinkOnRename\",\"no\").toLowerCase().trim() === \"yes\";\n\t\t\t\tif(isRename && shouldRelink && this.wiki.tiddlerExists(draftOf)) {\nconsole.log(\"Relinking '\" + draftOf + \"' to '\" + draftTitle + \"'\");\n\t\t\t\t\tthis.wiki.relinkTiddler(draftOf,draftTitle);\n\t\t\t\t}\n\t\t\t\t// Remove the draft tiddler\n\t\t\t\tthis.wiki.deleteTiddler(title);\n\t\t\t\t// Remove the original tiddler if we're renaming it\n\t\t\t\tif(isRename) {\n\t\t\t\t\tthis.wiki.deleteTiddler(draftOf);\n\t\t\t\t}\n\t\t\t\t// #2381 always remove new title & old\n\t\t\t\tthis.removeTitleFromStory(storyList,draftTitle);\n\t\t\t\tthis.removeTitleFromStory(storyList,draftOf);\n\t\t\t\tif(!event.paramObject || event.paramObject.suppressNavigation !== \"yes\") {\n\t\t\t\t\t// Replace the draft in the story with the original\n\t\t\t\t\tthis.replaceFirstTitleInStory(storyList,title,draftTitle);\n\t\t\t\t\tthis.addToHistory(draftTitle,event.navigateFromClientRect);\n\t\t\t\t\tif(draftTitle !== this.storyTitle) {\n\t\t\t\t\t\tthis.saveStoryList(storyList);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Trigger an autosave\n\t\t\t\t$tw.rootWidget.dispatchEvent({type: \"tm-auto-save-wiki\"});\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n};\n\n// Take a tiddler out of edit mode without saving the changes\nNavigatorWidget.prototype.handleCancelTiddlerEvent = function(event) {\n\t// Flip the specified tiddler from draft back to the original\n\tvar draftTitle = event.param || event.tiddlerTitle,\n\t\tdraftTiddler = this.wiki.getTiddler(draftTitle),\n\t\toriginalTitle = draftTiddler && draftTiddler.fields[\"draft.of\"];\n\tif(draftTiddler && originalTitle) {\n\t\t// Ask for confirmation if the tiddler text has changed\n\t\tvar isConfirmed = true,\n\t\t\toriginalTiddler = this.wiki.getTiddler(originalTitle),\n\t\t\tstoryList = this.getStoryList();\n\t\tif(this.wiki.isDraftModified(draftTitle)) {\n\t\t\tisConfirmed = confirm($tw.language.getString(\n\t\t\t\t\"ConfirmCancelTiddler\",\n\t\t\t\t{variables:\n\t\t\t\t\t{title: draftTitle}\n\t\t\t\t}\n\t\t\t));\n\t\t}\n\t\t// Remove the draft tiddler\n\t\tif(isConfirmed) {\n\t\t\tthis.wiki.deleteTiddler(draftTitle);\n\t\t\tif(!event.paramObject || event.paramObject.suppressNavigation !== \"yes\") {\n\t\t\t\tif(originalTiddler) {\n\t\t\t\t\tthis.replaceFirstTitleInStory(storyList,draftTitle,originalTitle);\n\t\t\t\t\tthis.addToHistory(originalTitle,event.navigateFromClientRect);\n\t\t\t\t} else {\n\t\t\t\t\tthis.removeTitleFromStory(storyList,draftTitle);\n\t\t\t\t}\n\t\t\t\tthis.saveStoryList(storyList);\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n};\n\n// Create a new draft tiddler\n// event.param can either be the title of a template tiddler, or a hashmap of fields.\n//\n// The title of the newly created tiddler follows these rules:\n// * If a hashmap was used and a title field was specified, use that title\n// * If a hashmap was used without a title field, use a default title, if necessary making it unique with a numeric suffix\n// * If a template tiddler was used, use the title of the template, if necessary making it unique with a numeric suffix\n//\n// If a draft of the target tiddler already exists then it is reused\nNavigatorWidget.prototype.handleNewTiddlerEvent = function(event) {\n\t// Get the story details\n\tvar storyList = this.getStoryList(),\n\t\ttemplateTiddler, additionalFields, title, draftTitle, existingTiddler;\n\t// Get the template tiddler (if any)\n\tif(typeof event.param === \"string\") {\n\t\t// Get the template tiddler\n\t\ttemplateTiddler = this.wiki.getTiddler(event.param);\n\t\t// Generate a new title\n\t\ttitle = this.wiki.generateNewTitle(event.param || $tw.language.getString(\"DefaultNewTiddlerTitle\"));\n\t}\n\t// Get the specified additional fields\n\tif(typeof event.paramObject === \"object\") {\n\t\tadditionalFields = event.paramObject;\n\t}\n\tif(typeof event.param === \"object\") { // Backwards compatibility with 5.1.3\n\t\tadditionalFields = event.param;\n\t}\n\tif(additionalFields && additionalFields.title) {\n\t\ttitle = additionalFields.title;\n\t}\n\t// Generate a title if we don't have one\n\ttitle = title || this.wiki.generateNewTitle($tw.language.getString(\"DefaultNewTiddlerTitle\"));\n\t// Find any existing draft for this tiddler\n\tdraftTitle = this.wiki.findDraft(title);\n\t// Pull in any existing tiddler\n\tif(draftTitle) {\n\t\texistingTiddler = this.wiki.getTiddler(draftTitle);\n\t} else {\n\t\tdraftTitle = this.generateDraftTitle(title);\n\t\texistingTiddler = this.wiki.getTiddler(title);\n\t}\n\t// Merge the tags\n\tvar mergedTags = [];\n\tif(existingTiddler && existingTiddler.fields.tags) {\n\t\t$tw.utils.pushTop(mergedTags,existingTiddler.fields.tags);\n\t}\n\tif(additionalFields && additionalFields.tags) {\n\t\t// Merge tags\n\t\tmergedTags = $tw.utils.pushTop(mergedTags,$tw.utils.parseStringArray(additionalFields.tags));\n\t}\n\tif(templateTiddler && templateTiddler.fields.tags) {\n\t\t// Merge tags\n\t\tmergedTags = $tw.utils.pushTop(mergedTags,templateTiddler.fields.tags);\n\t}\n\t// Save the draft tiddler\n\tvar draftTiddler = new $tw.Tiddler({\n\t\t\ttext: \"\",\n\t\t\t\"draft.title\": title\n\t\t},\n\t\ttemplateTiddler,\n\t\texistingTiddler,\n\t\tadditionalFields,\n\t\tthis.wiki.getCreationFields(),\n\t\t{\n\t\t\ttitle: draftTitle,\n\t\t\t\"draft.of\": title,\n\t\t\ttags: mergedTags\n\t\t},this.wiki.getModificationFields());\n\tthis.wiki.addTiddler(draftTiddler);\n\t// Update the story to insert the new draft at the top and remove any existing tiddler\n\tif(storyList.indexOf(draftTitle) === -1) {\n\t\tvar slot = storyList.indexOf(event.navigateFromTitle);\n\t\tstoryList.splice(slot + 1,0,draftTitle);\n\t}\n\tif(storyList.indexOf(title) !== -1) {\n\t\tstoryList.splice(storyList.indexOf(title),1);\t\t\n\t}\n\tthis.saveStoryList(storyList);\n\t// Add a new record to the top of the history stack\n\tthis.addToHistory(draftTitle);\n\treturn false;\n};\n\n// Import JSON tiddlers into a pending import tiddler\nNavigatorWidget.prototype.handleImportTiddlersEvent = function(event) {\n\t// Get the tiddlers\n\tvar tiddlers = [];\n\ttry {\n\t\ttiddlers = JSON.parse(event.param);\t\n\t} catch(e) {\n\t}\n\t// Get the current $:/Import tiddler\n\tvar importTiddler = this.wiki.getTiddler(IMPORT_TITLE),\n\t\timportData = this.wiki.getTiddlerData(IMPORT_TITLE,{}),\n\t\tnewFields = new Object({\n\t\t\ttitle: IMPORT_TITLE,\n\t\t\ttype: \"application/json\",\n\t\t\t\"plugin-type\": \"import\",\n\t\t\t\"status\": \"pending\"\n\t\t}),\n\t\tincomingTiddlers = [];\n\t// Process each tiddler\n\timportData.tiddlers = importData.tiddlers || {};\n\t$tw.utils.each(tiddlers,function(tiddlerFields) {\n\t\tvar title = tiddlerFields.title;\n\t\tif(title) {\n\t\t\tincomingTiddlers.push(title);\n\t\t\timportData.tiddlers[title] = tiddlerFields;\n\t\t}\n\t});\n\t// Give the active upgrader modules a chance to process the incoming tiddlers\n\tvar messages = this.wiki.invokeUpgraders(incomingTiddlers,importData.tiddlers);\n\t$tw.utils.each(messages,function(message,title) {\n\t\tnewFields[\"message-\" + title] = message;\n\t});\n\t// Deselect any suppressed tiddlers\n\t$tw.utils.each(importData.tiddlers,function(tiddler,title) {\n\t\tif($tw.utils.count(tiddler) === 0) {\n\t\t\tnewFields[\"selection-\" + title] = \"unchecked\";\n\t\t}\n\t});\n\t// Save the $:/Import tiddler\n\tnewFields.text = JSON.stringify(importData,null,$tw.config.preferences.jsonSpaces);\n\tthis.wiki.addTiddler(new $tw.Tiddler(importTiddler,newFields));\n\t// Update the story and history details\n\tif(this.getVariable(\"tv-auto-open-on-import\") !== \"no\") {\n\t\tvar storyList = this.getStoryList(),\n\t\t\thistory = [];\n\t\t// Add it to the story\n\t\tif(storyList.indexOf(IMPORT_TITLE) === -1) {\n\t\t\tstoryList.unshift(IMPORT_TITLE);\n\t\t}\n\t\t// And to history\n\t\thistory.push(IMPORT_TITLE);\n\t\t// Save the updated story and history\n\t\tthis.saveStoryList(storyList);\n\t\tthis.addToHistory(history);\n\t}\n\treturn false;\n};\n\n// \nNavigatorWidget.prototype.handlePerformImportEvent = function(event) {\n\tvar self = this,\n\t\timportTiddler = this.wiki.getTiddler(event.param),\n\t\timportData = this.wiki.getTiddlerDataCached(event.param,{tiddlers: {}}),\n\t\timportReport = [];\n\t// Add the tiddlers to the store\n\timportReport.push($tw.language.getString(\"Import/Imported/Hint\") + \"\\n\");\n\t$tw.utils.each(importData.tiddlers,function(tiddlerFields) {\n\t\tvar title = tiddlerFields.title;\n\t\tif(title && importTiddler && importTiddler.fields[\"selection-\" + title] !== \"unchecked\") {\n\t\t\tvar tiddler = new $tw.Tiddler(tiddlerFields);\n\t\t\ttiddler = $tw.hooks.invokeHook(\"th-importing-tiddler\",tiddler);\n\t\t\tself.wiki.addTiddler(tiddler);\n\t\t\timportReport.push(\"# [[\" + tiddlerFields.title + \"]]\");\n\t\t}\n\t});\n\t// Replace the $:/Import tiddler with an import report\n\tthis.wiki.addTiddler(new $tw.Tiddler({\n\t\ttitle: event.param,\n\t\ttext: importReport.join(\"\\n\"),\n\t\t\"status\": \"complete\"\n\t}));\n\t// Navigate to the $:/Import tiddler\n\tthis.addToHistory([event.param]);\n\t// Trigger an autosave\n\t$tw.rootWidget.dispatchEvent({type: \"tm-auto-save-wiki\"});\n};\n\nNavigatorWidget.prototype.handleFoldTiddlerEvent = function(event) {\n\tvar paramObject = event.paramObject || {};\n\tif(paramObject.foldedState) {\n\t\tvar foldedState = this.wiki.getTiddlerText(paramObject.foldedState,\"show\") === \"show\" ? \"hide\" : \"show\";\n\t\tthis.wiki.setText(paramObject.foldedState,\"text\",null,foldedState);\n\t}\n};\n\nNavigatorWidget.prototype.handleFoldOtherTiddlersEvent = function(event) {\n\tvar self = this,\n\t\tparamObject = event.paramObject || {},\n\t\tprefix = paramObject.foldedStatePrefix;\n\t$tw.utils.each(this.getStoryList(),function(title) {\n\t\tself.wiki.setText(prefix + title,\"text\",null,event.param === title ? \"show\" : \"hide\");\n\t});\n};\n\nNavigatorWidget.prototype.handleFoldAllTiddlersEvent = function(event) {\n\tvar self = this,\n\t\tparamObject = event.paramObject || {},\n\t\tprefix = paramObject.foldedStatePrefix;\n\t$tw.utils.each(this.getStoryList(),function(title) {\n\t\tself.wiki.setText(prefix + title,\"text\",null,\"hide\");\n\t});\n};\n\nNavigatorWidget.prototype.handleUnfoldAllTiddlersEvent = function(event) {\n\tvar self = this,\n\t\tparamObject = event.paramObject || {},\n\t\tprefix = paramObject.foldedStatePrefix;\n\t$tw.utils.each(this.getStoryList(),function(title) {\n\t\tself.wiki.setText(prefix + title,\"text\",null,\"show\");\n\t});\n};\n\nNavigatorWidget.prototype.handleRenameTiddlerEvent = function(event) {\n\tvar paramObject = event.paramObject || {},\n\t\tfrom = paramObject.from || event.tiddlerTitle,\n\t\tto = paramObject.to;\n\t$tw.wiki.renameTiddler(from,to);\n};\n\nexports.navigator = NavigatorWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/navigator.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/password.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/password.js\ntype: application/javascript\nmodule-type: widget\n\nPassword widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar PasswordWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nPasswordWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nPasswordWidget.prototype.render = function(parent,nextSibling) {\n\t// Save the parent dom node\n\tthis.parentDomNode = parent;\n\t// Compute our attributes\n\tthis.computeAttributes();\n\t// Execute our logic\n\tthis.execute();\n\t// Get the current password\n\tvar password = $tw.browser ? $tw.utils.getPassword(this.passwordName) || \"\" : \"\";\n\t// Create our element\n\tvar domNode = this.document.createElement(\"input\");\n\tdomNode.setAttribute(\"type\",\"password\");\n\tdomNode.setAttribute(\"value\",password);\n\t// Add a click event handler\n\t$tw.utils.addEventListeners(domNode,[\n\t\t{name: \"change\", handlerObject: this, handlerMethod: \"handleChangeEvent\"}\n\t]);\n\t// Insert the label into the DOM and render any children\n\tparent.insertBefore(domNode,nextSibling);\n\tthis.renderChildren(domNode,null);\n\tthis.domNodes.push(domNode);\n};\n\nPasswordWidget.prototype.handleChangeEvent = function(event) {\n\tvar password = this.domNodes[0].value;\n\treturn $tw.utils.savePassword(this.passwordName,password);\n};\n\n/*\nCompute the internal state of the widget\n*/\nPasswordWidget.prototype.execute = function() {\n\t// Get the parameters from the attributes\n\tthis.passwordName = this.getAttribute(\"name\",\"\");\n\t// Make the child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nPasswordWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.name) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn this.refreshChildren(changedTiddlers);\n\t}\n};\n\nexports.password = PasswordWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/password.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/radio.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/radio.js\ntype: application/javascript\nmodule-type: widget\n\nSet a field or index at a given tiddler via radio buttons\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar RadioWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nRadioWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nRadioWidget.prototype.render = function(parent,nextSibling) {\n\t// Save the parent dom node\n\tthis.parentDomNode = parent;\n\t// Compute our attributes\n\tthis.computeAttributes();\n\t// Execute our logic\n\tthis.execute();\n\t// Create our elements\n\tthis.labelDomNode = this.document.createElement(\"label\");\n\tthis.labelDomNode.setAttribute(\"class\",this.radioClass);\n\tthis.inputDomNode = this.document.createElement(\"input\");\n\tthis.inputDomNode.setAttribute(\"type\",\"radio\");\n\tif(this.getValue() == this.radioValue) {\n\t\tthis.inputDomNode.setAttribute(\"checked\",\"true\");\n\t}\n\tthis.labelDomNode.appendChild(this.inputDomNode);\n\tthis.spanDomNode = this.document.createElement(\"span\");\n\tthis.labelDomNode.appendChild(this.spanDomNode);\n\t// Add a click event handler\n\t$tw.utils.addEventListeners(this.inputDomNode,[\n\t\t{name: \"change\", handlerObject: this, handlerMethod: \"handleChangeEvent\"}\n\t]);\n\t// Insert the label into the DOM and render any children\n\tparent.insertBefore(this.labelDomNode,nextSibling);\n\tthis.renderChildren(this.spanDomNode,null);\n\tthis.domNodes.push(this.labelDomNode);\n};\n\nRadioWidget.prototype.getValue = function() {\n\tvar value,\n\t\ttiddler = this.wiki.getTiddler(this.radioTitle);\n\tif (this.radioIndex) {\n\t\tvalue = this.wiki.extractTiddlerDataItem(this.radioTitle,this.radioIndex);\n\t} else {\n\t\tvalue = tiddler && tiddler.getFieldString(this.radioField);\n\t}\n\treturn value;\n};\n\nRadioWidget.prototype.setValue = function() {\n\tif(this.radioIndex) {\n\t\tthis.wiki.setText(this.radioTitle,\"\",this.radioIndex,this.radioValue);\n\t} else {\n\t\tvar tiddler = this.wiki.getTiddler(this.radioTitle),\n\t\t\taddition = {};\n\t\taddition[this.radioField] = this.radioValue;\n\t\tthis.wiki.addTiddler(new $tw.Tiddler(this.wiki.getCreationFields(),{title: this.radioTitle},tiddler,addition,this.wiki.getModificationFields()));\n\t}\n};\n\nRadioWidget.prototype.handleChangeEvent = function(event) {\n\tif(this.inputDomNode.checked) {\n\t\tthis.setValue();\n\t}\n};\n\n/*\nCompute the internal state of the widget\n*/\nRadioWidget.prototype.execute = function() {\n\t// Get the parameters from the attributes\n\tthis.radioTitle = this.getAttribute(\"tiddler\",this.getVariable(\"currentTiddler\"));\n\tthis.radioField = this.getAttribute(\"field\",\"text\");\n\tthis.radioIndex = this.getAttribute(\"index\");\n\tthis.radioValue = this.getAttribute(\"value\");\n\tthis.radioClass = this.getAttribute(\"class\",\"\");\n\tif(this.radioClass !== \"\") {\n\t\tthis.radioClass += \" \";\n\t}\n\tthis.radioClass += \"tc-radio\";\n\t// Make the child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nRadioWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes.value || changedAttributes[\"class\"]) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\tvar refreshed = false;\n\t\tif(changedTiddlers[this.radioTitle]) {\n\t\t\tthis.inputDomNode.checked = this.getValue() === this.radioValue;\n\t\t\trefreshed = true;\n\t\t}\n\t\treturn this.refreshChildren(changedTiddlers) || refreshed;\n\t}\n};\n\nexports.radio = RadioWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/radio.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/raw.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/raw.js\ntype: application/javascript\nmodule-type: widget\n\nRaw widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar RawWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nRawWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nRawWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.execute();\n\tvar div = this.document.createElement(\"div\");\n\tdiv.innerHTML=this.parseTreeNode.html;\n\tparent.insertBefore(div,nextSibling);\n\tthis.domNodes.push(div);\t\n};\n\n/*\nCompute the internal state of the widget\n*/\nRawWidget.prototype.execute = function() {\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nRawWidget.prototype.refresh = function(changedTiddlers) {\n\treturn false;\n};\n\nexports.raw = RawWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/raw.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/reveal.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/reveal.js\ntype: application/javascript\nmodule-type: widget\n\nReveal widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar RevealWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nRevealWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nRevealWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tvar tag = this.parseTreeNode.isBlock ? \"div\" : \"span\";\n\tif(this.revealTag && $tw.config.htmlUnsafeElements.indexOf(this.revealTag) === -1) {\n\t\ttag = this.revealTag;\n\t}\n\tvar domNode = this.document.createElement(tag);\n\tvar classes = this[\"class\"].split(\" \") || [];\n\tclasses.push(\"tc-reveal\");\n\tdomNode.className = classes.join(\" \");\n\tif(this.style) {\n\t\tdomNode.setAttribute(\"style\",this.style);\n\t}\n\tparent.insertBefore(domNode,nextSibling);\n\tthis.renderChildren(domNode,null);\n\tif(!domNode.isTiddlyWikiFakeDom && this.type === \"popup\" && this.isOpen) {\n\t\tthis.positionPopup(domNode);\n\t\t$tw.utils.addClass(domNode,\"tc-popup\"); // Make sure that clicks don't dismiss popups within the revealed content\n\t}\n\tif(!this.isOpen) {\n\t\tdomNode.setAttribute(\"hidden\",\"true\");\n\t}\n\tthis.domNodes.push(domNode);\n};\n\nRevealWidget.prototype.positionPopup = function(domNode) {\n\tdomNode.style.position = \"absolute\";\n\tdomNode.style.zIndex = \"1000\";\n\tswitch(this.position) {\n\t\tcase \"left\":\n\t\t\tdomNode.style.left = (this.popup.left - domNode.offsetWidth) + \"px\";\n\t\t\tdomNode.style.top = this.popup.top + \"px\";\n\t\t\tbreak;\n\t\tcase \"above\":\n\t\t\tdomNode.style.left = this.popup.left + \"px\";\n\t\t\tdomNode.style.top = (this.popup.top - domNode.offsetHeight) + \"px\";\n\t\t\tbreak;\n\t\tcase \"aboveright\":\n\t\t\tdomNode.style.left = (this.popup.left + this.popup.width) + \"px\";\n\t\t\tdomNode.style.top = (this.popup.top + this.popup.height - domNode.offsetHeight) + \"px\";\n\t\t\tbreak;\n\t\tcase \"right\":\n\t\t\tdomNode.style.left = (this.popup.left + this.popup.width) + \"px\";\n\t\t\tdomNode.style.top = this.popup.top + \"px\";\n\t\t\tbreak;\n\t\tcase \"belowleft\":\n\t\t\tdomNode.style.left = (this.popup.left + this.popup.width - domNode.offsetWidth) + \"px\";\n\t\t\tdomNode.style.top = (this.popup.top + this.popup.height) + \"px\";\n\t\t\tbreak;\n\t\tdefault: // Below\n\t\t\tdomNode.style.left = this.popup.left + \"px\";\n\t\t\tdomNode.style.top = (this.popup.top + this.popup.height) + \"px\";\n\t\t\tbreak;\n\t}\n};\n\n/*\nCompute the internal state of the widget\n*/\nRevealWidget.prototype.execute = function() {\n\t// Get our parameters\n\tthis.state = this.getAttribute(\"state\");\n\tthis.revealTag = this.getAttribute(\"tag\");\n\tthis.type = this.getAttribute(\"type\");\n\tthis.text = this.getAttribute(\"text\");\n\tthis.position = this.getAttribute(\"position\");\n\tthis[\"class\"] = this.getAttribute(\"class\",\"\");\n\tthis.style = this.getAttribute(\"style\",\"\");\n\tthis[\"default\"] = this.getAttribute(\"default\",\"\");\n\tthis.animate = this.getAttribute(\"animate\",\"no\");\n\tthis.retain = this.getAttribute(\"retain\",\"no\");\n\tthis.openAnimation = this.animate === \"no\" ? undefined : \"open\";\n\tthis.closeAnimation = this.animate === \"no\" ? undefined : \"close\";\n\t// Compute the title of the state tiddler and read it\n\tthis.stateTitle = this.state;\n\tthis.readState();\n\t// Construct the child widgets\n\tvar childNodes = this.isOpen ? this.parseTreeNode.children : [];\n\tthis.hasChildNodes = this.isOpen;\n\tthis.makeChildWidgets(childNodes);\n};\n\n/*\nRead the state tiddler\n*/\nRevealWidget.prototype.readState = function() {\n\t// Read the information from the state tiddler\n\tvar state = this.stateTitle ? this.wiki.getTextReference(this.stateTitle,this[\"default\"],this.getVariable(\"currentTiddler\")) : this[\"default\"];\n\tswitch(this.type) {\n\t\tcase \"popup\":\n\t\t\tthis.readPopupState(state);\n\t\t\tbreak;\n\t\tcase \"match\":\n\t\t\tthis.readMatchState(state);\n\t\t\tbreak;\n\t\tcase \"nomatch\":\n\t\t\tthis.readMatchState(state);\n\t\t\tthis.isOpen = !this.isOpen;\n\t\t\tbreak;\n\t}\n};\n\nRevealWidget.prototype.readMatchState = function(state) {\n\tthis.isOpen = state === this.text;\n};\n\nRevealWidget.prototype.readPopupState = function(state) {\n\tvar popupLocationRegExp = /^\\((-?[0-9\\.E]+),(-?[0-9\\.E]+),(-?[0-9\\.E]+),(-?[0-9\\.E]+)\\)$/,\n\t\tmatch = popupLocationRegExp.exec(state);\n\t// Check if the state matches the location regexp\n\tif(match) {\n\t\t// If so, we're open\n\t\tthis.isOpen = true;\n\t\t// Get the location\n\t\tthis.popup = {\n\t\t\tleft: parseFloat(match[1]),\n\t\t\ttop: parseFloat(match[2]),\n\t\t\twidth: parseFloat(match[3]),\n\t\t\theight: parseFloat(match[4])\n\t\t};\n\t} else {\n\t\t// If not, we're closed\n\t\tthis.isOpen = false;\n\t}\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nRevealWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.state || changedAttributes.type || changedAttributes.text || changedAttributes.position || changedAttributes[\"default\"] || changedAttributes.animate) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\tvar refreshed = false,\n\t\t\tcurrentlyOpen = this.isOpen;\n\t\tthis.readState();\n\t\tif(this.isOpen !== currentlyOpen) {\n\t\t\tif(this.retain === \"yes\") {\n\t\t\t\tthis.updateState();\n\t\t\t} else {\n\t\t\t\tthis.refreshSelf();\n\t\t\t\trefreshed = true;\n\t\t\t}\n\t\t}\n\t\treturn this.refreshChildren(changedTiddlers) || refreshed;\n\t}\n};\n\n/*\nCalled by refresh() to dynamically show or hide the content\n*/\nRevealWidget.prototype.updateState = function() {\n\t// Read the current state\n\tthis.readState();\n\t// Construct the child nodes if needed\n\tvar domNode = this.domNodes[0];\n\tif(this.isOpen && !this.hasChildNodes) {\n\t\tthis.hasChildNodes = true;\n\t\tthis.makeChildWidgets(this.parseTreeNode.children);\n\t\tthis.renderChildren(domNode,null);\n\t}\n\t// Animate our DOM node\n\tif(!domNode.isTiddlyWikiFakeDom && this.type === \"popup\" && this.isOpen) {\n\t\tthis.positionPopup(domNode);\n\t\t$tw.utils.addClass(domNode,\"tc-popup\"); // Make sure that clicks don't dismiss popups within the revealed content\n\n\t}\n\tif(this.isOpen) {\n\t\tdomNode.removeAttribute(\"hidden\");\n        $tw.anim.perform(this.openAnimation,domNode);\n\t} else {\n\t\t$tw.anim.perform(this.closeAnimation,domNode,{callback: function() {\n\t\t\tdomNode.setAttribute(\"hidden\",\"true\");\n        }});\n\t}\n};\n\nexports.reveal = RevealWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/reveal.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/scrollable.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/scrollable.js\ntype: application/javascript\nmodule-type: widget\n\nScrollable widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar ScrollableWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n\tthis.scaleFactor = 1;\n\tthis.addEventListeners([\n\t\t{type: \"tm-scroll\", handler: \"handleScrollEvent\"}\n\t]);\n\tif($tw.browser) {\n\t\tthis.requestAnimationFrame = window.requestAnimationFrame ||\n\t\t\twindow.webkitRequestAnimationFrame ||\n\t\t\twindow.mozRequestAnimationFrame ||\n\t\t\tfunction(callback) {\n\t\t\t\treturn window.setTimeout(callback, 1000/60);\n\t\t\t};\n\t\tthis.cancelAnimationFrame = window.cancelAnimationFrame ||\n\t\t\twindow.webkitCancelAnimationFrame ||\n\t\t\twindow.webkitCancelRequestAnimationFrame ||\n\t\t\twindow.mozCancelAnimationFrame ||\n\t\t\twindow.mozCancelRequestAnimationFrame ||\n\t\t\tfunction(id) {\n\t\t\t\twindow.clearTimeout(id);\n\t\t\t};\n\t}\n};\n\n/*\nInherit from the base widget class\n*/\nScrollableWidget.prototype = new Widget();\n\nScrollableWidget.prototype.cancelScroll = function() {\n\tif(this.idRequestFrame) {\n\t\tthis.cancelAnimationFrame.call(window,this.idRequestFrame);\n\t\tthis.idRequestFrame = null;\n\t}\n};\n\n/*\nHandle a scroll event\n*/\nScrollableWidget.prototype.handleScrollEvent = function(event) {\n\t// Pass the scroll event through if our offsetsize is larger than our scrollsize\n\tif(this.outerDomNode.scrollWidth <= this.outerDomNode.offsetWidth && this.outerDomNode.scrollHeight <= this.outerDomNode.offsetHeight && this.fallthrough === \"yes\") {\n\t\treturn true;\n\t}\n\tthis.scrollIntoView(event.target);\n\treturn false; // Handled event\n};\n\n/*\nScroll an element into view\n*/\nScrollableWidget.prototype.scrollIntoView = function(element) {\n\tvar duration = $tw.utils.getAnimationDuration();\n\tthis.cancelScroll();\n\tthis.startTime = Date.now();\n\tvar scrollPosition = {\n\t\tx: this.outerDomNode.scrollLeft,\n\t\ty: this.outerDomNode.scrollTop\n\t};\n\t// Get the client bounds of the element and adjust by the scroll position\n\tvar scrollableBounds = this.outerDomNode.getBoundingClientRect(),\n\t\tclientTargetBounds = element.getBoundingClientRect(),\n\t\tbounds = {\n\t\t\tleft: clientTargetBounds.left + scrollPosition.x - scrollableBounds.left,\n\t\t\ttop: clientTargetBounds.top + scrollPosition.y - scrollableBounds.top,\n\t\t\twidth: clientTargetBounds.width,\n\t\t\theight: clientTargetBounds.height\n\t\t};\n\t// We'll consider the horizontal and vertical scroll directions separately via this function\n\tvar getEndPos = function(targetPos,targetSize,currentPos,currentSize) {\n\t\t\t// If the target is already visible then stay where we are\n\t\t\tif(targetPos >= currentPos && (targetPos + targetSize) <= (currentPos + currentSize)) {\n\t\t\t\treturn currentPos;\n\t\t\t// If the target is above/left of the current view, then scroll to its top/left\n\t\t\t} else if(targetPos <= currentPos) {\n\t\t\t\treturn targetPos;\n\t\t\t// If the target is smaller than the window and the scroll position is too far up, then scroll till the target is at the bottom of the window\n\t\t\t} else if(targetSize < currentSize && currentPos < (targetPos + targetSize - currentSize)) {\n\t\t\t\treturn targetPos + targetSize - currentSize;\n\t\t\t// If the target is big, then just scroll to the top\n\t\t\t} else if(currentPos < targetPos) {\n\t\t\t\treturn targetPos;\n\t\t\t// Otherwise, stay where we are\n\t\t\t} else {\n\t\t\t\treturn currentPos;\n\t\t\t}\n\t\t},\n\t\tendX = getEndPos(bounds.left,bounds.width,scrollPosition.x,this.outerDomNode.offsetWidth),\n\t\tendY = getEndPos(bounds.top,bounds.height,scrollPosition.y,this.outerDomNode.offsetHeight);\n\t// Only scroll if necessary\n\tif(endX !== scrollPosition.x || endY !== scrollPosition.y) {\n\t\tvar self = this,\n\t\t\tdrawFrame;\n\t\tdrawFrame = function () {\n\t\t\tvar t;\n\t\t\tif(duration <= 0) {\n\t\t\t\tt = 1;\n\t\t\t} else {\n\t\t\t\tt = ((Date.now()) - self.startTime) / duration;\t\n\t\t\t}\n\t\t\tif(t >= 1) {\n\t\t\t\tself.cancelScroll();\n\t\t\t\tt = 1;\n\t\t\t}\n\t\t\tt = $tw.utils.slowInSlowOut(t);\n\t\t\tself.outerDomNode.scrollLeft = scrollPosition.x + (endX - scrollPosition.x) * t;\n\t\t\tself.outerDomNode.scrollTop = scrollPosition.y + (endY - scrollPosition.y) * t;\n\t\t\tif(t < 1) {\n\t\t\t\tself.idRequestFrame = self.requestAnimationFrame.call(window,drawFrame);\n\t\t\t}\n\t\t};\n\t\tdrawFrame();\n\t}\n};\n\n/*\nRender this widget into the DOM\n*/\nScrollableWidget.prototype.render = function(parent,nextSibling) {\n\tvar self = this;\n\t// Remember parent\n\tthis.parentDomNode = parent;\n\t// Compute attributes and execute state\n\tthis.computeAttributes();\n\tthis.execute();\n\t// Create elements\n\tthis.outerDomNode = this.document.createElement(\"div\");\n\t$tw.utils.setStyle(this.outerDomNode,[\n\t\t{overflowY: \"auto\"},\n\t\t{overflowX: \"auto\"},\n\t\t{webkitOverflowScrolling: \"touch\"}\n\t]);\n\tthis.innerDomNode = this.document.createElement(\"div\");\n\tthis.outerDomNode.appendChild(this.innerDomNode);\n\t// Assign classes\n\tthis.outerDomNode.className = this[\"class\"] || \"\";\n\t// Insert element\n\tparent.insertBefore(this.outerDomNode,nextSibling);\n\tthis.renderChildren(this.innerDomNode,null);\n\tthis.domNodes.push(this.outerDomNode);\n};\n\n/*\nCompute the internal state of the widget\n*/\nScrollableWidget.prototype.execute = function() {\n\t// Get attributes\n\tthis.fallthrough = this.getAttribute(\"fallthrough\",\"yes\");\n\tthis[\"class\"] = this.getAttribute(\"class\");\n\t// Make child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nScrollableWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes[\"class\"]) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t}\n\treturn this.refreshChildren(changedTiddlers);\n};\n\nexports.scrollable = ScrollableWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/scrollable.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/select.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/select.js\ntype: application/javascript\nmodule-type: widget\n\nSelect widget:\n\n```\n<$select tiddler=\"MyTiddler\" field=\"text\">\n<$list filter=\"[tag[chapter]]\">\n<option value=<<currentTiddler>>>\n<$view field=\"description\"/>\n</option>\n</$list>\n</$select>\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar SelectWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nSelectWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nSelectWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n\tthis.setSelectValue();\n\t$tw.utils.addEventListeners(this.getSelectDomNode(),[\n\t\t{name: \"change\", handlerObject: this, handlerMethod: \"handleChangeEvent\"}\n\t]);\n};\n\n/*\nHandle a change event\n*/\nSelectWidget.prototype.handleChangeEvent = function(event) {\n\t// Get the new value and assign it to the tiddler\n\tif(this.selectMultiple == false) {\n\t\tvar value = this.getSelectDomNode().value;\n\t} else {\n\t\tvar value = this.getSelectValues()\n\t\t\t\tvalue = $tw.utils.stringifyList(value);\n\t}\n\tthis.wiki.setText(this.selectTitle,this.selectField,this.selectIndex,value);\n\t// Trigger actions\n\tif(this.selectActions) {\n\t\tthis.invokeActionString(this.selectActions,this,event);\n\t}\n};\n\n/*\nIf necessary, set the value of the select element to the current value\n*/\nSelectWidget.prototype.setSelectValue = function() {\n\tvar value = this.selectDefault;\n\t// Get the value\n\tif(this.selectIndex) {\n\t\tvalue = this.wiki.extractTiddlerDataItem(this.selectTitle,this.selectIndex);\n\t} else {\n\t\tvar tiddler = this.wiki.getTiddler(this.selectTitle);\n\t\tif(tiddler) {\n\t\t\tif(this.selectField === \"text\") {\n\t\t\t\t// Calling getTiddlerText() triggers lazy loading of skinny tiddlers\n\t\t\t\tvalue = this.wiki.getTiddlerText(this.selectTitle);\n\t\t\t} else {\n\t\t\t\tif($tw.utils.hop(tiddler.fields,this.selectField)) {\n\t\t\t\t\tvalue = tiddler.getFieldString(this.selectField);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif(this.selectField === \"title\") {\n\t\t\t\tvalue = this.selectTitle;\n\t\t\t}\n\t\t}\n\t}\n\t// Assign it to the select element if it's different than the current value\n\tif (this.selectMultiple) {\n\t\tvalue = value === undefined ? \"\" : value;\n\t\tvar select = this.getSelectDomNode();\n\t\tvar values = Array.isArray(value) ? value : $tw.utils.parseStringArray(value);\n\t\tfor(var i=0; i < select.children.length; i++){\n\t\t\tif(values.indexOf(select.children[i].value) != -1) {\n\t\t\t\tselect.children[i].selected = true;\n\t\t\t}\n\t\t}\n\t\t\n\t} else {\n\t\tvar domNode = this.getSelectDomNode();\n\t\tif(domNode.value !== value) {\n\t\t\tdomNode.value = value;\n\t\t}\n\t}\n};\n\n/*\nGet the DOM node of the select element\n*/\nSelectWidget.prototype.getSelectDomNode = function() {\n\treturn this.children[0].domNodes[0];\n};\n\n// Return an array of the selected opion values\n// select is an HTML select element\nSelectWidget.prototype.getSelectValues = function() {\n\tvar select, result, options, opt;\n\tselect = this.getSelectDomNode();\n\tresult = [];\n\toptions = select && select.options;\n\tfor (var i=0; i<options.length; i++) {\n\t\topt = options[i];\n\t\tif (opt.selected) {\n\t\t\tresult.push(opt.value || opt.text);\n\t\t}\n\t}\n\treturn result;\n}\n\n/*\nCompute the internal state of the widget\n*/\nSelectWidget.prototype.execute = function() {\n\t// Get our parameters\n\tthis.selectActions = this.getAttribute(\"actions\");\n\tthis.selectTitle = this.getAttribute(\"tiddler\",this.getVariable(\"currentTiddler\"));\n\tthis.selectField = this.getAttribute(\"field\",\"text\");\n\tthis.selectIndex = this.getAttribute(\"index\");\n\tthis.selectClass = this.getAttribute(\"class\");\n\tthis.selectDefault = this.getAttribute(\"default\");\n\tthis.selectMultiple = this.getAttribute(\"multiple\", false);\n\tthis.selectSize = this.getAttribute(\"size\");\n\t// Make the child widgets\n\tvar selectNode = {\n\t\ttype: \"element\",\n\t\ttag: \"select\",\n\t\tchildren: this.parseTreeNode.children\n\t};\n\tif(this.selectClass) {\n\t\t$tw.utils.addAttributeToParseTreeNode(selectNode,\"class\",this.selectClass);\n\t}\n\tif(this.selectMultiple) {\n\t\t$tw.utils.addAttributeToParseTreeNode(selectNode,\"multiple\",\"multiple\");\n\t}\n\tif(this.selectSize) {\n\t\t$tw.utils.addAttributeToParseTreeNode(selectNode,\"size\",this.selectSize);\n\t}\n\tthis.makeChildWidgets([selectNode]);\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nSelectWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\t// If we're using a different tiddler/field/index then completely refresh ourselves\n\tif(changedAttributes.selectTitle || changedAttributes.selectField || changedAttributes.selectIndex) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t// If the target tiddler value has changed, just update setting and refresh the children\n\t} else {\n\t\tvar childrenRefreshed = this.refreshChildren(changedTiddlers);\n\t\tif(changedTiddlers[this.selectTitle] || childrenRefreshed) {\n\t\t\tthis.setSelectValue();\n\t\t} \n\t\treturn childrenRefreshed;\n\t}\n};\n\nexports.select = SelectWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/select.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/set.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/set.js\ntype: application/javascript\nmodule-type: widget\n\nSet variable widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar SetWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nSetWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nSetWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n};\n\n/*\nCompute the internal state of the widget\n*/\nSetWidget.prototype.execute = function() {\n\t// Get our parameters\n\tthis.setName = this.getAttribute(\"name\",\"currentTiddler\");\n\tthis.setFilter = this.getAttribute(\"filter\");\n\tthis.setSelect = this.getAttribute(\"select\");\n\tthis.setValue = this.getAttribute(\"value\");\n\tthis.setEmptyValue = this.getAttribute(\"emptyValue\");\n\t// Set context variable\n\tthis.setVariable(this.setName,this.getValue(),this.parseTreeNode.params);\n\t// Construct the child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nGet the value to be assigned\n*/\nSetWidget.prototype.getValue = function() {\n\tvar value = this.setValue;\n\tif(this.setFilter) {\n\t\tvar results = this.wiki.filterTiddlers(this.setFilter,this);\n\t\tif(!this.setValue) {\n\t\t\tvar select;\n\t\t\tif(this.setSelect) {\n\t\t\t\tselect = parseInt(this.setSelect,10);\n\t\t\t}\n\t\t\tif(select !== undefined) {\n\t\t\t\tvalue = results[select] || \"\";\n\t\t\t} else {\n\t\t\t\tvalue = $tw.utils.stringifyList(results);\t\t\t\n\t\t\t}\n\t\t}\n\t\tif(results.length === 0 && this.setEmptyValue !== undefined) {\n\t\t\tvalue = this.setEmptyValue;\n\t\t}\n\t} else if(!value && this.setEmptyValue) {\n\t\tvalue = this.setEmptyValue;\n\t}\n\treturn value;\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nSetWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.name || changedAttributes.filter || changedAttributes.select ||changedAttributes.value || changedAttributes.emptyValue ||\n\t   (this.setFilter && this.getValue() != this.variables[this.setName].value)) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn this.refreshChildren(changedTiddlers);\n\t}\n};\n\nexports.setvariable = SetWidget;\nexports.set = SetWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/set.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/text.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/text.js\ntype: application/javascript\nmodule-type: widget\n\nText node widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar TextNodeWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nTextNodeWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nTextNodeWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tvar text = this.getAttribute(\"text\",this.parseTreeNode.text || \"\");\n\ttext = text.replace(/\\r/mg,\"\");\n\tvar textNode = this.document.createTextNode(text);\n\tparent.insertBefore(textNode,nextSibling);\n\tthis.domNodes.push(textNode);\n};\n\n/*\nCompute the internal state of the widget\n*/\nTextNodeWidget.prototype.execute = function() {\n\t// Nothing to do for a text node\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nTextNodeWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.text) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn false;\t\n\t}\n};\n\nexports.text = TextNodeWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/text.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/tiddler.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/tiddler.js\ntype: application/javascript\nmodule-type: widget\n\nTiddler widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar TiddlerWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nTiddlerWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nTiddlerWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n};\n\n/*\nCompute the internal state of the widget\n*/\nTiddlerWidget.prototype.execute = function() {\n\tthis.tiddlerState = this.computeTiddlerState();\n\tthis.setVariable(\"currentTiddler\",this.tiddlerState.currentTiddler);\n\tthis.setVariable(\"missingTiddlerClass\",this.tiddlerState.missingTiddlerClass);\n\tthis.setVariable(\"shadowTiddlerClass\",this.tiddlerState.shadowTiddlerClass);\n\tthis.setVariable(\"systemTiddlerClass\",this.tiddlerState.systemTiddlerClass);\n\tthis.setVariable(\"tiddlerTagClasses\",this.tiddlerState.tiddlerTagClasses);\n\t// Construct the child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nCompute the tiddler state flags\n*/\nTiddlerWidget.prototype.computeTiddlerState = function() {\n\t// Get our parameters\n\tthis.tiddlerTitle = this.getAttribute(\"tiddler\",this.getVariable(\"currentTiddler\"));\n\t// Compute the state\n\tvar state = {\n\t\tcurrentTiddler: this.tiddlerTitle || \"\",\n\t\tmissingTiddlerClass: (this.wiki.tiddlerExists(this.tiddlerTitle) || this.wiki.isShadowTiddler(this.tiddlerTitle)) ? \"tc-tiddler-exists\" : \"tc-tiddler-missing\",\n\t\tshadowTiddlerClass: this.wiki.isShadowTiddler(this.tiddlerTitle) ? \"tc-tiddler-shadow\" : \"\",\n\t\tsystemTiddlerClass: this.wiki.isSystemTiddler(this.tiddlerTitle) ? \"tc-tiddler-system\" : \"\",\n\t\ttiddlerTagClasses: this.getTagClasses()\n\t};\n\t// Compute a simple hash to make it easier to detect changes\n\tstate.hash = state.currentTiddler + state.missingTiddlerClass + state.shadowTiddlerClass + state.systemTiddlerClass + state.tiddlerTagClasses;\n\treturn state;\n};\n\n/*\nCreate a string of CSS classes derived from the tags of the current tiddler\n*/\nTiddlerWidget.prototype.getTagClasses = function() {\n\tvar tiddler = this.wiki.getTiddler(this.tiddlerTitle);\n\tif(tiddler) {\n\t\tvar tags = [];\n\t\t$tw.utils.each(tiddler.fields.tags,function(tag) {\n\t\t\ttags.push(\"tc-tagged-\" + encodeURIComponent(tag));\n\t\t});\n\t\treturn tags.join(\" \");\n\t} else {\n\t\treturn \"\";\n\t}\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nTiddlerWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes(),\n\t\tnewTiddlerState = this.computeTiddlerState();\n\tif(changedAttributes.tiddler || newTiddlerState.hash !== this.tiddlerState.hash) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn this.refreshChildren(changedTiddlers);\t\t\n\t}\n};\n\nexports.tiddler = TiddlerWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/tiddler.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/transclude.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/transclude.js\ntype: application/javascript\nmodule-type: widget\n\nTransclude widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar TranscludeWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nTranscludeWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nTranscludeWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n};\n\n/*\nCompute the internal state of the widget\n*/\nTranscludeWidget.prototype.execute = function() {\n\t// Get our parameters\n\tthis.transcludeTitle = this.getAttribute(\"tiddler\",this.getVariable(\"currentTiddler\"));\n\tthis.transcludeSubTiddler = this.getAttribute(\"subtiddler\");\n\tthis.transcludeField = this.getAttribute(\"field\");\n\tthis.transcludeIndex = this.getAttribute(\"index\");\n\tthis.transcludeMode = this.getAttribute(\"mode\");\n\t// Parse the text reference\n\tvar parseAsInline = !this.parseTreeNode.isBlock;\n\tif(this.transcludeMode === \"inline\") {\n\t\tparseAsInline = true;\n\t} else if(this.transcludeMode === \"block\") {\n\t\tparseAsInline = false;\n\t}\n\tvar parser = this.wiki.parseTextReference(\n\t\t\t\t\t\tthis.transcludeTitle,\n\t\t\t\t\t\tthis.transcludeField,\n\t\t\t\t\t\tthis.transcludeIndex,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tparseAsInline: parseAsInline,\n\t\t\t\t\t\t\tsubTiddler: this.transcludeSubTiddler\n\t\t\t\t\t\t}),\n\t\tparseTreeNodes = parser ? parser.tree : this.parseTreeNode.children;\n\t// Set context variables for recursion detection\n\tvar recursionMarker = this.makeRecursionMarker();\n\tthis.setVariable(\"transclusion\",recursionMarker);\n\t// Check for recursion\n\tif(parser) {\n\t\tif(this.parentWidget && this.parentWidget.hasVariable(\"transclusion\",recursionMarker)) {\n\t\t\tparseTreeNodes = [{type: \"element\", tag: \"span\", attributes: {\n\t\t\t\t\"class\": {type: \"string\", value: \"tc-error\"}\n\t\t\t}, children: [\n\t\t\t\t{type: \"text\", text: $tw.language.getString(\"Error/RecursiveTransclusion\")}\n\t\t\t]}];\n\t\t}\n\t}\n\t// Construct the child widgets\n\tthis.makeChildWidgets(parseTreeNodes);\n};\n\n/*\nCompose a string comprising the title, field and/or index to identify this transclusion for recursion detection\n*/\nTranscludeWidget.prototype.makeRecursionMarker = function() {\n\tvar output = [];\n\toutput.push(\"{\");\n\toutput.push(this.getVariable(\"currentTiddler\",{defaultValue: \"\"}));\n\toutput.push(\"|\");\n\toutput.push(this.transcludeTitle || \"\");\n\toutput.push(\"|\");\n\toutput.push(this.transcludeField || \"\");\n\toutput.push(\"|\");\n\toutput.push(this.transcludeIndex || \"\");\n\toutput.push(\"|\");\n\toutput.push(this.transcludeSubTiddler || \"\");\n\toutput.push(\"}\");\n\treturn output.join(\"\");\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nTranscludeWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedTiddlers[this.transcludeTitle]) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn this.refreshChildren(changedTiddlers);\t\t\n\t}\n};\n\nexports.transclude = TranscludeWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/transclude.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/vars.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/vars.js\ntype: application/javascript\nmodule-type: widget\n\nThis widget allows multiple variables to be set in one go:\n\n```\n\\define helloworld() Hello world!\n<$vars greeting=\"Hi\" me={{!!title}} sentence=<<helloworld>>>\n  <<greeting>>! I am <<me>> and I say: <<sentence>>\n</$vars>\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar VarsWidget = function(parseTreeNode,options) {\n\t// Call the constructor\n\tWidget.call(this);\n\t// Initialise\t\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nVarsWidget.prototype = Object.create(Widget.prototype);\n\n/*\nRender this widget into the DOM\n*/\nVarsWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n};\n\n/*\nCompute the internal state of the widget\n*/\nVarsWidget.prototype.execute = function() {\n\t// Parse variables\n\tvar self = this;\n\t$tw.utils.each(this.attributes,function(val,key) {\n\t\tif(key.charAt(0) !== \"$\") {\n\t\t\tself.setVariable(key,val);\n\t\t}\n\t});\n\t// Construct the child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nRefresh the widget by ensuring our attributes are up to date\n*/\nVarsWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(Object.keys(changedAttributes).length) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t}\n\treturn this.refreshChildren(changedTiddlers);\n};\n\nexports[\"vars\"] = VarsWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/vars.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/view.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/view.js\ntype: application/javascript\nmodule-type: widget\n\nView widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar ViewWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nViewWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nViewWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tif(this.text) {\n\t\tvar textNode = this.document.createTextNode(this.text);\n\t\tparent.insertBefore(textNode,nextSibling);\n\t\tthis.domNodes.push(textNode);\n\t} else {\n\t\tthis.makeChildWidgets();\n\t\tthis.renderChildren(parent,nextSibling);\n\t}\n};\n\n/*\nCompute the internal state of the widget\n*/\nViewWidget.prototype.execute = function() {\n\t// Get parameters from our attributes\n\tthis.viewTitle = this.getAttribute(\"tiddler\",this.getVariable(\"currentTiddler\"));\n\tthis.viewSubtiddler = this.getAttribute(\"subtiddler\");\n\tthis.viewField = this.getAttribute(\"field\",\"text\");\n\tthis.viewIndex = this.getAttribute(\"index\");\n\tthis.viewFormat = this.getAttribute(\"format\",\"text\");\n\tthis.viewTemplate = this.getAttribute(\"template\",\"\");\n\tswitch(this.viewFormat) {\n\t\tcase \"htmlwikified\":\n\t\t\tthis.text = this.getValueAsHtmlWikified();\n\t\t\tbreak;\n\t\tcase \"plainwikified\":\n\t\t\tthis.text = this.getValueAsPlainWikified();\n\t\t\tbreak;\n\t\tcase \"htmlencodedplainwikified\":\n\t\t\tthis.text = this.getValueAsHtmlEncodedPlainWikified();\n\t\t\tbreak;\n\t\tcase \"htmlencoded\":\n\t\t\tthis.text = this.getValueAsHtmlEncoded();\n\t\t\tbreak;\n\t\tcase \"urlencoded\":\n\t\t\tthis.text = this.getValueAsUrlEncoded();\n\t\t\tbreak;\n\t\tcase \"doubleurlencoded\":\n\t\t\tthis.text = this.getValueAsDoubleUrlEncoded();\n\t\t\tbreak;\n\t\tcase \"date\":\n\t\t\tthis.text = this.getValueAsDate(this.viewTemplate);\n\t\t\tbreak;\n\t\tcase \"relativedate\":\n\t\t\tthis.text = this.getValueAsRelativeDate();\n\t\t\tbreak;\n\t\tcase \"stripcomments\":\n\t\t\tthis.text = this.getValueAsStrippedComments();\n\t\t\tbreak;\n\t\tcase \"jsencoded\":\n\t\t\tthis.text = this.getValueAsJsEncoded();\n\t\t\tbreak;\n\t\tdefault: // \"text\"\n\t\t\tthis.text = this.getValueAsText();\n\t\t\tbreak;\n\t}\n};\n\n/*\nThe various formatter functions are baked into this widget for the moment. Eventually they will be replaced by macro functions\n*/\n\n/*\nRetrieve the value of the widget. Options are:\nasString: Optionally return the value as a string\n*/\nViewWidget.prototype.getValue = function(options) {\n\toptions = options || {};\n\tvar value = options.asString ? \"\" : undefined;\n\tif(this.viewIndex) {\n\t\tvalue = this.wiki.extractTiddlerDataItem(this.viewTitle,this.viewIndex);\n\t} else {\n\t\tvar tiddler;\n\t\tif(this.viewSubtiddler) {\n\t\t\ttiddler = this.wiki.getSubTiddler(this.viewTitle,this.viewSubtiddler);\t\n\t\t} else {\n\t\t\ttiddler = this.wiki.getTiddler(this.viewTitle);\n\t\t}\n\t\tif(tiddler) {\n\t\t\tif(this.viewField === \"text\" && !this.viewSubtiddler) {\n\t\t\t\t// Calling getTiddlerText() triggers lazy loading of skinny tiddlers\n\t\t\t\tvalue = this.wiki.getTiddlerText(this.viewTitle);\n\t\t\t} else {\n\t\t\t\tif($tw.utils.hop(tiddler.fields,this.viewField)) {\n\t\t\t\t\tif(options.asString) {\n\t\t\t\t\t\tvalue = tiddler.getFieldString(this.viewField);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvalue = tiddler.fields[this.viewField];\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif(this.viewField === \"title\") {\n\t\t\t\tvalue = this.viewTitle;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n\nViewWidget.prototype.getValueAsText = function() {\n\treturn this.getValue({asString: true});\n};\n\nViewWidget.prototype.getValueAsHtmlWikified = function() {\n\treturn this.wiki.renderText(\"text/html\",\"text/vnd.tiddlywiki\",this.getValueAsText(),{parentWidget: this});\n};\n\nViewWidget.prototype.getValueAsPlainWikified = function() {\n\treturn this.wiki.renderText(\"text/plain\",\"text/vnd.tiddlywiki\",this.getValueAsText(),{parentWidget: this});\n};\n\nViewWidget.prototype.getValueAsHtmlEncodedPlainWikified = function() {\n\treturn $tw.utils.htmlEncode(this.wiki.renderText(\"text/plain\",\"text/vnd.tiddlywiki\",this.getValueAsText(),{parentWidget: this}));\n};\n\nViewWidget.prototype.getValueAsHtmlEncoded = function() {\n\treturn $tw.utils.htmlEncode(this.getValueAsText());\n};\n\nViewWidget.prototype.getValueAsUrlEncoded = function() {\n\treturn encodeURIComponent(this.getValueAsText());\n};\n\nViewWidget.prototype.getValueAsDoubleUrlEncoded = function() {\n\treturn encodeURIComponent(encodeURIComponent(this.getValueAsText()));\n};\n\nViewWidget.prototype.getValueAsDate = function(format) {\n\tformat = format || \"YYYY MM DD 0hh:0mm\";\n\tvar value = $tw.utils.parseDate(this.getValue());\n\tif(value && $tw.utils.isDate(value) && value.toString() !== \"Invalid Date\") {\n\t\treturn $tw.utils.formatDateString(value,format);\n\t} else {\n\t\treturn \"\";\n\t}\n};\n\nViewWidget.prototype.getValueAsRelativeDate = function(format) {\n\tvar value = $tw.utils.parseDate(this.getValue());\n\tif(value && $tw.utils.isDate(value) && value.toString() !== \"Invalid Date\") {\n\t\treturn $tw.utils.getRelativeDate((new Date()) - (new Date(value))).description;\n\t} else {\n\t\treturn \"\";\n\t}\n};\n\nViewWidget.prototype.getValueAsStrippedComments = function() {\n\tvar lines = this.getValueAsText().split(\"\\n\"),\n\t\tout = [];\n\tfor(var line=0; line<lines.length; line++) {\n\t\tvar text = lines[line];\n\t\tif(!/^\\s*\\/\\/#/.test(text)) {\n\t\t\tout.push(text);\n\t\t}\n\t}\n\treturn out.join(\"\\n\");\n};\n\nViewWidget.prototype.getValueAsJsEncoded = function() {\n\treturn $tw.utils.stringify(this.getValueAsText());\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nViewWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes.template || changedAttributes.format || changedTiddlers[this.viewTitle]) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn false;\t\n\t}\n};\n\nexports.view = ViewWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/view.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/widget.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/widget.js\ntype: application/javascript\nmodule-type: widget\n\nWidget base class\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nCreate a widget object for a parse tree node\n\tparseTreeNode: reference to the parse tree node to be rendered\n\toptions: see below\nOptions include:\n\twiki: mandatory reference to wiki associated with this render tree\n\tparentWidget: optional reference to a parent renderer node for the context chain\n\tdocument: optional document object to use instead of global document\n*/\nvar Widget = function(parseTreeNode,options) {\n\tif(arguments.length > 0) {\n\t\tthis.initialise(parseTreeNode,options);\n\t}\n};\n\n/*\nInitialise widget properties. These steps are pulled out of the constructor so that we can reuse them in subclasses\n*/\nWidget.prototype.initialise = function(parseTreeNode,options) {\n\toptions = options || {};\n\t// Save widget info\n\tthis.parseTreeNode = parseTreeNode;\n\tthis.wiki = options.wiki;\n\tthis.parentWidget = options.parentWidget;\n\tthis.variablesConstructor = function() {};\n\tthis.variablesConstructor.prototype = this.parentWidget ? this.parentWidget.variables : {};\n\tthis.variables = new this.variablesConstructor();\n\tthis.document = options.document;\n\tthis.attributes = {};\n\tthis.children = [];\n\tthis.domNodes = [];\n\tthis.eventListeners = {};\n\t// Hashmap of the widget classes\n\tif(!this.widgetClasses) {\n\t\tWidget.prototype.widgetClasses = $tw.modules.applyMethods(\"widget\");\n\t}\n};\n\n/*\nRender this widget into the DOM\n*/\nWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n};\n\n/*\nCompute the internal state of the widget\n*/\nWidget.prototype.execute = function() {\n\tthis.makeChildWidgets();\n};\n\n/*\nSet the value of a context variable\nname: name of the variable\nvalue: value of the variable\nparams: array of {name:, default:} for each parameter\n*/\nWidget.prototype.setVariable = function(name,value,params) {\n\tthis.variables[name] = {value: value, params: params};\n};\n\n/*\nGet the prevailing value of a context variable\nname: name of variable\noptions: see below\nOptions include\nparams: array of {name:, value:} for each parameter\ndefaultValue: default value if the variable is not defined\n*/\nWidget.prototype.getVariable = function(name,options) {\n\toptions = options || {};\n\tvar actualParams = options.params || [],\n\t\tparentWidget = this.parentWidget;\n\t// Check for the variable defined in the parent widget (or an ancestor in the prototype chain)\n\tif(parentWidget && name in parentWidget.variables) {\n\t\tvar variable = parentWidget.variables[name],\n\t\t\tvalue = variable.value;\n\t\t// Substitute any parameters specified in the definition\n\t\tvalue = this.substituteVariableParameters(value,variable.params,actualParams);\n\t\tvalue = this.substituteVariableReferences(value);\n\t\treturn value;\n\t}\n\t// If the variable doesn't exist in the parent widget then look for a macro module\n\treturn this.evaluateMacroModule(name,actualParams,options.defaultValue);\n};\n\nWidget.prototype.substituteVariableParameters = function(text,formalParams,actualParams) {\n\tif(formalParams) {\n\t\tvar nextAnonParameter = 0, // Next candidate anonymous parameter in macro call\n\t\t\tparamInfo, paramValue;\n\t\t// Step through each of the parameters in the macro definition\n\t\tfor(var p=0; p<formalParams.length; p++) {\n\t\t\t// Check if we've got a macro call parameter with the same name\n\t\t\tparamInfo = formalParams[p];\n\t\t\tparamValue = undefined;\n\t\t\tfor(var m=0; m<actualParams.length; m++) {\n\t\t\t\tif(actualParams[m].name === paramInfo.name) {\n\t\t\t\t\tparamValue = actualParams[m].value;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If not, use the next available anonymous macro call parameter\n\t\t\twhile(nextAnonParameter < actualParams.length && actualParams[nextAnonParameter].name) {\n\t\t\t\tnextAnonParameter++;\n\t\t\t}\n\t\t\tif(paramValue === undefined && nextAnonParameter < actualParams.length) {\n\t\t\t\tparamValue = actualParams[nextAnonParameter++].value;\n\t\t\t}\n\t\t\t// If we've still not got a value, use the default, if any\n\t\t\tparamValue = paramValue || paramInfo[\"default\"] || \"\";\n\t\t\t// Replace any instances of this parameter\n\t\t\ttext = $tw.utils.replaceString(text,new RegExp(\"\\\\$\" + $tw.utils.escapeRegExp(paramInfo.name) + \"\\\\$\",\"mg\"),paramValue);\n\t\t}\n\t}\n\treturn text;\n};\n\nWidget.prototype.substituteVariableReferences = function(text) {\n\tvar self = this;\n\treturn (text || \"\").replace(/\\$\\(([^\\)\\$]+)\\)\\$/g,function(match,p1,offset,string) {\n\t\treturn self.getVariable(p1,{defaultValue: \"\"});\n\t});\n};\n\nWidget.prototype.evaluateMacroModule = function(name,actualParams,defaultValue) {\n\tif($tw.utils.hop($tw.macros,name)) {\n\t\tvar macro = $tw.macros[name],\n\t\t\targs = [];\n\t\tif(macro.params.length > 0) {\n\t\t\tvar nextAnonParameter = 0, // Next candidate anonymous parameter in macro call\n\t\t\t\tparamInfo, paramValue;\n\t\t\t// Step through each of the parameters in the macro definition\n\t\t\tfor(var p=0; p<macro.params.length; p++) {\n\t\t\t\t// Check if we've got a macro call parameter with the same name\n\t\t\t\tparamInfo = macro.params[p];\n\t\t\t\tparamValue = undefined;\n\t\t\t\tfor(var m=0; m<actualParams.length; m++) {\n\t\t\t\t\tif(actualParams[m].name === paramInfo.name) {\n\t\t\t\t\t\tparamValue = actualParams[m].value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If not, use the next available anonymous macro call parameter\n\t\t\t\twhile(nextAnonParameter < actualParams.length && actualParams[nextAnonParameter].name) {\n\t\t\t\t\tnextAnonParameter++;\n\t\t\t\t}\n\t\t\t\tif(paramValue === undefined && nextAnonParameter < actualParams.length) {\n\t\t\t\t\tparamValue = actualParams[nextAnonParameter++].value;\n\t\t\t\t}\n\t\t\t\t// If we've still not got a value, use the default, if any\n\t\t\t\tparamValue = paramValue || paramInfo[\"default\"] || \"\";\n\t\t\t\t// Save the parameter\n\t\t\t\targs.push(paramValue);\n\t\t\t}\n\t\t}\n\t\telse for(var i=0; i<actualParams.length; ++i) {\n\t\t\targs.push(actualParams[i].value);\n\t\t}\n\t\treturn (macro.run.apply(this,args) || \"\").toString();\n\t} else {\n\t\treturn defaultValue;\n\t}\n};\n\n/*\nCheck whether a given context variable value exists in the parent chain\n*/\nWidget.prototype.hasVariable = function(name,value) {\n\tvar node = this;\n\twhile(node) {\n\t\tif($tw.utils.hop(node.variables,name) && node.variables[name].value === value) {\n\t\t\treturn true;\n\t\t}\n\t\tnode = node.parentWidget;\n\t}\n\treturn false;\n};\n\n/*\nConstruct a qualifying string based on a hash of concatenating the values of a given variable in the parent chain\n*/\nWidget.prototype.getStateQualifier = function(name) {\n\tthis.qualifiers = this.qualifiers || Object.create(null);\n\tname = name || \"transclusion\";\n\tif(this.qualifiers[name]) {\n\t\treturn this.qualifiers[name];\n\t} else {\n\t\tvar output = [],\n\t\t\tnode = this;\n\t\twhile(node && node.parentWidget) {\n\t\t\tif($tw.utils.hop(node.parentWidget.variables,name)) {\n\t\t\t\toutput.push(node.getVariable(name));\n\t\t\t}\n\t\t\tnode = node.parentWidget;\n\t\t}\n\t\tvar value = $tw.utils.hashString(output.join(\"\"));\n\t\tthis.qualifiers[name] = value;\n\t\treturn value;\n\t}\n};\n\n/*\nCompute the current values of the attributes of the widget. Returns a hashmap of the names of the attributes that have changed\n*/\nWidget.prototype.computeAttributes = function() {\n\tvar changedAttributes = {},\n\t\tself = this,\n\t\tvalue;\n\t$tw.utils.each(this.parseTreeNode.attributes,function(attribute,name) {\n\t\tif(attribute.type === \"filtered\") {\n\t\t\tvalue = self.wiki.filterTiddlers(attribute.filter,self)[0] || \"\";\n\t\t} else if(attribute.type === \"indirect\") {\n\t\t\tvalue = self.wiki.getTextReference(attribute.textReference,\"\",self.getVariable(\"currentTiddler\"));\n\t\t} else if(attribute.type === \"macro\") {\n\t\t\tvalue = self.getVariable(attribute.value.name,{params: attribute.value.params});\n\t\t} else { // String attribute\n\t\t\tvalue = attribute.value;\n\t\t}\n\t\t// Check whether the attribute has changed\n\t\tif(self.attributes[name] !== value) {\n\t\t\tself.attributes[name] = value;\n\t\t\tchangedAttributes[name] = true;\n\t\t}\n\t});\n\treturn changedAttributes;\n};\n\n/*\nCheck for the presence of an attribute\n*/\nWidget.prototype.hasAttribute = function(name) {\n\treturn $tw.utils.hop(this.attributes,name);\n};\n\n/*\nGet the value of an attribute\n*/\nWidget.prototype.getAttribute = function(name,defaultText) {\n\tif($tw.utils.hop(this.attributes,name)) {\n\t\treturn this.attributes[name];\n\t} else {\n\t\treturn defaultText;\n\t}\n};\n\n/*\nAssign the computed attributes of the widget to a domNode\noptions include:\nexcludeEventAttributes: ignores attributes whose name begins with \"on\"\n*/\nWidget.prototype.assignAttributes = function(domNode,options) {\n\toptions = options || {};\n\tvar self = this;\n\t$tw.utils.each(this.attributes,function(v,a) {\n\t\t// Check exclusions\n\t\tif(options.excludeEventAttributes && a.substr(0,2) === \"on\") {\n\t\t\tv = undefined;\n\t\t}\n\t\tif(v !== undefined) {\n\t\t\tvar b = a.split(\":\");\n\t\t\t// Setting certain attributes can cause a DOM error (eg xmlns on the svg element)\n\t\t\ttry {\n\t\t\t\tif (b.length == 2 && b[0] == \"xlink\"){\n\t\t\t\t\tdomNode.setAttributeNS(\"http://www.w3.org/1999/xlink\",b[1],v);\n\t\t\t\t} else {\n\t\t\t\t\tdomNode.setAttributeNS(null,a,v);\n\t\t\t\t}\n\t\t\t} catch(e) {\n\t\t\t}\n\t\t}\n\t});\n};\n\n/*\nMake child widgets correspondng to specified parseTreeNodes\n*/\nWidget.prototype.makeChildWidgets = function(parseTreeNodes) {\n\tthis.children = [];\n\tvar self = this;\n\t$tw.utils.each(parseTreeNodes || (this.parseTreeNode && this.parseTreeNode.children),function(childNode) {\n\t\tself.children.push(self.makeChildWidget(childNode));\n\t});\n};\n\n/*\nConstruct the widget object for a parse tree node\n*/\nWidget.prototype.makeChildWidget = function(parseTreeNode) {\n\tvar WidgetClass = this.widgetClasses[parseTreeNode.type];\n\tif(!WidgetClass) {\n\t\tWidgetClass = this.widgetClasses.text;\n\t\tparseTreeNode = {type: \"text\", text: \"Undefined widget '\" + parseTreeNode.type + \"'\"};\n\t}\n\treturn new WidgetClass(parseTreeNode,{\n\t\twiki: this.wiki,\n\t\tvariables: {},\n\t\tparentWidget: this,\n\t\tdocument: this.document\n\t});\n};\n\n/*\nGet the next sibling of this widget\n*/\nWidget.prototype.nextSibling = function() {\n\tif(this.parentWidget) {\n\t\tvar index = this.parentWidget.children.indexOf(this);\n\t\tif(index !== -1 && index < this.parentWidget.children.length-1) {\n\t\t\treturn this.parentWidget.children[index+1];\n\t\t}\n\t}\n\treturn null;\n};\n\n/*\nGet the previous sibling of this widget\n*/\nWidget.prototype.previousSibling = function() {\n\tif(this.parentWidget) {\n\t\tvar index = this.parentWidget.children.indexOf(this);\n\t\tif(index !== -1 && index > 0) {\n\t\t\treturn this.parentWidget.children[index-1];\n\t\t}\n\t}\n\treturn null;\n};\n\n/*\nRender the children of this widget into the DOM\n*/\nWidget.prototype.renderChildren = function(parent,nextSibling) {\n\t$tw.utils.each(this.children,function(childWidget) {\n\t\tchildWidget.render(parent,nextSibling);\n\t});\n};\n\n/*\nAdd a list of event listeners from an array [{type:,handler:},...]\n*/\nWidget.prototype.addEventListeners = function(listeners) {\n\tvar self = this;\n\t$tw.utils.each(listeners,function(listenerInfo) {\n\t\tself.addEventListener(listenerInfo.type,listenerInfo.handler);\n\t});\n};\n\n/*\nAdd an event listener\n*/\nWidget.prototype.addEventListener = function(type,handler) {\n\tvar self = this;\n\tif(typeof handler === \"string\") { // The handler is a method name on this widget\n\t\tthis.eventListeners[type] = function(event) {\n\t\t\treturn self[handler].call(self,event);\n\t\t};\n\t} else { // The handler is a function\n\t\tthis.eventListeners[type] = function(event) {\n\t\t\treturn handler.call(self,event);\n\t\t};\n\t}\n};\n\n/*\nDispatch an event to a widget. If the widget doesn't handle the event then it is also dispatched to the parent widget\n*/\nWidget.prototype.dispatchEvent = function(event) {\n\t// Dispatch the event if this widget handles it\n\tvar listener = this.eventListeners[event.type];\n\tif(listener) {\n\t\t// Don't propagate the event if the listener returned false\n\t\tif(!listener(event)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t// Dispatch the event to the parent widget\n\tif(this.parentWidget) {\n\t\treturn this.parentWidget.dispatchEvent(event);\n\t}\n\treturn true;\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nWidget.prototype.refresh = function(changedTiddlers) {\n\treturn this.refreshChildren(changedTiddlers);\n};\n\n/*\nRebuild a previously rendered widget\n*/\nWidget.prototype.refreshSelf = function() {\n\tvar nextSibling = this.findNextSiblingDomNode();\n\tthis.removeChildDomNodes();\n\tthis.render(this.parentDomNode,nextSibling);\n};\n\n/*\nRefresh all the children of a widget\n*/\nWidget.prototype.refreshChildren = function(changedTiddlers) {\n\tvar self = this,\n\t\trefreshed = false;\n\t$tw.utils.each(this.children,function(childWidget) {\n\t\trefreshed = childWidget.refresh(changedTiddlers) || refreshed;\n\t});\n\treturn refreshed;\n};\n\n/*\nFind the next sibling in the DOM to this widget. This is done by scanning the widget tree through all next siblings and their descendents that share the same parent DOM node\n*/\nWidget.prototype.findNextSiblingDomNode = function(startIndex) {\n\t// Refer to this widget by its index within its parents children\n\tvar parent = this.parentWidget,\n\t\tindex = startIndex !== undefined ? startIndex : parent.children.indexOf(this);\nif(index === -1) {\n\tthrow \"node not found in parents children\";\n}\n\t// Look for a DOM node in the later siblings\n\twhile(++index < parent.children.length) {\n\t\tvar domNode = parent.children[index].findFirstDomNode();\n\t\tif(domNode) {\n\t\t\treturn domNode;\n\t\t}\n\t}\n\t// Go back and look for later siblings of our parent if it has the same parent dom node\n\tvar grandParent = parent.parentWidget;\n\tif(grandParent && parent.parentDomNode === this.parentDomNode) {\n\t\tindex = grandParent.children.indexOf(parent);\n\t\tif(index !== -1) {\n\t\t\treturn parent.findNextSiblingDomNode(index);\n\t\t}\n\t}\n\treturn null;\n};\n\n/*\nFind the first DOM node generated by a widget or its children\n*/\nWidget.prototype.findFirstDomNode = function() {\n\t// Return the first dom node of this widget, if we've got one\n\tif(this.domNodes.length > 0) {\n\t\treturn this.domNodes[0];\n\t}\n\t// Otherwise, recursively call our children\n\tfor(var t=0; t<this.children.length; t++) {\n\t\tvar domNode = this.children[t].findFirstDomNode();\n\t\tif(domNode) {\n\t\t\treturn domNode;\n\t\t}\n\t}\n\treturn null;\n};\n\n/*\nRemove any DOM nodes created by this widget or its children\n*/\nWidget.prototype.removeChildDomNodes = function() {\n\t// If this widget has directly created DOM nodes, delete them and exit. This assumes that any child widgets are contained within the created DOM nodes, which would normally be the case\n\tif(this.domNodes.length > 0) {\n\t\t$tw.utils.each(this.domNodes,function(domNode) {\n\t\t\tdomNode.parentNode.removeChild(domNode);\n\t\t});\n\t\tthis.domNodes = [];\n\t} else {\n\t\t// Otherwise, ask the child widgets to delete their DOM nodes\n\t\t$tw.utils.each(this.children,function(childWidget) {\n\t\t\tchildWidget.removeChildDomNodes();\n\t\t});\n\t}\n};\n\n/*\nInvoke the action widgets that are descendents of the current widget.\n*/\nWidget.prototype.invokeActions = function(triggeringWidget,event) {\n\tvar handled = false;\n\t// For each child widget\n\tfor(var t=0; t<this.children.length; t++) {\n\t\tvar child = this.children[t];\n\t\t// Invoke the child if it is an action widget\n\t\tif(child.invokeAction) {\n\t\t\tchild.refreshSelf();\n\t\t\tif(child.invokeAction(triggeringWidget,event)) {\n\t\t\t\thandled = true;\n\t\t\t}\n\t\t}\n\t\t// Propagate through through the child if it permits it\n\t\tif(child.allowActionPropagation() && child.invokeActions(triggeringWidget,event)) {\n\t\t\thandled = true;\n\t\t}\n\t}\n\treturn handled;\n};\n\n/*\nInvoke the action widgets defined in a string\n*/\nWidget.prototype.invokeActionString = function(actions,triggeringWidget,event,variables) {\n\tactions = actions || \"\";\n\tvar parser = this.wiki.parseText(\"text/vnd.tiddlywiki\",actions,{\n\t\t\tparentWidget: this,\n\t\t\tdocument: this.document\n\t\t}),\n\t\twidgetNode = this.wiki.makeWidget(parser,{\n\t\t\tparentWidget: this,\n\t\t\tdocument: this.document,\n\t\t\tvariables: variables\n\t\t});\n\tvar container = this.document.createElement(\"div\");\n\twidgetNode.render(container,null);\n\treturn widgetNode.invokeActions(this,event);\n};\n\nWidget.prototype.allowActionPropagation = function() {\n\treturn true;\n};\n\nexports.widget = Widget;\n\n})();\n",
            "title": "$:/core/modules/widgets/widget.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/widgets/wikify.js": {
            "text": "/*\\\ntitle: $:/core/modules/widgets/wikify.js\ntype: application/javascript\nmodule-type: widget\n\nWidget to wikify text into a variable\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar WikifyWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nWikifyWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nWikifyWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n};\n\n/*\nCompute the internal state of the widget\n*/\nWikifyWidget.prototype.execute = function() {\n\t// Get our parameters\n\tthis.wikifyName = this.getAttribute(\"name\");\n\tthis.wikifyText = this.getAttribute(\"text\");\n\tthis.wikifyType = this.getAttribute(\"type\");\n\tthis.wikifyMode = this.getAttribute(\"mode\",\"block\");\n\tthis.wikifyOutput = this.getAttribute(\"output\",\"text\");\n\t// Create the parse tree\n\tthis.wikifyParser = this.wiki.parseText(this.wikifyType,this.wikifyText,{\n\t\t\tparseAsInline: this.wikifyMode === \"inline\"\n\t\t});\n\t// Create the widget tree \n\tthis.wikifyWidgetNode = this.wiki.makeWidget(this.wikifyParser,{\n\t\t\tdocument: $tw.fakeDocument,\n\t\t\tparentWidget: this\n\t\t});\n\t// Render the widget tree to the container\n\tthis.wikifyContainer = $tw.fakeDocument.createElement(\"div\");\n\tthis.wikifyWidgetNode.render(this.wikifyContainer,null);\n\tthis.wikifyResult = this.getResult();\n\t// Set context variable\n\tthis.setVariable(this.wikifyName,this.wikifyResult);\n\t// Construct the child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nReturn the result string\n*/\nWikifyWidget.prototype.getResult = function() {\n\tvar result;\n\tswitch(this.wikifyOutput) {\n\t\tcase \"text\":\n\t\t\tresult = this.wikifyContainer.textContent;\n\t\t\tbreak;\n\t\tcase \"formattedtext\":\n\t\t\tresult = this.wikifyContainer.formattedTextContent;\n\t\t\tbreak;\n\t\tcase \"html\":\n\t\t\tresult = this.wikifyContainer.innerHTML;\n\t\t\tbreak;\n\t\tcase \"parsetree\":\n\t\t\tresult = JSON.stringify(this.wikifyParser.tree,0,$tw.config.preferences.jsonSpaces);\n\t\t\tbreak;\n\t\tcase \"widgettree\":\n\t\t\tresult = JSON.stringify(this.getWidgetTree(),0,$tw.config.preferences.jsonSpaces);\n\t\t\tbreak;\n\t}\n\treturn result;\n};\n\n/*\nReturn a string of the widget tree\n*/\nWikifyWidget.prototype.getWidgetTree = function() {\n\tvar copyNode = function(widgetNode,resultNode) {\n\t\t\tvar type = widgetNode.parseTreeNode.type;\n\t\t\tresultNode.type = type;\n\t\t\tswitch(type) {\n\t\t\t\tcase \"element\":\n\t\t\t\t\tresultNode.tag = widgetNode.parseTreeNode.tag;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"text\":\n\t\t\t\t\tresultNode.text = widgetNode.parseTreeNode.text;\n\t\t\t\t\tbreak;\t\n\t\t\t}\n\t\t\tif(Object.keys(widgetNode.attributes || {}).length > 0) {\n\t\t\t\tresultNode.attributes = {};\n\t\t\t\t$tw.utils.each(widgetNode.attributes,function(attr,attrName) {\n\t\t\t\t\tresultNode.attributes[attrName] = widgetNode.getAttribute(attrName);\n\t\t\t\t});\n\t\t\t}\n\t\t\tif(Object.keys(widgetNode.children || {}).length > 0) {\n\t\t\t\tresultNode.children = [];\n\t\t\t\t$tw.utils.each(widgetNode.children,function(widgetChildNode) {\n\t\t\t\t\tvar node = {};\n\t\t\t\t\tresultNode.children.push(node);\n\t\t\t\t\tcopyNode(widgetChildNode,node);\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\tresults = {};\n\tcopyNode(this.wikifyWidgetNode,results);\n\treturn results;\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nWikifyWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\t// Refresh ourselves entirely if any of our attributes have changed\n\tif(changedAttributes.name || changedAttributes.text || changedAttributes.type || changedAttributes.mode || changedAttributes.output) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\t// Refresh the widget tree\n\t\tif(this.wikifyWidgetNode.refresh(changedTiddlers)) {\n\t\t\t// Check if there was any change\n\t\t\tvar result = this.getResult();\n\t\t\tif(result !== this.wikifyResult) {\n\t\t\t\t// If so, save the change\n\t\t\t\tthis.wikifyResult = result;\n\t\t\t\tthis.setVariable(this.wikifyName,this.wikifyResult);\n\t\t\t\t// Refresh each of our child widgets\n\t\t\t\t$tw.utils.each(this.children,function(childWidget) {\n\t\t\t\t\tchildWidget.refreshSelf();\n\t\t\t\t});\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t// Just refresh the children\n\t\treturn this.refreshChildren(changedTiddlers);\n\t}\n};\n\nexports.wikify = WikifyWidget;\n\n})();\n",
            "title": "$:/core/modules/widgets/wikify.js",
            "type": "application/javascript",
            "module-type": "widget"
        },
        "$:/core/modules/wiki-bulkops.js": {
            "text": "/*\\\ntitle: $:/core/modules/wiki-bulkops.js\ntype: application/javascript\nmodule-type: wikimethod\n\nBulk tiddler operations such as rename.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nRename a tiddler, and relink any tags or lists that reference it.\n*/\nfunction renameTiddler(fromTitle,toTitle,options) {\n\tfromTitle = (fromTitle || \"\").trim();\n\ttoTitle = (toTitle || \"\").trim();\n\toptions = options || {};\n\tif(fromTitle && toTitle && fromTitle !== toTitle) {\n\t\t// Rename the tiddler itself\n\t\tvar oldTiddler = this.getTiddler(fromTitle),\n\t\t\tnewTiddler = new $tw.Tiddler(oldTiddler,{title: toTitle},this.getModificationFields());\n\t\tnewTiddler = $tw.hooks.invokeHook(\"th-renaming-tiddler\",newTiddler,oldTiddler);\n\t\tthis.addTiddler(newTiddler);\n\t\tthis.deleteTiddler(fromTitle);\n\t\t// Rename any tags or lists that reference it\n\t\tthis.relinkTiddler(fromTitle,toTitle,options)\n\t}\n}\n\n/*\nRelink any tags or lists that reference a given tiddler\n*/\nfunction relinkTiddler(fromTitle,toTitle,options) {\n\tvar self = this;\n\tfromTitle = (fromTitle || \"\").trim();\n\ttoTitle = (toTitle || \"\").trim();\n\toptions = options || {};\n\tif(fromTitle && toTitle && fromTitle !== toTitle) {\n\t\tthis.each(function(tiddler,title) {\n\t\t\tvar type = tiddler.fields.type || \"\";\n\t\t\t// Don't touch plugins or JavaScript modules\n\t\t\tif(!tiddler.fields[\"plugin-type\"] && type !== \"application/javascript\") {\n\t\t\t\tvar tags = (tiddler.fields.tags || []).slice(0),\n\t\t\t\t\tlist = (tiddler.fields.list || []).slice(0),\n\t\t\t\t\tisModified = false;\n\t\t\t\tif(!options.dontRenameInTags) {\n\t\t\t\t\t// Rename tags\n\t\t\t\t\t$tw.utils.each(tags,function (title,index) {\n\t\t\t\t\t\tif(title === fromTitle) {\nconsole.log(\"Renaming tag '\" + tags[index] + \"' to '\" + toTitle + \"' of tiddler '\" + tiddler.fields.title + \"'\");\n\t\t\t\t\t\t\ttags[index] = toTitle;\n\t\t\t\t\t\t\tisModified = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif(!options.dontRenameInLists) {\n\t\t\t\t\t// Rename lists\n\t\t\t\t\t$tw.utils.each(list,function (title,index) {\n\t\t\t\t\t\tif(title === fromTitle) {\nconsole.log(\"Renaming list item '\" + list[index] + \"' to '\" + toTitle + \"' of tiddler '\" + tiddler.fields.title + \"'\");\n\t\t\t\t\t\t\tlist[index] = toTitle;\n\t\t\t\t\t\t\tisModified = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif(isModified) {\n\t\t\t\t\tvar newTiddler = new $tw.Tiddler(tiddler,{tags: tags, list: list},self.getModificationFields())\n\t\t\t\t\tnewTiddler = $tw.hooks.invokeHook(\"th-relinking-tiddler\",newTiddler,tiddler);\n\t\t\t\t\tself.addTiddler(newTiddler);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n};\n\nexports.renameTiddler = renameTiddler;\nexports.relinkTiddler = relinkTiddler;\n\n})();\n",
            "title": "$:/core/modules/wiki-bulkops.js",
            "type": "application/javascript",
            "module-type": "wikimethod"
        },
        "$:/core/modules/wiki.js": {
            "text": "/*\\\ntitle: $:/core/modules/wiki.js\ntype: application/javascript\nmodule-type: wikimethod\n\nExtension methods for the $tw.Wiki object\n\nAdds the following properties to the wiki object:\n\n* `eventListeners` is a hashmap by type of arrays of listener functions\n* `changedTiddlers` is a hashmap describing changes to named tiddlers since wiki change events were last dispatched. Each entry is a hashmap containing two fields:\n\tmodified: true/false\n\tdeleted: true/false\n* `changeCount` is a hashmap by tiddler title containing a numerical index that starts at zero and is incremented each time a tiddler is created changed or deleted\n* `caches` is a hashmap by tiddler title containing a further hashmap of named cache objects. Caches are automatically cleared when a tiddler is modified or deleted\n* `globalCache` is a hashmap by cache name of cache objects that are cleared whenever any tiddler change occurs\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar widget = require(\"$:/core/modules/widgets/widget.js\");\n\nvar USER_NAME_TITLE = \"$:/status/UserName\",\n\tTIMESTAMP_DISABLE_TITLE = \"$:/config/TimestampDisable\";\n\n/*\nGet the value of a text reference. Text references can have any of these forms:\n\t<tiddlertitle>\n\t<tiddlertitle>!!<fieldname>\n\t!!<fieldname> - specifies a field of the current tiddlers\n\t<tiddlertitle>##<index>\n*/\nexports.getTextReference = function(textRef,defaultText,currTiddlerTitle) {\n\tvar tr = $tw.utils.parseTextReference(textRef),\n\t\ttitle = tr.title || currTiddlerTitle;\n\tif(tr.field) {\n\t\tvar tiddler = this.getTiddler(title);\n\t\tif(tr.field === \"title\") { // Special case so we can return the title of a non-existent tiddler\n\t\t\treturn title;\n\t\t} else if(tiddler && $tw.utils.hop(tiddler.fields,tr.field)) {\n\t\t\treturn tiddler.getFieldString(tr.field);\n\t\t} else {\n\t\t\treturn defaultText;\n\t\t}\n\t} else if(tr.index) {\n\t\treturn this.extractTiddlerDataItem(title,tr.index,defaultText);\n\t} else {\n\t\treturn this.getTiddlerText(title,defaultText);\n\t}\n};\n\nexports.setTextReference = function(textRef,value,currTiddlerTitle) {\n\tvar tr = $tw.utils.parseTextReference(textRef),\n\t\ttitle = tr.title || currTiddlerTitle;\n\tthis.setText(title,tr.field,tr.index,value);\n};\n\nexports.setText = function(title,field,index,value,options) {\n\toptions = options || {};\n\tvar creationFields = options.suppressTimestamp ? {} : this.getCreationFields(),\n\t\tmodificationFields = options.suppressTimestamp ? {} : this.getModificationFields();\n\t// Check if it is a reference to a tiddler field\n\tif(index) {\n\t\tvar data = this.getTiddlerData(title,Object.create(null));\n\t\tif(value !== undefined) {\n\t\t\tdata[index] = value;\n\t\t} else {\n\t\t\tdelete data[index];\n\t\t}\n\t\tthis.setTiddlerData(title,data,modificationFields);\n\t} else {\n\t\tvar tiddler = this.getTiddler(title),\n\t\t\tfields = {title: title};\n\t\tfields[field || \"text\"] = value;\n\t\tthis.addTiddler(new $tw.Tiddler(creationFields,tiddler,fields,modificationFields));\n\t}\n};\n\nexports.deleteTextReference = function(textRef,currTiddlerTitle) {\n\tvar tr = $tw.utils.parseTextReference(textRef),\n\t\ttitle,tiddler,fields;\n\t// Check if it is a reference to a tiddler\n\tif(tr.title && !tr.field) {\n\t\tthis.deleteTiddler(tr.title);\n\t// Else check for a field reference\n\t} else if(tr.field) {\n\t\ttitle = tr.title || currTiddlerTitle;\n\t\ttiddler = this.getTiddler(title);\n\t\tif(tiddler && $tw.utils.hop(tiddler.fields,tr.field)) {\n\t\t\tfields = Object.create(null);\n\t\t\tfields[tr.field] = undefined;\n\t\t\tthis.addTiddler(new $tw.Tiddler(tiddler,fields,this.getModificationFields()));\n\t\t}\n\t}\n};\n\nexports.addEventListener = function(type,listener) {\n\tthis.eventListeners = this.eventListeners || {};\n\tthis.eventListeners[type] = this.eventListeners[type]  || [];\n\tthis.eventListeners[type].push(listener);\t\n};\n\nexports.removeEventListener = function(type,listener) {\n\tvar listeners = this.eventListeners[type];\n\tif(listeners) {\n\t\tvar p = listeners.indexOf(listener);\n\t\tif(p !== -1) {\n\t\t\tlisteners.splice(p,1);\n\t\t}\n\t}\n};\n\nexports.dispatchEvent = function(type /*, args */) {\n\tvar args = Array.prototype.slice.call(arguments,1),\n\t\tlisteners = this.eventListeners[type];\n\tif(listeners) {\n\t\tfor(var p=0; p<listeners.length; p++) {\n\t\t\tvar listener = listeners[p];\n\t\t\tlistener.apply(listener,args);\n\t\t}\n\t}\n};\n\n/*\nCauses a tiddler to be marked as changed, incrementing the change count, and triggers event handlers.\nThis method should be called after the changes it describes have been made to the wiki.tiddlers[] array.\n\ttitle: Title of tiddler\n\tisDeleted: defaults to false (meaning the tiddler has been created or modified),\n\t\ttrue if the tiddler has been deleted\n*/\nexports.enqueueTiddlerEvent = function(title,isDeleted) {\n\t// Record the touch in the list of changed tiddlers\n\tthis.changedTiddlers = this.changedTiddlers || Object.create(null);\n\tthis.changedTiddlers[title] = this.changedTiddlers[title] || Object.create(null);\n\tthis.changedTiddlers[title][isDeleted ? \"deleted\" : \"modified\"] = true;\n\t// Increment the change count\n\tthis.changeCount = this.changeCount || Object.create(null);\n\tif($tw.utils.hop(this.changeCount,title)) {\n\t\tthis.changeCount[title]++;\n\t} else {\n\t\tthis.changeCount[title] = 1;\n\t}\n\t// Trigger events\n\tthis.eventListeners = this.eventListeners || {};\n\tif(!this.eventsTriggered) {\n\t\tvar self = this;\n\t\t$tw.utils.nextTick(function() {\n\t\t\tvar changes = self.changedTiddlers;\n\t\t\tself.changedTiddlers = Object.create(null);\n\t\t\tself.eventsTriggered = false;\n\t\t\tif($tw.utils.count(changes) > 0) {\n\t\t\t\tself.dispatchEvent(\"change\",changes);\n\t\t\t}\n\t\t});\n\t\tthis.eventsTriggered = true;\n\t}\n};\n\nexports.getSizeOfTiddlerEventQueue = function() {\n\treturn $tw.utils.count(this.changedTiddlers);\n};\n\nexports.clearTiddlerEventQueue = function() {\n\tthis.changedTiddlers = Object.create(null);\n\tthis.changeCount = Object.create(null);\n};\n\nexports.getChangeCount = function(title) {\n\tthis.changeCount = this.changeCount || Object.create(null);\n\tif($tw.utils.hop(this.changeCount,title)) {\n\t\treturn this.changeCount[title];\n\t} else {\n\t\treturn 0;\n\t}\n};\n\n/*\nGenerate an unused title from the specified base\n*/\nexports.generateNewTitle = function(baseTitle,options) {\n\toptions = options || {};\n\tvar c = 0,\n\t\ttitle = baseTitle;\n\twhile(this.tiddlerExists(title) || this.isShadowTiddler(title) || this.findDraft(title)) {\n\t\ttitle = baseTitle + \n\t\t\t(options.prefix || \" \") + \n\t\t\t(++c);\n\t}\n\treturn title;\n};\n\nexports.isSystemTiddler = function(title) {\n\treturn title && title.indexOf(\"$:/\") === 0;\n};\n\nexports.isTemporaryTiddler = function(title) {\n\treturn title && title.indexOf(\"$:/temp/\") === 0;\n};\n\nexports.isImageTiddler = function(title) {\n\tvar tiddler = this.getTiddler(title);\n\tif(tiddler) {\t\t\n\t\tvar contentTypeInfo = $tw.config.contentTypeInfo[tiddler.fields.type || \"text/vnd.tiddlywiki\"];\n\t\treturn !!contentTypeInfo && contentTypeInfo.flags.indexOf(\"image\") !== -1;\n\t} else {\n\t\treturn null;\n\t}\n};\n\n/*\nLike addTiddler() except it will silently reject any plugin tiddlers that are older than the currently loaded version. Returns true if the tiddler was imported\n*/\nexports.importTiddler = function(tiddler) {\n\tvar existingTiddler = this.getTiddler(tiddler.fields.title);\n\t// Check if we're dealing with a plugin\n\tif(tiddler && tiddler.hasField(\"plugin-type\") && tiddler.hasField(\"version\") && existingTiddler && existingTiddler.hasField(\"plugin-type\") && existingTiddler.hasField(\"version\")) {\n\t\t// Reject the incoming plugin if it is older\n\t\tif(!$tw.utils.checkVersions(tiddler.fields.version,existingTiddler.fields.version)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t// Fall through to adding the tiddler\n\tthis.addTiddler(tiddler);\n\treturn true;\n};\n\n/*\nReturn a hashmap of the fields that should be set when a tiddler is created\n*/\nexports.getCreationFields = function() {\n\tif(this.getTiddlerText(TIMESTAMP_DISABLE_TITLE,\"\").toLowerCase() !== \"yes\") {\n\t\tvar fields = {\n\t\t\t\tcreated: new Date()\n\t\t\t},\n\t\t\tcreator = this.getTiddlerText(USER_NAME_TITLE);\n\t\tif(creator) {\n\t\t\tfields.creator = creator;\n\t\t}\n\t\treturn fields;\n\t} else {\n\t\treturn {};\n\t}\n};\n\n/*\nReturn a hashmap of the fields that should be set when a tiddler is modified\n*/\nexports.getModificationFields = function() {\n\tif(this.getTiddlerText(TIMESTAMP_DISABLE_TITLE,\"\").toLowerCase() !== \"yes\") {\n\t\tvar fields = Object.create(null),\n\t\t\tmodifier = this.getTiddlerText(USER_NAME_TITLE);\n\t\tfields.modified = new Date();\n\t\tif(modifier) {\n\t\t\tfields.modifier = modifier;\n\t\t}\n\t\treturn fields;\n\t} else {\n\t\treturn {};\n\t}\n};\n\n/*\nReturn a sorted array of tiddler titles.  Options include:\nsortField: field to sort by\nexcludeTag: tag to exclude\nincludeSystem: whether to include system tiddlers (defaults to false)\n*/\nexports.getTiddlers = function(options) {\n\toptions = options || Object.create(null);\n\tvar self = this,\n\t\tsortField = options.sortField || \"title\",\n\t\ttiddlers = [], t, titles = [];\n\tthis.each(function(tiddler,title) {\n\t\tif(options.includeSystem || !self.isSystemTiddler(title)) {\n\t\t\tif(!options.excludeTag || !tiddler.hasTag(options.excludeTag)) {\n\t\t\t\ttiddlers.push(tiddler);\n\t\t\t}\n\t\t}\n\t});\n\ttiddlers.sort(function(a,b) {\n\t\tvar aa = a.fields[sortField].toLowerCase() || \"\",\n\t\t\tbb = b.fields[sortField].toLowerCase() || \"\";\n\t\tif(aa < bb) {\n\t\t\treturn -1;\n\t\t} else {\n\t\t\tif(aa > bb) {\n\t\t\t\treturn 1;\n\t\t\t} else {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t});\n\tfor(t=0; t<tiddlers.length; t++) {\n\t\ttitles.push(tiddlers[t].fields.title);\n\t}\n\treturn titles;\n};\n\nexports.countTiddlers = function(excludeTag) {\n\tvar tiddlers = this.getTiddlers({excludeTag: excludeTag});\n\treturn $tw.utils.count(tiddlers);\n};\n\n/*\nReturns a function iterator(callback) that iterates through the specified titles, and invokes the callback with callback(tiddler,title)\n*/\nexports.makeTiddlerIterator = function(titles) {\n\tvar self = this;\n\tif(!$tw.utils.isArray(titles)) {\n\t\ttitles = Object.keys(titles);\n\t} else {\n\t\ttitles = titles.slice(0);\n\t}\n\treturn function(callback) {\n\t\ttitles.forEach(function(title) {\n\t\t\tcallback(self.getTiddler(title),title);\n\t\t});\n\t};\n};\n\n/*\nSort an array of tiddler titles by a specified field\n\ttitles: array of titles (sorted in place)\n\tsortField: name of field to sort by\n\tisDescending: true if the sort should be descending\n\tisCaseSensitive: true if the sort should consider upper and lower case letters to be different\n*/\nexports.sortTiddlers = function(titles,sortField,isDescending,isCaseSensitive,isNumeric) {\n\tvar self = this;\n\ttitles.sort(function(a,b) {\n\t\tvar x,y,\n\t\t\tcompareNumbers = function(x,y) {\n\t\t\t\tvar result = \n\t\t\t\t\tisNaN(x) && !isNaN(y) ? (isDescending ? -1 : 1) :\n\t\t\t\t\t!isNaN(x) && isNaN(y) ? (isDescending ? 1 : -1) :\n\t\t\t\t\t\t\t\t\t\t\t(isDescending ? y - x :  x - y);\n\t\t\t\treturn result;\n\t\t\t};\n\t\tif(sortField !== \"title\") {\n\t\t\tvar tiddlerA = self.getTiddler(a),\n\t\t\t\ttiddlerB = self.getTiddler(b);\n\t\t\tif(tiddlerA) {\n\t\t\t\ta = tiddlerA.fields[sortField] || \"\";\n\t\t\t} else {\n\t\t\t\ta = \"\";\n\t\t\t}\n\t\t\tif(tiddlerB) {\n\t\t\t\tb = tiddlerB.fields[sortField] || \"\";\n\t\t\t} else {\n\t\t\t\tb = \"\";\n\t\t\t}\n\t\t}\n\t\tx = Number(a);\n\t\ty = Number(b);\n\t\tif(isNumeric && (!isNaN(x) || !isNaN(y))) {\n\t\t\treturn compareNumbers(x,y);\n\t\t} else if($tw.utils.isDate(a) && $tw.utils.isDate(b)) {\n\t\t\treturn isDescending ? b - a : a - b;\n\t\t} else {\n\t\t\ta = String(a);\n\t\t\tb = String(b);\n\t\t\tif(!isCaseSensitive) {\n\t\t\t\ta = a.toLowerCase();\n\t\t\t\tb = b.toLowerCase();\n\t\t\t}\n\t\t\treturn isDescending ? b.localeCompare(a) : a.localeCompare(b);\n\t\t}\n\t});\n};\n\n/*\nFor every tiddler invoke a callback(title,tiddler) with `this` set to the wiki object. Options include:\nsortField: field to sort by\nexcludeTag: tag to exclude\nincludeSystem: whether to include system tiddlers (defaults to false)\n*/\nexports.forEachTiddler = function(/* [options,]callback */) {\n\tvar arg = 0,\n\t\toptions = arguments.length >= 2 ? arguments[arg++] : {},\n\t\tcallback = arguments[arg++],\n\t\ttitles = this.getTiddlers(options),\n\t\tt, tiddler;\n\tfor(t=0; t<titles.length; t++) {\n\t\ttiddler = this.getTiddler(titles[t]);\n\t\tif(tiddler) {\n\t\t\tcallback.call(this,tiddler.fields.title,tiddler);\n\t\t}\n\t}\n};\n\n/*\nReturn an array of tiddler titles that are directly linked from the specified tiddler\n*/\nexports.getTiddlerLinks = function(title) {\n\tvar self = this;\n\t// We'll cache the links so they only get computed if the tiddler changes\n\treturn this.getCacheForTiddler(title,\"links\",function() {\n\t\t// Parse the tiddler\n\t\tvar parser = self.parseTiddler(title);\n\t\t// Count up the links\n\t\tvar links = [],\n\t\t\tcheckParseTree = function(parseTree) {\n\t\t\t\tfor(var t=0; t<parseTree.length; t++) {\n\t\t\t\t\tvar parseTreeNode = parseTree[t];\n\t\t\t\t\tif(parseTreeNode.type === \"link\" && parseTreeNode.attributes.to && parseTreeNode.attributes.to.type === \"string\") {\n\t\t\t\t\t\tvar value = parseTreeNode.attributes.to.value;\n\t\t\t\t\t\tif(links.indexOf(value) === -1) {\n\t\t\t\t\t\t\tlinks.push(value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(parseTreeNode.children) {\n\t\t\t\t\t\tcheckParseTree(parseTreeNode.children);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\tif(parser) {\n\t\t\tcheckParseTree(parser.tree);\n\t\t}\n\t\treturn links;\n\t});\n};\n\n/*\nReturn an array of tiddler titles that link to the specified tiddler\n*/\nexports.getTiddlerBacklinks = function(targetTitle) {\n\tvar self = this,\n\t\tbacklinks = [];\n\tthis.forEachTiddler(function(title,tiddler) {\n\t\tvar links = self.getTiddlerLinks(title);\n\t\tif(links.indexOf(targetTitle) !== -1) {\n\t\t\tbacklinks.push(title);\n\t\t}\n\t});\n\treturn backlinks;\n};\n\n/*\nReturn a hashmap of tiddler titles that are referenced but not defined. Each value is the number of times the missing tiddler is referenced\n*/\nexports.getMissingTitles = function() {\n\tvar self = this,\n\t\tmissing = [];\n// We should cache the missing tiddler list, even if we recreate it every time any tiddler is modified\n\tthis.forEachTiddler(function(title,tiddler) {\n\t\tvar links = self.getTiddlerLinks(title);\n\t\t$tw.utils.each(links,function(link) {\n\t\t\tif((!self.tiddlerExists(link) && !self.isShadowTiddler(link)) && missing.indexOf(link) === -1) {\n\t\t\t\tmissing.push(link);\n\t\t\t}\n\t\t});\n\t});\n\treturn missing;\n};\n\nexports.getOrphanTitles = function() {\n\tvar self = this,\n\t\torphans = this.getTiddlers();\n\tthis.forEachTiddler(function(title,tiddler) {\n\t\tvar links = self.getTiddlerLinks(title);\n\t\t$tw.utils.each(links,function(link) {\n\t\t\tvar p = orphans.indexOf(link);\n\t\t\tif(p !== -1) {\n\t\t\t\torphans.splice(p,1);\n\t\t\t}\n\t\t});\n\t});\n\treturn orphans; // Todo\n};\n\n/*\nRetrieves a list of the tiddler titles that are tagged with a given tag\n*/\nexports.getTiddlersWithTag = function(tag) {\n\tvar self = this;\n\treturn this.getGlobalCache(\"taglist-\" + tag,function() {\n\t\tvar tagmap = self.getTagMap();\n\t\treturn self.sortByList(tagmap[tag],tag);\n\t});\n};\n\n/*\nGet a hashmap by tag of arrays of tiddler titles\n*/\nexports.getTagMap = function() {\n\tvar self = this;\n\treturn this.getGlobalCache(\"tagmap\",function() {\n\t\tvar tags = Object.create(null),\n\t\t\tstoreTags = function(tagArray,title) {\n\t\t\t\tif(tagArray) {\n\t\t\t\t\tfor(var index=0; index<tagArray.length; index++) {\n\t\t\t\t\t\tvar tag = tagArray[index];\n\t\t\t\t\t\tif($tw.utils.hop(tags,tag)) {\n\t\t\t\t\t\t\ttags[tag].push(title);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttags[tag] = [title];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\ttitle, tiddler;\n\t\t// Collect up all the tags\n\t\tself.eachShadow(function(tiddler,title) {\n\t\t\tif(!self.tiddlerExists(title)) {\n\t\t\t\ttiddler = self.getTiddler(title);\n\t\t\t\tstoreTags(tiddler.fields.tags,title);\n\t\t\t}\n\t\t});\n\t\tself.each(function(tiddler,title) {\n\t\t\tstoreTags(tiddler.fields.tags,title);\n\t\t});\n\t\treturn tags;\n\t});\n};\n\n/*\nLookup a given tiddler and return a list of all the tiddlers that include it in the specified list field\n*/\nexports.findListingsOfTiddler = function(targetTitle,fieldName) {\n\tfieldName = fieldName || \"list\";\n\tvar titles = [];\n\tthis.each(function(tiddler,title) {\n\t\tvar list = $tw.utils.parseStringArray(tiddler.fields[fieldName]);\n\t\tif(list && list.indexOf(targetTitle) !== -1) {\n\t\t\ttitles.push(title);\n\t\t}\n\t});\n\treturn titles;\n};\n\n/*\nSorts an array of tiddler titles according to an ordered list\n*/\nexports.sortByList = function(array,listTitle) {\n\tvar list = this.getTiddlerList(listTitle);\n\tif(!array || array.length === 0) {\n\t\treturn [];\n\t} else {\n\t\tvar titles = [], t, title;\n\t\t// First place any entries that are present in the list\n\t\tfor(t=0; t<list.length; t++) {\n\t\t\ttitle = list[t];\n\t\t\tif(array.indexOf(title) !== -1) {\n\t\t\t\ttitles.push(title);\n\t\t\t}\n\t\t}\n\t\t// Then place any remaining entries\n\t\tfor(t=0; t<array.length; t++) {\n\t\t\ttitle = array[t];\n\t\t\tif(list.indexOf(title) === -1) {\n\t\t\t\ttitles.push(title);\n\t\t\t}\n\t\t}\n\t\t// Finally obey the list-before and list-after fields of each tiddler in turn\n\t\tvar sortedTitles = titles.slice(0);\n\t\tfor(t=0; t<sortedTitles.length; t++) {\n\t\t\ttitle = sortedTitles[t];\n\t\t\tvar currPos = titles.indexOf(title),\n\t\t\t\tnewPos = -1,\n\t\t\t\ttiddler = this.getTiddler(title);\n\t\t\tif(tiddler) {\n\t\t\t\tvar beforeTitle = tiddler.fields[\"list-before\"],\n\t\t\t\t\tafterTitle = tiddler.fields[\"list-after\"];\n\t\t\t\tif(beforeTitle === \"\") {\n\t\t\t\t\tnewPos = 0;\n\t\t\t\t} else if(beforeTitle) {\n\t\t\t\t\tnewPos = titles.indexOf(beforeTitle);\n\t\t\t\t} else if(afterTitle) {\n\t\t\t\t\tnewPos = titles.indexOf(afterTitle);\n\t\t\t\t\tif(newPos >= 0) {\n\t\t\t\t\t\t++newPos;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(newPos === -1) {\n\t\t\t\t\tnewPos = currPos;\n\t\t\t\t}\n\t\t\t\tif(newPos !== currPos) {\n\t\t\t\t\ttitles.splice(currPos,1);\n\t\t\t\t\tif(newPos >= currPos) {\n\t\t\t\t\t\tnewPos--;\n\t\t\t\t\t}\n\t\t\t\t\ttitles.splice(newPos,0,title);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn titles;\n\t}\n};\n\nexports.getSubTiddler = function(title,subTiddlerTitle) {\n\tvar bundleInfo = this.getPluginInfo(title) || this.getTiddlerDataCached(title);\n\tif(bundleInfo && bundleInfo.tiddlers) {\n\t\tvar subTiddler = bundleInfo.tiddlers[subTiddlerTitle];\n\t\tif(subTiddler) {\n\t\t\treturn new $tw.Tiddler(subTiddler);\n\t\t}\n\t}\n\treturn null;\n};\n\n/*\nRetrieve a tiddler as a JSON string of the fields\n*/\nexports.getTiddlerAsJson = function(title) {\n\tvar tiddler = this.getTiddler(title);\n\tif(tiddler) {\n\t\tvar fields = Object.create(null);\n\t\t$tw.utils.each(tiddler.fields,function(value,name) {\n\t\t\tfields[name] = tiddler.getFieldString(name);\n\t\t});\n\t\treturn JSON.stringify(fields);\n\t} else {\n\t\treturn JSON.stringify({title: title});\n\t}\n};\n\n/*\nGet the content of a tiddler as a JavaScript object. How this is done depends on the type of the tiddler:\n\napplication/json: the tiddler JSON is parsed into an object\napplication/x-tiddler-dictionary: the tiddler is parsed as sequence of name:value pairs\n\nOther types currently just return null.\n\ntitleOrTiddler: string tiddler title or a tiddler object\ndefaultData: default data to be returned if the tiddler is missing or doesn't contain data\n\nNote that the same value is returned for repeated calls for the same tiddler data. The value is frozen to prevent modification; otherwise modifications would be visible to all callers\n*/\nexports.getTiddlerDataCached = function(titleOrTiddler,defaultData) {\n\tvar self = this,\n\t\ttiddler = titleOrTiddler;\n\tif(!(tiddler instanceof $tw.Tiddler)) {\n\t\ttiddler = this.getTiddler(tiddler);\t\n\t}\n\tif(tiddler) {\n\t\treturn this.getCacheForTiddler(tiddler.fields.title,\"data\",function() {\n\t\t\t// Return the frozen value\n\t\t\tvar value = self.getTiddlerData(tiddler.fields.title,undefined);\n\t\t\t$tw.utils.deepFreeze(value);\n\t\t\treturn value;\n\t\t}) || defaultData;\n\t} else {\n\t\treturn defaultData;\n\t}\n};\n\n/*\nAlternative, uncached version of getTiddlerDataCached(). The return value can be mutated freely and reused\n*/\nexports.getTiddlerData = function(titleOrTiddler,defaultData) {\n\tvar tiddler = titleOrTiddler,\n\t\tdata;\n\tif(!(tiddler instanceof $tw.Tiddler)) {\n\t\ttiddler = this.getTiddler(tiddler);\t\n\t}\n\tif(tiddler && tiddler.fields.text) {\n\t\tswitch(tiddler.fields.type) {\n\t\t\tcase \"application/json\":\n\t\t\t\t// JSON tiddler\n\t\t\t\ttry {\n\t\t\t\t\tdata = JSON.parse(tiddler.fields.text);\n\t\t\t\t} catch(ex) {\n\t\t\t\t\treturn defaultData;\n\t\t\t\t}\n\t\t\t\treturn data;\n\t\t\tcase \"application/x-tiddler-dictionary\":\n\t\t\t\treturn $tw.utils.parseFields(tiddler.fields.text);\n\t\t}\n\t}\n\treturn defaultData;\n};\n\n/*\nExtract an indexed field from within a data tiddler\n*/\nexports.extractTiddlerDataItem = function(titleOrTiddler,index,defaultText) {\n\tvar data = this.getTiddlerDataCached(titleOrTiddler,Object.create(null)),\n\t\ttext;\n\tif(data && $tw.utils.hop(data,index)) {\n\t\ttext = data[index];\n\t}\n\tif(typeof text === \"string\" || typeof text === \"number\") {\n\t\treturn text.toString();\n\t} else {\n\t\treturn defaultText;\n\t}\n};\n\n/*\nSet a tiddlers content to a JavaScript object. Currently this is done by setting the tiddler's type to \"application/json\" and setting the text to the JSON text of the data.\ntitle: title of tiddler\ndata: object that can be serialised to JSON\nfields: optional hashmap of additional tiddler fields to be set\n*/\nexports.setTiddlerData = function(title,data,fields) {\n\tvar existingTiddler = this.getTiddler(title),\n\t\tnewFields = {\n\t\t\ttitle: title\n\t};\n\tif(existingTiddler && existingTiddler.fields.type === \"application/x-tiddler-dictionary\") {\n\t\tnewFields.text = $tw.utils.makeTiddlerDictionary(data);\n\t} else {\n\t\tnewFields.type = \"application/json\";\n\t\tnewFields.text = JSON.stringify(data,null,$tw.config.preferences.jsonSpaces);\n\t}\n\tthis.addTiddler(new $tw.Tiddler(this.getCreationFields(),existingTiddler,fields,newFields,this.getModificationFields()));\n};\n\n/*\nReturn the content of a tiddler as an array containing each line\n*/\nexports.getTiddlerList = function(title,field,index) {\n\tif(index) {\n\t\treturn $tw.utils.parseStringArray(this.extractTiddlerDataItem(title,index,\"\"));\n\t}\n\tfield = field || \"list\";\n\tvar tiddler = this.getTiddler(title);\n\tif(tiddler) {\n\t\treturn ($tw.utils.parseStringArray(tiddler.fields[field]) || []).slice(0);\n\t}\n\treturn [];\n};\n\n// Return a named global cache object. Global cache objects are cleared whenever a tiddler change occurs\nexports.getGlobalCache = function(cacheName,initializer) {\n\tthis.globalCache = this.globalCache || Object.create(null);\n\tif($tw.utils.hop(this.globalCache,cacheName)) {\n\t\treturn this.globalCache[cacheName];\n\t} else {\n\t\tthis.globalCache[cacheName] = initializer();\n\t\treturn this.globalCache[cacheName];\n\t}\n};\n\nexports.clearGlobalCache = function() {\n\tthis.globalCache = Object.create(null);\n};\n\n// Return the named cache object for a tiddler. If the cache doesn't exist then the initializer function is invoked to create it\nexports.getCacheForTiddler = function(title,cacheName,initializer) {\n\tthis.caches = this.caches || Object.create(null);\n\tvar caches = this.caches[title];\n\tif(caches && caches[cacheName]) {\n\t\treturn caches[cacheName];\n\t} else {\n\t\tif(!caches) {\n\t\t\tcaches = Object.create(null);\n\t\t\tthis.caches[title] = caches;\n\t\t}\n\t\tcaches[cacheName] = initializer();\n\t\treturn caches[cacheName];\n\t}\n};\n\n// Clear all caches associated with a particular tiddler, or, if the title is null, clear all the caches for all the tiddlers\nexports.clearCache = function(title) {\n\tif(title) {\n\t\tthis.caches = this.caches || Object.create(null);\n\t\tif($tw.utils.hop(this.caches,title)) {\n\t\t\tdelete this.caches[title];\n\t\t}\n\t} else {\n\t\tthis.caches = Object.create(null);\n\t}\n};\n\nexports.initParsers = function(moduleType) {\n\t// Install the parser modules\n\t$tw.Wiki.parsers = {};\n\tvar self = this;\n\t$tw.modules.forEachModuleOfType(\"parser\",function(title,module) {\n\t\tfor(var f in module) {\n\t\t\tif($tw.utils.hop(module,f)) {\n\t\t\t\t$tw.Wiki.parsers[f] = module[f]; // Store the parser class\n\t\t\t}\n\t\t}\n\t});\n};\n\n/*\nParse a block of text of a specified MIME type\n\ttype: content type of text to be parsed\n\ttext: text\n\toptions: see below\nOptions include:\n\tparseAsInline: if true, the text of the tiddler will be parsed as an inline run\n\t_canonical_uri: optional string of the canonical URI of this content\n*/\nexports.parseText = function(type,text,options) {\n\ttext = text || \"\";\n\toptions = options || {};\n\t// Select a parser\n\tvar Parser = $tw.Wiki.parsers[type];\n\tif(!Parser && $tw.utils.getFileExtensionInfo(type)) {\n\t\tParser = $tw.Wiki.parsers[$tw.utils.getFileExtensionInfo(type).type];\n\t}\n\tif(!Parser) {\n\t\tParser = $tw.Wiki.parsers[options.defaultType || \"text/vnd.tiddlywiki\"];\n\t}\n\tif(!Parser) {\n\t\treturn null;\n\t}\n\t// Return the parser instance\n\treturn new Parser(type,text,{\n\t\tparseAsInline: options.parseAsInline,\n\t\twiki: this,\n\t\t_canonical_uri: options._canonical_uri\n\t});\n};\n\n/*\nParse a tiddler according to its MIME type\n*/\nexports.parseTiddler = function(title,options) {\n\toptions = $tw.utils.extend({},options);\n\tvar cacheType = options.parseAsInline ? \"inlineParseTree\" : \"blockParseTree\",\n\t\ttiddler = this.getTiddler(title),\n\t\tself = this;\n\treturn tiddler ? this.getCacheForTiddler(title,cacheType,function() {\n\t\t\tif(tiddler.hasField(\"_canonical_uri\")) {\n\t\t\t\toptions._canonical_uri = tiddler.fields._canonical_uri;\n\t\t\t}\n\t\t\treturn self.parseText(tiddler.fields.type,tiddler.fields.text,options);\n\t\t}) : null;\n};\n\nexports.parseTextReference = function(title,field,index,options) {\n\tvar tiddler,text;\n\tif(options.subTiddler) {\n\t\ttiddler = this.getSubTiddler(title,options.subTiddler);\n\t} else {\n\t\ttiddler = this.getTiddler(title);\n\t\tif(field === \"text\" || (!field && !index)) {\n\t\t\tthis.getTiddlerText(title); // Force the tiddler to be lazily loaded\n\t\t\treturn this.parseTiddler(title,options);\n\t\t}\n\t}\n\tif(field === \"text\" || (!field && !index)) {\n\t\tif(tiddler && tiddler.fields) {\n\t\t\treturn this.parseText(tiddler.fields.type || \"text/vnd.tiddlywiki\",tiddler.fields.text,options);\t\t\t\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t} else if(field) {\n\t\tif(field === \"title\") {\n\t\t\ttext = title;\n\t\t} else {\n\t\t\tif(!tiddler || !tiddler.hasField(field)) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\ttext = tiddler.fields[field];\n\t\t}\n\t\treturn this.parseText(\"text/vnd.tiddlywiki\",text.toString(),options);\n\t} else if(index) {\n\t\tthis.getTiddlerText(title); // Force the tiddler to be lazily loaded\n\t\ttext = this.extractTiddlerDataItem(tiddler,index,undefined);\n\t\tif(text === undefined) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this.parseText(\"text/vnd.tiddlywiki\",text,options);\n\t}\n};\n\n/*\nMake a widget tree for a parse tree\nparser: parser object\noptions: see below\nOptions include:\ndocument: optional document to use\nvariables: hashmap of variables to set\nparentWidget: optional parent widget for the root node\n*/\nexports.makeWidget = function(parser,options) {\n\toptions = options || {};\n\tvar widgetNode = {\n\t\t\ttype: \"widget\",\n\t\t\tchildren: []\n\t\t},\n\t\tcurrWidgetNode = widgetNode;\n\t// Create set variable widgets for each variable\n\t$tw.utils.each(options.variables,function(value,name) {\n\t\tvar setVariableWidget = {\n\t\t\ttype: \"set\",\n\t\t\tattributes: {\n\t\t\t\tname: {type: \"string\", value: name},\n\t\t\t\tvalue: {type: \"string\", value: value}\n\t\t\t},\n\t\t\tchildren: []\n\t\t};\n\t\tcurrWidgetNode.children = [setVariableWidget];\n\t\tcurrWidgetNode = setVariableWidget;\n\t});\n\t// Add in the supplied parse tree nodes\n\tcurrWidgetNode.children = parser ? parser.tree : [];\n\t// Create the widget\n\treturn new widget.widget(widgetNode,{\n\t\twiki: this,\n\t\tdocument: options.document || $tw.fakeDocument,\n\t\tparentWidget: options.parentWidget\n\t});\n};\n\n/*\nMake a widget tree for transclusion\ntitle: target tiddler title\noptions: as for wiki.makeWidget() plus:\noptions.field: optional field to transclude (defaults to \"text\")\noptions.mode: transclusion mode \"inline\" or \"block\"\noptions.children: optional array of children for the transclude widget\noptions.importVariables: optional importvariables filter string for macros to be included\noptions.importPageMacros: optional boolean; if true, equivalent to passing \"[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]\" to options.importVariables\n*/\nexports.makeTranscludeWidget = function(title,options) {\n\toptions = options || {};\n\tvar parseTreeDiv = {tree: [{\n\t\t\ttype: \"element\",\n\t\t\ttag: \"div\",\n\t\t\tchildren: []}]},\n\t\tparseTreeImportVariables = {\n\t\t\ttype: \"importvariables\",\n\t\t\tattributes: {\n\t\t\t\tfilter: {\n\t\t\t\t\tname: \"filter\",\n\t\t\t\t\ttype: \"string\"\n\t\t\t\t}\n\t\t\t},\n\t\t\tisBlock: false,\n\t\t\tchildren: []},\n\t\tparseTreeTransclude = {\n\t\t\ttype: \"transclude\",\n\t\t\tattributes: {\n\t\t\t\ttiddler: {\n\t\t\t\t\tname: \"tiddler\",\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tvalue: title}},\n\t\t\tisBlock: !options.parseAsInline};\n\tif(options.importVariables || options.importPageMacros) {\n\t\tif(options.importVariables) {\n\t\t\tparseTreeImportVariables.attributes.filter.value = options.importVariables;\n\t\t} else if(options.importPageMacros) {\n\t\t\tparseTreeImportVariables.attributes.filter.value = \"[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]\";\n\t\t}\n\t\tparseTreeDiv.tree[0].children.push(parseTreeImportVariables);\n\t\tparseTreeImportVariables.children.push(parseTreeTransclude);\n\t} else {\n\t\tparseTreeDiv.tree[0].children.push(parseTreeTransclude);\n\t}\n\tif(options.field) {\n\t\tparseTreeTransclude.attributes.field = {type: \"string\", value: options.field};\n\t}\n\tif(options.mode) {\n\t\tparseTreeTransclude.attributes.mode = {type: \"string\", value: options.mode};\n\t}\n\tif(options.children) {\n\t\tparseTreeTransclude.children = options.children;\n\t}\n\treturn $tw.wiki.makeWidget(parseTreeDiv,options);\n};\n\n/*\nParse text in a specified format and render it into another format\n\toutputType: content type for the output\n\ttextType: content type of the input text\n\ttext: input text\n\toptions: see below\nOptions include:\nvariables: hashmap of variables to set\nparentWidget: optional parent widget for the root node\n*/\nexports.renderText = function(outputType,textType,text,options) {\n\toptions = options || {};\n\tvar parser = this.parseText(textType,text,options),\n\t\twidgetNode = this.makeWidget(parser,options);\n\tvar container = $tw.fakeDocument.createElement(\"div\");\n\twidgetNode.render(container,null);\n\treturn outputType === \"text/html\" ? container.innerHTML : container.textContent;\n};\n\n/*\nParse text from a tiddler and render it into another format\n\toutputType: content type for the output\n\ttitle: title of the tiddler to be rendered\n\toptions: see below\nOptions include:\nvariables: hashmap of variables to set\nparentWidget: optional parent widget for the root node\n*/\nexports.renderTiddler = function(outputType,title,options) {\n\toptions = options || {};\n\tvar parser = this.parseTiddler(title,options),\n\t\twidgetNode = this.makeWidget(parser,options);\n\tvar container = $tw.fakeDocument.createElement(\"div\");\n\twidgetNode.render(container,null);\n\treturn outputType === \"text/html\" ? container.innerHTML : (outputType === \"text/plain-formatted\" ? container.formattedTextContent : container.textContent);\n};\n\n/*\nReturn an array of tiddler titles that match a search string\n\ttext: The text string to search for\n\toptions: see below\nOptions available:\n\tsource: an iterator function for the source tiddlers, called source(iterator), where iterator is called as iterator(tiddler,title)\n\texclude: An array of tiddler titles to exclude from the search\n\tinvert: If true returns tiddlers that do not contain the specified string\n\tcaseSensitive: If true forces a case sensitive search\n\tliteral: If true, searches for literal string, rather than separate search terms\n\tfield: If specified, restricts the search to the specified field\n*/\nexports.search = function(text,options) {\n\toptions = options || {};\n\tvar self = this,\n\t\tt,\n\t\tinvert = !!options.invert;\n\t// Convert the search string into a regexp for each term\n\tvar terms, searchTermsRegExps,\n\t\tflags = options.caseSensitive ? \"\" : \"i\";\n\tif(options.literal) {\n\t\tif(text.length === 0) {\n\t\t\tsearchTermsRegExps = null;\n\t\t} else {\n\t\t\tsearchTermsRegExps = [new RegExp(\"(\" + $tw.utils.escapeRegExp(text) + \")\",flags)];\n\t\t}\n\t} else {\n\t\tterms = text.split(/ +/);\n\t\tif(terms.length === 1 && terms[0] === \"\") {\n\t\t\tsearchTermsRegExps = null;\n\t\t} else {\n\t\t\tsearchTermsRegExps = [];\n\t\t\tfor(t=0; t<terms.length; t++) {\n\t\t\t\tsearchTermsRegExps.push(new RegExp(\"(\" + $tw.utils.escapeRegExp(terms[t]) + \")\",flags));\n\t\t\t}\n\t\t}\n\t}\n\t// Function to check a given tiddler for the search term\n\tvar searchTiddler = function(title) {\n\t\tif(!searchTermsRegExps) {\n\t\t\treturn true;\n\t\t}\n\t\tvar tiddler = self.getTiddler(title);\n\t\tif(!tiddler) {\n\t\t\ttiddler = new $tw.Tiddler({title: title, text: \"\", type: \"text/vnd.tiddlywiki\"});\n\t\t}\n\t\tvar contentTypeInfo = $tw.config.contentTypeInfo[tiddler.fields.type] || $tw.config.contentTypeInfo[\"text/vnd.tiddlywiki\"],\n\t\t\tmatch;\n\t\tfor(var t=0; t<searchTermsRegExps.length; t++) {\n\t\t\tmatch = false;\n\t\t\tif(options.field) {\n\t\t\t\tmatch = searchTermsRegExps[t].test(tiddler.getFieldString(options.field));\n\t\t\t} else {\n\t\t\t\t// Search title, tags and body\n\t\t\t\tif(contentTypeInfo.encoding === \"utf8\") {\n\t\t\t\t\tmatch = match || searchTermsRegExps[t].test(tiddler.fields.text);\n\t\t\t\t}\n\t\t\t\tvar tags = tiddler.fields.tags ? tiddler.fields.tags.join(\"\\0\") : \"\";\n\t\t\t\tmatch = match || searchTermsRegExps[t].test(tags) || searchTermsRegExps[t].test(tiddler.fields.title);\n\t\t\t}\n\t\t\tif(!match) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t};\n\t// Loop through all the tiddlers doing the search\n\tvar results = [],\n\t\tsource = options.source || this.each;\n\tsource(function(tiddler,title) {\n\t\tif(searchTiddler(title) !== options.invert) {\n\t\t\tresults.push(title);\n\t\t}\n\t});\n\t// Remove any of the results we have to exclude\n\tif(options.exclude) {\n\t\tfor(t=0; t<options.exclude.length; t++) {\n\t\t\tvar p = results.indexOf(options.exclude[t]);\n\t\t\tif(p !== -1) {\n\t\t\t\tresults.splice(p,1);\n\t\t\t}\n\t\t}\n\t}\n\treturn results;\n};\n\n/*\nTrigger a load for a tiddler if it is skinny. Returns the text, or undefined if the tiddler is missing, null if the tiddler is being lazily loaded.\n*/\nexports.getTiddlerText = function(title,defaultText) {\n\tvar tiddler = this.getTiddler(title);\n\t// Return undefined if the tiddler isn't found\n\tif(!tiddler) {\n\t\treturn defaultText;\n\t}\n\tif(tiddler.fields.text !== undefined) {\n\t\t// Just return the text if we've got it\n\t\treturn tiddler.fields.text;\n\t} else {\n\t\t// Tell any listeners about the need to lazily load this tiddler\n\t\tthis.dispatchEvent(\"lazyLoad\",title);\n\t\t// Indicate that the text is being loaded\n\t\treturn null;\n\t}\n};\n\n/*\nCheck whether the text of a tiddler matches a given value. By default, the comparison is case insensitive, and any spaces at either end of the tiddler text is trimmed\n*/\nexports.checkTiddlerText = function(title,targetText,options) {\n\toptions = options || {};\n\tvar text = this.getTiddlerText(title,\"\");\n\tif(!options.noTrim) {\n\t\ttext = text.trim();\n\t}\n\tif(!options.caseSensitive) {\n\t\ttext = text.toLowerCase();\n\t\ttargetText = targetText.toLowerCase();\n\t}\n\treturn text === targetText;\n}\n\n/*\nRead an array of browser File objects, invoking callback(tiddlerFieldsArray) once they're all read\n*/\nexports.readFiles = function(files,callback) {\n\tvar result = [],\n\t\toutstanding = files.length;\n\tfor(var f=0; f<files.length; f++) {\n\t\tthis.readFile(files[f],function(tiddlerFieldsArray) {\n\t\t\tresult.push.apply(result,tiddlerFieldsArray);\n\t\t\tif(--outstanding === 0) {\n\t\t\t\tcallback(result);\n\t\t\t}\n\t\t});\n\t}\n\treturn files.length;\n};\n\n/*\nRead a browser File object, invoking callback(tiddlerFieldsArray) with an array of tiddler fields objects\n*/\nexports.readFile = function(file,callback) {\n\t// Get the type, falling back to the filename extension\n\tvar self = this,\n\t\ttype = file.type;\n\tif(type === \"\" || !type) {\n\t\tvar dotPos = file.name.lastIndexOf(\".\");\n\t\tif(dotPos !== -1) {\n\t\t\tvar fileExtensionInfo = $tw.utils.getFileExtensionInfo(file.name.substr(dotPos));\n\t\t\tif(fileExtensionInfo) {\n\t\t\t\ttype = fileExtensionInfo.type;\n\t\t\t}\n\t\t}\n\t}\n\t// Figure out if we're reading a binary file\n\tvar contentTypeInfo = $tw.config.contentTypeInfo[type],\n\t\tisBinary = contentTypeInfo ? contentTypeInfo.encoding === \"base64\" : false;\n\t// Log some debugging information\n\tif($tw.log.IMPORT) {\n\t\tconsole.log(\"Importing file '\" + file.name + \"', type: '\" + type + \"', isBinary: \" + isBinary);\n\t}\n\t// Create the FileReader\n\tvar reader = new FileReader();\n\t// Onload\n\treader.onload = function(event) {\n\t\tvar text = event.target.result,\n\t\t\ttiddlerFields = {title: file.name || \"Untitled\", type: type};\n\t\tif(isBinary) {\n\t\t\tvar commaPos = text.indexOf(\",\");\n\t\t\tif(commaPos !== -1) {\n\t\t\t\ttext = text.substr(commaPos + 1);\n\t\t\t}\n\t\t}\n\t\t// Check whether this is an encrypted TiddlyWiki file\n\t\tvar encryptedJson = $tw.utils.extractEncryptedStoreArea(text);\n\t\tif(encryptedJson) {\n\t\t\t// If so, attempt to decrypt it with the current password\n\t\t\t$tw.utils.decryptStoreAreaInteractive(encryptedJson,function(tiddlers) {\n\t\t\t\tcallback(tiddlers);\n\t\t\t});\n\t\t} else {\n\t\t\t// Otherwise, just try to deserialise any tiddlers in the file\n\t\t\tcallback(self.deserializeTiddlers(type,text,tiddlerFields));\n\t\t}\n\t};\n\t// Kick off the read\n\tif(isBinary) {\n\t\treader.readAsDataURL(file);\n\t} else {\n\t\treader.readAsText(file);\n\t}\n};\n\n/*\nFind any existing draft of a specified tiddler\n*/\nexports.findDraft = function(targetTitle) {\n\tvar draftTitle = undefined;\n\tthis.forEachTiddler({includeSystem: true},function(title,tiddler) {\n\t\tif(tiddler.fields[\"draft.title\"] && tiddler.fields[\"draft.of\"] === targetTitle) {\n\t\t\tdraftTitle = title;\n\t\t}\n\t});\n\treturn draftTitle;\n}\n\n/*\nCheck whether the specified draft tiddler has been modified.\nIf the original tiddler doesn't exist, create  a vanilla tiddler variable,\nto check if additional fields have been added.\n*/\nexports.isDraftModified = function(title) {\n\tvar tiddler = this.getTiddler(title);\n\tif(!tiddler.isDraft()) {\n\t\treturn false;\n\t}\n\tvar ignoredFields = [\"created\", \"modified\", \"title\", \"draft.title\", \"draft.of\"],\n\t\torigTiddler = this.getTiddler(tiddler.fields[\"draft.of\"]) || new $tw.Tiddler({text:\"\", tags:[]}),\n\t\ttitleModified = tiddler.fields[\"draft.title\"] !== tiddler.fields[\"draft.of\"];\n\treturn titleModified || !tiddler.isEqual(origTiddler,ignoredFields);\n};\n\n/*\nAdd a new record to the top of the history stack\ntitle: a title string or an array of title strings\nfromPageRect: page coordinates of the origin of the navigation\nhistoryTitle: title of history tiddler (defaults to $:/HistoryList)\n*/\nexports.addToHistory = function(title,fromPageRect,historyTitle) {\n\tvar story = new $tw.Story({wiki: this, historyTitle: historyTitle});\n\tstory.addToHistory(title,fromPageRect);\n};\n\n/*\nInvoke the available upgrader modules\ntitles: array of tiddler titles to be processed\ntiddlers: hashmap by title of tiddler fields of pending import tiddlers. These can be modified by the upgraders. An entry with no fields indicates a tiddler that was pending import has been suppressed. When entries are added to the pending import the tiddlers hashmap may have entries that are not present in the titles array\nReturns a hashmap of messages keyed by tiddler title.\n*/\nexports.invokeUpgraders = function(titles,tiddlers) {\n\t// Collect up the available upgrader modules\n\tvar self = this;\n\tif(!this.upgraderModules) {\n\t\tthis.upgraderModules = [];\n\t\t$tw.modules.forEachModuleOfType(\"upgrader\",function(title,module) {\n\t\t\tif(module.upgrade) {\n\t\t\t\tself.upgraderModules.push(module);\n\t\t\t}\n\t\t});\n\t}\n\t// Invoke each upgrader in turn\n\tvar messages = {};\n\tfor(var t=0; t<this.upgraderModules.length; t++) {\n\t\tvar upgrader = this.upgraderModules[t],\n\t\t\tupgraderMessages = upgrader.upgrade(this,titles,tiddlers);\n\t\t$tw.utils.extend(messages,upgraderMessages);\n\t}\n\treturn messages;\n};\n\n})();\n\n",
            "title": "$:/core/modules/wiki.js",
            "type": "application/javascript",
            "module-type": "wikimethod"
        },
        "$:/palettes/Blanca": {
            "title": "$:/palettes/Blanca",
            "name": "Blanca",
            "description": "A clean white palette to let you focus",
            "tags": "$:/tags/Palette",
            "type": "application/x-tiddler-dictionary",
            "text": "alert-background: #ffe476\nalert-border: #b99e2f\nalert-highlight: #881122\nalert-muted-foreground: #b99e2f\nbackground: #ffffff\nblockquote-bar: <<colour muted-foreground>>\nbutton-background:\nbutton-foreground:\nbutton-border:\ncode-background: #f7f7f9\ncode-border: #e1e1e8\ncode-foreground: #dd1144\ndirty-indicator: #ff0000\ndownload-background: #66cccc\ndownload-foreground: <<colour background>>\ndragger-background: <<colour foreground>>\ndragger-foreground: <<colour background>>\ndropdown-background: <<colour background>>\ndropdown-border: <<colour muted-foreground>>\ndropdown-tab-background-selected: #fff\ndropdown-tab-background: #ececec\ndropzone-background: rgba(0,200,0,0.7)\nexternal-link-background-hover: inherit\nexternal-link-background-visited: inherit\nexternal-link-background: inherit\nexternal-link-foreground-hover: inherit\nexternal-link-foreground-visited: #0000aa\nexternal-link-foreground: #0000ee\nforeground: #333333\nmessage-background: #ecf2ff\nmessage-border: #cfd6e6\nmessage-foreground: #547599\nmodal-backdrop: <<colour foreground>>\nmodal-background: <<colour background>>\nmodal-border: #999999\nmodal-footer-background: #f5f5f5\nmodal-footer-border: #dddddd\nmodal-header-border: #eeeeee\nmuted-foreground: #999999\nnotification-background: #ffffdd\nnotification-border: #999999\npage-background: #ffffff\npre-background: #f5f5f5\npre-border: #cccccc\nprimary: #7897f3\nsidebar-button-foreground: <<colour foreground>>\nsidebar-controls-foreground-hover: #000000\nsidebar-controls-foreground: #ccc\nsidebar-foreground-shadow: rgba(255,255,255, 0.8)\nsidebar-foreground: #acacac\nsidebar-muted-foreground-hover: #444444\nsidebar-muted-foreground: #c0c0c0\nsidebar-tab-background-selected: #ffffff\nsidebar-tab-background: <<colour tab-background>>\nsidebar-tab-border-selected: <<colour tab-border-selected>>\nsidebar-tab-border: <<colour tab-border>>\nsidebar-tab-divider: <<colour tab-divider>>\nsidebar-tab-foreground-selected: \nsidebar-tab-foreground: <<colour tab-foreground>>\nsidebar-tiddler-link-foreground-hover: #444444\nsidebar-tiddler-link-foreground: #7897f3\nsite-title-foreground: <<colour tiddler-title-foreground>>\nstatic-alert-foreground: #aaaaaa\ntab-background-selected: #ffffff\ntab-background: #eeeeee\ntab-border-selected: #cccccc\ntab-border: #cccccc\ntab-divider: #d8d8d8\ntab-foreground-selected: <<colour tab-foreground>>\ntab-foreground: #666666\ntable-border: #dddddd\ntable-footer-background: #a8a8a8\ntable-header-background: #f0f0f0\ntag-background: #ffeedd\ntag-foreground: #000\ntiddler-background: <<colour background>>\ntiddler-border: #eee\ntiddler-controls-foreground-hover: #888888\ntiddler-controls-foreground-selected: #444444\ntiddler-controls-foreground: #cccccc\ntiddler-editor-background: #f8f8f8\ntiddler-editor-border-image: #ffffff\ntiddler-editor-border: #cccccc\ntiddler-editor-fields-even: #e0e8e0\ntiddler-editor-fields-odd: #f0f4f0\ntiddler-info-background: #f8f8f8\ntiddler-info-border: #dddddd\ntiddler-info-tab-background: #f8f8f8\ntiddler-link-background: <<colour background>>\ntiddler-link-foreground: <<colour primary>>\ntiddler-subtitle-foreground: #c0c0c0\ntiddler-title-foreground: #ff9900\ntoolbar-new-button:\ntoolbar-options-button:\ntoolbar-save-button:\ntoolbar-info-button:\ntoolbar-edit-button:\ntoolbar-close-button:\ntoolbar-delete-button:\ntoolbar-cancel-button:\ntoolbar-done-button:\nuntagged-background: #999999\nvery-muted-foreground: #888888\n"
        },
        "$:/palettes/Blue": {
            "title": "$:/palettes/Blue",
            "name": "Blue",
            "description": "A blue theme",
            "tags": "$:/tags/Palette",
            "type": "application/x-tiddler-dictionary",
            "text": "alert-background: #ffe476\nalert-border: #b99e2f\nalert-highlight: #881122\nalert-muted-foreground: #b99e2f\nbackground: #fff\nblockquote-bar: <<colour muted-foreground>>\nbutton-background:\nbutton-foreground:\nbutton-border:\ncode-background: #f7f7f9\ncode-border: #e1e1e8\ncode-foreground: #dd1144\ndirty-indicator: #ff0000\ndownload-background: #34c734\ndownload-foreground: <<colour foreground>>\ndragger-background: <<colour foreground>>\ndragger-foreground: <<colour background>>\ndropdown-background: <<colour background>>\ndropdown-border: <<colour muted-foreground>>\ndropdown-tab-background-selected: #fff\ndropdown-tab-background: #ececec\ndropzone-background: rgba(0,200,0,0.7)\nexternal-link-background-hover: inherit\nexternal-link-background-visited: inherit\nexternal-link-background: inherit\nexternal-link-foreground-hover: inherit\nexternal-link-foreground-visited: #0000aa\nexternal-link-foreground: #0000ee\nforeground: #333353\nmessage-background: #ecf2ff\nmessage-border: #cfd6e6\nmessage-foreground: #547599\nmodal-backdrop: <<colour foreground>>\nmodal-background: <<colour background>>\nmodal-border: #999999\nmodal-footer-background: #f5f5f5\nmodal-footer-border: #dddddd\nmodal-header-border: #eeeeee\nmuted-foreground: #999999\nnotification-background: #ffffdd\nnotification-border: #999999\npage-background: #ddddff\npre-background: #f5f5f5\npre-border: #cccccc\nprimary: #5778d8\nsidebar-button-foreground: <<colour foreground>>\nsidebar-controls-foreground-hover: #000000\nsidebar-controls-foreground: #ffffff\nsidebar-foreground-shadow: rgba(255,255,255, 0.8)\nsidebar-foreground: #acacac\nsidebar-muted-foreground-hover: #444444\nsidebar-muted-foreground: #c0c0c0\nsidebar-tab-background-selected: <<colour page-background>>\nsidebar-tab-background: <<colour tab-background>>\nsidebar-tab-border-selected: <<colour tab-border-selected>>\nsidebar-tab-border: <<colour tab-border>>\nsidebar-tab-divider: <<colour tab-divider>>\nsidebar-tab-foreground-selected: \nsidebar-tab-foreground: <<colour tab-foreground>>\nsidebar-tiddler-link-foreground-hover: #444444\nsidebar-tiddler-link-foreground: #5959c0\nsite-title-foreground: <<colour tiddler-title-foreground>>\nstatic-alert-foreground: #aaaaaa\ntab-background-selected: <<colour background>>\ntab-background: #ccccdd\ntab-border-selected: #ccccdd\ntab-border: #cccccc\ntab-divider: #d8d8d8\ntab-foreground-selected: <<colour tab-foreground>>\ntab-foreground: #666666\ntable-border: #dddddd\ntable-footer-background: #a8a8a8\ntable-header-background: #f0f0f0\ntag-background: #eeeeff\ntag-foreground: #000\ntiddler-background: <<colour background>>\ntiddler-border: <<colour background>>\ntiddler-controls-foreground-hover: #666666\ntiddler-controls-foreground-selected: #444444\ntiddler-controls-foreground: #cccccc\ntiddler-editor-background: #f8f8f8\ntiddler-editor-border-image: #ffffff\ntiddler-editor-border: #cccccc\ntiddler-editor-fields-even: #e0e8e0\ntiddler-editor-fields-odd: #f0f4f0\ntiddler-info-background: #ffffff\ntiddler-info-border: #dddddd\ntiddler-info-tab-background: #ffffff\ntiddler-link-background: <<colour background>>\ntiddler-link-foreground: <<colour primary>>\ntiddler-subtitle-foreground: #c0c0c0\ntiddler-title-foreground: #5959c0\ntoolbar-new-button: #5eb95e\ntoolbar-options-button: rgb(128, 88, 165)\ntoolbar-save-button: #0e90d2\ntoolbar-info-button: #0e90d2\ntoolbar-edit-button: rgb(243, 123, 29)\ntoolbar-close-button: #dd514c\ntoolbar-delete-button: #dd514c\ntoolbar-cancel-button: rgb(243, 123, 29)\ntoolbar-done-button: #5eb95e\nuntagged-background: #999999\nvery-muted-foreground: #888888\n"
        },
        "$:/palettes/Muted": {
            "title": "$:/palettes/Muted",
            "name": "Muted",
            "description": "Bright tiddlers on a muted background",
            "tags": "$:/tags/Palette",
            "type": "application/x-tiddler-dictionary",
            "text": "alert-background: #ffe476\nalert-border: #b99e2f\nalert-highlight: #881122\nalert-muted-foreground: #b99e2f\nbackground: #ffffff\nblockquote-bar: <<colour muted-foreground>>\nbutton-background:\nbutton-foreground:\nbutton-border:\ncode-background: #f7f7f9\ncode-border: #e1e1e8\ncode-foreground: #dd1144\ndirty-indicator: #ff0000\ndownload-background: #34c734\ndownload-foreground: <<colour background>>\ndragger-background: <<colour foreground>>\ndragger-foreground: <<colour background>>\ndropdown-background: <<colour background>>\ndropdown-border: <<colour muted-foreground>>\ndropdown-tab-background-selected: #fff\ndropdown-tab-background: #ececec\ndropzone-background: rgba(0,200,0,0.7)\nexternal-link-background-hover: inherit\nexternal-link-background-visited: inherit\nexternal-link-background: inherit\nexternal-link-foreground-hover: inherit\nexternal-link-foreground-visited: #0000aa\nexternal-link-foreground: #0000ee\nforeground: #333333\nmessage-background: #ecf2ff\nmessage-border: #cfd6e6\nmessage-foreground: #547599\nmodal-backdrop: <<colour foreground>>\nmodal-background: <<colour background>>\nmodal-border: #999999\nmodal-footer-background: #f5f5f5\nmodal-footer-border: #dddddd\nmodal-header-border: #eeeeee\nmuted-foreground: #bbb\nnotification-background: #ffffdd\nnotification-border: #999999\npage-background: #6f6f70\npre-background: #f5f5f5\npre-border: #cccccc\nprimary: #29a6ee\nsidebar-button-foreground: <<colour foreground>>\nsidebar-controls-foreground-hover: #000000\nsidebar-controls-foreground: #c2c1c2\nsidebar-foreground-shadow: rgba(255,255,255,0)\nsidebar-foreground: #d3d2d4\nsidebar-muted-foreground-hover: #444444\nsidebar-muted-foreground: #c0c0c0\nsidebar-tab-background-selected: #6f6f70\nsidebar-tab-background: #666667\nsidebar-tab-border-selected: #999\nsidebar-tab-border: #515151\nsidebar-tab-divider: #999\nsidebar-tab-foreground-selected: \nsidebar-tab-foreground: #999\nsidebar-tiddler-link-foreground-hover: #444444\nsidebar-tiddler-link-foreground: #d1d0d2\nsite-title-foreground: <<colour tiddler-title-foreground>>\nstatic-alert-foreground: #aaaaaa\ntab-background-selected: #ffffff\ntab-background: #d8d8d8\ntab-border-selected: #d8d8d8\ntab-border: #cccccc\ntab-divider: #d8d8d8\ntab-foreground-selected: <<colour tab-foreground>>\ntab-foreground: #666666\ntable-border: #dddddd\ntable-footer-background: #a8a8a8\ntable-header-background: #f0f0f0\ntag-background: #d5ad34\ntag-foreground: #ffffff\ntiddler-background: <<colour background>>\ntiddler-border: <<colour background>>\ntiddler-controls-foreground-hover: #888888\ntiddler-controls-foreground-selected: #444444\ntiddler-controls-foreground: #cccccc\ntiddler-editor-background: #f8f8f8\ntiddler-editor-border-image: #ffffff\ntiddler-editor-border: #cccccc\ntiddler-editor-fields-even: #e0e8e0\ntiddler-editor-fields-odd: #f0f4f0\ntiddler-info-background: #f8f8f8\ntiddler-info-border: #dddddd\ntiddler-info-tab-background: #f8f8f8\ntiddler-link-background: <<colour background>>\ntiddler-link-foreground: <<colour primary>>\ntiddler-subtitle-foreground: #c0c0c0\ntiddler-title-foreground: #182955\ntoolbar-new-button: \ntoolbar-options-button: \ntoolbar-save-button: \ntoolbar-info-button: \ntoolbar-edit-button: \ntoolbar-close-button: \ntoolbar-delete-button: \ntoolbar-cancel-button: \ntoolbar-done-button: \nuntagged-background: #999999\nvery-muted-foreground: #888888\n"
        },
        "$:/palettes/ContrastLight": {
            "title": "$:/palettes/ContrastLight",
            "name": "Contrast (Light)",
            "description": "High contrast and unambiguous (light version)",
            "tags": "$:/tags/Palette",
            "type": "application/x-tiddler-dictionary",
            "text": "alert-background: #f00\nalert-border: <<colour background>>\nalert-highlight: <<colour foreground>>\nalert-muted-foreground: #800\nbackground: #fff\nblockquote-bar: <<colour muted-foreground>>\nbutton-background: <<colour background>>\nbutton-foreground: <<colour foreground>>\nbutton-border: <<colour foreground>>\ncode-background: <<colour background>>\ncode-border: <<colour foreground>>\ncode-foreground: <<colour foreground>>\ndirty-indicator: #f00\ndownload-background: #080\ndownload-foreground: <<colour background>>\ndragger-background: <<colour foreground>>\ndragger-foreground: <<colour background>>\ndropdown-background: <<colour background>>\ndropdown-border: <<colour muted-foreground>>\ndropdown-tab-background-selected: <<colour foreground>>\ndropdown-tab-background: <<colour foreground>>\ndropzone-background: rgba(0,200,0,0.7)\nexternal-link-background-hover: inherit\nexternal-link-background-visited: inherit\nexternal-link-background: inherit\nexternal-link-foreground-hover: inherit\nexternal-link-foreground-visited: #00a\nexternal-link-foreground: #00e\nforeground: #000\nmessage-background: <<colour foreground>>\nmessage-border: <<colour background>>\nmessage-foreground: <<colour background>>\nmodal-backdrop: <<colour foreground>>\nmodal-background: <<colour background>>\nmodal-border: <<colour foreground>>\nmodal-footer-background: <<colour background>>\nmodal-footer-border: <<colour foreground>>\nmodal-header-border: <<colour foreground>>\nmuted-foreground: <<colour foreground>>\nnotification-background: <<colour background>>\nnotification-border: <<colour foreground>>\npage-background: <<colour background>>\npre-background: <<colour background>>\npre-border: <<colour foreground>>\nprimary: #00f\nsidebar-button-foreground: <<colour foreground>>\nsidebar-controls-foreground-hover: <<colour background>>\nsidebar-controls-foreground: <<colour foreground>>\nsidebar-foreground-shadow: rgba(0,0,0, 0)\nsidebar-foreground: <<colour foreground>>\nsidebar-muted-foreground-hover: #444444\nsidebar-muted-foreground: <<colour foreground>>\nsidebar-tab-background-selected: <<colour background>>\nsidebar-tab-background: <<colour tab-background>>\nsidebar-tab-border-selected: <<colour tab-border-selected>>\nsidebar-tab-border: <<colour tab-border>>\nsidebar-tab-divider: <<colour tab-divider>>\nsidebar-tab-foreground-selected: <<colour foreground>>\nsidebar-tab-foreground: <<colour tab-foreground>>\nsidebar-tiddler-link-foreground-hover: <<colour foreground>>\nsidebar-tiddler-link-foreground: <<colour primary>>\nsite-title-foreground: <<colour tiddler-title-foreground>>\nstatic-alert-foreground: #aaaaaa\ntab-background-selected: <<colour background>>\ntab-background: <<colour foreground>>\ntab-border-selected: <<colour foreground>>\ntab-border: <<colour foreground>>\ntab-divider: <<colour foreground>>\ntab-foreground-selected: <<colour foreground>>\ntab-foreground: <<colour background>>\ntable-border: #dddddd\ntable-footer-background: #a8a8a8\ntable-header-background: #f0f0f0\ntag-background: #000\ntag-foreground: #fff\ntiddler-background: <<colour background>>\ntiddler-border: <<colour foreground>>\ntiddler-controls-foreground-hover: #ddd\ntiddler-controls-foreground-selected: #fdd\ntiddler-controls-foreground: <<colour foreground>>\ntiddler-editor-background: <<colour background>>\ntiddler-editor-border-image: <<colour foreground>>\ntiddler-editor-border: #cccccc\ntiddler-editor-fields-even: <<colour background>>\ntiddler-editor-fields-odd: <<colour background>>\ntiddler-info-background: <<colour background>>\ntiddler-info-border: <<colour foreground>>\ntiddler-info-tab-background: <<colour background>>\ntiddler-link-background: <<colour background>>\ntiddler-link-foreground: <<colour primary>>\ntiddler-subtitle-foreground: <<colour foreground>>\ntiddler-title-foreground: <<colour foreground>>\ntoolbar-new-button: \ntoolbar-options-button: \ntoolbar-save-button: \ntoolbar-info-button: \ntoolbar-edit-button: \ntoolbar-close-button: \ntoolbar-delete-button: \ntoolbar-cancel-button: \ntoolbar-done-button: \nuntagged-background: <<colour foreground>>\nvery-muted-foreground: #888888\n"
        },
        "$:/palettes/ContrastDark": {
            "title": "$:/palettes/ContrastDark",
            "name": "Contrast (Dark)",
            "description": "High contrast and unambiguous (dark version)",
            "tags": "$:/tags/Palette",
            "type": "application/x-tiddler-dictionary",
            "text": "alert-background: #f00\nalert-border: <<colour background>>\nalert-highlight: <<colour foreground>>\nalert-muted-foreground: #800\nbackground: #000\nblockquote-bar: <<colour muted-foreground>>\nbutton-background: <<colour background>>\nbutton-foreground: <<colour foreground>>\nbutton-border: <<colour foreground>>\ncode-background: <<colour background>>\ncode-border: <<colour foreground>>\ncode-foreground: <<colour foreground>>\ndirty-indicator: #f00\ndownload-background: #080\ndownload-foreground: <<colour background>>\ndragger-background: <<colour foreground>>\ndragger-foreground: <<colour background>>\ndropdown-background: <<colour background>>\ndropdown-border: <<colour muted-foreground>>\ndropdown-tab-background-selected: <<colour foreground>>\ndropdown-tab-background: <<colour foreground>>\ndropzone-background: rgba(0,200,0,0.7)\nexternal-link-background-hover: inherit\nexternal-link-background-visited: inherit\nexternal-link-background: inherit\nexternal-link-foreground-hover: inherit\nexternal-link-foreground-visited: #00a\nexternal-link-foreground: #00e\nforeground: #fff\nmessage-background: <<colour foreground>>\nmessage-border: <<colour background>>\nmessage-foreground: <<colour background>>\nmodal-backdrop: <<colour foreground>>\nmodal-background: <<colour background>>\nmodal-border: <<colour foreground>>\nmodal-footer-background: <<colour background>>\nmodal-footer-border: <<colour foreground>>\nmodal-header-border: <<colour foreground>>\nmuted-foreground: <<colour foreground>>\nnotification-background: <<colour background>>\nnotification-border: <<colour foreground>>\npage-background: <<colour background>>\npre-background: <<colour background>>\npre-border: <<colour foreground>>\nprimary: #00f\nsidebar-button-foreground: <<colour foreground>>\nsidebar-controls-foreground-hover: <<colour background>>\nsidebar-controls-foreground: <<colour foreground>>\nsidebar-foreground-shadow: rgba(0,0,0, 0)\nsidebar-foreground: <<colour foreground>>\nsidebar-muted-foreground-hover: #444444\nsidebar-muted-foreground: <<colour foreground>>\nsidebar-tab-background-selected: <<colour background>>\nsidebar-tab-background: <<colour tab-background>>\nsidebar-tab-border-selected: <<colour tab-border-selected>>\nsidebar-tab-border: <<colour tab-border>>\nsidebar-tab-divider: <<colour tab-divider>>\nsidebar-tab-foreground-selected: <<colour foreground>>\nsidebar-tab-foreground: <<colour tab-foreground>>\nsidebar-tiddler-link-foreground-hover: <<colour foreground>>\nsidebar-tiddler-link-foreground: <<colour primary>>\nsite-title-foreground: <<colour tiddler-title-foreground>>\nstatic-alert-foreground: #aaaaaa\ntab-background-selected: <<colour background>>\ntab-background: <<colour foreground>>\ntab-border-selected: <<colour foreground>>\ntab-border: <<colour foreground>>\ntab-divider: <<colour foreground>>\ntab-foreground-selected: <<colour foreground>>\ntab-foreground: <<colour background>>\ntable-border: #dddddd\ntable-footer-background: #a8a8a8\ntable-header-background: #f0f0f0\ntag-background: #fff\ntag-foreground: #000\ntiddler-background: <<colour background>>\ntiddler-border: <<colour foreground>>\ntiddler-controls-foreground-hover: #ddd\ntiddler-controls-foreground-selected: #fdd\ntiddler-controls-foreground: <<colour foreground>>\ntiddler-editor-background: <<colour background>>\ntiddler-editor-border-image: <<colour foreground>>\ntiddler-editor-border: #cccccc\ntiddler-editor-fields-even: <<colour background>>\ntiddler-editor-fields-odd: <<colour background>>\ntiddler-info-background: <<colour background>>\ntiddler-info-border: <<colour foreground>>\ntiddler-info-tab-background: <<colour background>>\ntiddler-link-background: <<colour background>>\ntiddler-link-foreground: <<colour primary>>\ntiddler-subtitle-foreground: <<colour foreground>>\ntiddler-title-foreground: <<colour foreground>>\ntoolbar-new-button: \ntoolbar-options-button: \ntoolbar-save-button: \ntoolbar-info-button: \ntoolbar-edit-button: \ntoolbar-close-button: \ntoolbar-delete-button: \ntoolbar-cancel-button: \ntoolbar-done-button: \nuntagged-background: <<colour foreground>>\nvery-muted-foreground: #888888\n"
        },
        "$:/palettes/DarkPhotos": {
            "created": "20150402111612188",
            "description": "Good with dark photo backgrounds",
            "modified": "20150402112344080",
            "name": "DarkPhotos",
            "tags": "$:/tags/Palette",
            "title": "$:/palettes/DarkPhotos",
            "type": "application/x-tiddler-dictionary",
            "text": "alert-background: #ffe476\nalert-border: #b99e2f\nalert-highlight: #881122\nalert-muted-foreground: #b99e2f\nbackground: #ffffff\nblockquote-bar: <<colour muted-foreground>>\nbutton-background: \nbutton-foreground: \nbutton-border: \ncode-background: #f7f7f9\ncode-border: #e1e1e8\ncode-foreground: #dd1144\ndirty-indicator: #ff0000\ndownload-background: #34c734\ndownload-foreground: <<colour background>>\ndragger-background: <<colour foreground>>\ndragger-foreground: <<colour background>>\ndropdown-background: <<colour background>>\ndropdown-border: <<colour muted-foreground>>\ndropdown-tab-background-selected: #fff\ndropdown-tab-background: #ececec\ndropzone-background: rgba(0,200,0,0.7)\nexternal-link-background-hover: inherit\nexternal-link-background-visited: inherit\nexternal-link-background: inherit\nexternal-link-foreground-hover: inherit\nexternal-link-foreground-visited: #0000aa\nexternal-link-foreground: #0000ee\nforeground: #333333\nmessage-background: #ecf2ff\nmessage-border: #cfd6e6\nmessage-foreground: #547599\nmodal-backdrop: <<colour foreground>>\nmodal-background: <<colour background>>\nmodal-border: #999999\nmodal-footer-background: #f5f5f5\nmodal-footer-border: #dddddd\nmodal-header-border: #eeeeee\nmuted-foreground: #ddd\nnotification-background: #ffffdd\nnotification-border: #999999\npage-background: #336438\npre-background: #f5f5f5\npre-border: #cccccc\nprimary: #5778d8\nsidebar-button-foreground: <<colour foreground>>\nsidebar-controls-foreground-hover: #ccf\nsidebar-controls-foreground: #fff\nsidebar-foreground-shadow: rgba(0,0,0, 0.5)\nsidebar-foreground: #fff\nsidebar-muted-foreground-hover: #444444\nsidebar-muted-foreground: #eee\nsidebar-tab-background-selected: rgba(255,255,255, 0.8)\nsidebar-tab-background: rgba(255,255,255, 0.4)\nsidebar-tab-border-selected: <<colour tab-border-selected>>\nsidebar-tab-border: <<colour tab-border>>\nsidebar-tab-divider: rgba(255,255,255, 0.2)\nsidebar-tab-foreground-selected: \nsidebar-tab-foreground: <<colour tab-foreground>>\nsidebar-tiddler-link-foreground-hover: #aaf\nsidebar-tiddler-link-foreground: #ddf\nsite-title-foreground: #fff\nstatic-alert-foreground: #aaaaaa\ntab-background-selected: #ffffff\ntab-background: #d8d8d8\ntab-border-selected: #d8d8d8\ntab-border: #cccccc\ntab-divider: #d8d8d8\ntab-foreground-selected: <<colour tab-foreground>>\ntab-foreground: #666666\ntable-border: #dddddd\ntable-footer-background: #a8a8a8\ntable-header-background: #f0f0f0\ntag-background: #ec6\ntag-foreground: #ffffff\ntiddler-background: <<colour background>>\ntiddler-border: <<colour background>>\ntiddler-controls-foreground-hover: #888888\ntiddler-controls-foreground-selected: #444444\ntiddler-controls-foreground: #cccccc\ntiddler-editor-background: #f8f8f8\ntiddler-editor-border-image: #ffffff\ntiddler-editor-border: #cccccc\ntiddler-editor-fields-even: #e0e8e0\ntiddler-editor-fields-odd: #f0f4f0\ntiddler-info-background: #f8f8f8\ntiddler-info-border: #dddddd\ntiddler-info-tab-background: #f8f8f8\ntiddler-link-background: <<colour background>>\ntiddler-link-foreground: <<colour primary>>\ntiddler-subtitle-foreground: #c0c0c0\ntiddler-title-foreground: #182955\ntoolbar-new-button: \ntoolbar-options-button: \ntoolbar-save-button: \ntoolbar-info-button: \ntoolbar-edit-button: \ntoolbar-close-button: \ntoolbar-delete-button: \ntoolbar-cancel-button: \ntoolbar-done-button: \nuntagged-background: #999999\nvery-muted-foreground: #888888\n"
        },
        "$:/palettes/Rocker": {
            "title": "$:/palettes/Rocker",
            "name": "Rocker",
            "description": "A dark theme",
            "tags": "$:/tags/Palette",
            "type": "application/x-tiddler-dictionary",
            "text": "alert-background: #ffe476\nalert-border: #b99e2f\nalert-highlight: #881122\nalert-muted-foreground: #b99e2f\nbackground: #ffffff\nblockquote-bar: <<colour muted-foreground>>\nbutton-background:\nbutton-foreground:\nbutton-border:\ncode-background: #f7f7f9\ncode-border: #e1e1e8\ncode-foreground: #dd1144\ndirty-indicator: #ff0000\ndownload-background: #34c734\ndownload-foreground: <<colour background>>\ndragger-background: <<colour foreground>>\ndragger-foreground: <<colour background>>\ndropdown-background: <<colour background>>\ndropdown-border: <<colour muted-foreground>>\ndropdown-tab-background-selected: #fff\ndropdown-tab-background: #ececec\ndropzone-background: rgba(0,200,0,0.7)\nexternal-link-background-hover: inherit\nexternal-link-background-visited: inherit\nexternal-link-background: inherit\nexternal-link-foreground-hover: inherit\nexternal-link-foreground-visited: #0000aa\nexternal-link-foreground: #0000ee\nforeground: #333333\nmessage-background: #ecf2ff\nmessage-border: #cfd6e6\nmessage-foreground: #547599\nmodal-backdrop: <<colour foreground>>\nmodal-background: <<colour background>>\nmodal-border: #999999\nmodal-footer-background: #f5f5f5\nmodal-footer-border: #dddddd\nmodal-header-border: #eeeeee\nmuted-foreground: #999999\nnotification-background: #ffffdd\nnotification-border: #999999\npage-background: #000\npre-background: #f5f5f5\npre-border: #cccccc\nprimary: #cc0000\nsidebar-button-foreground: <<colour foreground>>\nsidebar-controls-foreground-hover: #000000\nsidebar-controls-foreground: #ffffff\nsidebar-foreground-shadow: rgba(255,255,255, 0.0)\nsidebar-foreground: #acacac\nsidebar-muted-foreground-hover: #444444\nsidebar-muted-foreground: #c0c0c0\nsidebar-tab-background-selected: #000\nsidebar-tab-background: <<colour tab-background>>\nsidebar-tab-border-selected: <<colour tab-border-selected>>\nsidebar-tab-border: <<colour tab-border>>\nsidebar-tab-divider: <<colour tab-divider>>\nsidebar-tab-foreground-selected: \nsidebar-tab-foreground: <<colour tab-foreground>>\nsidebar-tiddler-link-foreground-hover: #ffbb99\nsidebar-tiddler-link-foreground: #cc0000\nsite-title-foreground: <<colour tiddler-title-foreground>>\nstatic-alert-foreground: #aaaaaa\ntab-background-selected: #ffffff\ntab-background: #d8d8d8\ntab-border-selected: #d8d8d8\ntab-border: #cccccc\ntab-divider: #d8d8d8\ntab-foreground-selected: <<colour tab-foreground>>\ntab-foreground: #666666\ntable-border: #dddddd\ntable-footer-background: #a8a8a8\ntable-header-background: #f0f0f0\ntag-background: #ffbb99\ntag-foreground: #000\ntiddler-background: <<colour background>>\ntiddler-border: <<colour background>>\ntiddler-controls-foreground-hover: #888888\ntiddler-controls-foreground-selected: #444444\ntiddler-controls-foreground: #cccccc\ntiddler-editor-background: #f8f8f8\ntiddler-editor-border-image: #ffffff\ntiddler-editor-border: #cccccc\ntiddler-editor-fields-even: #e0e8e0\ntiddler-editor-fields-odd: #f0f4f0\ntiddler-info-background: #f8f8f8\ntiddler-info-border: #dddddd\ntiddler-info-tab-background: #f8f8f8\ntiddler-link-background: <<colour background>>\ntiddler-link-foreground: <<colour primary>>\ntiddler-subtitle-foreground: #c0c0c0\ntiddler-title-foreground: #cc0000\ntoolbar-new-button:\ntoolbar-options-button:\ntoolbar-save-button:\ntoolbar-info-button:\ntoolbar-edit-button:\ntoolbar-close-button:\ntoolbar-delete-button:\ntoolbar-cancel-button:\ntoolbar-done-button:\nuntagged-background: #999999\nvery-muted-foreground: #888888\n"
        },
        "$:/palettes/SolarFlare": {
            "title": "$:/palettes/SolarFlare",
            "name": "Solar Flare",
            "description": "Warm, relaxing earth colours",
            "tags": "$:/tags/Palette",
            "type": "application/x-tiddler-dictionary",
            "text": ": Background Tones\n\nbase03: #002b36\nbase02: #073642\n\n: Content Tones\n\nbase01: #586e75\nbase00: #657b83\nbase0: #839496\nbase1: #93a1a1\n\n: Background Tones\n\nbase2: #eee8d5\nbase3: #fdf6e3\n\n: Accent Colors\n\nyellow: #b58900\norange: #cb4b16\nred: #dc322f\nmagenta: #d33682\nviolet: #6c71c4\nblue: #268bd2\ncyan: #2aa198\ngreen: #859900\n\n: Additional Tones (RA)\n\nbase10: #c0c4bb\nviolet-muted: #7c81b0\nblue-muted: #4e7baa\n\nyellow-hot: #ffcc44\norange-hot: #eb6d20\nred-hot: #ff2222\nblue-hot: #2298ee\ngreen-hot: #98ee22\n\n: Palette\n\n: Do not use colour macro for background and foreground\nbackground: #fdf6e3\n    download-foreground: <<colour background>>\n    dragger-foreground: <<colour background>>\n    dropdown-background: <<colour background>>\n    modal-background: <<colour background>>\n    sidebar-foreground-shadow: <<colour background>>\n    tiddler-background: <<colour background>>\n    tiddler-border: <<colour background>>\n    tiddler-link-background: <<colour background>>\n    tab-background-selected: <<colour background>>\n        dropdown-tab-background-selected: <<colour tab-background-selected>>\nforeground: #657b83\n    dragger-background: <<colour foreground>>\n    tab-foreground: <<colour foreground>>\n        tab-foreground-selected: <<colour tab-foreground>>\n            sidebar-tab-foreground-selected: <<colour tab-foreground-selected>>\n        sidebar-tab-foreground: <<colour tab-foreground>>\n    sidebar-button-foreground: <<colour foreground>>\n    sidebar-controls-foreground: <<colour foreground>>\n    sidebar-foreground: <<colour foreground>>\n: base03\n: base02\n: base01\n    alert-muted-foreground: <<colour base01>>\n: base00\n    code-foreground: <<colour base00>>\n    message-foreground: <<colour base00>>\n    tag-foreground: <<colour base00>>\n: base0\n    sidebar-tiddler-link-foreground: <<colour base0>>\n: base1\n    muted-foreground: <<colour base1>>\n        blockquote-bar: <<colour muted-foreground>>\n        dropdown-border: <<colour muted-foreground>>\n        sidebar-muted-foreground: <<colour muted-foreground>>\n        tiddler-title-foreground: <<colour muted-foreground>>\n            site-title-foreground: <<colour tiddler-title-foreground>>\n: base2\n    modal-footer-background: <<colour base2>>\n    page-background: <<colour base2>>\n        modal-backdrop: <<colour page-background>>\n        notification-background: <<colour page-background>>\n        code-background: <<colour page-background>>\n            code-border: <<colour code-background>>\n        pre-background: <<colour page-background>>\n            pre-border: <<colour pre-background>>\n        sidebar-tab-background-selected: <<colour page-background>>\n    table-header-background: <<colour base2>>\n    tag-background: <<colour base2>>\n    tiddler-editor-background: <<colour base2>>\n    tiddler-info-background: <<colour base2>>\n    tiddler-info-tab-background: <<colour base2>>\n    tab-background: <<colour base2>>\n        dropdown-tab-background: <<colour tab-background>>\n: base3\n    alert-background: <<colour base3>>\n    message-background: <<colour base3>>\n: yellow\n: orange\n: red\n: magenta\n    alert-highlight: <<colour magenta>>\n: violet\n    external-link-foreground: <<colour violet>>\n: blue\n: cyan\n: green\n: base10\n    tiddler-controls-foreground: <<colour base10>>\n: violet-muted\n    external-link-foreground-visited: <<colour violet-muted>>\n: blue-muted\n    primary: <<colour blue-muted>>\n        download-background: <<colour primary>>\n        tiddler-link-foreground: <<colour primary>>\n\nalert-border: #b99e2f\ndirty-indicator: #ff0000\ndropzone-background: rgba(0,200,0,0.7)\nexternal-link-background-hover: inherit\nexternal-link-background-visited: inherit\nexternal-link-background: inherit\nexternal-link-foreground-hover: inherit\nmessage-border: #cfd6e6\nmodal-border: #999999\nsidebar-controls-foreground-hover:\nsidebar-muted-foreground-hover:\nsidebar-tab-background: #ded8c5\nsidebar-tiddler-link-foreground-hover:\nstatic-alert-foreground: #aaaaaa\ntab-border: #cccccc\n    modal-footer-border: <<colour tab-border>>\n    modal-header-border: <<colour tab-border>>\n    notification-border: <<colour tab-border>>\n    sidebar-tab-border: <<colour tab-border>>\n    tab-border-selected: <<colour tab-border>>\n        sidebar-tab-border-selected: <<colour tab-border-selected>>\ntab-divider: #d8d8d8\n    sidebar-tab-divider: <<colour tab-divider>>\ntable-border: #dddddd\ntable-footer-background: #a8a8a8\ntiddler-controls-foreground-hover: #888888\ntiddler-controls-foreground-selected: #444444\ntiddler-editor-border-image: #ffffff\ntiddler-editor-border: #cccccc\ntiddler-editor-fields-even: #e0e8e0\ntiddler-editor-fields-odd: #f0f4f0\ntiddler-info-border: #dddddd\ntiddler-subtitle-foreground: #c0c0c0\ntoolbar-new-button:\ntoolbar-options-button:\ntoolbar-save-button:\ntoolbar-info-button:\ntoolbar-edit-button:\ntoolbar-close-button:\ntoolbar-delete-button:\ntoolbar-cancel-button:\ntoolbar-done-button:\nuntagged-background: #999999\nvery-muted-foreground: #888888\n"
        },
        "$:/palettes/Vanilla": {
            "title": "$:/palettes/Vanilla",
            "name": "Vanilla",
            "description": "Pale and unobtrusive",
            "tags": "$:/tags/Palette",
            "type": "application/x-tiddler-dictionary",
            "text": "alert-background: #ffe476\nalert-border: #b99e2f\nalert-highlight: #881122\nalert-muted-foreground: #b99e2f\nbackground: #ffffff\nblockquote-bar: <<colour muted-foreground>>\nbutton-background:\nbutton-foreground:\nbutton-border:\ncode-background: #f7f7f9\ncode-border: #e1e1e8\ncode-foreground: #dd1144\ndirty-indicator: #ff0000\ndownload-background: #34c734\ndownload-foreground: <<colour background>>\ndragger-background: <<colour foreground>>\ndragger-foreground: <<colour background>>\ndropdown-background: <<colour background>>\ndropdown-border: <<colour muted-foreground>>\ndropdown-tab-background-selected: #fff\ndropdown-tab-background: #ececec\ndropzone-background: rgba(0,200,0,0.7)\nexternal-link-background-hover: inherit\nexternal-link-background-visited: inherit\nexternal-link-background: inherit\nexternal-link-foreground-hover: inherit\nexternal-link-foreground-visited: #0000aa\nexternal-link-foreground: #0000ee\nforeground: #333333\nmessage-background: #ecf2ff\nmessage-border: #cfd6e6\nmessage-foreground: #547599\nmodal-backdrop: <<colour foreground>>\nmodal-background: <<colour background>>\nmodal-border: #999999\nmodal-footer-background: #f5f5f5\nmodal-footer-border: #dddddd\nmodal-header-border: #eeeeee\nmuted-foreground: #bbb\nnotification-background: #ffffdd\nnotification-border: #999999\npage-background: #f4f4f4\npre-background: #f5f5f5\npre-border: #cccccc\nprimary: #5778d8\nsidebar-button-foreground: <<colour foreground>>\nsidebar-controls-foreground-hover: #000000\nsidebar-controls-foreground: #aaaaaa\nsidebar-foreground-shadow: rgba(255,255,255, 0.8)\nsidebar-foreground: #acacac\nsidebar-muted-foreground-hover: #444444\nsidebar-muted-foreground: #c0c0c0\nsidebar-tab-background-selected: #f4f4f4\nsidebar-tab-background: #e0e0e0\nsidebar-tab-border-selected: <<colour tab-border-selected>>\nsidebar-tab-border: <<colour tab-border>>\nsidebar-tab-divider: #e4e4e4\nsidebar-tab-foreground-selected:\nsidebar-tab-foreground: <<colour tab-foreground>>\nsidebar-tiddler-link-foreground-hover: #444444\nsidebar-tiddler-link-foreground: #999999\nsite-title-foreground: <<colour tiddler-title-foreground>>\nstatic-alert-foreground: #aaaaaa\ntab-background-selected: #ffffff\ntab-background: #d8d8d8\ntab-border-selected: #d8d8d8\ntab-border: #cccccc\ntab-divider: #d8d8d8\ntab-foreground-selected: <<colour tab-foreground>>\ntab-foreground: #666666\ntable-border: #dddddd\ntable-footer-background: #a8a8a8\ntable-header-background: #f0f0f0\ntag-background: #ec6\ntag-foreground: #ffffff\ntiddler-background: <<colour background>>\ntiddler-border: <<colour background>>\ntiddler-controls-foreground-hover: #888888\ntiddler-controls-foreground-selected: #444444\ntiddler-controls-foreground: #cccccc\ntiddler-editor-background: #f8f8f8\ntiddler-editor-border-image: #ffffff\ntiddler-editor-border: #cccccc\ntiddler-editor-fields-even: #e0e8e0\ntiddler-editor-fields-odd: #f0f4f0\ntiddler-info-background: #f8f8f8\ntiddler-info-border: #dddddd\ntiddler-info-tab-background: #f8f8f8\ntiddler-link-background: <<colour background>>\ntiddler-link-foreground: <<colour primary>>\ntiddler-subtitle-foreground: #c0c0c0\ntiddler-title-foreground: #182955\ntoolbar-new-button:\ntoolbar-options-button:\ntoolbar-save-button:\ntoolbar-info-button:\ntoolbar-edit-button:\ntoolbar-close-button:\ntoolbar-delete-button:\ntoolbar-cancel-button:\ntoolbar-done-button:\nuntagged-background: #999999\nvery-muted-foreground: #888888\n"
        },
        "$:/core/readme": {
            "title": "$:/core/readme",
            "text": "This plugin contains TiddlyWiki's core components, comprising:\n\n* JavaScript code modules\n* Icons\n* Templates needed to create TiddlyWiki's user interface\n* British English (''en-GB'') translations of the localisable strings used by the core\n"
        },
        "$:/library/sjcl.js/license": {
            "title": "$:/library/sjcl.js/license",
            "type": "text/plain",
            "text": "SJCL is open. You can use, modify and redistribute it under a BSD\nlicense or under the GNU GPL, version 2.0.\n\n---------------------------------------------------------------------\n\nhttp://opensource.org/licenses/BSD-2-Clause\n\nCopyright (c) 2009-2015, Emily Stark, Mike Hamburg and Dan Boneh at\nStanford University. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n1. Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright\nnotice, this list of conditions and the following disclaimer in the\ndocumentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\nIS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\nTO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\nPARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nHOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\nTO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n---------------------------------------------------------------------\n\nhttp://opensource.org/licenses/GPL-2.0\n\nThe Stanford Javascript Crypto Library (hosted here on GitHub) is a\nproject by the Stanford Computer Security Lab to build a secure,\npowerful, fast, small, easy-to-use, cross-browser library for\ncryptography in Javascript.\n\nCopyright (c) 2009-2015, Emily Stark, Mike Hamburg and Dan Boneh at\nStanford University.\n\nThis program is free software; you can redistribute it and/or modify it\nunder the terms of the GNU General Public License as published by the\nFree Software Foundation; either version 2 of the License, or (at your\noption) any later version.\n\nThis program is distributed in the hope that it will be useful, but\nWITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General\nPublic License for more details.\n\nYou should have received a copy of the GNU General Public License along\nwith this program; if not, write to the Free Software Foundation, Inc.,\n59 Temple Place, Suite 330, Boston, MA 02111-1307 USA"
        },
        "$:/core/templates/MOTW.html": {
            "title": "$:/core/templates/MOTW.html",
            "text": "\\rules only filteredtranscludeinline transcludeinline entity\n<!-- The following comment is called a MOTW comment and is necessary for the TiddlyIE Internet Explorer extension -->\n<!-- saved from url=(0021)http://tiddlywiki.com -->&#13;&#10;"
        },
        "$:/core/templates/alltiddlers.template.html": {
            "title": "$:/core/templates/alltiddlers.template.html",
            "type": "text/vnd.tiddlywiki-html",
            "text": "<!-- This template is provided for backwards compatibility with older versions of TiddlyWiki -->\n\n<$set name=\"exportFilter\" value=\"[!is[system]sort[title]]\">\n\n{{$:/core/templates/exporters/StaticRiver}}\n\n</$set>\n"
        },
        "$:/core/templates/canonical-uri-external-image": {
            "title": "$:/core/templates/canonical-uri-external-image",
            "text": "<!--\n\nThis template is used to assign the ''_canonical_uri'' field to external images.\n\nChange the `./images/` part to a different base URI. The URI can be relative or absolute.\n\n-->\n./images/<$view field=\"title\" format=\"doubleurlencoded\"/>"
        },
        "$:/core/templates/canonical-uri-external-text": {
            "title": "$:/core/templates/canonical-uri-external-text",
            "text": "<!--\n\nThis template is used to assign the ''_canonical_uri'' field to external text files.\n\nChange the `./text/` part to a different base URI. The URI can be relative or absolute.\n\n-->\n./text/<$view field=\"title\" format=\"doubleurlencoded\"/>.tid"
        },
        "$:/core/templates/css-tiddler": {
            "title": "$:/core/templates/css-tiddler",
            "text": "<!--\n\nThis template is used for saving CSS tiddlers as a style tag with data attributes representing the tiddler fields.\n\n-->`<style`<$fields template=' data-tiddler-$name$=\"$encoded_value$\"'></$fields>` type=\"text/css\">`<$view field=\"text\" format=\"text\" />`</style>`"
        },
        "$:/core/templates/exporters/CsvFile": {
            "title": "$:/core/templates/exporters/CsvFile",
            "tags": "$:/tags/Exporter",
            "description": "{{$:/language/Exporters/CsvFile}}",
            "extension": ".csv",
            "text": "\\define renderContent()\n<$text text=<<csvtiddlers filter:\"\"\"$(exportFilter)$\"\"\" format:\"quoted-comma-sep\">>/>\n\\end\n<<renderContent>>\n"
        },
        "$:/core/templates/exporters/JsonFile": {
            "title": "$:/core/templates/exporters/JsonFile",
            "tags": "$:/tags/Exporter",
            "description": "{{$:/language/Exporters/JsonFile}}",
            "extension": ".json",
            "text": "\\define renderContent()\n<$text text=<<jsontiddlers filter:\"\"\"$(exportFilter)$\"\"\">>/>\n\\end\n<<renderContent>>\n"
        },
        "$:/core/templates/exporters/StaticRiver": {
            "title": "$:/core/templates/exporters/StaticRiver",
            "tags": "$:/tags/Exporter",
            "description": "{{$:/language/Exporters/StaticRiver}}",
            "extension": ".html",
            "text": "\\define tv-wikilink-template() #$uri_encoded$\n\\define tv-config-toolbar-icons() no\n\\define tv-config-toolbar-text() no\n\\define tv-config-toolbar-class() tc-btn-invisible\n\\rules only filteredtranscludeinline transcludeinline\n<!doctype html>\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />\n<meta name=\"generator\" content=\"TiddlyWiki\" />\n<meta name=\"tiddlywiki-version\" content=\"{{$:/core/templates/version}}\" />\n<meta name=\"format-detection\" content=\"telephone=no\">\n<link id=\"faviconLink\" rel=\"shortcut icon\" href=\"favicon.ico\">\n<title>{{$:/core/wiki/title}}</title>\n<div id=\"styleArea\">\n{{$:/boot/boot.css||$:/core/templates/css-tiddler}}\n</div>\n<style type=\"text/css\">\n{{$:/core/ui/PageStylesheet||$:/core/templates/wikified-tiddler}}\n</style>\n</head>\n<body class=\"tc-body\">\n{{$:/StaticBanner||$:/core/templates/html-tiddler}}\n<section class=\"tc-story-river\">\n{{$:/core/templates/exporters/StaticRiver/Content||$:/core/templates/html-tiddler}}\n</section>\n</body>\n</html>\n"
        },
        "$:/core/templates/exporters/StaticRiver/Content": {
            "title": "$:/core/templates/exporters/StaticRiver/Content",
            "text": "\\define renderContent()\n{{{ $(exportFilter)$ ||$:/core/templates/static-tiddler}}}\n\\end\n<$importvariables filter=\"[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]\">\n<<renderContent>>\n</$importvariables>\n"
        },
        "$:/core/templates/exporters/TidFile": {
            "title": "$:/core/templates/exporters/TidFile",
            "tags": "$:/tags/Exporter",
            "description": "{{$:/language/Exporters/TidFile}}",
            "extension": ".tid",
            "text": "\\define renderContent()\n{{{ $(exportFilter)$ +[limit[1]] ||$:/core/templates/tid-tiddler}}}\n\\end\n<$importvariables filter=\"[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]\"><<renderContent>></$importvariables>"
        },
        "$:/core/templates/html-div-tiddler": {
            "title": "$:/core/templates/html-div-tiddler",
            "text": "<!--\n\nThis template is used for saving tiddlers as an HTML DIV tag with attributes representing the tiddler fields.\n\n-->`<div`<$fields template=' $name$=\"$encoded_value$\"'></$fields>`>\n<pre>`<$view field=\"text\" format=\"htmlencoded\" />`</pre>\n</div>`\n"
        },
        "$:/core/templates/html-tiddler": {
            "title": "$:/core/templates/html-tiddler",
            "text": "<!--\n\nThis template is used for saving tiddlers as raw HTML\n\n--><$view field=\"text\" format=\"htmlwikified\" />"
        },
        "$:/core/templates/javascript-tiddler": {
            "title": "$:/core/templates/javascript-tiddler",
            "text": "<!--\n\nThis template is used for saving JavaScript tiddlers as a script tag with data attributes representing the tiddler fields.\n\n-->`<script`<$fields template=' data-tiddler-$name$=\"$encoded_value$\"'></$fields>` type=\"text/javascript\">`<$view field=\"text\" format=\"text\" />`</script>`"
        },
        "$:/core/templates/json-tiddler": {
            "title": "$:/core/templates/json-tiddler",
            "text": "<!--\n\nThis template is used for saving tiddlers as raw JSON\n\n--><$text text=<<jsontiddler>>/>"
        },
        "$:/core/templates/module-tiddler": {
            "title": "$:/core/templates/module-tiddler",
            "text": "<!--\n\nThis template is used for saving JavaScript tiddlers as a script tag with data attributes representing the tiddler fields. The body of the tiddler is wrapped in a call to the `$tw.modules.define` function in order to define the body of the tiddler as a module\n\n-->`<script`<$fields template=' data-tiddler-$name$=\"$encoded_value$\"'></$fields>` type=\"text/javascript\" data-module=\"yes\">$tw.modules.define(\"`<$view field=\"title\" format=\"jsencoded\" />`\",\"`<$view field=\"module-type\" format=\"jsencoded\" />`\",function(module,exports,require) {`<$view field=\"text\" format=\"text\" />`});\n</script>`"
        },
        "$:/core/templates/plain-text-tiddler": {
            "title": "$:/core/templates/plain-text-tiddler",
            "text": "<$view field=\"text\" format=\"text\" />"
        },
        "$:/core/templates/raw-static-tiddler": {
            "title": "$:/core/templates/raw-static-tiddler",
            "text": "<!--\n\nThis template is used for saving tiddlers as static HTML\n\n--><$view field=\"text\" format=\"plainwikified\" />"
        },
        "$:/core/save/all": {
            "title": "$:/core/save/all",
            "text": "\\define saveTiddlerFilter()\n[is[tiddler]] -[prefix[$:/state/popup/]] -[[$:/HistoryList]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$\n\\end\n{{$:/core/templates/tiddlywiki5.html}}\n"
        },
        "$:/core/save/empty": {
            "title": "$:/core/save/empty",
            "text": "\\define saveTiddlerFilter()\n[is[system]] -[prefix[$:/state/popup/]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]]\n\\end\n{{$:/core/templates/tiddlywiki5.html}}\n"
        },
        "$:/core/save/lazy-all": {
            "title": "$:/core/save/lazy-all",
            "text": "\\define saveTiddlerFilter()\n[is[system]] -[prefix[$:/state/popup/]] -[[$:/HistoryList]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] \n\\end\n{{$:/core/templates/tiddlywiki5.html}}\n"
        },
        "$:/core/save/lazy-images": {
            "title": "$:/core/save/lazy-images",
            "text": "\\define saveTiddlerFilter()\n[is[tiddler]] -[prefix[$:/state/popup/]] -[[$:/HistoryList]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] -[!is[system]is[image]] +[sort[title]] \n\\end\n{{$:/core/templates/tiddlywiki5.html}}\n"
        },
        "$:/core/templates/single.tiddler.window": {
            "title": "$:/core/templates/single.tiddler.window",
            "text": "<$set name=\"themeTitle\" value={{$:/view}}>\n\n<$set name=\"tempCurrentTiddler\" value=<<currentTiddler>>>\n\n<$set name=\"currentTiddler\" value={{$:/language}}>\n\n<$set name=\"languageTitle\" value={{!!name}}>\n\n<$set name=\"currentTiddler\" value=<<tempCurrentTiddler>>>\n\n<$importvariables filter=\"[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]\">\n\n<$navigator story=\"$:/StoryList\" history=\"$:/HistoryList\">\n\n<$transclude mode=\"block\"/>\n\n</$navigator>\n\n</$importvariables>\n\n</$set>\n\n</$set>\n\n</$set>\n\n</$set>\n\n</$set>\n\n"
        },
        "$:/core/templates/split-recipe": {
            "title": "$:/core/templates/split-recipe",
            "text": "<$list filter=\"[!is[system]]\">\ntiddler: <$view field=\"title\" format=\"urlencoded\"/>.tid\n</$list>\n"
        },
        "$:/core/templates/static-tiddler": {
            "title": "$:/core/templates/static-tiddler",
            "text": "<a name=<<currentTiddler>>>\n<$transclude tiddler=\"$:/core/ui/ViewTemplate\"/>\n</a>"
        },
        "$:/core/templates/static.area": {
            "title": "$:/core/templates/static.area",
            "text": "<$reveal type=\"nomatch\" state=\"$:/isEncrypted\" text=\"yes\">\n{{{ [all[shadows+tiddlers]tag[$:/tags/RawStaticContent]!has[draft.of]] ||$:/core/templates/raw-static-tiddler}}}\n{{$:/core/templates/static.content||$:/core/templates/html-tiddler}}\n</$reveal>\n<$reveal type=\"match\" state=\"$:/isEncrypted\" text=\"yes\">\nThis file contains an encrypted ~TiddlyWiki. Enable ~JavaScript and enter the decryption password when prompted.\n</$reveal>\n"
        },
        "$:/core/templates/static.content": {
            "title": "$:/core/templates/static.content",
            "type": "text/vnd.tiddlywiki",
            "text": "<!-- For Google, and people without JavaScript-->\nThis [[TiddlyWiki|http://tiddlywiki.com]] contains the following tiddlers:\n\n<ul>\n<$list filter=<<saveTiddlerFilter>>>\n<li><$view field=\"title\" format=\"text\"></$view></li>\n</$list>\n</ul>\n"
        },
        "$:/core/templates/static.template.css": {
            "title": "$:/core/templates/static.template.css",
            "text": "{{$:/boot/boot.css||$:/core/templates/plain-text-tiddler}}\n\n{{$:/core/ui/PageStylesheet||$:/core/templates/wikified-tiddler}}\n"
        },
        "$:/core/templates/static.template.html": {
            "title": "$:/core/templates/static.template.html",
            "type": "text/vnd.tiddlywiki-html",
            "text": "\\define tv-wikilink-template() static/$uri_doubleencoded$.html\n\\define tv-config-toolbar-icons() no\n\\define tv-config-toolbar-text() no\n\\define tv-config-toolbar-class() tc-btn-invisible\n\\rules only filteredtranscludeinline transcludeinline\n<!doctype html>\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />\n<meta name=\"generator\" content=\"TiddlyWiki\" />\n<meta name=\"tiddlywiki-version\" content=\"{{$:/core/templates/version}}\" />\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n<meta name=\"apple-mobile-web-app-capable\" content=\"yes\" />\n<meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black-translucent\" />\n<meta name=\"mobile-web-app-capable\" content=\"yes\"/>\n<meta name=\"format-detection\" content=\"telephone=no\">\n<link id=\"faviconLink\" rel=\"shortcut icon\" href=\"favicon.ico\">\n<title>{{$:/core/wiki/title}}</title>\n<div id=\"styleArea\">\n{{$:/boot/boot.css||$:/core/templates/css-tiddler}}\n</div>\n<style type=\"text/css\">\n{{$:/core/ui/PageStylesheet||$:/core/templates/wikified-tiddler}}\n</style>\n</head>\n<body class=\"tc-body\">\n{{$:/StaticBanner||$:/core/templates/html-tiddler}}\n{{$:/core/ui/PageTemplate||$:/core/templates/html-tiddler}}\n</body>\n</html>\n"
        },
        "$:/core/templates/static.tiddler.html": {
            "title": "$:/core/templates/static.tiddler.html",
            "text": "\\define tv-wikilink-template() $uri_doubleencoded$.html\n\\define tv-config-toolbar-icons() no\n\\define tv-config-toolbar-text() no\n\\define tv-config-toolbar-class() tc-btn-invisible\n`<!doctype html>\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />\n<meta name=\"generator\" content=\"TiddlyWiki\" />\n<meta name=\"tiddlywiki-version\" content=\"`{{$:/core/templates/version}}`\" />\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n<meta name=\"apple-mobile-web-app-capable\" content=\"yes\" />\n<meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black-translucent\" />\n<meta name=\"mobile-web-app-capable\" content=\"yes\"/>\n<meta name=\"format-detection\" content=\"telephone=no\">\n<link id=\"faviconLink\" rel=\"shortcut icon\" href=\"favicon.ico\">\n<link rel=\"stylesheet\" href=\"static.css\">\n<title>`<$view field=\"caption\"><$view field=\"title\"/></$view>: {{$:/core/wiki/title}}`</title>\n</head>\n<body class=\"tc-body\">\n`{{$:/StaticBanner||$:/core/templates/html-tiddler}}`\n<section class=\"tc-story-river\">\n`<$importvariables filter=\"[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]\">\n<$view tiddler=\"$:/core/ui/ViewTemplate\" format=\"htmlwikified\"/>\n</$importvariables>`\n</section>\n</body>\n</html>\n`"
        },
        "$:/core/templates/store.area.template.html": {
            "title": "$:/core/templates/store.area.template.html",
            "text": "<$reveal type=\"nomatch\" state=\"$:/isEncrypted\" text=\"yes\">\n`<div id=\"storeArea\" style=\"display:none;\">`\n<$list filter=<<saveTiddlerFilter>> template=\"$:/core/templates/html-div-tiddler\"/>\n`</div>`\n</$reveal>\n<$reveal type=\"match\" state=\"$:/isEncrypted\" text=\"yes\">\n`<!--~~ Encrypted tiddlers ~~-->`\n`<pre id=\"encryptedStoreArea\" type=\"text/plain\" style=\"display:none;\">`\n<$encrypt filter=<<saveTiddlerFilter>>/>\n`</pre>`\n</$reveal>"
        },
        "$:/core/templates/tid-tiddler": {
            "title": "$:/core/templates/tid-tiddler",
            "text": "<!--\n\nThis template is used for saving tiddlers in TiddlyWeb *.tid format\n\n--><$fields exclude='text bag' template='$name$: $value$\n'></$fields>`\n`<$view field=\"text\" format=\"text\" />"
        },
        "$:/core/templates/tiddler-metadata": {
            "title": "$:/core/templates/tiddler-metadata",
            "text": "<!--\n\nThis template is used for saving tiddler metadata *.meta files\n\n--><$fields exclude='text bag' template='$name$: $value$\n'></$fields>"
        },
        "$:/core/templates/tiddlywiki5.html": {
            "title": "$:/core/templates/tiddlywiki5.html",
            "text": "\\rules only filteredtranscludeinline transcludeinline\n<!doctype html>\n{{$:/core/templates/MOTW.html}}<html>\n<head>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=Edge\">\n<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />\n<meta name=\"application-name\" content=\"TiddlyWiki\" />\n<meta name=\"generator\" content=\"TiddlyWiki\" />\n<meta name=\"tiddlywiki-version\" content=\"{{$:/core/templates/version}}\" />\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n<meta name=\"apple-mobile-web-app-capable\" content=\"yes\" />\n<meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black-translucent\" />\n<meta name=\"mobile-web-app-capable\" content=\"yes\"/>\n<meta name=\"format-detection\" content=\"telephone=no\" />\n<meta name=\"copyright\" content=\"{{$:/core/copyright.txt}}\" />\n<link id=\"faviconLink\" rel=\"shortcut icon\" href=\"favicon.ico\">\n<title>{{$:/core/wiki/title}}</title>\n<!--~~ This is a Tiddlywiki file. The points of interest in the file are marked with this pattern ~~-->\n\n<!--~~ Raw markup ~~-->\n{{{ [all[shadows+tiddlers]tag[$:/core/wiki/rawmarkup]] [all[shadows+tiddlers]tag[$:/tags/RawMarkup]] ||$:/core/templates/plain-text-tiddler}}}\n{{{ [all[shadows+tiddlers]tag[$:/tags/RawMarkupWikified]] ||$:/core/templates/raw-static-tiddler}}}\n</head>\n<body class=\"tc-body\">\n<!--~~ Static styles ~~-->\n<div id=\"styleArea\">\n{{$:/boot/boot.css||$:/core/templates/css-tiddler}}\n</div>\n<!--~~ Static content for Google and browsers without JavaScript ~~-->\n<noscript>\n<div id=\"splashArea\">\n{{$:/core/templates/static.area}}\n</div>\n</noscript>\n<!--~~ Ordinary tiddlers ~~-->\n{{$:/core/templates/store.area.template.html}}\n<!--~~ Library modules ~~-->\n<div id=\"libraryModules\" style=\"display:none;\">\n{{{ [is[system]type[application/javascript]library[yes]] ||$:/core/templates/javascript-tiddler}}}\n</div>\n<!--~~ Boot kernel prologue ~~-->\n<div id=\"bootKernelPrefix\" style=\"display:none;\">\n{{ $:/boot/bootprefix.js ||$:/core/templates/javascript-tiddler}}\n</div>\n<!--~~ Boot kernel ~~-->\n<div id=\"bootKernel\" style=\"display:none;\">\n{{ $:/boot/boot.js ||$:/core/templates/javascript-tiddler}}\n</div>\n</body>\n</html>\n"
        },
        "$:/core/templates/version": {
            "title": "$:/core/templates/version",
            "text": "<<version>>"
        },
        "$:/core/templates/wikified-tiddler": {
            "title": "$:/core/templates/wikified-tiddler",
            "text": "<$transclude />"
        },
        "$:/core/ui/AboveStory/tw2-plugin-check": {
            "title": "$:/core/ui/AboveStory/tw2-plugin-check",
            "tags": "$:/tags/AboveStory",
            "text": "\\define lingo-base() $:/language/AboveStory/ClassicPlugin/\n<$list filter=\"[all[system+tiddlers]tag[systemConfig]limit[1]]\">\n\n<div class=\"tc-message-box\">\n\n<<lingo Warning>>\n\n<ul>\n\n<$list filter=\"[all[system+tiddlers]tag[systemConfig]]\">\n\n<li>\n\n<$link><$view field=\"title\"/></$link>\n\n</li>\n\n</$list>\n\n</ul>\n\n</div>\n\n</$list>\n"
        },
        "$:/core/ui/AdvancedSearch/Filter": {
            "title": "$:/core/ui/AdvancedSearch/Filter",
            "tags": "$:/tags/AdvancedSearch",
            "caption": "{{$:/language/Search/Filter/Caption}}",
            "text": "\\define lingo-base() $:/language/Search/\n<<lingo Filter/Hint>>\n\n<div class=\"tc-search tc-advanced-search\">\n<$edit-text tiddler=\"$:/temp/advancedsearch\" type=\"search\" tag=\"input\"/>\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/AdvancedSearch/FilterButton]!has[draft.of]]\"><$transclude/></$list>\n</div>\n\n<$reveal state=\"$:/temp/advancedsearch\" type=\"nomatch\" text=\"\">\n<$set name=\"resultCount\" value=\"\"\"<$count filter={{$:/temp/advancedsearch}}/>\"\"\">\n<div class=\"tc-search-results\">\n<<lingo Filter/Matches>>\n<$list filter={{$:/temp/advancedsearch}} template=\"$:/core/ui/ListItemTemplate\"/>\n</div>\n</$set>\n</$reveal>\n"
        },
        "$:/core/ui/AdvancedSearch/Filter/FilterButtons/clear": {
            "title": "$:/core/ui/AdvancedSearch/Filter/FilterButtons/clear",
            "tags": "$:/tags/AdvancedSearch/FilterButton",
            "text": "<$reveal state=\"$:/temp/advancedsearch\" type=\"nomatch\" text=\"\">\n<$button class=\"tc-btn-invisible\">\n<$action-setfield $tiddler=\"$:/temp/advancedsearch\" $field=\"text\" $value=\"\"/>\n{{$:/core/images/close-button}}\n</$button>\n</$reveal>\n"
        },
        "$:/core/ui/AdvancedSearch/Filter/FilterButtons/delete": {
            "title": "$:/core/ui/AdvancedSearch/Filter/FilterButtons/delete",
            "tags": "$:/tags/AdvancedSearch/FilterButton",
            "text": "<$reveal state=\"$:/temp/advancedsearch\" type=\"nomatch\" text=\"\">\n<$button popup=<<qualify \"$:/state/filterDeleteDropdown\">> class=\"tc-btn-invisible\">\n{{$:/core/images/delete-button}}\n</$button>\n</$reveal>\n\n<$reveal state=<<qualify \"$:/state/filterDeleteDropdown\">> type=\"popup\" position=\"belowleft\" animate=\"yes\">\n<div class=\"tc-block-dropdown-wrapper\">\n<div class=\"tc-block-dropdown tc-edit-type-dropdown\">\n<div class=\"tc-dropdown-item-plain\">\n<$set name=\"resultCount\" value=\"\"\"<$count filter={{$:/temp/advancedsearch}}/>\"\"\">\nAre you sure you wish to delete <<resultCount>> tiddler(s)?\n</$set>\n</div>\n<div class=\"tc-dropdown-item-plain\">\n<$button class=\"tc-btn\">\n<$action-deletetiddler $filter={{$:/temp/advancedsearch}}/>\nDelete these tiddlers\n</$button>\n</div>\n</div>\n</div>\n</$reveal>\n"
        },
        "$:/core/ui/AdvancedSearch/Filter/FilterButtons/dropdown": {
            "title": "$:/core/ui/AdvancedSearch/Filter/FilterButtons/dropdown",
            "tags": "$:/tags/AdvancedSearch/FilterButton",
            "text": "<span class=\"tc-popup-keep\">\n<$button popup=<<qualify \"$:/state/filterDropdown\">> class=\"tc-btn-invisible\">\n{{$:/core/images/down-arrow}}\n</$button>\n</span>\n\n<$reveal state=<<qualify \"$:/state/filterDropdown\">> type=\"popup\" position=\"belowleft\" animate=\"yes\">\n<$linkcatcher to=\"$:/temp/advancedsearch\">\n<div class=\"tc-block-dropdown-wrapper\">\n<div class=\"tc-block-dropdown tc-edit-type-dropdown\">\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/Filter]]\"><$link to={{!!filter}}><$transclude field=\"description\"/></$link>\n</$list>\n</div>\n</div>\n</$linkcatcher>\n</$reveal>\n"
        },
        "$:/core/ui/AdvancedSearch/Filter/FilterButtons/export": {
            "title": "$:/core/ui/AdvancedSearch/Filter/FilterButtons/export",
            "tags": "$:/tags/AdvancedSearch/FilterButton",
            "text": "<$reveal state=\"$:/temp/advancedsearch\" type=\"nomatch\" text=\"\">\n<$macrocall $name=\"exportButton\" exportFilter={{$:/temp/advancedsearch}} lingoBase=\"$:/language/Buttons/ExportTiddlers/\"/>\n</$reveal>\n"
        },
        "$:/core/ui/AdvancedSearch/Shadows": {
            "title": "$:/core/ui/AdvancedSearch/Shadows",
            "tags": "$:/tags/AdvancedSearch",
            "caption": "{{$:/language/Search/Shadows/Caption}}",
            "text": "\\define lingo-base() $:/language/Search/\n<$linkcatcher to=\"$:/temp/advancedsearch\">\n\n<<lingo Shadows/Hint>>\n\n<div class=\"tc-search\">\n<$edit-text tiddler=\"$:/temp/advancedsearch\" type=\"search\" tag=\"input\"/>\n<$reveal state=\"$:/temp/advancedsearch\" type=\"nomatch\" text=\"\">\n<$button class=\"tc-btn-invisible\">\n<$action-setfield $tiddler=\"$:/temp/advancedsearch\" $field=\"text\" $value=\"\"/>\n{{$:/core/images/close-button}}\n</$button>\n</$reveal>\n</div>\n\n</$linkcatcher>\n\n<$reveal state=\"$:/temp/advancedsearch\" type=\"nomatch\" text=\"\">\n\n<$list filter=\"[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]\" emptyMessage=\"\"\"<div class=\"tc-search-results\">{{$:/language/Search/Search/TooShort}}</div>\"\"\" variable=\"listItem\">\n\n<$set name=\"resultCount\" value=\"\"\"<$count filter=\"[all[shadows]search{$:/temp/advancedsearch}] -[[$:/temp/advancedsearch]]\"/>\"\"\">\n\n<div class=\"tc-search-results\">\n\n<<lingo Shadows/Matches>>\n\n<$list filter=\"[all[shadows]search{$:/temp/advancedsearch}sort[title]limit[250]] -[[$:/temp/advancedsearch]]\" template=\"$:/core/ui/ListItemTemplate\"/>\n\n</div>\n\n</$set>\n\n</$list>\n\n</$reveal>\n\n<$reveal state=\"$:/temp/advancedsearch\" type=\"match\" text=\"\">\n\n</$reveal>\n"
        },
        "$:/core/ui/AdvancedSearch/Standard": {
            "title": "$:/core/ui/AdvancedSearch/Standard",
            "tags": "$:/tags/AdvancedSearch",
            "caption": "{{$:/language/Search/Standard/Caption}}",
            "text": "\\define lingo-base() $:/language/Search/\n<$linkcatcher to=\"$:/temp/advancedsearch\">\n\n<<lingo Standard/Hint>>\n\n<div class=\"tc-search\">\n<$edit-text tiddler=\"$:/temp/advancedsearch\" type=\"search\" tag=\"input\"/>\n<$reveal state=\"$:/temp/advancedsearch\" type=\"nomatch\" text=\"\">\n<$button class=\"tc-btn-invisible\">\n<$action-setfield $tiddler=\"$:/temp/advancedsearch\" $field=\"text\" $value=\"\"/>\n{{$:/core/images/close-button}}\n</$button>\n</$reveal>\n</div>\n\n</$linkcatcher>\n\n<$reveal state=\"$:/temp/advancedsearch\" type=\"nomatch\" text=\"\">\n<$list filter=\"[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]\" emptyMessage=\"\"\"<div class=\"tc-search-results\">{{$:/language/Search/Search/TooShort}}</div>\"\"\" variable=\"listItem\">\n<$set name=\"searchTiddler\" value=\"$:/temp/advancedsearch\">\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]butfirst[]limit[1]]\" emptyMessage=\"\"\"\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]\">\n<$transclude/>\n</$list>\n\"\"\">\n<$macrocall $name=\"tabs\" tabsList=\"[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]\" default={{$:/config/SearchResults/Default}}/>\n</$list>\n</$set>\n</$list>\n</$reveal>\n"
        },
        "$:/core/ui/AdvancedSearch/System": {
            "title": "$:/core/ui/AdvancedSearch/System",
            "tags": "$:/tags/AdvancedSearch",
            "caption": "{{$:/language/Search/System/Caption}}",
            "text": "\\define lingo-base() $:/language/Search/\n<$linkcatcher to=\"$:/temp/advancedsearch\">\n\n<<lingo System/Hint>>\n\n<div class=\"tc-search\">\n<$edit-text tiddler=\"$:/temp/advancedsearch\" type=\"search\" tag=\"input\"/>\n<$reveal state=\"$:/temp/advancedsearch\" type=\"nomatch\" text=\"\">\n<$button class=\"tc-btn-invisible\">\n<$action-setfield $tiddler=\"$:/temp/advancedsearch\" $field=\"text\" $value=\"\"/>\n{{$:/core/images/close-button}}\n</$button>\n</$reveal>\n</div>\n\n</$linkcatcher>\n\n<$reveal state=\"$:/temp/advancedsearch\" type=\"nomatch\" text=\"\">\n\n<$list filter=\"[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]\" emptyMessage=\"\"\"<div class=\"tc-search-results\">{{$:/language/Search/Search/TooShort}}</div>\"\"\" variable=\"listItem\">\n\n<$set name=\"resultCount\" value=\"\"\"<$count filter=\"[is[system]search{$:/temp/advancedsearch}] -[[$:/temp/advancedsearch]]\"/>\"\"\">\n\n<div class=\"tc-search-results\">\n\n<<lingo System/Matches>>\n\n<$list filter=\"[is[system]search{$:/temp/advancedsearch}sort[title]limit[250]] -[[$:/temp/advancedsearch]]\" template=\"$:/core/ui/ListItemTemplate\"/>\n\n</div>\n\n</$set>\n\n</$list>\n\n</$reveal>\n\n<$reveal state=\"$:/temp/advancedsearch\" type=\"match\" text=\"\">\n\n</$reveal>\n"
        },
        "$:/AdvancedSearch": {
            "title": "$:/AdvancedSearch",
            "icon": "$:/core/images/advanced-search-button",
            "color": "#bbb",
            "text": "<div class=\"tc-advanced-search\">\n<<tabs \"[all[shadows+tiddlers]tag[$:/tags/AdvancedSearch]!has[draft.of]]\" \"$:/core/ui/AdvancedSearch/System\">>\n</div>\n"
        },
        "$:/core/ui/AlertTemplate": {
            "title": "$:/core/ui/AlertTemplate",
            "text": "<div class=\"tc-alert\">\n<div class=\"tc-alert-toolbar\">\n<$button class=\"tc-btn-invisible\"><$action-deletetiddler $tiddler=<<currentTiddler>>/>{{$:/core/images/delete-button}}</$button>\n</div>\n<div class=\"tc-alert-subtitle\">\n<$view field=\"component\"/> - <$view field=\"modified\" format=\"date\" template=\"0hh:0mm:0ss DD MM YYYY\"/> <$reveal type=\"nomatch\" state=\"!!count\" text=\"\"><span class=\"tc-alert-highlight\">({{$:/language/Count}}: <$view field=\"count\"/>)</span></$reveal>\n</div>\n<div class=\"tc-alert-body\">\n\n<$transclude/>\n\n</div>\n</div>\n"
        },
        "$:/core/ui/BinaryWarning": {
            "title": "$:/core/ui/BinaryWarning",
            "text": "\\define lingo-base() $:/language/BinaryWarning/\n<div class=\"tc-binary-warning\">\n\n<<lingo Prompt>>\n\n</div>\n"
        },
        "$:/core/ui/Components/plugin-info": {
            "title": "$:/core/ui/Components/plugin-info",
            "text": "\\define lingo-base() $:/language/ControlPanel/Plugins/\n\n\\define popup-state-macro()\n$(qualified-state)$-$(currentTiddler)$\n\\end\n\n\\define tabs-state-macro()\n$(popup-state)$-$(pluginInfoType)$\n\\end\n\n\\define plugin-icon-title()\n$(currentTiddler)$/icon\n\\end\n\n\\define plugin-disable-title()\n$:/config/Plugins/Disabled/$(currentTiddler)$\n\\end\n\n\\define plugin-table-body(type,disabledMessage,default-popup-state)\n<div class=\"tc-plugin-info-chunk tc-small-icon\">\n<$reveal type=\"nomatch\" state=<<popup-state>> text=\"yes\" default=\"\"\"$default-popup-state$\"\"\">\n<$button class=\"tc-btn-invisible tc-btn-dropdown\" set=<<popup-state>> setTo=\"yes\">\n{{$:/core/images/right-arrow}}\n</$button>\n</$reveal>\n<$reveal type=\"match\" state=<<popup-state>> text=\"yes\" default=\"\"\"$default-popup-state$\"\"\">\n<$button class=\"tc-btn-invisible tc-btn-dropdown\" set=<<popup-state>> setTo=\"no\">\n{{$:/core/images/down-arrow}}\n</$button>\n</$reveal>\n</div>\n<div class=\"tc-plugin-info-chunk\">\n<$transclude tiddler=<<currentTiddler>> subtiddler=<<plugin-icon-title>>>\n<$transclude tiddler=\"$:/core/images/plugin-generic-$type$\"/>\n</$transclude>\n</div>\n<div class=\"tc-plugin-info-chunk\">\n<h1>\n''<$view field=\"description\"><$view field=\"title\"/></$view>'' $disabledMessage$\n</h1>\n<h2>\n<$view field=\"title\"/>\n</h2>\n<h2>\n<div><em><$view field=\"version\"/></em></div>\n</h2>\n</div>\n\\end\n\n\\define plugin-info(type,default-popup-state)\n<$set name=\"popup-state\" value=<<popup-state-macro>>>\n<$reveal type=\"nomatch\" state=<<plugin-disable-title>> text=\"yes\">\n<$link to={{!!title}} class=\"tc-plugin-info\">\n<<plugin-table-body type:\"$type$\" default-popup-state:\"\"\"$default-popup-state$\"\"\">>\n</$link>\n</$reveal>\n<$reveal type=\"match\" state=<<plugin-disable-title>> text=\"yes\">\n<$link to={{!!title}} class=\"tc-plugin-info tc-plugin-info-disabled\">\n<<plugin-table-body type:\"$type$\" default-popup-state:\"\"\"$default-popup-state$\"\"\" disabledMessage:\"<$macrocall $name='lingo' title='Disabled/Status'/>\">>\n</$link>\n</$reveal>\n<$reveal type=\"match\" text=\"yes\" state=<<popup-state>> default=\"\"\"$default-popup-state$\"\"\">\n<div class=\"tc-plugin-info-dropdown\">\n<div class=\"tc-plugin-info-dropdown-body\">\n<$list filter=\"[all[current]] -[[$:/core]]\">\n<div style=\"float:right;\">\n<$reveal type=\"nomatch\" state=<<plugin-disable-title>> text=\"yes\">\n<$button set=<<plugin-disable-title>> setTo=\"yes\" tooltip={{$:/language/ControlPanel/Plugins/Disable/Hint}} aria-label={{$:/language/ControlPanel/Plugins/Disable/Caption}}>\n<<lingo Disable/Caption>>\n</$button>\n</$reveal>\n<$reveal type=\"match\" state=<<plugin-disable-title>> text=\"yes\">\n<$button set=<<plugin-disable-title>> setTo=\"no\" tooltip={{$:/language/ControlPanel/Plugins/Enable/Hint}} aria-label={{$:/language/ControlPanel/Plugins/Enable/Caption}}>\n<<lingo Enable/Caption>>\n</$button>\n</$reveal>\n</div>\n</$list>\n<$reveal type=\"nomatch\" text=\"\" state=\"!!list\">\n<$set name=\"tabsList\" filter=\"[<currentTiddler>list[]] contents\">\n<$macrocall $name=\"tabs\" state=<<tabs-state-macro>> tabsList=<<tabsList>> default=\"readme\" template=\"$:/core/ui/PluginInfo\"/>\n</$set>\n</$reveal>\n<$reveal type=\"match\" text=\"\" state=\"!!list\">\n<<lingo NoInformation/Hint>>\n</$reveal>\n</div>\n</div>\n</$reveal>\n</$set>\n\\end\n\n<$macrocall $name=\"plugin-info\" type=<<plugin-type>> default-popup-state=<<default-popup-state>>/>\n"
        },
        "$:/core/ui/Components/tag-link": {
            "title": "$:/core/ui/Components/tag-link",
            "text": "<$link>\n<$set name=\"backgroundColor\" value={{!!color}}>\n<span style=<<tag-styles>> class=\"tc-tag-label\">\n<$view field=\"title\" format=\"text\"/>\n</span>\n</$set>\n</$link>"
        },
        "$:/core/ui/ControlPanel/Advanced": {
            "title": "$:/core/ui/ControlPanel/Advanced",
            "tags": "$:/tags/ControlPanel/Info",
            "caption": "{{$:/language/ControlPanel/Advanced/Caption}}",
            "text": "{{$:/language/ControlPanel/Advanced/Hint}}\n\n<div class=\"tc-control-panel\">\n<<tabs \"[all[shadows+tiddlers]tag[$:/tags/ControlPanel/Advanced]!has[draft.of]]\" \"$:/core/ui/ControlPanel/TiddlerFields\">>\n</div>\n"
        },
        "$:/core/ui/ControlPanel/Appearance": {
            "title": "$:/core/ui/ControlPanel/Appearance",
            "tags": "$:/tags/ControlPanel",
            "caption": "{{$:/language/ControlPanel/Appearance/Caption}}",
            "text": "{{$:/language/ControlPanel/Appearance/Hint}}\n\n<div class=\"tc-control-panel\">\n<<tabs \"[all[shadows+tiddlers]tag[$:/tags/ControlPanel/Appearance]!has[draft.of]]\" \"$:/core/ui/ControlPanel/Theme\">>\n</div>\n"
        },
        "$:/core/ui/ControlPanel/Basics": {
            "title": "$:/core/ui/ControlPanel/Basics",
            "tags": "$:/tags/ControlPanel/Info",
            "caption": "{{$:/language/ControlPanel/Basics/Caption}}",
            "text": "\\define lingo-base() $:/language/ControlPanel/Basics/\n\n\\define show-filter-count(filter)\n<$button class=\"tc-btn-invisible\">\n<$action-setfield $tiddler=\"$:/temp/advancedsearch\" $value=\"\"\"$filter$\"\"\"/>\n<$action-setfield $tiddler=\"$:/state/tab--1498284803\" $value=\"$:/core/ui/AdvancedSearch/Filter\"/>\n<$action-navigate $to=\"$:/AdvancedSearch\"/>\n''<$count filter=\"\"\"$filter$\"\"\"/>''\n{{$:/core/images/advanced-search-button}}\n</$button>\n\\end\n\n|<<lingo Version/Prompt>> |''<<version>>'' |\n|<$link to=\"$:/SiteTitle\"><<lingo Title/Prompt>></$link> |<$edit-text tiddler=\"$:/SiteTitle\" default=\"\" tag=\"input\"/> |\n|<$link to=\"$:/SiteSubtitle\"><<lingo Subtitle/Prompt>></$link> |<$edit-text tiddler=\"$:/SiteSubtitle\" default=\"\" tag=\"input\"/> |\n|<$link to=\"$:/status/UserName\"><<lingo Username/Prompt>></$link> |<$edit-text tiddler=\"$:/status/UserName\" default=\"\" tag=\"input\"/> |\n|<$link to=\"$:/config/AnimationDuration\"><<lingo AnimDuration/Prompt>></$link> |<$edit-text tiddler=\"$:/config/AnimationDuration\" default=\"\" tag=\"input\"/> |\n|<$link to=\"$:/DefaultTiddlers\"><<lingo DefaultTiddlers/Prompt>></$link> |<<lingo DefaultTiddlers/TopHint>><br> <$edit tag=\"textarea\" tiddler=\"$:/DefaultTiddlers\" class=\"tc-edit-texteditor\"/><br>//<<lingo DefaultTiddlers/BottomHint>>// |\n|<$link to=\"$:/config/NewJournal/Title\"><<lingo NewJournal/Title/Prompt>></$link> |<$edit-text tiddler=\"$:/config/NewJournal/Title\" default=\"\" tag=\"input\"/> |\n|<$link to=\"$:/config/NewJournal/Text\"><<lingo NewJournal/Text/Prompt>></$link> |<$edit tiddler=\"$:/config/NewJournal/Text\" tag=\"textarea\" class=\"tc-edit-texteditor\" default=\"\"/> |\n|<$link to=\"$:/config/NewJournal/Tags\"><<lingo NewJournal/Tags/Prompt>></$link> |<$edit-text tiddler=\"$:/config/NewJournal/Tags\" default=\"\" tag=\"input\"/> |\n|<<lingo Language/Prompt>> |{{$:/snippets/minilanguageswitcher}} |\n|<<lingo Tiddlers/Prompt>> |<<show-filter-count \"[!is[system]sort[title]]\">> |\n|<<lingo Tags/Prompt>> |<<show-filter-count \"[tags[]sort[title]]\">> |\n|<<lingo SystemTiddlers/Prompt>> |<<show-filter-count \"[is[system]sort[title]]\">> |\n|<<lingo ShadowTiddlers/Prompt>> |<<show-filter-count \"[all[shadows]sort[title]]\">> |\n|<<lingo OverriddenShadowTiddlers/Prompt>> |<<show-filter-count \"[is[tiddler]is[shadow]sort[title]]\">> |\n"
        },
        "$:/core/ui/ControlPanel/EditorTypes": {
            "title": "$:/core/ui/ControlPanel/EditorTypes",
            "tags": "$:/tags/ControlPanel/Advanced",
            "caption": "{{$:/language/ControlPanel/EditorTypes/Caption}}",
            "text": "\\define lingo-base() $:/language/ControlPanel/EditorTypes/\n\n<<lingo Hint>>\n\n<table>\n<tbody>\n<tr>\n<th><<lingo Type/Caption>></th>\n<th><<lingo Editor/Caption>></th>\n</tr>\n<$list filter=\"[all[shadows+tiddlers]prefix[$:/config/EditorTypeMappings/]sort[title]]\">\n<tr>\n<td>\n<$link>\n<$list filter=\"[all[current]removeprefix[$:/config/EditorTypeMappings/]]\">\n<$text text={{!!title}}/>\n</$list>\n</$link>\n</td>\n<td>\n<$view field=\"text\"/>\n</td>\n</tr>\n</$list>\n</tbody>\n</table>\n"
        },
        "$:/core/ui/ControlPanel/Info": {
            "title": "$:/core/ui/ControlPanel/Info",
            "tags": "$:/tags/ControlPanel",
            "caption": "{{$:/language/ControlPanel/Info/Caption}}",
            "text": "{{$:/language/ControlPanel/Info/Hint}}\n\n<div class=\"tc-control-panel\">\n<<tabs \"[all[shadows+tiddlers]tag[$:/tags/ControlPanel/Info]!has[draft.of]]\" \"$:/core/ui/ControlPanel/Basics\">>\n</div>\n"
        },
        "$:/core/ui/ControlPanel/KeyboardShortcuts": {
            "title": "$:/core/ui/ControlPanel/KeyboardShortcuts",
            "tags": "$:/tags/ControlPanel",
            "caption": "{{$:/language/ControlPanel/KeyboardShortcuts/Caption}}",
            "text": "\\define lingo-base() $:/language/ControlPanel/KeyboardShortcuts/\n\n\\define new-shortcut(title)\n<div class=\"tc-dropdown-item-plain\">\n<$edit-shortcut tiddler=\"$title$\" placeholder={{$:/language/ControlPanel/KeyboardShortcuts/Add/Prompt}} style=\"width:auto;\"/> <$button>\n<<lingo Add/Caption>>\n<$action-listops\n\t$tiddler=\"$(shortcutTitle)$\"\n\t$field=\"text\"\n\t$subfilter=\"[{$title$}]\"\n/>\n<$action-deletetiddler\n\t$tiddler=\"$title$\"\n/>\n</$button>\n</div>\n\\end\n\n\\define shortcut-list-item(caption)\n<td>\n</td>\n<td style=\"text-align:right;font-size:0.7em;\">\n<<lingo Platform/$caption$>>\n</td>\n<td>\n<div style=\"position:relative;\">\n<$button popup=<<qualify \"$:/state/dropdown/$(shortcutTitle)$\">> class=\"tc-btn-invisible\">\n{{$:/core/images/edit-button}}\n</$button>\n<$macrocall $name=\"displayshortcuts\" $output=\"text/html\" shortcuts={{$(shortcutTitle)$}} prefix=\"<kbd>\" separator=\"</kbd> <kbd>\" suffix=\"</kbd>\"/>\n\n<$reveal state=<<qualify \"$:/state/dropdown/$(shortcutTitle)$\">> type=\"popup\" position=\"below\" animate=\"yes\">\n<div class=\"tc-block-dropdown-wrapper\">\n<div class=\"tc-block-dropdown tc-edit-type-dropdown tc-popup-keep\">\n<$list filter=\"[list[$(shortcutTitle)$!!text]sort[title]]\" variable=\"shortcut\" emptyMessage=\"\"\"\n<div class=\"tc-dropdown-item-plain\">\n//<<lingo NoShortcuts/Caption>>//\n</div>\n\"\"\">\n<div class=\"tc-dropdown-item-plain\">\n<$button class=\"tc-btn-invisible\" tooltip=<<lingo Remove/Hint>>>\n<$action-listops\n\t$tiddler=\"$(shortcutTitle)$\"\n\t$field=\"text\"\n\t$subfilter=\"+[remove<shortcut>]\"\n/>\n&times;\n</$button>\n<kbd>\n<$macrocall $name=\"displayshortcuts\" $output=\"text/html\" shortcuts=<<shortcut>>/>\n</kbd>\n</div>\n</$list>\n<hr/>\n<$macrocall $name=\"new-shortcut\" title=<<qualify \"$:/state/new-shortcut/$(shortcutTitle)$\">>/>\n</div>\n</div>\n</$reveal>\n</div>\n</td>\n\\end\n\n\\define shortcut-list(caption,prefix)\n<tr>\n<$list filter=\"[all[tiddlers+shadows][$prefix$$(shortcutName)$]]\" variable=\"shortcutTitle\">\n<<shortcut-list-item \"$caption$\">>\n</$list>\n</tr>\n\\end\n\n\\define shortcut-editor()\n<<shortcut-list \"All\" \"$:/config/shortcuts/\">>\n<<shortcut-list \"Mac\" \"$:/config/shortcuts-mac/\">>\n<<shortcut-list \"NonMac\" \"$:/config/shortcuts-not-mac/\">>\n<<shortcut-list \"Linux\" \"$:/config/shortcuts-linux/\">>\n<<shortcut-list \"NonLinux\" \"$:/config/shortcuts-not-linux/\">>\n<<shortcut-list \"Windows\" \"$:/config/shortcuts-windows/\">>\n<<shortcut-list \"NonWindows\" \"$:/config/shortcuts-not-windows/\">>\n\\end\n\n\\define shortcut-preview()\n<$macrocall $name=\"displayshortcuts\" $output=\"text/html\" shortcuts={{$(shortcutPrefix)$$(shortcutName)$}} prefix=\"<kbd>\" separator=\"</kbd> <kbd>\" suffix=\"</kbd>\"/>\n\\end\n\n\\define shortcut-item-inner()\n<tr>\n<td>\n<$reveal type=\"nomatch\" state=<<dropdownStateTitle>> text=\"open\">\n<$button class=\"tc-btn-invisible\">\n<$action-setfield\n\t$tiddler=<<dropdownStateTitle>>\n\t$value=\"open\"\n/>\n{{$:/core/images/right-arrow}}\n</$button>\n</$reveal>\n<$reveal type=\"match\" state=<<dropdownStateTitle>> text=\"open\">\n<$button class=\"tc-btn-invisible\">\n<$action-setfield\n\t$tiddler=<<dropdownStateTitle>>\n\t$value=\"close\"\n/>\n{{$:/core/images/down-arrow}}\n</$button>\n</$reveal>\n''<$text text=<<shortcutName>>/>''\n</td>\n<td>\n<$transclude tiddler=\"$:/config/ShortcutInfo/$(shortcutName)$\"/>\n</td>\n<td>\n<$list filter=\"$:/config/shortcuts/ $:/config/shortcuts-mac/ $:/config/shortcuts-not-mac/ $:/config/shortcuts-linux/ $:/config/shortcuts-not-linux/ $:/config/shortcuts-windows/ $:/config/shortcuts-not-windows/\" variable=\"shortcutPrefix\">\n<<shortcut-preview>>\n</$list>\n</td>\n</tr>\n<$set name=\"dropdownState\" value={{$(dropdownStateTitle)$}}>\n<$list filter=\"[<dropdownState>prefix[open]]\" variable=\"listItem\">\n<<shortcut-editor>>\n</$list>\n</$set>\n\\end\n\n\\define shortcut-item()\n<$set name=\"dropdownStateTitle\" value=<<qualify \"$:/state/dropdown/keyboardshortcut/$(shortcutName)$\">>>\n<<shortcut-item-inner>>\n</$set>\n\\end\n\n<table>\n<tbody>\n<$list filter=\"[all[shadows+tiddlers]removeprefix[$:/config/ShortcutInfo/]]\" variable=\"shortcutName\">\n<<shortcut-item>>\n</$list>\n</tbody>\n</table>\n"
        },
        "$:/core/ui/ControlPanel/LoadedModules": {
            "title": "$:/core/ui/ControlPanel/LoadedModules",
            "tags": "$:/tags/ControlPanel/Advanced",
            "caption": "{{$:/language/ControlPanel/LoadedModules/Caption}}",
            "text": "\\define lingo-base() $:/language/ControlPanel/\n<<lingo LoadedModules/Hint>>\n\n{{$:/snippets/modules}}\n"
        },
        "$:/core/ui/ControlPanel/Modals/AddPlugins": {
            "title": "$:/core/ui/ControlPanel/Modals/AddPlugins",
            "subtitle": "{{$:/core/images/download-button}} {{$:/language/ControlPanel/Plugins/Add/Caption}}",
            "text": "\\define install-plugin-button()\n<$button>\n<$action-sendmessage $message=\"tm-load-plugin-from-library\" url={{!!url}} title={{$(assetInfo)$!!original-title}}/>\n<$list filter=\"[<assetInfo>get[original-title]get[version]]\" variable=\"installedVersion\" emptyMessage=\"\"\"{{$:/language/ControlPanel/Plugins/Install/Caption}}\"\"\">\n{{$:/language/ControlPanel/Plugins/Reinstall/Caption}}\n</$list>\n</$button>\n\\end\n\n\\define popup-state-macro()\n$:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$\n\\end\n\n\\define display-plugin-info(type)\n<$set name=\"popup-state\" value=<<popup-state-macro>>>\n<div class=\"tc-plugin-info\">\n<div class=\"tc-plugin-info-chunk tc-small-icon\">\n<$reveal type=\"nomatch\" state=<<popup-state>> text=\"yes\">\n<$button class=\"tc-btn-invisible tc-btn-dropdown\" set=<<popup-state>> setTo=\"yes\">\n{{$:/core/images/right-arrow}}\n</$button>\n</$reveal>\n<$reveal type=\"match\" state=<<popup-state>> text=\"yes\">\n<$button class=\"tc-btn-invisible tc-btn-dropdown\" set=<<popup-state>> setTo=\"no\">\n{{$:/core/images/down-arrow}}\n</$button>\n</$reveal>\n</div>\n<div class=\"tc-plugin-info-chunk\">\n<$list filter=\"[<assetInfo>has[icon]]\" emptyMessage=\"\"\"<$transclude tiddler=\"$:/core/images/plugin-generic-$type$\"/>\"\"\">\n<img src={{$(assetInfo)$!!icon}}/>\n</$list>\n</div>\n<div class=\"tc-plugin-info-chunk\">\n<h1><$view tiddler=<<assetInfo>> field=\"description\"/></h1>\n<h2><$view tiddler=<<assetInfo>> field=\"original-title\"/></h2>\n<div><em><$view tiddler=<<assetInfo>> field=\"version\"/></em></div>\n</div>\n<div class=\"tc-plugin-info-chunk\">\n<<install-plugin-button>>\n</div>\n</div>\n<$reveal type=\"match\" text=\"yes\" state=<<popup-state>>>\n<div class=\"tc-plugin-info-dropdown\">\n<div class=\"tc-plugin-info-dropdown-message\">\n<$list filter=\"[<assetInfo>get[original-title]get[version]]\" variable=\"installedVersion\" emptyMessage=\"\"\"{{$:/language/ControlPanel/Plugins/NotInstalled/Hint}}\"\"\">\n<em>\n{{$:/language/ControlPanel/Plugins/AlreadyInstalled/Hint}}\n</em>\n</$list>\n</div>\n<div class=\"tc-plugin-info-dropdown-body\">\n<$transclude tiddler=<<assetInfo>> field=\"readme\" mode=\"block\"/>\n</div>\n</div>\n</$reveal>\n</$set>\n\\end\n\n\\define load-plugin-library-button()\n<$button class=\"tc-btn-big-green\">\n<$action-sendmessage $message=\"tm-load-plugin-library\" url={{!!url}} infoTitlePrefix=\"$:/temp/RemoteAssetInfo/\"/>\n{{$:/core/images/chevron-right}} {{$:/language/ControlPanel/Plugins/OpenPluginLibrary}}\n</$button>\n\\end\n\n\\define display-server-assets(type)\n{{$:/language/Search/Search}}: <$edit-text tiddler=\"\"\"$:/temp/RemoteAssetSearch/$(currentTiddler)$\"\"\" default=\"\" type=\"search\" tag=\"input\"/>\n<$reveal state=\"\"\"$:/temp/RemoteAssetSearch/$(currentTiddler)$\"\"\" type=\"nomatch\" text=\"\">\n<$button class=\"tc-btn-invisible\">\n<$action-setfield $tiddler=\"\"\"$:/temp/RemoteAssetSearch/$(currentTiddler)$\"\"\" $field=\"text\" $value=\"\"/>\n{{$:/core/images/close-button}}\n</$button>\n</$reveal>\n<div class=\"tc-plugin-library-listing\">\n<$list filter=\"[all[tiddlers+shadows]tag[$:/tags/RemoteAssetInfo]server-url{!!url}original-plugin-type[$type$]search{$:/temp/RemoteAssetSearch/$(currentTiddler)$}sort[description]]\" variable=\"assetInfo\">\n<<display-plugin-info \"$type$\">>\n</$list>\n</div>\n\\end\n\n\\define display-server-connection()\n<$list filter=\"[all[tiddlers+shadows]tag[$:/tags/ServerConnection]suffix{!!url}]\" variable=\"connectionTiddler\" emptyMessage=<<load-plugin-library-button>>>\n\n<<tabs \"[[$:/core/ui/ControlPanel/Plugins/Add/Plugins]] [[$:/core/ui/ControlPanel/Plugins/Add/Themes]] [[$:/core/ui/ControlPanel/Plugins/Add/Languages]]\" \"$:/core/ui/ControlPanel/Plugins/Add/Plugins\">>\n\n</$list>\n\\end\n\n\\define close-library-button()\n<$reveal type='nomatch' state='$:/temp/ServerConnection/$(PluginLibraryURL)$' text=''>\n<$button class='tc-btn-big-green'>\n<$action-sendmessage $message=\"tm-unload-plugin-library\" url={{!!url}}/>\n{{$:/core/images/chevron-left}} {{$:/language/ControlPanel/Plugins/ClosePluginLibrary}}\n<$action-deletetiddler $filter=\"[prefix[$:/temp/ServerConnection/$(PluginLibraryURL)$]][prefix[$:/temp/RemoteAssetInfo/$(PluginLibraryURL)$]]\"/>\n</$button>\n</$reveal>\n\\end\n\n\\define plugin-library-listing()\n<$list filter=\"[all[tiddlers+shadows]tag[$:/tags/PluginLibrary]]\">\n<div class=\"tc-plugin-library\">\n\n!! <$link><$transclude field=\"caption\"><$view field=\"title\"/></$transclude></$link>\n\n//<$view field=\"url\"/>//\n\n<$transclude/>\n\n<$set name=PluginLibraryURL value={{!!url}}>\n<<close-library-button>>\n</$set>\n\n<<display-server-connection>>\n</div>\n</$list>\n\\end\n\n<$importvariables filter=\"[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]\">\n\n<div>\n<<plugin-library-listing>>\n</div>\n\n</$importvariables>\n"
        },
        "$:/core/ui/ControlPanel/Palette": {
            "title": "$:/core/ui/ControlPanel/Palette",
            "tags": "$:/tags/ControlPanel/Appearance",
            "caption": "{{$:/language/ControlPanel/Palette/Caption}}",
            "text": "\\define lingo-base() $:/language/ControlPanel/Palette/\n\n{{$:/snippets/paletteswitcher}}\n\n<$reveal type=\"nomatch\" state=\"$:/state/ShowPaletteEditor\" text=\"yes\">\n\n<$button set=\"$:/state/ShowPaletteEditor\" setTo=\"yes\"><<lingo ShowEditor/Caption>></$button>\n\n</$reveal>\n\n<$reveal type=\"match\" state=\"$:/state/ShowPaletteEditor\" text=\"yes\">\n\n<$button set=\"$:/state/ShowPaletteEditor\" setTo=\"no\"><<lingo HideEditor/Caption>></$button>\n{{$:/snippets/paletteeditor}}\n\n</$reveal>\n\n"
        },
        "$:/core/ui/ControlPanel/Parsing": {
            "title": "$:/core/ui/ControlPanel/Parsing",
            "tags": "$:/tags/ControlPanel/Advanced",
            "caption": "{{$:/language/ControlPanel/Parsing/Caption}}",
            "text": "\\define lingo-base() $:/language/ControlPanel/Parsing/\n\n\\define toggle(Type)\n<$checkbox\ntiddler=\"\"\"$:/config/WikiParserRules/$Type$/$(rule)$\"\"\"\nfield=\"text\"\nchecked=\"enable\"\nunchecked=\"disable\"\ndefault=\"enable\">\n<<rule>>\n</$checkbox>\n\\end\n\n\\define rules(type,Type)\n<$list filter=\"[wikiparserrules[$type$]]\" variable=\"rule\">\n<dd><<toggle $Type$>></dd>\n</$list>\n\\end\n\n<<lingo Hint>>\n\n<dl>\n<dt><<lingo Pragma/Caption>></dt>\n<<rules pragma Pragma>>\n<dt><<lingo Inline/Caption>></dt>\n<<rules inline Inline>>\n<dt><<lingo Block/Caption>></dt>\n<<rules block Block>>\n</dl>"
        },
        "$:/core/ui/ControlPanel/Plugins/Add/Languages": {
            "title": "$:/core/ui/ControlPanel/Plugins/Add/Languages",
            "caption": "{{$:/language/ControlPanel/Plugins/Languages/Caption}} (<$count filter=\"[all[tiddlers+shadows]tag[$:/tags/RemoteAssetInfo]server-url{!!url}original-plugin-type[language]]\"/>)",
            "text": "<<display-server-assets language>>\n"
        },
        "$:/core/ui/ControlPanel/Plugins/Add/Plugins": {
            "title": "$:/core/ui/ControlPanel/Plugins/Add/Plugins",
            "caption": "{{$:/language/ControlPanel/Plugins/Plugins/Caption}}  (<$count filter=\"[all[tiddlers+shadows]tag[$:/tags/RemoteAssetInfo]server-url{!!url}original-plugin-type[plugin]]\"/>)",
            "text": "<<display-server-assets plugin>>\n"
        },
        "$:/core/ui/ControlPanel/Plugins/Add/Themes": {
            "title": "$:/core/ui/ControlPanel/Plugins/Add/Themes",
            "caption": "{{$:/language/ControlPanel/Plugins/Themes/Caption}}  (<$count filter=\"[all[tiddlers+shadows]tag[$:/tags/RemoteAssetInfo]server-url{!!url}original-plugin-type[theme]]\"/>)",
            "text": "<<display-server-assets theme>>\n"
        },
        "$:/core/ui/ControlPanel/Plugins/AddPlugins": {
            "title": "$:/core/ui/ControlPanel/Plugins/AddPlugins",
            "text": "\\define lingo-base() $:/language/ControlPanel/Plugins/\n\n<$button message=\"tm-modal\" param=\"$:/core/ui/ControlPanel/Modals/AddPlugins\" tooltip={{$:/language/ControlPanel/Plugins/Add/Hint}} class=\"tc-btn-big-green\" style=\"background:blue;\">\n{{$:/core/images/download-button}} <<lingo Add/Caption>>\n</$button>\n"
        },
        "$:/core/ui/ControlPanel/Plugins/Installed/Languages": {
            "title": "$:/core/ui/ControlPanel/Plugins/Installed/Languages",
            "caption": "{{$:/language/ControlPanel/Plugins/Languages/Caption}} (<$count filter=\"[!has[draft.of]plugin-type[language]]\"/>)",
            "text": "<<plugin-table language>>\n"
        },
        "$:/core/ui/ControlPanel/Plugins/Installed/Plugins": {
            "title": "$:/core/ui/ControlPanel/Plugins/Installed/Plugins",
            "caption": "{{$:/language/ControlPanel/Plugins/Plugins/Caption}} (<$count filter=\"[!has[draft.of]plugin-type[plugin]]\"/>)",
            "text": "<<plugin-table plugin>>\n"
        },
        "$:/core/ui/ControlPanel/Plugins/Installed/Themes": {
            "title": "$:/core/ui/ControlPanel/Plugins/Installed/Themes",
            "caption": "{{$:/language/ControlPanel/Plugins/Themes/Caption}} (<$count filter=\"[!has[draft.of]plugin-type[theme]]\"/>)",
            "text": "<<plugin-table theme>>\n"
        },
        "$:/core/ui/ControlPanel/Plugins": {
            "title": "$:/core/ui/ControlPanel/Plugins",
            "tags": "$:/tags/ControlPanel",
            "caption": "{{$:/language/ControlPanel/Plugins/Caption}}",
            "text": "\\define lingo-base() $:/language/ControlPanel/Plugins/\n\n\\define plugin-table(type)\n<$set name=\"plugin-type\" value=\"\"\"$type$\"\"\">\n<$set name=\"qualified-state\" value=<<qualify \"$:/state/plugin-info\">>>\n<$list filter=\"[!has[draft.of]plugin-type[$type$]sort[description]]\" emptyMessage=<<lingo \"Empty/Hint\">> template=\"$:/core/ui/Components/plugin-info\"/>\n</$set>\n</$set>\n\\end\n\n{{$:/core/ui/ControlPanel/Plugins/AddPlugins}}\n\n<<lingo Installed/Hint>>\n\n<<tabs \"[[$:/core/ui/ControlPanel/Plugins/Installed/Plugins]] [[$:/core/ui/ControlPanel/Plugins/Installed/Themes]] [[$:/core/ui/ControlPanel/Plugins/Installed/Languages]]\" \"$:/core/ui/ControlPanel/Plugins/Installed/Plugins\">>\n"
        },
        "$:/core/ui/ControlPanel/Saving/DownloadSaver": {
            "title": "$:/core/ui/ControlPanel/Saving/DownloadSaver",
            "tags": "$:/tags/ControlPanel/Saving",
            "caption": "{{$:/language/ControlPanel/Saving/DownloadSaver/Caption}}",
            "text": "\\define lingo-base() $:/language/ControlPanel/Saving/DownloadSaver/\n\n<<lingo Hint>>\n\n!! <$link to=\"$:/config/DownloadSaver/AutoSave\"><<lingo AutoSave/Hint>></$link>\n\n<$checkbox tiddler=\"$:/config/DownloadSaver/AutoSave\" field=\"text\" checked=\"yes\" unchecked=\"no\" default=\"no\"> <<lingo AutoSave/Description>> </$checkbox>\n"
        },
        "$:/core/ui/ControlPanel/Saving/General": {
            "title": "$:/core/ui/ControlPanel/Saving/General",
            "tags": "$:/tags/ControlPanel/Saving",
            "caption": "{{$:/language/ControlPanel/Saving/General/Caption}}",
            "list-before": "",
            "text": "\\define lingo-base() $:/language/ControlPanel/Settings/\n\n{{$:/language/ControlPanel/Saving/General/Hint}}\n\n!! <$link to=\"$:/config/AutoSave\"><<lingo AutoSave/Caption>></$link>\n\n<<lingo AutoSave/Hint>>\n\n<$radio tiddler=\"$:/config/AutoSave\" value=\"yes\"> <<lingo AutoSave/Enabled/Description>> </$radio>\n\n<$radio tiddler=\"$:/config/AutoSave\" value=\"no\"> <<lingo AutoSave/Disabled/Description>> </$radio>\n"
        },
        "$:/core/ui/ControlPanel/Saving/TiddlySpot": {
            "title": "$:/core/ui/ControlPanel/Saving/TiddlySpot",
            "tags": "$:/tags/ControlPanel/Saving",
            "caption": "{{$:/language/ControlPanel/Saving/TiddlySpot/Caption}}",
            "text": "\\define lingo-base() $:/language/ControlPanel/Saving/TiddlySpot/\n\n\\define backupURL()\nhttp://$(userName)$.tiddlyspot.com/backup/\n\\end\n\\define backupLink()\n<$reveal type=\"nomatch\" state=\"$:/UploadName\" text=\"\">\n<$set name=\"userName\" value={{$:/UploadName}}>\n<$reveal type=\"match\" state=\"$:/UploadURL\" text=\"\">\n<<backupURL>>\n</$reveal>\n<$reveal type=\"nomatch\" state=\"$:/UploadURL\" text=\"\">\n<$macrocall $name=resolvePath source={{$:/UploadBackupDir}} root={{$:/UploadURL}}>>\n</$reveal>\n</$set>\n</$reveal>\n\\end\n\n<<lingo Description>>\n\n|<<lingo UserName>> |<$edit-text tiddler=\"$:/UploadName\" default=\"\" tag=\"input\"/> |\n|<<lingo Password>> |<$password name=\"upload\"/> |\n|<<lingo Backups>> |<<backupLink>> |\n\n''<<lingo Advanced/Heading>>''\n\n|<<lingo ServerURL>>  |<$edit-text tiddler=\"$:/UploadURL\" default=\"\" tag=\"input\"/> |\n|<<lingo Filename>> |<$edit-text tiddler=\"$:/UploadFilename\" default=\"index.html\" tag=\"input\"/> |\n|<<lingo UploadDir>> |<$edit-text tiddler=\"$:/UploadDir\" default=\".\" tag=\"input\"/> |\n|<<lingo BackupDir>> |<$edit-text tiddler=\"$:/UploadBackupDir\" default=\".\" tag=\"input\"/> |\n\n<<lingo TiddlySpot/Hint>>"
        },
        "$:/core/ui/ControlPanel/Saving": {
            "title": "$:/core/ui/ControlPanel/Saving",
            "tags": "$:/tags/ControlPanel",
            "caption": "{{$:/language/ControlPanel/Saving/Caption}}",
            "text": "{{$:/language/ControlPanel/Saving/Hint}}\n\n<div class=\"tc-control-panel\">\n<<tabs \"[all[shadows+tiddlers]tag[$:/tags/ControlPanel/Saving]!has[draft.of]]\" \"$:/core/ui/ControlPanel/Saving/General\">>\n</div>\n"
        },
        "$:/core/buttonstyles/Borderless": {
            "title": "$:/core/buttonstyles/Borderless",
            "tags": "$:/tags/ToolbarButtonStyle",
            "caption": "{{$:/language/ControlPanel/Settings/ToolbarButtonStyle/Styles/Borderless}}",
            "text": "tc-btn-invisible"
        },
        "$:/core/buttonstyles/Boxed": {
            "title": "$:/core/buttonstyles/Boxed",
            "tags": "$:/tags/ToolbarButtonStyle",
            "caption": "{{$:/language/ControlPanel/Settings/ToolbarButtonStyle/Styles/Boxed}}",
            "text": "tc-btn-boxed"
        },
        "$:/core/buttonstyles/Rounded": {
            "title": "$:/core/buttonstyles/Rounded",
            "tags": "$:/tags/ToolbarButtonStyle",
            "caption": "{{$:/language/ControlPanel/Settings/ToolbarButtonStyle/Styles/Rounded}}",
            "text": "tc-btn-rounded"
        },
        "$:/core/ui/ControlPanel/Settings/CamelCase": {
            "title": "$:/core/ui/ControlPanel/Settings/CamelCase",
            "tags": "$:/tags/ControlPanel/Settings",
            "caption": "{{$:/language/ControlPanel/Settings/CamelCase/Caption}}",
            "text": "\\define lingo-base() $:/language/ControlPanel/Settings/CamelCase/\n<<lingo Hint>>\n\n<$checkbox tiddler=\"$:/config/WikiParserRules/Inline/wikilink\" field=\"text\" checked=\"enable\" unchecked=\"disable\" default=\"enable\"> <$link to=\"$:/config/WikiParserRules/Inline/wikilink\"><<lingo Description>></$link> </$checkbox>\n"
        },
        "$:/core/ui/ControlPanel/Settings/DefaultSidebarTab": {
            "caption": "{{$:/language/ControlPanel/Settings/DefaultSidebarTab/Caption}}",
            "tags": "$:/tags/ControlPanel/Settings",
            "title": "$:/core/ui/ControlPanel/Settings/DefaultSidebarTab",
            "text": "\\define lingo-base() $:/language/ControlPanel/Settings/DefaultSidebarTab/\n\n<$link to=\"$:/config/DefaultSidebarTab\"><<lingo Hint>></$link>\n\n<$select tiddler=\"$:/config/DefaultSidebarTab\">\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/SideBar]!has[draft.of]]\">\n<option value=<<currentTiddler>>><$transclude field=\"caption\"><$text text=<<currentTiddler>>/></$transclude></option>\n</$list>\n</$select>\n"
        },
        "$:/core/ui/ControlPanel/Settings/EditorToolbar": {
            "title": "$:/core/ui/ControlPanel/Settings/EditorToolbar",
            "tags": "$:/tags/ControlPanel/Settings",
            "caption": "{{$:/language/ControlPanel/Settings/EditorToolbar/Caption}}",
            "text": "\\define lingo-base() $:/language/ControlPanel/Settings/EditorToolbar/\n<<lingo Hint>>\n\n<$checkbox tiddler=\"$:/config/TextEditor/EnableToolbar\" field=\"text\" checked=\"yes\" unchecked=\"no\" default=\"yes\"> <$link to=\"$:/config/TextEditor/EnableToolbar\"><<lingo Description>></$link> </$checkbox>\n\n"
        },
        "$:/core/ui/ControlPanel/Settings/InfoPanelMode": {
            "title": "$:/core/ui/ControlPanel/Settings/InfoPanelMode",
            "tags": "$:/tags/ControlPanel/Settings",
            "caption": "{{$:/language/ControlPanel/Settings/InfoPanelMode/Caption}}",
            "text": "\\define lingo-base() $:/language/ControlPanel/Settings/InfoPanelMode/\n<$link to=\"$:/config/TiddlerInfo/Mode\"><<lingo Hint>></$link>\n\n<$radio tiddler=\"$:/config/TiddlerInfo/Mode\" value=\"popup\"> <<lingo Popup/Description>> </$radio>\n\n<$radio tiddler=\"$:/config/TiddlerInfo/Mode\" value=\"sticky\"> <<lingo Sticky/Description>> </$radio>\n"
        },
        "$:/core/ui/ControlPanel/Settings/LinkToBehaviour": {
            "title": "$:/core/ui/ControlPanel/Settings/LinkToBehaviour",
            "tags": "$:/tags/ControlPanel/Settings",
            "caption": "{{$:/language/ControlPanel/Settings/LinkToBehaviour/Caption}}",
            "text": "\\define lingo-base() $:/language/ControlPanel/Settings/LinkToBehaviour/\n\n<$link to=\"$:/config/Navigation/openLinkFromInsideRiver\"><<lingo \"InsideRiver/Hint\">></$link>\n\n<$select tiddler=\"$:/config/Navigation/openLinkFromInsideRiver\">\n  <option value=\"above\"><<lingo \"OpenAbove\">></option>\n  <option value=\"below\"><<lingo \"OpenBelow\">></option>\n  <option value=\"top\"><<lingo \"OpenAtTop\">></option>\n  <option value=\"bottom\"><<lingo \"OpenAtBottom\">></option>\n</$select>\n\n<$link to=\"$:/config/Navigation/openLinkFromOutsideRiver\"><<lingo \"OutsideRiver/Hint\">></$link>\n\n<$select tiddler=\"$:/config/Navigation/openLinkFromOutsideRiver\">\n  <option value=\"top\"><<lingo \"OpenAtTop\">></option>\n  <option value=\"bottom\"><<lingo \"OpenAtBottom\">></option>\n</$select>\n"
        },
        "$:/core/ui/ControlPanel/Settings/MissingLinks": {
            "title": "$:/core/ui/ControlPanel/Settings/MissingLinks",
            "tags": "$:/tags/ControlPanel/Settings",
            "caption": "{{$:/language/ControlPanel/Settings/MissingLinks/Caption}}",
            "text": "\\define lingo-base() $:/language/ControlPanel/Settings/MissingLinks/\n<<lingo Hint>>\n\n<$checkbox tiddler=\"$:/config/MissingLinks\" field=\"text\" checked=\"yes\" unchecked=\"no\" default=\"yes\"> <$link to=\"$:/config/MissingLinks\"><<lingo Description>></$link> </$checkbox>\n\n"
        },
        "$:/core/ui/ControlPanel/Settings/NavigationAddressBar": {
            "title": "$:/core/ui/ControlPanel/Settings/NavigationAddressBar",
            "tags": "$:/tags/ControlPanel/Settings",
            "caption": "{{$:/language/ControlPanel/Settings/NavigationAddressBar/Caption}}",
            "text": "\\define lingo-base() $:/language/ControlPanel/Settings/NavigationAddressBar/\n\n<$link to=\"$:/config/Navigation/UpdateAddressBar\"><<lingo Hint>></$link>\n\n<$radio tiddler=\"$:/config/Navigation/UpdateAddressBar\" value=\"permaview\"> <<lingo Permaview/Description>> </$radio>\n\n<$radio tiddler=\"$:/config/Navigation/UpdateAddressBar\" value=\"permalink\"> <<lingo Permalink/Description>> </$radio>\n\n<$radio tiddler=\"$:/config/Navigation/UpdateAddressBar\" value=\"no\"> <<lingo No/Description>> </$radio>\n"
        },
        "$:/core/ui/ControlPanel/Settings/NavigationHistory": {
            "title": "$:/core/ui/ControlPanel/Settings/NavigationHistory",
            "tags": "$:/tags/ControlPanel/Settings",
            "caption": "{{$:/language/ControlPanel/Settings/NavigationHistory/Caption}}",
            "text": "\\define lingo-base() $:/language/ControlPanel/Settings/NavigationHistory/\n<$link to=\"$:/config/Navigation/UpdateHistory\"><<lingo Hint>></$link>\n\n<$radio tiddler=\"$:/config/Navigation/UpdateHistory\" value=\"yes\"> <<lingo Yes/Description>> </$radio>\n\n<$radio tiddler=\"$:/config/Navigation/UpdateHistory\" value=\"no\"> <<lingo No/Description>> </$radio>\n"
        },
        "$:/core/ui/ControlPanel/Settings/PerformanceInstrumentation": {
            "title": "$:/core/ui/ControlPanel/Settings/PerformanceInstrumentation",
            "tags": "$:/tags/ControlPanel/Settings",
            "caption": "{{$:/language/ControlPanel/Settings/PerformanceInstrumentation/Caption}}",
            "text": "\\define lingo-base() $:/language/ControlPanel/Settings/PerformanceInstrumentation/\n<<lingo Hint>>\n\n<$checkbox tiddler=\"$:/config/Performance/Instrumentation\" field=\"text\" checked=\"yes\" unchecked=\"no\" default=\"no\"> <$link to=\"$:/config/Performance/Instrumentation\"><<lingo Description>></$link> </$checkbox>\n"
        },
        "$:/core/ui/ControlPanel/Settings/TitleLinks": {
            "title": "$:/core/ui/ControlPanel/Settings/TitleLinks",
            "tags": "$:/tags/ControlPanel/Settings",
            "caption": "{{$:/language/ControlPanel/Settings/TitleLinks/Caption}}",
            "text": "\\define lingo-base() $:/language/ControlPanel/Settings/TitleLinks/\n<$link to=\"$:/config/Tiddlers/TitleLinks\"><<lingo Hint>></$link>\n\n<$radio tiddler=\"$:/config/Tiddlers/TitleLinks\" value=\"yes\"> <<lingo Yes/Description>> </$radio>\n\n<$radio tiddler=\"$:/config/Tiddlers/TitleLinks\" value=\"no\"> <<lingo No/Description>> </$radio>\n"
        },
        "$:/core/ui/ControlPanel/Settings/ToolbarButtonStyle": {
            "title": "$:/core/ui/ControlPanel/Settings/ToolbarButtonStyle",
            "tags": "$:/tags/ControlPanel/Settings",
            "caption": "{{$:/language/ControlPanel/Settings/ToolbarButtonStyle/Caption}}",
            "text": "\\define lingo-base() $:/language/ControlPanel/Settings/ToolbarButtonStyle/\n<$link to=\"$:/config/Toolbar/ButtonClass\"><<lingo \"Hint\">></$link>\n\n<$select tiddler=\"$:/config/Toolbar/ButtonClass\">\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/ToolbarButtonStyle]]\">\n<option value={{!!text}}>{{!!caption}}</option>\n</$list>\n</$select>\n"
        },
        "$:/core/ui/ControlPanel/Settings/ToolbarButtons": {
            "title": "$:/core/ui/ControlPanel/Settings/ToolbarButtons",
            "tags": "$:/tags/ControlPanel/Settings",
            "caption": "{{$:/language/ControlPanel/Settings/ToolbarButtons/Caption}}",
            "text": "\\define lingo-base() $:/language/ControlPanel/Settings/ToolbarButtons/\n<<lingo Hint>>\n\n<$checkbox tiddler=\"$:/config/Toolbar/Icons\" field=\"text\" checked=\"yes\" unchecked=\"no\" default=\"yes\"> <$link to=\"$:/config/Toolbar/Icons\"><<lingo Icons/Description>></$link> </$checkbox>\n\n<$checkbox tiddler=\"$:/config/Toolbar/Text\" field=\"text\" checked=\"yes\" unchecked=\"no\" default=\"no\"> <$link to=\"$:/config/Toolbar/Text\"><<lingo Text/Description>></$link> </$checkbox>\n"
        },
        "$:/core/ui/ControlPanel/Settings": {
            "title": "$:/core/ui/ControlPanel/Settings",
            "tags": "$:/tags/ControlPanel",
            "caption": "{{$:/language/ControlPanel/Settings/Caption}}",
            "text": "\\define lingo-base() $:/language/ControlPanel/Settings/\n\n<<lingo Hint>>\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/ControlPanel/Settings]]\">\n\n<div style=\"border-top:1px solid #eee;\">\n\n!! <$link><$transclude field=\"caption\"/></$link>\n\n<$transclude/>\n\n</div>\n\n</$list>\n"
        },
        "$:/core/ui/ControlPanel/StoryView": {
            "title": "$:/core/ui/ControlPanel/StoryView",
            "tags": "$:/tags/ControlPanel/Appearance",
            "caption": "{{$:/language/ControlPanel/StoryView/Caption}}",
            "text": "{{$:/snippets/viewswitcher}}\n"
        },
        "$:/core/ui/ControlPanel/Theme": {
            "title": "$:/core/ui/ControlPanel/Theme",
            "tags": "$:/tags/ControlPanel/Appearance",
            "caption": "{{$:/language/ControlPanel/Theme/Caption}}",
            "text": "{{$:/snippets/themeswitcher}}\n"
        },
        "$:/core/ui/ControlPanel/TiddlerFields": {
            "title": "$:/core/ui/ControlPanel/TiddlerFields",
            "tags": "$:/tags/ControlPanel/Advanced",
            "caption": "{{$:/language/ControlPanel/TiddlerFields/Caption}}",
            "text": "\\define lingo-base() $:/language/ControlPanel/\n\n<<lingo TiddlerFields/Hint>>\n\n{{$:/snippets/allfields}}"
        },
        "$:/core/ui/ControlPanel/Toolbars/EditToolbar": {
            "title": "$:/core/ui/ControlPanel/Toolbars/EditToolbar",
            "tags": "$:/tags/ControlPanel/Toolbars",
            "caption": "{{$:/language/ControlPanel/Toolbars/EditToolbar/Caption}}",
            "text": "\\define lingo-base() $:/language/TiddlerInfo/\n\n\\define config-base() $:/config/EditToolbarButtons/Visibility/\n\n{{$:/language/ControlPanel/Toolbars/EditToolbar/Hint}}\n\n<$set name=\"tv-config-toolbar-icons\" value=\"yes\">\n\n<$set name=\"tv-config-toolbar-text\" value=\"yes\">\n\n<$macrocall $name=\"list-tagged-draggable\" tag=\"$:/tags/EditToolbar\" itemTemplate=\"$:/core/ui/ControlPanel/Toolbars/ItemTemplate\"/>\n\n</$set>\n\n</$set>"
        },
        "$:/core/ui/ControlPanel/Toolbars/EditorItemTemplate": {
            "title": "$:/core/ui/ControlPanel/Toolbars/EditorItemTemplate",
            "text": "\\define config-title()\n$(config-base)$$(currentTiddler)$\n\\end\n\n<$draggable tiddler=<<currentTiddler>>>\n<$checkbox tiddler=<<config-title>> field=\"text\" checked=\"show\" unchecked=\"hide\" default=\"show\"/> <span class=\"tc-icon-wrapper\"><$transclude tiddler={{!!icon}}/></span> <$transclude field=\"caption\"/> -- <i class=\"tc-muted\"><$transclude field=\"description\"/></i>\n</$draggable>\n"
        },
        "$:/core/ui/ControlPanel/Toolbars/EditorToolbar": {
            "title": "$:/core/ui/ControlPanel/Toolbars/EditorToolbar",
            "tags": "$:/tags/ControlPanel/Toolbars",
            "caption": "{{$:/language/ControlPanel/Toolbars/EditorToolbar/Caption}}",
            "text": "\\define lingo-base() $:/language/TiddlerInfo/\n\n\\define config-base() $:/config/EditorToolbarButtons/Visibility/\n\n{{$:/language/ControlPanel/Toolbars/EditorToolbar/Hint}}\n\n<$macrocall $name=\"list-tagged-draggable\" tag=\"$:/tags/EditorToolbar\" itemTemplate=\"$:/core/ui/ControlPanel/Toolbars/EditorItemTemplate\"/>\n"
        },
        "$:/core/ui/ControlPanel/Toolbars/ItemTemplate": {
            "title": "$:/core/ui/ControlPanel/Toolbars/ItemTemplate",
            "text": "\\define config-title()\n$(config-base)$$(currentTiddler)$\n\\end\n\n<$draggable tiddler=<<currentTiddler>>>\n<$checkbox tiddler=<<config-title>> field=\"text\" checked=\"show\" unchecked=\"hide\" default=\"show\"/> <span class=\"tc-icon-wrapper\"> <$transclude field=\"caption\"/> <i class=\"tc-muted\">-- <$transclude field=\"description\"/></i></span>\n</$draggable>\n"
        },
        "$:/core/ui/ControlPanel/Toolbars/PageControls": {
            "title": "$:/core/ui/ControlPanel/Toolbars/PageControls",
            "tags": "$:/tags/ControlPanel/Toolbars",
            "caption": "{{$:/language/ControlPanel/Toolbars/PageControls/Caption}}",
            "text": "\\define lingo-base() $:/language/TiddlerInfo/\n\n\\define config-base() $:/config/PageControlButtons/Visibility/\n\n{{$:/language/ControlPanel/Toolbars/PageControls/Hint}}\n\n<$set name=\"tv-config-toolbar-icons\" value=\"yes\">\n\n<$set name=\"tv-config-toolbar-text\" value=\"yes\">\n\n<$macrocall $name=\"list-tagged-draggable\" tag=\"$:/tags/PageControls\" itemTemplate=\"$:/core/ui/ControlPanel/Toolbars/ItemTemplate\"/>\n\n</$set>\n\n</$set>\n"
        },
        "$:/core/ui/ControlPanel/Toolbars/ViewToolbar": {
            "title": "$:/core/ui/ControlPanel/Toolbars/ViewToolbar",
            "tags": "$:/tags/ControlPanel/Toolbars",
            "caption": "{{$:/language/ControlPanel/Toolbars/ViewToolbar/Caption}}",
            "text": "\\define lingo-base() $:/language/TiddlerInfo/\n\n\\define config-base() $:/config/ViewToolbarButtons/Visibility/\n\n{{$:/language/ControlPanel/Toolbars/ViewToolbar/Hint}}\n\n<$set name=\"tv-config-toolbar-icons\" value=\"yes\">\n\n<$set name=\"tv-config-toolbar-text\" value=\"yes\">\n\n<$macrocall $name=\"list-tagged-draggable\" tag=\"$:/tags/ViewToolbar\" itemTemplate=\"$:/core/ui/ControlPanel/Toolbars/ItemTemplate\"/>\n\n</$set>\n\n</$set>\n"
        },
        "$:/core/ui/ControlPanel/Toolbars": {
            "title": "$:/core/ui/ControlPanel/Toolbars",
            "tags": "$:/tags/ControlPanel/Appearance",
            "caption": "{{$:/language/ControlPanel/Toolbars/Caption}}",
            "text": "{{$:/language/ControlPanel/Toolbars/Hint}}\n\n<div class=\"tc-control-panel\">\n<<tabs \"[all[shadows+tiddlers]tag[$:/tags/ControlPanel/Toolbars]!has[draft.of]]\" \"$:/core/ui/ControlPanel/Toolbars/ViewToolbar\" \"$:/state/tabs/controlpanel/toolbars\" \"tc-vertical\">>\n</div>\n"
        },
        "$:/ControlPanel": {
            "title": "$:/ControlPanel",
            "icon": "$:/core/images/options-button",
            "color": "#bbb",
            "text": "<div class=\"tc-control-panel\">\n<<tabs \"[all[shadows+tiddlers]tag[$:/tags/ControlPanel]!has[draft.of]]\" \"$:/core/ui/ControlPanel/Info\">>\n</div>\n"
        },
        "$:/core/ui/DefaultSearchResultList": {
            "title": "$:/core/ui/DefaultSearchResultList",
            "tags": "$:/tags/SearchResults",
            "caption": "{{$:/language/Search/DefaultResults/Caption}}",
            "text": "\\define searchResultList()\n//<small>{{$:/language/Search/Matches/Title}}</small>//\n\n<$list filter=\"[!is[system]search:title{$(searchTiddler)$}sort[title]limit[250]]\" template=\"$:/core/ui/ListItemTemplate\"/>\n\n//<small>{{$:/language/Search/Matches/All}}</small>//\n\n<$list filter=\"[!is[system]search{$(searchTiddler)$}sort[title]limit[250]]\" template=\"$:/core/ui/ListItemTemplate\"/>\n\n\\end\n<<searchResultList>>\n"
        },
        "$:/core/ui/EditTemplate/body/preview/output": {
            "title": "$:/core/ui/EditTemplate/body/preview/output",
            "tags": "$:/tags/EditPreview",
            "caption": "{{$:/language/EditTemplate/Body/Preview/Type/Output}}",
            "text": "<$set name=\"tv-tiddler-preview\" value=\"yes\">\n\n<$transclude />\n\n</$set>\n"
        },
        "$:/core/ui/EditTemplate/body/editor": {
            "title": "$:/core/ui/EditTemplate/body/editor",
            "text": "<$edit\n\n  field=\"text\"\n  class=\"tc-edit-texteditor\"\n  placeholder={{$:/language/EditTemplate/Body/Placeholder}}\n\n><$set\n\n  name=\"targetTiddler\"\n  value=<<currentTiddler>>\n\n><$list\n\n  filter=\"[all[shadows+tiddlers]tag[$:/tags/EditorToolbar]!has[draft.of]]\"\n\n><$reveal\n\n  type=\"nomatch\"\n  state=<<config-visibility-title>>\n  text=\"hide\"\n  class=\"tc-text-editor-toolbar-item-wrapper\"\n\n><$transclude\n\n  tiddler=\"$:/core/ui/EditTemplate/body/toolbar/button\"\n  mode=\"inline\"\n\n/></$reveal></$list></$set></$edit>\n"
        },
        "$:/core/ui/EditTemplate/body/toolbar/button": {
            "title": "$:/core/ui/EditTemplate/body/toolbar/button",
            "text": "\\define toolbar-button-icon()\n<$list\n\n  filter=\"[all[current]!has[custom-icon]]\"\n  variable=\"no-custom-icon\"\n\n><$transclude\n\n  tiddler={{!!icon}}\n\n/></$list>\n\\end\n\n\\define toolbar-button-tooltip()\n{{!!description}}<$macrocall $name=\"displayshortcuts\" $output=\"text/plain\" shortcuts={{!!shortcuts}} prefix=\"` - [\" separator=\"] [\" suffix=\"]`\"/>\n\\end\n\n\\define toolbar-button()\n<$list\n\n  filter={{!!condition}}\n  variable=\"list-condition\"\n\n><$wikify\n\n  name=\"tooltip-text\"\n  text=<<toolbar-button-tooltip>>\n  mode=\"inline\"\n  output=\"text\"\n\n><$list\n\n  filter=\"[all[current]!has[dropdown]]\"\n  variable=\"no-dropdown\"\n\n><$button\n\n  class=\"tc-btn-invisible $(buttonClasses)$\"\n  tooltip=<<tooltip-text>>\n\n><span\n\n  data-tw-keyboard-shortcut={{!!shortcuts}}\n\n/><<toolbar-button-icon>><$transclude\n\n  tiddler=<<currentTiddler>>\n  field=\"text\"\n\n/></$button></$list><$list\n\n  filter=\"[all[current]has[dropdown]]\"\n  variable=\"dropdown\"\n\n><$set\n\n  name=\"dropdown-state\"\n  value=<<qualify \"$:/state/EditorToolbarDropdown\">>\n\n><$button\n\n  popup=<<dropdown-state>>\n  class=\"tc-popup-keep tc-btn-invisible $(buttonClasses)$\"\n  selectedClass=\"tc-selected\"\n  tooltip=<<tooltip-text>>\n\n><span\n\n  data-tw-keyboard-shortcut={{!!shortcuts}}\n\n/><<toolbar-button-icon>><$transclude\n\n  tiddler=<<currentTiddler>>\n  field=\"text\"\n\n/></$button><$reveal\n\n  state=<<dropdown-state>>\n  type=\"popup\"\n  position=\"below\"\n  animate=\"yes\"\n  tag=\"span\"\n\n><div\n\n  class=\"tc-drop-down tc-popup-keep\"\n\n><$transclude\n\n  tiddler={{!!dropdown}}\n  mode=\"block\"\n\n/></div></$reveal></$set></$list></$wikify></$list>\n\\end\n\n\\define toolbar-button-outer()\n<$set\n\n  name=\"buttonClasses\"\n  value={{!!button-classes}}\n\n><<toolbar-button>></$set>\n\\end\n\n<<toolbar-button-outer>>"
        },
        "$:/core/ui/EditTemplate/body": {
            "title": "$:/core/ui/EditTemplate/body",
            "tags": "$:/tags/EditTemplate",
            "text": "\\define lingo-base() $:/language/EditTemplate/Body/\n\\define config-visibility-title()\n$:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$\n\\end\n<$list filter=\"[is[current]has[_canonical_uri]]\">\n\n<div class=\"tc-message-box\">\n\n<<lingo External/Hint>>\n\n<a href={{!!_canonical_uri}}><$text text={{!!_canonical_uri}}/></a>\n\n<$edit-text field=\"_canonical_uri\" class=\"tc-edit-fields\"></$edit-text>\n\n</div>\n\n</$list>\n\n<$list filter=\"[is[current]!has[_canonical_uri]]\">\n\n<$reveal state=\"$:/state/showeditpreview\" type=\"match\" text=\"yes\">\n\n<div class=\"tc-tiddler-preview\">\n\n<$transclude tiddler=\"$:/core/ui/EditTemplate/body/editor\" mode=\"inline\"/>\n\n<div class=\"tc-tiddler-preview-preview\">\n\n<$transclude tiddler={{$:/state/editpreviewtype}} mode=\"inline\">\n\n<$transclude tiddler=\"$:/core/ui/EditTemplate/body/preview/output\" mode=\"inline\"/>\n\n</$transclude>\n\n</div>\n\n</div>\n\n</$reveal>\n\n<$reveal state=\"$:/state/showeditpreview\" type=\"nomatch\" text=\"yes\">\n\n<$transclude tiddler=\"$:/core/ui/EditTemplate/body/editor\" mode=\"inline\"/>\n\n</$reveal>\n\n</$list>\n"
        },
        "$:/core/ui/EditTemplate/controls": {
            "title": "$:/core/ui/EditTemplate/controls",
            "tags": "$:/tags/EditTemplate",
            "text": "\\define config-title()\n$:/config/EditToolbarButtons/Visibility/$(listItem)$\n\\end\n<div class=\"tc-tiddler-title tc-tiddler-edit-title\">\n<$view field=\"title\"/>\n<span class=\"tc-tiddler-controls tc-titlebar\"><$list filter=\"[all[shadows+tiddlers]tag[$:/tags/EditToolbar]!has[draft.of]]\" variable=\"listItem\"><$reveal type=\"nomatch\" state=<<config-title>> text=\"hide\"><$transclude tiddler=<<listItem>>/></$reveal></$list></span>\n<div style=\"clear: both;\"></div>\n</div>\n"
        },
        "$:/core/ui/EditTemplate/fields": {
            "title": "$:/core/ui/EditTemplate/fields",
            "tags": "$:/tags/EditTemplate",
            "text": "\\define lingo-base() $:/language/EditTemplate/\n\\define config-title()\n$:/config/EditTemplateFields/Visibility/$(currentField)$\n\\end\n\n\\define config-filter()\n[[hide]] -[title{$(config-title)$}]\n\\end\n\n\\define new-field-inner()\n<$reveal type=\"nomatch\" text=\"\" default=<<name>>>\n<$button>\n<$action-sendmessage $message=\"tm-add-field\" $name=<<name>> $value=<<value>>/>\n<$action-deletetiddler $tiddler=\"$:/temp/newfieldname\"/>\n<$action-deletetiddler $tiddler=\"$:/temp/newfieldvalue\"/>\n<<lingo Fields/Add/Button>>\n</$button>\n</$reveal>\n<$reveal type=\"match\" text=\"\" default=<<name>>>\n<$button>\n<<lingo Fields/Add/Button>>\n</$button>\n</$reveal>\n\\end\n\n\\define new-field()\n<$set name=\"name\" value={{$:/temp/newfieldname}}>\n<$set name=\"value\" value={{$:/temp/newfieldvalue}}>\n<<new-field-inner>>\n</$set>\n</$set>\n\\end\n\n<div class=\"tc-edit-fields\">\n<table class=\"tc-edit-fields\">\n<tbody>\n<$list filter=\"[all[current]fields[]] +[sort[title]]\" variable=\"currentField\">\n<$list filter=<<config-filter>> variable=\"temp\">\n<tr class=\"tc-edit-field\">\n<td class=\"tc-edit-field-name\">\n<$text text=<<currentField>>/>:</td>\n<td class=\"tc-edit-field-value\">\n<$edit-text tiddler=<<currentTiddler>> field=<<currentField>> placeholder={{$:/language/EditTemplate/Fields/Add/Value/Placeholder}}/>\n</td>\n<td class=\"tc-edit-field-remove\">\n<$button class=\"tc-btn-invisible\" tooltip={{$:/language/EditTemplate/Field/Remove/Hint}} aria-label={{$:/language/EditTemplate/Field/Remove/Caption}}>\n<$action-deletefield $field=<<currentField>>/>\n{{$:/core/images/delete-button}}\n</$button>\n</td>\n</tr>\n</$list>\n</$list>\n</tbody>\n</table>\n</div>\n\n<$fieldmangler>\n<div class=\"tc-edit-field-add\">\n<em class=\"tc-edit\">\n<<lingo Fields/Add/Prompt>>\n</em>\n<span class=\"tc-edit-field-add-name\">\n<$edit-text tiddler=\"$:/temp/newfieldname\" tag=\"input\" default=\"\" placeholder={{$:/language/EditTemplate/Fields/Add/Name/Placeholder}} focusPopup=<<qualify \"$:/state/popup/field-dropdown\">> class=\"tc-edit-texteditor tc-popup-handle\"/>\n</span>\n<$button popup=<<qualify \"$:/state/popup/field-dropdown\">> class=\"tc-btn-invisible tc-btn-dropdown\" tooltip={{$:/language/EditTemplate/Field/Dropdown/Hint}} aria-label={{$:/language/EditTemplate/Field/Dropdown/Caption}}>{{$:/core/images/down-arrow}}</$button>\n<$reveal state=<<qualify \"$:/state/popup/field-dropdown\">> type=\"nomatch\" text=\"\" default=\"\">\n<div class=\"tc-block-dropdown tc-edit-type-dropdown\">\n<$linkcatcher to=\"$:/temp/newfieldname\">\n<div class=\"tc-dropdown-item\">\n<<lingo Fields/Add/Dropdown/User>>\n</div>\n<$list filter=\"[!is[shadow]!is[system]fields[]search:title{$:/temp/newfieldname}sort[]] -created -creator -draft.of -draft.title -modified -modifier -tags -text -title -type\"  variable=\"currentField\">\n<$link to=<<currentField>>>\n<<currentField>>\n</$link>\n</$list>\n<div class=\"tc-dropdown-item\">\n<<lingo Fields/Add/Dropdown/System>>\n</div>\n<$list filter=\"[fields[]search:title{$:/temp/newfieldname}sort[]] -[!is[shadow]!is[system]fields[]]\" variable=\"currentField\">\n<$link to=<<currentField>>>\n<<currentField>>\n</$link>\n</$list>\n</$linkcatcher>\n</div>\n</$reveal>\n<span class=\"tc-edit-field-add-value\">\n<$edit-text tiddler=\"$:/temp/newfieldvalue\" tag=\"input\" default=\"\" placeholder={{$:/language/EditTemplate/Fields/Add/Value/Placeholder}} class=\"tc-edit-texteditor\"/>\n</span>\n<span class=\"tc-edit-field-add-button\">\n<$macrocall $name=\"new-field\"/>\n</span>\n</div>\n</$fieldmangler>\n"
        },
        "$:/core/ui/EditTemplate/shadow": {
            "title": "$:/core/ui/EditTemplate/shadow",
            "tags": "$:/tags/EditTemplate",
            "text": "\\define lingo-base() $:/language/EditTemplate/Shadow/\n\\define pluginLinkBody()\n<$link to=\"\"\"$(pluginTitle)$\"\"\">\n<$text text=\"\"\"$(pluginTitle)$\"\"\"/>\n</$link>\n\\end\n<$list filter=\"[all[current]get[draft.of]is[shadow]!is[tiddler]]\">\n\n<$list filter=\"[all[current]shadowsource[]]\" variable=\"pluginTitle\">\n\n<$set name=\"pluginLink\" value=<<pluginLinkBody>>>\n<div class=\"tc-message-box\">\n\n<<lingo Warning>>\n\n</div>\n</$set>\n</$list>\n\n</$list>\n\n<$list filter=\"[all[current]get[draft.of]is[shadow]is[tiddler]]\">\n\n<$list filter=\"[all[current]shadowsource[]]\" variable=\"pluginTitle\">\n\n<$set name=\"pluginLink\" value=<<pluginLinkBody>>>\n<div class=\"tc-message-box\">\n\n<<lingo OverriddenWarning>>\n\n</div>\n</$set>\n</$list>\n\n</$list>"
        },
        "$:/core/ui/EditTemplate/tags": {
            "title": "$:/core/ui/EditTemplate/tags",
            "tags": "$:/tags/EditTemplate",
            "text": "\\define lingo-base() $:/language/EditTemplate/\n\n\\define tag-styles()\nbackground-color:$(backgroundColor)$;\nfill:$(foregroundColor)$;\ncolor:$(foregroundColor)$;\n\\end\n\n\\define tag-body-inner(colour,fallbackTarget,colourA,colourB)\n<$vars foregroundColor=<<contrastcolour target:\"\"\"$colour$\"\"\" fallbackTarget:\"\"\"$fallbackTarget$\"\"\" colourA:\"\"\"$colourA$\"\"\" colourB:\"\"\"$colourB$\"\"\">> backgroundColor=\"\"\"$colour$\"\"\">\n<span style=<<tag-styles>> class=\"tc-tag-label\">\n<$view field=\"title\" format=\"text\" />\n<$button message=\"tm-remove-tag\" param={{!!title}} class=\"tc-btn-invisible tc-remove-tag-button\">&times;</$button>\n</span>\n</$vars>\n\\end\n\n\\define tag-body(colour,palette)\n<$macrocall $name=\"tag-body-inner\" colour=\"\"\"$colour$\"\"\" fallbackTarget={{$palette$##tag-background}} colourA={{$palette$##foreground}} colourB={{$palette$##background}}/>\n\\end\n\n\\define tag-picker-actions()\n<$action-listops\n\t$tiddler=<<currentTiddler>>\n\t$field=\"tags\"\n\t$subfilter=\"[<tag>] [all[current]tags[]]\"\n/>\n\\end\n\n<div class=\"tc-edit-tags\">\n<$fieldmangler>\n<$list filter=\"[all[current]tags[]sort[title]]\" storyview=\"pop\">\n<$macrocall $name=\"tag-body\" colour={{!!color}} palette={{$:/palette}}/>\n</$list>\n</$fieldmangler>\n<$macrocall $name=\"tag-picker\" actions=<<tag-picker-actions>>/>\n</div>\n"
        },
        "$:/core/ui/EditTemplate/title": {
            "title": "$:/core/ui/EditTemplate/title",
            "tags": "$:/tags/EditTemplate",
            "text": "<$edit-text field=\"draft.title\" class=\"tc-titlebar tc-edit-texteditor\" focus=\"true\"/>\n\n<$vars pattern=\"\"\"[\\|\\[\\]{}]\"\"\" bad-chars=\"\"\"`| [ ] { }`\"\"\">\n\n<$list filter=\"[is[current]regexp:draft.title<pattern>]\" variable=\"listItem\">\n\n<div class=\"tc-message-box\">\n\n{{$:/core/images/warning}} {{$:/language/EditTemplate/Title/BadCharacterWarning}}\n\n</div>\n\n</$list>\n\n</$vars>\n\n<$reveal state=\"!!draft.title\" type=\"nomatch\" text={{!!draft.of}} tag=\"div\">\n\n<$list filter=\"[{!!draft.title}!is[missing]]\" variable=\"listItem\">\n\n<div class=\"tc-message-box\">\n\n{{$:/core/images/warning}} {{$:/language/EditTemplate/Title/Exists/Prompt}}\n\n</div>\n\n</$list>\n\n<$list filter=\"[{!!draft.of}!is[missing]]\" variable=\"listItem\">\n\n<$vars fromTitle={{!!draft.of}} toTitle={{!!draft.title}}>\n\n<$checkbox tiddler=\"$:/config/RelinkOnRename\" field=\"text\" checked=\"yes\" unchecked=\"no\" default=\"no\"> {{$:/language/EditTemplate/Title/Relink/Prompt}}</$checkbox>\n\n</$vars>\n\n</$list>\n\n</$reveal>\n\n\n"
        },
        "$:/core/ui/EditTemplate/type": {
            "title": "$:/core/ui/EditTemplate/type",
            "tags": "$:/tags/EditTemplate",
            "text": "\\define lingo-base() $:/language/EditTemplate/\n<div class=\"tc-type-selector\"><$fieldmangler>\n<em class=\"tc-edit\"><<lingo Type/Prompt>></em> <$edit-text field=\"type\" tag=\"input\" default=\"\" placeholder={{$:/language/EditTemplate/Type/Placeholder}} focusPopup=<<qualify \"$:/state/popup/type-dropdown\">> class=\"tc-edit-typeeditor tc-popup-handle\"/> <$button popup=<<qualify \"$:/state/popup/type-dropdown\">> class=\"tc-btn-invisible tc-btn-dropdown\" tooltip={{$:/language/EditTemplate/Type/Dropdown/Hint}} aria-label={{$:/language/EditTemplate/Type/Dropdown/Caption}}>{{$:/core/images/down-arrow}}</$button> <$button message=\"tm-remove-field\" param=\"type\" class=\"tc-btn-invisible tc-btn-icon\" tooltip={{$:/language/EditTemplate/Type/Delete/Hint}} aria-label={{$:/language/EditTemplate/Type/Delete/Caption}}>{{$:/core/images/delete-button}}</$button>\n</$fieldmangler></div>\n\n<div class=\"tc-block-dropdown-wrapper\">\n<$reveal state=<<qualify \"$:/state/popup/type-dropdown\">> type=\"nomatch\" text=\"\" default=\"\">\n<div class=\"tc-block-dropdown tc-edit-type-dropdown\">\n<$linkcatcher to=\"!!type\">\n<$list filter='[all[shadows+tiddlers]prefix[$:/language/Docs/Types/]each[group]sort[group-sort]]'>\n<div class=\"tc-dropdown-item\">\n<$text text={{!!group}}/>\n</div>\n<$list filter=\"[all[shadows+tiddlers]prefix[$:/language/Docs/Types/]group{!!group}] +[sort[description]]\"><$link to={{!!name}}><$view field=\"description\"/> (<$view field=\"name\"/>)</$link>\n</$list>\n</$list>\n</$linkcatcher>\n</div>\n</$reveal>\n</div>"
        },
        "$:/core/ui/EditTemplate": {
            "title": "$:/core/ui/EditTemplate",
            "text": "\\define actions()\n<$action-sendmessage $message=\"tm-add-tag\" $param={{$:/temp/NewTagName}}/>\n<$action-deletetiddler $tiddler=\"$:/temp/NewTagName\"/>\n<$action-sendmessage $message=\"tm-add-field\" $name={{$:/temp/newfieldname}} $value={{$:/temp/newfieldvalue}}/>\n<$action-deletetiddler $tiddler=\"$:/temp/newfieldname\"/>\n<$action-deletetiddler $tiddler=\"$:/temp/newfieldvalue\"/>\n<$action-sendmessage $message=\"tm-save-tiddler\"/>\n\\end\n\\define frame-classes()\ntc-tiddler-frame tc-tiddler-edit-frame $(missingTiddlerClass)$ $(shadowTiddlerClass)$ $(systemTiddlerClass)$\n\\end\n<div class=<<frame-classes>>>\n<$fieldmangler>\n<$set name=\"storyTiddler\" value=<<currentTiddler>>>\n<$keyboard key=\"((cancel-edit-tiddler))\" message=\"tm-cancel-tiddler\">\n<$keyboard key=\"((save-tiddler))\" actions=<<actions>>>\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/EditTemplate]!has[draft.of]]\" variable=\"listItem\">\n<$transclude tiddler=<<listItem>>/>\n</$list>\n</$keyboard>\n</$keyboard>\n</$set>\n</$fieldmangler>\n</div>\n"
        },
        "$:/core/ui/Buttons/cancel": {
            "title": "$:/core/ui/Buttons/cancel",
            "tags": "$:/tags/EditToolbar",
            "caption": "{{$:/core/images/cancel-button}} {{$:/language/Buttons/Cancel/Caption}}",
            "description": "{{$:/language/Buttons/Cancel/Hint}}",
            "text": "<$button message=\"tm-cancel-tiddler\" tooltip={{$:/language/Buttons/Cancel/Hint}} aria-label={{$:/language/Buttons/Cancel/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/cancel-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Cancel/Caption}}/></span>\n</$list>\n</$button>"
        },
        "$:/core/ui/Buttons/delete": {
            "title": "$:/core/ui/Buttons/delete",
            "tags": "$:/tags/EditToolbar $:/tags/ViewToolbar",
            "caption": "{{$:/core/images/delete-button}} {{$:/language/Buttons/Delete/Caption}}",
            "description": "{{$:/language/Buttons/Delete/Hint}}",
            "text": "<$button message=\"tm-delete-tiddler\" tooltip={{$:/language/Buttons/Delete/Hint}} aria-label={{$:/language/Buttons/Delete/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/delete-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Delete/Caption}}/></span>\n</$list>\n</$button>"
        },
        "$:/core/ui/Buttons/save": {
            "title": "$:/core/ui/Buttons/save",
            "tags": "$:/tags/EditToolbar",
            "caption": "{{$:/core/images/done-button}} {{$:/language/Buttons/Save/Caption}}",
            "description": "{{$:/language/Buttons/Save/Hint}}",
            "text": "<$fieldmangler><$button tooltip={{$:/language/Buttons/Save/Hint}} aria-label={{$:/language/Buttons/Save/Caption}} class=<<tv-config-toolbar-class>>>\n<$action-sendmessage $message=\"tm-add-tag\" $param={{$:/temp/NewTagName}}/>\n<$action-deletetiddler $tiddler=\"$:/temp/NewTagName\"/>\n<$action-sendmessage $message=\"tm-add-field\" $name={{$:/temp/newfieldname}} $value={{$:/temp/newfieldvalue}}/>\n<$action-deletetiddler $tiddler=\"$:/temp/newfieldname\"/>\n<$action-deletetiddler $tiddler=\"$:/temp/newfieldvalue\"/>\n<$action-sendmessage $message=\"tm-save-tiddler\"/>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/done-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Save/Caption}}/></span>\n</$list>\n</$button>\n</$fieldmangler>\n"
        },
        "$:/core/ui/EditorToolbar/bold": {
            "title": "$:/core/ui/EditorToolbar/bold",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/bold",
            "caption": "{{$:/language/Buttons/Bold/Caption}}",
            "description": "{{$:/language/Buttons/Bold/Hint}}",
            "condition": "[<targetTiddler>!has[type]] [<targetTiddler>type[text/vnd.tiddlywiki]]",
            "shortcuts": "((bold))",
            "text": "<$action-sendmessage\n\t$message=\"tm-edit-text-operation\"\n\t$param=\"wrap-selection\"\n\tprefix=\"''\"\n\tsuffix=\"''\"\n/>\n"
        },
        "$:/core/ui/EditorToolbar/clear-dropdown": {
            "title": "$:/core/ui/EditorToolbar/clear-dropdown",
            "text": "''{{$:/language/Buttons/Clear/Hint}}''\n\n<div class=\"tc-colour-chooser\">\n\n<$macrocall $name=\"colour-picker\" actions=\"\"\"\n\n<$action-sendmessage\n\t$message=\"tm-edit-bitmap-operation\"\n\t$param=\"clear\"\n\tcolour=<<colour-picker-value>>\n/>\n\n<$action-deletetiddler\n\t$tiddler=<<dropdown-state>>\n/>\n\n\"\"\"/>\n\n</div>\n"
        },
        "$:/core/ui/EditorToolbar/clear": {
            "title": "$:/core/ui/EditorToolbar/clear",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/erase",
            "caption": "{{$:/language/Buttons/Clear/Caption}}",
            "description": "{{$:/language/Buttons/Clear/Hint}}",
            "condition": "[<targetTiddler>is[image]]",
            "dropdown": "$:/core/ui/EditorToolbar/clear-dropdown",
            "text": ""
        },
        "$:/core/ui/EditorToolbar/editor-height-dropdown": {
            "title": "$:/core/ui/EditorToolbar/editor-height-dropdown",
            "text": "\\define lingo-base() $:/language/Buttons/EditorHeight/\n''<<lingo Hint>>''\n\n<$radio tiddler=\"$:/config/TextEditor/EditorHeight/Mode\" value=\"auto\"> {{$:/core/images/auto-height}} <<lingo Caption/Auto>></$radio>\n\n<$radio tiddler=\"$:/config/TextEditor/EditorHeight/Mode\" value=\"fixed\"> {{$:/core/images/fixed-height}} <<lingo Caption/Fixed>> <$edit-text tag=\"input\" tiddler=\"$:/config/TextEditor/EditorHeight/Height\" default=\"100px\"/></$radio>\n"
        },
        "$:/core/ui/EditorToolbar/editor-height": {
            "title": "$:/core/ui/EditorToolbar/editor-height",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/fixed-height",
            "custom-icon": "yes",
            "caption": "{{$:/language/Buttons/EditorHeight/Caption}}",
            "description": "{{$:/language/Buttons/EditorHeight/Hint}}",
            "condition": "[<targetTiddler>!is[image]]",
            "dropdown": "$:/core/ui/EditorToolbar/editor-height-dropdown",
            "text": "<$reveal tag=\"span\" state=\"$:/config/TextEditor/EditorHeight/Mode\" type=\"match\" text=\"fixed\">\n{{$:/core/images/fixed-height}}\n</$reveal>\n<$reveal tag=\"span\" state=\"$:/config/TextEditor/EditorHeight/Mode\" type=\"match\" text=\"auto\">\n{{$:/core/images/auto-height}}\n</$reveal>\n"
        },
        "$:/core/ui/EditorToolbar/excise-dropdown": {
            "title": "$:/core/ui/EditorToolbar/excise-dropdown",
            "text": "\\define lingo-base() $:/language/Buttons/Excise/\n\n\\define body(config-title)\n''<<lingo Hint>>''\n\n<<lingo Caption/NewTitle>> <$edit-text tag=\"input\" tiddler=\"$config-title$/new-title\" default=\"\" focus=\"true\"/>\n\n<$set name=\"new-title\" value={{$config-title$/new-title}}>\n<$list filter=\"\"\"[<new-title>is[tiddler]]\"\"\">\n<div class=\"tc-error\">\n<<lingo Caption/TiddlerExists>>\n</div>\n</$list>\n</$set>\n\n<$checkbox tiddler=\"\"\"$config-title$/tagnew\"\"\" field=\"text\" checked=\"yes\" unchecked=\"no\" default=\"false\"> <<lingo Caption/Tag>></$checkbox>\n\n<<lingo Caption/Replace>> <$select tiddler=\"\"\"$config-title$/type\"\"\" default=\"transclude\">\n<option value=\"link\"><<lingo Caption/Replace/Link>></option>\n<option value=\"transclude\"><<lingo Caption/Replace/Transclusion>></option>\n<option value=\"macro\"><<lingo Caption/Replace/Macro>></option>\n</$select>\n\n<$reveal state=\"\"\"$config-title$/type\"\"\" type=\"match\" text=\"macro\">\n<<lingo Caption/MacroName>> <$edit-text tag=\"input\" tiddler=\"\"\"$config-title$/macro-title\"\"\" default=\"translink\"/>\n</$reveal>\n\n<$button>\n<$action-sendmessage\n\t$message=\"tm-edit-text-operation\"\n\t$param=\"excise\"\n\ttitle={{$config-title$/new-title}}\n\ttype={{$config-title$/type}}\n\tmacro={{$config-title$/macro-title}}\n\ttagnew={{$config-title$/tagnew}}\n/>\n<$action-deletetiddler\n\t$tiddler=\"$config-title$/new-title\"\n/>\n<$action-deletetiddler\n\t$tiddler=<<dropdown-state>>\n/>\n<<lingo Caption/Excise>>\n</$button>\n\\end\n\n<$macrocall $name=\"body\" config-title=<<qualify \"$:/state/Excise/\">>/>\n"
        },
        "$:/core/ui/EditorToolbar/excise": {
            "title": "$:/core/ui/EditorToolbar/excise",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/excise",
            "caption": "{{$:/language/Buttons/Excise/Caption}}",
            "description": "{{$:/language/Buttons/Excise/Hint}}",
            "condition": "[<targetTiddler>!is[image]]",
            "shortcuts": "((excise))",
            "dropdown": "$:/core/ui/EditorToolbar/excise-dropdown",
            "text": ""
        },
        "$:/core/ui/EditorToolbar/heading-1": {
            "title": "$:/core/ui/EditorToolbar/heading-1",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/heading-1",
            "caption": "{{$:/language/Buttons/Heading1/Caption}}",
            "description": "{{$:/language/Buttons/Heading1/Hint}}",
            "condition": "[<targetTiddler>!has[type]] [<targetTiddler>type[text/vnd.tiddlywiki]]",
            "button-classes": "tc-text-editor-toolbar-item-start-group",
            "shortcuts": "((heading-1))",
            "text": "<$action-sendmessage\n\t$message=\"tm-edit-text-operation\"\n\t$param=\"prefix-lines\"\n\tcharacter=\"!\"\n\tcount=\"1\"\n/>\n"
        },
        "$:/core/ui/EditorToolbar/heading-2": {
            "title": "$:/core/ui/EditorToolbar/heading-2",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/heading-2",
            "caption": "{{$:/language/Buttons/Heading2/Caption}}",
            "description": "{{$:/language/Buttons/Heading2/Hint}}",
            "condition": "[<targetTiddler>!has[type]] [<targetTiddler>type[text/vnd.tiddlywiki]]",
            "shortcuts": "((heading-2))",
            "text": "<$action-sendmessage\n\t$message=\"tm-edit-text-operation\"\n\t$param=\"prefix-lines\"\n\tcharacter=\"!\"\n\tcount=\"2\"\n/>\n"
        },
        "$:/core/ui/EditorToolbar/heading-3": {
            "title": "$:/core/ui/EditorToolbar/heading-3",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/heading-3",
            "caption": "{{$:/language/Buttons/Heading3/Caption}}",
            "description": "{{$:/language/Buttons/Heading3/Hint}}",
            "condition": "[<targetTiddler>!has[type]] [<targetTiddler>type[text/vnd.tiddlywiki]]",
            "shortcuts": "((heading-3))",
            "text": "<$action-sendmessage\n\t$message=\"tm-edit-text-operation\"\n\t$param=\"prefix-lines\"\n\tcharacter=\"!\"\n\tcount=\"3\"\n/>\n"
        },
        "$:/core/ui/EditorToolbar/heading-4": {
            "title": "$:/core/ui/EditorToolbar/heading-4",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/heading-4",
            "caption": "{{$:/language/Buttons/Heading4/Caption}}",
            "description": "{{$:/language/Buttons/Heading4/Hint}}",
            "condition": "[<targetTiddler>!has[type]] [<targetTiddler>type[text/vnd.tiddlywiki]]",
            "shortcuts": "((heading-4))",
            "text": "<$action-sendmessage\n\t$message=\"tm-edit-text-operation\"\n\t$param=\"prefix-lines\"\n\tcharacter=\"!\"\n\tcount=\"4\"\n/>\n"
        },
        "$:/core/ui/EditorToolbar/heading-5": {
            "title": "$:/core/ui/EditorToolbar/heading-5",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/heading-5",
            "caption": "{{$:/language/Buttons/Heading5/Caption}}",
            "description": "{{$:/language/Buttons/Heading5/Hint}}",
            "condition": "[<targetTiddler>!has[type]] [<targetTiddler>type[text/vnd.tiddlywiki]]",
            "shortcuts": "((heading-5))",
            "text": "<$action-sendmessage\n\t$message=\"tm-edit-text-operation\"\n\t$param=\"prefix-lines\"\n\tcharacter=\"!\"\n\tcount=\"5\"\n/>\n"
        },
        "$:/core/ui/EditorToolbar/heading-6": {
            "title": "$:/core/ui/EditorToolbar/heading-6",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/heading-6",
            "caption": "{{$:/language/Buttons/Heading6/Caption}}",
            "description": "{{$:/language/Buttons/Heading6/Hint}}",
            "condition": "[<targetTiddler>!has[type]] [<targetTiddler>type[text/vnd.tiddlywiki]]",
            "shortcuts": "((heading-6))",
            "text": "<$action-sendmessage\n\t$message=\"tm-edit-text-operation\"\n\t$param=\"prefix-lines\"\n\tcharacter=\"!\"\n\tcount=\"6\"\n/>\n"
        },
        "$:/core/ui/EditorToolbar/italic": {
            "title": "$:/core/ui/EditorToolbar/italic",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/italic",
            "caption": "{{$:/language/Buttons/Italic/Caption}}",
            "description": "{{$:/language/Buttons/Italic/Hint}}",
            "condition": "[<targetTiddler>!has[type]] [<targetTiddler>type[text/vnd.tiddlywiki]]",
            "shortcuts": "((italic))",
            "text": "<$action-sendmessage\n\t$message=\"tm-edit-text-operation\"\n\t$param=\"wrap-selection\"\n\tprefix=\"//\"\n\tsuffix=\"//\"\n/>\n"
        },
        "$:/core/ui/EditorToolbar/line-width-dropdown": {
            "title": "$:/core/ui/EditorToolbar/line-width-dropdown",
            "text": "\\define lingo-base() $:/language/Buttons/LineWidth/\n\n\\define toolbar-line-width-inner()\n<$button tag=\"a\" tooltip=\"\"\"$(line-width)$\"\"\">\n\n<$action-setfield\n\t$tiddler=\"$:/config/BitmapEditor/LineWidth\"\n\t$value=\"$(line-width)$\"\n/>\n\n<$action-deletetiddler\n\t$tiddler=<<dropdown-state>>\n/>\n\n<div style=\"display: inline-block; margin: 4px calc(80px - $(line-width)$); background-color: #000; width: calc(100px + $(line-width)$ * 2); height: $(line-width)$; border-radius: 120px; vertical-align: middle;\"/>\n\n<span style=\"margin-left: 8px;\">\n\n<$text text=\"\"\"$(line-width)$\"\"\"/>\n\n<$reveal state=\"$:/config/BitmapEditor/LineWidth\" type=\"match\" text=\"\"\"$(line-width)$\"\"\" tag=\"span\">\n\n<$entity entity=\"&nbsp;\"/>\n\n<$entity entity=\"&#x2713;\"/>\n\n</$reveal>\n\n</span>\n\n</$button>\n\\end\n\n''<<lingo Hint>>''\n\n<$list filter={{$:/config/BitmapEditor/LineWidths}} variable=\"line-width\">\n\n<<toolbar-line-width-inner>>\n\n</$list>\n"
        },
        "$:/core/ui/EditorToolbar/line-width": {
            "title": "$:/core/ui/EditorToolbar/line-width",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/line-width",
            "caption": "{{$:/language/Buttons/LineWidth/Caption}}",
            "description": "{{$:/language/Buttons/LineWidth/Hint}}",
            "condition": "[<targetTiddler>is[image]]",
            "dropdown": "$:/core/ui/EditorToolbar/line-width-dropdown",
            "text": "<$text text={{$:/config/BitmapEditor/LineWidth}}/>"
        },
        "$:/core/ui/EditorToolbar/link-dropdown": {
            "title": "$:/core/ui/EditorToolbar/link-dropdown",
            "text": "\\define lingo-base() $:/language/Buttons/Link/\n\n\\define link-actions()\n<$action-sendmessage\n\t$message=\"tm-edit-text-operation\"\n\t$param=\"make-link\"\n\ttext={{$(linkTiddler)$}}\n/>\n\n<$action-deletetiddler\n\t$tiddler=<<dropdown-state>>\n/>\n\n<$action-deletetiddler\n\t$tiddler=<<searchTiddler>>\n/>\n\n<$action-deletetiddler\n\t$tiddler=<<linkTiddler>>\n/>\n\\end\n\n\\define external-link()\n<$button class=\"tc-btn-invisible\" style=\"width: auto; display: inline-block; background-colour: inherit;\">\n<$action-sendmessage $message=\"tm-edit-text-operation\" $param=\"make-link\" text={{$(searchTiddler)$}}\n/>\n{{$:/core/images/chevron-right}}\n<$action-deletetiddler\n\t$tiddler=<<dropdown-state>>\n/>\n\n<$action-deletetiddler\n\t$tiddler=<<searchTiddler>>\n/>\n\n<$action-deletetiddler\n\t$tiddler=<<linkTiddler>>\n/>\n</$button>\n\\end\n\n\n\\define body(config-title)\n''<<lingo Hint>>''\n\n<$vars searchTiddler=\"\"\"$config-title$/search\"\"\" linkTiddler=\"\"\"$config-title$/link\"\"\" linktext=\"\" >\n\n<$edit-text tiddler=<<searchTiddler>> type=\"search\" tag=\"input\" focus=\"true\" placeholder={{$:/language/Search/Search}} default=\"\"/>\n<$reveal tag=\"span\" state=<<searchTiddler>> type=\"nomatch\" text=\"\">\n<<external-link>>\n<$button class=\"tc-btn-invisible\" style=\"width: auto; display: inline-block; background-colour: inherit;\">\n<$action-setfield $tiddler=<<searchTiddler>> text=\"\" />\n{{$:/core/images/close-button}}\n</$button>\n</$reveal>\n\n<$reveal tag=\"div\" state=<<searchTiddler>> type=\"nomatch\" text=\"\">\n\n<$linkcatcher actions=<<link-actions>> to=<<linkTiddler>>>\n\n{{$:/core/ui/SearchResults}}\n\n</$linkcatcher>\n\n</$reveal>\n\n</$vars>\n\n\\end\n\n<$macrocall $name=\"body\" config-title=<<qualify \"$:/state/Link/\">>/>"
        },
        "$:/core/ui/EditorToolbar/link": {
            "title": "$:/core/ui/EditorToolbar/link",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/link",
            "caption": "{{$:/language/Buttons/Link/Caption}}",
            "description": "{{$:/language/Buttons/Link/Hint}}",
            "condition": "[<targetTiddler>!has[type]] [<targetTiddler>type[text/vnd.tiddlywiki]]",
            "button-classes": "tc-text-editor-toolbar-item-start-group",
            "shortcuts": "((link))",
            "dropdown": "$:/core/ui/EditorToolbar/link-dropdown",
            "text": ""
        },
        "$:/core/ui/EditorToolbar/list-bullet": {
            "title": "$:/core/ui/EditorToolbar/list-bullet",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/list-bullet",
            "caption": "{{$:/language/Buttons/ListBullet/Caption}}",
            "description": "{{$:/language/Buttons/ListBullet/Hint}}",
            "condition": "[<targetTiddler>!has[type]] [<targetTiddler>type[text/vnd.tiddlywiki]]",
            "shortcuts": "((list-bullet))",
            "text": "<$action-sendmessage\n\t$message=\"tm-edit-text-operation\"\n\t$param=\"prefix-lines\"\n\tcharacter=\"*\"\n\tcount=\"1\"\n/>\n"
        },
        "$:/core/ui/EditorToolbar/list-number": {
            "title": "$:/core/ui/EditorToolbar/list-number",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/list-number",
            "caption": "{{$:/language/Buttons/ListNumber/Caption}}",
            "description": "{{$:/language/Buttons/ListNumber/Hint}}",
            "condition": "[<targetTiddler>!has[type]] [<targetTiddler>type[text/vnd.tiddlywiki]]",
            "shortcuts": "((list-number))",
            "text": "<$action-sendmessage\n\t$message=\"tm-edit-text-operation\"\n\t$param=\"prefix-lines\"\n\tcharacter=\"#\"\n\tcount=\"1\"\n/>\n"
        },
        "$:/core/ui/EditorToolbar/mono-block": {
            "title": "$:/core/ui/EditorToolbar/mono-block",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/mono-block",
            "caption": "{{$:/language/Buttons/MonoBlock/Caption}}",
            "description": "{{$:/language/Buttons/MonoBlock/Hint}}",
            "condition": "[<targetTiddler>!has[type]] [<targetTiddler>type[text/vnd.tiddlywiki]]",
            "button-classes": "tc-text-editor-toolbar-item-start-group",
            "shortcuts": "((mono-block))",
            "text": "<$action-sendmessage\n\t$message=\"tm-edit-text-operation\"\n\t$param=\"wrap-lines\"\n\tprefix=\"\n```\"\n\tsuffix=\"```\"\n/>\n"
        },
        "$:/core/ui/EditorToolbar/mono-line": {
            "title": "$:/core/ui/EditorToolbar/mono-line",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/mono-line",
            "caption": "{{$:/language/Buttons/MonoLine/Caption}}",
            "description": "{{$:/language/Buttons/MonoLine/Hint}}",
            "condition": "[<targetTiddler>!has[type]] [<targetTiddler>type[text/vnd.tiddlywiki]]",
            "shortcuts": "((mono-line))",
            "text": "<$action-sendmessage\n\t$message=\"tm-edit-text-operation\"\n\t$param=\"wrap-selection\"\n\tprefix=\"`\"\n\tsuffix=\"`\"\n/>\n"
        },
        "$:/core/ui/EditorToolbar/more-dropdown": {
            "title": "$:/core/ui/EditorToolbar/more-dropdown",
            "text": "\\define config-title()\n$:/config/EditorToolbarButtons/Visibility/$(toolbarItem)$\n\\end\n\n\\define conditional-button()\n<$list filter={{$(toolbarItem)$!!condition}} variable=\"condition\">\n<$transclude tiddler=\"$:/core/ui/EditTemplate/body/toolbar/button\" mode=\"inline\"/> <$transclude tiddler=<<toolbarItem>> field=\"description\"/>\n</$list>\n\\end\n\n<div class=\"tc-text-editor-toolbar-more\">\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/EditorToolbar]!has[draft.of]] -[[$:/core/ui/EditorToolbar/more]]\">\n<$reveal type=\"match\" state=<<config-visibility-title>> text=\"hide\" tag=\"div\">\n<<conditional-button>>\n</$reveal>\n</$list>\n</div>\n"
        },
        "$:/core/ui/EditorToolbar/more": {
            "title": "$:/core/ui/EditorToolbar/more",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/down-arrow",
            "caption": "{{$:/language/Buttons/More/Caption}}",
            "description": "{{$:/language/Buttons/More/Hint}}",
            "condition": "[<targetTiddler>]",
            "dropdown": "$:/core/ui/EditorToolbar/more-dropdown",
            "text": ""
        },
        "$:/core/ui/EditorToolbar/opacity-dropdown": {
            "title": "$:/core/ui/EditorToolbar/opacity-dropdown",
            "text": "\\define lingo-base() $:/language/Buttons/Opacity/\n\n\\define toolbar-opacity-inner()\n<$button tag=\"a\" tooltip=\"\"\"$(opacity)$\"\"\">\n\n<$action-setfield\n\t$tiddler=\"$:/config/BitmapEditor/Opacity\"\n\t$value=\"$(opacity)$\"\n/>\n\n<$action-deletetiddler\n\t$tiddler=<<dropdown-state>>\n/>\n\n<div style=\"display: inline-block; vertical-align: middle; background-color: $(current-paint-colour)$; opacity: $(opacity)$; width: 1em; height: 1em; border-radius: 50%;\"/>\n\n<span style=\"margin-left: 8px;\">\n\n<$text text=\"\"\"$(opacity)$\"\"\"/>\n\n<$reveal state=\"$:/config/BitmapEditor/Opacity\" type=\"match\" text=\"\"\"$(opacity)$\"\"\" tag=\"span\">\n\n<$entity entity=\"&nbsp;\"/>\n\n<$entity entity=\"&#x2713;\"/>\n\n</$reveal>\n\n</span>\n\n</$button>\n\\end\n\n\\define toolbar-opacity()\n''<<lingo Hint>>''\n\n<$list filter={{$:/config/BitmapEditor/Opacities}} variable=\"opacity\">\n\n<<toolbar-opacity-inner>>\n\n</$list>\n\\end\n\n<$set name=\"current-paint-colour\" value={{$:/config/BitmapEditor/Colour}}>\n\n<$set name=\"current-opacity\" value={{$:/config/BitmapEditor/Opacity}}>\n\n<<toolbar-opacity>>\n\n</$set>\n\n</$set>\n"
        },
        "$:/core/ui/EditorToolbar/opacity": {
            "title": "$:/core/ui/EditorToolbar/opacity",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/opacity",
            "caption": "{{$:/language/Buttons/Opacity/Caption}}",
            "description": "{{$:/language/Buttons/Opacity/Hint}}",
            "condition": "[<targetTiddler>is[image]]",
            "dropdown": "$:/core/ui/EditorToolbar/opacity-dropdown",
            "text": "<$text text={{$:/config/BitmapEditor/Opacity}}/>\n"
        },
        "$:/core/ui/EditorToolbar/paint-dropdown": {
            "title": "$:/core/ui/EditorToolbar/paint-dropdown",
            "text": "''{{$:/language/Buttons/Paint/Hint}}''\n\n<$macrocall $name=\"colour-picker\" actions=\"\"\"\n\n<$action-setfield\n\t$tiddler=\"$:/config/BitmapEditor/Colour\"\n\t$value=<<colour-picker-value>>\n/>\n\n<$action-deletetiddler\n\t$tiddler=<<dropdown-state>>\n/>\n\n\"\"\"/>\n"
        },
        "$:/core/ui/EditorToolbar/paint": {
            "title": "$:/core/ui/EditorToolbar/paint",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/paint",
            "caption": "{{$:/language/Buttons/Paint/Caption}}",
            "description": "{{$:/language/Buttons/Paint/Hint}}",
            "condition": "[<targetTiddler>is[image]]",
            "dropdown": "$:/core/ui/EditorToolbar/paint-dropdown",
            "text": "\\define toolbar-paint()\n<div style=\"display: inline-block; vertical-align: middle; background-color: $(colour-picker-value)$; width: 1em; height: 1em; border-radius: 50%;\"/>\n\\end\n<$set name=\"colour-picker-value\" value={{$:/config/BitmapEditor/Colour}}>\n<<toolbar-paint>>\n</$set>\n"
        },
        "$:/core/ui/EditorToolbar/picture-dropdown": {
            "title": "$:/core/ui/EditorToolbar/picture-dropdown",
            "text": "\\define replacement-text()\n[img[$(imageTitle)$]]\n\\end\n\n''{{$:/language/Buttons/Picture/Hint}}''\n\n<$macrocall $name=\"image-picker\" actions=\"\"\"\n\n<$action-sendmessage\n\t$message=\"tm-edit-text-operation\"\n\t$param=\"replace-selection\"\n\ttext=<<replacement-text>>\n/>\n\n<$action-deletetiddler\n\t$tiddler=<<dropdown-state>>\n/>\n\n\"\"\"/>\n"
        },
        "$:/core/ui/EditorToolbar/picture": {
            "title": "$:/core/ui/EditorToolbar/picture",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/picture",
            "caption": "{{$:/language/Buttons/Picture/Caption}}",
            "description": "{{$:/language/Buttons/Picture/Hint}}",
            "condition": "[<targetTiddler>!has[type]] [<targetTiddler>type[text/vnd.tiddlywiki]]",
            "shortcuts": "((picture))",
            "dropdown": "$:/core/ui/EditorToolbar/picture-dropdown",
            "text": ""
        },
        "$:/core/ui/EditorToolbar/preview-type-dropdown": {
            "title": "$:/core/ui/EditorToolbar/preview-type-dropdown",
            "text": "\\define preview-type-button()\n<$button tag=\"a\">\n\n<$action-setfield $tiddler=\"$:/state/editpreviewtype\" $value=\"$(previewType)$\"/>\n\n<$action-deletetiddler\n\t$tiddler=<<dropdown-state>>\n/>\n\n<$transclude tiddler=<<previewType>> field=\"caption\" mode=\"inline\">\n\n<$view tiddler=<<previewType>> field=\"title\" mode=\"inline\"/>\n\n</$transclude> \n\n<$reveal tag=\"span\" state=\"$:/state/editpreviewtype\" type=\"match\" text=<<previewType>> default=\"$:/core/ui/EditTemplate/body/preview/output\">\n\n<$entity entity=\"&nbsp;\"/>\n\n<$entity entity=\"&#x2713;\"/>\n\n</$reveal>\n\n</$button>\n\\end\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/EditPreview]!has[draft.of]]\" variable=\"previewType\">\n\n<<preview-type-button>>\n\n</$list>\n"
        },
        "$:/core/ui/EditorToolbar/preview-type": {
            "title": "$:/core/ui/EditorToolbar/preview-type",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/chevron-down",
            "caption": "{{$:/language/Buttons/PreviewType/Caption}}",
            "description": "{{$:/language/Buttons/PreviewType/Hint}}",
            "condition": "[all[shadows+tiddlers]tag[$:/tags/EditPreview]!has[draft.of]butfirst[]limit[1]]",
            "button-classes": "tc-text-editor-toolbar-item-adjunct",
            "dropdown": "$:/core/ui/EditorToolbar/preview-type-dropdown"
        },
        "$:/core/ui/EditorToolbar/preview": {
            "title": "$:/core/ui/EditorToolbar/preview",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/preview-open",
            "custom-icon": "yes",
            "caption": "{{$:/language/Buttons/Preview/Caption}}",
            "description": "{{$:/language/Buttons/Preview/Hint}}",
            "condition": "[<targetTiddler>]",
            "button-classes": "tc-text-editor-toolbar-item-start-group",
            "shortcuts": "((preview))",
            "text": "<$reveal state=\"$:/state/showeditpreview\" type=\"match\" text=\"yes\" tag=\"span\">\n{{$:/core/images/preview-open}}\n<$action-setfield $tiddler=\"$:/state/showeditpreview\" $value=\"no\"/>\n</$reveal>\n<$reveal state=\"$:/state/showeditpreview\" type=\"nomatch\" text=\"yes\" tag=\"span\">\n{{$:/core/images/preview-closed}}\n<$action-setfield $tiddler=\"$:/state/showeditpreview\" $value=\"yes\"/>\n</$reveal>\n"
        },
        "$:/core/ui/EditorToolbar/quote": {
            "title": "$:/core/ui/EditorToolbar/quote",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/quote",
            "caption": "{{$:/language/Buttons/Quote/Caption}}",
            "description": "{{$:/language/Buttons/Quote/Hint}}",
            "condition": "[<targetTiddler>!has[type]] [<targetTiddler>type[text/vnd.tiddlywiki]]",
            "shortcuts": "((quote))",
            "text": "<$action-sendmessage\n\t$message=\"tm-edit-text-operation\"\n\t$param=\"wrap-lines\"\n\tprefix=\"\n<<<\"\n\tsuffix=\"<<<\"\n/>\n"
        },
        "$:/core/ui/EditorToolbar/size-dropdown": {
            "title": "$:/core/ui/EditorToolbar/size-dropdown",
            "text": "\\define lingo-base() $:/language/Buttons/Size/\n\n\\define toolbar-button-size-preset(config-title)\n<$set name=\"width\" filter=\"$(sizePair)$ +[first[]]\">\n\n<$set name=\"height\" filter=\"$(sizePair)$ +[last[]]\">\n\n<$button tag=\"a\">\n\n<$action-setfield\n\t$tiddler=\"\"\"$config-title$/new-width\"\"\"\n\t$value=<<width>>\n/>\n\n<$action-setfield\n\t$tiddler=\"\"\"$config-title$/new-height\"\"\"\n\t$value=<<height>>\n/>\n\n<$action-deletetiddler\n\t$tiddler=\"\"\"$config-title$/presets-popup\"\"\"\n/>\n\n<$text text=<<width>>/> &times; <$text text=<<height>>/>\n\n</$button>\n\n</$set>\n\n</$set>\n\\end\n\n\\define toolbar-button-size(config-title)\n''{{$:/language/Buttons/Size/Hint}}''\n\n<<lingo Caption/Width>> <$edit-text tag=\"input\" tiddler=\"\"\"$config-title$/new-width\"\"\" default=<<tv-bitmap-editor-width>> focus=\"true\" size=\"8\"/> <<lingo Caption/Height>> <$edit-text tag=\"input\" tiddler=\"\"\"$config-title$/new-height\"\"\" default=<<tv-bitmap-editor-height>> size=\"8\"/> <$button popup=\"\"\"$config-title$/presets-popup\"\"\" class=\"tc-btn-invisible tc-popup-keep\" style=\"width: auto; display: inline-block; background-colour: inherit;\" selectedClass=\"tc-selected\">\n{{$:/core/images/down-arrow}}\n</$button>\n\n<$reveal tag=\"span\" state=\"\"\"$config-title$/presets-popup\"\"\" type=\"popup\" position=\"belowleft\" animate=\"yes\">\n\n<div class=\"tc-drop-down tc-popup-keep\">\n\n<$list filter={{$:/config/BitmapEditor/ImageSizes}} variable=\"sizePair\">\n\n<$macrocall $name=\"toolbar-button-size-preset\" config-title=\"$config-title$\"/>\n\n</$list>\n\n</div>\n\n</$reveal>\n\n<$button>\n<$action-sendmessage\n\t$message=\"tm-edit-bitmap-operation\"\n\t$param=\"resize\"\n\twidth={{$config-title$/new-width}}\n\theight={{$config-title$/new-height}}\n/>\n<$action-deletetiddler\n\t$tiddler=\"\"\"$config-title$/new-width\"\"\"\n/>\n<$action-deletetiddler\n\t$tiddler=\"\"\"$config-title$/new-height\"\"\"\n/>\n<$action-deletetiddler\n\t$tiddler=<<dropdown-state>>\n/>\n<<lingo Caption/Resize>>\n</$button>\n\\end\n\n<$macrocall $name=\"toolbar-button-size\" config-title=<<qualify \"$:/state/Size/\">>/>\n"
        },
        "$:/core/ui/EditorToolbar/size": {
            "title": "$:/core/ui/EditorToolbar/size",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/size",
            "caption": "{{$:/language/Buttons/Size/Caption}}",
            "description": "{{$:/language/Buttons/Size/Hint}}",
            "condition": "[<targetTiddler>is[image]]",
            "dropdown": "$:/core/ui/EditorToolbar/size-dropdown",
            "text": ""
        },
        "$:/core/ui/EditorToolbar/stamp-dropdown": {
            "title": "$:/core/ui/EditorToolbar/stamp-dropdown",
            "text": "\\define toolbar-button-stamp-inner()\n<$button tag=\"a\">\n\n<$action-sendmessage\n\t$message=\"tm-edit-text-operation\"\n\t$param=\"replace-selection\"\n\ttext={{$(snippetTitle)$}}\n/>\n\n<$action-deletetiddler\n\t$tiddler=<<dropdown-state>>\n/>\n\n<$view tiddler=<<snippetTitle>> field=\"caption\" mode=\"inline\">\n\n<$view tiddler=<<snippetTitle>> field=\"title\" mode=\"inline\"/>\n\n</$view>\n\n</$button>\n\\end\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/TextEditor/Snippet]!has[draft.of]sort[caption]]\" variable=\"snippetTitle\">\n\n<<toolbar-button-stamp-inner>>\n\n</$list>\n\n----\n\n<$button tag=\"a\">\n\n<$action-sendmessage\n\t$message=\"tm-new-tiddler\"\n\ttags=\"$:/tags/TextEditor/Snippet\"\n\tcaption={{$:/language/Buttons/Stamp/New/Title}}\n\ttext={{$:/language/Buttons/Stamp/New/Text}}\n/>\n\n<$action-deletetiddler\n\t$tiddler=<<dropdown-state>>\n/>\n\n<em>\n\n<$text text={{$:/language/Buttons/Stamp/Caption/New}}/>\n\n</em>\n\n</$button>\n"
        },
        "$:/core/ui/EditorToolbar/stamp": {
            "title": "$:/core/ui/EditorToolbar/stamp",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/stamp",
            "caption": "{{$:/language/Buttons/Stamp/Caption}}",
            "description": "{{$:/language/Buttons/Stamp/Hint}}",
            "condition": "[<targetTiddler>!is[image]]",
            "shortcuts": "((stamp))",
            "dropdown": "$:/core/ui/EditorToolbar/stamp-dropdown",
            "text": ""
        },
        "$:/core/ui/EditorToolbar/strikethrough": {
            "title": "$:/core/ui/EditorToolbar/strikethrough",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/strikethrough",
            "caption": "{{$:/language/Buttons/Strikethrough/Caption}}",
            "description": "{{$:/language/Buttons/Strikethrough/Hint}}",
            "condition": "[<targetTiddler>!has[type]] [<targetTiddler>type[text/vnd.tiddlywiki]]",
            "shortcuts": "((strikethrough))",
            "text": "<$action-sendmessage\n\t$message=\"tm-edit-text-operation\"\n\t$param=\"wrap-selection\"\n\tprefix=\"~~\"\n\tsuffix=\"~~\"\n/>\n"
        },
        "$:/core/ui/EditorToolbar/subscript": {
            "title": "$:/core/ui/EditorToolbar/subscript",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/subscript",
            "caption": "{{$:/language/Buttons/Subscript/Caption}}",
            "description": "{{$:/language/Buttons/Subscript/Hint}}",
            "condition": "[<targetTiddler>!has[type]] [<targetTiddler>type[text/vnd.tiddlywiki]]",
            "shortcuts": "((subscript))",
            "text": "<$action-sendmessage\n\t$message=\"tm-edit-text-operation\"\n\t$param=\"wrap-selection\"\n\tprefix=\",,\"\n\tsuffix=\",,\"\n/>\n"
        },
        "$:/core/ui/EditorToolbar/superscript": {
            "title": "$:/core/ui/EditorToolbar/superscript",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/superscript",
            "caption": "{{$:/language/Buttons/Superscript/Caption}}",
            "description": "{{$:/language/Buttons/Superscript/Hint}}",
            "condition": "[<targetTiddler>!has[type]] [<targetTiddler>type[text/vnd.tiddlywiki]]",
            "shortcuts": "((superscript))",
            "text": "<$action-sendmessage\n\t$message=\"tm-edit-text-operation\"\n\t$param=\"wrap-selection\"\n\tprefix=\"^^\"\n\tsuffix=\"^^\"\n/>\n"
        },
        "$:/core/ui/EditorToolbar/underline": {
            "title": "$:/core/ui/EditorToolbar/underline",
            "tags": "$:/tags/EditorToolbar",
            "icon": "$:/core/images/underline",
            "caption": "{{$:/language/Buttons/Underline/Caption}}",
            "description": "{{$:/language/Buttons/Underline/Hint}}",
            "condition": "[<targetTiddler>!has[type]] [<targetTiddler>type[text/vnd.tiddlywiki]]",
            "shortcuts": "((underline))",
            "text": "<$action-sendmessage\n\t$message=\"tm-edit-text-operation\"\n\t$param=\"wrap-selection\"\n\tprefix=\"__\"\n\tsuffix=\"__\"\n/>\n"
        },
        "$:/core/Filters/AllTags": {
            "title": "$:/core/Filters/AllTags",
            "tags": "$:/tags/Filter",
            "filter": "[tags[]!is[system]sort[title]]",
            "description": "{{$:/language/Filters/AllTags}}",
            "text": ""
        },
        "$:/core/Filters/AllTiddlers": {
            "title": "$:/core/Filters/AllTiddlers",
            "tags": "$:/tags/Filter",
            "filter": "[!is[system]sort[title]]",
            "description": "{{$:/language/Filters/AllTiddlers}}",
            "text": ""
        },
        "$:/core/Filters/Drafts": {
            "title": "$:/core/Filters/Drafts",
            "tags": "$:/tags/Filter",
            "filter": "[has[draft.of]sort[title]]",
            "description": "{{$:/language/Filters/Drafts}}",
            "text": ""
        },
        "$:/core/Filters/Missing": {
            "title": "$:/core/Filters/Missing",
            "tags": "$:/tags/Filter",
            "filter": "[all[missing]sort[title]]",
            "description": "{{$:/language/Filters/Missing}}",
            "text": ""
        },
        "$:/core/Filters/Orphans": {
            "title": "$:/core/Filters/Orphans",
            "tags": "$:/tags/Filter",
            "filter": "[all[orphans]sort[title]]",
            "description": "{{$:/language/Filters/Orphans}}",
            "text": ""
        },
        "$:/core/Filters/OverriddenShadowTiddlers": {
            "title": "$:/core/Filters/OverriddenShadowTiddlers",
            "tags": "$:/tags/Filter",
            "filter": "[is[shadow]]",
            "description": "{{$:/language/Filters/OverriddenShadowTiddlers}}",
            "text": ""
        },
        "$:/core/Filters/RecentSystemTiddlers": {
            "title": "$:/core/Filters/RecentSystemTiddlers",
            "tags": "$:/tags/Filter",
            "filter": "[has[modified]!sort[modified]limit[50]]",
            "description": "{{$:/language/Filters/RecentSystemTiddlers}}",
            "text": ""
        },
        "$:/core/Filters/RecentTiddlers": {
            "title": "$:/core/Filters/RecentTiddlers",
            "tags": "$:/tags/Filter",
            "filter": "[!is[system]has[modified]!sort[modified]limit[50]]",
            "description": "{{$:/language/Filters/RecentTiddlers}}",
            "text": ""
        },
        "$:/core/Filters/ShadowTiddlers": {
            "title": "$:/core/Filters/ShadowTiddlers",
            "tags": "$:/tags/Filter",
            "filter": "[all[shadows]sort[title]]",
            "description": "{{$:/language/Filters/ShadowTiddlers}}",
            "text": ""
        },
        "$:/core/Filters/StoryList": {
            "title": "$:/core/Filters/StoryList",
            "tags": "$:/tags/Filter",
            "filter": "[list[$:/StoryList]] -$:/AdvancedSearch",
            "description": "{{$:/language/Filters/StoryList}}",
            "text": ""
        },
        "$:/core/Filters/SystemTags": {
            "title": "$:/core/Filters/SystemTags",
            "tags": "$:/tags/Filter",
            "filter": "[all[shadows+tiddlers]tags[]is[system]sort[title]]",
            "description": "{{$:/language/Filters/SystemTags}}",
            "text": ""
        },
        "$:/core/Filters/SystemTiddlers": {
            "title": "$:/core/Filters/SystemTiddlers",
            "tags": "$:/tags/Filter",
            "filter": "[is[system]sort[title]]",
            "description": "{{$:/language/Filters/SystemTiddlers}}",
            "text": ""
        },
        "$:/core/Filters/TypedTiddlers": {
            "title": "$:/core/Filters/TypedTiddlers",
            "tags": "$:/tags/Filter",
            "filter": "[!is[system]has[type]each[type]sort[type]] -[type[text/vnd.tiddlywiki]]",
            "description": "{{$:/language/Filters/TypedTiddlers}}",
            "text": ""
        },
        "$:/core/ui/ImportListing": {
            "title": "$:/core/ui/ImportListing",
            "text": "\\define lingo-base() $:/language/Import/\n\n\\define messageField()\nmessage-$(payloadTiddler)$\n\\end\n\n\\define selectionField()\nselection-$(payloadTiddler)$\n\\end\n\n\\define previewPopupState()\n$(currentTiddler)$!!popup-$(payloadTiddler)$\n\\end\n\n\\define select-all-actions()\n<$list filter=\"[all[current]plugintiddlers[]sort[title]]\" variable=\"payloadTiddler\">\n<$action-setfield $field={{{ [<payloadTiddler>addprefix[selection-]] }}} $value={{$:/state/import/select-all}}/>\n</$list>\n\\end\n\n<table>\n<tbody>\n<tr>\n<th>\n<$checkbox tiddler=\"$:/state/import/select-all\" field=\"text\" checked=\"checked\" unchecked=\"unchecked\" default=\"checked\" actions=<<select-all-actions>>>\n<<lingo Listing/Select/Caption>>\n</$checkbox>\n</th>\n<th>\n<<lingo Listing/Title/Caption>>\n</th>\n<th>\n<<lingo Listing/Status/Caption>>\n</th>\n</tr>\n<$list filter=\"[all[current]plugintiddlers[]sort[title]]\" variable=\"payloadTiddler\">\n<tr>\n<td>\n<$checkbox field=<<selectionField>> checked=\"checked\" unchecked=\"unchecked\" default=\"checked\"/>\n</td>\n<td>\n<$reveal type=\"nomatch\" state=<<previewPopupState>> text=\"yes\">\n<$button class=\"tc-btn-invisible tc-btn-dropdown\" set=<<previewPopupState>> setTo=\"yes\">\n{{$:/core/images/right-arrow}}&nbsp;<$text text=<<payloadTiddler>>/>\n</$button>\n</$reveal>\n<$reveal type=\"match\" state=<<previewPopupState>> text=\"yes\">\n<$button class=\"tc-btn-invisible tc-btn-dropdown\" set=<<previewPopupState>> setTo=\"no\">\n{{$:/core/images/down-arrow}}&nbsp;<$text text=<<payloadTiddler>>/>\n</$button>\n</$reveal>\n</td>\n<td>\n<$view field=<<messageField>>/>\n</td>\n</tr>\n<tr>\n<td colspan=\"3\">\n<$reveal type=\"match\" text=\"yes\" state=<<previewPopupState>>>\n<$transclude subtiddler=<<payloadTiddler>> mode=\"block\"/>\n</$reveal>\n</td>\n</tr>\n</$list>\n</tbody>\n</table>\n"
        },
        "$:/core/ui/ListItemTemplate": {
            "title": "$:/core/ui/ListItemTemplate",
            "text": "<div class=\"tc-menu-list-item\">\n<$link to={{!!title}}>\n<$view field=\"title\"/>\n</$link>\n</div>"
        },
        "$:/Manager/ItemMain/Fields": {
            "title": "$:/Manager/ItemMain/Fields",
            "tags": "$:/tags/Manager/ItemMain",
            "caption": "{{$:/language/Manager/Item/Fields}}",
            "text": "<table>\n<tbody>\n<$list filter=\"[all[current]fields[]sort[title]] -text\" template=\"$:/core/ui/TiddlerFieldTemplate\" variable=\"listItem\"/>\n</tbody>\n</table>\n"
        },
        "$:/Manager/ItemMain/RawText": {
            "title": "$:/Manager/ItemMain/RawText",
            "tags": "$:/tags/Manager/ItemMain",
            "caption": "{{$:/language/Manager/Item/RawText}}",
            "text": "<pre><code><$view/></code></pre>\n"
        },
        "$:/Manager/ItemMain/WikifiedText": {
            "title": "$:/Manager/ItemMain/WikifiedText",
            "tags": "$:/tags/Manager/ItemMain",
            "caption": "{{$:/language/Manager/Item/WikifiedText}}",
            "text": "<$transclude mode=\"block\"/>\n"
        },
        "$:/Manager/ItemSidebar/Colour": {
            "title": "$:/Manager/ItemSidebar/Colour",
            "tags": "$:/tags/Manager/ItemSidebar",
            "caption": "{{$:/language/Manager/Item/Colour}}",
            "text": "\\define swatch-styles()\nheight: 1em;\nbackground-color: $(colour)$\n\\end\n\n<$vars colour={{!!color}}>\n<p style=<<swatch-styles>>/>\n</$vars>\n<p>\n<$edit-text field=\"color\" tag=\"input\" type=\"color\"/> / <$edit-text field=\"color\" tag=\"input\" type=\"text\" size=\"9\"/>\n</p>\n"
        },
        "$:/Manager/ItemSidebar/Icon": {
            "title": "$:/Manager/ItemSidebar/Icon",
            "tags": "$:/tags/Manager/ItemSidebar",
            "caption": "{{$:/language/Manager/Item/Icon}}",
            "text": "<p>\n<div class=\"tc-manager-icon-editor\">\n<$button popup=<<qualify \"$:/state/popup/image-picker\">> class=\"tc-btn-invisible\">\n<$transclude tiddler={{!!icon}}>\n{{$:/language/Manager/Item/Icon/None}}\n</$transclude>\n</$button>\n<div class=\"tc-block-dropdown-wrapper\" style=\"position: static;\">\n<$reveal state=<<qualify \"$:/state/popup/image-picker\">> type=\"nomatch\" text=\"\" default=\"\" tag=\"div\" class=\"tc-popup\">\n<div class=\"tc-block-dropdown tc-popup-keep\" style=\"width: 80%; left: 10%; right: 10%; padding: 0.5em;\">\n<$macrocall $name=\"image-picker-include-tagged-images\" actions=\"\"\"\n<$action-setfield $field=\"icon\" $value=<<imageTitle>>/>\n<$action-deletetiddler $tiddler=<<qualify \"$:/state/popup/image-picker\">>/>\n\"\"\"/>\n</div>\n</$reveal>\n</div>\n</div>\n</p>\n"
        },
        "$:/Manager/ItemSidebar/Tags": {
            "title": "$:/Manager/ItemSidebar/Tags",
            "tags": "$:/tags/Manager/ItemSidebar",
            "caption": "{{$:/language/Manager/Item/Tags}}",
            "text": "\\define tag-checkbox-actions()\n<$action-listops\n\t$tiddler=\"$:/config/Manager/RecentTags\"\n\t$subfilter=\"[<tag>] [list[$:/config/Manager/RecentTags]] +[limit[12]]\"\n/>\n\\end\n\n\\define tag-picker-actions()\n<<tag-checkbox-actions>>\n<$action-listops\n\t$tiddler=<<currentTiddler>>\n\t$field=\"tags\"\n\t$subfilter=\"[<tag>] [all[current]tags[]]\"\n/>\n\\end\n\n<p>\n<$list filter=\"[is[current]tags[]] [list[$:/config/Manager/RecentTags]] +[sort[title]] \" variable=\"tag\">\n<div>\n<$checkbox tiddler=<<currentTiddler>> tag=<<tag>> actions=<<tag-checkbox-actions>>>\n<$macrocall $name=\"tag-pill\" tag=<<tag>>/>\n</$checkbox>\n</div>\n</$list>\n</p>\n<p>\n<$macrocall $name=\"tag-picker\" actions=<<tag-picker-actions>>/>\n</p>\n"
        },
        "$:/Manager/ItemSidebar/Tools": {
            "title": "$:/Manager/ItemSidebar/Tools",
            "tags": "$:/tags/Manager/ItemSidebar",
            "caption": "{{$:/language/Manager/Item/Tools}}",
            "text": "<p>\n<$button to=<<currentTiddler>>>{{$:/core/images/link}} open</$button>\n</p>\n<p>\n<$button message=\"tm-edit-tiddler\" param=<<currentTiddler>>>{{$:/core/images/edit-button}} edit</$button>\n</p>\n"
        },
        "$:/Manager": {
            "title": "$:/Manager",
            "icon": "$:/core/images/list",
            "color": "#bbb",
            "text": "\\define lingo-base() $:/language/Manager/\n\n\\define list-item-content-item()\n<div class=\"tc-manager-list-item-content-item\">\n\t<$vars state-title=\"\"\"$:/state/popup/manager/item/$(listItem)$\"\"\">\n\t\t<$reveal state=<<state-title>> type=\"match\" text=\"show\" default=\"show\" tag=\"div\">\n\t\t\t<$button set=<<state-title>> setTo=\"hide\" class=\"tc-btn-invisible tc-manager-list-item-content-item-heading\">\n\t\t\t\t{{$:/core/images/down-arrow}} <$transclude tiddler=<<listItem>> field=\"caption\"/>\n\t\t\t</$button>\n\t\t</$reveal>\n\t\t<$reveal state=<<state-title>> type=\"nomatch\" text=\"show\" default=\"show\" tag=\"div\">\n\t\t\t<$button set=<<state-title>> setTo=\"show\" class=\"tc-btn-invisible tc-manager-list-item-content-item-heading\">\n\t\t\t\t{{$:/core/images/right-arrow}} <$transclude tiddler=<<listItem>> field=\"caption\"/>\n\t\t\t</$button>\n\t\t</$reveal>\n\t\t<$reveal state=<<state-title>> type=\"match\" text=\"show\" default=\"show\" tag=\"div\" class=\"tc-manager-list-item-content-item-body\">\n\t\t\t<$transclude tiddler=<<listItem>>/>\n\t\t</$reveal>\n\t</$vars>\n</div>\n\\end\n\n<div class=\"tc-manager-wrapper\">\n\t<div class=\"tc-manager-controls\">\n\t\t<div class=\"tc-manager-control\">\n\t\t\t<<lingo Controls/Show/Prompt>> <$select tiddler=\"$:/config/Manager/Show\" default=\"tiddlers\">\n\t\t\t\t<option value=\"tiddlers\"><<lingo Controls/Show/Option/Tiddlers>></option>\n\t\t\t\t<option value=\"tags\"><<lingo Controls/Show/Option/Tags>></option>\n\t\t\t</$select>\n\t\t</div>\n\t\t<div class=\"tc-manager-control\">\n\t\t\t<<lingo Controls/Search/Prompt>> <$edit-text tiddler=\"$:/config/Manager/Filter\" tag=\"input\" default=\"\" placeholder={{$:/language/Manager/Controls/Search/Placeholder}}/>\n\t\t</div>\n\t\t<div class=\"tc-manager-control\">\n\t\t\t<<lingo Controls/FilterByTag/Prompt>> <$select tiddler=\"$:/config/Manager/Tag\" default=\"\">\n\t\t\t\t<option value=\"\"><<lingo Controls/FilterByTag/None>></option>\n\t\t\t\t<$list filter=\"[!is{$:/config/Manager/System}tags[]!is[system]sort[title]]\" variable=\"tag\">\n\t\t\t\t\t<option value=<<tag>>><$text text=<<tag>>/></option>\n\t\t\t\t</$list>\n\t\t\t</$select>\n\t\t</div>\n\t\t<div class=\"tc-manager-control\">\n\t\t\t<<lingo Controls/Sort/Prompt>> <$select tiddler=\"$:/config/Manager/Sort\" default=\"title\">\n\t\t\t\t<optgroup label=\"Common\">\n\t\t\t\t\t<$list filter=\"title modified modifier created creator created\" variable=\"field\">\n\t\t\t\t\t\t<option value=<<field>>><$text text=<<field>>/></option>\n\t\t\t\t\t</$list>\n\t\t\t\t</optgroup>\n\t\t\t\t<optgroup label=\"All\">\n\t\t\t\t\t<$list filter=\"[all{$:/config/Manager/Show}!is{$:/config/Manager/System}fields[]sort[title]] -title -modified -modifier -created -creator -created\" variable=\"field\">\n\t\t\t\t\t\t<option value=<<field>>><$text text=<<field>>/></option>\n\t\t\t\t\t</$list>\n\t\t\t\t</optgroup>\n\t\t\t</$select>\n\t\t\t<$checkbox tiddler=\"$:/config/Manager/Order\" field=\"text\" checked=\"reverse\" unchecked=\"forward\" default=\"forward\">\n\t\t\t\t<<lingo Controls/Order/Prompt>>\n\t\t\t</$checkbox>\n\t\t</div>\n\t\t<div class=\"tc-manager-control\">\n\t\t\t<$checkbox tiddler=\"$:/config/Manager/System\" field=\"text\" checked=\"\" unchecked=\"system\" default=\"system\">\n\t\t\t\t{{$:/language/SystemTiddlers/Include/Prompt}}\n\t\t\t</$checkbox>\n\t\t</div>\n\t</div>\n\t<div class=\"tc-manager-list\">\n\t\t<$list filter=\"[all{$:/config/Manager/Show}!is{$:/config/Manager/System}search{$:/config/Manager/Filter}tag:strict{$:/config/Manager/Tag}sort{$:/config/Manager/Sort}order{$:/config/Manager/Order}]\">\n\t\t\t<$vars transclusion=<<currentTiddler>>>\n\t\t\t\t<div style=\"tc-manager-list-item\">\n\t\t\t\t\t<$button popup=<<qualify \"$:/state/manager/popup\">> class=\"tc-btn-invisible tc-manager-list-item-heading\" selectedClass=\"tc-manager-list-item-heading-selected\">\n\t\t\t\t\t\t<$text text=<<currentTiddler>>/>\n\t\t\t\t\t</$button>\n\t\t\t\t\t<$reveal state=<<qualify \"$:/state/manager/popup\">> type=\"nomatch\" text=\"\" default=\"\" tag=\"div\" class=\"tc-manager-list-item-content tc-popup-handle\">\n\t\t\t\t\t\t<div class=\"tc-manager-list-item-content-tiddler\">\n\t\t\t\t\t\t\t<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/Manager/ItemMain]!has[draft.of]]\" variable=\"listItem\">\n\t\t\t\t\t\t\t\t<<list-item-content-item>>\n\t\t\t\t\t\t\t</$list>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"tc-manager-list-item-content-sidebar\">\n\t\t\t\t\t\t\t<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/Manager/ItemSidebar]!has[draft.of]]\" variable=\"listItem\">\n\t\t\t\t\t\t\t\t<<list-item-content-item>>\n\t\t\t\t\t\t\t</$list>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</$reveal>\n\t\t\t\t</div>\n\t\t\t</$vars>\n\t\t</$list>\n\t</div>\n</div>\n"
        },
        "$:/core/ui/MissingTemplate": {
            "title": "$:/core/ui/MissingTemplate",
            "text": "<div class=\"tc-tiddler-missing\">\n<$button popup=<<qualify \"$:/state/popup/missing\">> class=\"tc-btn-invisible tc-missing-tiddler-label\">\n<$view field=\"title\" format=\"text\" />\n</$button>\n<$reveal state=<<qualify \"$:/state/popup/missing\">> type=\"popup\" position=\"below\" animate=\"yes\">\n<div class=\"tc-drop-down\">\n<$transclude tiddler=\"$:/core/ui/ListItemTemplate\"/>\n<hr>\n<$list filter=\"[all[current]backlinks[]sort[title]]\" template=\"$:/core/ui/ListItemTemplate\"/>\n</div>\n</$reveal>\n</div>\n"
        },
        "$:/core/ui/MoreSideBar/All": {
            "title": "$:/core/ui/MoreSideBar/All",
            "tags": "$:/tags/MoreSideBar",
            "caption": "{{$:/language/SideBar/All/Caption}}",
            "text": "<$list filter={{$:/core/Filters/AllTiddlers!!filter}} template=\"$:/core/ui/ListItemTemplate\"/>\n"
        },
        "$:/core/ui/MoreSideBar/Drafts": {
            "title": "$:/core/ui/MoreSideBar/Drafts",
            "tags": "$:/tags/MoreSideBar",
            "caption": "{{$:/language/SideBar/Drafts/Caption}}",
            "text": "<$list filter={{$:/core/Filters/Drafts!!filter}} template=\"$:/core/ui/ListItemTemplate\"/>\n"
        },
        "$:/core/ui/MoreSideBar/Missing": {
            "title": "$:/core/ui/MoreSideBar/Missing",
            "tags": "$:/tags/MoreSideBar",
            "caption": "{{$:/language/SideBar/Missing/Caption}}",
            "text": "<$list filter={{$:/core/Filters/Missing!!filter}} template=\"$:/core/ui/MissingTemplate\"/>\n"
        },
        "$:/core/ui/MoreSideBar/Orphans": {
            "title": "$:/core/ui/MoreSideBar/Orphans",
            "tags": "$:/tags/MoreSideBar",
            "caption": "{{$:/language/SideBar/Orphans/Caption}}",
            "text": "<$list filter={{$:/core/Filters/Orphans!!filter}} template=\"$:/core/ui/ListItemTemplate\"/>\n"
        },
        "$:/core/ui/MoreSideBar/Plugins": {
            "title": "$:/core/ui/MoreSideBar/Plugins",
            "tags": "$:/tags/MoreSideBar",
            "caption": "{{$:/language/ControlPanel/Plugins/Caption}}",
            "text": "\n{{$:/language/ControlPanel/Plugins/Installed/Hint}}\n\n<<tabs \"[all[shadows+tiddlers]tag[$:/tags/MoreSideBar/Plugins]!has[draft.of]]\" \"$:/core/ui/MoreSideBar/Plugins/Plugins\">>\n"
        },
        "$:/core/ui/MoreSideBar/Recent": {
            "title": "$:/core/ui/MoreSideBar/Recent",
            "tags": "$:/tags/MoreSideBar",
            "caption": "{{$:/language/SideBar/Recent/Caption}}",
            "text": "<$macrocall $name=\"timeline\" format={{$:/language/RecentChanges/DateFormat}}/>\n"
        },
        "$:/core/ui/MoreSideBar/Shadows": {
            "title": "$:/core/ui/MoreSideBar/Shadows",
            "tags": "$:/tags/MoreSideBar",
            "caption": "{{$:/language/SideBar/Shadows/Caption}}",
            "text": "<$list filter={{$:/core/Filters/ShadowTiddlers!!filter}} template=\"$:/core/ui/ListItemTemplate\"/>\n"
        },
        "$:/core/ui/MoreSideBar/System": {
            "title": "$:/core/ui/MoreSideBar/System",
            "tags": "$:/tags/MoreSideBar",
            "caption": "{{$:/language/SideBar/System/Caption}}",
            "text": "<$list filter={{$:/core/Filters/SystemTiddlers!!filter}} template=\"$:/core/ui/ListItemTemplate\"/>\n"
        },
        "$:/core/ui/MoreSideBar/Tags": {
            "title": "$:/core/ui/MoreSideBar/Tags",
            "tags": "$:/tags/MoreSideBar",
            "caption": "{{$:/language/SideBar/Tags/Caption}}",
            "text": "<$set name=\"tv-config-toolbar-icons\" value=\"yes\">\n\n<$set name=\"tv-config-toolbar-text\" value=\"yes\">\n\n<$set name=\"tv-config-toolbar-class\" value=\"\">\n\n{{$:/core/ui/Buttons/tag-manager}}\n\n</$set>\n\n</$set>\n\n</$set>\n\n<$list filter={{$:/core/Filters/AllTags!!filter}}>\n\n<$transclude tiddler=\"$:/core/ui/TagTemplate\"/>\n\n</$list>\n\n<hr class=\"tc-untagged-separator\">\n\n{{$:/core/ui/UntaggedTemplate}}\n"
        },
        "$:/core/ui/MoreSideBar/Types": {
            "title": "$:/core/ui/MoreSideBar/Types",
            "tags": "$:/tags/MoreSideBar",
            "caption": "{{$:/language/SideBar/Types/Caption}}",
            "text": "<$list filter={{$:/core/Filters/TypedTiddlers!!filter}}>\n<div class=\"tc-menu-list-item\">\n<$view field=\"type\"/>\n<$list filter=\"[type{!!type}!is[system]sort[title]]\">\n<div class=\"tc-menu-list-subitem\">\n<$link to={{!!title}}><$view field=\"title\"/></$link>\n</div>\n</$list>\n</div>\n</$list>\n"
        },
        "$:/core/ui/MoreSideBar/Plugins/Languages": {
            "title": "$:/core/ui/MoreSideBar/Plugins/Languages",
            "tags": "$:/tags/MoreSideBar/Plugins",
            "caption": "{{$:/language/ControlPanel/Plugins/Languages/Caption}}",
            "text": "<$list filter=\"[!has[draft.of]plugin-type[language]sort[description]]\" template=\"$:/core/ui/PluginListItemTemplate\" emptyMessage={{$:/language/ControlPanel/Plugins/Empty/Hint}}/>\n"
        },
        "$:/core/ui/MoreSideBar/Plugins/Plugins": {
            "title": "$:/core/ui/MoreSideBar/Plugins/Plugins",
            "tags": "$:/tags/MoreSideBar/Plugins",
            "caption": "{{$:/language/ControlPanel/Plugins/Plugins/Caption}}",
            "text": "<$list filter=\"[!has[draft.of]plugin-type[plugin]sort[description]]\" template=\"$:/core/ui/PluginListItemTemplate\" emptyMessage={{$:/language/ControlPanel/Plugins/Empty/Hint}}>>/>\n"
        },
        "$:/core/ui/MoreSideBar/Plugins/Theme": {
            "title": "$:/core/ui/MoreSideBar/Plugins/Theme",
            "tags": "$:/tags/MoreSideBar/Plugins",
            "caption": "{{$:/language/ControlPanel/Plugins/Themes/Caption}}",
            "text": "<$list filter=\"[!has[draft.of]plugin-type[theme]sort[description]]\" template=\"$:/core/ui/PluginListItemTemplate\" emptyMessage={{$:/language/ControlPanel/Plugins/Empty/Hint}}/>\n"
        },
        "$:/core/ui/Buttons/advanced-search": {
            "title": "$:/core/ui/Buttons/advanced-search",
            "tags": "$:/tags/PageControls",
            "caption": "{{$:/core/images/advanced-search-button}} {{$:/language/Buttons/AdvancedSearch/Caption}}",
            "description": "{{$:/language/Buttons/AdvancedSearch/Hint}}",
            "text": "\\define control-panel-button(class)\n<$button to=\"$:/AdvancedSearch\" tooltip={{$:/language/Buttons/AdvancedSearch/Hint}} aria-label={{$:/language/Buttons/AdvancedSearch/Caption}} class=\"\"\"$(tv-config-toolbar-class)$ $class$\"\"\">\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/advanced-search-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/AdvancedSearch/Caption}}/></span>\n</$list>\n</$button>\n\\end\n\n<$list filter=\"[list[$:/StoryList]] +[field:title[$:/AdvancedSearch]]\" emptyMessage=<<control-panel-button>>>\n<<control-panel-button \"tc-selected\">>\n</$list>\n"
        },
        "$:/core/ui/Buttons/close-all": {
            "title": "$:/core/ui/Buttons/close-all",
            "tags": "$:/tags/PageControls",
            "caption": "{{$:/core/images/close-all-button}} {{$:/language/Buttons/CloseAll/Caption}}",
            "description": "{{$:/language/Buttons/CloseAll/Hint}}",
            "text": "<$button message=\"tm-close-all-tiddlers\" tooltip={{$:/language/Buttons/CloseAll/Hint}} aria-label={{$:/language/Buttons/CloseAll/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/close-all-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/CloseAll/Caption}}/></span>\n</$list>\n</$button>"
        },
        "$:/core/ui/Buttons/control-panel": {
            "title": "$:/core/ui/Buttons/control-panel",
            "tags": "$:/tags/PageControls",
            "caption": "{{$:/core/images/options-button}} {{$:/language/Buttons/ControlPanel/Caption}}",
            "description": "{{$:/language/Buttons/ControlPanel/Hint}}",
            "text": "\\define control-panel-button(class)\n<$button to=\"$:/ControlPanel\" tooltip={{$:/language/Buttons/ControlPanel/Hint}} aria-label={{$:/language/Buttons/ControlPanel/Caption}} class=\"\"\"$(tv-config-toolbar-class)$ $class$\"\"\">\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/options-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/ControlPanel/Caption}}/></span>\n</$list>\n</$button>\n\\end\n\n<$list filter=\"[list[$:/StoryList]] +[field:title[$:/ControlPanel]]\" emptyMessage=<<control-panel-button>>>\n<<control-panel-button \"tc-selected\">>\n</$list>\n"
        },
        "$:/core/ui/Buttons/encryption": {
            "title": "$:/core/ui/Buttons/encryption",
            "tags": "$:/tags/PageControls",
            "caption": "{{$:/core/images/locked-padlock}} {{$:/language/Buttons/Encryption/Caption}}",
            "description": "{{$:/language/Buttons/Encryption/Hint}}",
            "text": "<$reveal type=\"match\" state=\"$:/isEncrypted\" text=\"yes\">\n<$button message=\"tm-clear-password\" tooltip={{$:/language/Buttons/Encryption/ClearPassword/Hint}} aria-label={{$:/language/Buttons/Encryption/ClearPassword/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/locked-padlock}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Encryption/ClearPassword/Caption}}/></span>\n</$list>\n</$button>\n</$reveal>\n<$reveal type=\"nomatch\" state=\"$:/isEncrypted\" text=\"yes\">\n<$button message=\"tm-set-password\" tooltip={{$:/language/Buttons/Encryption/SetPassword/Hint}} aria-label={{$:/language/Buttons/Encryption/SetPassword/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/unlocked-padlock}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Encryption/SetPassword/Caption}}/></span>\n</$list>\n</$button>\n</$reveal>"
        },
        "$:/core/ui/Buttons/export-page": {
            "title": "$:/core/ui/Buttons/export-page",
            "tags": "$:/tags/PageControls",
            "caption": "{{$:/core/images/export-button}} {{$:/language/Buttons/ExportPage/Caption}}",
            "description": "{{$:/language/Buttons/ExportPage/Hint}}",
            "text": "<$macrocall $name=\"exportButton\" exportFilter=\"[!is[system]sort[title]]\" lingoBase=\"$:/language/Buttons/ExportPage/\"/>"
        },
        "$:/core/ui/Buttons/fold-all": {
            "title": "$:/core/ui/Buttons/fold-all",
            "tags": "$:/tags/PageControls",
            "caption": "{{$:/core/images/fold-all-button}} {{$:/language/Buttons/FoldAll/Caption}}",
            "description": "{{$:/language/Buttons/FoldAll/Hint}}",
            "text": "<$button tooltip={{$:/language/Buttons/FoldAll/Hint}} aria-label={{$:/language/Buttons/FoldAll/Caption}} class=<<tv-config-toolbar-class>>>\n<$action-sendmessage $message=\"tm-fold-all-tiddlers\" $param=<<currentTiddler>> foldedStatePrefix=\"$:/state/folded/\"/>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\" variable=\"listItem\">\n{{$:/core/images/fold-all-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/FoldAll/Caption}}/></span>\n</$list>\n</$button>"
        },
        "$:/core/ui/Buttons/full-screen": {
            "title": "$:/core/ui/Buttons/full-screen",
            "tags": "$:/tags/PageControls",
            "caption": "{{$:/core/images/full-screen-button}} {{$:/language/Buttons/FullScreen/Caption}}",
            "description": "{{$:/language/Buttons/FullScreen/Hint}}",
            "text": "<$button message=\"tm-full-screen\" tooltip={{$:/language/Buttons/FullScreen/Hint}} aria-label={{$:/language/Buttons/FullScreen/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/full-screen-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/FullScreen/Caption}}/></span>\n</$list>\n</$button>"
        },
        "$:/core/ui/Buttons/home": {
            "title": "$:/core/ui/Buttons/home",
            "tags": "$:/tags/PageControls",
            "caption": "{{$:/core/images/home-button}} {{$:/language/Buttons/Home/Caption}}",
            "description": "{{$:/language/Buttons/Home/Hint}}",
            "text": "<$button message=\"tm-home\" tooltip={{$:/language/Buttons/Home/Hint}} aria-label={{$:/language/Buttons/Home/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/home-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Home/Caption}}/></span>\n</$list>\n</$button>"
        },
        "$:/core/ui/Buttons/import": {
            "title": "$:/core/ui/Buttons/import",
            "tags": "$:/tags/PageControls",
            "caption": "{{$:/core/images/import-button}} {{$:/language/Buttons/Import/Caption}}",
            "description": "{{$:/language/Buttons/Import/Hint}}",
            "text": "<div class=\"tc-file-input-wrapper\">\n<$button tooltip={{$:/language/Buttons/Import/Hint}} aria-label={{$:/language/Buttons/Import/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/import-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Import/Caption}}/></span>\n</$list>\n</$button>\n<$browse tooltip={{$:/language/Buttons/Import/Hint}}/>\n</div>"
        },
        "$:/core/ui/Buttons/language": {
            "title": "$:/core/ui/Buttons/language",
            "tags": "$:/tags/PageControls",
            "caption": "{{$:/core/images/globe}} {{$:/language/Buttons/Language/Caption}}",
            "description": "{{$:/language/Buttons/Language/Hint}}",
            "text": "\\define flag-title()\n$(languagePluginTitle)$/icon\n\\end\n<span class=\"tc-popup-keep\">\n<$button popup=<<qualify \"$:/state/popup/language\">> tooltip={{$:/language/Buttons/Language/Hint}} aria-label={{$:/language/Buttons/Language/Caption}} class=<<tv-config-toolbar-class>> selectedClass=\"tc-selected\">\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n<span class=\"tc-image-button\">\n<$set name=\"languagePluginTitle\" value={{$:/language}}>\n<$image source=<<flag-title>>/>\n</$set>\n</span>\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Language/Caption}}/></span>\n</$list>\n</$button>\n</span>\n<$reveal state=<<qualify \"$:/state/popup/language\">> type=\"popup\" position=\"below\" animate=\"yes\">\n<div class=\"tc-drop-down tc-drop-down-language-chooser\">\n<$linkcatcher to=\"$:/language\">\n<$list filter=\"[[$:/languages/en-GB]] [plugin-type[language]sort[description]]\">\n<$link>\n<span class=\"tc-drop-down-bullet\">\n<$reveal type=\"match\" state=\"$:/language\" text=<<currentTiddler>>>\n&bull;\n</$reveal>\n<$reveal type=\"nomatch\" state=\"$:/language\" text=<<currentTiddler>>>\n&nbsp;\n</$reveal>\n</span>\n<span class=\"tc-image-button\">\n<$set name=\"languagePluginTitle\" value=<<currentTiddler>>>\n<$transclude subtiddler=<<flag-title>>>\n<$list filter=\"[all[current]field:title[$:/languages/en-GB]]\">\n<$transclude tiddler=\"$:/languages/en-GB/icon\"/>\n</$list>\n</$transclude>\n</$set>\n</span>\n<$view field=\"description\">\n<$view field=\"name\">\n<$view field=\"title\"/>\n</$view>\n</$view>\n</$link>\n</$list>\n</$linkcatcher>\n</div>\n</$reveal>"
        },
        "$:/core/ui/Buttons/manager": {
            "title": "$:/core/ui/Buttons/manager",
            "tags": "$:/tags/PageControls",
            "caption": "{{$:/core/images/list}} {{$:/language/Buttons/Manager/Caption}}",
            "description": "{{$:/language/Buttons/Manager/Hint}}",
            "text": "\\define manager-button(class)\n<$button to=\"$:/Manager\" tooltip={{$:/language/Buttons/Manager/Hint}} aria-label={{$:/language/Buttons/Manager/Caption}} class=\"\"\"$(tv-config-toolbar-class)$ $class$\"\"\">\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/list}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Manager/Caption}}/></span>\n</$list>\n</$button>\n\\end\n\n<$list filter=\"[list[$:/StoryList]] +[field:title[$:/Manager]]\" emptyMessage=<<manager-button>>>\n<<manager-button \"tc-selected\">>\n</$list>\n"
        },
        "$:/core/ui/Buttons/more-page-actions": {
            "title": "$:/core/ui/Buttons/more-page-actions",
            "tags": "$:/tags/PageControls",
            "caption": "{{$:/core/images/down-arrow}} {{$:/language/Buttons/More/Caption}}",
            "description": "{{$:/language/Buttons/More/Hint}}",
            "text": "\\define config-title()\n$:/config/PageControlButtons/Visibility/$(listItem)$\n\\end\n<$button popup=<<qualify \"$:/state/popup/more\">> tooltip={{$:/language/Buttons/More/Hint}} aria-label={{$:/language/Buttons/More/Caption}} class=<<tv-config-toolbar-class>> selectedClass=\"tc-selected\">\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/down-arrow}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/More/Caption}}/></span>\n</$list>\n</$button><$reveal state=<<qualify \"$:/state/popup/more\">> type=\"popup\" position=\"below\" animate=\"yes\">\n\n<div class=\"tc-drop-down\">\n\n<$set name=\"tv-config-toolbar-icons\" value=\"yes\">\n\n<$set name=\"tv-config-toolbar-text\" value=\"yes\">\n\n<$set name=\"tv-config-toolbar-class\" value=\"tc-btn-invisible\">\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]] -[[$:/core/ui/Buttons/more-page-actions]]\" variable=\"listItem\">\n\n<$reveal type=\"match\" state=<<config-title>> text=\"hide\">\n\n<$transclude tiddler=<<listItem>> mode=\"inline\"/>\n\n</$reveal>\n\n</$list>\n\n</$set>\n\n</$set>\n\n</$set>\n\n</div>\n\n</$reveal>"
        },
        "$:/core/ui/Buttons/new-image": {
            "title": "$:/core/ui/Buttons/new-image",
            "tags": "$:/tags/PageControls",
            "caption": "{{$:/core/images/new-image-button}} {{$:/language/Buttons/NewImage/Caption}}",
            "description": "{{$:/language/Buttons/NewImage/Hint}}",
            "text": "<$button tooltip={{$:/language/Buttons/NewImage/Hint}} aria-label={{$:/language/Buttons/NewImage/Caption}} class=<<tv-config-toolbar-class>>>\n<$action-sendmessage $message=\"tm-new-tiddler\" type=\"image/jpeg\"/>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/new-image-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/NewImage/Caption}}/></span>\n</$list>\n</$button>\n"
        },
        "$:/core/ui/Buttons/new-journal": {
            "title": "$:/core/ui/Buttons/new-journal",
            "tags": "$:/tags/PageControls",
            "caption": "{{$:/core/images/new-journal-button}} {{$:/language/Buttons/NewJournal/Caption}}",
            "description": "{{$:/language/Buttons/NewJournal/Hint}}",
            "text": "\\define journalButton()\n<$button tooltip={{$:/language/Buttons/NewJournal/Hint}} aria-label={{$:/language/Buttons/NewJournal/Caption}} class=<<tv-config-toolbar-class>>>\n<$action-sendmessage $message=\"tm-new-tiddler\" title=<<now \"$(journalTitleTemplate)$\">> tags=\"$(journalTags)$\" text=\"$(journalText)$\"/>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/new-journal-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/NewJournal/Caption}}/></span>\n</$list>\n</$button>\n\\end\n<$set name=\"journalTitleTemplate\" value={{$:/config/NewJournal/Title}}>\n<$set name=\"journalTags\" value={{$:/config/NewJournal/Tags}}>\n<$set name=\"journalText\" value={{$:/config/NewJournal/Text}}>\n<<journalButton>>\n</$set></$set></$set>"
        },
        "$:/core/ui/Buttons/new-tiddler": {
            "title": "$:/core/ui/Buttons/new-tiddler",
            "tags": "$:/tags/PageControls",
            "caption": "{{$:/core/images/new-button}} {{$:/language/Buttons/NewTiddler/Caption}}",
            "description": "{{$:/language/Buttons/NewTiddler/Hint}}",
            "text": "<$button message=\"tm-new-tiddler\" tooltip={{$:/language/Buttons/NewTiddler/Hint}} aria-label={{$:/language/Buttons/NewTiddler/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/new-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/NewTiddler/Caption}}/></span>\n</$list>\n</$button>"
        },
        "$:/core/ui/Buttons/palette": {
            "title": "$:/core/ui/Buttons/palette",
            "tags": "$:/tags/PageControls",
            "caption": "{{$:/core/images/palette}} {{$:/language/Buttons/Palette/Caption}}",
            "description": "{{$:/language/Buttons/Palette/Hint}}",
            "text": "<span class=\"tc-popup-keep\">\n<$button popup=<<qualify \"$:/state/popup/palette\">> tooltip={{$:/language/Buttons/Palette/Hint}} aria-label={{$:/language/Buttons/Palette/Caption}} class=<<tv-config-toolbar-class>> selectedClass=\"tc-selected\">\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/palette}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Palette/Caption}}/></span>\n</$list>\n</$button>\n</span>\n<$reveal state=<<qualify \"$:/state/popup/palette\">> type=\"popup\" position=\"below\" animate=\"yes\">\n<div class=\"tc-drop-down\" style=\"font-size:0.7em;\">\n{{$:/snippets/paletteswitcher}}\n</div>\n</$reveal>"
        },
        "$:/core/ui/Buttons/print": {
            "title": "$:/core/ui/Buttons/print",
            "tags": "$:/tags/PageControls",
            "caption": "{{$:/core/images/print-button}} {{$:/language/Buttons/Print/Caption}}",
            "description": "{{$:/language/Buttons/Print/Hint}}",
            "text": "<$button message=\"tm-print\" tooltip={{$:/language/Buttons/Print/Hint}} aria-label={{$:/language/Buttons/Print/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/print-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Print/Caption}}/></span>\n</$list>\n</$button>"
        },
        "$:/core/ui/Buttons/refresh": {
            "title": "$:/core/ui/Buttons/refresh",
            "tags": "$:/tags/PageControls",
            "caption": "{{$:/core/images/refresh-button}} {{$:/language/Buttons/Refresh/Caption}}",
            "description": "{{$:/language/Buttons/Refresh/Hint}}",
            "text": "<$button message=\"tm-browser-refresh\" tooltip={{$:/language/Buttons/Refresh/Hint}} aria-label={{$:/language/Buttons/Refresh/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/refresh-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Refresh/Caption}}/></span>\n</$list>\n</$button>"
        },
        "$:/core/ui/Buttons/save-wiki": {
            "title": "$:/core/ui/Buttons/save-wiki",
            "tags": "$:/tags/PageControls",
            "caption": "{{$:/core/images/save-button}} {{$:/language/Buttons/SaveWiki/Caption}}",
            "description": "{{$:/language/Buttons/SaveWiki/Hint}}",
            "text": "<$button message=\"tm-save-wiki\" param={{$:/config/SaveWikiButton/Template}} tooltip={{$:/language/Buttons/SaveWiki/Hint}} aria-label={{$:/language/Buttons/SaveWiki/Caption}} class=<<tv-config-toolbar-class>>>\n<span class=\"tc-dirty-indicator\">\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/save-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/SaveWiki/Caption}}/></span>\n</$list>\n</span>\n</$button>"
        },
        "$:/core/ui/Buttons/storyview": {
            "title": "$:/core/ui/Buttons/storyview",
            "tags": "$:/tags/PageControls",
            "caption": "{{$:/core/images/storyview-classic}} {{$:/language/Buttons/StoryView/Caption}}",
            "description": "{{$:/language/Buttons/StoryView/Hint}}",
            "text": "\\define icon()\n$:/core/images/storyview-$(storyview)$\n\\end\n<span class=\"tc-popup-keep\">\n<$button popup=<<qualify \"$:/state/popup/storyview\">> tooltip={{$:/language/Buttons/StoryView/Hint}} aria-label={{$:/language/Buttons/StoryView/Caption}} class=<<tv-config-toolbar-class>> selectedClass=\"tc-selected\">\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n<$set name=\"storyview\" value={{$:/view}}>\n<$transclude tiddler=<<icon>>/>\n</$set>\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/StoryView/Caption}}/></span>\n</$list>\n</$button>\n</span>\n<$reveal state=<<qualify \"$:/state/popup/storyview\">> type=\"popup\" position=\"below\" animate=\"yes\">\n<div class=\"tc-drop-down\">\n<$linkcatcher to=\"$:/view\">\n<$list filter=\"[storyviews[]]\" variable=\"storyview\">\n<$link to=<<storyview>>>\n<span class=\"tc-drop-down-bullet\">\n<$reveal type=\"match\" state=\"$:/view\" text=<<storyview>>>\n&bull;\n</$reveal>\n<$reveal type=\"nomatch\" state=\"$:/view\" text=<<storyview>>>\n&nbsp;\n</$reveal>\n</span>\n<$transclude tiddler=<<icon>>/>\n<$text text=<<storyview>>/></$link>\n</$list>\n</$linkcatcher>\n</div>\n</$reveal>"
        },
        "$:/core/ui/Buttons/tag-manager": {
            "title": "$:/core/ui/Buttons/tag-manager",
            "tags": "$:/tags/PageControls",
            "caption": "{{$:/core/images/tag-button}} {{$:/language/Buttons/TagManager/Caption}}",
            "description": "{{$:/language/Buttons/TagManager/Hint}}",
            "text": "\\define control-panel-button(class)\n<$button to=\"$:/TagManager\" tooltip={{$:/language/Buttons/TagManager/Hint}} aria-label={{$:/language/Buttons/TagManager/Caption}} class=\"\"\"$(tv-config-toolbar-class)$ $class$\"\"\">\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/tag-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/TagManager/Caption}}/></span>\n</$list>\n</$button>\n\\end\n\n<$list filter=\"[list[$:/StoryList]] +[field:title[$:/TagManager]]\" emptyMessage=<<control-panel-button>>>\n<<control-panel-button \"tc-selected\">>\n</$list>\n"
        },
        "$:/core/ui/Buttons/theme": {
            "title": "$:/core/ui/Buttons/theme",
            "tags": "$:/tags/PageControls",
            "caption": "{{$:/core/images/theme-button}} {{$:/language/Buttons/Theme/Caption}}",
            "description": "{{$:/language/Buttons/Theme/Hint}}",
            "text": "<span class=\"tc-popup-keep\">\n<$button popup=<<qualify \"$:/state/popup/theme\">> tooltip={{$:/language/Buttons/Theme/Hint}} aria-label={{$:/language/Buttons/Theme/Caption}} class=<<tv-config-toolbar-class>> selectedClass=\"tc-selected\">\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/theme-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Theme/Caption}}/></span>\n</$list>\n</$button>\n</span>\n<$reveal state=<<qualify \"$:/state/popup/theme\">> type=\"popup\" position=\"below\" animate=\"yes\">\n<div class=\"tc-drop-down\">\n<$linkcatcher to=\"$:/theme\">\n<$list filter=\"[plugin-type[theme]sort[title]]\" variable=\"themeTitle\">\n<$link to=<<themeTitle>>>\n<span class=\"tc-drop-down-bullet\">\n<$reveal type=\"match\" state=\"$:/theme\" text=<<themeTitle>>>\n&bull;\n</$reveal>\n<$reveal type=\"nomatch\" state=\"$:/theme\" text=<<themeTitle>>>\n&nbsp;\n</$reveal>\n</span>\n<$view tiddler=<<themeTitle>> field=\"name\"/>\n</$link>\n</$list>\n</$linkcatcher>\n</div>\n</$reveal>"
        },
        "$:/core/ui/Buttons/timestamp": {
            "title": "$:/core/ui/Buttons/timestamp",
            "tags": "$:/tags/PageControls",
            "caption": "{{$:/core/images/timestamp-on}} {{$:/language/Buttons/Timestamp/Caption}}",
            "description": "{{$:/language/Buttons/Timestamp/Hint}}",
            "text": "<$reveal type=\"nomatch\" state=\"$:/config/TimestampDisable\" text=\"yes\">\n<$button tooltip={{$:/language/Buttons/Timestamp/On/Hint}} aria-label={{$:/language/Buttons/Timestamp/On/Caption}} class=<<tv-config-toolbar-class>>>\n<$action-setfield $tiddler=\"$:/config/TimestampDisable\" $value=\"yes\"/>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/timestamp-on}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Timestamp/On/Caption}}/></span>\n</$list>\n</$button>\n</$reveal>\n<$reveal type=\"match\" state=\"$:/config/TimestampDisable\" text=\"yes\">\n<$button tooltip={{$:/language/Buttons/Timestamp/Off/Hint}} aria-label={{$:/language/Buttons/Timestamp/Off/Caption}} class=<<tv-config-toolbar-class>>>\n<$action-setfield $tiddler=\"$:/config/TimestampDisable\" $value=\"no\"/>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/timestamp-off}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Timestamp/Off/Caption}}/></span>\n</$list>\n</$button>\n</$reveal>"
        },
        "$:/core/ui/Buttons/unfold-all": {
            "title": "$:/core/ui/Buttons/unfold-all",
            "tags": "$:/tags/PageControls",
            "caption": "{{$:/core/images/unfold-all-button}} {{$:/language/Buttons/UnfoldAll/Caption}}",
            "description": "{{$:/language/Buttons/UnfoldAll/Hint}}",
            "text": "<$button tooltip={{$:/language/Buttons/UnfoldAll/Hint}} aria-label={{$:/language/Buttons/UnfoldAll/Caption}} class=<<tv-config-toolbar-class>>>\n<$action-sendmessage $message=\"tm-unfold-all-tiddlers\" $param=<<currentTiddler>> foldedStatePrefix=\"$:/state/folded/\"/>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\" variable=\"listItem\">\n{{$:/core/images/unfold-all-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/UnfoldAll/Caption}}/></span>\n</$list>\n</$button>"
        },
        "$:/core/ui/PageTemplate/pagecontrols": {
            "title": "$:/core/ui/PageTemplate/pagecontrols",
            "text": "\\define config-title()\n$:/config/PageControlButtons/Visibility/$(listItem)$\n\\end\n<div class=\"tc-page-controls\">\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]]\" variable=\"listItem\">\n<$reveal type=\"nomatch\" state=<<config-title>> text=\"hide\">\n<$transclude tiddler=<<listItem>> mode=\"inline\"/>\n</$reveal>\n</$list>\n</div>\n\n"
        },
        "$:/core/ui/PageStylesheet": {
            "title": "$:/core/ui/PageStylesheet",
            "text": "<$importvariables filter=\"[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]\">\n\n<$set name=\"currentTiddler\" value={{$:/language}}>\n\n<$set name=\"languageTitle\" value={{!!name}}>\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/Stylesheet]!has[draft.of]]\">\n<$transclude mode=\"block\"/>\n</$list>\n\n</$set>\n\n</$set>\n\n</$importvariables>\n"
        },
        "$:/core/ui/PageTemplate/alerts": {
            "title": "$:/core/ui/PageTemplate/alerts",
            "tags": "$:/tags/PageTemplate",
            "text": "<div class=\"tc-alerts\">\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/Alert]!has[draft.of]]\" template=\"$:/core/ui/AlertTemplate\" storyview=\"pop\"/>\n\n</div>\n"
        },
        "$:/core/ui/PageTemplate/pluginreloadwarning": {
            "title": "$:/core/ui/PageTemplate/pluginreloadwarning",
            "tags": "$:/tags/PageTemplate",
            "text": "\\define lingo-base() $:/language/\n\n<$list filter=\"[has[plugin-type]haschanged[]!plugin-type[import]limit[1]]\">\n\n<$reveal type=\"nomatch\" state=\"$:/temp/HidePluginWarning\" text=\"yes\">\n\n<div class=\"tc-plugin-reload-warning\">\n\n<$set name=\"tv-config-toolbar-class\" value=\"\">\n\n<<lingo PluginReloadWarning>> <$button set=\"$:/temp/HidePluginWarning\" setTo=\"yes\" class=\"tc-btn-invisible\">{{$:/core/images/close-button}}</$button>\n\n</$set>\n\n</div>\n\n</$reveal>\n\n</$list>\n"
        },
        "$:/core/ui/PageTemplate/sidebar": {
            "title": "$:/core/ui/PageTemplate/sidebar",
            "tags": "$:/tags/PageTemplate",
            "text": "<$scrollable fallthrough=\"no\" class=\"tc-sidebar-scrollable\">\n\n<div class=\"tc-sidebar-header\">\n\n<$reveal state=\"$:/state/sidebar\" type=\"match\" text=\"yes\" default=\"yes\" retain=\"yes\" animate=\"yes\">\n\n<h1 class=\"tc-site-title\">\n\n<$transclude tiddler=\"$:/SiteTitle\" mode=\"inline\"/>\n\n</h1>\n\n<div class=\"tc-site-subtitle\">\n\n<$transclude tiddler=\"$:/SiteSubtitle\" mode=\"inline\"/>\n\n</div>\n\n{{||$:/core/ui/PageTemplate/pagecontrols}}\n\n<$transclude tiddler=\"$:/core/ui/SideBarLists\" mode=\"inline\"/>\n\n</$reveal>\n\n</div>\n\n</$scrollable>"
        },
        "$:/core/ui/PageTemplate/story": {
            "title": "$:/core/ui/PageTemplate/story",
            "tags": "$:/tags/PageTemplate",
            "text": "<section class=\"tc-story-river\">\n\n<section class=\"story-backdrop\">\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/AboveStory]!has[draft.of]]\">\n\n<$transclude/>\n\n</$list>\n\n</section>\n\n<$list filter=\"[list[$:/StoryList]]\" history=\"$:/HistoryList\" template=\"$:/core/ui/ViewTemplate\" editTemplate=\"$:/core/ui/EditTemplate\" storyview={{$:/view}} emptyMessage={{$:/config/EmptyStoryMessage}}/>\n\n<section class=\"story-frontdrop\">\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/BelowStory]!has[draft.of]]\">\n\n<$transclude/>\n\n</$list>\n\n</section>\n\n</section>\n"
        },
        "$:/core/ui/PageTemplate/topleftbar": {
            "title": "$:/core/ui/PageTemplate/topleftbar",
            "tags": "$:/tags/PageTemplate",
            "text": "<span class=\"tc-topbar tc-topbar-left\">\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/TopLeftBar]!has[draft.of]]\" variable=\"listItem\">\n\n<$transclude tiddler=<<listItem>> mode=\"inline\"/>\n\n</$list>\n\n</span>\n"
        },
        "$:/core/ui/PageTemplate/toprightbar": {
            "title": "$:/core/ui/PageTemplate/toprightbar",
            "tags": "$:/tags/PageTemplate",
            "text": "<span class=\"tc-topbar tc-topbar-right\">\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/TopRightBar]!has[draft.of]]\" variable=\"listItem\">\n\n<$transclude tiddler=<<listItem>> mode=\"inline\"/>\n\n</$list>\n\n</span>\n"
        },
        "$:/core/ui/PageTemplate": {
            "title": "$:/core/ui/PageTemplate",
            "text": "\\define containerClasses()\ntc-page-container tc-page-view-$(themeTitle)$ tc-language-$(languageTitle)$\n\\end\n\n<$importvariables filter=\"[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]\">\n\n<$set name=\"tv-config-toolbar-icons\" value={{$:/config/Toolbar/Icons}}>\n\n<$set name=\"tv-config-toolbar-text\" value={{$:/config/Toolbar/Text}}>\n\n<$set name=\"tv-config-toolbar-class\" value={{$:/config/Toolbar/ButtonClass}}>\n\n<$set name=\"themeTitle\" value={{$:/view}}>\n\n<$set name=\"currentTiddler\" value={{$:/language}}>\n\n<$set name=\"languageTitle\" value={{!!name}}>\n\n<$set name=\"currentTiddler\" value=\"\">\n\n<div class=<<containerClasses>>>\n\n<$navigator story=\"$:/StoryList\" history=\"$:/HistoryList\" openLinkFromInsideRiver={{$:/config/Navigation/openLinkFromInsideRiver}} openLinkFromOutsideRiver={{$:/config/Navigation/openLinkFromOutsideRiver}} relinkOnRename={{$:/config/RelinkOnRename}}>\n\n<$dropzone>\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/PageTemplate]!has[draft.of]]\" variable=\"listItem\">\n\n<$transclude tiddler=<<listItem>>/>\n\n</$list>\n\n</$dropzone>\n\n</$navigator>\n\n</div>\n\n</$set>\n\n</$set>\n\n</$set>\n\n</$set>\n\n</$set>\n\n</$set>\n\n</$set>\n\n</$importvariables>\n"
        },
        "$:/core/ui/PluginInfo": {
            "title": "$:/core/ui/PluginInfo",
            "text": "\\define localised-info-tiddler-title()\n$(currentTiddler)$/$(languageTitle)$/$(currentTab)$\n\\end\n\\define info-tiddler-title()\n$(currentTiddler)$/$(currentTab)$\n\\end\n\\define default-tiddler-title()\n$:/core/ui/PluginInfo/Default/$(currentTab)$\n\\end\n<$transclude tiddler=<<localised-info-tiddler-title>> mode=\"block\">\n<$transclude tiddler=<<currentTiddler>> subtiddler=<<localised-info-tiddler-title>> mode=\"block\">\n<$transclude tiddler=<<currentTiddler>> subtiddler=<<info-tiddler-title>> mode=\"block\">\n<$transclude tiddler=<<default-tiddler-title>> mode=\"block\">\n{{$:/language/ControlPanel/Plugin/NoInfoFound/Hint}}\n</$transclude>\n</$transclude>\n</$transclude>\n</$transclude>\n"
        },
        "$:/core/ui/PluginInfo/Default/contents": {
            "title": "$:/core/ui/PluginInfo/Default/contents",
            "text": "\\define lingo-base() $:/language/TiddlerInfo/Advanced/PluginInfo/\n<<lingo Hint>>\n<ul>\n<$list filter=\"[all[current]plugintiddlers[]sort[title]]\" emptyMessage=<<lingo Empty/Hint>>>\n<li>\n<$link to={{!!title}}>\n<$view field=\"title\"/>\n</$link>\n</li>\n</$list>\n</ul>\n"
        },
        "$:/core/ui/PluginListItemTemplate": {
            "title": "$:/core/ui/PluginListItemTemplate",
            "text": "<div class=\"tc-menu-list-item\">\n<$link to={{!!title}}>\n<$view field=\"description\">\n<$view field=\"title\"/>\n</$view>\n</$link>\n</div>"
        },
        "$:/core/ui/SearchResults": {
            "title": "$:/core/ui/SearchResults",
            "text": "<div class=\"tc-search-results\">\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]butfirst[]limit[1]]\" emptyMessage=\"\"\"\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]\">\n<$transclude mode=\"block\"/>\n</$list>\n\"\"\">\n\n<$macrocall $name=\"tabs\" tabsList=\"[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]\" default={{$:/config/SearchResults/Default}}/>\n\n</$list>\n\n</div>\n"
        },
        "$:/core/ui/SideBar/More": {
            "title": "$:/core/ui/SideBar/More",
            "tags": "$:/tags/SideBar",
            "caption": "{{$:/language/SideBar/More/Caption}}",
            "text": "<div class=\"tc-more-sidebar\">\n<<tabs \"[all[shadows+tiddlers]tag[$:/tags/MoreSideBar]!has[draft.of]]\" \"$:/core/ui/MoreSideBar/Tags\" \"$:/state/tab/moresidebar\" \"tc-vertical\">>\n</div>\n"
        },
        "$:/core/ui/SideBar/Open": {
            "title": "$:/core/ui/SideBar/Open",
            "tags": "$:/tags/SideBar",
            "caption": "{{$:/language/SideBar/Open/Caption}}",
            "text": "\\define lingo-base() $:/language/CloseAll/\n\n\\define drop-actions()\n<$action-listops $tiddler=\"$:/StoryList\" $subfilter=\"+[insertbefore:currentTiddler<actionTiddler>]\"/>\n\\end\n\n<$list filter=\"[list[$:/StoryList]]\" history=\"$:/HistoryList\" storyview=\"pop\">\n<div style=\"position: relative;\">\n<$droppable actions=<<drop-actions>>>\n<div class=\"tc-droppable-placeholder\">\n&nbsp;\n</div>\n<div>\n<$button message=\"tm-close-tiddler\" tooltip={{$:/language/Buttons/Close/Hint}} aria-label={{$:/language/Buttons/Close/Caption}} class=\"tc-btn-invisible tc-btn-mini\">&times;</$button> <$link to={{!!title}}><$view field=\"title\"/></$link>\n</div>\n</$droppable>\n</div>\n</$list>\n<$tiddler tiddler=\"\">\n<$droppable actions=<<drop-actions>>>\n<div class=\"tc-droppable-placeholder\">\n&nbsp;\n</div>\n<$button message=\"tm-close-all-tiddlers\" class=\"tc-btn-invisible tc-btn-mini\"><<lingo Button>></$button>\n</$droppable>\n</$tiddler>\n"
        },
        "$:/core/ui/SideBar/Recent": {
            "title": "$:/core/ui/SideBar/Recent",
            "tags": "$:/tags/SideBar",
            "caption": "{{$:/language/SideBar/Recent/Caption}}",
            "text": "<$macrocall $name=\"timeline\" format={{$:/language/RecentChanges/DateFormat}}/>\n"
        },
        "$:/core/ui/SideBar/Tools": {
            "title": "$:/core/ui/SideBar/Tools",
            "tags": "$:/tags/SideBar",
            "caption": "{{$:/language/SideBar/Tools/Caption}}",
            "text": "\\define lingo-base() $:/language/ControlPanel/\n\\define config-title()\n$:/config/PageControlButtons/Visibility/$(listItem)$\n\\end\n\n<<lingo Basics/Version/Prompt>> <<version>>\n\n<$set name=\"tv-config-toolbar-icons\" value=\"yes\">\n\n<$set name=\"tv-config-toolbar-text\" value=\"yes\">\n\n<$set name=\"tv-config-toolbar-class\" value=\"\">\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]]\" variable=\"listItem\">\n\n<div style=\"position:relative;\">\n\n<$checkbox tiddler=<<config-title>> field=\"text\" checked=\"show\" unchecked=\"hide\" default=\"show\"/> <$transclude tiddler=<<listItem>>/> <i class=\"tc-muted\"><$transclude tiddler=<<listItem>> field=\"description\"/></i>\n\n</div>\n\n</$list>\n\n</$set>\n\n</$set>\n\n</$set>\n"
        },
        "$:/core/ui/SideBarLists": {
            "title": "$:/core/ui/SideBarLists",
            "text": "<div class=\"tc-sidebar-lists\">\n\n<$set name=\"searchTiddler\" value=\"$:/temp/search\">\n<div class=\"tc-search\">\n<$edit-text tiddler=\"$:/temp/search\" type=\"search\" tag=\"input\" focus={{$:/config/Search/AutoFocus}} focusPopup=<<qualify \"$:/state/popup/search-dropdown\">> class=\"tc-popup-handle\"/>\n<$reveal state=\"$:/temp/search\" type=\"nomatch\" text=\"\">\n<$button tooltip={{$:/language/Buttons/AdvancedSearch/Hint}} aria-label={{$:/language/Buttons/AdvancedSearch/Caption}} class=\"tc-btn-invisible\">\n<$action-setfield $tiddler=\"$:/temp/advancedsearch\" text={{$:/temp/search}}/>\n<$action-setfield $tiddler=\"$:/temp/search\" text=\"\"/>\n<$action-navigate $to=\"$:/AdvancedSearch\"/>\n{{$:/core/images/advanced-search-button}}\n</$button>\n<$button class=\"tc-btn-invisible\">\n<$action-setfield $tiddler=\"$:/temp/search\" text=\"\" />\n{{$:/core/images/close-button}}\n</$button>\n<$button popup=<<qualify \"$:/state/popup/search-dropdown\">> class=\"tc-btn-invisible\">\n{{$:/core/images/down-arrow}}\n<$list filter=\"[{$:/temp/search}minlength{$:/config/Search/MinLength}limit[1]]\" variable=\"listItem\">\n<$set name=\"resultCount\" value=\"\"\"<$count filter=\"[!is[system]search{$(searchTiddler)$}]\"/>\"\"\">\n{{$:/language/Search/Matches}}\n</$set>\n</$list>\n</$button>\n</$reveal>\n<$reveal state=\"$:/temp/search\" type=\"match\" text=\"\">\n<$button to=\"$:/AdvancedSearch\" tooltip={{$:/language/Buttons/AdvancedSearch/Hint}} aria-label={{$:/language/Buttons/AdvancedSearch/Caption}} class=\"tc-btn-invisible\">\n{{$:/core/images/advanced-search-button}}\n</$button>\n</$reveal>\n</div>\n\n<$reveal tag=\"div\" class=\"tc-block-dropdown-wrapper\" state=\"$:/temp/search\" type=\"nomatch\" text=\"\">\n\n<$reveal tag=\"div\" class=\"tc-block-dropdown tc-search-drop-down tc-popup-handle\" state=<<qualify \"$:/state/popup/search-dropdown\">> type=\"nomatch\" text=\"\" default=\"\">\n\n<$list filter=\"[{$:/temp/search}minlength{$:/config/Search/MinLength}limit[1]]\" emptyMessage=\"\"\"<div class=\"tc-search-results\">{{$:/language/Search/Search/TooShort}}</div>\"\"\" variable=\"listItem\">\n\n{{$:/core/ui/SearchResults}}\n\n</$list>\n\n</$reveal>\n\n</$reveal>\n\n</$set>\n\n<$macrocall $name=\"tabs\" tabsList=\"[all[shadows+tiddlers]tag[$:/tags/SideBar]!has[draft.of]]\" default={{$:/config/DefaultSidebarTab}} state=\"$:/state/tab/sidebar\" />\n\n</div>\n"
        },
        "$:/TagManager": {
            "title": "$:/TagManager",
            "icon": "$:/core/images/tag-button",
            "color": "#bbb",
            "caption": "{{$:/language/TagManager/Caption}}",
            "text": "\\define lingo-base() $:/language/TagManager/\n\\define iconEditorTab(type)\n<$list filter=\"[all[shadows+tiddlers]is[image]] [all[shadows+tiddlers]tag[$:/tags/Image]] -[type[application/pdf]] +[sort[title]] +[$type$is[system]]\">\n<$link to={{!!title}}>\n<$transclude/> <$view field=\"title\"/>\n</$link>\n</$list>\n\\end\n\\define iconEditor(title)\n<div class=\"tc-drop-down-wrapper\">\n<$button popup=<<qualify \"$:/state/popup/icon/$title$\">> class=\"tc-btn-invisible tc-btn-dropdown\">{{$:/core/images/down-arrow}}</$button>\n<$reveal state=<<qualify \"$:/state/popup/icon/$title$\">> type=\"popup\" position=\"belowleft\" text=\"\" default=\"\">\n<div class=\"tc-drop-down\">\n<$linkcatcher to=\"$title$!!icon\">\n<<iconEditorTab type:\"!\">>\n<hr/>\n<<iconEditorTab type:\"\">>\n</$linkcatcher>\n</div>\n</$reveal>\n</div>\n\\end\n\\define qualifyTitle(title)\n$title$$(currentTiddler)$\n\\end\n\\define toggleButton(state)\n<$reveal state=\"$state$\" type=\"match\" text=\"closed\" default=\"closed\">\n<$button set=\"$state$\" setTo=\"open\" class=\"tc-btn-invisible tc-btn-dropdown\" selectedClass=\"tc-selected\">\n{{$:/core/images/info-button}}\n</$button>\n</$reveal>\n<$reveal state=\"$state$\" type=\"match\" text=\"open\" default=\"closed\">\n<$button set=\"$state$\" setTo=\"closed\" class=\"tc-btn-invisible tc-btn-dropdown\" selectedClass=\"tc-selected\">\n{{$:/core/images/info-button}}\n</$button>\n</$reveal>\n\\end\n<table class=\"tc-tag-manager-table\">\n<tbody>\n<tr>\n<th><<lingo Colour/Heading>></th>\n<th class=\"tc-tag-manager-tag\"><<lingo Tag/Heading>></th>\n<th><<lingo Count/Heading>></th>\n<th><<lingo Icon/Heading>></th>\n<th><<lingo Info/Heading>></th>\n</tr>\n<$list filter=\"[tags[]!is[system]sort[title]]\">\n<tr>\n<td><$edit-text field=\"color\" tag=\"input\" type=\"color\"/></td>\n<td><$macrocall $name=\"tag\" tag=<<currentTiddler>>/></td>\n<td><$count filter=\"[all[current]tagging[]]\"/></td>\n<td>\n<$macrocall $name=\"iconEditor\" title={{!!title}}/>\n</td>\n<td>\n<$macrocall $name=\"toggleButton\" state=<<qualifyTitle \"$:/state/tag-manager/\">> /> \n</td>\n</tr>\n<tr>\n<td></td>\n<td colspan=\"4\">\n<$reveal state=<<qualifyTitle \"$:/state/tag-manager/\">> type=\"match\" text=\"open\" default=\"\">\n<table>\n<tbody>\n<tr><td><<lingo Colour/Heading>></td><td><$edit-text field=\"color\" tag=\"input\" type=\"text\" size=\"9\"/></td></tr>\n<tr><td><<lingo Icon/Heading>></td><td><$edit-text field=\"icon\" tag=\"input\" size=\"45\"/></td></tr>\n</tbody>\n</table>\n</$reveal>\n</td>\n</tr>\n</$list>\n<tr>\n<td></td>\n<td>\n{{$:/core/ui/UntaggedTemplate}}\n</td>\n<td>\n<small class=\"tc-menu-list-count\"><$count filter=\"[untagged[]!is[system]] -[tags[]]\"/></small>\n</td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n"
        },
        "$:/core/ui/TagTemplate": {
            "title": "$:/core/ui/TagTemplate",
            "text": "<span class=\"tc-tag-list-item\">\n<$set name=\"transclusion\" value=<<currentTiddler>>>\n<$macrocall $name=\"tag-pill-body\" tag=<<currentTiddler>> icon={{!!icon}} colour={{!!color}} palette={{$:/palette}} element-tag=\"\"\"$button\"\"\" element-attributes=\"\"\"popup=<<qualify \"$:/state/popup/tag\">> dragFilter='[all[current]tagging[]]' tag='span'\"\"\"/>\n<$reveal state=<<qualify \"$:/state/popup/tag\">> type=\"popup\" position=\"below\" animate=\"yes\" class=\"tc-drop-down\">\n<$transclude tiddler=\"$:/core/ui/ListItemTemplate\"/>\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/TagDropdown]!has[draft.of]]\" variable=\"listItem\"> \n<$transclude tiddler=<<listItem>>/> \n</$list>\n<hr>\n<$macrocall $name=\"list-tagged-draggable\" tag=<<currentTiddler>>/>\n</$reveal>\n</$set>\n</span>\n"
        },
        "$:/core/ui/TiddlerFieldTemplate": {
            "title": "$:/core/ui/TiddlerFieldTemplate",
            "text": "<tr class=\"tc-view-field\">\n<td class=\"tc-view-field-name\">\n<$text text=<<listItem>>/>\n</td>\n<td class=\"tc-view-field-value\">\n<$view field=<<listItem>>/>\n</td>\n</tr>"
        },
        "$:/core/ui/TiddlerFields": {
            "title": "$:/core/ui/TiddlerFields",
            "text": "<table class=\"tc-view-field-table\">\n<tbody>\n<$list filter=\"[all[current]fields[]sort[title]] -text\" template=\"$:/core/ui/TiddlerFieldTemplate\" variable=\"listItem\"/>\n</tbody>\n</table>\n"
        },
        "$:/core/ui/TiddlerInfo/Advanced/PluginInfo": {
            "title": "$:/core/ui/TiddlerInfo/Advanced/PluginInfo",
            "tags": "$:/tags/TiddlerInfo/Advanced",
            "text": "\\define lingo-base() $:/language/TiddlerInfo/Advanced/PluginInfo/\n<$list filter=\"[all[current]has[plugin-type]]\">\n\n! <<lingo Heading>>\n\n<<lingo Hint>>\n<ul>\n<$list filter=\"[all[current]plugintiddlers[]sort[title]]\" emptyMessage=<<lingo Empty/Hint>>>\n<li>\n<$link to={{!!title}}>\n<$view field=\"title\"/>\n</$link>\n</li>\n</$list>\n</ul>\n\n</$list>\n"
        },
        "$:/core/ui/TiddlerInfo/Advanced/ShadowInfo": {
            "title": "$:/core/ui/TiddlerInfo/Advanced/ShadowInfo",
            "tags": "$:/tags/TiddlerInfo/Advanced",
            "text": "\\define lingo-base() $:/language/TiddlerInfo/Advanced/ShadowInfo/\n<$set name=\"infoTiddler\" value=<<currentTiddler>>>\n\n''<<lingo Heading>>''\n\n<$list filter=\"[all[current]!is[shadow]]\">\n\n<<lingo NotShadow/Hint>>\n\n</$list>\n\n<$list filter=\"[all[current]is[shadow]]\">\n\n<<lingo Shadow/Hint>>\n\n<$list filter=\"[all[current]shadowsource[]]\">\n\n<$set name=\"pluginTiddler\" value=<<currentTiddler>>>\n<<lingo Shadow/Source>>\n</$set>\n\n</$list>\n\n<$list filter=\"[all[current]is[shadow]is[tiddler]]\">\n\n<<lingo OverriddenShadow/Hint>>\n\n</$list>\n\n\n</$list>\n</$set>\n"
        },
        "$:/core/ui/TiddlerInfo/Advanced": {
            "title": "$:/core/ui/TiddlerInfo/Advanced",
            "tags": "$:/tags/TiddlerInfo",
            "caption": "{{$:/language/TiddlerInfo/Advanced/Caption}}",
            "text": "<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/TiddlerInfo/Advanced]!has[draft.of]]\" variable=\"listItem\">\n<$transclude tiddler=<<listItem>>/>\n\n</$list>\n"
        },
        "$:/core/ui/TiddlerInfo/Fields": {
            "title": "$:/core/ui/TiddlerInfo/Fields",
            "tags": "$:/tags/TiddlerInfo",
            "caption": "{{$:/language/TiddlerInfo/Fields/Caption}}",
            "text": "<$transclude tiddler=\"$:/core/ui/TiddlerFields\"/>\n"
        },
        "$:/core/ui/TiddlerInfo/List": {
            "title": "$:/core/ui/TiddlerInfo/List",
            "tags": "$:/tags/TiddlerInfo",
            "caption": "{{$:/language/TiddlerInfo/List/Caption}}",
            "text": "\\define lingo-base() $:/language/TiddlerInfo/\n<$list filter=\"[list{!!title}]\" emptyMessage=<<lingo List/Empty>> template=\"$:/core/ui/ListItemTemplate\"/>\n"
        },
        "$:/core/ui/TiddlerInfo/Listed": {
            "title": "$:/core/ui/TiddlerInfo/Listed",
            "tags": "$:/tags/TiddlerInfo",
            "caption": "{{$:/language/TiddlerInfo/Listed/Caption}}",
            "text": "\\define lingo-base() $:/language/TiddlerInfo/\n<$list filter=\"[all[current]listed[]!is[system]]\" emptyMessage=<<lingo Listed/Empty>> template=\"$:/core/ui/ListItemTemplate\"/>\n"
        },
        "$:/core/ui/TiddlerInfo/References": {
            "title": "$:/core/ui/TiddlerInfo/References",
            "tags": "$:/tags/TiddlerInfo",
            "caption": "{{$:/language/TiddlerInfo/References/Caption}}",
            "text": "\\define lingo-base() $:/language/TiddlerInfo/\n<$list filter=\"[all[current]backlinks[]sort[title]]\" emptyMessage=<<lingo References/Empty>> template=\"$:/core/ui/ListItemTemplate\">\n</$list>\n"
        },
        "$:/core/ui/TiddlerInfo/Tagging": {
            "title": "$:/core/ui/TiddlerInfo/Tagging",
            "tags": "$:/tags/TiddlerInfo",
            "caption": "{{$:/language/TiddlerInfo/Tagging/Caption}}",
            "text": "\\define lingo-base() $:/language/TiddlerInfo/\n<$list filter=\"[all[current]tagging[]]\" emptyMessage=<<lingo Tagging/Empty>> template=\"$:/core/ui/ListItemTemplate\"/>\n"
        },
        "$:/core/ui/TiddlerInfo/Tools": {
            "title": "$:/core/ui/TiddlerInfo/Tools",
            "tags": "$:/tags/TiddlerInfo",
            "caption": "{{$:/language/TiddlerInfo/Tools/Caption}}",
            "text": "\\define lingo-base() $:/language/TiddlerInfo/\n\\define config-title()\n$:/config/ViewToolbarButtons/Visibility/$(listItem)$\n\\end\n<$set name=\"tv-config-toolbar-icons\" value=\"yes\">\n\n<$set name=\"tv-config-toolbar-text\" value=\"yes\">\n\n<$set name=\"tv-config-toolbar-class\" value=\"\">\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]]\" variable=\"listItem\">\n\n<$checkbox tiddler=<<config-title>> field=\"text\" checked=\"show\" unchecked=\"hide\" default=\"show\"/> <$transclude tiddler=<<listItem>>/> <i class=\"tc-muted\"><$transclude tiddler=<<listItem>> field=\"description\"/></i>\n\n</$list>\n\n</$set>\n\n</$set>\n\n</$set>\n"
        },
        "$:/core/ui/TiddlerInfo": {
            "title": "$:/core/ui/TiddlerInfo",
            "text": "<div style=\"position:relative;\">\n<div class=\"tc-tiddler-controls\" style=\"position:absolute;right:0;\">\n<$reveal state=\"$:/config/TiddlerInfo/Mode\" type=\"match\" text=\"sticky\">\n<$button set=<<tiddlerInfoState>> setTo=\"\" tooltip={{$:/language/Buttons/Info/Hint}} aria-label={{$:/language/Buttons/Info/Caption}} class=\"tc-btn-invisible\">\n{{$:/core/images/close-button}}\n</$button>\n</$reveal>\n</div>\n</div>\n\n<$macrocall $name=\"tabs\" tabsList=\"[all[shadows+tiddlers]tag[$:/tags/TiddlerInfo]!has[draft.of]]\" default={{$:/config/TiddlerInfo/Default}}/>"
        },
        "$:/core/ui/TopBar/menu": {
            "title": "$:/core/ui/TopBar/menu",
            "tags": "$:/tags/TopRightBar",
            "text": "<$reveal state=\"$:/state/sidebar\" type=\"nomatch\" text=\"no\">\n<$button set=\"$:/state/sidebar\" setTo=\"no\" tooltip={{$:/language/Buttons/HideSideBar/Hint}} aria-label={{$:/language/Buttons/HideSideBar/Caption}} class=\"tc-btn-invisible\">{{$:/core/images/chevron-right}}</$button>\n</$reveal>\n<$reveal state=\"$:/state/sidebar\" type=\"match\" text=\"no\">\n<$button set=\"$:/state/sidebar\" setTo=\"yes\" tooltip={{$:/language/Buttons/ShowSideBar/Hint}} aria-label={{$:/language/Buttons/ShowSideBar/Caption}} class=\"tc-btn-invisible\">{{$:/core/images/chevron-left}}</$button>\n</$reveal>\n"
        },
        "$:/core/ui/UntaggedTemplate": {
            "title": "$:/core/ui/UntaggedTemplate",
            "text": "\\define lingo-base() $:/language/SideBar/\n<$button popup=<<qualify \"$:/state/popup/tag\">> class=\"tc-btn-invisible tc-untagged-label tc-tag-label\">\n<<lingo Tags/Untagged/Caption>>\n</$button>\n<$reveal state=<<qualify \"$:/state/popup/tag\">> type=\"popup\" position=\"below\">\n<div class=\"tc-drop-down\">\n<$list filter=\"[untagged[]!is[system]] -[tags[]] +[sort[title]]\" template=\"$:/core/ui/ListItemTemplate\"/>\n</div>\n</$reveal>\n"
        },
        "$:/core/ui/ViewTemplate/body": {
            "title": "$:/core/ui/ViewTemplate/body",
            "tags": "$:/tags/ViewTemplate",
            "text": "<$reveal tag=\"div\" class=\"tc-tiddler-body\" type=\"nomatch\" state=<<folded-state>> text=\"hide\" retain=\"yes\" animate=\"yes\">\n\n<$list filter=\"[all[current]!has[plugin-type]!field:hide-body[yes]]\">\n\n<$transclude>\n\n<$transclude tiddler=\"$:/language/MissingTiddler/Hint\"/>\n\n</$transclude>\n\n</$list>\n\n</$reveal>"
        },
        "$:/core/ui/ViewTemplate/classic": {
            "title": "$:/core/ui/ViewTemplate/classic",
            "tags": "$:/tags/ViewTemplate $:/tags/EditTemplate",
            "text": "\\define lingo-base() $:/language/ClassicWarning/\n<$list filter=\"[all[current]type[text/x-tiddlywiki]]\">\n<div class=\"tc-message-box\">\n\n<<lingo Hint>>\n\n<$button set=\"!!type\" setTo=\"text/vnd.tiddlywiki\"><<lingo Upgrade/Caption>></$button>\n\n</div>\n</$list>\n"
        },
        "$:/core/ui/ViewTemplate/import": {
            "title": "$:/core/ui/ViewTemplate/import",
            "tags": "$:/tags/ViewTemplate",
            "text": "\\define lingo-base() $:/language/Import/\n\n<$list filter=\"[all[current]field:plugin-type[import]]\">\n\n<div class=\"tc-import\">\n\n<<lingo Listing/Hint>>\n\n<$button message=\"tm-delete-tiddler\" param=<<currentTiddler>>><<lingo Listing/Cancel/Caption>></$button>\n<$button message=\"tm-perform-import\" param=<<currentTiddler>>><<lingo Listing/Import/Caption>></$button>\n\n{{||$:/core/ui/ImportListing}}\n\n<$button message=\"tm-delete-tiddler\" param=<<currentTiddler>>><<lingo Listing/Cancel/Caption>></$button>\n<$button message=\"tm-perform-import\" param=<<currentTiddler>>><<lingo Listing/Import/Caption>></$button>\n\n</div>\n\n</$list>\n"
        },
        "$:/core/ui/ViewTemplate/plugin": {
            "title": "$:/core/ui/ViewTemplate/plugin",
            "tags": "$:/tags/ViewTemplate",
            "text": "<$list filter=\"[all[current]has[plugin-type]] -[all[current]field:plugin-type[import]]\">\n<$set name=\"plugin-type\" value={{!!plugin-type}}>\n<$set name=\"default-popup-state\" value=\"yes\">\n<$set name=\"qualified-state\" value=<<qualify \"$:/state/plugin-info\">>>\n{{||$:/core/ui/Components/plugin-info}}\n</$set>\n</$set>\n</$set>\n</$list>\n"
        },
        "$:/core/ui/ViewTemplate/subtitle": {
            "title": "$:/core/ui/ViewTemplate/subtitle",
            "tags": "$:/tags/ViewTemplate",
            "text": "<$reveal type=\"nomatch\" state=<<folded-state>> text=\"hide\" tag=\"div\" retain=\"yes\" animate=\"yes\">\n<div class=\"tc-subtitle\">\n<$link to={{!!modifier}}>\n<$view field=\"modifier\"/>\n</$link> <$view field=\"modified\" format=\"date\" template={{$:/language/Tiddler/DateFormat}}/>\n</div>\n</$reveal>\n"
        },
        "$:/core/ui/ViewTemplate/tags": {
            "title": "$:/core/ui/ViewTemplate/tags",
            "tags": "$:/tags/ViewTemplate",
            "text": "<$reveal type=\"nomatch\" state=<<folded-state>> text=\"hide\" tag=\"div\" retain=\"yes\" animate=\"yes\">\n<div class=\"tc-tags-wrapper\"><$list filter=\"[all[current]tags[]sort[title]]\" template=\"$:/core/ui/TagTemplate\" storyview=\"pop\"/></div>\n</$reveal>"
        },
        "$:/core/ui/ViewTemplate/title": {
            "title": "$:/core/ui/ViewTemplate/title",
            "tags": "$:/tags/ViewTemplate",
            "text": "\\define title-styles()\nfill:$(foregroundColor)$;\n\\end\n\\define config-title()\n$:/config/ViewToolbarButtons/Visibility/$(listItem)$\n\\end\n<div class=\"tc-tiddler-title\">\n<div class=\"tc-titlebar\">\n<span class=\"tc-tiddler-controls\">\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]]\" variable=\"listItem\"><$reveal type=\"nomatch\" state=<<config-title>> text=\"hide\"><$transclude tiddler=<<listItem>>/></$reveal></$list>\n</span>\n<$set name=\"tv-wikilinks\" value={{$:/config/Tiddlers/TitleLinks}}>\n<$link>\n<$set name=\"foregroundColor\" value={{!!color}}>\n<span class=\"tc-tiddler-title-icon\" style=<<title-styles>>>\n<$transclude tiddler={{!!icon}}/>\n</span>\n</$set>\n<$list filter=\"[all[current]removeprefix[$:/]]\">\n<h2 class=\"tc-title\" title={{$:/language/SystemTiddler/Tooltip}}>\n<span class=\"tc-system-title-prefix\">$:/</span><$text text=<<currentTiddler>>/>\n</h2>\n</$list>\n<$list filter=\"[all[current]!prefix[$:/]]\">\n<h2 class=\"tc-title\">\n<$view field=\"title\"/>\n</h2>\n</$list>\n</$link>\n</$set>\n</div>\n\n<$reveal type=\"nomatch\" text=\"\" default=\"\" state=<<tiddlerInfoState>> class=\"tc-tiddler-info tc-popup-handle\" animate=\"yes\" retain=\"yes\">\n\n<$transclude tiddler=\"$:/core/ui/TiddlerInfo\"/>\n\n</$reveal>\n</div>"
        },
        "$:/core/ui/ViewTemplate/unfold": {
            "title": "$:/core/ui/ViewTemplate/unfold",
            "tags": "$:/tags/ViewTemplate",
            "text": "<$reveal tag=\"div\" type=\"nomatch\" state=\"$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/fold-bar\" text=\"hide\">\n<$reveal tag=\"div\" type=\"nomatch\" state=<<folded-state>> text=\"hide\" default=\"show\" retain=\"yes\" animate=\"yes\">\n<$button tooltip={{$:/language/Buttons/Fold/Hint}} aria-label={{$:/language/Buttons/Fold/Caption}} class=\"tc-fold-banner\">\n<$action-sendmessage $message=\"tm-fold-tiddler\" $param=<<currentTiddler>> foldedState=<<folded-state>>/>\n{{$:/core/images/chevron-up}}\n</$button>\n</$reveal>\n<$reveal tag=\"div\" type=\"nomatch\" state=<<folded-state>> text=\"show\" default=\"show\" retain=\"yes\" animate=\"yes\">\n<$button tooltip={{$:/language/Buttons/Unfold/Hint}} aria-label={{$:/language/Buttons/Unfold/Caption}} class=\"tc-unfold-banner\">\n<$action-sendmessage $message=\"tm-fold-tiddler\" $param=<<currentTiddler>> foldedState=<<folded-state>>/>\n{{$:/core/images/chevron-down}}\n</$button>\n</$reveal>\n</$reveal>\n"
        },
        "$:/core/ui/ViewTemplate": {
            "title": "$:/core/ui/ViewTemplate",
            "text": "\\define frame-classes()\ntc-tiddler-frame tc-tiddler-view-frame $(missingTiddlerClass)$ $(shadowTiddlerClass)$ $(systemTiddlerClass)$ $(tiddlerTagClasses)$\n\\end\n\\define folded-state()\n$:/state/folded/$(currentTiddler)$\n\\end\n<$set name=\"storyTiddler\" value=<<currentTiddler>>><$set name=\"tiddlerInfoState\" value=<<qualify \"$:/state/popup/tiddler-info\">>><$tiddler tiddler=<<currentTiddler>>><div class=<<frame-classes>>><$list filter=\"[all[shadows+tiddlers]tag[$:/tags/ViewTemplate]!has[draft.of]]\" variable=\"listItem\"><$transclude tiddler=<<listItem>>/></$list>\n</div>\n</$tiddler></$set></$set>\n"
        },
        "$:/core/ui/Buttons/clone": {
            "title": "$:/core/ui/Buttons/clone",
            "tags": "$:/tags/ViewToolbar",
            "caption": "{{$:/core/images/clone-button}} {{$:/language/Buttons/Clone/Caption}}",
            "description": "{{$:/language/Buttons/Clone/Hint}}",
            "text": "<$button message=\"tm-new-tiddler\" param=<<currentTiddler>> tooltip={{$:/language/Buttons/Clone/Hint}} aria-label={{$:/language/Buttons/Clone/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/clone-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Clone/Caption}}/></span>\n</$list>\n</$button>"
        },
        "$:/core/ui/Buttons/close-others": {
            "title": "$:/core/ui/Buttons/close-others",
            "tags": "$:/tags/ViewToolbar",
            "caption": "{{$:/core/images/close-others-button}} {{$:/language/Buttons/CloseOthers/Caption}}",
            "description": "{{$:/language/Buttons/CloseOthers/Hint}}",
            "text": "<$button message=\"tm-close-other-tiddlers\" param=<<currentTiddler>> tooltip={{$:/language/Buttons/CloseOthers/Hint}} aria-label={{$:/language/Buttons/CloseOthers/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/close-others-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/CloseOthers/Caption}}/></span>\n</$list>\n</$button>"
        },
        "$:/core/ui/Buttons/close": {
            "title": "$:/core/ui/Buttons/close",
            "tags": "$:/tags/ViewToolbar",
            "caption": "{{$:/core/images/close-button}} {{$:/language/Buttons/Close/Caption}}",
            "description": "{{$:/language/Buttons/Close/Hint}}",
            "text": "<$button message=\"tm-close-tiddler\" tooltip={{$:/language/Buttons/Close/Hint}} aria-label={{$:/language/Buttons/Close/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/close-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Close/Caption}}/></span>\n</$list>\n</$button>"
        },
        "$:/core/ui/Buttons/edit": {
            "title": "$:/core/ui/Buttons/edit",
            "tags": "$:/tags/ViewToolbar",
            "caption": "{{$:/core/images/edit-button}} {{$:/language/Buttons/Edit/Caption}}",
            "description": "{{$:/language/Buttons/Edit/Hint}}",
            "text": "<$button message=\"tm-edit-tiddler\" tooltip={{$:/language/Buttons/Edit/Hint}} aria-label={{$:/language/Buttons/Edit/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/edit-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Edit/Caption}}/></span>\n</$list>\n</$button>"
        },
        "$:/core/ui/Buttons/export-tiddler": {
            "title": "$:/core/ui/Buttons/export-tiddler",
            "tags": "$:/tags/ViewToolbar",
            "caption": "{{$:/core/images/export-button}} {{$:/language/Buttons/ExportTiddler/Caption}}",
            "description": "{{$:/language/Buttons/ExportTiddler/Hint}}",
            "text": "\\define makeExportFilter()\n[[$(currentTiddler)$]]\n\\end\n<$macrocall $name=\"exportButton\" exportFilter=<<makeExportFilter>> lingoBase=\"$:/language/Buttons/ExportTiddler/\" baseFilename=<<currentTiddler>>/>"
        },
        "$:/core/ui/Buttons/fold-bar": {
            "title": "$:/core/ui/Buttons/fold-bar",
            "tags": "$:/tags/ViewToolbar",
            "caption": "{{$:/core/images/chevron-up}} {{$:/language/Buttons/Fold/FoldBar/Caption}}",
            "description": "{{$:/language/Buttons/Fold/FoldBar/Hint}}",
            "text": "<!-- This dummy toolbar button is here to allow visibility of the fold-bar to be controlled as if it were a toolbar button -->"
        },
        "$:/core/ui/Buttons/fold-others": {
            "title": "$:/core/ui/Buttons/fold-others",
            "tags": "$:/tags/ViewToolbar",
            "caption": "{{$:/core/images/fold-others-button}} {{$:/language/Buttons/FoldOthers/Caption}}",
            "description": "{{$:/language/Buttons/FoldOthers/Hint}}",
            "text": "<$button tooltip={{$:/language/Buttons/FoldOthers/Hint}} aria-label={{$:/language/Buttons/FoldOthers/Caption}} class=<<tv-config-toolbar-class>>>\n<$action-sendmessage $message=\"tm-fold-other-tiddlers\" $param=<<currentTiddler>> foldedStatePrefix=\"$:/state/folded/\"/>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\" variable=\"listItem\">\n{{$:/core/images/fold-others-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/FoldOthers/Caption}}/></span>\n</$list>\n</$button>"
        },
        "$:/core/ui/Buttons/fold": {
            "title": "$:/core/ui/Buttons/fold",
            "tags": "$:/tags/ViewToolbar",
            "caption": "{{$:/core/images/fold-button}} {{$:/language/Buttons/Fold/Caption}}",
            "description": "{{$:/language/Buttons/Fold/Hint}}",
            "text": "<$reveal type=\"nomatch\" state=<<folded-state>> text=\"hide\" default=\"show\"><$button tooltip={{$:/language/Buttons/Fold/Hint}} aria-label={{$:/language/Buttons/Fold/Caption}} class=<<tv-config-toolbar-class>>>\n<$action-sendmessage $message=\"tm-fold-tiddler\" $param=<<currentTiddler>> foldedState=<<folded-state>>/>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\" variable=\"listItem\">\n{{$:/core/images/fold-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\">\n<$text text={{$:/language/Buttons/Fold/Caption}}/>\n</span>\n</$list>\n</$button></$reveal><$reveal type=\"match\" state=<<folded-state>> text=\"hide\" default=\"show\"><$button tooltip={{$:/language/Buttons/Unfold/Hint}} aria-label={{$:/language/Buttons/Unfold/Caption}} class=<<tv-config-toolbar-class>>>\n<$action-sendmessage $message=\"tm-fold-tiddler\" $param=<<currentTiddler>> foldedState=<<folded-state>>/>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\" variable=\"listItem\">\n{{$:/core/images/unfold-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\">\n<$text text={{$:/language/Buttons/Unfold/Caption}}/>\n</span>\n</$list>\n</$button></$reveal>"
        },
        "$:/core/ui/Buttons/info": {
            "title": "$:/core/ui/Buttons/info",
            "tags": "$:/tags/ViewToolbar",
            "caption": "{{$:/core/images/info-button}} {{$:/language/Buttons/Info/Caption}}",
            "description": "{{$:/language/Buttons/Info/Hint}}",
            "text": "\\define button-content()\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/info-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Info/Caption}}/></span>\n</$list>\n\\end\n<$reveal state=\"$:/config/TiddlerInfo/Mode\" type=\"match\" text=\"popup\">\n<$button popup=<<tiddlerInfoState>> tooltip={{$:/language/Buttons/Info/Hint}} aria-label={{$:/language/Buttons/Info/Caption}} class=<<tv-config-toolbar-class>> selectedClass=\"tc-selected\">\n<$macrocall $name=\"button-content\" mode=\"inline\"/>\n</$button>\n</$reveal>\n<$reveal state=\"$:/config/TiddlerInfo/Mode\" type=\"match\" text=\"sticky\">\n<$reveal state=<<tiddlerInfoState>> type=\"match\" text=\"\" default=\"\">\n<$button set=<<tiddlerInfoState>> setTo=\"yes\" tooltip={{$:/language/Buttons/Info/Hint}} aria-label={{$:/language/Buttons/Info/Caption}} class=<<tv-config-toolbar-class>> selectedClass=\"tc-selected\">\n<$macrocall $name=\"button-content\" mode=\"inline\"/>\n</$button>\n</$reveal>\n<$reveal state=<<tiddlerInfoState>> type=\"nomatch\" text=\"\" default=\"\">\n<$button set=<<tiddlerInfoState>> setTo=\"\" tooltip={{$:/language/Buttons/Info/Hint}} aria-label={{$:/language/Buttons/Info/Caption}} class=<<tv-config-toolbar-class>> selectedClass=\"tc-selected\">\n<$macrocall $name=\"button-content\" mode=\"inline\"/>\n</$button>\n</$reveal>\n</$reveal>"
        },
        "$:/core/ui/Buttons/more-tiddler-actions": {
            "title": "$:/core/ui/Buttons/more-tiddler-actions",
            "tags": "$:/tags/ViewToolbar",
            "caption": "{{$:/core/images/down-arrow}} {{$:/language/Buttons/More/Caption}}",
            "description": "{{$:/language/Buttons/More/Hint}}",
            "text": "\\define config-title()\n$:/config/ViewToolbarButtons/Visibility/$(listItem)$\n\\end\n<$button popup=<<qualify \"$:/state/popup/more\">> tooltip={{$:/language/Buttons/More/Hint}} aria-label={{$:/language/Buttons/More/Caption}} class=<<tv-config-toolbar-class>> selectedClass=\"tc-selected\">\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/down-arrow}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/More/Caption}}/></span>\n</$list>\n</$button><$reveal state=<<qualify \"$:/state/popup/more\">> type=\"popup\" position=\"below\" animate=\"yes\">\n\n<div class=\"tc-drop-down\">\n\n<$set name=\"tv-config-toolbar-icons\" value=\"yes\">\n\n<$set name=\"tv-config-toolbar-text\" value=\"yes\">\n\n<$set name=\"tv-config-toolbar-class\" value=\"tc-btn-invisible\">\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]] -[[$:/core/ui/Buttons/more-tiddler-actions]]\" variable=\"listItem\">\n\n<$reveal type=\"match\" state=<<config-title>> text=\"hide\">\n\n<$transclude tiddler=<<listItem>> mode=\"inline\"/>\n\n</$reveal>\n\n</$list>\n\n</$set>\n\n</$set>\n\n</$set>\n\n</div>\n\n</$reveal>"
        },
        "$:/core/ui/Buttons/new-here": {
            "title": "$:/core/ui/Buttons/new-here",
            "tags": "$:/tags/ViewToolbar",
            "caption": "{{$:/core/images/new-here-button}} {{$:/language/Buttons/NewHere/Caption}}",
            "description": "{{$:/language/Buttons/NewHere/Hint}}",
            "text": "\\define newHereButtonTags()\n[[$(currentTiddler)$]]\n\\end\n\\define newHereButton()\n<$button tooltip={{$:/language/Buttons/NewHere/Hint}} aria-label={{$:/language/Buttons/NewHere/Caption}} class=<<tv-config-toolbar-class>>>\n<$action-sendmessage $message=\"tm-new-tiddler\" tags=<<newHereButtonTags>>/>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/new-here-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/NewHere/Caption}}/></span>\n</$list>\n</$button>\n\\end\n<<newHereButton>>"
        },
        "$:/core/ui/Buttons/new-journal-here": {
            "title": "$:/core/ui/Buttons/new-journal-here",
            "tags": "$:/tags/ViewToolbar",
            "caption": "{{$:/core/images/new-journal-button}} {{$:/language/Buttons/NewJournalHere/Caption}}",
            "description": "{{$:/language/Buttons/NewJournalHere/Hint}}",
            "text": "\\define journalButtonTags()\n[[$(currentTiddlerTag)$]] $(journalTags)$\n\\end\n\\define journalButton()\n<$button tooltip={{$:/language/Buttons/NewJournalHere/Hint}} aria-label={{$:/language/Buttons/NewJournalHere/Caption}} class=<<tv-config-toolbar-class>>>\n<$action-sendmessage $message=\"tm-new-tiddler\" title=<<now \"$(journalTitleTemplate)$\">> tags=<<journalButtonTags>>/>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/new-journal-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/NewJournalHere/Caption}}/></span>\n</$list>\n</$button>\n\\end\n<$set name=\"journalTitleTemplate\" value={{$:/config/NewJournal/Title}}>\n<$set name=\"journalTags\" value={{$:/config/NewJournal/Tags}}>\n<$set name=\"currentTiddlerTag\" value=<<currentTiddler>>>\n<<journalButton>>\n</$set></$set></$set>"
        },
        "$:/core/ui/Buttons/open-window": {
            "title": "$:/core/ui/Buttons/open-window",
            "tags": "$:/tags/ViewToolbar",
            "caption": "{{$:/core/images/open-window}} {{$:/language/Buttons/OpenWindow/Caption}}",
            "description": "{{$:/language/Buttons/OpenWindow/Hint}}",
            "text": "<$button message=\"tm-open-window\" tooltip={{$:/language/Buttons/OpenWindow/Hint}} aria-label={{$:/language/Buttons/OpenWindow/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/open-window}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/OpenWindow/Caption}}/></span>\n</$list>\n</$button>"
        },
        "$:/core/ui/Buttons/permalink": {
            "title": "$:/core/ui/Buttons/permalink",
            "tags": "$:/tags/ViewToolbar",
            "caption": "{{$:/core/images/permalink-button}} {{$:/language/Buttons/Permalink/Caption}}",
            "description": "{{$:/language/Buttons/Permalink/Hint}}",
            "text": "<$button message=\"tm-permalink\" tooltip={{$:/language/Buttons/Permalink/Hint}} aria-label={{$:/language/Buttons/Permalink/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/permalink-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Permalink/Caption}}/></span>\n</$list>\n</$button>"
        },
        "$:/core/ui/Buttons/permaview": {
            "title": "$:/core/ui/Buttons/permaview",
            "tags": "$:/tags/ViewToolbar $:/tags/PageControls",
            "caption": "{{$:/core/images/permaview-button}} {{$:/language/Buttons/Permaview/Caption}}",
            "description": "{{$:/language/Buttons/Permaview/Hint}}",
            "text": "<$button message=\"tm-permaview\" tooltip={{$:/language/Buttons/Permaview/Hint}} aria-label={{$:/language/Buttons/Permaview/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/permaview-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Permaview/Caption}}/></span>\n</$list>\n</$button>"
        },
        "$:/DefaultTiddlers": {
            "title": "$:/DefaultTiddlers",
            "text": "GettingStarted\n"
        },
        "$:/temp/advancedsearch": {
            "title": "$:/temp/advancedsearch",
            "text": ""
        },
        "$:/snippets/allfields": {
            "title": "$:/snippets/allfields",
            "text": "\\define renderfield(title)\n<tr class=\"tc-view-field\"><td class=\"tc-view-field-name\">''$title$'':</td><td class=\"tc-view-field-value\">//{{$:/language/Docs/Fields/$title$}}//</td></tr>\n\\end\n<table class=\"tc-view-field-table\"><tbody><$list filter=\"[fields[]sort[title]]\" variable=\"listItem\"><$macrocall $name=\"renderfield\" title=<<listItem>>/></$list>\n</tbody></table>\n"
        },
        "$:/config/AnimationDuration": {
            "title": "$:/config/AnimationDuration",
            "text": "400"
        },
        "$:/config/AutoSave": {
            "title": "$:/config/AutoSave",
            "text": "yes"
        },
        "$:/config/BitmapEditor/Colour": {
            "title": "$:/config/BitmapEditor/Colour",
            "text": "#444"
        },
        "$:/config/BitmapEditor/ImageSizes": {
            "title": "$:/config/BitmapEditor/ImageSizes",
            "text": "[[62px 100px]] [[100px 62px]] [[124px 200px]] [[200px 124px]] [[248px 400px]] [[371px 600px]] [[400px 248px]] [[556px 900px]] [[600px 371px]] [[742px 1200px]] [[900px 556px]] [[1200px 742px]]"
        },
        "$:/config/BitmapEditor/LineWidth": {
            "title": "$:/config/BitmapEditor/LineWidth",
            "text": "3px"
        },
        "$:/config/BitmapEditor/LineWidths": {
            "title": "$:/config/BitmapEditor/LineWidths",
            "text": "0.25px 0.5px 1px 2px 3px 4px 6px 8px 10px 16px 20px 28px 40px 56px 80px"
        },
        "$:/config/BitmapEditor/Opacities": {
            "title": "$:/config/BitmapEditor/Opacities",
            "text": "0.01 0.025 0.05 0.075 0.1 0.15 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0"
        },
        "$:/config/BitmapEditor/Opacity": {
            "title": "$:/config/BitmapEditor/Opacity",
            "text": "1.0"
        },
        "$:/config/DefaultSidebarTab": {
            "title": "$:/config/DefaultSidebarTab",
            "text": "$:/core/ui/SideBar/Open"
        },
        "$:/config/DownloadSaver/AutoSave": {
            "title": "$:/config/DownloadSaver/AutoSave",
            "text": "no"
        },
        "$:/config/Drafts/TypingTimeout": {
            "title": "$:/config/Drafts/TypingTimeout",
            "text": "400"
        },
        "$:/config/EditTemplateFields/Visibility/title": {
            "title": "$:/config/EditTemplateFields/Visibility/title",
            "text": "hide"
        },
        "$:/config/EditTemplateFields/Visibility/tags": {
            "title": "$:/config/EditTemplateFields/Visibility/tags",
            "text": "hide"
        },
        "$:/config/EditTemplateFields/Visibility/text": {
            "title": "$:/config/EditTemplateFields/Visibility/text",
            "text": "hide"
        },
        "$:/config/EditTemplateFields/Visibility/creator": {
            "title": "$:/config/EditTemplateFields/Visibility/creator",
            "text": "hide"
        },
        "$:/config/EditTemplateFields/Visibility/created": {
            "title": "$:/config/EditTemplateFields/Visibility/created",
            "text": "hide"
        },
        "$:/config/EditTemplateFields/Visibility/modified": {
            "title": "$:/config/EditTemplateFields/Visibility/modified",
            "text": "hide"
        },
        "$:/config/EditTemplateFields/Visibility/modifier": {
            "title": "$:/config/EditTemplateFields/Visibility/modifier",
            "text": "hide"
        },
        "$:/config/EditTemplateFields/Visibility/type": {
            "title": "$:/config/EditTemplateFields/Visibility/type",
            "text": "hide"
        },
        "$:/config/EditTemplateFields/Visibility/draft.title": {
            "title": "$:/config/EditTemplateFields/Visibility/draft.title",
            "text": "hide"
        },
        "$:/config/EditTemplateFields/Visibility/draft.of": {
            "title": "$:/config/EditTemplateFields/Visibility/draft.of",
            "text": "hide"
        },
        "$:/config/EditTemplateFields/Visibility/revision": {
            "title": "$:/config/EditTemplateFields/Visibility/revision",
            "text": "hide"
        },
        "$:/config/EditTemplateFields/Visibility/bag": {
            "title": "$:/config/EditTemplateFields/Visibility/bag",
            "text": "hide"
        },
        "$:/config/EditorToolbarButtons/Visibility/$:/core/ui/EditorToolbar/heading-4": {
            "title": "$:/config/EditorToolbarButtons/Visibility/$:/core/ui/EditorToolbar/heading-4",
            "text": "hide"
        },
        "$:/config/EditorToolbarButtons/Visibility/$:/core/ui/EditorToolbar/heading-5": {
            "title": "$:/config/EditorToolbarButtons/Visibility/$:/core/ui/EditorToolbar/heading-5",
            "text": "hide"
        },
        "$:/config/EditorToolbarButtons/Visibility/$:/core/ui/EditorToolbar/heading-6": {
            "title": "$:/config/EditorToolbarButtons/Visibility/$:/core/ui/EditorToolbar/heading-6",
            "text": "hide"
        },
        "$:/config/EditorTypeMappings/image/gif": {
            "title": "$:/config/EditorTypeMappings/image/gif",
            "text": "bitmap"
        },
        "$:/config/EditorTypeMappings/image/jpeg": {
            "title": "$:/config/EditorTypeMappings/image/jpeg",
            "text": "bitmap"
        },
        "$:/config/EditorTypeMappings/image/jpg": {
            "title": "$:/config/EditorTypeMappings/image/jpg",
            "text": "bitmap"
        },
        "$:/config/EditorTypeMappings/image/png": {
            "title": "$:/config/EditorTypeMappings/image/png",
            "text": "bitmap"
        },
        "$:/config/EditorTypeMappings/image/x-icon": {
            "title": "$:/config/EditorTypeMappings/image/x-icon",
            "text": "bitmap"
        },
        "$:/config/EditorTypeMappings/text/vnd.tiddlywiki": {
            "title": "$:/config/EditorTypeMappings/text/vnd.tiddlywiki",
            "text": "text"
        },
        "$:/config/Manager/Show": {
            "title": "$:/config/Manager/Show",
            "text": "tiddlers"
        },
        "$:/config/Manager/Filter": {
            "title": "$:/config/Manager/Filter",
            "text": ""
        },
        "$:/config/Manager/Order": {
            "title": "$:/config/Manager/Order",
            "text": "forward"
        },
        "$:/config/Manager/Sort": {
            "title": "$:/config/Manager/Sort",
            "text": "title"
        },
        "$:/config/Manager/System": {
            "title": "$:/config/Manager/System",
            "text": "system"
        },
        "$:/config/Manager/Tag": {
            "title": "$:/config/Manager/Tag",
            "text": ""
        },
        "$:/state/popup/manager/item/$:/Manager/ItemMain/RawText": {
            "title": "$:/state/popup/manager/item/$:/Manager/ItemMain/RawText",
            "text": "hide"
        },
        "$:/config/MissingLinks": {
            "title": "$:/config/MissingLinks",
            "text": "yes"
        },
        "$:/config/Navigation/UpdateAddressBar": {
            "title": "$:/config/Navigation/UpdateAddressBar",
            "text": "no"
        },
        "$:/config/Navigation/UpdateHistory": {
            "title": "$:/config/Navigation/UpdateHistory",
            "text": "no"
        },
        "$:/config/OfficialPluginLibrary": {
            "title": "$:/config/OfficialPluginLibrary",
            "tags": "$:/tags/PluginLibrary",
            "url": "http://tiddlywiki.com/library/v5.1.14/index.html",
            "caption": "{{$:/language/OfficialPluginLibrary}}",
            "text": "{{$:/language/OfficialPluginLibrary/Hint}}\n"
        },
        "$:/config/Navigation/openLinkFromInsideRiver": {
            "title": "$:/config/Navigation/openLinkFromInsideRiver",
            "text": "below"
        },
        "$:/config/Navigation/openLinkFromOutsideRiver": {
            "title": "$:/config/Navigation/openLinkFromOutsideRiver",
            "text": "top"
        },
        "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/advanced-search": {
            "title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/advanced-search",
            "text": "hide"
        },
        "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/close-all": {
            "title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/close-all",
            "text": "hide"
        },
        "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/encryption": {
            "title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/encryption",
            "text": "hide"
        },
        "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/export-page": {
            "title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/export-page",
            "text": "hide"
        },
        "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/fold-all": {
            "title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/fold-all",
            "text": "hide"
        },
        "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/full-screen": {
            "title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/full-screen",
            "text": "hide"
        },
        "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/home": {
            "title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/home",
            "text": "hide"
        },
        "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/refresh": {
            "title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/refresh",
            "text": "hide"
        },
        "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/import": {
            "title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/import",
            "text": "hide"
        },
        "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/language": {
            "title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/language",
            "text": "hide"
        },
        "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/tag-manager": {
            "title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/tag-manager",
            "text": "hide"
        },
        "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/manager": {
            "title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/manager",
            "text": "hide"
        },
        "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/more-page-actions": {
            "title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/more-page-actions",
            "text": "hide"
        },
        "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/new-journal": {
            "title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/new-journal",
            "text": "hide"
        },
        "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/new-image": {
            "title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/new-image",
            "text": "hide"
        },
        "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/palette": {
            "title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/palette",
            "text": "hide"
        },
        "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/permaview": {
            "title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/permaview",
            "text": "hide"
        },
        "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/print": {
            "title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/print",
            "text": "hide"
        },
        "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/storyview": {
            "title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/storyview",
            "text": "hide"
        },
        "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/timestamp": {
            "title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/timestamp",
            "text": "hide"
        },
        "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/theme": {
            "title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/theme",
            "text": "hide"
        },
        "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/unfold-all": {
            "title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/unfold-all",
            "text": "hide"
        },
        "$:/config/Performance/Instrumentation": {
            "title": "$:/config/Performance/Instrumentation",
            "text": "no"
        },
        "$:/config/SaveWikiButton/Template": {
            "title": "$:/config/SaveWikiButton/Template",
            "text": "$:/core/save/all"
        },
        "$:/config/SaverFilter": {
            "title": "$:/config/SaverFilter",
            "text": "[all[]] -[[$:/HistoryList]] -[[$:/StoryList]] -[[$:/Import]] -[[$:/isEncrypted]] -[[$:/UploadName]] -[prefix[$:/state/]] -[prefix[$:/temp/]]"
        },
        "$:/config/Search/AutoFocus": {
            "title": "$:/config/Search/AutoFocus",
            "text": "true"
        },
        "$:/config/Search/MinLength": {
            "title": "$:/config/Search/MinLength",
            "text": "3"
        },
        "$:/config/SearchResults/Default": {
            "title": "$:/config/SearchResults/Default",
            "text": "$:/core/ui/DefaultSearchResultList"
        },
        "$:/config/ShortcutInfo/bold": {
            "title": "$:/config/ShortcutInfo/bold",
            "text": "{{$:/language/Buttons/Bold/Hint}}"
        },
        "$:/config/ShortcutInfo/cancel-edit-tiddler": {
            "title": "$:/config/ShortcutInfo/cancel-edit-tiddler",
            "text": "{{$:/language/Buttons/Cancel/Hint}}"
        },
        "$:/config/ShortcutInfo/excise": {
            "title": "$:/config/ShortcutInfo/excise",
            "text": "{{$:/language/Buttons/Excise/Hint}}"
        },
        "$:/config/ShortcutInfo/heading-1": {
            "title": "$:/config/ShortcutInfo/heading-1",
            "text": "{{$:/language/Buttons/Heading1/Hint}}"
        },
        "$:/config/ShortcutInfo/heading-2": {
            "title": "$:/config/ShortcutInfo/heading-2",
            "text": "{{$:/language/Buttons/Heading2/Hint}}"
        },
        "$:/config/ShortcutInfo/heading-3": {
            "title": "$:/config/ShortcutInfo/heading-3",
            "text": "{{$:/language/Buttons/Heading3/Hint}}"
        },
        "$:/config/ShortcutInfo/heading-4": {
            "title": "$:/config/ShortcutInfo/heading-4",
            "text": "{{$:/language/Buttons/Heading4/Hint}}"
        },
        "$:/config/ShortcutInfo/heading-5": {
            "title": "$:/config/ShortcutInfo/heading-5",
            "text": "{{$:/language/Buttons/Heading5/Hint}}"
        },
        "$:/config/ShortcutInfo/heading-6": {
            "title": "$:/config/ShortcutInfo/heading-6",
            "text": "{{$:/language/Buttons/Heading6/Hint}}"
        },
        "$:/config/ShortcutInfo/italic": {
            "title": "$:/config/ShortcutInfo/italic",
            "text": "{{$:/language/Buttons/Italic/Hint}}"
        },
        "$:/config/ShortcutInfo/link": {
            "title": "$:/config/ShortcutInfo/link",
            "text": "{{$:/language/Buttons/Link/Hint}}"
        },
        "$:/config/ShortcutInfo/list-bullet": {
            "title": "$:/config/ShortcutInfo/list-bullet",
            "text": "{{$:/language/Buttons/ListBullet/Hint}}"
        },
        "$:/config/ShortcutInfo/list-number": {
            "title": "$:/config/ShortcutInfo/list-number",
            "text": "{{$:/language/Buttons/ListNumber/Hint}}"
        },
        "$:/config/ShortcutInfo/mono-block": {
            "title": "$:/config/ShortcutInfo/mono-block",
            "text": "{{$:/language/Buttons/MonoBlock/Hint}}"
        },
        "$:/config/ShortcutInfo/mono-line": {
            "title": "$:/config/ShortcutInfo/mono-line",
            "text": "{{$:/language/Buttons/MonoLine/Hint}}"
        },
        "$:/config/ShortcutInfo/picture": {
            "title": "$:/config/ShortcutInfo/picture",
            "text": "{{$:/language/Buttons/Picture/Hint}}"
        },
        "$:/config/ShortcutInfo/preview": {
            "title": "$:/config/ShortcutInfo/preview",
            "text": "{{$:/language/Buttons/Preview/Hint}}"
        },
        "$:/config/ShortcutInfo/quote": {
            "title": "$:/config/ShortcutInfo/quote",
            "text": "{{$:/language/Buttons/Quote/Hint}}"
        },
        "$:/config/ShortcutInfo/save-tiddler": {
            "title": "$:/config/ShortcutInfo/save-tiddler",
            "text": "{{$:/language/Buttons/Save/Hint}}"
        },
        "$:/config/ShortcutInfo/stamp": {
            "title": "$:/config/ShortcutInfo/stamp",
            "text": "{{$:/language/Buttons/Stamp/Hint}}"
        },
        "$:/config/ShortcutInfo/strikethrough": {
            "title": "$:/config/ShortcutInfo/strikethrough",
            "text": "{{$:/language/Buttons/Strikethrough/Hint}}"
        },
        "$:/config/ShortcutInfo/subscript": {
            "title": "$:/config/ShortcutInfo/subscript",
            "text": "{{$:/language/Buttons/Subscript/Hint}}"
        },
        "$:/config/ShortcutInfo/superscript": {
            "title": "$:/config/ShortcutInfo/superscript",
            "text": "{{$:/language/Buttons/Superscript/Hint}}"
        },
        "$:/config/ShortcutInfo/underline": {
            "title": "$:/config/ShortcutInfo/underline",
            "text": "{{$:/language/Buttons/Underline/Hint}}"
        },
        "$:/config/SyncFilter": {
            "title": "$:/config/SyncFilter",
            "text": "[is[tiddler]] -[[$:/HistoryList]] -[[$:/Import]] -[[$:/isEncrypted]] -[prefix[$:/status/]] -[prefix[$:/state/]] -[prefix[$:/temp/]]"
        },
        "$:/config/TextEditor/EditorHeight/Height": {
            "title": "$:/config/TextEditor/EditorHeight/Height",
            "text": "400px"
        },
        "$:/config/TextEditor/EditorHeight/Mode": {
            "title": "$:/config/TextEditor/EditorHeight/Mode",
            "text": "auto"
        },
        "$:/config/TiddlerInfo/Default": {
            "title": "$:/config/TiddlerInfo/Default",
            "text": "$:/core/ui/TiddlerInfo/Fields"
        },
        "$:/config/TiddlerInfo/Mode": {
            "title": "$:/config/TiddlerInfo/Mode",
            "text": "popup"
        },
        "$:/config/Tiddlers/TitleLinks": {
            "title": "$:/config/Tiddlers/TitleLinks",
            "text": "no"
        },
        "$:/config/Toolbar/ButtonClass": {
            "title": "$:/config/Toolbar/ButtonClass",
            "text": "tc-btn-invisible"
        },
        "$:/config/Toolbar/Icons": {
            "title": "$:/config/Toolbar/Icons",
            "text": "yes"
        },
        "$:/config/Toolbar/Text": {
            "title": "$:/config/Toolbar/Text",
            "text": "no"
        },
        "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/clone": {
            "title": "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/clone",
            "text": "hide"
        },
        "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/close-others": {
            "title": "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/close-others",
            "text": "hide"
        },
        "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/export-tiddler": {
            "title": "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/export-tiddler",
            "text": "hide"
        },
        "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/info": {
            "title": "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/info",
            "text": "hide"
        },
        "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/more-tiddler-actions": {
            "title": "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/more-tiddler-actions",
            "text": "show"
        },
        "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/new-here": {
            "title": "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/new-here",
            "text": "hide"
        },
        "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/new-journal-here": {
            "title": "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/new-journal-here",
            "text": "hide"
        },
        "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/open-window": {
            "title": "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/open-window",
            "text": "hide"
        },
        "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/permalink": {
            "title": "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/permalink",
            "text": "hide"
        },
        "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/permaview": {
            "title": "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/permaview",
            "text": "hide"
        },
        "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/delete": {
            "title": "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/delete",
            "text": "hide"
        },
        "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/fold": {
            "title": "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/fold",
            "text": "hide"
        },
        "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/fold-bar": {
            "title": "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/fold-bar",
            "text": "hide"
        },
        "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/fold-others": {
            "title": "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/fold-others",
            "text": "hide"
        },
        "$:/config/shortcuts-mac/bold": {
            "title": "$:/config/shortcuts-mac/bold",
            "text": "meta-B"
        },
        "$:/config/shortcuts-mac/italic": {
            "title": "$:/config/shortcuts-mac/italic",
            "text": "meta-I"
        },
        "$:/config/shortcuts-mac/underline": {
            "title": "$:/config/shortcuts-mac/underline",
            "text": "meta-U"
        },
        "$:/config/shortcuts-not-mac/bold": {
            "title": "$:/config/shortcuts-not-mac/bold",
            "text": "ctrl-B"
        },
        "$:/config/shortcuts-not-mac/italic": {
            "title": "$:/config/shortcuts-not-mac/italic",
            "text": "ctrl-I"
        },
        "$:/config/shortcuts-not-mac/underline": {
            "title": "$:/config/shortcuts-not-mac/underline",
            "text": "ctrl-U"
        },
        "$:/config/shortcuts/cancel-edit-tiddler": {
            "title": "$:/config/shortcuts/cancel-edit-tiddler",
            "text": "escape"
        },
        "$:/config/shortcuts/excise": {
            "title": "$:/config/shortcuts/excise",
            "text": "ctrl-E"
        },
        "$:/config/shortcuts/heading-1": {
            "title": "$:/config/shortcuts/heading-1",
            "text": "ctrl-1"
        },
        "$:/config/shortcuts/heading-2": {
            "title": "$:/config/shortcuts/heading-2",
            "text": "ctrl-2"
        },
        "$:/config/shortcuts/heading-3": {
            "title": "$:/config/shortcuts/heading-3",
            "text": "ctrl-3"
        },
        "$:/config/shortcuts/heading-4": {
            "title": "$:/config/shortcuts/heading-4",
            "text": "ctrl-4"
        },
        "$:/config/shortcuts/heading-5": {
            "title": "$:/config/shortcuts/heading-5",
            "text": "ctrl-5"
        },
        "$:/config/shortcuts/heading-6": {
            "title": "$:/config/shortcuts/heading-6",
            "text": "ctrl-6"
        },
        "$:/config/shortcuts/link": {
            "title": "$:/config/shortcuts/link",
            "text": "ctrl-L"
        },
        "$:/config/shortcuts/list-bullet": {
            "title": "$:/config/shortcuts/list-bullet",
            "text": "ctrl-shift-L"
        },
        "$:/config/shortcuts/list-number": {
            "title": "$:/config/shortcuts/list-number",
            "text": "ctrl-shift-N"
        },
        "$:/config/shortcuts/mono-block": {
            "title": "$:/config/shortcuts/mono-block",
            "text": "ctrl-shift-M"
        },
        "$:/config/shortcuts/mono-line": {
            "title": "$:/config/shortcuts/mono-line",
            "text": "ctrl-M"
        },
        "$:/config/shortcuts/picture": {
            "title": "$:/config/shortcuts/picture",
            "text": "ctrl-shift-I"
        },
        "$:/config/shortcuts/preview": {
            "title": "$:/config/shortcuts/preview",
            "text": "alt-P"
        },
        "$:/config/shortcuts/quote": {
            "title": "$:/config/shortcuts/quote",
            "text": "ctrl-Q"
        },
        "$:/config/shortcuts/save-tiddler": {
            "title": "$:/config/shortcuts/save-tiddler",
            "text": "ctrl+enter"
        },
        "$:/config/shortcuts/stamp": {
            "title": "$:/config/shortcuts/stamp",
            "text": "ctrl-S"
        },
        "$:/config/shortcuts/strikethrough": {
            "title": "$:/config/shortcuts/strikethrough",
            "text": "ctrl-T"
        },
        "$:/config/shortcuts/subscript": {
            "title": "$:/config/shortcuts/subscript",
            "text": "ctrl-shift-B"
        },
        "$:/config/shortcuts/superscript": {
            "title": "$:/config/shortcuts/superscript",
            "text": "ctrl-shift-P"
        },
        "$:/config/WikiParserRules/Inline/wikilink": {
            "title": "$:/config/WikiParserRules/Inline/wikilink",
            "text": "enable"
        },
        "$:/snippets/currpalettepreview": {
            "title": "$:/snippets/currpalettepreview",
            "text": "\\define swatchStyle()\nbackground-color: $(swatchColour)$;\n\\end\n\\define swatch(colour)\n<$set name=\"swatchColour\" value={{##$colour$}}>\n<div class=\"tc-swatch\" style=<<swatchStyle>>/>\n</$set>\n\\end\n<div class=\"tc-swatches-horiz\">\n<<swatch foreground>>\n<<swatch background>>\n<<swatch muted-foreground>>\n<<swatch primary>>\n<<swatch page-background>>\n<<swatch tab-background>>\n<<swatch tiddler-info-background>>\n</div>\n"
        },
        "$:/snippets/download-wiki-button": {
            "title": "$:/snippets/download-wiki-button",
            "text": "\\define lingo-base() $:/language/ControlPanel/Tools/Download/\n<$button class=\"tc-btn-big-green\">\n<$action-sendmessage $message=\"tm-download-file\" $param=\"$:/core/save/all\" filename=\"index.html\"/>\n<<lingo Full/Caption>> {{$:/core/images/save-button}}\n</$button>"
        },
        "$:/language": {
            "title": "$:/language",
            "text": "$:/languages/en-GB"
        },
        "$:/snippets/languageswitcher": {
            "title": "$:/snippets/languageswitcher",
            "text": "{{$:/language/ControlPanel/Basics/Language/Prompt}} <$select tiddler=\"$:/language\">\n<$list filter=\"[[$:/languages/en-GB]] [plugin-type[language]sort[description]]\">\n<option value=<<currentTiddler>>><$view field=\"description\"><$view field=\"name\"><$view field=\"title\"/></$view></$view></option>\n</$list>\n</$select>"
        },
        "$:/core/macros/CSS": {
            "title": "$:/core/macros/CSS",
            "tags": "$:/tags/Macro",
            "text": "\\define colour(name)\n<$transclude tiddler={{$:/palette}} index=\"$name$\"><$transclude tiddler=\"$:/palettes/Vanilla\" index=\"$name$\"/></$transclude>\n\\end\n\n\\define color(name)\n<<colour $name$>>\n\\end\n\n\\define box-shadow(shadow)\n``\n  -webkit-box-shadow: $shadow$;\n     -moz-box-shadow: $shadow$;\n          box-shadow: $shadow$;\n``\n\\end\n\n\\define filter(filter)\n``\n  -webkit-filter: $filter$;\n     -moz-filter: $filter$;\n          filter: $filter$;\n``\n\\end\n\n\\define transition(transition)\n``\n  -webkit-transition: $transition$;\n     -moz-transition: $transition$;\n          transition: $transition$;\n``\n\\end\n\n\\define transform-origin(origin)\n``\n  -webkit-transform-origin: $origin$;\n     -moz-transform-origin: $origin$;\n          transform-origin: $origin$;\n``\n\\end\n\n\\define background-linear-gradient(gradient)\n``\nbackground-image: linear-gradient($gradient$);\nbackground-image: -o-linear-gradient($gradient$);\nbackground-image: -moz-linear-gradient($gradient$);\nbackground-image: -webkit-linear-gradient($gradient$);\nbackground-image: -ms-linear-gradient($gradient$);\n``\n\\end\n\n\\define column-count(columns)\n``\n-moz-column-count: $columns$;\n-webkit-column-count: $columns$;\ncolumn-count: $columns$;\n``\n\\end\n\n\\define datauri(title)\n<$macrocall $name=\"makedatauri\" type={{$title$!!type}} text={{$title$}}/>\n\\end\n\n\\define if-sidebar(text)\n<$reveal state=\"$:/state/sidebar\" type=\"match\" text=\"yes\" default=\"yes\">$text$</$reveal>\n\\end\n\n\\define if-no-sidebar(text)\n<$reveal state=\"$:/state/sidebar\" type=\"nomatch\" text=\"yes\" default=\"yes\">$text$</$reveal>\n\\end\n"
        },
        "$:/core/macros/colour-picker": {
            "title": "$:/core/macros/colour-picker",
            "tags": "$:/tags/Macro",
            "text": "\\define colour-picker-update-recent()\n<$action-listops\n\t$tiddler=\"$:/config/ColourPicker/Recent\"\n\t$subfilter=\"$(colour-picker-value)$ [list[$:/config/ColourPicker/Recent]remove[$(colour-picker-value)$]] +[limit[8]]\"\n/>\n\\end\n\n\\define colour-picker-inner(actions)\n<$button tag=\"a\" tooltip=\"\"\"$(colour-picker-value)$\"\"\">\n\n$(colour-picker-update-recent)$\n\n$actions$\n\n<div style=\"background-color: $(colour-picker-value)$; width: 100%; height: 100%; border-radius: 50%;\"/>\n\n</$button>\n\\end\n\n\\define colour-picker-recent-inner(actions)\n<$set name=\"colour-picker-value\" value=\"$(recentColour)$\">\n<$macrocall $name=\"colour-picker-inner\" actions=\"\"\"$actions$\"\"\"/>\n</$set>\n\\end\n\n\\define colour-picker-recent(actions)\n{{$:/language/ColourPicker/Recent}} <$list filter=\"[list[$:/config/ColourPicker/Recent]]\" variable=\"recentColour\">\n<$macrocall $name=\"colour-picker-recent-inner\" actions=\"\"\"$actions$\"\"\"/></$list>\n\\end\n\n\\define colour-picker(actions)\n<div class=\"tc-colour-chooser\">\n\n<$macrocall $name=\"colour-picker-recent\" actions=\"\"\"$actions$\"\"\"/>\n\n---\n\n<$list filter=\"LightPink Pink Crimson LavenderBlush PaleVioletRed HotPink DeepPink MediumVioletRed Orchid Thistle Plum Violet Magenta Fuchsia DarkMagenta Purple MediumOrchid DarkViolet DarkOrchid Indigo BlueViolet MediumPurple MediumSlateBlue SlateBlue DarkSlateBlue Lavender GhostWhite Blue MediumBlue MidnightBlue DarkBlue Navy RoyalBlue CornflowerBlue LightSteelBlue LightSlateGrey SlateGrey DodgerBlue AliceBlue SteelBlue LightSkyBlue SkyBlue DeepSkyBlue LightBlue PowderBlue CadetBlue Azure LightCyan PaleTurquoise Cyan Aqua DarkTurquoise DarkSlateGrey DarkCyan Teal MediumTurquoise LightSeaGreen Turquoise Aquamarine MediumAquamarine MediumSpringGreen MintCream SpringGreen MediumSeaGreen SeaGreen Honeydew LightGreen PaleGreen DarkSeaGreen LimeGreen Lime ForestGreen Green DarkGreen Chartreuse LawnGreen GreenYellow DarkOliveGreen YellowGreen OliveDrab Beige LightGoldenrodYellow Ivory LightYellow Yellow Olive DarkKhaki LemonChiffon PaleGoldenrod Khaki Gold Cornsilk Goldenrod DarkGoldenrod FloralWhite OldLace Wheat Moccasin Orange PapayaWhip BlanchedAlmond NavajoWhite AntiqueWhite Tan BurlyWood Bisque DarkOrange Linen Peru PeachPuff SandyBrown Chocolate SaddleBrown Seashell Sienna LightSalmon Coral OrangeRed DarkSalmon Tomato MistyRose Salmon Snow LightCoral RosyBrown IndianRed Red Brown FireBrick DarkRed Maroon White WhiteSmoke Gainsboro LightGrey Silver DarkGrey Grey DimGrey Black\" variable=\"colour-picker-value\">\n<$macrocall $name=\"colour-picker-inner\" actions=\"\"\"$actions$\"\"\"/>\n</$list>\n\n---\n\n<$edit-text tiddler=\"$:/config/ColourPicker/New\" tag=\"input\" default=\"\" placeholder=\"\"/> \n<$edit-text tiddler=\"$:/config/ColourPicker/New\" type=\"color\" tag=\"input\"/>\n<$set name=\"colour-picker-value\" value={{$:/config/ColourPicker/New}}>\n<$macrocall $name=\"colour-picker-inner\" actions=\"\"\"$actions$\"\"\"/>\n</$set>\n\n</div>\n\n\\end\n"
        },
        "$:/core/macros/export": {
            "title": "$:/core/macros/export",
            "tags": "$:/tags/Macro",
            "text": "\\define exportButtonFilename(baseFilename)\n$baseFilename$$(extension)$\n\\end\n\n\\define exportButton(exportFilter:\"[!is[system]sort[title]]\",lingoBase,baseFilename:\"tiddlers\")\n<span class=\"tc-popup-keep\">\n<$button popup=<<qualify \"$:/state/popup/export\">> tooltip={{$lingoBase$Hint}} aria-label={{$lingoBase$Caption}} class=<<tv-config-toolbar-class>> selectedClass=\"tc-selected\">\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/export-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$lingoBase$Caption}}/></span>\n</$list>\n</$button>\n</span>\n<$reveal state=<<qualify \"$:/state/popup/export\">> type=\"popup\" position=\"below\" animate=\"yes\">\n<div class=\"tc-drop-down\">\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/Exporter]]\">\n<$set name=\"extension\" value={{!!extension}}>\n<$button class=\"tc-btn-invisible\">\n<$action-sendmessage $message=\"tm-download-file\" $param=<<currentTiddler>> exportFilter=\"\"\"$exportFilter$\"\"\" filename=<<exportButtonFilename \"\"\"$baseFilename$\"\"\">>/>\n<$action-deletetiddler $tiddler=<<qualify \"$:/state/popup/export\">>/>\n<$transclude field=\"description\"/>\n</$button>\n</$set>\n</$list>\n</div>\n</$reveal>\n\\end\n"
        },
        "$:/core/macros/image-picker": {
            "title": "$:/core/macros/image-picker",
            "tags": "$:/tags/Macro",
            "text": "\\define image-picker-thumbnail(actions)\n<$button tag=\"a\" tooltip=\"\"\"$(imageTitle)$\"\"\">\n$actions$\n<$transclude tiddler=<<imageTitle>>/>\n</$button>\n\\end\n\n\\define image-picker-list(filter,actions)\n<$list filter=\"\"\"$filter$\"\"\" variable=\"imageTitle\">\n<$macrocall $name=\"image-picker-thumbnail\" actions=\"\"\"$actions$\"\"\"/>\n</$list>\n\\end\n\n\\define image-picker(actions,filter:\"[all[shadows+tiddlers]is[image]] -[type[application/pdf]] +[!has[draft.of]sort[title]]\")\n<div class=\"tc-image-chooser\">\n<$vars state-system=<<qualify \"$:/state/image-picker/system\">>>\n<$checkbox tiddler=<<state-system>> field=\"text\" checked=\"show\" unchecked=\"hide\" default=\"hide\">\n{{$:/language/SystemTiddlers/Include/Prompt}}\n</$checkbox>\n<$reveal state=<<state-system>> type=\"match\" text=\"hide\" default=\"hide\" tag=\"div\">\n<$macrocall $name=\"image-picker-list\" filter=\"\"\"$filter$ +[!is[system]]\"\"\" actions=\"\"\"$actions$\"\"\"/>\n</$reveal>\n<$reveal state=<<state-system>> type=\"nomatch\" text=\"hide\" default=\"hide\" tag=\"div\">\n<$macrocall $name=\"image-picker-list\" filter=\"\"\"$filter$\"\"\" actions=\"\"\"$actions$\"\"\"/>\n</$reveal>\n</$vars>\n</div>\n\\end\n\n\\define image-picker-include-tagged-images(actions)\n<$macrocall $name=\"image-picker\" filter=\"[all[shadows+tiddlers]is[image]] [all[shadows+tiddlers]tag[$:/tags/Image]] -[type[application/pdf]] +[!has[draft.of]sort[title]]\" actions=\"\"\"$actions$\"\"\"/>\n\\end\n"
        },
        "$:/core/macros/lingo": {
            "title": "$:/core/macros/lingo",
            "tags": "$:/tags/Macro",
            "text": "\\define lingo-base()\n$:/language/\n\\end\n\n\\define lingo(title)\n{{$(lingo-base)$$title$}}\n\\end\n"
        },
        "$:/core/macros/list": {
            "title": "$:/core/macros/list",
            "tags": "$:/tags/Macro",
            "text": "\\define list-links(filter,type:\"ul\",subtype:\"li\",class:\"\")\n<$type$ class=\"$class$\">\n<$list filter=\"$filter$\">\n<$subtype$>\n<$link to={{!!title}}>\n<$transclude field=\"caption\">\n<$view field=\"title\"/>\n</$transclude>\n</$link>\n</$subtype$>\n</$list>\n</$type$>\n\\end\n\n\\define list-links-draggable-drop-actions()\n<$action-listops $tiddler=<<targetTiddler>> $field=<<targetField>> $subfilter=\"+[insertbefore:currentTiddler<actionTiddler>]\"/>\n\\end\n\n\\define list-links-draggable(tiddler,field:\"list\",type:\"ul\",subtype:\"li\",class:\"\",itemTemplate)\n<$vars targetTiddler=\"\"\"$tiddler$\"\"\" targetField=\"\"\"$field$\"\"\">\n<$type$ class=\"$class$\">\n<$list filter=\"[list[$tiddler$!!$field$]]\">\n<$droppable actions=<<list-links-draggable-drop-actions>> tag=\"\"\"$subtype$\"\"\">\n<div class=\"tc-droppable-placeholder\">\n&nbsp;\n</div>\n<div>\n<$link to={{!!title}}>\n<$transclude tiddler=\"\"\"$itemTemplate$\"\"\">\n<$transclude field=\"caption\">\n<$view field=\"title\"/>\n</$transclude>\n</$transclude>\n</$link>\n</div>\n</$droppable>\n</$list>\n<$tiddler tiddler=\"\">\n<$droppable actions=<<list-links-draggable-drop-actions>> tag=\"\"\"$subtype$\"\"\">\n<div class=\"tc-droppable-placeholder\">\n&nbsp;\n</div>\n<div>\n&nbsp;\n</div>\n</$droppable>\n</$tiddler>\n</$type$>\n</$vars>\n\\end\n\n\\define list-tagged-draggable-drop-actions()\n<!-- Save the current ordering of the tiddlers with this tag -->\n<$set name=\"order\" filter=\"[<tag>tagging[]]\">\n<!-- Remove any list-after or list-before fields from the tiddlers with this tag -->\n<$list filter=\"[<tag>tagging[]]\">\n<$action-deletefield $field=\"list-before\"/>\n<$action-deletefield $field=\"list-after\"/>\n</$list>\n<!-- Assign the list field of the tag with the current ordering -->\n<$action-setfield $tiddler=<<tag>> $field=\"list\" $value=<<order>>/>\n<!-- Add the newly inserted item to the list -->\n<$action-listops $tiddler=<<tag>> $field=\"list\" $subfilter=\"+[insertbefore:currentTiddler<actionTiddler>]\"/>\n<!-- Make sure the newly added item has the right tag -->\n<$action-listops $tiddler=<<actionTiddler>> $tags=\"[<tag>]\"/>\n</$set>\n\\end\n\n\\define list-tagged-draggable(tag,itemTemplate,elementTag:\"div\")\n<$set name=\"tag\" value=\"\"\"$tag$\"\"\">\n<$list filter=\"[<tag>tagging[]]\">\n<$elementTag$ class=\"tc-menu-list-item\">\n<$droppable actions=<<list-tagged-draggable-drop-actions>>>\n<$elementTag$ class=\"tc-droppable-placeholder\">\n&nbsp;\n</$elementTag$>\n<$elementTag$>\n<$transclude tiddler=\"\"\"$itemTemplate$\"\"\">\n<$link to={{!!title}}>\n<$view field=\"title\"/>\n</$link>\n</$transclude>\n</$elementTag$>\n</$droppable>\n</$elementTag$>\n</$list>\n<$tiddler tiddler=\"\">\n<$droppable actions=<<list-tagged-draggable-drop-actions>>>\n<$elementTag$ class=\"tc-droppable-placeholder\">\n&nbsp;\n</$elementTag$>\n<$elementTag$ style=\"height:0.5em;\">\n</$elementTag$>\n</$droppable>\n</$tiddler>\n</$set>\n\\end\n"
        },
        "$:/core/macros/tabs": {
            "title": "$:/core/macros/tabs",
            "tags": "$:/tags/Macro",
            "text": "\\define tabs(tabsList,default,state:\"$:/state/tab\",class,template)\n<div class=\"tc-tab-set $class$\">\n<div class=\"tc-tab-buttons $class$\">\n<$list filter=\"$tabsList$\" variable=\"currentTab\"><$set name=\"save-currentTiddler\" value=<<currentTiddler>>><$tiddler tiddler=<<currentTab>>><$button set=<<qualify \"$state$\">> setTo=<<currentTab>> default=\"$default$\" selectedClass=\"tc-tab-selected\" tooltip={{!!tooltip}}>\n<$tiddler tiddler=<<save-currentTiddler>>>\n<$set name=\"tv-wikilinks\" value=\"no\">\n<$transclude tiddler=<<currentTab>> field=\"caption\">\n<$macrocall $name=\"currentTab\" $type=\"text/plain\" $output=\"text/plain\"/>\n</$transclude>\n</$set></$tiddler></$button></$tiddler></$set></$list>\n</div>\n<div class=\"tc-tab-divider $class$\"/>\n<div class=\"tc-tab-content $class$\">\n<$list filter=\"$tabsList$\" variable=\"currentTab\">\n\n<$reveal type=\"match\" state=<<qualify \"$state$\">> text=<<currentTab>> default=\"$default$\">\n\n<$transclude tiddler=\"$template$\" mode=\"block\">\n\n<$transclude tiddler=<<currentTab>> mode=\"block\"/>\n\n</$transclude>\n\n</$reveal>\n\n</$list>\n</div>\n</div>\n\\end\n"
        },
        "$:/core/macros/tag-picker": {
            "title": "$:/core/macros/tag-picker",
            "tags": "$:/tags/Macro",
            "text": "\\define add-tag-actions()\n<$action-sendmessage $message=\"tm-add-tag\" $param={{$:/temp/NewTagName}}/>\n<$action-deletetiddler $tiddler=\"$:/temp/NewTagName\"/>\n\\end\n\n\\define tag-button()\n<$button class=\"tc-btn-invisible\" tag=\"a\">\n$(actions)$\n<$action-deletetiddler $tiddler=\"$:/temp/NewTagName\"/>\n<$macrocall $name=\"tag-pill\" tag=<<tag>>/>\n</$button>\n\\end\n\n\\define tag-picker(actions)\n<$set name=\"actions\" value=\"\"\"$actions$\"\"\">\n<div class=\"tc-edit-add-tag\">\n<span class=\"tc-add-tag-name\">\n<$keyboard key=\"ENTER\" actions=<<add-tag-actions>>>\n<$edit-text tiddler=\"$:/temp/NewTagName\" tag=\"input\" default=\"\" placeholder={{$:/language/EditTemplate/Tags/Add/Placeholder}} focusPopup=<<qualify \"$:/state/popup/tags-auto-complete\">> class=\"tc-edit-texteditor tc-popup-handle\"/>\n</$keyboard>\n</span> <$button popup=<<qualify \"$:/state/popup/tags-auto-complete\">> class=\"tc-btn-invisible\" tooltip={{$:/language/EditTemplate/Tags/Dropdown/Hint}} aria-label={{$:/language/EditTemplate/Tags/Dropdown/Caption}}>{{$:/core/images/down-arrow}}</$button> <span class=\"tc-add-tag-button\">\n<$set name=\"tag\" value={{$:/temp/NewTagName}}>\n<$button set=\"$:/temp/NewTagName\" setTo=\"\" class=\"\">\n$actions$\n<$action-deletetiddler $tiddler=\"$:/temp/NewTagName\"/>\n{{$:/language/EditTemplate/Tags/Add/Button}}\n</$button>\n</$set>\n</span>\n</div>\n<div class=\"tc-block-dropdown-wrapper\">\n<$reveal state=<<qualify \"$:/state/popup/tags-auto-complete\">> type=\"nomatch\" text=\"\" default=\"\">\n<div class=\"tc-block-dropdown\">\n<$list filter=\"[tags[]!is[system]search:title{$:/temp/NewTagName}sort[]]\" variable=\"tag\">\n<<tag-button>>\n</$list>\n<hr>\n<$list filter=\"[tags[]is[system]search:title{$:/temp/NewTagName}sort[]]\" variable=\"tag\">\n<<tag-button>>\n</$list>\n</div>\n</$reveal>\n</div>\n</$set>\n\\end\n"
        },
        "$:/core/macros/tag": {
            "title": "$:/core/macros/tag",
            "tags": "$:/tags/Macro",
            "text": "\\define tag-pill-styles()\nbackground-color:$(backgroundColor)$;\nfill:$(foregroundColor)$;\ncolor:$(foregroundColor)$;\n\\end\n\n\\define tag-pill-inner(tag,icon,colour,fallbackTarget,colourA,colourB,element-tag,element-attributes,actions)\n<$vars foregroundColor=<<contrastcolour target:\"\"\"$colour$\"\"\" fallbackTarget:\"\"\"$fallbackTarget$\"\"\" colourA:\"\"\"$colourA$\"\"\" colourB:\"\"\"$colourB$\"\"\">> backgroundColor=\"\"\"$colour$\"\"\">\n<$element-tag$ $element-attributes$ class=\"tc-tag-label tc-btn-invisible\" style=<<tag-pill-styles>>>\n$actions$<$transclude tiddler=\"\"\"$icon$\"\"\"/> <$view tiddler=\"\"\"$tag$\"\"\" field=\"title\" format=\"text\" />\n</$element-tag$>\n</$vars>\n\\end\n\n\\define tag-pill-body(tag,icon,colour,palette,element-tag,element-attributes,actions)\n<$macrocall $name=\"tag-pill-inner\" tag=\"\"\"$tag$\"\"\" icon=\"\"\"$icon$\"\"\" colour=\"\"\"$colour$\"\"\" fallbackTarget={{$palette$##tag-background}} colourA={{$palette$##foreground}} colourB={{$palette$##background}} element-tag=\"\"\"$element-tag$\"\"\" element-attributes=\"\"\"$element-attributes$\"\"\" actions=\"\"\"$actions$\"\"\"/>\n\\end\n\n\\define tag-pill(tag,element-tag:\"span\",element-attributes:\"\",actions:\"\")\n<span class=\"tc-tag-list-item\">\n<$macrocall $name=\"tag-pill-body\" tag=\"\"\"$tag$\"\"\" icon={{$tag$!!icon}} colour={{$tag$!!color}} palette={{$:/palette}} element-tag=\"\"\"$element-tag$\"\"\" element-attributes=\"\"\"$element-attributes$\"\"\" actions=\"\"\"$actions$\"\"\"/>\n</span>\n\\end\n\n\\define tag(tag)\n{{$tag$||$:/core/ui/TagTemplate}}\n\\end\n"
        },
        "$:/core/macros/thumbnails": {
            "title": "$:/core/macros/thumbnails",
            "tags": "$:/tags/Macro",
            "text": "\\define thumbnail(link,icon,color,background-color,image,caption,width:\"280\",height:\"157\")\n<$link to=\"\"\"$link$\"\"\"><div class=\"tc-thumbnail-wrapper\">\n<div class=\"tc-thumbnail-image\" style=\"width:$width$px;height:$height$px;\"><$reveal type=\"nomatch\" text=\"\" default=\"\"\"$image$\"\"\" tag=\"div\" style=\"width:$width$px;height:$height$px;\">\n[img[$image$]]\n</$reveal><$reveal type=\"match\" text=\"\" default=\"\"\"$image$\"\"\" tag=\"div\" class=\"tc-thumbnail-background\" style=\"width:$width$px;height:$height$px;background-color:$background-color$;\"></$reveal></div><div class=\"tc-thumbnail-icon\" style=\"fill:$color$;color:$color$;\">\n$icon$\n</div><div class=\"tc-thumbnail-caption\">\n$caption$\n</div>\n</div></$link>\n\\end\n\n\\define thumbnail-right(link,icon,color,background-color,image,caption,width:\"280\",height:\"157\")\n<div class=\"tc-thumbnail-right-wrapper\"><<thumbnail \"\"\"$link$\"\"\" \"\"\"$icon$\"\"\" \"\"\"$color$\"\"\" \"\"\"$background-color$\"\"\" \"\"\"$image$\"\"\" \"\"\"$caption$\"\"\" \"\"\"$width$\"\"\" \"\"\"$height$\"\"\">></div>\n\\end\n\n\\define list-thumbnails(filter,width:\"280\",height:\"157\")\n<$list filter=\"\"\"$filter$\"\"\"><$macrocall $name=\"thumbnail\" link={{!!link}} icon={{!!icon}} color={{!!color}} background-color={{!!background-color}} image={{!!image}} caption={{!!caption}} width=\"\"\"$width$\"\"\" height=\"\"\"$height$\"\"\"/></$list>\n\\end\n"
        },
        "$:/core/macros/timeline": {
            "created": "20141212105914482",
            "modified": "20141212110330815",
            "tags": "$:/tags/Macro",
            "title": "$:/core/macros/timeline",
            "type": "text/vnd.tiddlywiki",
            "text": "\\define timeline-title()\n<!-- Override this macro with a global macro \n     of the same name if you need to change \n     how titles are displayed on the timeline \n     -->\n<$view field=\"title\"/>\n\\end\n\\define timeline(limit:\"100\",format:\"DDth MMM YYYY\",subfilter:\"\",dateField:\"modified\")\n<div class=\"tc-timeline\">\n<$list filter=\"[!is[system]$subfilter$has[$dateField$]!sort[$dateField$]limit[$limit$]eachday[$dateField$]]\">\n<div class=\"tc-menu-list-item\">\n<$view field=\"$dateField$\" format=\"date\" template=\"$format$\"/>\n<$list filter=\"[sameday:$dateField${!!$dateField$}!is[system]$subfilter$!sort[$dateField$]]\">\n<div class=\"tc-menu-list-subitem\">\n<$link to={{!!title}}>\n<<timeline-title>>\n</$link>\n</div>\n</$list>\n</div>\n</$list>\n</div>\n\\end\n"
        },
        "$:/core/macros/toc": {
            "title": "$:/core/macros/toc",
            "tags": "$:/tags/Macro",
            "text": "\\define toc-caption()\n<$set name=\"tv-wikilinks\" value=\"no\">\n  <$transclude field=\"caption\">\n    <$view field=\"title\"/>\n  </$transclude>\n</$set>\n\\end\n\n\\define toc-body(tag,sort:\"\",itemClassFilter,exclude,path)\n<ol class=\"tc-toc\">\n  <$list filter=\"\"\"[all[shadows+tiddlers]tag[$tag$]!has[draft.of]$sort$] $exclude$\"\"\">\n    <$vars item=<<currentTiddler>> path=\"\"\"$path$/$tag$\"\"\" excluded=\"\"\"$exclude$ -[[$tag$]]\"\"\">\n      <$set name=\"toc-item-class\" filter=\"\"\"$itemClassFilter$\"\"\" emptyValue=\"toc-item\" value=\"toc-item-selected\">\n        <li class=<<toc-item-class>>>\n          <$list filter=\"[all[current]toc-link[no]]\" emptyMessage=\"<$link><$view field='caption'><$view field='title'/></$view></$link>\">\n            <<toc-caption>>\n          </$list>\n          <$macrocall $name=\"toc-body\" tag=<<item>> sort=\"\"\"$sort$\"\"\" itemClassFilter=\"\"\"$itemClassFilter$\"\"\" exclude=<<excluded>> path=<<path>>/>\n        </li>\n      </$set>\n    </$vars>\n  </$list>\n</ol>\n\\end\n\n\\define toc(tag,sort:\"\",itemClassFilter:\" \")\n<<toc-body tag:\"\"\"$tag$\"\"\" sort:\"\"\"$sort$\"\"\" itemClassFilter:\"\"\"$itemClassFilter$\"\"\">>\n\\end\n\n\\define toc-linked-expandable-body(tag,sort:\"\",itemClassFilter,exclude,path)\n<!-- helper function -->\n<$set name=\"toc-state\" value=<<qualify \"\"\"$:/state/toc$path$-$(currentTiddler)$\"\"\">>>\n  <$set name=\"toc-item-class\" filter=\"\"\"$itemClassFilter$\"\"\" emptyValue=\"toc-item\" value=\"toc-item-selected\">\n    <li class=<<toc-item-class>>>\n    <$link>\n      <$reveal type=\"nomatch\" state=<<toc-state>> text=\"open\">\n        <$button set=<<toc-state>> setTo=\"open\" class=\"tc-btn-invisible\">\n          {{$:/core/images/right-arrow}}\n        </$button>\n      </$reveal>\n      <$reveal type=\"match\" state=<<toc-state>> text=\"open\">\n        <$button set=<<toc-state>> setTo=\"close\" class=\"tc-btn-invisible\">\n          {{$:/core/images/down-arrow}}\n        </$button>\n      </$reveal>\n      <<toc-caption>>\n    </$link>\n    <$reveal type=\"match\" state=<<toc-state>> text=\"open\">\n      <$macrocall $name=\"toc-expandable\" tag=<<currentTiddler>> sort=\"\"\"$sort$\"\"\" itemClassFilter=\"\"\"$itemClassFilter$\"\"\" exclude=\"\"\"$exclude$\"\"\" path=\"\"\"$path$\"\"\"/>\n    </$reveal>\n    </li>\n  </$set>\n</$set>\n\\end\n\n\\define toc-unlinked-expandable-body(tag,sort:\"\",itemClassFilter:\" \",exclude,path)\n<!-- helper function -->\n<$set name=\"toc-state\" value=<<qualify \"\"\"$:/state/toc$path$-$(currentTiddler)$\"\"\">>>\n  <$set name=\"toc-item-class\" filter=\"\"\"$itemClassFilter$\"\"\" emptyValue=\"toc-item\" value=\"toc-item-selected\">\n    <li class=<<toc-item-class>>>\n      <$reveal type=\"nomatch\" state=<<toc-state>> text=\"open\">\n        <$button set=<<toc-state>> setTo=\"open\" class=\"tc-btn-invisible\">\n          {{$:/core/images/right-arrow}}\n          <<toc-caption>>\n        </$button>\n      </$reveal>\n      <$reveal type=\"match\" state=<<toc-state>> text=\"open\">\n        <$button set=<<toc-state>> setTo=\"close\" class=\"tc-btn-invisible\">\n          {{$:/core/images/down-arrow}}\n          <<toc-caption>>\n        </$button>\n      </$reveal>\n      <$reveal type=\"match\" state=<<toc-state>> text=\"open\">\n        <$macrocall $name=\"toc-expandable\" tag=<<currentTiddler>> sort=\"\"\"$sort$\"\"\" itemClassFilter=\"\"\"$itemClassFilter$\"\"\" exclude=\"\"\"$exclude$\"\"\" path=\"\"\"$path$\"\"\"/>\n      </$reveal>\n    </li>\n  </$set>\n</$set>\n\\end\n\n\\define toc-expandable-empty-message()\n<<toc-linked-expandable-body tag:\"\"\"$(tag)$\"\"\" sort:\"\"\"$(sort)$\"\"\" itemClassFilter:\"\"\"$(itemClassFilter)$\"\"\" exclude:\"\"\"$(excluded)$\"\"\" path:\"\"\"$(path)$\"\"\">>\n\\end\n\n\\define toc-expandable(tag,sort:\"\",itemClassFilter:\" \",exclude,path)\n<$vars tag=\"\"\"$tag$\"\"\" sort=\"\"\"$sort$\"\"\" itemClassFilter=\"\"\"$itemClassFilter$\"\"\" excluded=\"\"\"$exclude$ -[[$tag$]]\"\"\" path=\"\"\"$path$/$tag$\"\"\">\n  <ol class=\"tc-toc toc-expandable\">\n    <$list filter=\"\"\"[all[shadows+tiddlers]tag[$tag$]!has[draft.of]$sort$] $exclude$\"\"\">\n      <$list filter=\"[all[current]toc-link[no]]\" emptyMessage=<<toc-expandable-empty-message>> >\n        <$macrocall $name=\"toc-unlinked-expandable-body\" tag=\"\"\"$tag$\"\"\" sort=\"\"\"$sort$\"\"\" itemClassFilter=\"\"\"itemClassFilter\"\"\" exclude=<<excluded>> path=<<path>> />\n      </$list>\n    </$list>\n  </ol>\n</$vars>\n\\end\n\n\\define toc-linked-selective-expandable-body(tag,sort:\"\",itemClassFilter:\" \",exclude,path)\n<$set name=\"toc-state\" value=<<qualify \"\"\"$:/state/toc$path$-$(currentTiddler)$\"\"\">>>\n  <$set name=\"toc-item-class\" filter=\"\"\"$itemClassFilter$\"\"\" emptyValue=\"toc-item\" value=\"toc-item-selected\" >\n    <li class=<<toc-item-class>>>\n      <$link>\n          <$list filter=\"[all[current]tagging[]limit[1]]\" variable=\"ignore\" emptyMessage=\"<$button class='tc-btn-invisible'>{{$:/core/images/blank}}</$button>\">\n          <$reveal type=\"nomatch\" state=<<toc-state>> text=\"open\">\n            <$button set=<<toc-state>> setTo=\"open\" class=\"tc-btn-invisible\">\n              {{$:/core/images/right-arrow}}\n            </$button>\n          </$reveal>\n          <$reveal type=\"match\" state=<<toc-state>> text=\"open\">\n            <$button set=<<toc-state>> setTo=\"close\" class=\"tc-btn-invisible\">\n              {{$:/core/images/down-arrow}}\n            </$button>\n          </$reveal>\n        </$list>\n        <<toc-caption>>\n      </$link>\n      <$reveal type=\"match\" state=<<toc-state>> text=\"open\">\n        <$macrocall $name=\"toc-selective-expandable\" tag=<<currentTiddler>> sort=\"\"\"$sort$\"\"\" itemClassFilter=\"\"\"$itemClassFilter$\"\"\" exclude=\"\"\"$exclude$\"\"\" path=\"\"\"$path$\"\"\"/>\n      </$reveal>\n    </li>\n  </$set>\n</$set>\n\\end\n\n\\define toc-unlinked-selective-expandable-body(tag,sort:\"\",itemClassFilter:\" \",exclude,path)\n<$set name=\"toc-state\" value=<<qualify \"\"\"$:/state/toc$path$-$(currentTiddler)$\"\"\">>>\n  <$set name=\"toc-item-class\" filter=\"\"\"$itemClassFilter$\"\"\" emptyValue=\"toc-item\" value=\"toc-item-selected\">\n    <li class=<<toc-item-class>>>\n      <$list filter=\"[all[current]tagging[]limit[1]]\" variable=\"ignore\" emptyMessage=\"<$button class='tc-btn-invisible'>{{$:/core/images/blank}}</$button> <$view field='caption'><$view field='title'/></$view>\">\n        <$reveal type=\"nomatch\" state=<<toc-state>> text=\"open\">\n          <$button set=<<toc-state>> setTo=\"open\" class=\"tc-btn-invisible\">\n            {{$:/core/images/right-arrow}}\n            <<toc-caption>>\n          </$button>\n        </$reveal>\n        <$reveal type=\"match\" state=<<toc-state>> text=\"open\">\n          <$button set=<<toc-state>> setTo=\"close\" class=\"tc-btn-invisible\">\n            {{$:/core/images/down-arrow}}\n            <<toc-caption>>\n          </$button>\n        </$reveal>\n      </$list>\n      <$reveal type=\"match\" state=<<toc-state>> text=\"open\">\n        <$macrocall $name=\"\"\"toc-selective-expandable\"\"\" tag=<<currentTiddler>> sort=\"\"\"$sort$\"\"\" itemClassFilter=\"\"\"$itemClassFilter$\"\"\" exclude=\"\"\"$exclude$\"\"\" path=\"\"\"$path$\"\"\"/>\n      </$reveal>\n    </li>\n  </$set>\n</$set>\n\\end\n\n\\define toc-selective-expandable-empty-message()\n<<toc-linked-selective-expandable-body tag:\"\"\"$(tag)$\"\"\" sort:\"\"\"$(sort)$\"\"\" itemClassFilter:\"\"\"$(itemClassFilter)$\"\"\" exclude:\"\"\"$(excluded)$\"\"\" path:\"\"\"$(path)$\"\"\">>\n\\end\n\n\\define toc-selective-expandable(tag,sort:\"\",itemClassFilter,exclude,path)\n<$vars tag=\"\"\"$tag$\"\"\" sort=\"\"\"$sort$\"\"\" itemClassFilter=\"\"\"$itemClassFilter$\"\"\" excluded=\"\"\"$exclude$ -[[$tag$]]\"\"\" path=\"\"\"$path$/$tag$\"\"\">\n  <ol class=\"tc-toc toc-selective-expandable\">\n    <$list filter=\"\"\"[all[shadows+tiddlers]tag[$tag$]!has[draft.of]$sort$] $exclude$\"\"\">\n      <$list filter=\"[all[current]toc-link[no]]\" variable=\"ignore\" emptyMessage=<<toc-selective-expandable-empty-message>> >\n        <$macrocall $name=toc-unlinked-selective-expandable-body tag=\"\"\"$tag$\"\"\" sort=\"\"\"$sort$\"\"\" itemClassFilter=\"\"\"$itemClassFilter$\"\"\" exclude=<<excluded>> path=<<path>> >\n      </$list>\n    </$list>\n  </ol>\n</$vars>\n\\end\n\n\\define toc-tabbed-selected-item-filter(selectedTiddler)\n[all[current]field:title{$selectedTiddler$}]\n\\end\n\n\\define toc-tabbed-external-nav(tag,sort:\"\",selectedTiddler:\"$:/temp/toc/selectedTiddler\",unselectedText,missingText,template:\"\")\n<$tiddler tiddler={{$selectedTiddler$}}>\n  <div class=\"tc-tabbed-table-of-contents\">\n    <$linkcatcher to=\"$selectedTiddler$\">\n      <div class=\"tc-table-of-contents\">\n        <$macrocall $name=\"toc-selective-expandable\" tag=\"\"\"$tag$\"\"\" sort=\"\"\"$sort$\"\"\" itemClassFilter=<<toc-tabbed-selected-item-filter selectedTiddler:\"\"\"$selectedTiddler$\"\"\">>/>\n      </div>\n    </$linkcatcher>\n    <div class=\"tc-tabbed-table-of-contents-content\">\n      <$reveal state=\"\"\"$selectedTiddler$\"\"\" type=\"nomatch\" text=\"\">\n        <$transclude mode=\"block\" tiddler=\"$template$\">\n          <h1><<toc-caption>></h1>\n          <$transclude mode=\"block\">$missingText$</$transclude>\n        </$transclude>\n      </$reveal>\n      <$reveal state=\"\"\"$selectedTiddler$\"\"\" type=\"match\" text=\"\">\n        $unselectedText$\n      </$reveal>\n    </div>\n  </div>\n</$tiddler>\n\\end\n\n\\define toc-tabbed-internal-nav(tag,sort:\"\",selectedTiddler:\"$:/temp/toc/selectedTiddler\",unselectedText,missingText,template:\"\")\n<$linkcatcher to=\"\"\"$selectedTiddler$\"\"\">\n  <$macrocall $name=\"toc-tabbed-external-nav\" tag=\"\"\"$tag$\"\"\" sort=\"\"\"$sort$\"\"\" selectedTiddler=\"\"\"$selectedTiddler$\"\"\" unselectedText=\"\"\"$unselectedText$\"\"\" missingText=\"\"\"$missingText$\"\"\" template=\"\"\"$template$\"\"\"/>\n</$linkcatcher>\n\\end\n\n"
        },
        "$:/core/macros/translink": {
            "title": "$:/core/macros/translink",
            "tags": "$:/tags/Macro",
            "text": "\\define translink(title,mode:\"block\")\n<div style=\"border:1px solid #ccc; padding: 0.5em; background: black; foreground; white;\">\n<$link to=\"\"\"$title$\"\"\">\n<$text text=\"\"\"$title$\"\"\"/>\n</$link>\n<div style=\"border:1px solid #ccc; padding: 0.5em; background: white; foreground; black;\">\n<$transclude tiddler=\"\"\"$title$\"\"\" mode=\"$mode$\">\n\"<$text text=\"\"\"$title$\"\"\"/>\" is missing\n</$transclude>\n</div>\n</div>\n\\end\n"
        },
        "$:/snippets/minilanguageswitcher": {
            "title": "$:/snippets/minilanguageswitcher",
            "text": "<$select tiddler=\"$:/language\">\n<$list filter=\"[[$:/languages/en-GB]] [plugin-type[language]sort[title]]\">\n<option value=<<currentTiddler>>><$view field=\"description\"><$view field=\"name\"><$view field=\"title\"/></$view></$view></option>\n</$list>\n</$select>"
        },
        "$:/snippets/minithemeswitcher": {
            "title": "$:/snippets/minithemeswitcher",
            "text": "\\define lingo-base() $:/language/ControlPanel/Theme/\n<<lingo Prompt>> <$select tiddler=\"$:/theme\">\n<$list filter=\"[plugin-type[theme]sort[title]]\">\n<option value=<<currentTiddler>>><$view field=\"name\"><$view field=\"title\"/></$view></option>\n</$list>\n</$select>"
        },
        "$:/snippets/modules": {
            "title": "$:/snippets/modules",
            "text": "\\define describeModuleType(type)\n{{$:/language/Docs/ModuleTypes/$type$}}\n\\end\n<$list filter=\"[moduletypes[]]\">\n\n!! <$macrocall $name=\"currentTiddler\" $type=\"text/plain\" $output=\"text/plain\"/>\n\n<$macrocall $name=\"describeModuleType\" type=<<currentTiddler>>/>\n\n<ul><$list filter=\"[all[current]modules[]]\"><li><$link><<currentTiddler>></$link>\n</li>\n</$list>\n</ul>\n</$list>\n"
        },
        "$:/palette": {
            "title": "$:/palette",
            "text": "$:/palettes/Vanilla"
        },
        "$:/snippets/paletteeditor": {
            "title": "$:/snippets/paletteeditor",
            "text": "\\define lingo-base() $:/language/ControlPanel/Palette/Editor/\n\\define describePaletteColour(colour)\n<$transclude tiddler=\"$:/language/Docs/PaletteColours/$colour$\"><$text text=\"$colour$\"/></$transclude>\n\\end\n<$set name=\"currentTiddler\" value={{$:/palette}}>\n\n<<lingo Prompt>> <$link to={{$:/palette}}><$macrocall $name=\"currentTiddler\" $output=\"text/plain\"/></$link>\n\n<$list filter=\"[all[current]is[shadow]is[tiddler]]\" variable=\"listItem\">\n<<lingo Prompt/Modified>>\n<$button message=\"tm-delete-tiddler\" param={{$:/palette}}><<lingo Reset/Caption>></$button>\n</$list>\n\n<$list filter=\"[all[current]is[shadow]!is[tiddler]]\" variable=\"listItem\">\n<<lingo Clone/Prompt>>\n</$list>\n\n<$button message=\"tm-new-tiddler\" param={{$:/palette}}><<lingo Clone/Caption>></$button>\n\n<table>\n<tbody>\n<$list filter=\"[all[current]indexes[]]\" variable=\"colourName\">\n<tr>\n<td>\n''<$macrocall $name=\"describePaletteColour\" colour=<<colourName>>/>''<br/>\n<$macrocall $name=\"colourName\" $output=\"text/plain\"/>\n</td>\n<td>\n<$edit-text index=<<colourName>> tag=\"input\"/>\n<br>\n<$edit-text index=<<colourName>> type=\"color\" tag=\"input\"/>\n</td>\n</tr>\n</$list>\n</tbody>\n</table>\n</$set>\n"
        },
        "$:/snippets/palettepreview": {
            "title": "$:/snippets/palettepreview",
            "text": "<$set name=\"currentTiddler\" value={{$:/palette}}>\n<$transclude tiddler=\"$:/snippets/currpalettepreview\"/>\n</$set>\n"
        },
        "$:/snippets/paletteswitcher": {
            "title": "$:/snippets/paletteswitcher",
            "text": "\\define lingo-base() $:/language/ControlPanel/Palette/\n<div class=\"tc-prompt\">\n<<lingo Prompt>> <$view tiddler={{$:/palette}} field=\"name\"/>\n</div>\n\n<$linkcatcher to=\"$:/palette\">\n<div class=\"tc-chooser\"><$list filter=\"[all[shadows+tiddlers]tag[$:/tags/Palette]sort[description]]\"><div class=\"tc-chooser-item\"><$link to={{!!title}}><div><$reveal state=\"$:/palette\" type=\"match\" text={{!!title}}>&bull;</$reveal><$reveal state=\"$:/palette\" type=\"nomatch\" text={{!!title}}>&nbsp;</$reveal> ''<$view field=\"name\" format=\"text\"/>'' - <$view field=\"description\" format=\"text\"/></div><$transclude tiddler=\"$:/snippets/currpalettepreview\"/></$link></div>\n</$list>\n</div>\n</$linkcatcher>"
        },
        "$:/temp/search": {
            "title": "$:/temp/search",
            "text": ""
        },
        "$:/tags/AdvancedSearch": {
            "title": "$:/tags/AdvancedSearch",
            "list": "[[$:/core/ui/AdvancedSearch/Standard]] [[$:/core/ui/AdvancedSearch/System]] [[$:/core/ui/AdvancedSearch/Shadows]] [[$:/core/ui/AdvancedSearch/Filter]]"
        },
        "$:/tags/AdvancedSearch/FilterButton": {
            "title": "$:/tags/AdvancedSearch/FilterButton",
            "list": "$:/core/ui/AdvancedSearch/Filter/FilterButtons/dropdown $:/core/ui/AdvancedSearch/Filter/FilterButtons/clear $:/core/ui/AdvancedSearch/Filter/FilterButtons/export $:/core/ui/AdvancedSearch/Filter/FilterButtons/delete"
        },
        "$:/tags/ControlPanel": {
            "title": "$:/tags/ControlPanel",
            "list": "$:/core/ui/ControlPanel/Info $:/core/ui/ControlPanel/Appearance $:/core/ui/ControlPanel/Settings $:/core/ui/ControlPanel/Saving $:/core/ui/ControlPanel/Plugins $:/core/ui/ControlPanel/Tools $:/core/ui/ControlPanel/Internals"
        },
        "$:/tags/ControlPanel/Info": {
            "title": "$:/tags/ControlPanel/Info",
            "list": "$:/core/ui/ControlPanel/Basics $:/core/ui/ControlPanel/Advanced"
        },
        "$:/tags/ControlPanel/Plugins": {
            "title": "$:/tags/ControlPanel/Plugins",
            "list": "[[$:/core/ui/ControlPanel/Plugins/Installed]] [[$:/core/ui/ControlPanel/Plugins/Add]]"
        },
        "$:/tags/EditTemplate": {
            "title": "$:/tags/EditTemplate",
            "list": "[[$:/core/ui/EditTemplate/controls]] [[$:/core/ui/EditTemplate/title]] [[$:/core/ui/EditTemplate/tags]] [[$:/core/ui/EditTemplate/shadow]] [[$:/core/ui/ViewTemplate/classic]] [[$:/core/ui/EditTemplate/body]] [[$:/core/ui/EditTemplate/type]] [[$:/core/ui/EditTemplate/fields]]"
        },
        "$:/tags/EditToolbar": {
            "title": "$:/tags/EditToolbar",
            "list": "[[$:/core/ui/Buttons/delete]] [[$:/core/ui/Buttons/cancel]] [[$:/core/ui/Buttons/save]]"
        },
        "$:/tags/EditorToolbar": {
            "title": "$:/tags/EditorToolbar",
            "list": "$:/core/ui/EditorToolbar/paint $:/core/ui/EditorToolbar/opacity $:/core/ui/EditorToolbar/line-width $:/core/ui/EditorToolbar/clear $:/core/ui/EditorToolbar/bold $:/core/ui/EditorToolbar/italic $:/core/ui/EditorToolbar/strikethrough $:/core/ui/EditorToolbar/underline $:/core/ui/EditorToolbar/superscript $:/core/ui/EditorToolbar/subscript $:/core/ui/EditorToolbar/mono-line $:/core/ui/EditorToolbar/mono-block $:/core/ui/EditorToolbar/quote $:/core/ui/EditorToolbar/list-bullet $:/core/ui/EditorToolbar/list-number $:/core/ui/EditorToolbar/heading-1 $:/core/ui/EditorToolbar/heading-2 $:/core/ui/EditorToolbar/heading-3 $:/core/ui/EditorToolbar/heading-4 $:/core/ui/EditorToolbar/heading-5 $:/core/ui/EditorToolbar/heading-6 $:/core/ui/EditorToolbar/link $:/core/ui/EditorToolbar/excise $:/core/ui/EditorToolbar/picture $:/core/ui/EditorToolbar/stamp $:/core/ui/EditorToolbar/size $:/core/ui/EditorToolbar/editor-height $:/core/ui/EditorToolbar/more $:/core/ui/EditorToolbar/preview $:/core/ui/EditorToolbar/preview-type"
        },
        "$:/tags/Manager/ItemMain": {
            "title": "$:/tags/Manager/ItemMain",
            "list": "$:/Manager/ItemMain/WikifiedText $:/Manager/ItemMain/RawText $:/Manager/ItemMain/Fields"
        },
        "$:/tags/Manager/ItemSidebar": {
            "title": "$:/tags/Manager/ItemSidebar",
            "list": "$:/Manager/ItemSidebar/Tags $:/Manager/ItemSidebar/Colour $:/Manager/ItemSidebar/Icon $:/Manager/ItemSidebar/Tools"
        },
        "$:/tags/MoreSideBar": {
            "title": "$:/tags/MoreSideBar",
            "list": "[[$:/core/ui/MoreSideBar/All]] [[$:/core/ui/MoreSideBar/Recent]] [[$:/core/ui/MoreSideBar/Tags]] [[$:/core/ui/MoreSideBar/Missing]] [[$:/core/ui/MoreSideBar/Drafts]] [[$:/core/ui/MoreSideBar/Orphans]] [[$:/core/ui/MoreSideBar/Types]] [[$:/core/ui/MoreSideBar/System]] [[$:/core/ui/MoreSideBar/Shadows]] [[$:/core/ui/MoreSideBar/Plugins]]",
            "text": ""
        },
        "$:/tags/PageControls": {
            "title": "$:/tags/PageControls",
            "list": "[[$:/core/ui/Buttons/home]] [[$:/core/ui/Buttons/close-all]] [[$:/core/ui/Buttons/fold-all]] [[$:/core/ui/Buttons/unfold-all]] [[$:/core/ui/Buttons/permaview]] [[$:/core/ui/Buttons/new-tiddler]] [[$:/core/ui/Buttons/new-journal]] [[$:/core/ui/Buttons/new-image]] [[$:/core/ui/Buttons/import]] [[$:/core/ui/Buttons/export-page]] [[$:/core/ui/Buttons/control-panel]] [[$:/core/ui/Buttons/advanced-search]] [[$:/core/ui/Buttons/manager]] [[$:/core/ui/Buttons/tag-manager]] [[$:/core/ui/Buttons/language]] [[$:/core/ui/Buttons/palette]] [[$:/core/ui/Buttons/theme]] [[$:/core/ui/Buttons/storyview]] [[$:/core/ui/Buttons/encryption]] [[$:/core/ui/Buttons/timestamp]] [[$:/core/ui/Buttons/full-screen]] [[$:/core/ui/Buttons/print]] [[$:/core/ui/Buttons/save-wiki]] [[$:/core/ui/Buttons/refresh]] [[$:/core/ui/Buttons/more-page-actions]]"
        },
        "$:/tags/PageTemplate": {
            "title": "$:/tags/PageTemplate",
            "list": "[[$:/core/ui/PageTemplate/topleftbar]] [[$:/core/ui/PageTemplate/toprightbar]] [[$:/core/ui/PageTemplate/sidebar]] [[$:/core/ui/PageTemplate/story]] [[$:/core/ui/PageTemplate/alerts]]",
            "text": ""
        },
        "$:/tags/SideBar": {
            "title": "$:/tags/SideBar",
            "list": "[[$:/core/ui/SideBar/Open]] [[$:/core/ui/SideBar/Recent]] [[$:/core/ui/SideBar/Tools]] [[$:/core/ui/SideBar/More]]",
            "text": ""
        },
        "$:/tags/TiddlerInfo": {
            "title": "$:/tags/TiddlerInfo",
            "list": "[[$:/core/ui/TiddlerInfo/Tools]] [[$:/core/ui/TiddlerInfo/References]] [[$:/core/ui/TiddlerInfo/Tagging]] [[$:/core/ui/TiddlerInfo/List]] [[$:/core/ui/TiddlerInfo/Listed]] [[$:/core/ui/TiddlerInfo/Fields]]",
            "text": ""
        },
        "$:/tags/TiddlerInfo/Advanced": {
            "title": "$:/tags/TiddlerInfo/Advanced",
            "list": "[[$:/core/ui/TiddlerInfo/Advanced/ShadowInfo]] [[$:/core/ui/TiddlerInfo/Advanced/PluginInfo]]"
        },
        "$:/tags/ViewTemplate": {
            "title": "$:/tags/ViewTemplate",
            "list": "[[$:/core/ui/ViewTemplate/title]] [[$:/core/ui/ViewTemplate/unfold]] [[$:/core/ui/ViewTemplate/subtitle]] [[$:/core/ui/ViewTemplate/tags]] [[$:/core/ui/ViewTemplate/classic]] [[$:/core/ui/ViewTemplate/body]]"
        },
        "$:/tags/ViewToolbar": {
            "title": "$:/tags/ViewToolbar",
            "list": "[[$:/core/ui/Buttons/more-tiddler-actions]] [[$:/core/ui/Buttons/info]] [[$:/core/ui/Buttons/new-here]] [[$:/core/ui/Buttons/new-journal-here]] [[$:/core/ui/Buttons/clone]] [[$:/core/ui/Buttons/export-tiddler]] [[$:/core/ui/Buttons/edit]] [[$:/core/ui/Buttons/delete]] [[$:/core/ui/Buttons/permalink]] [[$:/core/ui/Buttons/permaview]] [[$:/core/ui/Buttons/open-window]] [[$:/core/ui/Buttons/close-others]] [[$:/core/ui/Buttons/close]] [[$:/core/ui/Buttons/fold-others]] [[$:/core/ui/Buttons/fold]]"
        },
        "$:/snippets/themeswitcher": {
            "title": "$:/snippets/themeswitcher",
            "text": "\\define lingo-base() $:/language/ControlPanel/Theme/\n<<lingo Prompt>> <$view tiddler={{$:/theme}} field=\"name\"/>\n\n<$linkcatcher to=\"$:/theme\">\n<$list filter=\"[plugin-type[theme]sort[title]]\"><div><$reveal state=\"$:/theme\" type=\"match\" text={{!!title}}>&bull;</$reveal><$reveal state=\"$:/theme\" type=\"nomatch\" text={{!!title}}>&nbsp;</$reveal> <$link to={{!!title}}>''<$view field=\"name\" format=\"text\"/>'' <$view field=\"description\" format=\"text\"/></$link></div>\n</$list>\n</$linkcatcher>"
        },
        "$:/core/wiki/title": {
            "title": "$:/core/wiki/title",
            "type": "text/vnd.tiddlywiki",
            "text": "{{$:/SiteTitle}} --- {{$:/SiteSubtitle}}"
        },
        "$:/view": {
            "title": "$:/view",
            "text": "classic"
        },
        "$:/snippets/viewswitcher": {
            "title": "$:/snippets/viewswitcher",
            "text": "\\define lingo-base() $:/language/ControlPanel/StoryView/\n<<lingo Prompt>> <$select tiddler=\"$:/view\">\n<$list filter=\"[storyviews[]]\">\n<option><$view field=\"title\"/></option>\n</$list>\n</$select>"
        }
    }
}
[[New Tiddler]]
no
/*\
title: $:/plugins/inmysocks/rangewidget/range.js
type: application/javascript
module-type: widget

Range widget - sets a value using a html slider

Usage:

<$range tiddler=someTiddler field=someField min=minValue max=maxValue step=stepSize class=someCSSClass/>

or

<$range tiddler=someTiddler index=someIndex min=minValue max=maxValue step=stepSize class=someCSSClass/>

\*/
(function(){

/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";

var Widget = require("$:/core/modules/widgets/widget.js").widget;

var RangeWidget = function(parseTreeNode,options) {
	this.initialise(parseTreeNode,options);
};

/*
Inherit from the base widget class
*/
RangeWidget.prototype = new Widget();

/*
Render this widget into the DOM
*/
RangeWidget.prototype.render = function(parent,nextSibling) {
	// Save the parent dom node
	this.parentDomNode = parent;
	// Compute our attributes
	this.computeAttributes();
	// Execute our logic
	this.execute();
	// Create our elements
	this.labelDomNode = this.document.createElement("label");
	this.labelDomNode.setAttribute("class",this.rangeClass);
	this.inputDomNode = this.document.createElement("input");
	this.inputDomNode.setAttribute("type","range");
	this.inputDomNode.min = this.rangeMin;
	this.inputDomNode.max = this.rangeMax;
	this.inputDomNode.step = this.rangeStep;
	this.inputDomNode.value = this.getValue();
	this.labelDomNode.appendChild(this.inputDomNode);
	this.spanDomNode = this.document.createElement("span");
	this.labelDomNode.appendChild(this.spanDomNode);
	// Add a click event handler
	$tw.utils.addEventListeners(this.inputDomNode,[
		{name: "change", handlerObject: this, handlerMethod: "handleChangeEvent"}
	]);
	// Insert the label into the DOM and render any children
	parent.insertBefore(this.labelDomNode,nextSibling);
	this.renderChildren(this.spanDomNode,null);
	this.domNodes.push(this.labelDomNode);
};

RangeWidget.prototype.getValue = function() {
	var tiddler = this.wiki.getTiddler(this.rangeTitle);
	if(tiddler && this.rangeField) {
		return tiddler.getFieldString(this.rangeField);
	}
	return 0;
};

RangeWidget.prototype.handleChangeEvent = function(event) {
	this.wiki.setText(this.rangeTitle,this.rangeField,this.rangeIndex,this.inputDomNode.value);
};

/*
Compute the internal state of the widget
*/
RangeWidget.prototype.execute = function() {
	// Get the parameters from the attributes
	this.rangeTitle = this.getAttribute("tiddler",this.getVariable("currentTiddler"));
	this.rangeField = this.getAttribute("field");
	this.rangeIndex = this.getAttribute("index");
	this.rangeMin = this.getAttribute("min","0");
	this.rangeMax = this.getAttribute("max","100");
	this.rangeStep = this.getAttribute("step","1");
	this.rangeClass = this.getAttribute("class","");

	// Make the child widgets
	this.makeChildWidgets();
};

/*
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
*/
RangeWidget.prototype.refresh = function(changedTiddlers) {
	var changedAttributes = this.computeAttributes();
	if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes.default || changedAttributes.class || changedAttributes.min || changedAttributes.max || changedAttributes.step) {
		this.refreshSelf();
		return true;
	} else {
		var refreshed = false;
		if(changedTiddlers[this.rangeTitle]) {
			this.inputDomNode.value = this.getValue();
			refreshed = true;
		}
		return this.refreshChildren(changedTiddlers) || refreshed;
	}
};

exports.range = RangeWidget;

})();
{
    "tiddlers": {
        "$:/plugins/rboue/Three.js/Lib/three-min.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/three-min.js",
            "module-type": "library",
            "text": "(function(){\nvar THREE={REVISION:\"68\"};TiddlyWiki||\"object\"!==typeof module||(module.exports=THREE);THREE.CullFaceNone=0;THREE.CullFaceBack=1;THREE.CullFaceFront=2;THREE.CullFaceFrontBack=3;THREE.FrontFaceDirectionCW=0;THREE.FrontFaceDirectionCCW=1;THREE.BasicShadowMap=0;THREE.PCFShadowMap=1;THREE.PCFSoftShadowMap=2;THREE.FrontSide=0;THREE.BackSide=1;THREE.DoubleSide=2;THREE.NoShading=0;THREE.FlatShading=1;THREE.SmoothShading=2;THREE.NoColors=0;THREE.FaceColors=1;THREE.VertexColors=2;THREE.NoBlending=0;\nTHREE.NormalBlending=1;THREE.AdditiveBlending=2;THREE.SubtractiveBlending=3;THREE.MultiplyBlending=4;THREE.CustomBlending=5;THREE.AddEquation=100;THREE.SubtractEquation=101;THREE.ReverseSubtractEquation=102;THREE.ZeroFactor=200;THREE.OneFactor=201;THREE.SrcColorFactor=202;THREE.OneMinusSrcColorFactor=203;THREE.SrcAlphaFactor=204;THREE.OneMinusSrcAlphaFactor=205;THREE.DstAlphaFactor=206;THREE.OneMinusDstAlphaFactor=207;THREE.DstColorFactor=208;THREE.OneMinusDstColorFactor=209;\nTHREE.SrcAlphaSaturateFactor=210;THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.AddOperation=2;THREE.UVMapping=function(){};THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.RepeatWrapping=1E3;THREE.ClampToEdgeWrapping=1001;THREE.MirroredRepeatWrapping=1002;THREE.NearestFilter=1003;THREE.NearestMipMapNearestFilter=1004;THREE.NearestMipMapLinearFilter=1005;\nTHREE.LinearFilter=1006;THREE.LinearMipMapNearestFilter=1007;THREE.LinearMipMapLinearFilter=1008;THREE.UnsignedByteType=1009;THREE.ByteType=1010;THREE.ShortType=1011;THREE.UnsignedShortType=1012;THREE.IntType=1013;THREE.UnsignedIntType=1014;THREE.FloatType=1015;THREE.UnsignedShort4444Type=1016;THREE.UnsignedShort5551Type=1017;THREE.UnsignedShort565Type=1018;THREE.AlphaFormat=1019;THREE.RGBFormat=1020;THREE.RGBAFormat=1021;THREE.LuminanceFormat=1022;THREE.LuminanceAlphaFormat=1023;\nTHREE.RGB_S3TC_DXT1_Format=2001;THREE.RGBA_S3TC_DXT1_Format=2002;THREE.RGBA_S3TC_DXT3_Format=2003;THREE.RGBA_S3TC_DXT5_Format=2004;THREE.Color=function(a){return 3===arguments.length?this.setRGB(arguments[0],arguments[1],arguments[2]):this.set(a)};\nTHREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,set:function(a){a instanceof THREE.Color?this.copy(a):\"number\"===typeof a?this.setHex(a):\"string\"===typeof a&&this.setStyle(a);return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSL:function(a,b,c){if(0===b)this.r=this.g=this.b=c;else{var d=function(a,b,c){0>c&&(c+=1);1<c&&--c;return c<1/6?a+6*(b-a)*c:\n.5>c?b:c<2/3?a+6*(b-a)*(2/3-c):a};b=.5>=c?c*(1+b):c+b-c*b;c=2*c-b;this.r=d(c,b,a+1/3);this.g=d(c,b,a);this.b=d(c,b,a-1/3)}return this},setStyle:function(a){if(/^rgb\\((\\d+), ?(\\d+), ?(\\d+)\\)$/i.test(a))return a=/^rgb\\((\\d+), ?(\\d+), ?(\\d+)\\)$/i.exec(a),this.r=Math.min(255,parseInt(a[1],10))/255,this.g=Math.min(255,parseInt(a[2],10))/255,this.b=Math.min(255,parseInt(a[3],10))/255,this;if(/^rgb\\((\\d+)\\%, ?(\\d+)\\%, ?(\\d+)\\%\\)$/i.test(a))return a=/^rgb\\((\\d+)\\%, ?(\\d+)\\%, ?(\\d+)\\%\\)$/i.exec(a),this.r=\nMath.min(100,parseInt(a[1],10))/100,this.g=Math.min(100,parseInt(a[2],10))/100,this.b=Math.min(100,parseInt(a[3],10))/100,this;if(/^\\#([0-9a-f]{6})$/i.test(a))return a=/^\\#([0-9a-f]{6})$/i.exec(a),this.setHex(parseInt(a[1],16)),this;if(/^\\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.test(a))return a=/^\\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(a),this.setHex(parseInt(a[1]+a[1]+a[2]+a[2]+a[3]+a[3],16)),this;if(/^(\\w+)$/i.test(a))return this.setHex(THREE.ColorKeywords[a]),this},copy:function(a){this.r=a.r;this.g=\na.g;this.b=a.b;return this},copyGammaToLinear:function(a){this.r=a.r*a.r;this.g=a.g*a.g;this.b=a.b*a.b;return this},copyLinearToGamma:function(a){this.r=Math.sqrt(a.r);this.g=Math.sqrt(a.g);this.b=Math.sqrt(a.b);return this},convertGammaToLinear:function(){var a=this.r,b=this.g,c=this.b;this.r=a*a;this.g=b*b;this.b=c*c;return this},convertLinearToGamma:function(){this.r=Math.sqrt(this.r);this.g=Math.sqrt(this.g);this.b=Math.sqrt(this.b);return this},getHex:function(){return 255*this.r<<16^255*this.g<<\n8^255*this.b<<0},getHexString:function(){return(\"000000\"+this.getHex().toString(16)).slice(-6)},getHSL:function(a){a=a||{h:0,s:0,l:0};var b=this.r,c=this.g,d=this.b,e=Math.max(b,c,d),f=Math.min(b,c,d),g,h=(f+e)/2;if(f===e)f=g=0;else{var k=e-f,f=.5>=h?k/(e+f):k/(2-e-f);switch(e){case b:g=(c-d)/k+(c<d?6:0);break;case c:g=(d-b)/k+2;break;case d:g=(b-c)/k+4}g/=6}a.h=g;a.s=f;a.l=h;return a},getStyle:function(){return\"rgb(\"+(255*this.r|0)+\",\"+(255*this.g|0)+\",\"+(255*this.b|0)+\")\"},offsetHSL:function(a,\nb,c){var d=this.getHSL();d.h+=a;d.s+=b;d.l+=c;this.setHSL(d.h,d.s,d.l);return this},add:function(a){this.r+=a.r;this.g+=a.g;this.b+=a.b;return this},addColors:function(a,b){this.r=a.r+b.r;this.g=a.g+b.g;this.b=a.b+b.b;return this},addScalar:function(a){this.r+=a;this.g+=a;this.b+=a;return this},multiply:function(a){this.r*=a.r;this.g*=a.g;this.b*=a.b;return this},multiplyScalar:function(a){this.r*=a;this.g*=a;this.b*=a;return this},lerp:function(a,b){this.r+=(a.r-this.r)*b;this.g+=(a.g-this.g)*b;\nthis.b+=(a.b-this.b)*b;return this},equals:function(a){return a.r===this.r&&a.g===this.g&&a.b===this.b},fromArray:function(a){this.r=a[0];this.g=a[1];this.b=a[2];return this},toArray:function(){return[this.r,this.g,this.b]},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};\nTHREE.ColorKeywords={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,\ndarkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,\ngrey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,\nlime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,\npalegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,\ntomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};THREE.Quaternion=function(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._w=void 0!==d?d:1};\nTHREE.Quaternion.prototype={constructor:THREE.Quaternion,_x:0,_y:0,_z:0,_w:0,get x(){return this._x},set x(a){this._x=a;this.onChangeCallback()},get y(){return this._y},set y(a){this._y=a;this.onChangeCallback()},get z(){return this._z},set z(a){this._z=a;this.onChangeCallback()},get w(){return this._w},set w(a){this._w=a;this.onChangeCallback()},set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._w=d;this.onChangeCallback();return this},copy:function(a){this._x=a.x;this._y=a.y;this._z=a.z;\nthis._w=a.w;this.onChangeCallback();return this},setFromEuler:function(a,b){if(!1===a instanceof THREE.Euler)throw Error(\"THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.\");var c=Math.cos(a._x/2),d=Math.cos(a._y/2),e=Math.cos(a._z/2),f=Math.sin(a._x/2),g=Math.sin(a._y/2),h=Math.sin(a._z/2);\"XYZ\"===a.order?(this._x=f*d*e+c*g*h,this._y=c*g*e-f*d*h,this._z=c*d*h+f*g*e,this._w=c*d*e-f*g*h):\"YXZ\"===a.order?(this._x=f*d*e+c*g*h,this._y=c*g*e-f*d*h,this._z=\nc*d*h-f*g*e,this._w=c*d*e+f*g*h):\"ZXY\"===a.order?(this._x=f*d*e-c*g*h,this._y=c*g*e+f*d*h,this._z=c*d*h+f*g*e,this._w=c*d*e-f*g*h):\"ZYX\"===a.order?(this._x=f*d*e-c*g*h,this._y=c*g*e+f*d*h,this._z=c*d*h-f*g*e,this._w=c*d*e+f*g*h):\"YZX\"===a.order?(this._x=f*d*e+c*g*h,this._y=c*g*e+f*d*h,this._z=c*d*h-f*g*e,this._w=c*d*e-f*g*h):\"XZY\"===a.order&&(this._x=f*d*e-c*g*h,this._y=c*g*e-f*d*h,this._z=c*d*h+f*g*e,this._w=c*d*e+f*g*h);if(!1!==b)this.onChangeCallback();return this},setFromAxisAngle:function(a,\nb){var c=b/2,d=Math.sin(c);this._x=a.x*d;this._y=a.y*d;this._z=a.z*d;this._w=Math.cos(c);this.onChangeCallback();return this},setFromRotationMatrix:function(a){var b=a.elements,c=b[0];a=b[4];var d=b[8],e=b[1],f=b[5],g=b[9],h=b[2],k=b[6],b=b[10],l=c+f+b;0<l?(c=.5/Math.sqrt(l+1),this._w=.25/c,this._x=(k-g)*c,this._y=(d-h)*c,this._z=(e-a)*c):c>f&&c>b?(c=2*Math.sqrt(1+c-f-b),this._w=(k-g)/c,this._x=.25*c,this._y=(a+e)/c,this._z=(d+h)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this._w=(d-h)/c,this._x=(a+e)/c,this._y=\n.25*c,this._z=(g+k)/c):(c=2*Math.sqrt(1+b-c-f),this._w=(e-a)/c,this._x=(d+h)/c,this._y=(g+k)/c,this._z=.25*c);this.onChangeCallback();return this},setFromUnitVectors:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector3);b=c.dot(d)+1;1E-6>b?(b=0,Math.abs(c.x)>Math.abs(c.z)?a.set(-c.y,c.x,0):a.set(0,-c.z,c.y)):a.crossVectors(c,d);this._x=a.x;this._y=a.y;this._z=a.z;this._w=b;this.normalize();return this}}(),inverse:function(){this.conjugate().normalize();return this},conjugate:function(){this._x*=\n-1;this._y*=-1;this._z*=-1;this.onChangeCallback();return this},dot:function(a){return this._x*a._x+this._y*a._y+this._z*a._z+this._w*a._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var a=this.length();0===a?(this._z=this._y=this._x=0,this._w=1):(a=1/a,this._x*=a,this._y*=a,this._z*=a,this._w*=a);this.onChangeCallback();return this},\nmultiply:function(a,b){return void 0!==b?(console.warn(\"THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.\"),this.multiplyQuaternions(a,b)):this.multiplyQuaternions(this,a)},multiplyQuaternions:function(a,b){var c=a._x,d=a._y,e=a._z,f=a._w,g=b._x,h=b._y,k=b._z,l=b._w;this._x=c*l+f*g+d*k-e*h;this._y=d*l+f*h+e*g-c*k;this._z=e*l+f*k+c*h-d*g;this._w=f*l-c*g-d*h-e*k;this.onChangeCallback();return this},multiplyVector3:function(a){console.warn(\"THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.\");\nreturn a.applyQuaternion(this)},slerp:function(a,b){var c=this._x,d=this._y,e=this._z,f=this._w,g=f*a._w+c*a._x+d*a._y+e*a._z;0>g?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,g=-g):this.copy(a);if(1<=g)return this._w=f,this._x=c,this._y=d,this._z=e,this;var h=Math.acos(g),k=Math.sqrt(1-g*g);if(.001>Math.abs(k))return this._w=.5*(f+this._w),this._x=.5*(c+this._x),this._y=.5*(d+this._y),this._z=.5*(e+this._z),this;g=Math.sin((1-b)*h)/k;h=Math.sin(b*h)/k;this._w=f*g+this._w*h;this._x=c*g+\nthis._x*h;this._y=d*g+this._y*h;this._z=e*g+this._z*h;this.onChangeCallback();return this},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._w===this._w},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];this._w=a[3];this.onChangeCallback();return this},toArray:function(){return[this._x,this._y,this._z,this._w]},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){},clone:function(){return new THREE.Quaternion(this._x,this._y,\nthis._z,this._w)}};THREE.Quaternion.slerp=function(a,b,c,d){return c.copy(a).slerp(b,d)};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0};\nTHREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw Error(\"index is out of range: \"+a);}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;default:throw Error(\"index is out of range: \"+a);}},copy:function(a){this.x=a.x;this.y=a.y;return this},add:function(a,\nb){if(void 0!==b)return console.warn(\"THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.\"),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addScalar:function(a){this.x+=a;this.y+=a;return this},sub:function(a,b){if(void 0!==b)return console.warn(\"THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.\"),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;return this},\nsubVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},multiply:function(a){this.x*=a.x;this.y*=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},divide:function(a){this.x/=a.x;this.y/=a.y;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a):this.y=this.x=0;return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);return this},max:function(a){this.x<a.x&&(this.x=a.x);this.y<a.y&&(this.y=a.y);return this},clamp:function(a,\nb){this.x<a.x?this.x=a.x:this.x>b.x&&(this.x=b.x);this.y<a.y?this.y=a.y:this.y>b.y&&(this.y=b.y);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector2,b=new THREE.Vector2);a.set(c,c);b.set(d,d);return this.clamp(a,b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this},\nroundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);return this},negate:function(){this.x=-this.x;this.y=-this.y;return this},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=\nthis.x-a.x;a=this.y-a.y;return b*b+a*a},setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;return this},equals:function(a){return a.x===this.x&&a.y===this.y},fromArray:function(a){this.x=a[0];this.y=a[1];return this},toArray:function(){return[this.x,this.y]},clone:function(){return new THREE.Vector2(this.x,this.y)}};THREE.Vector3=function(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0};\nTHREE.Vector3.prototype={constructor:THREE.Vector3,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;default:throw Error(\"index is out of range: \"+a);}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error(\"index is out of range: \"+\na);}},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},add:function(a,b){if(void 0!==b)return console.warn(\"THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.\"),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},sub:function(a,b){if(void 0!==b)return console.warn(\"THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.\"),\nthis.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this},multiply:function(a,b){if(void 0!==b)return console.warn(\"THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.\"),this.multiplyVectors(a,b);this.x*=a.x;this.y*=a.y;this.z*=a.z;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;return this},multiplyVectors:function(a,b){this.x=a.x*b.x;this.y=\na.y*b.y;this.z=a.z*b.z;return this},applyEuler:function(){var a;return function(b){!1===b instanceof THREE.Euler&&console.error(\"THREE.Vector3: .applyEuler() now expects a Euler rotation rather than a Vector3 and order.\");void 0===a&&(a=new THREE.Quaternion);this.applyQuaternion(a.setFromEuler(b));return this}}(),applyAxisAngle:function(){var a;return function(b,c){void 0===a&&(a=new THREE.Quaternion);this.applyQuaternion(a.setFromAxisAngle(b,c));return this}}(),applyMatrix3:function(a){var b=this.x,\nc=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[3]*c+a[6]*d;this.y=a[1]*b+a[4]*c+a[7]*d;this.z=a[2]*b+a[5]*c+a[8]*d;return this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12];this.y=a[1]*b+a[5]*c+a[9]*d+a[13];this.z=a[2]*b+a[6]*c+a[10]*d+a[14];return this},applyProjection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;var e=1/(a[3]*b+a[7]*c+a[11]*d+a[15]);this.x=(a[0]*b+a[4]*c+a[8]*d+a[12])*e;this.y=(a[1]*b+a[5]*c+a[9]*d+a[13])*e;this.z=\n(a[2]*b+a[6]*c+a[10]*d+a[14])*e;return this},applyQuaternion:function(a){var b=this.x,c=this.y,d=this.z,e=a.x,f=a.y,g=a.z;a=a.w;var h=a*b+f*d-g*c,k=a*c+g*b-e*d,l=a*d+e*c-f*b,b=-e*b-f*c-g*d;this.x=h*a+b*-e+k*-g-l*-f;this.y=k*a+b*-f+l*-e-h*-g;this.z=l*a+b*-g+h*-f-k*-e;return this},transformDirection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d;this.y=a[1]*b+a[5]*c+a[9]*d;this.z=a[2]*b+a[6]*c+a[10]*d;this.normalize();return this},divide:function(a){this.x/=a.x;\nthis.y/=a.y;this.z/=a.z;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a,this.z*=a):this.z=this.y=this.x=0;return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);this.z>a.z&&(this.z=a.z);return this},max:function(a){this.x<a.x&&(this.x=a.x);this.y<a.y&&(this.y=a.y);this.z<a.z&&(this.z=a.z);return this},clamp:function(a,b){this.x<a.x?this.x=a.x:this.x>b.x&&(this.x=b.x);this.y<a.y?this.y=a.y:this.y>b.y&&(this.y=b.y);this.z<a.z?this.z=a.z:this.z>b.z&&(this.z=\nb.z);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector3,b=new THREE.Vector3);a.set(c,c,c);b.set(d,d,d);return this.clamp(a,b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this},roundToZero:function(){this.x=\n0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+\nMath.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;return this},cross:function(a,b){if(void 0!==b)return console.warn(\"THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.\"),this.crossVectors(a,b);var c=this.x,d=this.y,e=this.z;this.x=d*a.z-e*a.y;this.y=\ne*a.x-c*a.z;this.z=c*a.y-d*a.x;return this},crossVectors:function(a,b){var c=a.x,d=a.y,e=a.z,f=b.x,g=b.y,h=b.z;this.x=d*h-e*g;this.y=e*f-c*h;this.z=c*g-d*f;return this},projectOnVector:function(){var a,b;return function(c){void 0===a&&(a=new THREE.Vector3);a.copy(c).normalize();b=this.dot(a);return this.copy(a).multiplyScalar(b)}}(),projectOnPlane:function(){var a;return function(b){void 0===a&&(a=new THREE.Vector3);a.copy(this).projectOnVector(b);return this.sub(a)}}(),reflect:function(){var a;return function(b){void 0===\na&&(a=new THREE.Vector3);return this.sub(a.copy(b).multiplyScalar(2*this.dot(b)))}}(),angleTo:function(a){a=this.dot(a)/(this.length()*a.length());return Math.acos(THREE.Math.clamp(a,-1,1))},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;a=this.z-a.z;return b*b+c*c+a*a},setEulerFromRotationMatrix:function(a,b){console.error(\"THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.\")},\nsetEulerFromQuaternion:function(a,b){console.error(\"THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.\")},getPositionFromMatrix:function(a){console.warn(\"THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().\");return this.setFromMatrixPosition(a)},getScaleFromMatrix:function(a){console.warn(\"THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().\");return this.setFromMatrixScale(a)},getColumnFromMatrix:function(a,\nb){console.warn(\"THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().\");return this.setFromMatrixColumn(a,b)},setFromMatrixPosition:function(a){this.x=a.elements[12];this.y=a.elements[13];this.z=a.elements[14];return this},setFromMatrixScale:function(a){var b=this.set(a.elements[0],a.elements[1],a.elements[2]).length(),c=this.set(a.elements[4],a.elements[5],a.elements[6]).length();a=this.set(a.elements[8],a.elements[9],a.elements[10]).length();this.x=b;this.y=c;this.z=\na;return this},setFromMatrixColumn:function(a,b){var c=4*a,d=b.elements;this.x=d[c];this.y=d[c+1];this.z=d[c+2];return this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},fromArray:function(a){this.x=a[0];this.y=a[1];this.z=a[2];return this},toArray:function(){return[this.x,this.y,this.z]},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};THREE.Vector4=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=void 0!==d?d:1};\nTHREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setW:function(a){this.w=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;case 3:this.w=b;break;default:throw Error(\"index is out of range: \"+a);}},getComponent:function(a){switch(a){case 0:return this.x;\ncase 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error(\"index is out of range: \"+a);}},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=void 0!==a.w?a.w:1;return this},add:function(a,b){if(void 0!==b)return console.warn(\"THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.\"),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;this.w+=a;return this},\naddVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},sub:function(a,b){if(void 0!==b)return console.warn(\"THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.\"),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;this.w=a.w-b.w;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},applyMatrix4:function(a){var b=\nthis.x,c=this.y,d=this.z,e=this.w;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12]*e;this.y=a[1]*b+a[5]*c+a[9]*d+a[13]*e;this.z=a[2]*b+a[6]*c+a[10]*d+a[14]*e;this.w=a[3]*b+a[7]*c+a[11]*d+a[15]*e;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a):(this.z=this.y=this.x=0,this.w=1);return this},setAxisAngleFromQuaternion:function(a){this.w=2*Math.acos(a.w);var b=Math.sqrt(1-a.w*a.w);1E-4>b?(this.x=1,this.z=this.y=0):(this.x=a.x/b,this.y=a.y/b,this.z=a.z/b);return this},\nsetAxisAngleFromRotationMatrix:function(a){var b,c,d;a=a.elements;var e=a[0];d=a[4];var f=a[8],g=a[1],h=a[5],k=a[9];c=a[2];b=a[6];var l=a[10];if(.01>Math.abs(d-g)&&.01>Math.abs(f-c)&&.01>Math.abs(k-b)){if(.1>Math.abs(d+g)&&.1>Math.abs(f+c)&&.1>Math.abs(k+b)&&.1>Math.abs(e+h+l-3))return this.set(1,0,0,0),this;a=Math.PI;e=(e+1)/2;h=(h+1)/2;l=(l+1)/2;d=(d+g)/4;f=(f+c)/4;k=(k+b)/4;e>h&&e>l?.01>e?(b=0,d=c=.707106781):(b=Math.sqrt(e),c=d/b,d=f/b):h>l?.01>h?(b=.707106781,c=0,d=.707106781):(c=Math.sqrt(h),\nb=d/c,d=k/c):.01>l?(c=b=.707106781,d=0):(d=Math.sqrt(l),b=f/d,c=k/d);this.set(b,c,d,a);return this}a=Math.sqrt((b-k)*(b-k)+(f-c)*(f-c)+(g-d)*(g-d));.001>Math.abs(a)&&(a=1);this.x=(b-k)/a;this.y=(f-c)/a;this.z=(g-d)/a;this.w=Math.acos((e+h+l-1)/2);return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);this.z>a.z&&(this.z=a.z);this.w>a.w&&(this.w=a.w);return this},max:function(a){this.x<a.x&&(this.x=a.x);this.y<a.y&&(this.y=a.y);this.z<a.z&&(this.z=a.z);this.w<a.w&&(this.w=a.w);\nreturn this},clamp:function(a,b){this.x<a.x?this.x=a.x:this.x>b.x&&(this.x=b.x);this.y<a.y?this.y=a.y:this.y>b.y&&(this.y=b.y);this.z<a.z?this.z=a.z:this.z>b.z&&(this.z=b.z);this.w<a.w?this.w=a.w:this.w>b.w&&(this.w=b.w);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector4,b=new THREE.Vector4);a.set(c,c,c,c);b.set(d,d,d,d);return this.clamp(a,b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);this.w=Math.floor(this.w);\nreturn this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);this.w=Math.ceil(this.w);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);this.w=0>this.w?Math.ceil(this.w):Math.floor(this.w);\nreturn this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w=-this.w;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())},\nsetLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},fromArray:function(a){this.x=a[0];this.y=a[1];this.z=a[2];this.w=a[3];return this},toArray:function(){return[this.x,this.y,this.z,this.w]},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,\nthis.w)}};THREE.Euler=function(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._order=d||THREE.Euler.DefaultOrder};THREE.Euler.RotationOrders=\"XYZ YZX ZXY XZY YXZ ZYX\".split(\" \");THREE.Euler.DefaultOrder=\"XYZ\";\nTHREE.Euler.prototype={constructor:THREE.Euler,_x:0,_y:0,_z:0,_order:THREE.Euler.DefaultOrder,get x(){return this._x},set x(a){this._x=a;this.onChangeCallback()},get y(){return this._y},set y(a){this._y=a;this.onChangeCallback()},get z(){return this._z},set z(a){this._z=a;this.onChangeCallback()},get order(){return this._order},set order(a){this._order=a;this.onChangeCallback()},set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._order=d||this._order;this.onChangeCallback();return this},copy:function(a){this._x=\na._x;this._y=a._y;this._z=a._z;this._order=a._order;this.onChangeCallback();return this},setFromRotationMatrix:function(a,b){var c=THREE.Math.clamp,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[1],k=d[5],l=d[9],n=d[2],q=d[6],d=d[10];b=b||this._order;\"XYZ\"===b?(this._y=Math.asin(c(g,-1,1)),.99999>Math.abs(g)?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-f,e)):(this._x=Math.atan2(q,k),this._z=0)):\"YXZ\"===b?(this._x=Math.asin(-c(l,-1,1)),.99999>Math.abs(l)?(this._y=Math.atan2(g,d),this._z=Math.atan2(h,k)):(this._y=\nMath.atan2(-n,e),this._z=0)):\"ZXY\"===b?(this._x=Math.asin(c(q,-1,1)),.99999>Math.abs(q)?(this._y=Math.atan2(-n,d),this._z=Math.atan2(-f,k)):(this._y=0,this._z=Math.atan2(h,e))):\"ZYX\"===b?(this._y=Math.asin(-c(n,-1,1)),.99999>Math.abs(n)?(this._x=Math.atan2(q,d),this._z=Math.atan2(h,e)):(this._x=0,this._z=Math.atan2(-f,k))):\"YZX\"===b?(this._z=Math.asin(c(h,-1,1)),.99999>Math.abs(h)?(this._x=Math.atan2(-l,k),this._y=Math.atan2(-n,e)):(this._x=0,this._y=Math.atan2(g,d))):\"XZY\"===b?(this._z=Math.asin(-c(f,\n-1,1)),.99999>Math.abs(f)?(this._x=Math.atan2(q,k),this._y=Math.atan2(g,e)):(this._x=Math.atan2(-l,d),this._y=0)):console.warn(\"THREE.Euler: .setFromRotationMatrix() given unsupported order: \"+b);this._order=b;this.onChangeCallback();return this},setFromQuaternion:function(a,b,c){var d=THREE.Math.clamp,e=a.x*a.x,f=a.y*a.y,g=a.z*a.z,h=a.w*a.w;b=b||this._order;\"XYZ\"===b?(this._x=Math.atan2(2*(a.x*a.w-a.y*a.z),h-e-f+g),this._y=Math.asin(d(2*(a.x*a.z+a.y*a.w),-1,1)),this._z=Math.atan2(2*(a.z*a.w-a.x*\na.y),h+e-f-g)):\"YXZ\"===b?(this._x=Math.asin(d(2*(a.x*a.w-a.y*a.z),-1,1)),this._y=Math.atan2(2*(a.x*a.z+a.y*a.w),h-e-f+g),this._z=Math.atan2(2*(a.x*a.y+a.z*a.w),h-e+f-g)):\"ZXY\"===b?(this._x=Math.asin(d(2*(a.x*a.w+a.y*a.z),-1,1)),this._y=Math.atan2(2*(a.y*a.w-a.z*a.x),h-e-f+g),this._z=Math.atan2(2*(a.z*a.w-a.x*a.y),h-e+f-g)):\"ZYX\"===b?(this._x=Math.atan2(2*(a.x*a.w+a.z*a.y),h-e-f+g),this._y=Math.asin(d(2*(a.y*a.w-a.x*a.z),-1,1)),this._z=Math.atan2(2*(a.x*a.y+a.z*a.w),h+e-f-g)):\"YZX\"===b?(this._x=Math.atan2(2*\n(a.x*a.w-a.z*a.y),h-e+f-g),this._y=Math.atan2(2*(a.y*a.w-a.x*a.z),h+e-f-g),this._z=Math.asin(d(2*(a.x*a.y+a.z*a.w),-1,1))):\"XZY\"===b?(this._x=Math.atan2(2*(a.x*a.w+a.y*a.z),h-e+f-g),this._y=Math.atan2(2*(a.x*a.z+a.y*a.w),h+e-f-g),this._z=Math.asin(d(2*(a.z*a.w-a.x*a.y),-1,1))):console.warn(\"THREE.Euler: .setFromQuaternion() given unsupported order: \"+b);this._order=b;if(!1!==c)this.onChangeCallback();return this},reorder:function(){var a=new THREE.Quaternion;return function(b){a.setFromEuler(this);\nthis.setFromQuaternion(a,b)}}(),equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];void 0!==a[3]&&(this._order=a[3]);this.onChangeCallback();return this},toArray:function(){return[this._x,this._y,this._z,this._order]},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){},clone:function(){return new THREE.Euler(this._x,this._y,this._z,this._order)}};\nTHREE.Line3=function(a,b){this.start=void 0!==a?a:new THREE.Vector3;this.end=void 0!==b?b:new THREE.Vector3};\nTHREE.Line3.prototype={constructor:THREE.Line3,set:function(a,b){this.start.copy(a);this.end.copy(b);return this},copy:function(a){this.start.copy(a.start);this.end.copy(a.end);return this},center:function(a){return(a||new THREE.Vector3).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(a){return(a||new THREE.Vector3).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(a,\nb){var c=b||new THREE.Vector3;return this.delta(c).multiplyScalar(a).add(this.start)},closestPointToPointParameter:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d){a.subVectors(c,this.start);b.subVectors(this.end,this.start);var e=b.dot(b),e=b.dot(a)/e;d&&(e=THREE.Math.clamp(e,0,1));return e}}(),closestPointToPoint:function(a,b,c){a=this.closestPointToPointParameter(a,b);c=c||new THREE.Vector3;return this.delta(c).multiplyScalar(a).add(this.start)},applyMatrix4:function(a){this.start.applyMatrix4(a);\nthis.end.applyMatrix4(a);return this},equals:function(a){return a.start.equals(this.start)&&a.end.equals(this.end)},clone:function(){return(new THREE.Line3).copy(this)}};THREE.Box2=function(a,b){this.min=void 0!==a?a:new THREE.Vector2(Infinity,Infinity);this.max=void 0!==b?b:new THREE.Vector2(-Infinity,-Infinity)};\nTHREE.Box2.prototype={constructor:THREE.Box2,set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;b<c;b++)this.expandByPoint(a[b]);return this},setFromCenterAndSize:function(){var a=new THREE.Vector2;return function(b,c){var d=a.copy(c).multiplyScalar(.5);this.min.copy(b).sub(d);this.max.copy(b).add(d);return this}}(),copy:function(a){this.min.copy(a.min);this.max.copy(a.max);return this},makeEmpty:function(){this.min.x=\nthis.min.y=Infinity;this.max.x=this.max.y=-Infinity;return this},empty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},center:function(a){return(a||new THREE.Vector2).addVectors(this.min,this.max).multiplyScalar(.5)},size:function(a){return(a||new THREE.Vector2).subVectors(this.max,this.min)},expandByPoint:function(a){this.min.min(a);this.max.max(a);return this},expandByVector:function(a){this.min.sub(a);this.max.add(a);return this},expandByScalar:function(a){this.min.addScalar(-a);\nthis.max.addScalar(a);return this},containsPoint:function(a){return a.x<this.min.x||a.x>this.max.x||a.y<this.min.y||a.y>this.max.y?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y?!0:!1},getParameter:function(a,b){return(b||new THREE.Vector2).set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y))},isIntersectionBox:function(a){return a.max.x<this.min.x||a.min.x>this.max.x||a.max.y<this.min.y||a.min.y>\nthis.max.y?!1:!0},clampPoint:function(a,b){return(b||new THREE.Vector2).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new THREE.Vector2;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&\na.max.equals(this.max)},clone:function(){return(new THREE.Box2).copy(this)}};THREE.Box3=function(a,b){this.min=void 0!==a?a:new THREE.Vector3(Infinity,Infinity,Infinity);this.max=void 0!==b?b:new THREE.Vector3(-Infinity,-Infinity,-Infinity)};\nTHREE.Box3.prototype={constructor:THREE.Box3,set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;b<c;b++)this.expandByPoint(a[b]);return this},setFromCenterAndSize:function(){var a=new THREE.Vector3;return function(b,c){var d=a.copy(c).multiplyScalar(.5);this.min.copy(b).sub(d);this.max.copy(b).add(d);return this}}(),setFromObject:function(){var a=new THREE.Vector3;return function(b){var c=this;b.updateMatrixWorld(!0);\nthis.makeEmpty();b.traverse(function(b){if(void 0!==b.geometry&&void 0!==b.geometry.vertices)for(var e=b.geometry.vertices,f=0,g=e.length;f<g;f++)a.copy(e[f]),a.applyMatrix4(b.matrixWorld),c.expandByPoint(a)});return this}}(),copy:function(a){this.min.copy(a.min);this.max.copy(a.max);return this},makeEmpty:function(){this.min.x=this.min.y=this.min.z=Infinity;this.max.x=this.max.y=this.max.z=-Infinity;return this},empty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},\ncenter:function(a){return(a||new THREE.Vector3).addVectors(this.min,this.max).multiplyScalar(.5)},size:function(a){return(a||new THREE.Vector3).subVectors(this.max,this.min)},expandByPoint:function(a){this.min.min(a);this.max.max(a);return this},expandByVector:function(a){this.min.sub(a);this.max.add(a);return this},expandByScalar:function(a){this.min.addScalar(-a);this.max.addScalar(a);return this},containsPoint:function(a){return a.x<this.min.x||a.x>this.max.x||a.y<this.min.y||a.y>this.max.y||a.z<\nthis.min.z||a.z>this.max.z?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y&&this.min.z<=a.min.z&&a.max.z<=this.max.z?!0:!1},getParameter:function(a,b){return(b||new THREE.Vector3).set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y),(a.z-this.min.z)/(this.max.z-this.min.z))},isIntersectionBox:function(a){return a.max.x<this.min.x||a.min.x>this.max.x||a.max.y<this.min.y||a.min.y>this.max.y||a.max.z<\nthis.min.z||a.min.z>this.max.z?!1:!0},clampPoint:function(a,b){return(b||new THREE.Vector3).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),getBoundingSphere:function(){var a=new THREE.Vector3;return function(b){b=b||new THREE.Sphere;b.center=this.center();b.radius=.5*this.size(a).length();return b}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);return this},union:function(a){this.min.min(a.min);\nthis.max.max(a.max);return this},applyMatrix4:function(){var a=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];return function(b){a[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(b);a[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(b);a[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(b);a[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(b);a[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(b);\na[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(b);a[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(b);a[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(b);this.makeEmpty();this.setFromPoints(a);return this}}(),translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)},clone:function(){return(new THREE.Box3).copy(this)}};\nTHREE.Matrix3=function(a,b,c,d,e,f,g,h,k){var l=this.elements=new Float32Array(9);l[0]=void 0!==a?a:1;l[3]=b||0;l[6]=c||0;l[1]=d||0;l[4]=void 0!==e?e:1;l[7]=f||0;l[2]=g||0;l[5]=h||0;l[8]=void 0!==k?k:1};\nTHREE.Matrix3.prototype={constructor:THREE.Matrix3,set:function(a,b,c,d,e,f,g,h,k){var l=this.elements;l[0]=a;l[3]=b;l[6]=c;l[1]=d;l[4]=e;l[7]=f;l[2]=g;l[5]=h;l[8]=k;return this},identity:function(){this.set(1,0,0,0,1,0,0,0,1);return this},copy:function(a){a=a.elements;this.set(a[0],a[3],a[6],a[1],a[4],a[7],a[2],a[5],a[8]);return this},multiplyVector3:function(a){console.warn(\"THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.\");return a.applyMatrix3(this)},\nmultiplyVector3Array:function(a){console.warn(\"THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.\");return this.applyToVector3Array(a)},applyToVector3Array:function(){var a=new THREE.Vector3;return function(b,c,d){void 0===c&&(c=0);void 0===d&&(d=b.length);for(var e=0;e<d;e+=3,c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyMatrix3(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[3]*=a;b[6]*=\na;b[1]*=a;b[4]*=a;b[7]*=a;b[2]*=a;b[5]*=a;b[8]*=a;return this},determinant:function(){var a=this.elements,b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],g=a[5],h=a[6],k=a[7],a=a[8];return b*f*a-b*g*k-c*e*a+c*g*h+d*e*k-d*f*h},getInverse:function(a,b){var c=a.elements,d=this.elements;d[0]=c[10]*c[5]-c[6]*c[9];d[1]=-c[10]*c[1]+c[2]*c[9];d[2]=c[6]*c[1]-c[2]*c[5];d[3]=-c[10]*c[4]+c[6]*c[8];d[4]=c[10]*c[0]-c[2]*c[8];d[5]=-c[6]*c[0]+c[2]*c[4];d[6]=c[9]*c[4]-c[5]*c[8];d[7]=-c[9]*c[0]+c[1]*c[8];d[8]=c[5]*c[0]-c[1]*c[4];\nc=c[0]*d[0]+c[1]*d[3]+c[2]*d[6];if(0===c){if(b)throw Error(\"Matrix3.getInverse(): can't invert matrix, determinant is 0\");console.warn(\"Matrix3.getInverse(): can't invert matrix, determinant is 0\");this.identity();return this}this.multiplyScalar(1/c);return this},transpose:function(){var a,b=this.elements;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},flattenToArrayOffset:function(a,b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];\na[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];return a},getNormalMatrix:function(a){this.getInverse(a).transpose();return this},transposeIntoArray:function(a){var b=this.elements;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this},fromArray:function(a){this.elements.set(a);return this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8]]},clone:function(){var a=this.elements;return new THREE.Matrix3(a[0],a[3],\na[6],a[1],a[4],a[7],a[2],a[5],a[8])}};THREE.Matrix4=function(a,b,c,d,e,f,g,h,k,l,n,q,r,t,s,p){var v=this.elements=new Float32Array(16);v[0]=void 0!==a?a:1;v[4]=b||0;v[8]=c||0;v[12]=d||0;v[1]=e||0;v[5]=void 0!==f?f:1;v[9]=g||0;v[13]=h||0;v[2]=k||0;v[6]=l||0;v[10]=void 0!==n?n:1;v[14]=q||0;v[3]=r||0;v[7]=t||0;v[11]=s||0;v[15]=void 0!==p?p:1};\nTHREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,f,g,h,k,l,n,q,r,t,s,p){var v=this.elements;v[0]=a;v[4]=b;v[8]=c;v[12]=d;v[1]=e;v[5]=f;v[9]=g;v[13]=h;v[2]=k;v[6]=l;v[10]=n;v[14]=q;v[3]=r;v[7]=t;v[11]=s;v[15]=p;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.elements.set(a.elements);return this},extractPosition:function(a){console.warn(\"THREEMatrix4: .extractPosition() has been renamed to .copyPosition().\");return this.copyPosition(a)},\ncopyPosition:function(a){var b=this.elements;a=a.elements;b[12]=a[12];b[13]=a[13];b[14]=a[14];return this},extractRotation:function(){var a=new THREE.Vector3;return function(b){var c=this.elements;b=b.elements;var d=1/a.set(b[0],b[1],b[2]).length(),e=1/a.set(b[4],b[5],b[6]).length(),f=1/a.set(b[8],b[9],b[10]).length();c[0]=b[0]*d;c[1]=b[1]*d;c[2]=b[2]*d;c[4]=b[4]*e;c[5]=b[5]*e;c[6]=b[6]*e;c[8]=b[8]*f;c[9]=b[9]*f;c[10]=b[10]*f;return this}}(),makeRotationFromEuler:function(a){!1===a instanceof THREE.Euler&&\nconsole.error(\"THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.\");var b=this.elements,c=a.x,d=a.y,e=a.z,f=Math.cos(c),c=Math.sin(c),g=Math.cos(d),d=Math.sin(d),h=Math.cos(e),e=Math.sin(e);if(\"XYZ\"===a.order){a=f*h;var k=f*e,l=c*h,n=c*e;b[0]=g*h;b[4]=-g*e;b[8]=d;b[1]=k+l*d;b[5]=a-n*d;b[9]=-c*g;b[2]=n-a*d;b[6]=l+k*d;b[10]=f*g}else\"YXZ\"===a.order?(a=g*h,k=g*e,l=d*h,n=d*e,b[0]=a+n*c,b[4]=l*c-k,b[8]=f*d,b[1]=f*e,b[5]=f*h,b[9]=-c,b[2]=k*c-l,b[6]=n+a*c,\nb[10]=f*g):\"ZXY\"===a.order?(a=g*h,k=g*e,l=d*h,n=d*e,b[0]=a-n*c,b[4]=-f*e,b[8]=l+k*c,b[1]=k+l*c,b[5]=f*h,b[9]=n-a*c,b[2]=-f*d,b[6]=c,b[10]=f*g):\"ZYX\"===a.order?(a=f*h,k=f*e,l=c*h,n=c*e,b[0]=g*h,b[4]=l*d-k,b[8]=a*d+n,b[1]=g*e,b[5]=n*d+a,b[9]=k*d-l,b[2]=-d,b[6]=c*g,b[10]=f*g):\"YZX\"===a.order?(a=f*g,k=f*d,l=c*g,n=c*d,b[0]=g*h,b[4]=n-a*e,b[8]=l*e+k,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+l,b[10]=a-n*e):\"XZY\"===a.order&&(a=f*g,k=f*d,l=c*g,n=c*d,b[0]=g*h,b[4]=-e,b[8]=d*h,b[1]=a*e+n,b[5]=f*h,b[9]=k*\ne-l,b[2]=l*e-k,b[6]=c*h,b[10]=n*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},setRotationFromQuaternion:function(a){console.warn(\"THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().\");return this.makeRotationFromQuaternion(a)},makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,g=c+c,h=d+d,k=e+e;a=c*g;var l=c*h,c=c*k,n=d*h,d=d*k,e=e*k,g=f*g,h=f*h,f=f*k;b[0]=1-(n+e);b[4]=l-f;b[8]=c+h;b[1]=l+f;b[5]=1-\n(a+e);b[9]=d-g;b[2]=c-h;b[6]=d+g;b[10]=1-(a+n);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f){var g=this.elements;c.subVectors(d,e).normalize();0===c.length()&&(c.z=1);a.crossVectors(f,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(f,c).normalize());b.crossVectors(c,a);g[0]=a.x;g[4]=b.x;g[8]=c.x;g[1]=a.y;g[5]=b.y;g[9]=c.y;g[2]=a.z;g[6]=b.z;g[10]=c.z;return this}}(),\nmultiply:function(a,b){return void 0!==b?(console.warn(\"THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.\"),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],k=c[12],l=c[1],n=c[5],q=c[9],r=c[13],t=c[2],s=c[6],p=c[10],v=c[14],w=c[3],u=c[7],D=c[11],c=c[15],A=d[0],x=d[4],C=d[8],I=d[12],z=d[1],y=d[5],K=d[9],N=d[13],ba=d[2],P=d[6],O=d[10],J=d[14],E=d[3],\nQ=d[7],L=d[11],d=d[15];e[0]=f*A+g*z+h*ba+k*E;e[4]=f*x+g*y+h*P+k*Q;e[8]=f*C+g*K+h*O+k*L;e[12]=f*I+g*N+h*J+k*d;e[1]=l*A+n*z+q*ba+r*E;e[5]=l*x+n*y+q*P+r*Q;e[9]=l*C+n*K+q*O+r*L;e[13]=l*I+n*N+q*J+r*d;e[2]=t*A+s*z+p*ba+v*E;e[6]=t*x+s*y+p*P+v*Q;e[10]=t*C+s*K+p*O+v*L;e[14]=t*I+s*N+p*J+v*d;e[3]=w*A+u*z+D*ba+c*E;e[7]=w*x+u*y+D*P+c*Q;e[11]=w*C+u*K+D*O+c*L;e[15]=w*I+u*N+D*J+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];\nc[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},multiplyVector3:function(a){console.warn(\"THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.\");\nreturn a.applyProjection(this)},multiplyVector4:function(a){console.warn(\"THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.\");return a.applyMatrix4(this)},multiplyVector3Array:function(a){console.warn(\"THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.\");return this.applyToVector3Array(a)},applyToVector3Array:function(){var a=new THREE.Vector3;return function(b,c,d){void 0===c&&(c=0);void 0===d&&(d=\nb.length);for(var e=0;e<d;e+=3,c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyMatrix4(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),rotateAxis:function(a){console.warn(\"THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.\");a.transformDirection(this)},crossVector:function(a){console.warn(\"THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.\");return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=\na[0],c=a[4],d=a[8],e=a[12],f=a[1],g=a[5],h=a[9],k=a[13],l=a[2],n=a[6],q=a[10],r=a[14];return a[3]*(+e*h*n-d*k*n-e*g*q+c*k*q+d*g*r-c*h*r)+a[7]*(+b*h*r-b*k*q+e*f*q-d*f*r+d*k*l-e*h*l)+a[11]*(+b*k*n-b*g*r-e*f*n+c*f*r+e*g*l-c*k*l)+a[15]*(-d*g*l-b*h*n+b*g*q+d*f*n-c*f*q+c*h*l)},transpose:function(){var a=this.elements,b;b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];a[13]=b;b=a[11];a[11]=a[14];a[14]=b;return this},flattenToArrayOffset:function(a,\nb){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a},getPosition:function(){var a=new THREE.Vector3;return function(){console.warn(\"THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.\");var b=this.elements;return a.set(b[12],b[13],b[14])}}(),setPosition:function(a){var b=\nthis.elements;b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getInverse:function(a,b){var c=this.elements,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[12],k=d[1],l=d[5],n=d[9],q=d[13],r=d[2],t=d[6],s=d[10],p=d[14],v=d[3],w=d[7],u=d[11],d=d[15];c[0]=n*p*w-q*s*w+q*t*u-l*p*u-n*t*d+l*s*d;c[4]=h*s*w-g*p*w-h*t*u+f*p*u+g*t*d-f*s*d;c[8]=g*q*w-h*n*w+h*l*u-f*q*u-g*l*d+f*n*d;c[12]=h*n*t-g*q*t-h*l*s+f*q*s+g*l*p-f*n*p;c[1]=q*s*v-n*p*v-q*r*u+k*p*u+n*r*d-k*s*d;c[5]=g*p*v-h*s*v+h*r*u-e*p*u-g*r*d+e*s*d;c[9]=h*n*v-g*q*v-h*k*\nu+e*q*u+g*k*d-e*n*d;c[13]=g*q*r-h*n*r+h*k*s-e*q*s-g*k*p+e*n*p;c[2]=l*p*v-q*t*v+q*r*w-k*p*w-l*r*d+k*t*d;c[6]=h*t*v-f*p*v-h*r*w+e*p*w+f*r*d-e*t*d;c[10]=f*q*v-h*l*v+h*k*w-e*q*w-f*k*d+e*l*d;c[14]=h*l*r-f*q*r-h*k*t+e*q*t+f*k*p-e*l*p;c[3]=n*t*v-l*s*v-n*r*w+k*s*w+l*r*u-k*t*u;c[7]=f*s*v-g*t*v+g*r*w-e*s*w-f*r*u+e*t*u;c[11]=g*l*v-f*n*v-g*k*w+e*n*w+f*k*u-e*l*u;c[15]=f*n*r-g*l*r+g*k*t-e*n*t-f*k*s+e*l*s;c=e*c[0]+k*c[4]+r*c[8]+v*c[12];if(0==c){if(b)throw Error(\"Matrix4.getInverse(): can't invert matrix, determinant is 0\");\nconsole.warn(\"Matrix4.getInverse(): can't invert matrix, determinant is 0\");this.identity();return this}this.multiplyScalar(1/c);return this},translate:function(a){console.warn(\"THREE.Matrix4: .translate() has been removed.\")},rotateX:function(a){console.warn(\"THREE.Matrix4: .rotateX() has been removed.\")},rotateY:function(a){console.warn(\"THREE.Matrix4: .rotateY() has been removed.\")},rotateZ:function(a){console.warn(\"THREE.Matrix4: .rotateZ() has been removed.\")},rotateByAxis:function(a,b){console.warn(\"THREE.Matrix4: .rotateByAxis() has been removed.\")},\nscale:function(a){var b=this.elements,c=a.x,d=a.y;a=a.z;b[0]*=c;b[4]*=d;b[8]*=a;b[1]*=c;b[5]*=d;b[9]*=a;b[2]*=c;b[6]*=d;b[10]*=a;b[3]*=c;b[7]*=d;b[11]*=a;return this},getMaxScaleOnAxis:function(){var a=this.elements;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1]+a[2]*a[2],Math.max(a[4]*a[4]+a[5]*a[5]+a[6]*a[6],a[8]*a[8]+a[9]*a[9]+a[10]*a[10])))},makeTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},makeRotationX:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(1,\n0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},makeRotationY:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},makeRotationZ:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1);return this},makeRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,f=a.x,g=a.y,h=a.z,k=e*f,l=e*g;this.set(k*f+c,k*g-d*h,k*h+d*g,0,k*g+d*h,l*g+c,l*h-d*f,0,k*h-d*g,l*h+d*f,e*h*h+c,0,0,0,0,1);return this},makeScale:function(a,b,c){this.set(a,\n0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},compose:function(a,b,c){this.makeRotationFromQuaternion(b);this.scale(c);this.setPosition(a);return this},decompose:function(){var a=new THREE.Vector3,b=new THREE.Matrix4;return function(c,d,e){var f=this.elements,g=a.set(f[0],f[1],f[2]).length(),h=a.set(f[4],f[5],f[6]).length(),k=a.set(f[8],f[9],f[10]).length();0>this.determinant()&&(g=-g);c.x=f[12];c.y=f[13];c.z=f[14];b.elements.set(this.elements);c=1/g;var f=1/h,l=1/k;b.elements[0]*=c;b.elements[1]*=\nc;b.elements[2]*=c;b.elements[4]*=f;b.elements[5]*=f;b.elements[6]*=f;b.elements[8]*=l;b.elements[9]*=l;b.elements[10]*=l;d.setFromRotationMatrix(b);e.x=g;e.y=h;e.z=k;return this}}(),makeFrustum:function(a,b,c,d,e,f){var g=this.elements;g[0]=2*e/(b-a);g[4]=0;g[8]=(b+a)/(b-a);g[12]=0;g[1]=0;g[5]=2*e/(d-c);g[9]=(d+c)/(d-c);g[13]=0;g[2]=0;g[6]=0;g[10]=-(f+e)/(f-e);g[14]=-2*f*e/(f-e);g[3]=0;g[7]=0;g[11]=-1;g[15]=0;return this},makePerspective:function(a,b,c,d){a=c*Math.tan(THREE.Math.degToRad(.5*a));\nvar e=-a;return this.makeFrustum(e*b,a*b,e,a,c,d)},makeOrthographic:function(a,b,c,d,e,f){var g=this.elements,h=b-a,k=c-d,l=f-e;g[0]=2/h;g[4]=0;g[8]=0;g[12]=-((b+a)/h);g[1]=0;g[5]=2/k;g[9]=0;g[13]=-((c+d)/k);g[2]=0;g[6]=0;g[10]=-2/l;g[14]=-((f+e)/l);g[3]=0;g[7]=0;g[11]=0;g[15]=1;return this},fromArray:function(a){this.elements.set(a);return this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15]]},clone:function(){var a=\nthis.elements;return new THREE.Matrix4(a[0],a[4],a[8],a[12],a[1],a[5],a[9],a[13],a[2],a[6],a[10],a[14],a[3],a[7],a[11],a[15])}};THREE.Ray=function(a,b){this.origin=void 0!==a?a:new THREE.Vector3;this.direction=void 0!==b?b:new THREE.Vector3};\nTHREE.Ray.prototype={constructor:THREE.Ray,set:function(a,b){this.origin.copy(a);this.direction.copy(b);return this},copy:function(a){this.origin.copy(a.origin);this.direction.copy(a.direction);return this},at:function(a,b){return(b||new THREE.Vector3).copy(this.direction).multiplyScalar(a).add(this.origin)},recast:function(){var a=new THREE.Vector3;return function(b){this.origin.copy(this.at(b,a));return this}}(),closestPointToPoint:function(a,b){var c=b||new THREE.Vector3;c.subVectors(a,this.origin);\nvar d=c.dot(this.direction);return 0>d?c.copy(this.origin):c.copy(this.direction).multiplyScalar(d).add(this.origin)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){var c=a.subVectors(b,this.origin).dot(this.direction);if(0>c)return this.origin.distanceTo(b);a.copy(this.direction).multiplyScalar(c).add(this.origin);return a.distanceTo(b)}}(),distanceSqToSegment:function(a,b,c,d){var e=a.clone().add(b).multiplyScalar(.5),f=b.clone().sub(a).normalize(),g=.5*a.distanceTo(b),h=\nthis.origin.clone().sub(e);a=-this.direction.dot(f);b=h.dot(this.direction);var k=-h.dot(f),l=h.lengthSq(),n=Math.abs(1-a*a),q,r;0<=n?(h=a*k-b,q=a*b-k,r=g*n,0<=h?q>=-r?q<=r?(g=1/n,h*=g,q*=g,a=h*(h+a*q+2*b)+q*(a*h+q+2*k)+l):(q=g,h=Math.max(0,-(a*q+b)),a=-h*h+q*(q+2*k)+l):(q=-g,h=Math.max(0,-(a*q+b)),a=-h*h+q*(q+2*k)+l):q<=-r?(h=Math.max(0,-(-a*g+b)),q=0<h?-g:Math.min(Math.max(-g,-k),g),a=-h*h+q*(q+2*k)+l):q<=r?(h=0,q=Math.min(Math.max(-g,-k),g),a=q*(q+2*k)+l):(h=Math.max(0,-(a*g+b)),q=0<h?g:Math.min(Math.max(-g,\n-k),g),a=-h*h+q*(q+2*k)+l)):(q=0<a?-g:g,h=Math.max(0,-(a*q+b)),a=-h*h+q*(q+2*k)+l);c&&c.copy(this.direction.clone().multiplyScalar(h).add(this.origin));d&&d.copy(f.clone().multiplyScalar(q).add(e));return a},isIntersectionSphere:function(a){return this.distanceToPoint(a.center)<=a.radius},intersectSphere:function(){var a=new THREE.Vector3;return function(b,c){a.subVectors(b.center,this.origin);var d=a.dot(this.direction),e=a.dot(a)-d*d,f=b.radius*b.radius;if(e>f)return null;f=Math.sqrt(f-e);e=d-f;\nd+=f;return 0>e&&0>d?null:0>e?this.at(d,c):this.at(e,c)}}(),isIntersectionPlane:function(a){var b=a.distanceToPoint(this.origin);return 0===b||0>a.normal.dot(this.direction)*b?!0:!1},distanceToPlane:function(a){var b=a.normal.dot(this.direction);if(0==b)return 0==a.distanceToPoint(this.origin)?0:null;a=-(this.origin.dot(a.normal)+a.constant)/b;return 0<=a?a:null},intersectPlane:function(a,b){var c=this.distanceToPlane(a);return null===c?null:this.at(c,b)},isIntersectionBox:function(){var a=new THREE.Vector3;\nreturn function(b){return null!==this.intersectBox(b,a)}}(),intersectBox:function(a,b){var c,d,e,f,g;d=1/this.direction.x;f=1/this.direction.y;g=1/this.direction.z;var h=this.origin;0<=d?(c=(a.min.x-h.x)*d,d*=a.max.x-h.x):(c=(a.max.x-h.x)*d,d*=a.min.x-h.x);0<=f?(e=(a.min.y-h.y)*f,f*=a.max.y-h.y):(e=(a.max.y-h.y)*f,f*=a.min.y-h.y);if(c>f||e>d)return null;if(e>c||c!==c)c=e;if(f<d||d!==d)d=f;0<=g?(e=(a.min.z-h.z)*g,g*=a.max.z-h.z):(e=(a.max.z-h.z)*g,g*=a.min.z-h.z);if(c>g||e>d)return null;if(e>c||c!==\nc)c=e;if(g<d||d!==d)d=g;return 0>d?null:this.at(0<=c?c:d,b)},intersectTriangle:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Vector3;return function(e,f,g,h,k){b.subVectors(f,e);c.subVectors(g,e);d.crossVectors(b,c);f=this.direction.dot(d);if(0<f){if(h)return null;h=1}else if(0>f)h=-1,f=-f;else return null;a.subVectors(this.origin,e);e=h*this.direction.dot(c.crossVectors(a,c));if(0>e)return null;g=h*this.direction.dot(b.cross(a));if(0>g||e+g>f)return null;\ne=-h*a.dot(d);return 0>e?null:this.at(e/f,k)}}(),applyMatrix4:function(a){this.direction.add(this.origin).applyMatrix4(a);this.origin.applyMatrix4(a);this.direction.sub(this.origin);this.direction.normalize();return this},equals:function(a){return a.origin.equals(this.origin)&&a.direction.equals(this.direction)},clone:function(){return(new THREE.Ray).copy(this)}};THREE.Sphere=function(a,b){this.center=void 0!==a?a:new THREE.Vector3;this.radius=void 0!==b?b:0};\nTHREE.Sphere.prototype={constructor:THREE.Sphere,set:function(a,b){this.center.copy(a);this.radius=b;return this},setFromPoints:function(){var a=new THREE.Box3;return function(b,c){var d=this.center;void 0!==c?d.copy(c):a.setFromPoints(b).center(d);for(var e=0,f=0,g=b.length;f<g;f++)e=Math.max(e,d.distanceToSquared(b[f]));this.radius=Math.sqrt(e);return this}}(),copy:function(a){this.center.copy(a.center);this.radius=a.radius;return this},empty:function(){return 0>=this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<=\nthis.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},clampPoint:function(a,b){var c=this.center.distanceToSquared(a),d=b||new THREE.Vector3;d.copy(a);c>this.radius*this.radius&&(d.sub(this.center).normalize(),d.multiplyScalar(this.radius).add(this.center));return d},getBoundingBox:function(a){a=a||new THREE.Box3;a.set(this.center,this.center);a.expandByScalar(this.radius);\nreturn a},applyMatrix4:function(a){this.center.applyMatrix4(a);this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius},clone:function(){return(new THREE.Sphere).copy(this)}};\nTHREE.Frustum=function(a,b,c,d,e,f){this.planes=[void 0!==a?a:new THREE.Plane,void 0!==b?b:new THREE.Plane,void 0!==c?c:new THREE.Plane,void 0!==d?d:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==f?f:new THREE.Plane]};\nTHREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var g=this.planes;g[0].copy(a);g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);g[5].copy(f);return this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],k=c[6],l=c[7],n=c[8],q=c[9],r=c[10],t=c[11],s=c[12],p=c[13],v=c[14],c=c[15];b[0].setComponents(f-a,l-g,t-n,c-s).normalize();b[1].setComponents(f+\na,l+g,t+n,c+s).normalize();b[2].setComponents(f+d,l+h,t+q,c+p).normalize();b[3].setComponents(f-d,l-h,t-q,c-p).normalize();b[4].setComponents(f-e,l-k,t-r,c-v).normalize();b[5].setComponents(f+e,l+k,t+r,c+v).normalize();return this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere);a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes,\nc=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)<a)return!1;return!0},intersectsBox:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){for(var d=this.planes,e=0;6>e;e++){var f=d[e];a.x=0<f.normal.x?c.min.x:c.max.x;b.x=0<f.normal.x?c.max.x:c.min.x;a.y=0<f.normal.y?c.min.y:c.max.y;b.y=0<f.normal.y?c.max.y:c.min.y;a.z=0<f.normal.z?c.min.z:c.max.z;b.z=0<f.normal.z?c.max.z:c.min.z;var g=f.distanceToPoint(a),f=f.distanceToPoint(b);if(0>g&&0>f)return!1}return!0}}(),\ncontainsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0},clone:function(){return(new THREE.Frustum).copy(this)}};THREE.Plane=function(a,b){this.normal=void 0!==a?a:new THREE.Vector3(1,0,0);this.constant=void 0!==b?b:0};\nTHREE.Plane.prototype={constructor:THREE.Plane,set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d,e){d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();this.setFromNormalAndCoplanarPoint(d,\nc);return this}}(),copy:function(a){this.normal.copy(a.normal);this.constant=a.constant;return this},normalize:function(){var a=1/this.normal.length();this.normal.multiplyScalar(a);this.constant*=a;return this},negate:function(){this.constant*=-1;this.normal.negate();return this},distanceToPoint:function(a){return this.normal.dot(a)+this.constant},distanceToSphere:function(a){return this.distanceToPoint(a.center)-a.radius},projectPoint:function(a,b){return this.orthoPoint(a,b).sub(a).negate()},orthoPoint:function(a,\nb){var c=this.distanceToPoint(a);return(b||new THREE.Vector3).copy(this.normal).multiplyScalar(c)},isIntersectionLine:function(a){var b=this.distanceToPoint(a.start);a=this.distanceToPoint(a.end);return 0>b&&0<a||0>a&&0<b},intersectLine:function(){var a=new THREE.Vector3;return function(b,c){var d=c||new THREE.Vector3,e=b.delta(a),f=this.normal.dot(e);if(0==f){if(0==this.distanceToPoint(b.start))return d.copy(b.start)}else return f=-(b.start.dot(this.normal)+this.constant)/f,0>f||1<f?void 0:d.copy(e).multiplyScalar(f).add(b.start)}}(),\ncoplanarPoint:function(a){return(a||new THREE.Vector3).copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Matrix3;return function(d,e){var f=e||c.getNormalMatrix(d),f=a.copy(this.normal).applyMatrix3(f),g=this.coplanarPoint(b);g.applyMatrix4(d);this.setFromNormalAndCoplanarPoint(f,g);return this}}(),translate:function(a){this.constant-=a.dot(this.normal);return this},equals:function(a){return a.normal.equals(this.normal)&&\na.constant==this.constant},clone:function(){return(new THREE.Plane).copy(this)}};\nTHREE.Math={generateUUID:function(){var a=\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\".split(\"\"),b=Array(36),c=0,d;return function(){for(var e=0;36>e;e++)8==e||13==e||18==e||23==e?b[e]=\"-\":14==e?b[e]=\"4\":(2>=c&&(c=33554432+16777216*Math.random()|0),d=c&15,c>>=4,b[e]=a[19==e?d&3|8:d]);return b.join(\"\")}}(),clamp:function(a,b,c){return a<b?b:a>c?c:a},clampBottom:function(a,b){return a<b?b:a},mapLinear:function(a,b,c,d,e){return d+(a-b)*(e-d)/(c-b)},smoothstep:function(a,b,c){if(a<=\nb)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*(3-2*a)},smootherstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*a*(a*(6*a-15)+10)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(.5-Math.random())},sign:function(a){return 0>a?-1:0<a?1:0},degToRad:function(){var a=Math.PI/180;return function(b){return b*\na}}(),radToDeg:function(){var a=180/Math.PI;return function(b){return b*a}}(),isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a}};\nTHREE.Spline=function(a){function b(a,b,c,d,e,f,g){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b}this.points=a;var c=[],d={x:0,y:0,z:0},e,f,g,h,k,l,n,q,r;this.initFromArray=function(a){this.points=[];for(var b=0;b<a.length;b++)this.points[b]={x:a[b][0],y:a[b][1],z:a[b][2]}};this.getPoint=function(a){e=(this.points.length-1)*a;f=Math.floor(e);g=e-f;c[0]=0===f?f:f-1;c[1]=f;c[2]=f>this.points.length-2?this.points.length-1:f+1;c[3]=f>this.points.length-3?this.points.length-1:f+\n2;l=this.points[c[0]];n=this.points[c[1]];q=this.points[c[2]];r=this.points[c[3]];h=g*g;k=g*h;d.x=b(l.x,n.x,q.x,r.x,g,h,k);d.y=b(l.y,n.y,q.y,r.y,g,h,k);d.z=b(l.z,n.z,q.z,r.z,g,h,k);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a<c;a++)b=this.points[a],d[a]=[b.x,b.y,b.z];return d};this.getLength=function(a){var b,c,d,e=b=b=0,f=new THREE.Vector3,g=new THREE.Vector3,h=[],k=0;h[0]=0;a||(a=100);c=this.points.length*a;f.copy(this.points[0]);for(a=1;a<c;a++)b=\na/c,d=this.getPoint(b),g.copy(d),k+=g.distanceTo(f),f.copy(d),b*=this.points.length-1,b=Math.floor(b),b!=e&&(h[b]=k,e=b);h[h.length]=k;return{chunks:h,total:k}};this.reparametrizeByArcLength=function(a){var b,c,d,e,f,g,h=[],k=new THREE.Vector3,l=this.getLength();h.push(k.copy(this.points[0]).clone());for(b=1;b<this.points.length;b++){c=l.chunks[b]-l.chunks[b-1];g=Math.ceil(a*c/l.total);e=(b-1)/(this.points.length-1);f=b/(this.points.length-1);for(c=1;c<g-1;c++)d=e+1/g*c*(f-e),d=this.getPoint(d),h.push(k.copy(d).clone());\nh.push(k.copy(this.points[b]).clone())}this.points=h}};THREE.Triangle=function(a,b,c){this.a=void 0!==a?a:new THREE.Vector3;this.b=void 0!==b?b:new THREE.Vector3;this.c=void 0!==c?c:new THREE.Vector3};THREE.Triangle.normal=function(){var a=new THREE.Vector3;return function(b,c,d,e){e=e||new THREE.Vector3;e.subVectors(d,c);a.subVectors(b,c);e.cross(a);b=e.lengthSq();return 0<b?e.multiplyScalar(1/Math.sqrt(b)):e.set(0,0,0)}}();\nTHREE.Triangle.barycoordFromPoint=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f,g,h){a.subVectors(g,e);b.subVectors(f,e);c.subVectors(d,e);d=a.dot(a);e=a.dot(b);f=a.dot(c);var k=b.dot(b);g=b.dot(c);var l=d*k-e*e;h=h||new THREE.Vector3;if(0==l)return h.set(-2,-1,-1);l=1/l;k=(k*f-e*g)*l;d=(d*g-e*f)*l;return h.set(1-k-d,d,k)}}();\nTHREE.Triangle.containsPoint=function(){var a=new THREE.Vector3;return function(b,c,d,e){b=THREE.Triangle.barycoordFromPoint(b,c,d,e,a);return 0<=b.x&&0<=b.y&&1>=b.x+b.y}}();\nTHREE.Triangle.prototype={constructor:THREE.Triangle,set:function(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this},setFromPointsAndIndices:function(a,b,c,d){this.a.copy(a[b]);this.b.copy(a[c]);this.c.copy(a[d]);return this},copy:function(a){this.a.copy(a.a);this.b.copy(a.b);this.c.copy(a.c);return this},area:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){a.subVectors(this.c,this.b);b.subVectors(this.a,this.b);return.5*a.cross(b).length()}}(),midpoint:function(a){return(a||\nnew THREE.Vector3).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(a){return THREE.Triangle.normal(this.a,this.b,this.c,a)},plane:function(a){return(a||new THREE.Plane).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(a,b){return THREE.Triangle.barycoordFromPoint(a,this.a,this.b,this.c,b)},containsPoint:function(a){return THREE.Triangle.containsPoint(a,this.a,this.b,this.c)},equals:function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)},\nclone:function(){return(new THREE.Triangle).copy(this)}};THREE.Clock=function(a){this.autoStart=void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1};\nTHREE.Clock.prototype={constructor:THREE.Clock,start:function(){this.oldTime=this.startTime=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now();this.running=!0},stop:function(){this.getElapsedTime();this.running=!1},getElapsedTime:function(){this.getDelta();return this.elapsedTime},getDelta:function(){var a=0;this.autoStart&&!this.running&&this.start();if(this.running){var b=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now(),\na=.001*(b-this.oldTime);this.oldTime=b;this.elapsedTime+=a}return a}};THREE.EventDispatcher=function(){};\nTHREE.EventDispatcher.prototype={constructor:THREE.EventDispatcher,apply:function(a){a.addEventListener=THREE.EventDispatcher.prototype.addEventListener;a.hasEventListener=THREE.EventDispatcher.prototype.hasEventListener;a.removeEventListener=THREE.EventDispatcher.prototype.removeEventListener;a.dispatchEvent=THREE.EventDispatcher.prototype.dispatchEvent},addEventListener:function(a,b){void 0===this._listeners&&(this._listeners={});var c=this._listeners;void 0===c[a]&&(c[a]=[]);-1===c[a].indexOf(b)&&\nc[a].push(b)},hasEventListener:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)?!0:!1},removeEventListener:function(a,b){if(void 0!==this._listeners){var c=this._listeners[a];if(void 0!==c){var d=c.indexOf(b);-1!==d&&c.splice(d,1)}}},dispatchEvent:function(a){if(void 0!==this._listeners){var b=this._listeners[a.type];if(void 0!==b){a.target=this;for(var c=[],d=b.length,e=0;e<d;e++)c[e]=b[e];for(e=0;e<d;e++)c[e].call(this,a)}}}};\n(function(a){a.Raycaster=function(b,c,f,g){this.ray=new a.Ray(b,c);this.near=f||0;this.far=g||Infinity;this.params={Sprite:{},Mesh:{},PointCloud:{threshold:1},LOD:{},Line:{}}};var b=function(a,b){return a.distance-b.distance},c=function(a,b,f,g){a.raycast(b,f);if(!0===g){a=a.children;g=0;for(var h=a.length;g<h;g++)c(a[g],b,f,!0)}};a.Raycaster.prototype={constructor:a.Raycaster,precision:1E-4,linePrecision:1,set:function(a,b){this.ray.set(a,b)},intersectObject:function(a,e){var f=[];c(a,this,f,e);\nf.sort(b);return f},intersectObjects:function(a,e){for(var f=[],g=0,h=a.length;g<h;g++)c(a[g],this,f,e);f.sort(b);return f}}})(THREE);\nTHREE.Object3D=function(){this.id=THREE.Object3DIdCount++;this.uuid=THREE.Math.generateUUID();this.name=\"\";this.parent=void 0;this.children=[];this.up=THREE.Object3D.DefaultUp.clone();var a=new THREE.Vector3,b=new THREE.Euler,c=new THREE.Quaternion,d=new THREE.Vector3(1,1,1);b.onChange(function(){c.setFromEuler(b,!1)});c.onChange(function(){b.setFromQuaternion(c,void 0,!1)});Object.defineProperties(this,{position:{enumerable:!0,value:a},rotation:{enumerable:!0,value:b},quaternion:{enumerable:!0,value:c},\nscale:{enumerable:!0,value:d}});this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixAutoUpdate=!0;this.matrixWorldNeedsUpdate=!1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this.userData={}};THREE.Object3D.DefaultUp=new THREE.Vector3(0,1,0);\nTHREE.Object3D.prototype={constructor:THREE.Object3D,get eulerOrder(){console.warn(\"THREE.Object3D: .eulerOrder has been moved to .rotation.order.\");return this.rotation.order},set eulerOrder(a){console.warn(\"THREE.Object3D: .eulerOrder has been moved to .rotation.order.\");this.rotation.order=a},get useQuaternion(){console.warn(\"THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.\")},set useQuaternion(a){console.warn(\"THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.\")},\napplyMatrix:function(a){this.matrix.multiplyMatrices(a,this.matrix);this.matrix.decompose(this.position,this.quaternion,this.scale)},setRotationFromAxisAngle:function(a,b){this.quaternion.setFromAxisAngle(a,b)},setRotationFromEuler:function(a){this.quaternion.setFromEuler(a,!0)},setRotationFromMatrix:function(a){this.quaternion.setFromRotationMatrix(a)},setRotationFromQuaternion:function(a){this.quaternion.copy(a)},rotateOnAxis:function(){var a=new THREE.Quaternion;return function(b,c){a.setFromAxisAngle(b,\nc);this.quaternion.multiply(a);return this}}(),rotateX:function(){var a=new THREE.Vector3(1,0,0);return function(b){return this.rotateOnAxis(a,b)}}(),rotateY:function(){var a=new THREE.Vector3(0,1,0);return function(b){return this.rotateOnAxis(a,b)}}(),rotateZ:function(){var a=new THREE.Vector3(0,0,1);return function(b){return this.rotateOnAxis(a,b)}}(),translateOnAxis:function(){var a=new THREE.Vector3;return function(b,c){a.copy(b).applyQuaternion(this.quaternion);this.position.add(a.multiplyScalar(c));\nreturn this}}(),translate:function(a,b){console.warn(\"THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.\");return this.translateOnAxis(b,a)},translateX:function(){var a=new THREE.Vector3(1,0,0);return function(b){return this.translateOnAxis(a,b)}}(),translateY:function(){var a=new THREE.Vector3(0,1,0);return function(b){return this.translateOnAxis(a,b)}}(),translateZ:function(){var a=new THREE.Vector3(0,0,1);return function(b){return this.translateOnAxis(a,\nb)}}(),localToWorld:function(a){return a.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var a=new THREE.Matrix4;return function(b){return b.applyMatrix4(a.getInverse(this.matrixWorld))}}(),lookAt:function(){var a=new THREE.Matrix4;return function(b){a.lookAt(b,this.position,this.up);this.quaternion.setFromRotationMatrix(a)}}(),add:function(a){if(1<arguments.length){for(var b=0;b<arguments.length;b++)this.add(arguments[b]);return this}if(a===this)return console.error(\"THREE.Object3D.add:\",\na,\"can't be added as a child of itself.\"),this;if(a instanceof THREE.Object3D){void 0!==a.parent&&a.parent.remove(a);a.parent=this;a.dispatchEvent({type:\"added\"});this.children.push(a);for(b=this;void 0!==b.parent;)b=b.parent;void 0!==b&&b instanceof THREE.Scene&&b.__addObject(a)}else console.error(\"THREE.Object3D.add:\",a,\"is not an instance of THREE.Object3D.\");return this},remove:function(a){if(1<arguments.length)for(var b=0;b<arguments.length;b++)this.remove(arguments[b]);b=this.children.indexOf(a);\nif(-1!==b){a.parent=void 0;a.dispatchEvent({type:\"removed\"});this.children.splice(b,1);for(b=this;void 0!==b.parent;)b=b.parent;void 0!==b&&b instanceof THREE.Scene&&b.__removeObject(a)}},raycast:function(){},traverse:function(a){a(this);for(var b=0,c=this.children.length;b<c;b++)this.children[b].traverse(a)},traverseVisible:function(a){if(!1!==this.visible){a(this);for(var b=0,c=this.children.length;b<c;b++)this.children[b].traverseVisible(a)}},getObjectById:function(a,b){for(var c=0,d=this.children.length;c<\nd;c++){var e=this.children[c];if(e.id===a||!0===b&&(e=e.getObjectById(a,b),void 0!==e))return e}},getObjectByName:function(a,b){for(var c=0,d=this.children.length;c<d;c++){var e=this.children[c];if(e.name===a||!0===b&&(e=e.getObjectByName(a,b),void 0!==e))return e}},getChildByName:function(a,b){console.warn(\"THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().\");return this.getObjectByName(a,b)},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale);\nthis.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){!0===this.matrixAutoUpdate&&this.updateMatrix();if(!0===this.matrixWorldNeedsUpdate||!0===a)void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)},clone:function(a,b){void 0===a&&(a=new THREE.Object3D);void 0===b&&(b=!0);a.name=this.name;a.up.copy(this.up);\na.position.copy(this.position);a.quaternion.copy(this.quaternion);a.scale.copy(this.scale);a.renderDepth=this.renderDepth;a.rotationAutoUpdate=this.rotationAutoUpdate;a.matrix.copy(this.matrix);a.matrixWorld.copy(this.matrixWorld);a.matrixAutoUpdate=this.matrixAutoUpdate;a.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate;a.visible=this.visible;a.castShadow=this.castShadow;a.receiveShadow=this.receiveShadow;a.frustumCulled=this.frustumCulled;a.userData=JSON.parse(JSON.stringify(this.userData));if(!0===\nb)for(var c=0;c<this.children.length;c++)a.add(this.children[c].clone());return a}};THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype);THREE.Object3DIdCount=0;\nTHREE.Projector=function(){function a(){if(q===t){var a=new THREE.RenderableVertex;r.push(a);t++;q++;return a}return r[q++]}function b(){if(p===w){var a=new THREE.RenderableFace;v.push(a);w++;p++;return a}return v[p++]}function c(){if(D===x){var a=new THREE.RenderableLine;A.push(a);x++;D++;return a}return A[D++]}function d(){if(I===y){var a=new THREE.RenderableSprite;z.push(a);y++;I++;return a}return z[I++]}function e(a,b){return a.z!==b.z?b.z-a.z:a.id!==b.id?a.id-b.id:0}function f(a,b){var c=0,d=\n1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;if(0<=e&&0<=f&&0<=g&&0<=h)return!0;if(0>e&&0>f||0>g&&0>h)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>g?c=Math.max(c,g/(g-h)):0>h&&(d=Math.min(d,g/(g-h)));if(d<c)return!1;a.lerp(b,c);b.lerp(a,1-d);return!0}var g,h,k=[],l=0,n,q,r=[],t=0,s,p,v=[],w=0,u,D,A=[],x=0,C,I,z=[],y=0,K={objects:[],lights:[],elements:[]},N=new THREE.Vector3,ba=new THREE.Vector3,P=new THREE.Vector3,O=new THREE.Vector3,J=new THREE.Vector4,E=new THREE.Box3(new THREE.Vector3(-1,\n-1,-1),new THREE.Vector3(1,1,1)),Q=new THREE.Box3,L=Array(3),R=new THREE.Matrix4,B=new THREE.Matrix4,S,V=new THREE.Matrix4,W=new THREE.Matrix3,H=new THREE.Frustum,oa=new THREE.Vector4,$=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);B.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);return a.applyProjection(B)};this.unprojectVector=function(){var a=new THREE.Matrix4;return function(b,c){a.getInverse(c.projectionMatrix);B.multiplyMatrices(c.matrixWorld,\na);return b.applyProjection(B)}}();this.pickingRay=function(a,b){a.z=-1;var c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.sub(a).normalize();return new THREE.Raycaster(a,c)};var X=new function(){var d=[],e=[],f=null,g=null,h=new THREE.Matrix3,k=function(a){var b=a.positionWorld,c=a.positionScreen;b.copy(a.position).applyMatrix4(S);c.copy(b).applyMatrix4(B);b=1/c.w;c.x*=b;c.y*=b;c.z*=b;a.visible=-1<=c.x&&1>=c.x&&-1<=c.y&&1>=c.y&&-1<=c.z&&1>=c.z},l=function(a,\nb,c){if(!0===a.visible||!0===b.visible||!0===c.visible)return!0;L[0]=a.positionScreen;L[1]=b.positionScreen;L[2]=c.positionScreen;return E.isIntersectionBox(Q.setFromPoints(L))},q=function(a,b,c){return 0>(c.positionScreen.x-a.positionScreen.x)*(b.positionScreen.y-a.positionScreen.y)-(c.positionScreen.y-a.positionScreen.y)*(b.positionScreen.x-a.positionScreen.x)};return{setObject:function(a){f=a;g=f.material;h.getNormalMatrix(f.matrixWorld);d.length=0;e.length=0},projectVertex:k,checkTriangleVisibility:l,\ncheckBackfaceCulling:q,pushVertex:function(b,c,d){n=a();n.position.set(b,c,d);k(n)},pushNormal:function(a,b,c){d.push(a,b,c)},pushUv:function(a,b){e.push(a,b)},pushLine:function(a,b){var d=r[a],e=r[b];u=c();u.id=f.id;u.v1.copy(d);u.v2.copy(e);u.z=(d.positionScreen.z+e.positionScreen.z)/2;u.material=f.material;K.elements.push(u)},pushTriangle:function(a,c,k){var n=r[a],p=r[c],t=r[k];if(!1!==l(n,p,t)&&(g.side===THREE.DoubleSide||!0===q(n,p,t))){s=b();s.id=f.id;s.v1.copy(n);s.v2.copy(p);s.v3.copy(t);\ns.z=(n.positionScreen.z+p.positionScreen.z+t.positionScreen.z)/3;for(n=0;3>n;n++)p=3*arguments[n],t=s.vertexNormalsModel[n],t.set(d[p],d[p+1],d[p+2]),t.applyMatrix3(h).normalize(),p=2*arguments[n],s.uvs[n].set(e[p],e[p+1]);s.vertexNormalsLength=3;s.material=f.material;K.elements.push(s)}}}};this.projectScene=function(n,t,w,v){I=D=p=0;K.elements.length=0;!0===n.autoUpdate&&n.updateMatrixWorld();void 0===t.parent&&t.updateMatrixWorld();R.copy(t.matrixWorldInverse.getInverse(t.matrixWorld));B.multiplyMatrices(t.projectionMatrix,\nR);H.setFromMatrix(B);h=0;K.objects.length=0;K.lights.length=0;n.traverseVisible(function(a){if(a instanceof THREE.Light)K.lights.push(a);else if(a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Sprite)if(!1===a.frustumCulled||!0===H.intersectsObject(a)){if(h===l){var b=new THREE.RenderableObject;k.push(b);l++;h++;g=b}else g=k[h++];g.id=a.id;g.object=a;null!==a.renderDepth?g.z=a.renderDepth:(O.setFromMatrixPosition(a.matrixWorld),O.applyProjection(B),g.z=O.z);K.objects.push(g)}});\n!0===w&&K.objects.sort(e);n=0;for(w=K.objects.length;n<w;n++){var A=K.objects[n].object,x=A.geometry;X.setObject(A);S=A.matrixWorld;q=0;if(A instanceof THREE.Mesh)if(x instanceof THREE.BufferGeometry){var z=x.attributes,A=x.offsets;if(void 0!==z.position){for(var G=z.position.array,x=0,y=G.length;x<y;x+=3)X.pushVertex(G[x],G[x+1],G[x+2]);if(void 0!==z.normal)for(var L=z.normal.array,x=0,y=L.length;x<y;x+=3)X.pushNormal(L[x],L[x+1],L[x+2]);if(void 0!==z.uv)for(L=z.uv.array,x=0,y=L.length;x<y;x+=2)X.pushUv(L[x],\nL[x+1]);if(void 0!==z.index)if(z=z.index.array,0<A.length)for(n=0;n<A.length;n++)for(y=A[n],G=y.index,x=y.start,y=y.start+y.count;x<y;x+=3)X.pushTriangle(z[x]+G,z[x+1]+G,z[x+2]+G);else for(x=0,y=z.length;x<y;x+=3)X.pushTriangle(z[x],z[x+1],z[x+2]);else for(x=0,y=G.length/3;x<y;x+=3)X.pushTriangle(x,x+1,x+2)}}else{if(x instanceof THREE.Geometry){var Q=x.vertices,y=x.faces,z=x.faceVertexUvs[0];W.getNormalMatrix(S);for(var G=A.material instanceof THREE.MeshFaceMaterial,L=!0===G?A.material:null,E=0,ca=\nQ.length;E<ca;E++){var la=Q[E];X.pushVertex(la.x,la.y,la.z)}Q=0;for(E=y.length;Q<E;Q++){var ca=y[Q],qa=!0===G?L.materials[ca.materialIndex]:A.material;if(void 0!==qa){var ua=qa.side,la=r[ca.a],ja=r[ca.b],Fa=r[ca.c];if(!0===qa.morphTargets){var va=x.morphTargets,Ka=A.morphTargetInfluences,aa=la.position,ra=ja.position,Da=Fa.position;N.set(0,0,0);ba.set(0,0,0);P.set(0,0,0);for(var Qa=0,cb=va.length;Qa<cb;Qa++){var Ga=Ka[Qa];if(0!==Ga){var xa=va[Qa].vertices;N.x+=(xa[ca.a].x-aa.x)*Ga;N.y+=(xa[ca.a].y-\naa.y)*Ga;N.z+=(xa[ca.a].z-aa.z)*Ga;ba.x+=(xa[ca.b].x-ra.x)*Ga;ba.y+=(xa[ca.b].y-ra.y)*Ga;ba.z+=(xa[ca.b].z-ra.z)*Ga;P.x+=(xa[ca.c].x-Da.x)*Ga;P.y+=(xa[ca.c].y-Da.y)*Ga;P.z+=(xa[ca.c].z-Da.z)*Ga}}la.position.add(N);ja.position.add(ba);Fa.position.add(P);X.projectVertex(la);X.projectVertex(ja);X.projectVertex(Fa)}if(!1!==X.checkTriangleVisibility(la,ja,Fa)){va=X.checkBackfaceCulling(la,ja,Fa);if(ua!==THREE.DoubleSide){if(ua===THREE.FrontSide&&!1===va)continue;if(ua===THREE.BackSide&&!0===va)continue}s=\nb();s.id=A.id;s.v1.copy(la);s.v2.copy(ja);s.v3.copy(Fa);s.normalModel.copy(ca.normal);!1!==va||ua!==THREE.BackSide&&ua!==THREE.DoubleSide||s.normalModel.negate();s.normalModel.applyMatrix3(W).normalize();Ka=ca.vertexNormals;aa=0;for(ra=Math.min(Ka.length,3);aa<ra;aa++)Da=s.vertexNormalsModel[aa],Da.copy(Ka[aa]),!1!==va||ua!==THREE.BackSide&&ua!==THREE.DoubleSide||Da.negate(),Da.applyMatrix3(W).normalize();s.vertexNormalsLength=Ka.length;ua=z[Q];if(void 0!==ua)for(va=0;3>va;va++)s.uvs[va].copy(ua[va]);\ns.color=ca.color;s.material=qa;s.z=(la.positionScreen.z+ja.positionScreen.z+Fa.positionScreen.z)/3;K.elements.push(s)}}}}}else if(A instanceof THREE.Line)if(x instanceof THREE.BufferGeometry){if(z=x.attributes,void 0!==z.position){G=z.position.array;x=0;for(y=G.length;x<y;x+=3)X.pushVertex(G[x],G[x+1],G[x+2]);if(void 0!==z.index)for(z=z.index.array,x=0,y=z.length;x<y;x+=2)X.pushLine(z[x],z[x+1]);else for(z=A.type===THREE.LinePieces?2:1,x=0,y=G.length/3-1;x<y;x+=z)X.pushLine(x,x+1)}}else{if(x instanceof\nTHREE.Geometry&&(V.multiplyMatrices(B,S),Q=A.geometry.vertices,0!==Q.length))for(la=a(),la.positionScreen.copy(Q[0]).applyMatrix4(V),z=A.type===THREE.LinePieces?2:1,E=1,ca=Q.length;E<ca;E++)la=a(),la.positionScreen.copy(Q[E]).applyMatrix4(V),0<(E+1)%z||(ja=r[q-2],oa.copy(la.positionScreen),$.copy(ja.positionScreen),!0===f(oa,$)&&(oa.multiplyScalar(1/oa.w),$.multiplyScalar(1/$.w),u=c(),u.id=A.id,u.v1.positionScreen.copy(oa),u.v2.positionScreen.copy($),u.z=Math.max(oa.z,$.z),u.material=A.material,A.material.vertexColors===\nTHREE.VertexColors&&(u.vertexColors[0].copy(A.geometry.colors[E]),u.vertexColors[1].copy(A.geometry.colors[E-1])),K.elements.push(u)))}else A instanceof THREE.Sprite&&(J.set(S.elements[12],S.elements[13],S.elements[14],1),J.applyMatrix4(B),x=1/J.w,J.z*=x,-1<=J.z&&1>=J.z&&(C=d(),C.id=A.id,C.x=J.x*x,C.y=J.y*x,C.z=J.z,C.object=A,C.rotation=A.rotation,C.scale.x=A.scale.x*Math.abs(C.x-(J.x+t.projectionMatrix.elements[0])/(J.w+t.projectionMatrix.elements[12])),C.scale.y=A.scale.y*Math.abs(C.y-(J.y+t.projectionMatrix.elements[5])/\n(J.w+t.projectionMatrix.elements[13])),C.material=A.material,K.elements.push(C)))}!0===v&&K.elements.sort(e);return K}};THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=void 0!==f?f:0};\nTHREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.materialIndex=this.materialIndex;for(var b=0,c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();b=0;for(c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();b=0;for(c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();return a}};\nTHREE.Face4=function(a,b,c,d,e,f,g){console.warn(\"THREE.Face4 has been removed. A THREE.Face3 will be created instead.\");return new THREE.Face3(a,b,c,e,f,g)};THREE.BufferAttribute=function(a,b){this.array=a;this.itemSize=b};\nTHREE.BufferAttribute.prototype={constructor:THREE.BufferAttribute,get length(){return this.array.length},set:function(a){this.array.set(a);return this},setX:function(a,b){this.array[a*this.itemSize]=b;return this},setY:function(a,b){this.array[a*this.itemSize+1]=b;return this},setZ:function(a,b){this.array[a*this.itemSize+2]=b;return this},setXY:function(a,b,c){a*=this.itemSize;this.array[a]=b;this.array[a+1]=c;return this},setXYZ:function(a,b,c,d){a*=this.itemSize;this.array[a]=b;this.array[a+1]=\nc;this.array[a+2]=d;return this},setXYZW:function(a,b,c,d,e){a*=this.itemSize;this.array[a]=b;this.array[a+1]=c;this.array[a+2]=d;this.array[a+3]=e;return this}};THREE.Int8Attribute=function(a,b){console.warn(\"THREE.Int8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.\");return new THREE.BufferAttribute(a,b)};\nTHREE.Uint8Attribute=function(a,b){console.warn(\"THREE.Uint8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.\");return new THREE.BufferAttribute(a,b)};THREE.Uint8ClampedAttribute=function(a,b){console.warn(\"THREE.Uint8ClampedAttribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.\");return new THREE.BufferAttribute(a,b)};\nTHREE.Int16Attribute=function(a,b){console.warn(\"THREE.Int16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.\");return new THREE.BufferAttribute(a,b)};THREE.Uint16Attribute=function(a,b){console.warn(\"THREE.Uint16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.\");return new THREE.BufferAttribute(a,b)};\nTHREE.Int32Attribute=function(a,b){console.warn(\"THREE.Int32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.\");return new THREE.BufferAttribute(a,b)};THREE.Uint32Attribute=function(a,b){console.warn(\"THREE.Uint32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.\");return new THREE.BufferAttribute(a,b)};\nTHREE.Float32Attribute=function(a,b){console.warn(\"THREE.Float32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.\");return new THREE.BufferAttribute(a,b)};THREE.Float64Attribute=function(a,b){console.warn(\"THREE.Float64Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.\");return new THREE.BufferAttribute(a,b)};\nTHREE.BufferGeometry=function(){this.id=THREE.GeometryIdCount++;this.uuid=THREE.Math.generateUUID();this.name=\"\";this.attributes={};this.offsets=this.drawcalls=[];this.boundingSphere=this.boundingBox=null};\nTHREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(a,b,c){!1===b instanceof THREE.BufferAttribute?(console.warn(\"THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).\"),this.attributes[a]={array:b,itemSize:c}):this.attributes[a]=b},getAttribute:function(a){return this.attributes[a]},addDrawCall:function(a,b,c){this.drawcalls.push({start:a,count:b,index:void 0!==c?c:0})},applyMatrix:function(a){var b=this.attributes.position;void 0!==b&&(a.applyToVector3Array(b.array),\nb.needsUpdate=!0);b=this.attributes.normal;void 0!==b&&((new THREE.Matrix3).getNormalMatrix(a).applyToVector3Array(b.array),b.needsUpdate=!0)},fromGeometry:function(a,b){b=b||{vertexColors:THREE.NoColors};var c=a.vertices,d=a.faces,e=a.faceVertexUvs,f=b.vertexColors,g=0<e[0].length,h=3==d[0].vertexNormals.length,k=new Float32Array(9*d.length);this.addAttribute(\"position\",new THREE.BufferAttribute(k,3));var l=new Float32Array(9*d.length);this.addAttribute(\"normal\",new THREE.BufferAttribute(l,3));if(f!==\nTHREE.NoColors){var n=new Float32Array(9*d.length);this.addAttribute(\"color\",new THREE.BufferAttribute(n,3))}if(!0===g){var q=new Float32Array(6*d.length);this.addAttribute(\"uvs\",new THREE.BufferAttribute(q,2))}for(var r=0,t=0,s=0;r<d.length;r++,t+=6,s+=9){var p=d[r],v=c[p.a],w=c[p.b],u=c[p.c];k[s]=v.x;k[s+1]=v.y;k[s+2]=v.z;k[s+3]=w.x;k[s+4]=w.y;k[s+5]=w.z;k[s+6]=u.x;k[s+7]=u.y;k[s+8]=u.z;!0===h?(v=p.vertexNormals[0],w=p.vertexNormals[1],u=p.vertexNormals[2],l[s]=v.x,l[s+1]=v.y,l[s+2]=v.z,l[s+3]=\nw.x,l[s+4]=w.y,l[s+5]=w.z,l[s+6]=u.x,l[s+7]=u.y,l[s+8]=u.z):(v=p.normal,l[s]=v.x,l[s+1]=v.y,l[s+2]=v.z,l[s+3]=v.x,l[s+4]=v.y,l[s+5]=v.z,l[s+6]=v.x,l[s+7]=v.y,l[s+8]=v.z);f===THREE.FaceColors?(p=p.color,n[s]=p.r,n[s+1]=p.g,n[s+2]=p.b,n[s+3]=p.r,n[s+4]=p.g,n[s+5]=p.b,n[s+6]=p.r,n[s+7]=p.g,n[s+8]=p.b):f===THREE.VertexColors&&(v=p.vertexColors[0],w=p.vertexColors[1],p=p.vertexColors[2],n[s]=v.r,n[s+1]=v.g,n[s+2]=v.b,n[s+3]=w.r,n[s+4]=w.g,n[s+5]=w.b,n[s+6]=p.r,n[s+7]=p.g,n[s+8]=p.b);!0===g&&(p=e[0][r][0],\nv=e[0][r][1],w=e[0][r][2],q[t]=p.x,q[t+1]=p.y,q[t+2]=v.x,q[t+3]=v.y,q[t+4]=w.x,q[t+5]=w.y)}this.computeBoundingSphere();return this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var a=this.attributes.position.array;if(a){var b=this.boundingBox;3<=a.length&&(b.min.x=b.max.x=a[0],b.min.y=b.max.y=a[1],b.min.z=b.max.z=a[2]);for(var c=3,d=a.length;c<d;c+=3){var e=a[c],f=a[c+1],g=a[c+2];e<b.min.x?b.min.x=e:e>b.max.x&&(b.max.x=e);f<b.min.y?b.min.y=f:f>b.max.y&&\n(b.max.y=f);g<b.min.z?b.min.z=g:g>b.max.z&&(b.max.z=g)}}if(void 0===a||0===a.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0);(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The \"position\" attribute is likely to have NaN values.')},computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&&\n(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,f=c.length;e<f;e+=3)b.set(c[e],c[e+1],c[e+2]),a.expandByPoint(b);a.center(d);for(var g=0,e=0,f=c.length;e<f;e+=3)b.set(c[e],c[e+1],c[e+2]),g=Math.max(g,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(g);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The \"position\" attribute is likely to have NaN values.')}}}(),\ncomputeFaceNormals:function(){},computeVertexNormals:function(){if(this.attributes.position){var a,b,c,d;a=this.attributes.position.array.length;if(void 0===this.attributes.normal)this.attributes.normal={itemSize:3,array:new Float32Array(a)};else for(a=0,b=this.attributes.normal.array.length;a<b;a++)this.attributes.normal.array[a]=0;var e=this.attributes.position.array,f=this.attributes.normal.array,g,h,k,l,n,q,r=new THREE.Vector3,t=new THREE.Vector3,s=new THREE.Vector3,p=new THREE.Vector3,v=new THREE.Vector3;\nif(this.attributes.index){var w=this.attributes.index.array,u=0<this.offsets.length?this.offsets:[{start:0,count:w.length,index:0}];c=0;for(d=u.length;c<d;++c){b=u[c].start;g=u[c].count;var D=u[c].index;a=b;for(b+=g;a<b;a+=3)g=D+w[a],h=D+w[a+1],k=D+w[a+2],l=e[3*g],n=e[3*g+1],q=e[3*g+2],r.set(l,n,q),l=e[3*h],n=e[3*h+1],q=e[3*h+2],t.set(l,n,q),l=e[3*k],n=e[3*k+1],q=e[3*k+2],s.set(l,n,q),p.subVectors(s,t),v.subVectors(r,t),p.cross(v),f[3*g]+=p.x,f[3*g+1]+=p.y,f[3*g+2]+=p.z,f[3*h]+=p.x,f[3*h+1]+=p.y,\nf[3*h+2]+=p.z,f[3*k]+=p.x,f[3*k+1]+=p.y,f[3*k+2]+=p.z}}else for(a=0,b=e.length;a<b;a+=9)l=e[a],n=e[a+1],q=e[a+2],r.set(l,n,q),l=e[a+3],n=e[a+4],q=e[a+5],t.set(l,n,q),l=e[a+6],n=e[a+7],q=e[a+8],s.set(l,n,q),p.subVectors(s,t),v.subVectors(r,t),p.cross(v),f[a]=p.x,f[a+1]=p.y,f[a+2]=p.z,f[a+3]=p.x,f[a+4]=p.y,f[a+5]=p.z,f[a+6]=p.x,f[a+7]=p.y,f[a+8]=p.z;this.normalizeNormals();this.normalsNeedUpdate=!0}},computeTangents:function(){function a(a,b,c){q=d[3*a];r=d[3*a+1];t=d[3*a+2];s=d[3*b];p=d[3*b+1];v=d[3*\nb+2];w=d[3*c];u=d[3*c+1];D=d[3*c+2];A=f[2*a];x=f[2*a+1];C=f[2*b];I=f[2*b+1];z=f[2*c];y=f[2*c+1];K=s-q;N=w-q;ba=p-r;P=u-r;O=v-t;J=D-t;E=C-A;Q=z-A;L=I-x;R=y-x;B=1/(E*R-Q*L);S.set((R*K-L*N)*B,(R*ba-L*P)*B,(R*O-L*J)*B);V.set((E*N-Q*K)*B,(E*P-Q*ba)*B,(E*J-Q*O)*B);k[a].add(S);k[b].add(S);k[c].add(S);l[a].add(V);l[b].add(V);l[c].add(V)}function b(a){za.x=e[3*a];za.y=e[3*a+1];za.z=e[3*a+2];Oa.copy(za);G=k[a];Ea.copy(G);Ea.sub(za.multiplyScalar(za.dot(G))).normalize();Aa.crossVectors(Oa,G);Ba=Aa.dot(l[a]);\nPa=0>Ba?-1:1;h[4*a]=Ea.x;h[4*a+1]=Ea.y;h[4*a+2]=Ea.z;h[4*a+3]=Pa}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn(\"Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()\");else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&(this.attributes.tangent=\n{itemSize:4,array:new Float32Array(4*g)});for(var h=this.attributes.tangent.array,k=[],l=[],n=0;n<g;n++)k[n]=new THREE.Vector3,l[n]=new THREE.Vector3;var q,r,t,s,p,v,w,u,D,A,x,C,I,z,y,K,N,ba,P,O,J,E,Q,L,R,B,S=new THREE.Vector3,V=new THREE.Vector3,W,H,oa,$,X,T=this.offsets,n=0;for(H=T.length;n<H;++n){W=T[n].start;oa=T[n].count;var ya=T[n].index,g=W;for(W+=oa;g<W;g+=3)oa=ya+c[g],$=ya+c[g+1],X=ya+c[g+2],a(oa,$,X)}var Ea=new THREE.Vector3,Aa=new THREE.Vector3,za=new THREE.Vector3,Oa=new THREE.Vector3,\nPa,G,Ba,n=0;for(H=T.length;n<H;++n)for(W=T[n].start,oa=T[n].count,ya=T[n].index,g=W,W+=oa;g<W;g+=3)oa=ya+c[g],$=ya+c[g+1],X=ya+c[g+2],b(oa),b($),b(X)}},computeOffsets:function(a){var b=a;void 0===a&&(b=65535);Date.now();a=this.attributes.index.array;for(var c=this.attributes.position.array,d=a.length/3,e=new Uint16Array(a.length),f=0,g=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,n=0,q=new Int32Array(6),r=new Int32Array(c.length),t=new Int32Array(c.length),s=0;s<c.length;s++)r[s]=-1,t[s]=-1;for(c=0;c<\nd;c++){for(var p=n=0;3>p;p++)s=a[3*c+p],-1==r[s]?(q[2*p]=s,q[2*p+1]=-1,n++):r[s]<k.index?(q[2*p]=s,q[2*p+1]=-1,l++):(q[2*p]=s,q[2*p+1]=r[s]);if(g+n>k.index+b)for(k={start:f,count:0,index:g},h.push(k),n=0;6>n;n+=2)p=q[n+1],-1<p&&p<k.index&&(q[n+1]=-1);for(n=0;6>n;n+=2)s=q[n],p=q[n+1],-1===p&&(p=g++),r[s]=p,t[p]=s,e[f++]=p-k.index,k.count++}this.reorderBuffers(e,t,g);return this.offsets=h},merge:function(){console.log(\"BufferGeometry.merge(): TODO\")},normalizeNormals:function(){for(var a=this.attributes.normal.array,\nb,c,d,e=0,f=a.length;e<f;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},reorderBuffers:function(a,b,c){var d={},e=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],f;for(f in this.attributes)if(\"index\"!=f)for(var g=this.attributes[f].array,h=0,k=e.length;h<k;h++){var l=e[h];if(g instanceof l){d[f]=new l(this.attributes[f].itemSize*c);break}}for(e=0;e<c;e++)for(f in g=b[e],this.attributes)if(\"index\"!=\nf)for(var h=this.attributes[f].array,k=this.attributes[f].itemSize,l=d[f],n=0;n<k;n++)l[e*k+n]=h[g*k+n];this.attributes.index.array=a;for(f in this.attributes)\"index\"!=f&&(this.attributes[f].array=d[f],this.attributes[f].numItems=this.attributes[f].itemSize*c)},clone:function(){var a=new THREE.BufferGeometry,b=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],c;for(c in this.attributes){for(var d=this.attributes[c],e=d.array,f={itemSize:d.itemSize,\narray:null},d=0,g=b.length;d<g;d++){var h=b[d];if(e instanceof h){f.array=new h(e);break}}a.attributes[c]=f}d=0;for(g=this.offsets.length;d<g;d++)b=this.offsets[d],a.offsets.push({start:b.start,index:b.index,count:b.count});return a},dispose:function(){this.dispatchEvent({type:\"dispose\"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);\nTHREE.Geometry=function(){this.id=THREE.GeometryIdCount++;this.uuid=THREE.Math.generateUUID();this.name=\"\";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1;this.dynamic=!0;this.groupsNeedUpdate=this.buffersNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.tangentsNeedUpdate=this.normalsNeedUpdate=\nthis.uvsNeedUpdate=this.elementsNeedUpdate=this.verticesNeedUpdate=!1};\nTHREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){for(var b=(new THREE.Matrix3).getNormalMatrix(a),c=0,d=this.vertices.length;c<d;c++)this.vertices[c].applyMatrix4(a);c=0;for(d=this.faces.length;c<d;c++){a=this.faces[c];a.normal.applyMatrix3(b).normalize();for(var e=0,f=a.vertexNormals.length;e<f;e++)a.vertexNormals[e].applyMatrix3(b).normalize()}this.boundingBox instanceof THREE.Box3&&this.computeBoundingBox();this.boundingSphere instanceof THREE.Sphere&&this.computeBoundingSphere()},\ncenter:function(){this.computeBoundingBox();var a=new THREE.Vector3;a.addVectors(this.boundingBox.min,this.boundingBox.max);a.multiplyScalar(-.5);this.applyMatrix((new THREE.Matrix4).makeTranslation(a.x,a.y,a.z));this.computeBoundingBox();return a},computeFaceNormals:function(){for(var a=new THREE.Vector3,b=new THREE.Vector3,c=0,d=this.faces.length;c<d;c++){var e=this.faces[c],f=this.vertices[e.a],g=this.vertices[e.b];a.subVectors(this.vertices[e.c],g);b.subVectors(f,g);a.cross(b);a.normalize();e.normal.copy(a)}},\ncomputeVertexNormals:function(a){var b,c,d;d=Array(this.vertices.length);b=0;for(c=this.vertices.length;b<c;b++)d[b]=new THREE.Vector3;if(a){var e,f,g,h=new THREE.Vector3,k=new THREE.Vector3;new THREE.Vector3;new THREE.Vector3;new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],e=this.vertices[c.a],f=this.vertices[c.b],g=this.vertices[c.c],h.subVectors(g,f),k.subVectors(e,f),h.cross(k),d[c.a].add(h),d[c.b].add(h),d[c.c].add(h)}else for(a=0,b=this.faces.length;a<b;a++)c=this.faces[a],\nd[c.a].add(c.normal),d[c.b].add(c.normal),d[c.c].add(c.normal);b=0;for(c=this.vertices.length;b<c;b++)d[b].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c.vertexNormals[0]=d[c.a].clone(),c.vertexNormals[1]=d[c.b].clone(),c.vertexNormals[2]=d[c.c].clone()},computeMorphNormals:function(){var a,b,c,d,e;c=0;for(d=this.faces.length;c<d;c++)for(e=this.faces[c],e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone(),e.__originalVertexNormals||\n(e.__originalVertexNormals=[]),a=0,b=e.vertexNormals.length;a<b;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone();var f=new THREE.Geometry;f.faces=this.faces;a=0;for(b=this.morphTargets.length;a<b;a++){if(!this.morphNormals[a]){this.morphNormals[a]={};this.morphNormals[a].faceNormals=[];this.morphNormals[a].vertexNormals=[];e=this.morphNormals[a].faceNormals;var g=this.morphNormals[a].vertexNormals,h,k;c=\n0;for(d=this.faces.length;c<d;c++)h=new THREE.Vector3,k={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},e.push(h),g.push(k)}g=this.morphNormals[a];f.vertices=this.morphTargets[a].vertices;f.computeFaceNormals();f.computeVertexNormals();c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],h=g.faceNormals[c],k=g.vertexNormals[c],h.copy(e.normal),k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],e.normal=\ne.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,f,g,h,k,l,n,q,r,t,s,p,v,w=[],u=[];c=new THREE.Vector3;var D=new THREE.Vector3,A=new THREE.Vector3,x=new THREE.Vector3,C=new THREE.Vector3;a=0;for(b=this.vertices.length;a<b;a++)w[a]=new THREE.Vector3,u[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],f=this.faceVertexUvs[0][a],d=e.a,v=e.b,e=e.c,g=this.vertices[d],h=this.vertices[v],k=this.vertices[e],l=f[0],n=f[1],q=f[2],\nf=h.x-g.x,r=k.x-g.x,t=h.y-g.y,s=k.y-g.y,h=h.z-g.z,g=k.z-g.z,k=n.x-l.x,p=q.x-l.x,n=n.y-l.y,l=q.y-l.y,q=1/(k*l-p*n),c.set((l*f-n*r)*q,(l*t-n*s)*q,(l*h-n*g)*q),D.set((k*r-p*f)*q,(k*s-p*t)*q,(k*g-p*h)*q),w[d].add(c),w[v].add(c),w[e].add(c),u[d].add(D),u[v].add(D),u[e].add(D);D=[\"a\",\"b\",\"c\",\"d\"];a=0;for(b=this.faces.length;a<b;a++)for(e=this.faces[a],c=0;c<Math.min(e.vertexNormals.length,3);c++)C.copy(e.vertexNormals[c]),d=e[D[c]],v=w[d],A.copy(v),A.sub(C.multiplyScalar(C.dot(v))).normalize(),x.crossVectors(e.vertexNormals[c],\nv),d=x.dot(u[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(A.x,A.y,A.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)0<c&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=a},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);this.boundingSphere.setFromPoints(this.vertices)},\nmerge:function(a,b,c){if(!1===a instanceof THREE.Geometry)console.error(\"THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.\",a);else{var d,e=this.vertices.length,f=this.vertices,g=a.vertices,h=this.faces,k=a.faces,l=this.faceVertexUvs[0];a=a.faceVertexUvs[0];void 0===c&&(c=0);void 0!==b&&(d=(new THREE.Matrix3).getNormalMatrix(b));for(var n=0,q=g.length;n<q;n++){var r=g[n].clone();void 0!==b&&r.applyMatrix4(b);f.push(r)}n=0;for(q=k.length;n<q;n++){var g=k[n],t,s=g.vertexNormals,p=\ng.vertexColors,r=new THREE.Face3(g.a+e,g.b+e,g.c+e);r.normal.copy(g.normal);void 0!==d&&r.normal.applyMatrix3(d).normalize();b=0;for(f=s.length;b<f;b++)t=s[b].clone(),void 0!==d&&t.applyMatrix3(d).normalize(),r.vertexNormals.push(t);r.color.copy(g.color);b=0;for(f=p.length;b<f;b++)t=p[b],r.vertexColors.push(t.clone());r.materialIndex=g.materialIndex+c;h.push(r)}n=0;for(q=a.length;n<q;n++)if(c=a[n],d=[],void 0!==c){b=0;for(f=c.length;b<f;b++)d.push(new THREE.Vector2(c[b].x,c[b].y));l.push(d)}}},mergeVertices:function(){var a=\n{},b=[],c=[],d,e=Math.pow(10,4),f,g;f=0;for(g=this.vertices.length;f<g;f++)d=this.vertices[f],d=Math.round(d.x*e)+\"_\"+Math.round(d.y*e)+\"_\"+Math.round(d.z*e),void 0===a[d]?(a[d]=f,b.push(this.vertices[f]),c[f]=b.length-1):c[f]=c[a[d]];a=[];f=0;for(g=this.faces.length;f<g;f++)for(e=this.faces[f],e.a=c[e.a],e.b=c[e.b],e.c=c[e.c],e=[e.a,e.b,e.c],d=0;3>d;d++)if(e[d]==e[(d+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(e=a[f],this.faces.splice(e,1),c=0,g=this.faceVertexUvs.length;c<g;c++)this.faceVertexUvs[c].splice(e,\n1);f=this.vertices.length-b.length;this.vertices=b;return f},makeGroups:function(){var a=0;return function(b,c){var d,e,f,g,h={},k,l=this.morphTargets.length,n=this.morphNormals.length;this.geometryGroups={};this.geometryGroupsList=[];d=0;for(e=this.faces.length;d<e;d++)f=this.faces[d],f=b?f.materialIndex:0,f in h||(h[f]={hash:f,counter:0}),g=h[f].hash+\"_\"+h[f].counter,g in this.geometryGroups||(k={id:a++,faces3:[],materialIndex:f,vertices:0,numMorphTargets:l,numMorphNormals:n},this.geometryGroups[g]=\nk,this.geometryGroupsList.push(k)),this.geometryGroups[g].vertices+3>c&&(h[f].counter+=1,g=h[f].hash+\"_\"+h[f].counter,g in this.geometryGroups||(k={id:a++,faces3:[],materialIndex:f,vertices:0,numMorphTargets:l,numMorphNormals:n},this.geometryGroups[g]=k,this.geometryGroupsList.push(k))),this.geometryGroups[g].faces3.push(d),this.geometryGroups[g].vertices+=3}}(),clone:function(){for(var a=new THREE.Geometry,b=this.vertices,c=0,d=b.length;c<d;c++)a.vertices.push(b[c].clone());b=this.faces;c=0;for(d=\nb.length;c<d;c++)a.faces.push(b[c].clone());b=this.faceVertexUvs[0];c=0;for(d=b.length;c<d;c++){for(var e=b[c],f=[],g=0,h=e.length;g<h;g++)f.push(new THREE.Vector2(e[g].x,e[g].y));a.faceVertexUvs[0].push(f)}return a},dispose:function(){this.dispatchEvent({type:\"dispose\"})}};THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype);THREE.GeometryIdCount=0;THREE.Camera=function(){THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};\nTHREE.Camera.prototype=Object.create(THREE.Object3D.prototype);THREE.Camera.prototype.lookAt=function(){var a=new THREE.Matrix4;return function(b){a.lookAt(this.position,b,this.up);this.quaternion.setFromRotationMatrix(a)}}();THREE.Camera.prototype.clone=function(a){void 0===a&&(a=new THREE.Camera);THREE.Object3D.prototype.clone.call(this,a);a.matrixWorldInverse.copy(this.matrixWorldInverse);a.projectionMatrix.copy(this.projectionMatrix);return a};\nTHREE.CubeCamera=function(a,b,c){THREE.Object3D.call(this);var d=new THREE.PerspectiveCamera(90,1,a,b);d.up.set(0,-1,0);d.lookAt(new THREE.Vector3(1,0,0));this.add(d);var e=new THREE.PerspectiveCamera(90,1,a,b);e.up.set(0,-1,0);e.lookAt(new THREE.Vector3(-1,0,0));this.add(e);var f=new THREE.PerspectiveCamera(90,1,a,b);f.up.set(0,0,1);f.lookAt(new THREE.Vector3(0,1,0));this.add(f);var g=new THREE.PerspectiveCamera(90,1,a,b);g.up.set(0,0,-1);g.lookAt(new THREE.Vector3(0,-1,0));this.add(g);var h=new THREE.PerspectiveCamera(90,\n1,a,b);h.up.set(0,-1,0);h.lookAt(new THREE.Vector3(0,0,1));this.add(h);var k=new THREE.PerspectiveCamera(90,1,a,b);k.up.set(0,-1,0);k.lookAt(new THREE.Vector3(0,0,-1));this.add(k);this.renderTarget=new THREE.WebGLRenderTargetCube(c,c,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter});this.updateCubeMap=function(a,b){var c=this.renderTarget,r=c.generateMipmaps;c.generateMipmaps=!1;c.activeCubeFace=0;a.render(b,d,c);c.activeCubeFace=1;a.render(b,e,c);c.activeCubeFace=\n2;a.render(b,f,c);c.activeCubeFace=3;a.render(b,g,c);c.activeCubeFace=4;a.render(b,h,c);c.generateMipmaps=r;c.activeCubeFace=5;a.render(b,k,c)}};THREE.CubeCamera.prototype=Object.create(THREE.Object3D.prototype);THREE.OrthographicCamera=function(a,b,c,d,e,f){THREE.Camera.call(this);this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:.1;this.far=void 0!==f?f:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype);\nTHREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix.makeOrthographic(this.left,this.right,this.top,this.bottom,this.near,this.far)};THREE.OrthographicCamera.prototype.clone=function(){var a=new THREE.OrthographicCamera;THREE.Camera.prototype.clone.call(this,a);a.left=this.left;a.right=this.right;a.top=this.top;a.bottom=this.bottom;a.near=this.near;a.far=this.far;return a};\nTHREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=void 0!==a?a:50;this.aspect=void 0!==b?b:1;this.near=void 0!==c?c:.1;this.far=void 0!==d?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=Object.create(THREE.Camera.prototype);THREE.PerspectiveCamera.prototype.setLens=function(a,b){void 0===b&&(b=24);this.fov=2*THREE.Math.radToDeg(Math.atan(b/(2*a)));this.updateProjectionMatrix()};\nTHREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,e,f){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=f;this.updateProjectionMatrix()};\nTHREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(THREE.Math.degToRad(.5*this.fov))*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix.makePerspective(this.fov,this.aspect,this.near,this.far)};\nTHREE.PerspectiveCamera.prototype.clone=function(){var a=new THREE.PerspectiveCamera;THREE.Camera.prototype.clone.call(this,a);a.fov=this.fov;a.aspect=this.aspect;a.near=this.near;a.far=this.far;return a};THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=Object.create(THREE.Object3D.prototype);THREE.Light.prototype.clone=function(a){void 0===a&&(a=new THREE.Light);THREE.Object3D.prototype.clone.call(this,a);a.color.copy(this.color);return a};\nTHREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=Object.create(THREE.Light.prototype);THREE.AmbientLight.prototype.clone=function(){var a=new THREE.AmbientLight;THREE.Light.prototype.clone.call(this,a);return a};\nTHREE.AreaLight=function(a,b){THREE.Light.call(this,a);this.normal=new THREE.Vector3(0,-1,0);this.right=new THREE.Vector3(1,0,0);this.intensity=void 0!==b?b:1;this.height=this.width=1;this.constantAttenuation=1.5;this.linearAttenuation=.5;this.quadraticAttenuation=.1};THREE.AreaLight.prototype=Object.create(THREE.Light.prototype);\nTHREE.DirectionalLight=function(a,b){THREE.Light.call(this,a);this.position.set(0,1,0);this.target=new THREE.Object3D;this.intensity=void 0!==b?b:1;this.onlyShadow=this.castShadow=!1;this.shadowCameraNear=50;this.shadowCameraFar=5E3;this.shadowCameraLeft=-500;this.shadowCameraTop=this.shadowCameraRight=500;this.shadowCameraBottom=-500;this.shadowCameraVisible=!1;this.shadowBias=0;this.shadowDarkness=.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCascade=!1;this.shadowCascadeOffset=new THREE.Vector3(0,\n0,-1E3);this.shadowCascadeCount=2;this.shadowCascadeBias=[0,0,0];this.shadowCascadeWidth=[512,512,512];this.shadowCascadeHeight=[512,512,512];this.shadowCascadeNearZ=[-1,.99,.998];this.shadowCascadeFarZ=[.99,.998,1];this.shadowCascadeArray=[];this.shadowMatrix=this.shadowCamera=this.shadowMapSize=this.shadowMap=null};THREE.DirectionalLight.prototype=Object.create(THREE.Light.prototype);\nTHREE.DirectionalLight.prototype.clone=function(){var a=new THREE.DirectionalLight;THREE.Light.prototype.clone.call(this,a);a.target=this.target.clone();a.intensity=this.intensity;a.castShadow=this.castShadow;a.onlyShadow=this.onlyShadow;a.shadowCameraNear=this.shadowCameraNear;a.shadowCameraFar=this.shadowCameraFar;a.shadowCameraLeft=this.shadowCameraLeft;a.shadowCameraRight=this.shadowCameraRight;a.shadowCameraTop=this.shadowCameraTop;a.shadowCameraBottom=this.shadowCameraBottom;a.shadowCameraVisible=\nthis.shadowCameraVisible;a.shadowBias=this.shadowBias;a.shadowDarkness=this.shadowDarkness;a.shadowMapWidth=this.shadowMapWidth;a.shadowMapHeight=this.shadowMapHeight;a.shadowCascade=this.shadowCascade;a.shadowCascadeOffset.copy(this.shadowCascadeOffset);a.shadowCascadeCount=this.shadowCascadeCount;a.shadowCascadeBias=this.shadowCascadeBias.slice(0);a.shadowCascadeWidth=this.shadowCascadeWidth.slice(0);a.shadowCascadeHeight=this.shadowCascadeHeight.slice(0);a.shadowCascadeNearZ=this.shadowCascadeNearZ.slice(0);\na.shadowCascadeFarZ=this.shadowCascadeFarZ.slice(0);return a};THREE.HemisphereLight=function(a,b,c){THREE.Light.call(this,a);this.position.set(0,100,0);this.groundColor=new THREE.Color(b);this.intensity=void 0!==c?c:1};THREE.HemisphereLight.prototype=Object.create(THREE.Light.prototype);THREE.HemisphereLight.prototype.clone=function(){var a=new THREE.HemisphereLight;THREE.Light.prototype.clone.call(this,a);a.groundColor.copy(this.groundColor);a.intensity=this.intensity;return a};\nTHREE.PointLight=function(a,b,c){THREE.Light.call(this,a);this.intensity=void 0!==b?b:1;this.distance=void 0!==c?c:0};THREE.PointLight.prototype=Object.create(THREE.Light.prototype);THREE.PointLight.prototype.clone=function(){var a=new THREE.PointLight;THREE.Light.prototype.clone.call(this,a);a.intensity=this.intensity;a.distance=this.distance;return a};\nTHREE.SpotLight=function(a,b,c,d,e){THREE.Light.call(this,a);this.position.set(0,1,0);this.target=new THREE.Object3D;this.intensity=void 0!==b?b:1;this.distance=void 0!==c?c:0;this.angle=void 0!==d?d:Math.PI/3;this.exponent=void 0!==e?e:10;this.onlyShadow=this.castShadow=!1;this.shadowCameraNear=50;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowCameraVisible=!1;this.shadowBias=0;this.shadowDarkness=.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowMatrix=this.shadowCamera=this.shadowMapSize=\nthis.shadowMap=null};THREE.SpotLight.prototype=Object.create(THREE.Light.prototype);\nTHREE.SpotLight.prototype.clone=function(){var a=new THREE.SpotLight;THREE.Light.prototype.clone.call(this,a);a.target=this.target.clone();a.intensity=this.intensity;a.distance=this.distance;a.angle=this.angle;a.exponent=this.exponent;a.castShadow=this.castShadow;a.onlyShadow=this.onlyShadow;a.shadowCameraNear=this.shadowCameraNear;a.shadowCameraFar=this.shadowCameraFar;a.shadowCameraFov=this.shadowCameraFov;a.shadowCameraVisible=this.shadowCameraVisible;a.shadowBias=this.shadowBias;a.shadowDarkness=\nthis.shadowDarkness;a.shadowMapWidth=this.shadowMapWidth;a.shadowMapHeight=this.shadowMapHeight;return a};THREE.Cache=function(){this.files={}};THREE.Cache.prototype={constructor:THREE.Cache,add:function(a,b){this.files[a]=b},get:function(a){return this.files[a]},remove:function(a){delete this.files[a]},clear:function(){this.files={}}};\nTHREE.Loader=function(a){this.statusDomElement=(this.showStatus=a)?THREE.Loader.prototype.addStatusElement():null;this.imageLoader=new THREE.ImageLoader;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};\nTHREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:void 0,addStatusElement:function(){var a=document.createElement(\"div\");a.style.position=\"absolute\";a.style.right=\"0px\";a.style.top=\"0px\";a.style.fontSize=\"0.8em\";a.style.textAlign=\"left\";a.style.background=\"rgba(0,0,0,0.25)\";a.style.color=\"#fff\";a.style.width=\"120px\";a.style.padding=\"0.5em 0.5em 0.5em 0.5em\";a.style.zIndex=1E3;a.innerHTML=\"Loading ...\";return a},updateProgress:function(a){var b=\"Loaded \",b=a.total?b+((100*a.loaded/a.total).toFixed(0)+\n\"%\"):b+((a.loaded/1024).toFixed(2)+\" KB\");this.statusDomElement.innerHTML=b},extractUrlBase:function(a){a=a.split(\"/\");if(1===a.length)return\"./\";a.pop();return a.join(\"/\")+\"/\"},initMaterials:function(a,b){for(var c=[],d=0;d<a.length;++d)c[d]=this.createMaterial(a[d],b);return c},needsTangents:function(a){for(var b=0,c=a.length;b<c;b++)if(a[b]instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(a,b){function c(a){a=Math.log(a)/Math.LN2;return Math.pow(2,Math.round(a))}function d(a,\nd,e,g,h,k,p){var v=b+e,w,u=THREE.Loader.Handlers.get(v);null!==u?w=u.load(v):(w=new THREE.Texture,u=f.imageLoader,u.crossOrigin=f.crossOrigin,u.load(v,function(a){if(!1===THREE.Math.isPowerOfTwo(a.width)||!1===THREE.Math.isPowerOfTwo(a.height)){var b=c(a.width),d=c(a.height),e=document.createElement(\"canvas\");e.width=b;e.height=d;e.getContext(\"2d\").drawImage(a,0,0,b,d);w.image=e}else w.image=a;w.needsUpdate=!0}));w.sourceFile=e;g&&(w.repeat.set(g[0],g[1]),1!==g[0]&&(w.wrapS=THREE.RepeatWrapping),\n1!==g[1]&&(w.wrapT=THREE.RepeatWrapping));h&&w.offset.set(h[0],h[1]);k&&(e={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==e[k[0]]&&(w.wrapS=e[k[0]]),void 0!==e[k[1]]&&(w.wrapT=e[k[1]]));p&&(w.anisotropy=p);a[d]=w}function e(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}var f=this,g=\"MeshLambertMaterial\",h={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,bumpMap:null,wireframe:!1};if(a.shading){var k=a.shading.toLowerCase();\"phong\"===k?g=\"MeshPhongMaterial\":\n\"basic\"===k&&(g=\"MeshBasicMaterial\")}void 0!==a.blending&&void 0!==THREE[a.blending]&&(h.blending=THREE[a.blending]);if(void 0!==a.transparent||1>a.opacity)h.transparent=a.transparent;void 0!==a.depthTest&&(h.depthTest=a.depthTest);void 0!==a.depthWrite&&(h.depthWrite=a.depthWrite);void 0!==a.visible&&(h.visible=a.visible);void 0!==a.flipSided&&(h.side=THREE.BackSide);void 0!==a.doubleSided&&(h.side=THREE.DoubleSide);void 0!==a.wireframe&&(h.wireframe=a.wireframe);void 0!==a.vertexColors&&(\"face\"===\na.vertexColors?h.vertexColors=THREE.FaceColors:a.vertexColors&&(h.vertexColors=THREE.VertexColors));a.colorDiffuse?h.color=e(a.colorDiffuse):a.DbgColor&&(h.color=a.DbgColor);a.colorSpecular&&(h.specular=e(a.colorSpecular));a.colorAmbient&&(h.ambient=e(a.colorAmbient));a.colorEmissive&&(h.emissive=e(a.colorEmissive));a.transparency&&(h.opacity=a.transparency);a.specularCoef&&(h.shininess=a.specularCoef);a.mapDiffuse&&b&&d(h,\"map\",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap,\na.mapDiffuseAnisotropy);a.mapLight&&b&&d(h,\"lightMap\",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap,a.mapLightAnisotropy);a.mapBump&&b&&d(h,\"bumpMap\",a.mapBump,a.mapBumpRepeat,a.mapBumpOffset,a.mapBumpWrap,a.mapBumpAnisotropy);a.mapNormal&&b&&d(h,\"normalMap\",a.mapNormal,a.mapNormalRepeat,a.mapNormalOffset,a.mapNormalWrap,a.mapNormalAnisotropy);a.mapSpecular&&b&&d(h,\"specularMap\",a.mapSpecular,a.mapSpecularRepeat,a.mapSpecularOffset,a.mapSpecularWrap,a.mapSpecularAnisotropy);a.mapAlpha&&\nb&&d(h,\"alphaMap\",a.mapAlpha,a.mapAlphaRepeat,a.mapAlphaOffset,a.mapAlphaWrap,a.mapAlphaAnisotropy);a.mapBumpScale&&(h.bumpScale=a.mapBumpScale);a.mapNormal?(g=THREE.ShaderLib.normalmap,k=THREE.UniformsUtils.clone(g.uniforms),k.tNormal.value=h.normalMap,a.mapNormalFactor&&k.uNormalScale.value.set(a.mapNormalFactor,a.mapNormalFactor),h.map&&(k.tDiffuse.value=h.map,k.enableDiffuse.value=!0),h.specularMap&&(k.tSpecular.value=h.specularMap,k.enableSpecular.value=!0),h.lightMap&&(k.tAO.value=h.lightMap,\nk.enableAO.value=!0),k.diffuse.value.setHex(h.color),k.specular.value.setHex(h.specular),k.ambient.value.setHex(h.ambient),k.shininess.value=h.shininess,void 0!==h.opacity&&(k.opacity.value=h.opacity),g=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:k,lights:!0,fog:!0}),h.transparent&&(g.transparent=!0)):g=new THREE[g](h);void 0!==a.DbgName&&(g.name=a.DbgName);return g}};\nTHREE.Loader.Handlers={handlers:[],add:function(a,b){this.handlers.push(a,b)},get:function(a){for(var b=0,c=this.handlers.length;b<c;b+=2){var d=this.handlers[b+1];if(this.handlers[b].test(a))return d}return null}};THREE.XHRLoader=function(a){this.cache=new THREE.Cache;this.manager=void 0!==a?a:THREE.DefaultLoadingManager};\nTHREE.XHRLoader.prototype={constructor:THREE.XHRLoader,load:function(a,b,c,d){var e=this,f=e.cache.get(a);void 0!==f?b&&b(f):TiddlyWiki&&a.match(/^tw:/)?(f=TiddlyWiki.load(a),e.manager.itemStart(a),void 0!==b&&(e.cache.add(a,f),b(f),e.manager.itemEnd(f)),hack.log(\"url: \"+a+\": loaded\",hack.loader,\"THREE.XHRLoader.load\")):(f=new XMLHttpRequest,f.open(\"GET\",a,!0),f.addEventListener(\"load\",function(c){e.cache.add(a,this.response);b&&b(this.response);e.manager.itemEnd(a)},!1),void 0!==c&&f.addEventListener(\"progress\",\nfunction(a){c(a)},!1),void 0!==d&&f.addEventListener(\"error\",function(a){d(a)},!1),void 0!==this.crossOrigin&&(f.crossOrigin=this.crossOrigin),void 0!==this.responseType&&(f.responseType=this.responseType),f.send(null),e.manager.itemStart(a))},setResponseType:function(a){this.responseType=a},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.ImageLoader=function(a){this.cache=new THREE.Cache;this.manager=void 0!==a?a:THREE.DefaultLoadingManager};\nTHREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d){var e=this,f=e.cache.get(a);if(void 0!==f)b(f);else return f=document.createElement(\"img\"),TiddlyWiki&&a.match(/^tw:/)&&(hack.log(\"url: \"+a+(f.crossOrigin?' [crossOrigin=\"'+f.crossOrigin+'\"]':\"\")+\": to be loaded\",hack.loader,\"THREE.ImageLoader.load\"),a=TiddlyWiki.load(a)),void 0!==b&&f.addEventListener(\"load\",function(c){e.cache.add(a,this);b(this);e.manager.itemEnd(a)},!1),void 0!==c&&f.addEventListener(\"progress\",\nfunction(a){c(a)},!1),void 0!==d&&f.addEventListener(\"error\",function(a){d(a)},!1),void 0!==this.crossOrigin&&(f.crossOrigin=this.crossOrigin),f.src=a,e.manager.itemStart(a),f},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a);this.withCredentials=!1};THREE.JSONLoader.prototype=Object.create(THREE.Loader.prototype);\nTHREE.JSONLoader.prototype.load=function(a,b,c){c=c&&\"string\"===typeof c?c:this.extractUrlBase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};\nTHREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){if(TiddlyWiki&&b.match(/^tw:/)){var f=JSON.parse(TiddlyWiki.load(b));void 0!==f.metadata&&\"scene\"===f.metadata.type?console.error('THREE.JSONLoader: \"'+b+'\" seems to be a Scene. Use THREE.SceneLoader instead.'):(f=a.parse(f,d),c(f.geometry,f.materials),a.onLoadComplete(),hack.log(\"url: \"+b+\": loaded\",hack.loader,\"THREE.JSONLoader.loadAjaxJSON\"))}else{var g=new XMLHttpRequest,h=0;g.onreadystatechange=function(){if(g.readyState===g.DONE)if(200===\ng.status||0===g.status){if(g.responseText){var f=JSON.parse(g.responseText);if(void 0!==f.metadata&&\"scene\"===f.metadata.type){console.error('THREE.JSONLoader: \"'+b+'\" seems to be a Scene. Use THREE.SceneLoader instead.');return}f=a.parse(f,d);c(f.geometry,f.materials)}else console.error('THREE.JSONLoader: \"'+b+'\" seems to be unreachable or the file is empty.');a.onLoadComplete()}else console.error(\"THREE.JSONLoader: Couldn't load \\\"\"+b+'\" ('+g.status+\")\");else g.readyState===g.LOADING?e&&(0===h&&\n(h=g.getResponseHeader(\"Content-Length\")),e({total:h,loaded:g.responseText.length})):g.readyState===g.HEADERS_RECEIVED&&void 0!==e&&(h=g.getResponseHeader(\"Content-Length\"))};g.open(\"GET\",b,!0);g.withCredentials=this.withCredentials;g.send(null)}};\nTHREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,g,h,k,l,n,q,r,t,s,p,v,w,u=a.faces;n=a.vertices;var D=a.normals,A=a.colors,x=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&x++;for(d=0;d<x;d++)c.faceVertexUvs[d]=[]}k=0;for(l=n.length;k<l;)d=new THREE.Vector3,d.x=n[k++]*b,d.y=n[k++]*b,d.z=n[k++]*b,c.vertices.push(d);k=0;for(l=u.length;k<l;)if(b=u[k++],t=b&1,h=b&2,d=b&8,q=b&16,s=b&32,n=b&64,b&=128,t){t=new THREE.Face3;\nt.a=u[k];t.b=u[k+1];t.c=u[k+3];p=new THREE.Face3;p.a=u[k+1];p.b=u[k+2];p.c=u[k+3];k+=4;h&&(h=u[k++],t.materialIndex=h,p.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<x;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)r=u[k++],w=v[2*r],r=v[2*r+1],w=new THREE.Vector2(w,r),2!==g&&c.faceVertexUvs[d][h].push(w),0!==g&&c.faceVertexUvs[d][h+1].push(w);q&&(q=3*u[k++],t.normal.set(D[q++],D[q++],D[q]),p.normal.copy(t.normal));if(s)for(d=0;4>d;d++)q=3*u[k++],s=new THREE.Vector3(D[q++],\nD[q++],D[q]),2!==d&&t.vertexNormals.push(s),0!==d&&p.vertexNormals.push(s);n&&(n=u[k++],n=A[n],t.color.setHex(n),p.color.setHex(n));if(b)for(d=0;4>d;d++)n=u[k++],n=A[n],2!==d&&t.vertexColors.push(new THREE.Color(n)),0!==d&&p.vertexColors.push(new THREE.Color(n));c.faces.push(t);c.faces.push(p)}else{t=new THREE.Face3;t.a=u[k++];t.b=u[k++];t.c=u[k++];h&&(h=u[k++],t.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<x;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)r=u[k++],w=v[2*r],r=v[2*r+1],\nw=new THREE.Vector2(w,r),c.faceVertexUvs[d][h].push(w);q&&(q=3*u[k++],t.normal.set(D[q++],D[q++],D[q]));if(s)for(d=0;3>d;d++)q=3*u[k++],s=new THREE.Vector3(D[q++],D[q++],D[q]),t.vertexNormals.push(s);n&&(n=u[k++],t.color.setHex(A[n]));if(b)for(d=0;3>d;d++)n=u[k++],t.vertexColors.push(new THREE.Color(A[n]));c.faces.push(t)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,g=a.skinWeights.length;d<g;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],\n1<b?a.skinWeights[d+1]:0,2<b?a.skinWeights[d+2]:0,3<b?a.skinWeights[d+3]:0));if(a.skinIndices)for(d=0,g=a.skinIndices.length;d<g;d+=b)c.skinIndices.push(new THREE.Vector4(a.skinIndices[d],1<b?a.skinIndices[d+1]:0,2<b?a.skinIndices[d+2]:0,3<b?a.skinIndices[d+3]:0));c.bones=a.bones;c.bones&&0<c.bones.length&&(c.skinWeights.length!==c.skinIndices.length||c.skinIndices.length!==c.vertices.length)&&console.warn(\"When skinning, number of vertices (\"+c.vertices.length+\"), skinIndices (\"+c.skinIndices.length+\n\"), and skinWeights (\"+c.skinWeights.length+\") should match.\");c.animation=a.animation;c.animations=a.animations})();(function(b){if(void 0!==a.morphTargets){var d,g,h,k,l,n;d=0;for(g=a.morphTargets.length;d<g;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=a.morphTargets[d].name,c.morphTargets[d].vertices=[],l=c.morphTargets[d].vertices,n=a.morphTargets[d].vertices,h=0,k=n.length;h<k;h+=3){var q=new THREE.Vector3;q.x=n[h]*b;q.y=n[h+1]*b;q.z=n[h+2]*b;l.push(q)}}if(void 0!==a.morphColors)for(d=\n0,g=a.morphColors.length;d<g;d++)for(c.morphColors[d]={},c.morphColors[d].name=a.morphColors[d].name,c.morphColors[d].colors=[],k=c.morphColors[d].colors,l=a.morphColors[d].colors,b=0,h=l.length;b<h;b+=3)n=new THREE.Color(16755200),n.setRGB(l[b],l[b+1],l[b+2]),k.push(n)})(d);c.computeFaceNormals();c.computeBoundingSphere();if(void 0===a.materials||0===a.materials.length)return{geometry:c};d=this.initMaterials(a.materials,b);this.needsTangents(d)&&c.computeTangents();return{geometry:c,materials:d}};\nTHREE.LoadingManager=function(a,b,c){var d=this,e=0,f=0;this.onLoad=a;this.onProgress=b;this.onError=c;this.itemStart=function(a){f++};this.itemEnd=function(a){e++;if(void 0!==d.onProgress)d.onProgress(a,e,f);if(e===f&&void 0!==d.onLoad)d.onLoad()}};THREE.DefaultLoadingManager=new THREE.LoadingManager;THREE.BufferGeometryLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};\nTHREE.BufferGeometryLoader.prototype={constructor:THREE.BufferGeometryLoader,load:function(a,b,c,d){var e=this,f=new THREE.XHRLoader;f.setCrossOrigin(this.crossOrigin);f.load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a){var b=new THREE.BufferGeometry,c=a.attributes,d;for(d in c){var e=c[d];b.attributes[d]={itemSize:e.itemSize,array:new self[e.type](e.array)}}c=a.offsets;void 0!==c&&(b.offsets=JSON.parse(JSON.stringify(c)));a=a.boundingSphere;\nvoid 0!==a&&(b.boundingSphere=new THREE.Sphere((new THREE.Vector3).fromArray(void 0!==a.center?a.center:[0,0,0]),a.radius));return b}};THREE.MaterialLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};\nTHREE.MaterialLoader.prototype={constructor:THREE.MaterialLoader,load:function(a,b,c,d){var e=this,f=new THREE.XHRLoader;f.setCrossOrigin(this.crossOrigin);f.load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a){var b=new THREE[a.type];void 0!==a.color&&b.color.setHex(a.color);void 0!==a.ambient&&b.ambient.setHex(a.ambient);void 0!==a.emissive&&b.emissive.setHex(a.emissive);void 0!==a.specular&&b.specular.setHex(a.specular);void 0!==a.shininess&&\n(b.shininess=a.shininess);void 0!==a.uniforms&&(b.uniforms=a.uniforms);void 0!==a.vertexShader&&(b.vertexShader=a.vertexShader);void 0!==a.fragmentShader&&(b.fragmentShader=a.fragmentShader);void 0!==a.vertexColors&&(b.vertexColors=a.vertexColors);void 0!==a.blending&&(b.blending=a.blending);void 0!==a.side&&(b.side=a.side);void 0!==a.opacity&&(b.opacity=a.opacity);void 0!==a.transparent&&(b.transparent=a.transparent);void 0!==a.wireframe&&(b.wireframe=a.wireframe);if(void 0!==a.materials)for(var c=\n0,d=a.materials.length;c<d;c++)b.materials.push(this.parse(a.materials[c]));return b}};THREE.ObjectLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};\nTHREE.ObjectLoader.prototype={constructor:THREE.ObjectLoader,load:function(a,b,c,d){var e=this,f=new THREE.XHRLoader(e.manager);f.setCrossOrigin(this.crossOrigin);f.load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a){var b=this.parseGeometries(a.geometries),c=this.parseMaterials(a.materials);return this.parseObject(a.object,b,c)},parseGeometries:function(a){var b={};if(void 0!==a)for(var c=new THREE.JSONLoader,d=new THREE.BufferGeometryLoader,\ne=0,f=a.length;e<f;e++){var g,h=a[e];switch(h.type){case \"PlaneGeometry\":g=new THREE.PlaneGeometry(h.width,h.height,h.widthSegments,h.heightSegments);break;case \"BoxGeometry\":case \"CubeGeometry\":g=new THREE.BoxGeometry(h.width,h.height,h.depth,h.widthSegments,h.heightSegments,h.depthSegments);break;case \"CircleGeometry\":g=new THREE.CircleGeometry(h.radius,h.segments);break;case \"CylinderGeometry\":g=new THREE.CylinderGeometry(h.radiusTop,h.radiusBottom,h.height,h.radialSegments,h.heightSegments,h.openEnded);\nbreak;case \"SphereGeometry\":g=new THREE.SphereGeometry(h.radius,h.widthSegments,h.heightSegments,h.phiStart,h.phiLength,h.thetaStart,h.thetaLength);break;case \"IcosahedronGeometry\":g=new THREE.IcosahedronGeometry(h.radius,h.detail);break;case \"TorusGeometry\":g=new THREE.TorusGeometry(h.radius,h.tube,h.radialSegments,h.tubularSegments,h.arc);break;case \"TorusKnotGeometry\":g=new THREE.TorusKnotGeometry(h.radius,h.tube,h.radialSegments,h.tubularSegments,h.p,h.q,h.heightScale);break;case \"BufferGeometry\":g=\nd.parse(h.data);break;case \"Geometry\":g=c.parse(h.data).geometry}g.uuid=h.uuid;void 0!==h.name&&(g.name=h.name);b[h.uuid]=g}return b},parseMaterials:function(a){var b={};if(void 0!==a)for(var c=new THREE.MaterialLoader,d=0,e=a.length;d<e;d++){var f=a[d],g=c.parse(f);g.uuid=f.uuid;void 0!==f.name&&(g.name=f.name);b[f.uuid]=g}return b},parseObject:function(){var a=new THREE.Matrix4;return function(b,c,d){var e;switch(b.type){case \"Scene\":e=new THREE.Scene;break;case \"PerspectiveCamera\":e=new THREE.PerspectiveCamera(b.fov,\nb.aspect,b.near,b.far);break;case \"OrthographicCamera\":e=new THREE.OrthographicCamera(b.left,b.right,b.top,b.bottom,b.near,b.far);break;case \"AmbientLight\":e=new THREE.AmbientLight(b.color);break;case \"DirectionalLight\":e=new THREE.DirectionalLight(b.color,b.intensity);break;case \"PointLight\":e=new THREE.PointLight(b.color,b.intensity,b.distance);break;case \"SpotLight\":e=new THREE.SpotLight(b.color,b.intensity,b.distance,b.angle,b.exponent);break;case \"HemisphereLight\":e=new THREE.HemisphereLight(b.color,\nb.groundColor,b.intensity);break;case \"Mesh\":e=c[b.geometry];var f=d[b.material];void 0===e&&console.error(\"THREE.ObjectLoader: Undefined geometry \"+b.geometry);void 0===f&&console.error(\"THREE.ObjectLoader: Undefined material \"+b.material);e=new THREE.Mesh(e,f);break;case \"Sprite\":f=d[b.material];void 0===f&&console.error(\"THREE.ObjectLoader: Undefined material \"+b.material);e=new THREE.Sprite(f);break;default:e=new THREE.Object3D}e.uuid=b.uuid;void 0!==b.name&&(e.name=b.name);void 0!==b.matrix?\n(a.fromArray(b.matrix),a.decompose(e.position,e.quaternion,e.scale)):(void 0!==b.position&&e.position.fromArray(b.position),void 0!==b.rotation&&e.rotation.fromArray(b.rotation),void 0!==b.scale&&e.scale.fromArray(b.scale));void 0!==b.visible&&(e.visible=b.visible);void 0!==b.userData&&(e.userData=b.userData);if(void 0!==b.children)for(var g in b.children)e.add(this.parseObject(b.children[g],c,d));return e}}()};THREE.TextureLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};\nTHREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a,b,c,d){var e=new THREE.ImageLoader(this.manager);e.setCrossOrigin(this.crossOrigin);e.load(a,function(a){a=new THREE.Texture(a);a.needsUpdate=!0;void 0!==b&&b(a)},c,d)},setCrossOrigin:function(a){this.crossOrigin=a}};\nTHREE.Material=function(){this.id=THREE.MaterialIdCount++;this.uuid=THREE.Math.generateUUID();this.name=\"\";this.side=THREE.FrontSide;this.opacity=1;this.transparent=!1;this.blending=THREE.NormalBlending;this.blendSrc=THREE.SrcAlphaFactor;this.blendDst=THREE.OneMinusSrcAlphaFactor;this.blendEquation=THREE.AddEquation;this.depthWrite=this.depthTest=!0;this.polygonOffset=!1;this.overdraw=this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.needsUpdate=this.visible=!0};\nTHREE.Material.prototype={constructor:THREE.Material,setValues:function(a){if(void 0!==a)for(var b in a){var c=a[b];if(void 0===c)console.warn(\"THREE.Material: '\"+b+\"' parameter is undefined.\");else if(b in this){var d=this[b];d instanceof THREE.Color?d.set(c):d instanceof THREE.Vector3&&c instanceof THREE.Vector3?d.copy(c):this[b]=\"overdraw\"==b?Number(c):c}}},clone:function(a){void 0===a&&(a=new THREE.Material);a.name=this.name;a.side=this.side;a.opacity=this.opacity;a.transparent=this.transparent;\na.blending=this.blending;a.blendSrc=this.blendSrc;a.blendDst=this.blendDst;a.blendEquation=this.blendEquation;a.depthTest=this.depthTest;a.depthWrite=this.depthWrite;a.polygonOffset=this.polygonOffset;a.polygonOffsetFactor=this.polygonOffsetFactor;a.polygonOffsetUnits=this.polygonOffsetUnits;a.alphaTest=this.alphaTest;a.overdraw=this.overdraw;a.visible=this.visible;return a},dispose:function(){this.dispatchEvent({type:\"dispose\"})}};THREE.EventDispatcher.prototype.apply(THREE.Material.prototype);\nTHREE.MaterialIdCount=0;THREE.LineBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.linewidth=1;this.linejoin=this.linecap=\"round\";this.vertexColors=THREE.NoColors;this.fog=!0;this.setValues(a)};THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype);\nTHREE.LineBasicMaterial.prototype.clone=function(){var a=new THREE.LineBasicMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.linewidth=this.linewidth;a.linecap=this.linecap;a.linejoin=this.linejoin;a.vertexColors=this.vertexColors;a.fog=this.fog;return a};THREE.LineDashedMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.scale=this.linewidth=1;this.dashSize=3;this.gapSize=1;this.vertexColors=!1;this.fog=!0;this.setValues(a)};\nTHREE.LineDashedMaterial.prototype=Object.create(THREE.Material.prototype);THREE.LineDashedMaterial.prototype.clone=function(){var a=new THREE.LineDashedMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.linewidth=this.linewidth;a.scale=this.scale;a.dashSize=this.dashSize;a.gapSize=this.gapSize;a.vertexColors=this.vertexColors;a.fog=this.fog;return a};\nTHREE.MeshBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.envMap=this.alphaMap=this.specularMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=.98;this.fog=!0;this.shading=THREE.SmoothShading;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap=\"round\";this.vertexColors=THREE.NoColors;this.morphTargets=this.skinning=!1;this.setValues(a)};\nTHREE.MeshBasicMaterial.prototype=Object.create(THREE.Material.prototype);\nTHREE.MeshBasicMaterial.prototype.clone=function(){var a=new THREE.MeshBasicMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.map=this.map;a.lightMap=this.lightMap;a.specularMap=this.specularMap;a.alphaMap=this.alphaMap;a.envMap=this.envMap;a.combine=this.combine;a.reflectivity=this.reflectivity;a.refractionRatio=this.refractionRatio;a.fog=this.fog;a.shading=this.shading;a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;a.wireframeLinecap=this.wireframeLinecap;\na.wireframeLinejoin=this.wireframeLinejoin;a.vertexColors=this.vertexColors;a.skinning=this.skinning;a.morphTargets=this.morphTargets;return a};\nTHREE.MeshLambertMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.ambient=new THREE.Color(16777215);this.emissive=new THREE.Color(0);this.wrapAround=!1;this.wrapRGB=new THREE.Vector3(1,1,1);this.envMap=this.alphaMap=this.specularMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=.98;this.fog=!0;this.shading=THREE.SmoothShading;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap=\n\"round\";this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=!1;this.setValues(a)};THREE.MeshLambertMaterial.prototype=Object.create(THREE.Material.prototype);\nTHREE.MeshLambertMaterial.prototype.clone=function(){var a=new THREE.MeshLambertMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.ambient.copy(this.ambient);a.emissive.copy(this.emissive);a.wrapAround=this.wrapAround;a.wrapRGB.copy(this.wrapRGB);a.map=this.map;a.lightMap=this.lightMap;a.specularMap=this.specularMap;a.alphaMap=this.alphaMap;a.envMap=this.envMap;a.combine=this.combine;a.reflectivity=this.reflectivity;a.refractionRatio=this.refractionRatio;a.fog=this.fog;\na.shading=this.shading;a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;a.wireframeLinecap=this.wireframeLinecap;a.wireframeLinejoin=this.wireframeLinejoin;a.vertexColors=this.vertexColors;a.skinning=this.skinning;a.morphTargets=this.morphTargets;a.morphNormals=this.morphNormals;return a};\nTHREE.MeshPhongMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.ambient=new THREE.Color(16777215);this.emissive=new THREE.Color(0);this.specular=new THREE.Color(1118481);this.shininess=30;this.wrapAround=this.metal=!1;this.wrapRGB=new THREE.Vector3(1,1,1);this.bumpMap=this.lightMap=this.map=null;this.bumpScale=1;this.normalMap=null;this.normalScale=new THREE.Vector2(1,1);this.envMap=this.alphaMap=this.specularMap=null;this.combine=THREE.MultiplyOperation;this.reflectivity=\n1;this.refractionRatio=.98;this.fog=!0;this.shading=THREE.SmoothShading;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap=\"round\";this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=!1;this.setValues(a)};THREE.MeshPhongMaterial.prototype=Object.create(THREE.Material.prototype);\nTHREE.MeshPhongMaterial.prototype.clone=function(){var a=new THREE.MeshPhongMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.ambient.copy(this.ambient);a.emissive.copy(this.emissive);a.specular.copy(this.specular);a.shininess=this.shininess;a.metal=this.metal;a.wrapAround=this.wrapAround;a.wrapRGB.copy(this.wrapRGB);a.map=this.map;a.lightMap=this.lightMap;a.bumpMap=this.bumpMap;a.bumpScale=this.bumpScale;a.normalMap=this.normalMap;a.normalScale.copy(this.normalScale);\na.specularMap=this.specularMap;a.alphaMap=this.alphaMap;a.envMap=this.envMap;a.combine=this.combine;a.reflectivity=this.reflectivity;a.refractionRatio=this.refractionRatio;a.fog=this.fog;a.shading=this.shading;a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;a.wireframeLinecap=this.wireframeLinecap;a.wireframeLinejoin=this.wireframeLinejoin;a.vertexColors=this.vertexColors;a.skinning=this.skinning;a.morphTargets=this.morphTargets;a.morphNormals=this.morphNormals;return a};\nTHREE.MeshDepthMaterial=function(a){THREE.Material.call(this);this.wireframe=this.morphTargets=!1;this.wireframeLinewidth=1;this.setValues(a)};THREE.MeshDepthMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshDepthMaterial.prototype.clone=function(){var a=new THREE.MeshDepthMaterial;THREE.Material.prototype.clone.call(this,a);a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;return a};\nTHREE.MeshNormalMaterial=function(a){THREE.Material.call(this,a);this.shading=THREE.FlatShading;this.wireframe=!1;this.wireframeLinewidth=1;this.morphTargets=!1;this.setValues(a)};THREE.MeshNormalMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshNormalMaterial.prototype.clone=function(){var a=new THREE.MeshNormalMaterial;THREE.Material.prototype.clone.call(this,a);a.shading=this.shading;a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;return a};\nTHREE.MeshFaceMaterial=function(a){this.materials=a instanceof Array?a:[]};THREE.MeshFaceMaterial.prototype.clone=function(){for(var a=new THREE.MeshFaceMaterial,b=0;b<this.materials.length;b++)a.materials.push(this.materials[b].clone());return a};THREE.PointCloudMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.map=null;this.size=1;this.sizeAttenuation=!0;this.vertexColors=THREE.NoColors;this.fog=!0;this.setValues(a)};THREE.PointCloudMaterial.prototype=Object.create(THREE.Material.prototype);\nTHREE.PointCloudMaterial.prototype.clone=function(){var a=new THREE.PointCloudMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.map=this.map;a.size=this.size;a.sizeAttenuation=this.sizeAttenuation;a.vertexColors=this.vertexColors;a.fog=this.fog;return a};THREE.ParticleBasicMaterial=function(a){console.warn(\"THREE.ParticleBasicMaterial has been renamed to THREE.PointCloudMaterial.\");return new THREE.PointCloudMaterial(a)};\nTHREE.ParticleSystemMaterial=function(a){console.warn(\"THREE.ParticleSystemMaterial has been renamed to THREE.PointCloudMaterial.\");return new THREE.PointCloudMaterial(a)};\nTHREE.ShaderMaterial=function(a){THREE.Material.call(this);this.defines={};this.uniforms={};this.attributes=null;this.vertexShader=\"void main() {\\n\\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\\n}\";this.fragmentShader=\"void main() {\\n\\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\\n}\";this.shading=THREE.SmoothShading;this.linewidth=1;this.wireframe=!1;this.wireframeLinewidth=1;this.lights=this.fog=!1;this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=\n!1;this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]};this.index0AttributeName=void 0;this.setValues(a)};THREE.ShaderMaterial.prototype=Object.create(THREE.Material.prototype);\nTHREE.ShaderMaterial.prototype.clone=function(){var a=new THREE.ShaderMaterial;THREE.Material.prototype.clone.call(this,a);a.fragmentShader=this.fragmentShader;a.vertexShader=this.vertexShader;a.uniforms=THREE.UniformsUtils.clone(this.uniforms);a.attributes=this.attributes;a.defines=this.defines;a.shading=this.shading;a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;a.fog=this.fog;a.lights=this.lights;a.vertexColors=this.vertexColors;a.skinning=this.skinning;a.morphTargets=\nthis.morphTargets;a.morphNormals=this.morphNormals;return a};THREE.RawShaderMaterial=function(a){THREE.ShaderMaterial.call(this,a)};THREE.RawShaderMaterial.prototype=Object.create(THREE.ShaderMaterial.prototype);THREE.RawShaderMaterial.prototype.clone=function(){var a=new THREE.RawShaderMaterial;THREE.ShaderMaterial.prototype.clone.call(this,a);return a};THREE.SpriteMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.map=null;this.rotation=0;this.fog=!1;this.setValues(a)};\nTHREE.SpriteMaterial.prototype=Object.create(THREE.Material.prototype);THREE.SpriteMaterial.prototype.clone=function(){var a=new THREE.SpriteMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.map=this.map;a.rotation=this.rotation;a.fog=this.fog;return a};THREE.SpriteCanvasMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.program=function(a,c){};this.setValues(a)};THREE.SpriteCanvasMaterial.prototype=Object.create(THREE.Material.prototype);\nTHREE.SpriteCanvasMaterial.prototype.clone=function(){var a=new THREE.SpriteCanvasMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.program=this.program;return a};THREE.ParticleCanvasMaterial=THREE.SpriteCanvasMaterial;\nTHREE.Texture=function(a,b,c,d,e,f,g,h,k){this.id=THREE.TextureIdCount++;this.uuid=THREE.Math.generateUUID();this.name=\"\";this.image=void 0!==a?a:THREE.Texture.DEFAULT_IMAGE;this.mipmaps=[];this.mapping=void 0!==b?b:THREE.Texture.DEFAULT_MAPPING;this.wrapS=void 0!==c?c:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==d?d:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==e?e:THREE.LinearFilter;this.minFilter=void 0!==f?f:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==k?k:1;this.format=void 0!==\ng?g:THREE.RGBAFormat;this.type=void 0!==h?h:THREE.UnsignedByteType;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.generateMipmaps=!0;this.premultiplyAlpha=!1;this.flipY=!0;this.unpackAlignment=4;this._needsUpdate=!1;this.onUpdate=null};THREE.Texture.DEFAULT_IMAGE=void 0;THREE.Texture.DEFAULT_MAPPING=new THREE.UVMapping;\nTHREE.Texture.prototype={constructor:THREE.Texture,get needsUpdate(){return this._needsUpdate},set needsUpdate(a){!0===a&&this.update();this._needsUpdate=a},clone:function(a){void 0===a&&(a=new THREE.Texture);a.image=this.image;a.mipmaps=this.mipmaps.slice(0);a.mapping=this.mapping;a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.minFilter=this.minFilter;a.anisotropy=this.anisotropy;a.format=this.format;a.type=this.type;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.generateMipmaps=\nthis.generateMipmaps;a.premultiplyAlpha=this.premultiplyAlpha;a.flipY=this.flipY;a.unpackAlignment=this.unpackAlignment;return a},update:function(){this.dispatchEvent({type:\"update\"})},dispose:function(){this.dispatchEvent({type:\"dispose\"})}};THREE.EventDispatcher.prototype.apply(THREE.Texture.prototype);THREE.TextureIdCount=0;THREE.CubeTexture=function(a,b,c,d,e,f,g,h,k){THREE.Texture.call(this,a,b,c,d,e,f,g,h,k);this.images=a};THREE.CubeTexture.prototype=Object.create(THREE.Texture.prototype);\nTHREE.CubeTexture.clone=function(a){void 0===a&&(a=new THREE.CubeTexture);THREE.Texture.prototype.clone.call(this,a);a.images=this.images;return a};THREE.CompressedTexture=function(a,b,c,d,e,f,g,h,k,l,n){THREE.Texture.call(this,null,f,g,h,k,l,d,e,n);this.image={width:b,height:c};this.mipmaps=a;this.generateMipmaps=!1};THREE.CompressedTexture.prototype=Object.create(THREE.Texture.prototype);\nTHREE.CompressedTexture.prototype.clone=function(){var a=new THREE.CompressedTexture;THREE.Texture.prototype.clone.call(this,a);return a};THREE.DataTexture=function(a,b,c,d,e,f,g,h,k,l,n){THREE.Texture.call(this,null,f,g,h,k,l,d,e,n);this.image={data:a,width:b,height:c}};THREE.DataTexture.prototype=Object.create(THREE.Texture.prototype);THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture;THREE.Texture.prototype.clone.call(this,a);return a};\nTHREE.PointCloud=function(a,b){THREE.Object3D.call(this);this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.PointCloudMaterial({color:16777215*Math.random()});this.sortParticles=!1};THREE.PointCloud.prototype=Object.create(THREE.Object3D.prototype);\nTHREE.PointCloud.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray;return function(c,d){var e=this,f=e.geometry,g=c.params.PointCloud.threshold;a.getInverse(this.matrixWorld);b.copy(c.ray).applyMatrix4(a);if(null===f.boundingBox||!1!==b.isIntersectionBox(f.boundingBox)){var h=g/((this.scale.x+this.scale.y+this.scale.z)/3),k=new THREE.Vector3,g=function(a,f){var g=b.distanceToPoint(a);if(g<h){var k=b.closestPointToPoint(a);k.applyMatrix4(e.matrixWorld);var l=c.ray.origin.distanceTo(k);\nd.push({distance:l,distanceToRay:g,point:k.clone(),index:f,face:null,object:e})}};if(f instanceof THREE.BufferGeometry){var l=f.attributes,n=l.position.array;if(void 0!==l.index){var l=l.index.array,q=f.offsets;0===q.length&&(q=[{start:0,count:l.length,index:0}]);for(var r=0,t=q.length;r<t;++r)for(var s=q[r].start,p=q[r].index,f=s,s=s+q[r].count;f<s;f++){var v=p+l[f];k.set(n[3*v],n[3*v+1],n[3*v+2]);g(k,v)}}else for(l=n.length/3,f=0;f<l;f++)k.set(n[3*f],n[3*f+1],n[3*f+2]),g(k,f)}else for(k=this.geometry.vertices,\nf=0;f<k.length;f++)g(k[f],f)}}}();THREE.PointCloud.prototype.clone=function(a){void 0===a&&(a=new THREE.PointCloud(this.geometry,this.material));a.sortParticles=this.sortParticles;THREE.Object3D.prototype.clone.call(this,a);return a};THREE.ParticleSystem=function(a,b){console.warn(\"THREE.ParticleSystem has been renamed to THREE.PointCloud.\");return new THREE.PointCloud(a,b)};\nTHREE.Line=function(a,b,c){THREE.Object3D.call(this);this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.LineBasicMaterial({color:16777215*Math.random()});this.type=void 0!==c?c:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=Object.create(THREE.Object3D.prototype);\nTHREE.Line.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere;return function(d,e){var f=d.linePrecision,f=f*f,g=this.geometry;null===g.boundingSphere&&g.computeBoundingSphere();c.copy(g.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==d.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(d.ray).applyMatrix4(a),g instanceof THREE.Geometry))for(var g=g.vertices,h=g.length,k=new THREE.Vector3,l=new THREE.Vector3,n=this.type===THREE.LineStrip?\n1:2,q=0;q<h-1;q+=n)if(!(b.distanceSqToSegment(g[q],g[q+1],l,k)>f)){var r=b.origin.distanceTo(l);r<d.near||r>d.far||e.push({distance:r,point:k.clone().applyMatrix4(this.matrixWorld),face:null,faceIndex:null,object:this})}}}();THREE.Line.prototype.clone=function(a){void 0===a&&(a=new THREE.Line(this.geometry,this.material,this.type));THREE.Object3D.prototype.clone.call(this,a);return a};\nTHREE.Mesh=function(a,b){THREE.Object3D.call(this);this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.MeshBasicMaterial({color:16777215*Math.random()});this.updateMorphTargets()};THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype);\nTHREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0<this.geometry.morphTargets.length){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var a=0,b=this.geometry.morphTargets.length;a<b;a++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[a].name]=a}};\nTHREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(void 0!==this.morphTargetDictionary[a])return this.morphTargetDictionary[a];console.log(\"THREE.Mesh.getMorphTargetIndexByName: morph target \"+a+\" does not exist. Returning 0.\");return 0};\nTHREE.Mesh.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere,d=new THREE.Vector3,e=new THREE.Vector3,f=new THREE.Vector3;return function(g,h){var k=this.geometry;null===k.boundingSphere&&k.computeBoundingSphere();c.copy(k.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==g.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(g.ray).applyMatrix4(a),null===k.boundingBox||!1!==b.isIntersectionBox(k.boundingBox)))if(k instanceof THREE.BufferGeometry){var l=\nthis.material;if(void 0!==l){var n=k.attributes,q,r,t=g.precision;if(void 0!==n.index){var s=n.index.array,p=n.position.array,v=k.offsets;0===v.length&&(v=[{start:0,count:s.length,index:0}]);for(var w=0,u=v.length;w<u;++w)for(var n=v[w].start,D=v[w].index,k=n,A=n+v[w].count;k<A;k+=3){n=D+s[k];q=D+s[k+1];r=D+s[k+2];d.set(p[3*n],p[3*n+1],p[3*n+2]);e.set(p[3*q],p[3*q+1],p[3*q+2]);f.set(p[3*r],p[3*r+1],p[3*r+2]);var x=l.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,l.side!==\nTHREE.DoubleSide);if(null!==x){x.applyMatrix4(this.matrixWorld);var C=g.ray.origin.distanceTo(x);C<t||C<g.near||C>g.far||h.push({distance:C,point:x,indices:[n,q,r],face:null,faceIndex:null,object:this})}}}else for(p=n.position.array,s=k=0,A=p.length;k<A;k+=3,s+=9)n=k,q=k+1,r=k+2,d.set(p[s],p[s+1],p[s+2]),e.set(p[s+3],p[s+4],p[s+5]),f.set(p[s+6],p[s+7],p[s+8]),x=l.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,l.side!==THREE.DoubleSide),null!==x&&(x.applyMatrix4(this.matrixWorld),\nC=g.ray.origin.distanceTo(x),C<t||C<g.near||C>g.far||h.push({distance:C,point:x,indices:[n,q,r],face:null,faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(s=this.material instanceof THREE.MeshFaceMaterial,p=!0===s?this.material.materials:null,t=g.precision,v=k.vertices,w=0,u=k.faces.length;w<u;w++)if(D=k.faces[w],l=!0===s?p[D.materialIndex]:this.material,void 0!==l){n=v[D.a];q=v[D.b];r=v[D.c];if(!0===l.morphTargets){x=k.morphTargets;C=this.morphTargetInfluences;d.set(0,0,0);\ne.set(0,0,0);f.set(0,0,0);for(var A=0,I=x.length;A<I;A++){var z=C[A];if(0!==z){var y=x[A].vertices;d.x+=(y[D.a].x-n.x)*z;d.y+=(y[D.a].y-n.y)*z;d.z+=(y[D.a].z-n.z)*z;e.x+=(y[D.b].x-q.x)*z;e.y+=(y[D.b].y-q.y)*z;e.z+=(y[D.b].z-q.z)*z;f.x+=(y[D.c].x-r.x)*z;f.y+=(y[D.c].y-r.y)*z;f.z+=(y[D.c].z-r.z)*z}}d.add(n);e.add(q);f.add(r);n=d;q=e;r=f}x=l.side===THREE.BackSide?b.intersectTriangle(r,q,n,!0):b.intersectTriangle(n,q,r,l.side!==THREE.DoubleSide);null!==x&&(x.applyMatrix4(this.matrixWorld),C=g.ray.origin.distanceTo(x),\nC<t||C<g.near||C>g.far||h.push({distance:C,point:x,face:D,faceIndex:w,object:this}))}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.accumulatedSclWeight=this.accumulatedPosWeight=this.accumulatedRotWeight=0};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);\nTHREE.Bone.prototype.updateMatrixWorld=function(a){THREE.Object3D.prototype.updateMatrixWorld.call(this,a);this.accumulatedSclWeight=this.accumulatedPosWeight=this.accumulatedRotWeight=0};\nTHREE.Skeleton=function(a,b,c){this.useVertexTexture=void 0!==c?c:!0;this.identityMatrix=new THREE.Matrix4;a=a||[];this.bones=a.slice(0);this.useVertexTexture?(this.boneTextureHeight=this.boneTextureWidth=a=256<this.bones.length?64:64<this.bones.length?32:16<this.bones.length?16:8,this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new THREE.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,THREE.RGBAFormat,THREE.FloatType),\nthis.boneTexture.minFilter=THREE.NearestFilter,this.boneTexture.magFilter=THREE.NearestFilter,this.boneTexture.generateMipmaps=!1,this.boneTexture.flipY=!1):this.boneMatrices=new Float32Array(16*this.bones.length);if(void 0===b)this.calculateInverses();else if(this.bones.length===b.length)this.boneInverses=b.slice(0);else for(console.warn(\"THREE.Skeleton bonInverses is the wrong length.\"),this.boneInverses=[],b=0,a=this.bones.length;b<a;b++)this.boneInverses.push(new THREE.Matrix4)};\nTHREE.Skeleton.prototype.calculateInverses=function(){this.boneInverses=[];for(var a=0,b=this.bones.length;a<b;a++){var c=new THREE.Matrix4;this.bones[a]&&c.getInverse(this.bones[a].matrixWorld);this.boneInverses.push(c)}};\nTHREE.Skeleton.prototype.pose=function(){for(var a,b=0,c=this.bones.length;b<c;b++)(a=this.bones[b])&&a.matrixWorld.getInverse(this.boneInverses[b]);b=0;for(c=this.bones.length;b<c;b++)if(a=this.bones[b])a.parent?(a.matrix.getInverse(a.parent.matrixWorld),a.matrix.multiply(a.matrixWorld)):a.matrix.copy(a.matrixWorld),a.matrix.decompose(a.position,a.quaternion,a.scale)};\nTHREE.Skeleton.prototype.update=function(){for(var a=new THREE.Matrix4,b=0,c=this.bones.length;b<c;b++)a.multiplyMatrices(this.bones[b]?this.bones[b].matrixWorld:this.identityMatrix,this.boneInverses[b]),a.flattenToArrayOffset(this.boneMatrices,16*b);this.useVertexTexture&&(this.boneTexture.needsUpdate=!0)};\nTHREE.SkinnedMesh=function(a,b,c){THREE.Mesh.call(this,a,b);this.bindMode=\"attached\";this.bindMatrix=new THREE.Matrix4;this.bindMatrixInverse=new THREE.Matrix4;a=[];if(this.geometry&&void 0!==this.geometry.bones){for(var d,e,f,g,h=0,k=this.geometry.bones.length;h<k;++h)d=this.geometry.bones[h],e=d.pos,f=d.rotq,g=d.scl,b=new THREE.Bone(this),a.push(b),b.name=d.name,b.position.set(e[0],e[1],e[2]),b.quaternion.set(f[0],f[1],f[2],f[3]),void 0!==g?b.scale.set(g[0],g[1],g[2]):b.scale.set(1,1,1);h=0;for(k=\nthis.geometry.bones.length;h<k;++h)d=this.geometry.bones[h],-1!==d.parent?a[d.parent].add(a[h]):this.add(a[h])}this.normalizeSkinWeights();this.updateMatrixWorld(!0);this.bind(new THREE.Skeleton(a,void 0,c))};THREE.SkinnedMesh.prototype=Object.create(THREE.Mesh.prototype);THREE.SkinnedMesh.prototype.bind=function(a,b){this.skeleton=a;void 0===b&&(this.updateMatrixWorld(!0),b=this.matrixWorld);this.bindMatrix.copy(b);this.bindMatrixInverse.getInverse(b)};THREE.SkinnedMesh.prototype.pose=function(){this.skeleton.pose()};\nTHREE.SkinnedMesh.prototype.normalizeSkinWeights=function(){if(this.geometry instanceof THREE.Geometry)for(var a=0;a<this.geometry.skinIndices.length;a++){var b=this.geometry.skinWeights[a],c=1/b.lengthManhattan();Infinity!==c?b.multiplyScalar(c):b.set(1)}};\nTHREE.SkinnedMesh.prototype.updateMatrixWorld=function(a){THREE.Mesh.prototype.updateMatrixWorld.call(this,!0);\"attached\"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):\"detached\"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn(\"THREE.SkinnedMesh unreckognized bindMode: \"+this.bindMode)};\nTHREE.SkinnedMesh.prototype.clone=function(a){void 0===a&&(a=new THREE.SkinnedMesh(this.geometry,this.material,this.useVertexTexture));THREE.Mesh.prototype.clone.call(this,a);return a};THREE.MorphAnimMesh=function(a,b){THREE.Mesh.call(this,a,b);this.duration=1E3;this.mirroredLoop=!1;this.currentKeyframe=this.lastKeyframe=this.time=0;this.direction=1;this.directionBackwards=!1;this.setFrameRange(0,this.geometry.morphTargets.length-1)};THREE.MorphAnimMesh.prototype=Object.create(THREE.Mesh.prototype);\nTHREE.MorphAnimMesh.prototype.setFrameRange=function(a,b){this.startKeyframe=a;this.endKeyframe=b;this.length=this.endKeyframe-this.startKeyframe+1};THREE.MorphAnimMesh.prototype.setDirectionForward=function(){this.direction=1;this.directionBackwards=!1};THREE.MorphAnimMesh.prototype.setDirectionBackward=function(){this.direction=-1;this.directionBackwards=!0};\nTHREE.MorphAnimMesh.prototype.parseAnimations=function(){var a=this.geometry;a.animations||(a.animations={});for(var b,c=a.animations,d=/([a-z]+)_?(\\d+)/,e=0,f=a.morphTargets.length;e<f;e++){var g=a.morphTargets[e].name.match(d);if(g&&1<g.length){g=g[1];c[g]||(c[g]={start:Infinity,end:-Infinity});var h=c[g];e<h.start&&(h.start=e);e>h.end&&(h.end=e);b||(b=g)}}a.firstAnimation=b};\nTHREE.MorphAnimMesh.prototype.setAnimationLabel=function(a,b,c){this.geometry.animations||(this.geometry.animations={});this.geometry.animations[a]={start:b,end:c}};THREE.MorphAnimMesh.prototype.playAnimation=function(a,b){var c=this.geometry.animations[a];c?(this.setFrameRange(c.start,c.end),this.duration=(c.end-c.start)/b*1E3,this.time=0):console.warn(\"animation[\"+a+\"] undefined\")};\nTHREE.MorphAnimMesh.prototype.updateAnimation=function(a){var b=this.duration/this.length;this.time+=this.direction*a;if(this.mirroredLoop){if(this.time>this.duration||0>this.time)this.direction*=-1,this.time>this.duration&&(this.time=this.duration,this.directionBackwards=!0),0>this.time&&(this.time=0,this.directionBackwards=!1)}else this.time%=this.duration,0>this.time&&(this.time+=this.duration);a=this.startKeyframe+THREE.Math.clamp(Math.floor(this.time/b),0,this.length-1);a!==this.currentKeyframe&&\n(this.morphTargetInfluences[this.lastKeyframe]=0,this.morphTargetInfluences[this.currentKeyframe]=1,this.morphTargetInfluences[a]=0,this.lastKeyframe=this.currentKeyframe,this.currentKeyframe=a);b=this.time%b/b;this.directionBackwards&&(b=1-b);this.morphTargetInfluences[this.currentKeyframe]=b;this.morphTargetInfluences[this.lastKeyframe]=1-b};\nTHREE.MorphAnimMesh.prototype.interpolateTargets=function(a,b,c){for(var d=this.morphTargetInfluences,e=0,f=d.length;e<f;e++)d[e]=0;-1<a&&(d[a]=1-c);-1<b&&(d[b]=c)};\nTHREE.MorphAnimMesh.prototype.clone=function(a){void 0===a&&(a=new THREE.MorphAnimMesh(this.geometry,this.material));a.duration=this.duration;a.mirroredLoop=this.mirroredLoop;a.time=this.time;a.lastKeyframe=this.lastKeyframe;a.currentKeyframe=this.currentKeyframe;a.direction=this.direction;a.directionBackwards=this.directionBackwards;THREE.Mesh.prototype.clone.call(this,a);return a};THREE.LOD=function(){THREE.Object3D.call(this);this.objects=[]};THREE.LOD.prototype=Object.create(THREE.Object3D.prototype);\nTHREE.LOD.prototype.addLevel=function(a,b){void 0===b&&(b=0);b=Math.abs(b);for(var c=0;c<this.objects.length&&!(b<this.objects[c].distance);c++);this.objects.splice(c,0,{distance:b,object:a});this.add(a)};THREE.LOD.prototype.getObjectForDistance=function(a){for(var b=1,c=this.objects.length;b<c&&!(a<this.objects[b].distance);b++);return this.objects[b-1].object};\nTHREE.LOD.prototype.raycast=function(){var a=new THREE.Vector3;return function(b,c){a.setFromMatrixPosition(this.matrixWorld);var d=b.ray.origin.distanceTo(a);this.getObjectForDistance(d).raycast(b,c)}}();\nTHREE.LOD.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){if(1<this.objects.length){a.setFromMatrixPosition(c.matrixWorld);b.setFromMatrixPosition(this.matrixWorld);c=a.distanceTo(b);this.objects[0].object.visible=!0;for(var d=1,e=this.objects.length;d<e;d++)if(c>=this.objects[d].distance)this.objects[d-1].object.visible=!1,this.objects[d].object.visible=!0;else break;for(;d<e;d++)this.objects[d].object.visible=!1}}}();\nTHREE.LOD.prototype.clone=function(a){void 0===a&&(a=new THREE.LOD);THREE.Object3D.prototype.clone.call(this,a);for(var b=0,c=this.objects.length;b<c;b++){var d=this.objects[b].object.clone();d.visible=0===b;a.addLevel(d,this.objects[b].distance)}return a};\nTHREE.Sprite=function(){var a=new Float32Array([-.5,-.5,0,.5,-.5,0,.5,.5,0]),b=new THREE.BufferGeometry;b.addAttribute(\"position\",new THREE.BufferAttribute(a,3));return function(a){THREE.Object3D.call(this);this.geometry=b;this.material=void 0!==a?a:new THREE.SpriteMaterial}}();THREE.Sprite.prototype=Object.create(THREE.Object3D.prototype);\nTHREE.Sprite.prototype.raycast=function(){var a=new THREE.Vector3;return function(b,c){a.setFromMatrixPosition(this.matrixWorld);var d=b.ray.distanceToPoint(a);d>this.scale.x||c.push({distance:d,point:this.position,face:null,object:this})}}();THREE.Sprite.prototype.updateMatrix=function(){this.matrix.compose(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=!0};\nTHREE.Sprite.prototype.clone=function(a){void 0===a&&(a=new THREE.Sprite(this.material));THREE.Object3D.prototype.clone.call(this,a);return a};THREE.Particle=THREE.Sprite;THREE.Scene=function(){THREE.Object3D.call(this);this.overrideMaterial=this.fog=null;this.autoUpdate=!0;this.matrixAutoUpdate=!1;this.__lights=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=Object.create(THREE.Object3D.prototype);\nTHREE.Scene.prototype.__addObject=function(a){if(a instanceof THREE.Light)-1===this.__lights.indexOf(a)&&this.__lights.push(a),a.target&&void 0===a.target.parent&&this.add(a.target);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)){this.__objectsAdded.push(a);var b=this.__objectsRemoved.indexOf(a);-1!==b&&this.__objectsRemoved.splice(b,1)}this.dispatchEvent({type:\"objectAdded\",object:a});a.dispatchEvent({type:\"addedToScene\",scene:this});for(b=0;b<a.children.length;b++)this.__addObject(a.children[b])};\nTHREE.Scene.prototype.__removeObject=function(a){if(a instanceof THREE.Light){var b=this.__lights.indexOf(a);-1!==b&&this.__lights.splice(b,1);if(a.shadowCascadeArray)for(b=0;b<a.shadowCascadeArray.length;b++)this.__removeObject(a.shadowCascadeArray[b])}else a instanceof THREE.Camera||(this.__objectsRemoved.push(a),b=this.__objectsAdded.indexOf(a),-1!==b&&this.__objectsAdded.splice(b,1));this.dispatchEvent({type:\"objectRemoved\",object:a});a.dispatchEvent({type:\"removedFromScene\",scene:this});for(b=\n0;b<a.children.length;b++)this.__removeObject(a.children[b])};THREE.Scene.prototype.clone=function(a){void 0===a&&(a=new THREE.Scene);THREE.Object3D.prototype.clone.call(this,a);null!==this.fog&&(a.fog=this.fog.clone());null!==this.overrideMaterial&&(a.overrideMaterial=this.overrideMaterial.clone());a.autoUpdate=this.autoUpdate;a.matrixAutoUpdate=this.matrixAutoUpdate;return a};THREE.Fog=function(a,b,c){this.name=\"\";this.color=new THREE.Color(a);this.near=void 0!==b?b:1;this.far=void 0!==c?c:1E3};\nTHREE.Fog.prototype.clone=function(){return new THREE.Fog(this.color.getHex(),this.near,this.far)};THREE.FogExp2=function(a,b){this.name=\"\";this.color=new THREE.Color(a);this.density=void 0!==b?b:2.5E-4};THREE.FogExp2.prototype.clone=function(){return new THREE.FogExp2(this.color.getHex(),this.density)};\nTHREE.CanvasRenderer=function(a){function b(a,b,c,d){l(b);n(c);q(d);r(a.getStyle());O.stroke();ra.expandByScalar(2*b)}function c(a){t(a.getStyle());O.fill()}function d(a){e(a.target)}function e(a){if(!(a instanceof THREE.CompressedTexture)){var b=a.wrapS===THREE.RepeatWrapping,c=a.wrapT===THREE.RepeatWrapping,d=a.image,e=document.createElement(\"canvas\");e.width=d.width;e.height=d.height;var f=e.getContext(\"2d\");f.setTransform(1,0,0,-1,0,d.height);f.drawImage(d,0,0);Ca[a.id]=O.createPattern(e,!0===\nb&&!0===c?\"repeat\":!0===b&&!1===c?\"repeat-x\":!1===b&&!0===c?\"repeat-y\":\"no-repeat\")}}function f(a,b,c,f,g,h,k,l,n,r,q,s,p){if(!(p instanceof THREE.DataTexture)){!1===p.hasEventListener(\"update\",d)&&(void 0!==p.image&&0<p.image.width&&e(p),p.addEventListener(\"update\",d));var m=Ca[p.id];if(void 0!==m){t(m);var m=p.offset.x/p.repeat.x,w=p.offset.y/p.repeat.y,u=p.image.width*p.repeat.x;p=p.image.height*p.repeat.y;k=(k+m)*u;l=(l+w)*p;c-=a;f-=b;g-=a;h-=b;n=(n+m)*u-k;r=(r+w)*p-l;q=(q+m)*u-k;s=(s+w)*p-l;\np=n*s-q*r;0!==p&&(m=1/p,p=(s*c-r*g)*m,r=(s*f-r*h)*m,c=(n*g-q*c)*m,f=(n*h-q*f)*m,a=a-p*k-c*l,b=b-r*k-f*l,O.save(),O.transform(p,r,c,f,a,b),O.fill(),O.restore())}else t(\"rgba(0,0,0,1)\"),O.fill()}}function g(a,b,c){var d=b.x-a.x,e=b.y-a.y,f=d*d+e*e;0!==f&&(c/=Math.sqrt(f),d*=c,e*=c,b.x+=d,b.y+=e,a.x-=d,a.y-=e)}function h(a){Q!==a&&(Q=O.globalAlpha=a)}function k(a){L!==a&&(a===THREE.NormalBlending?O.globalCompositeOperation=\"source-over\":a===THREE.AdditiveBlending?O.globalCompositeOperation=\"lighter\":\na===THREE.SubtractiveBlending&&(O.globalCompositeOperation=\"darker\"),L=a)}function l(a){S!==a&&(S=O.lineWidth=a)}function n(a){V!==a&&(V=O.lineCap=a)}function q(a){W!==a&&(W=O.lineJoin=a)}function r(a){R!==a&&(R=O.strokeStyle=a)}function t(a){B!==a&&(B=O.fillStyle=a)}function s(a){H.length!==a.length&&(O.setLineDash(a),H=a)}console.log(\"THREE.CanvasRenderer\",THREE.REVISION);var p=THREE.Math.smoothstep;a=a||{};var v=this,w,u,D,A=new THREE.Projector,x=void 0!==a.canvas?a.canvas:document.createElement(\"canvas\"),\nC=x.width,I=x.height,z=Math.floor(C/2),y=Math.floor(I/2),K=0,N=0,ba=C,P=I,O=x.getContext(\"2d\",{alpha:!0===a.alpha}),J=new THREE.Color(0),E=0,Q=1,L=0,R=null,B=null,S=null,V=null,W=null,H=[],oa,$,X,T;new THREE.RenderableVertex;new THREE.RenderableVertex;var ya,Ea,Aa,za,Oa,Pa,G=new THREE.Color;new THREE.Color;new THREE.Color;new THREE.Color;new THREE.Color;var Ba=new THREE.Color,Ya=new THREE.Color,Za=new THREE.Color,Ca={},ca,la,qa,ua,ja,Fa,va,Ka=new THREE.Box2,aa=new THREE.Box2,ra=new THREE.Box2,Da=\nnew THREE.Color,Qa=new THREE.Color,cb=new THREE.Color,Ga=new THREE.Vector3,xa=new THREE.Vector3,ma=new THREE.Vector3,Ja=new THREE.Matrix3;void 0===O.setLineDash&&(O.setLineDash=function(){});this.domElement=x;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.supportsVertexTextures=function(){};this.setFaceCulling=function(){};this.setSize=\nfunction(a,b,c){C=a*this.devicePixelRatio;I=b*this.devicePixelRatio;x.width=C;x.height=I;z=Math.floor(C/2);y=Math.floor(I/2);!1!==c&&(x.style.width=a+\"px\",x.style.height=b+\"px\");Ka.min.set(-z,-y);Ka.max.set(z,y);aa.min.set(-z,-y);aa.max.set(z,y);Q=1;L=0;W=V=S=B=R=null;this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){K=a*this.devicePixelRatio;N=b*this.devicePixelRatio;ba=c*this.devicePixelRatio;P=d*this.devicePixelRatio};this.setScissor=function(){};this.enableScissorTest=function(){};\nthis.setClearColor=function(a,b){J.set(a);E=void 0!==b?b:1;aa.min.set(-z,-y);aa.max.set(z,y)};this.setClearColorHex=function(a,b){console.warn(\"THREE.CanvasRenderer: .setClearColorHex() is being removed. Use .setClearColor() instead.\");this.setClearColor(a,b)};this.getClearColor=function(){return J};this.getClearAlpha=function(){return E};this.getMaxAnisotropy=function(){return 0};this.clear=function(){!1===aa.empty()&&(aa.intersect(Ka),aa.expandByScalar(2),aa.min.x+=z,aa.min.y=-aa.min.y+y,aa.max.x+=\nz,aa.max.y=-aa.max.y+y,1>E&&O.clearRect(aa.min.x|0,aa.min.y|0,aa.max.x-aa.min.x|0,aa.max.y-aa.min.y|0),0<E&&(k(THREE.NormalBlending),h(1),t(\"rgba(\"+Math.floor(255*J.r)+\",\"+Math.floor(255*J.g)+\",\"+Math.floor(255*J.b)+\",\"+E+\")\"),O.fillRect(aa.min.x|0,aa.min.y|0,aa.max.x-aa.min.x|0,aa.max.y-aa.min.y|0)),aa.makeEmpty())};this.clearColor=function(){};this.clearDepth=function(){};this.clearStencil=function(){};this.render=function(a,x){if(!1===x instanceof THREE.Camera)console.error(\"THREE.CanvasRenderer.render: camera is not an instance of THREE.Camera.\");\nelse{!0===this.autoClear&&this.clear();v.info.render.vertices=0;v.info.render.faces=0;O.setTransform(ba/C,0,0,-P/I,K,I-N);O.translate(z,y);w=A.projectScene(a,x,this.sortObjects,this.sortElements);u=w.elements;D=w.lights;oa=x;Ja.getNormalMatrix(x.matrixWorldInverse);Da.setRGB(0,0,0);Qa.setRGB(0,0,0);cb.setRGB(0,0,0);for(var L=0,Q=D.length;L<Q;L++){var E=D[L],H=E.color;E instanceof THREE.AmbientLight?Da.add(H):E instanceof THREE.DirectionalLight?Qa.add(H):E instanceof THREE.PointLight&&cb.add(H)}L=\n0;for(Q=u.length;L<Q;L++){var J=u[L],B=J.material;if(void 0!==B&&0!==B.opacity){ra.makeEmpty();if(J instanceof THREE.RenderableSprite){$=J;$.x*=z;$.y*=y;var E=$,R=J,H=B;h(H.opacity);k(H.blending);var ea=R.scale.x*z,R=R.scale.y*y,J=.5*Math.sqrt(ea*ea+R*R);ra.min.set(E.x-J,E.y-J);ra.max.set(E.x+J,E.y+J);if(H instanceof THREE.SpriteMaterial){var da=H.map;if(null!==da&&void 0!==da.image){!1===da.hasEventListener(\"update\",d)&&(0<da.image.width&&e(da),da.addEventListener(\"update\",d));J=Ca[da.id];void 0!==\nJ?t(J):t(\"rgba( 0, 0, 0, 1 )\");var S=da.image,J=S.width*da.offset.x,B=S.height*da.offset.y,V=S.width*da.repeat.x,da=S.height*da.repeat.y,S=ea/V,m=R/da;O.save();O.translate(E.x,E.y);0!==H.rotation&&O.rotate(H.rotation);O.translate(-ea/2,-R/2);O.scale(S,m);O.translate(-J,-B);O.fillRect(J,B,V,da)}else t(H.color.getStyle()),O.save(),O.translate(E.x,E.y),0!==H.rotation&&O.rotate(H.rotation),O.scale(ea,-R),O.fillRect(-.5,-.5,1,1);O.restore()}else H instanceof THREE.SpriteCanvasMaterial&&(r(H.color.getStyle()),\nt(H.color.getStyle()),O.save(),O.translate(E.x,E.y),0!==H.rotation&&O.rotate(H.rotation),O.scale(ea,R),H.program(O),O.restore())}else if(J instanceof THREE.RenderableLine){if($=J.v1,X=J.v2,$.positionScreen.x*=z,$.positionScreen.y*=y,X.positionScreen.x*=z,X.positionScreen.y*=y,ra.setFromPoints([$.positionScreen,X.positionScreen]),!0===Ka.isIntersectionBox(ra))if(E=$,H=X,ea=J,R=B,h(R.opacity),k(R.blending),O.beginPath(),O.moveTo(E.positionScreen.x,E.positionScreen.y),O.lineTo(H.positionScreen.x,H.positionScreen.y),\nR instanceof THREE.LineBasicMaterial){l(R.linewidth);n(R.linecap);q(R.linejoin);if(R.vertexColors!==THREE.VertexColors)r(R.color.getStyle());else if(J=ea.vertexColors[0].getStyle(),ea=ea.vertexColors[1].getStyle(),J===ea)r(J);else{try{var W=O.createLinearGradient(E.positionScreen.x,E.positionScreen.y,H.positionScreen.x,H.positionScreen.y);W.addColorStop(0,J);W.addColorStop(1,ea)}catch(xb){W=J}r(W)}O.stroke();ra.expandByScalar(2*R.linewidth)}else R instanceof THREE.LineDashedMaterial&&(l(R.linewidth),\nn(R.linecap),q(R.linejoin),r(R.color.getStyle()),s([R.dashSize,R.gapSize]),O.stroke(),ra.expandByScalar(2*R.linewidth),s([]))}else if(J instanceof THREE.RenderableFace){$=J.v1;X=J.v2;T=J.v3;if(-1>$.positionScreen.z||1<$.positionScreen.z)continue;if(-1>X.positionScreen.z||1<X.positionScreen.z)continue;if(-1>T.positionScreen.z||1<T.positionScreen.z)continue;$.positionScreen.x*=z;$.positionScreen.y*=y;X.positionScreen.x*=z;X.positionScreen.y*=y;T.positionScreen.x*=z;T.positionScreen.y*=y;0<B.overdraw&&\n(g($.positionScreen,X.positionScreen,B.overdraw),g(X.positionScreen,T.positionScreen,B.overdraw),g(T.positionScreen,$.positionScreen,B.overdraw));ra.setFromPoints([$.positionScreen,X.positionScreen,T.positionScreen]);if(!0===Ka.isIntersectionBox(ra)){H=$;ea=X;R=T;E=B;v.info.render.vertices+=3;v.info.render.faces++;h(E.opacity);k(E.blending);ya=H.positionScreen.x;Ea=H.positionScreen.y;Aa=ea.positionScreen.x;za=ea.positionScreen.y;Oa=R.positionScreen.x;Pa=R.positionScreen.y;var B=ya,V=Ea,da=Aa,S=za,\nm=Oa,Ta=Pa;O.beginPath();O.moveTo(B,V);O.lineTo(da,S);O.lineTo(m,Ta);O.closePath();if((E instanceof THREE.MeshLambertMaterial||E instanceof THREE.MeshPhongMaterial)&&null===E.map){Ba.copy(E.color);Ya.copy(E.emissive);E.vertexColors===THREE.FaceColors&&Ba.multiply(J.color);G.copy(Da);xa.copy(H.positionWorld).add(ea.positionWorld).add(R.positionWorld).divideScalar(3);H=xa;ea=J.normalModel;R=G;J=0;for(B=D.length;J<B;J++)V=D[J],Za.copy(V.color),V instanceof THREE.DirectionalLight?(da=Ga.setFromMatrixPosition(V.matrixWorld).normalize(),\nS=ea.dot(da),0>=S||(S*=V.intensity,R.add(Za.multiplyScalar(S)))):V instanceof THREE.PointLight&&(da=Ga.setFromMatrixPosition(V.matrixWorld),S=ea.dot(Ga.subVectors(da,H).normalize()),0>=S||(S*=0==V.distance?1:1-Math.min(H.distanceTo(da)/V.distance,1),0!=S&&(S*=V.intensity,R.add(Za.multiplyScalar(S)))));G.multiply(Ba).add(Ya);!0===E.wireframe?b(G,E.wireframeLinewidth,E.wireframeLinecap,E.wireframeLinejoin):c(G)}else E instanceof THREE.MeshBasicMaterial||E instanceof THREE.MeshLambertMaterial||E instanceof\nTHREE.MeshPhongMaterial?null!==E.map?E.map.mapping instanceof THREE.UVMapping&&(ca=J.uvs,f(ya,Ea,Aa,za,Oa,Pa,ca[0].x,ca[0].y,ca[1].x,ca[1].y,ca[2].x,ca[2].y,E.map)):null!==E.envMap?E.envMap.mapping instanceof THREE.SphericalReflectionMapping?(ma.copy(J.vertexNormalsModel[0]).applyMatrix3(Ja),la=.5*ma.x+.5,qa=.5*ma.y+.5,ma.copy(J.vertexNormalsModel[1]).applyMatrix3(Ja),ua=.5*ma.x+.5,ja=.5*ma.y+.5,ma.copy(J.vertexNormalsModel[2]).applyMatrix3(Ja),Fa=.5*ma.x+.5,va=.5*ma.y+.5,f(ya,Ea,Aa,za,Oa,Pa,la,qa,\nua,ja,Fa,va,E.envMap)):E.envMap.mapping instanceof THREE.SphericalRefractionMapping&&(ma.copy(J.vertexNormalsModel[0]).applyMatrix3(Ja),la=-.5*ma.x+.5,qa=-.5*ma.y+.5,ma.copy(J.vertexNormalsModel[1]).applyMatrix3(Ja),ua=-.5*ma.x+.5,ja=-.5*ma.y+.5,ma.copy(J.vertexNormalsModel[2]).applyMatrix3(Ja),Fa=-.5*ma.x+.5,va=-.5*ma.y+.5,f(ya,Ea,Aa,za,Oa,Pa,la,qa,ua,ja,Fa,va,E.envMap)):(G.copy(E.color),E.vertexColors===THREE.FaceColors&&G.multiply(J.color),!0===E.wireframe?b(G,E.wireframeLinewidth,E.wireframeLinecap,\nE.wireframeLinejoin):c(G)):(E instanceof THREE.MeshDepthMaterial?G.r=G.g=G.b=1-p(H.positionScreen.z*H.positionScreen.w,oa.near,oa.far):E instanceof THREE.MeshNormalMaterial?(ma.copy(J.normalModel).applyMatrix3(Ja),G.setRGB(ma.x,ma.y,ma.z).multiplyScalar(.5).addScalar(.5)):G.setRGB(1,1,1),!0===E.wireframe?b(G,E.wireframeLinewidth,E.wireframeLinecap,E.wireframeLinejoin):c(G))}}aa.union(ra)}}O.setTransform(1,0,0,1,0,0)}}};THREE.ShaderChunk={};THREE.ShaderChunk.alphatest_fragment=\"#ifdef ALPHATEST\\n\\n\\tif ( gl_FragColor.a < ALPHATEST ) discard;\\n\\n#endif\\n\";\nTHREE.ShaderChunk.lights_lambert_vertex=\"vLightFront = vec3( 0.0 );\\n\\n#ifdef DOUBLE_SIDED\\n\\n\\tvLightBack = vec3( 0.0 );\\n\\n#endif\\n\\ntransformedNormal = normalize( transformedNormal );\\n\\n#if MAX_DIR_LIGHTS > 0\\n\\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\\n\\n\\tvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\\n\\tvec3 dirVector = normalize( lDirection.xyz );\\n\\n\\tfloat dotProduct = dot( transformedNormal, dirVector );\\n\\tvec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\\n\\n\\t#ifdef DOUBLE_SIDED\\n\\n\\t\\tvec3 directionalLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\\n\\n\\t\\t#ifdef WRAP_AROUND\\n\\n\\t\\t\\tvec3 directionalLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\\n\\n\\t\\t#endif\\n\\n\\t#endif\\n\\n\\t#ifdef WRAP_AROUND\\n\\n\\t\\tvec3 directionalLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\\n\\t\\tdirectionalLightWeighting = mix( directionalLightWeighting, directionalLightWeightingHalf, wrapRGB );\\n\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\n\\t\\t\\tdirectionalLightWeightingBack = mix( directionalLightWeightingBack, directionalLightWeightingHalfBack, wrapRGB );\\n\\n\\t\\t#endif\\n\\n\\t#endif\\n\\n\\tvLightFront += directionalLightColor[ i ] * directionalLightWeighting;\\n\\n\\t#ifdef DOUBLE_SIDED\\n\\n\\t\\tvLightBack += directionalLightColor[ i ] * directionalLightWeightingBack;\\n\\n\\t#endif\\n\\n}\\n\\n#endif\\n\\n#if MAX_POINT_LIGHTS > 0\\n\\n\\tfor( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\\n\\n\\t\\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\\n\\t\\tvec3 lVector = lPosition.xyz - mvPosition.xyz;\\n\\n\\t\\tfloat lDistance = 1.0;\\n\\t\\tif ( pointLightDistance[ i ] > 0.0 )\\n\\t\\t\\tlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\\n\\n\\t\\tlVector = normalize( lVector );\\n\\t\\tfloat dotProduct = dot( transformedNormal, lVector );\\n\\n\\t\\tvec3 pointLightWeighting = vec3( max( dotProduct, 0.0 ) );\\n\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\n\\t\\t\\tvec3 pointLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\\n\\n\\t\\t\\t#ifdef WRAP_AROUND\\n\\n\\t\\t\\t\\tvec3 pointLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\\n\\n\\t\\t\\t#endif\\n\\n\\t\\t#endif\\n\\n\\t\\t#ifdef WRAP_AROUND\\n\\n\\t\\t\\tvec3 pointLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\\n\\t\\t\\tpointLightWeighting = mix( pointLightWeighting, pointLightWeightingHalf, wrapRGB );\\n\\n\\t\\t\\t#ifdef DOUBLE_SIDED\\n\\n\\t\\t\\t\\tpointLightWeightingBack = mix( pointLightWeightingBack, pointLightWeightingHalfBack, wrapRGB );\\n\\n\\t\\t\\t#endif\\n\\n\\t\\t#endif\\n\\n\\t\\tvLightFront += pointLightColor[ i ] * pointLightWeighting * lDistance;\\n\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\n\\t\\t\\tvLightBack += pointLightColor[ i ] * pointLightWeightingBack * lDistance;\\n\\n\\t\\t#endif\\n\\n\\t}\\n\\n#endif\\n\\n#if MAX_SPOT_LIGHTS > 0\\n\\n\\tfor( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\\n\\n\\t\\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\\n\\t\\tvec3 lVector = lPosition.xyz - mvPosition.xyz;\\n\\n\\t\\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - worldPosition.xyz ) );\\n\\n\\t\\tif ( spotEffect > spotLightAngleCos[ i ] ) {\\n\\n\\t\\t\\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\\n\\n\\t\\t\\tfloat lDistance = 1.0;\\n\\t\\t\\tif ( spotLightDistance[ i ] > 0.0 )\\n\\t\\t\\t\\tlDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );\\n\\n\\t\\t\\tlVector = normalize( lVector );\\n\\n\\t\\t\\tfloat dotProduct = dot( transformedNormal, lVector );\\n\\t\\t\\tvec3 spotLightWeighting = vec3( max( dotProduct, 0.0 ) );\\n\\n\\t\\t\\t#ifdef DOUBLE_SIDED\\n\\n\\t\\t\\t\\tvec3 spotLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\\n\\n\\t\\t\\t\\t#ifdef WRAP_AROUND\\n\\n\\t\\t\\t\\t\\tvec3 spotLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\\n\\n\\t\\t\\t\\t#endif\\n\\n\\t\\t\\t#endif\\n\\n\\t\\t\\t#ifdef WRAP_AROUND\\n\\n\\t\\t\\t\\tvec3 spotLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\\n\\t\\t\\t\\tspotLightWeighting = mix( spotLightWeighting, spotLightWeightingHalf, wrapRGB );\\n\\n\\t\\t\\t\\t#ifdef DOUBLE_SIDED\\n\\n\\t\\t\\t\\t\\tspotLightWeightingBack = mix( spotLightWeightingBack, spotLightWeightingHalfBack, wrapRGB );\\n\\n\\t\\t\\t\\t#endif\\n\\n\\t\\t\\t#endif\\n\\n\\t\\t\\tvLightFront += spotLightColor[ i ] * spotLightWeighting * lDistance * spotEffect;\\n\\n\\t\\t\\t#ifdef DOUBLE_SIDED\\n\\n\\t\\t\\t\\tvLightBack += spotLightColor[ i ] * spotLightWeightingBack * lDistance * spotEffect;\\n\\n\\t\\t\\t#endif\\n\\n\\t\\t}\\n\\n\\t}\\n\\n#endif\\n\\n#if MAX_HEMI_LIGHTS > 0\\n\\n\\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\\n\\n\\t\\tvec4 lDirection = viewMatrix * vec4( hemisphereLightDirection[ i ], 0.0 );\\n\\t\\tvec3 lVector = normalize( lDirection.xyz );\\n\\n\\t\\tfloat dotProduct = dot( transformedNormal, lVector );\\n\\n\\t\\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\\n\\t\\tfloat hemiDiffuseWeightBack = -0.5 * dotProduct + 0.5;\\n\\n\\t\\tvLightFront += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\\n\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\n\\t\\t\\tvLightBack += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeightBack );\\n\\n\\t\\t#endif\\n\\n\\t}\\n\\n#endif\\n\\nvLightFront = vLightFront * diffuse + ambient * ambientLightColor + emissive;\\n\\n#ifdef DOUBLE_SIDED\\n\\n\\tvLightBack = vLightBack * diffuse + ambient * ambientLightColor + emissive;\\n\\n#endif\";\nTHREE.ShaderChunk.map_particle_pars_fragment=\"#ifdef USE_MAP\\n\\n\\tuniform sampler2D map;\\n\\n#endif\";THREE.ShaderChunk.default_vertex=\"vec4 mvPosition;\\n\\n#ifdef USE_SKINNING\\n\\n\\tmvPosition = modelViewMatrix * skinned;\\n\\n#endif\\n\\n#if !defined( USE_SKINNING ) && defined( USE_MORPHTARGETS )\\n\\n\\tmvPosition = modelViewMatrix * vec4( morphed, 1.0 );\\n\\n#endif\\n\\n#if !defined( USE_SKINNING ) && ! defined( USE_MORPHTARGETS )\\n\\n\\tmvPosition = modelViewMatrix * vec4( position, 1.0 );\\n\\n#endif\\n\\ngl_Position = projectionMatrix * mvPosition;\";\nTHREE.ShaderChunk.map_pars_fragment=\"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\\n\\n\\tvarying vec2 vUv;\\n\\n#endif\\n\\n#ifdef USE_MAP\\n\\n\\tuniform sampler2D map;\\n\\n#endif\";THREE.ShaderChunk.skinnormal_vertex=\"#ifdef USE_SKINNING\\n\\n\\tmat4 skinMatrix = mat4( 0.0 );\\n\\tskinMatrix += skinWeight.x * boneMatX;\\n\\tskinMatrix += skinWeight.y * boneMatY;\\n\\tskinMatrix += skinWeight.z * boneMatZ;\\n\\tskinMatrix += skinWeight.w * boneMatW;\\n\\tskinMatrix  = bindMatrixInverse * skinMatrix * bindMatrix;\\n\\n\\t#ifdef USE_MORPHNORMALS\\n\\n\\tvec4 skinnedNormal = skinMatrix * vec4( morphedNormal, 0.0 );\\n\\n\\t#else\\n\\n\\tvec4 skinnedNormal = skinMatrix * vec4( normal, 0.0 );\\n\\n\\t#endif\\n\\n#endif\\n\";\nTHREE.ShaderChunk.logdepthbuf_pars_vertex=\"#ifdef USE_LOGDEPTHBUF\\n\\n\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\n\\t\\tvarying float vFragDepth;\\n\\n\\t#endif\\n\\n\\tuniform float logDepthBufFC;\\n\\n#endif\";THREE.ShaderChunk.lightmap_pars_vertex=\"#ifdef USE_LIGHTMAP\\n\\n\\tvarying vec2 vUv2;\\n\\n#endif\";THREE.ShaderChunk.lights_phong_fragment=\"vec3 normal = normalize( vNormal );\\nvec3 viewPosition = normalize( vViewPosition );\\n\\n#ifdef DOUBLE_SIDED\\n\\n\\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\\n\\n#endif\\n\\n#ifdef USE_NORMALMAP\\n\\n\\tnormal = perturbNormal2Arb( -vViewPosition, normal );\\n\\n#elif defined( USE_BUMPMAP )\\n\\n\\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\\n\\n#endif\\n\\n#if MAX_POINT_LIGHTS > 0\\n\\n\\tvec3 pointDiffuse = vec3( 0.0 );\\n\\tvec3 pointSpecular = vec3( 0.0 );\\n\\n\\tfor ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\\n\\n\\t\\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\\n\\t\\tvec3 lVector = lPosition.xyz + vViewPosition.xyz;\\n\\n\\t\\tfloat lDistance = 1.0;\\n\\t\\tif ( pointLightDistance[ i ] > 0.0 )\\n\\t\\t\\tlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\\n\\n\\t\\tlVector = normalize( lVector );\\n\\n\\t\\t\\t\\t// diffuse\\n\\n\\t\\tfloat dotProduct = dot( normal, lVector );\\n\\n\\t\\t#ifdef WRAP_AROUND\\n\\n\\t\\t\\tfloat pointDiffuseWeightFull = max( dotProduct, 0.0 );\\n\\t\\t\\tfloat pointDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\\n\\n\\t\\t\\tvec3 pointDiffuseWeight = mix( vec3( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );\\n\\n\\t\\t#else\\n\\n\\t\\t\\tfloat pointDiffuseWeight = max( dotProduct, 0.0 );\\n\\n\\t\\t#endif\\n\\n\\t\\tpointDiffuse += diffuse * pointLightColor[ i ] * pointDiffuseWeight * lDistance;\\n\\n\\t\\t\\t\\t// specular\\n\\n\\t\\tvec3 pointHalfVector = normalize( lVector + viewPosition );\\n\\t\\tfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\\n\\t\\tfloat pointSpecularWeight = specularStrength * max( pow( pointDotNormalHalf, shininess ), 0.0 );\\n\\n\\t\\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\\n\\n\\t\\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, pointHalfVector ), 0.0 ), 5.0 );\\n\\t\\tpointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * lDistance * specularNormalization;\\n\\n\\t}\\n\\n#endif\\n\\n#if MAX_SPOT_LIGHTS > 0\\n\\n\\tvec3 spotDiffuse = vec3( 0.0 );\\n\\tvec3 spotSpecular = vec3( 0.0 );\\n\\n\\tfor ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\\n\\n\\t\\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\\n\\t\\tvec3 lVector = lPosition.xyz + vViewPosition.xyz;\\n\\n\\t\\tfloat lDistance = 1.0;\\n\\t\\tif ( spotLightDistance[ i ] > 0.0 )\\n\\t\\t\\tlDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );\\n\\n\\t\\tlVector = normalize( lVector );\\n\\n\\t\\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );\\n\\n\\t\\tif ( spotEffect > spotLightAngleCos[ i ] ) {\\n\\n\\t\\t\\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\\n\\n\\t\\t\\t\\t\\t// diffuse\\n\\n\\t\\t\\tfloat dotProduct = dot( normal, lVector );\\n\\n\\t\\t\\t#ifdef WRAP_AROUND\\n\\n\\t\\t\\t\\tfloat spotDiffuseWeightFull = max( dotProduct, 0.0 );\\n\\t\\t\\t\\tfloat spotDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\\n\\n\\t\\t\\t\\tvec3 spotDiffuseWeight = mix( vec3( spotDiffuseWeightFull ), vec3( spotDiffuseWeightHalf ), wrapRGB );\\n\\n\\t\\t\\t#else\\n\\n\\t\\t\\t\\tfloat spotDiffuseWeight = max( dotProduct, 0.0 );\\n\\n\\t\\t\\t#endif\\n\\n\\t\\t\\tspotDiffuse += diffuse * spotLightColor[ i ] * spotDiffuseWeight * lDistance * spotEffect;\\n\\n\\t\\t\\t\\t\\t// specular\\n\\n\\t\\t\\tvec3 spotHalfVector = normalize( lVector + viewPosition );\\n\\t\\t\\tfloat spotDotNormalHalf = max( dot( normal, spotHalfVector ), 0.0 );\\n\\t\\t\\tfloat spotSpecularWeight = specularStrength * max( pow( spotDotNormalHalf, shininess ), 0.0 );\\n\\n\\t\\t\\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\\n\\n\\t\\t\\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, spotHalfVector ), 0.0 ), 5.0 );\\n\\t\\t\\tspotSpecular += schlick * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * lDistance * specularNormalization * spotEffect;\\n\\n\\t\\t}\\n\\n\\t}\\n\\n#endif\\n\\n#if MAX_DIR_LIGHTS > 0\\n\\n\\tvec3 dirDiffuse = vec3( 0.0 );\\n\\tvec3 dirSpecular = vec3( 0.0 );\\n\\n\\tfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\\n\\n\\t\\tvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\\n\\t\\tvec3 dirVector = normalize( lDirection.xyz );\\n\\n\\t\\t\\t\\t// diffuse\\n\\n\\t\\tfloat dotProduct = dot( normal, dirVector );\\n\\n\\t\\t#ifdef WRAP_AROUND\\n\\n\\t\\t\\tfloat dirDiffuseWeightFull = max( dotProduct, 0.0 );\\n\\t\\t\\tfloat dirDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\\n\\n\\t\\t\\tvec3 dirDiffuseWeight = mix( vec3( dirDiffuseWeightFull ), vec3( dirDiffuseWeightHalf ), wrapRGB );\\n\\n\\t\\t#else\\n\\n\\t\\t\\tfloat dirDiffuseWeight = max( dotProduct, 0.0 );\\n\\n\\t\\t#endif\\n\\n\\t\\tdirDiffuse += diffuse * directionalLightColor[ i ] * dirDiffuseWeight;\\n\\n\\t\\t// specular\\n\\n\\t\\tvec3 dirHalfVector = normalize( dirVector + viewPosition );\\n\\t\\tfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\\n\\t\\tfloat dirSpecularWeight = specularStrength * max( pow( dirDotNormalHalf, shininess ), 0.0 );\\n\\n\\t\\t/*\\n\\t\\t// fresnel term from skin shader\\n\\t\\tconst float F0 = 0.128;\\n\\n\\t\\tfloat base = 1.0 - dot( viewPosition, dirHalfVector );\\n\\t\\tfloat exponential = pow( base, 5.0 );\\n\\n\\t\\tfloat fresnel = exponential + F0 * ( 1.0 - exponential );\\n\\t\\t*/\\n\\n\\t\\t/*\\n\\t\\t// fresnel term from fresnel shader\\n\\t\\tconst float mFresnelBias = 0.08;\\n\\t\\tconst float mFresnelScale = 0.3;\\n\\t\\tconst float mFresnelPower = 5.0;\\n\\n\\t\\tfloat fresnel = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( -viewPosition ), normal ), mFresnelPower );\\n\\t\\t*/\\n\\n\\t\\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\\n\\n\\t\\t// \\t\\tdirSpecular += specular * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization * fresnel;\\n\\n\\t\\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( dirVector, dirHalfVector ), 0.0 ), 5.0 );\\n\\t\\tdirSpecular += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization;\\n\\n\\n\\t}\\n\\n#endif\\n\\n#if MAX_HEMI_LIGHTS > 0\\n\\n\\tvec3 hemiDiffuse = vec3( 0.0 );\\n\\tvec3 hemiSpecular = vec3( 0.0 );\\n\\n\\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\\n\\n\\t\\tvec4 lDirection = viewMatrix * vec4( hemisphereLightDirection[ i ], 0.0 );\\n\\t\\tvec3 lVector = normalize( lDirection.xyz );\\n\\n\\t\\t// diffuse\\n\\n\\t\\tfloat dotProduct = dot( normal, lVector );\\n\\t\\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\\n\\n\\t\\tvec3 hemiColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\\n\\n\\t\\themiDiffuse += diffuse * hemiColor;\\n\\n\\t\\t// specular (sky light)\\n\\n\\t\\tvec3 hemiHalfVectorSky = normalize( lVector + viewPosition );\\n\\t\\tfloat hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;\\n\\t\\tfloat hemiSpecularWeightSky = specularStrength * max( pow( max( hemiDotNormalHalfSky, 0.0 ), shininess ), 0.0 );\\n\\n\\t\\t// specular (ground light)\\n\\n\\t\\tvec3 lVectorGround = -lVector;\\n\\n\\t\\tvec3 hemiHalfVectorGround = normalize( lVectorGround + viewPosition );\\n\\t\\tfloat hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;\\n\\t\\tfloat hemiSpecularWeightGround = specularStrength * max( pow( max( hemiDotNormalHalfGround, 0.0 ), shininess ), 0.0 );\\n\\n\\t\\tfloat dotProductGround = dot( normal, lVectorGround );\\n\\n\\t\\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\\n\\n\\t\\tvec3 schlickSky = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, hemiHalfVectorSky ), 0.0 ), 5.0 );\\n\\t\\tvec3 schlickGround = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVectorGround, hemiHalfVectorGround ), 0.0 ), 5.0 );\\n\\t\\themiSpecular += hemiColor * specularNormalization * ( schlickSky * hemiSpecularWeightSky * max( dotProduct, 0.0 ) + schlickGround * hemiSpecularWeightGround * max( dotProductGround, 0.0 ) );\\n\\n\\t}\\n\\n#endif\\n\\nvec3 totalDiffuse = vec3( 0.0 );\\nvec3 totalSpecular = vec3( 0.0 );\\n\\n#if MAX_DIR_LIGHTS > 0\\n\\n\\ttotalDiffuse += dirDiffuse;\\n\\ttotalSpecular += dirSpecular;\\n\\n#endif\\n\\n#if MAX_HEMI_LIGHTS > 0\\n\\n\\ttotalDiffuse += hemiDiffuse;\\n\\ttotalSpecular += hemiSpecular;\\n\\n#endif\\n\\n#if MAX_POINT_LIGHTS > 0\\n\\n\\ttotalDiffuse += pointDiffuse;\\n\\ttotalSpecular += pointSpecular;\\n\\n#endif\\n\\n#if MAX_SPOT_LIGHTS > 0\\n\\n\\ttotalDiffuse += spotDiffuse;\\n\\ttotalSpecular += spotSpecular;\\n\\n#endif\\n\\n#ifdef METAL\\n\\n\\tgl_FragColor.xyz = gl_FragColor.xyz * ( emissive + totalDiffuse + ambientLightColor * ambient + totalSpecular );\\n\\n#else\\n\\n\\tgl_FragColor.xyz = gl_FragColor.xyz * ( emissive + totalDiffuse + ambientLightColor * ambient ) + totalSpecular;\\n\\n#endif\";\nTHREE.ShaderChunk.fog_pars_fragment=\"#ifdef USE_FOG\\n\\n\\tuniform vec3 fogColor;\\n\\n\\t#ifdef FOG_EXP2\\n\\n\\t\\tuniform float fogDensity;\\n\\n\\t#else\\n\\n\\t\\tuniform float fogNear;\\n\\t\\tuniform float fogFar;\\n\\t#endif\\n\\n#endif\";THREE.ShaderChunk.morphnormal_vertex=\"#ifdef USE_MORPHNORMALS\\n\\n\\tvec3 morphedNormal = vec3( 0.0 );\\n\\n\\tmorphedNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\\n\\tmorphedNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\\n\\tmorphedNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\\n\\tmorphedNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\\n\\n\\tmorphedNormal += normal;\\n\\n#endif\";\nTHREE.ShaderChunk.envmap_pars_fragment=\"#ifdef USE_ENVMAP\\n\\n\\tuniform float reflectivity;\\n\\tuniform samplerCube envMap;\\n\\tuniform float flipEnvMap;\\n\\tuniform int combine;\\n\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\\n\\n\\t\\tuniform bool useRefract;\\n\\t\\tuniform float refractionRatio;\\n\\n\\t#else\\n\\n\\t\\tvarying vec3 vReflect;\\n\\n\\t#endif\\n\\n#endif\";THREE.ShaderChunk.logdepthbuf_fragment=\"#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\\n\\n\\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\\n\\n#endif\";\nTHREE.ShaderChunk.normalmap_pars_fragment=\"#ifdef USE_NORMALMAP\\n\\n\\tuniform sampler2D normalMap;\\n\\tuniform vec2 normalScale;\\n\\n\\t\\t\\t// Per-Pixel Tangent Space Normal Mapping\\n\\t\\t\\t// http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html\\n\\n\\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\\n\\n\\t\\tvec3 q0 = dFdx( eye_pos.xyz );\\n\\t\\tvec3 q1 = dFdy( eye_pos.xyz );\\n\\t\\tvec2 st0 = dFdx( vUv.st );\\n\\t\\tvec2 st1 = dFdy( vUv.st );\\n\\n\\t\\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\\n\\t\\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\\n\\t\\tvec3 N = normalize( surf_norm );\\n\\n\\t\\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\\n\\t\\tmapN.xy = normalScale * mapN.xy;\\n\\t\\tmat3 tsn = mat3( S, T, N );\\n\\t\\treturn normalize( tsn * mapN );\\n\\n\\t}\\n\\n#endif\\n\";\nTHREE.ShaderChunk.lights_phong_pars_vertex=\"#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\\n\\n\\tvarying vec3 vWorldPosition;\\n\\n#endif\\n\";THREE.ShaderChunk.lightmap_pars_fragment=\"#ifdef USE_LIGHTMAP\\n\\n\\tvarying vec2 vUv2;\\n\\tuniform sampler2D lightMap;\\n\\n#endif\";THREE.ShaderChunk.shadowmap_vertex=\"#ifdef USE_SHADOWMAP\\n\\n\\tfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\\n\\n\\t\\tvShadowCoord[ i ] = shadowMatrix[ i ] * worldPosition;\\n\\n\\t}\\n\\n#endif\";\nTHREE.ShaderChunk.lights_phong_vertex=\"#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\\n\\n\\tvWorldPosition = worldPosition.xyz;\\n\\n#endif\";THREE.ShaderChunk.map_fragment=\"#ifdef USE_MAP\\n\\n\\tvec4 texelColor = texture2D( map, vUv );\\n\\n\\t#ifdef GAMMA_INPUT\\n\\n\\t\\ttexelColor.xyz *= texelColor.xyz;\\n\\n\\t#endif\\n\\n\\tgl_FragColor = gl_FragColor * texelColor;\\n\\n#endif\";THREE.ShaderChunk.lightmap_vertex=\"#ifdef USE_LIGHTMAP\\n\\n\\tvUv2 = uv2;\\n\\n#endif\";\nTHREE.ShaderChunk.map_particle_fragment=\"#ifdef USE_MAP\\n\\n\\tgl_FragColor = gl_FragColor * texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) );\\n\\n#endif\";THREE.ShaderChunk.color_pars_fragment=\"#ifdef USE_COLOR\\n\\n\\tvarying vec3 vColor;\\n\\n#endif\\n\";THREE.ShaderChunk.color_vertex=\"#ifdef USE_COLOR\\n\\n\\t#ifdef GAMMA_INPUT\\n\\n\\t\\tvColor = color * color;\\n\\n\\t#else\\n\\n\\t\\tvColor = color;\\n\\n\\t#endif\\n\\n#endif\";THREE.ShaderChunk.skinning_vertex=\"#ifdef USE_SKINNING\\n\\n\\t#ifdef USE_MORPHTARGETS\\n\\n\\tvec4 skinVertex = bindMatrix * vec4( morphed, 1.0 );\\n\\n\\t#else\\n\\n\\tvec4 skinVertex = bindMatrix * vec4( position, 1.0 );\\n\\n\\t#endif\\n\\n\\tvec4 skinned = vec4( 0.0 );\\n\\tskinned += boneMatX * skinVertex * skinWeight.x;\\n\\tskinned += boneMatY * skinVertex * skinWeight.y;\\n\\tskinned += boneMatZ * skinVertex * skinWeight.z;\\n\\tskinned += boneMatW * skinVertex * skinWeight.w;\\n\\tskinned  = bindMatrixInverse * skinned;\\n\\n#endif\\n\";\nTHREE.ShaderChunk.envmap_pars_vertex=\"#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\\n\\n\\tvarying vec3 vReflect;\\n\\n\\tuniform float refractionRatio;\\n\\tuniform bool useRefract;\\n\\n#endif\\n\";THREE.ShaderChunk.linear_to_gamma_fragment=\"#ifdef GAMMA_OUTPUT\\n\\n\\tgl_FragColor.xyz = sqrt( gl_FragColor.xyz );\\n\\n#endif\";THREE.ShaderChunk.color_pars_vertex=\"#ifdef USE_COLOR\\n\\n\\tvarying vec3 vColor;\\n\\n#endif\";THREE.ShaderChunk.lights_lambert_pars_vertex=\"uniform vec3 ambient;\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\n\\nuniform vec3 ambientLightColor;\\n\\n#if MAX_DIR_LIGHTS > 0\\n\\n\\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\\n\\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\\n\\n#endif\\n\\n#if MAX_HEMI_LIGHTS > 0\\n\\n\\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\\n\\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\\n\\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\\n\\n#endif\\n\\n#if MAX_POINT_LIGHTS > 0\\n\\n\\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\\n\\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\\n\\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\\n\\n#endif\\n\\n#if MAX_SPOT_LIGHTS > 0\\n\\n\\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\\n\\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\\n\\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\\n\\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\\n\\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\\n\\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\\n\\n#endif\\n\\n#ifdef WRAP_AROUND\\n\\n\\tuniform vec3 wrapRGB;\\n\\n#endif\\n\";\nTHREE.ShaderChunk.map_pars_vertex=\"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\\n\\n\\tvarying vec2 vUv;\\n\\tuniform vec4 offsetRepeat;\\n\\n#endif\\n\";THREE.ShaderChunk.envmap_fragment=\"#ifdef USE_ENVMAP\\n\\n\\tvec3 reflectVec;\\n\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\\n\\n\\t\\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\\n\\n\\t\\t// http://en.wikibooks.org/wiki/GLSL_Programming/Applying_Matrix_Transformations\\n\\t\\t// Transforming Normal Vectors with the Inverse Transformation\\n\\n\\t\\tvec3 worldNormal = normalize( vec3( vec4( normal, 0.0 ) * viewMatrix ) );\\n\\n\\t\\tif ( useRefract ) {\\n\\n\\t\\t\\treflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\\n\\n\\t\\t} else { \\n\\n\\t\\t\\treflectVec = reflect( cameraToVertex, worldNormal );\\n\\n\\t\\t}\\n\\n\\t#else\\n\\n\\t\\treflectVec = vReflect;\\n\\n\\t#endif\\n\\n\\t#ifdef DOUBLE_SIDED\\n\\n\\t\\tfloat flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\\n\\t\\tvec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\\n\\n\\t#else\\n\\n\\t\\tvec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\\n\\n\\t#endif\\n\\n\\t#ifdef GAMMA_INPUT\\n\\n\\t\\tcubeColor.xyz *= cubeColor.xyz;\\n\\n\\t#endif\\n\\n\\tif ( combine == 1 ) {\\n\\n\\t\\tgl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularStrength * reflectivity );\\n\\n\\t} else if ( combine == 2 ) {\\n\\n\\t\\tgl_FragColor.xyz += cubeColor.xyz * specularStrength * reflectivity;\\n\\n\\t} else {\\n\\n\\t\\tgl_FragColor.xyz = mix( gl_FragColor.xyz, gl_FragColor.xyz * cubeColor.xyz, specularStrength * reflectivity );\\n\\n\\t}\\n\\n#endif\";\nTHREE.ShaderChunk.specularmap_pars_fragment=\"#ifdef USE_SPECULARMAP\\n\\n\\tuniform sampler2D specularMap;\\n\\n#endif\";THREE.ShaderChunk.logdepthbuf_vertex=\"#ifdef USE_LOGDEPTHBUF\\n\\n\\tgl_Position.z = log2(max(1e-6, gl_Position.w + 1.0)) * logDepthBufFC;\\n\\n\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\n\\t\\tvFragDepth = 1.0 + gl_Position.w;\\n\\n#else\\n\\n\\t\\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\\n\\n\\t#endif\\n\\n#endif\";THREE.ShaderChunk.morphtarget_pars_vertex=\"#ifdef USE_MORPHTARGETS\\n\\n\\t#ifndef USE_MORPHNORMALS\\n\\n\\tuniform float morphTargetInfluences[ 8 ];\\n\\n\\t#else\\n\\n\\tuniform float morphTargetInfluences[ 4 ];\\n\\n\\t#endif\\n\\n#endif\";\nTHREE.ShaderChunk.specularmap_fragment=\"float specularStrength;\\n\\n#ifdef USE_SPECULARMAP\\n\\n\\tvec4 texelSpecular = texture2D( specularMap, vUv );\\n\\tspecularStrength = texelSpecular.r;\\n\\n#else\\n\\n\\tspecularStrength = 1.0;\\n\\n#endif\";THREE.ShaderChunk.fog_fragment=\"#ifdef USE_FOG\\n\\n\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\n\\t\\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\\n\\n\\t#else\\n\\n\\t\\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\\n\\n\\t#endif\\n\\n\\t#ifdef FOG_EXP2\\n\\n\\t\\tconst float LOG2 = 1.442695;\\n\\t\\tfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\\n\\t\\tfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\\n\\n\\t#else\\n\\n\\t\\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\\n\\n\\t#endif\\n\\t\\n\\tgl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\\n\\n#endif\";\nTHREE.ShaderChunk.bumpmap_pars_fragment=\"#ifdef USE_BUMPMAP\\n\\n\\tuniform sampler2D bumpMap;\\n\\tuniform float bumpScale;\\n\\n\\t\\t\\t// Derivative maps - bump mapping unparametrized surfaces by Morten Mikkelsen\\n\\t\\t\\t//\\thttp://mmikkelsen3d.blogspot.sk/2011/07/derivative-maps.html\\n\\n\\t\\t\\t// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\\n\\n\\tvec2 dHdxy_fwd() {\\n\\n\\t\\tvec2 dSTdx = dFdx( vUv );\\n\\t\\tvec2 dSTdy = dFdy( vUv );\\n\\n\\t\\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\\n\\t\\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\\n\\t\\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\\n\\n\\t\\treturn vec2( dBx, dBy );\\n\\n\\t}\\n\\n\\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\\n\\n\\t\\tvec3 vSigmaX = dFdx( surf_pos );\\n\\t\\tvec3 vSigmaY = dFdy( surf_pos );\\n\\t\\tvec3 vN = surf_norm;\\t\\t// normalized\\n\\n\\t\\tvec3 R1 = cross( vSigmaY, vN );\\n\\t\\tvec3 R2 = cross( vN, vSigmaX );\\n\\n\\t\\tfloat fDet = dot( vSigmaX, R1 );\\n\\n\\t\\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\\n\\t\\treturn normalize( abs( fDet ) * surf_norm - vGrad );\\n\\n\\t}\\n\\n#endif\";\nTHREE.ShaderChunk.defaultnormal_vertex=\"vec3 objectNormal;\\n\\n#ifdef USE_SKINNING\\n\\n\\tobjectNormal = skinnedNormal.xyz;\\n\\n#endif\\n\\n#if !defined( USE_SKINNING ) && defined( USE_MORPHNORMALS )\\n\\n\\tobjectNormal = morphedNormal;\\n\\n#endif\\n\\n#if !defined( USE_SKINNING ) && ! defined( USE_MORPHNORMALS )\\n\\n\\tobjectNormal = normal;\\n\\n#endif\\n\\n#ifdef FLIP_SIDED\\n\\n\\tobjectNormal = -objectNormal;\\n\\n#endif\\n\\nvec3 transformedNormal = normalMatrix * objectNormal;\";\nTHREE.ShaderChunk.lights_phong_pars_fragment=\"uniform vec3 ambientLightColor;\\n\\n#if MAX_DIR_LIGHTS > 0\\n\\n\\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\\n\\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\\n\\n#endif\\n\\n#if MAX_HEMI_LIGHTS > 0\\n\\n\\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\\n\\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\\n\\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\\n\\n#endif\\n\\n#if MAX_POINT_LIGHTS > 0\\n\\n\\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\\n\\n\\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\\n\\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\\n\\n#endif\\n\\n#if MAX_SPOT_LIGHTS > 0\\n\\n\\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\\n\\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\\n\\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\\n\\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\\n\\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\\n\\n\\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\\n\\n#endif\\n\\n#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\\n\\n\\tvarying vec3 vWorldPosition;\\n\\n#endif\\n\\n#ifdef WRAP_AROUND\\n\\n\\tuniform vec3 wrapRGB;\\n\\n#endif\\n\\nvarying vec3 vViewPosition;\\nvarying vec3 vNormal;\";\nTHREE.ShaderChunk.skinbase_vertex=\"#ifdef USE_SKINNING\\n\\n\\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\\n\\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\\n\\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\\n\\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\\n\\n#endif\";THREE.ShaderChunk.map_vertex=\"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\\n\\n\\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\\n\\n#endif\";\nTHREE.ShaderChunk.lightmap_fragment=\"#ifdef USE_LIGHTMAP\\n\\n\\tgl_FragColor = gl_FragColor * texture2D( lightMap, vUv2 );\\n\\n#endif\";THREE.ShaderChunk.shadowmap_pars_vertex=\"#ifdef USE_SHADOWMAP\\n\\n\\tvarying vec4 vShadowCoord[ MAX_SHADOWS ];\\n\\tuniform mat4 shadowMatrix[ MAX_SHADOWS ];\\n\\n#endif\";THREE.ShaderChunk.color_fragment=\"#ifdef USE_COLOR\\n\\n\\tgl_FragColor = gl_FragColor * vec4( vColor, 1.0 );\\n\\n#endif\";THREE.ShaderChunk.morphtarget_vertex=\"#ifdef USE_MORPHTARGETS\\n\\n\\tvec3 morphed = vec3( 0.0 );\\n\\tmorphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\\n\\tmorphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\\n\\tmorphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\\n\\tmorphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\\n\\n\\t#ifndef USE_MORPHNORMALS\\n\\n\\tmorphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\\n\\tmorphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\\n\\tmorphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\\n\\tmorphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\\n\\n\\t#endif\\n\\n\\tmorphed += position;\\n\\n#endif\";\nTHREE.ShaderChunk.envmap_vertex=\"#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\\n\\n\\tvec3 worldNormal = mat3( modelMatrix[ 0 ].xyz, modelMatrix[ 1 ].xyz, modelMatrix[ 2 ].xyz ) * objectNormal;\\n\\tworldNormal = normalize( worldNormal );\\n\\n\\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\\n\\n\\tif ( useRefract ) {\\n\\n\\t\\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\\n\\n\\t} else {\\n\\n\\t\\tvReflect = reflect( cameraToVertex, worldNormal );\\n\\n\\t}\\n\\n#endif\";\nTHREE.ShaderChunk.shadowmap_fragment=\"#ifdef USE_SHADOWMAP\\n\\n\\t#ifdef SHADOWMAP_DEBUG\\n\\n\\t\\tvec3 frustumColors[3];\\n\\t\\tfrustumColors[0] = vec3( 1.0, 0.5, 0.0 );\\n\\t\\tfrustumColors[1] = vec3( 0.0, 1.0, 0.8 );\\n\\t\\tfrustumColors[2] = vec3( 0.0, 0.5, 1.0 );\\n\\n\\t#endif\\n\\n\\t#ifdef SHADOWMAP_CASCADE\\n\\n\\t\\tint inFrustumCount = 0;\\n\\n\\t#endif\\n\\n\\tfloat fDepth;\\n\\tvec3 shadowColor = vec3( 1.0 );\\n\\n\\tfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\\n\\n\\t\\tvec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\\n\\n\\t\\t\\t\\t// if ( something && something ) breaks ATI OpenGL shader compiler\\n\\t\\t\\t\\t// if ( all( something, something ) ) using this instead\\n\\n\\t\\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\\n\\t\\tbool inFrustum = all( inFrustumVec );\\n\\n\\t\\t\\t\\t// don't shadow pixels outside of light frustum\\n\\t\\t\\t\\t// use just first frustum (for cascades)\\n\\t\\t\\t\\t// don't shadow pixels behind far plane of light frustum\\n\\n\\t\\t#ifdef SHADOWMAP_CASCADE\\n\\n\\t\\t\\tinFrustumCount += int( inFrustum );\\n\\t\\t\\tbvec3 frustumTestVec = bvec3( inFrustum, inFrustumCount == 1, shadowCoord.z <= 1.0 );\\n\\n\\t\\t#else\\n\\n\\t\\t\\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\\n\\n\\t\\t#endif\\n\\n\\t\\tbool frustumTest = all( frustumTestVec );\\n\\n\\t\\tif ( frustumTest ) {\\n\\n\\t\\t\\tshadowCoord.z += shadowBias[ i ];\\n\\n\\t\\t\\t#if defined( SHADOWMAP_TYPE_PCF )\\n\\n\\t\\t\\t\\t\\t\\t// Percentage-close filtering\\n\\t\\t\\t\\t\\t\\t// (9 pixel kernel)\\n\\t\\t\\t\\t\\t\\t// http://fabiensanglard.net/shadowmappingPCF/\\n\\n\\t\\t\\t\\tfloat shadow = 0.0;\\n\\n\\t\\t/*\\n\\t\\t\\t\\t\\t\\t// nested loops breaks shader compiler / validator on some ATI cards when using OpenGL\\n\\t\\t\\t\\t\\t\\t// must enroll loop manually\\n\\n\\t\\t\\t\\tfor ( float y = -1.25; y <= 1.25; y += 1.25 )\\n\\t\\t\\t\\t\\tfor ( float x = -1.25; x <= 1.25; x += 1.25 ) {\\n\\n\\t\\t\\t\\t\\t\\tvec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\\n\\n\\t\\t\\t\\t\\t\\t\\t\\t// doesn't seem to produce any noticeable visual difference compared to simple texture2D lookup\\n\\t\\t\\t\\t\\t\\t\\t\\t//vec4 rgbaDepth = texture2DProj( shadowMap[ i ], vec4( vShadowCoord[ i ].w * ( vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy ), 0.05, vShadowCoord[ i ].w ) );\\n\\n\\t\\t\\t\\t\\t\\tfloat fDepth = unpackDepth( rgbaDepth );\\n\\n\\t\\t\\t\\t\\t\\tif ( fDepth < shadowCoord.z )\\n\\t\\t\\t\\t\\t\\t\\tshadow += 1.0;\\n\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\tshadow /= 9.0;\\n\\n\\t\\t*/\\n\\n\\t\\t\\t\\tconst float shadowDelta = 1.0 / 9.0;\\n\\n\\t\\t\\t\\tfloat xPixelOffset = 1.0 / shadowMapSize[ i ].x;\\n\\t\\t\\t\\tfloat yPixelOffset = 1.0 / shadowMapSize[ i ].y;\\n\\n\\t\\t\\t\\tfloat dx0 = -1.25 * xPixelOffset;\\n\\t\\t\\t\\tfloat dy0 = -1.25 * yPixelOffset;\\n\\t\\t\\t\\tfloat dx1 = 1.25 * xPixelOffset;\\n\\t\\t\\t\\tfloat dy1 = 1.25 * yPixelOffset;\\n\\n\\t\\t\\t\\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\\n\\t\\t\\t\\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\\n\\n\\t\\t\\t\\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\\n\\t\\t\\t\\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\\n\\n\\t\\t\\t\\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\\n\\t\\t\\t\\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\\n\\n\\t\\t\\t\\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\\n\\t\\t\\t\\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\\n\\n\\t\\t\\t\\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\\n\\t\\t\\t\\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\\n\\n\\t\\t\\t\\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\\n\\t\\t\\t\\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\\n\\n\\t\\t\\t\\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\\n\\t\\t\\t\\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\\n\\n\\t\\t\\t\\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\\n\\t\\t\\t\\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\\n\\n\\t\\t\\t\\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\\n\\t\\t\\t\\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\\n\\n\\t\\t\\t\\tshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\\n\\n\\t\\t\\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\\n\\n\\t\\t\\t\\t\\t\\t// Percentage-close filtering\\n\\t\\t\\t\\t\\t\\t// (9 pixel kernel)\\n\\t\\t\\t\\t\\t\\t// http://fabiensanglard.net/shadowmappingPCF/\\n\\n\\t\\t\\t\\tfloat shadow = 0.0;\\n\\n\\t\\t\\t\\tfloat xPixelOffset = 1.0 / shadowMapSize[ i ].x;\\n\\t\\t\\t\\tfloat yPixelOffset = 1.0 / shadowMapSize[ i ].y;\\n\\n\\t\\t\\t\\tfloat dx0 = -1.0 * xPixelOffset;\\n\\t\\t\\t\\tfloat dy0 = -1.0 * yPixelOffset;\\n\\t\\t\\t\\tfloat dx1 = 1.0 * xPixelOffset;\\n\\t\\t\\t\\tfloat dy1 = 1.0 * yPixelOffset;\\n\\n\\t\\t\\t\\tmat3 shadowKernel;\\n\\t\\t\\t\\tmat3 depthKernel;\\n\\n\\t\\t\\t\\tdepthKernel[0][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\\n\\t\\t\\t\\tdepthKernel[0][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\\n\\t\\t\\t\\tdepthKernel[0][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\\n\\t\\t\\t\\tdepthKernel[1][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\\n\\t\\t\\t\\tdepthKernel[1][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\\n\\t\\t\\t\\tdepthKernel[1][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\\n\\t\\t\\t\\tdepthKernel[2][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\\n\\t\\t\\t\\tdepthKernel[2][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\\n\\t\\t\\t\\tdepthKernel[2][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\\n\\n\\t\\t\\t\\tvec3 shadowZ = vec3( shadowCoord.z );\\n\\t\\t\\t\\tshadowKernel[0] = vec3(lessThan(depthKernel[0], shadowZ ));\\n\\t\\t\\t\\tshadowKernel[0] *= vec3(0.25);\\n\\n\\t\\t\\t\\tshadowKernel[1] = vec3(lessThan(depthKernel[1], shadowZ ));\\n\\t\\t\\t\\tshadowKernel[1] *= vec3(0.25);\\n\\n\\t\\t\\t\\tshadowKernel[2] = vec3(lessThan(depthKernel[2], shadowZ ));\\n\\t\\t\\t\\tshadowKernel[2] *= vec3(0.25);\\n\\n\\t\\t\\t\\tvec2 fractionalCoord = 1.0 - fract( shadowCoord.xy * shadowMapSize[i].xy );\\n\\n\\t\\t\\t\\tshadowKernel[0] = mix( shadowKernel[1], shadowKernel[0], fractionalCoord.x );\\n\\t\\t\\t\\tshadowKernel[1] = mix( shadowKernel[2], shadowKernel[1], fractionalCoord.x );\\n\\n\\t\\t\\t\\tvec4 shadowValues;\\n\\t\\t\\t\\tshadowValues.x = mix( shadowKernel[0][1], shadowKernel[0][0], fractionalCoord.y );\\n\\t\\t\\t\\tshadowValues.y = mix( shadowKernel[0][2], shadowKernel[0][1], fractionalCoord.y );\\n\\t\\t\\t\\tshadowValues.z = mix( shadowKernel[1][1], shadowKernel[1][0], fractionalCoord.y );\\n\\t\\t\\t\\tshadowValues.w = mix( shadowKernel[1][2], shadowKernel[1][1], fractionalCoord.y );\\n\\n\\t\\t\\t\\tshadow = dot( shadowValues, vec4( 1.0 ) );\\n\\n\\t\\t\\t\\tshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\\n\\n\\t\\t\\t#else\\n\\n\\t\\t\\t\\tvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\\n\\t\\t\\t\\tfloat fDepth = unpackDepth( rgbaDepth );\\n\\n\\t\\t\\t\\tif ( fDepth < shadowCoord.z )\\n\\n\\t\\t// spot with multiple shadows is darker\\n\\n\\t\\t\\t\\t\\tshadowColor = shadowColor * vec3( 1.0 - shadowDarkness[ i ] );\\n\\n\\t\\t// spot with multiple shadows has the same color as single shadow spot\\n\\n\\t\\t// \\t\\t\\t\\t\\tshadowColor = min( shadowColor, vec3( shadowDarkness[ i ] ) );\\n\\n\\t\\t\\t#endif\\n\\n\\t\\t}\\n\\n\\n\\t\\t#ifdef SHADOWMAP_DEBUG\\n\\n\\t\\t\\t#ifdef SHADOWMAP_CASCADE\\n\\n\\t\\t\\t\\tif ( inFrustum && inFrustumCount == 1 ) gl_FragColor.xyz *= frustumColors[ i ];\\n\\n\\t\\t\\t#else\\n\\n\\t\\t\\t\\tif ( inFrustum ) gl_FragColor.xyz *= frustumColors[ i ];\\n\\n\\t\\t\\t#endif\\n\\n\\t\\t#endif\\n\\n\\t}\\n\\n\\t#ifdef GAMMA_OUTPUT\\n\\n\\t\\tshadowColor *= shadowColor;\\n\\n\\t#endif\\n\\n\\tgl_FragColor.xyz = gl_FragColor.xyz * shadowColor;\\n\\n#endif\\n\";\nTHREE.ShaderChunk.worldpos_vertex=\"#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\\n\\n\\t#ifdef USE_SKINNING\\n\\n\\t\\tvec4 worldPosition = modelMatrix * skinned;\\n\\n\\t#endif\\n\\n\\t#if defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\\n\\n\\t\\tvec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\\n\\n\\t#endif\\n\\n\\t#if ! defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\\n\\n\\t\\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\\n\\n\\t#endif\\n\\n#endif\";\nTHREE.ShaderChunk.shadowmap_pars_fragment=\"#ifdef USE_SHADOWMAP\\n\\n\\tuniform sampler2D shadowMap[ MAX_SHADOWS ];\\n\\tuniform vec2 shadowMapSize[ MAX_SHADOWS ];\\n\\n\\tuniform float shadowDarkness[ MAX_SHADOWS ];\\n\\tuniform float shadowBias[ MAX_SHADOWS ];\\n\\n\\tvarying vec4 vShadowCoord[ MAX_SHADOWS ];\\n\\n\\tfloat unpackDepth( const in vec4 rgba_depth ) {\\n\\n\\t\\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\\n\\t\\tfloat depth = dot( rgba_depth, bit_shift );\\n\\t\\treturn depth;\\n\\n\\t}\\n\\n#endif\";\nTHREE.ShaderChunk.skinning_pars_vertex=\"#ifdef USE_SKINNING\\n\\n\\tuniform mat4 bindMatrix;\\n\\tuniform mat4 bindMatrixInverse;\\n\\n\\t#ifdef BONE_TEXTURE\\n\\n\\t\\tuniform sampler2D boneTexture;\\n\\t\\tuniform int boneTextureWidth;\\n\\t\\tuniform int boneTextureHeight;\\n\\n\\t\\tmat4 getBoneMatrix( const in float i ) {\\n\\n\\t\\t\\tfloat j = i * 4.0;\\n\\t\\t\\tfloat x = mod( j, float( boneTextureWidth ) );\\n\\t\\t\\tfloat y = floor( j / float( boneTextureWidth ) );\\n\\n\\t\\t\\tfloat dx = 1.0 / float( boneTextureWidth );\\n\\t\\t\\tfloat dy = 1.0 / float( boneTextureHeight );\\n\\n\\t\\t\\ty = dy * ( y + 0.5 );\\n\\n\\t\\t\\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\\n\\t\\t\\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\\n\\t\\t\\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\\n\\t\\t\\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\\n\\n\\t\\t\\tmat4 bone = mat4( v1, v2, v3, v4 );\\n\\n\\t\\t\\treturn bone;\\n\\n\\t\\t}\\n\\n\\t#else\\n\\n\\t\\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\\n\\n\\t\\tmat4 getBoneMatrix( const in float i ) {\\n\\n\\t\\t\\tmat4 bone = boneGlobalMatrices[ int(i) ];\\n\\t\\t\\treturn bone;\\n\\n\\t\\t}\\n\\n\\t#endif\\n\\n#endif\\n\";\nTHREE.ShaderChunk.logdepthbuf_pars_fragment=\"#ifdef USE_LOGDEPTHBUF\\n\\n\\tuniform float logDepthBufFC;\\n\\n\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\n\\t\\t#extension GL_EXT_frag_depth : enable\\n\\t\\tvarying float vFragDepth;\\n\\n\\t#endif\\n\\n#endif\";THREE.ShaderChunk.alphamap_fragment=\"#ifdef USE_ALPHAMAP\\n\\n\\tgl_FragColor.a *= texture2D( alphaMap, vUv ).g;\\n\\n#endif\\n\";THREE.ShaderChunk.alphamap_pars_fragment=\"#ifdef USE_ALPHAMAP\\n\\n\\tuniform sampler2D alphaMap;\\n\\n#endif\\n\";\nTHREE.UniformsUtils={merge:function(a){var b,c,d,e={};for(b=0;b<a.length;b++)for(c in d=this.clone(a[b]),d)e[c]=d[c];return e},clone:function(a){var b,c,d,e={};for(b in a)for(c in e[b]={},a[b])d=a[b][c],e[b][c]=d instanceof THREE.Color||d instanceof THREE.Vector2||d instanceof THREE.Vector3||d instanceof THREE.Vector4||d instanceof THREE.Matrix4||d instanceof THREE.Texture?d.clone():d instanceof Array?d.slice():d;return e}};\nTHREE.UniformsLib={common:{diffuse:{type:\"c\",value:new THREE.Color(15658734)},opacity:{type:\"f\",value:1},map:{type:\"t\",value:null},offsetRepeat:{type:\"v4\",value:new THREE.Vector4(0,0,1,1)},lightMap:{type:\"t\",value:null},specularMap:{type:\"t\",value:null},alphaMap:{type:\"t\",value:null},envMap:{type:\"t\",value:null},flipEnvMap:{type:\"f\",value:-1},useRefract:{type:\"i\",value:0},reflectivity:{type:\"f\",value:1},refractionRatio:{type:\"f\",value:.98},combine:{type:\"i\",value:0},morphTargetInfluences:{type:\"f\",\nvalue:0}},bump:{bumpMap:{type:\"t\",value:null},bumpScale:{type:\"f\",value:1}},normalmap:{normalMap:{type:\"t\",value:null},normalScale:{type:\"v2\",value:new THREE.Vector2(1,1)}},fog:{fogDensity:{type:\"f\",value:2.5E-4},fogNear:{type:\"f\",value:1},fogFar:{type:\"f\",value:2E3},fogColor:{type:\"c\",value:new THREE.Color(16777215)}},lights:{ambientLightColor:{type:\"fv\",value:[]},directionalLightDirection:{type:\"fv\",value:[]},directionalLightColor:{type:\"fv\",value:[]},hemisphereLightDirection:{type:\"fv\",value:[]},\nhemisphereLightSkyColor:{type:\"fv\",value:[]},hemisphereLightGroundColor:{type:\"fv\",value:[]},pointLightColor:{type:\"fv\",value:[]},pointLightPosition:{type:\"fv\",value:[]},pointLightDistance:{type:\"fv1\",value:[]},spotLightColor:{type:\"fv\",value:[]},spotLightPosition:{type:\"fv\",value:[]},spotLightDirection:{type:\"fv\",value:[]},spotLightDistance:{type:\"fv1\",value:[]},spotLightAngleCos:{type:\"fv1\",value:[]},spotLightExponent:{type:\"fv1\",value:[]}},particle:{psColor:{type:\"c\",value:new THREE.Color(15658734)},\nopacity:{type:\"f\",value:1},size:{type:\"f\",value:1},scale:{type:\"f\",value:1},map:{type:\"t\",value:null},fogDensity:{type:\"f\",value:2.5E-4},fogNear:{type:\"f\",value:1},fogFar:{type:\"f\",value:2E3},fogColor:{type:\"c\",value:new THREE.Color(16777215)}},shadowmap:{shadowMap:{type:\"tv\",value:[]},shadowMapSize:{type:\"v2v\",value:[]},shadowBias:{type:\"fv1\",value:[]},shadowDarkness:{type:\"fv1\",value:[]},shadowMatrix:{type:\"m4v\",value:[]}}};\nTHREE.ShaderLib={basic:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.fog,THREE.UniformsLib.shadowmap]),vertexShader:[THREE.ShaderChunk.map_pars_vertex,THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,\"void main() {\",THREE.ShaderChunk.map_vertex,\nTHREE.ShaderChunk.lightmap_vertex,THREE.ShaderChunk.color_vertex,THREE.ShaderChunk.skinbase_vertex,\"\\t#ifdef USE_ENVMAP\",THREE.ShaderChunk.morphnormal_vertex,THREE.ShaderChunk.skinnormal_vertex,THREE.ShaderChunk.defaultnormal_vertex,\"\\t#endif\",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,THREE.ShaderChunk.worldpos_vertex,THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.shadowmap_vertex,\"}\"].join(\"\\n\"),\nfragmentShader:[\"uniform vec3 diffuse;\\nuniform float opacity;\",THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.alphamap_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.specularmap_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,\"void main() {\\n\\tgl_FragColor = vec4( diffuse, opacity );\",THREE.ShaderChunk.logdepthbuf_fragment,\nTHREE.ShaderChunk.map_fragment,THREE.ShaderChunk.alphamap_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.specularmap_fragment,THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,\"}\"].join(\"\\n\")},lambert:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.fog,THREE.UniformsLib.lights,THREE.UniformsLib.shadowmap,\n{ambient:{type:\"c\",value:new THREE.Color(16777215)},emissive:{type:\"c\",value:new THREE.Color(0)},wrapRGB:{type:\"v3\",value:new THREE.Vector3(1,1,1)}}]),vertexShader:[\"#define LAMBERT\\nvarying vec3 vLightFront;\\n#ifdef DOUBLE_SIDED\\n\\tvarying vec3 vLightBack;\\n#endif\",THREE.ShaderChunk.map_pars_vertex,THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.lights_lambert_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,\nTHREE.ShaderChunk.shadowmap_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,\"void main() {\",THREE.ShaderChunk.map_vertex,THREE.ShaderChunk.lightmap_vertex,THREE.ShaderChunk.color_vertex,THREE.ShaderChunk.morphnormal_vertex,THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.skinnormal_vertex,THREE.ShaderChunk.defaultnormal_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,THREE.ShaderChunk.worldpos_vertex,\nTHREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.lights_lambert_vertex,THREE.ShaderChunk.shadowmap_vertex,\"}\"].join(\"\\n\"),fragmentShader:[\"uniform float opacity;\\nvarying vec3 vLightFront;\\n#ifdef DOUBLE_SIDED\\n\\tvarying vec3 vLightBack;\\n#endif\",THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.alphamap_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,\nTHREE.ShaderChunk.specularmap_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,\"void main() {\\n\\tgl_FragColor = vec4( vec3( 1.0 ), opacity );\",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.alphamap_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.specularmap_fragment,\"\\t#ifdef DOUBLE_SIDED\\n\\t\\tif ( gl_FrontFacing )\\n\\t\\t\\tgl_FragColor.xyz *= vLightFront;\\n\\t\\telse\\n\\t\\t\\tgl_FragColor.xyz *= vLightBack;\\n\\t#else\\n\\t\\tgl_FragColor.xyz *= vLightFront;\\n\\t#endif\",\nTHREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,\"}\"].join(\"\\n\")},phong:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.bump,THREE.UniformsLib.normalmap,THREE.UniformsLib.fog,THREE.UniformsLib.lights,THREE.UniformsLib.shadowmap,{ambient:{type:\"c\",value:new THREE.Color(16777215)},emissive:{type:\"c\",value:new THREE.Color(0)},\nspecular:{type:\"c\",value:new THREE.Color(1118481)},shininess:{type:\"f\",value:30},wrapRGB:{type:\"v3\",value:new THREE.Vector3(1,1,1)}}]),vertexShader:[\"#define PHONG\\nvarying vec3 vViewPosition;\\nvarying vec3 vNormal;\",THREE.ShaderChunk.map_pars_vertex,THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.lights_phong_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,\nTHREE.ShaderChunk.logdepthbuf_pars_vertex,\"void main() {\",THREE.ShaderChunk.map_vertex,THREE.ShaderChunk.lightmap_vertex,THREE.ShaderChunk.color_vertex,THREE.ShaderChunk.morphnormal_vertex,THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.skinnormal_vertex,THREE.ShaderChunk.defaultnormal_vertex,\"\\tvNormal = normalize( transformedNormal );\",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,\"\\tvViewPosition = -mvPosition.xyz;\",\nTHREE.ShaderChunk.worldpos_vertex,THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.lights_phong_vertex,THREE.ShaderChunk.shadowmap_vertex,\"}\"].join(\"\\n\"),fragmentShader:[\"uniform vec3 diffuse;\\nuniform float opacity;\\nuniform vec3 ambient;\\nuniform vec3 emissive;\\nuniform vec3 specular;\\nuniform float shininess;\",THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.alphamap_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,\nTHREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.lights_phong_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.bumpmap_pars_fragment,THREE.ShaderChunk.normalmap_pars_fragment,THREE.ShaderChunk.specularmap_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,\"void main() {\\n\\tgl_FragColor = vec4( vec3( 1.0 ), opacity );\",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.alphamap_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.specularmap_fragment,\nTHREE.ShaderChunk.lights_phong_fragment,THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,\"}\"].join(\"\\n\")},particle_basic:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.particle,THREE.UniformsLib.shadowmap]),vertexShader:[\"uniform float size;\\nuniform float scale;\",THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,\nTHREE.ShaderChunk.logdepthbuf_pars_vertex,\"void main() {\",THREE.ShaderChunk.color_vertex,\"\\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\\n\\t#ifdef USE_SIZEATTENUATION\\n\\t\\tgl_PointSize = size * ( scale / length( mvPosition.xyz ) );\\n\\t#else\\n\\t\\tgl_PointSize = size;\\n\\t#endif\\n\\tgl_Position = projectionMatrix * mvPosition;\",THREE.ShaderChunk.logdepthbuf_vertex,THREE.ShaderChunk.worldpos_vertex,THREE.ShaderChunk.shadowmap_vertex,\"}\"].join(\"\\n\"),fragmentShader:[\"uniform vec3 psColor;\\nuniform float opacity;\",\nTHREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_particle_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,\"void main() {\\n\\tgl_FragColor = vec4( psColor, opacity );\",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.map_particle_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.fog_fragment,\"}\"].join(\"\\n\")},dashed:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,\nTHREE.UniformsLib.fog,{scale:{type:\"f\",value:1},dashSize:{type:\"f\",value:1},totalSize:{type:\"f\",value:2}}]),vertexShader:[\"uniform float scale;\\nattribute float lineDistance;\\nvarying float vLineDistance;\",THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,\"void main() {\",THREE.ShaderChunk.color_vertex,\"\\tvLineDistance = scale * lineDistance;\\n\\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\\n\\tgl_Position = projectionMatrix * mvPosition;\",THREE.ShaderChunk.logdepthbuf_vertex,\n\"}\"].join(\"\\n\"),fragmentShader:[\"uniform vec3 diffuse;\\nuniform float opacity;\\nuniform float dashSize;\\nuniform float totalSize;\\nvarying float vLineDistance;\",THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,\"void main() {\\n\\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\\n\\t\\tdiscard;\\n\\t}\\n\\tgl_FragColor = vec4( diffuse, opacity );\",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.fog_fragment,\n\"}\"].join(\"\\n\")},depth:{uniforms:{mNear:{type:\"f\",value:1},mFar:{type:\"f\",value:2E3},opacity:{type:\"f\",value:1}},vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,\"void main() {\",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,\"}\"].join(\"\\n\"),fragmentShader:[\"uniform float mNear;\\nuniform float mFar;\\nuniform float opacity;\",THREE.ShaderChunk.logdepthbuf_pars_fragment,\"void main() {\",THREE.ShaderChunk.logdepthbuf_fragment,\n\"\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\t\\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\\n\\t#else\\n\\t\\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\\n\\t#endif\\n\\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );\\n\\tgl_FragColor = vec4( vec3( color ), opacity );\\n}\"].join(\"\\n\")},normal:{uniforms:{opacity:{type:\"f\",value:1}},vertexShader:[\"varying vec3 vNormal;\",THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,\"void main() {\\n\\tvNormal = normalize( normalMatrix * normal );\",\nTHREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,\"}\"].join(\"\\n\"),fragmentShader:[\"uniform float opacity;\\nvarying vec3 vNormal;\",THREE.ShaderChunk.logdepthbuf_pars_fragment,\"void main() {\\n\\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );\",THREE.ShaderChunk.logdepthbuf_fragment,\"}\"].join(\"\\n\")},normalmap:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.fog,THREE.UniformsLib.lights,THREE.UniformsLib.shadowmap,{enableAO:{type:\"i\",\nvalue:0},enableDiffuse:{type:\"i\",value:0},enableSpecular:{type:\"i\",value:0},enableReflection:{type:\"i\",value:0},enableDisplacement:{type:\"i\",value:0},tDisplacement:{type:\"t\",value:null},tDiffuse:{type:\"t\",value:null},tCube:{type:\"t\",value:null},tNormal:{type:\"t\",value:null},tSpecular:{type:\"t\",value:null},tAO:{type:\"t\",value:null},uNormalScale:{type:\"v2\",value:new THREE.Vector2(1,1)},uDisplacementBias:{type:\"f\",value:0},uDisplacementScale:{type:\"f\",value:1},diffuse:{type:\"c\",value:new THREE.Color(16777215)},\nspecular:{type:\"c\",value:new THREE.Color(1118481)},ambient:{type:\"c\",value:new THREE.Color(16777215)},shininess:{type:\"f\",value:30},opacity:{type:\"f\",value:1},useRefract:{type:\"i\",value:0},refractionRatio:{type:\"f\",value:.98},reflectivity:{type:\"f\",value:.5},uOffset:{type:\"v2\",value:new THREE.Vector2(0,0)},uRepeat:{type:\"v2\",value:new THREE.Vector2(1,1)},wrapRGB:{type:\"v3\",value:new THREE.Vector3(1,1,1)}}]),fragmentShader:[\"uniform vec3 ambient;\\nuniform vec3 diffuse;\\nuniform vec3 specular;\\nuniform float shininess;\\nuniform float opacity;\\nuniform bool enableDiffuse;\\nuniform bool enableSpecular;\\nuniform bool enableAO;\\nuniform bool enableReflection;\\nuniform sampler2D tDiffuse;\\nuniform sampler2D tNormal;\\nuniform sampler2D tSpecular;\\nuniform sampler2D tAO;\\nuniform samplerCube tCube;\\nuniform vec2 uNormalScale;\\nuniform bool useRefract;\\nuniform float refractionRatio;\\nuniform float reflectivity;\\nvarying vec3 vTangent;\\nvarying vec3 vBinormal;\\nvarying vec3 vNormal;\\nvarying vec2 vUv;\\nuniform vec3 ambientLightColor;\\n#if MAX_DIR_LIGHTS > 0\\n\\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\\n\\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\\n#endif\\n#if MAX_HEMI_LIGHTS > 0\\n\\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\\n\\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\\n\\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\\n#endif\\n#if MAX_POINT_LIGHTS > 0\\n\\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\\n\\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\\n\\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\\n#endif\\n#if MAX_SPOT_LIGHTS > 0\\n\\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\\n\\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\\n\\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\\n\\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\\n\\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\\n\\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\\n#endif\\n#ifdef WRAP_AROUND\\n\\tuniform vec3 wrapRGB;\\n#endif\\nvarying vec3 vWorldPosition;\\nvarying vec3 vViewPosition;\",\nTHREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,\"void main() {\",THREE.ShaderChunk.logdepthbuf_fragment,\"\\tgl_FragColor = vec4( vec3( 1.0 ), opacity );\\n\\tvec3 specularTex = vec3( 1.0 );\\n\\tvec3 normalTex = texture2D( tNormal, vUv ).xyz * 2.0 - 1.0;\\n\\tnormalTex.xy *= uNormalScale;\\n\\tnormalTex = normalize( normalTex );\\n\\tif( enableDiffuse ) {\\n\\t\\t#ifdef GAMMA_INPUT\\n\\t\\t\\tvec4 texelColor = texture2D( tDiffuse, vUv );\\n\\t\\t\\ttexelColor.xyz *= texelColor.xyz;\\n\\t\\t\\tgl_FragColor = gl_FragColor * texelColor;\\n\\t\\t#else\\n\\t\\t\\tgl_FragColor = gl_FragColor * texture2D( tDiffuse, vUv );\\n\\t\\t#endif\\n\\t}\\n\\tif( enableAO ) {\\n\\t\\t#ifdef GAMMA_INPUT\\n\\t\\t\\tvec4 aoColor = texture2D( tAO, vUv );\\n\\t\\t\\taoColor.xyz *= aoColor.xyz;\\n\\t\\t\\tgl_FragColor.xyz = gl_FragColor.xyz * aoColor.xyz;\\n\\t\\t#else\\n\\t\\t\\tgl_FragColor.xyz = gl_FragColor.xyz * texture2D( tAO, vUv ).xyz;\\n\\t\\t#endif\\n\\t}\",\nTHREE.ShaderChunk.alphatest_fragment,\"\\tif( enableSpecular )\\n\\t\\tspecularTex = texture2D( tSpecular, vUv ).xyz;\\n\\tmat3 tsb = mat3( normalize( vTangent ), normalize( vBinormal ), normalize( vNormal ) );\\n\\tvec3 finalNormal = tsb * normalTex;\\n\\t#ifdef FLIP_SIDED\\n\\t\\tfinalNormal = -finalNormal;\\n\\t#endif\\n\\tvec3 normal = normalize( finalNormal );\\n\\tvec3 viewPosition = normalize( vViewPosition );\\n\\t#if MAX_POINT_LIGHTS > 0\\n\\t\\tvec3 pointDiffuse = vec3( 0.0 );\\n\\t\\tvec3 pointSpecular = vec3( 0.0 );\\n\\t\\tfor ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\\n\\t\\t\\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\\n\\t\\t\\tvec3 pointVector = lPosition.xyz + vViewPosition.xyz;\\n\\t\\t\\tfloat pointDistance = 1.0;\\n\\t\\t\\tif ( pointLightDistance[ i ] > 0.0 )\\n\\t\\t\\t\\tpointDistance = 1.0 - min( ( length( pointVector ) / pointLightDistance[ i ] ), 1.0 );\\n\\t\\t\\tpointVector = normalize( pointVector );\\n\\t\\t\\t#ifdef WRAP_AROUND\\n\\t\\t\\t\\tfloat pointDiffuseWeightFull = max( dot( normal, pointVector ), 0.0 );\\n\\t\\t\\t\\tfloat pointDiffuseWeightHalf = max( 0.5 * dot( normal, pointVector ) + 0.5, 0.0 );\\n\\t\\t\\t\\tvec3 pointDiffuseWeight = mix( vec3( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );\\n\\t\\t\\t#else\\n\\t\\t\\t\\tfloat pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );\\n\\t\\t\\t#endif\\n\\t\\t\\tpointDiffuse += pointDistance * pointLightColor[ i ] * diffuse * pointDiffuseWeight;\\n\\t\\t\\tvec3 pointHalfVector = normalize( pointVector + viewPosition );\\n\\t\\t\\tfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\\n\\t\\t\\tfloat pointSpecularWeight = specularTex.r * max( pow( pointDotNormalHalf, shininess ), 0.0 );\\n\\t\\t\\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\\n\\t\\t\\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( pointVector, pointHalfVector ), 0.0 ), 5.0 );\\n\\t\\t\\tpointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance * specularNormalization;\\n\\t\\t}\\n\\t#endif\\n\\t#if MAX_SPOT_LIGHTS > 0\\n\\t\\tvec3 spotDiffuse = vec3( 0.0 );\\n\\t\\tvec3 spotSpecular = vec3( 0.0 );\\n\\t\\tfor ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\\n\\t\\t\\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\\n\\t\\t\\tvec3 spotVector = lPosition.xyz + vViewPosition.xyz;\\n\\t\\t\\tfloat spotDistance = 1.0;\\n\\t\\t\\tif ( spotLightDistance[ i ] > 0.0 )\\n\\t\\t\\t\\tspotDistance = 1.0 - min( ( length( spotVector ) / spotLightDistance[ i ] ), 1.0 );\\n\\t\\t\\tspotVector = normalize( spotVector );\\n\\t\\t\\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );\\n\\t\\t\\tif ( spotEffect > spotLightAngleCos[ i ] ) {\\n\\t\\t\\t\\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\\n\\t\\t\\t\\t#ifdef WRAP_AROUND\\n\\t\\t\\t\\t\\tfloat spotDiffuseWeightFull = max( dot( normal, spotVector ), 0.0 );\\n\\t\\t\\t\\t\\tfloat spotDiffuseWeightHalf = max( 0.5 * dot( normal, spotVector ) + 0.5, 0.0 );\\n\\t\\t\\t\\t\\tvec3 spotDiffuseWeight = mix( vec3( spotDiffuseWeightFull ), vec3( spotDiffuseWeightHalf ), wrapRGB );\\n\\t\\t\\t\\t#else\\n\\t\\t\\t\\t\\tfloat spotDiffuseWeight = max( dot( normal, spotVector ), 0.0 );\\n\\t\\t\\t\\t#endif\\n\\t\\t\\t\\tspotDiffuse += spotDistance * spotLightColor[ i ] * diffuse * spotDiffuseWeight * spotEffect;\\n\\t\\t\\t\\tvec3 spotHalfVector = normalize( spotVector + viewPosition );\\n\\t\\t\\t\\tfloat spotDotNormalHalf = max( dot( normal, spotHalfVector ), 0.0 );\\n\\t\\t\\t\\tfloat spotSpecularWeight = specularTex.r * max( pow( spotDotNormalHalf, shininess ), 0.0 );\\n\\t\\t\\t\\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\\n\\t\\t\\t\\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( spotVector, spotHalfVector ), 0.0 ), 5.0 );\\n\\t\\t\\t\\tspotSpecular += schlick * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * spotDistance * specularNormalization * spotEffect;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t#endif\\n\\t#if MAX_DIR_LIGHTS > 0\\n\\t\\tvec3 dirDiffuse = vec3( 0.0 );\\n\\t\\tvec3 dirSpecular = vec3( 0.0 );\\n\\t\\tfor( int i = 0; i < MAX_DIR_LIGHTS; i++ ) {\\n\\t\\t\\tvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\\n\\t\\t\\tvec3 dirVector = normalize( lDirection.xyz );\\n\\t\\t\\t#ifdef WRAP_AROUND\\n\\t\\t\\t\\tfloat directionalLightWeightingFull = max( dot( normal, dirVector ), 0.0 );\\n\\t\\t\\t\\tfloat directionalLightWeightingHalf = max( 0.5 * dot( normal, dirVector ) + 0.5, 0.0 );\\n\\t\\t\\t\\tvec3 dirDiffuseWeight = mix( vec3( directionalLightWeightingFull ), vec3( directionalLightWeightingHalf ), wrapRGB );\\n\\t\\t\\t#else\\n\\t\\t\\t\\tfloat dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );\\n\\t\\t\\t#endif\\n\\t\\t\\tdirDiffuse += directionalLightColor[ i ] * diffuse * dirDiffuseWeight;\\n\\t\\t\\tvec3 dirHalfVector = normalize( dirVector + viewPosition );\\n\\t\\t\\tfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\\n\\t\\t\\tfloat dirSpecularWeight = specularTex.r * max( pow( dirDotNormalHalf, shininess ), 0.0 );\\n\\t\\t\\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\\n\\t\\t\\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( dirVector, dirHalfVector ), 0.0 ), 5.0 );\\n\\t\\t\\tdirSpecular += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization;\\n\\t\\t}\\n\\t#endif\\n\\t#if MAX_HEMI_LIGHTS > 0\\n\\t\\tvec3 hemiDiffuse = vec3( 0.0 );\\n\\t\\tvec3 hemiSpecular = vec3( 0.0 );\\n\\t\\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\\n\\t\\t\\tvec4 lDirection = viewMatrix * vec4( hemisphereLightDirection[ i ], 0.0 );\\n\\t\\t\\tvec3 lVector = normalize( lDirection.xyz );\\n\\t\\t\\tfloat dotProduct = dot( normal, lVector );\\n\\t\\t\\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\\n\\t\\t\\tvec3 hemiColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\\n\\t\\t\\themiDiffuse += diffuse * hemiColor;\\n\\t\\t\\tvec3 hemiHalfVectorSky = normalize( lVector + viewPosition );\\n\\t\\t\\tfloat hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;\\n\\t\\t\\tfloat hemiSpecularWeightSky = specularTex.r * max( pow( max( hemiDotNormalHalfSky, 0.0 ), shininess ), 0.0 );\\n\\t\\t\\tvec3 lVectorGround = -lVector;\\n\\t\\t\\tvec3 hemiHalfVectorGround = normalize( lVectorGround + viewPosition );\\n\\t\\t\\tfloat hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;\\n\\t\\t\\tfloat hemiSpecularWeightGround = specularTex.r * max( pow( max( hemiDotNormalHalfGround, 0.0 ), shininess ), 0.0 );\\n\\t\\t\\tfloat dotProductGround = dot( normal, lVectorGround );\\n\\t\\t\\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\\n\\t\\t\\tvec3 schlickSky = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, hemiHalfVectorSky ), 0.0 ), 5.0 );\\n\\t\\t\\tvec3 schlickGround = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVectorGround, hemiHalfVectorGround ), 0.0 ), 5.0 );\\n\\t\\t\\themiSpecular += hemiColor * specularNormalization * ( schlickSky * hemiSpecularWeightSky * max( dotProduct, 0.0 ) + schlickGround * hemiSpecularWeightGround * max( dotProductGround, 0.0 ) );\\n\\t\\t}\\n\\t#endif\\n\\tvec3 totalDiffuse = vec3( 0.0 );\\n\\tvec3 totalSpecular = vec3( 0.0 );\\n\\t#if MAX_DIR_LIGHTS > 0\\n\\t\\ttotalDiffuse += dirDiffuse;\\n\\t\\ttotalSpecular += dirSpecular;\\n\\t#endif\\n\\t#if MAX_HEMI_LIGHTS > 0\\n\\t\\ttotalDiffuse += hemiDiffuse;\\n\\t\\ttotalSpecular += hemiSpecular;\\n\\t#endif\\n\\t#if MAX_POINT_LIGHTS > 0\\n\\t\\ttotalDiffuse += pointDiffuse;\\n\\t\\ttotalSpecular += pointSpecular;\\n\\t#endif\\n\\t#if MAX_SPOT_LIGHTS > 0\\n\\t\\ttotalDiffuse += spotDiffuse;\\n\\t\\ttotalSpecular += spotSpecular;\\n\\t#endif\\n\\t#ifdef METAL\\n\\t\\tgl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient + totalSpecular );\\n\\t#else\\n\\t\\tgl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient ) + totalSpecular;\\n\\t#endif\\n\\tif ( enableReflection ) {\\n\\t\\tvec3 vReflect;\\n\\t\\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\\n\\t\\tif ( useRefract ) {\\n\\t\\t\\tvReflect = refract( cameraToVertex, normal, refractionRatio );\\n\\t\\t} else {\\n\\t\\t\\tvReflect = reflect( cameraToVertex, normal );\\n\\t\\t}\\n\\t\\tvec4 cubeColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );\\n\\t\\t#ifdef GAMMA_INPUT\\n\\t\\t\\tcubeColor.xyz *= cubeColor.xyz;\\n\\t\\t#endif\\n\\t\\tgl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularTex.r * reflectivity );\\n\\t}\",\nTHREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,\"}\"].join(\"\\n\"),vertexShader:[\"attribute vec4 tangent;\\nuniform vec2 uOffset;\\nuniform vec2 uRepeat;\\nuniform bool enableDisplacement;\\n#ifdef VERTEX_TEXTURES\\n\\tuniform sampler2D tDisplacement;\\n\\tuniform float uDisplacementScale;\\n\\tuniform float uDisplacementBias;\\n#endif\\nvarying vec3 vTangent;\\nvarying vec3 vBinormal;\\nvarying vec3 vNormal;\\nvarying vec2 vUv;\\nvarying vec3 vWorldPosition;\\nvarying vec3 vViewPosition;\",\nTHREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,\"void main() {\",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.skinnormal_vertex,\"\\t#ifdef USE_SKINNING\\n\\t\\tvNormal = normalize( normalMatrix * skinnedNormal.xyz );\\n\\t\\tvec4 skinnedTangent = skinMatrix * vec4( tangent.xyz, 0.0 );\\n\\t\\tvTangent = normalize( normalMatrix * skinnedTangent.xyz );\\n\\t#else\\n\\t\\tvNormal = normalize( normalMatrix * normal );\\n\\t\\tvTangent = normalize( normalMatrix * tangent.xyz );\\n\\t#endif\\n\\tvBinormal = normalize( cross( vNormal, vTangent ) * tangent.w );\\n\\tvUv = uv * uRepeat + uOffset;\\n\\tvec3 displacedPosition;\\n\\t#ifdef VERTEX_TEXTURES\\n\\t\\tif ( enableDisplacement ) {\\n\\t\\t\\tvec3 dv = texture2D( tDisplacement, uv ).xyz;\\n\\t\\t\\tfloat df = uDisplacementScale * dv.x + uDisplacementBias;\\n\\t\\t\\tdisplacedPosition = position + normalize( normal ) * df;\\n\\t\\t} else {\\n\\t\\t\\t#ifdef USE_SKINNING\\n\\t\\t\\t\\tvec4 skinVertex = bindMatrix * vec4( position, 1.0 );\\n\\t\\t\\t\\tvec4 skinned = vec4( 0.0 );\\n\\t\\t\\t\\tskinned += boneMatX * skinVertex * skinWeight.x;\\n\\t\\t\\t\\tskinned += boneMatY * skinVertex * skinWeight.y;\\n\\t\\t\\t\\tskinned += boneMatZ * skinVertex * skinWeight.z;\\n\\t\\t\\t\\tskinned += boneMatW * skinVertex * skinWeight.w;\\n\\t\\t\\t\\tskinned  = bindMatrixInverse * skinned;\\n\\t\\t\\t\\tdisplacedPosition = skinned.xyz;\\n\\t\\t\\t#else\\n\\t\\t\\t\\tdisplacedPosition = position;\\n\\t\\t\\t#endif\\n\\t\\t}\\n\\t#else\\n\\t\\t#ifdef USE_SKINNING\\n\\t\\t\\tvec4 skinVertex = bindMatrix * vec4( position, 1.0 );\\n\\t\\t\\tvec4 skinned = vec4( 0.0 );\\n\\t\\t\\tskinned += boneMatX * skinVertex * skinWeight.x;\\n\\t\\t\\tskinned += boneMatY * skinVertex * skinWeight.y;\\n\\t\\t\\tskinned += boneMatZ * skinVertex * skinWeight.z;\\n\\t\\t\\tskinned += boneMatW * skinVertex * skinWeight.w;\\n\\t\\t\\tskinned  = bindMatrixInverse * skinned;\\n\\t\\t\\tdisplacedPosition = skinned.xyz;\\n\\t\\t#else\\n\\t\\t\\tdisplacedPosition = position;\\n\\t\\t#endif\\n\\t#endif\\n\\tvec4 mvPosition = modelViewMatrix * vec4( displacedPosition, 1.0 );\\n\\tvec4 worldPosition = modelMatrix * vec4( displacedPosition, 1.0 );\\n\\tgl_Position = projectionMatrix * mvPosition;\",\nTHREE.ShaderChunk.logdepthbuf_vertex,\"\\tvWorldPosition = worldPosition.xyz;\\n\\tvViewPosition = -mvPosition.xyz;\\n\\t#ifdef USE_SHADOWMAP\\n\\t\\tfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\\n\\t\\t\\tvShadowCoord[ i ] = shadowMatrix[ i ] * worldPosition;\\n\\t\\t}\\n\\t#endif\\n}\"].join(\"\\n\")},cube:{uniforms:{tCube:{type:\"t\",value:null},tFlip:{type:\"f\",value:-1}},vertexShader:[\"varying vec3 vWorldPosition;\",THREE.ShaderChunk.logdepthbuf_pars_vertex,\"void main() {\\n\\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\\n\\tvWorldPosition = worldPosition.xyz;\\n\\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\nTHREE.ShaderChunk.logdepthbuf_vertex,\"}\"].join(\"\\n\"),fragmentShader:[\"uniform samplerCube tCube;\\nuniform float tFlip;\\nvarying vec3 vWorldPosition;\",THREE.ShaderChunk.logdepthbuf_pars_fragment,\"void main() {\\n\\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\",THREE.ShaderChunk.logdepthbuf_fragment,\"}\"].join(\"\\n\")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,\n\"void main() {\",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,\"}\"].join(\"\\n\"),fragmentShader:[THREE.ShaderChunk.logdepthbuf_pars_fragment,\"vec4 pack_depth( const in float depth ) {\\n\\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\\n\\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\\n\\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\\n\\tres -= res.xxyz * bit_mask;\\n\\treturn res;\\n}\\nvoid main() {\",\nTHREE.ShaderChunk.logdepthbuf_fragment,\"\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\t\\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\\n\\t#else\\n\\t\\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\\n\\t#endif\\n}\"].join(\"\\n\")}};\nTHREE.WebGLRenderer=function(a){function b(a,b){var c=a.vertices.length,d=b.material;if(d.attributes){void 0===a.__webglCustomAttributesList&&(a.__webglCustomAttributesList=[]);for(var e in d.attributes){var f=d.attributes[e];if(!f.__webglInitialized||f.createUniqueBuffers){f.__webglInitialized=!0;var g=1;\"v2\"===f.type?g=2:\"v3\"===f.type?g=3:\"v4\"===f.type?g=4:\"c\"===f.type&&(g=3);f.size=g;f.array=new Float32Array(c*g);f.buffer=m.createBuffer();f.buffer.belongsToAttribute=e;f.needsUpdate=!0}a.__webglCustomAttributesList.push(f)}}}\nfunction c(a,b){var c=b.geometry,g=a.faces3,h=3*g.length,k=1*g.length,l=3*g.length,g=d(b,a),n=f(g),r=e(g),p=g.vertexColors?g.vertexColors:!1;a.__vertexArray=new Float32Array(3*h);r&&(a.__normalArray=new Float32Array(3*h));c.hasTangents&&(a.__tangentArray=new Float32Array(4*h));p&&(a.__colorArray=new Float32Array(3*h));n&&(0<c.faceVertexUvs.length&&(a.__uvArray=new Float32Array(2*h)),1<c.faceVertexUvs.length&&(a.__uv2Array=new Float32Array(2*h)));b.geometry.skinWeights.length&&b.geometry.skinIndices.length&&\n(a.__skinIndexArray=new Float32Array(4*h),a.__skinWeightArray=new Float32Array(4*h));c=null!==Eb&&21845<k?Uint32Array:Uint16Array;a.__typeArray=c;a.__faceArray=new c(3*k);a.__lineArray=new c(2*l);if(a.numMorphTargets)for(a.__morphTargetsArrays=[],c=0,n=a.numMorphTargets;c<n;c++)a.__morphTargetsArrays.push(new Float32Array(3*h));if(a.numMorphNormals)for(a.__morphNormalsArrays=[],c=0,n=a.numMorphNormals;c<n;c++)a.__morphNormalsArrays.push(new Float32Array(3*h));a.__webglFaceCount=3*k;a.__webglLineCount=\n2*l;if(g.attributes){void 0===a.__webglCustomAttributesList&&(a.__webglCustomAttributesList=[]);for(var q in g.attributes){var k=g.attributes[q],l={},s;for(s in k)l[s]=k[s];if(!l.__webglInitialized||l.createUniqueBuffers)l.__webglInitialized=!0,c=1,\"v2\"===l.type?c=2:\"v3\"===l.type?c=3:\"v4\"===l.type?c=4:\"c\"===l.type&&(c=3),l.size=c,l.array=new Float32Array(h*c),l.buffer=m.createBuffer(),l.buffer.belongsToAttribute=q,k.needsUpdate=!0,l.__original=k;a.__webglCustomAttributesList.push(l)}}a.__inittedArrays=\n!0}function d(a,b){return a.material instanceof THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:a.material}function e(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a instanceof THREE.MeshDepthMaterial?!1:a&&void 0!==a.shading&&a.shading===THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading}function f(a){return a.map||a.lightMap||a.bumpMap||a.normalMap||a.specularMap||a.alphaMap||a instanceof THREE.ShaderMaterial?!0:!1}function g(a){for(var b in a.attributes){var c=\n\"index\"===b?m.ELEMENT_ARRAY_BUFFER:m.ARRAY_BUFFER,d=a.attributes[b];d.buffer=m.createBuffer();m.bindBuffer(c,d.buffer);m.bufferData(c,d.array,m.STATIC_DRAW)}}function h(a,b,c,d){for(var e in b){var f=b[e],g=c[e];if(0<=f)if(g){var h=g.itemSize;m.bindBuffer(m.ARRAY_BUFFER,g.buffer);l(f);m.vertexAttribPointer(f,h,m.FLOAT,!1,0,d*h*4)}else a.defaultAttributeValues&&(2===a.defaultAttributeValues[e].length?m.vertexAttrib2fv(f,a.defaultAttributeValues[e]):3===a.defaultAttributeValues[e].length&&m.vertexAttrib3fv(f,\na.defaultAttributeValues[e]))}n()}function k(){for(var a=0,b=pb.length;a<b;a++)pb[a]=0}function l(a){pb[a]=1;0===tb[a]&&(m.enableVertexAttribArray(a),tb[a]=1)}function n(){for(var a=0,b=tb.length;a<b;a++)tb[a]!==pb[a]&&(m.disableVertexAttribArray(a),tb[a]=0)}function q(a,b){return a.z!==b.z?b.z-a.z:a.id-b.id}function r(a,b){return a.z!==b.z?a.z-b.z:a.id-b.id}function t(a,b){return b[0]-a[0]}function s(a,b,h){if(!1!==b.visible){var k=a.__webglObjects[b.id];if(k&&(!1===b.frustumCulled||!0===jc.intersectsObject(b))){var l=\nb.geometry,n,r,p;if(l instanceof THREE.BufferGeometry){var q=m.DYNAMIC_DRAW,w=l.attributes,u,v;for(u in w)v=w[u],v.needsUpdate&&(\"index\"===u?(m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,v.buffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,v.array,q)):(m.bindBuffer(m.ARRAY_BUFFER,v.buffer),m.bufferData(m.ARRAY_BUFFER,v.array,q)),v.needsUpdate=!1)}else if(b instanceof THREE.Mesh){if(l.buffersNeedUpdate||l.groupsNeedUpdate)l instanceof THREE.BufferGeometry?g(l):b instanceof THREE.Mesh&&D(a,b,l);for(var A=0,z=l.geometryGroupsList.length;A<\nz;A++)if(n=l.geometryGroupsList[A],p=d(b,n),(l.buffersNeedUpdate||l.groupsNeedUpdate)&&c(n,b),r=p.attributes&&x(p),l.verticesNeedUpdate||l.morphTargetsNeedUpdate||l.elementsNeedUpdate||l.uvsNeedUpdate||l.normalsNeedUpdate||l.colorsNeedUpdate||l.tangentsNeedUpdate||r){var y=n,E=b,I=m.DYNAMIC_DRAW,J=!l.dynamic,L=p;if(y.__inittedArrays){var K=e(L),H=L.vertexColors?L.vertexColors:!1,Q=f(L),O=K===THREE.SmoothShading,B=void 0,N=void 0,P=void 0,T=void 0,R=void 0,ba=void 0,S=void 0,$=void 0,X=void 0,V=void 0,\nza=void 0,ga=void 0,ha=void 0,ia=void 0,Ea=void 0,aa=void 0,da=void 0,ya=void 0,U=void 0,ca=void 0,W=void 0,Ba=void 0,Aa=void 0,la=void 0,ma=void 0,oa=void 0,ra=void 0,ua=void 0,va=void 0,ja=void 0,Fa=void 0,Da=void 0,Ga=void 0,Ya=void 0,qa=void 0,Ka=void 0,xa=void 0,Ca=void 0,Ja=void 0,Qa=void 0,db=0,eb=0,Sa=0,Za=0,Ta=0,gb=0,Ua=0,ub=0,$a=0,wa=0,Ha=0,M=0,Ra=void 0,hb=y.__vertexArray,cb=y.__uvArray,fb=y.__uv2Array,yb=y.__normalArray,Va=y.__tangentArray,ib=y.__colorArray,Wa=y.__skinIndexArray,Xa=y.__skinWeightArray,\ntb=y.__morphTargetsArrays,wb=y.__morphNormalsArrays,sb=y.__webglCustomAttributesList,F=void 0,pb=y.__faceArray,zb=y.__lineArray,La=E.geometry,Db=La.elementsNeedUpdate,xb=La.uvsNeedUpdate,Eb=La.normalsNeedUpdate,Ob=La.tangentsNeedUpdate,Pb=La.colorsNeedUpdate,Sb=La.morphTargetsNeedUpdate,lc=La.vertices,ka=y.faces3,jb=La.faces,Hb=La.faceVertexUvs[0],Ib=La.faceVertexUvs[1],mc=La.skinIndices,Vb=La.skinWeights,Wb=La.morphTargets,Jb=La.morphNormals;if(La.verticesNeedUpdate){B=0;for(N=ka.length;B<N;B++)T=\njb[ka[B]],ga=lc[T.a],ha=lc[T.b],ia=lc[T.c],hb[eb]=ga.x,hb[eb+1]=ga.y,hb[eb+2]=ga.z,hb[eb+3]=ha.x,hb[eb+4]=ha.y,hb[eb+5]=ha.z,hb[eb+6]=ia.x,hb[eb+7]=ia.y,hb[eb+8]=ia.z,eb+=9;m.bindBuffer(m.ARRAY_BUFFER,y.__webglVertexBuffer);m.bufferData(m.ARRAY_BUFFER,hb,I)}if(Sb)for(qa=0,Ka=Wb.length;qa<Ka;qa++){B=Ha=0;for(N=ka.length;B<N;B++)Ja=ka[B],T=jb[Ja],ga=Wb[qa].vertices[T.a],ha=Wb[qa].vertices[T.b],ia=Wb[qa].vertices[T.c],xa=tb[qa],xa[Ha]=ga.x,xa[Ha+1]=ga.y,xa[Ha+2]=ga.z,xa[Ha+3]=ha.x,xa[Ha+4]=ha.y,xa[Ha+\n5]=ha.z,xa[Ha+6]=ia.x,xa[Ha+7]=ia.y,xa[Ha+8]=ia.z,L.morphNormals&&(O?(Qa=Jb[qa].vertexNormals[Ja],ya=Qa.a,U=Qa.b,ca=Qa.c):ca=U=ya=Jb[qa].faceNormals[Ja],Ca=wb[qa],Ca[Ha]=ya.x,Ca[Ha+1]=ya.y,Ca[Ha+2]=ya.z,Ca[Ha+3]=U.x,Ca[Ha+4]=U.y,Ca[Ha+5]=U.z,Ca[Ha+6]=ca.x,Ca[Ha+7]=ca.y,Ca[Ha+8]=ca.z),Ha+=9;m.bindBuffer(m.ARRAY_BUFFER,y.__webglMorphTargetsBuffers[qa]);m.bufferData(m.ARRAY_BUFFER,tb[qa],I);L.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,y.__webglMorphNormalsBuffers[qa]),m.bufferData(m.ARRAY_BUFFER,wb[qa],\nI))}if(Vb.length){B=0;for(N=ka.length;B<N;B++)T=jb[ka[B]],la=Vb[T.a],ma=Vb[T.b],oa=Vb[T.c],Xa[wa]=la.x,Xa[wa+1]=la.y,Xa[wa+2]=la.z,Xa[wa+3]=la.w,Xa[wa+4]=ma.x,Xa[wa+5]=ma.y,Xa[wa+6]=ma.z,Xa[wa+7]=ma.w,Xa[wa+8]=oa.x,Xa[wa+9]=oa.y,Xa[wa+10]=oa.z,Xa[wa+11]=oa.w,ra=mc[T.a],ua=mc[T.b],va=mc[T.c],Wa[wa]=ra.x,Wa[wa+1]=ra.y,Wa[wa+2]=ra.z,Wa[wa+3]=ra.w,Wa[wa+4]=ua.x,Wa[wa+5]=ua.y,Wa[wa+6]=ua.z,Wa[wa+7]=ua.w,Wa[wa+8]=va.x,Wa[wa+9]=va.y,Wa[wa+10]=va.z,Wa[wa+11]=va.w,wa+=12;0<wa&&(m.bindBuffer(m.ARRAY_BUFFER,\ny.__webglSkinIndicesBuffer),m.bufferData(m.ARRAY_BUFFER,Wa,I),m.bindBuffer(m.ARRAY_BUFFER,y.__webglSkinWeightsBuffer),m.bufferData(m.ARRAY_BUFFER,Xa,I))}if(Pb&&H){B=0;for(N=ka.length;B<N;B++)T=jb[ka[B]],S=T.vertexColors,$=T.color,3===S.length&&H===THREE.VertexColors?(W=S[0],Ba=S[1],Aa=S[2]):Aa=Ba=W=$,ib[$a]=W.r,ib[$a+1]=W.g,ib[$a+2]=W.b,ib[$a+3]=Ba.r,ib[$a+4]=Ba.g,ib[$a+5]=Ba.b,ib[$a+6]=Aa.r,ib[$a+7]=Aa.g,ib[$a+8]=Aa.b,$a+=9;0<$a&&(m.bindBuffer(m.ARRAY_BUFFER,y.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,\nib,I))}if(Ob&&La.hasTangents){B=0;for(N=ka.length;B<N;B++)T=jb[ka[B]],X=T.vertexTangents,Ea=X[0],aa=X[1],da=X[2],Va[Ua]=Ea.x,Va[Ua+1]=Ea.y,Va[Ua+2]=Ea.z,Va[Ua+3]=Ea.w,Va[Ua+4]=aa.x,Va[Ua+5]=aa.y,Va[Ua+6]=aa.z,Va[Ua+7]=aa.w,Va[Ua+8]=da.x,Va[Ua+9]=da.y,Va[Ua+10]=da.z,Va[Ua+11]=da.w,Ua+=12;m.bindBuffer(m.ARRAY_BUFFER,y.__webglTangentBuffer);m.bufferData(m.ARRAY_BUFFER,Va,I)}if(Eb&&K){B=0;for(N=ka.length;B<N;B++)if(T=jb[ka[B]],R=T.vertexNormals,ba=T.normal,3===R.length&&O)for(ja=0;3>ja;ja++)Da=R[ja],\nyb[gb]=Da.x,yb[gb+1]=Da.y,yb[gb+2]=Da.z,gb+=3;else for(ja=0;3>ja;ja++)yb[gb]=ba.x,yb[gb+1]=ba.y,yb[gb+2]=ba.z,gb+=3;m.bindBuffer(m.ARRAY_BUFFER,y.__webglNormalBuffer);m.bufferData(m.ARRAY_BUFFER,yb,I)}if(xb&&Hb&&Q){B=0;for(N=ka.length;B<N;B++)if(P=ka[B],V=Hb[P],void 0!==V)for(ja=0;3>ja;ja++)Ga=V[ja],cb[Sa]=Ga.x,cb[Sa+1]=Ga.y,Sa+=2;0<Sa&&(m.bindBuffer(m.ARRAY_BUFFER,y.__webglUVBuffer),m.bufferData(m.ARRAY_BUFFER,cb,I))}if(xb&&Ib&&Q){B=0;for(N=ka.length;B<N;B++)if(P=ka[B],za=Ib[P],void 0!==za)for(ja=\n0;3>ja;ja++)Ya=za[ja],fb[Za]=Ya.x,fb[Za+1]=Ya.y,Za+=2;0<Za&&(m.bindBuffer(m.ARRAY_BUFFER,y.__webglUV2Buffer),m.bufferData(m.ARRAY_BUFFER,fb,I))}if(Db){B=0;for(N=ka.length;B<N;B++)pb[Ta]=db,pb[Ta+1]=db+1,pb[Ta+2]=db+2,Ta+=3,zb[ub]=db,zb[ub+1]=db+1,zb[ub+2]=db,zb[ub+3]=db+2,zb[ub+4]=db+1,zb[ub+5]=db+2,ub+=6,db+=3;m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,y.__webglFaceBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,pb,I);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,y.__webglLineBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,\nzb,I)}if(sb)for(ja=0,Fa=sb.length;ja<Fa;ja++)if(F=sb[ja],F.__original.needsUpdate){M=0;if(1===F.size)if(void 0===F.boundTo||\"vertices\"===F.boundTo)for(B=0,N=ka.length;B<N;B++)T=jb[ka[B]],F.array[M]=F.value[T.a],F.array[M+1]=F.value[T.b],F.array[M+2]=F.value[T.c],M+=3;else{if(\"faces\"===F.boundTo)for(B=0,N=ka.length;B<N;B++)Ra=F.value[ka[B]],F.array[M]=Ra,F.array[M+1]=Ra,F.array[M+2]=Ra,M+=3}else if(2===F.size)if(void 0===F.boundTo||\"vertices\"===F.boundTo)for(B=0,N=ka.length;B<N;B++)T=jb[ka[B]],ga=\nF.value[T.a],ha=F.value[T.b],ia=F.value[T.c],F.array[M]=ga.x,F.array[M+1]=ga.y,F.array[M+2]=ha.x,F.array[M+3]=ha.y,F.array[M+4]=ia.x,F.array[M+5]=ia.y,M+=6;else{if(\"faces\"===F.boundTo)for(B=0,N=ka.length;B<N;B++)ia=ha=ga=Ra=F.value[ka[B]],F.array[M]=ga.x,F.array[M+1]=ga.y,F.array[M+2]=ha.x,F.array[M+3]=ha.y,F.array[M+4]=ia.x,F.array[M+5]=ia.y,M+=6}else if(3===F.size){var ta;ta=\"c\"===F.type?[\"r\",\"g\",\"b\"]:[\"x\",\"y\",\"z\"];if(void 0===F.boundTo||\"vertices\"===F.boundTo)for(B=0,N=ka.length;B<N;B++)T=jb[ka[B]],\nga=F.value[T.a],ha=F.value[T.b],ia=F.value[T.c],F.array[M]=ga[ta[0]],F.array[M+1]=ga[ta[1]],F.array[M+2]=ga[ta[2]],F.array[M+3]=ha[ta[0]],F.array[M+4]=ha[ta[1]],F.array[M+5]=ha[ta[2]],F.array[M+6]=ia[ta[0]],F.array[M+7]=ia[ta[1]],F.array[M+8]=ia[ta[2]],M+=9;else if(\"faces\"===F.boundTo)for(B=0,N=ka.length;B<N;B++)ia=ha=ga=Ra=F.value[ka[B]],F.array[M]=ga[ta[0]],F.array[M+1]=ga[ta[1]],F.array[M+2]=ga[ta[2]],F.array[M+3]=ha[ta[0]],F.array[M+4]=ha[ta[1]],F.array[M+5]=ha[ta[2]],F.array[M+6]=ia[ta[0]],F.array[M+\n7]=ia[ta[1]],F.array[M+8]=ia[ta[2]],M+=9;else if(\"faceVertices\"===F.boundTo)for(B=0,N=ka.length;B<N;B++)Ra=F.value[ka[B]],ga=Ra[0],ha=Ra[1],ia=Ra[2],F.array[M]=ga[ta[0]],F.array[M+1]=ga[ta[1]],F.array[M+2]=ga[ta[2]],F.array[M+3]=ha[ta[0]],F.array[M+4]=ha[ta[1]],F.array[M+5]=ha[ta[2]],F.array[M+6]=ia[ta[0]],F.array[M+7]=ia[ta[1]],F.array[M+8]=ia[ta[2]],M+=9}else if(4===F.size)if(void 0===F.boundTo||\"vertices\"===F.boundTo)for(B=0,N=ka.length;B<N;B++)T=jb[ka[B]],ga=F.value[T.a],ha=F.value[T.b],ia=F.value[T.c],\nF.array[M]=ga.x,F.array[M+1]=ga.y,F.array[M+2]=ga.z,F.array[M+3]=ga.w,F.array[M+4]=ha.x,F.array[M+5]=ha.y,F.array[M+6]=ha.z,F.array[M+7]=ha.w,F.array[M+8]=ia.x,F.array[M+9]=ia.y,F.array[M+10]=ia.z,F.array[M+11]=ia.w,M+=12;else if(\"faces\"===F.boundTo)for(B=0,N=ka.length;B<N;B++)ia=ha=ga=Ra=F.value[ka[B]],F.array[M]=ga.x,F.array[M+1]=ga.y,F.array[M+2]=ga.z,F.array[M+3]=ga.w,F.array[M+4]=ha.x,F.array[M+5]=ha.y,F.array[M+6]=ha.z,F.array[M+7]=ha.w,F.array[M+8]=ia.x,F.array[M+9]=ia.y,F.array[M+10]=ia.z,\nF.array[M+11]=ia.w,M+=12;else if(\"faceVertices\"===F.boundTo)for(B=0,N=ka.length;B<N;B++)Ra=F.value[ka[B]],ga=Ra[0],ha=Ra[1],ia=Ra[2],F.array[M]=ga.x,F.array[M+1]=ga.y,F.array[M+2]=ga.z,F.array[M+3]=ga.w,F.array[M+4]=ha.x,F.array[M+5]=ha.y,F.array[M+6]=ha.z,F.array[M+7]=ha.w,F.array[M+8]=ia.x,F.array[M+9]=ia.y,F.array[M+10]=ia.z,F.array[M+11]=ia.w,M+=12;m.bindBuffer(m.ARRAY_BUFFER,F.buffer);m.bufferData(m.ARRAY_BUFFER,F.array,I)}J&&(delete y.__inittedArrays,delete y.__colorArray,delete y.__normalArray,\ndelete y.__tangentArray,delete y.__uvArray,delete y.__uv2Array,delete y.__faceArray,delete y.__vertexArray,delete y.__lineArray,delete y.__skinIndexArray,delete y.__skinWeightArray)}}l.verticesNeedUpdate=!1;l.morphTargetsNeedUpdate=!1;l.elementsNeedUpdate=!1;l.uvsNeedUpdate=!1;l.normalsNeedUpdate=!1;l.colorsNeedUpdate=!1;l.tangentsNeedUpdate=!1;l.buffersNeedUpdate=!1;p.attributes&&C(p)}else if(b instanceof THREE.Line){p=d(b,l);r=p.attributes&&x(p);if(l.verticesNeedUpdate||l.colorsNeedUpdate||l.lineDistancesNeedUpdate||\nr){var Xb=m.DYNAMIC_DRAW,Kb,Lb,Mb,Yb,sa,Zb,Nb=l.vertices,Qb=l.colors,Rb=l.lineDistances,ec=Nb.length,fc=Qb.length,gc=Rb.length,$b=l.__vertexArray,ac=l.__colorArray,Tb=l.__lineDistanceArray,hc=l.colorsNeedUpdate,ic=l.lineDistancesNeedUpdate,nc=l.__webglCustomAttributesList,bc,uc,Ia,Fb,Ma,pa;if(l.verticesNeedUpdate){for(Kb=0;Kb<ec;Kb++)Yb=Nb[Kb],sa=3*Kb,$b[sa]=Yb.x,$b[sa+1]=Yb.y,$b[sa+2]=Yb.z;m.bindBuffer(m.ARRAY_BUFFER,l.__webglVertexBuffer);m.bufferData(m.ARRAY_BUFFER,$b,Xb)}if(hc){for(Lb=0;Lb<fc;Lb++)Zb=\nQb[Lb],sa=3*Lb,ac[sa]=Zb.r,ac[sa+1]=Zb.g,ac[sa+2]=Zb.b;m.bindBuffer(m.ARRAY_BUFFER,l.__webglColorBuffer);m.bufferData(m.ARRAY_BUFFER,ac,Xb)}if(ic){for(Mb=0;Mb<gc;Mb++)Tb[Mb]=Rb[Mb];m.bindBuffer(m.ARRAY_BUFFER,l.__webglLineDistanceBuffer);m.bufferData(m.ARRAY_BUFFER,Tb,Xb)}if(nc)for(bc=0,uc=nc.length;bc<uc;bc++)if(pa=nc[bc],pa.needsUpdate&&(void 0===pa.boundTo||\"vertices\"===pa.boundTo)){sa=0;Fb=pa.value.length;if(1===pa.size)for(Ia=0;Ia<Fb;Ia++)pa.array[Ia]=pa.value[Ia];else if(2===pa.size)for(Ia=\n0;Ia<Fb;Ia++)Ma=pa.value[Ia],pa.array[sa]=Ma.x,pa.array[sa+1]=Ma.y,sa+=2;else if(3===pa.size)if(\"c\"===pa.type)for(Ia=0;Ia<Fb;Ia++)Ma=pa.value[Ia],pa.array[sa]=Ma.r,pa.array[sa+1]=Ma.g,pa.array[sa+2]=Ma.b,sa+=3;else for(Ia=0;Ia<Fb;Ia++)Ma=pa.value[Ia],pa.array[sa]=Ma.x,pa.array[sa+1]=Ma.y,pa.array[sa+2]=Ma.z,sa+=3;else if(4===pa.size)for(Ia=0;Ia<Fb;Ia++)Ma=pa.value[Ia],pa.array[sa]=Ma.x,pa.array[sa+1]=Ma.y,pa.array[sa+2]=Ma.z,pa.array[sa+3]=Ma.w,sa+=4;m.bindBuffer(m.ARRAY_BUFFER,pa.buffer);m.bufferData(m.ARRAY_BUFFER,\npa.array,Xb)}}l.verticesNeedUpdate=!1;l.colorsNeedUpdate=!1;l.lineDistancesNeedUpdate=!1;p.attributes&&C(p)}else if(b instanceof THREE.PointCloud){p=d(b,l);r=p.attributes&&x(p);if(l.verticesNeedUpdate||l.colorsNeedUpdate||b.sortParticles||r){var oc=m.DYNAMIC_DRAW,Na,kb,lb,Z,mb,vb,cc=l.vertices,pc=cc.length,qc=l.colors,vc=qc.length,Ab=l.__vertexArray,Bb=l.__colorArray,qb=l.__sortArray,wc=l.verticesNeedUpdate,xc=l.colorsNeedUpdate,rb=l.__webglCustomAttributesList,ab,Gb,fa,bb,na,Y;if(b.sortParticles){kc.copy(Ub);\nkc.multiply(b.matrixWorld);for(Na=0;Na<pc;Na++)lb=cc[Na],ea.copy(lb),ea.applyProjection(kc),qb[Na]=[ea.z,Na];qb.sort(t);for(Na=0;Na<pc;Na++)lb=cc[qb[Na][1]],Z=3*Na,Ab[Z]=lb.x,Ab[Z+1]=lb.y,Ab[Z+2]=lb.z;for(kb=0;kb<vc;kb++)Z=3*kb,vb=qc[qb[kb][1]],Bb[Z]=vb.r,Bb[Z+1]=vb.g,Bb[Z+2]=vb.b;if(rb)for(ab=0,Gb=rb.length;ab<Gb;ab++)if(Y=rb[ab],void 0===Y.boundTo||\"vertices\"===Y.boundTo)if(Z=0,bb=Y.value.length,1===Y.size)for(fa=0;fa<bb;fa++)mb=qb[fa][1],Y.array[fa]=Y.value[mb];else if(2===Y.size)for(fa=0;fa<bb;fa++)mb=\nqb[fa][1],na=Y.value[mb],Y.array[Z]=na.x,Y.array[Z+1]=na.y,Z+=2;else if(3===Y.size)if(\"c\"===Y.type)for(fa=0;fa<bb;fa++)mb=qb[fa][1],na=Y.value[mb],Y.array[Z]=na.r,Y.array[Z+1]=na.g,Y.array[Z+2]=na.b,Z+=3;else for(fa=0;fa<bb;fa++)mb=qb[fa][1],na=Y.value[mb],Y.array[Z]=na.x,Y.array[Z+1]=na.y,Y.array[Z+2]=na.z,Z+=3;else if(4===Y.size)for(fa=0;fa<bb;fa++)mb=qb[fa][1],na=Y.value[mb],Y.array[Z]=na.x,Y.array[Z+1]=na.y,Y.array[Z+2]=na.z,Y.array[Z+3]=na.w,Z+=4}else{if(wc)for(Na=0;Na<pc;Na++)lb=cc[Na],Z=3*\nNa,Ab[Z]=lb.x,Ab[Z+1]=lb.y,Ab[Z+2]=lb.z;if(xc)for(kb=0;kb<vc;kb++)vb=qc[kb],Z=3*kb,Bb[Z]=vb.r,Bb[Z+1]=vb.g,Bb[Z+2]=vb.b;if(rb)for(ab=0,Gb=rb.length;ab<Gb;ab++)if(Y=rb[ab],Y.needsUpdate&&(void 0===Y.boundTo||\"vertices\"===Y.boundTo))if(bb=Y.value.length,Z=0,1===Y.size)for(fa=0;fa<bb;fa++)Y.array[fa]=Y.value[fa];else if(2===Y.size)for(fa=0;fa<bb;fa++)na=Y.value[fa],Y.array[Z]=na.x,Y.array[Z+1]=na.y,Z+=2;else if(3===Y.size)if(\"c\"===Y.type)for(fa=0;fa<bb;fa++)na=Y.value[fa],Y.array[Z]=na.r,Y.array[Z+1]=\nna.g,Y.array[Z+2]=na.b,Z+=3;else for(fa=0;fa<bb;fa++)na=Y.value[fa],Y.array[Z]=na.x,Y.array[Z+1]=na.y,Y.array[Z+2]=na.z,Z+=3;else if(4===Y.size)for(fa=0;fa<bb;fa++)na=Y.value[fa],Y.array[Z]=na.x,Y.array[Z+1]=na.y,Y.array[Z+2]=na.z,Y.array[Z+3]=na.w,Z+=4}if(wc||b.sortParticles)m.bindBuffer(m.ARRAY_BUFFER,l.__webglVertexBuffer),m.bufferData(m.ARRAY_BUFFER,Ab,oc);if(xc||b.sortParticles)m.bindBuffer(m.ARRAY_BUFFER,l.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,Bb,oc);if(rb)for(ab=0,Gb=rb.length;ab<\nGb;ab++)if(Y=rb[ab],Y.needsUpdate||b.sortParticles)m.bindBuffer(m.ARRAY_BUFFER,Y.buffer),m.bufferData(m.ARRAY_BUFFER,Y.array,oc)}l.verticesNeedUpdate=!1;l.colorsNeedUpdate=!1;p.attributes&&C(p)}for(var Cb=0,rc=k.length;Cb<rc;Cb++){var dc=k[Cb],nb=dc,yc=nb.object,sc=nb.buffer,tc=yc.geometry,ob=yc.material;ob instanceof THREE.MeshFaceMaterial?(ob=ob.materials[tc instanceof THREE.BufferGeometry?0:sc.materialIndex],ob.transparent?(nb.material=ob,Pa.push(nb)):(nb.material=ob,Oa.push(nb))):ob&&(ob.transparent?\n(nb.material=ob,Pa.push(nb)):(nb.material=ob,Oa.push(nb)));dc.render=!0;!0===G.sortObjects&&(null!==b.renderDepth?dc.z=b.renderDepth:(ea.setFromMatrixPosition(b.matrixWorld),ea.applyProjection(Ub),dc.z=ea.z))}}Cb=0;for(rc=b.children.length;Cb<rc;Cb++)s(a,b.children[Cb],h)}}function p(a,b,c){if(0!==a.length)for(var d=0,e=a.length;d<e;d++)la=Ya=null,Ca=ca=ja=ua=Da=ra=Fa=-1,fb=!0,a[d].render(b,c,Hb,Ib),la=Ya=null,Ca=ca=ja=ua=Da=ra=Fa=-1,fb=!0}function v(a,b,c,d,e,f){for(var g,h,k,m=a.length-1;-1!==m;m--){g=\na[m];h=g.object;k=g.buffer;N(h,b);if(f)g=f;else{g=g.material;if(!g)continue;e&&G.setBlending(g.blending,g.blendEquation,g.blendSrc,g.blendDst);G.setDepthTest(g.depthTest);G.setDepthWrite(g.depthWrite);J(g.polygonOffset,g.polygonOffsetFactor,g.polygonOffsetUnits)}G.setMaterialFaces(g);k instanceof THREE.BufferGeometry?G.renderBufferDirect(b,c,d,g,k,h):G.renderBuffer(b,c,d,g,k,h)}}function w(a,b,c,d,e,f,g){for(var h,k,m=0,l=a.length;m<l;m++)if(h=a[m],k=h.object,k.visible){if(g)h=g;else{h=h[b];if(!h)continue;\nf&&G.setBlending(h.blending,h.blendEquation,h.blendSrc,h.blendDst);G.setDepthTest(h.depthTest);G.setDepthWrite(h.depthWrite);J(h.polygonOffset,h.polygonOffsetFactor,h.polygonOffsetUnits)}G.renderImmediateObject(c,d,e,h,k)}}function u(a){var b=a.object.material;b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}function D(a,b,d){var e,f=!1;e=b.material;if(void 0===d.geometryGroups||d.groupsNeedUpdate)delete a.__webglObjects[b.id],d.makeGroups(e instanceof THREE.MeshFaceMaterial,\nEb?4294967296:65535),d.groupsNeedUpdate=!1;for(var g=0,h=d.geometryGroupsList.length;g<h;g++){e=d.geometryGroupsList[g];if(e.__webglVertexBuffer)f=!1;else{f=e;f.__webglVertexBuffer=m.createBuffer();f.__webglNormalBuffer=m.createBuffer();f.__webglTangentBuffer=m.createBuffer();f.__webglColorBuffer=m.createBuffer();f.__webglUVBuffer=m.createBuffer();f.__webglUV2Buffer=m.createBuffer();f.__webglSkinIndicesBuffer=m.createBuffer();f.__webglSkinWeightsBuffer=m.createBuffer();f.__webglFaceBuffer=m.createBuffer();\nf.__webglLineBuffer=m.createBuffer();var k=void 0,l=void 0;if(f.numMorphTargets)for(f.__webglMorphTargetsBuffers=[],k=0,l=f.numMorphTargets;k<l;k++)f.__webglMorphTargetsBuffers.push(m.createBuffer());if(f.numMorphNormals)for(f.__webglMorphNormalsBuffers=[],k=0,l=f.numMorphNormals;k<l;k++)f.__webglMorphNormalsBuffers.push(m.createBuffer());G.info.memory.geometries++;c(e,b);d.verticesNeedUpdate=!0;d.morphTargetsNeedUpdate=!0;d.elementsNeedUpdate=!0;d.uvsNeedUpdate=!0;d.normalsNeedUpdate=!0;d.tangentsNeedUpdate=\n!0;f=d.colorsNeedUpdate=!0}(f||void 0===b.__webglActive)&&A(a.__webglObjects,e,b)}b.__webglActive=!0}function A(a,b,c){var d=c.id;a[d]=a[d]||[];a[d].push({id:d,buffer:b,object:c,material:null,z:0})}function x(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function C(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function I(a,b){if(a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line)delete b.__webglObjects[a.id];else if(a instanceof\nTHREE.ImmediateRenderObject||a.immediateRenderCallback)for(var c=b.__webglObjectsImmediate,d=c.length-1;0<=d;d--)c[d].object===a&&c.splice(d,1);delete a.__webglActive}function z(a,b,c,d,e){qa=0;d.needsUpdate&&(d.program&&Nb(d),G.initMaterial(d,b,c,e),d.needsUpdate=!1);d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(G.maxMorphTargets));var f=!1,g=!1,h=!1,k=d.program,l=k.uniforms,n=d.__webglShader.uniforms;k.id!==Ya&&(m.useProgram(k.program),Ya=k.id,\nh=g=f=!0);d.id!==Ca&&(-1===Ca&&(h=!0),Ca=d.id,g=!0);if(f||a!==la)m.uniformMatrix4fv(l.projectionMatrix,!1,a.projectionMatrix.elements),Ea&&m.uniform1f(l.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==la&&(la=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==l.cameraPosition&&(ea.setFromMatrixPosition(a.matrixWorld),m.uniform3f(l.cameraPosition,ea.x,ea.y,ea.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof\nTHREE.ShaderMaterial||d.skinning)&&null!==l.viewMatrix&&m.uniformMatrix4fv(l.viewMatrix,!1,a.matrixWorldInverse.elements);d.skinning&&(e.bindMatrix&&null!==l.bindMatrix&&m.uniformMatrix4fv(l.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&null!==l.bindMatrixInverse&&m.uniformMatrix4fv(l.bindMatrixInverse,!1,e.bindMatrixInverse.elements),Ob&&e.skeleton&&e.skeleton.useVertexTexture?(null!==l.boneTexture&&(f=K(),m.uniform1i(l.boneTexture,f),G.setTexture(e.skeleton.boneTexture,f)),null!==l.boneTextureWidth&&\nm.uniform1i(l.boneTextureWidth,e.skeleton.boneTextureWidth),null!==l.boneTextureHeight&&m.uniform1i(l.boneTextureHeight,e.skeleton.boneTextureHeight)):e.skeleton&&e.skeleton.boneMatrices&&null!==l.boneGlobalMatrices&&m.uniformMatrix4fv(l.boneGlobalMatrices,!1,e.skeleton.boneMatrices));if(g){c&&d.fog&&(n.fogColor.value=c.color,c instanceof THREE.Fog?(n.fogNear.value=c.near,n.fogFar.value=c.far):c instanceof THREE.FogExp2&&(n.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof\nTHREE.MeshLambertMaterial||d.lights){if(fb){var h=!0,p,r=f=0,q=0,s,t,w,u=Jb,v=u.directional.colors,x=u.directional.positions,D=u.point.colors,A=u.point.positions,z=u.point.distances,C=u.spot.colors,I=u.spot.positions,L=u.spot.distances,N=u.spot.directions,J=u.spot.anglesCos,T=u.spot.exponents,H=u.hemi.skyColors,Q=u.hemi.groundColors,O=u.hemi.positions,R=0,X=0,V=0,$=0,za=0,aa=0,ya=0,ca=0,W=p=0;c=w=W=0;for(g=b.length;c<g;c++)p=b[c],p.onlyShadow||(s=p.color,t=p.intensity,w=p.distance,p instanceof THREE.AmbientLight?\np.visible&&(G.gammaInput?(f+=s.r*s.r,r+=s.g*s.g,q+=s.b*s.b):(f+=s.r,r+=s.g,q+=s.b)):p instanceof THREE.DirectionalLight?(za+=1,p.visible&&(da.setFromMatrixPosition(p.matrixWorld),ea.setFromMatrixPosition(p.target.matrixWorld),da.sub(ea),da.normalize(),p=3*R,x[p]=da.x,x[p+1]=da.y,x[p+2]=da.z,G.gammaInput?ba(v,p,s,t*t):P(v,p,s,t),R+=1)):p instanceof THREE.PointLight?(aa+=1,p.visible&&(W=3*X,G.gammaInput?ba(D,W,s,t*t):P(D,W,s,t),ea.setFromMatrixPosition(p.matrixWorld),A[W]=ea.x,A[W+1]=ea.y,A[W+2]=ea.z,\nz[X]=w,X+=1)):p instanceof THREE.SpotLight?(ya+=1,p.visible&&(W=3*V,G.gammaInput?ba(C,W,s,t*t):P(C,W,s,t),ea.setFromMatrixPosition(p.matrixWorld),I[W]=ea.x,I[W+1]=ea.y,I[W+2]=ea.z,L[V]=w,da.copy(ea),ea.setFromMatrixPosition(p.target.matrixWorld),da.sub(ea),da.normalize(),N[W]=da.x,N[W+1]=da.y,N[W+2]=da.z,J[V]=Math.cos(p.angle),T[V]=p.exponent,V+=1)):p instanceof THREE.HemisphereLight&&(ca+=1,p.visible&&(da.setFromMatrixPosition(p.matrixWorld),da.normalize(),w=3*$,O[w]=da.x,O[w+1]=da.y,O[w+2]=da.z,\ns=p.color,p=p.groundColor,G.gammaInput?(t*=t,ba(H,w,s,t),ba(Q,w,p,t)):(P(H,w,s,t),P(Q,w,p,t)),$+=1)));c=3*R;for(g=Math.max(v.length,3*za);c<g;c++)v[c]=0;c=3*X;for(g=Math.max(D.length,3*aa);c<g;c++)D[c]=0;c=3*V;for(g=Math.max(C.length,3*ya);c<g;c++)C[c]=0;c=3*$;for(g=Math.max(H.length,3*ca);c<g;c++)H[c]=0;c=3*$;for(g=Math.max(Q.length,3*ca);c<g;c++)Q[c]=0;u.directional.length=R;u.point.length=X;u.spot.length=V;u.hemi.length=$;u.ambient[0]=f;u.ambient[1]=r;u.ambient[2]=q;fb=!1}h?(h=Jb,n.ambientLightColor.value=\nh.ambient,n.directionalLightColor.value=h.directional.colors,n.directionalLightDirection.value=h.directional.positions,n.pointLightColor.value=h.point.colors,n.pointLightPosition.value=h.point.positions,n.pointLightDistance.value=h.point.distances,n.spotLightColor.value=h.spot.colors,n.spotLightPosition.value=h.spot.positions,n.spotLightDistance.value=h.spot.distances,n.spotLightDirection.value=h.spot.directions,n.spotLightAngleCos.value=h.spot.anglesCos,n.spotLightExponent.value=h.spot.exponents,\nn.hemisphereLightSkyColor.value=h.hemi.skyColors,n.hemisphereLightGroundColor.value=h.hemi.groundColors,n.hemisphereLightDirection.value=h.hemi.positions,y(n,!0)):y(n,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){n.opacity.value=d.opacity;G.gammaInput?n.diffuse.value.copyGammaToLinear(d.color):n.diffuse.value=d.color;n.map.value=d.map;n.lightMap.value=d.lightMap;n.specularMap.value=d.specularMap;n.alphaMap.value=d.alphaMap;\nd.bumpMap&&(n.bumpMap.value=d.bumpMap,n.bumpScale.value=d.bumpScale);d.normalMap&&(n.normalMap.value=d.normalMap,n.normalScale.value.copy(d.normalScale));var U;d.map?U=d.map:d.specularMap?U=d.specularMap:d.normalMap?U=d.normalMap:d.bumpMap?U=d.bumpMap:d.alphaMap&&(U=d.alphaMap);void 0!==U&&(h=U.offset,U=U.repeat,n.offsetRepeat.value.set(h.x,h.y,U.x,U.y));n.envMap.value=d.envMap;n.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;n.reflectivity.value=d.reflectivity;n.refractionRatio.value=\nd.refractionRatio;n.combine.value=d.combine;n.useRefract.value=d.envMap&&d.envMap.mapping instanceof THREE.CubeRefractionMapping}d instanceof THREE.LineBasicMaterial?(n.diffuse.value=d.color,n.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(n.diffuse.value=d.color,n.opacity.value=d.opacity,n.dashSize.value=d.dashSize,n.totalSize.value=d.dashSize+d.gapSize,n.scale.value=d.scale):d instanceof THREE.PointCloudMaterial?(n.psColor.value=d.color,n.opacity.value=d.opacity,n.size.value=d.size,\nn.scale.value=S.height/2,n.map.value=d.map):d instanceof THREE.MeshPhongMaterial?(n.shininess.value=d.shininess,G.gammaInput?(n.ambient.value.copyGammaToLinear(d.ambient),n.emissive.value.copyGammaToLinear(d.emissive),n.specular.value.copyGammaToLinear(d.specular)):(n.ambient.value=d.ambient,n.emissive.value=d.emissive,n.specular.value=d.specular),d.wrapAround&&n.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(G.gammaInput?(n.ambient.value.copyGammaToLinear(d.ambient),n.emissive.value.copyGammaToLinear(d.emissive)):\n(n.ambient.value=d.ambient,n.emissive.value=d.emissive),d.wrapAround&&n.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?(n.mNear.value=a.near,n.mFar.value=a.far,n.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(n.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&n.shadowMatrix)for(U=a=0,h=b.length;U<h;U++)c=b[U],c.castShadow&&(c instanceof THREE.SpotLight||c instanceof THREE.DirectionalLight&&!c.shadowCascade)&&(n.shadowMap.value[a]=c.shadowMap,n.shadowMapSize.value[a]=\nc.shadowMapSize,n.shadowMatrix.value[a]=c.shadowMatrix,n.shadowDarkness.value[a]=c.shadowDarkness,n.shadowBias.value[a]=c.shadowBias,a++);b=d.uniformsList;d=0;for(n=b.length;d<n;d++)if(a=b[d][0],!1!==a.needsUpdate)switch(c=a.type,h=a.value,U=b[d][1],c){case \"1i\":m.uniform1i(U,h);break;case \"1f\":m.uniform1f(U,h);break;case \"2f\":m.uniform2f(U,h[0],h[1]);break;case \"3f\":m.uniform3f(U,h[0],h[1],h[2]);break;case \"4f\":m.uniform4f(U,h[0],h[1],h[2],h[3]);break;case \"1iv\":m.uniform1iv(U,h);break;case \"3iv\":m.uniform3iv(U,\nh);break;case \"1fv\":m.uniform1fv(U,h);break;case \"2fv\":m.uniform2fv(U,h);break;case \"3fv\":m.uniform3fv(U,h);break;case \"4fv\":m.uniform4fv(U,h);break;case \"Matrix3fv\":m.uniformMatrix3fv(U,!1,h);break;case \"Matrix4fv\":m.uniformMatrix4fv(U,!1,h);break;case \"i\":m.uniform1i(U,h);break;case \"f\":m.uniform1f(U,h);break;case \"v2\":m.uniform2f(U,h.x,h.y);break;case \"v3\":m.uniform3f(U,h.x,h.y,h.z);break;case \"v4\":m.uniform4f(U,h.x,h.y,h.z,h.w);break;case \"c\":m.uniform3f(U,h.r,h.g,h.b);break;case \"iv1\":m.uniform1iv(U,\nh);break;case \"iv\":m.uniform3iv(U,h);break;case \"fv1\":m.uniform1fv(U,h);break;case \"fv\":m.uniform3fv(U,h);break;case \"v2v\":void 0===a._array&&(a._array=new Float32Array(2*h.length));c=0;for(g=h.length;c<g;c++)f=2*c,a._array[f]=h[c].x,a._array[f+1]=h[c].y;m.uniform2fv(U,a._array);break;case \"v3v\":void 0===a._array&&(a._array=new Float32Array(3*h.length));c=0;for(g=h.length;c<g;c++)f=3*c,a._array[f]=h[c].x,a._array[f+1]=h[c].y,a._array[f+2]=h[c].z;m.uniform3fv(U,a._array);break;case \"v4v\":void 0===\na._array&&(a._array=new Float32Array(4*h.length));c=0;for(g=h.length;c<g;c++)f=4*c,a._array[f]=h[c].x,a._array[f+1]=h[c].y,a._array[f+2]=h[c].z,a._array[f+3]=h[c].w;m.uniform4fv(U,a._array);break;case \"m3\":m.uniformMatrix3fv(U,!1,h.elements);break;case \"m3v\":void 0===a._array&&(a._array=new Float32Array(9*h.length));c=0;for(g=h.length;c<g;c++)h[c].flattenToArrayOffset(a._array,9*c);m.uniformMatrix3fv(U,!1,a._array);break;case \"m4\":m.uniformMatrix4fv(U,!1,h.elements);break;case \"m4v\":void 0===a._array&&\n(a._array=new Float32Array(16*h.length));c=0;for(g=h.length;c<g;c++)h[c].flattenToArrayOffset(a._array,16*c);m.uniformMatrix4fv(U,!1,a._array);break;case \"t\":f=h;h=K();m.uniform1i(U,h);if(!f)continue;if(f instanceof THREE.CubeTexture||f.image instanceof Array&&6===f.image.length){if(a=f,U=h,6===a.image.length)if(a.needsUpdate){a.image.__webglTextureCube||(a.addEventListener(\"dispose\",Pb),a.image.__webglTextureCube=m.createTexture(),G.info.memory.textures++);m.activeTexture(m.TEXTURE0+U);m.bindTexture(m.TEXTURE_CUBE_MAP,\na.image.__webglTextureCube);m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,a.flipY);U=a instanceof THREE.CompressedTexture;h=[];for(c=0;6>c;c++)G.autoScaleCubemaps&&!U?(g=c,f=a.image[c],q=sc,f.width<=q&&f.height<=q||(u=Math.max(f.width,f.height),r=Math.floor(f.width*q/u),q=Math.floor(f.height*q/u),u=document.createElement(\"canvas\"),u.width=r,u.height=q,u.getContext(\"2d\").drawImage(f,0,0,f.width,f.height,0,0,r,q),f=u),h[g]=f):h[c]=a.image[c];c=h[0];g=THREE.Math.isPowerOfTwo(c.width)&&THREE.Math.isPowerOfTwo(c.height);\nf=B(a.format);r=B(a.type);E(m.TEXTURE_CUBE_MAP,a,g);for(c=0;6>c;c++)if(U)for(u=h[c].mipmaps,v=0,x=u.length;v<x;v++)q=u[v],a.format!==THREE.RGBAFormat?m.compressedTexImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+c,v,f,q.width,q.height,0,q.data):m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+c,v,f,q.width,q.height,0,f,r,q.data);else m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,f,f,r,h[c]);a.generateMipmaps&&g&&m.generateMipmap(m.TEXTURE_CUBE_MAP);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate()}else m.activeTexture(m.TEXTURE0+\nU),m.bindTexture(m.TEXTURE_CUBE_MAP,a.image.__webglTextureCube)}else f instanceof THREE.WebGLRenderTargetCube?(a=f,m.activeTexture(m.TEXTURE0+h),m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture)):G.setTexture(f,h);break;case \"tv\":void 0===a._array&&(a._array=[]);c=0;for(g=a.value.length;c<g;c++)a._array[c]=K();m.uniform1iv(U,a._array);c=0;for(g=a.value.length;c<g;c++)f=a.value[c],h=a._array[c],f&&G.setTexture(f,h);break;default:console.warn(\"THREE.WebGLRenderer: Unknown uniform type: \"+c)}}m.uniformMatrix4fv(l.modelViewMatrix,\n!1,e._modelViewMatrix.elements);l.normalMatrix&&m.uniformMatrix3fv(l.normalMatrix,!1,e._normalMatrix.elements);null!==l.modelMatrix&&m.uniformMatrix4fv(l.modelMatrix,!1,e.matrixWorld.elements);return k}function y(a,b){a.ambientLightColor.needsUpdate=b;a.directionalLightColor.needsUpdate=b;a.directionalLightDirection.needsUpdate=b;a.pointLightColor.needsUpdate=b;a.pointLightPosition.needsUpdate=b;a.pointLightDistance.needsUpdate=b;a.spotLightColor.needsUpdate=b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=\nb;a.spotLightDirection.needsUpdate=b;a.spotLightAngleCos.needsUpdate=b;a.spotLightExponent.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=b;a.hemisphereLightGroundColor.needsUpdate=b;a.hemisphereLightDirection.needsUpdate=b}function K(){var a=qa;a>=Qb&&console.warn(\"WebGLRenderer: trying to use \"+a+\" texture units while this GPU supports only \"+Qb);qa+=1;return a}function N(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getNormalMatrix(a._modelViewMatrix)}\nfunction ba(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function P(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function O(a){a!==xa&&(m.lineWidth(a),xa=a)}function J(a,b,c){Qa!==a&&(a?m.enable(m.POLYGON_OFFSET_FILL):m.disable(m.POLYGON_OFFSET_FILL),Qa=a);!a||cb===b&&Ga===c||(m.polygonOffset(b,c),cb=b,Ga=c)}function E(a,b,c){c?(m.texParameteri(a,m.TEXTURE_WRAP_S,B(b.wrapS)),m.texParameteri(a,m.TEXTURE_WRAP_T,B(b.wrapT)),m.texParameteri(a,m.TEXTURE_MAG_FILTER,B(b.magFilter)),m.texParameteri(a,\nm.TEXTURE_MIN_FILTER,B(b.minFilter))):(m.texParameteri(a,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_MAG_FILTER,R(b.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,R(b.minFilter)));Ta&&b.type!==THREE.FloatType&&(1<b.anisotropy||b.__oldAnisotropy)&&(m.texParameterf(a,Ta.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,Rb)),b.__oldAnisotropy=b.anisotropy)}function Q(a,b){m.bindRenderbuffer(m.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?\n(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_COMPONENT16,b.width,b.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_STENCIL,b.width,b.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a)):m.renderbufferStorage(m.RENDERBUFFER,m.RGBA4,b.width,b.height)}function L(a){a instanceof THREE.WebGLRenderTargetCube?(m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture),\nm.generateMipmap(m.TEXTURE_CUBE_MAP),m.bindTexture(m.TEXTURE_CUBE_MAP,null)):(m.bindTexture(m.TEXTURE_2D,a.__webglTexture),m.generateMipmap(m.TEXTURE_2D),m.bindTexture(m.TEXTURE_2D,null))}function R(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?m.NEAREST:m.LINEAR}function B(a){if(a===THREE.RepeatWrapping)return m.REPEAT;if(a===THREE.ClampToEdgeWrapping)return m.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return m.MIRRORED_REPEAT;\nif(a===THREE.NearestFilter)return m.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return m.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return m.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return m.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return m.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return m.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return m.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return m.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return m.UNSIGNED_SHORT_5_5_5_1;\nif(a===THREE.UnsignedShort565Type)return m.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return m.BYTE;if(a===THREE.ShortType)return m.SHORT;if(a===THREE.UnsignedShortType)return m.UNSIGNED_SHORT;if(a===THREE.IntType)return m.INT;if(a===THREE.UnsignedIntType)return m.UNSIGNED_INT;if(a===THREE.FloatType)return m.FLOAT;if(a===THREE.AlphaFormat)return m.ALPHA;if(a===THREE.RGBFormat)return m.RGB;if(a===THREE.RGBAFormat)return m.RGBA;if(a===THREE.LuminanceFormat)return m.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return m.LUMINANCE_ALPHA;\nif(a===THREE.AddEquation)return m.FUNC_ADD;if(a===THREE.SubtractEquation)return m.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return m.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return m.ZERO;if(a===THREE.OneFactor)return m.ONE;if(a===THREE.SrcColorFactor)return m.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return m.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return m.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return m.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return m.DST_ALPHA;\nif(a===THREE.OneMinusDstAlphaFactor)return m.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return m.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return m.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return m.SRC_ALPHA_SATURATE;if(void 0!==Sa){if(a===THREE.RGB_S3TC_DXT1_Format)return Sa.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return Sa.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return Sa.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return Sa.COMPRESSED_RGBA_S3TC_DXT5_EXT}return 0}\nconsole.log(\"THREE.WebGLRenderer\",THREE.REVISION);a=a||{};var S=void 0!==a.canvas?a.canvas:document.createElement(\"canvas\"),V=void 0!==a.context?a.context:null,W=void 0!==a.precision?a.precision:\"highp\",H=void 0!==a.alpha?a.alpha:!1,oa=void 0!==a.depth?a.depth:!0,$=void 0!==a.stencil?a.stencil:!0,X=void 0!==a.antialias?a.antialias:!1,T=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,ya=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,Ea=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:\n!1,Aa=new THREE.Color(0),za=0,Oa=[],Pa=[];this.domElement=S;this.context=null;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1;this.shadowMapAutoUpdate=!0;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=\n!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.renderPluginsPre=[];this.renderPluginsPost=[];this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var G=this,Ba=[],Ya=null,Za=null,Ca=-1,ca=null,la=null,qa=0,ua=-1,ja=-1,Fa=-1,va=-1,Ka=-1,aa=-1,ra=-1,Da=-1,Qa=null,cb=null,Ga=null,xa=null,ma=0,Ja=0,wb=S.width,sb=S.height,Hb=0,Ib=0,pb=new Uint8Array(16),tb=new Uint8Array(16),jc=new THREE.Frustum,Ub=new THREE.Matrix4,kc=new THREE.Matrix4,\nea=new THREE.Vector3,da=new THREE.Vector3,fb=!0,Jb={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},m,Db,xb,Ta,Sa,Eb;(function(){try{var a={alpha:H,depth:oa,stencil:$,antialias:X,premultipliedAlpha:T,preserveDrawingBuffer:ya};m=V||S.getContext(\"webgl\",a)||S.getContext(\"experimental-webgl\",\na);if(null===m)throw\"Error creating WebGL context.\";}catch(b){console.error(b)}Db=m.getExtension(\"OES_texture_float\");m.getExtension(\"OES_texture_float_linear\");xb=m.getExtension(\"OES_standard_derivatives\");Ta=m.getExtension(\"EXT_texture_filter_anisotropic\")||m.getExtension(\"MOZ_EXT_texture_filter_anisotropic\")||m.getExtension(\"WEBKIT_EXT_texture_filter_anisotropic\");Sa=m.getExtension(\"WEBGL_compressed_texture_s3tc\")||m.getExtension(\"MOZ_WEBGL_compressed_texture_s3tc\")||m.getExtension(\"WEBKIT_WEBGL_compressed_texture_s3tc\");\nEb=m.getExtension(\"OES_element_index_uint\");null===Db&&console.log(\"THREE.WebGLRenderer: Float textures not supported.\");null===xb&&console.log(\"THREE.WebGLRenderer: Standard derivatives not supported.\");null===Ta&&console.log(\"THREE.WebGLRenderer: Anisotropic texture filtering not supported.\");null===Sa&&console.log(\"THREE.WebGLRenderer: S3TC compressed textures not supported.\");null===Eb&&console.log(\"THREE.WebGLRenderer: elementindex as unsigned integer not supported.\");void 0===m.getShaderPrecisionFormat&&\n(m.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});Ea&&m.getExtension(\"EXT_frag_depth\")})();m.clearColor(0,0,0,1);m.clearDepth(1);m.clearStencil(0);m.enable(m.DEPTH_TEST);m.depthFunc(m.LEQUAL);m.frontFace(m.CCW);m.cullFace(m.BACK);m.enable(m.CULL_FACE);m.enable(m.BLEND);m.blendEquation(m.FUNC_ADD);m.blendFunc(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA);m.viewport(ma,Ja,wb,sb);m.clearColor(Aa.r,Aa.g,Aa.b,za);this.context=m;var Qb=m.getParameter(m.MAX_TEXTURE_IMAGE_UNITS),tc=\nm.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS);m.getParameter(m.MAX_TEXTURE_SIZE);var sc=m.getParameter(m.MAX_CUBE_MAP_TEXTURE_SIZE),Rb=Ta?m.getParameter(Ta.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,Sb=0<tc,Ob=Sb&&Db;Sa&&m.getParameter(m.COMPRESSED_TEXTURE_FORMATS);var zc=m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.HIGH_FLOAT),Ac=m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.MEDIUM_FLOAT);m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.LOW_FLOAT);var Bc=m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.HIGH_FLOAT),\nCc=m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.MEDIUM_FLOAT);m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.LOW_FLOAT);var Dc=0<zc.precision&&0<Bc.precision,ec=0<Ac.precision&&0<Cc.precision;\"highp\"!==W||Dc||(ec?(W=\"mediump\",console.warn(\"THREE.WebGLRenderer: highp not supported, using mediump.\")):(W=\"lowp\",console.warn(\"THREE.WebGLRenderer: highp and mediump not supported, using lowp.\")));\"mediump\"!==W||ec||(W=\"lowp\",console.warn(\"THREE.WebGLRenderer: mediump not supported, using lowp.\"));this.getContext=\nfunction(){return m};this.supportsVertexTextures=function(){return Sb};this.supportsFloatTextures=function(){return Db};this.supportsStandardDerivatives=function(){return xb};this.supportsCompressedTextureS3TC=function(){return Sa};this.getMaxAnisotropy=function(){return Rb};this.getPrecision=function(){return W};this.setSize=function(a,b,c){S.width=a*this.devicePixelRatio;S.height=b*this.devicePixelRatio;!1!==c&&(S.style.width=a+\"px\",S.style.height=b+\"px\");this.setViewport(0,0,a,b)};this.setViewport=\nfunction(a,b,c,d){ma=a*this.devicePixelRatio;Ja=b*this.devicePixelRatio;wb=c*this.devicePixelRatio;sb=d*this.devicePixelRatio;m.viewport(ma,Ja,wb,sb)};this.setScissor=function(a,b,c,d){m.scissor(a*this.devicePixelRatio,b*this.devicePixelRatio,c*this.devicePixelRatio,d*this.devicePixelRatio)};this.enableScissorTest=function(a){a?m.enable(m.SCISSOR_TEST):m.disable(m.SCISSOR_TEST)};this.setClearColor=function(a,b){Aa.set(a);za=void 0!==b?b:1;m.clearColor(Aa.r,Aa.g,Aa.b,za)};this.setClearColorHex=function(a,\nb){console.warn(\"THREE.WebGLRenderer: .setClearColorHex() is being removed. Use .setClearColor() instead.\");this.setClearColor(a,b)};this.getClearColor=function(){return Aa};this.getClearAlpha=function(){return za};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=m.COLOR_BUFFER_BIT;if(void 0===b||b)d|=m.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=m.STENCIL_BUFFER_BIT;m.clear(d)};this.clearColor=function(){m.clear(m.COLOR_BUFFER_BIT)};this.clearDepth=function(){m.clear(m.DEPTH_BUFFER_BIT)};this.clearStencil=\nfunction(){m.clear(m.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.addPostPlugin=function(a){a.init(this);this.renderPluginsPost.push(a)};this.addPrePlugin=function(a){a.init(this);this.renderPluginsPre.push(a)};this.updateShadowMap=function(a,b){Ya=null;Ca=ca=Da=ra=Fa=-1;fb=!0;ja=ua=-1;fc(a);this.shadowMapPlugin.update(a,b)};var gc=function(a){a=a.target;a.removeEventListener(\"dispose\",gc);a.__webglInit=void 0;if(a instanceof THREE.BufferGeometry){a=\na.attributes;for(var b in a)void 0!==a[b].buffer&&m.deleteBuffer(a[b].buffer);G.info.memory.geometries--}else if(void 0!==a.geometryGroups){b=0;for(var c=a.geometryGroupsList.length;b<c;b++){var d=a.geometryGroupsList[b];if(void 0!==d.numMorphTargets)for(var e=0,f=d.numMorphTargets;e<f;e++)m.deleteBuffer(d.__webglMorphTargetsBuffers[e]);if(void 0!==d.numMorphNormals)for(e=0,f=d.numMorphNormals;e<f;e++)m.deleteBuffer(d.__webglMorphNormalsBuffers[e]);Tb(d)}}else Tb(a)},Pb=function(a){a=a.target;a.removeEventListener(\"dispose\",\nPb);a.image&&a.image.__webglTextureCube?m.deleteTexture(a.image.__webglTextureCube):a.__webglInit&&(a.__webglInit=!1,m.deleteTexture(a.__webglTexture));G.info.memory.textures--},hc=function(a){a=a.target;a.removeEventListener(\"dispose\",hc);if(a&&a.__webglTexture)if(m.deleteTexture(a.__webglTexture),a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)m.deleteFramebuffer(a.__webglFramebuffer[b]),m.deleteRenderbuffer(a.__webglRenderbuffer[b]);else m.deleteFramebuffer(a.__webglFramebuffer),m.deleteRenderbuffer(a.__webglRenderbuffer);\nG.info.memory.textures--},ic=function(a){a=a.target;a.removeEventListener(\"dispose\",ic);Nb(a)},Tb=function(a){void 0!==a.__webglVertexBuffer&&m.deleteBuffer(a.__webglVertexBuffer);void 0!==a.__webglNormalBuffer&&m.deleteBuffer(a.__webglNormalBuffer);void 0!==a.__webglTangentBuffer&&m.deleteBuffer(a.__webglTangentBuffer);void 0!==a.__webglColorBuffer&&m.deleteBuffer(a.__webglColorBuffer);void 0!==a.__webglUVBuffer&&m.deleteBuffer(a.__webglUVBuffer);void 0!==a.__webglUV2Buffer&&m.deleteBuffer(a.__webglUV2Buffer);\nvoid 0!==a.__webglSkinIndicesBuffer&&m.deleteBuffer(a.__webglSkinIndicesBuffer);void 0!==a.__webglSkinWeightsBuffer&&m.deleteBuffer(a.__webglSkinWeightsBuffer);void 0!==a.__webglFaceBuffer&&m.deleteBuffer(a.__webglFaceBuffer);void 0!==a.__webglLineBuffer&&m.deleteBuffer(a.__webglLineBuffer);void 0!==a.__webglLineDistanceBuffer&&m.deleteBuffer(a.__webglLineDistanceBuffer);if(void 0!==a.__webglCustomAttributesList)for(var b in a.__webglCustomAttributesList)m.deleteBuffer(a.__webglCustomAttributesList[b].buffer);\nG.info.memory.geometries--},Nb=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=Ba.length;a<c;a++)if(d=Ba[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=Ba.length;a<c;a++)d=Ba[a],d.program!==b&&e.push(d);Ba=e;m.deleteProgram(b);G.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){k();a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=m.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&\n(a.__webglNormalBuffer=m.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=m.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=m.createBuffer());a.hasPositions&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglVertexBuffer),m.bufferData(m.ARRAY_BUFFER,a.positionArray,m.DYNAMIC_DRAW),l(b.attributes.position),m.vertexAttribPointer(b.attributes.position,3,m.FLOAT,!1,0,0));if(a.hasNormals){m.bindBuffer(m.ARRAY_BUFFER,a.__webglNormalBuffer);if(c.shading===THREE.FlatShading){var d,\ne,f,g,h,p,r,q,s,t,u,w=3*a.count;for(u=0;u<w;u+=9)t=a.normalArray,d=t[u],e=t[u+1],f=t[u+2],g=t[u+3],p=t[u+4],q=t[u+5],h=t[u+6],r=t[u+7],s=t[u+8],d=(d+g+h)/3,e=(e+p+r)/3,f=(f+q+s)/3,t[u]=d,t[u+1]=e,t[u+2]=f,t[u+3]=d,t[u+4]=e,t[u+5]=f,t[u+6]=d,t[u+7]=e,t[u+8]=f}m.bufferData(m.ARRAY_BUFFER,a.normalArray,m.DYNAMIC_DRAW);l(b.attributes.normal);m.vertexAttribPointer(b.attributes.normal,3,m.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglUvBuffer),m.bufferData(m.ARRAY_BUFFER,a.uvArray,\nm.DYNAMIC_DRAW),l(b.attributes.uv),m.vertexAttribPointer(b.attributes.uv,2,m.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,a.colorArray,m.DYNAMIC_DRAW),l(b.attributes.color),m.vertexAttribPointer(b.attributes.color,3,m.FLOAT,!1,0,0));n();m.drawArrays(m.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){if(!1!==d.visible){var g=z(a,b,c,d,f);a=g.attributes;b=e.attributes;c=!1;g=16777215*\ne.id+2*g.id+(d.wireframe?1:0);g!==ca&&(ca=g,c=!0);c&&k();if(f instanceof THREE.Mesh)if(g=b.index){var l,n;g.array instanceof Uint32Array?(l=m.UNSIGNED_INT,n=4):(l=m.UNSIGNED_SHORT,n=2);e=e.offsets;if(0===e.length)c&&(h(d,a,b,0),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,g.buffer)),m.drawElements(m.TRIANGLES,g.array.length,l,0),G.info.render.calls++,G.info.render.vertices+=g.array.length,G.info.render.faces+=g.array.length/3;else{c=!0;for(var p=0,r=e.length;p<r;p++){var q=e[p].index;c&&(h(d,a,b,q),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,\ng.buffer));m.drawElements(m.TRIANGLES,e[p].count,l,e[p].start*n);G.info.render.calls++;G.info.render.vertices+=e[p].count;G.info.render.faces+=e[p].count/3}}}else c&&h(d,a,b,0),d=e.attributes.position,m.drawArrays(m.TRIANGLES,0,d.array.length/3),G.info.render.calls++,G.info.render.vertices+=d.array.length/3,G.info.render.faces+=d.array.length/9;else if(f instanceof THREE.PointCloud)c&&h(d,a,b,0),d=b.position,m.drawArrays(m.POINTS,0,d.array.length/3),G.info.render.calls++,G.info.render.points+=d.array.length/\n3;else if(f instanceof THREE.Line)if(f=f.type===THREE.LineStrip?m.LINE_STRIP:m.LINES,O(d.linewidth),g=b.index)if(g.array instanceof Uint32Array?(l=m.UNSIGNED_INT,n=4):(l=m.UNSIGNED_SHORT,n=2),e=e.offsets,0===e.length)c&&(h(d,a,b,0),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,g.buffer)),m.drawElements(f,g.array.length,l,0),G.info.render.calls++,G.info.render.vertices+=g.array.length;else for(1<e.length&&(c=!0),p=0,r=e.length;p<r;p++)q=e[p].index,c&&(h(d,a,b,q),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,g.buffer)),\nm.drawElements(f,e[p].count,l,e[p].start*n),G.info.render.calls++,G.info.render.vertices+=e[p].count;else c&&h(d,a,b,0),d=b.position,m.drawArrays(f,0,d.array.length/3),G.info.render.calls++,G.info.render.points+=d.array.length/3}};this.renderBuffer=function(a,b,c,d,e,f){if(!1!==d.visible){var g,h;c=z(a,b,c,d,f);b=c.attributes;a=!1;c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==ca&&(ca=c,a=!0);a&&k();if(!d.morphTargets&&0<=b.position)a&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglVertexBuffer),l(b.position),\nm.vertexAttribPointer(b.position,3,m.FLOAT,!1,0,0));else if(f.morphTargetBase){c=d.program.attributes;-1!==f.morphTargetBase&&0<=c.position?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[f.morphTargetBase]),l(c.position),m.vertexAttribPointer(c.position,3,m.FLOAT,!1,0,0)):0<=c.position&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglVertexBuffer),l(c.position),m.vertexAttribPointer(c.position,3,m.FLOAT,!1,0,0));if(f.morphTargetForcedOrder.length){var p=0;h=f.morphTargetForcedOrder;for(g=f.morphTargetInfluences;p<\nd.numSupportedMorphTargets&&p<h.length;)0<=c[\"morphTarget\"+p]&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[h[p]]),l(c[\"morphTarget\"+p]),m.vertexAttribPointer(c[\"morphTarget\"+p],3,m.FLOAT,!1,0,0)),0<=c[\"morphNormal\"+p]&&d.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[h[p]]),l(c[\"morphNormal\"+p]),m.vertexAttribPointer(c[\"morphNormal\"+p],3,m.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[p]=g[h[p]],p++}else{h=[];g=f.morphTargetInfluences;var r,q=g.length;for(r=\n0;r<q;r++)p=g[r],0<p&&h.push([p,r]);h.length>d.numSupportedMorphTargets?(h.sort(t),h.length=d.numSupportedMorphTargets):h.length>d.numSupportedMorphNormals?h.sort(t):0===h.length&&h.push([0,0]);for(p=0;p<d.numSupportedMorphTargets;)h[p]?(r=h[p][1],0<=c[\"morphTarget\"+p]&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[r]),l(c[\"morphTarget\"+p]),m.vertexAttribPointer(c[\"morphTarget\"+p],3,m.FLOAT,!1,0,0)),0<=c[\"morphNormal\"+p]&&d.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[r]),\nl(c[\"morphNormal\"+p]),m.vertexAttribPointer(c[\"morphNormal\"+p],3,m.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[p]=g[r]):f.__webglMorphTargetInfluences[p]=0,p++}null!==d.program.uniforms.morphTargetInfluences&&m.uniform1fv(d.program.uniforms.morphTargetInfluences,f.__webglMorphTargetInfluences)}if(a){if(e.__webglCustomAttributesList)for(g=0,h=e.__webglCustomAttributesList.length;g<h;g++)c=e.__webglCustomAttributesList[g],0<=b[c.buffer.belongsToAttribute]&&(m.bindBuffer(m.ARRAY_BUFFER,c.buffer),l(b[c.buffer.belongsToAttribute]),\nm.vertexAttribPointer(b[c.buffer.belongsToAttribute],c.size,m.FLOAT,!1,0,0));0<=b.color&&(0<f.geometry.colors.length||0<f.geometry.faces.length?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglColorBuffer),l(b.color),m.vertexAttribPointer(b.color,3,m.FLOAT,!1,0,0)):d.defaultAttributeValues&&m.vertexAttrib3fv(b.color,d.defaultAttributeValues.color));0<=b.normal&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglNormalBuffer),l(b.normal),m.vertexAttribPointer(b.normal,3,m.FLOAT,!1,0,0));0<=b.tangent&&(m.bindBuffer(m.ARRAY_BUFFER,\ne.__webglTangentBuffer),l(b.tangent),m.vertexAttribPointer(b.tangent,4,m.FLOAT,!1,0,0));0<=b.uv&&(f.geometry.faceVertexUvs[0]?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglUVBuffer),l(b.uv),m.vertexAttribPointer(b.uv,2,m.FLOAT,!1,0,0)):d.defaultAttributeValues&&m.vertexAttrib2fv(b.uv,d.defaultAttributeValues.uv));0<=b.uv2&&(f.geometry.faceVertexUvs[1]?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglUV2Buffer),l(b.uv2),m.vertexAttribPointer(b.uv2,2,m.FLOAT,!1,0,0)):d.defaultAttributeValues&&m.vertexAttrib2fv(b.uv2,\nd.defaultAttributeValues.uv2));d.skinning&&0<=b.skinIndex&&0<=b.skinWeight&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),l(b.skinIndex),m.vertexAttribPointer(b.skinIndex,4,m.FLOAT,!1,0,0),m.bindBuffer(m.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),l(b.skinWeight),m.vertexAttribPointer(b.skinWeight,4,m.FLOAT,!1,0,0));0<=b.lineDistance&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglLineDistanceBuffer),l(b.lineDistance),m.vertexAttribPointer(b.lineDistance,1,m.FLOAT,!1,0,0))}n();f instanceof THREE.Mesh?\n(f=e.__typeArray===Uint32Array?m.UNSIGNED_INT:m.UNSIGNED_SHORT,d.wireframe?(O(d.wireframeLinewidth),a&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),m.drawElements(m.LINES,e.__webglLineCount,f,0)):(a&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),m.drawElements(m.TRIANGLES,e.__webglFaceCount,f,0)),G.info.render.calls++,G.info.render.vertices+=e.__webglFaceCount,G.info.render.faces+=e.__webglFaceCount/3):f instanceof THREE.Line?(f=f.type===THREE.LineStrip?m.LINE_STRIP:m.LINES,\nO(d.linewidth),m.drawArrays(f,0,e.__webglLineCount),G.info.render.calls++):f instanceof THREE.PointCloud&&(m.drawArrays(m.POINTS,0,e.__webglParticleCount),G.info.render.calls++,G.info.render.points+=e.__webglParticleCount)}};this.render=function(a,b,c,d){function e(a){a instanceof THREE.SkinnedMesh&&a.skeleton.update();for(var b=0,c=a.children.length;b<c;b++)e(a.children[b])}if(!1===b instanceof THREE.Camera)console.error(\"THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.\");else{var f,\ng,h,k,m=a.__lights,l=a.fog;Ca=-1;la=null;fb=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();e(a);b.matrixWorldInverse.getInverse(b.matrixWorld);Ub.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);jc.setFromMatrix(Ub);fc(a);Oa.length=0;Pa.length=0;s(a,a,b);!0===G.sortObjects&&(Oa.sort(q),Pa.sort(r));p(this.renderPluginsPre,a,b);G.info.render.calls=0;G.info.render.vertices=0;G.info.render.faces=0;G.info.render.points=0;this.setRenderTarget(c);(this.autoClear||\nd)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);k=a.__webglObjectsImmediate;d=0;for(f=k.length;d<f;d++)g=k[d],h=g.object,h.visible&&(N(h,b),u(g));a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,d.blendSrc,d.blendDst),this.setDepthTest(d.depthTest),this.setDepthWrite(d.depthWrite),J(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),v(Oa,b,m,l,!0,d),v(Pa,b,m,l,!0,d),w(a.__webglObjectsImmediate,\"\",b,m,l,!1,d)):(d=null,this.setBlending(THREE.NoBlending),\nv(Oa,b,m,l,!1,d),w(a.__webglObjectsImmediate,\"opaque\",b,m,l,!1,d),v(Pa,b,m,l,!0,d),w(a.__webglObjectsImmediate,\"transparent\",b,m,l,!0,d));p(this.renderPluginsPost,a,b);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&L(c);this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=z(a,b,c,d,e);ca=-1;G.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,m,jc):e.render(function(a){G.renderBufferImmediate(a,\nf,d)})};var fc=function(a){a.__webglObjects||(a.__webglObjects={},a.__webglObjectsImmediate=[]);for(;a.__objectsAdded.length;){var c=a.__objectsAdded[0],d=a,e=void 0,f=void 0;void 0===c.__webglInit&&(c.__webglInit=!0,c._modelViewMatrix=new THREE.Matrix4,c._normalMatrix=new THREE.Matrix3);e=c.geometry;if(void 0!==e&&void 0===e.__webglInit)if(e.__webglInit=!0,e.addEventListener(\"dispose\",gc),e instanceof THREE.BufferGeometry)g(e);else if(c instanceof THREE.Mesh)void 0!==c.__webglActive&&I(c,d),D(d,\nc,e);else if(c instanceof THREE.Line){if(!e.__webglVertexBuffer){f=e;f.__webglVertexBuffer=m.createBuffer();f.__webglColorBuffer=m.createBuffer();f.__webglLineDistanceBuffer=m.createBuffer();G.info.memory.geometries++;var f=e,h=c,k=f.vertices.length;f.__vertexArray=new Float32Array(3*k);f.__colorArray=new Float32Array(3*k);f.__lineDistanceArray=new Float32Array(1*k);f.__webglLineCount=k;b(f,h);e.verticesNeedUpdate=!0;e.colorsNeedUpdate=!0;e.lineDistancesNeedUpdate=!0}}else c instanceof THREE.PointCloud&&\n!e.__webglVertexBuffer&&(f=e,f.__webglVertexBuffer=m.createBuffer(),f.__webglColorBuffer=m.createBuffer(),G.info.memory.geometries++,f=e,h=c,k=f.vertices.length,f.__vertexArray=new Float32Array(3*k),f.__colorArray=new Float32Array(3*k),f.__sortArray=[],f.__webglParticleCount=k,b(f,h),e.verticesNeedUpdate=!0,e.colorsNeedUpdate=!0);if(void 0===c.__webglActive){if(c instanceof THREE.Mesh)if(e=c.geometry,e instanceof THREE.BufferGeometry)A(d.__webglObjects,e,c);else{if(e instanceof THREE.Geometry)for(h=\n0,k=e.geometryGroupsList.length;h<k;h++)f=e.geometryGroupsList[h],A(d.__webglObjects,f,c)}else c instanceof THREE.Line||c instanceof THREE.PointCloud?(e=c.geometry,A(d.__webglObjects,e,c)):(c instanceof THREE.ImmediateRenderObject||c.immediateRenderCallback)&&d.__webglObjectsImmediate.push({id:null,object:c,opaque:null,transparent:null,z:0});c.__webglActive=!0}a.__objectsAdded.splice(0,1)}for(;a.__objectsRemoved.length;)I(a.__objectsRemoved[0],a),a.__objectsRemoved.splice(0,1)};this.initMaterial=\nfunction(a,b,c,d){var e,f,g,h;a.addEventListener(\"dispose\",ic);var k,l,n,p;a instanceof THREE.MeshDepthMaterial?p=\"depth\":a instanceof THREE.MeshNormalMaterial?p=\"normal\":a instanceof THREE.MeshBasicMaterial?p=\"basic\":a instanceof THREE.MeshLambertMaterial?p=\"lambert\":a instanceof THREE.MeshPhongMaterial?p=\"phong\":a instanceof THREE.LineBasicMaterial?p=\"basic\":a instanceof THREE.LineDashedMaterial?p=\"dashed\":a instanceof THREE.PointCloudMaterial&&(p=\"particle_basic\");p?(e=THREE.ShaderLib[p],a.__webglShader=\n{uniforms:THREE.UniformsUtils.clone(e.uniforms),vertexShader:e.vertexShader,fragmentShader:e.fragmentShader}):a.__webglShader={uniforms:a.uniforms,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader};n=h=g=f=e=0;for(var r=b.length;n<r;n++){var q=b[n];q.onlyShadow||!1===q.visible||(q instanceof THREE.DirectionalLight&&e++,q instanceof THREE.PointLight&&f++,q instanceof THREE.SpotLight&&g++,q instanceof THREE.HemisphereLight&&h++)}r=n=0;for(q=b.length;r<q;r++){var s=b[r];s.castShadow&&(s instanceof\nTHREE.SpotLight&&n++,s instanceof THREE.DirectionalLight&&!s.shadowCascade&&n++)}b=n;Ob&&d&&d.skeleton&&d.skeleton.useVertexTexture?n=1024:(n=m.getParameter(m.MAX_VERTEX_UNIFORM_VECTORS),n=Math.floor((n-20)/4),void 0!==d&&d instanceof THREE.SkinnedMesh&&(n=Math.min(d.skeleton.bones.length,n),n<d.skeleton.bones.length&&console.warn(\"WebGLRenderer: too many bones - \"+d.skeleton.bones.length+\", this GPU supports just \"+n+\" (try OpenGL instead of ANGLE)\")));c={precision:W,supportsVertexTextures:Sb,map:!!a.map,\nenvMap:!!a.envMap,lightMap:!!a.lightMap,bumpMap:!!a.bumpMap,normalMap:!!a.normalMap,specularMap:!!a.specularMap,alphaMap:!!a.alphaMap,vertexColors:a.vertexColors,fog:c,useFog:a.fog,fogExp:c instanceof THREE.FogExp2,sizeAttenuation:a.sizeAttenuation,logarithmicDepthBuffer:Ea,skinning:a.skinning,maxBones:n,useVertexTexture:Ob&&d&&d.skeleton&&d.skeleton.useVertexTexture,morphTargets:a.morphTargets,morphNormals:a.morphNormals,maxMorphTargets:this.maxMorphTargets,maxMorphNormals:this.maxMorphNormals,maxDirLights:e,\nmaxPointLights:f,maxSpotLights:g,maxHemiLights:h,maxShadows:b,shadowMapEnabled:this.shadowMapEnabled&&d.receiveShadow&&0<b,shadowMapType:this.shadowMapType,shadowMapDebug:this.shadowMapDebug,shadowMapCascade:this.shadowMapCascade,alphaTest:a.alphaTest,metal:a.metal,wrapAround:a.wrapAround,doubleSided:a.side===THREE.DoubleSide,flipSided:a.side===THREE.BackSide};d=[];p?d.push(p):(d.push(a.fragmentShader),d.push(a.vertexShader));for(var t in a.defines)d.push(t),d.push(a.defines[t]);for(l in c)d.push(l),\nd.push(c[l]);p=d.join();var u;l=0;for(t=Ba.length;l<t;l++)if(d=Ba[l],d.code===p){u=d;u.usedTimes++;break}void 0===u&&(u=new THREE.WebGLProgram(this,p,a,c),Ba.push(u),G.info.memory.programs=Ba.length);a.program=u;u=a.program.attributes;if(a.morphTargets)for(a.numSupportedMorphTargets=0,t=\"morphTarget\",l=0;l<this.maxMorphTargets;l++)p=t+l,0<=u[p]&&a.numSupportedMorphTargets++;if(a.morphNormals)for(a.numSupportedMorphNormals=0,t=\"morphNormal\",l=0;l<this.maxMorphNormals;l++)p=t+l,0<=u[p]&&a.numSupportedMorphNormals++;\na.uniformsList=[];for(k in a.__webglShader.uniforms)(l=a.program.uniforms[k])&&a.uniformsList.push([a.__webglShader.uniforms[k],l])};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?m.disable(m.CULL_FACE):(b===THREE.FrontFaceDirectionCW?m.frontFace(m.CW):m.frontFace(m.CCW),a===THREE.CullFaceBack?m.cullFace(m.BACK):a===THREE.CullFaceFront?m.cullFace(m.FRONT):m.cullFace(m.FRONT_AND_BACK),m.enable(m.CULL_FACE))};this.setMaterialFaces=function(a){var b=a.side===THREE.DoubleSide;a=a.side===THREE.BackSide;\nua!==b&&(b?m.disable(m.CULL_FACE):m.enable(m.CULL_FACE),ua=b);ja!==a&&(a?m.frontFace(m.CW):m.frontFace(m.CCW),ja=a)};this.setDepthTest=function(a){ra!==a&&(a?m.enable(m.DEPTH_TEST):m.disable(m.DEPTH_TEST),ra=a)};this.setDepthWrite=function(a){Da!==a&&(m.depthMask(a),Da=a)};this.setBlending=function(a,b,c,d){a!==Fa&&(a===THREE.NoBlending?m.disable(m.BLEND):a===THREE.AdditiveBlending?(m.enable(m.BLEND),m.blendEquation(m.FUNC_ADD),m.blendFunc(m.SRC_ALPHA,m.ONE)):a===THREE.SubtractiveBlending?(m.enable(m.BLEND),\nm.blendEquation(m.FUNC_ADD),m.blendFunc(m.ZERO,m.ONE_MINUS_SRC_COLOR)):a===THREE.MultiplyBlending?(m.enable(m.BLEND),m.blendEquation(m.FUNC_ADD),m.blendFunc(m.ZERO,m.SRC_COLOR)):a===THREE.CustomBlending?m.enable(m.BLEND):(m.enable(m.BLEND),m.blendEquationSeparate(m.FUNC_ADD,m.FUNC_ADD),m.blendFuncSeparate(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA,m.ONE,m.ONE_MINUS_SRC_ALPHA)),Fa=a);if(a===THREE.CustomBlending){if(b!==va&&(m.blendEquation(B(b)),va=b),c!==Ka||d!==aa)m.blendFunc(B(c),B(d)),Ka=c,aa=d}else aa=\nKa=va=null};this.setTexture=function(a,b){hack.log(\"\",hack.render,\"THREE.WebGLRenderer.setTexture\");if(a.needsUpdate){a.__webglInit||(a.__webglInit=!0,a.addEventListener(\"dispose\",Pb),a.__webglTexture=m.createTexture(),G.info.memory.textures++);m.activeTexture(m.TEXTURE0+b);m.bindTexture(m.TEXTURE_2D,a.__webglTexture);m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,a.flipY);m.pixelStorei(m.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);m.pixelStorei(m.UNPACK_ALIGNMENT,a.unpackAlignment);var c=a.image,d=THREE.Math.isPowerOfTwo(c.width)&&\nTHREE.Math.isPowerOfTwo(c.height),e=B(a.format),f=B(a.type);E(m.TEXTURE_2D,a,d);var g=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<g.length&&d){for(var h=0,k=g.length;h<k;h++)c=g[h],m.texImage2D(m.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);a.generateMipmaps=!1}else m.texImage2D(m.TEXTURE_2D,0,e,c.width,c.height,0,e,f,c.data);else if(a instanceof THREE.CompressedTexture)for(h=0,k=g.length;h<k;h++)c=g[h],a.format!==THREE.RGBAFormat?m.compressedTexImage2D(m.TEXTURE_2D,h,e,c.width,c.height,0,c.data):\nm.texImage2D(m.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);else if(0<g.length&&d){h=0;for(k=g.length;h<k;h++)c=g[h],m.texImage2D(m.TEXTURE_2D,h,e,e,f,c);a.generateMipmaps=!1}else m.texImage2D(m.TEXTURE_2D,0,e,e,f,a.image);a.generateMipmaps&&d&&m.generateMipmap(m.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate()}else m.activeTexture(m.TEXTURE0+b),m.bindTexture(m.TEXTURE_2D,a.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){void 0===\na.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener(\"dispose\",hc);a.__webglTexture=m.createTexture();G.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=B(a.format),e=B(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture);E(m.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=m.createFramebuffer();a.__webglRenderbuffer[f]=m.createRenderbuffer();\nm.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=m.TEXTURE_CUBE_MAP_POSITIVE_X+f;m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer[f]);m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,h,g.__webglTexture,0);Q(a.__webglRenderbuffer[f],a)}c&&m.generateMipmap(m.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=m.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:m.createRenderbuffer(),m.bindTexture(m.TEXTURE_2D,a.__webglTexture),\nE(m.TEXTURE_2D,a,c),m.texImage2D(m.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=m.TEXTURE_2D,m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer),m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a.__webglRenderbuffer):\nQ(a.__webglRenderbuffer,a),c&&m.generateMipmap(m.TEXTURE_2D);b?m.bindTexture(m.TEXTURE_CUBE_MAP,null):m.bindTexture(m.TEXTURE_2D,null);m.bindRenderbuffer(m.RENDERBUFFER,null);m.bindFramebuffer(m.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=wb,a=sb,d=ma,e=Ja);b!==Za&&(m.bindFramebuffer(m.FRAMEBUFFER,b),m.viewport(d,e,c,a),Za=b);Hb=c;Ib=a};this.shadowMapPlugin=new THREE.ShadowMapPlugin;this.addPrePlugin(this.shadowMapPlugin);\nthis.addPostPlugin(new THREE.SpritePlugin);this.addPostPlugin(new THREE.LensFlarePlugin)};\nTHREE.WebGLRenderTarget=function(a,b,c){this.width=a;this.height=b;c=c||{};this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter;this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==c.anisotropy?c.anisotropy:1;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=void 0!==c.format?c.format:\nTHREE.RGBAFormat;this.type=void 0!==c.type?c.type:THREE.UnsignedByteType;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.generateMipmaps=!0;this.shareDepthFrom=null};\nTHREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(a,b){this.width=a;this.height=b},clone:function(){var a=new THREE.WebGLRenderTarget(this.width,this.height);a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.minFilter=this.minFilter;a.anisotropy=this.anisotropy;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.format=this.format;a.type=this.type;a.depthBuffer=this.depthBuffer;a.stencilBuffer=this.stencilBuffer;a.generateMipmaps=this.generateMipmaps;\na.shareDepthFrom=this.shareDepthFrom;return a},dispose:function(){this.dispatchEvent({type:\"dispose\"})}};THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c);this.activeCubeFace=0};THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype);\nTHREE.WebGLProgram=function(){var a=0;return function(b,c,d,e){var f=b.context,g=d.defines,h=d.__webglShader.uniforms,k=d.attributes,l=d.__webglShader.vertexShader,n=d.__webglShader.fragmentShader,q=d.index0AttributeName;void 0===q&&!0===e.morphTargets&&(q=\"position\");var r=\"SHADOWMAP_TYPE_BASIC\";e.shadowMapType===THREE.PCFShadowMap?r=\"SHADOWMAP_TYPE_PCF\":e.shadowMapType===THREE.PCFSoftShadowMap&&(r=\"SHADOWMAP_TYPE_PCF_SOFT\");var t,s;t=[];for(var p in g)s=g[p],!1!==s&&(s=\"#define \"+p+\" \"+s,t.push(s));\nt=t.join(\"\\n\");g=f.createProgram();d instanceof THREE.RawShaderMaterial?b=d=\"\":(d=[\"precision \"+e.precision+\" float;\",\"precision \"+e.precision+\" int;\",t,e.supportsVertexTextures?\"#define VERTEX_TEXTURES\":\"\",b.gammaInput?\"#define GAMMA_INPUT\":\"\",b.gammaOutput?\"#define GAMMA_OUTPUT\":\"\",\"#define MAX_DIR_LIGHTS \"+e.maxDirLights,\"#define MAX_POINT_LIGHTS \"+e.maxPointLights,\"#define MAX_SPOT_LIGHTS \"+e.maxSpotLights,\"#define MAX_HEMI_LIGHTS \"+e.maxHemiLights,\"#define MAX_SHADOWS \"+e.maxShadows,\"#define MAX_BONES \"+\ne.maxBones,e.map?\"#define USE_MAP\":\"\",e.envMap?\"#define USE_ENVMAP\":\"\",e.lightMap?\"#define USE_LIGHTMAP\":\"\",e.bumpMap?\"#define USE_BUMPMAP\":\"\",e.normalMap?\"#define USE_NORMALMAP\":\"\",e.specularMap?\"#define USE_SPECULARMAP\":\"\",e.alphaMap?\"#define USE_ALPHAMAP\":\"\",e.vertexColors?\"#define USE_COLOR\":\"\",e.skinning?\"#define USE_SKINNING\":\"\",e.useVertexTexture?\"#define BONE_TEXTURE\":\"\",e.morphTargets?\"#define USE_MORPHTARGETS\":\"\",e.morphNormals?\"#define USE_MORPHNORMALS\":\"\",e.wrapAround?\"#define WRAP_AROUND\":\n\"\",e.doubleSided?\"#define DOUBLE_SIDED\":\"\",e.flipSided?\"#define FLIP_SIDED\":\"\",e.shadowMapEnabled?\"#define USE_SHADOWMAP\":\"\",e.shadowMapEnabled?\"#define \"+r:\"\",e.shadowMapDebug?\"#define SHADOWMAP_DEBUG\":\"\",e.shadowMapCascade?\"#define SHADOWMAP_CASCADE\":\"\",e.sizeAttenuation?\"#define USE_SIZEATTENUATION\":\"\",e.logarithmicDepthBuffer?\"#define USE_LOGDEPTHBUF\":\"\",\"uniform mat4 modelMatrix;\\nuniform mat4 modelViewMatrix;\\nuniform mat4 projectionMatrix;\\nuniform mat4 viewMatrix;\\nuniform mat3 normalMatrix;\\nuniform vec3 cameraPosition;\\nattribute vec3 position;\\nattribute vec3 normal;\\nattribute vec2 uv;\\nattribute vec2 uv2;\\n#ifdef USE_COLOR\\n\\tattribute vec3 color;\\n#endif\\n#ifdef USE_MORPHTARGETS\\n\\tattribute vec3 morphTarget0;\\n\\tattribute vec3 morphTarget1;\\n\\tattribute vec3 morphTarget2;\\n\\tattribute vec3 morphTarget3;\\n\\t#ifdef USE_MORPHNORMALS\\n\\t\\tattribute vec3 morphNormal0;\\n\\t\\tattribute vec3 morphNormal1;\\n\\t\\tattribute vec3 morphNormal2;\\n\\t\\tattribute vec3 morphNormal3;\\n\\t#else\\n\\t\\tattribute vec3 morphTarget4;\\n\\t\\tattribute vec3 morphTarget5;\\n\\t\\tattribute vec3 morphTarget6;\\n\\t\\tattribute vec3 morphTarget7;\\n\\t#endif\\n#endif\\n#ifdef USE_SKINNING\\n\\tattribute vec4 skinIndex;\\n\\tattribute vec4 skinWeight;\\n#endif\\n\"].join(\"\\n\"),\nb=[\"precision \"+e.precision+\" float;\",\"precision \"+e.precision+\" int;\",e.bumpMap||e.normalMap?\"#extension GL_OES_standard_derivatives : enable\":\"\",t,\"#define MAX_DIR_LIGHTS \"+e.maxDirLights,\"#define MAX_POINT_LIGHTS \"+e.maxPointLights,\"#define MAX_SPOT_LIGHTS \"+e.maxSpotLights,\"#define MAX_HEMI_LIGHTS \"+e.maxHemiLights,\"#define MAX_SHADOWS \"+e.maxShadows,e.alphaTest?\"#define ALPHATEST \"+e.alphaTest:\"\",b.gammaInput?\"#define GAMMA_INPUT\":\"\",b.gammaOutput?\"#define GAMMA_OUTPUT\":\"\",e.useFog&&e.fog?\"#define USE_FOG\":\n\"\",e.useFog&&e.fogExp?\"#define FOG_EXP2\":\"\",e.map?\"#define USE_MAP\":\"\",e.envMap?\"#define USE_ENVMAP\":\"\",e.lightMap?\"#define USE_LIGHTMAP\":\"\",e.bumpMap?\"#define USE_BUMPMAP\":\"\",e.normalMap?\"#define USE_NORMALMAP\":\"\",e.specularMap?\"#define USE_SPECULARMAP\":\"\",e.alphaMap?\"#define USE_ALPHAMAP\":\"\",e.vertexColors?\"#define USE_COLOR\":\"\",e.metal?\"#define METAL\":\"\",e.wrapAround?\"#define WRAP_AROUND\":\"\",e.doubleSided?\"#define DOUBLE_SIDED\":\"\",e.flipSided?\"#define FLIP_SIDED\":\"\",e.shadowMapEnabled?\"#define USE_SHADOWMAP\":\n\"\",e.shadowMapEnabled?\"#define \"+r:\"\",e.shadowMapDebug?\"#define SHADOWMAP_DEBUG\":\"\",e.shadowMapCascade?\"#define SHADOWMAP_CASCADE\":\"\",e.logarithmicDepthBuffer?\"#define USE_LOGDEPTHBUF\":\"\",\"uniform mat4 viewMatrix;\\nuniform vec3 cameraPosition;\\n\"].join(\"\\n\"));l=new THREE.WebGLShader(f,f.VERTEX_SHADER,d+l);n=new THREE.WebGLShader(f,f.FRAGMENT_SHADER,b+n);f.attachShader(g,l);f.attachShader(g,n);void 0!==q&&f.bindAttribLocation(g,0,q);f.linkProgram(g);!1===f.getProgramParameter(g,f.LINK_STATUS)&&(console.error(\"THREE.WebGLProgram: Could not initialise shader.\"),\nconsole.error(\"gl.VALIDATE_STATUS\",f.getProgramParameter(g,f.VALIDATE_STATUS)),console.error(\"gl.getError()\",f.getError()));\"\"!==f.getProgramInfoLog(g)&&console.warn(\"THREE.WebGLProgram: gl.getProgramInfoLog()\",f.getProgramInfoLog(g));f.deleteShader(l);f.deleteShader(n);q=\"viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences bindMatrix bindMatrixInverse\".split(\" \");e.useVertexTexture?(q.push(\"boneTexture\"),q.push(\"boneTextureWidth\"),q.push(\"boneTextureHeight\")):\nq.push(\"boneGlobalMatrices\");e.logarithmicDepthBuffer&&q.push(\"logDepthBufFC\");for(var v in h)q.push(v);h=q;v={};q=0;for(b=h.length;q<b;q++)r=h[q],v[r]=f.getUniformLocation(g,r);this.uniforms=v;q=\"position normal uv uv2 tangent color skinIndex skinWeight lineDistance\".split(\" \");for(h=0;h<e.maxMorphTargets;h++)q.push(\"morphTarget\"+h);for(h=0;h<e.maxMorphNormals;h++)q.push(\"morphNormal\"+h);for(var w in k)q.push(w);e=q;k={};w=0;for(h=e.length;w<h;w++)v=e[w],k[v]=f.getAttribLocation(g,v);this.attributes=\nk;this.id=a++;this.code=c;this.usedTimes=1;this.program=g;this.vertexShader=l;this.fragmentShader=n;return this}}();\nTHREE.WebGLShader=function(){var a=function(a){a=a.split(\"\\n\");for(var c=0;c<a.length;c++)a[c]=c+1+\": \"+a[c];return a.join(\"\\n\")};return function(b,c,d){c=b.createShader(c);b.shaderSource(c,d);b.compileShader(c);!1===b.getShaderParameter(c,b.COMPILE_STATUS)&&console.error(\"THREE.WebGLShader: Shader couldn't compile.\");\"\"!==b.getShaderInfoLog(c)&&(console.warn(\"THREE.WebGLShader: gl.getShaderInfoLog()\",b.getShaderInfoLog(c)),console.warn(a(d)));return c}}();\nTHREE.RenderableVertex=function(){this.position=new THREE.Vector3;this.positionWorld=new THREE.Vector3;this.positionScreen=new THREE.Vector4;this.visible=!0};THREE.RenderableVertex.prototype.copy=function(a){this.positionWorld.copy(a.positionWorld);this.positionScreen.copy(a.positionScreen)};\nTHREE.RenderableFace=function(){this.id=0;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.normalModel=new THREE.Vector3;this.vertexNormalsModel=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.vertexNormalsLength=0;this.color=new THREE.Color;this.material=null;this.uvs=[new THREE.Vector2,new THREE.Vector2,new THREE.Vector2];this.z=0};THREE.RenderableObject=function(){this.id=0;this.object=null;this.z=0};\nTHREE.RenderableSprite=function(){this.id=0;this.object=null;this.rotation=this.z=this.y=this.x=0;this.scale=new THREE.Vector2;this.material=null};THREE.RenderableLine=function(){this.id=0;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.vertexColors=[new THREE.Color,new THREE.Color];this.material=null;this.z=0};\nTHREE.GeometryUtils={merge:function(a,b,c){console.warn(\"THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.\");var d;b instanceof THREE.Mesh&&(b.matrixAutoUpdate&&b.updateMatrix(),d=b.matrix,b=b.geometry);a.merge(b,d,c)},center:function(a){console.warn(\"THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.\");return a.center()}};\nTHREE.ImageUtils={crossOrigin:void 0,loadTexture:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var f=new THREE.Texture(void 0,b);e.load(a,function(a){f.image=a;f.needsUpdate=!0;c&&c(f)},void 0,function(a){d&&d(a)});f.sourceFile=a;return f},loadTextureCube:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var f=new THREE.CubeTexture([],b);f.flipY=!1;var g=0;b=function(b){e.load(a[b],function(a){f.images[b]=a;g+=1;6===g&&(f.needsUpdate=!0,c&&\nc(f))})};d=0;for(var h=a.length;d<h;++d)b(d);return f},loadCompressedTexture:function(){console.error(\"THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.\")},loadCompressedTextureCube:function(){console.error(\"THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.\")},getNormalMap:function(a,b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]};b|=1;var d=a.width,e=a.height,f=document.createElement(\"canvas\");\nf.width=d;f.height=e;var g=f.getContext(\"2d\");g.drawImage(a,0,0);for(var h=g.getImageData(0,0,d,e).data,k=g.createImageData(d,e),l=k.data,n=0;n<d;n++)for(var q=0;q<e;q++){var r=0>q-1?0:q-1,t=q+1>e-1?e-1:q+1,s=0>n-1?0:n-1,p=n+1>d-1?d-1:n+1,v=[],w=[0,0,h[4*(q*d+n)]/255*b];v.push([-1,0,h[4*(q*d+s)]/255*b]);v.push([-1,-1,h[4*(r*d+s)]/255*b]);v.push([0,-1,h[4*(r*d+n)]/255*b]);v.push([1,-1,h[4*(r*d+p)]/255*b]);v.push([1,0,h[4*(q*d+p)]/255*b]);v.push([1,1,h[4*(t*d+p)]/255*b]);v.push([0,1,h[4*(t*d+n)]/255*\nb]);v.push([-1,1,h[4*(t*d+s)]/255*b]);r=[];s=v.length;for(t=0;t<s;t++){var p=v[t],u=v[(t+1)%s],p=[p[0]-w[0],p[1]-w[1],p[2]-w[2]],u=[u[0]-w[0],u[1]-w[1],u[2]-w[2]];r.push(c([p[1]*u[2]-p[2]*u[1],p[2]*u[0]-p[0]*u[2],p[0]*u[1]-p[1]*u[0]]))}v=[0,0,0];for(t=0;t<r.length;t++)v[0]+=r[t][0],v[1]+=r[t][1],v[2]+=r[t][2];v[0]/=r.length;v[1]/=r.length;v[2]/=r.length;w=4*(q*d+n);l[w]=(v[0]+1)/2*255|0;l[w+1]=(v[1]+1)/2*255|0;l[w+2]=255*v[2]|0;l[w+3]=255}g.putImageData(k,0,0);return f},generateDataTexture:function(a,\nb,c){var d=a*b,e=new Uint8Array(3*d),f=Math.floor(255*c.r),g=Math.floor(255*c.g);c=Math.floor(255*c.b);for(var h=0;h<d;h++)e[3*h]=f,e[3*h+1]=g,e[3*h+2]=c;a=new THREE.DataTexture(e,a,b,THREE.RGBFormat);a.needsUpdate=!0;return a}};\nTHREE.SceneUtils={createMultiMaterialObject:function(a,b){for(var c=new THREE.Object3D,d=0,e=b.length;d<e;d++)c.add(new THREE.Mesh(a,b[d]));return c},detach:function(a,b,c){a.applyMatrix(b.matrixWorld);b.remove(a);c.add(a)},attach:function(a,b,c){var d=new THREE.Matrix4;d.getInverse(c.matrixWorld);a.applyMatrix(d);b.remove(a);c.add(a)}};\nTHREE.FontUtils={faces:{},face:\"helvetiker\",weight:\"normal\",style:\"normal\",size:150,divisions:10,getFace:function(){try{return this.faces[this.face][this.weight][this.style]}catch(a){throw\"The font \"+this.face+\" with \"+this.weight+\" weight and \"+this.style+\" style is missing.\";}},loadFace:function(a){var b=a.familyName.toLowerCase();this.faces[b]=this.faces[b]||{};this.faces[b][a.cssFontWeight]=this.faces[b][a.cssFontWeight]||{};this.faces[b][a.cssFontWeight][a.cssFontStyle]=a;return this.faces[b][a.cssFontWeight][a.cssFontStyle]=\na},drawText:function(a){var b=this.getFace(),c=this.size/b.resolution,d=0,e=String(a).split(\"\"),f=e.length,g=[];for(a=0;a<f;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;g.push(h.path)}return{paths:g,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var f=[],g,h,k,l,n,q,r,t,s,p,v,w=b.glyphs[a]||b.glyphs[\"?\"];if(w){if(w.o)for(b=w._cachedOutline||(w._cachedOutline=w.o.split(\" \")),l=b.length,a=0;a<l;)switch(k=b[a++],k){case \"m\":k=b[a++]*c+d;n=b[a++]*c;e.moveTo(k,n);\nbreak;case \"l\":k=b[a++]*c+d;n=b[a++]*c;e.lineTo(k,n);break;case \"q\":k=b[a++]*c+d;n=b[a++]*c;t=b[a++]*c+d;s=b[a++]*c;e.quadraticCurveTo(t,s,k,n);if(g=f[f.length-1])for(q=g.x,r=g.y,g=1,h=this.divisions;g<=h;g++){var u=g/h;THREE.Shape.Utils.b2(u,q,t,k);THREE.Shape.Utils.b2(u,r,s,n)}break;case \"b\":if(k=b[a++]*c+d,n=b[a++]*c,t=b[a++]*c+d,s=b[a++]*c,p=b[a++]*c+d,v=b[a++]*c,e.bezierCurveTo(t,s,p,v,k,n),g=f[f.length-1])for(q=g.x,r=g.y,g=1,h=this.divisions;g<=h;g++)u=g/h,THREE.Shape.Utils.b3(u,q,t,p,k),THREE.Shape.Utils.b3(u,\nr,s,v,n)}return{offset:w.ha*c,path:e}}}};\nTHREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:\"helvetiker\",e=void 0!==b.weight?b.weight:\"normal\",f=void 0!==b.style?b.style:\"normal\";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=f;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(f=c.length;e<f;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};\n(function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,g=0;g<b;f=g++)e+=a[f].x*a[g].y-a[g].x*a[f].y;return.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var f=[],g=[],h=[],k,l,n;if(0<b(a))for(l=0;l<e;l++)g[l]=l;else for(l=0;l<e;l++)g[l]=e-1-l;var q=2*e;for(l=e-1;2<e;){if(0>=q--){console.log(\"Warning, unable to triangulate polygon!\");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);n=l+1;e<=n&&(n=0);var r;a:{var t=r=void 0,s=void 0,p=void 0,v=void 0,w=void 0,u=void 0,D=void 0,A=void 0,\nt=a[g[k]].x,s=a[g[k]].y,p=a[g[l]].x,v=a[g[l]].y,w=a[g[n]].x,u=a[g[n]].y;if(1E-10>(p-t)*(u-s)-(v-s)*(w-t))r=!1;else{var x=void 0,C=void 0,I=void 0,z=void 0,y=void 0,K=void 0,N=void 0,ba=void 0,P=void 0,O=void 0,P=ba=N=A=D=void 0,x=w-p,C=u-v,I=t-w,z=s-u,y=p-t,K=v-s;for(r=0;r<e;r++)if(D=a[g[r]].x,A=a[g[r]].y,!(D===t&&A===s||D===p&&A===v||D===w&&A===u)&&(N=D-t,ba=A-s,P=D-p,O=A-v,D-=w,A-=u,P=x*O-C*P,N=y*ba-K*N,ba=I*A-z*D,-1E-10<=P&&-1E-10<=ba&&-1E-10<=N)){r=!1;break a}r=!0}}if(r){f.push([a[g[k]],a[g[l]],\na[g[n]]]);h.push([g[k],g[l],g[n]]);k=l;for(n=l+1;n<e;k++,n++)g[k]=g[n];e--;q=2*e}}return d?h:f};a.Triangulate.area=b;return a})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};THREE.typeface_js=self._typeface_js;THREE.Curve=function(){};THREE.Curve.prototype.getPoint=function(a){console.log(\"Warning, getPoint() not implemented!\");return null};THREE.Curve.prototype.getPointAt=function(a){a=this.getUtoTmapping(a);return this.getPoint(a)};\nTHREE.Curve.prototype.getPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPoint(b/a));return c};THREE.Curve.prototype.getSpacedPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPointAt(b/a));return c};THREE.Curve.prototype.getLength=function(){var a=this.getLengths();return a[a.length-1]};\nTHREE.Curve.prototype.getLengths=function(a){a||(a=this.__arcLengthDivisions?this.__arcLengthDivisions:200);if(this.cacheArcLengths&&this.cacheArcLengths.length==a+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var b=[],c,d=this.getPoint(0),e,f=0;b.push(0);for(e=1;e<=a;e++)c=this.getPoint(e/a),f+=c.distanceTo(d),b.push(f),d=c;return this.cacheArcLengths=b};THREE.Curve.prototype.updateArcLengths=function(){this.needsUpdate=!0;this.getLengths()};\nTHREE.Curve.prototype.getUtoTmapping=function(a,b){var c=this.getLengths(),d=0,e=c.length,f;f=b?b:a*c[e-1];for(var g=0,h=e-1,k;g<=h;)if(d=Math.floor(g+(h-g)/2),k=c[d]-f,0>k)g=d+1;else if(0<k)h=d-1;else{h=d;break}d=h;if(c[d]==f)return d/(e-1);g=c[d];return c=(d+(f-g)/(c[d+1]-g))/(e-1)};THREE.Curve.prototype.getTangent=function(a){var b=a-1E-4;a+=1E-4;0>b&&(b=0);1<a&&(a=1);b=this.getPoint(b);return this.getPoint(a).clone().sub(b).normalize()};\nTHREE.Curve.prototype.getTangentAt=function(a){a=this.getUtoTmapping(a);return this.getTangent(a)};\nTHREE.Curve.Utils={tangentQuadraticBezier:function(a,b,c,d){return 2*(1-a)*(c-b)+2*a*(d-c)},tangentCubicBezier:function(a,b,c,d,e){return-3*b*(1-a)*(1-a)+3*c*(1-a)*(1-a)-6*a*c*(1-a)+6*a*d*(1-a)-3*a*a*d+3*a*a*e},tangentSpline:function(a,b,c,d,e){return 6*a*a-6*a+(3*a*a-4*a+1)+(-6*a*a+6*a)+(3*a*a-2*a)},interpolate:function(a,b,c,d,e){a=.5*(c-a);d=.5*(d-b);var f=e*e;return(2*b-2*c+a+d)*e*f+(-3*b+3*c-2*a-d)*f+a*e+b}};\nTHREE.Curve.create=function(a,b){a.prototype=Object.create(THREE.Curve.prototype);a.prototype.getPoint=b;return a};THREE.CurvePath=function(){this.curves=[];this.bends=[];this.autoClose=!1};THREE.CurvePath.prototype=Object.create(THREE.Curve.prototype);THREE.CurvePath.prototype.add=function(a){this.curves.push(a)};THREE.CurvePath.prototype.checkConnection=function(){};\nTHREE.CurvePath.prototype.closePath=function(){var a=this.curves[0].getPoint(0),b=this.curves[this.curves.length-1].getPoint(1);a.equals(b)||this.curves.push(new THREE.LineCurve(b,a))};THREE.CurvePath.prototype.getPoint=function(a){var b=a*this.getLength(),c=this.getCurveLengths();for(a=0;a<c.length;){if(c[a]>=b)return b=c[a]-b,a=this.curves[a],b=1-b/a.getLength(),a.getPointAt(b);a++}return null};THREE.CurvePath.prototype.getLength=function(){var a=this.getCurveLengths();return a[a.length-1]};\nTHREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var a=[],b=0,c,d=this.curves.length;for(c=0;c<d;c++)b+=this.curves[c].getLength(),a.push(b);return this.cacheLengths=a};\nTHREE.CurvePath.prototype.getBoundingBox=function(){var a=this.getPoints(),b,c,d,e,f,g;b=c=Number.NEGATIVE_INFINITY;e=f=Number.POSITIVE_INFINITY;var h,k,l,n,q=a[0]instanceof THREE.Vector3;n=q?new THREE.Vector3:new THREE.Vector2;k=0;for(l=a.length;k<l;k++)h=a[k],h.x>b?b=h.x:h.x<e&&(e=h.x),h.y>c?c=h.y:h.y<f&&(f=h.y),q&&(h.z>d?d=h.z:h.z<g&&(g=h.z)),n.add(h);a={minX:e,minY:f,maxX:b,maxY:c};q&&(a.maxZ=d,a.minZ=g);return a};\nTHREE.CurvePath.prototype.createPointsGeometry=function(a){a=this.getPoints(a,!0);return this.createGeometry(a)};THREE.CurvePath.prototype.createSpacedPointsGeometry=function(a){a=this.getSpacedPoints(a,!0);return this.createGeometry(a)};THREE.CurvePath.prototype.createGeometry=function(a){for(var b=new THREE.Geometry,c=0;c<a.length;c++)b.vertices.push(new THREE.Vector3(a[c].x,a[c].y,a[c].z||0));return b};THREE.CurvePath.prototype.addWrapPath=function(a){this.bends.push(a)};\nTHREE.CurvePath.prototype.getTransformedPoints=function(a,b){var c=this.getPoints(a),d,e;b||(b=this.bends);d=0;for(e=b.length;d<e;d++)c=this.getWrapPoints(c,b[d]);return c};THREE.CurvePath.prototype.getTransformedSpacedPoints=function(a,b){var c=this.getSpacedPoints(a),d,e;b||(b=this.bends);d=0;for(e=b.length;d<e;d++)c=this.getWrapPoints(c,b[d]);return c};\nTHREE.CurvePath.prototype.getWrapPoints=function(a,b){var c=this.getBoundingBox(),d,e,f,g,h,k;d=0;for(e=a.length;d<e;d++)f=a[d],g=f.x,h=f.y,k=g/c.maxX,k=b.getUtoTmapping(k,g),g=b.getPoint(k),k=b.getTangent(k),k.set(-k.y,k.x).multiplyScalar(h),f.x=g.x+k.x,f.y=g.y+k.y;return a};THREE.Gyroscope=function(){THREE.Object3D.call(this)};THREE.Gyroscope.prototype=Object.create(THREE.Object3D.prototype);\nTHREE.Gyroscope.prototype.updateMatrixWorld=function(a){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||a)this.parent?(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorld.decompose(this.translationWorld,this.quaternionWorld,this.scaleWorld),this.matrix.decompose(this.translationObject,this.quaternionObject,this.scaleObject),this.matrixWorld.compose(this.translationWorld,this.quaternionObject,this.scaleWorld)):this.matrixWorld.copy(this.matrix),\nthis.matrixWorldNeedsUpdate=!1,a=!0;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)};THREE.Gyroscope.prototype.translationWorld=new THREE.Vector3;THREE.Gyroscope.prototype.translationObject=new THREE.Vector3;THREE.Gyroscope.prototype.quaternionWorld=new THREE.Quaternion;THREE.Gyroscope.prototype.quaternionObject=new THREE.Quaternion;THREE.Gyroscope.prototype.scaleWorld=new THREE.Vector3;THREE.Gyroscope.prototype.scaleObject=new THREE.Vector3;\nTHREE.Path=function(a){THREE.CurvePath.call(this);this.actions=[];a&&this.fromPoints(a)};THREE.Path.prototype=Object.create(THREE.CurvePath.prototype);THREE.PathActions={MOVE_TO:\"moveTo\",LINE_TO:\"lineTo\",QUADRATIC_CURVE_TO:\"quadraticCurveTo\",BEZIER_CURVE_TO:\"bezierCurveTo\",CSPLINE_THRU:\"splineThru\",ARC:\"arc\",ELLIPSE:\"ellipse\"};THREE.Path.prototype.fromPoints=function(a){this.moveTo(a[0].x,a[0].y);for(var b=1,c=a.length;b<c;b++)this.lineTo(a[b].x,a[b].y)};\nTHREE.Path.prototype.moveTo=function(a,b){var c=Array.prototype.slice.call(arguments);this.actions.push({action:THREE.PathActions.MOVE_TO,args:c})};THREE.Path.prototype.lineTo=function(a,b){var c=Array.prototype.slice.call(arguments),d=this.actions[this.actions.length-1].args,d=new THREE.LineCurve(new THREE.Vector2(d[d.length-2],d[d.length-1]),new THREE.Vector2(a,b));this.curves.push(d);this.actions.push({action:THREE.PathActions.LINE_TO,args:c})};\nTHREE.Path.prototype.quadraticCurveTo=function(a,b,c,d){var e=Array.prototype.slice.call(arguments),f=this.actions[this.actions.length-1].args,f=new THREE.QuadraticBezierCurve(new THREE.Vector2(f[f.length-2],f[f.length-1]),new THREE.Vector2(a,b),new THREE.Vector2(c,d));this.curves.push(f);this.actions.push({action:THREE.PathActions.QUADRATIC_CURVE_TO,args:e})};\nTHREE.Path.prototype.bezierCurveTo=function(a,b,c,d,e,f){var g=Array.prototype.slice.call(arguments),h=this.actions[this.actions.length-1].args,h=new THREE.CubicBezierCurve(new THREE.Vector2(h[h.length-2],h[h.length-1]),new THREE.Vector2(a,b),new THREE.Vector2(c,d),new THREE.Vector2(e,f));this.curves.push(h);this.actions.push({action:THREE.PathActions.BEZIER_CURVE_TO,args:g})};\nTHREE.Path.prototype.splineThru=function(a){var b=Array.prototype.slice.call(arguments),c=this.actions[this.actions.length-1].args,c=[new THREE.Vector2(c[c.length-2],c[c.length-1])];Array.prototype.push.apply(c,a);c=new THREE.SplineCurve(c);this.curves.push(c);this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:b})};THREE.Path.prototype.arc=function(a,b,c,d,e,f){var g=this.actions[this.actions.length-1].args;this.absarc(a+g[g.length-2],b+g[g.length-1],c,d,e,f)};\nTHREE.Path.prototype.absarc=function(a,b,c,d,e,f){this.absellipse(a,b,c,c,d,e,f)};THREE.Path.prototype.ellipse=function(a,b,c,d,e,f,g){var h=this.actions[this.actions.length-1].args;this.absellipse(a+h[h.length-2],b+h[h.length-1],c,d,e,f,g)};THREE.Path.prototype.absellipse=function(a,b,c,d,e,f,g){var h=Array.prototype.slice.call(arguments),k=new THREE.EllipseCurve(a,b,c,d,e,f,g);this.curves.push(k);k=k.getPoint(1);h.push(k.x);h.push(k.y);this.actions.push({action:THREE.PathActions.ELLIPSE,args:h})};\nTHREE.Path.prototype.getSpacedPoints=function(a,b){a||(a=40);for(var c=[],d=0;d<a;d++)c.push(this.getPoint(d/a));return c};\nTHREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints)return console.log(\"tata\"),this.getSpacedPoints(a,b);a=a||12;var c=[],d,e,f,g,h,k,l,n,q,r,t,s,p;d=0;for(e=this.actions.length;d<e;d++)switch(f=this.actions[d],g=f.action,f=f.args,g){case THREE.PathActions.MOVE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:h=f[2];k=f[3];q=f[0];r=f[1];0<c.length?(g=c[c.length-1],t=g.x,\ns=g.y):(g=this.actions[d-1].args,t=g[g.length-2],s=g[g.length-1]);for(f=1;f<=a;f++)p=f/a,g=THREE.Shape.Utils.b2(p,t,q,h),p=THREE.Shape.Utils.b2(p,s,r,k),c.push(new THREE.Vector2(g,p));break;case THREE.PathActions.BEZIER_CURVE_TO:h=f[4];k=f[5];q=f[0];r=f[1];l=f[2];n=f[3];0<c.length?(g=c[c.length-1],t=g.x,s=g.y):(g=this.actions[d-1].args,t=g[g.length-2],s=g[g.length-1]);for(f=1;f<=a;f++)p=f/a,g=THREE.Shape.Utils.b3(p,t,q,l,h),p=THREE.Shape.Utils.b3(p,s,r,n,k),c.push(new THREE.Vector2(g,p));break;case THREE.PathActions.CSPLINE_THRU:g=\nthis.actions[d-1].args;p=[new THREE.Vector2(g[g.length-2],g[g.length-1])];g=a*f[0].length;p=p.concat(f[0]);p=new THREE.SplineCurve(p);for(f=1;f<=g;f++)c.push(p.getPointAt(f/g));break;case THREE.PathActions.ARC:h=f[0];k=f[1];r=f[2];l=f[3];g=f[4];q=!!f[5];t=g-l;s=2*a;for(f=1;f<=s;f++)p=f/s,q||(p=1-p),p=l+p*t,g=h+r*Math.cos(p),p=k+r*Math.sin(p),c.push(new THREE.Vector2(g,p));break;case THREE.PathActions.ELLIPSE:for(h=f[0],k=f[1],r=f[2],n=f[3],l=f[4],g=f[5],q=!!f[6],t=g-l,s=2*a,f=1;f<=s;f++)p=f/s,q||\n(p=1-p),p=l+p*t,g=h+r*Math.cos(p),p=k+n*Math.sin(p),c.push(new THREE.Vector2(g,p))}d=c[c.length-1];1E-10>Math.abs(d.x-c[0].x)&&1E-10>Math.abs(d.y-c[0].y)&&c.splice(c.length-1,1);b&&c.push(c[0]);return c};\nTHREE.Path.prototype.toShapes=function(a,b){function c(a){for(var b=[],c=0,d=a.length;c<d;c++){var e=a[c],f=new THREE.Shape;f.actions=e.actions;f.curves=e.curves;b.push(f)}return b}function d(a,b){for(var c=b.length,d=!1,e=c-1,f=0;f<c;e=f++){var g=b[e],h=b[f],k=h.x-g.x,l=h.y-g.y;if(1E-10<Math.abs(l)){if(0>l&&(g=b[f],k=-k,h=b[e],l=-l),!(a.y<g.y||a.y>h.y))if(a.y==g.y){if(a.x==g.x)return!0}else{e=l*(a.x-g.x)-k*(a.y-g.y);if(0==e)return!0;0>e||(d=!d)}}else if(a.y==g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<=\nh.x))return!0}return d}var e=function(a){var b,c,d,e,f=[],g=new THREE.Path;b=0;for(c=a.length;b<c;b++)d=a[b],e=d.args,d=d.action,d==THREE.PathActions.MOVE_TO&&0!=g.actions.length&&(f.push(g),g=new THREE.Path),g[d].apply(g,e);0!=g.actions.length&&f.push(g);return f}(this.actions);if(0==e.length)return[];if(!0===b)return c(e);var f,g,h,k=[];if(1==e.length)return g=e[0],h=new THREE.Shape,h.actions=g.actions,h.curves=g.curves,k.push(h),k;var l=!THREE.Shape.Utils.isClockWise(e[0].getPoints()),l=a?!l:l;\nh=[];var n=[],q=[],r=0,t;n[r]=void 0;q[r]=[];var s,p;s=0;for(p=e.length;s<p;s++)g=e[s],t=g.getPoints(),f=THREE.Shape.Utils.isClockWise(t),(f=a?!f:f)?(!l&&n[r]&&r++,n[r]={s:new THREE.Shape,p:t},n[r].s.actions=g.actions,n[r].s.curves=g.curves,l&&r++,q[r]=[]):q[r].push({h:g,p:t[0]});if(!n[0])return c(e);if(1<n.length){s=!1;p=[];g=0;for(e=n.length;g<e;g++)h[g]=[];g=0;for(e=n.length;g<e;g++)for(f=q[g],l=0;l<f.length;l++){r=f[l];t=!0;for(var v=0;v<n.length;v++)d(r.p,n[v].p)&&(g!=v&&p.push({froms:g,tos:v,\nhole:l}),t?(t=!1,h[v].push(r)):s=!0);t&&h[g].push(r)}0<p.length&&(s||(q=h))}s=0;for(p=n.length;s<p;s++)for(h=n[s].s,k.push(h),g=q[s],e=0,f=g.length;e<f;e++)h.holes.push(g[e].h);return k};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=Object.create(THREE.Path.prototype);THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};THREE.Shape.prototype.makeGeometry=function(a){return new THREE.ShapeGeometry(this,a)};\nTHREE.Shape.prototype.getPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d};THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d};THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}};\nTHREE.Shape.prototype.extractPoints=function(a){return this.useSpacedPoints?this.extractAllSpacedPoints(a):this.extractAllPoints(a)};THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}};\nTHREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!=b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,n=a.x-d.x,q=a.y-d.y,I=h*k-g*l,z=h*n-g*q;if(1E-10<Math.abs(I)){if(0<I){if(0>z||z>I)return[];k=l*n-k*q;if(0>k||k>I)return[]}else{if(0<z||z<I)return[];k=l*n-k*q;if(0<k||k<I)return[]}if(0==k)return!f||0!=z&&z!=I?[a]:[];if(k==I)return!f||0!=z&&z!=I?[b]:[];if(0==z)return[d];\nif(z==I)return[e];f=k/I;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!=z||l*n!=k*q)return[];h=0==g&&0==h;k=0==k&&0==l;if(h&&k)return a.x!=d.x||a.y!=d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!=g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,I=d.x,l=e,d=e.x):(b=e,I=e.x,l=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,I=d.y,l=e,d=e.y):(b=e,I=e.y,l=d,d=d.y));return k<=I?a<I?[]:a==I?f?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:k==d?f?[]:[g]:a<=d?[g,h]:\n[g,l]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10<Math.abs(a)?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var f,g,h,k,l,n={};h=a.concat();f=0;for(g=b.length;f<g;f++)Array.prototype.push.apply(h,b[f]);f=0;for(g=h.length;f<g;f++)l=h[f].x+\":\"+h[f].y,void 0!==n[l]&&console.log(\"Duplicate point\",l),n[l]=f;f=function(a,b){function c(a,b){var d=h.length-1,f=a-1;0>f&&(f=d);var g=a+1;g>d&&(g=0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;\nd=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<l.length;e++)for(f=b[l[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,l=[],n,q,C,I,z,y=[],K,N,ba,P=0;for(n=b.length;P<n;P++)l.push(P);K=0;for(var O=2*l.length;0<l.length;){O--;if(0>O){console.log(\"Infinite Loop! Holes left:\"+\nl.length+\", Probably Hole outside Shape!\");break}for(q=K;q<h.length;q++){C=h[q];n=-1;for(P=0;P<l.length;P++)if(I=l[P],z=C.x+\":\"+C.y+\":\"+I,void 0===y[z]){k=b[I];for(N=0;N<k.length;N++)if(I=k[N],c(q,N)&&!f(C,I)&&!g(C,I)){n=N;l.splice(P,1);K=h.slice(0,q+1);I=h.slice(q);N=k.slice(n);ba=k.slice(0,n+1);h=K.concat(N).concat(ba).concat(I);K=q;break}if(0<=n)break;y[z]=!0}if(0<=n)break}}return h}(a,b);var q=THREE.FontUtils.Triangulate(f,!1);f=0;for(g=q.length;f<g;f++)for(k=q[f],h=0;3>h;h++)l=k[h].x+\":\"+k[h].y,\nl=n[l],void 0!==l&&(k[h]=l);return q.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,\nb)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);b.multiplyScalar(a).add(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()};\nTHREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);return new THREE.Vector2(b,a)};\nTHREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y);b=new THREE.Vector2(b,a);b.normalize();return b};THREE.CubicBezierCurve=function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d};THREE.CubicBezierCurve.prototype=Object.create(THREE.Curve.prototype);\nTHREE.CubicBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);return new THREE.Vector2(b,a)};THREE.CubicBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);b=new THREE.Vector2(b,a);b.normalize();return b};\nTHREE.SplineCurve=function(a){this.points=void 0==a?[]:a};THREE.SplineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.SplineCurve.prototype.getPoint=function(a){var b=new THREE.Vector2,c=[],d=this.points,e;e=(d.length-1)*a;a=Math.floor(e);e-=a;c[0]=0==a?a:a-1;c[1]=a;c[2]=a>d.length-2?d.length-1:a+1;c[3]=a>d.length-3?d.length-1:a+2;b.x=THREE.Curve.Utils.interpolate(d[c[0]].x,d[c[1]].x,d[c[2]].x,d[c[3]].x,e);b.y=THREE.Curve.Utils.interpolate(d[c[0]].y,d[c[1]].y,d[c[2]].y,d[c[3]].y,e);return b};\nTHREE.EllipseCurve=function(a,b,c,d,e,f,g){this.aX=a;this.aY=b;this.xRadius=c;this.yRadius=d;this.aStartAngle=e;this.aEndAngle=f;this.aClockwise=g};THREE.EllipseCurve.prototype=Object.create(THREE.Curve.prototype);\nTHREE.EllipseCurve.prototype.getPoint=function(a){var b;b=this.aEndAngle-this.aStartAngle;0>b&&(b+=2*Math.PI);b>2*Math.PI&&(b-=2*Math.PI);b=!0===this.aClockwise?this.aEndAngle+(1-a)*(2*Math.PI-b):this.aStartAngle+a*b;a=this.aX+this.xRadius*Math.cos(b);b=this.aY+this.yRadius*Math.sin(b);return new THREE.Vector2(a,b)};THREE.ArcCurve=function(a,b,c,d,e,f){THREE.EllipseCurve.call(this,a,b,c,c,d,e,f)};THREE.ArcCurve.prototype=Object.create(THREE.EllipseCurve.prototype);\nTHREE.LineCurve3=THREE.Curve.create(function(a,b){this.v1=a;this.v2=b},function(a){var b=new THREE.Vector3;b.subVectors(this.v2,this.v1);b.multiplyScalar(a);b.add(this.v1);return b});THREE.QuadraticBezierCurve3=THREE.Curve.create(function(a,b,c){this.v0=a;this.v1=b;this.v2=c},function(a){var b,c;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);c=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);a=THREE.Shape.Utils.b2(a,this.v0.z,this.v1.z,this.v2.z);return new THREE.Vector3(b,c,a)});\nTHREE.CubicBezierCurve3=THREE.Curve.create(function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d},function(a){var b,c;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);c=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);a=THREE.Shape.Utils.b3(a,this.v0.z,this.v1.z,this.v2.z,this.v3.z);return new THREE.Vector3(b,c,a)});\nTHREE.SplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=new THREE.Vector3,c=[],d=this.points,e;a*=d.length-1;e=Math.floor(a);a-=e;c[0]=0==e?e:e-1;c[1]=e;c[2]=e>d.length-2?d.length-1:e+1;c[3]=e>d.length-3?d.length-1:e+2;e=d[c[0]];var f=d[c[1]],g=d[c[2]],c=d[c[3]];b.x=THREE.Curve.Utils.interpolate(e.x,f.x,g.x,c.x,a);b.y=THREE.Curve.Utils.interpolate(e.y,f.y,g.y,c.y,a);b.z=THREE.Curve.Utils.interpolate(e.z,f.z,g.z,c.z,a);return b});\nTHREE.ClosedSplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=new THREE.Vector3,c=[],d=this.points,e;e=(d.length-0)*a;a=Math.floor(e);e-=a;a+=0<a?0:(Math.floor(Math.abs(a)/d.length)+1)*d.length;c[0]=(a-1)%d.length;c[1]=a%d.length;c[2]=(a+1)%d.length;c[3]=(a+2)%d.length;b.x=THREE.Curve.Utils.interpolate(d[c[0]].x,d[c[1]].x,d[c[2]].x,d[c[3]].x,e);b.y=THREE.Curve.Utils.interpolate(d[c[0]].y,d[c[1]].y,d[c[2]].y,d[c[3]].y,e);b.z=THREE.Curve.Utils.interpolate(d[c[0]].z,\nd[c[1]].z,d[c[2]].z,d[c[3]].z,e);return b});\nTHREE.AnimationHandler={LINEAR:0,CATMULLROM:1,CATMULLROM_FORWARD:2,add:function(){console.warn(\"THREE.AnimationHandler.add() has been deprecated.\")},get:function(){console.warn(\"THREE.AnimationHandler.get() has been deprecated.\")},remove:function(){console.warn(\"THREE.AnimationHandler.remove() has been deprecated.\")},animations:[],init:function(a){if(!0!==a.initialized){for(var b=0;b<a.hierarchy.length;b++){for(var c=0;c<a.hierarchy[b].keys.length;c++)if(0>a.hierarchy[b].keys[c].time&&(a.hierarchy[b].keys[c].time=\n0),void 0!==a.hierarchy[b].keys[c].rot&&!(a.hierarchy[b].keys[c].rot instanceof THREE.Quaternion)){var d=a.hierarchy[b].keys[c].rot;a.hierarchy[b].keys[c].rot=(new THREE.Quaternion).fromArray(d)}if(a.hierarchy[b].keys.length&&void 0!==a.hierarchy[b].keys[0].morphTargets){d={};for(c=0;c<a.hierarchy[b].keys.length;c++)for(var e=0;e<a.hierarchy[b].keys[c].morphTargets.length;e++){var f=a.hierarchy[b].keys[c].morphTargets[e];d[f]=-1}a.hierarchy[b].usedMorphTargets=d;for(c=0;c<a.hierarchy[b].keys.length;c++){var g=\n{};for(f in d){for(e=0;e<a.hierarchy[b].keys[c].morphTargets.length;e++)if(a.hierarchy[b].keys[c].morphTargets[e]===f){g[f]=a.hierarchy[b].keys[c].morphTargetsInfluences[e];break}e===a.hierarchy[b].keys[c].morphTargets.length&&(g[f]=0)}a.hierarchy[b].keys[c].morphTargetsInfluences=g}}for(c=1;c<a.hierarchy[b].keys.length;c++)a.hierarchy[b].keys[c].time===a.hierarchy[b].keys[c-1].time&&(a.hierarchy[b].keys.splice(c,1),c--);for(c=0;c<a.hierarchy[b].keys.length;c++)a.hierarchy[b].keys[c].index=c}a.initialized=\n!0;return a}},parse:function(a){var b=function(a,c){c.push(a);for(var d=0;d<a.children.length;d++)b(a.children[d],c)},c=[];if(a instanceof THREE.SkinnedMesh)for(var d=0;d<a.skeleton.bones.length;d++)c.push(a.skeleton.bones[d]);else b(a,c);return c},play:function(a){-1===this.animations.indexOf(a)&&this.animations.push(a)},stop:function(a){a=this.animations.indexOf(a);-1!==a&&this.animations.splice(a,1)},update:function(a){for(var b=0;b<this.animations.length;b++)this.animations[b].update(a)}};\nTHREE.Animation=function(a,b){this.root=a;this.data=THREE.AnimationHandler.init(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=1;this.isPlaying=!1;this.loop=!0;this.weight=0;this.interpolationType=THREE.AnimationHandler.LINEAR};THREE.Animation.prototype.keyTypes=[\"pos\",\"rot\",\"scl\"];THREE.Animation.prototype.play=function(a,b){this.currentTime=void 0!==a?a:0;this.weight=void 0!==b?b:1;this.isPlaying=!0;this.reset();THREE.AnimationHandler.play(this)};\nTHREE.Animation.prototype.stop=function(){this.isPlaying=!1;THREE.AnimationHandler.stop(this)};\nTHREE.Animation.prototype.reset=function(){for(var a=0,b=this.hierarchy.length;a<b;a++){var c=this.hierarchy[a];c.matrixAutoUpdate=!0;void 0===c.animationCache&&(c.animationCache={});void 0===c.animationCache[this.data.name]&&(c.animationCache[this.data.name]={},c.animationCache[this.data.name].prevKey={pos:0,rot:0,scl:0},c.animationCache[this.data.name].nextKey={pos:0,rot:0,scl:0},c.animationCache[this.data.name].originalMatrix=c.matrix);for(var c=c.animationCache[this.data.name],d=0;3>d;d++){for(var e=\nthis.keyTypes[d],f=this.data.hierarchy[a].keys[0],g=this.getNextKeyWith(e,a,1);g.time<this.currentTime&&g.index>f.index;)f=g,g=this.getNextKeyWith(e,a,g.index+1);c.prevKey[e]=f;c.nextKey[e]=g}}};\nTHREE.Animation.prototype.update=function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,q,r,t,s,p;e=(a.length-1)*b;q=Math.floor(e);e-=q;c[0]=0===q?q:q-1;c[1]=q;c[2]=q>a.length-2?q:q+1;c[3]=q>a.length-3?q:q+2;q=a[c[0]];t=a[c[1]];s=a[c[2]];p=a[c[3]];c=e*e;r=e*c;d[0]=f(q[0],t[0],s[0],p[0],e,c,r);d[1]=f(q[1],t[1],s[1],p[1],e,c,r);d[2]=f(q[2],t[2],s[2],p[2],e,c,r);return d},f=function(a,b,c,d,e,f,r){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*r+\n(-3*(b-c)-2*a-d)*f+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){f=this.data.length;if(!0===this.loop&&this.currentTime>f)this.currentTime%=f,this.reset();else if(!1===this.loop&&this.currentTime>f){this.stop();return}f=0;for(var h=this.hierarchy.length;f<h;f++)for(var k=this.hierarchy[f],l=k.animationCache[this.data.name],n=0;3>n;n++){var q=this.keyTypes[n],r=l.prevKey[q],t=l.nextKey[q];if(t.time<=this.currentTime){r=this.data.hierarchy[f].keys[0];\nfor(t=this.getNextKeyWith(q,f,1);t.time<this.currentTime&&t.index>r.index;)r=t,t=this.getNextKeyWith(q,f,t.index+1);l.prevKey[q]=r;l.nextKey[q]=t}k.matrixAutoUpdate=!0;k.matrixWorldNeedsUpdate=!0;var s=(this.currentTime-r.time)/(t.time-r.time),p=r[q],v=t[q];0>s&&(s=0);1<s&&(s=1);if(\"pos\"===q)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=p[0]+(v[0]-p[0])*s,c.y=p[1]+(v[1]-p[1])*s,c.z=p[2]+(v[2]-p[2])*s,k instanceof THREE.Bone?(r=this.weight/(this.weight+k.accumulatedPosWeight),k.position.lerp(c,\nr),k.accumulatedPosWeight+=this.weight):k.position.copy(c);else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)a[0]=this.getPrevKeyWith(\"pos\",f,r.index-1).pos,a[1]=p,a[2]=v,a[3]=this.getNextKeyWith(\"pos\",f,t.index+1).pos,s=.33*s+.33,t=e(a,s),r=1,k instanceof THREE.Bone&&(r=this.weight/(this.weight+k.accumulatedPosWeight),k.accumulatedPosWeight+=this.weight),q=k.position,q.x+=(t[0]-q.x)*r,q.y+=(t[1]-q.y)*r,q.z+=(t[2]-\nq.z)*r,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(s=e(a,1.01*s),b.set(s[0],s[1],s[2]),b.sub(q),b.y=0,b.normalize(),s=Math.atan2(b.x,b.z),k.rotation.set(0,s,0))}else\"rot\"===q?(THREE.Quaternion.slerp(p,v,d,s),k instanceof THREE.Bone?0===k.accumulatedRotWeight?(k.quaternion.copy(d),k.accumulatedRotWeight=this.weight):(r=this.weight/(this.weight+k.accumulatedRotWeight),THREE.Quaternion.slerp(k.quaternion,d,k.quaternion,r),k.accumulatedRotWeight+=this.weight):k.quaternion.copy(d)):\n\"scl\"===q&&(c.x=p[0]+(v[0]-p[0])*s,c.y=p[1]+(v[1]-p[1])*s,c.z=p[2]+(v[2]-p[2])*s,k instanceof THREE.Bone?(r=this.weight/(this.weight+k.accumulatedSclWeight),k.scale.lerp(c,r),k.accumulatedSclWeight+=this.weight):k.scale.copy(c))}return!0}}}();\nTHREE.Animation.prototype.getNextKeyWith=function(a,b,c){var d=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c<d.length-1?c:d.length-1:c%d.length;c<d.length;c++)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[0]};\nTHREE.Animation.prototype.getPrevKeyWith=function(a,b,c){var d=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?0<c?c:0:0<=c?c:c+d.length;0<=c;c--)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[d.length-1]};\nTHREE.KeyFrameAnimation=function(a){this.root=a.node;this.data=THREE.AnimationHandler.init(a);this.hierarchy=THREE.AnimationHandler.parse(this.root);this.currentTime=0;this.timeScale=.001;this.isPlaying=!1;this.loop=this.isPaused=!0;a=0;for(var b=this.hierarchy.length;a<b;a++){var c=this.data.hierarchy[a].sids,d=this.hierarchy[a];if(this.data.hierarchy[a].keys.length&&c){for(var e=0;e<c.length;e++){var f=c[e],g=this.getNextKeyWith(f,a,0);g&&g.apply(f)}d.matrixAutoUpdate=!1;this.data.hierarchy[a].node.updateMatrix();\nd.matrixWorldNeedsUpdate=!0}}};\nTHREE.KeyFrameAnimation.prototype.play=function(a){this.currentTime=void 0!==a?a:0;if(!1===this.isPlaying){this.isPlaying=!0;var b=this.hierarchy.length,c,d;for(a=0;a<b;a++)c=this.hierarchy[a],d=this.data.hierarchy[a],void 0===d.animationCache&&(d.animationCache={},d.animationCache.prevKey=null,d.animationCache.nextKey=null,d.animationCache.originalMatrix=c.matrix),c=this.data.hierarchy[a].keys,c.length&&(d.animationCache.prevKey=c[0],d.animationCache.nextKey=c[1],this.startTime=Math.min(c[0].time,\nthis.startTime),this.endTime=Math.max(c[c.length-1].time,this.endTime));this.update(0)}this.isPaused=!1;THREE.AnimationHandler.play(this)};THREE.KeyFrameAnimation.prototype.stop=function(){this.isPaused=this.isPlaying=!1;THREE.AnimationHandler.stop(this);for(var a=0;a<this.data.hierarchy.length;a++){var b=this.hierarchy[a],c=this.data.hierarchy[a];if(void 0!==c.animationCache){var d=c.animationCache.originalMatrix;d.copy(b.matrix);b.matrix=d;delete c.animationCache}}};\nTHREE.KeyFrameAnimation.prototype.update=function(a){if(!1!==this.isPlaying){this.currentTime+=a*this.timeScale;a=this.data.length;!0===this.loop&&this.currentTime>a&&(this.currentTime%=a);this.currentTime=Math.min(this.currentTime,a);a=0;for(var b=this.hierarchy.length;a<b;a++){var c=this.hierarchy[a],d=this.data.hierarchy[a],e=d.keys,d=d.animationCache;if(e.length){var f=d.prevKey,g=d.nextKey;if(g.time<=this.currentTime){for(;g.time<this.currentTime&&g.index>f.index;)f=g,g=e[f.index+1];d.prevKey=\nf;d.nextKey=g}g.time>=this.currentTime?f.interpolate(g,this.currentTime):f.interpolate(g,g.time);this.data.hierarchy[a].node.updateMatrix();c.matrixWorldNeedsUpdate=!0}}}};THREE.KeyFrameAnimation.prototype.getNextKeyWith=function(a,b,c){b=this.data.hierarchy[b].keys;for(c%=b.length;c<b.length;c++)if(b[c].hasTarget(a))return b[c];return b[0]};\nTHREE.KeyFrameAnimation.prototype.getPrevKeyWith=function(a,b,c){b=this.data.hierarchy[b].keys;for(c=0<=c?c:c+b.length;0<=c;c--)if(b[c].hasTarget(a))return b[c];return b[b.length-1]};THREE.MorphAnimation=function(a){this.mesh=a;this.frames=a.morphTargetInfluences.length;this.currentTime=0;this.duration=1E3;this.loop=!0;this.isPlaying=!1};\nTHREE.MorphAnimation.prototype={play:function(){this.isPlaying=!0},pause:function(){this.isPlaying=!1},update:function(){var a=0,b=0;return function(c){if(!1!==this.isPlaying){this.currentTime+=c;!0===this.loop&&this.currentTime>this.duration&&(this.currentTime%=this.duration);this.currentTime=Math.min(this.currentTime,this.duration);c=this.duration/this.frames;var d=Math.floor(this.currentTime/c);d!=b&&(this.mesh.morphTargetInfluences[a]=0,this.mesh.morphTargetInfluences[b]=1,this.mesh.morphTargetInfluences[d]=\n0,a=b,b=d);this.mesh.morphTargetInfluences[d]=this.currentTime%c/c;this.mesh.morphTargetInfluences[a]=1-this.mesh.morphTargetInfluences[d]}}}()};\nTHREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,p){var v,w=h.widthSegments,u=h.heightSegments,D=e/2,A=f/2,x=h.vertices.length;if(\"x\"===a&&\"y\"===b||\"y\"===a&&\"x\"===b)v=\"z\";else if(\"x\"===a&&\"z\"===b||\"z\"===a&&\"x\"===b)v=\"y\",u=h.depthSegments;else if(\"z\"===a&&\"y\"===b||\"y\"===a&&\"z\"===b)v=\"x\",w=h.depthSegments;var C=w+1,I=u+1,z=e/w,y=f/u,K=new THREE.Vector3;K[v]=0<g?1:-1;for(e=0;e<I;e++)for(f=0;f<C;f++){var N=new THREE.Vector3;N[a]=(f*z-D)*c;N[b]=(e*y-A)*d;N[v]=g;h.vertices.push(N)}for(e=\n0;e<u;e++)for(f=0;f<w;f++)A=f+C*e,a=f+C*(e+1),b=f+1+C*(e+1),c=f+1+C*e,d=new THREE.Vector2(f/w,1-e/u),g=new THREE.Vector2(f/w,1-(e+1)/u),v=new THREE.Vector2((f+1)/w,1-(e+1)/u),D=new THREE.Vector2((f+1)/w,1-e/u),A=new THREE.Face3(A+x,a+x,c+x),A.normal.copy(K),A.vertexNormals.push(K.clone(),K.clone(),K.clone()),A.materialIndex=p,h.faces.push(A),h.faceVertexUvs[0].push([d,g,D]),A=new THREE.Face3(a+x,b+x,c+x),A.normal.copy(K),A.vertexNormals.push(K.clone(),K.clone(),K.clone()),A.materialIndex=p,h.faces.push(A),\nh.faceVertexUvs[0].push([g.clone(),v,D.clone()])}THREE.Geometry.call(this);this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=f||1;var h=this;d=a/2;e=b/2;f=c/2;g(\"z\",\"y\",-1,-1,c,b,d,0);g(\"z\",\"y\",1,-1,c,b,-d,1);g(\"x\",\"z\",1,1,a,c,e,2);g(\"x\",\"z\",1,-1,a,c,-e,3);g(\"x\",\"y\",1,-1,a,b,f,4);g(\"x\",\"y\",-1,-1,a,b,-f,5);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);\nTHREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e,f=[];e=new THREE.Vector3;var g=new THREE.Vector2(.5,.5);this.vertices.push(e);f.push(g);for(e=0;e<=b;e++){var h=new THREE.Vector3,k=c+e/b*d;h.x=a*Math.cos(k);h.y=a*Math.sin(k);this.vertices.push(h);f.push(new THREE.Vector2((h.x/a+1)/2,(h.y/a+1)/2))}c=new THREE.Vector3(0,0,1);for(e=1;e<=\nb;e++)this.faces.push(new THREE.Face3(e,e+1,0,[c.clone(),c.clone(),c.clone()])),this.faceVertexUvs[0].push([f[e].clone(),f[e+1].clone(),g.clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CubeGeometry=function(a,b,c,d,e,f){console.warn(\"THEE.CubeGeometry has been renamed to THREE.BoxGeometry.\");return new THREE.BoxGeometry(a,b,c,d,e,f)};\nTHREE.CylinderGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;f=void 0!==f?f:!1;var g=c/2,h,k,l=[],n=[];for(k=0;k<=e;k++){var q=[],r=[],t=k/e,s=t*(b-a)+a;for(h=0;h<=d;h++){var p=h/d,v=new THREE.Vector3;v.x=s*Math.sin(p*Math.PI*2);v.y=-t*c+g;v.z=s*Math.cos(p*Math.PI*2);this.vertices.push(v);q.push(this.vertices.length-1);r.push(new THREE.Vector2(p,\n1-t))}l.push(q);n.push(r)}c=(b-a)/c;for(h=0;h<d;h++)for(0!==a?(q=this.vertices[l[0][h]].clone(),r=this.vertices[l[0][h+1]].clone()):(q=this.vertices[l[1][h]].clone(),r=this.vertices[l[1][h+1]].clone()),q.setY(Math.sqrt(q.x*q.x+q.z*q.z)*c).normalize(),r.setY(Math.sqrt(r.x*r.x+r.z*r.z)*c).normalize(),k=0;k<e;k++){var t=l[k][h],s=l[k+1][h],p=l[k+1][h+1],v=l[k][h+1],w=q.clone(),u=q.clone(),D=r.clone(),A=r.clone(),x=n[k][h].clone(),C=n[k+1][h].clone(),I=n[k+1][h+1].clone(),z=n[k][h+1].clone();this.faces.push(new THREE.Face3(t,\ns,v,[w,u,A]));this.faceVertexUvs[0].push([x,C,z]);this.faces.push(new THREE.Face3(s,p,v,[u.clone(),D,A.clone()]));this.faceVertexUvs[0].push([C.clone(),I,z.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,g,0)),h=0;h<d;h++)t=l[0][h],s=l[0][h+1],p=this.vertices.length-1,w=new THREE.Vector3(0,1,0),u=new THREE.Vector3(0,1,0),D=new THREE.Vector3(0,1,0),x=n[0][h].clone(),C=n[0][h+1].clone(),I=new THREE.Vector2(C.x,0),this.faces.push(new THREE.Face3(t,s,p,[w,u,D])),this.faceVertexUvs[0].push([x,\nC,I]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-g,0)),h=0;h<d;h++)t=l[k][h+1],s=l[k][h],p=this.vertices.length-1,w=new THREE.Vector3(0,-1,0),u=new THREE.Vector3(0,-1,0),D=new THREE.Vector3(0,-1,0),x=n[k][h+1].clone(),C=n[k][h].clone(),I=new THREE.Vector2(C.x,1),this.faces.push(new THREE.Face3(t,s,p,[w,u,D])),this.faceVertexUvs[0].push([x,C,I]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);\nTHREE.ExtrudeGeometry=function(a,b){\"undefined\"!==typeof a&&(THREE.Geometry.call(this),a=a instanceof Array?a:[a],this.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};\nTHREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.log(\"die\");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=THREE.Math.sign,e=1,e=a.x-b.x,f=a.y-b.y,g=c.x-a.x,h=c.y-a.y,k=e*e+f*f;if(1E-10<Math.abs(e*h-f*g)){var l=Math.sqrt(k),d=Math.sqrt(g*g+h*h),k=b.x-f/l;b=b.y+e/l;g=((c.x-h/d-k)*h-(c.y+g/d-b)*g)/(e*h-f*g);c=k+e*g-a.x;a=b+f*g-a.y;e=c*c+a*a;if(2>=e)return new THREE.Vector2(c,a);e=Math.sqrt(e/2)}else a=!1,1E-10<e?1E-10<g&&(a=!0):-1E-10>e?-1E-10>g&&\n(a=!0):d(f)==d(h)&&(a=!0),a?(c=-f,a=e,e=Math.sqrt(k)):(c=e,a=f,e=Math.sqrt(k/2));return new THREE.Vector2(c/e,a/e)}function e(c,d){var e,f;for(H=c.length;0<=--H;){e=H;f=H-1;0>f&&(f=c.length-1);for(var g=0,h=t+2*n,g=0;g<h;g++){var k=S*g,l=S*(g+1),p=d+e+k,k=d+f+k,q=d+f+l,l=d+e+l,r=c,s=g,v=h,w=e,x=f,p=p+ba,k=k+ba,q=q+ba,l=l+ba;N.faces.push(new THREE.Face3(p,k,l,null,null,u));N.faces.push(new THREE.Face3(k,q,l,null,null,u));p=D.generateSideWallUV(N,a,r,b,p,k,q,l,s,v,w,x);N.faceVertexUvs[0].push([p[0],\np[1],p[3]]);N.faceVertexUvs[0].push([p[1],p[2],p[3]])}}}function f(a,b,c){N.vertices.push(new THREE.Vector3(a,b,c))}function g(c,d,e,f){c+=ba;d+=ba;e+=ba;N.faces.push(new THREE.Face3(c,d,e,null,null,w));c=f?D.generateBottomUV(N,a,b,c,d,e):D.generateTopUV(N,a,b,c,d,e);N.faceVertexUvs[0].push(c)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,l=void 0!==b.bevelSize?b.bevelSize:k-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,q=void 0!==b.bevelEnabled?b.bevelEnabled:\n!0,r=void 0!==b.curveSegments?b.curveSegments:12,t=void 0!==b.steps?b.steps:1,s=b.extrudePath,p,v=!1,w=b.material,u=b.extrudeMaterial,D=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,A,x,C,I;s&&(p=s.getSpacedPoints(t),v=!0,q=!1,A=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(s,t,!1),x=new THREE.Vector3,C=new THREE.Vector3,I=new THREE.Vector3);q||(l=k=n=0);var z,y,K,N=this,ba=this.vertices.length,s=a.extractPoints(r),r=s.shape,P=s.holes;if(s=!THREE.Shape.Utils.isClockWise(r)){r=\nr.reverse();y=0;for(K=P.length;y<K;y++)z=P[y],THREE.Shape.Utils.isClockWise(z)&&(P[y]=z.reverse());s=!1}var O=THREE.Shape.Utils.triangulateShape(r,P),J=r;y=0;for(K=P.length;y<K;y++)z=P[y],r=r.concat(z);var E,Q,L,R,B,S=r.length,V,W=O.length,s=[],H=0;L=J.length;E=L-1;for(Q=H+1;H<L;H++,E++,Q++)E===L&&(E=0),Q===L&&(Q=0),s[H]=d(J[H],J[E],J[Q]);var oa=[],$,X=s.concat();y=0;for(K=P.length;y<K;y++){z=P[y];$=[];H=0;L=z.length;E=L-1;for(Q=H+1;H<L;H++,E++,Q++)E===L&&(E=0),Q===L&&(Q=0),$[H]=d(z[H],z[E],z[Q]);\noa.push($);X=X.concat($)}for(E=0;E<n;E++){L=E/n;R=k*(1-L);Q=l*Math.sin(L*Math.PI/2);H=0;for(L=J.length;H<L;H++)B=c(J[H],s[H],Q),f(B.x,B.y,-R);y=0;for(K=P.length;y<K;y++)for(z=P[y],$=oa[y],H=0,L=z.length;H<L;H++)B=c(z[H],$[H],Q),f(B.x,B.y,-R)}Q=l;for(H=0;H<S;H++)B=q?c(r[H],X[H],Q):r[H],v?(C.copy(A.normals[0]).multiplyScalar(B.x),x.copy(A.binormals[0]).multiplyScalar(B.y),I.copy(p[0]).add(C).add(x),f(I.x,I.y,I.z)):f(B.x,B.y,0);for(L=1;L<=t;L++)for(H=0;H<S;H++)B=q?c(r[H],X[H],Q):r[H],v?(C.copy(A.normals[L]).multiplyScalar(B.x),\nx.copy(A.binormals[L]).multiplyScalar(B.y),I.copy(p[L]).add(C).add(x),f(I.x,I.y,I.z)):f(B.x,B.y,h/t*L);for(E=n-1;0<=E;E--){L=E/n;R=k*(1-L);Q=l*Math.sin(L*Math.PI/2);H=0;for(L=J.length;H<L;H++)B=c(J[H],s[H],Q),f(B.x,B.y,h+R);y=0;for(K=P.length;y<K;y++)for(z=P[y],$=oa[y],H=0,L=z.length;H<L;H++)B=c(z[H],$[H],Q),v?f(B.x,B.y+p[t-1].y,p[t-1].x+R):f(B.x,B.y,h+R)}(function(){if(q){var a;a=0*S;for(H=0;H<W;H++)V=O[H],g(V[2]+a,V[1]+a,V[0]+a,!0);a=t+2*n;a*=S;for(H=0;H<W;H++)V=O[H],g(V[0]+a,V[1]+a,V[2]+a,!1)}else{for(H=\n0;H<W;H++)V=O[H],g(V[2],V[1],V[0],!0);for(H=0;H<W;H++)V=O[H],g(V[0]+S*t,V[1]+S*t,V[2]+S*t,!1)}})();(function(){var a=0;e(J,a);a+=J.length;y=0;for(K=P.length;y<K;y++)z=P[y],e(z,a),a+=z.length})()};\nTHREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d,e,f){b=a.vertices[e].x;e=a.vertices[e].y;c=a.vertices[f].x;f=a.vertices[f].y;return[new THREE.Vector2(a.vertices[d].x,a.vertices[d].y),new THREE.Vector2(b,e),new THREE.Vector2(c,f)]},generateBottomUV:function(a,b,c,d,e,f){return this.generateTopUV(a,b,c,d,e,f)},generateSideWallUV:function(a,b,c,d,e,f,g,h,k,l,n,q){b=a.vertices[e].x;c=a.vertices[e].y;e=a.vertices[e].z;d=a.vertices[f].x;k=a.vertices[f].y;f=a.vertices[f].z;l=a.vertices[g].x;\nn=a.vertices[g].y;g=a.vertices[g].z;q=a.vertices[h].x;var r=a.vertices[h].y;a=a.vertices[h].z;return.01>Math.abs(c-k)?[new THREE.Vector2(b,1-e),new THREE.Vector2(d,1-f),new THREE.Vector2(l,1-g),new THREE.Vector2(q,1-a)]:[new THREE.Vector2(c,1-e),new THREE.Vector2(k,1-f),new THREE.Vector2(n,1-g),new THREE.Vector2(r,1-a)]}};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;THREE.ExtrudeGeometry.__v2=new THREE.Vector2;THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2;\nTHREE.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);!1===a instanceof Array&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};\nTHREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c=b.material,d=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,e,f,g,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var k=e.shape,l=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,f=l.length;e<f;e++)g=l[e],THREE.Shape.Utils.isClockWise(g)&&(l[e]=g.reverse());var n=THREE.Shape.Utils.triangulateShape(k,l);e=0;for(f=l.length;e<f;e++)g=l[e],\nk=k.concat(g);l=k.length;f=n.length;for(e=0;e<l;e++)g=k[e],this.vertices.push(new THREE.Vector3(g.x,g.y,0));for(e=0;e<f;e++)l=n[e],k=l[0]+h,g=l[1]+h,l=l[2]+h,this.faces.push(new THREE.Face3(k,g,l,null,null,c)),this.faceVertexUvs[0].push(d.generateBottomUV(this,a,b,k,g,l))};\nTHREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);b=b||12;c=c||0;d=d||2*Math.PI;for(var e=1/(a.length-1),f=1/b,g=0,h=b;g<=h;g++)for(var k=c+g*f*d,l=Math.cos(k),n=Math.sin(k),k=0,q=a.length;k<q;k++){var r=a[k],t=new THREE.Vector3;t.x=l*r.x-n*r.y;t.y=n*r.x+l*r.y;t.z=r.z;this.vertices.push(t)}c=a.length;g=0;for(h=b;g<h;g++)for(k=0,q=a.length-1;k<q;k++){b=n=k+c*g;d=n+c;var l=n+1+c,n=n+1,r=g*f,t=k*e,s=r+f,p=t+e;this.faces.push(new THREE.Face3(b,d,n));this.faceVertexUvs[0].push([new THREE.Vector2(r,\nt),new THREE.Vector2(s,t),new THREE.Vector2(r,p)]);this.faces.push(new THREE.Face3(d,l,n));this.faceVertexUvs[0].push([new THREE.Vector2(s,t),new THREE.Vector2(s,p),new THREE.Vector2(r,p)])}this.mergeVertices();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);\nTHREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,f=b/2;c=c||1;d=d||1;var g=c+1,h=d+1,k=a/c,l=b/d,n=new THREE.Vector3(0,0,1);for(a=0;a<h;a++){var q=a*l-f;for(b=0;b<g;b++)this.vertices.push(new THREE.Vector3(b*k-e,-q,0))}for(a=0;a<d;a++)for(b=0;b<c;b++){var r=b+g*a,e=b+g*(a+1),f=b+1+g*(a+1),h=b+1+g*a,k=new THREE.Vector2(b/c,1-a/d),l=new THREE.Vector2(b/c,1-(a+1)/d),q=new THREE.Vector2((b+1)/c,1-(a+1)/d),t=new THREE.Vector2((b+\n1)/c,1-a/d),r=new THREE.Face3(r,e,h);r.normal.copy(n);r.vertexNormals.push(n.clone(),n.clone(),n.clone());this.faces.push(r);this.faceVertexUvs[0].push([k,l,t]);r=new THREE.Face3(e,f,h);r.normal.copy(n);r.vertexNormals.push(n.clone(),n.clone(),n.clone());this.faces.push(r);this.faceVertexUvs[0].push([l.clone(),q,t.clone()])}};THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype);\nTHREE.RingGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);a=a||0;b=b||50;e=void 0!==e?e:0;f=void 0!==f?f:2*Math.PI;c=void 0!==c?Math.max(3,c):8;d=void 0!==d?Math.max(1,d):8;var g,h=[],k=a,l=(b-a)/d;for(a=0;a<d+1;a++){for(g=0;g<c+1;g++){var n=new THREE.Vector3,q=e+g/c*f;n.x=k*Math.cos(q);n.y=k*Math.sin(q);this.vertices.push(n);h.push(new THREE.Vector2((n.x/b+1)/2,(n.y/b+1)/2))}k+=l}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*(c+1),g=0;g<c;g++)f=q=g+e,l=q+c+1,n=q+c+2,this.faces.push(new THREE.Face3(f,\nl,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[l].clone(),h[n].clone()]),f=q,l=q+c+2,n=q+1,this.faces.push(new THREE.Face3(f,l,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[l].clone(),h[n].clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,k)};THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype);\nTHREE.SphereGeometry=function(a,b,c,d,e,f,g){THREE.Geometry.call(this);this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};a=a||50;b=Math.max(3,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;f=void 0!==f?f:0;g=void 0!==g?g:Math.PI;var h,k,l=[],n=[];for(k=0;k<=c;k++){var q=[],r=[];for(h=0;h<=b;h++){var t=h/b,s=k/c,p=new THREE.Vector3;p.x=-a*Math.cos(d+t*e)*Math.sin(f+s*g);p.y=a*Math.cos(f+s*g);p.z=\na*Math.sin(d+t*e)*Math.sin(f+s*g);this.vertices.push(p);q.push(this.vertices.length-1);r.push(new THREE.Vector2(t,1-s))}l.push(q);n.push(r)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=l[k][h+1];e=l[k][h];f=l[k+1][h];g=l[k+1][h+1];var q=this.vertices[d].clone().normalize(),r=this.vertices[e].clone().normalize(),t=this.vertices[f].clone().normalize(),s=this.vertices[g].clone().normalize(),p=n[k][h+1].clone(),v=n[k][h].clone(),w=n[k+1][h].clone(),u=n[k+1][h+1].clone();Math.abs(this.vertices[d].y)===a?(p.x=(p.x+\nv.x)/2,this.faces.push(new THREE.Face3(d,f,g,[q,t,s])),this.faceVertexUvs[0].push([p,w,u])):Math.abs(this.vertices[f].y)===a?(w.x=(w.x+u.x)/2,this.faces.push(new THREE.Face3(d,e,f,[q,r,t])),this.faceVertexUvs[0].push([p,v,w])):(this.faces.push(new THREE.Face3(d,e,g,[q,r,s])),this.faceVertexUvs[0].push([p,v,u]),this.faces.push(new THREE.Face3(e,f,g,[r.clone(),t,s.clone()])),this.faceVertexUvs[0].push([v.clone(),w,u.clone()]))}this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,\na)};THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TextGeometry=function(a,b){b=b||{};var c=THREE.FontUtils.generateShapes(a,b);b.amount=void 0!==b.height?b.height:50;void 0===b.bevelThickness&&(b.bevelThickness=10);void 0===b.bevelSize&&(b.bevelSize=8);void 0===b.bevelEnabled&&(b.bevelEnabled=!1);THREE.ExtrudeGeometry.call(this,c,b)};THREE.TextGeometry.prototype=Object.create(THREE.ExtrudeGeometry.prototype);\nTHREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e};a=a||100;b=b||40;c=c||8;d=d||6;e=e||2*Math.PI;for(var f=new THREE.Vector3,g=[],h=[],k=0;k<=c;k++)for(var l=0;l<=d;l++){var n=l/d*e,q=k/c*Math.PI*2;f.x=a*Math.cos(n);f.y=a*Math.sin(n);var r=new THREE.Vector3;r.x=(a+b*Math.cos(q))*Math.cos(n);r.y=(a+b*Math.cos(q))*Math.sin(n);r.z=b*Math.sin(q);this.vertices.push(r);g.push(new THREE.Vector2(l/d,k/c));h.push(r.clone().sub(f).normalize())}for(k=\n1;k<=c;k++)for(l=1;l<=d;l++)a=(d+1)*k+l-1,b=(d+1)*(k-1)+l-1,e=(d+1)*(k-1)+l,f=(d+1)*k+l,n=new THREE.Face3(a,b,f,[h[a].clone(),h[b].clone(),h[f].clone()]),this.faces.push(n),this.faceVertexUvs[0].push([g[a].clone(),g[b].clone(),g[f].clone()]),n=new THREE.Face3(b,e,f,[h[b].clone(),h[e].clone(),h[f].clone()]),this.faces.push(n),this.faceVertexUvs[0].push([g[b].clone(),g[e].clone(),g[f].clone()]);this.computeFaceNormals()};THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype);\nTHREE.TorusKnotGeometry=function(a,b,c,d,e,f,g){function h(a,b,c,d,e){var f=Math.cos(a),g=Math.sin(a);a*=b/c;b=Math.cos(a);f*=d*(2+b)*.5;g=d*(2+b)*g*.5;d=e*d*Math.sin(a)*.5;return new THREE.Vector3(f,g,d)}THREE.Geometry.call(this);this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,p:e,q:f,heightScale:g};a=a||100;b=b||40;c=c||64;d=d||8;e=e||2;f=f||3;g=g||1;for(var k=Array(c),l=new THREE.Vector3,n=new THREE.Vector3,q=new THREE.Vector3,r=0;r<c;++r){k[r]=Array(d);var t=r/c*2*e*Math.PI,\ns=h(t,f,e,a,g),t=h(t+.01,f,e,a,g);l.subVectors(t,s);n.addVectors(t,s);q.crossVectors(l,n);n.crossVectors(q,l);q.normalize();n.normalize();for(t=0;t<d;++t){var p=t/d*2*Math.PI,v=-b*Math.cos(p),p=b*Math.sin(p),w=new THREE.Vector3;w.x=s.x+v*n.x+p*q.x;w.y=s.y+v*n.y+p*q.y;w.z=s.z+v*n.z+p*q.z;k[r][t]=this.vertices.push(w)-1}}for(r=0;r<c;++r)for(t=0;t<d;++t)e=(r+1)%c,f=(t+1)%d,a=k[r][t],b=k[e][t],e=k[e][f],f=k[r][f],g=new THREE.Vector2(r/c,t/d),l=new THREE.Vector2((r+1)/c,t/d),n=new THREE.Vector2((r+1)/\nc,(t+1)/d),q=new THREE.Vector2(r/c,(t+1)/d),this.faces.push(new THREE.Face3(a,b,f)),this.faceVertexUvs[0].push([g,l,q]),this.faces.push(new THREE.Face3(b,e,f)),this.faceVertexUvs[0].push([l.clone(),n,q.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);\nTHREE.TubeGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.parameters={path:a,segments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;var f=[],g,h,k=b+1,l,n,q,r,t=new THREE.Vector3,s,p,v;s=new THREE.TubeGeometry.FrenetFrames(a,b,e);p=s.normals;v=s.binormals;this.tangents=s.tangents;this.normals=p;this.binormals=v;for(s=0;s<k;s++)for(f[s]=[],l=s/(k-1),r=a.getPointAt(l),g=p[s],h=v[s],l=0;l<d;l++)n=l/d*2*Math.PI,q=-c*Math.cos(n),n=c*Math.sin(n),t.copy(r),t.x+=q*g.x+n*\nh.x,t.y+=q*g.y+n*h.y,t.z+=q*g.z+n*h.z,f[s][l]=this.vertices.push(new THREE.Vector3(t.x,t.y,t.z))-1;for(s=0;s<b;s++)for(l=0;l<d;l++)k=e?(s+1)%b:s+1,t=(l+1)%d,a=f[s][l],c=f[k][l],k=f[k][t],t=f[s][t],p=new THREE.Vector2(s/b,l/d),v=new THREE.Vector2((s+1)/b,l/d),g=new THREE.Vector2((s+1)/b,(l+1)/d),h=new THREE.Vector2(s/b,(l+1)/d),this.faces.push(new THREE.Face3(a,c,t)),this.faceVertexUvs[0].push([p,v,h]),this.faces.push(new THREE.Face3(c,k,t)),this.faceVertexUvs[0].push([v.clone(),g,h.clone()]);this.computeFaceNormals();\nthis.computeVertexNormals()};THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype);\nTHREE.TubeGeometry.FrenetFrames=function(a,b,c){new THREE.Vector3;var d=new THREE.Vector3;new THREE.Vector3;var e=[],f=[],g=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var l,n,q;this.tangents=e;this.normals=f;this.binormals=g;for(l=0;l<b;l++)n=l/(b-1),e[l]=a.getTangentAt(n),e[l].normalize();f[0]=new THREE.Vector3;g[0]=new THREE.Vector3;a=Number.MAX_VALUE;l=Math.abs(e[0].x);n=Math.abs(e[0].y);q=Math.abs(e[0].z);l<=a&&(a=l,d.set(1,0,0));n<=a&&(a=n,d.set(0,1,0));q<=a&&d.set(0,0,1);h.crossVectors(e[0],\nd).normalize();f[0].crossVectors(e[0],h);g[0].crossVectors(e[0],f[0]);for(l=1;l<b;l++)f[l]=f[l-1].clone(),g[l]=g[l-1].clone(),h.crossVectors(e[l-1],e[l]),1E-4<h.length()&&(h.normalize(),d=Math.acos(THREE.Math.clamp(e[l-1].dot(e[l]),-1,1)),f[l].applyMatrix4(k.makeRotationAxis(h,d))),g[l].crossVectors(e[l],f[l]);if(c)for(d=Math.acos(THREE.Math.clamp(f[0].dot(f[b-1]),-1,1)),d/=b-1,0<e[0].dot(h.crossVectors(f[0],f[b-1]))&&(d=-d),l=1;l<b;l++)f[l].applyMatrix4(k.makeRotationAxis(e[l],d*l)),g[l].crossVectors(e[l],\nf[l])};\nTHREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clone();b.index=k.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+.5;a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+.5;b.uv=new THREE.Vector2(c,1-a);return b}function f(a,b,c){var d=new THREE.Face3(a.index,b.index,c.index,[a.clone(),b.clone(),c.clone()]);k.faces.push(d);v.copy(a).add(b).add(c).divideScalar(3);d=Math.atan2(v.z,-v.x);k.faceVertexUvs[0].push([h(a.uv,a,d),h(b.uv,b,d),h(c.uv,c,d)])}function g(a,b){var c=\nMath.pow(2,b);Math.pow(4,b);for(var d=e(k.vertices[a.a]),g=e(k.vertices[a.b]),h=e(k.vertices[a.c]),l=[],n=0;n<=c;n++){l[n]=[];for(var p=e(d.clone().lerp(h,n/c)),q=e(g.clone().lerp(h,n/c)),r=c-n,s=0;s<=r;s++)l[n][s]=0==s&&n==c?p:e(p.clone().lerp(q,s/r))}for(n=0;n<c;n++)for(s=0;s<2*(c-n)-1;s++)d=Math.floor(s/2),0==s%2?f(l[n][d+1],l[n+1][d],l[n][d]):f(l[n][d+1],l[n+1][d+1],l[n+1][d])}function h(a,b,c){0>c&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/Math.PI+.5,\na.y));return a.clone()}THREE.Geometry.call(this);c=c||1;d=d||0;for(var k=this,l=0,n=a.length;l<n;l+=3)e(new THREE.Vector3(a[l],a[l+1],a[l+2]));a=this.vertices;for(var q=[],r=l=0,n=b.length;l<n;l+=3,r++){var t=a[b[l]],s=a[b[l+1]],p=a[b[l+2]];q[r]=new THREE.Face3(t.index,s.index,p.index,[t.clone(),s.clone(),p.clone()])}for(var v=new THREE.Vector3,l=0,n=q.length;l<n;l++)g(q[l],d);l=0;for(n=this.faceVertexUvs[0].length;l<n;l++)b=this.faceVertexUvs[0][l],d=b[0].x,a=b[1].x,q=b[2].x,r=Math.max(d,Math.max(a,\nq)),t=Math.min(d,Math.min(a,q)),.9<r&&.1>t&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>q&&(b[2].x+=1));l=0;for(n=this.vertices.length;l<n;l++)this.vertices[l].multiplyScalar(c);this.mergeVertices();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)};THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype);\nTHREE.IcosahedronGeometry=function(a,b){this.parameters={radius:a,detail:b};var c=(1+Math.sqrt(5))/2;THREE.PolyhedronGeometry.call(this,[-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],a,b)};THREE.IcosahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);\nTHREE.OctahedronGeometry=function(a,b){this.parameters={radius:a,detail:b};THREE.PolyhedronGeometry.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b)};THREE.OctahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TetrahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b)};THREE.TetrahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);\nTHREE.ParametricGeometry=function(a,b,c){THREE.Geometry.call(this);var d=this.vertices,e=this.faces,f=this.faceVertexUvs[0],g,h,k,l,n=b+1;for(g=0;g<=c;g++)for(l=g/c,h=0;h<=b;h++)k=h/b,k=a(k,l),d.push(k);var q,r,t,s;for(g=0;g<c;g++)for(h=0;h<b;h++)a=g*n+h,d=g*n+h+1,l=(g+1)*n+h+1,k=(g+1)*n+h,q=new THREE.Vector2(h/b,g/c),r=new THREE.Vector2((h+1)/b,g/c),t=new THREE.Vector2((h+1)/b,(g+1)/c),s=new THREE.Vector2(h/b,(g+1)/c),e.push(new THREE.Face3(a,d,k)),f.push([q,r,s]),e.push(new THREE.Face3(d,l,k)),\nf.push([r.clone(),t,s.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);\nTHREE.AxisHelper=function(a){a=a||1;var b=new Float32Array([0,0,0,a,0,0,0,0,0,0,a,0,0,0,0,0,0,a]),c=new Float32Array([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1]);a=new THREE.BufferGeometry;a.addAttribute(\"position\",new THREE.BufferAttribute(b,3));a.addAttribute(\"color\",new THREE.BufferAttribute(c,3));b=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});THREE.Line.call(this,a,b,THREE.LinePieces)};THREE.AxisHelper.prototype=Object.create(THREE.Line.prototype);\nTHREE.ArrowHelper=function(){var a=new THREE.Geometry;a.vertices.push(new THREE.Vector3(0,0,0),new THREE.Vector3(0,1,0));var b=new THREE.CylinderGeometry(0,.5,1,5,1);b.applyMatrix((new THREE.Matrix4).makeTranslation(0,-.5,0));return function(c,d,e,f,g,h){THREE.Object3D.call(this);void 0===f&&(f=16776960);void 0===e&&(e=1);void 0===g&&(g=.2*e);void 0===h&&(h=.2*g);this.position.copy(d);this.line=new THREE.Line(a,new THREE.LineBasicMaterial({color:f}));this.line.matrixAutoUpdate=!1;this.add(this.line);\nthis.cone=new THREE.Mesh(b,new THREE.MeshBasicMaterial({color:f}));this.cone.matrixAutoUpdate=!1;this.add(this.cone);this.setDirection(c);this.setLength(e,g,h)}}();THREE.ArrowHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.ArrowHelper.prototype.setDirection=function(){var a=new THREE.Vector3,b;return function(c){.99999<c.y?this.quaternion.set(0,0,0,1):-.99999>c.y?this.quaternion.set(1,0,0,0):(a.set(c.z,0,-c.x).normalize(),b=Math.acos(c.y),this.quaternion.setFromAxisAngle(a,b))}}();\nTHREE.ArrowHelper.prototype.setLength=function(a,b,c){void 0===b&&(b=.2*a);void 0===c&&(c=.2*b);this.line.scale.set(1,a,1);this.line.updateMatrix();this.cone.scale.set(c,b,c);this.cone.position.y=a;this.cone.updateMatrix()};THREE.ArrowHelper.prototype.setColor=function(a){this.line.material.color.set(a);this.cone.material.color.set(a)};\nTHREE.BoxHelper=function(a){var b=new THREE.BufferGeometry;b.addAttribute(\"position\",new THREE.BufferAttribute(new Float32Array(72),3));THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:16776960}),THREE.LinePieces);void 0!==a&&this.update(a)};THREE.BoxHelper.prototype=Object.create(THREE.Line.prototype);\nTHREE.BoxHelper.prototype.update=function(a){var b=a.geometry;null===b.boundingBox&&b.computeBoundingBox();var c=b.boundingBox.min,b=b.boundingBox.max,d=this.geometry.attributes.position.array;d[0]=b.x;d[1]=b.y;d[2]=b.z;d[3]=c.x;d[4]=b.y;d[5]=b.z;d[6]=c.x;d[7]=b.y;d[8]=b.z;d[9]=c.x;d[10]=c.y;d[11]=b.z;d[12]=c.x;d[13]=c.y;d[14]=b.z;d[15]=b.x;d[16]=c.y;d[17]=b.z;d[18]=b.x;d[19]=c.y;d[20]=b.z;d[21]=b.x;d[22]=b.y;d[23]=b.z;d[24]=b.x;d[25]=b.y;d[26]=c.z;d[27]=c.x;d[28]=b.y;d[29]=c.z;d[30]=c.x;d[31]=b.y;\nd[32]=c.z;d[33]=c.x;d[34]=c.y;d[35]=c.z;d[36]=c.x;d[37]=c.y;d[38]=c.z;d[39]=b.x;d[40]=c.y;d[41]=c.z;d[42]=b.x;d[43]=c.y;d[44]=c.z;d[45]=b.x;d[46]=b.y;d[47]=c.z;d[48]=b.x;d[49]=b.y;d[50]=b.z;d[51]=b.x;d[52]=b.y;d[53]=c.z;d[54]=c.x;d[55]=b.y;d[56]=b.z;d[57]=c.x;d[58]=b.y;d[59]=c.z;d[60]=c.x;d[61]=c.y;d[62]=b.z;d[63]=c.x;d[64]=c.y;d[65]=c.z;d[66]=b.x;d[67]=c.y;d[68]=b.z;d[69]=b.x;d[70]=c.y;d[71]=c.z;this.geometry.attributes.position.needsUpdate=!0;this.geometry.computeBoundingSphere();this.matrixAutoUpdate=\n!1;this.matrixWorld=a.matrixWorld};THREE.BoundingBoxHelper=function(a,b){var c=void 0!==b?b:8947848;this.object=a;this.box=new THREE.Box3;THREE.Mesh.call(this,new THREE.BoxGeometry(1,1,1),new THREE.MeshBasicMaterial({color:c,wireframe:!0}))};THREE.BoundingBoxHelper.prototype=Object.create(THREE.Mesh.prototype);THREE.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object);this.box.size(this.scale);this.box.center(this.position)};\nTHREE.CameraHelper=function(a){function b(a,b,d){c(a,d);c(b,d)}function c(a,b){d.vertices.push(new THREE.Vector3);d.colors.push(new THREE.Color(b));void 0===f[a]&&(f[a]=[]);f[a].push(d.vertices.length-1)}var d=new THREE.Geometry,e=new THREE.LineBasicMaterial({color:16777215,vertexColors:THREE.FaceColors}),f={};b(\"n1\",\"n2\",16755200);b(\"n2\",\"n4\",16755200);b(\"n4\",\"n3\",16755200);b(\"n3\",\"n1\",16755200);b(\"f1\",\"f2\",16755200);b(\"f2\",\"f4\",16755200);b(\"f4\",\"f3\",16755200);b(\"f3\",\"f1\",16755200);b(\"n1\",\"f1\",16755200);\nb(\"n2\",\"f2\",16755200);b(\"n3\",\"f3\",16755200);b(\"n4\",\"f4\",16755200);b(\"p\",\"n1\",16711680);b(\"p\",\"n2\",16711680);b(\"p\",\"n3\",16711680);b(\"p\",\"n4\",16711680);b(\"u1\",\"u2\",43775);b(\"u2\",\"u3\",43775);b(\"u3\",\"u1\",43775);b(\"c\",\"t\",16777215);b(\"p\",\"c\",3355443);b(\"cn1\",\"cn2\",3355443);b(\"cn3\",\"cn4\",3355443);b(\"cf1\",\"cf2\",3355443);b(\"cf3\",\"cf4\",3355443);THREE.Line.call(this,d,e,THREE.LinePieces);this.camera=a;this.matrixWorld=a.matrixWorld;this.matrixAutoUpdate=!1;this.pointMap=f;this.update()};\nTHREE.CameraHelper.prototype=Object.create(THREE.Line.prototype);\nTHREE.CameraHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Camera,c=new THREE.Projector;return function(){function d(d,g,h,k){a.set(g,h,k);c.unprojectVector(a,b);d=e.pointMap[d];if(void 0!==d)for(g=0,h=d.length;g<h;g++)e.geometry.vertices[d[g]].copy(a)}var e=this;b.projectionMatrix.copy(this.camera.projectionMatrix);d(\"c\",0,0,-1);d(\"t\",0,0,1);d(\"n1\",-1,-1,-1);d(\"n2\",1,-1,-1);d(\"n3\",-1,1,-1);d(\"n4\",1,1,-1);d(\"f1\",-1,-1,1);d(\"f2\",1,-1,1);d(\"f3\",-1,1,1);d(\"f4\",1,1,1);d(\"u1\",.7,\n1.1,-1);d(\"u2\",-.7,1.1,-1);d(\"u3\",0,2,-1);d(\"cf1\",-1,0,1);d(\"cf2\",1,0,1);d(\"cf3\",0,-1,1);d(\"cf4\",0,1,1);d(\"cn1\",-1,0,-1);d(\"cn2\",1,0,-1);d(\"cn3\",0,-1,-1);d(\"cn4\",0,1,-1);this.geometry.verticesNeedUpdate=!0}}();\nTHREE.DirectionalLightHelper=function(a,b){THREE.Object3D.call(this);this.light=a;this.light.updateMatrixWorld();this.matrixWorld=a.matrixWorld;this.matrixAutoUpdate=!1;b=b||1;var c=new THREE.Geometry;c.vertices.push(new THREE.Vector3(-b,b,0),new THREE.Vector3(b,b,0),new THREE.Vector3(b,-b,0),new THREE.Vector3(-b,-b,0),new THREE.Vector3(-b,b,0));var d=new THREE.LineBasicMaterial({fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.lightPlane=new THREE.Line(c,d);this.add(this.lightPlane);\nc=new THREE.Geometry;c.vertices.push(new THREE.Vector3,new THREE.Vector3);d=new THREE.LineBasicMaterial({fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine=new THREE.Line(c,d);this.add(this.targetLine);this.update()};THREE.DirectionalLightHelper.prototype=Object.create(THREE.Object3D.prototype);\nTHREE.DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geometry.dispose();this.lightPlane.material.dispose();this.targetLine.geometry.dispose();this.targetLine.material.dispose()};\nTHREE.DirectionalLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(){a.setFromMatrixPosition(this.light.matrixWorld);b.setFromMatrixPosition(this.light.target.matrixWorld);c.subVectors(b,a);this.lightPlane.lookAt(c);this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine.geometry.vertices[1].copy(c);this.targetLine.geometry.verticesNeedUpdate=!0;this.targetLine.material.color.copy(this.lightPlane.material.color)}}();\nTHREE.EdgesHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},f=function(a,b){return a-b},g=[\"a\",\"b\",\"c\"],h=new THREE.BufferGeometry,k=a.geometry.clone();k.mergeVertices();k.computeFaceNormals();for(var l=k.vertices,k=k.faces,n=0,q=0,r=k.length;q<r;q++)for(var t=k[q],s=0;3>s;s++){d[0]=t[g[s]];d[1]=t[g[(s+1)%3]];d.sort(f);var p=d.toString();void 0===e[p]?(e[p]={vert1:d[0],vert2:d[1],face1:q,face2:void 0},n++):e[p].face2=q}h.addAttribute(\"position\",new THREE.Float32Attribute(6*n,3));d=h.attributes.position.array;\nf=0;for(p in e)if(g=e[p],void 0===g.face2||.9999>k[g.face1].normal.dot(k[g.face2].normal))n=l[g.vert1],d[f++]=n.x,d[f++]=n.y,d[f++]=n.z,n=l[g.vert2],d[f++]=n.x,d[f++]=n.y,d[f++]=n.z;THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.matrixWorld=a.matrixWorld};THREE.EdgesHelper.prototype=Object.create(THREE.Line.prototype);\nTHREE.FaceNormalsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;a=void 0!==c?c:16776960;d=void 0!==d?d:1;b=new THREE.Geometry;c=0;for(var e=this.object.geometry.faces.length;c<e;c++)b.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:a,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.normalMatrix=new THREE.Matrix3;this.update()};THREE.FaceNormalsHelper.prototype=Object.create(THREE.Line.prototype);\nTHREE.FaceNormalsHelper.prototype.update=function(){var a=this.geometry.vertices,b=this.object,c=b.geometry.vertices,d=b.geometry.faces,e=b.matrixWorld;b.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(e);for(var f=b=0,g=d.length;b<g;b++,f+=2){var h=d[b];a[f].copy(c[h.a]).add(c[h.b]).add(c[h.c]).divideScalar(3).applyMatrix4(e);a[f+1].copy(h.normal).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size).add(a[f])}this.geometry.verticesNeedUpdate=!0;return this};\nTHREE.GridHelper=function(a,b){var c=new THREE.Geometry,d=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});this.color1=new THREE.Color(4473924);this.color2=new THREE.Color(8947848);for(var e=-a;e<=a;e+=b){c.vertices.push(new THREE.Vector3(-a,0,e),new THREE.Vector3(a,0,e),new THREE.Vector3(e,0,-a),new THREE.Vector3(e,0,a));var f=0===e?this.color1:this.color2;c.colors.push(f,f,f,f)}THREE.Line.call(this,c,d,THREE.LinePieces)};THREE.GridHelper.prototype=Object.create(THREE.Line.prototype);\nTHREE.GridHelper.prototype.setColors=function(a,b){this.color1.set(a);this.color2.set(b);this.geometry.colorsNeedUpdate=!0};\nTHREE.HemisphereLightHelper=function(a,b,c,d){THREE.Object3D.call(this);this.light=a;this.light.updateMatrixWorld();this.matrixWorld=a.matrixWorld;this.matrixAutoUpdate=!1;this.colors=[new THREE.Color,new THREE.Color];a=new THREE.SphereGeometry(b,4,2);a.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));for(b=0;8>b;b++)a.faces[b].color=this.colors[4>b?0:1];b=new THREE.MeshBasicMaterial({vertexColors:THREE.FaceColors,wireframe:!0});this.lightSphere=new THREE.Mesh(a,b);this.add(this.lightSphere);\nthis.update()};THREE.HemisphereLightHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.HemisphereLightHelper.prototype.dispose=function(){this.lightSphere.geometry.dispose();this.lightSphere.material.dispose()};\nTHREE.HemisphereLightHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity);this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity);this.lightSphere.lookAt(a.setFromMatrixPosition(this.light.matrixWorld).negate());this.lightSphere.geometry.colorsNeedUpdate=!0}}();\nTHREE.PointLightHelper=function(a,b){this.light=a;this.light.updateMatrixWorld();var c=new THREE.SphereGeometry(b,4,2),d=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);THREE.Mesh.call(this,c,d);this.matrixWorld=this.light.matrixWorld;this.matrixAutoUpdate=!1};THREE.PointLightHelper.prototype=Object.create(THREE.Mesh.prototype);THREE.PointLightHelper.prototype.dispose=function(){this.geometry.dispose();this.material.dispose()};\nTHREE.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)};\nTHREE.SkeletonHelper=function(a){this.bones=this.getBoneList(a);for(var b=new THREE.Geometry,c=0;c<this.bones.length;c++)this.bones[c].parent instanceof THREE.Bone&&(b.vertices.push(new THREE.Vector3),b.vertices.push(new THREE.Vector3),b.colors.push(new THREE.Color(0,0,1)),b.colors.push(new THREE.Color(0,1,0)));c=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors,depthTest:!1,depthWrite:!1,transparent:!0});THREE.Line.call(this,b,c,THREE.LinePieces);this.root=a;this.matrixWorld=a.matrixWorld;\nthis.matrixAutoUpdate=!1;this.update()};THREE.SkeletonHelper.prototype=Object.create(THREE.Line.prototype);THREE.SkeletonHelper.prototype.getBoneList=function(a){var b=[];a instanceof THREE.Bone&&b.push(a);for(var c=0;c<a.children.length;c++)b.push.apply(b,this.getBoneList(a.children[c]));return b};\nTHREE.SkeletonHelper.prototype.update=function(){for(var a=this.geometry,b=(new THREE.Matrix4).getInverse(this.root.matrixWorld),c=new THREE.Matrix4,d=0,e=0;e<this.bones.length;e++){var f=this.bones[e];f.parent instanceof THREE.Bone&&(c.multiplyMatrices(b,f.matrixWorld),a.vertices[d].setFromMatrixPosition(c),c.multiplyMatrices(b,f.parent.matrixWorld),a.vertices[d+1].setFromMatrixPosition(c),d+=2)}a.verticesNeedUpdate=!0;a.computeBoundingSphere()};\nTHREE.SpotLightHelper=function(a){THREE.Object3D.call(this);this.light=a;this.light.updateMatrixWorld();this.matrixWorld=a.matrixWorld;this.matrixAutoUpdate=!1;a=new THREE.CylinderGeometry(0,1,1,8,1,!0);a.applyMatrix((new THREE.Matrix4).makeTranslation(0,-.5,0));a.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));var b=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});this.cone=new THREE.Mesh(a,b);this.add(this.cone);this.update()};THREE.SpotLightHelper.prototype=Object.create(THREE.Object3D.prototype);\nTHREE.SpotLightHelper.prototype.dispose=function(){this.cone.geometry.dispose();this.cone.material.dispose()};THREE.SpotLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){var c=this.light.distance?this.light.distance:1E4,d=c*Math.tan(this.light.angle);this.cone.scale.set(d,d,c);a.setFromMatrixPosition(this.light.matrixWorld);b.setFromMatrixPosition(this.light.target.matrixWorld);this.cone.lookAt(b.sub(a));this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}();\nTHREE.VertexNormalsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;b=void 0!==c?c:16711680;d=void 0!==d?d:1;c=new THREE.Geometry;a=a.geometry.faces;for(var e=0,f=a.length;e<f;e++)for(var g=0,h=a[e].vertexNormals.length;g<h;g++)c.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.normalMatrix=new THREE.Matrix3;this.update()};THREE.VertexNormalsHelper.prototype=Object.create(THREE.Line.prototype);\nTHREE.VertexNormalsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=[\"a\",\"b\",\"c\",\"d\"];this.object.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,f=this.object.geometry.faces,g=this.object.matrixWorld,h=0,k=0,l=f.length;k<l;k++)for(var n=f[k],q=0,r=n.vertexNormals.length;q<r;q++){var t=n.vertexNormals[q];d[h].copy(e[n[a[q]]]).applyMatrix4(g);b.copy(t).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size);\nb.add(d[h]);h+=1;d[h].copy(b);h+=1}this.geometry.verticesNeedUpdate=!0;return this}}();\nTHREE.VertexTangentsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;b=void 0!==c?c:255;d=void 0!==d?d:1;c=new THREE.Geometry;a=a.geometry.faces;for(var e=0,f=a.length;e<f;e++)for(var g=0,h=a[e].vertexTangents.length;g<h;g++)c.vertices.push(new THREE.Vector3),c.vertices.push(new THREE.Vector3);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.update()};THREE.VertexTangentsHelper.prototype=Object.create(THREE.Line.prototype);\nTHREE.VertexTangentsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=[\"a\",\"b\",\"c\",\"d\"];this.object.updateMatrixWorld(!0);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,f=this.object.geometry.faces,g=this.object.matrixWorld,h=0,k=0,l=f.length;k<l;k++)for(var n=f[k],q=0,r=n.vertexTangents.length;q<r;q++){var t=n.vertexTangents[q];d[h].copy(e[n[a[q]]]).applyMatrix4(g);b.copy(t).transformDirection(g).multiplyScalar(this.size);b.add(d[h]);h+=1;d[h].copy(b);\nh+=1}this.geometry.verticesNeedUpdate=!0;return this}}();\nTHREE.WireframeHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},f=function(a,b){return a-b},g=[\"a\",\"b\",\"c\"],h=new THREE.BufferGeometry;if(a.geometry instanceof THREE.Geometry){for(var k=a.geometry.vertices,l=a.geometry.faces,n=0,q=new Uint32Array(6*l.length),r=0,t=l.length;r<t;r++)for(var s=l[r],p=0;3>p;p++){d[0]=s[g[p]];d[1]=s[g[(p+1)%3]];d.sort(f);var v=d.toString();void 0===e[v]&&(q[2*n]=d[0],q[2*n+1]=d[1],e[v]=!0,n++)}d=new Float32Array(6*n);r=0;for(t=n;r<t;r++)for(p=0;2>p;p++)n=\nk[q[2*r+p]],g=6*r+3*p,d[g+0]=n.x,d[g+1]=n.y,d[g+2]=n.z;h.addAttribute(\"position\",new THREE.BufferAttribute(d,3))}else if(a.geometry instanceof THREE.BufferGeometry){if(void 0!==a.geometry.attributes.index){for(var k=a.geometry.attributes.position.array,t=a.geometry.attributes.index.array,l=a.geometry.offsets,n=0,q=new Uint32Array(2*t.length),s=0,w=l.length;s<w;++s)for(var p=l[s].start,v=l[s].count,g=l[s].index,r=p,u=p+v;r<u;r+=3)for(p=0;3>p;p++)d[0]=g+t[r+p],d[1]=g+t[r+(p+1)%3],d.sort(f),v=d.toString(),\nvoid 0===e[v]&&(q[2*n]=d[0],q[2*n+1]=d[1],e[v]=!0,n++);d=new Float32Array(6*n);r=0;for(t=n;r<t;r++)for(p=0;2>p;p++)g=6*r+3*p,n=3*q[2*r+p],d[g+0]=k[n],d[g+1]=k[n+1],d[g+2]=k[n+2]}else for(k=a.geometry.attributes.position.array,n=k.length/3,q=n/3,d=new Float32Array(6*n),r=0,t=q;r<t;r++)for(p=0;3>p;p++)g=18*r+6*p,q=9*r+3*p,d[g+0]=k[q],d[g+1]=k[q+1],d[g+2]=k[q+2],n=9*r+(p+1)%3*3,d[g+3]=k[n],d[g+4]=k[n+1],d[g+5]=k[n+2];h.addAttribute(\"position\",new THREE.BufferAttribute(d,3))}THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),\nTHREE.LinePieces);this.matrixAutoUpdate=!1;this.matrixWorld=a.matrixWorld};THREE.WireframeHelper.prototype=Object.create(THREE.Line.prototype);THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this);this.render=function(a){}};THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype);THREE.LensFlare=function(a,b,c,d,e){THREE.Object3D.call(this);this.lensFlares=[];this.positionScreen=new THREE.Vector3;this.customUpdateCallback=void 0;void 0!==a&&this.add(a,b,c,d,e)};\nTHREE.LensFlare.prototype=Object.create(THREE.Object3D.prototype);THREE.LensFlare.prototype.add=function(a,b,c,d,e,f){void 0===b&&(b=-1);void 0===c&&(c=0);void 0===f&&(f=1);void 0===e&&(e=new THREE.Color(16777215));void 0===d&&(d=THREE.NormalBlending);c=Math.min(c,Math.max(0,c));this.lensFlares.push({texture:a,size:b,distance:c,x:0,y:0,z:0,scale:1,rotation:1,opacity:f,color:e,blending:d})};\nTHREE.LensFlare.prototype.updateLensFlares=function(){var a,b=this.lensFlares.length,c,d=2*-this.positionScreen.x,e=2*-this.positionScreen.y;for(a=0;a<b;a++)c=this.lensFlares[a],c.x=this.positionScreen.x+d*c.distance,c.y=this.positionScreen.y+e*c.distance,c.wantedRotation=c.x*Math.PI*.25,c.rotation+=.25*(c.wantedRotation-c.rotation)};\nTHREE.MorphBlendMesh=function(a,b){THREE.Mesh.call(this,a,b);this.animationsMap={};this.animationsList=[];var c=this.geometry.morphTargets.length;this.createAnimation(\"__default\",0,c-1,c/1);this.setAnimationWeight(\"__default\",1)};THREE.MorphBlendMesh.prototype=Object.create(THREE.Mesh.prototype);\nTHREE.MorphBlendMesh.prototype.createAnimation=function(a,b,c,d){b={startFrame:b,endFrame:c,length:c-b+1,fps:d,duration:(c-b)/d,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1};this.animationsMap[a]=b;this.animationsList.push(b)};\nTHREE.MorphBlendMesh.prototype.autoCreateAnimations=function(a){for(var b=/([a-z]+)_?(\\d+)/,c,d={},e=this.geometry,f=0,g=e.morphTargets.length;f<g;f++){var h=e.morphTargets[f].name.match(b);if(h&&1<h.length){var k=h[1];d[k]||(d[k]={start:Infinity,end:-Infinity});h=d[k];f<h.start&&(h.start=f);f>h.end&&(h.end=f);c||(c=k)}}for(k in d)h=d[k],this.createAnimation(k,h.start,h.end,a);this.firstAnimation=c};\nTHREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(a){if(a=this.animationsMap[a])a.direction=1,a.directionBackwards=!1};THREE.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(a){if(a=this.animationsMap[a])a.direction=-1,a.directionBackwards=!0};THREE.MorphBlendMesh.prototype.setAnimationFPS=function(a,b){var c=this.animationsMap[a];c&&(c.fps=b,c.duration=(c.end-c.start)/c.fps)};\nTHREE.MorphBlendMesh.prototype.setAnimationDuration=function(a,b){var c=this.animationsMap[a];c&&(c.duration=b,c.fps=(c.end-c.start)/c.duration)};THREE.MorphBlendMesh.prototype.setAnimationWeight=function(a,b){var c=this.animationsMap[a];c&&(c.weight=b)};THREE.MorphBlendMesh.prototype.setAnimationTime=function(a,b){var c=this.animationsMap[a];c&&(c.time=b)};THREE.MorphBlendMesh.prototype.getAnimationTime=function(a){var b=0;if(a=this.animationsMap[a])b=a.time;return b};\nTHREE.MorphBlendMesh.prototype.getAnimationDuration=function(a){var b=-1;if(a=this.animationsMap[a])b=a.duration;return b};THREE.MorphBlendMesh.prototype.playAnimation=function(a){var b=this.animationsMap[a];b?(b.time=0,b.active=!0):console.warn(\"animation[\"+a+\"] undefined\")};THREE.MorphBlendMesh.prototype.stopAnimation=function(a){if(a=this.animationsMap[a])a.active=!1};\nTHREE.MorphBlendMesh.prototype.update=function(a){for(var b=0,c=this.animationsList.length;b<c;b++){var d=this.animationsList[b];if(d.active){var e=d.duration/d.length;d.time+=d.direction*a;if(d.mirroredLoop){if(d.time>d.duration||0>d.time)d.direction*=-1,d.time>d.duration&&(d.time=d.duration,d.directionBackwards=!0),0>d.time&&(d.time=0,d.directionBackwards=!1)}else d.time%=d.duration,0>d.time&&(d.time+=d.duration);var f=d.startFrame+THREE.Math.clamp(Math.floor(d.time/e),0,d.length-1),g=d.weight;\nf!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*g,this.morphTargetInfluences[f]=0,d.lastFrame=d.currentFrame,d.currentFrame=f);e=d.time%e/e;d.directionBackwards&&(e=1-e);this.morphTargetInfluences[d.currentFrame]=e*g;this.morphTargetInfluences[d.lastFrame]=(1-e)*g}}};\nTHREE.LensFlarePlugin=function(){function a(a,b){var d=c.createProgram(),e=c.createShader(c.FRAGMENT_SHADER),f=c.createShader(c.VERTEX_SHADER),g=\"precision \"+b+\" float;\\n\";c.shaderSource(e,g+a.fragmentShader);c.shaderSource(f,g+a.vertexShader);c.compileShader(e);c.compileShader(f);c.attachShader(d,e);c.attachShader(d,f);c.linkProgram(d);return d}var b=[],c,d,e,f,g,h,k,l,n,q,r,t,s;this.init=function(b){c=b.context;d=b;e=b.getPrecision();f=new Float32Array(16);g=new Uint16Array(6);b=0;f[b++]=-1;f[b++]=\n-1;f[b++]=0;f[b++]=0;f[b++]=1;f[b++]=-1;f[b++]=1;f[b++]=0;f[b++]=1;f[b++]=1;f[b++]=1;f[b++]=1;f[b++]=-1;f[b++]=1;f[b++]=0;f[b++]=1;b=0;g[b++]=0;g[b++]=1;g[b++]=2;g[b++]=0;g[b++]=2;g[b++]=3;h=c.createBuffer();k=c.createBuffer();c.bindBuffer(c.ARRAY_BUFFER,h);c.bufferData(c.ARRAY_BUFFER,f,c.STATIC_DRAW);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,k);c.bufferData(c.ELEMENT_ARRAY_BUFFER,g,c.STATIC_DRAW);l=c.createTexture();n=c.createTexture();c.bindTexture(c.TEXTURE_2D,l);c.texImage2D(c.TEXTURE_2D,0,c.RGB,16,\n16,0,c.RGB,c.UNSIGNED_BYTE,null);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.NEAREST);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.NEAREST);c.bindTexture(c.TEXTURE_2D,n);c.texImage2D(c.TEXTURE_2D,0,c.RGBA,16,16,0,c.RGBA,c.UNSIGNED_BYTE,null);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE);\nc.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.NEAREST);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.NEAREST);0>=c.getParameter(c.MAX_VERTEX_TEXTURE_IMAGE_UNITS)?(q=!1,r=a(THREE.ShaderFlares.lensFlare,e)):(q=!0,r=a(THREE.ShaderFlares.lensFlareVertexTexture,e));t={};s={};t.vertex=c.getAttribLocation(r,\"position\");t.uv=c.getAttribLocation(r,\"uv\");s.renderType=c.getUniformLocation(r,\"renderType\");s.map=c.getUniformLocation(r,\"map\");s.occlusionMap=c.getUniformLocation(r,\"occlusionMap\");s.opacity=\nc.getUniformLocation(r,\"opacity\");s.color=c.getUniformLocation(r,\"color\");s.scale=c.getUniformLocation(r,\"scale\");s.rotation=c.getUniformLocation(r,\"rotation\");s.screenPosition=c.getUniformLocation(r,\"screenPosition\")};this.render=function(a,e,f,g){b.length=0;a.traverseVisible(function(a){a instanceof THREE.LensFlare&&b.push(a)});if(0!==b.length){a=new THREE.Vector3;var D=g/f,A=.5*f,x=.5*g,C=16/g,I=new THREE.Vector2(C*D,C),z=new THREE.Vector3(1,1,0),y=new THREE.Vector2(1,1),K=s,C=t;c.useProgram(r);\nc.enableVertexAttribArray(t.vertex);c.enableVertexAttribArray(t.uv);c.uniform1i(K.occlusionMap,0);c.uniform1i(K.map,1);c.bindBuffer(c.ARRAY_BUFFER,h);c.vertexAttribPointer(C.vertex,2,c.FLOAT,!1,16,0);c.vertexAttribPointer(C.uv,2,c.FLOAT,!1,16,8);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,k);c.disable(c.CULL_FACE);c.depthMask(!1);for(var N=0,ba=b.length;N<ba;N++){C=16/g;I.set(C*D,C);var P=b[N];a.set(P.matrixWorld.elements[12],P.matrixWorld.elements[13],P.matrixWorld.elements[14]);a.applyMatrix4(e.matrixWorldInverse);\na.applyProjection(e.projectionMatrix);z.copy(a);y.x=z.x*A+A;y.y=z.y*x+x;if(q||0<y.x&&y.x<f&&0<y.y&&y.y<g){c.activeTexture(c.TEXTURE1);c.bindTexture(c.TEXTURE_2D,l);c.copyTexImage2D(c.TEXTURE_2D,0,c.RGB,y.x-8,y.y-8,16,16,0);c.uniform1i(K.renderType,0);c.uniform2f(K.scale,I.x,I.y);c.uniform3f(K.screenPosition,z.x,z.y,z.z);c.disable(c.BLEND);c.enable(c.DEPTH_TEST);c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0);c.activeTexture(c.TEXTURE0);c.bindTexture(c.TEXTURE_2D,n);c.copyTexImage2D(c.TEXTURE_2D,\n0,c.RGBA,y.x-8,y.y-8,16,16,0);c.uniform1i(K.renderType,1);c.disable(c.DEPTH_TEST);c.activeTexture(c.TEXTURE1);c.bindTexture(c.TEXTURE_2D,l);c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0);P.positionScreen.copy(z);P.customUpdateCallback?P.customUpdateCallback(P):P.updateLensFlares();c.uniform1i(K.renderType,2);c.enable(c.BLEND);for(var O=0,J=P.lensFlares.length;O<J;O++){var E=P.lensFlares[O];.001<E.opacity&&.001<E.scale&&(z.x=E.x,z.y=E.y,z.z=E.z,C=E.size*E.scale/g,I.x=C*D,I.y=C,c.uniform3f(K.screenPosition,\nz.x,z.y,z.z),c.uniform2f(K.scale,I.x,I.y),c.uniform1f(K.rotation,E.rotation),c.uniform1f(K.opacity,E.opacity),c.uniform3f(K.color,E.color.r,E.color.g,E.color.b),d.setBlending(E.blending,E.blendEquation,E.blendSrc,E.blendDst),d.setTexture(E.texture,1),c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0))}}}c.enable(c.CULL_FACE);c.enable(c.DEPTH_TEST);c.depthMask(!0)}}};\nTHREE.ShadowMapPlugin=function(){function a(b,c,d){if(c.visible){var e=b.__webglObjects[c.id];if(e&&c.castShadow&&(!1===c.frustumCulled||!0===h.intersectsObject(c)))for(var f=0,g=e.length;f<g;f++){var k=e[f];c._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,c.matrixWorld);r.push(k)}f=0;for(g=c.children.length;f<g;f++)a(b,c.children[f],d)}}var b,c,d,e,f,g,h=new THREE.Frustum,k=new THREE.Matrix4,l=new THREE.Vector3,n=new THREE.Vector3,q=new THREE.Vector3,r=[];this.init=function(a){b=a.context;\nc=a;a=THREE.ShaderLib.depthRGBA;var h=THREE.UniformsUtils.clone(a.uniforms);d=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:h});e=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:h,morphTargets:!0});f=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:h,skinning:!0});g=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:h,\nmorphTargets:!0,skinning:!0});d._shadowPass=!0;e._shadowPass=!0;f._shadowPass=!0;g._shadowPass=!0};this.render=function(a,b){c.shadowMapEnabled&&c.shadowMapAutoUpdate&&this.update(a,b)};this.update=function(t,s){var p,v,w,u,D,A,x,C,I=[];u=0;b.clearColor(1,1,1,1);b.disable(b.BLEND);b.enable(b.CULL_FACE);b.frontFace(b.CCW);c.shadowMapCullFace===THREE.CullFaceFront?b.cullFace(b.FRONT):b.cullFace(b.BACK);c.setDepthTest(!0);p=0;for(v=t.__lights.length;p<v;p++)if(w=t.__lights[p],w.castShadow)if(w instanceof\nTHREE.DirectionalLight&&w.shadowCascade)for(D=0;D<w.shadowCascadeCount;D++){var z;if(w.shadowCascadeArray[D])z=w.shadowCascadeArray[D];else{x=w;var y=D;z=new THREE.DirectionalLight;z.isVirtual=!0;z.onlyShadow=!0;z.castShadow=!0;z.shadowCameraNear=x.shadowCameraNear;z.shadowCameraFar=x.shadowCameraFar;z.shadowCameraLeft=x.shadowCameraLeft;z.shadowCameraRight=x.shadowCameraRight;z.shadowCameraBottom=x.shadowCameraBottom;z.shadowCameraTop=x.shadowCameraTop;z.shadowCameraVisible=x.shadowCameraVisible;\nz.shadowDarkness=x.shadowDarkness;z.shadowBias=x.shadowCascadeBias[y];z.shadowMapWidth=x.shadowCascadeWidth[y];z.shadowMapHeight=x.shadowCascadeHeight[y];z.pointsWorld=[];z.pointsFrustum=[];C=z.pointsWorld;A=z.pointsFrustum;for(var K=0;8>K;K++)C[K]=new THREE.Vector3,A[K]=new THREE.Vector3;C=x.shadowCascadeNearZ[y];x=x.shadowCascadeFarZ[y];A[0].set(-1,-1,C);A[1].set(1,-1,C);A[2].set(-1,1,C);A[3].set(1,1,C);A[4].set(-1,-1,x);A[5].set(1,-1,x);A[6].set(-1,1,x);A[7].set(1,1,x);z.originalCamera=s;A=new THREE.Gyroscope;\nA.position.copy(w.shadowCascadeOffset);A.add(z);A.add(z.target);s.add(A);w.shadowCascadeArray[D]=z;console.log(\"Created virtualLight\",z)}y=w;C=D;x=y.shadowCascadeArray[C];x.position.copy(y.position);x.target.position.copy(y.target.position);x.lookAt(x.target);x.shadowCameraVisible=y.shadowCameraVisible;x.shadowDarkness=y.shadowDarkness;x.shadowBias=y.shadowCascadeBias[C];A=y.shadowCascadeNearZ[C];y=y.shadowCascadeFarZ[C];x=x.pointsFrustum;x[0].z=A;x[1].z=A;x[2].z=A;x[3].z=A;x[4].z=y;x[5].z=y;x[6].z=\ny;x[7].z=y;I[u]=z;u++}else I[u]=w,u++;p=0;for(v=I.length;p<v;p++){w=I[p];w.shadowMap||(D=THREE.LinearFilter,c.shadowMapType===THREE.PCFSoftShadowMap&&(D=THREE.NearestFilter),w.shadowMap=new THREE.WebGLRenderTarget(w.shadowMapWidth,w.shadowMapHeight,{minFilter:D,magFilter:D,format:THREE.RGBAFormat}),w.shadowMapSize=new THREE.Vector2(w.shadowMapWidth,w.shadowMapHeight),w.shadowMatrix=new THREE.Matrix4);if(!w.shadowCamera){if(w instanceof THREE.SpotLight)w.shadowCamera=new THREE.PerspectiveCamera(w.shadowCameraFov,\nw.shadowMapWidth/w.shadowMapHeight,w.shadowCameraNear,w.shadowCameraFar);else if(w instanceof THREE.DirectionalLight)w.shadowCamera=new THREE.OrthographicCamera(w.shadowCameraLeft,w.shadowCameraRight,w.shadowCameraTop,w.shadowCameraBottom,w.shadowCameraNear,w.shadowCameraFar);else{console.error(\"Unsupported light type for shadow\");continue}t.add(w.shadowCamera);!0===t.autoUpdate&&t.updateMatrixWorld()}w.shadowCameraVisible&&!w.cameraHelper&&(w.cameraHelper=new THREE.CameraHelper(w.shadowCamera),w.shadowCamera.add(w.cameraHelper));\nif(w.isVirtual&&z.originalCamera==s){D=s;u=w.shadowCamera;A=w.pointsFrustum;x=w.pointsWorld;l.set(Infinity,Infinity,Infinity);n.set(-Infinity,-Infinity,-Infinity);for(y=0;8>y;y++)C=x[y],C.copy(A[y]),THREE.ShadowMapPlugin.__projector.unprojectVector(C,D),C.applyMatrix4(u.matrixWorldInverse),C.x<l.x&&(l.x=C.x),C.x>n.x&&(n.x=C.x),C.y<l.y&&(l.y=C.y),C.y>n.y&&(n.y=C.y),C.z<l.z&&(l.z=C.z),C.z>n.z&&(n.z=C.z);u.left=l.x;u.right=n.x;u.top=n.y;u.bottom=l.y;u.updateProjectionMatrix()}u=w.shadowMap;A=w.shadowMatrix;\nD=w.shadowCamera;D.position.setFromMatrixPosition(w.matrixWorld);q.setFromMatrixPosition(w.target.matrixWorld);D.lookAt(q);D.updateMatrixWorld();D.matrixWorldInverse.getInverse(D.matrixWorld);w.cameraHelper&&(w.cameraHelper.visible=w.shadowCameraVisible);w.shadowCameraVisible&&w.cameraHelper.update();A.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);A.multiply(D.projectionMatrix);A.multiply(D.matrixWorldInverse);k.multiplyMatrices(D.projectionMatrix,D.matrixWorldInverse);h.setFromMatrix(k);c.setRenderTarget(u);\nc.clear();r.length=0;a(t,t,D);w=0;for(u=r.length;w<u;w++)x=r[w],A=x.object,x=x.buffer,y=A.material instanceof THREE.MeshFaceMaterial?A.material.materials[0]:A.material,C=void 0!==A.geometry.morphTargets&&0<A.geometry.morphTargets.length&&y.morphTargets,K=A instanceof THREE.SkinnedMesh&&y.skinning,C=A.customDepthMaterial?A.customDepthMaterial:K?C?g:f:C?e:d,c.setMaterialFaces(y),x instanceof THREE.BufferGeometry?c.renderBufferDirect(D,t.__lights,null,C,x,A):c.renderBuffer(D,t.__lights,null,C,x,A);y=\nt.__webglObjectsImmediate;w=0;for(u=y.length;w<u;w++)x=y[w],A=x.object,A.visible&&A.castShadow&&(A._modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,A.matrixWorld),c.renderImmediateObject(D,t.__lights,null,d,A))}p=c.getClearColor();v=c.getClearAlpha();b.clearColor(p.r,p.g,p.b,v);b.enable(b.BLEND);c.shadowMapCullFace===THREE.CullFaceFront&&b.cullFace(b.BACK)}};THREE.ShadowMapPlugin.__projector=new THREE.Projector;\nTHREE.SpritePlugin=function(){var a,b,c,d,e,f,g,h,k,l,n,q,r,t,s,p,v;function w(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var u,D,A,x=[],C,I,z,y,K;this.init=function(w){u=w.context;D=w;C=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]);I=new Uint16Array([0,1,2,0,2,3]);z=u.createBuffer();y=u.createBuffer();u.bindBuffer(u.ARRAY_BUFFER,z);u.bufferData(u.ARRAY_BUFFER,C,u.STATIC_DRAW);u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,y);u.bufferData(u.ELEMENT_ARRAY_BUFFER,I,u.STATIC_DRAW);w=u.createProgram();\nvar x=u.createShader(u.VERTEX_SHADER),P=u.createShader(u.FRAGMENT_SHADER);u.shaderSource(x,[\"precision \"+D.getPrecision()+\" float;\",\"uniform mat4 modelViewMatrix;\\nuniform mat4 projectionMatrix;\\nuniform float rotation;\\nuniform vec2 scale;\\nuniform vec2 uvOffset;\\nuniform vec2 uvScale;\\nattribute vec2 position;\\nattribute vec2 uv;\\nvarying vec2 vUV;\\nvoid main() {\\nvUV = uvOffset + uv * uvScale;\\nvec2 alignedPosition = position * scale;\\nvec2 rotatedPosition;\\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\\nvec4 finalPosition;\\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\\nfinalPosition.xy += rotatedPosition;\\nfinalPosition = projectionMatrix * finalPosition;\\ngl_Position = finalPosition;\\n}\"].join(\"\\n\"));\nu.shaderSource(P,[\"precision \"+D.getPrecision()+\" float;\",\"uniform vec3 color;\\nuniform sampler2D map;\\nuniform float opacity;\\nuniform int fogType;\\nuniform vec3 fogColor;\\nuniform float fogDensity;\\nuniform float fogNear;\\nuniform float fogFar;\\nuniform float alphaTest;\\nvarying vec2 vUV;\\nvoid main() {\\nvec4 texture = texture2D( map, vUV );\\nif ( texture.a < alphaTest ) discard;\\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\\nif ( fogType > 0 ) {\\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\\nfloat fogFactor = 0.0;\\nif ( fogType == 1 ) {\\nfogFactor = smoothstep( fogNear, fogFar, depth );\\n} else {\\nconst float LOG2 = 1.442695;\\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\\n}\\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\\n}\\n}\"].join(\"\\n\"));\nu.compileShader(x);u.compileShader(P);u.attachShader(w,x);u.attachShader(w,P);u.linkProgram(w);K=w;p=u.getAttribLocation(K,\"position\");v=u.getAttribLocation(K,\"uv\");a=u.getUniformLocation(K,\"uvOffset\");b=u.getUniformLocation(K,\"uvScale\");c=u.getUniformLocation(K,\"rotation\");d=u.getUniformLocation(K,\"scale\");e=u.getUniformLocation(K,\"color\");f=u.getUniformLocation(K,\"map\");g=u.getUniformLocation(K,\"opacity\");h=u.getUniformLocation(K,\"modelViewMatrix\");k=u.getUniformLocation(K,\"projectionMatrix\");l=\nu.getUniformLocation(K,\"fogType\");n=u.getUniformLocation(K,\"fogDensity\");q=u.getUniformLocation(K,\"fogNear\");r=u.getUniformLocation(K,\"fogFar\");t=u.getUniformLocation(K,\"fogColor\");s=u.getUniformLocation(K,\"alphaTest\");w=document.createElement(\"canvas\");w.width=8;w.height=8;x=w.getContext(\"2d\");x.fillStyle=\"white\";x.fillRect(0,0,8,8);A=new THREE.Texture(w);A.needsUpdate=!0};this.render=function(C,I,P,O){x.length=0;C.traverseVisible(function(a){a instanceof THREE.Sprite&&x.push(a)});if(0!==x.length){u.useProgram(K);\nu.enableVertexAttribArray(p);u.enableVertexAttribArray(v);u.disable(u.CULL_FACE);u.enable(u.BLEND);u.bindBuffer(u.ARRAY_BUFFER,z);u.vertexAttribPointer(p,2,u.FLOAT,!1,16,0);u.vertexAttribPointer(v,2,u.FLOAT,!1,16,8);u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,y);u.uniformMatrix4fv(k,!1,I.projectionMatrix.elements);u.activeTexture(u.TEXTURE0);u.uniform1i(f,0);O=P=0;var J=C.fog;J?(u.uniform3f(t,J.color.r,J.color.g,J.color.b),J instanceof THREE.Fog?(u.uniform1f(q,J.near),u.uniform1f(r,J.far),u.uniform1i(l,1),\nO=P=1):J instanceof THREE.FogExp2&&(u.uniform1f(n,J.density),u.uniform1i(l,2),O=P=2)):(u.uniform1i(l,0),O=P=0);for(var J=0,E=x.length;J<E;J++){var Q=x[J],L=Q.material;Q._modelViewMatrix.multiplyMatrices(I.matrixWorldInverse,Q.matrixWorld);Q.z=-Q._modelViewMatrix.elements[14]}x.sort(w);I=[];J=0;for(E=x.length;J<E;J++)Q=x[J],L=Q.material,u.uniform1f(s,L.alphaTest),u.uniformMatrix4fv(h,!1,Q._modelViewMatrix.elements),I[0]=Q.scale.x,I[1]=Q.scale.y,Q=0,C.fog&&L.fog&&(Q=O),P!==Q&&(u.uniform1i(l,Q),P=Q),\nnull!==L.map?(u.uniform2f(a,L.map.offset.x,L.map.offset.y),u.uniform2f(b,L.map.repeat.x,L.map.repeat.y)):(u.uniform2f(a,0,0),u.uniform2f(b,1,1)),u.uniform1f(g,L.opacity),u.uniform3f(e,L.color.r,L.color.g,L.color.b),u.uniform1f(c,L.rotation),u.uniform2fv(d,I),D.setBlending(L.blending,L.blendEquation,L.blendSrc,L.blendDst),D.setDepthTest(L.depthTest),D.setDepthWrite(L.depthWrite),L.map&&L.map.image&&L.map.image.width?D.setTexture(L.map,0):D.setTexture(A,0),u.drawElements(u.TRIANGLES,6,u.UNSIGNED_SHORT,\n0);u.enable(u.CULL_FACE)}}};\nTHREE.DepthPassPlugin=function(){function a(b,c,d){if(c.visible){var e=b.__webglObjects[c.id];if(e&&(!1===c.frustumCulled||!0===h.intersectsObject(c)))for(var f=0,g=e.length;f<g;f++){var k=e[f];c._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,c.matrixWorld);l.push(k)}f=0;for(g=c.children.length;f<g;f++)a(b,c.children[f],d)}}this.enabled=!1;this.renderTarget=null;var b,c,d,e,f,g,h=new THREE.Frustum,k=new THREE.Matrix4,l=[];this.init=function(a){b=a.context;c=a;a=THREE.ShaderLib.depthRGBA;var h=\nTHREE.UniformsUtils.clone(a.uniforms);d=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:h});e=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:h,morphTargets:!0});f=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:h,skinning:!0});g=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:h,morphTargets:!0,skinning:!0});d._shadowPass=\n!0;e._shadowPass=!0;f._shadowPass=!0;g._shadowPass=!0};this.render=function(a,b){this.enabled&&this.update(a,b)};this.update=function(n,q){var r,t,s,p,v;b.clearColor(1,1,1,1);b.disable(b.BLEND);c.setDepthTest(!0);!0===n.autoUpdate&&n.updateMatrixWorld();q.matrixWorldInverse.getInverse(q.matrixWorld);k.multiplyMatrices(q.projectionMatrix,q.matrixWorldInverse);h.setFromMatrix(k);c.setRenderTarget(this.renderTarget);c.clear();l.length=0;a(n,n,q);var w;r=0;for(t=l.length;r<t;r++)s=l[r],v=s.object,s=s.buffer,\nv instanceof THREE.PointCloud&&!v.customDepthMaterial||((w=v.material instanceof THREE.MeshFaceMaterial?v.material.materials[0]:v.material)&&c.setMaterialFaces(v.material),p=void 0!==v.geometry.morphTargets&&0<v.geometry.morphTargets.length&&w.morphTargets,w=v instanceof THREE.SkinnedMesh&&w.skinning,p=v.customDepthMaterial?v.customDepthMaterial:w?p?g:f:p?e:d,s instanceof THREE.BufferGeometry?c.renderBufferDirect(q,n.__lights,null,p,s,v):c.renderBuffer(q,n.__lights,null,p,s,v));p=n.__webglObjectsImmediate;\nr=0;for(t=p.length;r<t;r++)s=p[r],v=s.object,v.visible&&(v._modelViewMatrix.multiplyMatrices(q.matrixWorldInverse,v.matrixWorld),c.renderImmediateObject(q,n.__lights,null,d,v));r=c.getClearColor();t=c.getClearAlpha();b.clearColor(r.r,r.g,r.b,t);b.enable(b.BLEND)}};\nTHREE.ShaderFlares={lensFlareVertexTexture:{vertexShader:\"uniform lowp int renderType;\\nuniform vec3 screenPosition;\\nuniform vec2 scale;\\nuniform float rotation;\\nuniform sampler2D occlusionMap;\\nattribute vec2 position;\\nattribute vec2 uv;\\nvarying vec2 vUV;\\nvarying float vVisibility;\\nvoid main() {\\nvUV = uv;\\nvec2 pos = position;\\nif( renderType == 2 ) {\\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\\nvVisibility =        visibility.r / 9.0;\\nvVisibility *= 1.0 - visibility.g / 9.0;\\nvVisibility *=       visibility.b / 9.0;\\nvVisibility *= 1.0 - visibility.a / 9.0;\\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\\n}\\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\\n}\",fragmentShader:\"uniform lowp int renderType;\\nuniform sampler2D map;\\nuniform float opacity;\\nuniform vec3 color;\\nvarying vec2 vUV;\\nvarying float vVisibility;\\nvoid main() {\\nif( renderType == 0 ) {\\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\\n} else if( renderType == 1 ) {\\ngl_FragColor = texture2D( map, vUV );\\n} else {\\nvec4 texture = texture2D( map, vUV );\\ntexture.a *= opacity * vVisibility;\\ngl_FragColor = texture;\\ngl_FragColor.rgb *= color;\\n}\\n}\"},\nlensFlare:{vertexShader:\"uniform lowp int renderType;\\nuniform vec3 screenPosition;\\nuniform vec2 scale;\\nuniform float rotation;\\nattribute vec2 position;\\nattribute vec2 uv;\\nvarying vec2 vUV;\\nvoid main() {\\nvUV = uv;\\nvec2 pos = position;\\nif( renderType == 2 ) {\\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\\n}\\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\\n}\",\nfragmentShader:\"precision mediump float;\\nuniform lowp int renderType;\\nuniform sampler2D map;\\nuniform sampler2D occlusionMap;\\nuniform float opacity;\\nuniform vec3 color;\\nvarying vec2 vUV;\\nvoid main() {\\nif( renderType == 0 ) {\\ngl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );\\n} else if( renderType == 1 ) {\\ngl_FragColor = texture2D( map, vUV );\\n} else {\\nfloat visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;\\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;\\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;\\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;\\nvisibility = ( 1.0 - visibility / 4.0 );\\nvec4 texture = texture2D( map, vUV );\\ntexture.a *= opacity * visibility;\\ngl_FragColor = texture;\\ngl_FragColor.rgb *= color;\\n}\\n}\"}};\n\nexports.THREE = THREE;})();\n"
        },
        "$:/plugins/rboue/Three.js/Lib/config.css": {
            "type": "text/css",
            "title": "$:/plugins/rboue/Three.js/Lib/config.css",
            "tags": "[[$:/tags/Stylesheet]]",
            "text": "/* Stats module */\n#stats {}\n#stats #fps {background: transparent !important}\n#stats #fps #fpsText {color: #aaa !important}\n#stats #fps #fpsGraph {}"
        },
        "$:/plugins/rboue/Three.js/Lib/stringview.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/stringview.js",
            "module-type": "library",
            "text": "(function(){\n\"use strict\";\n/*\nThe aims of this library are:\n\n    to create a C-like interface for strings (i.e., an array of character codes — an\n      ArrayBufferView in JavaScript) based upon the JavaScript ArrayBuffer interface\n    to create a highly extensible library that anyone can extend by adding methods to\n      the object StringView.prototype\n    to create a collection of methods for such string-like objects (since now: stringViews)\n      which work strictly on arrays of numbers rather than on creating new immutable\n      JavaScript strings\n    to work with Unicode encodings other than JavaScript's default UTF-16 DOMStrings\n*/\n\n/*\\\n|*|\n|*|  :: Number.isInteger() polyfill ::\n|*|\n|*|  https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger\n|*|\n\\*/\n\nif (!Number.isInteger) {\n  Number.isInteger = function isInteger (nVal) {\n    return typeof nVal === \"number\" && isFinite(nVal) && nVal > -9007199254740992 && nVal < 9007199254740992 && Math.floor(nVal) === nVal;\n  };\n}\n\n/*\\\n|*|\n|*|  StringView - Mozilla Developer Network\n|*|\n|*|  Revision #8, October 6, 2014\n|*|\n|*|  https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays/StringView\n|*|  https://developer.mozilla.org/en-US/docs/User:fusionchess\n|*|\n|*|  This framework is released under the GNU Lesser General Public License, version 3 or later.\n|*|  http://www.gnu.org/licenses/lgpl-3.0.html\n|*|\n\\*/\n\nfunction StringView (vInput, sEncoding /* optional (default: UTF-8) */, nOffset /* optional */, nLength /* optional */) {\n\n  var fTAView, aWhole, aRaw, fPutOutptCode, fGetOutptChrSize, nInptLen, nStartIdx = isFinite(nOffset) ? nOffset : 0, nTranscrType = 15;\n\n  if (sEncoding) { this.encoding = sEncoding.toString(); }\n\n  encSwitch: switch (this.encoding) {\n    case \"UTF-8\":\n      fPutOutptCode = StringView.putUTF8CharCode;\n      fGetOutptChrSize = StringView.getUTF8CharLength;\n      fTAView = Uint8Array;\n      break encSwitch;\n    case \"UTF-16\":\n      fPutOutptCode = StringView.putUTF16CharCode;\n      fGetOutptChrSize = StringView.getUTF16CharLength;\n      fTAView = Uint16Array;\n      break encSwitch;\n    case \"UTF-32\":\n      fTAView = Uint32Array;\n      nTranscrType &= 14;\n      break encSwitch;\n    default:\n      /* case \"ASCII\", or case \"BinaryString\" or unknown cases */\n      fTAView = Uint8Array;\n      nTranscrType &= 14;\n  }\n\n  typeSwitch: switch (typeof vInput) {\n    case \"string\":\n      /* the input argument is a primitive string: a new buffer will be created. */\n      nTranscrType &= 7;\n      break typeSwitch;\n    case \"object\":\n      classSwitch: switch (vInput.constructor) {\n        case StringView:\n          /* the input argument is a stringView: a new buffer will be created. */\n          nTranscrType &= 3;\n          break typeSwitch;\n        case String:\n          /* the input argument is an objectified string: a new buffer will be created. */\n          nTranscrType &= 7;\n          break typeSwitch;\n        case ArrayBuffer:\n          /* the input argument is an arrayBuffer: the buffer will be shared. */\n          aWhole = new fTAView(vInput);\n          nInptLen = this.encoding === \"UTF-32\" ?\n              vInput.byteLength >>> 2\n            : this.encoding === \"UTF-16\" ?\n              vInput.byteLength >>> 1\n            :\n              vInput.byteLength;\n          aRaw = nStartIdx === 0 && (!isFinite(nLength) || nLength === nInptLen) ?\n            aWhole\n            : new fTAView(vInput, nStartIdx, !isFinite(nLength) ? nInptLen - nStartIdx : nLength);\n\n          break typeSwitch;\n        case Uint32Array:\n        case Uint16Array:\n        case Uint8Array:\n          /* the input argument is a typedArray: the buffer, and possibly the array itself, will be shared. */\n          fTAView = vInput.constructor;\n          nInptLen = vInput.length;\n          aWhole = vInput.byteOffset === 0 && vInput.length === (\n            fTAView === Uint32Array ?\n              vInput.buffer.byteLength >>> 2\n            : fTAView === Uint16Array ?\n              vInput.buffer.byteLength >>> 1\n            :\n              vInput.buffer.byteLength\n          ) ? vInput : new fTAView(vInput.buffer);\n          aRaw = nStartIdx === 0 && (!isFinite(nLength) || nLength === nInptLen) ?\n            vInput\n            : vInput.subarray(nStartIdx, isFinite(nLength) ? nStartIdx + nLength : nInptLen);\n\n          break typeSwitch;\n        default:\n          /* the input argument is an array or another serializable object: a new typedArray will be created. */\n          aWhole = new fTAView(vInput);\n          nInptLen = aWhole.length;\n          aRaw = nStartIdx === 0 && (!isFinite(nLength) || nLength === nInptLen) ?\n            aWhole\n            : aWhole.subarray(nStartIdx, isFinite(nLength) ? nStartIdx + nLength : nInptLen);\n      }\n      break typeSwitch;\n    default:\n      /* the input argument is a number, a boolean or a function: a new typedArray will be created. */\n      aWhole = aRaw = new fTAView(Number(vInput) || 0);\n\n  }\n\n  if (nTranscrType < 8) {\n\n    var vSource, nOutptLen, nCharStart, nCharEnd, nEndIdx, fGetInptChrSize, fGetInptChrCode;\n\n    if (nTranscrType & 4) { /* input is string */\n\n      vSource = vInput;\n      nOutptLen = nInptLen = vSource.length;\n      nTranscrType ^= this.encoding === \"UTF-32\" ? 0 : 2;\n      /* ...or...: nTranscrType ^= Number(this.encoding !== \"UTF-32\") << 1; */\n      nStartIdx = nCharStart = nOffset ? Math.max((nOutptLen + nOffset) % nOutptLen, 0) : 0;\n      nEndIdx = nCharEnd = (Number.isInteger(nLength) ? Math.min(Math.max(nLength, 0) + nStartIdx, nOutptLen) : nOutptLen) - 1;\n\n    } else { /* input is stringView */\n\n      vSource = vInput.rawData;\n      nInptLen = vInput.makeIndex();\n      nStartIdx = nCharStart = nOffset ? Math.max((nInptLen + nOffset) % nInptLen, 0) : 0;\n      nOutptLen = Number.isInteger(nLength) ? Math.min(Math.max(nLength, 0), nInptLen - nCharStart) : nInptLen;\n      nEndIdx = nCharEnd = nOutptLen + nCharStart;\n\n      if (vInput.encoding === \"UTF-8\") {\n        fGetInptChrSize = StringView.getUTF8CharLength;\n        fGetInptChrCode = StringView.loadUTF8CharCode;\n      } else if (vInput.encoding === \"UTF-16\") {\n        fGetInptChrSize = StringView.getUTF16CharLength;\n        fGetInptChrCode = StringView.loadUTF16CharCode;\n      } else {\n        nTranscrType &= 1;\n      }\n\n    }\n\n    if (nOutptLen === 0 || nTranscrType < 4 && vSource.encoding === this.encoding && nCharStart === 0 && nOutptLen === nInptLen) {\n\n      /* the encoding is the same, the length too and the offset is 0... or the input is empty! */\n\n      nTranscrType = 7;\n\n    }\n\n    conversionSwitch: switch (nTranscrType) {\n\n      case 0:\n\n      /* both the source and the new StringView have a fixed-length encoding... */\n\n        aWhole = new fTAView(nOutptLen);\n        for (var nOutptIdx = 0; nOutptIdx < nOutptLen; aWhole[nOutptIdx] = vSource[nStartIdx + nOutptIdx++]);\n        break conversionSwitch;\n\n      case 1:\n\n      /* the source has a fixed-length encoding but the new StringView has a variable-length encoding... */\n\n        /* mapping... */\n\n        nOutptLen = 0;\n\n        for (var nInptIdx = nStartIdx; nInptIdx < nEndIdx; nInptIdx++) {\n          nOutptLen += fGetOutptChrSize(vSource[nInptIdx]);\n        }\n\n        aWhole = new fTAView(nOutptLen);\n\n        /* transcription of the source... */\n\n        for (var nInptIdx = nStartIdx, nOutptIdx = 0; nOutptIdx < nOutptLen; nInptIdx++) {\n          nOutptIdx = fPutOutptCode(aWhole, vSource[nInptIdx], nOutptIdx);\n        }\n\n        break conversionSwitch;\n\n      case 2:\n\n      /* the source has a variable-length encoding but the new StringView has a fixed-length encoding... */\n\n        /* mapping... */\n\n        nStartIdx = 0;\n\n        var nChrCode;\n\n        for (nChrIdx = 0; nChrIdx < nCharStart; nChrIdx++) {\n          nChrCode = fGetInptChrCode(vSource, nStartIdx);\n          nStartIdx += fGetInptChrSize(nChrCode);\n        }\n\n        aWhole = new fTAView(nOutptLen);\n\n        /* transcription of the source... */\n\n        for (var nInptIdx = nStartIdx, nOutptIdx = 0; nOutptIdx < nOutptLen; nInptIdx += fGetInptChrSize(nChrCode), nOutptIdx++) {\n          nChrCode = fGetInptChrCode(vSource, nInptIdx);\n          aWhole[nOutptIdx] = nChrCode;\n        }\n\n        break conversionSwitch;\n\n      case 3:\n\n      /* both the source and the new StringView have a variable-length encoding... */\n\n        /* mapping... */\n\n        nOutptLen = 0;\n\n        var nChrCode;\n\n        for (var nChrIdx = 0, nInptIdx = 0; nChrIdx < nCharEnd; nInptIdx += fGetInptChrSize(nChrCode)) {\n          nChrCode = fGetInptChrCode(vSource, nInptIdx);\n          if (nChrIdx === nCharStart) { nStartIdx = nInptIdx; }\n          if (++nChrIdx > nCharStart) { nOutptLen += fGetOutptChrSize(nChrCode); }\n        }\n\n        aWhole = new fTAView(nOutptLen);\n\n        /* transcription... */\n\n        for (var nInptIdx = nStartIdx, nOutptIdx = 0; nOutptIdx < nOutptLen; nInptIdx += fGetInptChrSize(nChrCode)) {\n          nChrCode = fGetInptChrCode(vSource, nInptIdx);\n          nOutptIdx = fPutOutptCode(aWhole, nChrCode, nOutptIdx);\n        }\n\n        break conversionSwitch;\n\n      case 4:\n\n      /* DOMString to ASCII or BinaryString or other unknown encodings */\n\n        aWhole = new fTAView(nOutptLen);\n\n        /* transcription... */\n\n        for (var nIdx = 0; nIdx < nOutptLen; nIdx++) {\n          aWhole[nIdx] = vSource.charCodeAt(nIdx) & 0xff;\n        }\n\n        break conversionSwitch;\n\n      case 5:\n\n      /* DOMString to UTF-8 or to UTF-16 */\n\n        /* mapping... */\n\n        nOutptLen = 0;\n\n        for (var nMapIdx = 0; nMapIdx < nInptLen; nMapIdx++) {\n          if (nMapIdx === nCharStart) { nStartIdx = nOutptLen; }\n          nOutptLen += fGetOutptChrSize(vSource.charCodeAt(nMapIdx));\n          if (nMapIdx === nCharEnd) { nEndIdx = nOutptLen; }\n        }\n\n        aWhole = new fTAView(nOutptLen);\n\n        /* transcription... */\n\n        for (var nOutptIdx = 0, nChrIdx = 0; nOutptIdx < nOutptLen; nChrIdx++) {\n          nOutptIdx = fPutOutptCode(aWhole, vSource.charCodeAt(nChrIdx), nOutptIdx);\n        }\n\n        break conversionSwitch;\n\n      case 6:\n\n      /* DOMString to UTF-32 */\n\n        aWhole = new fTAView(nOutptLen);\n\n        /* transcription... */\n\n        for (var nIdx = 0; nIdx < nOutptLen; nIdx++) {\n          aWhole[nIdx] = vSource.charCodeAt(nIdx);\n        }\n\n        break conversionSwitch;\n\n      case 7:\n\n        aWhole = new fTAView(nOutptLen ? vSource : 0);\n        break conversionSwitch;\n\n    }\n\n    aRaw = nTranscrType > 3 && (nStartIdx > 0 || nEndIdx < aWhole.length - 1) ? aWhole.subarray(nStartIdx, nEndIdx) : aWhole;\n\n  }\n\n  this.buffer = aWhole.buffer;\n  this.bufferView = aWhole;\n  this.rawData = aRaw;\n\n  Object.freeze(this);\n\n}\n\n/* CONSTRUCTOR'S METHODS */\n\nStringView.loadUTF8CharCode = function (aChars, nIdx) {\n\n  var nLen = aChars.length, nPart = aChars[nIdx];\n\n  return nPart > 251 && nPart < 254 && nIdx + 5 < nLen ?\n      /* (nPart - 252 << 30) may be not safe in ECMAScript! So...: */\n      /* six bytes */ (nPart - 252) * 1073741824 + (aChars[nIdx + 1] - 128 << 24) + (aChars[nIdx + 2] - 128 << 18) + (aChars[nIdx + 3] - 128 << 12) + (aChars[nIdx + 4] - 128 << 6) + aChars[nIdx + 5] - 128\n    : nPart > 247 && nPart < 252 && nIdx + 4 < nLen ?\n      /* five bytes */ (nPart - 248 << 24) + (aChars[nIdx + 1] - 128 << 18) + (aChars[nIdx + 2] - 128 << 12) + (aChars[nIdx + 3] - 128 << 6) + aChars[nIdx + 4] - 128\n    : nPart > 239 && nPart < 248 && nIdx + 3 < nLen ?\n      /* four bytes */(nPart - 240 << 18) + (aChars[nIdx + 1] - 128 << 12) + (aChars[nIdx + 2] - 128 << 6) + aChars[nIdx + 3] - 128\n    : nPart > 223 && nPart < 240 && nIdx + 2 < nLen ?\n      /* three bytes */ (nPart - 224 << 12) + (aChars[nIdx + 1] - 128 << 6) + aChars[nIdx + 2] - 128\n    : nPart > 191 && nPart < 224 && nIdx + 1 < nLen ?\n      /* two bytes */ (nPart - 192 << 6) + aChars[nIdx + 1] - 128\n    :\n      /* one byte */ nPart;\n\n};\n\nStringView.putUTF8CharCode = function (aTarget, nChar, nPutAt) {\n\n  var nIdx = nPutAt;\n\n  if (nChar < 0x80 /* 128 */) {\n    /* one byte */\n    aTarget[nIdx++] = nChar;\n  } else if (nChar < 0x800 /* 2048 */) {\n    /* two bytes */\n    aTarget[nIdx++] = 0xc0 /* 192 */ + (nChar >>> 6);\n    aTarget[nIdx++] = 0x80 /* 128 */ + (nChar & 0x3f /* 63 */);\n  } else if (nChar < 0x10000 /* 65536 */) {\n    /* three bytes */\n    aTarget[nIdx++] = 0xe0 /* 224 */ + (nChar >>> 12);\n    aTarget[nIdx++] = 0x80 /* 128 */ + ((nChar >>> 6) & 0x3f /* 63 */);\n    aTarget[nIdx++] = 0x80 /* 128 */ + (nChar & 0x3f /* 63 */);\n  } else if (nChar < 0x200000 /* 2097152 */) {\n    /* four bytes */\n    aTarget[nIdx++] = 0xf0 /* 240 */ + (nChar >>> 18);\n    aTarget[nIdx++] = 0x80 /* 128 */ + ((nChar >>> 12) & 0x3f /* 63 */);\n    aTarget[nIdx++] = 0x80 /* 128 */ + ((nChar >>> 6) & 0x3f /* 63 */);\n    aTarget[nIdx++] = 0x80 /* 128 */ + (nChar & 0x3f /* 63 */);\n  } else if (nChar < 0x4000000 /* 67108864 */) {\n    /* five bytes */\n    aTarget[nIdx++] = 0xf8 /* 248 */ + (nChar >>> 24);\n    aTarget[nIdx++] = 0x80 /* 128 */ + ((nChar >>> 18) & 0x3f /* 63 */);\n    aTarget[nIdx++] = 0x80 /* 128 */ + ((nChar >>> 12) & 0x3f /* 63 */);\n    aTarget[nIdx++] = 0x80 /* 128 */ + ((nChar >>> 6) & 0x3f /* 63 */);\n    aTarget[nIdx++] = 0x80 /* 128 */ + (nChar & 0x3f /* 63 */);\n  } else /* if (nChar <= 0x7fffffff) */ { /* 2147483647 */\n    /* six bytes */\n    aTarget[nIdx++] = 0xfc /* 252 */ + /* (nChar >>> 30) may be not safe in ECMAScript! So...: */ (nChar / 1073741824);\n    aTarget[nIdx++] = 0x80 /* 128 */ + ((nChar >>> 24) & 0x3f /* 63 */);\n    aTarget[nIdx++] = 0x80 /* 128 */ + ((nChar >>> 18) & 0x3f /* 63 */);\n    aTarget[nIdx++] = 0x80 /* 128 */ + ((nChar >>> 12) & 0x3f /* 63 */);\n    aTarget[nIdx++] = 0x80 /* 128 */ + ((nChar >>> 6) & 0x3f /* 63 */);\n    aTarget[nIdx++] = 0x80 /* 128 */ + (nChar & 0x3f /* 63 */);\n  }\n\n  return nIdx;\n\n};\n\nStringView.getUTF8CharLength = function (nChar) {\n  return nChar < 0x80 ? 1 : nChar < 0x800 ? 2 : nChar < 0x10000 ? 3 : nChar < 0x200000 ? 4 : nChar < 0x4000000 ? 5 : 6;\n};\n\nStringView.loadUTF16CharCode = function (aChars, nIdx) {\n\n  /* UTF-16 to DOMString decoding algorithm */\n  var nFrstChr = aChars[nIdx];\n\n  return nFrstChr > 0xD7BF /* 55231 */ && nIdx + 1 < aChars.length ?\n    (nFrstChr - 0xD800 /* 55296 */ << 10) + aChars[nIdx + 1] + 0x2400 /* 9216 */\n    : nFrstChr;\n\n};\n\nStringView.putUTF16CharCode = function (aTarget, nChar, nPutAt) {\n\n  var nIdx = nPutAt;\n\n  if (nChar < 0x10000 /* 65536 */) {\n    /* one element */\n    aTarget[nIdx++] = nChar;\n  } else {\n    /* two elements */\n    aTarget[nIdx++] = 0xD7C0 /* 55232 */ + (nChar >>> 10);\n    aTarget[nIdx++] = 0xDC00 /* 56320 */ + (nChar & 0x3FF /* 1023 */);\n  }\n\n  return nIdx;\n\n};\n\nStringView.getUTF16CharLength = function (nChar) {\n  return nChar < 0x10000 ? 1 : 2;\n};\n\n/* Array of bytes to base64 string decoding */\n\nStringView.b64ToUint6 = function (nChr) {\n\n  return nChr > 64 && nChr < 91 ?\n      nChr - 65\n    : nChr > 96 && nChr < 123 ?\n      nChr - 71\n    : nChr > 47 && nChr < 58 ?\n      nChr + 4\n    : nChr === 43 ?\n      62\n    : nChr === 47 ?\n      63\n    :\n      0;\n\n};\n\nStringView.uint6ToB64 = function (nUint6) {\n\n  return nUint6 < 26 ?\n      nUint6 + 65\n    : nUint6 < 52 ?\n      nUint6 + 71\n    : nUint6 < 62 ?\n      nUint6 - 4\n    : nUint6 === 62 ?\n      43\n    : nUint6 === 63 ?\n      47\n    :\n      65;\n\n};\n\n/* Base64 string to array encoding */\n\nStringView.bytesToBase64 = function (aBytes) {\n\n  var sB64Enc = \"\";\n\n  for (var nMod3, nLen = aBytes.length, nUint24 = 0, nIdx = 0; nIdx < nLen; nIdx++) {\n    nMod3 = nIdx % 3;\n    if (nIdx > 0 && (nIdx * 4 / 3) % 76 === 0) { sB64Enc += \"\\r\\n\"; }\n    nUint24 |= aBytes[nIdx] << (16 >>> nMod3 & 24);\n    if (nMod3 === 2 || aBytes.length - nIdx === 1) {\n      sB64Enc += String.fromCharCode(StringView.uint6ToB64(nUint24 >>> 18 & 63), StringView.uint6ToB64(nUint24 >>> 12 & 63), StringView.uint6ToB64(nUint24 >>> 6 & 63), StringView.uint6ToB64(nUint24 & 63));\n      nUint24 = 0;\n    }\n  }\n\n  return sB64Enc.replace(/A(?=A$|$)/g, \"=\");\n\n};\n\n\nStringView.base64ToBytes = function (sBase64, nBlockBytes) {\n\n  var\n    sB64Enc = sBase64.replace(/[^A-Za-z0-9\\+\\/]/g, \"\"), nInLen = sB64Enc.length,\n    nOutLen = nBlockBytes ? Math.ceil((nInLen * 3 + 1 >>> 2) / nBlockBytes) * nBlockBytes : nInLen * 3 + 1 >>> 2, aBytes = new Uint8Array(nOutLen);\n\n  for (var nMod3, nMod4, nUint24 = 0, nOutIdx = 0, nInIdx = 0; nInIdx < nInLen; nInIdx++) {\n    nMod4 = nInIdx & 3;\n    nUint24 |= StringView.b64ToUint6(sB64Enc.charCodeAt(nInIdx)) << 18 - 6 * nMod4;\n    if (nMod4 === 3 || nInLen - nInIdx === 1) {\n      for (nMod3 = 0; nMod3 < 3 && nOutIdx < nOutLen; nMod3++, nOutIdx++) {\n        aBytes[nOutIdx] = nUint24 >>> (16 >>> nMod3 & 24) & 255;\n      }\n      nUint24 = 0;\n    }\n  }\n\n  return aBytes;\n\n};\n\nStringView.makeFromBase64 = function (sB64Inpt, sEncoding, nByteOffset, nLength) {\n\n  return new StringView(sEncoding === \"UTF-16\" || sEncoding === \"UTF-32\" ? StringView.base64ToBytes(sB64Inpt, sEncoding === \"UTF-16\" ? 2 : 4).buffer : StringView.base64ToBytes(sB64Inpt), sEncoding, nByteOffset, nLength);\n\n};\n\n/* DEFAULT VALUES */\n\nStringView.prototype.encoding = \"UTF-8\"; /* Default encoding... */\n\n/* INSTANCES' METHODS */\n\nStringView.prototype.makeIndex = function (nChrLength, nStartFrom) {\n\n  var\n\n    aTarget = this.rawData, nChrEnd, nRawLength = aTarget.length,\n    nStartIdx = nStartFrom || 0, nIdxEnd = nStartIdx, nStopAtChr = isNaN(nChrLength) ? Infinity : nChrLength;\n\n  if (nChrLength + 1 > aTarget.length) { throw new RangeError(\"StringView.prototype.makeIndex - The offset can\\'t be major than the length of the array - 1.\"); }\n\n  switch (this.encoding) {\n\n    case \"UTF-8\":\n\n      var nPart;\n\n      for (nChrEnd = 0; nIdxEnd < nRawLength && nChrEnd < nStopAtChr; nChrEnd++) {\n        nPart = aTarget[nIdxEnd];\n        nIdxEnd += nPart > 251 && nPart < 254 && nIdxEnd + 5 < nRawLength ? 6\n          : nPart > 247 && nPart < 252 && nIdxEnd + 4 < nRawLength ? 5\n          : nPart > 239 && nPart < 248 && nIdxEnd + 3 < nRawLength ? 4\n          : nPart > 223 && nPart < 240 && nIdxEnd + 2 < nRawLength ? 3\n          : nPart > 191 && nPart < 224 && nIdxEnd + 1 < nRawLength ? 2\n          : 1;\n      }\n\n      break;\n\n    case \"UTF-16\":\n\n      for (nChrEnd = nStartIdx; nIdxEnd < nRawLength && nChrEnd < nStopAtChr; nChrEnd++) {\n        nIdxEnd += aTarget[nIdxEnd] > 0xD7BF /* 55231 */ && nIdxEnd + 1 < aTarget.length ? 2 : 1;\n      }\n\n      break;\n\n    default:\n\n      nIdxEnd = nChrEnd = isFinite(nChrLength) ? nChrLength : nRawLength - 1;\n\n  }\n\n  if (nChrLength) { return nIdxEnd; }\n\n  return nChrEnd;\n\n};\n\nStringView.prototype.toBase64 = function (bWholeBuffer) {\n\n  return StringView.bytesToBase64(\n    bWholeBuffer ?\n      (\n        this.bufferView.constructor === Uint8Array ?\n          this.bufferView\n        :\n          new Uint8Array(this.buffer)\n      )\n    : this.rawData.constructor === Uint8Array ?\n      this.rawData\n    :\n      new Uint8Array(this.buffer, this.rawData.byteOffset, this.rawData.length << (this.rawData.constructor === Uint16Array ? 1 : 2))\n    );\n\n};\n\nStringView.prototype.subview = function (nCharOffset /* optional */, nCharLength /* optional */) {\n\n  var\n\n    nChrLen, nCharStart, nStrLen, bVariableLen = this.encoding === \"UTF-8\" || this.encoding === \"UTF-16\",\n    nStartOffset = nCharOffset, nStringLength, nRawLen = this.rawData.length;\n\n  if (nRawLen === 0) {\n    return new StringView(this.buffer, this.encoding);\n  }\n\n  nStringLength = bVariableLen ? this.makeIndex() : nRawLen;\n  nCharStart = nCharOffset ? Math.max((nStringLength + nCharOffset) % nStringLength, 0) : 0;\n  nStrLen = Number.isInteger(nCharLength) ? Math.max(nCharLength, 0) + nCharStart > nStringLength ? nStringLength - nCharStart : nCharLength : nStringLength;\n\n  if (nCharStart === 0 && nStrLen === nStringLength) { return this; }\n\n  if (bVariableLen) {\n    nStartOffset = this.makeIndex(nCharStart);\n    nChrLen = this.makeIndex(nStrLen, nStartOffset) - nStartOffset;\n  } else {\n    nStartOffset = nCharStart;\n    nChrLen = nStrLen - nCharStart;\n  }\n\n  if (this.encoding === \"UTF-16\") {\n    nStartOffset <<= 1;\n  } else if (this.encoding === \"UTF-32\") {\n    nStartOffset <<= 2;\n  }\n\n  return new StringView(this.buffer, this.encoding, nStartOffset, nChrLen);\n\n};\n\nStringView.prototype.forEachChar = function (fCallback, oThat, nChrOffset, nChrLen) {\n\n  var aSource = this.rawData, nRawEnd, nRawIdx;\n\n  if (this.encoding === \"UTF-8\" || this.encoding === \"UTF-16\") {\n\n    var fGetInptChrSize, fGetInptChrCode;\n\n    if (this.encoding === \"UTF-8\") {\n      fGetInptChrSize = StringView.getUTF8CharLength;\n      fGetInptChrCode = StringView.loadUTF8CharCode;\n    } else if (this.encoding === \"UTF-16\") {\n      fGetInptChrSize = StringView.getUTF16CharLength;\n      fGetInptChrCode = StringView.loadUTF16CharCode;\n    }\n\n    nRawIdx = isFinite(nChrOffset) ? this.makeIndex(nChrOffset) : 0;\n    nRawEnd = isFinite(nChrLen) ? this.makeIndex(nChrLen, nRawIdx) : aSource.length;\n\n    for (var nChrCode, nChrIdx = 0; nRawIdx < nRawEnd; nChrIdx++) {\n      nChrCode = fGetInptChrCode(aSource, nRawIdx);\n      fCallback.call(oThat || null, nChrCode, nChrIdx, nRawIdx, aSource);\n      nRawIdx += fGetInptChrSize(nChrCode);\n    }\n\n  } else {\n\n    nRawIdx = isFinite(nChrOffset) ? nChrOffset : 0;\n    nRawEnd = isFinite(nChrLen) ? nChrLen + nRawIdx : aSource.length;\n\n    for (nRawIdx; nRawIdx < nRawEnd; nRawIdx++) {\n      fCallback.call(oThat || null, aSource[nRawIdx], nRawIdx, nRawIdx, aSource);\n    }\n\n  }\n\n};\n\nStringView.prototype.valueOf = StringView.prototype.toString = function () {\n\n  if (this.encoding !== \"UTF-8\" && this.encoding !== \"UTF-16\") {\n    /* ASCII, UTF-32 or BinaryString to DOMString */\n    return String.fromCharCode.apply(null, this.rawData);\n  }\n\n  var fGetCode, fGetIncr, sView = \"\";\n\n  if (this.encoding === \"UTF-8\") {\n    fGetIncr = StringView.getUTF8CharLength;\n    fGetCode = StringView.loadUTF8CharCode;\n  } else if (this.encoding === \"UTF-16\") {\n    fGetIncr = StringView.getUTF16CharLength;\n    fGetCode = StringView.loadUTF16CharCode;\n  }\n\n  for (var nChr, nLen = this.rawData.length, nIdx = 0; nIdx < nLen; nIdx += fGetIncr(nChr)) {\n    nChr = fGetCode(this.rawData, nIdx);\n    sView += String.fromCharCode(nChr);\n  }\n\n  return sView;\n\n};\nexports.StringView = StringView;})();\n"
        },
        "$:/plugins/rboue/Three.js/Lib/tools.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/tools.js",
            "module-type": "library",
            "text": "// Tools for playing more easily with Three.js library.\n//\n\n(function() {\n\n  var Tools = {};\n\n  Tools.Stats = require(\"$:/plugins/rboue/Three.js/Lib/stats-min.js\").Stats;\n  Tools.dat = require(\"$:/plugins/rboue/Three.js/Lib/dat-gui-min.js\").dat;\n\n  // Resolve PATH\n  Tools.resolvePath = function(path) {\n    if (!tiddlyWiki) return null;\n    return(tiddlyWiki.resolvePath(path));\n  };\n\n  // Debug tools\n  //\n  Tools.log = function() {\n    this.flagActive = true;\n  };\n  Tools.log.prototype = {\n    start: function() {this.flagActive = true;},\n    stop: function() {this.flagActive = false;},\n    log: function(mess, flagNoLog, fonc) {\n      if (!this.flagActive || flagNoLog) return;\n      console.log((fonc ? fonc+\": \" : \"\")+mess);\n    },\n    logPoint: function(x,y) {return \"(\"+x+\",\"+y+\")\";}\n  };\n\n  // Animation object\n  //\n  Tools.Animation = function(node, renderFunc, flagStartStopOnClick, flagLog) {\n    var func = \"Tools.Animation\";\n    this.flagNoLog = !flagLog;\n    this.node = node; // Container DOM node\n    this.renderFunc = renderFunc; // rendering\n    this.idAnimation = null; // Internal id used by cancelAnimationFrame() to stop animation\n    this.flagAnimation = true;\n\n    this.nodeId = this.node.getAttribute(\"id\");\n    if (!this.nodeId)\n      alert(\"Tools.Animation error: DOM node has no \\\"id\\\" attribute. Can't stop animation !\");\n\n    // Start/Stop on click\n    if (flagStartStopOnClick) {\n      var self = this;\n      this.node.addEventListener(\"mousedown\", function(event) {\n        func = \"Tools.Animation.onMouseDown\";\n        self.startStop();\n      }, false);\n    }\n  };\n  Tools.Animation.prototype = {\n    start: function() {\n      var func = \"Tools.Animation.start\";\n      hack.log(\"\", this.flagNoLog, func);\n      this.flagAnimation = true;\n      var self = this;\n      var animate = function() {\n        var func = \"Tools.Animation.start.animate\";\n        // Cancel animation when tiddler has been closed (i.e. widget's DOM node disappears, cf.\n        // Jeremy Ruston 14/12/07 in TiddlyWikiDev group).\n        if (!document.getElementById(self.nodeId)) {\n          hack.log(\"animation canceled: tiddler closes\", self.flagNoLog, func);\n          self.stop();\n          return;\n        }\n        self.idAnimation = window.requestAnimationFrame(animate);\n        self.renderFunc();\n      };\n      animate();\n    },\n    isClosed: function() {\n      var func = \"Tools.Animation.isClosed\";\n      // Cancel animation when tiddler has been closed (i.e. widget's DOM node disappears, cf.\n      // Jeremy Ruston 14/12/07 in TiddlyWikiDev group).\n      if (this.nodeId && ! document.getElementById(this.nodeId)) {\n        hack.log(\"animation canceled: tiddler closes\", this.flagNoLog, func);\n        this.stop();\n        return true;\n      }\n      return false;\n    },\n    stop: function() {\n      var func = \"Tools.Animation.stop\";\n      hack.log(\"\", this.flagNoLog, func);\n      window.cancelAnimationFrame(this.idAnimation);\n      this.flagAnimation = false;\n    },\n    startStop: function() {\n      if (this.flagAnimation)\n        this.stop();\n      else\n        this.start();\n    }\n  };\n\n  // Toolbar container for stats and menu\n  //\n  Tools.toolbarId = \"toolbar\"; // id of toolbar  \n  Tools.toolbarGet = function(node) {\n    var nodeId = node.getAttribute(\"id\");\n    if (!nodeId) return null;\n    var toolbarId = nodeId + \"-\" + Tools.toolbarId;\n    var toolbar = document.getElementById(toolbarId);\n    if (!toolbar) {\n      var toolbar = document.createElement(\"div\");\n      toolbar.setAttribute(\"id\", toolbarId);\n      toolbar.style.position = \"relative\";\n      toolbar.style.top = \"\" + (-node.offsetHeight - 5) + \"px\";\n      toolbar.style.zIndex = 10;\n      node.appendChild(toolbar);\n    }\n    return toolbar;\n  };\n\n  // Statistic viewer at upper left corner of widget DOM <node>\n  //\n  Tools.addStats = function(node) {\n    var stats = new Tools.Stats();\n    stats.domElement.style.position = \"relative\";\n    stats.domElement.style.display = \"inline-block\";\n    stats.domElement.style.verticalAlign = \"top\";\n\n    // Install stats in toolbar\n    var toolbar = Tools.toolbarGet(node);\n    if (toolbar.firstChild)\n      toolbar.insertBefore(stats.domElement, toolbar.firstChild);\n    else\n      toolbar.appendChild(stats.domElement);\n    return stats;\n  };\n\n  // GUI menu at upper right corner of widget DOM <node> \n  //\n  Tools.Gui = function(node, flagOpen) {\n    this.node = node;\n    this.gui = new Tools.dat.GUI({autoPlace: false});\n    this.gui.domElement.style.position = \"relative\";\n    this.gui.domElement.style.display = \"inline-block\";\n    this.gui.domElement.style.verticalAlign = \"top\";\n    this.gui.domElement.style.zIndex = 20;\n    //this.onTiddlerRefresh();\n    if (flagOpen)\n      this.gui.open();\n    else\n      this.gui.close();\n\n    // Install menu in toolbar\n    this.toolbar = Tools.toolbarGet(this.node);\n    this.toolbar.appendChild(this.gui.domElement);\n  };\n  Tools.Gui.prototype = {\n    get: function() {\n      return this.gui;\n    },\n    onTiddlerRefresh: function() {\n      var offset = this.toolbar.childNodes.length >= 2 ? this.toolbar.firstChild.offsetWidth : 0;\n      var left = this.toolbar.offsetWidth - offset < 245 ? 0 : this.toolbar.offsetWidth - offset - 245;\n      this.gui.domElement.style.left = \"\" + left + \"px\";\n    }\n  };\n\n  // Export renderer's view to tiddler\n  // Parameters :\n  //   <renderer> : renderer.\n  //   <tiddlerTitle> : title of the target tiddler with respect to the filesystem mode configuration.\n  //   <type> : type of tiddler : \"image/png\" (default), \"image/jpeg\" or \"image/svg+xml\".\n  //   <flagOverwrite> : if true, overwrite existing tiddler without asking.\n  // Saves renderer's wiew as a tiddler with required type.\n  //\n  Tools.exportView = function(renderer, tiddlerTitle, type, flagOverwrite) {\n    var func = \"Tools.exportView\";\n    if (!renderer.domElement) return;\n    var tag = renderer.domElement.tagName.toUpperCase();\n    if ((((type == \"image/png\") || (type == \"image/jpeg\")) && (tag != \"CANVAS\")) ||\n        ((type == \"image/svg+xml\") && (tag != \"SVG\"))) {\n      console.error(func+\": bad tiddler type : \"+type)\n      return;\n    }\n    TiddlyWiki.exportToTiddler(renderer.domElement, \"tw:\"+tiddlerTitle, type, flagOverwrite);\n  };\n\n  // Execute code when a condition is fulfilled\n  // Parameters :\n  //   <funcTest> : returns true when the condition is fulfilled, false otherwise.\n  //   <funcExec> : code to execute.\n  //   <periodicity> : periodicity of the active waiting mechanism (250 ms by default).\n  //\n  Tools.wait = function(funcTest, funcExec, periodicity) {\n    var func = \"Tools.wait\", flagNoLog = true;\n    var period = 250; // periodicity in ms\n    if (periodicity) period = periodicity;\n    var timerId = null;\n    var doWait = function() {\n      var func = \"Tools.wait/doWait\";\n      if (!funcTest()) return;\n\n      // Test OK\n      hack.log(\"test OK !\", flagNoLog, func);\n      clearInterval(timerId);\n      funcExec();\n    };\n    timerId = setInterval(doWait, period);\n  };\n\n  exports.Tools = Tools;\n})();"
        },
        "$:/plugins/rboue/Three.js/Lib/stats-min.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/stats-min.js",
            "module-type": "library",
            "text": "(function(){\n// stats.js - http://github.com/mrdoob/stats.js\nvar Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement(\"div\");f.id=\"stats\";f.addEventListener(\"mousedown\",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText=\"width:80px;opacity:0.9;cursor:pointer\";var a=document.createElement(\"div\");a.id=\"fps\";a.style.cssText=\"padding:0 0 3px 3px;text-align:left;background-color:#002\";f.appendChild(a);var i=document.createElement(\"div\");i.id=\"fpsText\";i.style.cssText=\"color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px\";\ni.innerHTML=\"FPS\";a.appendChild(i);var c=document.createElement(\"div\");c.id=\"fpsGraph\";c.style.cssText=\"position:relative;width:74px;height:30px;background-color:#0ff\";for(a.appendChild(c);74>c.children.length;){var j=document.createElement(\"span\");j.style.cssText=\"width:1px;height:30px;float:left;background-color:#113\";c.appendChild(j)}var d=document.createElement(\"div\");d.id=\"ms\";d.style.cssText=\"padding:0 0 3px 3px;text-align:left;background-color:#020;display:none\";f.appendChild(d);var k=document.createElement(\"div\");\nk.id=\"msText\";k.style.cssText=\"color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px\";k.innerHTML=\"MS\";d.appendChild(k);var e=document.createElement(\"div\");e.id=\"msGraph\";e.style.cssText=\"position:relative;width:74px;height:30px;background-color:#0f0\";for(d.appendChild(e);74>e.children.length;)j=document.createElement(\"span\"),j.style.cssText=\"width:1px;height:30px;float:left;background-color:#131\",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display=\n\"block\";d.style.display=\"none\";break;case 1:a.style.display=\"none\",d.style.display=\"block\"}};return{REVISION:11,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+\" MS (\"+n+\"-\"+o+\")\";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+\"px\";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+\" FPS (\"+p+\"-\"+q+\")\",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height=\na+\"px\",m=b,r=0);return b},update:function(){l=this.end()}}};\n\nexports.Stats = Stats;})();\n"
        },
        "$:/plugins/rboue/Three.js/Lib/dat-gui-min.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/dat-gui-min.js",
            "module-type": "library",
            "text": "(function(){\n/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\nvar dat=dat||{};dat.gui=dat.gui||{};dat.utils=dat.utils||{};dat.controllers=dat.controllers||{};dat.dom=dat.dom||{};dat.color=dat.color||{};dat.utils.css=function(){return{load:function(e,a){var a=a||document,c=a.createElement(\"link\");c.type=\"text/css\";c.rel=\"stylesheet\";c.href=e;a.getElementsByTagName(\"head\")[0].appendChild(c)},inject:function(e,a){var a=a||document,c=document.createElement(\"style\");c.type=\"text/css\";c.innerHTML=e;a.getElementsByTagName(\"head\")[0].appendChild(c)}}}();\ndat.utils.common=function(){var e=Array.prototype.forEach,a=Array.prototype.slice;return{BREAK:{},extend:function(c){this.each(a.call(arguments,1),function(a){for(var f in a)this.isUndefined(a[f])||(c[f]=a[f])},this);return c},defaults:function(c){this.each(a.call(arguments,1),function(a){for(var f in a)this.isUndefined(c[f])&&(c[f]=a[f])},this);return c},compose:function(){var c=a.call(arguments);return function(){for(var d=a.call(arguments),f=c.length-1;f>=0;f--)d=[c[f].apply(this,d)];return d[0]}},\neach:function(a,d,f){if(e&&a.forEach===e)a.forEach(d,f);else if(a.length===a.length+0)for(var b=0,n=a.length;b<n;b++){if(b in a&&d.call(f,a[b],b)===this.BREAK)break}else for(b in a)if(d.call(f,a[b],b)===this.BREAK)break},defer:function(a){setTimeout(a,0)},toArray:function(c){return c.toArray?c.toArray():a.call(c)},isUndefined:function(a){return a===void 0},isNull:function(a){return a===null},isNaN:function(a){return a!==a},isArray:Array.isArray||function(a){return a.constructor===Array},isObject:function(a){return a===\nObject(a)},isNumber:function(a){return a===a+0},isString:function(a){return a===a+\"\"},isBoolean:function(a){return a===false||a===true},isFunction:function(a){return Object.prototype.toString.call(a)===\"[object Function]\"}}}();\ndat.controllers.Controller=function(e){var a=function(a,d){this.initialValue=a[d];this.domElement=document.createElement(\"div\");this.object=a;this.property=d;this.__onFinishChange=this.__onChange=void 0};e.extend(a.prototype,{onChange:function(a){this.__onChange=a;return this},onFinishChange:function(a){this.__onFinishChange=a;return this},setValue:function(a){this.object[this.property]=a;this.__onChange&&this.__onChange.call(this,a);this.updateDisplay();return this},getValue:function(){return this.object[this.property]},\nupdateDisplay:function(){return this},isModified:function(){return this.initialValue!==this.getValue()}});return a}(dat.utils.common);\ndat.dom.dom=function(e){function a(b){if(b===\"0\"||e.isUndefined(b))return 0;b=b.match(d);return!e.isNull(b)?parseFloat(b[1]):0}var c={};e.each({HTMLEvents:[\"change\"],MouseEvents:[\"click\",\"mousemove\",\"mousedown\",\"mouseup\",\"mouseover\"],KeyboardEvents:[\"keydown\"]},function(b,a){e.each(b,function(b){c[b]=a})});var d=/(\\d+(\\.\\d+)?)px/,f={makeSelectable:function(b,a){if(!(b===void 0||b.style===void 0))b.onselectstart=a?function(){return false}:function(){},b.style.MozUserSelect=a?\"auto\":\"none\",b.style.KhtmlUserSelect=\na?\"auto\":\"none\",b.unselectable=a?\"on\":\"off\"},makeFullscreen:function(b,a,d){e.isUndefined(a)&&(a=true);e.isUndefined(d)&&(d=true);b.style.position=\"absolute\";if(a)b.style.left=0,b.style.right=0;if(d)b.style.top=0,b.style.bottom=0},fakeEvent:function(b,a,d,f){var d=d||{},m=c[a];if(!m)throw Error(\"Event type \"+a+\" not supported.\");var l=document.createEvent(m);switch(m){case \"MouseEvents\":l.initMouseEvent(a,d.bubbles||false,d.cancelable||true,window,d.clickCount||1,0,0,d.x||d.clientX||0,d.y||d.clientY||\n0,false,false,false,false,0,null);break;case \"KeyboardEvents\":m=l.initKeyboardEvent||l.initKeyEvent;e.defaults(d,{cancelable:true,ctrlKey:false,altKey:false,shiftKey:false,metaKey:false,keyCode:void 0,charCode:void 0});m(a,d.bubbles||false,d.cancelable,window,d.ctrlKey,d.altKey,d.shiftKey,d.metaKey,d.keyCode,d.charCode);break;default:l.initEvent(a,d.bubbles||false,d.cancelable||true)}e.defaults(l,f);b.dispatchEvent(l)},bind:function(b,a,d,c){b.addEventListener?b.addEventListener(a,d,c||false):b.attachEvent&&\nb.attachEvent(\"on\"+a,d);return f},unbind:function(b,a,d,c){b.removeEventListener?b.removeEventListener(a,d,c||false):b.detachEvent&&b.detachEvent(\"on\"+a,d);return f},addClass:function(b,a){if(b.className===void 0)b.className=a;else if(b.className!==a){var d=b.className.split(/ +/);if(d.indexOf(a)==-1)d.push(a),b.className=d.join(\" \").replace(/^\\s+/,\"\").replace(/\\s+$/,\"\")}return f},removeClass:function(b,a){if(a){if(b.className!==void 0)if(b.className===a)b.removeAttribute(\"class\");else{var d=b.className.split(/ +/),\nc=d.indexOf(a);if(c!=-1)d.splice(c,1),b.className=d.join(\" \")}}else b.className=void 0;return f},hasClass:function(a,d){return RegExp(\"(?:^|\\\\s+)\"+d+\"(?:\\\\s+|$)\").test(a.className)||false},getWidth:function(b){b=getComputedStyle(b);return a(b[\"border-left-width\"])+a(b[\"border-right-width\"])+a(b[\"padding-left\"])+a(b[\"padding-right\"])+a(b.width)},getHeight:function(b){b=getComputedStyle(b);return a(b[\"border-top-width\"])+a(b[\"border-bottom-width\"])+a(b[\"padding-top\"])+a(b[\"padding-bottom\"])+a(b.height)},\ngetOffset:function(a){var d={left:0,top:0};if(a.offsetParent){do d.left+=a.offsetLeft,d.top+=a.offsetTop;while(a=a.offsetParent)}return d},isActive:function(a){return a===document.activeElement&&(a.type||a.href)}};return f}(dat.utils.common);\ndat.controllers.OptionController=function(e,a,c){var d=function(f,b,e){d.superclass.call(this,f,b);var h=this;this.__select=document.createElement(\"select\");if(c.isArray(e)){var j={};c.each(e,function(a){j[a]=a});e=j}c.each(e,function(a,b){var d=document.createElement(\"option\");d.innerHTML=b;d.setAttribute(\"value\",a);h.__select.appendChild(d)});this.updateDisplay();a.bind(this.__select,\"change\",function(){h.setValue(this.options[this.selectedIndex].value)});this.domElement.appendChild(this.__select)};\nd.superclass=e;c.extend(d.prototype,e.prototype,{setValue:function(a){a=d.superclass.prototype.setValue.call(this,a);this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue());return a},updateDisplay:function(){this.__select.value=this.getValue();return d.superclass.prototype.updateDisplay.call(this)}});return d}(dat.controllers.Controller,dat.dom.dom,dat.utils.common);\ndat.controllers.NumberController=function(e,a){var c=function(d,f,b){c.superclass.call(this,d,f);b=b||{};this.__min=b.min;this.__max=b.max;this.__step=b.step;d=this.__impliedStep=a.isUndefined(this.__step)?this.initialValue==0?1:Math.pow(10,Math.floor(Math.log(this.initialValue)/Math.LN10))/10:this.__step;d=d.toString();this.__precision=d.indexOf(\".\")>-1?d.length-d.indexOf(\".\")-1:0};c.superclass=e;a.extend(c.prototype,e.prototype,{setValue:function(a){if(this.__min!==void 0&&a<this.__min)a=this.__min;\nelse if(this.__max!==void 0&&a>this.__max)a=this.__max;this.__step!==void 0&&a%this.__step!=0&&(a=Math.round(a/this.__step)*this.__step);return c.superclass.prototype.setValue.call(this,a)},min:function(a){this.__min=a;return this},max:function(a){this.__max=a;return this},step:function(a){this.__step=a;return this}});return c}(dat.controllers.Controller,dat.utils.common);\ndat.controllers.NumberControllerBox=function(e,a,c){var d=function(f,b,e){function h(){var a=parseFloat(l.__input.value);c.isNaN(a)||l.setValue(a)}function j(a){var b=o-a.clientY;l.setValue(l.getValue()+b*l.__impliedStep);o=a.clientY}function m(){a.unbind(window,\"mousemove\",j);a.unbind(window,\"mouseup\",m)}this.__truncationSuspended=false;d.superclass.call(this,f,b,e);var l=this,o;this.__input=document.createElement(\"input\");this.__input.setAttribute(\"type\",\"text\");a.bind(this.__input,\"change\",h);\na.bind(this.__input,\"blur\",function(){h();l.__onFinishChange&&l.__onFinishChange.call(l,l.getValue())});a.bind(this.__input,\"mousedown\",function(b){a.bind(window,\"mousemove\",j);a.bind(window,\"mouseup\",m);o=b.clientY});a.bind(this.__input,\"keydown\",function(a){if(a.keyCode===13)l.__truncationSuspended=true,this.blur(),l.__truncationSuspended=false});this.updateDisplay();this.domElement.appendChild(this.__input)};d.superclass=e;c.extend(d.prototype,e.prototype,{updateDisplay:function(){var a=this.__input,\nb;if(this.__truncationSuspended)b=this.getValue();else{b=this.getValue();var c=Math.pow(10,this.__precision);b=Math.round(b*c)/c}a.value=b;return d.superclass.prototype.updateDisplay.call(this)}});return d}(dat.controllers.NumberController,dat.dom.dom,dat.utils.common);\ndat.controllers.NumberControllerSlider=function(e,a,c,d,f){var b=function(d,c,f,e,l){function o(b){b.preventDefault();var d=a.getOffset(g.__background),c=a.getWidth(g.__background);g.setValue(g.__min+(g.__max-g.__min)*((b.clientX-d.left)/(d.left+c-d.left)));return false}function y(){a.unbind(window,\"mousemove\",o);a.unbind(window,\"mouseup\",y);g.__onFinishChange&&g.__onFinishChange.call(g,g.getValue())}b.superclass.call(this,d,c,{min:f,max:e,step:l});var g=this;this.__background=document.createElement(\"div\");\nthis.__foreground=document.createElement(\"div\");a.bind(this.__background,\"mousedown\",function(b){a.bind(window,\"mousemove\",o);a.bind(window,\"mouseup\",y);o(b)});a.addClass(this.__background,\"slider\");a.addClass(this.__foreground,\"slider-fg\");this.updateDisplay();this.__background.appendChild(this.__foreground);this.domElement.appendChild(this.__background)};b.superclass=e;b.useDefaultStyles=function(){c.inject(f)};d.extend(b.prototype,e.prototype,{updateDisplay:function(){this.__foreground.style.width=\n(this.getValue()-this.__min)/(this.__max-this.__min)*100+\"%\";return b.superclass.prototype.updateDisplay.call(this)}});return b}(dat.controllers.NumberController,dat.dom.dom,dat.utils.css,dat.utils.common,\".slider {\\n  box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\\n  height: 1em;\\n  border-radius: 1em;\\n  background-color: #eee;\\n  padding: 0 0.5em;\\n  overflow: hidden;\\n}\\n\\n.slider-fg {\\n  padding: 1px 0 2px 0;\\n  background-color: #aaa;\\n  height: 1em;\\n  margin-left: -0.5em;\\n  padding-right: 0.5em;\\n  border-radius: 1em 0 0 1em;\\n}\\n\\n.slider-fg:after {\\n  display: inline-block;\\n  border-radius: 1em;\\n  background-color: #fff;\\n  border:  1px solid #aaa;\\n  content: '';\\n  float: right;\\n  margin-right: -1em;\\n  margin-top: -1px;\\n  height: 0.9em;\\n  width: 0.9em;\\n}\");\ndat.controllers.FunctionController=function(e,a,c){var d=function(c,b,e){d.superclass.call(this,c,b);var h=this;this.__button=document.createElement(\"div\");this.__button.innerHTML=e===void 0?\"Fire\":e;a.bind(this.__button,\"click\",function(a){a.preventDefault();h.fire();return false});a.addClass(this.__button,\"button\");this.domElement.appendChild(this.__button)};d.superclass=e;c.extend(d.prototype,e.prototype,{fire:function(){this.__onChange&&this.__onChange.call(this);this.__onFinishChange&&this.__onFinishChange.call(this,\nthis.getValue());this.getValue().call(this.object)}});return d}(dat.controllers.Controller,dat.dom.dom,dat.utils.common);\ndat.controllers.BooleanController=function(e,a,c){var d=function(c,b){d.superclass.call(this,c,b);var e=this;this.__prev=this.getValue();this.__checkbox=document.createElement(\"input\");this.__checkbox.setAttribute(\"type\",\"checkbox\");a.bind(this.__checkbox,\"change\",function(){e.setValue(!e.__prev)},false);this.domElement.appendChild(this.__checkbox);this.updateDisplay()};d.superclass=e;c.extend(d.prototype,e.prototype,{setValue:function(a){a=d.superclass.prototype.setValue.call(this,a);this.__onFinishChange&&\nthis.__onFinishChange.call(this,this.getValue());this.__prev=this.getValue();return a},updateDisplay:function(){this.getValue()===true?(this.__checkbox.setAttribute(\"checked\",\"checked\"),this.__checkbox.checked=true):this.__checkbox.checked=false;return d.superclass.prototype.updateDisplay.call(this)}});return d}(dat.controllers.Controller,dat.dom.dom,dat.utils.common);\ndat.color.toString=function(e){return function(a){if(a.a==1||e.isUndefined(a.a)){for(a=a.hex.toString(16);a.length<6;)a=\"0\"+a;return\"#\"+a}else return\"rgba(\"+Math.round(a.r)+\",\"+Math.round(a.g)+\",\"+Math.round(a.b)+\",\"+a.a+\")\"}}(dat.utils.common);\ndat.color.interpret=function(e,a){var c,d,f=[{litmus:a.isString,conversions:{THREE_CHAR_HEX:{read:function(a){a=a.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return a===null?false:{space:\"HEX\",hex:parseInt(\"0x\"+a[1].toString()+a[1].toString()+a[2].toString()+a[2].toString()+a[3].toString()+a[3].toString())}},write:e},SIX_CHAR_HEX:{read:function(a){a=a.match(/^#([A-F0-9]{6})$/i);return a===null?false:{space:\"HEX\",hex:parseInt(\"0x\"+a[1].toString())}},write:e},CSS_RGB:{read:function(a){a=a.match(/^rgb\\(\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*\\)/);\nreturn a===null?false:{space:\"RGB\",r:parseFloat(a[1]),g:parseFloat(a[2]),b:parseFloat(a[3])}},write:e},CSS_RGBA:{read:function(a){a=a.match(/^rgba\\(\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*\\,\\s*(.+)\\s*\\)/);return a===null?false:{space:\"RGB\",r:parseFloat(a[1]),g:parseFloat(a[2]),b:parseFloat(a[3]),a:parseFloat(a[4])}},write:e}}},{litmus:a.isNumber,conversions:{HEX:{read:function(a){return{space:\"HEX\",hex:a,conversionName:\"HEX\"}},write:function(a){return a.hex}}}},{litmus:a.isArray,conversions:{RGB_ARRAY:{read:function(a){return a.length!=\n3?false:{space:\"RGB\",r:a[0],g:a[1],b:a[2]}},write:function(a){return[a.r,a.g,a.b]}},RGBA_ARRAY:{read:function(a){return a.length!=4?false:{space:\"RGB\",r:a[0],g:a[1],b:a[2],a:a[3]}},write:function(a){return[a.r,a.g,a.b,a.a]}}}},{litmus:a.isObject,conversions:{RGBA_OBJ:{read:function(b){return a.isNumber(b.r)&&a.isNumber(b.g)&&a.isNumber(b.b)&&a.isNumber(b.a)?{space:\"RGB\",r:b.r,g:b.g,b:b.b,a:b.a}:false},write:function(a){return{r:a.r,g:a.g,b:a.b,a:a.a}}},RGB_OBJ:{read:function(b){return a.isNumber(b.r)&&\na.isNumber(b.g)&&a.isNumber(b.b)?{space:\"RGB\",r:b.r,g:b.g,b:b.b}:false},write:function(a){return{r:a.r,g:a.g,b:a.b}}},HSVA_OBJ:{read:function(b){return a.isNumber(b.h)&&a.isNumber(b.s)&&a.isNumber(b.v)&&a.isNumber(b.a)?{space:\"HSV\",h:b.h,s:b.s,v:b.v,a:b.a}:false},write:function(a){return{h:a.h,s:a.s,v:a.v,a:a.a}}},HSV_OBJ:{read:function(b){return a.isNumber(b.h)&&a.isNumber(b.s)&&a.isNumber(b.v)?{space:\"HSV\",h:b.h,s:b.s,v:b.v}:false},write:function(a){return{h:a.h,s:a.s,v:a.v}}}}}];return function(){d=\nfalse;var b=arguments.length>1?a.toArray(arguments):arguments[0];a.each(f,function(e){if(e.litmus(b))return a.each(e.conversions,function(e,f){c=e.read(b);if(d===false&&c!==false)return d=c,c.conversionName=f,c.conversion=e,a.BREAK}),a.BREAK});return d}}(dat.color.toString,dat.utils.common);\ndat.GUI=dat.gui.GUI=function(e,a,c,d,f,b,n,h,j,m,l,o,y,g,i){function q(a,b,r,c){if(b[r]===void 0)throw Error(\"Object \"+b+' has no property \"'+r+'\"');c.color?b=new l(b,r):(b=[b,r].concat(c.factoryArgs),b=d.apply(a,b));if(c.before instanceof f)c.before=c.before.__li;t(a,b);g.addClass(b.domElement,\"c\");r=document.createElement(\"span\");g.addClass(r,\"property-name\");r.innerHTML=b.property;var e=document.createElement(\"div\");e.appendChild(r);e.appendChild(b.domElement);c=s(a,e,c.before);g.addClass(c,k.CLASS_CONTROLLER_ROW);\ng.addClass(c,typeof b.getValue());p(a,c,b);a.__controllers.push(b);return b}function s(a,b,d){var c=document.createElement(\"li\");b&&c.appendChild(b);d?a.__ul.insertBefore(c,params.before):a.__ul.appendChild(c);a.onResize();return c}function p(a,d,c){c.__li=d;c.__gui=a;i.extend(c,{options:function(b){if(arguments.length>1)return c.remove(),q(a,c.object,c.property,{before:c.__li.nextElementSibling,factoryArgs:[i.toArray(arguments)]});if(i.isArray(b)||i.isObject(b))return c.remove(),q(a,c.object,c.property,\n{before:c.__li.nextElementSibling,factoryArgs:[b]})},name:function(a){c.__li.firstElementChild.firstElementChild.innerHTML=a;return c},listen:function(){c.__gui.listen(c);return c},remove:function(){c.__gui.remove(c);return c}});if(c instanceof j){var e=new h(c.object,c.property,{min:c.__min,max:c.__max,step:c.__step});i.each([\"updateDisplay\",\"onChange\",\"onFinishChange\"],function(a){var b=c[a],H=e[a];c[a]=e[a]=function(){var a=Array.prototype.slice.call(arguments);b.apply(c,a);return H.apply(e,a)}});\ng.addClass(d,\"has-slider\");c.domElement.insertBefore(e.domElement,c.domElement.firstElementChild)}else if(c instanceof h){var f=function(b){return i.isNumber(c.__min)&&i.isNumber(c.__max)?(c.remove(),q(a,c.object,c.property,{before:c.__li.nextElementSibling,factoryArgs:[c.__min,c.__max,c.__step]})):b};c.min=i.compose(f,c.min);c.max=i.compose(f,c.max)}else if(c instanceof b)g.bind(d,\"click\",function(){g.fakeEvent(c.__checkbox,\"click\")}),g.bind(c.__checkbox,\"click\",function(a){a.stopPropagation()});\nelse if(c instanceof n)g.bind(d,\"click\",function(){g.fakeEvent(c.__button,\"click\")}),g.bind(d,\"mouseover\",function(){g.addClass(c.__button,\"hover\")}),g.bind(d,\"mouseout\",function(){g.removeClass(c.__button,\"hover\")});else if(c instanceof l)g.addClass(d,\"color\"),c.updateDisplay=i.compose(function(a){d.style.borderLeftColor=c.__color.toString();return a},c.updateDisplay),c.updateDisplay();c.setValue=i.compose(function(b){a.getRoot().__preset_select&&c.isModified()&&B(a.getRoot(),true);return b},c.setValue)}\nfunction t(a,b){var c=a.getRoot(),d=c.__rememberedObjects.indexOf(b.object);if(d!=-1){var e=c.__rememberedObjectIndecesToControllers[d];e===void 0&&(e={},c.__rememberedObjectIndecesToControllers[d]=e);e[b.property]=b;if(c.load&&c.load.remembered){c=c.load.remembered;if(c[a.preset])c=c[a.preset];else if(c[w])c=c[w];else return;if(c[d]&&c[d][b.property]!==void 0)d=c[d][b.property],b.initialValue=d,b.setValue(d)}}}function I(a){var b=a.__save_row=document.createElement(\"li\");g.addClass(a.domElement,\n\"has-save\");a.__ul.insertBefore(b,a.__ul.firstChild);g.addClass(b,\"save-row\");var c=document.createElement(\"span\");c.innerHTML=\"&nbsp;\";g.addClass(c,\"button gears\");var d=document.createElement(\"span\");d.innerHTML=\"Save\";g.addClass(d,\"button\");g.addClass(d,\"save\");var e=document.createElement(\"span\");e.innerHTML=\"New\";g.addClass(e,\"button\");g.addClass(e,\"save-as\");var f=document.createElement(\"span\");f.innerHTML=\"Revert\";g.addClass(f,\"button\");g.addClass(f,\"revert\");var m=a.__preset_select=document.createElement(\"select\");\na.load&&a.load.remembered?i.each(a.load.remembered,function(b,c){C(a,c,c==a.preset)}):C(a,w,false);g.bind(m,\"change\",function(){for(var b=0;b<a.__preset_select.length;b++)a.__preset_select[b].innerHTML=a.__preset_select[b].value;a.preset=this.value});b.appendChild(m);b.appendChild(c);b.appendChild(d);b.appendChild(e);b.appendChild(f);if(u){var b=document.getElementById(\"dg-save-locally\"),l=document.getElementById(\"dg-local-explain\");b.style.display=\"block\";b=document.getElementById(\"dg-local-storage\");\nlocalStorage.getItem(document.location.href+\".isLocal\")===\"true\"&&b.setAttribute(\"checked\",\"checked\");var o=function(){l.style.display=a.useLocalStorage?\"block\":\"none\"};o();g.bind(b,\"change\",function(){a.useLocalStorage=!a.useLocalStorage;o()})}var h=document.getElementById(\"dg-new-constructor\");g.bind(h,\"keydown\",function(a){a.metaKey&&(a.which===67||a.keyCode==67)&&x.hide()});g.bind(c,\"click\",function(){h.innerHTML=JSON.stringify(a.getSaveObject(),void 0,2);x.show();h.focus();h.select()});g.bind(d,\n\"click\",function(){a.save()});g.bind(e,\"click\",function(){var b=prompt(\"Enter a new preset name.\");b&&a.saveAs(b)});g.bind(f,\"click\",function(){a.revert()})}function J(a){function b(f){f.preventDefault();e=f.clientX;g.addClass(a.__closeButton,k.CLASS_DRAG);g.bind(window,\"mousemove\",c);g.bind(window,\"mouseup\",d);return false}function c(b){b.preventDefault();a.width+=e-b.clientX;a.onResize();e=b.clientX;return false}function d(){g.removeClass(a.__closeButton,k.CLASS_DRAG);g.unbind(window,\"mousemove\",\nc);g.unbind(window,\"mouseup\",d)}a.__resize_handle=document.createElement(\"div\");i.extend(a.__resize_handle.style,{width:\"6px\",marginLeft:\"-3px\",height:\"200px\",cursor:\"ew-resize\",position:\"absolute\"});var e;g.bind(a.__resize_handle,\"mousedown\",b);g.bind(a.__closeButton,\"mousedown\",b);a.domElement.insertBefore(a.__resize_handle,a.domElement.firstElementChild)}function D(a,b){a.domElement.style.width=b+\"px\";if(a.__save_row&&a.autoPlace)a.__save_row.style.width=b+\"px\";if(a.__closeButton)a.__closeButton.style.width=\nb+\"px\"}function z(a,b){var c={};i.each(a.__rememberedObjects,function(d,e){var f={};i.each(a.__rememberedObjectIndecesToControllers[e],function(a,c){f[c]=b?a.initialValue:a.getValue()});c[e]=f});return c}function C(a,b,c){var d=document.createElement(\"option\");d.innerHTML=b;d.value=b;a.__preset_select.appendChild(d);if(c)a.__preset_select.selectedIndex=a.__preset_select.length-1}function B(a,b){var c=a.__preset_select[a.__preset_select.selectedIndex];c.innerHTML=b?c.value+\"*\":c.value}function E(a){a.length!=\n0&&o(function(){E(a)});i.each(a,function(a){a.updateDisplay()})}e.inject(c);var w=\"Default\",u;try{u=\"localStorage\"in window&&window.localStorage!==null}catch(K){u=false}var x,F=true,v,A=false,G=[],k=function(a){function b(){localStorage.setItem(document.location.href+\".gui\",JSON.stringify(d.getSaveObject()))}function c(){var a=d.getRoot();a.width+=1;i.defer(function(){a.width-=1})}var d=this;this.domElement=document.createElement(\"div\");this.__ul=document.createElement(\"ul\");this.domElement.appendChild(this.__ul);\ng.addClass(this.domElement,\"dg\");this.__folders={};this.__controllers=[];this.__rememberedObjects=[];this.__rememberedObjectIndecesToControllers=[];this.__listening=[];a=a||{};a=i.defaults(a,{autoPlace:true,width:k.DEFAULT_WIDTH});a=i.defaults(a,{resizable:a.autoPlace,hideable:a.autoPlace});if(i.isUndefined(a.load))a.load={preset:w};else if(a.preset)a.load.preset=a.preset;i.isUndefined(a.parent)&&a.hideable&&G.push(this);a.resizable=i.isUndefined(a.parent)&&a.resizable;if(a.autoPlace&&i.isUndefined(a.scrollable))a.scrollable=\ntrue;var e=u&&localStorage.getItem(document.location.href+\".isLocal\")===\"true\";Object.defineProperties(this,{parent:{get:function(){return a.parent}},scrollable:{get:function(){return a.scrollable}},autoPlace:{get:function(){return a.autoPlace}},preset:{get:function(){return d.parent?d.getRoot().preset:a.load.preset},set:function(b){d.parent?d.getRoot().preset=b:a.load.preset=b;for(b=0;b<this.__preset_select.length;b++)if(this.__preset_select[b].value==this.preset)this.__preset_select.selectedIndex=\nb;d.revert()}},width:{get:function(){return a.width},set:function(b){a.width=b;D(d,b)}},name:{get:function(){return a.name},set:function(b){a.name=b;if(m)m.innerHTML=a.name}},closed:{get:function(){return a.closed},set:function(b){a.closed=b;a.closed?g.addClass(d.__ul,k.CLASS_CLOSED):g.removeClass(d.__ul,k.CLASS_CLOSED);this.onResize();if(d.__closeButton)d.__closeButton.innerHTML=b?k.TEXT_OPEN:k.TEXT_CLOSED}},load:{get:function(){return a.load}},useLocalStorage:{get:function(){return e},set:function(a){u&&\n((e=a)?g.bind(window,\"unload\",b):g.unbind(window,\"unload\",b),localStorage.setItem(document.location.href+\".isLocal\",a))}}});if(i.isUndefined(a.parent)){a.closed=false;g.addClass(this.domElement,k.CLASS_MAIN);g.makeSelectable(this.domElement,false);if(u&&e){d.useLocalStorage=true;var f=localStorage.getItem(document.location.href+\".gui\");if(f)a.load=JSON.parse(f)}this.__closeButton=document.createElement(\"div\");this.__closeButton.innerHTML=k.TEXT_CLOSED;g.addClass(this.__closeButton,k.CLASS_CLOSE_BUTTON);\nthis.domElement.appendChild(this.__closeButton);g.bind(this.__closeButton,\"click\",function(){d.closed=!d.closed})}else{if(a.closed===void 0)a.closed=true;var m=document.createTextNode(a.name);g.addClass(m,\"controller-name\");f=s(d,m);g.addClass(this.__ul,k.CLASS_CLOSED);g.addClass(f,\"title\");g.bind(f,\"click\",function(a){a.preventDefault();d.closed=!d.closed;return false});if(!a.closed)this.closed=false}a.autoPlace&&(i.isUndefined(a.parent)&&(F&&(v=document.createElement(\"div\"),g.addClass(v,\"dg\"),g.addClass(v,\nk.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(v),F=false),v.appendChild(this.domElement),g.addClass(this.domElement,k.CLASS_AUTO_PLACE)),this.parent||D(d,a.width));g.bind(window,\"resize\",function(){d.onResize()});g.bind(this.__ul,\"webkitTransitionEnd\",function(){d.onResize()});g.bind(this.__ul,\"transitionend\",function(){d.onResize()});g.bind(this.__ul,\"oTransitionEnd\",function(){d.onResize()});this.onResize();a.resizable&&J(this);d.getRoot();a.parent||c()};k.toggleHide=function(){A=!A;i.each(G,\nfunction(a){a.domElement.style.zIndex=A?-999:999;a.domElement.style.opacity=A?0:1})};k.CLASS_AUTO_PLACE=\"a\";k.CLASS_AUTO_PLACE_CONTAINER=\"ac\";k.CLASS_MAIN=\"main\";k.CLASS_CONTROLLER_ROW=\"cr\";k.CLASS_TOO_TALL=\"taller-than-window\";k.CLASS_CLOSED=\"closed\";k.CLASS_CLOSE_BUTTON=\"close-button\";k.CLASS_DRAG=\"drag\";k.DEFAULT_WIDTH=245;k.TEXT_CLOSED=\"Close Controls\";k.TEXT_OPEN=\"Open Controls\";g.bind(window,\"keydown\",function(a){document.activeElement.type!==\"text\"&&(a.which===72||a.keyCode==72)&&k.toggleHide()},\nfalse);i.extend(k.prototype,{add:function(a,b){return q(this,a,b,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(a,b){return q(this,a,b,{color:true})},remove:function(a){this.__ul.removeChild(a.__li);this.__controllers.slice(this.__controllers.indexOf(a),1);var b=this;i.defer(function(){b.onResize()})},destroy:function(){this.autoPlace&&v.removeChild(this.domElement)},addFolder:function(a){if(this.__folders[a]!==void 0)throw Error('You already have a folder in this GUI by the name \"'+\na+'\"');var b={name:a,parent:this};b.autoPlace=this.autoPlace;if(this.load&&this.load.folders&&this.load.folders[a])b.closed=this.load.folders[a].closed,b.load=this.load.folders[a];b=new k(b);this.__folders[a]=b;a=s(this,b.domElement);g.addClass(a,\"folder\");return b},open:function(){this.closed=false},close:function(){this.closed=true},onResize:function(){var a=this.getRoot();if(a.scrollable){var b=g.getOffset(a.__ul).top,c=0;i.each(a.__ul.childNodes,function(b){a.autoPlace&&b===a.__save_row||(c+=\ng.getHeight(b))});window.innerHeight-b-20<c?(g.addClass(a.domElement,k.CLASS_TOO_TALL),a.__ul.style.height=window.innerHeight-b-20+\"px\"):(g.removeClass(a.domElement,k.CLASS_TOO_TALL),a.__ul.style.height=\"auto\")}a.__resize_handle&&i.defer(function(){a.__resize_handle.style.height=a.__ul.offsetHeight+\"px\"});if(a.__closeButton)a.__closeButton.style.width=a.width+\"px\"},remember:function(){if(i.isUndefined(x))x=new y,x.domElement.innerHTML=a;if(this.parent)throw Error(\"You can only call remember on a top level GUI.\");\nvar b=this;i.each(Array.prototype.slice.call(arguments),function(a){b.__rememberedObjects.length==0&&I(b);b.__rememberedObjects.indexOf(a)==-1&&b.__rememberedObjects.push(a)});this.autoPlace&&D(this,this.width)},getRoot:function(){for(var a=this;a.parent;)a=a.parent;return a},getSaveObject:function(){var a=this.load;a.closed=this.closed;if(this.__rememberedObjects.length>0){a.preset=this.preset;if(!a.remembered)a.remembered={};a.remembered[this.preset]=z(this)}a.folders={};i.each(this.__folders,function(b,\nc){a.folders[c]=b.getSaveObject()});return a},save:function(){if(!this.load.remembered)this.load.remembered={};this.load.remembered[this.preset]=z(this);B(this,false)},saveAs:function(a){if(!this.load.remembered)this.load.remembered={},this.load.remembered[w]=z(this,true);this.load.remembered[a]=z(this);this.preset=a;C(this,a,true)},revert:function(a){i.each(this.__controllers,function(b){this.getRoot().load.remembered?t(a||this.getRoot(),b):b.setValue(b.initialValue)},this);i.each(this.__folders,\nfunction(a){a.revert(a)});a||B(this.getRoot(),false)},listen:function(a){var b=this.__listening.length==0;this.__listening.push(a);b&&E(this.__listening)}});return k}(dat.utils.css,'<div id=\"dg-save\" class=\"dg dialogue\">\\n\\n  Here\\'s the new load parameter for your <code>GUI</code>\\'s constructor:\\n\\n  <textarea id=\"dg-new-constructor\"></textarea>\\n\\n  <div id=\"dg-save-locally\">\\n\\n    <input id=\"dg-local-storage\" type=\"checkbox\"/> Automatically save\\n    values to <code>localStorage</code> on exit.\\n\\n    <div id=\"dg-local-explain\">The values saved to <code>localStorage</code> will\\n      override those passed to <code>dat.GUI</code>\\'s constructor. This makes it\\n      easier to work incrementally, but <code>localStorage</code> is fragile,\\n      and your friends may not see the same values you do.\\n      \\n    </div>\\n    \\n  </div>\\n\\n</div>',\n\".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear;border:0;position:absolute;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-x:hidden}.dg.a.has-save ul{margin-top:27px}.dg.a.has-save ul.closed{margin-top:0}.dg.a .save-row{position:fixed;top:0;z-index:1002}.dg li{-webkit-transition:height 0.1s ease-out;-o-transition:height 0.1s ease-out;-moz-transition:height 0.1s ease-out;transition:height 0.1s ease-out}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;overflow:hidden;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li > *{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:9px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2fa1d6}.dg .cr.number input[type=text]{color:#2fa1d6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2fa1d6}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\\n\",\ndat.controllers.factory=function(e,a,c,d,f,b,n){return function(h,j,m,l){var o=h[j];if(n.isArray(m)||n.isObject(m))return new e(h,j,m);if(n.isNumber(o))return n.isNumber(m)&&n.isNumber(l)?new c(h,j,m,l):new a(h,j,{min:m,max:l});if(n.isString(o))return new d(h,j);if(n.isFunction(o))return new f(h,j,\"\");if(n.isBoolean(o))return new b(h,j)}}(dat.controllers.OptionController,dat.controllers.NumberControllerBox,dat.controllers.NumberControllerSlider,dat.controllers.StringController=function(e,a,c){var d=\nfunction(c,b){function e(){h.setValue(h.__input.value)}d.superclass.call(this,c,b);var h=this;this.__input=document.createElement(\"input\");this.__input.setAttribute(\"type\",\"text\");a.bind(this.__input,\"keyup\",e);a.bind(this.__input,\"change\",e);a.bind(this.__input,\"blur\",function(){h.__onFinishChange&&h.__onFinishChange.call(h,h.getValue())});a.bind(this.__input,\"keydown\",function(a){a.keyCode===13&&this.blur()});this.updateDisplay();this.domElement.appendChild(this.__input)};d.superclass=e;c.extend(d.prototype,\ne.prototype,{updateDisplay:function(){if(!a.isActive(this.__input))this.__input.value=this.getValue();return d.superclass.prototype.updateDisplay.call(this)}});return d}(dat.controllers.Controller,dat.dom.dom,dat.utils.common),dat.controllers.FunctionController,dat.controllers.BooleanController,dat.utils.common),dat.controllers.Controller,dat.controllers.BooleanController,dat.controllers.FunctionController,dat.controllers.NumberControllerBox,dat.controllers.NumberControllerSlider,dat.controllers.OptionController,\ndat.controllers.ColorController=function(e,a,c,d,f){function b(a,b,c,d){a.style.background=\"\";f.each(j,function(e){a.style.cssText+=\"background: \"+e+\"linear-gradient(\"+b+\", \"+c+\" 0%, \"+d+\" 100%); \"})}function n(a){a.style.background=\"\";a.style.cssText+=\"background: -moz-linear-gradient(top,  #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);\";a.style.cssText+=\"background: -webkit-linear-gradient(top,  #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);\";\na.style.cssText+=\"background: -o-linear-gradient(top,  #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);\";a.style.cssText+=\"background: -ms-linear-gradient(top,  #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);\";a.style.cssText+=\"background: linear-gradient(top,  #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);\"}var h=function(e,l){function o(b){q(b);a.bind(window,\"mousemove\",q);a.bind(window,\n\"mouseup\",j)}function j(){a.unbind(window,\"mousemove\",q);a.unbind(window,\"mouseup\",j)}function g(){var a=d(this.value);a!==false?(p.__color.__state=a,p.setValue(p.__color.toOriginal())):this.value=p.__color.toString()}function i(){a.unbind(window,\"mousemove\",s);a.unbind(window,\"mouseup\",i)}function q(b){b.preventDefault();var c=a.getWidth(p.__saturation_field),d=a.getOffset(p.__saturation_field),e=(b.clientX-d.left+document.body.scrollLeft)/c,b=1-(b.clientY-d.top+document.body.scrollTop)/c;b>1?b=\n1:b<0&&(b=0);e>1?e=1:e<0&&(e=0);p.__color.v=b;p.__color.s=e;p.setValue(p.__color.toOriginal());return false}function s(b){b.preventDefault();var c=a.getHeight(p.__hue_field),d=a.getOffset(p.__hue_field),b=1-(b.clientY-d.top+document.body.scrollTop)/c;b>1?b=1:b<0&&(b=0);p.__color.h=b*360;p.setValue(p.__color.toOriginal());return false}h.superclass.call(this,e,l);this.__color=new c(this.getValue());this.__temp=new c(0);var p=this;this.domElement=document.createElement(\"div\");a.makeSelectable(this.domElement,\nfalse);this.__selector=document.createElement(\"div\");this.__selector.className=\"selector\";this.__saturation_field=document.createElement(\"div\");this.__saturation_field.className=\"saturation-field\";this.__field_knob=document.createElement(\"div\");this.__field_knob.className=\"field-knob\";this.__field_knob_border=\"2px solid \";this.__hue_knob=document.createElement(\"div\");this.__hue_knob.className=\"hue-knob\";this.__hue_field=document.createElement(\"div\");this.__hue_field.className=\"hue-field\";this.__input=\ndocument.createElement(\"input\");this.__input.type=\"text\";this.__input_textShadow=\"0 1px 1px \";a.bind(this.__input,\"keydown\",function(a){a.keyCode===13&&g.call(this)});a.bind(this.__input,\"blur\",g);a.bind(this.__selector,\"mousedown\",function(){a.addClass(this,\"drag\").bind(window,\"mouseup\",function(){a.removeClass(p.__selector,\"drag\")})});var t=document.createElement(\"div\");f.extend(this.__selector.style,{width:\"122px\",height:\"102px\",padding:\"3px\",backgroundColor:\"#222\",boxShadow:\"0px 1px 3px rgba(0,0,0,0.3)\"});\nf.extend(this.__field_knob.style,{position:\"absolute\",width:\"12px\",height:\"12px\",border:this.__field_knob_border+(this.__color.v<0.5?\"#fff\":\"#000\"),boxShadow:\"0px 1px 3px rgba(0,0,0,0.5)\",borderRadius:\"12px\",zIndex:1});f.extend(this.__hue_knob.style,{position:\"absolute\",width:\"15px\",height:\"2px\",borderRight:\"4px solid #fff\",zIndex:1});f.extend(this.__saturation_field.style,{width:\"100px\",height:\"100px\",border:\"1px solid #555\",marginRight:\"3px\",display:\"inline-block\",cursor:\"pointer\"});f.extend(t.style,\n{width:\"100%\",height:\"100%\",background:\"none\"});b(t,\"top\",\"rgba(0,0,0,0)\",\"#000\");f.extend(this.__hue_field.style,{width:\"15px\",height:\"100px\",display:\"inline-block\",border:\"1px solid #555\",cursor:\"ns-resize\"});n(this.__hue_field);f.extend(this.__input.style,{outline:\"none\",textAlign:\"center\",color:\"#fff\",border:0,fontWeight:\"bold\",textShadow:this.__input_textShadow+\"rgba(0,0,0,0.7)\"});a.bind(this.__saturation_field,\"mousedown\",o);a.bind(this.__field_knob,\"mousedown\",o);a.bind(this.__hue_field,\"mousedown\",\nfunction(b){s(b);a.bind(window,\"mousemove\",s);a.bind(window,\"mouseup\",i)});this.__saturation_field.appendChild(t);this.__selector.appendChild(this.__field_knob);this.__selector.appendChild(this.__saturation_field);this.__selector.appendChild(this.__hue_field);this.__hue_field.appendChild(this.__hue_knob);this.domElement.appendChild(this.__input);this.domElement.appendChild(this.__selector);this.updateDisplay()};h.superclass=e;f.extend(h.prototype,e.prototype,{updateDisplay:function(){var a=d(this.getValue());\nif(a!==false){var e=false;f.each(c.COMPONENTS,function(b){if(!f.isUndefined(a[b])&&!f.isUndefined(this.__color.__state[b])&&a[b]!==this.__color.__state[b])return e=true,{}},this);e&&f.extend(this.__color.__state,a)}f.extend(this.__temp.__state,this.__color.__state);this.__temp.a=1;var h=this.__color.v<0.5||this.__color.s>0.5?255:0,j=255-h;f.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+\"px\",marginTop:100*(1-this.__color.v)-7+\"px\",backgroundColor:this.__temp.toString(),border:this.__field_knob_border+\n\"rgb(\"+h+\",\"+h+\",\"+h+\")\"});this.__hue_knob.style.marginTop=(1-this.__color.h/360)*100+\"px\";this.__temp.s=1;this.__temp.v=1;b(this.__saturation_field,\"left\",\"#fff\",this.__temp.toString());f.extend(this.__input.style,{backgroundColor:this.__input.value=this.__color.toString(),color:\"rgb(\"+h+\",\"+h+\",\"+h+\")\",textShadow:this.__input_textShadow+\"rgba(\"+j+\",\"+j+\",\"+j+\",.7)\"})}});var j=[\"-moz-\",\"-o-\",\"-webkit-\",\"-ms-\",\"\"];return h}(dat.controllers.Controller,dat.dom.dom,dat.color.Color=function(e,a,c,d){function f(a,\nb,c){Object.defineProperty(a,b,{get:function(){if(this.__state.space===\"RGB\")return this.__state[b];n(this,b,c);return this.__state[b]},set:function(a){if(this.__state.space!==\"RGB\")n(this,b,c),this.__state.space=\"RGB\";this.__state[b]=a}})}function b(a,b){Object.defineProperty(a,b,{get:function(){if(this.__state.space===\"HSV\")return this.__state[b];h(this);return this.__state[b]},set:function(a){if(this.__state.space!==\"HSV\")h(this),this.__state.space=\"HSV\";this.__state[b]=a}})}function n(b,c,e){if(b.__state.space===\n\"HEX\")b.__state[c]=a.component_from_hex(b.__state.hex,e);else if(b.__state.space===\"HSV\")d.extend(b.__state,a.hsv_to_rgb(b.__state.h,b.__state.s,b.__state.v));else throw\"Corrupted color state\";}function h(b){var c=a.rgb_to_hsv(b.r,b.g,b.b);d.extend(b.__state,{s:c.s,v:c.v});if(d.isNaN(c.h)){if(d.isUndefined(b.__state.h))b.__state.h=0}else b.__state.h=c.h}var j=function(){this.__state=e.apply(this,arguments);if(this.__state===false)throw\"Failed to interpret color arguments\";this.__state.a=this.__state.a||\n1};j.COMPONENTS=\"r,g,b,h,s,v,hex,a\".split(\",\");d.extend(j.prototype,{toString:function(){return c(this)},toOriginal:function(){return this.__state.conversion.write(this)}});f(j.prototype,\"r\",2);f(j.prototype,\"g\",1);f(j.prototype,\"b\",0);b(j.prototype,\"h\");b(j.prototype,\"s\");b(j.prototype,\"v\");Object.defineProperty(j.prototype,\"a\",{get:function(){return this.__state.a},set:function(a){this.__state.a=a}});Object.defineProperty(j.prototype,\"hex\",{get:function(){if(!this.__state.space!==\"HEX\")this.__state.hex=\na.rgb_to_hex(this.r,this.g,this.b);return this.__state.hex},set:function(a){this.__state.space=\"HEX\";this.__state.hex=a}});return j}(dat.color.interpret,dat.color.math=function(){var e;return{hsv_to_rgb:function(a,c,d){var e=a/60-Math.floor(a/60),b=d*(1-c),n=d*(1-e*c),c=d*(1-(1-e)*c),a=[[d,c,b],[n,d,b],[b,d,c],[b,n,d],[c,b,d],[d,b,n]][Math.floor(a/60)%6];return{r:a[0]*255,g:a[1]*255,b:a[2]*255}},rgb_to_hsv:function(a,c,d){var e=Math.min(a,c,d),b=Math.max(a,c,d),e=b-e;if(b==0)return{h:NaN,s:0,v:0};\na=a==b?(c-d)/e:c==b?2+(d-a)/e:4+(a-c)/e;a/=6;a<0&&(a+=1);return{h:a*360,s:e/b,v:b/255}},rgb_to_hex:function(a,c,d){a=this.hex_with_component(0,2,a);a=this.hex_with_component(a,1,c);return a=this.hex_with_component(a,0,d)},component_from_hex:function(a,c){return a>>c*8&255},hex_with_component:function(a,c,d){return d<<(e=c*8)|a&~(255<<e)}}}(),dat.color.toString,dat.utils.common),dat.color.interpret,dat.utils.common),dat.utils.requestAnimationFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||\nwindow.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1E3/60)}}(),dat.dom.CenteredDiv=function(e,a){var c=function(){this.backgroundElement=document.createElement(\"div\");a.extend(this.backgroundElement.style,{backgroundColor:\"rgba(0,0,0,0.8)\",top:0,left:0,display:\"none\",zIndex:\"1000\",opacity:0,WebkitTransition:\"opacity 0.2s linear\"});e.makeFullscreen(this.backgroundElement);this.backgroundElement.style.position=\"fixed\";this.domElement=\ndocument.createElement(\"div\");a.extend(this.domElement.style,{position:\"fixed\",display:\"none\",zIndex:\"1001\",opacity:0,WebkitTransition:\"-webkit-transform 0.2s ease-out, opacity 0.2s linear\"});document.body.appendChild(this.backgroundElement);document.body.appendChild(this.domElement);var c=this;e.bind(this.backgroundElement,\"click\",function(){c.hide()})};c.prototype.show=function(){var c=this;this.backgroundElement.style.display=\"block\";this.domElement.style.display=\"block\";this.domElement.style.opacity=\n0;this.domElement.style.webkitTransform=\"scale(1.1)\";this.layout();a.defer(function(){c.backgroundElement.style.opacity=1;c.domElement.style.opacity=1;c.domElement.style.webkitTransform=\"scale(1)\"})};c.prototype.hide=function(){var a=this,c=function(){a.domElement.style.display=\"none\";a.backgroundElement.style.display=\"none\";e.unbind(a.domElement,\"webkitTransitionEnd\",c);e.unbind(a.domElement,\"transitionend\",c);e.unbind(a.domElement,\"oTransitionEnd\",c)};e.bind(this.domElement,\"webkitTransitionEnd\",\nc);e.bind(this.domElement,\"transitionend\",c);e.bind(this.domElement,\"oTransitionEnd\",c);this.backgroundElement.style.opacity=0;this.domElement.style.opacity=0;this.domElement.style.webkitTransform=\"scale(1.1)\"};c.prototype.layout=function(){this.domElement.style.left=window.innerWidth/2-e.getWidth(this.domElement)/2+\"px\";this.domElement.style.top=window.innerHeight/2-e.getHeight(this.domElement)/2+\"px\"};return c}(dat.dom.dom,dat.utils.common),dat.dom.dom,dat.utils.common);\nexports.dat = dat;})();\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Loaders/AssimpJSONLoader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Loaders/AssimpJSONLoader.js",
            "module-type": "library",
            "text": "/**\n * @author Alexander Gessler / http://www.greentoken.de/\n * https://github.com/acgessler\n *\n * Loader for models imported with Open Asset Import Library (http://assimp.sf.net)\n * through assimp2json (https://github.com/acgessler/assimp2json).\n *\n * Supports any input format that assimp supports, including 3ds, obj, dae, blend,\n * fbx, x, ms3d, lwo (and many more).\n *\n * See webgl_loader_assimp2json example.\n */\n\nTHREE.AssimpJSONLoader = function ( manager ) {\n\n\tthis.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;\n};\n\nTHREE.AssimpJSONLoader.prototype = {\n\n\tconstructor: THREE.AssimpJSONLoader,\n\n\ttexturePath : '',\n\n\tload: function ( url, onLoad, onProgress, onError, texturePath ) {\n          var fonc = \"THREE.AssimpJSONLoader.load\";\n          hack.log(\"url: \"+url+\": crossOrigin = \"+this.crossOrigin, hack.loader, fonc);\n\n\t\tvar scope = this;\n\n\t\tthis.texturePath = texturePath && ( typeof texturePath === \"string\" ) ? texturePath : this.extractUrlBase( url );\n\n\t\tvar loader = new THREE.XHRLoader( this.manager );\n\t\tloader.setCrossOrigin( this.crossOrigin );\n\t\tloader.load( url, function ( text ) {\n\t\t\tvar scene = scope.parse( JSON.parse( text ) );\n\t\t\tonLoad( scene );\n\t\t} );\n\t},\n\n\tsetCrossOrigin: function ( value ) {\n\t\tthis.crossOrigin = value;\n\t},\n\n\textractUrlBase: function ( url ) { // from three/src/loaders/Loader.js\n\t\tvar parts = url.split( '/' );\n\t\tparts.pop();\n\t\treturn ( parts.length < 1 ? '.' : parts.join( '/' ) ) + '/';\n\t},\n\n\tparse: function ( json ) {\n\t\tvar meshes = this.parseList ( json.meshes, this.parseMesh );\n\t\tvar materials = this.parseList ( json.materials, this.parseMaterial );\n\t\treturn this.parseObject( json, json.rootnode, meshes, materials );\n\t},\n\n\tparseList : function(json, handler) {\n\t\tvar meshes = new Array(json.length);\n\t\tfor(var i = 0; i < json.length; ++i) {\n\t\t\tmeshes[i] = handler.call(this, json[i]);\n\t\t}\n\t\treturn meshes;\n\t},\n\n\tparseMesh : function(json) {\n\t\tvar vertex, geometry, i, e, in_data, src;\n\n\n\t\tgeometry = new THREE.Geometry();\n\n\t\t// read vertex positions\n\t\tfor(in_data = json.vertices, i = 0, e = in_data.length; i < e; ) {\n\t\t\tgeometry.vertices.push( new THREE.Vector3( in_data[ i++ ], in_data[ i++ ], in_data[ i++ ] ) );\n\t\t}\n\n\t\t// read faces\n\t\tvar cnt = 0;\n\t\tfor(in_data = json.faces, i = 0, e = in_data.length; i < e; ++i) {\n\t\t\tface = new THREE.Face3();\n\t\t\tsrc = in_data[i];\n\t\t\tface.a = src[0];\n\t\t\tface.b = src[1];\n\t\t\tface.c = src[2];\n\n\t\t\tface.materialIndex = 0; //json.materialindex;\n\t\t\tgeometry.faces.push(face);\n\t\t}\n\n\t\t// read texture coordinates - three.js attaches them to its faces\n\t\tjson.texturecoords = json.texturecoords || [];\n\t\tfor(i = 0, e = json.texturecoords.length; i < e; ++i) {\n\n\t\t\tfunction convertTextureCoords(in_uv, out_faces, out_vertex_uvs) {\n\t\t\t\tvar i, e, face, a, b, c;\n\n\t\t\t\tfor(i = 0, e = out_faces.length; i < e; ++i) {\n\t\t\t\t\tface = out_faces[i];\n\t\t\t\t\ta = face.a * 2;\n\t\t\t\t\tb = face.b * 2;\n\t\t\t\t\tc = face.c * 2;\n\t\t\t\t\tout_vertex_uvs.push([\n\t\t\t\t\t\tnew THREE.Vector2( in_uv[ a ], in_uv[ a + 1 ] ),\n\t\t\t\t\t\tnew THREE.Vector2( in_uv[ b ], in_uv[ b + 1 ] ),\n\t\t\t\t\t\tnew THREE.Vector2( in_uv[ c ], in_uv[ c + 1 ] )\n\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconvertTextureCoords(json.texturecoords[i], geometry.faces, geometry.faceVertexUvs[i]);\n\t\t}\n\n\t\t// read normals - three.js also attaches them to its faces\n\t\tif(json.normals) {\n\n\t\t\tfunction convertNormals(in_nor, out_faces) {\n\t\t\t\tvar i, e, face, a, b, c;\n\n\t\t\t\tfor(i = 0, e = out_faces.length; i < e; ++i) {\n\t\t\t\t\tface = out_faces[i];\n\t\t\t\t\ta = face.a * 3;\n\t\t\t\t\tb = face.b * 3;\n\t\t\t\t\tc = face.c * 3;\n\t\t\t\t\tface.vertexNormals = [\n\t\t\t\t\t\tnew THREE.Vector3( in_nor[ a ], in_nor[ a + 1 ], in_nor[ a + 2 ] ),\n\t\t\t\t\t\tnew THREE.Vector3( in_nor[ b ], in_nor[ b + 1 ], in_nor[ b + 2 ] ),\n\t\t\t\t\t\tnew THREE.Vector3( in_nor[ c ], in_nor[ c + 1 ], in_nor[ c + 2 ] )\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconvertNormals(json.normals, geometry.faces);\n\t\t}\n\n\t\t// read vertex colors - three.js also attaches them to its faces\n\t\tif(json.colors && json.colors[0]) {\n\n\t\t\tfunction convertColors(in_color, out_faces) {\n\t\t\t\tvar i, e, face, a, b, c;\n\n\t\t\t\tfunction makeColor(start) {\n\t\t\t\t\tvar col = new THREE.Color( );\n\t\t\t\t\tcol.setRGB( arr[0], arr[1], arr[2] );\n\t\t\t\t\t// TODO: what about alpha?\n\t\t\t\t\treturn col;\n\t\t\t\t}\n\n\t\t\t\tfor(i = 0, e = out_faces.length; i < e; ++i) {\n\t\t\t\t\tface = out_faces[i];\n\t\t\t\t\ta = face.a * 4;\n\t\t\t\t\tb = face.b * 4;\n\t\t\t\t\tc = face.c * 4;\n\t\t\t\t\tface.vertexColors = [\n\t\t\t\t\t\tmakeColor( a ),\n\t\t\t\t\t\tmakeColor( b ),\n\t\t\t\t\t\tmakeColor( c )\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconvertColors(json.colors[0], geometry.faces);\n\t\t}\n\n\n\t\t//geometry.computeFaceNormals();\n\t\t//geometry.computeVertexNormals();\n\t\t//geometry.computeTangents();\n\t\tgeometry.computeBoundingSphere();\n\n\t\t// TODO: tangents\n\t\treturn geometry;\n\t},\n\n\tparseMaterial : function(json) {\n          var func = \"THREE.AssimpJSONLoader.parseMaterial\";\n          // *tiddlywiki*\n          // It seems that this algorithm has bugs !\n          // Due to the fact that images are asynchronously loaded, it made the assumption\n          // that textures are loaded after all json is parsed. With TiddlyWiki, it's not the\n          // case because image Tiddler's file are immediately and synchronously loaded.\n          // The result is that <mat> variable is null and clashes when the onLoad() callback of the\n          // image loader tries to make something of the texture with <mat>.\n          //\n          // The fix : cancel the texture loading and wait till all json is parsed\n          // and <mat> is initialized with a coherent THREE.MeshPhongMaterial instance. After\n          // that, a second pass resumes the normal loading of the textures.\n\n\t\tvar mat = null, \n\t\tscope = this, i, prop, has_textures = [],\n\n\t\tinit_props = {\n\t\t\tshading : THREE.SmoothShading\n\t\t};\n\n\t\tfunction toColor(value_arr) {\n\t\t\tvar col = new THREE.Color();\n\t\t\tcol.setRGB(value_arr[0],value_arr[1],value_arr[2]);\n\t\t\treturn col;\n\t\t}\n\n\t\tfunction defaultTexture() {\n\t\t\tvar im = new Image();\n\t\t\tim.width = 1;\n\t\t\tim.height = 1;\n\t\t\treturn new THREE.Texture(im);\n\t\t}\n\n          // *tiddlywiki*\n          var flagTiddler = false;\n\n\t\tfor (var i in json.properties) {\n\t\t\tprop = json.properties[i];\n\n\t\t\tif(prop.key === '$tex.file') {\n\t\t\t\t// prop.semantic gives the type of the texture\n\t\t\t\t// 1: diffuse\n\t\t\t\t// 2: specular mao\n\t\t\t\t// 5: height map (bumps)\n\t\t\t\t// 6: normal map\n\t\t\t\t// more values (i.e. emissive, environment) are known by assimp and may be relevant\n\t\t\t\tif(prop.semantic === 1 || prop.semantic === 5 || prop.semantic === 6 || prop.semantic === 2) {\n\t\t\t\t\t(function(semantic) {\n\t\t\t\t\t\tvar loader = new THREE.TextureLoader(scope.manager),\n\t\t\t\t\t\tkeyname;\n\n\t\t\t\t\t\tif(semantic === 1) {\n\t\t\t\t\t\t\tkeyname = 'map';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(semantic === 5) {\n\t\t\t\t\t\t\tkeyname = 'bumpMap';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(semantic === 6) {\n\t\t\t\t\t\t\tkeyname = 'normalMap';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(semantic === 2) {\n\t\t\t\t\t\t\tkeyname = 'specularMap';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\thas_textures.push(keyname);\n\n\t\t\t\t\t\tloader.setCrossOrigin(this.crossOrigin);\n\t\t\t\t\t\tvar material_url = scope.texturePath + '/' + prop.value\n\t\t\t\t\t\tmaterial_url = material_url.replace(/\\\\/g, '/');\n\n                                          if (TiddlyWiki && material_url.match(/^tw:/)) {\n                                            flagTiddler = true;\n                                            hack.log(\"PASS 1: ignoring textures in tiddler's file\", hack.loader, func);\n                                            return;\n                                          }\n\t\t\t\t\t\tloader.load(material_url, function(tex) {\n\t\t\t\t\t\t\tif(tex) {\n\t\t\t\t\t\t\t\t// TODO: read texture settings from assimp.\n\t\t\t\t\t\t\t\t// Wrapping is the default, though.\n\t\t\t\t\t\t\t\ttex.wrapS = tex.wrapT = THREE.RepeatWrapping;\n\n                                                          if (TiddlyWiki) {\n                                                            if (mat) {\n\t\t\t\t\t\t\t      mat[keyname] = tex;\n\t\t\t\t\t\t\t      mat.needsUpdate = true;\n                                                            }\n                                                          } else {\n\t\t\t\t\t\t\t\tmat[keyname] = tex;\n\t\t\t\t\t\t\t\tmat.needsUpdate = true;\n                                                          }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t})(prop.semantic);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(prop.key === '?mat.name') {\n\t\t\t\tinit_props.name = prop.value;\n\t\t\t}\n\t\t\telse if(prop.key === '$clr.diffuse') {\n\t\t\t\tinit_props.color = toColor(prop.value);\n\t\t\t}\n\t\t\telse if(prop.key === '$clr.specular') {\n\t\t\t\tinit_props.specular = toColor(prop.value);\n\t\t\t}\n\t\t\telse if(prop.key === '$clr.ambient') {\n\t\t\t\tinit_props.ambient = toColor(prop.value);\n\t\t\t}\n\t\t\telse if(prop.key === '$clr.emissive') {\n\t\t\t\tinit_props.emissive = toColor(prop.value);\n\t\t\t}\n\t\t\telse if(prop.key === '$mat.shadingm') {\n\t\t\t\t// aiShadingMode_Flat\n\t\t\t\tif (prop.value === 1) {\n\t\t\t\t\tinit_props.shading = THREE.FlatShading;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (prop.key === '$mat.shininess') {\n\t\t\t\tinit_props.shininess = prop.value;\n\t\t\t}\n\t\t}\n\n\t\tif(!init_props.ambient) {\n\t\t\tinit_props.ambient = init_props.color;\n\t\t}\n\n\t\t// note: three.js does not like it when a texture is added after the geometry\n\t\t// has been rendered once, see http://stackoverflow.com/questions/16531759/.\n\t\t// for this reason we fill all slots upfront with default textures\n\t\tif(has_textures.length) {\n\t\t\tfor(i = has_textures.length-1; i >= 0; --i) {\n\t\t\t\tinit_props[has_textures[i]] = defaultTexture();\n\t\t\t}\n\t\t}\n\n                mat = new THREE.MeshPhongMaterial( init_props );\n\n          if (TiddlyWiki && flagTiddler) {\n            // New pass to handle tiddler files\n            hack.log(\"PASS 2: loading textures in tiddler's file\", hack.loader, func);\n\n\t    has_textures = [];\n\n\t    for (var i in json.properties) {\n\t      prop = json.properties[i];\n\t      if(prop.key === '$tex.file') {\n\t\t// prop.semantic gives the type of the texture\n\t\t// 1: diffuse\n\t\t// 2: specular mao\n\t\t// 5: height map (bumps)\n\t\t// 6: normal map\n\t\t// more values (i.e. emissive, environment) are known by assimp and may be relevant\n\t\tif(prop.semantic === 1 || prop.semantic === 5 || prop.semantic === 6 || prop.semantic === 2) {\n\t\t  (function(semantic) {\n\t\t    var loader = new THREE.TextureLoader(scope.manager), keyname;\n\t\t    if(semantic === 1) keyname = 'map';\n\t\t    else if(semantic === 5) keyname = 'bumpMap';\n\t\t    else if(semantic === 6) keyname = 'normalMap';\n\t\t    else if(semantic === 2) keyname = 'specularMap';\n\t\t    has_textures.push(keyname);\n\t\t    loader.setCrossOrigin(this.crossOrigin);\n\t\t    var material_url = scope.texturePath + '/' + prop.value\n\t\t    material_url = material_url.replace(/\\\\/g, '/');\n\t\t    loader.load(material_url, function(tex) {\n\t\t      if(tex) {\n\t\t\t// TODO: read texture settings from assimp.\n\t\t\t// Wrapping is the default, though.\n\t\t\ttex.wrapS = tex.wrapT = THREE.RepeatWrapping;\n                        if (mat) {\n\t\t\t  mat[keyname] = tex;\n\t\t\t  mat.needsUpdate = true;\n                        }\n\t\t      }\n\t\t    });\n\t\t  })(prop.semantic);\n\t\t}\n\t      }\n            }\n          }\n              \n\t      return mat;\n\t},\n\n\tparseObject : function(json, node, meshes, materials) {\n\t\tvar obj = new THREE.Object3D()\n\t\t,\ti\n\t\t,\tidx\n\t\t;\n\n\t\tobj.name = node.name || \"\";\n\t\tobj.matrix = new THREE.Matrix4().fromArray(node.transformation).transpose();\n\t\tobj.matrix.decompose( obj.position, obj.quaternion, obj.scale );\n\n\t\tfor(i = 0; node.meshes && i < node.meshes.length; ++i) {\n\t\t\tidx = node.meshes[i];\n\t\t\tobj.add(new THREE.Mesh( meshes[idx], materials[json.meshes[idx].materialindex] ));\n\t\t}\n\n\t\tfor(i = 0; node.children && i < node.children.length; ++i) {\n\t\t\tobj.add(this.parseObject(json, node.children[i], meshes, materials));\n\t\t}\n\n\t\treturn obj;\n\t},\n};\n\n\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Loaders/AWDLoader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Loaders/AWDLoader.js",
            "module-type": "library",
            "text": "/**\n * Author: Pierre Lepers\n * Date: 09/12/2013 17:21\n */\n\nTHREE.AWDLoader = (function (){\n\n\n\n  var UNCOMPRESSED  = 0,\n      DEFLATE       = 1,\n      LZMA          = 2,\n\n      AWD_FIELD_INT8      = 1,\n      AWD_FIELD_INT16     = 2,\n      AWD_FIELD_INT32     = 3,\n      AWD_FIELD_UINT8     = 4,\n      AWD_FIELD_UINT16    = 5,\n      AWD_FIELD_UINT32    = 6,\n      AWD_FIELD_FLOAT32   = 7,\n      AWD_FIELD_FLOAT64   = 8,\n      AWD_FIELD_BOOL      = 21,\n      AWD_FIELD_COLOR     = 22,\n      AWD_FIELD_BADDR     = 23,\n      AWD_FIELD_STRING    = 31,\n      AWD_FIELD_BYTEARRAY = 32,\n      AWD_FIELD_VECTOR2x1 = 41,\n      AWD_FIELD_VECTOR3x1 = 42,\n      AWD_FIELD_VECTOR4x1 = 43,\n      AWD_FIELD_MTX3x2    = 44,\n      AWD_FIELD_MTX3x3    = 45,\n      AWD_FIELD_MTX4x3    = 46,\n      AWD_FIELD_MTX4x4    = 47,\n\n      BOOL       = 21,\n      COLOR      = 22,\n      BADDR      = 23,\n\n      INT8    = 1,\n      INT16   = 2,\n      INT32   = 3,\n      UINT8   = 4,\n      UINT16  = 5,\n      UINT32  = 6,\n      FLOAT32 = 7,\n      FLOAT64 = 8;\n\n\n  var littleEndian = true;\n\n  // ResourcesLoader\n  // =============\n  // handle loading for external resources\n  function ResourcesLoader( awdUrl ){\n    var func = \"THREE.AWDLoader.ResourcesLoader\";\n\n    this._baseDir = awdUrl.substr( 0, awdUrl.lastIndexOf( '/' )+1 );\n\n    this._loadingManager = new THREE.LoadingManager();\n\n  }\n\n  ResourcesLoader.prototype = {\n\n    loadTexture : function( path ){\n      var tex = new THREE.Texture();\n\n      var loader = new THREE.ImageLoader( this._loadingManager );\n\n      loader.load( this._baseDir+path, function( image ) {\n        tex.image = image;\n        tex.needsUpdate = true;\n      });\n\n      return tex;\n\n    }\n  }\n\n\n\n  function Block(){\n    this.id = 0;\n    this.data = null;\n  }\n\n\n\n  function AWDLoader( showStatus ) {\n\n    THREE.Loader.call( this, showStatus );\n\n    this.trunk = new THREE.Object3D();\n\n    this.materialFactory = undefined;\n\n    this._resourceLoader = null;\n    this._url = null;\n\n    this._data;\n    this._ptr = 0;\n\n    this._version =  [];\n    this._streaming = false;\n    this._optimized_for_accuracy = false;\n    this._compression = 0;\n    this._bodylen = 0xFFFFFFFF;\n\n\n    this._blocks = [ new Block() ];\n\n    this._accuracyMatrix  = false;\n    this._accuracyGeo     = false;\n    this._accuracyProps   = false;\n\n\n  };\n\n\n  AWDLoader.prototype = new THREE.Loader();\n\n  AWDLoader.prototype.constructor = AWDLoader;\n\n  AWDLoader.prototype.load = function ( url, callback ) {\n    var func = \"THREE.AWDLoader.load\";\n\n    if (TiddlyWiki && url.match(/^tw:/)) {\n      this._url = url;\n      var res = TiddlyWiki.load(url);\n      //hack.log(\"res.byteLength = \"+res.byteLength, hack.loader, func);\n      this.parse(res);\n      callback(this.trunk);\n      hack.log(\"url: \"+url+\": loaded\", hack.loader, func);\n      return;\n    }\n\n    var that = this;\n    this._url = url;\n    var xhr = new XMLHttpRequest();\n    xhr.open( \"GET\", url, true );\n    xhr.responseType = 'arraybuffer';\n\n    xhr.onreadystatechange = function () {\n\n      if ( xhr.readyState == 4 ) {\n\n        if ( xhr.status == 200 || xhr.status == 0 ) {\n          that.parse( xhr.response );\n          callback( that.trunk );\n\n        } else {\n\n          console.error( 'AWDLoader: Couldn\\'t load ' + url + ' (' + xhr.status + ')' );\n\n        }\n\n      }\n\n    };\n\n    xhr.send( null );\n\n  };\n\n  AWDLoader.prototype.parse = function ( data ) {\n    var func = \"THREE.AWDLoader.parse\";\n\n    var blen = data.byteLength;\n\n    this._ptr = 0;\n    this._data = new DataView( data );\n\n    this._parseHeader( );\n\n    if( this._compression != 0  ) {\n      console.error( 'compressed AWD not supported' );\n    }\n\n    if (!this._streaming && this._bodylen != data.byteLength - this._ptr ) {\n      console.error('AWDLoader: body len does not match file length', this._bodylen ,  blen - this._ptr);\n    }\n\n    while ( this._ptr < blen ) {\n      this.parseNextBlock();\n    }\n\n  }\n\n\n\n  AWDLoader.prototype.parseNextBlock = function ( ) {\n\n    var assetData,\n        ns, type, len, block,\n        blockId = this.readU32(),\n        ns      = this.readU8(),\n        type    = this.readU8(),\n        flags   = this.readU8(),\n        len     = this.readU32();\n\n\n    switch (type) {\n      case 1:\n        assetData = this.parseMeshData(len);\n        break;\n      case 22:\n        assetData = this.parseContainer(len);\n        break;\n      case 23:\n        assetData = this.parseMeshInstance(len);\n        break;\n      case 81:\n        assetData = this.parseMaterial(len);\n        break;\n      case 82:\n        assetData = this.parseTexture(len);\n        break;\n      case 101:\n        assetData = this.parseSkeleton(len);\n        break;\n\n//      case 111:\n//        assetData = this.parseMeshPoseAnimation(len, true);\n//        break;\n      case 112:\n        assetData = this.parseMeshPoseAnimation(len, false);\n        break;\n      case 113:\n        assetData = this.parseVertexAnimationSet(len);\n        break;\n      case 102:\n      \tassetData = this.parseSkeletonPose(len);\n      \tbreak;\n      case 103:\n      \tassetData = this.parseSkeletonAnimation(len);\n      \tbreak;\n      case 122:\n        assetData = this.parseAnimatorSet(len);\n        break;\n      // case 121:\n      // \tassetData = parseUVAnimation(len);\n      // \tbreak;\n      default:\n        //debug('Ignoring block!',type, len);\n        this._ptr += len;\n        break;\n    }\n\n\n    // Store block reference for later use\n    this._blocks[blockId] = block = new Block();\n    block.data = assetData;\n    block.id = blockId;\n\n  }\n\n\n  AWDLoader.prototype._parseHeader = function () {\n\n    var version = this._version,\n        awdmagic =\n            ( this.readU8()<<16)\n        |   ( this.readU8()<<8 )\n        |     this.readU8();\n\n    if( awdmagic != 4282180 )\n      throw new Error( \"AWDLoader - bad magic\" );\n\n    version[0] = this.readU8();\n    version[1] = this.readU8();\n\n    var flags = this.readU16();\n\n    this._streaming = (flags & 0x1) == 0x1;\n\n    if ((version[0] === 2) && (version[1] === 1)) {\n      this._accuracyMatrix =  (flags & 0x2) === 0x2;\n      this._accuracyGeo =     (flags & 0x4) === 0x4;\n      this._accuracyProps =   (flags & 0x8) === 0x8;\n    }\n\n    this._geoNrType     = this._accuracyGeo     ? FLOAT64 : FLOAT32;\n    this._matrixNrType  = this._accuracyMatrix  ? FLOAT64 : FLOAT32;\n    this._propsNrType   = this._accuracyProps   ? FLOAT64 : FLOAT32;\n\n    this._optimized_for_accuracy \t= (flags & 0x2) === 0x2;\n\n    this._compression = this.readU8();\n    this._bodylen = this.readU32();\n\n\n  }\n\n\n  AWDLoader.prototype.parseContainer = function ( len ) {\n    var parent,\n        ctr     = new THREE.Object3D(),\n        par_id  = this.readU32(),\n        mtx     = this.parseMatrix4();\n\n    ctr.name = this.readUTF();\n    ctr.applyMatrix( mtx );\n\n    parent = this._blocks[par_id].data || this.trunk;\n    parent.add(ctr);\n\n    this.parseProperties({\n      1:this._matrixNrType,\n      2:this._matrixNrType,\n      3:this._matrixNrType,\n      4:UINT8\n    });\n\n    ctr.extra = this.parseUserAttributes();\n\n    return ctr;\n  }\n\n\n\n  AWDLoader.prototype.parseMeshInstance = function ( len ) {\n    var name,\n        mesh, geometries, meshLen, meshes,\n        par_id, data_id,\n        mtx,\n        materials, mat, mat_id,\n        num_materials,\n        materials_parsed,\n        parent,\n        i;\n\n    par_id        = this.readU32();\n    mtx           = this.parseMatrix4();\n    name          = this.readUTF();\n    data_id       = this.readU32();\n    num_materials = this.readU16();\n\n    geometries = this.getBlock( data_id );\n\n    materials = [];\n    materials_parsed = 0;\n\n    for ( i = 0; i < num_materials; i++) {\n      mat_id = this.readU32();\n      mat = this.getBlock( mat_id );\n      materials.push( mat );\n    }\n\n\n\n    meshLen = geometries.length\n    meshes = [];\n\n    // TODO : BufferGeometry don't support \"geometryGroups\" for now.\n    // so we create sub meshes for each groups\n    if( meshLen  > 1 ) {\n      mesh = new THREE.Object3D()\n      for ( i = 0; i < meshLen; i++) {\n        var sm = new THREE.Mesh( geometries[i] );\n        meshes.push( sm );\n        mesh.add( sm );\n      }\n    }\n    else {\n      mesh = new THREE.Mesh( geometries[0] );\n      meshes.push( mesh );\n    }\n\n    mesh.applyMatrix( mtx );\n    mesh.name = name;\n\n\n    parent = this.getBlock( par_id ) || this.trunk;\n    parent.add( mesh );\n\n\n    var matLen = materials.length;\n    var maxLen = Math.max( meshLen, matLen);\n    for( i = 0; i< maxLen; i++ )\n      meshes[ i%meshLen ].material = materials[ i % matLen ];\n\n\n    // Ignore for now\n    this.parseProperties( null );\n    mesh.extra = this.parseUserAttributes();\n\n    return mesh;\n  }\n\n\n\n  AWDLoader.prototype.parseMaterial = function ( len ) {\n    var name,\n        type,\n        props,\n        mat,\n        attributes,\n        finalize,\n        num_methods,\n        methods_parsed;\n\n    name        = this.readUTF();\n    type        = this.readU8();\n    num_methods = this.readU8();\n\n    //log( \"AWDLoader parseMaterial \",name )\n\n    // Read material numerical properties\n    // (1=color, 2=bitmap url, 11=alpha_blending, 12=alpha_threshold, 13=repeat)\n    props = this.parseProperties({\n      1:  AWD_FIELD_INT32,\n      2:  AWD_FIELD_BADDR,\n      11: AWD_FIELD_BOOL,\n      12: AWD_FIELD_FLOAT32,\n      13: AWD_FIELD_BOOL\n    });\n\n    methods_parsed = 0;\n\n    while( methods_parsed < num_methods ) {\n      var method_type = this.readU16();\n      this.parseProperties( null );\n      this.parseUserAttributes();\n    }\n\n    attributes = this.parseUserAttributes();\n\n    if( this.materialFactory !== undefined ) {\n      mat = this.materialFactory( name );\n      if( mat ) return mat;\n    }\n\n    mat = new THREE.MeshPhongMaterial();\n\n    if (type === 1) { // Color material\n      mat.color.setHex( props.get(1, 0xcccccc) );\n    }\n    else if (type === 2) { // Bitmap material\n      var tex_addr = props.get(2, 0);\n      mat.map = this.getBlock( tex_addr );\n    }\n\n    mat.extra = attributes;\n    mat.alphaThreshold = props.get(12, 0.0);\n    mat.repeat = props.get(13, false);\n\n\n    return mat;\n  }\n\n\n\n\n  AWDLoader.prototype.parseTexture = function( len ) {\n\n\n    var name = this.readUTF(),\n        type = this.readU8(),\n        asset,\n        data_len;\n\n    // External\n    if (type === 0) {\n      data_len = this.readU32();\n      var url = this.readUTFBytes(data_len);\n      console.log( url );\n\n      asset = this.loadTexture( url );\n    } else {\n      // embed texture not supported\n    }\n    // Ignore for now\n    this.parseProperties( null );\n\n    this.parseUserAttributes();\n    return asset;\n  }\n\n  AWDLoader.prototype.loadTexture = function( url ) {\n    var func = \"AWDLoader.loadTexture\";\n\n    if( null === this._resourceLoader )\n      this._resourceLoader = new ResourcesLoader( this._url );\n\n    return this._resourceLoader.loadTexture( url );\n  }\n\n  // broken : skeleton pose format is different than threejs one\n  AWDLoader.prototype.parseSkeleton = function(len) // Array<Bone>\n  {\n    var name          = this.readUTF(),\n        num_joints    = this.readU16(),\n        skeleton      = [],\n        joints_parsed = 0;\n\n    this.parseProperties( null );\n\n    while (joints_parsed < num_joints) {\n      var joint, ibp;\n\n      // Ignore joint id\n      this.readU16();\n\n      joint = new THREE.Bone();\n      joint.parent = this.readU16() - 1; // 0=null in AWD\n      joint.name = this.readUTF();\n\n      ibp = this.parseMatrix4();\n      joint.skinMatrix = ibp;\n\n      // Ignore joint props/attributes for now\n      this.parseProperties(null);\n      this.parseUserAttributes();\n\n      skeleton.push(joint);\n      joints_parsed++;\n    }\n\n    // Discard attributes for now\n    this.parseUserAttributes();\n\n\n    return skeleton;\n  }\n\n\n\n  AWDLoader.prototype.parseSkeletonPose = function(blockID)\n  {\n    var name = this.readUTF();\n\n\n    var num_joints = this.readU16();\n    this.parseProperties(null);\n\n    // debug( 'parse Skeleton Pose. joints : ' + num_joints);\n\n    var pose = [];\n\n    var joints_parsed = 0;\n\n    while (joints_parsed < num_joints) {\n\n      var joint_pose;\n\n      var has_transform; //:uint;\n      var mtx_data;\n\n      has_transform = this.readU8();\n\n      if (has_transform === 1) {\n        mtx_data = this.parseMatrix4();\n      } else\n      {\n        mtx_data = new THREE.Matrix4();\n      }\n      pose[joints_parsed] = mtx_data;\n      joints_parsed++;\n    }\n    // Skip attributes for now\n    this.parseUserAttributes();\n\n    return pose\n  }\n\n  AWDLoader.prototype.parseSkeletonAnimation = function(blockID)\n  {\n    var frame_dur;\n    var pose_addr;\n    var pose;\n\n    var name = this.readUTF();\n\n    var clip = [];\n\n    var num_frames = this.readU16();\n    this.parseProperties(null);\n\n    var frames_parsed = 0;\n    var returnedArray;\n\n\n    // debug( 'parse Skeleton Animation. frames : ' + num_frames);\n\n    while (frames_parsed < num_frames) {\n      pose_addr = this.readU32();\n      frame_dur = this.readU16();\n\n      pose = this._blocks[pose_addr].data\n      // debug( 'pose address ',pose[2].elements[12],pose[2].elements[13],pose[2].elements[14] );\n      clip.push( {\n        pose : pose,\n        duration : frame_dur\n      } );\n\n      frames_parsed++;\n    }\n    if (clip.length == 0) {\n      // debug(\"Could not this SkeletonClipNode, because no Frames where set.\");\n      return;\n    }\n    // Ignore attributes for now\n    this.parseUserAttributes();\n    return clip;\n  }\n\n\n\n  AWDLoader.prototype.parseVertexAnimationSet = function(len)\n  {\n    var poseBlockAdress,\n        name           = this.readUTF(),\n        num_frames     = this.readU16(),\n        props          = this.parseProperties({1:UINT16}),\n        frames_parsed  = 0,\n        skeletonFrames = [];\n\n    while (frames_parsed < num_frames) {\n      poseBlockAdress = this.readU32();\n      skeletonFrames.push(this._blocks[poseBlockAdress].data);\n      frames_parsed++;\n    }\n\n    this.parseUserAttributes();\n\n\n    return skeletonFrames;\n  }\n\n\n  AWDLoader.prototype.parseAnimatorSet = function(len)\n  {\n    var targetMesh;\n\n    var animSetBlockAdress; //:int\n\n    var targetAnimationSet; //:AnimationSetBase;\n    var outputString = \"\"; //:String = \"\";\n    var name = this.readUTF();\n    var type = this.readU16();\n\n    var props = this.parseProperties({1:BADDR});\n\n    animSetBlockAdress = this.readU32();\n    var targetMeshLength = this.readU16();\n\n    var meshAdresses = []; //:Vector.<uint> = new Vector.<uint>;\n\n    for (var i = 0; i < targetMeshLength; i++)\n      meshAdresses.push( this.readU32() );\n\n    var activeState = this.readU16();\n    var autoplay = Boolean(this.readU8());\n    this.parseUserAttributes();\n    this.parseUserAttributes();\n\n    var returnedArray;\n    var targetMeshes = []; //:Vector.<Mesh> = new Vector.<Mesh>;\n\n    for (i = 0; i < meshAdresses.length; i++) {\n//      returnedArray = getAssetByID(meshAdresses[i], [AssetType.MESH]);\n//      if (returnedArray[0])\n        targetMeshes.push(this._blocks[meshAdresses[i]].data);\n    }\n\n    targetAnimationSet = this._blocks[animSetBlockAdress].data\n    var thisAnimator;\n\n    if (type == 1) {\n\n\n      thisAnimator = {\n        animationSet : targetAnimationSet,\n        skeleton : this._blocks[props.get(1, 0)].data\n      };\n\n    } else if (type == 2) {\n      // debug( \"vertex Anim???\");\n    }\n\n\n    for (i = 0; i < targetMeshes.length; i++) {\n        targetMeshes[i].animator = thisAnimator;\n    }\n    // debug(\"Parsed a Animator: Name = \" + name);\n\n    return thisAnimator;\n  }\n\n\n\n\n\n\n\n  AWDLoader.prototype.parseMeshData = function ( len ) {\n\n    var name      = this.readUTF(),\n        num_subs  = this.readU16(),\n        geom,\n        subs_parsed = 0,\n        props,\n        buffer,\n        skinW, skinI,\n        geometries = [];\n\n\n\n\n    props = this.parseProperties({\n      1: this._geoNrType,\n      2: this._geoNrType\n    });\n\n\n\n    // Loop through sub meshes\n    while (subs_parsed < num_subs) {\n\n      var sm_len, sm_end, attrib;\n\n      geom = new THREE.BufferGeometry();\n      geom.name = name;\n      geometries.push( geom );\n\n\n      sm_len = this.readU32();\n      sm_end = this._ptr + sm_len;\n\n\n      // Ignore for now\n      this.parseProperties({1:this._geoNrType, 2:this._geoNrType});\n\n      // Loop through data streams\n      while ( this._ptr < sm_end ) {\n\n\n        var idx = 0,\n            str_type  = this.readU8(),\n            str_ftype = this.readU8(),\n            str_len   = this.readU32(),\n            str_end   = str_len + this._ptr;\n\n\n\n\n\n        // VERTICES\n        // ------------------\n        if ( str_type === 1 ) {\n\n          buffer = new Float32Array( ( str_len / 12 ) * 3 );\n          attrib = new THREE.BufferAttribute( buffer, 3 );\n\n          geom.addAttribute( 'position', attrib );\n          idx = 0;\n\n          while (this._ptr < str_end) {\n            buffer[idx]   = -this.readF32();\n            buffer[idx+1] = this.readF32();\n            buffer[idx+2] = this.readF32();\n            idx+=3;\n          }\n        }\n\n\n        // INDICES\n        // -----------------\n        else if (str_type === 2) {\n\n          buffer = new Uint16Array( str_len / 2 );\n          attrib = new THREE.BufferAttribute( buffer, 1 );\n          geom.addAttribute( 'index', attrib );\n\n          geom.offsets.push({\n            start: 0,\n            index: 0,\n            count: str_len/2\n          });\n\n          idx = 0;\n\n          while (this._ptr < str_end) {\n            buffer[idx+1]   = this.readU16();\n            buffer[idx]     = this.readU16();\n            buffer[idx+2]   = this.readU16();\n            idx+=3;\n          }\n        }\n\n        // UVS\n        // -------------------\n        else if (str_type === 3) {\n\n          buffer = new Float32Array( ( str_len / 8 ) * 2 );\n          attrib = new THREE.BufferAttribute( buffer, 2 );\n\n          geom.addAttribute( 'uv', attrib );\n          idx = 0;\n\n          while (this._ptr < str_end) {\n            buffer[idx]   = this.readF32();\n            buffer[idx+1] = 1.0-this.readF32();\n            idx+=2;\n          }\n        }\n\n        // NORMALS\n        else if (str_type === 4) {\n\n          buffer = new Float32Array( ( str_len / 12 ) * 3 );\n          attrib = new THREE.BufferAttribute( buffer, 3 );\n          geom.addAttribute( 'normal', attrib );\n          idx = 0;\n\n          while (this._ptr < str_end) {\n            buffer[idx]   = -this.readF32();\n            buffer[idx+1] = this.readF32();\n            buffer[idx+2] = this.readF32();\n            idx+=3;\n          }\n\n        }\n\n        // else if (str_type == 6) {\n        //   skinI = new Float32Array( str_len>>1 );\n        //   idx = 0\n\n        //   while (this._ptr < str_end) {\n        //     skinI[idx]   = this.readU16();\n        //     idx++;\n        //   }\n\n        // }\n        // else if (str_type == 7) {\n        //   skinW = new Float32Array( str_len>>2 );\n        //   idx = 0;\n\n        //   while (this._ptr < str_end) {\n        //     skinW[idx]   = this.readF32();\n        //     idx++;\n        //   }\n        // }\n        else {\n          this._ptr = str_end;\n        }\n\n\n\n      }\n\n      this.parseUserAttributes();\n\n\n      geom.computeBoundingSphere();\n      subs_parsed++;\n    }\n\n\n    //geom.computeFaceNormals();\n\n\n    this.parseUserAttributes();\n    //finalizeAsset(geom, name);\n\n    return geometries;\n  }\n\n  AWDLoader.prototype.parseMeshPoseAnimation = function(len, poseOnly)\n  {\n    var num_frames = 1,\n        num_submeshes,\n        frames_parsed,\n        subMeshParsed,\n        frame_dur,\n        x, y, z,\n\n        str_len,\n        str_end,\n        geom,\n        subGeom,\n        idx = 0,\n        clip = {},\n        indices,\n        verts,\n        num_Streams,\n        streamsParsed,\n        streamtypes = [],\n\n        props,\n        thisGeo,\n        name = this.readUTF(),\n        geoAdress = this.readU32();\n\n\n    var mesh = this.getBlock( geoAdress );\n\n    if (mesh == null) {\n      console.log( \"parseMeshPoseAnimation target mesh not found at:\", geoAdress );\n      return;\n    }\n\n    geom = mesh.geometry;\n    geom.morphTargets = [];\n\n    if (!poseOnly)\n      num_frames = this.readU16();\n\n    num_submeshes = this.readU16();\n    num_Streams = this.readU16();\n\n    // debug(\"VA num_frames : \", num_frames );\n    // debug(\"VA num_submeshes : \", num_submeshes );\n    // debug(\"VA numstreams : \", num_Streams );\n\n    streamsParsed = 0;\n    while (streamsParsed < num_Streams) {\n      streamtypes.push(this.readU16());\n      streamsParsed++;\n    }\n    props = this.parseProperties({1:BOOL, 2:BOOL});\n\n    clip.looping = props.get(1, true);\n    clip.stitchFinalFrame = props.get(2, false);\n\n    frames_parsed = 0;\n\n    while (frames_parsed < num_frames) {\n\n      frame_dur = this.readU16();\n      subMeshParsed = 0;\n\n      while (subMeshParsed < num_submeshes) {\n\n        streamsParsed = 0;\n        str_len = this.readU32();\n        str_end = this._ptr + str_len;\n\n        while (streamsParsed < num_Streams) {\n\n          if (streamtypes[streamsParsed] == 1) {\n\n            //geom.addAttribute( 'morphTarget'+frames_parsed, Float32Array, str_len/12, 3 );\n            var buffer = new Float32Array(str_len/4);\n            geom.morphTargets.push( {\n              array : buffer\n            });\n\n            //buffer = geom.attributes['morphTarget'+frames_parsed].array\n            idx = 0;\n\n            while ( this._ptr < str_end ) {\n              buffer[idx]     = this.readF32();\n              buffer[idx+1]   = this.readF32();\n              buffer[idx+2]   = this.readF32();\n              idx += 3;\n            }\n\n\n            subMeshParsed++;\n          } else\n            this._ptr = str_end;\n          streamsParsed++;\n        }\n      }\n\n\n      frames_parsed++;\n    }\n    this.parseUserAttributes();\n\n    return null;\n  }\n\n\n\n\n\n\n\n\n\n  AWDLoader.prototype.getBlock = function ( id ) {\n    return this._blocks[id].data;\n  },\n\n\n  AWDLoader.prototype.parseMatrix4 = function ( ) {\n    var mtx = new THREE.Matrix4();\n    var e = mtx.elements;\n\n    e[0] = this.readF32();\n    e[1] = this.readF32();\n    e[2] = this.readF32();\n    e[3] = 0.0;\n    //e[3] = 0.0;\n\n    e[4] = this.readF32();\n    e[5] = this.readF32();\n    e[6] = this.readF32();\n    //e[7] = this.readF32();\n    e[7] = 0.0;\n\n    e[8] = this.readF32();\n    e[9] = this.readF32();\n    e[10] = this.readF32();\n    //e[11] = this.readF32();\n    e[11] = 0.0;\n\n    e[12] = -this.readF32();\n    e[13] = this.readF32();\n    e[14] = this.readF32();\n    //e[15] = this.readF32();\n    e[15] = 1.0;\n    return mtx;\n  }\n\n\n  AWDLoader.prototype.parseProperties = function ( expected ) {\n    var list_len = this.readU32();\n    var list_end = this._ptr + list_len;\n\n    var props = new AWDProperties();\n\n    if( expected ) {\n\n      while( this._ptr < list_end ) {\n\n        var key = this.readU16();\n        var len = this.readU32();\n        var type;\n\n        if( expected.hasOwnProperty( key ) ) {\n          type = expected[ key ];\n          props.set( key, this.parseAttrValue( type, len ) );\n        } else {\n          this._ptr += len;\n        }\n      }\n\n    }\n\n    return props;\n\n  };\n\n\n  AWDLoader.prototype.parseUserAttributes = function ( ) {\n    // skip for now\n    this._ptr = this.readU32() + this._ptr;\n    return null;\n  };\n\n\n  AWDLoader.prototype.parseAttrValue = function ( type, len ) {\n\n    var elem_len;\n    var read_func;\n\n    switch (type) {\n      case AWD_FIELD_INT8:\n        elem_len = 1;\n        read_func = this.readI8;\n        break;\n      case AWD_FIELD_INT16:\n        elem_len = 2;\n        read_func = this.readI16;\n        break;\n      case AWD_FIELD_INT32:\n        elem_len = 4;\n        read_func = this.readI32;\n        break;\n      case AWD_FIELD_BOOL:\n      case AWD_FIELD_UINT8:\n        elem_len = 1;\n        read_func = this.readU8;\n        break;\n      case AWD_FIELD_UINT16:\n        elem_len = 2;\n        read_func = this.readU16;\n        break;\n      case AWD_FIELD_UINT32:\n      case AWD_FIELD_BADDR:\n        elem_len = 4;\n        read_func = this.readU32;\n        break;\n      case AWD_FIELD_FLOAT32:\n        elem_len = 4;\n        read_func = this.readF32;\n        break;\n      case AWD_FIELD_FLOAT64:\n        elem_len = 8;\n        read_func = this.readF64;\n        break;\n      case AWD_FIELD_VECTOR2x1:\n      case AWD_FIELD_VECTOR3x1:\n      case AWD_FIELD_VECTOR4x1:\n      case AWD_FIELD_MTX3x2:\n      case AWD_FIELD_MTX3x3:\n      case AWD_FIELD_MTX4x3:\n      case AWD_FIELD_MTX4x4:\n        elem_len = 8;\n        read_func = this.readF64;\n        break;\n    }\n\n    if (elem_len < len) {\n      var list;\n      var num_read;\n      var num_elems;\n\n      list = [];\n      num_read = 0;\n      num_elems = len / elem_len;\n\n      while (num_read < num_elems) {\n        list.push(read_func.call( this ) );\n        num_read++;\n      }\n\n      return list;\n    }\n    else {\n      return read_func.call( this );\n    }\n\n  }\n\n\n  AWDLoader.prototype.readU8 = function () {\n    return this._data.getUint8( this._ptr++ );\n  }\n  AWDLoader.prototype.readI8 = function () {\n    return this._data.getInt8( this._ptr++ );\n  }\n\n  AWDLoader.prototype.readU16 = function () {\n    var a = this._data.getUint16( this._ptr, littleEndian );\n    this._ptr += 2;\n    return a;\n  }\n  AWDLoader.prototype.readI16 = function () {\n    var a = this._data.getInt16( this._ptr, littleEndian );\n    this._ptr += 2;\n    return a;\n  }\n\n  AWDLoader.prototype.readU32 = function () {\n    var a = this._data.getUint32( this._ptr, littleEndian );\n    this._ptr += 4;\n    return a;\n  }\n  AWDLoader.prototype.readI32 = function () {\n    var a = this._data.getInt32( this._ptr, littleEndian );\n    this._ptr += 4;\n    return a;\n  }\n  AWDLoader.prototype.readF32 = function () {\n    var a = this._data.getFloat32( this._ptr, littleEndian );\n    this._ptr += 4;\n    return a;\n  }\n  AWDLoader.prototype.readF64 = function () {\n    var a = this._data.getFloat64( this._ptr, littleEndian );\n    this._ptr += 8;\n    return a;\n  }\n\n\n  /**\n   * Converts a UTF-8 byte array to JavaScript's 16-bit Unicode.\n   * @param {Array.<number>} bytes UTF-8 byte array.\n   * @return {string} 16-bit Unicode string.\n   */\n  AWDLoader.prototype.readUTF = function () {\n    var len = this.readU16();\n\n    return this.readUTFBytes( len );\n  };\n\n  /**\n   * Converts a UTF-8 byte array to JavaScript's 16-bit Unicode.\n   * @param {Array.<number>} bytes UTF-8 byte array.\n   * @return {string} 16-bit Unicode string.\n   */\n  AWDLoader.prototype.readUTFBytes = function ( len ) {\n\n\n    // TODO(user): Use native implementations if/when available\n\n    var out = [], c = 0;\n\n    while ( out.length < len ) {\n      var c1 = this._data.getUint8( this._ptr++, littleEndian );\n      if (c1 < 128) {\n        out[c++] = String.fromCharCode(c1);\n      } else if (c1 > 191 && c1 < 224) {\n        var c2 = this._data.getUint8( this._ptr++, littleEndian );\n        out[c++] = String.fromCharCode((c1 & 31) << 6 | c2 & 63);\n      } else {\n        var c2 = this._data.getUint8( this._ptr++, littleEndian );\n        var c3 = this._data.getUint8( this._ptr++, littleEndian );\n        out[c++] = String.fromCharCode(\n            (c1 & 15) << 12 | (c2 & 63) << 6 | c3 & 63\n        );\n      }\n    }\n    return out.join('');\n  };\n\n\n\n\n\n\n\n\n\n  AWDProperties = function(){}\n\n  AWDProperties.prototype = {\n\n\n    set : function(key, value)\n    {\n      this[key] = value;\n    },\n\n    get : function(key, fallback)\n    {\n      if ( this.hasOwnProperty(key) )\n        return this[key];\n      else return fallback;\n    }\n  }\n\n  return AWDLoader;\n\n})();\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Loaders/BinaryLoader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Loaders/BinaryLoader.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.BinaryLoader = function ( showStatus ) {\n\n\tTHREE.Loader.call( this, showStatus );\n\n};\n\nTHREE.BinaryLoader.prototype = Object.create( THREE.Loader.prototype );\n\n// Load models generated by slim OBJ converter with BINARY option (converter_obj_three_slim.py -t binary)\n//  - binary models consist of two files: JS and BIN\n//  - parameters\n//\t\t- url (required)\n//\t\t- callback (required)\n//\t\t- texturePath (optional: if not specified, textures will be assumed to be in the same folder as JS model file)\n//\t\t- binaryPath (optional: if not specified, binary file will be assumed to be in the same folder as JS model file)\n\nTHREE.BinaryLoader.prototype.load = function ( url, callback, texturePath, binaryPath ) {\n\n\t// todo: unify load API to for easier SceneLoader use\n\n\ttexturePath = texturePath || this.extractUrlBase( url );\n\tbinaryPath = binaryPath || this.extractUrlBase( url );\n\n\tvar callbackProgress = this.showProgress ? THREE.Loader.prototype.updateProgress : undefined;\n\n\tthis.onLoadStart();\n\n\t// #1 load JS part via web worker\n\n\tthis.loadAjaxJSON( this, url, callback, texturePath, binaryPath, callbackProgress );\n\n};\n\nTHREE.BinaryLoader.prototype.loadAjaxJSON = function ( context, url, callback, texturePath, binaryPath, callbackProgress ) {\n  var func = \"THREE.BinaryLoader.loadAjaxJSON\";\n\n\ttexturePath = texturePath && ( typeof texturePath === \"string\" ) ? texturePath : this.extractUrlBase( url );\n\tbinaryPath = binaryPath && ( typeof binaryPath === \"string\" ) ? binaryPath : this.extractUrlBase( url );\n\n  if (TiddlyWiki && url.match(/^tw:/)) {\n    var res = TiddlyWiki.load(url);\n    //hack.log(\"res.length = \"+res.length, hack.loader, func);\n\n    var json = JSON.parse(res);\n    context.loadAjaxBuffers(json, callback, binaryPath, texturePath, callbackProgress);\n\n    hack.log(\"url: \"+url+\": loaded\", hack.loader, func);\n    return;\n  }\n\n\tvar xhr = new XMLHttpRequest();\n\n\txhr.onreadystatechange = function () {\n\n\t\tif ( xhr.readyState == 4 ) {\n\n\t\t\tif ( xhr.status == 200 || xhr.status == 0 ) {\n\n\t\t\t\tvar json = JSON.parse( xhr.responseText );\n\t\t\t\tcontext.loadAjaxBuffers( json, callback, binaryPath, texturePath, callbackProgress );\n\n\t\t\t} else {\n\n\t\t\t\tconsole.error( \"THREE.BinaryLoader: Couldn't load [\" + url + \"] [\" + xhr.status + \"]\" );\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\txhr.open( \"GET\", url, true );\n\txhr.send( null );\n\n};\n\nTHREE.BinaryLoader.prototype.loadAjaxBuffers = function ( json, callback, binaryPath, texturePath, callbackProgress ) {\n  var func = \"THREE.BinaryLoader.loadAjaxBuffers\";\n\n  var url = binaryPath + json.buffers;\n\n  if (TiddlyWiki && url.match(/^tw:/)) {\n    var res = TiddlyWiki.load(url);\n    //hack.log(\"res.length = \"+res.length, hack.loader, func);\n\n    this.createBinModel(res, callback, texturePath, json.materials);\n\n    hack.log(\"url: \"+url+\": loaded\", hack.loader, func);\n    return;\n  }\n\n\tvar scope = this;\n\n\tvar xhr = new XMLHttpRequest(),\n\t\turl = binaryPath + json.buffers;\n\n\txhr.addEventListener( 'load', function ( event ) {\n\n\t\tvar buffer = xhr.response;\n\n\t\tif ( buffer === undefined ) {\n\n\t\t\t// IEWEBGL needs this\n\t\t\tbuffer = ( new Uint8Array( xhr.responseBody ) ).buffer;\n\n\t\t}\n\n\t\tif ( buffer.byteLength == 0 ) {  // iOS and other XMLHttpRequest level 1\n\n\t\t\tvar buffer = new ArrayBuffer( xhr.responseText.length );\n\n\t\t\tvar bufView = new Uint8Array( buffer );\n\n\t\t\tfor ( var i = 0, l = xhr.responseText.length; i < l; i ++ ) {\n\n\t\t\t\tbufView[ i ] = xhr.responseText.charCodeAt( i ) & 0xff;\n\n\t\t\t}\n\n\t\t}\n\n\t\tscope.createBinModel( buffer, callback, texturePath, json.materials );\n\n\t}, false );\n\n\tif ( callbackProgress !== undefined ) {\n\n\t\txhr.addEventListener( 'progress', function ( event ) {\n\n\t\t\tif ( event.lengthComputable ) {\n\n\t\t\t\tcallbackProgress( event );\n\n\t\t\t}\n\n\t\t}, false );\n\n\t}\n\n\txhr.addEventListener( 'error', function ( event ) {\n\n\t\tconsole.error( \"THREE.BinaryLoader: Couldn't load [\" + url + \"] [\" + xhr.status + \"]\" );\n\n\t}, false );\n\n\n\txhr.open( \"GET\", url, true );\n\txhr.responseType = \"arraybuffer\";\n\tif ( xhr.overrideMimeType ) xhr.overrideMimeType( \"text/plain; charset=x-user-defined\" );\n\txhr.send( null );\n\n};\n\n// Binary AJAX parser\n\nTHREE.BinaryLoader.prototype.createBinModel = function ( data, callback, texturePath, jsonMaterials ) {\n\n\tvar Model = function ( texturePath ) {\n\n\t\tvar scope = this,\n\t\t\tcurrentOffset = 0,\n\t\t\tmd,\n\t\t\tnormals = [],\n\t\t\tuvs = [],\n\t\t\tstart_tri_flat, start_tri_smooth, start_tri_flat_uv, start_tri_smooth_uv,\n\t\t\tstart_quad_flat, start_quad_smooth, start_quad_flat_uv, start_quad_smooth_uv,\n\t\t\ttri_size, quad_size,\n\t\t\tlen_tri_flat, len_tri_smooth, len_tri_flat_uv, len_tri_smooth_uv,\n\t\t\tlen_quad_flat, len_quad_smooth, len_quad_flat_uv, len_quad_smooth_uv;\n\n\n\t\tTHREE.Geometry.call( this );\n\n\t\tmd = parseMetaData( data, currentOffset );\n\n\t\tcurrentOffset += md.header_bytes;\n/*\n\t\tmd.vertex_index_bytes = Uint32Array.BYTES_PER_ELEMENT;\n\t\tmd.material_index_bytes = Uint16Array.BYTES_PER_ELEMENT;\n\t\tmd.normal_index_bytes = Uint32Array.BYTES_PER_ELEMENT;\n\t\tmd.uv_index_bytes = Uint32Array.BYTES_PER_ELEMENT;\n*/\n\t\t// buffers sizes\n\n\t\ttri_size =  md.vertex_index_bytes * 3 + md.material_index_bytes;\n\t\tquad_size = md.vertex_index_bytes * 4 + md.material_index_bytes;\n\n\t\tlen_tri_flat      = md.ntri_flat      * ( tri_size );\n\t\tlen_tri_smooth    = md.ntri_smooth    * ( tri_size + md.normal_index_bytes * 3 );\n\t\tlen_tri_flat_uv   = md.ntri_flat_uv   * ( tri_size + md.uv_index_bytes * 3 );\n\t\tlen_tri_smooth_uv = md.ntri_smooth_uv * ( tri_size + md.normal_index_bytes * 3 + md.uv_index_bytes * 3 );\n\n\t\tlen_quad_flat      = md.nquad_flat      * ( quad_size );\n\t\tlen_quad_smooth    = md.nquad_smooth    * ( quad_size + md.normal_index_bytes * 4 );\n\t\tlen_quad_flat_uv   = md.nquad_flat_uv   * ( quad_size + md.uv_index_bytes * 4 );\n\t\tlen_quad_smooth_uv = md.nquad_smooth_uv * ( quad_size + md.normal_index_bytes * 4 + md.uv_index_bytes * 4 );\n\n\t\t// read buffers\n\n\t\tcurrentOffset += init_vertices( currentOffset );\n\n\t\tcurrentOffset += init_normals( currentOffset );\n\t\tcurrentOffset += handlePadding( md.nnormals * 3 );\n\n\t\tcurrentOffset += init_uvs( currentOffset );\n\n\t\tstart_tri_flat \t\t= currentOffset;\n\t\tstart_tri_smooth    = start_tri_flat    + len_tri_flat    + handlePadding( md.ntri_flat * 2 );\n\t\tstart_tri_flat_uv   = start_tri_smooth  + len_tri_smooth  + handlePadding( md.ntri_smooth * 2 );\n\t\tstart_tri_smooth_uv = start_tri_flat_uv + len_tri_flat_uv + handlePadding( md.ntri_flat_uv * 2 );\n\n\t\tstart_quad_flat     = start_tri_smooth_uv + len_tri_smooth_uv  + handlePadding( md.ntri_smooth_uv * 2 );\n\t\tstart_quad_smooth   = start_quad_flat     + len_quad_flat\t   + handlePadding( md.nquad_flat * 2 );\n\t\tstart_quad_flat_uv  = start_quad_smooth   + len_quad_smooth    + handlePadding( md.nquad_smooth * 2 );\n\t\tstart_quad_smooth_uv= start_quad_flat_uv  + len_quad_flat_uv   + handlePadding( md.nquad_flat_uv * 2 );\n\n\t\t// have to first process faces with uvs\n\t\t// so that face and uv indices match\n\n\t\tinit_triangles_flat_uv( start_tri_flat_uv );\n\t\tinit_triangles_smooth_uv( start_tri_smooth_uv );\n\n\t\tinit_quads_flat_uv( start_quad_flat_uv );\n\t\tinit_quads_smooth_uv( start_quad_smooth_uv );\n\n\t\t// now we can process untextured faces\n\n\t\tinit_triangles_flat( start_tri_flat );\n\t\tinit_triangles_smooth( start_tri_smooth );\n\n\t\tinit_quads_flat( start_quad_flat );\n\t\tinit_quads_smooth( start_quad_smooth );\n\n\t\tthis.computeFaceNormals();\n\n\t\tfunction handlePadding( n ) {\n\n\t\t\treturn ( n % 4 ) ? ( 4 - n % 4 ) : 0;\n\n\t\t};\n\n\t\tfunction parseMetaData( data, offset ) {\n\n\t\t\tvar metaData = {\n\n\t\t\t\t'signature'               :parseString( data, offset,  12 ),\n\t\t\t\t'header_bytes'            :parseUChar8( data, offset + 12 ),\n\n\t\t\t\t'vertex_coordinate_bytes' :parseUChar8( data, offset + 13 ),\n\t\t\t\t'normal_coordinate_bytes' :parseUChar8( data, offset + 14 ),\n\t\t\t\t'uv_coordinate_bytes'     :parseUChar8( data, offset + 15 ),\n\n\t\t\t\t'vertex_index_bytes'      :parseUChar8( data, offset + 16 ),\n\t\t\t\t'normal_index_bytes'      :parseUChar8( data, offset + 17 ),\n\t\t\t\t'uv_index_bytes'          :parseUChar8( data, offset + 18 ),\n\t\t\t\t'material_index_bytes'    :parseUChar8( data, offset + 19 ),\n\n\t\t\t\t'nvertices'    :parseUInt32( data, offset + 20 ),\n\t\t\t\t'nnormals'     :parseUInt32( data, offset + 20 + 4*1 ),\n\t\t\t\t'nuvs'         :parseUInt32( data, offset + 20 + 4*2 ),\n\n\t\t\t\t'ntri_flat'      :parseUInt32( data, offset + 20 + 4*3 ),\n\t\t\t\t'ntri_smooth'    :parseUInt32( data, offset + 20 + 4*4 ),\n\t\t\t\t'ntri_flat_uv'   :parseUInt32( data, offset + 20 + 4*5 ),\n\t\t\t\t'ntri_smooth_uv' :parseUInt32( data, offset + 20 + 4*6 ),\n\n\t\t\t\t'nquad_flat'      :parseUInt32( data, offset + 20 + 4*7 ),\n\t\t\t\t'nquad_smooth'    :parseUInt32( data, offset + 20 + 4*8 ),\n\t\t\t\t'nquad_flat_uv'   :parseUInt32( data, offset + 20 + 4*9 ),\n\t\t\t\t'nquad_smooth_uv' :parseUInt32( data, offset + 20 + 4*10 )\n\n\t\t\t};\n/*\n\t\t\tconsole.log( \"signature: \" + metaData.signature );\n\n\t\t\tconsole.log( \"header_bytes: \" + metaData.header_bytes );\n\t\t\tconsole.log( \"vertex_coordinate_bytes: \" + metaData.vertex_coordinate_bytes );\n\t\t\tconsole.log( \"normal_coordinate_bytes: \" + metaData.normal_coordinate_bytes );\n\t\t\tconsole.log( \"uv_coordinate_bytes: \" + metaData.uv_coordinate_bytes );\n\n\t\t\tconsole.log( \"vertex_index_bytes: \" + metaData.vertex_index_bytes );\n\t\t\tconsole.log( \"normal_index_bytes: \" + metaData.normal_index_bytes );\n\t\t\tconsole.log( \"uv_index_bytes: \" + metaData.uv_index_bytes );\n\t\t\tconsole.log( \"material_index_bytes: \" + metaData.material_index_bytes );\n\n\t\t\tconsole.log( \"nvertices: \" + metaData.nvertices );\n\t\t\tconsole.log( \"nnormals: \" + metaData.nnormals );\n\t\t\tconsole.log( \"nuvs: \" + metaData.nuvs );\n\n\t\t\tconsole.log( \"ntri_flat: \" + metaData.ntri_flat );\n\t\t\tconsole.log( \"ntri_smooth: \" + metaData.ntri_smooth );\n\t\t\tconsole.log( \"ntri_flat_uv: \" + metaData.ntri_flat_uv );\n\t\t\tconsole.log( \"ntri_smooth_uv: \" + metaData.ntri_smooth_uv );\n\n\t\t\tconsole.log( \"nquad_flat: \" + metaData.nquad_flat );\n\t\t\tconsole.log( \"nquad_smooth: \" + metaData.nquad_smooth );\n\t\t\tconsole.log( \"nquad_flat_uv: \" + metaData.nquad_flat_uv );\n\t\t\tconsole.log( \"nquad_smooth_uv: \" + metaData.nquad_smooth_uv );\n\n\t\t\tvar total = metaData.header_bytes\n\t\t\t\t\t  + metaData.nvertices * metaData.vertex_coordinate_bytes * 3\n\t\t\t\t\t  + metaData.nnormals * metaData.normal_coordinate_bytes * 3\n\t\t\t\t\t  + metaData.nuvs * metaData.uv_coordinate_bytes * 2\n\t\t\t\t\t  + metaData.ntri_flat * ( metaData.vertex_index_bytes*3 + metaData.material_index_bytes )\n\t\t\t\t\t  + metaData.ntri_smooth * ( metaData.vertex_index_bytes*3 + metaData.material_index_bytes + metaData.normal_index_bytes*3 )\n\t\t\t\t\t  + metaData.ntri_flat_uv * ( metaData.vertex_index_bytes*3 + metaData.material_index_bytes + metaData.uv_index_bytes*3 )\n\t\t\t\t\t  + metaData.ntri_smooth_uv * ( metaData.vertex_index_bytes*3 + metaData.material_index_bytes + metaData.normal_index_bytes*3 + metaData.uv_index_bytes*3 )\n\t\t\t\t\t  + metaData.nquad_flat * ( metaData.vertex_index_bytes*4 + metaData.material_index_bytes )\n\t\t\t\t\t  + metaData.nquad_smooth * ( metaData.vertex_index_bytes*4 + metaData.material_index_bytes + metaData.normal_index_bytes*4 )\n\t\t\t\t\t  + metaData.nquad_flat_uv * ( metaData.vertex_index_bytes*4 + metaData.material_index_bytes + metaData.uv_index_bytes*4 )\n\t\t\t\t\t  + metaData.nquad_smooth_uv * ( metaData.vertex_index_bytes*4 + metaData.material_index_bytes + metaData.normal_index_bytes*4 + metaData.uv_index_bytes*4 );\n\t\t\tconsole.log( \"total bytes: \" + total );\n*/\n\n\t\t\treturn metaData;\n\n\t\t};\n\n\t\tfunction parseString( data, offset, length ) {\n\n\t\t\tvar charArray = new Uint8Array( data, offset, length );\n\n\t\t\tvar text = \"\";\n\n\t\t\tfor ( var i = 0; i < length; i ++ ) {\n\n\t\t\t\ttext += String.fromCharCode( charArray[ offset + i ] );\n\n\t\t\t}\n\n\t\t\treturn text;\n\n\t\t};\n\n\t\tfunction parseUChar8( data, offset ) {\n\n\t\t\tvar charArray = new Uint8Array( data, offset, 1 );\n\n\t\t\treturn charArray[ 0 ];\n\n\t\t};\n\n\t\tfunction parseUInt32( data, offset ) {\n\n\t\t\tvar intArray = new Uint32Array( data, offset, 1 );\n\n\t\t\treturn intArray[ 0 ];\n\n\t\t};\n\n\t\tfunction init_vertices( start ) {\n\n\t\t\tvar nElements = md.nvertices;\n\n\t\t\tvar coordArray = new Float32Array( data, start, nElements * 3 );\n\n\t\t\tvar i, x, y, z;\n\n\t\t\tfor( i = 0; i < nElements; i ++ ) {\n\n\t\t\t\tx = coordArray[ i * 3 ];\n\t\t\t\ty = coordArray[ i * 3 + 1 ];\n\t\t\t\tz = coordArray[ i * 3 + 2 ];\n\n\t\t\t\tscope.vertices.push( new THREE.Vector3( x, y, z ) );\n\n\t\t\t}\n\n\t\t\treturn nElements * 3 * Float32Array.BYTES_PER_ELEMENT;\n\n\t\t};\n\n\t\tfunction init_normals( start ) {\n\n\t\t\tvar nElements = md.nnormals;\n\n\t\t\tif ( nElements ) {\n\n\t\t\t\tvar normalArray = new Int8Array( data, start, nElements * 3 );\n\n\t\t\t\tvar i, x, y, z;\n\n\t\t\t\tfor( i = 0; i < nElements; i ++ ) {\n\n\t\t\t\t\tx = normalArray[ i * 3 ];\n\t\t\t\t\ty = normalArray[ i * 3 + 1 ];\n\t\t\t\t\tz = normalArray[ i * 3 + 2 ];\n\n\t\t\t\t\tnormals.push( x/127, y/127, z/127 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn nElements * 3 * Int8Array.BYTES_PER_ELEMENT;\n\n\t\t};\n\n\t\tfunction init_uvs( start ) {\n\n\t\t\tvar nElements = md.nuvs;\n\n\t\t\tif ( nElements ) {\n\n\t\t\t\tvar uvArray = new Float32Array( data, start, nElements * 2 );\n\n\t\t\t\tvar i, u, v;\n\n\t\t\t\tfor( i = 0; i < nElements; i ++ ) {\n\n\t\t\t\t\tu = uvArray[ i * 2 ];\n\t\t\t\t\tv = uvArray[ i * 2 + 1 ];\n\n\t\t\t\t\tuvs.push( u, v );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn nElements * 2 * Float32Array.BYTES_PER_ELEMENT;\n\n\t\t};\n\n\t\tfunction init_uvs3( nElements, offset ) {\n\n\t\t\tvar i, uva, uvb, uvc, u1, u2, u3, v1, v2, v3;\n\n\t\t\tvar uvIndexBuffer = new Uint32Array( data, offset, 3 * nElements );\n\n\t\t\tfor( i = 0; i < nElements; i ++ ) {\n\n\t\t\t\tuva = uvIndexBuffer[ i * 3 ];\n\t\t\t\tuvb = uvIndexBuffer[ i * 3 + 1 ];\n\t\t\t\tuvc = uvIndexBuffer[ i * 3 + 2 ];\n\n\t\t\t\tu1 = uvs[ uva*2 ];\n\t\t\t\tv1 = uvs[ uva*2 + 1 ];\n\n\t\t\t\tu2 = uvs[ uvb*2 ];\n\t\t\t\tv2 = uvs[ uvb*2 + 1 ];\n\n\t\t\t\tu3 = uvs[ uvc*2 ];\n\t\t\t\tv3 = uvs[ uvc*2 + 1 ];\n\n\t\t\t\tscope.faceVertexUvs[ 0 ].push( [\n\t\t\t\t\tnew THREE.Vector2( u1, v1 ),\n\t\t\t\t\tnew THREE.Vector2( u2, v2 ),\n\t\t\t\t\tnew THREE.Vector2( u3, v3 )\n\t\t\t\t] );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction init_uvs4( nElements, offset ) {\n\n\t\t\tvar i, uva, uvb, uvc, uvd, u1, u2, u3, u4, v1, v2, v3, v4;\n\n\t\t\tvar uvIndexBuffer = new Uint32Array( data, offset, 4 * nElements );\n\n\t\t\tfor( i = 0; i < nElements; i ++ ) {\n\n\t\t\t\tuva = uvIndexBuffer[ i * 4 ];\n\t\t\t\tuvb = uvIndexBuffer[ i * 4 + 1 ];\n\t\t\t\tuvc = uvIndexBuffer[ i * 4 + 2 ];\n\t\t\t\tuvd = uvIndexBuffer[ i * 4 + 3 ];\n\n\t\t\t\tu1 = uvs[ uva*2 ];\n\t\t\t\tv1 = uvs[ uva*2 + 1 ];\n\n\t\t\t\tu2 = uvs[ uvb*2 ];\n\t\t\t\tv2 = uvs[ uvb*2 + 1 ];\n\n\t\t\t\tu3 = uvs[ uvc*2 ];\n\t\t\t\tv3 = uvs[ uvc*2 + 1 ];\n\n\t\t\t\tu4 = uvs[ uvd*2 ];\n\t\t\t\tv4 = uvs[ uvd*2 + 1 ];\n\n\t\t\t\tscope.faceVertexUvs[ 0 ].push( [\n\t\t\t\t\tnew THREE.Vector2( u1, v1 ),\n\t\t\t\t\tnew THREE.Vector2( u2, v2 ),\n\t\t\t\t\tnew THREE.Vector2( u4, v4 )\n\t\t\t\t] );\n\n\t\t\t\tscope.faceVertexUvs[ 0 ].push( [\n\t\t\t\t\tnew THREE.Vector2( u2, v2 ),\n\t\t\t\t\tnew THREE.Vector2( u3, v3 ),\n\t\t\t\t\tnew THREE.Vector2( u4, v4 )\n\t\t\t\t] );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction init_faces3_flat( nElements, offsetVertices, offsetMaterials ) {\n\n\t\t\tvar i, a, b, c, m;\n\n\t\t\tvar vertexIndexBuffer = new Uint32Array( data, offsetVertices, 3 * nElements );\n\t\t\tvar materialIndexBuffer = new Uint16Array( data, offsetMaterials, nElements );\n\n\t\t\tfor( i = 0; i < nElements; i ++ ) {\n\n\t\t\t\ta = vertexIndexBuffer[ i * 3 ];\n\t\t\t\tb = vertexIndexBuffer[ i * 3 + 1 ];\n\t\t\t\tc = vertexIndexBuffer[ i * 3 + 2 ];\n\n\t\t\t\tm = materialIndexBuffer[ i ];\n\n\t\t\t\tscope.faces.push( new THREE.Face3( a, b, c, null, null, m ) );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction init_faces4_flat( nElements, offsetVertices, offsetMaterials ) {\n\n\t\t\tvar i, a, b, c, d, m;\n\n\t\t\tvar vertexIndexBuffer = new Uint32Array( data, offsetVertices, 4 * nElements );\n\t\t\tvar materialIndexBuffer = new Uint16Array( data, offsetMaterials, nElements );\n\n\t\t\tfor( i = 0; i < nElements; i ++ ) {\n\n\t\t\t\ta = vertexIndexBuffer[ i * 4 ];\n\t\t\t\tb = vertexIndexBuffer[ i * 4 + 1 ];\n\t\t\t\tc = vertexIndexBuffer[ i * 4 + 2 ];\n\t\t\t\td = vertexIndexBuffer[ i * 4 + 3 ];\n\n\t\t\t\tm = materialIndexBuffer[ i ];\n\n\t\t\t\tscope.faces.push( new THREE.Face3( a, b, d, null, null, m ) );\n\t\t\t\tscope.faces.push( new THREE.Face3( b, c, d, null, null, m ) );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction init_faces3_smooth( nElements, offsetVertices, offsetNormals, offsetMaterials ) {\n\n\t\t\tvar i, a, b, c, m;\n\t\t\tvar na, nb, nc;\n\n\t\t\tvar vertexIndexBuffer = new Uint32Array( data, offsetVertices, 3 * nElements );\n\t\t\tvar normalIndexBuffer = new Uint32Array( data, offsetNormals, 3 * nElements );\n\t\t\tvar materialIndexBuffer = new Uint16Array( data, offsetMaterials, nElements );\n\n\t\t\tfor( i = 0; i < nElements; i ++ ) {\n\n\t\t\t\ta = vertexIndexBuffer[ i * 3 ];\n\t\t\t\tb = vertexIndexBuffer[ i * 3 + 1 ];\n\t\t\t\tc = vertexIndexBuffer[ i * 3 + 2 ];\n\n\t\t\t\tna = normalIndexBuffer[ i * 3 ];\n\t\t\t\tnb = normalIndexBuffer[ i * 3 + 1 ];\n\t\t\t\tnc = normalIndexBuffer[ i * 3 + 2 ];\n\n\t\t\t\tm = materialIndexBuffer[ i ];\n\n\t\t\t\tvar nax = normals[ na*3     ],\n\t\t\t\t\tnay = normals[ na*3 + 1 ],\n\t\t\t\t\tnaz = normals[ na*3 + 2 ],\n\n\t\t\t\t\tnbx = normals[ nb*3     ],\n\t\t\t\t\tnby = normals[ nb*3 + 1 ],\n\t\t\t\t\tnbz = normals[ nb*3 + 2 ],\n\n\t\t\t\t\tncx = normals[ nc*3     ],\n\t\t\t\t\tncy = normals[ nc*3 + 1 ],\n\t\t\t\t\tncz = normals[ nc*3 + 2 ];\n\n\t\t\t\tscope.faces.push( new THREE.Face3( a, b, c, [\n\t\t\t\t\tnew THREE.Vector3( nax, nay, naz ),\n\t\t\t\t\tnew THREE.Vector3( nbx, nby, nbz ),\n\t\t\t\t\tnew THREE.Vector3( ncx, ncy, ncz )\n\t\t\t\t], null, m ) );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction init_faces4_smooth( nElements, offsetVertices, offsetNormals, offsetMaterials ) {\n\n\t\t\tvar i, a, b, c, d, m;\n\t\t\tvar na, nb, nc, nd;\n\n\t\t\tvar vertexIndexBuffer = new Uint32Array( data, offsetVertices, 4 * nElements );\n\t\t\tvar normalIndexBuffer = new Uint32Array( data, offsetNormals, 4 * nElements );\n\t\t\tvar materialIndexBuffer = new Uint16Array( data, offsetMaterials, nElements );\n\n\t\t\tfor( i = 0; i < nElements; i ++ ) {\n\n\t\t\t\ta = vertexIndexBuffer[ i * 4 ];\n\t\t\t\tb = vertexIndexBuffer[ i * 4 + 1 ];\n\t\t\t\tc = vertexIndexBuffer[ i * 4 + 2 ];\n\t\t\t\td = vertexIndexBuffer[ i * 4 + 3 ];\n\n\t\t\t\tna = normalIndexBuffer[ i * 4 ];\n\t\t\t\tnb = normalIndexBuffer[ i * 4 + 1 ];\n\t\t\t\tnc = normalIndexBuffer[ i * 4 + 2 ];\n\t\t\t\tnd = normalIndexBuffer[ i * 4 + 3 ];\n\n\t\t\t\tm = materialIndexBuffer[ i ];\n\n\t\t\t\tvar nax = normals[ na*3     ],\n\t\t\t\t\tnay = normals[ na*3 + 1 ],\n\t\t\t\t\tnaz = normals[ na*3 + 2 ],\n\n\t\t\t\t\tnbx = normals[ nb*3     ],\n\t\t\t\t\tnby = normals[ nb*3 + 1 ],\n\t\t\t\t\tnbz = normals[ nb*3 + 2 ],\n\n\t\t\t\t\tncx = normals[ nc*3     ],\n\t\t\t\t\tncy = normals[ nc*3 + 1 ],\n\t\t\t\t\tncz = normals[ nc*3 + 2 ],\n\n\t\t\t\t\tndx = normals[ nd*3     ],\n\t\t\t\t\tndy = normals[ nd*3 + 1 ],\n\t\t\t\t\tndz = normals[ nd*3 + 2 ];\n\n\t\t\t\tscope.faces.push( new THREE.Face3( a, b, d, [\n\t\t\t\t\tnew THREE.Vector3( nax, nay, naz ),\n\t\t\t\t\tnew THREE.Vector3( nbx, nby, nbz ),\n\t\t\t\t\tnew THREE.Vector3( ndx, ndy, ndz )\n\t\t\t\t], null, m ) );\n\n\t\t\t\tscope.faces.push( new THREE.Face3( b, c, d, [\n\t\t\t\t\tnew THREE.Vector3( nbx, nby, nbz ),\n\t\t\t\t\tnew THREE.Vector3( ncx, ncy, ncz ),\n\t\t\t\t\tnew THREE.Vector3( ndx, ndy, ndz )\n\t\t\t\t], null, m ) );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction init_triangles_flat( start ) {\n\n\t\t\tvar nElements = md.ntri_flat;\n\n\t\t\tif ( nElements ) {\n\n\t\t\t\tvar offsetMaterials = start + nElements * Uint32Array.BYTES_PER_ELEMENT * 3;\n\t\t\t\tinit_faces3_flat( nElements, start, offsetMaterials );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction init_triangles_flat_uv( start ) {\n\n\t\t\tvar nElements = md.ntri_flat_uv;\n\n\t\t\tif ( nElements ) {\n\n\t\t\t\tvar offsetUvs = start + nElements * Uint32Array.BYTES_PER_ELEMENT * 3;\n\t\t\t\tvar offsetMaterials = offsetUvs + nElements * Uint32Array.BYTES_PER_ELEMENT * 3;\n\n\t\t\t\tinit_faces3_flat( nElements, start, offsetMaterials );\n\t\t\t\tinit_uvs3( nElements, offsetUvs );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction init_triangles_smooth( start ) {\n\n\t\t\tvar nElements = md.ntri_smooth;\n\n\t\t\tif ( nElements ) {\n\n\t\t\t\tvar offsetNormals = start + nElements * Uint32Array.BYTES_PER_ELEMENT * 3;\n\t\t\t\tvar offsetMaterials = offsetNormals + nElements * Uint32Array.BYTES_PER_ELEMENT * 3;\n\n\t\t\t\tinit_faces3_smooth( nElements, start, offsetNormals, offsetMaterials );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction init_triangles_smooth_uv( start ) {\n\n\t\t\tvar nElements = md.ntri_smooth_uv;\n\n\t\t\tif ( nElements ) {\n\n\t\t\t\tvar offsetNormals = start + nElements * Uint32Array.BYTES_PER_ELEMENT * 3;\n\t\t\t\tvar offsetUvs = offsetNormals + nElements * Uint32Array.BYTES_PER_ELEMENT * 3;\n\t\t\t\tvar offsetMaterials = offsetUvs + nElements * Uint32Array.BYTES_PER_ELEMENT * 3;\n\n\t\t\t\tinit_faces3_smooth( nElements, start, offsetNormals, offsetMaterials );\n\t\t\t\tinit_uvs3( nElements, offsetUvs );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction init_quads_flat( start ) {\n\n\t\t\tvar nElements = md.nquad_flat;\n\n\t\t\tif ( nElements ) {\n\n\t\t\t\tvar offsetMaterials = start + nElements * Uint32Array.BYTES_PER_ELEMENT * 4;\n\t\t\t\tinit_faces4_flat( nElements, start, offsetMaterials );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction init_quads_flat_uv( start ) {\n\n\t\t\tvar nElements = md.nquad_flat_uv;\n\n\t\t\tif ( nElements ) {\n\n\t\t\t\tvar offsetUvs = start + nElements * Uint32Array.BYTES_PER_ELEMENT * 4;\n\t\t\t\tvar offsetMaterials = offsetUvs + nElements * Uint32Array.BYTES_PER_ELEMENT * 4;\n\n\t\t\t\tinit_faces4_flat( nElements, start, offsetMaterials );\n\t\t\t\tinit_uvs4( nElements, offsetUvs );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction init_quads_smooth( start ) {\n\n\t\t\tvar nElements = md.nquad_smooth;\n\n\t\t\tif ( nElements ) {\n\n\t\t\t\tvar offsetNormals = start + nElements * Uint32Array.BYTES_PER_ELEMENT * 4;\n\t\t\t\tvar offsetMaterials = offsetNormals + nElements * Uint32Array.BYTES_PER_ELEMENT * 4;\n\n\t\t\t\tinit_faces4_smooth( nElements, start, offsetNormals, offsetMaterials );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction init_quads_smooth_uv( start ) {\n\n\t\t\tvar nElements = md.nquad_smooth_uv;\n\n\t\t\tif ( nElements ) {\n\n\t\t\t\tvar offsetNormals = start + nElements * Uint32Array.BYTES_PER_ELEMENT * 4;\n\t\t\t\tvar offsetUvs = offsetNormals + nElements * Uint32Array.BYTES_PER_ELEMENT * 4;\n\t\t\t\tvar offsetMaterials = offsetUvs + nElements * Uint32Array.BYTES_PER_ELEMENT * 4;\n\n\t\t\t\tinit_faces4_smooth( nElements, start, offsetNormals, offsetMaterials );\n\t\t\t\tinit_uvs4( nElements, offsetUvs );\n\n\t\t\t}\n\n\t\t};\n\n\t};\n\n\tModel.prototype = Object.create( THREE.Geometry.prototype );\n\n\tvar geometry = new Model( texturePath );\n\tvar materials = this.initMaterials( jsonMaterials, texturePath );\n\n\tif ( this.needsTangents( materials ) ) geometry.computeTangents();\n\n\tcallback( geometry, materials );\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Loaders/ColladaLoader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Loaders/ColladaLoader.js",
            "module-type": "library",
            "text": "/**\n* @author Tim Knip / http://www.floorplanner.com/ / tim at floorplanner.com\n* @author Tony Parisi / http://www.tonyparisi.com/\n*/\n\nTHREE.ColladaLoader = function () {\n\n\tvar COLLADA = null;\n\tvar scene = null;\n\tvar daeScene;\n\n\tvar readyCallbackFunc = null;\n\n\tvar sources = {};\n\tvar images = {};\n\tvar animations = {};\n\tvar controllers = {};\n\tvar geometries = {};\n\tvar materials = {};\n\tvar effects = {};\n\tvar cameras = {};\n\tvar lights = {};\n\n\tvar animData;\n\tvar visualScenes;\n\tvar baseUrl;\n\tvar morphs;\n\tvar skins;\n\n\tvar flip_uv = true;\n\tvar preferredShading = THREE.SmoothShading;\n\n\tvar options = {\n\t\t// Force Geometry to always be centered at the local origin of the\n\t\t// containing Mesh.\n\t\tcenterGeometry: false,\n\n\t\t// Axis conversion is done for geometries, animations, and controllers.\n\t\t// If we ever pull cameras or lights out of the COLLADA file, they'll\n\t\t// need extra work.\n\t\tconvertUpAxis: false,\n\n\t\tsubdivideFaces: true,\n\n\t\tupAxis: 'Y',\n\n\t\t// For reflective or refractive materials we'll use this cubemap\n\t\tdefaultEnvMap: null\n\n\t};\n\n\tvar colladaUnit = 1.0;\n\tvar colladaUp = 'Y';\n\tvar upConversion = null;\n\n\tfunction load ( url, readyCallback, progressCallback ) {\n          var func = \"THREE.ColladaLoader.load\";\n\n\t\tvar length = 0;\n\n\t\tif ( document.implementation && document.implementation.createDocument ) {\n\n                  if (TiddlyWiki && url.match(/^tw:/)) {\n                    this._url = url;\n                    var res = TiddlyWiki.load(url);\n                    //hack.log(\"res.byteLength = \"+res.byteLength, hack.loader, func);\n                    //hack.log(\"res = \"+res, hack.loader, func);\n\t\t    readyCallbackFunc = readyCallback;\n\t\t    var xmlParser = new DOMParser();\n\t\t    var responseXML = xmlParser.parseFromString(res, \"application/xml\" );\n\t\t    parse(responseXML, undefined, url);\n                    hack.log(\"url: \"+url+\": loaded\", hack.loader, func);\n                    return;\n                  }\n\n\t\t\tvar request = new XMLHttpRequest();\n\n\t\t\trequest.onreadystatechange = function() {\n\n\t\t\t\tif( request.readyState == 4 ) {\n\n\t\t\t\t\tif( request.status == 0 || request.status == 200 ) {\n\n\n\t\t\t\t\t\tif ( request.responseXML ) {\n\n\t\t\t\t\t\t\treadyCallbackFunc = readyCallback;\n\t\t\t\t\t\t\tparse( request.responseXML, undefined, url );\n\n\t\t\t\t\t\t} else if ( request.responseText ) {\n\n\t\t\t\t\t\t\treadyCallbackFunc = readyCallback;\n\t\t\t\t\t\t\tvar xmlParser = new DOMParser();\n\t\t\t\t\t\t\tvar responseXML = xmlParser.parseFromString( request.responseText, \"application/xml\" );\n\t\t\t\t\t\t\tparse( responseXML, undefined, url );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tconsole.error( \"ColladaLoader: Empty or non-existing file (\" + url + \")\" );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( request.readyState == 3 ) {\n\n\t\t\t\t\tif ( progressCallback ) {\n\n\t\t\t\t\t\tif ( length == 0 ) {\n\n\t\t\t\t\t\t\tlength = request.getResponseHeader( \"Content-Length\" );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tprogressCallback( { total: length, loaded: request.responseText.length } );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\trequest.open( \"GET\", url, true );\n\t\t\trequest.send( null );\n\n\t\t} else {\n\n\t\t\talert( \"Don't know how to parse XML!\" );\n\n\t\t}\n\n\t}\n\n\tfunction parse( doc, callBack, url ) {\n\n\t\tCOLLADA = doc;\n\t\tcallBack = callBack || readyCallbackFunc;\n\n\t\tif ( url !== undefined ) {\n\n\t\t\tvar parts = url.split( '/' );\n\t\t\tparts.pop();\n\t\t\tbaseUrl = ( parts.length < 1 ? '.' : parts.join( '/' ) ) + '/';\n\n\t\t}\n\n\t\tparseAsset();\n\t\tsetUpConversion();\n\t\timages = parseLib( \"library_images image\", _Image, \"image\" );\n\t\tmaterials = parseLib( \"library_materials material\", Material, \"material\" );\n\t\teffects = parseLib( \"library_effects effect\", Effect, \"effect\" );\n\t\tgeometries = parseLib( \"library_geometries geometry\", Geometry, \"geometry\" );\n\t\tcameras = parseLib( \"library_cameras camera\", Camera, \"camera\" );\n\t\tlights = parseLib( \"library_lights light\", Light, \"light\" );\n\t\tcontrollers = parseLib( \"library_controllers controller\", Controller, \"controller\" );\n\t\tanimations = parseLib( \"library_animations animation\", Animation, \"animation\" );\n\t\tvisualScenes = parseLib( \"library_visual_scenes visual_scene\", VisualScene, \"visual_scene\" );\n\n\t\tmorphs = [];\n\t\tskins = [];\n\n\t\tdaeScene = parseScene();\n\t\tscene = new THREE.Object3D();\n\n\t\tfor ( var i = 0; i < daeScene.nodes.length; i ++ ) {\n\n\t\t\tscene.add( createSceneGraph( daeScene.nodes[ i ] ) );\n\n\t\t}\n\n\t\t// unit conversion\n\t\tscene.scale.multiplyScalar( colladaUnit );\n\n\t\tcreateAnimations();\n\n\t\tvar result = {\n\n\t\t\tscene: scene,\n\t\t\tmorphs: morphs,\n\t\t\tskins: skins,\n\t\t\tanimations: animData,\n\t\t\tdae: {\n\t\t\t\timages: images,\n\t\t\t\tmaterials: materials,\n\t\t\t\tcameras: cameras,\n\t\t\t\tlights: lights,\n\t\t\t\teffects: effects,\n\t\t\t\tgeometries: geometries,\n\t\t\t\tcontrollers: controllers,\n\t\t\t\tanimations: animations,\n\t\t\t\tvisualScenes: visualScenes,\n\t\t\t\tscene: daeScene\n\t\t\t}\n\n\t\t};\n\n\t\tif ( callBack ) {\n\n\t\t\tcallBack( result );\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n\tfunction setPreferredShading ( shading ) {\n\n\t\tpreferredShading = shading;\n\n\t}\n\n\tfunction parseAsset () {\n\n\t\tvar elements = COLLADA.querySelectorAll('asset');\n\n\t\tvar element = elements[0];\n\n\t\tif ( element && element.childNodes ) {\n\n\t\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\t\tvar child = element.childNodes[ i ];\n\n\t\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\t\tcase 'unit':\n\n\t\t\t\t\t\tvar meter = child.getAttribute( 'meter' );\n\n\t\t\t\t\t\tif ( meter ) {\n\n\t\t\t\t\t\t\tcolladaUnit = parseFloat( meter );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'up_axis':\n\n\t\t\t\t\t\tcolladaUp = child.textContent.charAt(0);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction parseLib ( q, classSpec, prefix ) {\n\n\t\tvar elements = COLLADA.querySelectorAll(q);\n\n\t\tvar lib = {};\n\n\t\tvar i = 0;\n\n\t\tvar elementsLength = elements.length;\n\n\t\tfor ( var j = 0; j < elementsLength; j ++ ) {\n\n\t\t\tvar element = elements[j];\n\t\t\tvar daeElement = ( new classSpec() ).parse( element );\n\n\t\t\tif ( !daeElement.id || daeElement.id.length == 0 ) daeElement.id = prefix + ( i ++ );\n\t\t\tlib[ daeElement.id ] = daeElement;\n\n\t\t}\n\n\t\treturn lib;\n\n\t}\n\n\tfunction parseScene() {\n\n\t\tvar sceneElement = COLLADA.querySelectorAll('scene instance_visual_scene')[0];\n\t\tif ( sceneElement ) {\n\n\t\t\tvar url = sceneElement.getAttribute( 'url' ).replace( /^#/, '' );\n\t\t\treturn visualScenes[ url.length > 0 ? url : 'visual_scene0' ];\n\n\t\t} else {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t}\n\n\tfunction createAnimations() {\n\n\t\tanimData = [];\n\n\t\t// fill in the keys\n\t\trecurseHierarchy( scene );\n\n\t}\n\n\tfunction recurseHierarchy( node ) {\n\n\t\tvar n = daeScene.getChildById( node.id, true ),\n\t\t\tnewData = null;\n\n\t\tif ( n && n.keys ) {\n\n\t\t\tnewData = {\n\t\t\t\tfps: 60,\n\t\t\t\thierarchy: [ {\n\t\t\t\t\tnode: n,\n\t\t\t\t\tkeys: n.keys,\n\t\t\t\t\tsids: n.sids\n\t\t\t\t} ],\n\t\t\t\tnode: node,\n\t\t\t\tname: 'animation_' + node.name,\n\t\t\t\tlength: 0\n\t\t\t};\n\n\t\t\tanimData.push(newData);\n\n\t\t\tfor ( var i = 0, il = n.keys.length; i < il; i++ ) {\n\n\t\t\t\tnewData.length = Math.max( newData.length, n.keys[i].time );\n\n\t\t\t}\n\n\t\t} else  {\n\n\t\t\tnewData = {\n\t\t\t\thierarchy: [ {\n\t\t\t\t\tkeys: [],\n\t\t\t\t\tsids: []\n\t\t\t\t} ]\n\t\t\t}\n\n\t\t}\n\n\t\tfor ( var i = 0, il = node.children.length; i < il; i++ ) {\n\n\t\t\tvar d = recurseHierarchy( node.children[i] );\n\n\t\t\tfor ( var j = 0, jl = d.hierarchy.length; j < jl; j ++ ) {\n\n\t\t\t\tnewData.hierarchy.push( {\n\t\t\t\t\tkeys: [],\n\t\t\t\t\tsids: []\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn newData;\n\n\t}\n\n\tfunction calcAnimationBounds () {\n\n\t\tvar start = 1000000;\n\t\tvar end = -start;\n\t\tvar frames = 0;\n\t\tvar ID;\n\t\tfor ( var id in animations ) {\n\n\t\t\tvar animation = animations[ id ];\n\t\t\tID = ID || animation.id;\n\t\t\tfor ( var i = 0; i < animation.sampler.length; i ++ ) {\n\n\t\t\t\tvar sampler = animation.sampler[ i ];\n\n\t\t\t\tsampler.create();\n\n\t\t\t\tstart = Math.min( start, sampler.startTime );\n\t\t\t\tend = Math.max( end, sampler.endTime );\n\t\t\t\tframes = Math.max( frames, sampler.input.length );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn { start:start, end:end, frames:frames,ID:ID };\n\n\t}\n\n\tfunction createMorph ( geometry, ctrl ) {\n\n\t\tvar morphCtrl = ctrl instanceof InstanceController ? controllers[ ctrl.url ] : ctrl;\n\n\t\tif ( !morphCtrl || !morphCtrl.morph ) {\n\n\t\t\tconsole.log(\"could not find morph controller!\");\n\t\t\treturn;\n\n\t\t}\n\n\t\tvar morph = morphCtrl.morph;\n\n\t\tfor ( var i = 0; i < morph.targets.length; i ++ ) {\n\n\t\t\tvar target_id = morph.targets[ i ];\n\t\t\tvar daeGeometry = geometries[ target_id ];\n\n\t\t\tif ( !daeGeometry.mesh ||\n\t\t\t\t !daeGeometry.mesh.primitives ||\n\t\t\t\t !daeGeometry.mesh.primitives.length ) {\n\t\t\t\t continue;\n\t\t\t}\n\n\t\t\tvar target = daeGeometry.mesh.primitives[ 0 ].geometry;\n\n\t\t\tif ( target.vertices.length === geometry.vertices.length ) {\n\n\t\t\t\tgeometry.morphTargets.push( { name: \"target_1\", vertices: target.vertices } );\n\n\t\t\t}\n\n\t\t}\n\n\t\tgeometry.morphTargets.push( { name: \"target_Z\", vertices: geometry.vertices } );\n\n\t};\n\n\tfunction createSkin ( geometry, ctrl, applyBindShape ) {\n\n\t\tvar skinCtrl = controllers[ ctrl.url ];\n\n\t\tif ( !skinCtrl || !skinCtrl.skin ) {\n\n\t\t\tconsole.log( \"could not find skin controller!\" );\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( !ctrl.skeleton || !ctrl.skeleton.length ) {\n\n\t\t\tconsole.log( \"could not find the skeleton for the skin!\" );\n\t\t\treturn;\n\n\t\t}\n\n\t\tvar skin = skinCtrl.skin;\n\t\tvar skeleton = daeScene.getChildById( ctrl.skeleton[ 0 ] );\n\t\tvar hierarchy = [];\n\n\t\tapplyBindShape = applyBindShape !== undefined ? applyBindShape : true;\n\n\t\tvar bones = [];\n\t\tgeometry.skinWeights = [];\n\t\tgeometry.skinIndices = [];\n\n\t\t//createBones( geometry.bones, skin, hierarchy, skeleton, null, -1 );\n\t\t//createWeights( skin, geometry.bones, geometry.skinIndices, geometry.skinWeights );\n\n\t\t/*\n\t\tgeometry.animation = {\n\t\t\tname: 'take_001',\n\t\t\tfps: 30,\n\t\t\tlength: 2,\n\t\t\tJIT: true,\n\t\t\thierarchy: hierarchy\n\t\t};\n\t\t*/\n\n\t\tif ( applyBindShape ) {\n\n\t\t\tfor ( var i = 0; i < geometry.vertices.length; i ++ ) {\n\n\t\t\t\tgeometry.vertices[ i ].applyMatrix4( skin.bindShapeMatrix );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction setupSkeleton ( node, bones, frame, parent ) {\n\n\t\tnode.world = node.world || new THREE.Matrix4();\n\t\tnode.localworld = node.localworld || new THREE.Matrix4();\n\t\tnode.world.copy( node.matrix );\n\t\tnode.localworld.copy( node.matrix );\n\n\t\tif ( node.channels && node.channels.length ) {\n\n\t\t\tvar channel = node.channels[ 0 ];\n\t\t\tvar m = channel.sampler.output[ frame ];\n\n\t\t\tif ( m instanceof THREE.Matrix4 ) {\n\n\t\t\t\tnode.world.copy( m );\n\t\t\t\tnode.localworld.copy(m);\n\t\t\t\tif(frame == 0)\n\t\t\t\t\tnode.matrix.copy(m);\n\t\t\t}\n\n\t\t}\n\n\t\tif ( parent ) {\n\n\t\t\tnode.world.multiplyMatrices( parent, node.world );\n\n\t\t}\n\n\t\tbones.push( node );\n\n\t\tfor ( var i = 0; i < node.nodes.length; i ++ ) {\n\n\t\t\tsetupSkeleton( node.nodes[ i ], bones, frame, node.world );\n\n\t\t}\n\n\t}\n\n\tfunction setupSkinningMatrices ( bones, skin ) {\n\n\t\t// FIXME: this is dumb...\n\n\t\tfor ( var i = 0; i < bones.length; i ++ ) {\n\n\t\t\tvar bone = bones[ i ];\n\t\t\tvar found = -1;\n\n\t\t\tif ( bone.type != 'JOINT' ) continue;\n\n\t\t\tfor ( var j = 0; j < skin.joints.length; j ++ ) {\n\n\t\t\t\tif ( bone.sid == skin.joints[ j ] ) {\n\n\t\t\t\t\tfound = j;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( found >= 0 ) {\n\n\t\t\t\tvar inv = skin.invBindMatrices[ found ];\n\n\t\t\t\tbone.invBindMatrix = inv;\n\t\t\t\tbone.skinningMatrix = new THREE.Matrix4();\n\t\t\t\tbone.skinningMatrix.multiplyMatrices(bone.world, inv); // (IBMi * JMi)\n\t\t\t\tbone.animatrix = new THREE.Matrix4();\n\n\t\t\t\tbone.animatrix.copy(bone.localworld);\n\t\t\t\tbone.weights = [];\n\n\t\t\t\tfor ( var j = 0; j < skin.weights.length; j ++ ) {\n\n\t\t\t\t\tfor (var k = 0; k < skin.weights[ j ].length; k ++ ) {\n\n\t\t\t\t\t\tvar w = skin.weights[ j ][ k ];\n\n\t\t\t\t\t\tif ( w.joint == found ) {\n\n\t\t\t\t\t\t\tbone.weights.push( w );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tconsole.warn( \"ColladaLoader: Could not find joint '\" + bone.sid + \"'.\" );\n\n\t\t\t\tbone.skinningMatrix = new THREE.Matrix4();\n\t\t\t\tbone.weights = [];\n\n\t\t\t}\n\t\t}\n\n\t}\n\n\t//Walk the Collada tree and flatten the bones into a list, extract the position, quat and scale from the matrix\n\tfunction flattenSkeleton(skeleton) {\n\n\t\tvar list = [];\n\t\tvar walk = function(parentid, node, list) {\n\n\t\t\tvar bone = {};\n\t\t\tbone.name = node.sid;\n\t\t\tbone.parent = parentid;\n\t\t\tbone.matrix = node.matrix;\n\t\t\tvar data = [new THREE.Vector3(),new THREE.Quaternion(),new THREE.Vector3()];\n\t\t\tbone.matrix.decompose(data[0],data[1],data[2]);\n\n\t\t\tbone.pos = [data[0].x,data[0].y,data[0].z];\n\n\t\t\tbone.scl = [data[2].x,data[2].y,data[2].z];\n\t\t\tbone.rotq = [data[1].x,data[1].y,data[1].z,data[1].w];\n\t\t\tlist.push(bone);\n\n\t\t\tfor(var i in node.nodes) {\n\n\t\t\t\twalk(node.sid,node.nodes[i],list);\n\n\t\t\t}\n\n\t\t};\n\n\t\twalk(-1,skeleton,list);\n\t\treturn list;\n\n\t}\n\n\t//Move the vertices into the pose that is proper for the start of the animation\n\tfunction skinToBindPose(geometry,skeleton,skinController) {\n\n\t\tvar bones = [];\n\t\tsetupSkeleton( skeleton, bones, -1 );\n\t\tsetupSkinningMatrices( bones, skinController.skin );\n\t\tv = new THREE.Vector3();\n\t\tvar skinned = [];\n\n\t\tfor(var i =0; i < geometry.vertices.length; i++) {\n\n\t\t\tskinned.push(new THREE.Vector3());\n\n\t\t}\n\n\t\tfor ( i = 0; i < bones.length; i ++ ) {\n\n\t\t\tif ( bones[ i ].type != 'JOINT' ) continue;\n\n\t\t\tfor ( j = 0; j < bones[ i ].weights.length; j ++ ) {\n\n\t\t\t\tw = bones[ i ].weights[ j ];\n\t\t\t\tvidx = w.index;\n\t\t\t\tweight = w.weight;\n\n\t\t\t\to = geometry.vertices[vidx];\n\t\t\t\ts = skinned[vidx];\n\n\t\t\t\tv.x = o.x;\n\t\t\t\tv.y = o.y;\n\t\t\t\tv.z = o.z;\n\n\t\t\t\tv.applyMatrix4( bones[i].skinningMatrix );\n\n\t\t\t\ts.x += (v.x * weight);\n\t\t\t\ts.y += (v.y * weight);\n\t\t\t\ts.z += (v.z * weight);\n\t\t\t}\n\n\t\t}\n\n\t\tfor(var i =0; i < geometry.vertices.length; i++) {\n\n\t\t\tgeometry.vertices[i] = skinned[i];\n\n\t\t}\n\n\t}\n\n\tfunction applySkin ( geometry, instanceCtrl, frame ) {\n\n\t\tvar skinController = controllers[ instanceCtrl.url ];\n\n\t\tframe = frame !== undefined ? frame : 40;\n\n\t\tif ( !skinController || !skinController.skin ) {\n\n\t\t\tconsole.log( 'ColladaLoader: Could not find skin controller.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( !instanceCtrl.skeleton || !instanceCtrl.skeleton.length ) {\n\n\t\t\tconsole.log( 'ColladaLoader: Could not find the skeleton for the skin. ' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tvar animationBounds = calcAnimationBounds();\n\t\tvar skeleton = daeScene.getChildById( instanceCtrl.skeleton[0], true ) ||\n\t\t\t\t\t   daeScene.getChildBySid( instanceCtrl.skeleton[0], true );\n\n\t\t//flatten the skeleton into a list of bones\n\t\tvar bonelist = flattenSkeleton(skeleton);\n\t\tvar joints = skinController.skin.joints;\n\n\t\t//sort that list so that the order reflects the order in the joint list\n\t\tvar sortedbones = [];\n\t\tfor(var i = 0; i < joints.length; i++) {\n\n\t\t\tfor(var j =0; j < bonelist.length; j++) {\n\n\t\t\t\tif(bonelist[j].name == joints[i]) {\n\n\t\t\t\t\tsortedbones[i] = bonelist[j];\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t//hook up the parents by index instead of name\n\t\tfor(var i = 0; i < sortedbones.length; i++) {\n\n\t\t\tfor(var j =0; j < sortedbones.length; j++) {\n\n\t\t\t\tif(sortedbones[i].parent == sortedbones[j].name) {\n\n\t\t\t\t\tsortedbones[i].parent = j;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\n\t\tvar i, j, w, vidx, weight;\n\t\tvar v = new THREE.Vector3(), o, s;\n\n\t\t// move vertices to bind shape\n\t\tfor ( i = 0; i < geometry.vertices.length; i ++ ) {\n\t\t\t\t\tgeometry.vertices[i].applyMatrix4( skinController.skin.bindShapeMatrix );\n\t\t}\n\n\t\tvar skinIndices = [];\n\t\tvar skinWeights = [];\n\t\tvar weights = skinController.skin.weights;\n\n\t\t//hook up the skin weights\n\t\t// TODO -  this might be a good place to choose greatest 4 weights\n\t\tfor(var i =0; i < weights.length; i++) {\n\n\t\t\tvar indicies = new THREE.Vector4(weights[i][0]?weights[i][0].joint:0,weights[i][1]?weights[i][1].joint:0,weights[i][2]?weights[i][2].joint:0,weights[i][3]?weights[i][3].joint:0);\n\t\t\tvar weight = new THREE.Vector4(weights[i][0]?weights[i][0].weight:0,weights[i][1]?weights[i][1].weight:0,weights[i][2]?weights[i][2].weight:0,weights[i][3]?weights[i][3].weight:0);\n\n\t\t\tskinIndices.push(indicies);\n\t\t\tskinWeights.push(weight);\n\n\t\t}\n\n\t\tgeometry.skinIndices = skinIndices;\n\t\tgeometry.skinWeights = skinWeights;\n\t\tgeometry.bones = sortedbones;\n\t\t// process animation, or simply pose the rig if no animation\n\n\t\t//create an animation for the animated bones\n\t\t//NOTE: this has no effect when using morphtargets\n\t\tvar animationdata = {\"name\":animationBounds.ID,\"fps\":30,\"length\":animationBounds.frames/30,\"hierarchy\":[]};\n\n\t\tfor(var j =0; j < sortedbones.length; j++) {\n\n\t\t\tanimationdata.hierarchy.push({parent:sortedbones[j].parent, name:sortedbones[j].name, keys:[]});\n\n\t\t}\n\n\t\tconsole.log( 'ColladaLoader:', animationBounds.ID + ' has ' + sortedbones.length + ' bones.' );\n\n\n\n\t\tskinToBindPose(geometry,skeleton,skinController);\n\n\n\t\tfor ( frame = 0; frame < animationBounds.frames; frame ++ ) {\n\n\t\t\tvar bones = [];\n\t\t\tvar skinned = [];\n\t\t\t// process the frame and setup the rig with a fresh\n\t\t\t// transform, possibly from the bone's animation channel(s)\n\n\t\t\tsetupSkeleton( skeleton, bones, frame );\n\t\t\tsetupSkinningMatrices( bones, skinController.skin );\n\n\t\t\tfor(var i = 0; i < bones.length; i ++) {\n\n\t\t\t\tfor(var j = 0; j < animationdata.hierarchy.length; j ++) {\n\n\t\t\t\t\tif(animationdata.hierarchy[j].name == bones[i].sid) {\n\n\t\t\t\t\t\tvar key = {};\n\t\t\t\t\t\tkey.time = (frame/30);\n\t\t\t\t\t\tkey.matrix = bones[i].animatrix;\n\n\t\t\t\t\t\tif(frame == 0)\n\t\t\t\t\t\t\tbones[i].matrix = key.matrix;\n\n\t\t\t\t\t\tvar data = [new THREE.Vector3(),new THREE.Quaternion(),new THREE.Vector3()];\n\t\t\t\t\t\tkey.matrix.decompose(data[0],data[1],data[2]);\n\n\t\t\t\t\t\tkey.pos = [data[0].x,data[0].y,data[0].z];\n\n\t\t\t\t\t\tkey.scl = [data[2].x,data[2].y,data[2].z];\n\t\t\t\t\t\tkey.rot = data[1];\n\n\t\t\t\t\t\tanimationdata.hierarchy[j].keys.push(key);\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tgeometry.animation = animationdata;\n\n\t\t}\n\n\t};\n\n\tfunction createSceneGraph ( node, parent ) {\n\n\t\tvar obj = new THREE.Object3D();\n\t\tvar skinned = false;\n\t\tvar skinController;\n\t\tvar morphController;\n\t\tvar i, j;\n\n\t\t// FIXME: controllers\n\n\t\tfor ( i = 0; i < node.controllers.length; i ++ ) {\n\n\t\t\tvar controller = controllers[ node.controllers[ i ].url ];\n\n\t\t\tswitch ( controller.type ) {\n\n\t\t\t\tcase 'skin':\n\n\t\t\t\t\tif ( geometries[ controller.skin.source ] ) {\n\n\t\t\t\t\t\tvar inst_geom = new InstanceGeometry();\n\n\t\t\t\t\t\tinst_geom.url = controller.skin.source;\n\t\t\t\t\t\tinst_geom.instance_material = node.controllers[ i ].instance_material;\n\n\t\t\t\t\t\tnode.geometries.push( inst_geom );\n\t\t\t\t\t\tskinned = true;\n\t\t\t\t\t\tskinController = node.controllers[ i ];\n\n\t\t\t\t\t} else if ( controllers[ controller.skin.source ] ) {\n\n\t\t\t\t\t\t// urgh: controller can be chained\n\t\t\t\t\t\t// handle the most basic case...\n\n\t\t\t\t\t\tvar second = controllers[ controller.skin.source ];\n\t\t\t\t\t\tmorphController = second;\n\t\t\t\t\t//\tskinController = node.controllers[i];\n\n\t\t\t\t\t\tif ( second.morph && geometries[ second.morph.source ] ) {\n\n\t\t\t\t\t\t\tvar inst_geom = new InstanceGeometry();\n\n\t\t\t\t\t\t\tinst_geom.url = second.morph.source;\n\t\t\t\t\t\t\tinst_geom.instance_material = node.controllers[ i ].instance_material;\n\n\t\t\t\t\t\t\tnode.geometries.push( inst_geom );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'morph':\n\n\t\t\t\t\tif ( geometries[ controller.morph.source ] ) {\n\n\t\t\t\t\t\tvar inst_geom = new InstanceGeometry();\n\n\t\t\t\t\t\tinst_geom.url = controller.morph.source;\n\t\t\t\t\t\tinst_geom.instance_material = node.controllers[ i ].instance_material;\n\n\t\t\t\t\t\tnode.geometries.push( inst_geom );\n\t\t\t\t\t\tmorphController = node.controllers[ i ];\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconsole.log( 'ColladaLoader: Morph-controller partially supported.' );\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// geometries\n\n\t\tvar double_sided_materials = {};\n\n\t\tfor ( i = 0; i < node.geometries.length; i ++ ) {\n\n\t\t\tvar instance_geometry = node.geometries[i];\n\t\t\tvar instance_materials = instance_geometry.instance_material;\n\t\t\tvar geometry = geometries[ instance_geometry.url ];\n\t\t\tvar used_materials = {};\n\t\t\tvar used_materials_array = [];\n\t\t\tvar num_materials = 0;\n\t\t\tvar first_material;\n\n\t\t\tif ( geometry ) {\n\n\t\t\t\tif ( !geometry.mesh || !geometry.mesh.primitives )\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif ( obj.name.length == 0 ) {\n\n\t\t\t\t\tobj.name = geometry.id;\n\n\t\t\t\t}\n\n\t\t\t\t// collect used fx for this geometry-instance\n\n\t\t\t\tif ( instance_materials ) {\n\n\t\t\t\t\tfor ( j = 0; j < instance_materials.length; j ++ ) {\n\n\t\t\t\t\t\tvar instance_material = instance_materials[ j ];\n\t\t\t\t\t\tvar mat = materials[ instance_material.target ];\n\t\t\t\t\t\tvar effect_id = mat.instance_effect.url;\n\t\t\t\t\t\tvar shader = effects[ effect_id ].shader;\n\t\t\t\t\t\tvar material3js = shader.material;\n\n\t\t\t\t\t\tif ( geometry.doubleSided ) {\n\n\t\t\t\t\t\t\tif ( !( instance_material.symbol in double_sided_materials ) ) {\n\n\t\t\t\t\t\t\t\tvar _copied_material = material3js.clone();\n\t\t\t\t\t\t\t\t_copied_material.side = THREE.DoubleSide;\n\t\t\t\t\t\t\t\tdouble_sided_materials[ instance_material.symbol ] = _copied_material;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tmaterial3js = double_sided_materials[ instance_material.symbol ];\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmaterial3js.opacity = !material3js.opacity ? 1 : material3js.opacity;\n\t\t\t\t\t\tused_materials[ instance_material.symbol ] = num_materials;\n\t\t\t\t\t\tused_materials_array.push( material3js );\n\t\t\t\t\t\tfirst_material = material3js;\n\t\t\t\t\t\tfirst_material.name = mat.name == null || mat.name === '' ? mat.id : mat.name;\n\t\t\t\t\t\tnum_materials ++;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tvar mesh;\n\t\t\t\tvar material = first_material || new THREE.MeshLambertMaterial( { color: 0xdddddd, shading: THREE.FlatShading, side: geometry.doubleSided ? THREE.DoubleSide : THREE.FrontSide } );\n\t\t\t\tvar geom = geometry.mesh.geometry3js;\n\n\t\t\t\tif ( num_materials > 1 ) {\n\n\t\t\t\t\tmaterial = new THREE.MeshFaceMaterial( used_materials_array );\n\n\t\t\t\t\tfor ( j = 0; j < geom.faces.length; j ++ ) {\n\n\t\t\t\t\t\tvar face = geom.faces[ j ];\n\t\t\t\t\t\tface.materialIndex = used_materials[ face.daeMaterial ]\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( skinController !== undefined ) {\n\n\n\t\t\t\t\tapplySkin( geom, skinController );\n\n\t\t\t\t\tif(geom.morphTargets.length > 0) {\n\n\t\t\t\t\t\tmaterial.morphTargets = true;\n\t\t\t\t\t\tmaterial.skinning = false;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tmaterial.morphTargets = false;\n\t\t\t\t\t\tmaterial.skinning = true;\n\n\t\t\t\t\t}\n\n\n\t\t\t\t\tmesh = new THREE.SkinnedMesh( geom, material, false );\n\n\n\t\t\t\t\t//mesh.skeleton = skinController.skeleton;\n\t\t\t\t\t//mesh.skinController = controllers[ skinController.url ];\n\t\t\t\t\t//mesh.skinInstanceController = skinController;\n\t\t\t\t\tmesh.name = 'skin_' + skins.length;\n\n\n\n\t\t\t\t\t//mesh.animationHandle.setKey(0);\n\t\t\t\t\tskins.push( mesh );\n\n\t\t\t\t} else if ( morphController !== undefined ) {\n\n\t\t\t\t\tcreateMorph( geom, morphController );\n\n\t\t\t\t\tmaterial.morphTargets = true;\n\n\t\t\t\t\tmesh = new THREE.Mesh( geom, material );\n\t\t\t\t\tmesh.name = 'morph_' + morphs.length;\n\n\t\t\t\t\tmorphs.push( mesh );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tmesh = new THREE.Mesh( geom, material );\n\t\t\t\t\t// mesh.geom.name = geometry.id;\n\n\t\t\t\t}\n\n\t\t\t\t// N.B.: TP says this is not a great default behavior. It's a nice\n\t\t\t\t// optimization to flatten the hierarchy but this should be done\n\t\t\t\t// only if requested by the user via a flag. For now I undid it\n\t\t\t\t// and fixed the character animation example that uses it\n\t\t\t\t// node.geometries.length > 1 ? obj.add( mesh ) : obj = mesh;\n\t\t\t\tobj.add(mesh);\n\n\t\t\t}\n\n\t\t}\n\n\t\tfor ( i = 0; i < node.cameras.length; i ++ ) {\n\n\t\t\tvar instance_camera = node.cameras[i];\n\t\t\tvar cparams = cameras[instance_camera.url];\n\n\t\t\tvar cam = new THREE.PerspectiveCamera(cparams.yfov, parseFloat(cparams.aspect_ratio),\n\t\t\t\t\tparseFloat(cparams.znear), parseFloat(cparams.zfar));\n\n\t\t\tobj.add(cam);\n\t\t}\n\n\t\tfor ( i = 0; i < node.lights.length; i ++ ) {\n\n\t\t\tvar light = null;\n\t\t\tvar instance_light = node.lights[i];\n\t\t\tvar lparams = lights[instance_light.url];\n\n\t\t\tif ( lparams && lparams.technique ) {\n\n\t\t\t\tvar color = lparams.color.getHex();\n\t\t\t\tvar intensity = lparams.intensity;\n\t\t\t\tvar distance = lparams.distance;\n\t\t\t\tvar angle = lparams.falloff_angle;\n\t\t\t\tvar exponent; // Intentionally undefined, don't know what this is yet\n\n\t\t\t\tswitch ( lparams.technique ) {\n\n\t\t\t\t\tcase 'directional':\n\n\t\t\t\t\t\tlight = new THREE.DirectionalLight( color, intensity, distance );\n\t\t\t\t\t\tlight.position.set(0, 0, 1);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'point':\n\n\t\t\t\t\t\tlight = new THREE.PointLight( color, intensity, distance );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'spot':\n\n\t\t\t\t\t\tlight = new THREE.SpotLight( color, intensity, distance, angle, exponent );\n\t\t\t\t\t\tlight.position.set(0, 0, 1);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'ambient':\n\n\t\t\t\t\t\tlight = new THREE.AmbientLight( color );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (light) {\n\t\t\t\tobj.add(light);\n\t\t\t}\n\t\t}\n\n\t\tobj.name = node.name || node.id || \"\";\n\t\tobj.id = node.id || \"\";\n\t\tobj.layer = node.layer || \"\";\n\t\tobj.matrix = node.matrix;\n\t\tobj.matrix.decompose( obj.position, obj.quaternion, obj.scale );\n\n\t\tif ( options.centerGeometry && obj.geometry ) {\n\n\t\t\tvar delta = obj.geometry.center();\n\t\t\tdelta.multiply( obj.scale );\n\t\t\tdelta.applyQuaternion( obj.quaternion );\n\n\t\t\tobj.position.sub( delta );\n\n\t\t}\n\n\t\tfor ( i = 0; i < node.nodes.length; i ++ ) {\n\n\t\t\tobj.add( createSceneGraph( node.nodes[i], node ) );\n\n\t\t}\n\n\t\treturn obj;\n\n\t};\n\n\tfunction getJointId( skin, id ) {\n\n\t\tfor ( var i = 0; i < skin.joints.length; i ++ ) {\n\n\t\t\tif ( skin.joints[ i ] == id ) {\n\n\t\t\t\treturn i;\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tfunction getLibraryNode( id ) {\n\n        var nodes = COLLADA.querySelectorAll('library_nodes node');\n\n        for ( var i = 0; i < nodes.length; i++ ) {\n\n            var attObj = nodes[i].attributes.getNamedItem('id');\n            if ( attObj && attObj.value === id ) {\n                return nodes[i];\n        }\n        }\n\n        return undefined;\n\n\t};\n\n\tfunction getChannelsForNode (node ) {\n\n\t\tvar channels = [];\n\t\tvar startTime = 1000000;\n\t\tvar endTime = -1000000;\n\n\t\tfor ( var id in animations ) {\n\n\t\t\tvar animation = animations[id];\n\n\t\t\tfor ( var i = 0; i < animation.channel.length; i ++ ) {\n\n\t\t\t\tvar channel = animation.channel[i];\n\t\t\t\tvar sampler = animation.sampler[i];\n\t\t\t\tvar id = channel.target.split('/')[0];\n\n\t\t\t\tif ( id == node.id ) {\n\n\t\t\t\t\tsampler.create();\n\t\t\t\t\tchannel.sampler = sampler;\n\t\t\t\t\tstartTime = Math.min(startTime, sampler.startTime);\n\t\t\t\t\tendTime = Math.max(endTime, sampler.endTime);\n\t\t\t\t\tchannels.push(channel);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( channels.length ) {\n\n\t\t\tnode.startTime = startTime;\n\t\t\tnode.endTime = endTime;\n\n\t\t}\n\n\t\treturn channels;\n\n\t};\n\n\tfunction calcFrameDuration( node ) {\n\n\t\tvar minT = 10000000;\n\n\t\tfor ( var i = 0; i < node.channels.length; i ++ ) {\n\n\t\t\tvar sampler = node.channels[i].sampler;\n\n\t\t\tfor ( var j = 0; j < sampler.input.length - 1; j ++ ) {\n\n\t\t\t\tvar t0 = sampler.input[ j ];\n\t\t\t\tvar t1 = sampler.input[ j + 1 ];\n\t\t\t\tminT = Math.min( minT, t1 - t0 );\n\n\t\t\t}\n\t\t}\n\n\t\treturn minT;\n\n\t};\n\n\tfunction calcMatrixAt( node, t ) {\n\n\t\tvar animated = {};\n\n\t\tvar i, j;\n\n\t\tfor ( i = 0; i < node.channels.length; i ++ ) {\n\n\t\t\tvar channel = node.channels[ i ];\n\t\t\tanimated[ channel.sid ] = channel;\n\n\t\t}\n\n\t\tvar matrix = new THREE.Matrix4();\n\n\t\tfor ( i = 0; i < node.transforms.length; i ++ ) {\n\n\t\t\tvar transform = node.transforms[ i ];\n\t\t\tvar channel = animated[ transform.sid ];\n\n\t\t\tif ( channel !== undefined ) {\n\n\t\t\t\tvar sampler = channel.sampler;\n\t\t\t\tvar value;\n\n\t\t\t\tfor ( j = 0; j < sampler.input.length - 1; j ++ ) {\n\n\t\t\t\t\tif ( sampler.input[ j + 1 ] > t ) {\n\n\t\t\t\t\t\tvalue = sampler.output[ j ];\n\t\t\t\t\t\t//console.log(value.flatten)\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( value !== undefined ) {\n\n\t\t\t\t\tif ( value instanceof THREE.Matrix4 ) {\n\n\t\t\t\t\t\tmatrix.multiplyMatrices( matrix, value );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// FIXME: handle other types\n\n\t\t\t\t\t\tmatrix.multiplyMatrices( matrix, transform.matrix );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tmatrix.multiplyMatrices( matrix, transform.matrix );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tmatrix.multiplyMatrices( matrix, transform.matrix );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn matrix;\n\n\t};\n\n\tfunction bakeAnimations ( node ) {\n\n\t\tif ( node.channels && node.channels.length ) {\n\n\t\t\tvar keys = [],\n\t\t\t\tsids = [];\n\n\t\t\tfor ( var i = 0, il = node.channels.length; i < il; i++ ) {\n\n\t\t\t\tvar channel = node.channels[i],\n\t\t\t\t\tfullSid = channel.fullSid,\n\t\t\t\t\tsampler = channel.sampler,\n\t\t\t\t\tinput = sampler.input,\n\t\t\t\t\ttransform = node.getTransformBySid( channel.sid ),\n\t\t\t\t\tmember;\n\n\t\t\t\tif ( channel.arrIndices ) {\n\n\t\t\t\t\tmember = [];\n\n\t\t\t\t\tfor ( var j = 0, jl = channel.arrIndices.length; j < jl; j++ ) {\n\n\t\t\t\t\t\tmember[ j ] = getConvertedIndex( channel.arrIndices[ j ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tmember = getConvertedMember( channel.member );\n\n\t\t\t\t}\n\n\t\t\t\tif ( transform ) {\n\n\t\t\t\t\tif ( sids.indexOf( fullSid ) === -1 ) {\n\n\t\t\t\t\t\tsids.push( fullSid );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( var j = 0, jl = input.length; j < jl; j++ ) {\n\n\t\t\t\t\t\tvar time = input[j],\n\t\t\t\t\t\t\tdata = sampler.getData( transform.type, j, member ),\n\t\t\t\t\t\t\tkey = findKey( keys, time );\n\n\t\t\t\t\t\tif ( !key ) {\n\n\t\t\t\t\t\t\tkey = new Key( time );\n\t\t\t\t\t\t\tvar timeNdx = findTimeNdx( keys, time );\n\t\t\t\t\t\t\tkeys.splice( timeNdx == -1 ? keys.length : timeNdx, 0, key );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tkey.addTarget( fullSid, transform, member, data );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.log( 'Could not find transform \"' + channel.sid + '\" in node ' + node.id );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// post process\n\t\t\tfor ( var i = 0; i < sids.length; i++ ) {\n\n\t\t\t\tvar sid = sids[ i ];\n\n\t\t\t\tfor ( var j = 0; j < keys.length; j++ ) {\n\n\t\t\t\t\tvar key = keys[ j ];\n\n\t\t\t\t\tif ( !key.hasTarget( sid ) ) {\n\n\t\t\t\t\t\tinterpolateKeys( keys, key, j, sid );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tnode.keys = keys;\n\t\t\tnode.sids = sids;\n\n\t\t}\n\n\t};\n\n\tfunction findKey ( keys, time) {\n\n\t\tvar retVal = null;\n\n\t\tfor ( var i = 0, il = keys.length; i < il && retVal == null; i++ ) {\n\n\t\t\tvar key = keys[i];\n\n\t\t\tif ( key.time === time ) {\n\n\t\t\t\tretVal = key;\n\n\t\t\t} else if ( key.time > time ) {\n\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn retVal;\n\n\t};\n\n\tfunction findTimeNdx ( keys, time) {\n\n\t\tvar ndx = -1;\n\n\t\tfor ( var i = 0, il = keys.length; i < il && ndx == -1; i++ ) {\n\n\t\t\tvar key = keys[i];\n\n\t\t\tif ( key.time >= time ) {\n\n\t\t\t\tndx = i;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn ndx;\n\n\t};\n\n\tfunction interpolateKeys ( keys, key, ndx, fullSid ) {\n\n\t\tvar prevKey = getPrevKeyWith( keys, fullSid, ndx ? ndx-1 : 0 ),\n\t\t\tnextKey = getNextKeyWith( keys, fullSid, ndx+1 );\n\n\t\tif ( prevKey && nextKey ) {\n\n\t\t\tvar scale = (key.time - prevKey.time) / (nextKey.time - prevKey.time),\n\t\t\t\tprevTarget = prevKey.getTarget( fullSid ),\n\t\t\t\tnextData = nextKey.getTarget( fullSid ).data,\n\t\t\t\tprevData = prevTarget.data,\n\t\t\t\tdata;\n\n\t\t\tif ( prevTarget.type === 'matrix' ) {\n\n\t\t\t\tdata = prevData;\n\n\t\t\t} else if ( prevData.length ) {\n\n\t\t\t\tdata = [];\n\n\t\t\t\tfor ( var i = 0; i < prevData.length; ++i ) {\n\n\t\t\t\t\tdata[ i ] = prevData[ i ] + ( nextData[ i ] - prevData[ i ] ) * scale;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tdata = prevData + ( nextData - prevData ) * scale;\n\n\t\t\t}\n\n\t\t\tkey.addTarget( fullSid, prevTarget.transform, prevTarget.member, data );\n\n\t\t}\n\n\t};\n\n\t// Get next key with given sid\n\n\tfunction getNextKeyWith( keys, fullSid, ndx ) {\n\n\t\tfor ( ; ndx < keys.length; ndx++ ) {\n\n\t\t\tvar key = keys[ ndx ];\n\n\t\t\tif ( key.hasTarget( fullSid ) ) {\n\n\t\t\t\treturn key;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn null;\n\n\t};\n\n\t// Get previous key with given sid\n\n\tfunction getPrevKeyWith( keys, fullSid, ndx ) {\n\n\t\tndx = ndx >= 0 ? ndx : ndx + keys.length;\n\n\t\tfor ( ; ndx >= 0; ndx-- ) {\n\n\t\t\tvar key = keys[ ndx ];\n\n\t\t\tif ( key.hasTarget( fullSid ) ) {\n\n\t\t\t\treturn key;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn null;\n\n\t};\n\n\tfunction _Image() {\n\n\t\tthis.id = \"\";\n\t\tthis.init_from = \"\";\n\n\t};\n\n\t_Image.prototype.parse = function(element) {\n\n\t\tthis.id = element.getAttribute('id');\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\n\t\t\tif ( child.nodeName == 'init_from' ) {\n\n\t\t\t\tthis.init_from = child.textContent;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction Controller() {\n\n\t\tthis.id = \"\";\n\t\tthis.name = \"\";\n\t\tthis.type = \"\";\n\t\tthis.skin = null;\n\t\tthis.morph = null;\n\n\t};\n\n\tController.prototype.parse = function( element ) {\n\n\t\tthis.id = element.getAttribute('id');\n\t\tthis.name = element.getAttribute('name');\n\t\tthis.type = \"none\";\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'skin':\n\n\t\t\t\t\tthis.skin = (new Skin()).parse(child);\n\t\t\t\t\tthis.type = child.nodeName;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'morph':\n\n\t\t\t\t\tthis.morph = (new Morph()).parse(child);\n\t\t\t\t\tthis.type = child.nodeName;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction Morph() {\n\n\t\tthis.method = null;\n\t\tthis.source = null;\n\t\tthis.targets = null;\n\t\tthis.weights = null;\n\n\t};\n\n\tMorph.prototype.parse = function( element ) {\n\n\t\tvar sources = {};\n\t\tvar inputs = [];\n\t\tvar i;\n\n\t\tthis.method = element.getAttribute( 'method' );\n\t\tthis.source = element.getAttribute( 'source' ).replace( /^#/, '' );\n\n\t\tfor ( i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'source':\n\n\t\t\t\t\tvar source = ( new Source() ).parse( child );\n\t\t\t\t\tsources[ source.id ] = source;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'targets':\n\n\t\t\t\t\tinputs = this.parseInputs( child );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tconsole.log( child.nodeName );\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfor ( i = 0; i < inputs.length; i ++ ) {\n\n\t\t\tvar input = inputs[ i ];\n\t\t\tvar source = sources[ input.source ];\n\n\t\t\tswitch ( input.semantic ) {\n\n\t\t\t\tcase 'MORPH_TARGET':\n\n\t\t\t\t\tthis.targets = source.read();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'MORPH_WEIGHT':\n\n\t\t\t\t\tthis.weights = source.read();\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tMorph.prototype.parseInputs = function(element) {\n\n\t\tvar inputs = [];\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[i];\n\t\t\tif ( child.nodeType != 1) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'input':\n\n\t\t\t\t\tinputs.push( (new Input()).parse(child) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn inputs;\n\n\t};\n\n\tfunction Skin() {\n\n\t\tthis.source = \"\";\n\t\tthis.bindShapeMatrix = null;\n\t\tthis.invBindMatrices = [];\n\t\tthis.joints = [];\n\t\tthis.weights = [];\n\n\t};\n\n\tSkin.prototype.parse = function( element ) {\n\n\t\tvar sources = {};\n\t\tvar joints, weights;\n\n\t\tthis.source = element.getAttribute( 'source' ).replace( /^#/, '' );\n\t\tthis.invBindMatrices = [];\n\t\tthis.joints = [];\n\t\tthis.weights = [];\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[i];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'bind_shape_matrix':\n\n\t\t\t\t\tvar f = _floats(child.textContent);\n\t\t\t\t\tthis.bindShapeMatrix = getConvertedMat4( f );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'source':\n\n\t\t\t\t\tvar src = new Source().parse(child);\n\t\t\t\t\tsources[ src.id ] = src;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'joints':\n\n\t\t\t\t\tjoints = child;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'vertex_weights':\n\n\t\t\t\t\tweights = child;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tconsole.log( child.nodeName );\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\t\t}\n\n\t\tthis.parseJoints( joints, sources );\n\t\tthis.parseWeights( weights, sources );\n\n\t\treturn this;\n\n\t};\n\n\tSkin.prototype.parseJoints = function ( element, sources ) {\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'input':\n\n\t\t\t\t\tvar input = ( new Input() ).parse( child );\n\t\t\t\t\tvar source = sources[ input.source ];\n\n\t\t\t\t\tif ( input.semantic == 'JOINT' ) {\n\n\t\t\t\t\t\tthis.joints = source.read();\n\n\t\t\t\t\t} else if ( input.semantic == 'INV_BIND_MATRIX' ) {\n\n\t\t\t\t\t\tthis.invBindMatrices = source.read();\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tSkin.prototype.parseWeights = function ( element, sources ) {\n\n\t\tvar v, vcount, inputs = [];\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'input':\n\n\t\t\t\t\tinputs.push( ( new Input() ).parse( child ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'v':\n\n\t\t\t\t\tv = _ints( child.textContent );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'vcount':\n\n\t\t\t\t\tvcount = _ints( child.textContent );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tvar index = 0;\n\n\t\tfor ( var i = 0; i < vcount.length; i ++ ) {\n\n\t\t\tvar numBones = vcount[i];\n\t\t\tvar vertex_weights = [];\n\n\t\t\tfor ( var j = 0; j < numBones; j++ ) {\n\n\t\t\t\tvar influence = {};\n\n\t\t\t\tfor ( var k = 0; k < inputs.length; k ++ ) {\n\n\t\t\t\t\tvar input = inputs[ k ];\n\t\t\t\t\tvar value = v[ index + input.offset ];\n\n\t\t\t\t\tswitch ( input.semantic ) {\n\n\t\t\t\t\t\tcase 'JOINT':\n\n\t\t\t\t\t\t\tinfluence.joint = value;//this.joints[value];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'WEIGHT':\n\n\t\t\t\t\t\t\tinfluence.weight = sources[ input.source ].data[ value ];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tvertex_weights.push( influence );\n\t\t\t\tindex += inputs.length;\n\t\t\t}\n\n\t\t\tfor ( var j = 0; j < vertex_weights.length; j ++ ) {\n\n\t\t\t\tvertex_weights[ j ].index = i;\n\n\t\t\t}\n\n\t\t\tthis.weights.push( vertex_weights );\n\n\t\t}\n\n\t};\n\n\tfunction VisualScene () {\n\n\t\tthis.id = \"\";\n\t\tthis.name = \"\";\n\t\tthis.nodes = [];\n\t\tthis.scene = new THREE.Object3D();\n\n\t};\n\n\tVisualScene.prototype.getChildById = function( id, recursive ) {\n\n\t\tfor ( var i = 0; i < this.nodes.length; i ++ ) {\n\n\t\t\tvar node = this.nodes[ i ].getChildById( id, recursive );\n\n\t\t\tif ( node ) {\n\n\t\t\t\treturn node;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn null;\n\n\t};\n\n\tVisualScene.prototype.getChildBySid = function( sid, recursive ) {\n\n\t\tfor ( var i = 0; i < this.nodes.length; i ++ ) {\n\n\t\t\tvar node = this.nodes[ i ].getChildBySid( sid, recursive );\n\n\t\t\tif ( node ) {\n\n\t\t\t\treturn node;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn null;\n\n\t};\n\n\tVisualScene.prototype.parse = function( element ) {\n\n\t\tthis.id = element.getAttribute( 'id' );\n\t\tthis.name = element.getAttribute( 'name' );\n\t\tthis.nodes = [];\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'node':\n\n\t\t\t\t\tthis.nodes.push( ( new Node() ).parse( child ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction Node() {\n\n\t\tthis.id = \"\";\n\t\tthis.name = \"\";\n\t\tthis.sid = \"\";\n\t\tthis.nodes = [];\n\t\tthis.controllers = [];\n\t\tthis.transforms = [];\n\t\tthis.geometries = [];\n\t\tthis.channels = [];\n\t\tthis.matrix = new THREE.Matrix4();\n\n\t};\n\n\tNode.prototype.getChannelForTransform = function( transformSid ) {\n\n\t\tfor ( var i = 0; i < this.channels.length; i ++ ) {\n\n\t\t\tvar channel = this.channels[i];\n\t\t\tvar parts = channel.target.split('/');\n\t\t\tvar id = parts.shift();\n\t\t\tvar sid = parts.shift();\n\t\t\tvar dotSyntax = (sid.indexOf(\".\") >= 0);\n\t\t\tvar arrSyntax = (sid.indexOf(\"(\") >= 0);\n\t\t\tvar arrIndices;\n\t\t\tvar member;\n\n\t\t\tif ( dotSyntax ) {\n\n\t\t\t\tparts = sid.split(\".\");\n\t\t\t\tsid = parts.shift();\n\t\t\t\tmember = parts.shift();\n\n\t\t\t} else if ( arrSyntax ) {\n\n\t\t\t\tarrIndices = sid.split(\"(\");\n\t\t\t\tsid = arrIndices.shift();\n\n\t\t\t\tfor ( var j = 0; j < arrIndices.length; j ++ ) {\n\n\t\t\t\t\tarrIndices[ j ] = parseInt( arrIndices[ j ].replace( /\\)/, '' ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( sid == transformSid ) {\n\n\t\t\t\tchannel.info = { sid: sid, dotSyntax: dotSyntax, arrSyntax: arrSyntax, arrIndices: arrIndices };\n\t\t\t\treturn channel;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn null;\n\n\t};\n\n\tNode.prototype.getChildById = function ( id, recursive ) {\n\n\t\tif ( this.id == id ) {\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tif ( recursive ) {\n\n\t\t\tfor ( var i = 0; i < this.nodes.length; i ++ ) {\n\n\t\t\t\tvar n = this.nodes[ i ].getChildById( id, recursive );\n\n\t\t\t\tif ( n ) {\n\n\t\t\t\t\treturn n;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn null;\n\n\t};\n\n\tNode.prototype.getChildBySid = function ( sid, recursive ) {\n\n\t\tif ( this.sid == sid ) {\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tif ( recursive ) {\n\n\t\t\tfor ( var i = 0; i < this.nodes.length; i ++ ) {\n\n\t\t\t\tvar n = this.nodes[ i ].getChildBySid( sid, recursive );\n\n\t\t\t\tif ( n ) {\n\n\t\t\t\t\treturn n;\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\n\t};\n\n\tNode.prototype.getTransformBySid = function ( sid ) {\n\n\t\tfor ( var i = 0; i < this.transforms.length; i ++ ) {\n\n\t\t\tif ( this.transforms[ i ].sid == sid ) return this.transforms[ i ];\n\n\t\t}\n\n\t\treturn null;\n\n\t};\n\n\tNode.prototype.parse = function( element ) {\n\n\t\tvar url;\n\n\t\tthis.id = element.getAttribute('id');\n\t\tthis.sid = element.getAttribute('sid');\n\t\tthis.name = element.getAttribute('name');\n\t\tthis.type = element.getAttribute('type');\n\t\tthis.layer = element.getAttribute('layer');\n\n\t\tthis.type = this.type == 'JOINT' ? this.type : 'NODE';\n\n\t\tthis.nodes = [];\n\t\tthis.transforms = [];\n\t\tthis.geometries = [];\n\t\tthis.cameras = [];\n\t\tthis.lights = [];\n\t\tthis.controllers = [];\n\t\tthis.matrix = new THREE.Matrix4();\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'node':\n\n\t\t\t\t\tthis.nodes.push( ( new Node() ).parse( child ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'instance_camera':\n\n\t\t\t\t\tthis.cameras.push( ( new InstanceCamera() ).parse( child ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'instance_controller':\n\n\t\t\t\t\tthis.controllers.push( ( new InstanceController() ).parse( child ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'instance_geometry':\n\n\t\t\t\t\tthis.geometries.push( ( new InstanceGeometry() ).parse( child ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'instance_light':\n\n\t\t\t\t\tthis.lights.push( ( new InstanceLight() ).parse( child ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'instance_node':\n\n\t\t\t\t\turl = child.getAttribute( 'url' ).replace( /^#/, '' );\n\t\t\t\t\tvar iNode = getLibraryNode( url );\n\n\t\t\t\t\tif ( iNode ) {\n\n\t\t\t\t\t\tthis.nodes.push( ( new Node() ).parse( iNode )) ;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'rotate':\n\t\t\t\tcase 'translate':\n\t\t\t\tcase 'scale':\n\t\t\t\tcase 'matrix':\n\t\t\t\tcase 'lookat':\n\t\t\t\tcase 'skew':\n\n\t\t\t\t\tthis.transforms.push( ( new Transform() ).parse( child ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'extra':\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tconsole.log( child.nodeName );\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.channels = getChannelsForNode( this );\n\t\tbakeAnimations( this );\n\n\t\tthis.updateMatrix();\n\n\t\treturn this;\n\n\t};\n\n\tNode.prototype.updateMatrix = function () {\n\n\t\tthis.matrix.identity();\n\n\t\tfor ( var i = 0; i < this.transforms.length; i ++ ) {\n\n\t\t\tthis.transforms[ i ].apply( this.matrix );\n\n\t\t}\n\n\t};\n\n\tfunction Transform () {\n\n\t\tthis.sid = \"\";\n\t\tthis.type = \"\";\n\t\tthis.data = [];\n\t\tthis.obj = null;\n\n\t};\n\n\tTransform.prototype.parse = function ( element ) {\n\n\t\tthis.sid = element.getAttribute( 'sid' );\n\t\tthis.type = element.nodeName;\n\t\tthis.data = _floats( element.textContent );\n\t\tthis.convert();\n\n\t\treturn this;\n\n\t};\n\n\tTransform.prototype.convert = function () {\n\n\t\tswitch ( this.type ) {\n\n\t\t\tcase 'matrix':\n\n\t\t\t\tthis.obj = getConvertedMat4( this.data );\n\t\t\t\tbreak;\n\n\t\t\tcase 'rotate':\n\n\t\t\t\tthis.angle = THREE.Math.degToRad( this.data[3] );\n\n\t\t\tcase 'translate':\n\n\t\t\t\tfixCoords( this.data, -1 );\n\t\t\t\tthis.obj = new THREE.Vector3( this.data[ 0 ], this.data[ 1 ], this.data[ 2 ] );\n\t\t\t\tbreak;\n\n\t\t\tcase 'scale':\n\n\t\t\t\tfixCoords( this.data, 1 );\n\t\t\t\tthis.obj = new THREE.Vector3( this.data[ 0 ], this.data[ 1 ], this.data[ 2 ] );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.log( 'Can not convert Transform of type ' + this.type );\n\t\t\t\tbreak;\n\n\t\t}\n\n\t};\n\n\tTransform.prototype.apply = function () {\n\n\t\tvar m1 = new THREE.Matrix4();\n\n\t\treturn function ( matrix ) {\n\n\t\t\tswitch ( this.type ) {\n\n\t\t\t\tcase 'matrix':\n\n\t\t\t\t\tmatrix.multiply( this.obj );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'translate':\n\n\t\t\t\t\tmatrix.multiply( m1.makeTranslation( this.obj.x, this.obj.y, this.obj.z ) );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'rotate':\n\n\t\t\t\t\tmatrix.multiply( m1.makeRotationAxis( this.obj, this.angle ) );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'scale':\n\n\t\t\t\t\tmatrix.scale( this.obj );\n\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t};\n\n\t}();\n\n\tTransform.prototype.update = function ( data, member ) {\n\n\t\tvar members = [ 'X', 'Y', 'Z', 'ANGLE' ];\n\n\t\tswitch ( this.type ) {\n\n\t\t\tcase 'matrix':\n\n\t\t\t\tif ( ! member ) {\n\n\t\t\t\t\tthis.obj.copy( data );\n\n\t\t\t\t} else if ( member.length === 1 ) {\n\n\t\t\t\t\tswitch ( member[ 0 ] ) {\n\n\t\t\t\t\t\tcase 0:\n\n\t\t\t\t\t\t\tthis.obj.n11 = data[ 0 ];\n\t\t\t\t\t\t\tthis.obj.n21 = data[ 1 ];\n\t\t\t\t\t\t\tthis.obj.n31 = data[ 2 ];\n\t\t\t\t\t\t\tthis.obj.n41 = data[ 3 ];\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 1:\n\n\t\t\t\t\t\t\tthis.obj.n12 = data[ 0 ];\n\t\t\t\t\t\t\tthis.obj.n22 = data[ 1 ];\n\t\t\t\t\t\t\tthis.obj.n32 = data[ 2 ];\n\t\t\t\t\t\t\tthis.obj.n42 = data[ 3 ];\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 2:\n\n\t\t\t\t\t\t\tthis.obj.n13 = data[ 0 ];\n\t\t\t\t\t\t\tthis.obj.n23 = data[ 1 ];\n\t\t\t\t\t\t\tthis.obj.n33 = data[ 2 ];\n\t\t\t\t\t\t\tthis.obj.n43 = data[ 3 ];\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 3:\n\n\t\t\t\t\t\t\tthis.obj.n14 = data[ 0 ];\n\t\t\t\t\t\t\tthis.obj.n24 = data[ 1 ];\n\t\t\t\t\t\t\tthis.obj.n34 = data[ 2 ];\n\t\t\t\t\t\t\tthis.obj.n44 = data[ 3 ];\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( member.length === 2 ) {\n\n\t\t\t\t\tvar propName = 'n' + ( member[ 0 ] + 1 ) + ( member[ 1 ] + 1 );\n\t\t\t\t\tthis.obj[ propName ] = data;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.log('Incorrect addressing of matrix in transform.');\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'translate':\n\t\t\tcase 'scale':\n\n\t\t\t\tif ( Object.prototype.toString.call( member ) === '[object Array]' ) {\n\n\t\t\t\t\tmember = members[ member[ 0 ] ];\n\n\t\t\t\t}\n\n\t\t\t\tswitch ( member ) {\n\n\t\t\t\t\tcase 'X':\n\n\t\t\t\t\t\tthis.obj.x = data;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Y':\n\n\t\t\t\t\t\tthis.obj.y = data;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Z':\n\n\t\t\t\t\t\tthis.obj.z = data;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\tthis.obj.x = data[ 0 ];\n\t\t\t\t\t\tthis.obj.y = data[ 1 ];\n\t\t\t\t\t\tthis.obj.z = data[ 2 ];\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'rotate':\n\n\t\t\t\tif ( Object.prototype.toString.call( member ) === '[object Array]' ) {\n\n\t\t\t\t\tmember = members[ member[ 0 ] ];\n\n\t\t\t\t}\n\n\t\t\t\tswitch ( member ) {\n\n\t\t\t\t\tcase 'X':\n\n\t\t\t\t\t\tthis.obj.x = data;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Y':\n\n\t\t\t\t\t\tthis.obj.y = data;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Z':\n\n\t\t\t\t\t\tthis.obj.z = data;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'ANGLE':\n\n\t\t\t\t\t\tthis.angle = THREE.Math.degToRad( data );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\tthis.obj.x = data[ 0 ];\n\t\t\t\t\t\tthis.obj.y = data[ 1 ];\n\t\t\t\t\t\tthis.obj.z = data[ 2 ];\n\t\t\t\t\t\tthis.angle = THREE.Math.degToRad( data[ 3 ] );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t}\n\n\t};\n\n\tfunction InstanceController() {\n\n\t\tthis.url = \"\";\n\t\tthis.skeleton = [];\n\t\tthis.instance_material = [];\n\n\t};\n\n\tInstanceController.prototype.parse = function ( element ) {\n\n\t\tthis.url = element.getAttribute('url').replace(/^#/, '');\n\t\tthis.skeleton = [];\n\t\tthis.instance_material = [];\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType !== 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'skeleton':\n\n\t\t\t\t\tthis.skeleton.push( child.textContent.replace(/^#/, '') );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'bind_material':\n\n\t\t\t\t\tvar instances = child.querySelectorAll('instance_material');\n\n\t\t\t\t\tfor ( var j = 0; j < instances.length; j ++ ){\n\n\t\t\t\t\t\tvar instance = instances[j];\n\t\t\t\t\t\tthis.instance_material.push( (new InstanceMaterial()).parse(instance) );\n\n\t\t\t\t\t}\n\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'extra':\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction InstanceMaterial () {\n\n\t\tthis.symbol = \"\";\n\t\tthis.target = \"\";\n\n\t};\n\n\tInstanceMaterial.prototype.parse = function ( element ) {\n\n\t\tthis.symbol = element.getAttribute('symbol');\n\t\tthis.target = element.getAttribute('target').replace(/^#/, '');\n\t\treturn this;\n\n\t};\n\n\tfunction InstanceGeometry() {\n\n\t\tthis.url = \"\";\n\t\tthis.instance_material = [];\n\n\t};\n\n\tInstanceGeometry.prototype.parse = function ( element ) {\n\n\t\tthis.url = element.getAttribute('url').replace(/^#/, '');\n\t\tthis.instance_material = [];\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[i];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tif ( child.nodeName == 'bind_material' ) {\n\n\t\t\t\tvar instances = child.querySelectorAll('instance_material');\n\n\t\t\t\tfor ( var j = 0; j < instances.length; j ++ ) {\n\n\t\t\t\t\tvar instance = instances[j];\n\t\t\t\t\tthis.instance_material.push( (new InstanceMaterial()).parse(instance) );\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction Geometry() {\n\n\t\tthis.id = \"\";\n\t\tthis.mesh = null;\n\n\t};\n\n\tGeometry.prototype.parse = function ( element ) {\n\n\t\tthis.id = element.getAttribute('id');\n\n\t\textractDoubleSided( this, element );\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[i];\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'mesh':\n\n\t\t\t\t\tthis.mesh = (new Mesh(this)).parse(child);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'extra':\n\n\t\t\t\t\t// console.log( child );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction Mesh( geometry ) {\n\n\t\tthis.geometry = geometry.id;\n\t\tthis.primitives = [];\n\t\tthis.vertices = null;\n\t\tthis.geometry3js = null;\n\n\t};\n\n\tMesh.prototype.parse = function( element ) {\n\n\t\tthis.primitives = [];\n\n\t\tvar i, j;\n\n\t\tfor ( i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'source':\n\n\t\t\t\t\t_source( child );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'vertices':\n\n\t\t\t\t\tthis.vertices = ( new Vertices() ).parse( child );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'triangles':\n\n\t\t\t\t\tthis.primitives.push( ( new Triangles().parse( child ) ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'polygons':\n\n\t\t\t\t\tthis.primitives.push( ( new Polygons().parse( child ) ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'polylist':\n\n\t\t\t\t\tthis.primitives.push( ( new Polylist().parse( child ) ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.geometry3js = new THREE.Geometry();\n\n\t\tvar vertexData = sources[ this.vertices.input['POSITION'].source ].data;\n\n\t\tfor ( i = 0; i < vertexData.length; i += 3 ) {\n\n\t\t\tthis.geometry3js.vertices.push( getConvertedVec3( vertexData, i ).clone() );\n\n\t\t}\n\n\t\tfor ( i = 0; i < this.primitives.length; i ++ ) {\n\n\t\t\tvar primitive = this.primitives[ i ];\n\t\t\tprimitive.setVertices( this.vertices );\n\t\t\tthis.handlePrimitive( primitive, this.geometry3js );\n\n\t\t}\n\n\t\tthis.geometry3js.computeFaceNormals();\n\n\t\tif ( this.geometry3js.calcNormals ) {\n\n\t\t\tthis.geometry3js.computeVertexNormals();\n\t\t\tdelete this.geometry3js.calcNormals;\n\n\t\t}\n\n\t\t// this.geometry3js.computeBoundingBox();\n\n\t\treturn this;\n\n\t};\n\n\tMesh.prototype.handlePrimitive = function( primitive, geom ) {\n\n\t\tvar j, k, pList = primitive.p, inputs = primitive.inputs;\n\t\tvar input, index, idx32;\n\t\tvar source, numParams;\n\t\tvar vcIndex = 0, vcount = 3, maxOffset = 0;\n\t\tvar texture_sets = [];\n\n\t\tfor ( j = 0; j < inputs.length; j ++ ) {\n\n\t\t\tinput = inputs[ j ];\n\n\t\t\tvar offset = input.offset + 1;\n\t\t\tmaxOffset = (maxOffset < offset)? offset : maxOffset;\n\n\t\t\tswitch ( input.semantic ) {\n\n\t\t\t\tcase 'TEXCOORD':\n\t\t\t\t\ttexture_sets.push( input.set );\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfor ( var pCount = 0; pCount < pList.length; ++pCount ) {\n\n\t\t\tvar p = pList[ pCount ], i = 0;\n\n\t\t\twhile ( i < p.length ) {\n\n\t\t\t\tvar vs = [];\n\t\t\t\tvar ns = [];\n\t\t\t\tvar ts = null;\n\t\t\t\tvar cs = [];\n\n\t\t\t\tif ( primitive.vcount ) {\n\n\t\t\t\t\tvcount = primitive.vcount.length ? primitive.vcount[ vcIndex ++ ] : primitive.vcount;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tvcount = p.length / maxOffset;\n\n\t\t\t\t}\n\n\n\t\t\t\tfor ( j = 0; j < vcount; j ++ ) {\n\n\t\t\t\t\tfor ( k = 0; k < inputs.length; k ++ ) {\n\n\t\t\t\t\t\tinput = inputs[ k ];\n\t\t\t\t\t\tsource = sources[ input.source ];\n\n\t\t\t\t\t\tindex = p[ i + ( j * maxOffset ) + input.offset ];\n\t\t\t\t\t\tnumParams = source.accessor.params.length;\n\t\t\t\t\t\tidx32 = index * numParams;\n\n\t\t\t\t\t\tswitch ( input.semantic ) {\n\n\t\t\t\t\t\t\tcase 'VERTEX':\n\n\t\t\t\t\t\t\t\tvs.push( index );\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'NORMAL':\n\n\t\t\t\t\t\t\t\tns.push( getConvertedVec3( source.data, idx32 ) );\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'TEXCOORD':\n\n\t\t\t\t\t\t\t\tts = ts || { };\n\t\t\t\t\t\t\t\tif ( ts[ input.set ] === undefined ) ts[ input.set ] = [];\n\t\t\t\t\t\t\t\t// invert the V\n\t\t\t\t\t\t\t\tts[ input.set ].push( new THREE.Vector2( source.data[ idx32 ], source.data[ idx32 + 1 ] ) );\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'COLOR':\n\n\t\t\t\t\t\t\t\tcs.push( new THREE.Color().setRGB( source.data[ idx32 ], source.data[ idx32 + 1 ], source.data[ idx32 + 2 ] ) );\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( ns.length == 0 ) {\n\n\t\t\t\t\t// check the vertices inputs\n\t\t\t\t\tinput = this.vertices.input.NORMAL;\n\n\t\t\t\t\tif ( input ) {\n\n\t\t\t\t\t\tsource = sources[ input.source ];\n\t\t\t\t\t\tnumParams = source.accessor.params.length;\n\n\t\t\t\t\t\tfor ( var ndx = 0, len = vs.length; ndx < len; ndx++ ) {\n\n\t\t\t\t\t\t\tns.push( getConvertedVec3( source.data, vs[ ndx ] * numParams ) );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tgeom.calcNormals = true;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( !ts ) {\n\n\t\t\t\t\tts = { };\n\t\t\t\t\t// check the vertices inputs\n\t\t\t\t\tinput = this.vertices.input.TEXCOORD;\n\n\t\t\t\t\tif ( input ) {\n\n\t\t\t\t\t\ttexture_sets.push( input.set );\n\t\t\t\t\t\tsource = sources[ input.source ];\n\t\t\t\t\t\tnumParams = source.accessor.params.length;\n\n\t\t\t\t\t\tfor ( var ndx = 0, len = vs.length; ndx < len; ndx++ ) {\n\n\t\t\t\t\t\t\tidx32 = vs[ ndx ] * numParams;\n\t\t\t\t\t\t\tif ( ts[ input.set ] === undefined ) ts[ input.set ] = [ ];\n\t\t\t\t\t\t\t// invert the V\n\t\t\t\t\t\t\tts[ input.set ].push( new THREE.Vector2( source.data[ idx32 ], 1.0 - source.data[ idx32 + 1 ] ) );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( cs.length == 0 ) {\n\n\t\t\t\t\t// check the vertices inputs\n\t\t\t\t\tinput = this.vertices.input.COLOR;\n\n\t\t\t\t\tif ( input ) {\n\n\t\t\t\t\t\tsource = sources[ input.source ];\n\t\t\t\t\t\tnumParams = source.accessor.params.length;\n\n\t\t\t\t\t\tfor ( var ndx = 0, len = vs.length; ndx < len; ndx++ ) {\n\n\t\t\t\t\t\t\tidx32 = vs[ ndx ] * numParams;\n\t\t\t\t\t\t\tcs.push( new THREE.Color().setRGB( source.data[ idx32 ], source.data[ idx32 + 1 ], source.data[ idx32 + 2 ] ) );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tvar face = null, faces = [], uv, uvArr;\n\n\t\t\t\tif ( vcount === 3 ) {\n\n\t\t\t\t\tfaces.push( new THREE.Face3( vs[0], vs[1], vs[2], ns, cs.length ? cs : new THREE.Color() ) );\n\n\t\t\t\t} else if ( vcount === 4 ) {\n\n\t\t\t\t\tfaces.push( new THREE.Face3( vs[0], vs[1], vs[3], [ns[0], ns[1], ns[3]], cs.length ? [cs[0], cs[1], cs[3]] : new THREE.Color() ) );\n\n\t\t\t\t\tfaces.push( new THREE.Face3( vs[1], vs[2], vs[3], [ns[1], ns[2], ns[3]], cs.length ? [cs[1], cs[2], cs[3]] : new THREE.Color() ) );\n\n\t\t\t\t} else if ( vcount > 4 && options.subdivideFaces ) {\n\n\t\t\t\t\tvar clr = cs.length ? cs : new THREE.Color(),\n\t\t\t\t\t\tvec1, vec2, vec3, v1, v2, norm;\n\n\t\t\t\t\t// subdivide into multiple Face3s\n\n\t\t\t\t\tfor ( k = 1; k < vcount - 1; ) {\n\n\t\t\t\t\t\t// FIXME: normals don't seem to be quite right\n\n\t\t\t\t\t\tfaces.push( new THREE.Face3( vs[0], vs[k], vs[k+1], [ ns[0], ns[k++], ns[k] ],  clr ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( faces.length ) {\n\n\t\t\t\t\tfor ( var ndx = 0, len = faces.length; ndx < len; ndx ++ ) {\n\n\t\t\t\t\t\tface = faces[ndx];\n\t\t\t\t\t\tface.daeMaterial = primitive.material;\n\t\t\t\t\t\tgeom.faces.push( face );\n\n\t\t\t\t\t\tfor ( k = 0; k < texture_sets.length; k++ ) {\n\n\t\t\t\t\t\t\tuv = ts[ texture_sets[k] ];\n\n\t\t\t\t\t\t\tif ( vcount > 4 ) {\n\n\t\t\t\t\t\t\t\t// Grab the right UVs for the vertices in this face\n\t\t\t\t\t\t\t\tuvArr = [ uv[0], uv[ndx+1], uv[ndx+2] ];\n\n\t\t\t\t\t\t\t} else if ( vcount === 4 ) {\n\n\t\t\t\t\t\t\t\tif ( ndx === 0 ) {\n\n\t\t\t\t\t\t\t\t\tuvArr = [ uv[0], uv[1], uv[3] ];\n\n\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\tuvArr = [ uv[1].clone(), uv[2], uv[3].clone() ];\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tuvArr = [ uv[0], uv[1], uv[2] ];\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( geom.faceVertexUvs[k] === undefined ) {\n\n\t\t\t\t\t\t\t\tgeom.faceVertexUvs[k] = [];\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tgeom.faceVertexUvs[k].push( uvArr );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.log( 'dropped face with vcount ' + vcount + ' for geometry with id: ' + geom.id );\n\n\t\t\t\t}\n\n\t\t\t\ti += maxOffset * vcount;\n\n\t\t\t}\n\t\t}\n\n\t};\n\n\tfunction Polygons () {\n\n\t\tthis.material = \"\";\n\t\tthis.count = 0;\n\t\tthis.inputs = [];\n\t\tthis.vcount = null;\n\t\tthis.p = [];\n\t\tthis.geometry = new THREE.Geometry();\n\n\t};\n\n\tPolygons.prototype.setVertices = function ( vertices ) {\n\n\t\tfor ( var i = 0; i < this.inputs.length; i ++ ) {\n\n\t\t\tif ( this.inputs[ i ].source == vertices.id ) {\n\n\t\t\t\tthis.inputs[ i ].source = vertices.input[ 'POSITION' ].source;\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tPolygons.prototype.parse = function ( element ) {\n\n\t\tthis.material = element.getAttribute( 'material' );\n\t\tthis.count = _attr_as_int( element, 'count', 0 );\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'input':\n\n\t\t\t\t\tthis.inputs.push( ( new Input() ).parse( element.childNodes[ i ] ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'vcount':\n\n\t\t\t\t\tthis.vcount = _ints( child.textContent );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'p':\n\n\t\t\t\t\tthis.p.push( _ints( child.textContent ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ph':\n\n\t\t\t\t\tconsole.warn( 'polygon holes not yet supported!' );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction Polylist () {\n\n\t\tPolygons.call( this );\n\n\t\tthis.vcount = [];\n\n\t};\n\n\tPolylist.prototype = Object.create( Polygons.prototype );\n\n\tfunction Triangles () {\n\n\t\tPolygons.call( this );\n\n\t\tthis.vcount = 3;\n\n\t};\n\n\tTriangles.prototype = Object.create( Polygons.prototype );\n\n\tfunction Accessor() {\n\n\t\tthis.source = \"\";\n\t\tthis.count = 0;\n\t\tthis.stride = 0;\n\t\tthis.params = [];\n\n\t};\n\n\tAccessor.prototype.parse = function ( element ) {\n\n\t\tthis.params = [];\n\t\tthis.source = element.getAttribute( 'source' );\n\t\tthis.count = _attr_as_int( element, 'count', 0 );\n\t\tthis.stride = _attr_as_int( element, 'stride', 0 );\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\n\t\t\tif ( child.nodeName == 'param' ) {\n\n\t\t\t\tvar param = {};\n\t\t\t\tparam[ 'name' ] = child.getAttribute( 'name' );\n\t\t\t\tparam[ 'type' ] = child.getAttribute( 'type' );\n\t\t\t\tthis.params.push( param );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction Vertices() {\n\n\t\tthis.input = {};\n\n\t};\n\n\tVertices.prototype.parse = function ( element ) {\n\n\t\tthis.id = element.getAttribute('id');\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tif ( element.childNodes[i].nodeName == 'input' ) {\n\n\t\t\t\tvar input = ( new Input() ).parse( element.childNodes[ i ] );\n\t\t\t\tthis.input[ input.semantic ] = input;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction Input () {\n\n\t\tthis.semantic = \"\";\n\t\tthis.offset = 0;\n\t\tthis.source = \"\";\n\t\tthis.set = 0;\n\n\t};\n\n\tInput.prototype.parse = function ( element ) {\n\n\t\tthis.semantic = element.getAttribute('semantic');\n\t\tthis.source = element.getAttribute('source').replace(/^#/, '');\n\t\tthis.set = _attr_as_int(element, 'set', -1);\n\t\tthis.offset = _attr_as_int(element, 'offset', 0);\n\n\t\tif ( this.semantic == 'TEXCOORD' && this.set < 0 ) {\n\n\t\t\tthis.set = 0;\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction Source ( id ) {\n\n\t\tthis.id = id;\n\t\tthis.type = null;\n\n\t};\n\n\tSource.prototype.parse = function ( element ) {\n\n\t\tthis.id = element.getAttribute( 'id' );\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[i];\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'bool_array':\n\n\t\t\t\t\tthis.data = _bools( child.textContent );\n\t\t\t\t\tthis.type = child.nodeName;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'float_array':\n\n\t\t\t\t\tthis.data = _floats( child.textContent );\n\t\t\t\t\tthis.type = child.nodeName;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'int_array':\n\n\t\t\t\t\tthis.data = _ints( child.textContent );\n\t\t\t\t\tthis.type = child.nodeName;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'IDREF_array':\n\t\t\t\tcase 'Name_array':\n\n\t\t\t\t\tthis.data = _strings( child.textContent );\n\t\t\t\t\tthis.type = child.nodeName;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'technique_common':\n\n\t\t\t\t\tfor ( var j = 0; j < child.childNodes.length; j ++ ) {\n\n\t\t\t\t\t\tif ( child.childNodes[ j ].nodeName == 'accessor' ) {\n\n\t\t\t\t\t\t\tthis.accessor = ( new Accessor() ).parse( child.childNodes[ j ] );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t// console.log(child.nodeName);\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tSource.prototype.read = function () {\n\n\t\tvar result = [];\n\n\t\t//for (var i = 0; i < this.accessor.params.length; i++) {\n\n\t\t\tvar param = this.accessor.params[ 0 ];\n\n\t\t\t//console.log(param.name + \" \" + param.type);\n\n\t\t\tswitch ( param.type ) {\n\n\t\t\t\tcase 'IDREF':\n\t\t\t\tcase 'Name': case 'name':\n\t\t\t\tcase 'float':\n\n\t\t\t\t\treturn this.data;\n\n\t\t\t\tcase 'float4x4':\n\n\t\t\t\t\tfor ( var j = 0; j < this.data.length; j += 16 ) {\n\n\t\t\t\t\t\tvar s = this.data.slice( j, j + 16 );\n\t\t\t\t\t\tvar m = getConvertedMat4( s );\n\t\t\t\t\t\tresult.push( m );\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tconsole.log( 'ColladaLoader: Source: Read dont know how to read ' + param.type + '.' );\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t//}\n\n\t\treturn result;\n\n\t};\n\n\tfunction Material () {\n\n\t\tthis.id = \"\";\n\t\tthis.name = \"\";\n\t\tthis.instance_effect = null;\n\n\t};\n\n\tMaterial.prototype.parse = function ( element ) {\n\n\t\tthis.id = element.getAttribute( 'id' );\n\t\tthis.name = element.getAttribute( 'name' );\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tif ( element.childNodes[ i ].nodeName == 'instance_effect' ) {\n\n\t\t\t\tthis.instance_effect = ( new InstanceEffect() ).parse( element.childNodes[ i ] );\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction ColorOrTexture () {\n\n\t\tthis.color = new THREE.Color();\n\t\tthis.color.setRGB( Math.random(), Math.random(), Math.random() );\n\t\tthis.color.a = 1.0;\n\n\t\tthis.texture = null;\n\t\tthis.texcoord = null;\n\t\tthis.texOpts = null;\n\n\t};\n\n\tColorOrTexture.prototype.isColor = function () {\n\n\t\treturn ( this.texture == null );\n\n\t};\n\n\tColorOrTexture.prototype.isTexture = function () {\n\n\t\treturn ( this.texture != null );\n\n\t};\n\n\tColorOrTexture.prototype.parse = function ( element ) {\n\n\t\tif (element.nodeName == 'transparent') {\n\n\t\t\tthis.opaque = element.getAttribute('opaque');\n\n\t\t}\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'color':\n\n\t\t\t\t\tvar rgba = _floats( child.textContent );\n\t\t\t\t\tthis.color = new THREE.Color();\n\t\t\t\t\tthis.color.setRGB( rgba[0], rgba[1], rgba[2] );\n\t\t\t\t\tthis.color.a = rgba[3];\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'texture':\n\n\t\t\t\t\tthis.texture = child.getAttribute('texture');\n\t\t\t\t\tthis.texcoord = child.getAttribute('texcoord');\n\t\t\t\t\t// Defaults from:\n\t\t\t\t\t// https://collada.org/mediawiki/index.php/Maya_texture_placement_MAYA_extension\n\t\t\t\t\tthis.texOpts = {\n\t\t\t\t\t\toffsetU: 0,\n\t\t\t\t\t\toffsetV: 0,\n\t\t\t\t\t\trepeatU: 1,\n\t\t\t\t\t\trepeatV: 1,\n\t\t\t\t\t\twrapU: 1,\n\t\t\t\t\t\twrapV: 1\n\t\t\t\t\t};\n\t\t\t\t\tthis.parseTexture( child );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tColorOrTexture.prototype.parseTexture = function ( element ) {\n\n\t\tif ( ! element.childNodes ) return this;\n\n\t\t// This should be supported by Maya, 3dsMax, and MotionBuilder\n\n\t\tif ( element.childNodes[1] && element.childNodes[1].nodeName === 'extra' ) {\n\n\t\t\telement = element.childNodes[1];\n\n\t\t\tif ( element.childNodes[1] && element.childNodes[1].nodeName === 'technique' ) {\n\n\t\t\t\telement = element.childNodes[1];\n\n\t\t\t}\n\n\t\t}\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'offsetU':\n\t\t\t\tcase 'offsetV':\n\t\t\t\tcase 'repeatU':\n\t\t\t\tcase 'repeatV':\n\n\t\t\t\t\tthis.texOpts[ child.nodeName ] = parseFloat( child.textContent );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'wrapU':\n\t\t\t\tcase 'wrapV':\n\n\t\t\t\t\t// some dae have a value of true which becomes NaN via parseInt\n\n\t\t\t\t\tif ( child.textContent.toUpperCase() === 'TRUE' ) {\n\n\t\t\t\t\t\tthis.texOpts[ child.nodeName ] = 1;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tthis.texOpts[ child.nodeName ] = parseInt( child.textContent );\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tthis.texOpts[ child.nodeName ] = child.textContent;\n\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction Shader ( type, effect ) {\n\n\t\tthis.type = type;\n\t\tthis.effect = effect;\n\t\tthis.material = null;\n\n\t};\n\n\tShader.prototype.parse = function ( element ) {\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'ambient':\n\t\t\t\tcase 'emission':\n\t\t\t\tcase 'diffuse':\n\t\t\t\tcase 'specular':\n\t\t\t\tcase 'transparent':\n\n\t\t\t\t\tthis[ child.nodeName ] = ( new ColorOrTexture() ).parse( child );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'bump':\n\n\t\t\t\t\t// If 'bumptype' is 'heightfield', create a 'bump' property\n\t\t\t\t\t// Else if 'bumptype' is 'normalmap', create a 'normal' property\n\t\t\t\t\t// (Default to 'bump')\n\t\t\t\t\tvar bumpType = child.getAttribute( 'bumptype' );\n\t\t\t\t\tif ( bumpType ) {\n\t\t\t\t\t\tif ( bumpType.toLowerCase() === \"heightfield\" ) {\n\t\t\t\t\t\t\tthis[ 'bump' ] = ( new ColorOrTexture() ).parse( child );\n\t\t\t\t\t\t} else if ( bumpType.toLowerCase() === \"normalmap\" ) {\n\t\t\t\t\t\t\tthis[ 'normal' ] = ( new ColorOrTexture() ).parse( child );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.error( \"Shader.prototype.parse: Invalid value for attribute 'bumptype' (\" + bumpType +\n\t\t\t\t\t\t\t\t           \") - valid bumptypes are 'HEIGHTFIELD' and 'NORMALMAP' - defaulting to 'HEIGHTFIELD'\" );\n\t\t\t\t\t\t\tthis[ 'bump' ] = ( new ColorOrTexture() ).parse( child );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.warn( \"Shader.prototype.parse: Attribute 'bumptype' missing from bump node - defaulting to 'HEIGHTFIELD'\" );\n\t\t\t\t\t\tthis[ 'bump' ] = ( new ColorOrTexture() ).parse( child );\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'shininess':\n\t\t\t\tcase 'reflectivity':\n\t\t\t\tcase 'index_of_refraction':\n\t\t\t\tcase 'transparency':\n\n\t\t\t\t\tvar f = child.querySelectorAll('float');\n\n\t\t\t\t\tif ( f.length > 0 )\n\t\t\t\t\t\tthis[ child.nodeName ] = parseFloat( f[ 0 ].textContent );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.create();\n\t\treturn this;\n\n\t};\n\n\tShader.prototype.create = function() {\n\n\t\tvar props = {};\n\n\t\tvar transparent = false;\n\n\t\tif (this['transparency'] !== undefined && this['transparent'] !== undefined) {\n\t\t\t// convert transparent color RBG to average value\n\t\t\tvar transparentColor = this['transparent'];\n\t\t\tvar transparencyLevel = (this.transparent.color.r + this.transparent.color.g + this.transparent.color.b) / 3 * this.transparency;\n\n\t\t\tif (transparencyLevel > 0) {\n\t\t\t\ttransparent = true;\n\t\t\t\tprops[ 'transparent' ] = true;\n\t\t\t\tprops[ 'opacity' ] = 1 - transparencyLevel;\n\n\t\t\t}\n\n\t\t}\n\n\t\tvar keys = {\n\t\t\t'diffuse':'map',\n\t\t\t'ambient':'lightMap' ,\n\t\t\t'specular':'specularMap',\n\t\t\t'emission':'emissionMap',\n\t\t\t'bump':'bumpMap',\n\t\t\t'normal':'normalMap'\n\t\t\t};\n\n\t\tfor ( var prop in this ) {\n\n\t\t\tswitch ( prop ) {\n\n\t\t\t\tcase 'ambient':\n\t\t\t\tcase 'emission':\n\t\t\t\tcase 'diffuse':\n\t\t\t\tcase 'specular':\n\t\t\t\tcase 'bump':\n\t\t\t\tcase 'normal':\n\n\t\t\t\t\tvar cot = this[ prop ];\n\n\t\t\t\t\tif ( cot instanceof ColorOrTexture ) {\n\n\t\t\t\t\t\tif ( cot.isTexture() ) {\n\n\t\t\t\t\t\t\tvar samplerId = cot.texture;\n\t\t\t\t\t\t\tvar surfaceId = this.effect.sampler[samplerId];\n\n\t\t\t\t\t\t\tif ( surfaceId !== undefined && surfaceId.source !== undefined ) {\n\n\t\t\t\t\t\t\t\tvar surface = this.effect.surface[surfaceId.source];\n\t\t\t\t\t\t\t\tvar image = images[surface.init_from];\n\n\t\t\t\t\t\t\t\tif (image) {\n\n\t\t\t\t\t\t\t\t\tvar url = baseUrl + image.init_from;\n\n\t\t\t\t\t\t\t\t\tvar texture;\n\t\t\t\t\t\t\t\t\tvar loader = THREE.Loader.Handlers.get( url );\n\n\t\t\t\t\t\t\t\t\tif ( loader !== null ) {\n\n\t\t\t\t\t\t\t\t\t\ttexture = loader.load( url );\n\n\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\ttexture = new THREE.Texture();\n\t\t\t\t\t\t\t\t\t\tloader = new THREE.ImageLoader();\n\t\t\t\t\t\t\t\t\t\tloader.load( url, function ( image ) {\n\n\t\t\t\t\t\t\t\t\t\t\ttexture.image = image;\n\t\t\t\t\t\t\t\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\ttexture.wrapS = cot.texOpts.wrapU ? THREE.RepeatWrapping : THREE.ClampToEdgeWrapping;\n\t\t\t\t\t\t\t\t\ttexture.wrapT = cot.texOpts.wrapV ? THREE.RepeatWrapping : THREE.ClampToEdgeWrapping;\n\t\t\t\t\t\t\t\t\ttexture.offset.x = cot.texOpts.offsetU;\n\t\t\t\t\t\t\t\t\ttexture.offset.y = cot.texOpts.offsetV;\n\t\t\t\t\t\t\t\t\ttexture.repeat.x = cot.texOpts.repeatU;\n\t\t\t\t\t\t\t\t\ttexture.repeat.y = cot.texOpts.repeatV;\n\t\t\t\t\t\t\t\t\tprops[keys[prop]] = texture;\n\n\t\t\t\t\t\t\t\t\t// Texture with baked lighting?\n\t\t\t\t\t\t\t\t\tif (prop === 'emission') props['emissive'] = 0xffffff;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else if ( prop === 'diffuse' || !transparent ) {\n\n\t\t\t\t\t\t\tif ( prop === 'emission' ) {\n\n\t\t\t\t\t\t\t\tprops[ 'emissive' ] = cot.color.getHex();\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tprops[ prop ] = cot.color.getHex();\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'shininess':\n\n\t\t\t\t\tprops[ prop ] = this[ prop ];\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'reflectivity':\n\n\t\t\t\t\tprops[ prop ] = this[ prop ];\n\t\t\t\t\tif( props[ prop ] > 0.0 ) props['envMap'] = options.defaultEnvMap;\n\t\t\t\t\tprops['combine'] = THREE.MixOperation;\t//mix regular shading with reflective component\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'index_of_refraction':\n\n\t\t\t\t\tprops[ 'refractionRatio' ] = this[ prop ]; //TODO: \"index_of_refraction\" becomes \"refractionRatio\" in shader, but I'm not sure if the two are actually comparable\n\t\t\t\t\tif ( this[ prop ] !== 1.0 ) props['envMap'] = options.defaultEnvMap;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'transparency':\n\t\t\t\t\t// gets figured out up top\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tprops[ 'shading' ] = preferredShading;\n\t\tprops[ 'side' ] = this.effect.doubleSided ? THREE.DoubleSide : THREE.FrontSide;\n\n\t\tswitch ( this.type ) {\n\n\t\t\tcase 'constant':\n\n\t\t\t\tif (props.emissive != undefined) props.color = props.emissive;\n\t\t\t\tthis.material = new THREE.MeshBasicMaterial( props );\n\t\t\t\tbreak;\n\n\t\t\tcase 'phong':\n\t\t\tcase 'blinn':\n\n\t\t\t\tif (props.diffuse != undefined) props.color = props.diffuse;\n\t\t\t\tthis.material = new THREE.MeshPhongMaterial( props );\n\t\t\t\tbreak;\n\n\t\t\tcase 'lambert':\n\t\t\tdefault:\n\n\t\t\t\tif (props.diffuse != undefined) props.color = props.diffuse;\n\t\t\t\tthis.material = new THREE.MeshLambertMaterial( props );\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\treturn this.material;\n\n\t};\n\n\tfunction Surface ( effect ) {\n\n\t\tthis.effect = effect;\n\t\tthis.init_from = null;\n\t\tthis.format = null;\n\n\t};\n\n\tSurface.prototype.parse = function ( element ) {\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'init_from':\n\n\t\t\t\t\tthis.init_from = child.textContent;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'format':\n\n\t\t\t\t\tthis.format = child.textContent;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tconsole.log( \"unhandled Surface prop: \" + child.nodeName );\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction Sampler2D ( effect ) {\n\n\t\tthis.effect = effect;\n\t\tthis.source = null;\n\t\tthis.wrap_s = null;\n\t\tthis.wrap_t = null;\n\t\tthis.minfilter = null;\n\t\tthis.magfilter = null;\n\t\tthis.mipfilter = null;\n\n\t};\n\n\tSampler2D.prototype.parse = function ( element ) {\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'source':\n\n\t\t\t\t\tthis.source = child.textContent;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'minfilter':\n\n\t\t\t\t\tthis.minfilter = child.textContent;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'magfilter':\n\n\t\t\t\t\tthis.magfilter = child.textContent;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'mipfilter':\n\n\t\t\t\t\tthis.mipfilter = child.textContent;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'wrap_s':\n\n\t\t\t\t\tthis.wrap_s = child.textContent;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'wrap_t':\n\n\t\t\t\t\tthis.wrap_t = child.textContent;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tconsole.log( \"unhandled Sampler2D prop: \" + child.nodeName );\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction Effect () {\n\n\t\tthis.id = \"\";\n\t\tthis.name = \"\";\n\t\tthis.shader = null;\n\t\tthis.surface = {};\n\t\tthis.sampler = {};\n\n\t};\n\n\tEffect.prototype.create = function () {\n\n\t\tif ( this.shader == null ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t};\n\n\tEffect.prototype.parse = function ( element ) {\n\n\t\tthis.id = element.getAttribute( 'id' );\n\t\tthis.name = element.getAttribute( 'name' );\n\n\t\textractDoubleSided( this, element );\n\n\t\tthis.shader = null;\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'profile_COMMON':\n\n\t\t\t\t\tthis.parseTechnique( this.parseProfileCOMMON( child ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tEffect.prototype.parseNewparam = function ( element ) {\n\n\t\tvar sid = element.getAttribute( 'sid' );\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'surface':\n\n\t\t\t\t\tthis.surface[sid] = ( new Surface( this ) ).parse( child );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'sampler2D':\n\n\t\t\t\t\tthis.sampler[sid] = ( new Sampler2D( this ) ).parse( child );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'extra':\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tconsole.log( child.nodeName );\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tEffect.prototype.parseProfileCOMMON = function ( element ) {\n\n\t\tvar technique;\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'profile_COMMON':\n\n\t\t\t\t\tthis.parseProfileCOMMON( child );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'technique':\n\n\t\t\t\t\ttechnique = child;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'newparam':\n\n\t\t\t\t\tthis.parseNewparam( child );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'image':\n\n\t\t\t\t\tvar _image = ( new _Image() ).parse( child );\n\t\t\t\t\timages[ _image.id ] = _image;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'extra':\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tconsole.log( child.nodeName );\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn technique;\n\n\t};\n\n\tEffect.prototype.parseTechnique= function ( element ) {\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[i];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'constant':\n\t\t\t\tcase 'lambert':\n\t\t\t\tcase 'blinn':\n\t\t\t\tcase 'phong':\n\n\t\t\t\t\tthis.shader = ( new Shader( child.nodeName, this ) ).parse( child );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'extra':\n\t\t\t\t\tthis.parseExtra(child);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tEffect.prototype.parseExtra = function ( element ) {\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[i];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'technique':\n\t\t\t\t\tthis.parseExtraTechnique( child );\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tEffect.prototype.parseExtraTechnique= function ( element ) {\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[i];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'bump':\n\t\t\t\t\tthis.shader.parse( element );\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tfunction InstanceEffect () {\n\n\t\tthis.url = \"\";\n\n\t};\n\n\tInstanceEffect.prototype.parse = function ( element ) {\n\n\t\tthis.url = element.getAttribute( 'url' ).replace( /^#/, '' );\n\t\treturn this;\n\n\t};\n\n\tfunction Animation() {\n\n\t\tthis.id = \"\";\n\t\tthis.name = \"\";\n\t\tthis.source = {};\n\t\tthis.sampler = [];\n\t\tthis.channel = [];\n\n\t};\n\n\tAnimation.prototype.parse = function ( element ) {\n\n\t\tthis.id = element.getAttribute( 'id' );\n\t\tthis.name = element.getAttribute( 'name' );\n\t\tthis.source = {};\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'animation':\n\n\t\t\t\t\tvar anim = ( new Animation() ).parse( child );\n\n\t\t\t\t\tfor ( var src in anim.source ) {\n\n\t\t\t\t\t\tthis.source[ src ] = anim.source[ src ];\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( var j = 0; j < anim.channel.length; j ++ ) {\n\n\t\t\t\t\t\tthis.channel.push( anim.channel[ j ] );\n\t\t\t\t\t\tthis.sampler.push( anim.sampler[ j ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'source':\n\n\t\t\t\t\tvar src = ( new Source() ).parse( child );\n\t\t\t\t\tthis.source[ src.id ] = src;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'sampler':\n\n\t\t\t\t\tthis.sampler.push( ( new Sampler( this ) ).parse( child ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'channel':\n\n\t\t\t\t\tthis.channel.push( ( new Channel( this ) ).parse( child ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction Channel( animation ) {\n\n\t\tthis.animation = animation;\n\t\tthis.source = \"\";\n\t\tthis.target = \"\";\n\t\tthis.fullSid = null;\n\t\tthis.sid = null;\n\t\tthis.dotSyntax = null;\n\t\tthis.arrSyntax = null;\n\t\tthis.arrIndices = null;\n\t\tthis.member = null;\n\n\t};\n\n\tChannel.prototype.parse = function ( element ) {\n\n\t\tthis.source = element.getAttribute( 'source' ).replace( /^#/, '' );\n\t\tthis.target = element.getAttribute( 'target' );\n\n\t\tvar parts = this.target.split( '/' );\n\n\t\tvar id = parts.shift();\n\t\tvar sid = parts.shift();\n\n\t\tvar dotSyntax = ( sid.indexOf(\".\") >= 0 );\n\t\tvar arrSyntax = ( sid.indexOf(\"(\") >= 0 );\n\n\t\tif ( dotSyntax ) {\n\n\t\t\tparts = sid.split(\".\");\n\t\t\tthis.sid = parts.shift();\n\t\t\tthis.member = parts.shift();\n\n\t\t} else if ( arrSyntax ) {\n\n\t\t\tvar arrIndices = sid.split(\"(\");\n\t\t\tthis.sid = arrIndices.shift();\n\n\t\t\tfor (var j = 0; j < arrIndices.length; j ++ ) {\n\n\t\t\t\tarrIndices[j] = parseInt( arrIndices[j].replace(/\\)/, '') );\n\n\t\t\t}\n\n\t\t\tthis.arrIndices = arrIndices;\n\n\t\t} else {\n\n\t\t\tthis.sid = sid;\n\n\t\t}\n\n\t\tthis.fullSid = sid;\n\t\tthis.dotSyntax = dotSyntax;\n\t\tthis.arrSyntax = arrSyntax;\n\n\t\treturn this;\n\n\t};\n\n\tfunction Sampler ( animation ) {\n\n\t\tthis.id = \"\";\n\t\tthis.animation = animation;\n\t\tthis.inputs = [];\n\t\tthis.input = null;\n\t\tthis.output = null;\n\t\tthis.strideOut = null;\n\t\tthis.interpolation = null;\n\t\tthis.startTime = null;\n\t\tthis.endTime = null;\n\t\tthis.duration = 0;\n\n\t};\n\n\tSampler.prototype.parse = function ( element ) {\n\n\t\tthis.id = element.getAttribute( 'id' );\n\t\tthis.inputs = [];\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'input':\n\n\t\t\t\t\tthis.inputs.push( (new Input()).parse( child ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tSampler.prototype.create = function () {\n\n\t\tfor ( var i = 0; i < this.inputs.length; i ++ ) {\n\n\t\t\tvar input = this.inputs[ i ];\n\t\t\tvar source = this.animation.source[ input.source ];\n\n\t\t\tswitch ( input.semantic ) {\n\n\t\t\t\tcase 'INPUT':\n\n\t\t\t\t\tthis.input = source.read();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'OUTPUT':\n\n\t\t\t\t\tthis.output = source.read();\n\t\t\t\t\tthis.strideOut = source.accessor.stride;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'INTERPOLATION':\n\n\t\t\t\t\tthis.interpolation = source.read();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'IN_TANGENT':\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'OUT_TANGENT':\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tconsole.log(input.semantic);\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.startTime = 0;\n\t\tthis.endTime = 0;\n\t\tthis.duration = 0;\n\n\t\tif ( this.input.length ) {\n\n\t\t\tthis.startTime = 100000000;\n\t\t\tthis.endTime = -100000000;\n\n\t\t\tfor ( var i = 0; i < this.input.length; i ++ ) {\n\n\t\t\t\tthis.startTime = Math.min( this.startTime, this.input[ i ] );\n\t\t\t\tthis.endTime = Math.max( this.endTime, this.input[ i ] );\n\n\t\t\t}\n\n\t\t\tthis.duration = this.endTime - this.startTime;\n\n\t\t}\n\n\t};\n\n\tSampler.prototype.getData = function ( type, ndx, member ) {\n\n\t\tvar data;\n\n\t\tif ( type === 'matrix' && this.strideOut === 16 ) {\n\n\t\t\tdata = this.output[ ndx ];\n\n\t\t} else if ( this.strideOut > 1 ) {\n\n\t\t\tdata = [];\n\t\t\tndx *= this.strideOut;\n\n\t\t\tfor ( var i = 0; i < this.strideOut; ++i ) {\n\n\t\t\t\tdata[ i ] = this.output[ ndx + i ];\n\n\t\t\t}\n\n\t\t\tif ( this.strideOut === 3 ) {\n\n\t\t\t\tswitch ( type ) {\n\n\t\t\t\t\tcase 'rotate':\n\t\t\t\t\tcase 'translate':\n\n\t\t\t\t\t\tfixCoords( data, -1 );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'scale':\n\n\t\t\t\t\t\tfixCoords( data, 1 );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t} else if ( this.strideOut === 4 && type === 'matrix' ) {\n\n\t\t\t\tfixCoords( data, -1 );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tdata = this.output[ ndx ];\n\n\t\t\tif ( member && type == 'translate' ) {\n\t\t\t\tdata = getConvertedTranslation( member, data );\n\t\t\t}\n\n\t\t}\n\n\t\treturn data;\n\n\t};\n\n\tfunction Key ( time ) {\n\n\t\tthis.targets = [];\n\t\tthis.time = time;\n\n\t};\n\n\tKey.prototype.addTarget = function ( fullSid, transform, member, data ) {\n\n\t\tthis.targets.push( {\n\t\t\tsid: fullSid,\n\t\t\tmember: member,\n\t\t\ttransform: transform,\n\t\t\tdata: data\n\t\t} );\n\n\t};\n\n\tKey.prototype.apply = function ( opt_sid ) {\n\n\t\tfor ( var i = 0; i < this.targets.length; ++i ) {\n\n\t\t\tvar target = this.targets[ i ];\n\n\t\t\tif ( !opt_sid || target.sid === opt_sid ) {\n\n\t\t\t\ttarget.transform.update( target.data, target.member );\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tKey.prototype.getTarget = function ( fullSid ) {\n\n\t\tfor ( var i = 0; i < this.targets.length; ++i ) {\n\n\t\t\tif ( this.targets[ i ].sid === fullSid ) {\n\n\t\t\t\treturn this.targets[ i ];\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn null;\n\n\t};\n\n\tKey.prototype.hasTarget = function ( fullSid ) {\n\n\t\tfor ( var i = 0; i < this.targets.length; ++i ) {\n\n\t\t\tif ( this.targets[ i ].sid === fullSid ) {\n\n\t\t\t\treturn true;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false;\n\n\t};\n\n\t// TODO: Currently only doing linear interpolation. Should support full COLLADA spec.\n\tKey.prototype.interpolate = function ( nextKey, time ) {\n\n\t\tfor ( var i = 0, l = this.targets.length; i < l; i ++ ) {\n\n\t\t\tvar target = this.targets[ i ],\n\t\t\t\tnextTarget = nextKey.getTarget( target.sid ),\n\t\t\t\tdata;\n\n\t\t\tif ( target.transform.type !== 'matrix' && nextTarget ) {\n\n\t\t\t\tvar scale = ( time - this.time ) / ( nextKey.time - this.time ),\n\t\t\t\t\tnextData = nextTarget.data,\n\t\t\t\t\tprevData = target.data;\n\n\t\t\t\tif ( scale < 0 ) scale = 0;\n\t\t\t\tif ( scale > 1 ) scale = 1;\n\n\t\t\t\tif ( prevData.length ) {\n\n\t\t\t\t\tdata = [];\n\n\t\t\t\t\tfor ( var j = 0; j < prevData.length; ++j ) {\n\n\t\t\t\t\t\tdata[ j ] = prevData[ j ] + ( nextData[ j ] - prevData[ j ] ) * scale;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tdata = prevData + ( nextData - prevData ) * scale;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tdata = target.data;\n\n\t\t\t}\n\n\t\t\ttarget.transform.update( data, target.member );\n\n\t\t}\n\n\t};\n\n\t// Camera\n\tfunction Camera() {\n\n\t\tthis.id = \"\";\n\t\tthis.name = \"\";\n\t\tthis.technique = \"\";\n\n\t};\n\n\tCamera.prototype.parse = function ( element ) {\n\n\t\tthis.id = element.getAttribute( 'id' );\n\t\tthis.name = element.getAttribute( 'name' );\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'optics':\n\n\t\t\t\t\tthis.parseOptics( child );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tCamera.prototype.parseOptics = function ( element ) {\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tif ( element.childNodes[ i ].nodeName == 'technique_common' ) {\n\n\t\t\t\tvar technique = element.childNodes[ i ];\n\n\t\t\t\tfor ( var j = 0; j < technique.childNodes.length; j ++ ) {\n\n\t\t\t\t\tthis.technique = technique.childNodes[ j ].nodeName;\n\n\t\t\t\t\tif ( this.technique == 'perspective' ) {\n\n\t\t\t\t\t\tvar perspective = technique.childNodes[ j ];\n\n\t\t\t\t\t\tfor ( var k = 0; k < perspective.childNodes.length; k ++ ) {\n\n\t\t\t\t\t\t\tvar param = perspective.childNodes[ k ];\n\n\t\t\t\t\t\t\tswitch ( param.nodeName ) {\n\n\t\t\t\t\t\t\t\tcase 'yfov':\n\t\t\t\t\t\t\t\t\tthis.yfov = param.textContent;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'xfov':\n\t\t\t\t\t\t\t\t\tthis.xfov = param.textContent;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'znear':\n\t\t\t\t\t\t\t\t\tthis.znear = param.textContent;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'zfar':\n\t\t\t\t\t\t\t\t\tthis.zfar = param.textContent;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'aspect_ratio':\n\t\t\t\t\t\t\t\t\tthis.aspect_ratio = param.textContent;\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else if ( this.technique == 'orthographic' ) {\n\n\t\t\t\t\t\tvar orthographic = technique.childNodes[ j ];\n\n\t\t\t\t\t\tfor ( var k = 0; k < orthographic.childNodes.length; k ++ ) {\n\n\t\t\t\t\t\t\tvar param = orthographic.childNodes[ k ];\n\n\t\t\t\t\t\t\tswitch ( param.nodeName ) {\n\n\t\t\t\t\t\t\t\tcase 'xmag':\n\t\t\t\t\t\t\t\t\tthis.xmag = param.textContent;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'ymag':\n\t\t\t\t\t\t\t\t\tthis.ymag = param.textContent;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'znear':\n\t\t\t\t\t\t\t\t\tthis.znear = param.textContent;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'zfar':\n\t\t\t\t\t\t\t\t\tthis.zfar = param.textContent;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'aspect_ratio':\n\t\t\t\t\t\t\t\t\tthis.aspect_ratio = param.textContent;\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction InstanceCamera() {\n\n\t\tthis.url = \"\";\n\n\t};\n\n\tInstanceCamera.prototype.parse = function ( element ) {\n\n\t\tthis.url = element.getAttribute('url').replace(/^#/, '');\n\n\t\treturn this;\n\n\t};\n\n\t// Light\n\n\tfunction Light() {\n\n\t\tthis.id = \"\";\n\t\tthis.name = \"\";\n\t\tthis.technique = \"\";\n\n\t};\n\n\tLight.prototype.parse = function ( element ) {\n\n\t\tthis.id = element.getAttribute( 'id' );\n\t\tthis.name = element.getAttribute( 'name' );\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'technique_common':\n\n\t\t\t\t\tthis.parseCommon( child );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'technique':\n\n\t\t\t\t\tthis.parseTechnique( child );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tLight.prototype.parseCommon = function ( element ) {\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tswitch ( element.childNodes[ i ].nodeName ) {\n\n\t\t\t\tcase 'directional':\n\t\t\t\tcase 'point':\n\t\t\t\tcase 'spot':\n\t\t\t\tcase 'ambient':\n\n\t\t\t\t\tthis.technique = element.childNodes[ i ].nodeName;\n\n\t\t\t\t\tvar light = element.childNodes[ i ];\n\n\t\t\t\t\tfor ( var j = 0; j < light.childNodes.length; j ++ ) {\n\n\t\t\t\t\t\tvar child = light.childNodes[j];\n\n\t\t\t\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\t\t\t\tcase 'color':\n\n\t\t\t\t\t\t\t\tvar rgba = _floats( child.textContent );\n\t\t\t\t\t\t\t\tthis.color = new THREE.Color(0);\n\t\t\t\t\t\t\t\tthis.color.setRGB( rgba[0], rgba[1], rgba[2] );\n\t\t\t\t\t\t\t\tthis.color.a = rgba[3];\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'falloff_angle':\n\n\t\t\t\t\t\t\t\tthis.falloff_angle = parseFloat( child.textContent );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'quadratic_attenuation':\n\t\t\t\t\t\t\t\tvar f = parseFloat( child.textContent );\n\t\t\t\t\t\t\t\tthis.distance = f ? Math.sqrt( 1/f ) : 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tLight.prototype.parseTechnique = function ( element ) {\n\n\t\tthis.profile = element.getAttribute( 'profile' );\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'intensity':\n\n\t\t\t\t\tthis.intensity = parseFloat(child.textContent);\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction InstanceLight() {\n\n\t\tthis.url = \"\";\n\n\t};\n\n\tInstanceLight.prototype.parse = function ( element ) {\n\n\t\tthis.url = element.getAttribute('url').replace(/^#/, '');\n\n\t\treturn this;\n\n\t};\n\n\tfunction _source( element ) {\n\n\t\tvar id = element.getAttribute( 'id' );\n\n\t\tif ( sources[ id ] != undefined ) {\n\n\t\t\treturn sources[ id ];\n\n\t\t}\n\n\t\tsources[ id ] = ( new Source(id )).parse( element );\n\t\treturn sources[ id ];\n\n\t};\n\n\tfunction _nsResolver( nsPrefix ) {\n\n\t\tif ( nsPrefix == \"dae\" ) {\n\n\t\t\treturn \"http://www.collada.org/2005/11/COLLADASchema\";\n\n\t\t}\n\n\t\treturn null;\n\n\t};\n\n\tfunction _bools( str ) {\n\n\t\tvar raw = _strings( str );\n\t\tvar data = [];\n\n\t\tfor ( var i = 0, l = raw.length; i < l; i ++ ) {\n\n\t\t\tdata.push( (raw[i] == 'true' || raw[i] == '1') ? true : false );\n\n\t\t}\n\n\t\treturn data;\n\n\t};\n\n\tfunction _floats( str ) {\n\n\t\tvar raw = _strings(str);\n\t\tvar data = [];\n\n\t\tfor ( var i = 0, l = raw.length; i < l; i ++ ) {\n\n\t\t\tdata.push( parseFloat( raw[ i ] ) );\n\n\t\t}\n\n\t\treturn data;\n\n\t};\n\n\tfunction _ints( str ) {\n\n\t\tvar raw = _strings( str );\n\t\tvar data = [];\n\n\t\tfor ( var i = 0, l = raw.length; i < l; i ++ ) {\n\n\t\t\tdata.push( parseInt( raw[ i ], 10 ) );\n\n\t\t}\n\n\t\treturn data;\n\n\t};\n\n\tfunction _strings( str ) {\n\n\t\treturn ( str.length > 0 ) ? _trimString( str ).split( /\\s+/ ) : [];\n\n\t};\n\n\tfunction _trimString( str ) {\n\n\t\treturn str.replace( /^\\s+/, \"\" ).replace( /\\s+$/, \"\" );\n\n\t};\n\n\tfunction _attr_as_float( element, name, defaultValue ) {\n\n\t\tif ( element.hasAttribute( name ) ) {\n\n\t\t\treturn parseFloat( element.getAttribute( name ) );\n\n\t\t} else {\n\n\t\t\treturn defaultValue;\n\n\t\t}\n\n\t};\n\n\tfunction _attr_as_int( element, name, defaultValue ) {\n\n\t\tif ( element.hasAttribute( name ) ) {\n\n\t\t\treturn parseInt( element.getAttribute( name ), 10) ;\n\n\t\t} else {\n\n\t\t\treturn defaultValue;\n\n\t\t}\n\n\t};\n\n\tfunction _attr_as_string( element, name, defaultValue ) {\n\n\t\tif ( element.hasAttribute( name ) ) {\n\n\t\t\treturn element.getAttribute( name );\n\n\t\t} else {\n\n\t\t\treturn defaultValue;\n\n\t\t}\n\n\t};\n\n\tfunction _format_float( f, num ) {\n\n\t\tif ( f === undefined ) {\n\n\t\t\tvar s = '0.';\n\n\t\t\twhile ( s.length < num + 2 ) {\n\n\t\t\t\ts += '0';\n\n\t\t\t}\n\n\t\t\treturn s;\n\n\t\t}\n\n\t\tnum = num || 2;\n\n\t\tvar parts = f.toString().split( '.' );\n\t\tparts[ 1 ] = parts.length > 1 ? parts[ 1 ].substr( 0, num ) : \"0\";\n\n\t\twhile( parts[ 1 ].length < num ) {\n\n\t\t\tparts[ 1 ] += '0';\n\n\t\t}\n\n\t\treturn parts.join( '.' );\n\n\t};\n\n\tfunction extractDoubleSided( obj, element ) {\n\n\t\tobj.doubleSided = false;\n\n\t\tvar node = element.querySelectorAll('extra double_sided')[0];\n\n\t\tif ( node ) {\n\n\t\t\tif ( node && parseInt( node.textContent, 10 ) === 1 ) {\n\n\t\t\t\tobj.doubleSided = true;\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\t// Up axis conversion\n\n\tfunction setUpConversion() {\n\n\t\tif ( options.convertUpAxis !== true || colladaUp === options.upAxis ) {\n\n\t\t\tupConversion = null;\n\n\t\t} else {\n\n\t\t\tswitch ( colladaUp ) {\n\n\t\t\t\tcase 'X':\n\n\t\t\t\t\tupConversion = options.upAxis === 'Y' ? 'XtoY' : 'XtoZ';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Y':\n\n\t\t\t\t\tupConversion = options.upAxis === 'X' ? 'YtoX' : 'YtoZ';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Z':\n\n\t\t\t\t\tupConversion = options.upAxis === 'X' ? 'ZtoX' : 'ZtoY';\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tfunction fixCoords( data, sign ) {\n\n\t\tif ( options.convertUpAxis !== true || colladaUp === options.upAxis ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tswitch ( upConversion ) {\n\n\t\t\tcase 'XtoY':\n\n\t\t\t\tvar tmp = data[ 0 ];\n\t\t\t\tdata[ 0 ] = sign * data[ 1 ];\n\t\t\t\tdata[ 1 ] = tmp;\n\t\t\t\tbreak;\n\n\t\t\tcase 'XtoZ':\n\n\t\t\t\tvar tmp = data[ 2 ];\n\t\t\t\tdata[ 2 ] = data[ 1 ];\n\t\t\t\tdata[ 1 ] = data[ 0 ];\n\t\t\t\tdata[ 0 ] = tmp;\n\t\t\t\tbreak;\n\n\t\t\tcase 'YtoX':\n\n\t\t\t\tvar tmp = data[ 0 ];\n\t\t\t\tdata[ 0 ] = data[ 1 ];\n\t\t\t\tdata[ 1 ] = sign * tmp;\n\t\t\t\tbreak;\n\n\t\t\tcase 'YtoZ':\n\n\t\t\t\tvar tmp = data[ 1 ];\n\t\t\t\tdata[ 1 ] = sign * data[ 2 ];\n\t\t\t\tdata[ 2 ] = tmp;\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZtoX':\n\n\t\t\t\tvar tmp = data[ 0 ];\n\t\t\t\tdata[ 0 ] = data[ 1 ];\n\t\t\t\tdata[ 1 ] = data[ 2 ];\n\t\t\t\tdata[ 2 ] = tmp;\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZtoY':\n\n\t\t\t\tvar tmp = data[ 1 ];\n\t\t\t\tdata[ 1 ] = data[ 2 ];\n\t\t\t\tdata[ 2 ] = sign * tmp;\n\t\t\t\tbreak;\n\n\t\t}\n\n\t};\n\n\tfunction getConvertedTranslation( axis, data ) {\n\n\t\tif ( options.convertUpAxis !== true || colladaUp === options.upAxis ) {\n\n\t\t\treturn data;\n\n\t\t}\n\n\t\tswitch ( axis ) {\n\t\t\tcase 'X':\n\t\t\t\tdata = upConversion == 'XtoY' ? data * -1 : data;\n\t\t\t\tbreak;\n\t\t\tcase 'Y':\n\t\t\t\tdata = upConversion == 'YtoZ' || upConversion == 'YtoX' ? data * -1 : data;\n\t\t\t\tbreak;\n\t\t\tcase 'Z':\n\t\t\t\tdata = upConversion == 'ZtoY' ? data * -1 : data ;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn data;\n\t};\n\n\tfunction getConvertedVec3( data, offset ) {\n\n\t\tvar arr = [ data[ offset ], data[ offset + 1 ], data[ offset + 2 ] ];\n\t\tfixCoords( arr, -1 );\n\t\treturn new THREE.Vector3( arr[ 0 ], arr[ 1 ], arr[ 2 ] );\n\n\t};\n\n\tfunction getConvertedMat4( data ) {\n\n\t\tif ( options.convertUpAxis ) {\n\n\t\t\t// First fix rotation and scale\n\n\t\t\t// Columns first\n\t\t\tvar arr = [ data[ 0 ], data[ 4 ], data[ 8 ] ];\n\t\t\tfixCoords( arr, -1 );\n\t\t\tdata[ 0 ] = arr[ 0 ];\n\t\t\tdata[ 4 ] = arr[ 1 ];\n\t\t\tdata[ 8 ] = arr[ 2 ];\n\t\t\tarr = [ data[ 1 ], data[ 5 ], data[ 9 ] ];\n\t\t\tfixCoords( arr, -1 );\n\t\t\tdata[ 1 ] = arr[ 0 ];\n\t\t\tdata[ 5 ] = arr[ 1 ];\n\t\t\tdata[ 9 ] = arr[ 2 ];\n\t\t\tarr = [ data[ 2 ], data[ 6 ], data[ 10 ] ];\n\t\t\tfixCoords( arr, -1 );\n\t\t\tdata[ 2 ] = arr[ 0 ];\n\t\t\tdata[ 6 ] = arr[ 1 ];\n\t\t\tdata[ 10 ] = arr[ 2 ];\n\t\t\t// Rows second\n\t\t\tarr = [ data[ 0 ], data[ 1 ], data[ 2 ] ];\n\t\t\tfixCoords( arr, -1 );\n\t\t\tdata[ 0 ] = arr[ 0 ];\n\t\t\tdata[ 1 ] = arr[ 1 ];\n\t\t\tdata[ 2 ] = arr[ 2 ];\n\t\t\tarr = [ data[ 4 ], data[ 5 ], data[ 6 ] ];\n\t\t\tfixCoords( arr, -1 );\n\t\t\tdata[ 4 ] = arr[ 0 ];\n\t\t\tdata[ 5 ] = arr[ 1 ];\n\t\t\tdata[ 6 ] = arr[ 2 ];\n\t\t\tarr = [ data[ 8 ], data[ 9 ], data[ 10 ] ];\n\t\t\tfixCoords( arr, -1 );\n\t\t\tdata[ 8 ] = arr[ 0 ];\n\t\t\tdata[ 9 ] = arr[ 1 ];\n\t\t\tdata[ 10 ] = arr[ 2 ];\n\n\t\t\t// Now fix translation\n\t\t\tarr = [ data[ 3 ], data[ 7 ], data[ 11 ] ];\n\t\t\tfixCoords( arr, -1 );\n\t\t\tdata[ 3 ] = arr[ 0 ];\n\t\t\tdata[ 7 ] = arr[ 1 ];\n\t\t\tdata[ 11 ] = arr[ 2 ];\n\n\t\t}\n\n\t\treturn new THREE.Matrix4(\n\t\t\tdata[0], data[1], data[2], data[3],\n\t\t\tdata[4], data[5], data[6], data[7],\n\t\t\tdata[8], data[9], data[10], data[11],\n\t\t\tdata[12], data[13], data[14], data[15]\n\t\t\t);\n\n\t};\n\n\tfunction getConvertedIndex( index ) {\n\n\t\tif ( index > -1 && index < 3 ) {\n\n\t\t\tvar members = ['X', 'Y', 'Z'],\n\t\t\t\tindices = { X: 0, Y: 1, Z: 2 };\n\n\t\t\tindex = getConvertedMember( members[ index ] );\n\t\t\tindex = indices[ index ];\n\n\t\t}\n\n\t\treturn index;\n\n\t};\n\n\tfunction getConvertedMember( member ) {\n\n\t\tif ( options.convertUpAxis ) {\n\n\t\t\tswitch ( member ) {\n\n\t\t\t\tcase 'X':\n\n\t\t\t\t\tswitch ( upConversion ) {\n\n\t\t\t\t\t\tcase 'XtoY':\n\t\t\t\t\t\tcase 'XtoZ':\n\t\t\t\t\t\tcase 'YtoX':\n\n\t\t\t\t\t\t\tmember = 'Y';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'ZtoX':\n\n\t\t\t\t\t\t\tmember = 'Z';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Y':\n\n\t\t\t\t\tswitch ( upConversion ) {\n\n\t\t\t\t\t\tcase 'XtoY':\n\t\t\t\t\t\tcase 'YtoX':\n\t\t\t\t\t\tcase 'ZtoX':\n\n\t\t\t\t\t\t\tmember = 'X';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'XtoZ':\n\t\t\t\t\t\tcase 'YtoZ':\n\t\t\t\t\t\tcase 'ZtoY':\n\n\t\t\t\t\t\t\tmember = 'Z';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Z':\n\n\t\t\t\t\tswitch ( upConversion ) {\n\n\t\t\t\t\t\tcase 'XtoZ':\n\n\t\t\t\t\t\t\tmember = 'X';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'YtoZ':\n\t\t\t\t\t\tcase 'ZtoX':\n\t\t\t\t\t\tcase 'ZtoY':\n\n\t\t\t\t\t\t\tmember = 'Y';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn member;\n\n\t};\n\n\treturn {\n\n\t\tload: load,\n\t\tparse: parse,\n\t\tsetPreferredShading: setPreferredShading,\n\t\tapplySkin: applySkin,\n\t\tgeometries : geometries,\n\t\toptions: options\n\n\t};\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Loaders/DDSLoader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Loaders/DDSLoader.js",
            "module-type": "library",
            "text": "/*\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.DDSLoader = function () {};\n\nTHREE.DDSLoader.prototype = {\n\n\tconstructor: THREE.DDSLoader,\n\n\tload: function ( url, onLoad, onError ) {\n          var func = \"THREE.DDSLoader.load\";\n          hack.log(\"url: \"+url, hack.loader, func);\n\n\t\tvar scope = this;\n\n\t\tvar images = [];\n\n\t\tvar texture = new THREE.CompressedTexture();\n\t\ttexture.image = images;\n\n\t\t// no flipping for cube textures\n\t\t// (also flipping doesn't work for compressed textures )\n\n\t\ttexture.flipY = false;\n\n\t\t// can't generate mipmaps for compressed textures\n\t\t// mips must be embedded in DDS files\n\n\t\ttexture.generateMipmaps = false;\n\n\t\tif ( url instanceof Array ) {\n\n\t\t\tvar loaded = 0;\n\n\t\t\tvar loader = new THREE.XHRLoader();\n\t\t\tloader.setResponseType( 'arraybuffer' );\n\n\t\t\tvar loadTexture = function ( i ) {\n\t\t\n\t\t\t\tloader.load( url[ i ], function ( buffer ) {\n\n\t\t\t\t\tvar dds = scope.parse( buffer, true );\n\n\t\t\t\t\timages[ i ] = {\n\t\t\t\t\t\twidth: dds.width,\n\t\t\t\t\t\theight: dds.height,\n\t\t\t\t\t\tformat: dds.format,\n\t\t\t\t\t\tmipmaps: dds.mipmaps\n\t\t\t\t\t}\n\n\t\t\t\t\tloaded += 1;\n\n\t\t\t\t\tif ( loaded === 6 ) {\n\n\t\t\t\t\t\ttexture.format = dds.format;\n\t\t\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\t\t\tif ( onLoad ) onLoad( texture );\n\n\t\t\t\t\t}\n\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t\tfor ( var i = 0, il = url.length; i < il; ++ i ) {\n\n\t\t\t\tloadTexture( i );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// compressed cubemap texture stored in a single DDS file\n\n\t\t\tvar loader = new THREE.XHRLoader();\n\t\t\tloader.setResponseType( 'arraybuffer' );\n\t\t\tloader.load( url, function ( buffer ) {\n\n\t\t\t\tvar dds = scope.parse( buffer, true );\n\n\t\t\t\tif ( dds.isCubemap ) {\n\n\t\t\t\t\tvar faces = dds.mipmaps.length / dds.mipmapCount;\n\n\t\t\t\t\tfor ( var f = 0; f < faces; f ++ ) {\n\n\t\t\t\t\t\timages[ f ] = { mipmaps : [] };\n\n\t\t\t\t\t\tfor ( var i = 0; i < dds.mipmapCount; i ++ ) {\n\n\t\t\t\t\t\t\timages[ f ].mipmaps.push( dds.mipmaps[ f * dds.mipmapCount + i ] );\n\t\t\t\t\t\t\timages[ f ].format = dds.format;\n\t\t\t\t\t\t\timages[ f ].width = dds.width;\n\t\t\t\t\t\t\timages[ f ].height = dds.height;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\ttexture.image.width = dds.width;\n\t\t\t\t\ttexture.image.height = dds.height;\n\t\t\t\t\ttexture.mipmaps = dds.mipmaps;\n\n\t\t\t\t}\n\n\t\t\t\ttexture.format = dds.format;\n\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\tif ( onLoad ) onLoad( texture );\n\n\t\t\t} );\n\n\t\t}\n          hack.log(\"url: \"+url+\": loaded\", hack.loader, func);\n\n\t\treturn texture;\n\n\t},\n\n\tparse: function ( buffer, loadMipmaps ) {\n\n\t\tvar dds = { mipmaps: [], width: 0, height: 0, format: null, mipmapCount: 1 };\n\n\t\t// Adapted from @toji's DDS utils\n\t\t//\thttps://github.com/toji/webgl-texture-utils/blob/master/texture-util/dds.js\n\n\t\t// All values and structures referenced from:\n\t\t// http://msdn.microsoft.com/en-us/library/bb943991.aspx/\n\n\t\tvar DDS_MAGIC = 0x20534444;\n\n\t\tvar DDSD_CAPS = 0x1,\n\t\t\tDDSD_HEIGHT = 0x2,\n\t\t\tDDSD_WIDTH = 0x4,\n\t\t\tDDSD_PITCH = 0x8,\n\t\t\tDDSD_PIXELFORMAT = 0x1000,\n\t\t\tDDSD_MIPMAPCOUNT = 0x20000,\n\t\t\tDDSD_LINEARSIZE = 0x80000,\n\t\t\tDDSD_DEPTH = 0x800000;\n\n\t\tvar DDSCAPS_COMPLEX = 0x8,\n\t\t\tDDSCAPS_MIPMAP = 0x400000,\n\t\t\tDDSCAPS_TEXTURE = 0x1000;\n\n\t\tvar DDSCAPS2_CUBEMAP = 0x200,\n\t\t\tDDSCAPS2_CUBEMAP_POSITIVEX = 0x400,\n\t\t\tDDSCAPS2_CUBEMAP_NEGATIVEX = 0x800,\n\t\t\tDDSCAPS2_CUBEMAP_POSITIVEY = 0x1000,\n\t\t\tDDSCAPS2_CUBEMAP_NEGATIVEY = 0x2000,\n\t\t\tDDSCAPS2_CUBEMAP_POSITIVEZ = 0x4000,\n\t\t\tDDSCAPS2_CUBEMAP_NEGATIVEZ = 0x8000,\n\t\t\tDDSCAPS2_VOLUME = 0x200000;\n\n\t\tvar DDPF_ALPHAPIXELS = 0x1,\n\t\t\tDDPF_ALPHA = 0x2,\n\t\t\tDDPF_FOURCC = 0x4,\n\t\t\tDDPF_RGB = 0x40,\n\t\t\tDDPF_YUV = 0x200,\n\t\t\tDDPF_LUMINANCE = 0x20000;\n\n\t\tfunction fourCCToInt32( value ) {\n\n\t\t\treturn value.charCodeAt(0) +\n\t\t\t\t(value.charCodeAt(1) << 8) +\n\t\t\t\t(value.charCodeAt(2) << 16) +\n\t\t\t\t(value.charCodeAt(3) << 24);\n\n\t\t}\n\n\t\tfunction int32ToFourCC( value ) {\n\n\t\t\treturn String.fromCharCode(\n\t\t\t\tvalue & 0xff,\n\t\t\t\t(value >> 8) & 0xff,\n\t\t\t\t(value >> 16) & 0xff,\n\t\t\t\t(value >> 24) & 0xff\n\t\t\t);\n\t\t}\n\n\t\tfunction loadARGBMip( buffer, dataOffset, width, height ) {\n\t\t\tvar dataLength = width*height*4;\n\t\t\tvar srcBuffer = new Uint8Array( buffer, dataOffset, dataLength );\n\t\t\tvar byteArray = new Uint8Array( dataLength );\n\t\t\tvar dst = 0;\n\t\t\tvar src = 0;\n\t\t\tfor ( var y = 0; y < height; y++ ) {\n\t\t\t\tfor ( var x = 0; x < width; x++ ) {\n\t\t\t\t\tvar b = srcBuffer[src]; src++;\n\t\t\t\t\tvar g = srcBuffer[src]; src++;\n\t\t\t\t\tvar r = srcBuffer[src]; src++;\n\t\t\t\t\tvar a = srcBuffer[src]; src++;\n\t\t\t\t\tbyteArray[dst] = r; dst++;\t//r\n\t\t\t\t\tbyteArray[dst] = g; dst++;\t//g\n\t\t\t\t\tbyteArray[dst] = b; dst++;\t//b\n\t\t\t\t\tbyteArray[dst] = a; dst++;\t//a\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn byteArray;\n\t\t}\n\n\t\tvar FOURCC_DXT1 = fourCCToInt32(\"DXT1\");\n\t\tvar FOURCC_DXT3 = fourCCToInt32(\"DXT3\");\n\t\tvar FOURCC_DXT5 = fourCCToInt32(\"DXT5\");\n\n\t\tvar headerLengthInt = 31; // The header length in 32 bit ints\n\n\t\t// Offsets into the header array\n\n\t\tvar off_magic = 0;\n\n\t\tvar off_size = 1;\n\t\tvar off_flags = 2;\n\t\tvar off_height = 3;\n\t\tvar off_width = 4;\n\n\t\tvar off_mipmapCount = 7;\n\n\t\tvar off_pfFlags = 20;\n\t\tvar off_pfFourCC = 21;\n\t\tvar off_RGBBitCount = 22;\n\t\tvar off_RBitMask = 23;\n\t\tvar off_GBitMask = 24;\n\t\tvar off_BBitMask = 25;\n\t\tvar off_ABitMask = 26;\n\n\t\tvar off_caps = 27;\n\t\tvar off_caps2 = 28;\n\t\tvar off_caps3 = 29;\n\t\tvar off_caps4 = 30;\n\n\t\t// Parse header\n\n\t\tvar header = new Int32Array( buffer, 0, headerLengthInt );\n\n\t\tif ( header[ off_magic ] !== DDS_MAGIC ) {\n\n\t\t\tconsole.error( 'THREE.DDSLoader.parse: Invalid magic number in DDS header.' );\n\t\t\treturn dds;\n\n\t\t}\n\n\t\tif ( ! header[ off_pfFlags ] & DDPF_FOURCC ) {\n\n\t\t\tconsole.error( 'THREE.DDSLoader.parse: Unsupported format, must contain a FourCC code.' );\n\t\t\treturn dds;\n\n\t\t}\n\n\t\tvar blockBytes;\n\n\t\tvar fourCC = header[ off_pfFourCC ];\n\n\t\tvar isRGBAUncompressed = false;\n\n\t\tswitch ( fourCC ) {\n\n\t\t\tcase FOURCC_DXT1:\n\n\t\t\t\tblockBytes = 8;\n\t\t\t\tdds.format = THREE.RGB_S3TC_DXT1_Format;\n\t\t\t\tbreak;\n\n\t\t\tcase FOURCC_DXT3:\n\n\t\t\t\tblockBytes = 16;\n\t\t\t\tdds.format = THREE.RGBA_S3TC_DXT3_Format;\n\t\t\t\tbreak;\n\n\t\t\tcase FOURCC_DXT5:\n\n\t\t\t\tblockBytes = 16;\n\t\t\t\tdds.format = THREE.RGBA_S3TC_DXT5_Format;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tif( header[off_RGBBitCount] ==32 \n\t\t\t\t\t&& header[off_RBitMask]&0xff0000\n\t\t\t\t\t&& header[off_GBitMask]&0xff00 \n\t\t\t\t\t&& header[off_BBitMask]&0xff\n\t\t\t\t\t&& header[off_ABitMask]&0xff000000  ) {\n\t\t\t\t\tisRGBAUncompressed = true;\n\t\t\t\t\tblockBytes = 64;\n\t\t\t\t\tdds.format = THREE.RGBAFormat;\n\t\t\t\t} else {\n\t\t\t\t\tconsole.error( 'THREE.DDSLoader.parse: Unsupported FourCC code ', int32ToFourCC( fourCC ) );\n\t\t\t\t\treturn dds;\n\t\t\t\t}\n\t\t}\n\n\t\tdds.mipmapCount = 1;\n\n\t\tif ( header[ off_flags ] & DDSD_MIPMAPCOUNT && loadMipmaps !== false ) {\n\n\t\t\tdds.mipmapCount = Math.max( 1, header[ off_mipmapCount ] );\n\n\t\t}\n\n\t\t//TODO: Verify that all faces of the cubemap are present with DDSCAPS2_CUBEMAP_POSITIVEX, etc.\n\n\t\tdds.isCubemap = header[ off_caps2 ] & DDSCAPS2_CUBEMAP ? true : false;\n\n\t\tdds.width = header[ off_width ];\n\t\tdds.height = header[ off_height ];\n\n\t\tvar dataOffset = header[ off_size ] + 4;\n\n\t\t// Extract mipmaps buffers\n\n\t\tvar width = dds.width;\n\t\tvar height = dds.height;\n\n\t\tvar faces = dds.isCubemap ? 6 : 1;\n\n\t\tfor ( var face = 0; face < faces; face ++ ) {\n\n\t\t\tfor ( var i = 0; i < dds.mipmapCount; i ++ ) {\n\n\t\t\t\tif( isRGBAUncompressed ) {\n\t\t\t\t\tvar byteArray = loadARGBMip( buffer, dataOffset, width, height );\n\t\t\t\t\tvar dataLength = byteArray.length;\n\t\t\t\t} else {\n\t\t\t\t\tvar dataLength = Math.max( 4, width ) / 4 * Math.max( 4, height ) / 4 * blockBytes;\n\t\t\t\t\tvar byteArray = new Uint8Array( buffer, dataOffset, dataLength );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar mipmap = { \"data\": byteArray, \"width\": width, \"height\": height };\n\t\t\t\tdds.mipmaps.push( mipmap );\n\n\t\t\t\tdataOffset += dataLength;\n\n\t\t\t\twidth = Math.max( width * 0.5, 1 );\n\t\t\t\theight = Math.max( height * 0.5, 1 );\n\n\t\t\t}\n\n\t\t\twidth = dds.width;\n\t\t\theight = dds.height;\n\n\t\t}\n\n\t\treturn dds;\n\n\t}\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Loaders/MTLLoader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Loaders/MTLLoader.js",
            "module-type": "library",
            "text": "/**\n * Loads a Wavefront .mtl file specifying materials\n *\n * @author angelxuanchang\n */\n\nTHREE.MTLLoader = function( baseUrl, options, crossOrigin ) {\n\n\tthis.baseUrl = baseUrl;\n\tthis.options = options;\n\tthis.crossOrigin = crossOrigin;\n\n};\n\nTHREE.MTLLoader.prototype = {\n\n\tconstructor: THREE.MTLLoader,\n\n\tload: function ( url, onLoad, onProgress, onError ) {\n\n\t\tvar scope = this;\n\n\t\tvar loader = new THREE.XHRLoader();\n\t\tloader.setCrossOrigin( this.crossOrigin );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\tonLoad( scope.parse( text ) );\n\n\t\t} );\n\n\t},\n\n\t/**\n\t * Parses loaded MTL file\n\t * @param text - Content of MTL file\n\t * @return {THREE.MTLLoader.MaterialCreator}\n\t */\n\tparse: function ( text ) {\n\n\t\tvar lines = text.split( \"\\n\" );\n\t\tvar info = {};\n\t\tvar delimiter_pattern = /\\s+/;\n\t\tvar materialsInfo = {};\n\n\t\tfor ( var i = 0; i < lines.length; i ++ ) {\n\n\t\t\tvar line = lines[ i ];\n\t\t\tline = line.trim();\n\n\t\t\tif ( line.length === 0 || line.charAt( 0 ) === '#' ) {\n\n\t\t\t\t// Blank line or comment ignore\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tvar pos = line.indexOf( ' ' );\n\n\t\t\tvar key = ( pos >= 0 ) ? line.substring( 0, pos ) : line;\n\t\t\tkey = key.toLowerCase();\n\n\t\t\tvar value = ( pos >= 0 ) ? line.substring( pos + 1 ) : \"\";\n\t\t\tvalue = value.trim();\n\n\t\t\tif ( key === \"newmtl\" ) {\n\n\t\t\t\t// New material\n\n\t\t\t\tinfo = { name: value };\n\t\t\t\tmaterialsInfo[ value ] = info;\n\n\t\t\t} else if ( info ) {\n\n\t\t\t\tif ( key === \"ka\" || key === \"kd\" || key === \"ks\" ) {\n\n\t\t\t\t\tvar ss = value.split( delimiter_pattern, 3 );\n\t\t\t\t\tinfo[ key ] = [ parseFloat( ss[0] ), parseFloat( ss[1] ), parseFloat( ss[2] ) ];\n\n\t\t\t\t} else {\n\n\t\t\t\t\tinfo[ key ] = value;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tvar materialCreator = new THREE.MTLLoader.MaterialCreator( this.baseUrl, this.options );\n\t\tmaterialCreator.setMaterials( materialsInfo );\n\t\treturn materialCreator;\n\n\t}\n\n};\n\n/**\n * Create a new THREE-MTLLoader.MaterialCreator\n * @param baseUrl - Url relative to which textures are loaded\n * @param options - Set of options on how to construct the materials\n *                  side: Which side to apply the material\n *                        THREE.FrontSide (default), THREE.BackSide, THREE.DoubleSide\n *                  wrap: What type of wrapping to apply for textures\n *                        THREE.RepeatWrapping (default), THREE.ClampToEdgeWrapping, THREE.MirroredRepeatWrapping\n *                  normalizeRGB: RGBs need to be normalized to 0-1 from 0-255\n *                                Default: false, assumed to be already normalized\n *                  ignoreZeroRGBs: Ignore values of RGBs (Ka,Kd,Ks) that are all 0's\n *                                  Default: false\n *                  invertTransparency: If transparency need to be inverted (inversion is needed if d = 0 is fully opaque)\n *                                      Default: false (d = 1 is fully opaque)\n * @constructor\n */\n\nTHREE.MTLLoader.MaterialCreator = function( baseUrl, options ) {\n\n\tthis.baseUrl = baseUrl;\n\tthis.options = options;\n\tthis.materialsInfo = {};\n\tthis.materials = {};\n\tthis.materialsArray = [];\n\tthis.nameLookup = {};\n\n\tthis.side = ( this.options && this.options.side )? this.options.side: THREE.FrontSide;\n\tthis.wrap = ( this.options && this.options.wrap )? this.options.wrap: THREE.RepeatWrapping;\n\n};\n\nTHREE.MTLLoader.MaterialCreator.prototype = {\n\n\tconstructor: THREE.MTLLoader.MaterialCreator,\n\n\tsetMaterials: function( materialsInfo ) {\n\n\t\tthis.materialsInfo = this.convert( materialsInfo );\n\t\tthis.materials = {};\n\t\tthis.materialsArray = [];\n\t\tthis.nameLookup = {};\n\n\t},\n\n\tconvert: function( materialsInfo ) {\n\n\t\tif ( !this.options ) return materialsInfo;\n\n\t\tvar converted = {};\n\n\t\tfor ( var mn in materialsInfo ) {\n\n\t\t\t// Convert materials info into normalized form based on options\n\n\t\t\tvar mat = materialsInfo[ mn ];\n\n\t\t\tvar covmat = {};\n\n\t\t\tconverted[ mn ] = covmat;\n\n\t\t\tfor ( var prop in mat ) {\n\n\t\t\t\tvar save = true;\n\t\t\t\tvar value = mat[ prop ];\n\t\t\t\tvar lprop = prop.toLowerCase();\n\n\t\t\t\tswitch ( lprop ) {\n\n\t\t\t\t\tcase 'kd':\n\t\t\t\t\tcase 'ka':\n\t\t\t\t\tcase 'ks':\n\n\t\t\t\t\t\t// Diffuse color (color under white light) using RGB values\n\n\t\t\t\t\t\tif ( this.options && this.options.normalizeRGB ) {\n\n\t\t\t\t\t\t\tvalue = [ value[ 0 ] / 255, value[ 1 ] / 255, value[ 2 ] / 255 ];\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( this.options && this.options.ignoreZeroRGBs ) {\n\n\t\t\t\t\t\t\tif ( value[ 0 ] === 0 && value[ 1 ] === 0 && value[ 1 ] === 0 ) {\n\n\t\t\t\t\t\t\t\t// ignore\n\n\t\t\t\t\t\t\t\tsave = false;\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'd':\n\n\t\t\t\t\t\t// According to MTL format (http://paulbourke.net/dataformats/mtl/):\n\t\t\t\t\t\t//   d is dissolve for current material\n\t\t\t\t\t\t//   factor of 1.0 is fully opaque, a factor of 0 is fully dissolved (completely transparent)\n\n\t\t\t\t\t\tif ( this.options && this.options.invertTransparency ) {\n\n\t\t\t\t\t\t\tvalue = 1 - value;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ( save ) {\n\n\t\t\t\t\tcovmat[ lprop ] = value;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn converted;\n\n\t},\n\n\tpreload: function () {\n\n\t\tfor ( var mn in this.materialsInfo ) {\n\n\t\t\tthis.create( mn );\n\n\t\t}\n\n\t},\n\n\tgetIndex: function( materialName ) {\n\n\t\treturn this.nameLookup[ materialName ];\n\n\t},\n\n\tgetAsArray: function() {\n\n\t\tvar index = 0;\n\n\t\tfor ( var mn in this.materialsInfo ) {\n\n\t\t\tthis.materialsArray[ index ] = this.create( mn );\n\t\t\tthis.nameLookup[ mn ] = index;\n\t\t\tindex ++;\n\n\t\t}\n\n\t\treturn this.materialsArray;\n\n\t},\n\n\tcreate: function ( materialName ) {\n\n\t\tif ( this.materials[ materialName ] === undefined ) {\n\n\t\t\tthis.createMaterial_( materialName );\n\n\t\t}\n\n\t\treturn this.materials[ materialName ];\n\n\t},\n\n\tcreateMaterial_: function ( materialName ) {\n\n\t\t// Create material\n\n\t\tvar mat = this.materialsInfo[ materialName ];\n\t\tvar params = {\n\n\t\t\tname: materialName,\n\t\t\tside: this.side\n\n\t\t};\n\n\t\tfor ( var prop in mat ) {\n\n\t\t\tvar value = mat[ prop ];\n\n\t\t\tswitch ( prop.toLowerCase() ) {\n\n\t\t\t\t// Ns is material specular exponent\n\n\t\t\t\tcase 'kd':\n\n\t\t\t\t\t// Diffuse color (color under white light) using RGB values\n\n\t\t\t\t\tparams[ 'diffuse' ] = new THREE.Color().fromArray( value );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ka':\n\n\t\t\t\t\t// Ambient color (color under shadow) using RGB values\n\n\t\t\t\t\tparams[ 'ambient' ] = new THREE.Color().fromArray( value );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ks':\n\n\t\t\t\t\t// Specular color (color when light is reflected from shiny surface) using RGB values\n\t\t\t\t\tparams[ 'specular' ] = new THREE.Color().fromArray( value );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'map_kd':\n\n\t\t\t\t\t// Diffuse texture map\n\n\t\t\t\t\tparams[ 'map' ] = this.loadTexture( this.baseUrl + value );\n\t\t\t\t\tparams[ 'map' ].wrapS = this.wrap;\n\t\t\t\t\tparams[ 'map' ].wrapT = this.wrap;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ns':\n\n\t\t\t\t\t// The specular exponent (defines the focus of the specular highlight)\n\t\t\t\t\t// A high exponent results in a tight, concentrated highlight. Ns values normally range from 0 to 1000.\n\n\t\t\t\t\tparams['shininess'] = value;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'd':\n\n\t\t\t\t\t// According to MTL format (http://paulbourke.net/dataformats/mtl/):\n\t\t\t\t\t//   d is dissolve for current material\n\t\t\t\t\t//   factor of 1.0 is fully opaque, a factor of 0 is fully dissolved (completely transparent)\n\n\t\t\t\t\tif ( value < 1 ) {\n\n\t\t\t\t\t\tparams['transparent'] = true;\n\t\t\t\t\t\tparams['opacity'] = value;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( params[ 'diffuse' ] ) {\n\n\t\t\tif ( !params[ 'ambient' ]) params[ 'ambient' ] = params[ 'diffuse' ];\n\t\t\tparams[ 'color' ] = params[ 'diffuse' ];\n\n\t\t}\n\n\t\tthis.materials[ materialName ] = new THREE.MeshPhongMaterial( params );\n\t\treturn this.materials[ materialName ];\n\n\t},\n\n\n\tloadTexture: function ( url, mapping, onLoad, onError ) {\n\n\t\tvar texture;\n\t\tvar loader = THREE.Loader.Handlers.get( url );\n\n\t\tif ( loader !== null ) {\n\n\t\t\ttexture = loader.load( url, onLoad );\n\n\t\t} else {\n\n\t\t\ttexture = new THREE.Texture();\n\n\t\t\tloader = new THREE.ImageLoader();\n\t\t\tloader.crossOrigin = this.crossOrigin;\n\t\t\tloader.load( url, function ( image ) {\n\n\t\t\t\ttexture.image = THREE.MTLLoader.ensurePowerOfTwo_( image );\n\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\tif ( onLoad ) onLoad( texture );\n\n\t\t\t} );\n\n\t\t}\n\n\t\ttexture.mapping = mapping;\n\n\t\treturn texture;\n\n\t}\n\n};\n\nTHREE.MTLLoader.ensurePowerOfTwo_ = function ( image ) {\n\n\tif ( ! THREE.Math.isPowerOfTwo( image.width ) || ! THREE.Math.isPowerOfTwo( image.height ) ) {\n\n\t\tvar canvas = document.createElement( \"canvas\" );\n\t\tcanvas.width = THREE.MTLLoader.nextHighestPowerOfTwo_( image.width );\n\t\tcanvas.height = THREE.MTLLoader.nextHighestPowerOfTwo_( image.height );\n\n\t\tvar ctx = canvas.getContext(\"2d\");\n\t\tctx.drawImage( image, 0, 0, image.width, image.height, 0, 0, canvas.width, canvas.height );\n\t\treturn canvas;\n\n\t}\n\n\treturn image;\n\n};\n\nTHREE.MTLLoader.nextHighestPowerOfTwo_ = function( x ) {\n\n\t--x;\n\n\tfor ( var i = 1; i < 32; i <<= 1 ) {\n\n\t\tx = x | x >> i;\n\n\t}\n\n\treturn x + 1;\n\n};\n\nTHREE.EventDispatcher.prototype.apply( THREE.MTLLoader.prototype );\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Loaders/OBJLoader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Loaders/OBJLoader.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.OBJLoader = function ( manager ) {\n\n\tthis.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;\n\n};\n\nTHREE.OBJLoader.prototype = {\n\n\tconstructor: THREE.OBJLoader,\n\n\tload: function ( url, onLoad, onProgress, onError ) {\n\n\t\tvar scope = this;\n\n\t\tvar loader = new THREE.XHRLoader( scope.manager );\n\t\tloader.setCrossOrigin( this.crossOrigin );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\tonLoad( scope.parse( text ) );\n\n\t\t} );\n\n\t},\n\n\tparse: function ( text ) {\n          var func = \"THREE.OBJLoader.parse\";\n\n\t\tfunction vector( x, y, z ) {\n\n\t\t\treturn new THREE.Vector3( parseFloat( x ), parseFloat( y ), parseFloat( z ) );\n\n\t\t}\n\n\t\tfunction uv( u, v ) {\n\n\t\t\treturn new THREE.Vector2( parseFloat( u ), parseFloat( v ) );\n\n\t\t}\n\n\t\tfunction face3( a, b, c, normals ) {\n\n\t\t\treturn new THREE.Face3( a, b, c, normals );\n\n\t\t}\n\t\t\n\t\tvar object = new THREE.Object3D();\n\t\tvar geometry, material, mesh;\n\n\t\tfunction parseVertexIndex( index ) {\n\n\t\t\tindex = parseInt( index );\n\n\t\t\treturn index >= 0 ? index - 1 : index + vertices.length;\n\n\t\t}\n\n\t\tfunction parseNormalIndex( index ) {\n\n\t\t\tindex = parseInt( index );\n\n\t\t\treturn index >= 0 ? index - 1 : index + normals.length;\n\n\t\t}\n\n\t\tfunction parseUVIndex( index ) {\n\n\t\t\tindex = parseInt( index );\n\n\t\t\treturn index >= 0 ? index - 1 : index + uvs.length;\n\n\t\t}\n\t\t\n\t\tfunction add_face( a, b, c, normals_inds ) {\n\n\t\t\tif ( normals_inds === undefined ) {\n\n\t\t\t\tgeometry.faces.push( face3(\n\t\t\t\t\tvertices[ parseVertexIndex( a ) ] - 1,\n\t\t\t\t\tvertices[ parseVertexIndex( b ) ] - 1,\n\t\t\t\t\tvertices[ parseVertexIndex( c ) ] - 1\n\t\t\t\t) );\n\n\t\t\t} else {\n\n\t\t\t\tgeometry.faces.push( face3(\n\t\t\t\t\tvertices[ parseVertexIndex( a ) ] - 1,\n\t\t\t\t\tvertices[ parseVertexIndex( b ) ] - 1,\n\t\t\t\t\tvertices[ parseVertexIndex( c ) ] - 1,\n\t\t\t\t\t[\n\t\t\t\t\t\tnormals[ parseNormalIndex( normals_inds[ 0 ] ) ].clone(),\n\t\t\t\t\t\tnormals[ parseNormalIndex( normals_inds[ 1 ] ) ].clone(),\n\t\t\t\t\t\tnormals[ parseNormalIndex( normals_inds[ 2 ] ) ].clone()\n\t\t\t\t\t]\n\t\t\t\t) );\n\n\t\t\t}\n\n\t\t}\n\t\t\n\t\tfunction add_uvs( a, b, c ) {\n\t  \n\t\t\tgeometry.faceVertexUvs[ 0 ].push( [\n\t\t\t\tuvs[ parseUVIndex( a ) ].clone(),\n\t\t\t\tuvs[ parseUVIndex( b ) ].clone(),\n\t\t\t\tuvs[ parseUVIndex( c ) ].clone()\n\t\t\t] );\n\n\t\t}\n\t\t\n\t\tfunction handle_face_line(faces, uvs, normals_inds) {\n\n\t\t\tif ( faces[ 3 ] === undefined ) {\n\t\t\t\t\n\t\t\t\tadd_face( faces[ 0 ], faces[ 1 ], faces[ 2 ], normals_inds );\n\t\t\t\t\n\t\t\t\tif ( uvs !== undefined && uvs.length > 0 ) {\n\n\t\t\t\t\tadd_uvs( uvs[ 0 ], uvs[ 1 ], uvs[ 2 ] );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tif ( normals_inds !== undefined && normals_inds.length > 0 ) {\n\n\t\t\t\t\tadd_face( faces[ 0 ], faces[ 1 ], faces[ 3 ], [ normals_inds[ 0 ], normals_inds[ 1 ], normals_inds[ 3 ] ] );\n\t\t\t\t\tadd_face( faces[ 1 ], faces[ 2 ], faces[ 3 ], [ normals_inds[ 1 ], normals_inds[ 2 ], normals_inds[ 3 ] ] );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tadd_face( faces[ 0 ], faces[ 1 ], faces[ 3 ] );\n\t\t\t\t\tadd_face( faces[ 1 ], faces[ 2 ], faces[ 3 ] );\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( uvs !== undefined && uvs.length > 0 ) {\n\n\t\t\t\t\tadd_uvs( uvs[ 0 ], uvs[ 1 ], uvs[ 3 ] );\n\t\t\t\t\tadd_uvs( uvs[ 1 ], uvs[ 2 ], uvs[ 3 ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t// create mesh if no objects in text\n\n\t\tif ( /^o /gm.test( text ) === false ) {\n\n\t\t\tgeometry = new THREE.Geometry();\n\t\t\tmaterial = new THREE.MeshLambertMaterial();\n\t\t\tmesh = new THREE.Mesh( geometry, material );\n\t\t\tobject.add( mesh );\n\n\t\t}\n\n\t\tvar vertices = [];\n\t\tvar normals = [];\n\t\tvar uvs = [];\n\n\t\t// v float float float\n\n\t\tvar vertex_pattern = /v( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)/;\n\n\t\t// vn float float float\n\n\t\tvar normal_pattern = /vn( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)/;\n\n\t\t// vt float float\n\n\t\tvar uv_pattern = /vt( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)/;\n\n\t\t// f vertex vertex vertex ...\n\n\t\tvar face_pattern1 = /f( +-?\\d+)( +-?\\d+)( +-?\\d+)( +-?\\d+)?/;\n\n\t\t// f vertex/uv vertex/uv vertex/uv ...\n\n\t\tvar face_pattern2 = /f( +(-?\\d+)\\/(-?\\d+))( +(-?\\d+)\\/(-?\\d+))( +(-?\\d+)\\/(-?\\d+))( +(-?\\d+)\\/(-?\\d+))?/;\n\n\t\t// f vertex/uv/normal vertex/uv/normal vertex/uv/normal ...\n\n\t\tvar face_pattern3 = /f( +(-?\\d+)\\/(-?\\d+)\\/(-?\\d+))( +(-?\\d+)\\/(-?\\d+)\\/(-?\\d+))( +(-?\\d+)\\/(-?\\d+)\\/(-?\\d+))( +(-?\\d+)\\/(-?\\d+)\\/(-?\\d+))?/;\n\n\t\t// f vertex//normal vertex//normal vertex//normal ... \n\n\t\tvar face_pattern4 = /f( +(-?\\d+)\\/\\/(-?\\d+))( +(-?\\d+)\\/\\/(-?\\d+))( +(-?\\d+)\\/\\/(-?\\d+))( +(-?\\d+)\\/\\/(-?\\d+))?/\n\n\t\t// fixes\n\n\t\ttext = text.replace( /\\\\\\r\\n/g, '' ); // handles line continuations \\\n\n\t\tvar lines = text.split( '\\n' );\n\n\t\tfor ( var i = 0; i < lines.length; i ++ ) {\n\n\t\t\tvar line = lines[ i ];\n\t\t\tline = line.trim();\n\n\t\t\tvar result;\n\n\t\t\tif ( line.length === 0 || line.charAt( 0 ) === '#' ) {\n\n\t\t\t\tcontinue;\n\n\t\t\t} else if ( ( result = vertex_pattern.exec( line ) ) !== null ) {\n\n\t\t\t\t// [\"v 1.0 2.0 3.0\", \"1.0\", \"2.0\", \"3.0\"]\n\n\t\t\t\tvertices.push( \n\t\t\t\t\tgeometry.vertices.push(\n\t\t\t\t\t\tvector(\n\t\t\t\t\t\t\tresult[ 1 ], result[ 2 ], result[ 3 ]\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t} else if ( ( result = normal_pattern.exec( line ) ) !== null ) {\n\n\t\t\t\t// [\"vn 1.0 2.0 3.0\", \"1.0\", \"2.0\", \"3.0\"]\n\n\t\t\t\tnormals.push(\n\t\t\t\t\tvector(\n\t\t\t\t\t\tresult[ 1 ], result[ 2 ], result[ 3 ]\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t} else if ( ( result = uv_pattern.exec( line ) ) !== null ) {\n\n\t\t\t\t// [\"vt 0.1 0.2\", \"0.1\", \"0.2\"]\n\n\t\t\t\tuvs.push(\n\t\t\t\t\tuv(\n\t\t\t\t\t\tresult[ 1 ], result[ 2 ]\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t} else if ( ( result = face_pattern1.exec( line ) ) !== null ) {\n\n\t\t\t\t// [\"f 1 2 3\", \"1\", \"2\", \"3\", undefined]\n\n\t\t\t\thandle_face_line(\n\t\t\t\t\t[ result[ 1 ], result[ 2 ], result[ 3 ], result[ 4 ] ]\n\t\t\t\t);\n\n\t\t\t} else if ( ( result = face_pattern2.exec( line ) ) !== null ) {\n\n\t\t\t\t// [\"f 1/1 2/2 3/3\", \" 1/1\", \"1\", \"1\", \" 2/2\", \"2\", \"2\", \" 3/3\", \"3\", \"3\", undefined, undefined, undefined]\n\t\t\t\t\n\t\t\t\thandle_face_line(\n\t\t\t\t\t[ result[ 2 ], result[ 5 ], result[ 8 ], result[ 11 ] ], //faces\n\t\t\t\t\t[ result[ 3 ], result[ 6 ], result[ 9 ], result[ 12 ] ] //uv\n\t\t\t\t);\n\n\t\t\t} else if ( ( result = face_pattern3.exec( line ) ) !== null ) {\n\n\t\t\t\t// [\"f 1/1/1 2/2/2 3/3/3\", \" 1/1/1\", \"1\", \"1\", \"1\", \" 2/2/2\", \"2\", \"2\", \"2\", \" 3/3/3\", \"3\", \"3\", \"3\", undefined, undefined, undefined, undefined]\n\n\t\t\t\thandle_face_line(\n\t\t\t\t\t[ result[ 2 ], result[ 6 ], result[ 10 ], result[ 14 ] ], //faces\n\t\t\t\t\t[ result[ 3 ], result[ 7 ], result[ 11 ], result[ 15 ] ], //uv\n\t\t\t\t\t[ result[ 4 ], result[ 8 ], result[ 12 ], result[ 16 ] ] //normal\n\t\t\t\t);\n\n\t\t\t} else if ( ( result = face_pattern4.exec( line ) ) !== null ) {\n\n\t\t\t\t// [\"f 1//1 2//2 3//3\", \" 1//1\", \"1\", \"1\", \" 2//2\", \"2\", \"2\", \" 3//3\", \"3\", \"3\", undefined, undefined, undefined]\n\n\t\t\t\thandle_face_line(\n\t\t\t\t\t[ result[ 2 ], result[ 5 ], result[ 8 ], result[ 11 ] ], //faces\n\t\t\t\t\t[ ], //uv\n\t\t\t\t\t[ result[ 3 ], result[ 6 ], result[ 9 ], result[ 12 ] ] //normal\n\t\t\t\t);\n\n\t\t\t} else if ( /^o /.test( line ) ) {\n\n\t\t\t\tgeometry = new THREE.Geometry();\n\t\t\t\tmaterial = new THREE.MeshLambertMaterial();\n\n\t\t\t\tmesh = new THREE.Mesh( geometry, material );\n\t\t\t\tmesh.name = line.substring( 2 ).trim();\n\t\t\t\tobject.add( mesh );\n\n\t\t\t} else if ( /^g /.test( line ) ) {\n\n\t\t\t\t// group\n\n\t\t\t} else if ( /^usemtl /.test( line ) ) {\n\n\t\t\t\t// material\n\n\t\t\t\tmaterial.name = line.substring( 7 ).trim();\n\n\t\t\t} else if ( /^mtllib /.test( line ) ) {\n\n\t\t\t\t// mtl file\n\n\t\t\t} else if ( /^s /.test( line ) ) {\n\n\t\t\t\t// smooth shading\n\n\t\t\t} else {\n\n\t\t\t\t// console.log( \"THREE.OBJLoader: Unhandled line \" + line );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvar children = object.children;\n\n\t\tfor ( var i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\tvar geometry = children[ i ].geometry;\n\n\t\t\tgeometry.computeFaceNormals();\n\t\t\tgeometry.computeBoundingSphere();\n\n\t\t}\n\t\t\n\t\treturn object;\n\n\t}\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Loaders/PDBLoader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Loaders/PDBLoader.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.PDBLoader = function ( manager ) {\n\n\tthis.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;\n\n};\n\nTHREE.PDBLoader.prototype = {\n\n\tconstructor: THREE.PDBLoader,\n\n\tload: function ( url, onLoad ) {\n\n\t\tvar scope = this;\n\n\t\tvar loader = new THREE.XHRLoader( scope.manager );\n\t\tloader.setCrossOrigin( this.crossOrigin );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\tvar json = scope.parsePDB( text );\n\t\t\tscope.createModel( json, onLoad );\n\n\t\t} );\n\n\t},\n\n\t// Based on CanvasMol PDB parser\n\n\tparsePDB: function ( text ) {\n\n\t\tfunction trim( text ) {\n\n\t\t\treturn text.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n\n\t\t}\n\n\t\tfunction capitalize( text ) {\n\n\t\t\treturn text.charAt(0).toUpperCase() + text.substr(1).toLowerCase();\n\n\t\t}\n\n\t\tfunction hash( s, e ) {\n\n\t\t\treturn \"s\" + Math.min( s, e ) + \"e\" + Math.max( s, e );\n\n\t\t}\n\n\t\tfunction parseBond( start, length ) {\n\n\t\t\tvar eatom = parseInt( lines[ i ].substr( start, length ) );\n\n\t\t\tif( eatom ) {\n\n\t\t\t\tvar h = hash( satom, eatom );\n\n\t\t\t\tif ( bhash[ h ] == undefined ) {\n\n\t\t\t\t\tbonds.push( [ satom - 1, eatom - 1, 1 ] );\n\t\t\t\t\tbhash[ h ] = bonds.length - 1;\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// doesn't really work as almost all PDBs\n\t\t\t\t\t// have just normal bonds appearing multiple\n\t\t\t\t\t// times instead of being double/triple bonds\n\t\t\t\t\t// bonds[bhash[h]][2] += 1;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tvar CPK = {\"h\":[255,255,255],\"he\":[217,255,255],\"li\":[204,128,255],\"be\":[194,255,0],\"b\":[255,181,181],\"c\":[144,144,144],\"n\":[48,80,248],\"o\":[255,13,13],\"f\":[144,224,80],\"ne\":[179,227,245],\"na\":[171,92,242],\"mg\":[138,255,0],\"al\":[191,166,166],\"si\":[240,200,160],\"p\":[255,128,0],\"s\":[255,255,48],\"cl\":[31,240,31],\"ar\":[128,209,227],\"k\":[143,64,212],\"ca\":[61,255,0],\"sc\":[230,230,230],\"ti\":[191,194,199],\"v\":[166,166,171],\"cr\":[138,153,199],\"mn\":[156,122,199],\"fe\":[224,102,51],\"co\":[240,144,160],\"ni\":[80,208,80],\"cu\":[200,128,51],\"zn\":[125,128,176],\"ga\":[194,143,143],\"ge\":[102,143,143],\"as\":[189,128,227],\"se\":[255,161,0],\"br\":[166,41,41],\"kr\":[92,184,209],\"rb\":[112,46,176],\"sr\":[0,255,0],\"y\":[148,255,255],\"zr\":[148,224,224],\"nb\":[115,194,201],\"mo\":[84,181,181],\"tc\":[59,158,158],\"ru\":[36,143,143],\"rh\":[10,125,140],\"pd\":[0,105,133],\"ag\":[192,192,192],\"cd\":[255,217,143],\"in\":[166,117,115],\"sn\":[102,128,128],\"sb\":[158,99,181],\"te\":[212,122,0],\"i\":[148,0,148],\"xe\":[66,158,176],\"cs\":[87,23,143],\"ba\":[0,201,0],\"la\":[112,212,255],\"ce\":[255,255,199],\"pr\":[217,255,199],\"nd\":[199,255,199],\"pm\":[163,255,199],\"sm\":[143,255,199],\"eu\":[97,255,199],\"gd\":[69,255,199],\"tb\":[48,255,199],\"dy\":[31,255,199],\"ho\":[0,255,156],\"er\":[0,230,117],\"tm\":[0,212,82],\"yb\":[0,191,56],\"lu\":[0,171,36],\"hf\":[77,194,255],\"ta\":[77,166,255],\"w\":[33,148,214],\"re\":[38,125,171],\"os\":[38,102,150],\"ir\":[23,84,135],\"pt\":[208,208,224],\"au\":[255,209,35],\"hg\":[184,184,208],\"tl\":[166,84,77],\"pb\":[87,89,97],\"bi\":[158,79,181],\"po\":[171,92,0],\"at\":[117,79,69],\"rn\":[66,130,150],\"fr\":[66,0,102],\"ra\":[0,125,0],\"ac\":[112,171,250],\"th\":[0,186,255],\"pa\":[0,161,255],\"u\":[0,143,255],\"np\":[0,128,255],\"pu\":[0,107,255],\"am\":[84,92,242],\"cm\":[120,92,227],\"bk\":[138,79,227],\"cf\":[161,54,212],\"es\":[179,31,212],\"fm\":[179,31,186],\"md\":[179,13,166],\"no\":[189,13,135],\"lr\":[199,0,102],\"rf\":[204,0,89],\"db\":[209,0,79],\"sg\":[217,0,69],\"bh\":[224,0,56],\"hs\":[230,0,46],\"mt\":[235,0,38],\n\t\t\t   \"ds\":[235,0,38],\"rg\":[235,0,38],\"cn\":[235,0,38],\"uut\":[235,0,38],\"uuq\":[235,0,38],\"uup\":[235,0,38],\"uuh\":[235,0,38],\"uus\":[235,0,38],\"uuo\":[235,0,38]};\n\n\n\t\tvar atoms = [];\n\t\tvar bonds = [];\n\t\tvar histogram = {};\n\n\t\tvar bhash = {};\n\n\t\tvar lines = text.split( \"\\n\" );\n\n\t\tvar x, y, z, e;\n\n\t\tfor( var i = 0, il = lines.length; i < il; ++ i ) {\n\n\t\t\tif( lines[i].substr(0,4)==\"ATOM\" || lines[i].substr(0,6)==\"HETATM\" ) {\n\n\t\t\t\tx = parseFloat( lines[i].substr(30,7) );\n\t\t\t\ty = parseFloat( lines[i].substr(38,7) );\n\t\t\t\tz = parseFloat( lines[i].substr(46,7) );\n\n\t\t\t\te = trim( lines[i].substr(76,2) ).toLowerCase();\n\n\t\t\t\tif ( e==\"\" ) e = trim(lines[i].substr(12,2)).toLowerCase();\n\t\t\t\tatoms.push( [ x,y,z, CPK[e], capitalize(e) ] );\n\n\t\t\t\tif (histogram[e]==undefined) histogram[e] = 1;\n\t\t\t\telse histogram[e] += 1;\n\n\t\t\t} else if(lines[i].substr(0,6)==\"CONECT\") {\n\n\t\t\t\tvar satom = parseInt( lines[i].substr(6,5) );\n\n\t\t\t\tparseBond(11,5);\n\t\t\t\tparseBond(16,5);\n\t\t\t\tparseBond(21,5);\n\t\t\t\tparseBond(26,5);\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn { \"ok\": true, \"atoms\": atoms, \"bonds\": bonds, \"histogram\": histogram };\n\n\t},\n\n\tcreateModel: function ( json, callback ) {\n\n\t\tvar scope = this,\n\t\tgeometryAtoms = new THREE.Geometry(),\n\t\tgeometryBonds = new THREE.Geometry();\n\n\t\tgeometryAtoms.elements = [];\n\n\t\tvar atoms = json.atoms;\n\t\tvar bonds = json.bonds;\n\n\t\tfor ( var i = 0; i < atoms.length; i ++ ) {\n\n\t\t\tvar atom = atoms[ i ];\n\n\t\t\tvar x = atom[ 0 ];\n\t\t\tvar y = atom[ 1 ];\n\t\t\tvar z = atom[ 2 ];\n\n\t\t\tvar position = new THREE.Vector3( x, y, z );\n\t\t\tgeometryAtoms.vertices.push( position );\n\n\t\t\tvar r = atom[ 3 ][ 0 ] / 255;\n\t\t\tvar g = atom[ 3 ][ 1 ] / 255;\n\t\t\tvar b = atom[ 3 ][ 2 ] / 255;\n\n\t\t\tvar color = new THREE.Color();\n\t\t\tcolor.setRGB( r, g, b );\n\n\t\t\tgeometryAtoms.colors.push( color );\n\n\t\t\tgeometryAtoms.elements.push( atom[ 4 ] );\n\n\t\t}\n\n\t\tfor ( var i = 0; i < bonds.length; i ++ ) {\n\n\t\t\tvar bond = bonds[ i ];\n\n\t\t\tvar start = bond[ 0 ];\n\t\t\tvar end = bond[ 1 ];\n\n\t\t\tvar vertex1 = geometryAtoms.vertices[ start ];\n\t\t\tvar vertex2 = geometryAtoms.vertices[ end ];\n\n\t\t\tgeometryBonds.vertices.push( vertex1.clone() );\n\t\t\tgeometryBonds.vertices.push( vertex2.clone() );\n\n\t\t}\n\n\t\tcallback( geometryAtoms, geometryBonds, json );\n\n\t}\n\n}\n\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Loaders/PLYLoader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Loaders/PLYLoader.js",
            "module-type": "library",
            "text": "/**\n * @author Wei Meng / http://about.me/menway\n *\n * Description: A THREE loader for PLY ASCII files (known as the Polygon File Format or the Stanford Triangle Format).\n *\n * Currently only supports ASCII encoded files.\n *\n * Limitations: ASCII decoding assumes file is UTF-8.\n *\n * Usage:\n *\tvar loader = new THREE.PLYLoader();\n *\tloader.addEventListener( 'load', function ( event ) {\n *\n *\t\tvar geometry = event.content;\n *\t\tscene.add( new THREE.Mesh( geometry ) );\n *\n *\t} );\n *\tloader.load( './models/ply/ascii/dolphins.ply' );\n */\n\n\nTHREE.PLYLoader = function () {};\n\nTHREE.PLYLoader.prototype = {\n\n\tconstructor: THREE.PLYLoader,\n\n\tload: function ( url, callback ) {\n          var func = \"THREE.PLYLoader.load\";\n\n          if (TiddlyWiki && url.match(/^tw:/)) {\n            var res = TiddlyWiki.load(url);\n            //hack.log(\"res.length = \"+res.length, hack.loader, func);\n\t    var geometry = this.parse(res);\n\t    this.dispatchEvent({type: 'load', content: geometry});\n\t    if (callback) callback(geometry);\n            hack.log(\"url: \"+url+\": loaded\", hack.loader, func);\n\t    return;\n          }\n\n\t\tvar scope = this;\n\t\tvar request = new XMLHttpRequest();\n\n\t\trequest.addEventListener( 'load', function ( event ) {\n\n\t\t\tvar geometry = scope.parse( event.target.response );\n\n\t\t\tscope.dispatchEvent( { type: 'load', content: geometry } );\n\n\t\t\tif ( callback ) callback( geometry );\n\n\t\t}, false );\n\n\t\trequest.addEventListener( 'progress', function ( event ) {\n\n\t\t\tscope.dispatchEvent( { type: 'progress', loaded: event.loaded, total: event.total } );\n\n\t\t}, false );\n\n\t\trequest.addEventListener( 'error', function () {\n\n\t\t\tscope.dispatchEvent( { type: 'error', message: 'Couldn\\'t load URL [' + url + ']' } );\n\n\t\t}, false );\n\n\t\trequest.open( 'GET', url, true );\n\t\trequest.responseType = \"arraybuffer\";\n\t\trequest.send( null );\n\n\t},\n\n\tbin2str: function (buf) {\n\n\t\tvar array_buffer = new Uint8Array(buf);\n\t\tvar str = '';\n\t\tfor(var i = 0; i < buf.byteLength; i++) {\n\t\t\tstr += String.fromCharCode(array_buffer[i]); // implicitly assumes little-endian\n\t\t}\n\n\t\treturn str;\n\n\t},\n\n\tisASCII: function( data ){\n\n\t\tvar header = this.parseHeader( this.bin2str( data ) );\n\t\t\n\t\treturn header.format === \"ascii\";\n\n\t},\n\n\tparse: function ( data ) {\n\n\t\tif ( data instanceof ArrayBuffer ) {\n\n\t\t\treturn this.isASCII( data )\n\t\t\t\t? this.parseASCII( this.bin2str( data ) )\n\t\t\t\t: this.parseBinary( data );\n\n\t\t} else {\n\n\t\t\treturn this.parseASCII( data );\n\n\t\t}\n\n\t},\n\n\tparseHeader: function ( data ) {\n\t\t\n\t\tvar patternHeader = /ply([\\s\\S]*)end_header\\n/;\n\t\tvar headerText = \"\";\n\t\tif ( ( result = patternHeader.exec( data ) ) != null ) {\n\t\t\theaderText = result [ 1 ];\n\t\t}\n\t\t\n\t\tvar header = new Object();\n\t\theader.comments = [];\n\t\theader.elements = [];\n\t\theader.headerLength = result[0].length;\n\t\t\n\t\tvar lines = headerText.split( '\\n' );\n\t\tvar currentElement = undefined;\n\t\tvar lineType, lineValues;\n\n\t\tfunction make_ply_element_property(propertValues) {\n\t\t\t\n\t\t\tvar property = Object();\n\n\t\t\tproperty.type = propertValues[0]\n\t\t\t\n\t\t\tif ( property.type === \"list\" ) {\n\t\t\t\t\n\t\t\t\tproperty.name = propertValues[3]\n\t\t\t\tproperty.countType = propertValues[1]\n\t\t\t\tproperty.itemType = propertValues[2]\n\n\t\t\t} else {\n\n\t\t\t\tproperty.name = propertValues[1]\n\n\t\t\t}\n\n\t\t\treturn property\n\t\t\t\n\t\t}\n\t\t\n\t\tfor ( var i = 0; i < lines.length; i ++ ) {\n\n\t\t\tvar line = lines[ i ];\n\t\t\tline = line.trim()\n\t\t\tif ( line === \"\" ) { continue; }\n\t\t\tlineValues = line.split( /\\s+/ );\n\t\t\tlineType = lineValues.shift()\n\t\t\tline = lineValues.join(\" \")\n\t\t\t\n\t\t\tswitch( lineType ) {\n\t\t\t\t\n\t\t\tcase \"format\":\n\n\t\t\t\theader.format = lineValues[0];\n\t\t\t\theader.version = lineValues[1];\n\n\t\t\t\tbreak;\n\n\t\t\tcase \"comment\":\n\n\t\t\t\theader.comments.push(line);\n\n\t\t\t\tbreak;\n\n\t\t\tcase \"element\":\n\n\t\t\t\tif ( !(currentElement === undefined) ) {\n\n\t\t\t\t\theader.elements.push(currentElement);\n\n\t\t\t\t}\n\n\t\t\t\tcurrentElement = Object();\n\t\t\t\tcurrentElement.name = lineValues[0];\n\t\t\t\tcurrentElement.count = parseInt( lineValues[1] );\n\t\t\t\tcurrentElement.properties = [];\n\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"property\":\n\n\t\t\t\tcurrentElement.properties.push( make_ply_element_property( lineValues ) );\n\n\t\t\t\tbreak;\n\t\t\t\t\n\n\t\t\tdefault:\n\n\t\t\t\tconsole.log(\"unhandled\", lineType, lineValues);\n\n\t\t\t}\n\n\t\t}\n\t\t\n\t\tif ( !(currentElement === undefined) ) {\n\n\t\t\theader.elements.push(currentElement);\n\n\t\t}\n\t\t\n\t\treturn header;\n\t\t\n\t},\n\n\tparseASCIINumber: function ( n, type ) {\n\t\t\n\t\tswitch( type ) {\n\t\t\t\n\t\tcase 'char': case 'uchar': case 'short': case 'ushort': case 'int': case 'uint':\n\t\tcase 'int8': case 'uint8': case 'int16': case 'uint16': case 'int32': case 'uint32':\n\n\t\t\treturn parseInt( n );\n\n\t\tcase 'float': case 'double': case 'float32': case 'float64':\n\n\t\t\treturn parseFloat( n );\n\t\t\t\n\t\t}\n\t\t\n\t},\n\n\tparseASCIIElement: function ( properties, line ) {\n\n\t\tvalues = line.split( /\\s+/ );\n\t\t\n\t\tvar element = Object();\n\t\t\n\t\tfor ( var i = 0; i < properties.length; i ++ ) {\n\t\t\t\n\t\t\tif ( properties[i].type === \"list\" ) {\n\t\t\t\t\n\t\t\t\tvar list = [];\n\t\t\t\tvar n = this.parseASCIINumber( values.shift(), properties[i].countType );\n\n\t\t\t\tfor ( j = 0; j < n; j ++ ) {\n\t\t\t\t\t\n\t\t\t\t\tlist.push( this.parseASCIINumber( values.shift(), properties[i].itemType ) );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telement[ properties[i].name ] = list;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\telement[ properties[i].name ] = this.parseASCIINumber( values.shift(), properties[i].type );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn element;\n\t\t\n\t},\n\n\tparseASCII: function ( data ) {\n\n\t\t// PLY ascii format specification, as per http://en.wikipedia.org/wiki/PLY_(file_format)\n\n\t\tvar geometry = new THREE.Geometry();\n\n\t\tvar result;\n\n\t\tvar header = this.parseHeader( data );\n\n\t\tvar patternBody = /end_header\\n([\\s\\S]*)$/;\n\t\tvar body = \"\";\n\t\tif ( ( result = patternBody.exec( data ) ) != null ) {\n\t\t\tbody = result [ 1 ];\n\t\t}\n\t\t\n\t\tvar lines = body.split( '\\n' );\n\t\tvar currentElement = 0;\n\t\tvar currentElementCount = 0;\n\t\tgeometry.useColor = false;\n\t\t\n\t\tfor ( var i = 0; i < lines.length; i ++ ) {\n\n\t\t\tvar line = lines[ i ];\n\t\t\tline = line.trim()\n\t\t\tif ( line === \"\" ) { continue; }\n\t\t\t\n\t\t\tif ( currentElementCount >= header.elements[currentElement].count ) {\n\n\t\t\t\tcurrentElement++;\n\t\t\t\tcurrentElementCount = 0;\n\n\t\t\t}\n\t\t\t\n\t\t\tvar element = this.parseASCIIElement( header.elements[currentElement].properties, line );\n\t\t\t\n\t\t\tthis.handleElement( geometry, header.elements[currentElement].name, element );\n\t\t\t\n\t\t\tcurrentElementCount++;\n\t\t\t\n\t\t}\n\n\t\treturn this.postProcess( geometry );\n\n\t},\n\n\tpostProcess: function ( geometry ) {\n\t\t\n\t\tif ( geometry.useColor ) {\n\t\t\t\n\t\t\tfor ( var i = 0; i < geometry.faces.length; i ++ ) {\n\t\t\t\t\n\t\t\t\tgeometry.faces[i].vertexColors = [\n\t\t\t\t\tgeometry.colors[geometry.faces[i].a],\n\t\t\t\t\tgeometry.colors[geometry.faces[i].b],\n\t\t\t\t\tgeometry.colors[geometry.faces[i].c]\n\t\t\t\t];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tgeometry.elementsNeedUpdate = true;\n\t\t\t\n\t\t}\n\n\t\tgeometry.computeBoundingSphere();\n\n\t\treturn geometry;\n\t\t\n\t},\n\n\thandleElement: function ( geometry, elementName, element ) {\n\t\t\n\t\tif ( elementName === \"vertex\" ) {\n\n\t\t\tgeometry.vertices.push(\n\t\t\t\tnew THREE.Vector3( element.x, element.y, element.z )\n\t\t\t);\n\t\t\t\n\t\t\tif ( 'red' in element && 'green' in element && 'blue' in element ) {\n\t\t\t\t\n\t\t\t\tgeometry.useColor = true;\n\t\t\t\t\n\t\t\t\tcolor = new THREE.Color();\n\t\t\t\tcolor.setRGB( element.red / 255.0, element.green / 255.0, element.blue / 255.0 );\n\t\t\t\tgeometry.colors.push( color );\n\t\t\t\t\n\t\t\t}\n\n\t\t} else if ( elementName === \"face\" ) {\n\n\t\t\tgeometry.faces.push(\n\t\t\t\tnew THREE.Face3( element.vertex_indices[0], element.vertex_indices[1], element.vertex_indices[2] )\n\t\t\t);\n\n\t\t}\n\t\t\n\t},\n\n\tbinaryRead: function ( dataview, at, type, little_endian ) {\n\n\t\tswitch( type ) {\n\n\t\t\t// corespondences for non-specific length types here match rply:\n\t\tcase 'int8':\t\tcase 'char':\t return [ dataview.getInt8( at ), 1 ];\n\n\t\tcase 'uint8':\t\tcase 'uchar':\t return [ dataview.getUint8( at ), 1 ];\n\n\t\tcase 'int16':\t\tcase 'short':\t return [ dataview.getInt16( at, little_endian ), 2 ];\n\n\t\tcase 'uint16':\tcase 'ushort': return [ dataview.getUint16( at, little_endian ), 2 ];\n\n\t\tcase 'int32':\t\tcase 'int':\t\t return [ dataview.getInt32( at, little_endian ), 4 ];\n\n\t\tcase 'uint32':\tcase 'uint':\t return [ dataview.getUint32( at, little_endian ), 4 ];\n\n\t\tcase 'float32': case 'float':\t return [ dataview.getFloat32( at, little_endian ), 4 ];\n\n\t\tcase 'float64': case 'double': return [ dataview.getFloat64( at, little_endian ), 8 ];\n\t\t\t\n\t\t}\n\t\t\n\t},\n\n\tbinaryReadElement: function ( dataview, at, properties, little_endian ) {\n\t\t\n\t\tvar element = Object();\n\t\tvar result, read = 0;\n\t\t\n\t\tfor ( var i = 0; i < properties.length; i ++ ) {\n\t\t \n\t\t\tif ( properties[i].type === \"list\" ) {\n\t\t\t\t\n\t\t\t\tvar list = [];\n\n\t\t\t\tresult = this.binaryRead( dataview, at+read, properties[i].countType, little_endian );\n\t\t\t\tvar n = result[0];\n\t\t\t\tread += result[1];\n\t\t\t\t\n\t\t\t\tfor ( j = 0; j < n; j ++ ) {\n\t\t\t\t\t\n\t\t\t\t\tresult = this.binaryRead( dataview, at+read, properties[i].itemType, little_endian );\n\t\t\t\t\tlist.push( result[0] );\n\t\t\t\t\tread += result[1];\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telement[ properties[i].name ] = list;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tresult = this.binaryRead( dataview, at+read, properties[i].type, little_endian );\n\t\t\t\telement[ properties[i].name ] = result[0];\n\t\t\t\tread += result[1];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn [ element, read ];\n\t\t\n\t},\n\n\tparseBinary: function ( data ) {\n\n\t\tvar geometry = new THREE.Geometry();\n\n\t\tvar header = this.parseHeader( this.bin2str( data ) );\n\t\tvar little_endian = (header.format === \"binary_little_endian\");\n\t\tvar body = new DataView( data, header.headerLength );\n\t\tvar result, loc = 0;\n\n\t\tfor ( var currentElement = 0; currentElement < header.elements.length; currentElement ++ ) {\n\t\t\t\n\t\t\tfor ( var currentElementCount = 0; currentElementCount < header.elements[currentElement].count; currentElementCount ++ ) {\n\t\t\t\n\t\t\t\tresult = this.binaryReadElement( body, loc, header.elements[currentElement].properties, little_endian );\n\t\t\t\tloc += result[1];\n\t\t\t\tvar element = result[0];\n\t\t\t\n\t\t\t\tthis.handleElement( geometry, header.elements[currentElement].name, element );\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn this.postProcess( geometry );\n\t\t\n\t}\n\n};\n\nTHREE.EventDispatcher.prototype.apply( THREE.PLYLoader.prototype );\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Loaders/SceneLoader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Loaders/SceneLoader.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.SceneLoader = function () {\n\n\tthis.onLoadStart = function () {};\n\tthis.onLoadProgress = function() {};\n\tthis.onLoadComplete = function () {};\n\n\tthis.callbackSync = function () {};\n\tthis.callbackProgress = function () {};\n\n\tthis.geometryHandlers = {};\n\tthis.hierarchyHandlers = {};\n\n\tthis.addGeometryHandler( \"ascii\", THREE.JSONLoader );\n\n};\n\nTHREE.SceneLoader.prototype = {\n\n\tconstructor: THREE.SceneLoader,\n\n\tload: function ( url, onLoad, onProgress, onError ) {\n\n\t\tvar scope = this;\n\n\t\tvar loader = new THREE.XHRLoader( scope.manager );\n\t\tloader.setCrossOrigin( this.crossOrigin );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\tscope.parse( JSON.parse( text ), onLoad, url );\n\n\t\t} );\n\n\t},\n\n\tsetCrossOrigin: function ( value ) {\n\n\t\tthis.crossOrigin = value;\n\n\t},\n\n\taddGeometryHandler: function ( typeID, loaderClass ) {\n\n\t\tthis.geometryHandlers[ typeID ] = { \"loaderClass\": loaderClass };\n\n\t},\n\n\taddHierarchyHandler: function ( typeID, loaderClass ) {\n\n\t\tthis.hierarchyHandlers[ typeID ] = { \"loaderClass\": loaderClass };\n\n\t},\n\n\tparse: function ( json, callbackFinished, url ) {\n          var func = \"THREE.SceneLoader.parse\";\n\n\t\tvar scope = this;\n\n\t\tvar urlBase = THREE.Loader.prototype.extractUrlBase( url );\n\n\t\tvar geometry, material, camera, fog,\n\t\t\ttexture, images, color,\n\t\t\tlight, hex, intensity,\n\t\t\tcounter_models, counter_textures,\n\t\t\ttotal_models, total_textures,\n\t\t\tresult;\n\n\t\tvar target_array = [];\n\n\t\tvar data = json;\n\n\t\t// async geometry loaders\n\n\t\tfor ( var typeID in this.geometryHandlers ) {\n\n\t\t\tvar loaderClass = this.geometryHandlers[ typeID ][ \"loaderClass\" ];\n\t\t\tthis.geometryHandlers[ typeID ][ \"loaderObject\" ] = new loaderClass();\n\n\t\t}\n\n\t\t// async hierachy loaders\n\n\t\tfor ( var typeID in this.hierarchyHandlers ) {\n\n\t\t\tvar loaderClass = this.hierarchyHandlers[ typeID ][ \"loaderClass\" ];\n\t\t\tthis.hierarchyHandlers[ typeID ][ \"loaderObject\" ] = new loaderClass();\n\n\t\t}\n\n\t\tcounter_models = 0;\n\t\tcounter_textures = 0;\n\n\t\tresult = {\n\n\t\t\tscene: new THREE.Scene(),\n\t\t\tgeometries: {},\n\t\t\tface_materials: {},\n\t\t\tmaterials: {},\n\t\t\ttextures: {},\n\t\t\tobjects: {},\n\t\t\tcameras: {},\n\t\t\tlights: {},\n\t\t\tfogs: {},\n\t\t\tempties: {},\n\t\t\tgroups: {}\n\n\t\t};\n\n\t\tif ( data.transform ) {\n\n\t\t\tvar position = data.transform.position,\n\t\t\t\trotation = data.transform.rotation,\n\t\t\t\tscale = data.transform.scale;\n\n\t\t\tif ( position ) {\n\n\t\t\t\tresult.scene.position.fromArray( position );\n\n\t\t\t}\n\n\t\t\tif ( rotation ) {\n\n\t\t\t\tresult.scene.rotation.fromArray( rotation );\n\n\t\t\t}\n\n\t\t\tif ( scale ) {\n\n\t\t\t\tresult.scene.scale.fromArray( scale );\n\n\t\t\t}\n\n\t\t\tif ( position || rotation || scale ) {\n\n\t\t\t\tresult.scene.updateMatrix();\n\t\t\t\tresult.scene.updateMatrixWorld();\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction get_url( source_url, url_type ) {\n\n\t\t\tif ( url_type == \"relativeToHTML\" ) {\n\n\t\t\t\treturn source_url;\n\n\t\t\t} else {\n\n\t\t\t\treturn urlBase + source_url;\n\n\t\t\t}\n\n\t\t};\n\n\t\t// toplevel loader function, delegates to handle_children\n\n\t\tfunction handle_objects() {\n                  var func = \"THREE.SceneLoader.parse.handle_objects\";\n\n\t\t\thandle_children( result.scene, data.objects );\n\n\t\t}\n\n\t\t// handle all the children from the loaded json and attach them to given parent\n\n\t\tfunction handle_children( parent, children ) {\n                  var func = \"THREE.SceneLoader.parse.handle_children\";\n                  hack.log(\"\", hack.sceneLoader, func);\n\n\t\t\tvar mat, dst, pos, rot, scl, quat;\n\n\t\t\tfor ( var objID in children ) {\n\n\t\t\t\t// check by id if child has already been handled,\n\t\t\t\t// if not, create new object\n\n\t\t\t\tvar object = result.objects[ objID ];\n\t\t\t\tvar objJSON = children[ objID ];\n\n                          hack.log(\"objID = <\"+objID+\">, object = \"+object, hack.sceneLoader, func);\n                          hack.log(\"  geometry = \"+objJSON.geometry, hack.sceneLoader, func);\n                          hack.log(\"  material = \"+objJSON.material, hack.sceneLoader, func);\n\n\t\t\t\tif ( object === undefined ) {\n\n\t\t\t\t\t// meshes\n\n\t\t\t\t\tif ( objJSON.type && ( objJSON.type in scope.hierarchyHandlers ) ) {\n\n\t\t\t\t\t\tif ( objJSON.loading === undefined ) {\n\n\t\t\t\t\t\t\tvar reservedTypes = {\n\t\t\t\t\t\t\t\t\"type\": 1, \"url\": 1, \"material\": 1,\n\t\t\t\t\t\t\t\t\"position\": 1, \"rotation\": 1, \"scale\" : 1,\n\t\t\t\t\t\t\t\t\"visible\": 1, \"children\": 1, \"userData\": 1,\n\t\t\t\t\t\t\t\t\"skin\": 1, \"morph\": 1, \"mirroredLoop\": 1, \"duration\": 1\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tvar loaderParameters = {};\n\n\t\t\t\t\t\t\tfor ( var parType in objJSON ) {\n\n\t\t\t\t\t\t\t\tif ( ! ( parType in reservedTypes ) ) {\n\n\t\t\t\t\t\t\t\t\tloaderParameters[ parType ] = objJSON[ parType ];\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tmaterial = result.materials[ objJSON.material ];\n\n\t\t\t\t\t\t\tobjJSON.loading = true;\n\n\t\t\t\t\t\t\tvar loader = scope.hierarchyHandlers[ objJSON.type ][ \"loaderObject\" ];\n\n\t\t\t\t\t\t\t// ColladaLoader\n\n\t\t\t\t\t\t\tif ( loader.options ) {\n\n\t\t\t\t\t\t\t\tloader.load( get_url( objJSON.url, data.urlBaseType ), create_callback_hierachy( objID, parent, material, objJSON ) );\n\n\t\t\t\t\t\t\t// UTF8Loader\n\t\t\t\t\t\t\t// OBJLoader\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tloader.load( get_url( objJSON.url, data.urlBaseType ), create_callback_hierachy( objID, parent, material, objJSON ), loaderParameters );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else if ( objJSON.geometry !== undefined ) {\n\n\t\t\t\t\t\tgeometry = result.geometries[ objJSON.geometry ];\n\n\t\t\t\t\t\t// geometry already loaded\n\n\t\t\t\t\t\tif ( geometry ) {\n\n\t\t\t\t\t\t\tvar needsTangents = false;\n\n\t\t\t\t\t\t\tmaterial = result.materials[ objJSON.material ];\n\t\t\t\t\t\t\tneedsTangents = material instanceof THREE.ShaderMaterial;\n\n\t\t\t\t\t\t\tpos = objJSON.position;\n\t\t\t\t\t\t\trot = objJSON.rotation;\n\t\t\t\t\t\t\tscl = objJSON.scale;\n\t\t\t\t\t\t\tmat = objJSON.matrix;\n\t\t\t\t\t\t\tquat = objJSON.quaternion;\n\n\t\t\t\t\t\t\t// use materials from the model file\n\t\t\t\t\t\t\t// if there is no material specified in the object\n\n\t\t\t\t\t\t\tif ( ! objJSON.material ) {\n\n\t\t\t\t\t\t\t\tmaterial = new THREE.MeshFaceMaterial( result.face_materials[ objJSON.geometry ] );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// use materials from the model file\n\t\t\t\t\t\t\t// if there is just empty face material\n\t\t\t\t\t\t\t// (must create new material as each model has its own face material)\n\n\t\t\t\t\t\t\tif ( ( material instanceof THREE.MeshFaceMaterial ) && material.materials.length === 0 ) {\n\n\t\t\t\t\t\t\t\tmaterial = new THREE.MeshFaceMaterial( result.face_materials[ objJSON.geometry ] );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( material instanceof THREE.MeshFaceMaterial ) {\n\n\t\t\t\t\t\t\t\tfor ( var i = 0; i < material.materials.length; i ++ ) {\n\n\t\t\t\t\t\t\t\t\tneedsTangents = needsTangents || ( material.materials[ i ] instanceof THREE.ShaderMaterial );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( needsTangents ) {\n\n\t\t\t\t\t\t\t\tgeometry.computeTangents();\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( objJSON.skin ) {\n\n\t\t\t\t\t\t\t\tobject = new THREE.SkinnedMesh( geometry, material );\n\n\t\t\t\t\t\t\t} else if ( objJSON.morph ) {\n\n\t\t\t\t\t\t\t\tobject = new THREE.MorphAnimMesh( geometry, material );\n\n\t\t\t\t\t\t\t\tif ( objJSON.duration !== undefined ) {\n\n\t\t\t\t\t\t\t\t\tobject.duration = objJSON.duration;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( objJSON.time !== undefined ) {\n\n\t\t\t\t\t\t\t\t\tobject.time = objJSON.time;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( objJSON.mirroredLoop !== undefined ) {\n\n\t\t\t\t\t\t\t\t\tobject.mirroredLoop = objJSON.mirroredLoop;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( material.morphNormals ) {\n\n\t\t\t\t\t\t\t\t\tgeometry.computeMorphNormals();\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\n\t\t\t\t\t\t\t\tobject = new THREE.Mesh( geometry, material );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tobject.name = objID;\n\n\t\t\t\t\t\t\tif ( mat ) {\n\n\t\t\t\t\t\t\t\tobject.matrixAutoUpdate = false;\n\t\t\t\t\t\t\t\tobject.matrix.set(\n\t\t\t\t\t\t\t\t\tmat[0],  mat[1],  mat[2],  mat[3],\n\t\t\t\t\t\t\t\t\tmat[4],  mat[5],  mat[6],  mat[7],\n\t\t\t\t\t\t\t\t\tmat[8],  mat[9],  mat[10], mat[11],\n\t\t\t\t\t\t\t\t\tmat[12], mat[13], mat[14], mat[15]\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tobject.position.fromArray( pos );\n\n\t\t\t\t\t\t\t\tif ( quat ) {\n\n\t\t\t\t\t\t\t\t\tobject.quaternion.fromArray( quat );\n\n\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\tobject.rotation.fromArray( rot );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tobject.scale.fromArray( scl );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tobject.visible = objJSON.visible;\n\t\t\t\t\t\t\tobject.castShadow = objJSON.castShadow;\n\t\t\t\t\t\t\tobject.receiveShadow = objJSON.receiveShadow;\n\n\t\t\t\t\t\t\tparent.add( object );\n\n\t\t\t\t\t\t\tresult.objects[ objID ] = object;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t// lights\n\n\t\t\t\t\t} else if ( objJSON.type === \"AmbientLight\" || objJSON.type === \"PointLight\" ||\n\t\t\t\t\t\tobjJSON.type === \"DirectionalLight\" || objJSON.type === \"SpotLight\" ||\n\t\t\t\t\t\tobjJSON.type === \"HemisphereLight\" || objJSON.type === \"AreaLight\" ) {\n\n\t\t\t\t\t\tvar color = objJSON.color;\n\t\t\t\t\t\tvar intensity = objJSON.intensity;\n\t\t\t\t\t\tvar distance = objJSON.distance;\n\t\t\t\t\t\tvar position = objJSON.position;\n\t\t\t\t\t\tvar rotation = objJSON.rotation;\n\n\t\t\t\t\t\tswitch ( objJSON.type ) {\n\n\t\t\t\t\t\t\tcase 'AmbientLight':\n\t\t\t\t\t\t\t\tlight = new THREE.AmbientLight( color );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'PointLight':\n\t\t\t\t\t\t\t\tlight = new THREE.PointLight( color, intensity, distance );\n\t\t\t\t\t\t\t\tlight.position.fromArray( position );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'DirectionalLight':\n\t\t\t\t\t\t\t\tlight = new THREE.DirectionalLight( color, intensity );\n\t\t\t\t\t\t\t\tlight.position.fromArray( objJSON.direction );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'SpotLight':\n\t\t\t\t\t\t\t\tlight = new THREE.SpotLight( color, intensity, distance, 1 );\n\t\t\t\t\t\t\t\tlight.angle = objJSON.angle;\n\t\t\t\t\t\t\t\tlight.position.fromArray( position );\n\t\t\t\t\t\t\t\tlight.target.set( position[ 0 ], position[ 1 ] - distance, position[ 2 ] );\n\t\t\t\t\t\t\t\tlight.target.applyEuler( new THREE.Euler( rotation[ 0 ], rotation[ 1 ], rotation[ 2 ], 'XYZ' ) );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'HemisphereLight':\n\t\t\t\t\t\t\t\tlight = new THREE.DirectionalLight( color, intensity, distance );\n\t\t\t\t\t\t\t\tlight.target.set( position[ 0 ], position[ 1 ] - distance, position[ 2 ] );\n\t\t\t\t\t\t\t\tlight.target.applyEuler( new THREE.Euler( rotation[ 0 ], rotation[ 1 ], rotation[ 2 ], 'XYZ' ) );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'AreaLight':\n\t\t\t\t\t\t\t\tlight = new THREE.AreaLight(color, intensity);\n\t\t\t\t\t\t\t\tlight.position.fromArray( position );\n\t\t\t\t\t\t\t\tlight.width = objJSON.size;\n\t\t\t\t\t\t\t\tlight.height = objJSON.size_y;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tparent.add( light );\n\n\t\t\t\t\t\tlight.name = objID;\n\t\t\t\t\t\tresult.lights[ objID ] = light;\n\t\t\t\t\t\tresult.objects[ objID ] = light;\n\n\t\t\t\t\t// cameras\n\n\t\t\t\t\t} else if ( objJSON.type === \"PerspectiveCamera\" || objJSON.type === \"OrthographicCamera\" ) {\n\n\t\t\t\t\t\tpos = objJSON.position;\n\t\t\t\t\t\trot = objJSON.rotation;\n\t\t\t\t\t\tquat = objJSON.quaternion;\n\n\t\t\t\t\t\tif ( objJSON.type === \"PerspectiveCamera\" ) {\n\n\t\t\t\t\t\t\tcamera = new THREE.PerspectiveCamera( objJSON.fov, objJSON.aspect, objJSON.near, objJSON.far );\n\n\t\t\t\t\t\t} else if ( objJSON.type === \"OrthographicCamera\" ) {\n\n\t\t\t\t\t\t\tcamera = new THREE.OrthographicCamera( objJSON.left, objJSON.right, objJSON.top, objJSON.bottom, objJSON.near, objJSON.far );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcamera.name = objID;\n\t\t\t\t\t\tcamera.position.fromArray( pos );\n\n\t\t\t\t\t\tif ( quat !== undefined ) {\n\n\t\t\t\t\t\t\tcamera.quaternion.fromArray( quat );\n\n\t\t\t\t\t\t} else if ( rot !== undefined ) {\n\n\t\t\t\t\t\t\tcamera.rotation.fromArray( rot );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tparent.add( camera );\n\n\t\t\t\t\t\tresult.cameras[ objID ] = camera;\n\t\t\t\t\t\tresult.objects[ objID ] = camera;\n\n\t\t\t\t\t// pure Object3D\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tpos = objJSON.position;\n\t\t\t\t\t\trot = objJSON.rotation;\n\t\t\t\t\t\tscl = objJSON.scale;\n\t\t\t\t\t\tquat = objJSON.quaternion;\n\n\t\t\t\t\t\tobject = new THREE.Object3D();\n\t\t\t\t\t\tobject.name = objID;\n\t\t\t\t\t\tobject.position.fromArray( pos );\n\n\t\t\t\t\t\tif ( quat ) {\n\n\t\t\t\t\t\t\tobject.quaternion.fromArray( quat );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tobject.rotation.fromArray( rot );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tobject.scale.fromArray( scl );\n\t\t\t\t\t\tobject.visible = ( objJSON.visible !== undefined ) ? objJSON.visible : false;\n\n\t\t\t\t\t\tparent.add( object );\n\n\t\t\t\t\t\tresult.objects[ objID ] = object;\n\t\t\t\t\t\tresult.empties[ objID ] = object;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( object ) {\n\n\t\t\t\t\t\tif ( objJSON.userData !== undefined ) {\n\n\t\t\t\t\t\t\tfor ( var key in objJSON.userData ) {\n\n\t\t\t\t\t\t\t\tvar value = objJSON.userData[ key ];\n\t\t\t\t\t\t\t\tobject.userData[ key ] = value;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( objJSON.groups !== undefined ) {\n\n\t\t\t\t\t\t\tfor ( var i = 0; i < objJSON.groups.length; i ++ ) {\n\n\t\t\t\t\t\t\t\tvar groupID = objJSON.groups[ i ];\n\n\t\t\t\t\t\t\t\tif ( result.groups[ groupID ] === undefined ) {\n\n\t\t\t\t\t\t\t\t\tresult.groups[ groupID ] = [];\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tresult.groups[ groupID ].push( objID );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( object !== undefined && objJSON.children !== undefined ) {\n\n\t\t\t\t\thandle_children( object, objJSON.children );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction handle_mesh( geo, mat, id ) {\n                  var func = \"THREE.SceneLoader.parse.handle_mesh\";\n                  hack.log(\"id = \"+id+\", mat = \"+mat, hack.sceneLoader, func);\n\n\t\t\tresult.geometries[ id ] = geo;\n\t\t        result.face_materials[ id ] = mat;\n\t\t\thandle_objects();\n\n\t\t};\n\n\t\tfunction handle_hierarchy( node, id, parent, material, obj ) {\n\n\t\t\tvar p = obj.position;\n\t\t\tvar r = obj.rotation;\n\t\t\tvar q = obj.quaternion;\n\t\t\tvar s = obj.scale;\n\n\t\t\tnode.position.fromArray( p );\n\n\t\t\tif ( q ) {\n\n\t\t\t\tnode.quaternion.fromArray( q );\n\n\t\t\t} else {\n\n\t\t\t\tnode.rotation.fromArray( r );\n\n\t\t\t}\n\n\t\t\tnode.scale.fromArray( s );\n\n\t\t\t// override children materials\n\t\t\t// if object material was specified in JSON explicitly\n\n\t\t\tif ( material ) {\n\n\t\t\t\tnode.traverse( function ( child ) {\n\n\t\t\t\t\tchild.material = material;\n\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t\t// override children visibility\n\t\t\t// with root node visibility as specified in JSON\n\n\t\t\tvar visible = ( obj.visible !== undefined ) ? obj.visible : true;\n\n\t\t\tnode.traverse( function ( child ) {\n\n\t\t\t\tchild.visible = visible;\n\n\t\t\t} );\n\n\t\t\tparent.add( node );\n\n\t\t\tnode.name = id;\n\n\t\t\tresult.objects[ id ] = node;\n\t\t\thandle_objects();\n\n\t\t};\n\n\t\tfunction create_callback_geometry( id ) {\n\n\t\t\treturn function ( geo, mat ) {\n                          var func = \"THREE.SceneLoader.parse.create_callback_geometry.function\";\n \n\t\t\t\tgeo.name = id;\n\n                                handle_mesh( geo, mat, id );\n\n\t\t\t\tcounter_models -= 1;\n\n\t\t\t\tscope.onLoadComplete();\n\n\t\t\t\tasync_callback_gate();\n\n\t\t\t}\n\n\t\t};\n\n          if (TiddlyWiki) {\n\t    function create_callback_geometry_for_tiddlywiki_url(id) {\n\t      return function (geo, mat) {\n                var func = \"THREE.SceneLoader.parse.create_callback_geometry_for_tiddlywiki_url.function\";\n                hack.log(\"id = \"+id, hack.sceneLoader, func);\n\t\tgeo.name = id;\n\n                // Simply register geometry but don't try to handle all objects because\n                // it's too early in the load process.\n                // It seems there is a bug in the load process algorithm. It\n                // assumes that most of objecs are already loaded when the current geometry\n                // ends it's loading, because this callback is always called by a\n                // geometryHandler which loads a remote URL. It's not the case with\n                // TiddlyWiki URL : loading is immediate !\n \t\tresult.geometries[ id ] = geo;\n\t\tresult.face_materials[ id ] = mat;\n\t\t\n                counter_models -= 1;\n\t\tscope.onLoadComplete();\n\t\tasync_callback_gate();\n\t      }\n\t    };\n          }\n\n\t\tfunction create_callback_hierachy( id, parent, material, obj ) {\n\n\t\t\treturn function ( event ) {\n\n\t\t\t\tvar result;\n\n\t\t\t\t// loaders which use EventDispatcher\n\n\t\t\t\tif ( event.content ) {\n\n\t\t\t\t\tresult = event.content;\n\n\t\t\t\t// ColladaLoader\n\n\t\t\t\t} else if ( event.dae ) {\n\n\t\t\t\t\tresult = event.scene;\n\n\n\t\t\t\t// UTF8Loader\n\n\t\t\t\t} else {\n\n\t\t\t\t\tresult = event;\n\n\t\t\t\t}\n\n\t\t\t\thandle_hierarchy( result, id, parent, material, obj );\n\n\t\t\t\tcounter_models -= 1;\n\n\t\t\t\tscope.onLoadComplete();\n\n\t\t\t\tasync_callback_gate();\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction create_callback_embed( id ) {\n\n\t\t\treturn function ( geo, mat ) {\n\n\t\t\t\tgeo.name = id;\n\n\t\t\t\tresult.geometries[ id ] = geo;\n\t\t\t\tresult.face_materials[ id ] = mat;\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction async_callback_gate() {\n\n\t\t\tvar progress = {\n\n\t\t\t\ttotalModels : total_models,\n\t\t\t\ttotalTextures : total_textures,\n\t\t\t\tloadedModels : total_models - counter_models,\n\t\t\t\tloadedTextures : total_textures - counter_textures\n\n\t\t\t};\n\n\t\t\tscope.callbackProgress( progress, result );\n\n\t\t\tscope.onLoadProgress();\n\n\t\t\tif ( counter_models === 0 && counter_textures === 0 ) {\n\n\t\t\t\tfinalize();\n\t\t\t\tcallbackFinished( result );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction finalize() {\n\n\t\t\t// take care of targets which could be asynchronously loaded objects\n\n\t\t\tfor ( var i = 0; i < target_array.length; i ++ ) {\n\n\t\t\t\tvar ta = target_array[ i ];\n\n\t\t\t\tvar target = result.objects[ ta.targetName ];\n\n\t\t\t\tif ( target ) {\n\n\t\t\t\t\tta.object.target = target;\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// if there was error and target of specified name doesn't exist in the scene file\n\t\t\t\t\t// create instead dummy target\n\t\t\t\t\t// (target must be added to scene explicitly as parent is already added)\n\n\t\t\t\t\tta.object.target = new THREE.Object3D();\n\t\t\t\t\tresult.scene.add( ta.object.target );\n\n\t\t\t\t}\n\n\t\t\t\tta.object.target.userData.targetInverse = ta.object;\n\n\t\t\t}\n\n\t\t};\n\n\t\tvar callbackTexture = function ( count ) {\n\n\t\t\tcounter_textures -= count;\n\t\t\tasync_callback_gate();\n\n\t\t\tscope.onLoadComplete();\n\n\t\t};\n\n\t\t// must use this instead of just directly calling callbackTexture\n\t\t// because of closure in the calling context loop\n\n\t\tvar generateTextureCallback = function ( count ) {\n\n\t\t\treturn function () {\n\n\t\t\t\tcallbackTexture( count );\n\n\t\t\t};\n\n\t\t};\n\n\t\tfunction traverse_json_hierarchy( objJSON, callback ) {\n\n\t\t\tcallback( objJSON );\n\n\t\t\tif ( objJSON.children !== undefined ) {\n\n\t\t\t\tfor ( var objChildID in objJSON.children ) {\n\n\t\t\t\t\ttraverse_json_hierarchy( objJSON.children[ objChildID ], callback );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t\t// first go synchronous elements\n\n\t\t// fogs\n\n\t\tvar fogID, fogJSON;\n\n\t\tfor ( fogID in data.fogs ) {\n\n\t\t\tfogJSON = data.fogs[ fogID ];\n\n\t\t\tif ( fogJSON.type === \"linear\" ) {\n\n\t\t\t\tfog = new THREE.Fog( 0x000000, fogJSON.near, fogJSON.far );\n\n\t\t\t} else if ( fogJSON.type === \"exp2\" ) {\n\n\t\t\t\tfog = new THREE.FogExp2( 0x000000, fogJSON.density );\n\n\t\t\t}\n\n\t\t\tcolor = fogJSON.color;\n\t\t\tfog.color.setRGB( color[0], color[1], color[2] );\n\n\t\t\tresult.fogs[ fogID ] = fog;\n\n\t\t}\n\n\t\t// now come potentially asynchronous elements\n\n\t\t// geometries\n\n\t\t// count how many geometries will be loaded asynchronously\n\n\t\tvar geoID, geoJSON;\n\n\t\tfor ( geoID in data.geometries ) {\n\n\t\t\tgeoJSON = data.geometries[ geoID ];\n\n\t\t\tif ( geoJSON.type in this.geometryHandlers ) {\n\n\t\t\t\tcounter_models += 1;\n\n\t\t\t\tscope.onLoadStart();\n\n\t\t\t}\n\n\t\t}\n\n\t\t// count how many hierarchies will be loaded asynchronously\n\n\t\tfor ( var objID in data.objects ) {\n\n\t\t\ttraverse_json_hierarchy( data.objects[ objID ], function ( objJSON ) {\n\n\t\t\t\tif ( objJSON.type && ( objJSON.type in scope.hierarchyHandlers ) ) {\n\n\t\t\t\t\tcounter_models += 1;\n\n\t\t\t\t\tscope.onLoadStart();\n\n\t\t\t\t}\n\n\t\t\t});\n\n\t\t}\n\n\t\ttotal_models = counter_models;\n\n\t\tfor ( geoID in data.geometries ) {\n\n\t\t\tgeoJSON = data.geometries[ geoID ];\n\n\t\t\tif ( geoJSON.type === \"cube\" ) {\n\n\t\t\t\tgeometry = new THREE.BoxGeometry( geoJSON.width, geoJSON.height, geoJSON.depth, geoJSON.widthSegments, geoJSON.heightSegments, geoJSON.depthSegments );\n\t\t\t\tgeometry.name = geoID;\n\t\t\t\tresult.geometries[ geoID ] = geometry;\n\n\t\t\t} else if ( geoJSON.type === \"plane\" ) {\n\n\t\t\t\tgeometry = new THREE.PlaneGeometry( geoJSON.width, geoJSON.height, geoJSON.widthSegments, geoJSON.heightSegments );\n\t\t\t\tgeometry.name = geoID;\n\t\t\t\tresult.geometries[ geoID ] = geometry;\n\n\t\t\t} else if ( geoJSON.type === \"sphere\" ) {\n\n\t\t\t\tgeometry = new THREE.SphereGeometry( geoJSON.radius, geoJSON.widthSegments, geoJSON.heightSegments );\n\t\t\t\tgeometry.name = geoID;\n\t\t\t\tresult.geometries[ geoID ] = geometry;\n\n\t\t\t} else if ( geoJSON.type === \"cylinder\" ) {\n\n\t\t\t\tgeometry = new THREE.CylinderGeometry( geoJSON.topRad, geoJSON.botRad, geoJSON.height, geoJSON.radSegs, geoJSON.heightSegs );\n\t\t\t\tgeometry.name = geoID;\n\t\t\t\tresult.geometries[ geoID ] = geometry;\n\n\t\t\t} else if ( geoJSON.type === \"torus\" ) {\n\n\t\t\t\tgeometry = new THREE.TorusGeometry( geoJSON.radius, geoJSON.tube, geoJSON.segmentsR, geoJSON.segmentsT );\n\t\t\t\tgeometry.name = geoID;\n\t\t\t\tresult.geometries[ geoID ] = geometry;\n\n\t\t\t} else if ( geoJSON.type === \"icosahedron\" ) {\n\n\t\t\t\tgeometry = new THREE.IcosahedronGeometry( geoJSON.radius, geoJSON.subdivisions );\n\t\t\t\tgeometry.name = geoID;\n\t\t\t\tresult.geometries[ geoID ] = geometry;\n\n\t\t\t} else if ( geoJSON.type in this.geometryHandlers ) {\n\n\t\t\t\tvar loaderParameters = {};\n\n\t\t\t\tfor ( var parType in geoJSON ) {\n\n\t\t\t\t\tif ( parType !== \"type\" && parType !== \"url\" ) {\n\n\t\t\t\t\t\tloaderParameters[ parType ] = geoJSON[ parType ];\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tvar loader = this.geometryHandlers[ geoJSON.type ][ \"loaderObject\" ];\n                          hack.log(\"geoJSON.type = \"+geoJSON.type+\", geoJSON.url = \"+geoJSON.url, hack.sceneLoader, func);\n                          if (TiddlyWiki && geoJSON.url.match(/^tw:/)) {\n\t\t\t      loader.load( get_url( geoJSON.url, data.urlBaseType ), create_callback_geometry_for_tiddlywiki_url( geoID ), loaderParameters );\n                          } else\n\t\t\t      loader.load( get_url( geoJSON.url, data.urlBaseType ), create_callback_geometry( geoID ), loaderParameters );\n\n\t\t\t} else if ( geoJSON.type === \"embedded\" ) {\n\n\t\t\t\tvar modelJson = data.embeds[ geoJSON.id ],\n\t\t\t\t\ttexture_path = \"\";\n\n\t\t\t\t// pass metadata along to jsonLoader so it knows the format version\n\n\t\t\t\tmodelJson.metadata = data.metadata;\n\n\t\t\t\tif ( modelJson ) {\n\n\t\t\t\t\tvar jsonLoader = this.geometryHandlers[ \"ascii\" ][ \"loaderObject\" ];\n\t\t\t\t\tvar model = jsonLoader.parse( modelJson, texture_path );\n\t\t\t\t\tcreate_callback_embed( geoID )( model.geometry, model.materials );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t// textures\n\n\t\t// count how many textures will be loaded asynchronously\n\n\t\tvar textureID, textureJSON;\n\n\t\tfor ( textureID in data.textures ) {\n\n\t\t\ttextureJSON = data.textures[ textureID ];\n\n\t\t\tif ( textureJSON.url instanceof Array ) {\n\n\t\t\t\tcounter_textures += textureJSON.url.length;\n\n\t\t\t\tfor( var n = 0; n < textureJSON.url.length; n ++ ) {\n\n\t\t\t\t\tscope.onLoadStart();\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tcounter_textures += 1;\n\n\t\t\t\tscope.onLoadStart();\n\n\t\t\t}\n\n\t\t}\n\n\t\ttotal_textures = counter_textures;\n\n\t\tfor ( textureID in data.textures ) {\n\n\t\t\ttextureJSON = data.textures[ textureID ];\n\n\t\t\tif ( textureJSON.mapping !== undefined && THREE[ textureJSON.mapping ] !== undefined ) {\n\n\t\t\t\ttextureJSON.mapping = new THREE[ textureJSON.mapping ]();\n\n\t\t\t}\n\n\t\t\tvar texture;\n\n\t\t\tif ( textureJSON.url instanceof Array ) {\n\n\t\t\t\tvar count = textureJSON.url.length;\n\t\t\t\tvar url_array = [];\n\n\t\t\t\tfor ( var i = 0; i < count; i ++ ) {\n\n\t\t\t\t\turl_array[ i ] = get_url( textureJSON.url[ i ], data.urlBaseType );\n\n\t\t\t\t}\n\n\t\t\t\tvar loader = THREE.Loader.Handlers.get( url_array[ 0 ] );\n\n\t\t\t\tif ( loader !== null ) {\n\n\t\t\t\t\ttexture = loader.load( url_array, generateTextureCallback( count ) );\n\t\t\t\t\ttexture.mapping = textureJSON.mapping;\n\n\t\t\t\t} else {\n\n\t\t\t\t\ttexture = THREE.ImageUtils.loadTextureCube( url_array, textureJSON.mapping, generateTextureCallback( count ) );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tvar fullUrl = get_url( textureJSON.url, data.urlBaseType );\n\t\t\t\tvar textureCallback = generateTextureCallback( 1 );\n\n\t\t\t\tvar loader = THREE.Loader.Handlers.get( fullUrl );\n\n\t\t\t\tif ( loader !== null ) {\n\n\t\t\t\t\ttexture = loader.load( fullUrl, textureCallback );\n\n\t\t\t\t} else {\n\n\t\t\t\t\ttexture = new THREE.Texture();\n\t\t\t\t\tloader = new THREE.ImageLoader();\n\t\t\t\t\t\n\t\t\t\t\t( function ( texture ) {\n\n\t\t\t\t\t\tloader.load( fullUrl, function ( image ) {\n\n\t\t\t\t\t\t\ttexture.image = image;\n\t\t\t\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\t\t\t\ttextureCallback();\n\n\t\t\t\t\t\t} );\n\t\t\t\t\t\n\t\t\t\t\t} )( texture )\n\t\t\t\t\t\n\n\t\t\t\t}\n\n\t\t\t\ttexture.mapping = textureJSON.mapping;\n\n\t\t\t\tif ( THREE[ textureJSON.minFilter ] !== undefined )\n\t\t\t\t\ttexture.minFilter = THREE[ textureJSON.minFilter ];\n\n\t\t\t\tif ( THREE[ textureJSON.magFilter ] !== undefined )\n\t\t\t\t\ttexture.magFilter = THREE[ textureJSON.magFilter ];\n\n\t\t\t\tif ( textureJSON.anisotropy ) texture.anisotropy = textureJSON.anisotropy;\n\n\t\t\t\tif ( textureJSON.repeat ) {\n\n\t\t\t\t\ttexture.repeat.set( textureJSON.repeat[ 0 ], textureJSON.repeat[ 1 ] );\n\n\t\t\t\t\tif ( textureJSON.repeat[ 0 ] !== 1 ) texture.wrapS = THREE.RepeatWrapping;\n\t\t\t\t\tif ( textureJSON.repeat[ 1 ] !== 1 ) texture.wrapT = THREE.RepeatWrapping;\n\n\t\t\t\t}\n\n\t\t\t\tif ( textureJSON.offset ) {\n\n\t\t\t\t\ttexture.offset.set( textureJSON.offset[ 0 ], textureJSON.offset[ 1 ] );\n\n\t\t\t\t}\n\n\t\t\t\t// handle wrap after repeat so that default repeat can be overriden\n\n\t\t\t\tif ( textureJSON.wrap ) {\n\n\t\t\t\t\tvar wrapMap = {\n\t\t\t\t\t\t\"repeat\": THREE.RepeatWrapping,\n\t\t\t\t\t\t\"mirror\": THREE.MirroredRepeatWrapping\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( wrapMap[ textureJSON.wrap[ 0 ] ] !== undefined ) texture.wrapS = wrapMap[ textureJSON.wrap[ 0 ] ];\n\t\t\t\t\tif ( wrapMap[ textureJSON.wrap[ 1 ] ] !== undefined ) texture.wrapT = wrapMap[ textureJSON.wrap[ 1 ] ];\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tresult.textures[ textureID ] = texture;\n\n\t\t}\n\n\t\t// materials\n\n\t\tvar matID, matJSON;\n\t\tvar parID;\n\n\t\tfor ( matID in data.materials ) {\n\n\t\t\tmatJSON = data.materials[ matID ];\n\n\t\t\tfor ( parID in matJSON.parameters ) {\n\n\t\t\t\tif ( parID === \"envMap\" || parID === \"map\" || parID === \"lightMap\" || parID === \"bumpMap\" ) {\n\n\t\t\t\t\tmatJSON.parameters[ parID ] = result.textures[ matJSON.parameters[ parID ] ];\n\n\t\t\t\t} else if ( parID === \"shading\" ) {\n\n\t\t\t\t\tmatJSON.parameters[ parID ] = ( matJSON.parameters[ parID ] === \"flat\" ) ? THREE.FlatShading : THREE.SmoothShading;\n\n\t\t\t\t} else if ( parID === \"side\" ) {\n\n\t\t\t\t\tif ( matJSON.parameters[ parID ] == \"double\" ) {\n\n\t\t\t\t\t\tmatJSON.parameters[ parID ] = THREE.DoubleSide;\n\n\t\t\t\t\t} else if ( matJSON.parameters[ parID ] == \"back\" ) {\n\n\t\t\t\t\t\tmatJSON.parameters[ parID ] = THREE.BackSide;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tmatJSON.parameters[ parID ] = THREE.FrontSide;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( parID === \"blending\" ) {\n\n\t\t\t\t\tmatJSON.parameters[ parID ] = matJSON.parameters[ parID ] in THREE ? THREE[ matJSON.parameters[ parID ] ] : THREE.NormalBlending;\n\n\t\t\t\t} else if ( parID === \"combine\" ) {\n\n\t\t\t\t\tmatJSON.parameters[ parID ] = matJSON.parameters[ parID ] in THREE ? THREE[ matJSON.parameters[ parID ] ] : THREE.MultiplyOperation;\n\n\t\t\t\t} else if ( parID === \"vertexColors\" ) {\n\n\t\t\t\t\tif ( matJSON.parameters[ parID ] == \"face\" ) {\n\n\t\t\t\t\t\tmatJSON.parameters[ parID ] = THREE.FaceColors;\n\n\t\t\t\t\t// default to vertex colors if \"vertexColors\" is anything else face colors or 0 / null / false\n\n\t\t\t\t\t} else if ( matJSON.parameters[ parID ] ) {\n\n\t\t\t\t\t\tmatJSON.parameters[ parID ] = THREE.VertexColors;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( parID === \"wrapRGB\" ) {\n\n\t\t\t\t\tvar v3 = matJSON.parameters[ parID ];\n\t\t\t\t\tmatJSON.parameters[ parID ] = new THREE.Vector3( v3[ 0 ], v3[ 1 ], v3[ 2 ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( matJSON.parameters.opacity !== undefined && matJSON.parameters.opacity < 1.0 ) {\n\n\t\t\t\tmatJSON.parameters.transparent = true;\n\n\t\t\t}\n\n\t\t\tif ( matJSON.parameters.normalMap ) {\n\n\t\t\t\tvar shader = THREE.ShaderLib[ \"normalmap\" ];\n\t\t\t\tvar uniforms = THREE.UniformsUtils.clone( shader.uniforms );\n\n\t\t\t\tvar diffuse = matJSON.parameters.color;\n\t\t\t\tvar specular = matJSON.parameters.specular;\n\t\t\t\tvar ambient = matJSON.parameters.ambient;\n\t\t\t\tvar shininess = matJSON.parameters.shininess;\n\n\t\t\t\tuniforms[ \"tNormal\" ].value = result.textures[ matJSON.parameters.normalMap ];\n\n\t\t\t\tif ( matJSON.parameters.normalScale ) {\n\n\t\t\t\t\tuniforms[ \"uNormalScale\" ].value.set( matJSON.parameters.normalScale[ 0 ], matJSON.parameters.normalScale[ 1 ] );\n\n\t\t\t\t}\n\n\t\t\t\tif ( matJSON.parameters.map ) {\n\n\t\t\t\t\tuniforms[ \"tDiffuse\" ].value = matJSON.parameters.map;\n\t\t\t\t\tuniforms[ \"enableDiffuse\" ].value = true;\n\n\t\t\t\t}\n\n\t\t\t\tif ( matJSON.parameters.envMap ) {\n\n\t\t\t\t\tuniforms[ \"tCube\" ].value = matJSON.parameters.envMap;\n\t\t\t\t\tuniforms[ \"enableReflection\" ].value = true;\n\t\t\t\t\tuniforms[ \"reflectivity\" ].value = matJSON.parameters.reflectivity;\n\n\t\t\t\t}\n\n\t\t\t\tif ( matJSON.parameters.lightMap ) {\n\n\t\t\t\t\tuniforms[ \"tAO\" ].value = matJSON.parameters.lightMap;\n\t\t\t\t\tuniforms[ \"enableAO\" ].value = true;\n\n\t\t\t\t}\n\n\t\t\t\tif ( matJSON.parameters.specularMap ) {\n\n\t\t\t\t\tuniforms[ \"tSpecular\" ].value = result.textures[ matJSON.parameters.specularMap ];\n\t\t\t\t\tuniforms[ \"enableSpecular\" ].value = true;\n\n\t\t\t\t}\n\n\t\t\t\tif ( matJSON.parameters.displacementMap ) {\n\n\t\t\t\t\tuniforms[ \"tDisplacement\" ].value = result.textures[ matJSON.parameters.displacementMap ];\n\t\t\t\t\tuniforms[ \"enableDisplacement\" ].value = true;\n\n\t\t\t\t\tuniforms[ \"uDisplacementBias\" ].value = matJSON.parameters.displacementBias;\n\t\t\t\t\tuniforms[ \"uDisplacementScale\" ].value = matJSON.parameters.displacementScale;\n\n\t\t\t\t}\n\n\t\t\t\tuniforms[ \"diffuse\" ].value.setHex( diffuse );\n\t\t\t\tuniforms[ \"specular\" ].value.setHex( specular );\n\t\t\t\tuniforms[ \"ambient\" ].value.setHex( ambient );\n\n\t\t\t\tuniforms[ \"shininess\" ].value = shininess;\n\n\t\t\t\tif ( matJSON.parameters.opacity ) {\n\n\t\t\t\t\tuniforms[ \"opacity\" ].value = matJSON.parameters.opacity;\n\n\t\t\t\t}\n\n\t\t\t\tvar parameters = { fragmentShader: shader.fragmentShader, vertexShader: shader.vertexShader, uniforms: uniforms, lights: true, fog: true };\n\n\t\t\t\tmaterial = new THREE.ShaderMaterial( parameters );\n\n\t\t\t} else {\n\n\t\t\t\tmaterial = new THREE[ matJSON.type ]( matJSON.parameters );\n\n\t\t\t}\n\n\t\t\tmaterial.name = matID;\n\n\t\t\tresult.materials[ matID ] = material;\n\n\t\t}\n\n\t\t// second pass through all materials to initialize MeshFaceMaterials\n\t\t// that could be referring to other materials out of order\n\n\t\tfor ( matID in data.materials ) {\n\n\t\t\tmatJSON = data.materials[ matID ];\n\n\t\t\tif ( matJSON.parameters.materials ) {\n\n\t\t\t\tvar materialArray = [];\n\n\t\t\t\tfor ( var i = 0; i < matJSON.parameters.materials.length; i ++ ) {\n\n\t\t\t\t\tvar label = matJSON.parameters.materials[ i ];\n\t\t\t\t\tmaterialArray.push( result.materials[ label ] );\n\n\t\t\t\t}\n\n\t\t\t\tresult.materials[ matID ].materials = materialArray;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// objects ( synchronous init of procedural primitives )\n\n\t\thandle_objects();\n\n\t\t// defaults\n\n\t\tif ( result.cameras && data.defaults.camera ) {\n\n\t\t\tresult.currentCamera = result.cameras[ data.defaults.camera ];\n\n\t\t}\n\n\t\tif ( result.fogs && data.defaults.fog ) {\n\n\t\t\tresult.scene.fog = result.fogs[ data.defaults.fog ];\n\n\t\t}\n\n\t\t// synchronous callback\n\n\t\tscope.callbackSync( result );\n\n\t\t// just in case there are no async elements\n\n\t\tasync_callback_gate();\n\n\t}\n\n}\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Loaders/STLLoader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Loaders/STLLoader.js",
            "module-type": "library",
            "text": "/**\n * @author aleeper / http://adamleeper.com/\n * @author mrdoob / http://mrdoob.com/\n * @author gero3 / https://github.com/gero3\n *\n * Description: A THREE loader for STL ASCII files, as created by Solidworks and other CAD programs.\n *\n * Supports both binary and ASCII encoded files, with automatic detection of type.\n *\n * Limitations:\n * \tBinary decoding ignores header. There doesn't seem to be much of a use for it.\n * \tThere is perhaps some question as to how valid it is to always assume little-endian-ness.\n * \tASCII decoding assumes file is UTF-8. Seems to work for the examples...\n *\n * Usage:\n * \tvar loader = new THREE.STLLoader();\n * \tloader.addEventListener( 'load', function ( event ) {\n *\n * \t\tvar geometry = event.content;\n * \t\tscene.add( new THREE.Mesh( geometry ) );\n *\n * \t} );\n * \tloader.load( './models/stl/slotted_disk.stl' );\n */\n\n\nTHREE.STLLoader = function () {};\n\nTHREE.STLLoader.prototype = {\n\n\tconstructor: THREE.STLLoader\n\n};\n\nTHREE.STLLoader.prototype.load = function ( url, callback ) {\n  var func = \"THREE.STLLoader.load\";\n\n  if (TiddlyWiki && url.match(/^tw:/)) {\n    var res = TiddlyWiki.load(url);\n    //hack.log(\"res.length = \"+res.length, hack.loader, func);\n\n    var geometry = this.parse(res);\n    this.dispatchEvent({type: 'load', content: geometry});\n    if (callback) callback(geometry);\n\n    hack.log(\"url: \"+url+\": loaded\", hack.loader, func);\n    return;\n  }\n\n\tvar scope = this;\n\n\tvar xhr = new XMLHttpRequest();\n\n\tfunction onloaded( event ) {\n\n\t\tif ( event.target.status === 200 || event.target.status === 0 ) {\n\n\t\t\tvar geometry = scope.parse( event.target.response || event.target.responseText );\n\n\t\t\tscope.dispatchEvent( { type: 'load', content: geometry } );\n\n\t\t\tif ( callback ) callback( geometry );\n\n\t\t} else {\n\n\t\t\tscope.dispatchEvent( { type: 'error', message: 'Couldn\\'t load URL [' + url + ']', response: event.target.statusText } );\n\n\t\t}\n\n\t}\n\n\txhr.addEventListener( 'load', onloaded, false );\n\n\txhr.addEventListener( 'progress', function ( event ) {\n\n\t\tscope.dispatchEvent( { type: 'progress', loaded: event.loaded, total: event.total } );\n\n\t}, false );\n\n\txhr.addEventListener( 'error', function () {\n\n\t\tscope.dispatchEvent( { type: 'error', message: 'Couldn\\'t load URL [' + url + ']' } );\n\n\t}, false );\n\n\tif ( xhr.overrideMimeType ) xhr.overrideMimeType( 'text/plain; charset=x-user-defined' );\n\txhr.open( 'GET', url, true );\n\txhr.responseType = 'arraybuffer';\n\txhr.send( null );\n\n};\n\nTHREE.STLLoader.prototype.parse = function ( data ) {\n  var func = \"THREE.STLLoader.parse\";\n\n\tvar isBinary = function () {\n\n\t\tvar expect, face_size, n_faces, reader;\n\t\treader = new DataView( binData );\n\t\tface_size = (32 / 8 * 3) + ((32 / 8 * 3) * 3) + (16 / 8);\n\t\tn_faces = reader.getUint32(80,true);\n\t\texpect = 80 + (32 / 8) + (n_faces * face_size);\n\t\treturn expect === reader.byteLength;\n\n\t};\n\n\tvar binData = this.ensureBinary( data );\n\n\treturn isBinary()\n\t\t? this.parseBinary( binData )\n\t\t: this.parseASCII( this.ensureString( data ) );\n\n};\n\nTHREE.STLLoader.prototype.parseBinary = function ( data ) {\n\n\tvar reader = new DataView( data );\n\tvar faces = reader.getUint32( 80, true );\n\tvar dataOffset = 84;\n\tvar faceLength = 12 * 4 + 2;\n\n\tvar offset = 0;\n\n\tvar geometry = new THREE.BufferGeometry();\n\n\tvar vertices = new Float32Array( faces * 3 * 3 );\n\tvar normals = new Float32Array( faces * 3 * 3 );\n\n\tfor ( var face = 0; face < faces; face ++ ) {\n\n\t\tvar start = dataOffset + face * faceLength;\n\n\t\tfor ( var i = 1; i <= 3; i ++ ) {\n\n\t\t\tvar vertexstart = start + i * 12;\n\n\t\t\tvertices[ offset     ] = reader.getFloat32( vertexstart, true );\n\t\t\tvertices[ offset + 1 ] = reader.getFloat32( vertexstart + 4, true );\n\t\t\tvertices[ offset + 2 ] = reader.getFloat32( vertexstart + 8, true );\n\n\t\t\tnormals[ offset     ] = reader.getFloat32( start    , true );\n\t\t\tnormals[ offset + 1 ] = reader.getFloat32( start + 4, true );\n\t\t\tnormals[ offset + 2 ] = reader.getFloat32( start + 8, true );\n\n\t\t\toffset += 3;\n\n\t\t}\n\n\t}\n\n\tgeometry.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );\n\tgeometry.addAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) );\n\n\treturn geometry;\n\n};\n\nTHREE.STLLoader.prototype.parseASCII = function (data) {\n  var func = \"THREE.STLLoader.parseASCII\";\n\n\tvar geometry, length, normal, patternFace, patternNormal, patternVertex, result, text;\n\tgeometry = new THREE.Geometry();\n\tpatternFace = /facet([\\s\\S]*?)endfacet/g;\n\n\twhile ( ( result = patternFace.exec( data ) ) !== null ) {\n\n\t\ttext = result[0];\n\t\tpatternNormal = /normal[\\s]+([\\-+]?[0-9]+\\.?[0-9]*([eE][\\-+]?[0-9]+)?)+[\\s]+([\\-+]?[0-9]*\\.?[0-9]+([eE][\\-+]?[0-9]+)?)+[\\s]+([\\-+]?[0-9]*\\.?[0-9]+([eE][\\-+]?[0-9]+)?)+/g;\n\n\t\twhile ( ( result = patternNormal.exec( text ) ) !== null ) {\n\n\t\t\tnormal = new THREE.Vector3( parseFloat( result[ 1 ] ), parseFloat( result[ 3 ] ), parseFloat( result[ 5 ] ) );\n\n\t\t}\n\n\t\tpatternVertex = /vertex[\\s]+([\\-+]?[0-9]+\\.?[0-9]*([eE][\\-+]?[0-9]+)?)+[\\s]+([\\-+]?[0-9]*\\.?[0-9]+([eE][\\-+]?[0-9]+)?)+[\\s]+([\\-+]?[0-9]*\\.?[0-9]+([eE][\\-+]?[0-9]+)?)+/g;\n\n\t\twhile ( ( result = patternVertex.exec( text ) ) !== null ) {\n\n\t\t\tgeometry.vertices.push( new THREE.Vector3( parseFloat( result[ 1 ] ), parseFloat( result[ 3 ] ), parseFloat( result[ 5 ] ) ) );\n\n\t\t}\n\n\t\tlength = geometry.vertices.length;\n\n\t\tgeometry.faces.push( new THREE.Face3( length - 3, length - 2, length - 1, normal ) );\n\n\t}\n\n\tgeometry.computeBoundingBox();\n\tgeometry.computeBoundingSphere();\n\n\treturn geometry;\n\n};\n\nTHREE.STLLoader.prototype.ensureString = function (buf) {\n  var func = \"THREE.STLLoader.ensureString\";\n\n\tif (typeof buf !== \"string\"){\n\t\tvar array_buffer = new Uint8Array(buf);\n\t\tvar str = '';\n\t\tfor(var i = 0; i < buf.byteLength; i++) {\n\t\t\tstr += String.fromCharCode(array_buffer[i]); // implicitly assumes little-endian\n\t\t}\n\t\treturn str;\n\t} else {\n\t\treturn buf;\n\t}\n\n};\n\nTHREE.STLLoader.prototype.ensureBinary = function (buf) {\n\n\tif (typeof buf === \"string\"){\n\t\tvar array_buffer = new Uint8Array(buf.length);\n\t\tfor(var i = 0; i < buf.length; i++) {\n\t\t\tarray_buffer[i] = buf.charCodeAt(i) & 0xff; // implicitly assumes little-endian\n\t\t}\n\t\treturn array_buffer.buffer || array_buffer;\n\t} else {\n\t\treturn buf;\n\t}\n\n};\n\nTHREE.EventDispatcher.prototype.apply( THREE.STLLoader.prototype );\n\nif ( typeof DataView === 'undefined'){\n\n\tDataView = function(buffer, byteOffset, byteLength){\n\n\t\tthis.buffer = buffer;\n\t\tthis.byteOffset = byteOffset || 0;\n\t\tthis.byteLength = byteLength || buffer.byteLength || buffer.length;\n\t\tthis._isString = typeof buffer === \"string\";\n\n\t}\n\n\tDataView.prototype = {\n\n\t\t_getCharCodes:function(buffer,start,length){\n\t\t\tstart = start || 0;\n\t\t\tlength = length || buffer.length;\n\t\t\tvar end = start + length;\n\t\t\tvar codes = [];\n\t\t\tfor (var i = start; i < end; i++) {\n\t\t\t\tcodes.push(buffer.charCodeAt(i) & 0xff);\n\t\t\t}\n\t\t\treturn codes;\n\t\t},\n\n\t\t_getBytes: function (length, byteOffset, littleEndian) {\n\n\t\t\tvar result;\n\n\t\t\t// Handle the lack of endianness\n\t\t\tif (littleEndian === undefined) {\n\n\t\t\t\tlittleEndian = this._littleEndian;\n\n\t\t\t}\n\n\t\t\t// Handle the lack of byteOffset\n\t\t\tif (byteOffset === undefined) {\n\n\t\t\t\tbyteOffset = this.byteOffset;\n\n\t\t\t} else {\n\n\t\t\t\tbyteOffset = this.byteOffset + byteOffset;\n\n\t\t\t}\n\n\t\t\tif (length === undefined) {\n\n\t\t\t\tlength = this.byteLength - byteOffset;\n\n\t\t\t}\n\n\t\t\t// Error Checking\n\t\t\tif (typeof byteOffset !== 'number') {\n\n\t\t\t\tthrow new TypeError('DataView byteOffset is not a number');\n\n\t\t\t}\n\n\t\t\tif (length < 0 || byteOffset + length > this.byteLength) {\n\n\t\t\t\tthrow new Error('DataView length or (byteOffset+length) value is out of bounds');\n\n\t\t\t}\n\n\t\t\tif (this.isString){\n\n\t\t\t\tresult = this._getCharCodes(this.buffer, byteOffset, byteOffset + length);\n\n\t\t\t} else {\n\n\t\t\t\tresult = this.buffer.slice(byteOffset, byteOffset + length);\n\n\t\t\t}\n\n\t\t\tif (!littleEndian && length > 1) {\n\n\t\t\t\tif (!(result instanceof Array)) {\n\n\t\t\t\t\tresult = Array.prototype.slice.call(result);\n\n\t\t\t\t}\n\n\t\t\t\tresult.reverse();\n\t\t\t}\n\n\t\t\treturn result;\n\n\t\t},\n\n\t\t// Compatibility functions on a String Buffer\n\n\t\tgetFloat64: function (byteOffset, littleEndian) {\n\n\t\t\tvar b = this._getBytes(8, byteOffset, littleEndian),\n\n\t\t\t\tsign = 1 - (2 * (b[7] >> 7)),\n\t\t\t\texponent = ((((b[7] << 1) & 0xff) << 3) | (b[6] >> 4)) - ((1 << 10) - 1),\n\n\t\t\t// Binary operators such as | and << operate on 32 bit values, using + and Math.pow(2) instead\n\t\t\t\tmantissa = ((b[6] & 0x0f) * Math.pow(2, 48)) + (b[5] * Math.pow(2, 40)) + (b[4] * Math.pow(2, 32)) +\n\t\t\t\t\t\t\t(b[3] * Math.pow(2, 24)) + (b[2] * Math.pow(2, 16)) + (b[1] * Math.pow(2, 8)) + b[0];\n\n\t\t\tif (exponent === 1024) {\n\t\t\t\tif (mantissa !== 0) {\n\t\t\t\t\treturn NaN;\n\t\t\t\t} else {\n\t\t\t\t\treturn sign * Infinity;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (exponent === -1023) { // Denormalized\n\t\t\t\treturn sign * mantissa * Math.pow(2, -1022 - 52);\n\t\t\t}\n\n\t\t\treturn sign * (1 + mantissa * Math.pow(2, -52)) * Math.pow(2, exponent);\n\n\t\t},\n\n\t\tgetFloat32: function (byteOffset, littleEndian) {\n\n\t\t\tvar b = this._getBytes(4, byteOffset, littleEndian),\n\n\t\t\t\tsign = 1 - (2 * (b[3] >> 7)),\n\t\t\t\texponent = (((b[3] << 1) & 0xff) | (b[2] >> 7)) - 127,\n\t\t\t\tmantissa = ((b[2] & 0x7f) << 16) | (b[1] << 8) | b[0];\n\n\t\t\tif (exponent === 128) {\n\t\t\t\tif (mantissa !== 0) {\n\t\t\t\t\treturn NaN;\n\t\t\t\t} else {\n\t\t\t\t\treturn sign * Infinity;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (exponent === -127) { // Denormalized\n\t\t\t\treturn sign * mantissa * Math.pow(2, -126 - 23);\n\t\t\t}\n\n\t\t\treturn sign * (1 + mantissa * Math.pow(2, -23)) * Math.pow(2, exponent);\n\t\t},\n\n\t\tgetInt32: function (byteOffset, littleEndian) {\n\t\t\tvar b = this._getBytes(4, byteOffset, littleEndian);\n\t\t\treturn (b[3] << 24) | (b[2] << 16) | (b[1] << 8) | b[0];\n\t\t},\n\n\t\tgetUint32: function (byteOffset, littleEndian) {\n\t\t\treturn this.getInt32(byteOffset, littleEndian) >>> 0;\n\t\t},\n\n\t\tgetInt16: function (byteOffset, littleEndian) {\n\t\t\treturn (this.getUint16(byteOffset, littleEndian) << 16) >> 16;\n\t\t},\n\n\t\tgetUint16: function (byteOffset, littleEndian) {\n\t\t\tvar b = this._getBytes(2, byteOffset, littleEndian);\n\t\t\treturn (b[1] << 8) | b[0];\n\t\t},\n\n\t\tgetInt8: function (byteOffset) {\n\t\t\treturn (this.getUint8(byteOffset) << 24) >> 24;\n\t\t},\n\n\t\tgetUint8: function (byteOffset) {\n\t\t\treturn this._getBytes(1, byteOffset)[0];\n\t\t}\n\n\t };\n\n}\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Loaders/UTF8Loader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Loaders/UTF8Loader.js",
            "module-type": "library",
            "text": "/**\n * Loader for UTF8 version2 (after r51) encoded models generated by:\n *\thttp://code.google.com/p/webgl-loader/\n *\n * Code to load/decompress mesh is taken from r100 of this webgl-loader\n */\n\nTHREE.UTF8Loader = function () {};\n\n/**\n * Load UTF8 encoded model\n * @param jsonUrl - URL from which to load json containing information about model\n * @param callback - Callback(THREE.Object3D) on successful loading of model\n * @param options - options on how to load model (see THREE.MTLLoader.MaterialCreator for basic options)\n *                  Additional options include\n *                   geometryBase: Base url from which to load referenced geometries\n *                   materialBase: Base url from which to load referenced textures\n */\n\nTHREE.UTF8Loader.prototype.load = function ( jsonUrl, callback, options ) {\n  var func = \"THREE.UTF8Loader.load\";\n  hack.log(\"url: \"+jsonUrl, hack.loader, func);\n\n    this.downloadModelJson( jsonUrl, options, callback );\n\n};\n\n// BufferGeometryCreator\n\nTHREE.UTF8Loader.BufferGeometryCreator = function () {\n};\n\nTHREE.UTF8Loader.BufferGeometryCreator.prototype.create = function ( attribArray, indices ) {\n\n\tvar ntris = indices.length / 3;\n\n\tvar geometry = new THREE.BufferGeometry();\n\n\tvar positions = new Float32Array( ntris * 3 * 3 );\n\tvar normals = new Float32Array( ntris * 3 * 3 );\n\tvar uvs = new Float32Array( ntris * 3 * 2 );\n\n\tvar i, j, offset;\n\tvar x, y, z;\n\tvar u, v;\n\n\tvar end = attribArray.length;\n\tvar stride = 8;\n\n\t// extract positions\n\n\tj = 0;\n\toffset = 0;\n\n\tfor( i = offset; i < end; i += stride ) {\n\n\t\tx = attribArray[ i ];\n\t\ty = attribArray[ i + 1 ];\n\t\tz = attribArray[ i + 2 ];\n\n\t\tpositions[ j++ ] = x;\n\t\tpositions[ j++ ] = y;\n\t\tpositions[ j++ ] = z;\n\n\t}\n\n\t// extract uvs\n\n\tj = 0;\n\toffset = 3;\n\n\tfor( i = offset; i < end; i += stride ) {\n\n\t\tu = attribArray[ i ];\n\t\tv = attribArray[ i + 1 ];\n\n\t\tuvs[ j++ ] = u;\n\t\tuvs[ j++ ] = v;\n\n\t}\n\n\t// extract normals\n\n\tj = 0;\n\toffset = 5;\n\n\tfor( i = offset; i < end; i += stride ) {\n\n\t\tx = attribArray[ i ];\n\t\ty = attribArray[ i + 1 ];\n\t\tz = attribArray[ i + 2 ];\n\n\t\tnormals[ j++ ] = x;\n\t\tnormals[ j++ ] = y;\n\t\tnormals[ j++ ] = z;\n\n\t}\n\n    geometry.addAttribute( 'index', new THREE.BufferAttribute( indices, 1 ) );\n    geometry.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) );\n    geometry.addAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) );\n    geometry.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ) );\n\n    geometry.offsets.push( { start: 0, count: indices.length, index: 0 } );\n\n\tgeometry.computeBoundingSphere();\n\n\treturn geometry;\n\n};\n\n\n// UTF-8 decoder from webgl-loader (r100)\n// http://code.google.com/p/webgl-loader/\n\n// Model manifest description. Contains objects like:\n// name: {\n//   materials: { 'material_name': { ... } ... },\n//   decodeParams: {\n//     decodeOffsets: [ ... ],\n//     decodeScales: [ ... ],\n//   },\n//   urls: {\n//     'url': [\n//       { material: 'material_name',\n//         attribRange: [#, #],\n//         indexRange: [#, #],\n//         names: [ 'object names' ... ],\n//         lengths: [#, #, # ... ]\n//       }\n//     ],\n//     ...\n//   }\n// }\n\nvar DEFAULT_DECODE_PARAMS = {\n\n    decodeOffsets: [-4095, -4095, -4095, 0, 0, -511, -511, -511],\n    decodeScales: [1/8191, 1/8191, 1/8191, 1/1023, 1/1023, 1/1023, 1/1023, 1/1023]\n\n    // TODO: normal decoding? (see walt.js)\n    // needs to know: input, output (from vertex format!)\n    //\n    // Should split attrib/index.\n    // 1) Decode position and non-normal attributes.\n    // 2) Decode indices, computing normals\n    // 3) Maybe normalize normals? Only necessary for refinement, or fixed?\n    // 4) Maybe refine normals? Should this be part of regular refinement?\n    // 5) Morphing\n\n};\n\n// Triangle strips!\n\n// TODO: will it be an optimization to specialize this method at\n// runtime for different combinations of stride, decodeOffset and\n// decodeScale?\n\nTHREE.UTF8Loader.prototype.decompressAttribsInner_ = function ( str, inputStart, inputEnd,\n                                                                  output, outputStart, stride,\n                                                                  decodeOffset, decodeScale ) {\n\n    var prev = 0;\n\n    for ( var j = inputStart; j < inputEnd; j ++ ) {\n\n        var code = str.charCodeAt( j );\n        prev += ( code >> 1 ) ^ ( -( code & 1 ) );\n\n        output[ outputStart ] = decodeScale * ( prev + decodeOffset );\n        outputStart += stride;\n\n    }\n\n};\n\nTHREE.UTF8Loader.prototype.decompressIndices_ = function( str, inputStart, numIndices,\n                                                            output, outputStart ) {\n\n\tvar highest = 0;\n\n    for ( var i = 0; i < numIndices; i ++ ) {\n\n        var code = str.charCodeAt( inputStart ++ );\n\n        output[ outputStart ++ ] = highest - code;\n\n        if ( code === 0 ) {\n\n            highest ++;\n\n        }\n\n    }\n\n};\n\nTHREE.UTF8Loader.prototype.decompressAABBs_ = function ( str, inputStart, numBBoxen,\n                                                           decodeOffsets, decodeScales ) {\n    var numFloats = 6 * numBBoxen;\n\n    var inputEnd = inputStart + numFloats;\n    var outputStart = 0;\n\n    var bboxen = new Float32Array( numFloats );\n\n    for ( var i = inputStart; i < inputEnd; i += 6 ) {\n\n        var minX = str.charCodeAt(i + 0) + decodeOffsets[0];\n        var minY = str.charCodeAt(i + 1) + decodeOffsets[1];\n        var minZ = str.charCodeAt(i + 2) + decodeOffsets[2];\n\n        var radiusX = (str.charCodeAt(i + 3) + 1) >> 1;\n        var radiusY = (str.charCodeAt(i + 4) + 1) >> 1;\n        var radiusZ = (str.charCodeAt(i + 5) + 1) >> 1;\n\n        bboxen[ outputStart++ ] = decodeScales[0] * (minX + radiusX);\n        bboxen[ outputStart++ ] = decodeScales[1] * (minY + radiusY);\n        bboxen[ outputStart++ ] = decodeScales[2] * (minZ + radiusZ);\n\n        bboxen[ outputStart++ ] = decodeScales[0] * radiusX;\n        bboxen[ outputStart++ ] = decodeScales[1] * radiusY;\n        bboxen[ outputStart++ ] = decodeScales[2] * radiusZ;\n\n    }\n\n    return bboxen;\n\n};\n\nTHREE.UTF8Loader.prototype.decompressMesh =  function ( str, meshParams, decodeParams, name, idx, callback ) {\n\n    // Extract conversion parameters from attribArrays.\n\n    var stride = decodeParams.decodeScales.length;\n\n    var decodeOffsets = decodeParams.decodeOffsets;\n    var decodeScales = decodeParams.decodeScales;\n\n    var attribStart = meshParams.attribRange[0];\n    var numVerts = meshParams.attribRange[1];\n\n    // Decode attributes.\n\n    var inputOffset = attribStart;\n    var attribsOut = new Float32Array( stride * numVerts );\n\n    for (var j = 0; j < stride; j ++ ) {\n\n        var end = inputOffset + numVerts;\n\n\t\tvar decodeScale = decodeScales[j];\n\n        if ( decodeScale ) {\n\n            // Assume if decodeScale is never set, simply ignore the\n            // attribute.\n\n            this.decompressAttribsInner_( str, inputOffset, end,\n                attribsOut, j, stride,\n                decodeOffsets[j], decodeScale );\n        }\n\n        inputOffset = end;\n\n    }\n\n    var indexStart = meshParams.indexRange[ 0 ];\n    var numIndices = 3 * meshParams.indexRange[ 1 ];\n\n    var indicesOut = new Uint16Array( numIndices );\n\n    this.decompressIndices_( str, inputOffset, numIndices, indicesOut, 0 );\n\n    // Decode bboxen.\n\n    var bboxen = undefined;\n    var bboxOffset = meshParams.bboxes;\n\n    if ( bboxOffset ) {\n\n        bboxen = this.decompressAABBs_( str, bboxOffset, meshParams.names.length, decodeOffsets, decodeScales );\n    }\n\n    callback( name, idx, attribsOut, indicesOut, bboxen, meshParams );\n\n};\n\nTHREE.UTF8Loader.prototype.copyAttrib = function ( stride, attribsOutFixed, lastAttrib, index ) {\n\n    for ( var j = 0; j < stride; j ++ ) {\n\n        lastAttrib[ j ] = attribsOutFixed[ stride * index + j ];\n\n    }\n\n};\n\nTHREE.UTF8Loader.prototype.decodeAttrib2 = function ( str, stride, decodeOffsets, decodeScales, deltaStart,\n                                                        numVerts, attribsOut, attribsOutFixed, lastAttrib,\n                                                        index ) {\n\n    for ( var j = 0; j < 5; j ++ ) {\n\n        var code = str.charCodeAt( deltaStart + numVerts*j + index );\n        var delta = ( code >> 1) ^ (-(code & 1));\n\n        lastAttrib[ j ] += delta;\n        attribsOutFixed[ stride * index + j ] = lastAttrib[ j ];\n        attribsOut[ stride * index + j ] = decodeScales[ j ] * ( lastAttrib[ j ] + decodeOffsets[ j ] );\n    }\n\n};\n\nTHREE.UTF8Loader.prototype.accumulateNormal = function ( i0, i1, i2, attribsOutFixed, crosses ) {\n\n    var p0x = attribsOutFixed[ 8*i0 ];\n    var p0y = attribsOutFixed[ 8*i0 + 1 ];\n    var p0z = attribsOutFixed[ 8*i0 + 2 ];\n\n    var p1x = attribsOutFixed[ 8*i1 ];\n    var p1y = attribsOutFixed[ 8*i1 + 1 ];\n    var p1z = attribsOutFixed[ 8*i1 + 2 ];\n\n    var p2x = attribsOutFixed[ 8*i2 ];\n    var p2y = attribsOutFixed[ 8*i2 + 1 ];\n    var p2z = attribsOutFixed[ 8*i2 + 2 ];\n\n    p1x -= p0x;\n    p1y -= p0y;\n    p1z -= p0z;\n\n    p2x -= p0x;\n    p2y -= p0y;\n    p2z -= p0z;\n\n    p0x = p1y*p2z - p1z*p2y;\n    p0y = p1z*p2x - p1x*p2z;\n    p0z = p1x*p2y - p1y*p2x;\n\n    crosses[ 3*i0 ]     += p0x;\n    crosses[ 3*i0 + 1 ] += p0y;\n    crosses[ 3*i0 + 2 ] += p0z;\n\n    crosses[ 3*i1 ]     += p0x;\n    crosses[ 3*i1 + 1 ] += p0y;\n    crosses[ 3*i1 + 2 ] += p0z;\n\n    crosses[ 3*i2 ]     += p0x;\n    crosses[ 3*i2 + 1 ] += p0y;\n    crosses[ 3*i2 + 2 ] += p0z;\n\n};\n\nTHREE.UTF8Loader.prototype.decompressMesh2 = function( str, meshParams, decodeParams, name, idx, callback ) {\n\n    var MAX_BACKREF = 96;\n\n    // Extract conversion parameters from attribArrays.\n\n    var stride = decodeParams.decodeScales.length;\n\n\tvar decodeOffsets = decodeParams.decodeOffsets;\n    var decodeScales = decodeParams.decodeScales;\n\n    var deltaStart = meshParams.attribRange[ 0 ];\n    var numVerts = meshParams.attribRange[ 1 ];\n\n    var codeStart = meshParams.codeRange[ 0 ];\n    var codeLength = meshParams.codeRange[ 1 ];\n\n    var numIndices = 3 * meshParams.codeRange[ 2 ];\n\n    var indicesOut = new Uint16Array( numIndices );\n\n    var crosses = new Int32Array( 3 * numVerts );\n\n    var lastAttrib = new Uint16Array( stride );\n\n    var attribsOutFixed = new Uint16Array( stride * numVerts );\n    var attribsOut = new Float32Array( stride * numVerts );\n\n    var highest = 0;\n    var outputStart = 0;\n\n    for ( var i = 0; i < numIndices; i += 3 ) {\n\n        var code = str.charCodeAt( codeStart ++ );\n\n        var max_backref = Math.min( i, MAX_BACKREF );\n\n        if ( code < max_backref ) {\n\n            // Parallelogram\n\n            var winding = code % 3;\n            var backref = i - ( code - winding );\n            var i0, i1, i2;\n\n            switch ( winding ) {\n\n                case 0:\n\n                    i0 = indicesOut[ backref + 2 ];\n                    i1 = indicesOut[ backref + 1 ];\n                    i2 = indicesOut[ backref + 0 ];\n                    break;\n\n                case 1:\n\n                    i0 = indicesOut[ backref + 0 ];\n                    i1 = indicesOut[ backref + 2 ];\n                    i2 = indicesOut[ backref + 1 ];\n                    break;\n\n                case 2:\n\n                    i0 = indicesOut[ backref + 1 ];\n                    i1 = indicesOut[ backref + 0 ];\n                    i2 = indicesOut[ backref + 2 ];\n                    break;\n\n            }\n\n            indicesOut[ outputStart ++ ] = i0;\n            indicesOut[ outputStart ++ ] = i1;\n\n            code = str.charCodeAt( codeStart ++ );\n\n            var index = highest - code;\n            indicesOut[ outputStart ++ ] = index;\n\n            if ( code === 0 ) {\n\n                for (var j = 0; j < 5; j ++ ) {\n\n                    var deltaCode = str.charCodeAt( deltaStart + numVerts * j + highest );\n\n                    var prediction = ((deltaCode >> 1) ^ (-(deltaCode & 1))) +\n                        attribsOutFixed[stride*i0 + j] +\n                        attribsOutFixed[stride*i1 + j] -\n                        attribsOutFixed[stride*i2 + j];\n\n                    lastAttrib[j] = prediction;\n\n                    attribsOutFixed[ stride * highest + j ] = prediction;\n                    attribsOut[ stride * highest + j ] = decodeScales[ j ] * ( prediction + decodeOffsets[ j ] );\n\n                }\n\n                highest ++;\n\n            } else {\n\n                this.copyAttrib( stride, attribsOutFixed, lastAttrib, index );\n\n            }\n\n            this.accumulateNormal( i0, i1, index, attribsOutFixed, crosses );\n\n        } else {\n\n            // Simple\n\n            var index0 = highest - ( code - max_backref );\n\n            indicesOut[ outputStart ++ ] = index0;\n\n            if ( code === max_backref ) {\n\n                this.decodeAttrib2( str, stride, decodeOffsets, decodeScales, deltaStart,\n                    numVerts, attribsOut, attribsOutFixed, lastAttrib,\n                    highest ++ );\n\n            } else {\n\n                this.copyAttrib(stride, attribsOutFixed, lastAttrib, index0);\n\n            }\n\n            code = str.charCodeAt( codeStart ++ );\n\n            var index1 = highest - code;\n            indicesOut[ outputStart ++ ] = index1;\n\n            if ( code === 0 ) {\n\n                this.decodeAttrib2( str, stride, decodeOffsets, decodeScales, deltaStart,\n                    numVerts, attribsOut, attribsOutFixed, lastAttrib,\n                    highest ++ );\n\n            } else {\n\n                this.copyAttrib( stride, attribsOutFixed, lastAttrib, index1 );\n\n            }\n\n            code = str.charCodeAt( codeStart ++ );\n\n            var index2 = highest - code;\n            indicesOut[ outputStart ++ ] = index2;\n\n            if ( code === 0 ) {\n\n                for ( var j = 0; j < 5; j ++ ) {\n\n                    lastAttrib[ j ] = ( attribsOutFixed[ stride * index0 + j ] + attribsOutFixed[ stride * index1 + j ] ) / 2;\n\n                }\n\n                this.decodeAttrib2( str, stride, decodeOffsets, decodeScales, deltaStart,\n                    numVerts, attribsOut, attribsOutFixed, lastAttrib,\n                    highest ++ );\n\n            } else {\n\n                this.copyAttrib( stride, attribsOutFixed, lastAttrib, index2 );\n\n            }\n\n            this.accumulateNormal( index0, index1, index2, attribsOutFixed, crosses );\n\n        }\n\n    }\n\n    for ( var i = 0; i < numVerts; i ++ ) {\n\n        var nx = crosses[ 3*i ];\n        var ny = crosses[ 3*i + 1 ];\n        var nz = crosses[ 3*i + 2 ];\n\n        var norm = 511.0 / Math.sqrt( nx*nx + ny*ny + nz*nz );\n\n        var cx = str.charCodeAt( deltaStart + 5*numVerts + i );\n        var cy = str.charCodeAt( deltaStart + 6*numVerts + i );\n        var cz = str.charCodeAt( deltaStart + 7*numVerts + i );\n\n        attribsOut[ stride*i + 5 ] = norm*nx + ((cx >> 1) ^ (-(cx & 1)));\n        attribsOut[ stride*i + 6 ] = norm*ny + ((cy >> 1) ^ (-(cy & 1)));\n        attribsOut[ stride*i + 7 ] = norm*nz + ((cz >> 1) ^ (-(cz & 1)));\n    }\n\n    callback( name, idx, attribsOut, indicesOut, undefined, meshParams );\n\n};\n\nTHREE.UTF8Loader.prototype.downloadMesh = function ( path, name, meshEntry, decodeParams, callback ) {\n  var func = \"THREE.UTF8Loader.downloadMesh\";\n\n\n    var loader = this;\n    var idx = 0;\n\n    function onprogress( req, e ) {\n\n        while ( idx < meshEntry.length ) {\n\n            var meshParams = meshEntry[ idx ];\n            var indexRange = meshParams.indexRange;\n\n            if ( indexRange ) {\n\n                var meshEnd = indexRange[ 0 ] + 3 * indexRange[ 1 ];\n\n                if ( req.responseText.length < meshEnd ) break;\n\n                loader.decompressMesh( req.responseText, meshParams, decodeParams, name, idx, callback );\n\n            } else {\n\n                var codeRange = meshParams.codeRange;\n                var meshEnd = codeRange[ 0 ] + codeRange[ 1 ];\n\n                if ( req.responseText.length < meshEnd ) break;\n\n                loader.decompressMesh2( req.responseText, meshParams, decodeParams, name, idx, callback );\n            }\n\n            ++idx;\n\n        }\n\n    };\n\n    THREE.UTF8Loader.getHttpRequest( path, function( req, e ) {\n\n        if ( req.status === 200 || req.status === 0 ) {\n\n            onprogress( req, e );\n\n        }\n\n        // TODO: handle errors.\n\n    }, onprogress );\n};\n\nTHREE.UTF8Loader.prototype.downloadMeshes = function ( path, meshUrlMap, decodeParams, callback ) {\n\n    for ( var url in meshUrlMap ) {\n\n        var meshEntry = meshUrlMap[url];\n        this.downloadMesh( path + url, url, meshEntry, decodeParams, callback );\n\n    }\n\n};\n\nTHREE.UTF8Loader.prototype.createMeshCallback = function( materialBaseUrl, loadModelInfo, allDoneCallback ) {\n\n\tvar nCompletedUrls = 0;\n    var nExpectedUrls = 0;\n\n    var expectedMeshesPerUrl = {};\n    var decodedMeshesPerUrl = {};\n\n\tvar modelParts = {};\n\n\tvar meshUrlMap = loadModelInfo.urls;\n\n    for ( var url in meshUrlMap ) {\n\n        expectedMeshesPerUrl[ url ] = meshUrlMap[ url ].length;\n        decodedMeshesPerUrl[ url ] = 0;\n\n\t\tnExpectedUrls ++;\n\n        modelParts[ url ] = new THREE.Object3D();\n\n    }\n\n    var model = new THREE.Object3D();\n\n    // Prepare materials first...\n\n    var materialCreator = new THREE.MTLLoader.MaterialCreator( materialBaseUrl, loadModelInfo.options );\n    materialCreator.setMaterials( loadModelInfo.materials );\n\n    materialCreator.preload();\n\n\t// Create callback for creating mesh parts\n\n\tvar bufferGeometryCreator = new THREE.UTF8Loader.BufferGeometryCreator();\n\n\tvar meshCallback = function( name, idx, attribArray, indexArray, bboxen, meshParams ) {\n\n        // Got ourselves a new mesh\n\n        // name identifies this part of the model (url)\n        // idx is the mesh index of this mesh of the part\n        // attribArray defines the vertices\n        // indexArray defines the faces\n        // bboxen defines the bounding box\n        // meshParams contains the material info\n\n\t\tvar geometry = bufferGeometryCreator.create( attribArray, indexArray );\n        var material = materialCreator.create( meshParams.material );\n\n\t\tvar mesh = new THREE.Mesh( geometry, material );\n        modelParts[ name ].add( mesh );\n\n        //model.add(new THREE.Mesh(geometry, material));\n\n        decodedMeshesPerUrl[ name ] ++;\n\n        if ( decodedMeshesPerUrl[ name ] === expectedMeshesPerUrl[ name ] ) {\n\n            nCompletedUrls ++;\n\n            model.add( modelParts[ name ] );\n\n            if ( nCompletedUrls === nExpectedUrls ) {\n\n                // ALL DONE!!!\n\n                allDoneCallback( model );\n\n            }\n\n        }\n\n    };\n\n\treturn meshCallback;\n\n};\n\nTHREE.UTF8Loader.prototype.downloadModel = function ( geometryBase, materialBase, model, callback ) {\n\n    var meshCallback = this.createMeshCallback( materialBase, model, callback );\n    this.downloadMeshes( geometryBase, model.urls, model.decodeParams, meshCallback );\n\n};\n\nTHREE.UTF8Loader.prototype.downloadModelJson = function ( jsonUrl, options, callback ) {\n\n    THREE.UTF8Loader.getJsonRequest( jsonUrl, function( loaded ) {\n\n        if ( ! loaded.decodeParams ) {\n\n            if ( options && options.decodeParams ) {\n\n                loaded.decodeParams = options.decodeParams;\n\n            } else {\n\n                loaded.decodeParams = DEFAULT_DECODE_PARAMS;\n\n            }\n\n        }\n\n        loaded.options = options;\n\n        var geometryBase = jsonUrl.substr( 0, jsonUrl.lastIndexOf( \"/\" ) + 1 );\n        var materialBase = geometryBase;\n\n        if ( options && options.geometryBase ) {\n\n            geometryBase = options.geometryBase;\n\n            if ( geometryBase.charAt( geometryBase.length - 1 ) !== \"/\" ) {\n\n                geometryBase = geometryBase + \"/\";\n\n            }\n\n        }\n\n        if ( options && options.materialBase ) {\n\n            materialBase = options.materialBase;\n\n            if ( materialBase.charAt( materialBase.length - 1 ) !== \"/\" ) {\n\n                materialBase = materialBase  + \"/\";\n\n            }\n\n        }\n\n        this.downloadModel( geometryBase, materialBase, loaded, callback );\n\n    }.bind( this ) );\n\n};\n\n// XMLHttpRequest stuff\n\nTHREE.UTF8Loader.getHttpRequest = function( url, onload, opt_onprogress ) {\n  var func = \"THREE.UTF8Loader.getHttpRequest\";\n\n  if (TiddlyWiki && url.match(/^tw:/)) {\n    var res = TiddlyWiki.load(url);\n    //hack.log(\"res.length = \"+res.length, hack.loader, func);\n\n    var req = {responseText: res};\n    onload(req);\n\n    hack.log(\"url: \"+url+\": loaded\", hack.loader, func);\n    return;\n  }\n\n    var LISTENERS = {\n\n        load: function( e ) { onload( req, e ); },\n        progress: function( e ) { opt_onprogress( req, e ); }\n\n    };\n\n    var req = new XMLHttpRequest();\n    THREE.UTF8Loader.addListeners( req, LISTENERS );\n\n    req.open( 'GET', url, true );\n    req.send( null );\n}\n\nTHREE.UTF8Loader.getJsonRequest = function( url, onjson ) {\n\n    THREE.UTF8Loader.getHttpRequest( url,\n        function( e ) { onjson( JSON.parse( e.responseText ) ); },\n        function() {} );\n\n}\n\nTHREE.UTF8Loader.addListeners = function( dom, listeners ) {\n\n    // TODO: handle event capture, object binding.\n\n    for ( var key in listeners ) {\n\n        dom.addEventListener( key, listeners[ key ] );\n\n    }\n}\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Loaders/VRMLLoader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Loaders/VRMLLoader.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.VRMLLoader = function () {};\n\nTHREE.VRMLLoader.prototype = {\n\n\tconstructor: THREE.VRMLLoader,\n\n\t// for IndexedFaceSet support\n\tisRecordingPoints: false,\n\tisRecordingFaces: false,\n\tpoints: [],\n\tindexes : [],\n\n\t// for Background support\n\tisRecordingAngles: false,\n\tisRecordingColors: false,\n\tangles: [],\n\tcolors: [],\n\n\trecordingFieldname: null,\n\n\tload: function ( url, callback ) {\n          var func = \"THREE.VRMLLoader.load\";\n\n          if (TiddlyWiki && url.match(/^tw:/)) {\n            var res = TiddlyWiki.load(url);\n            //hack.log(\"res.length = \"+res.length, hack.loader, func);\n            \n\t    var object = this.parse(res);\n\t    this.dispatchEvent({type: 'load', content: object});\n\t    if (callback) callback(object);\n            \n            hack.log(\"url: \"+url+\": loaded\", hack.loader, func);\n            return;\n          }\n\n\t\tvar scope = this;\n\t\tvar request = new XMLHttpRequest();\n\n\t\trequest.addEventListener( 'load', function ( event ) {\n\n\t\t\tvar object = scope.parse( event.target.responseText );\n\n\t\t\tscope.dispatchEvent( { type: 'load', content: object } );\n\n\t\t\tif ( callback ) callback( object );\n\n\t\t}, false );\n\n\t\trequest.addEventListener( 'progress', function ( event ) {\n\n\t\t\tscope.dispatchEvent( { type: 'progress', loaded: event.loaded, total: event.total } );\n\n\t\t}, false );\n\n\t\trequest.addEventListener( 'error', function () {\n\n\t\t\tscope.dispatchEvent( { type: 'error', message: 'Couldn\\'t load URL [' + url + ']' } );\n\n\t\t}, false );\n\n\t\trequest.open( 'GET', url, true );\n\t\trequest.send( null );\n\n\t},\n\n\tparse: function ( data ) {\n\n\t\tvar parseV1 = function ( lines, scene ) {\n\n\t\t\tconsole.warn( 'VRML V1.0 not supported yet' );\n\n\t\t};\n\n\t\tvar parseV2 = function ( lines, scene ) {\n\t\t\tvar defines = {};\n\t\t\tvar float_pattern = /(\\b|\\-|\\+)([\\d\\.e]+)/;\n\t\t\tvar float3_pattern = /([\\d\\.\\+\\-e]+),?\\s+([\\d\\.\\+\\-e]+),?\\s+([\\d\\.\\+\\-e]+)/;\n\n\t\t\t/**\n\t\t\t* Interpolates colors a and b following their relative distance\n\t\t\t* expressed by t.\n\t\t\t*\n\t\t\t* @param float a\n\t\t\t* @param float b\n\t\t\t* @param float t\n\t\t\t* @returns {Color}\n\t\t\t*/\n\t\t\tvar interpolateColors = function(a, b, t) {\n\t\t\t   var deltaR = a.r - b.r;\n\t\t\t   var deltaG = a.g - b.g;\n\t\t\t   var deltaB = a.b - b.b;\n\n\t\t\t   var c = new THREE.Color();\n\n\t\t\t   c.r = a.r - t * deltaR;\n\t\t\t   c.g = a.g - t * deltaG;\n\t\t\t   c.b = a.b - t * deltaB;\n\n\t\t\t   return c;\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Vertically paints the faces interpolating between the\n\t\t\t * specified colors at the specified angels. This is used for the Background\n\t\t\t * node, but could be applied to other nodes with multiple faces as well.\n\t\t\t *\n\t\t\t * When used with the Background node, default is directionIsDown is true if\n\t\t\t * interpolating the skyColor down from the Zenith. When interpolationg up from\n\t\t\t * the Nadir i.e. interpolating the groundColor, the directionIsDown is false.\n\t\t\t *\n\t\t\t * The first angle is never specified, it is the Zenith (0 rad). Angles are specified\n\t\t\t * in radians. The geometry is thought a sphere, but could be anything. The color interpolation\n\t\t\t * is linear along the Y axis in any case.\n\t\t\t *\n\t\t\t * You must specify one more color than you have angles at the beginning of the colors array.\n\t\t\t * This is the color of the Zenith (the top of the shape).\n\t\t\t *\n\t\t\t * @param geometry\n\t\t\t * @param radius\n\t\t\t * @param angles\n\t\t\t * @param colors\n\t\t\t * @param boolean directionIsDown Whether to work bottom up or top down.\n\t\t\t */\n\t\t\tvar paintFaces = function (geometry, radius, angles, colors, directionIsDown) {\n\n\t\t\t\tvar f, n, p, vertexIndex, color;\n\n\t\t\t\tvar direction = directionIsDown ? 1 : -1;\n\n\t\t\t\tvar faceIndices = [ 'a', 'b', 'c', 'd' ];\n\n\t\t\t\tvar coord = [ ], aColor, bColor, t = 1, A = {}, B = {}, applyColor = false, colorIndex;\n\n\t\t\t\tfor ( var k = 0; k < angles.length; k++ ) {\n\n\t\t\t\t\tvar vec = { };\n\n\t\t\t\t\t// push the vector at which the color changes\n\t\t\t\t\tvec.y = direction * ( Math.cos( angles[k] ) * radius);\n\n\t\t\t\t\tvec.x = direction * ( Math.sin( angles[k] ) * radius);\n\n\t\t\t\t\tcoord.push( vec );\n\n\t\t\t\t}\n\n\t\t\t\t// painting the colors on the faces\n\t\t\t\tfor ( var i = 0; i < geometry.faces.length ; i++ ) {\n\n\t\t\t\t\tf  = geometry.faces[ i ];\n\n\t\t\t\t\tn = ( f instanceof THREE.Face3 ) ? 3 : 4;\n\n\t\t\t\t\tfor ( var j = 0; j < n; j++ ) {\n\n\t\t\t\t\t\tvertexIndex = f[ faceIndices[ j ] ];\n\n\t\t\t\t\t\tp = geometry.vertices[ vertexIndex ];\n\n\t\t\t\t\t\tfor ( var index = 0; index < colors.length; index++ ) {\n\n\t\t\t\t\t\t\t// linear interpolation between aColor and bColor, calculate proportion\n\t\t\t\t\t\t\t// A is previous point (angle)\n\t\t\t\t\t\t\tif ( index === 0 ) {\n\n\t\t\t\t\t\t\t\tA.x = 0;\n\t\t\t\t\t\t\t\tA.y = directionIsDown ? radius : -1 * radius;\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tA.x = coord[ index-1 ].x;\n\t\t\t\t\t\t\t\tA.y = coord[ index-1 ].y;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// B is current point (angle)\n\t\t\t\t\t\t\tB = coord[index];\n\n\t\t\t\t\t\t\tif ( undefined !== B ) {\n\t\t\t\t\t\t\t\t// p has to be between the points A and B which we interpolate\n\t\t\t\t\t\t\t\tapplyColor = directionIsDown ? p.y <= A.y && p.y > B.y : p.y >= A.y && p.y < B.y;\n\n\t\t\t\t\t\t\t\tif (applyColor) {\n\n\t\t\t\t\t\t\t\t\tbColor = colors[ index + 1 ];\n\n\t\t\t\t\t\t\t\t\taColor = colors[ index ];\n\n\t\t\t\t\t\t\t\t\t// below is simple linear interpolation\n\t\t\t\t\t\t\t\t\tt = Math.abs( p.y - A.y ) / ( A.y - B.y );\n\n\t\t\t\t\t\t\t\t\t// to make it faster, you can only calculate this if the y coord changes, the color is the same for points with the same y\n\t\t\t\t\t\t\t\t\tcolor = interpolateColors( aColor, bColor, t );\n\n\t\t\t\t\t\t\t\t\tf.vertexColors[ j ] = color;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else if ( undefined === f.vertexColors[ j ] ) {\n\t\t\t\t\t\t\t\tcolorIndex = directionIsDown ? colors.length -1 : 0;\n\t\t\t\t\t\t\t\tf.vertexColors[ j ] = colors[ colorIndex ];\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tvar parseProperty = function (node, line) {\n\n\t\t\t\tvar parts = [], part, property = {}, fieldName;\n\n\t\t\t\t/**\n\t\t\t\t * Expression for matching relevant information, such as a name or value, but not the separators\n\t\t\t\t * @type {RegExp}\n\t\t\t\t */\n\t\t\t\tvar regex = /[^\\s,\\[\\]]+/g;\n\n\t\t\t\tvar point, index, angles, colors;\n\n\t\t\t\twhile (null != ( part = regex.exec(line) ) ) {\n\t\t\t\t\tparts.push(part[0]);\n\t\t\t\t}\n\n\t\t\t\tfieldName = parts[0];\n\n\n\t\t\t\t// trigger several recorders\n\t\t\t\tswitch (fieldName) {\n\t\t\t\t\tcase 'skyAngle':\n\t\t\t\t\tcase 'groundAngle':\n\t\t\t\t\t\tthis.recordingFieldname = fieldName;\n\t\t\t\t\t\tthis.isRecordingAngles = true;\n\t\t\t\t\t\tthis.angles = [];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'skyColor':\n\t\t\t\t\tcase 'groundColor':\n\t\t\t\t\t\tthis.recordingFieldname = fieldName;\n\t\t\t\t\t\tthis.isRecordingColors = true;\n\t\t\t\t\t\tthis.colors = [];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'point':\n\t\t\t\t\t\tthis.recordingFieldname = fieldName;\n\t\t\t\t\t\tthis.isRecordingPoints = true;\n\t\t\t\t\t\tthis.points = [];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'coordIndex':\n\t\t\t\t\t\tthis.recordingFieldname = fieldName;\n\t\t\t\t\t\tthis.isRecordingFaces = true;\n\t\t\t\t\t\tthis.indexes = [];\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (this.isRecordingFaces) {\n\n\t\t\t\t\t// the parts hold the indexes as strings\n\t\t\t\t\tif (parts.length > 0) {\n\t\t\t\t\t\tindex = [];\n\n\t\t\t\t\t\tfor (var ind = 0;ind < parts.length; ind++) {\n\n\t\t\t\t\t\t\t// the part should either be positive integer or -1\n\t\t\t\t\t\t\tif (!/(-?\\d+)/.test( parts[ind]) ) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// end of current face\n\t\t\t\t\t\t\tif (parts[ind] === \"-1\") {\n\t\t\t\t\t\t\t\tif (index.length > 0) {\n\t\t\t\t\t\t\t\t   this.indexes.push(index);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// start new one\n\t\t\t\t\t\t\t\tindex = [];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tindex.push(parseInt( parts[ind]) );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// end\n\t\t\t\t\tif (/]/.exec(line)) {\n\t\t\t\t\t\tthis.isRecordingFaces = false;\n\t\t\t\t\t\tnode.coordIndex = this.indexes;\n\t\t\t\t\t}\n\n\t\t\t\t} else if (this.isRecordingPoints) {\n\n\t\t\t\t\tparts = float3_pattern.exec(line);\n\n\t\t\t\t\t// parts may be empty on first and last line\n\t\t\t\t\tif (null != parts) {\n\t\t\t\t\t\tpoint = {\n\t\t\t\t\t\t\tx: parseFloat(parts[1]),\n\t\t\t\t\t\t\ty: parseFloat(parts[2]),\n\t\t\t\t\t\t\tz: parseFloat(parts[3])\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tthis.points.push(point);\n\t\t\t\t\t}\n\n\t\t\t\t\t// end\n\t\t\t\t\tif ( /]/.exec(line) ) {\n\t\t\t\t\t\tthis.isRecordingPoints = false;\n\t\t\t\t\t\tnode.points = this.points;\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( this.isRecordingAngles ) {\n\n\t\t\t\t\t// the parts hold the angles as strings\n\t\t\t\t\tif ( parts.length > 0 ) {\n\n\t\t\t\t\t\tfor ( var ind = 0;ind < parts.length; ind++ ) {\n\n\t\t\t\t\t\t\t// the part should be a float\n\t\t\t\t\t\t\tif ( ! float_pattern.test( parts[ind] ) ) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tthis.angles.push( parseFloat( parts[ind] ) );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// end\n\t\t\t\t\tif ( /]/.exec(line) ) {\n\t\t\t\t\t\tthis.isRecordingAngles = false;\n\t\t\t\t\t\tnode[this.recordingFieldname] = this.angles;\n\t\t\t\t\t}\n\n\t\t\t\t} else if (this.isRecordingColors) {\n\t\t\t\t\t// this is the float3 regex with the g modifier added, you could also explode the line by comma first (faster probably)\n\t\t\t\t\tvar float3_repeatable = /([\\d\\.\\+\\-e]+),?\\s+([\\d\\.\\+\\-e]+),?\\s+([\\d\\.\\+\\-e]+)/g;\n\n\t\t\t\t\twhile( null !== (parts = float3_repeatable.exec(line) ) ) {\n\n\t\t\t\t\t\tcolor = {\n\t\t\t\t\t\t\tr: parseFloat(parts[1]),\n\t\t\t\t\t\t\tg: parseFloat(parts[2]),\n\t\t\t\t\t\t\tb: parseFloat(parts[3])\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tthis.colors.push(color);\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// end\n\t\t\t\t\tif (/]/.exec(line)) {\n\t\t\t\t\t\tthis.isRecordingColors = false;\n\t\t\t\t\t\tnode[this.recordingFieldname] = this.colors;\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( parts[parts.length -1] !== 'NULL' && fieldName !== 'children') {\n\n\t\t\t\t\tswitch (fieldName) {\n\n\t\t\t\t\t\tcase 'diffuseColor':\n\t\t\t\t\t\tcase 'emissiveColor':\n\t\t\t\t\t\tcase 'specularColor':\n\t\t\t\t\t\tcase 'color':\n\n\t\t\t\t\t\t\tif (parts.length != 4) {\n\t\t\t\t\t\t\t\tconsole.warn('Invalid color format detected for ' + fieldName );\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tproperty = {\n\t\t\t\t\t\t\t\t'r'         : parseFloat(parts[1]),\n\t\t\t\t\t\t\t\t'g'         : parseFloat(parts[2]),\n\t\t\t\t\t\t\t\t'b'         : parseFloat(parts[3])\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'translation':\n\t\t\t\t\t\tcase 'scale':\n\t\t\t\t\t\tcase 'size':\n\t\t\t\t\t\t\tif (parts.length != 4) {\n\t\t\t\t\t\t\t\tconsole.warn('Invalid vector format detected for ' + fieldName);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tproperty = {\n\t\t\t\t\t\t\t\t'x'         : parseFloat(parts[1]),\n\t\t\t\t\t\t\t\t'y'         : parseFloat(parts[2]),\n\t\t\t\t\t\t\t\t'z'         : parseFloat(parts[3])\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'radius':\n\t\t\t\t\t\tcase 'topRadius':\n\t\t\t\t\t\tcase 'bottomRadius':\n\t\t\t\t\t\tcase 'height':\n\t\t\t\t\t\tcase 'transparency':\n\t\t\t\t\t\tcase 'shininess':\n\t\t\t\t\t\tcase 'ambientIntensity':\n\t\t\t\t\t\t\tif (parts.length != 2) {\n\t\t\t\t\t\t\t\tconsole.warn('Invalid single float value specification detected for ' + fieldName);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tproperty = parseFloat(parts[1]);\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'rotation':\n\t\t\t\t\t\t\tif (parts.length != 5) {\n\t\t\t\t\t\t\t\tconsole.warn('Invalid quaternion format detected for ' + fieldName);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tproperty = {\n\t\t\t\t\t\t\t\t'x'         : parseFloat(parts[1]),\n\t\t\t\t\t\t\t\t'y'         : parseFloat(parts[2]),\n\t\t\t\t\t\t\t\t'z'         : parseFloat(parts[3]),\n\t\t\t\t\t\t\t\t'w'         : parseFloat(parts[4])\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'ccw':\n\t\t\t\t\t\tcase 'solid':\n\t\t\t\t\t\tcase 'colorPerVertex':\n\t\t\t\t\t\tcase 'convex':\n\t\t\t\t\t\t\tif (parts.length != 2) {\n\t\t\t\t\t\t\t\tconsole.warn('Invalid format detected for ' + fieldName);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tproperty = parts[1] === 'TRUE' ? true : false;\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tnode[fieldName] = property;\n\t\t\t\t}\n\n\t\t\t\treturn property;\n\t\t\t};\n\n\t\t\tvar getTree = function ( lines ) {\n\n\t\t\t\tvar tree = { 'string': 'Scene', children: [] };\n\t\t\t\tvar current = tree;\n\t\t\t\tvar matches;\n\t\t\t\tvar specification;\n\n\t\t\t\tfor ( var i = 0; i < lines.length; i ++ ) {\n\n\t\t\t\t\tvar comment = '';\n\n\t\t\t\t\tvar line = lines[ i ];\n\n\t\t\t\t\t// omit whitespace only lines\n\t\t\t\t\tif ( null !== ( result = /^\\s+?$/g.exec( line ) ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tline = line.trim();\n\n\t\t\t\t\t// skip empty lines\n\t\t\t\t\tif (line === '') {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( /#/.exec( line ) ) {\n\n\t\t\t\t\t\tvar parts = line.split('#');\n\n\t\t\t\t\t\t// discard everything after the #, it is a comment\n\t\t\t\t\t\tline = parts[0];\n\n\t\t\t\t\t\t// well, let's also keep the comment\n\t\t\t\t\t\tcomment = parts[1];\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( matches = /([^\\s]*){1}\\s?{/.exec( line ) ) { // first subpattern should match the Node name\n\n\t\t\t\t\t\tvar block = { 'nodeType' : matches[1], 'string': line, 'parent': current, 'children': [],'comment' : comment};\n\t\t\t\t\t\tcurrent.children.push( block );\n\t\t\t\t\t\tcurrent = block;\n\n\t\t\t\t\t\tif ( /}/.exec( line ) ) {\n\t\t\t\t\t\t\t// example: geometry Box { size 1 1 1 } # all on the same line\n\t\t\t\t\t\t\tspecification = /{(.*)}/.exec( line )[ 1 ];\n\n\t\t\t\t\t\t\t// todo: remove once new parsing is complete?\n\t\t\t\t\t\t\tblock.children.push( specification );\n\n\t\t\t\t\t\t\tparseProperty(current, specification);\n\n\t\t\t\t\t\t\tcurrent = current.parent;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else if ( /}/.exec( line ) ) {\n\n\t\t\t\t\t\tcurrent = current.parent;\n\n\t\t\t\t\t} else if ( line !== '' ) {\n\n\t\t\t\t\t\tparseProperty(current, line);\n\t\t\t\t\t\t// todo: remove once new parsing is complete? we still do not parse geometry and appearance the new way\n\t\t\t\t\t\tcurrent.children.push( line );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\treturn tree;\n\t\t\t}\n\n\t\t\tvar parseNode = function ( data, parent ) {\n\n\t\t\t\t// console.log( data );\n\n\t\t\t\tif ( typeof data === 'string' ) {\n\n\t\t\t\t\tif ( /USE/.exec( data ) ) {\n\n\t\t\t\t\t\tvar defineKey = /USE\\s+?(\\w+)/.exec( data )[ 1 ];\n\n\t\t\t\t\t\tif (undefined == defines[defineKey]) {\n\t\t\t\t\t\t\tconsole.warn(defineKey + ' is not defined.');\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tif ( /appearance/.exec( data ) && defineKey ) {\n\n\t\t\t\t\t\t\t\tparent.material = defines[ defineKey ].clone();\n\n\t\t\t\t\t\t\t} else if ( /geometry/.exec( data ) && defineKey ) {\n\n\t\t\t\t\t\t\t\tparent.geometry = defines[ defineKey ].clone();\n\n\t\t\t\t\t\t\t\t// the solid property is not cloned with clone(), is only needed for VRML loading, so we need to transfer it\n\t\t\t\t\t\t\t\tif (undefined !== defines[ defineKey ].solid && defines[ defineKey ].solid === false) {\n\t\t\t\t\t\t\t\t\tparent.geometry.solid = false;\n\t\t\t\t\t\t\t\t\tparent.material.side = THREE.DoubleSide;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else if (defineKey){\n\n\t\t\t\t\t\t\t\tvar object = defines[ defineKey ].clone();\n\t\t\t\t\t\t\t\tparent.add( object );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t\tvar object = parent;\n\n\t\t\t\tif ( 'Transform' === data.nodeType || 'Group' === data.nodeType ) {\n\n\t\t\t\t\tobject = new THREE.Object3D();\n\n\t\t\t\t\tif ( /DEF/.exec( data.string ) ) {\n\t\t\t\t\t\tobject.name = /DEF\\s+(\\w+)/.exec( data.string )[ 1 ];\n\t\t\t\t\t\tdefines[ object.name ] = object;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( undefined !== data['translation'] ) {\n\n\t\t\t\t\t\tvar t = data.translation;\n\n\t\t\t\t\t\tobject.position.set(t.x, t.y, t.z);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( undefined !== data.rotation ) {\n\n\t\t\t\t\t\tvar r = data.rotation;\n\n\t\t\t\t\t\tobject.quaternion.setFromAxisAngle( new THREE.Vector3( r.x, r.y, r.z ), r.w );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( undefined !== data.scale ) {\n\n\t\t\t\t\t\tvar s = data.scale;\n\n\t\t\t\t\t\tobject.scale.set( s.x, s.y, s.z );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tparent.add( object );\n\n\t\t\t\t} else if ( 'Shape' === data.nodeType ) {\n\n\t\t\t\t\tobject = new THREE.Mesh();\n\n\t\t\t\t\tif ( /DEF/.exec( data.string ) ) {\n\n\t\t\t\t\t\tobject.name = /DEF (\\w+)/.exec( data.string )[ 1 ];\n\n\t\t\t\t\t\tdefines[ object.name ] = object;\n\t\t\t\t\t}\n\n\t\t\t\t\tparent.add( object );\n\n\t\t\t\t} else if ( 'Background' === data.nodeType ) {\n\n\t\t\t\t\tvar segments = 20;\n\n\t\t\t\t\t// sky (full sphere):\n\t\t\t\t\tvar radius = 2e4;\n\n\t\t\t\t\tvar skyGeometry = new THREE.SphereGeometry( radius, segments, segments );\n\n\t\t\t\t\tvar skyMaterial = new THREE.MeshBasicMaterial( { color: 'white', vertexColors: THREE.VertexColors, shading: THREE.NoShading } );\n\n\t\t\t\t\tskyMaterial.side = THREE.BackSide;\n\n\t\t\t\t\tskyMaterial.fog = false;\n\n\t\t\t\t\tskyMaterial.color = new THREE.Color();\n\n\t\t\t\t\tpaintFaces( skyGeometry, radius, data.skyAngle, data.skyColor, true );\n\n\t\t\t\t\tvar sky = new THREE.Mesh( skyGeometry, skyMaterial );\n\n\t\t\t\t\tscene.add( sky );\n\n\t\t\t\t\t// ground (half sphere):\n\n\t\t\t\t\tradius = 1.2e4;\n\n\t\t\t\t\tvar groundGeometry = new THREE.SphereGeometry( radius, segments, segments, 0, 2 * Math.PI, 0.5 * Math.PI, 1.5 * Math.PI );\n\n\t\t\t\t\tvar groundMaterial = new THREE.MeshBasicMaterial( { color: 'white', vertexColors: THREE.VertexColors, shading: THREE.NoShading } );\n\n\t\t\t\t\tgroundMaterial.side = THREE.BackSide;\n\n\t\t\t\t\tgroundMaterial.fog = false;\n\n\t\t\t\t\tgroundMaterial.color = new THREE.Color();\n\n\t\t\t\t\tpaintFaces( groundGeometry, radius, data.groundAngle, data.groundColor, false );\n\n\t\t\t\t\tvar ground = new THREE.Mesh( groundGeometry, groundMaterial );\n\n\t\t\t\t\tscene.add( ground );\n\n\t\t\t\t} else if ( /geometry/.exec( data.string ) ) {\n\n\t\t\t\t\tif ( 'Box' === data.nodeType ) {\n\n\t\t\t\t\t\tvar s = data.size;\n\n\t\t\t\t\t\tparent.geometry = new THREE.BoxGeometry( s.x, s.y, s.z );\n\n\t\t\t\t\t} else if ( 'Cylinder' === data.nodeType ) {\n\n\t\t\t\t\t\tparent.geometry = new THREE.CylinderGeometry( data.radius, data.radius, data.height );\n\n\t\t\t\t\t} else if ( 'Cone' === data.nodeType ) {\n\n\t\t\t\t\t\tparent.geometry = new THREE.CylinderGeometry( data.topRadius, data.bottomRadius, data.height );\n\n\t\t\t\t\t} else if ( 'Sphere' === data.nodeType ) {\n\n\t\t\t\t\t\tparent.geometry = new THREE.SphereGeometry( data.radius );\n\n\t\t\t\t\t} else if ( 'IndexedFaceSet' === data.nodeType ) {\n\n\t\t\t\t\t\tvar geometry = new THREE.Geometry();\n\n\t\t\t\t\t\tvar indexes;\n\n\t\t\t\t\t\tfor ( var i = 0, j = data.children.length; i < j; i++ ) {\n\n\t\t\t\t\t\t\tvar child = data.children[ i ];\n\n\t\t\t\t\t\t\tvar vec;\n\n\t\t\t\t\t\t\tif ( 'Coordinate' === child.nodeType ) {\n\n\t\t\t\t\t\t\t\tfor ( var k = 0, l = child.points.length; k < l; k++ ) {\n\n\t\t\t\t\t\t\t\t\tvar point = child.points[ k ];\n\n\t\t\t\t\t\t\t\t\tvec = new THREE.Vector3( point.x, point.y, point.z );\n\n\t\t\t\t\t\t\t\t\tgeometry.vertices.push( vec );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar skip = 0;\n\n\t\t\t\t\t\t// read this: http://math.hws.edu/eck/cs424/notes2013/16_Threejs_Advanced.html\n\t\t\t\t\t\tfor ( var i = 0, j = data.coordIndex.length; i < j; i++ ) {\n\n\t\t\t\t\t\t\tindexes = data.coordIndex[i];\n\n\t\t\t\t\t\t\t// vrml support multipoint indexed face sets (more then 3 vertices). You must calculate the composing triangles here\n\t\t\t\t\t\t\tskip = 0;\n\n\t\t\t\t\t\t\t// todo: this is the time to check if the faces are ordered ccw or not (cw)\n\n\t\t\t\t\t\t\t// Face3 only works with triangles, but IndexedFaceSet allows shapes with more then three vertices, build them of triangles\n\t\t\t\t\t\t\twhile ( indexes.length >= 3 && skip < ( indexes.length -2 ) ) {\n\n\t\t\t\t\t\t\t\tvar face = new THREE.Face3(\n\t\t\t\t\t\t\t\t\tindexes[0],\n\t\t\t\t\t\t\t\t\tindexes[skip + 1],\n\t\t\t\t\t\t\t\t\tindexes[skip + 2],\n\t\t\t\t\t\t\t\t\tnull // normal, will be added later\n\t\t\t\t\t\t\t\t\t// todo: pass in the color, if a color index is present\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tskip++;\n\n\t\t\t\t\t\t\t\tgeometry.faces.push( face );\n\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( false === data.solid ) {\n\t\t\t\t\t\t\tparent.material.side = THREE.DoubleSide;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// we need to store it on the geometry for use with defines\n\t\t\t\t\t\tgeometry.solid = data.solid;\n\n\t\t\t\t\t\tgeometry.computeFaceNormals();\n\t\t\t\t\t\t//geometry.computeVertexNormals(); // does not show\n\t\t\t\t\t\tgeometry.computeBoundingSphere();\n\n\t\t\t\t\t\t// see if it's a define\n\t\t\t\t\t\tif ( /DEF/.exec( data.string ) ) {\n\t\t\t\t\t\t\tgeometry.name = /DEF (\\w+)/.exec( data.string )[ 1 ];\n\t\t\t\t\t\t\tdefines[ geometry.name ] = geometry;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tparent.geometry = geometry;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn;\n\n\t\t\t\t} else if ( /appearance/.exec( data.string ) ) {\n\n\t\t\t\t\tfor ( var i = 0; i < data.children.length; i ++ ) {\n\n\t\t\t\t\t\tvar child = data.children[ i ];\n\n\t\t\t\t\t\tif ( 'Material' === child.nodeType ) {\n\t\t\t\t\t\t\tvar material = new THREE.MeshPhongMaterial();\n\n\t\t\t\t\t\t\tif ( undefined !== child.diffuseColor ) {\n\n\t\t\t\t\t\t\t\tvar d = child.diffuseColor;\n\n\t\t\t\t\t\t\t\tmaterial.color.setRGB( d.r, d.g, d.b );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( undefined !== child.emissiveColor ) {\n\n\t\t\t\t\t\t\t\tvar e = child.emissiveColor;\n\n\t\t\t\t\t\t\t\tmaterial.emissive.setRGB( e.r, e.g, e.b );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( undefined !== child.specularColor ) {\n\n\t\t\t\t\t\t\t\tvar s = child.specularColor;\n\n\t\t\t\t\t\t\t\tmaterial.specular.setRGB( s.r, s.g, s.b );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( undefined !== child.transparency ) {\n\n\t\t\t\t\t\t\t\tvar t = child.transparency;\n\n\t\t\t\t\t\t\t\t// transparency is opposite of opacity\n\t\t\t\t\t\t\t\tmaterial.opacity = Math.abs( 1 - t );\n\n\t\t\t\t\t\t\t\tmaterial.transparent = true;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( /DEF/.exec( data.string ) ) {\n\n\t\t\t\t\t\t\t\tmaterial.name = /DEF (\\w+)/.exec( data.string )[ 1 ];\n\n\t\t\t\t\t\t\t\tdefines[ material.name ] = material;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tparent.material = material;\n\n\t\t\t\t\t\t\t// material found, stop looping\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t\tfor ( var i = 0, l = data.children.length; i < l; i ++ ) {\n\n\t\t\t\t\tvar child = data.children[ i ];\n\n\t\t\t\t\tparseNode( data.children[ i ], object );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tparseNode( getTree( lines ), scene );\n\n\t\t};\n\n\t\tvar scene = new THREE.Scene();\n\n\t\tvar lines = data.split( '\\n' );\n\n\t\tvar header = lines.shift();\n\n\t\tif ( /V1.0/.exec( header ) ) {\n\n\t\t\tparseV1( lines, scene );\n\n\t\t} else if ( /V2.0/.exec( header ) ) {\n\n\t\t\tparseV2( lines, scene );\n\n\t\t}\n\n\t\treturn scene;\n\n\t}\n\n};\n\nTHREE.EventDispatcher.prototype.apply( THREE.VRMLLoader.prototype );\n\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Loaders/VTKLoader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Loaders/VTKLoader.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.VTKLoader = function () {};\n\nTHREE.VTKLoader.prototype = {\n\n\tconstructor: THREE.VTKLoader,\n\n\tload: function ( url, callback ) {\n          var func = \"THREE.VTKLoader.load\";\n\n          if (TiddlyWiki && url.match(/^tw:/)) {\n            var res = TiddlyWiki.load(url);\n            //hack.log(\"res.length = \"+res.length, hack.loader, func);\n            \n            var geometry = this.parse(res);\n            this.dispatchEvent({type: 'load', content: geometry});\n            if (callback) callback(geometry);\n           \n            hack.log(\"url: \"+url+\": loaded\", hack.loader, func);\n            return;\n          }\n\t\tvar scope = this;\n\t\tvar request = new XMLHttpRequest();\n\n\t\trequest.addEventListener( 'load', function ( event ) {\n\n\t\t\tvar geometry = scope.parse( event.target.responseText );\n\n\t\t\tscope.dispatchEvent( { type: 'load', content: geometry } );\n\n\t\t\tif ( callback ) callback( geometry );\n\n\t\t}, false );\n\n\t\trequest.addEventListener( 'progress', function ( event ) {\n\n\t\t\tscope.dispatchEvent( { type: 'progress', loaded: event.loaded, total: event.total } );\n\n\t\t}, false );\n\n\t\trequest.addEventListener( 'error', function () {\n\n\t\t\tscope.dispatchEvent( { type: 'error', message: 'Couldn\\'t load URL [' + url + ']' } );\n\n\t\t}, false );\n\n\t\trequest.open( 'GET', url, true );\n\t\trequest.send( null );\n\n\t},\n\n\tparse: function ( data ) {\n\n\t\tvar geometry = new THREE.Geometry();\n\n\t\tvar vertex = function ( x, y, z ) {\n\n\t\t\tgeometry.vertices.push( new THREE.Vector3( x, y, z ) );\n\n\t\t}\n\n\t\tvar face3 = function ( a, b, c ) {\n\n\t\t\tgeometry.faces.push( new THREE.Face3( a, b, c ) );\n\n\t\t}\n\n\t\tvar pattern, result;\n\n\t\t// float float float\n\n\t\tpattern = /([\\+|\\-]?[\\d]+[\\.]*[\\d|\\-|e]*)[ ]+([\\+|\\-]?[\\d]+[\\.]*[\\d|\\-|e]*)[ ]+([\\+|\\-]?[\\d]+[\\.]*[\\d|\\-|e]*)/g;\n\n\t\twhile ( ( result = pattern.exec( data ) ) !== null ) {\n\n\t\t\t// [\"1.0 2.0 3.0\", \"1.0\", \"2.0\", \"3.0\"]\n\n\t\t\tvertex( parseFloat( result[ 1 ] ), parseFloat( result[ 2 ] ), parseFloat( result[ 3 ] ) );\n\n\t\t}\n\n\t\t// 3 int int int\n\n\t\tpattern = /3[ ]+([\\d]+)[ ]+([\\d]+)[ ]+([\\d]+)/g;\n\n\t\twhile ( ( result = pattern.exec( data ) ) !== null ) {\n\n\t\t\t// [\"3 1 2 3\", \"1\", \"2\", \"3\"]\n\n\t\t\tface3( parseInt( result[ 1 ] ), parseInt( result[ 2 ] ), parseInt( result[ 3 ] ) );\n\n\t\t}\n\n\t\t// 4 int int int int\n\n\t\tpattern = /4[ ]+([\\d]+)[ ]+([\\d]+)[ ]+([\\d]+)[ ]+([\\d]+)/g;\n\n\t\twhile ( ( result = pattern.exec( data ) ) !== null ) {\n\n\t\t\t// [\"4 1 2 3 4\", \"1\", \"2\", \"3\", \"4\"]\n\n\t\t\tface3( parseInt( result[ 1 ] ), parseInt( result[ 2 ] ), parseInt( result[ 4 ] ) );\n\t\t\tface3( parseInt( result[ 2 ] ), parseInt( result[ 3 ] ), parseInt( result[ 4 ] ) );\n\n\t\t}\n\n\t\tgeometry.computeFaceNormals();\n\t\tgeometry.computeVertexNormals();\n\t\tgeometry.computeBoundingSphere();\n\n\t\treturn geometry;\n\n\t}\n\n};\n\nTHREE.EventDispatcher.prototype.apply( THREE.VTKLoader.prototype );\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Loaders/msgpack-js.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Loaders/msgpack-js.js",
            "module-type": "library",
            "text": "THREE.msgpack = {};\n\nTHREE.msgpack.inspect = function(buffer) {\n  if (buffer === undefined) return \"undefined\";\n  var view;\n  var type;\n  if (buffer instanceof ArrayBuffer) {\n    type = \"ArrayBuffer\";\n    view = new DataView(buffer);\n  }\n  else if (buffer instanceof DataView) {\n    type = \"DataView\";\n    view = buffer;\n  }\n  if (!view) return JSON.stringify(buffer);\n  var bytes = [];\n  for (var i = 0; i < buffer.byteLength; i++) {\n    if (i > 20) {\n      bytes.push(\"...\");\n      break;\n    }\n    var byte = view.getUint8(i).toString(16);\n    if (byte.length === 1) byte = \"0\" + byte;\n    bytes.push(byte);\n  }\n  return \"<\" + type + \" \" + bytes.join(\" \") + \">\";\n};\n\n// Encode string as utf8 into dataview at offset\nTHREE.msgpack.utf8Write = function(view, offset, string) {\n  var byteLength = view.byteLength;\n  for(var i = 0, l = string.length; i < l; i++) {\n    var codePoint = string.charCodeAt(i);\n\n    // One byte of UTF-8\n    if (codePoint < 0x80) {\n      view.setUint8(offset++, codePoint >>> 0 & 0x7f | 0x00);\n      continue;\n    }\n\n    // Two bytes of UTF-8\n    if (codePoint < 0x800) {\n      view.setUint8(offset++, codePoint >>> 6 & 0x1f | 0xc0);\n      view.setUint8(offset++, codePoint >>> 0 & 0x3f | 0x80);\n      continue;\n    }\n\n    // Three bytes of UTF-8.  \n    if (codePoint < 0x10000) {\n      view.setUint8(offset++, codePoint >>> 12 & 0x0f | 0xe0);\n      view.setUint8(offset++, codePoint >>> 6  & 0x3f | 0x80);\n      view.setUint8(offset++, codePoint >>> 0  & 0x3f | 0x80);\n      continue;\n    }\n\n    // Four bytes of UTF-8\n    if (codePoint < 0x110000) {\n      view.setUint8(offset++, codePoint >>> 18 & 0x07 | 0xf0);\n      view.setUint8(offset++, codePoint >>> 12 & 0x3f | 0x80);\n      view.setUint8(offset++, codePoint >>> 6  & 0x3f | 0x80);\n      view.setUint8(offset++, codePoint >>> 0  & 0x3f | 0x80);\n      continue;\n    }\n    throw new Error(\"bad codepoint \" + codePoint);\n  }\n};\n\nTHREE.msgpack.utf8Read = function(view, offset, length) {\n  var string = \"\";\n  for (var i = offset, end = offset + length; i < end; i++) {\n    var byte = view.getUint8(i);\n    // One byte character\n    if ((byte & 0x80) === 0x00) {\n      string += String.fromCharCode(byte);\n      continue;\n    }\n    // Two byte character\n    if ((byte & 0xe0) === 0xc0) {\n      string += String.fromCharCode(\n        ((byte & 0x0f) << 6) | \n        (view.getUint8(++i) & 0x3f)\n      );\n      continue;\n    }\n    // Three byte character\n    if ((byte & 0xf0) === 0xe0) {\n      string += String.fromCharCode(\n        ((byte & 0x0f) << 12) |\n        ((view.getUint8(++i) & 0x3f) << 6) |\n        ((view.getUint8(++i) & 0x3f) << 0)\n      );\n      continue;\n    }\n    // Four byte character\n    if ((byte & 0xf8) === 0xf0) {\n      string += String.fromCharCode(\n        ((byte & 0x07) << 18) |\n        ((view.getUint8(++i) & 0x3f) << 12) |\n        ((view.getUint8(++i) & 0x3f) << 6) |\n        ((view.getUint8(++i) & 0x3f) << 0)\n      );\n      continue;\n    }\n    throw new Error(\"Invalid byte \" + byte.toString(16));\n  }\n  return string;\n};\n\nTHREE.msgpack.utf8ByteCount = function(string) {\n  var count = 0;\n  for(var i = 0, l = string.length; i < l; i++) {\n    var codePoint = string.charCodeAt(i);\n    if (codePoint < 0x80) {\n      count += 1;\n      continue;\n    }\n    if (codePoint < 0x800) {\n      count += 2;\n      continue;\n    }\n    if (codePoint < 0x10000) {\n      count += 3;\n      continue;\n    }\n    if (codePoint < 0x110000) {\n      count += 4;\n      continue;\n    }\n    throw new Error(\"bad codepoint \" + codePoint);\n  }\n  return count;\n};\n\nTHREE.msgpack.encode = function(value) {\n  var buffer = new ArrayBuffer(sizeof(value));\n  var view = new DataView(buffer);\n  THREE.msgpack.encode1(value, view, 0);\n  return buffer;\n};\n\n// http://wiki.msgpack.org/display/MSGPACK/Format+specification\n// I've extended the protocol to have two new types that were previously reserved.\n//   buffer 16  11011000  0xd8\n//   buffer 32  11011001  0xd9\n// These work just like raw16 and raw32 except they are node buffers instead of strings.\n//\n// Also I've added a type for `undefined`\n//   undefined  11000100  0xc4\n\nTHREE.msgpack.Decoder = function(view, offset) {\n  this.offset = offset || 0;\n  this.view = view;\n};\nTHREE.msgpack.Decoder.prototype.map = function (length) {\n  var value = {};\n  for (var i = 0; i < length; i++) {\n    var key = this.parse();\n    value[key] = this.parse();\n  }\n  return value;\n};\nTHREE.msgpack.Decoder.prototype.buf = function (length) {\n  var value = new ArrayBuffer(length);\n  (new Uint8Array(value)).set(new Uint8Array(this.view.buffer, this.offset, length), 0);\n  this.offset += length;\n  return value;\n};\nTHREE.msgpack.Decoder.prototype.raw = function (length) {\n  var value = THREE.msgpack.utf8Read(this.view, this.offset, length);\n  this.offset += length;\n  return value;\n};\nTHREE.msgpack.Decoder.prototype.array = function (length) {\n  var value = new Array(length);\n  for (var i = 0; i < length; i++) {\n    value[i] = this.parse();\n  }\n  return value;\n};\nTHREE.msgpack.Decoder.prototype.parse = function () {\n  var type = this.view.getUint8(this.offset);\n  var value, length;\n  // FixRaw\n  if ((type & 0xe0) === 0xa0) {\n    length = type & 0x1f;\n    this.offset++;\n    return this.raw(length);\n  }\n  // FixMap\n  if ((type & 0xf0) === 0x80) {\n    length = type & 0x0f;\n    this.offset++;\n    return this.map(length);\n  }\n  // FixArray\n  if ((type & 0xf0) === 0x90) {\n    length = type & 0x0f;\n    this.offset++;\n    return this.array(length);\n  }\n  // Positive FixNum\n  if ((type & 0x80) === 0x00) {\n    this.offset++;\n    return type;\n  }\n  // Negative Fixnum\n  if ((type & 0xe0) === 0xe0) {\n    value = this.view.getInt8(this.offset);\n    this.offset++;\n    return value;\n  }\n  switch (type) {\n  // raw 16\n  case 0xda:\n    length = this.view.getUint16(this.offset + 1);\n    this.offset += 3;\n    return this.raw(length);\n  // raw 32\n  case 0xdb:\n    length = this.view.getUint32(this.offset + 1);\n    this.offset += 5;\n    return this.raw(length);\n  // nil\n  case 0xc0:\n    this.offset++;\n    return null;\n  // false\n  case 0xc2:\n    this.offset++;\n    return false;\n  // true\n  case 0xc3:\n    this.offset++;\n    return true;\n  // undefined\n  case 0xc4:\n    this.offset++;\n    return undefined;\n  // uint8\n  case 0xcc:\n    value = this.view.getUint8(this.offset + 1);\n    this.offset += 2;\n    return value;\n  // uint 16\n  case 0xcd:\n    value = this.view.getUint16(this.offset + 1);\n    this.offset += 3;\n    return value;\n  // uint 32\n  case 0xce:\n    value = this.view.getUint32(this.offset + 1);\n    this.offset += 5;\n    return value;\n  // int 8\n  case 0xd0:\n    value = this.view.getInt8(this.offset + 1);\n    this.offset += 2;\n    return value;\n  // int 16\n  case 0xd1:\n    value = this.view.getInt16(this.offset + 1);\n    this.offset += 3;\n    return value;\n  // int 32\n  case 0xd2:\n    value = this.view.getInt32(this.offset + 1);\n    this.offset += 5;\n    return value;\n  // map 16\n  case 0xde:\n    length = this.view.getUint16(this.offset + 1);\n    this.offset += 3;\n    return this.map(length);\n  // map 32\n  case 0xdf:\n    length = this.view.getUint32(this.offset + 1);\n    this.offset += 5;\n    return this.map(length);\n  // array 16\n  case 0xdc:\n    length = this.view.getUint16(this.offset + 1);\n    this.offset += 3;\n    return this.array(length);\n  // array 32\n  case 0xdd:\n    length = this.view.getUint32(this.offset + 1);\n    this.offset += 5;\n    return this.array(length);\n  // buffer 16\n  case 0xd8:\n    length = this.view.getUint16(this.offset + 1);\n    this.offset += 3;\n    return this.buf(length);\n  // buffer 32\n  case 0xd9:\n    length = this.view.getUint32(this.offset + 1);\n    this.offset += 5;\n    return this.buf(length);\n  // float\n  case 0xca:\n    value = this.view.getFloat32(this.offset + 1);\n    this.offset += 5;\n    return value;\n  // double\n  case 0xcb:\n    value = this.view.getFloat64(this.offset + 1);\n    this.offset += 9;\n    return value;\n  }\n  throw new Error(\"Unknown type 0x\" + type.toString(16));\n};\nTHREE.msgpack.decode = function(buffer) {\n  var view = new DataView(buffer);\n  var decoder = new THREE.msgpack.Decoder(view);\n  var value = decoder.parse();\n  if (decoder.offset !== buffer.byteLength) throw new Error((buffer.byteLength - decoder.offset) + \" trailing bytes\");\n  return value;\n};\n\nTHREE.msgpack.encode1 = function(value, view, offset) {\n  var type = typeof value;\n\n  // Strings Bytes\n  if (type === \"string\") {\n    var length = utf8ByteCount(value);\n    // fix raw\n    if (length < 0x20) {\n      view.setUint8(offset, length | 0xa0);\n      THREE.msgpack.utf8Write(view, offset + 1, value);\n      return 1 + length;\n    }\n    // raw 16\n    if (length < 0x10000) {\n      view.setUint8(offset, 0xda);\n      view.setUint16(offset + 1, length);\n      THREE.msgpack.utf8Write(view, offset + 3, value);\n      return 3 + length;\n    }\n    // raw 32\n    if (length < 0x100000000) {\n      view.setUint8(offset, 0xdb);\n      view.setUint32(offset + 1, length);\n      THREE.msgpack.utf8Write(view, offset + 5, value);\n      return 5 + length;\n    }\n  }\n\n  if (value instanceof ArrayBuffer) {\n    var length = value.byteLength;\n    // buffer 16\n    if (length < 0x10000) {\n      view.setUint8(offset, 0xd8);\n      view.setUint16(offset + 1, length);\n      (new Uint8Array(view.buffer)).set(new Uint8Array(value), offset + 3);\n      return 3 + length;\n    }\n    // buffer 32\n    if (length < 0x100000000) {\n      view.setUint8(offset, 0xd9);\n      view.setUint32(offset + 1, length);\n      (new Uint8Array(view.buffer)).set(new Uint8Array(value), offset + 5);\n      return 5 + length;\n    }\n  }\n  \n  if (type === \"number\") {\n    // Floating Point\n    if ((value << 0) !== value) {\n      view.setUint8(offset, 0xcb);\n      view.setFloat64(offset + 1, value);\n      return 9;\n    }\n\n    // Integers\n    if (value >=0) {\n      // positive fixnum\n      if (value < 0x80) {\n        view.setUint8(offset, value);\n        return 1;\n      }\n      // uint 8\n      if (value < 0x100) {\n        view.setUint8(offset, 0xcc);\n        view.setUint8(offset + 1, value);\n        return 2;\n      }\n      // uint 16\n      if (value < 0x10000) {\n        view.setUint8(offset, 0xcd);\n        view.setUint16(offset + 1, value);\n        return 3;\n      }\n      // uint 32\n      if (value < 0x100000000) {\n        view.setUint8(offset, 0xce);\n        view.setUint32(offset + 1, value);\n        return 5;\n      }\n      throw new Error(\"Number too big 0x\" + value.toString(16));\n    }\n    // negative fixnum\n    if (value >= -0x20) {\n      view.setInt8(offset, value);\n      return 1;\n    }\n    // int 8\n    if (value >= -0x80) {\n      view.setUint8(offset, 0xd0);\n      view.setInt8(offset + 1, value);\n      return 2;\n    }\n    // int 16\n    if (value >= -0x8000) {\n      view.setUint8(offset, 0xd1);\n      view.setInt16(offset + 1, value);\n      return 3;\n    }\n    // int 32\n    if (value >= -0x80000000) {\n      view.setUint8(offset, 0xd2);\n      view.setInt32(offset + 1, value);\n      return 5;\n    }\n    throw new Error(\"Number too small -0x\" + (-value).toString(16).substr(1));\n  }\n  \n  // undefined\n  if (type === \"undefined\") {\n    view.setUint8(offset, 0xc4);\n    return 1;\n  }\n  \n  // null\n  if (value === null) {\n    view.setUint8(offset, 0xc0);\n    return 1;\n  }\n\n  // Boolean\n  if (type === \"boolean\") {\n    view.setUint8(offset, value ? 0xc3 : 0xc2);\n    return 1;\n  }\n  \n  // Container Types\n  if (type === \"object\") {\n    var length, size = 0;\n    var isArray = Array.isArray(value);\n\n    if (isArray) {\n      length = value.length;\n    }\n    else {\n      var keys = Object.keys(value);\n      length = keys.length;\n    }\n\n    var size;\n    if (length < 0x10) {\n      view.setUint8(offset, length | (isArray ? 0x90 : 0x80));\n      size = 1;\n    }\n    else if (length < 0x10000) {\n      view.setUint8(offset, isArray ? 0xdc : 0xde);\n      view.setUint16(offset + 1, length);\n      size = 3;\n    }\n    else if (length < 0x100000000) {\n      view.setUint8(offset, isArray ? 0xdd : 0xdf);\n      view.setUint32(offset + 1, length);\n      size = 5;\n    }\n\n    if (isArray) {\n      for (var i = 0; i < length; i++) {\n        size += THREE.msgpack.encode(value[i], view, offset + size);\n      }\n    }\n    else {\n      for (var i = 0; i < length; i++) {\n        var key = keys[i];\n        size += THREE.msgpack.encode(key, view, offset + size);\n        size += THREE.msgpack.encode(value[key], view, offset + size);\n      }\n    }\n    \n    return size;\n  }\n  throw new Error(\"Unknown type \" + type);\n};\n\nTHREE.msgpack.sizeof = function(value) {\n  var type = typeof value;\n\n  // Raw Bytes\n  if (type === \"string\") {\n    var length = THREE.msgpack.utf8ByteCount(value);\n    if (length < 0x20) {\n      return 1 + length;\n    }\n    if (length < 0x10000) {\n      return 3 + length;\n    }\n    if (length < 0x100000000) {\n      return 5 + length;\n    }\n  }\n  \n  if (value instanceof ArrayBuffer) {\n    var length = value.byteLength;\n    if (length < 0x10000) {\n      return 3 + length;\n    }\n    if (length < 0x100000000) {\n      return 5 + length;\n    }\n  }\n  \n  if (type === \"number\") {\n    // Floating Point\n    // double\n    if (value << 0 !== value) return 9;\n\n    // Integers\n    if (value >=0) {\n      // positive fixnum\n      if (value < 0x80) return 1;\n      // uint 8\n      if (value < 0x100) return 2;\n      // uint 16\n      if (value < 0x10000) return 3;\n      // uint 32\n      if (value < 0x100000000) return 5;\n      // uint 64\n      if (value < 0x10000000000000000) return 9;\n      throw new Error(\"Number too big 0x\" + value.toString(16));\n    }\n    // negative fixnum\n    if (value >= -0x20) return 1;\n    // int 8\n    if (value >= -0x80) return 2;\n    // int 16\n    if (value >= -0x8000) return 3;\n    // int 32\n    if (value >= -0x80000000) return 5;\n    // int 64\n    if (value >= -0x8000000000000000) return 9;\n    throw new Error(\"Number too small -0x\" + value.toString(16).substr(1));\n  }\n  \n  // Boolean, null, undefined\n  if (type === \"boolean\" || type === \"undefined\" || value === null) return 1;\n  \n  // Container Types\n  if (type === \"object\") {\n    var length, size = 0;\n    if (Array.isArray(value)) {\n      length = value.length;\n      for (var i = 0; i < length; i++) {\n        size += sizeof(value[i]);\n      }\n    }\n    else {\n      var keys = Object.keys(value);\n      length = keys.length;\n      for (var i = 0; i < length; i++) {\n        var key = keys[i];\n        size += sizeof(key) + sizeof(value[key]);\n      }\n    }\n    if (length < 0x10) {\n      return 1 + size;\n    }\n    if (length < 0x10000) {\n      return 3 + size;\n    }\n    if (length < 0x100000000) {\n      return 5 + size;\n    }\n    throw new Error(\"Array or object too long 0x\" + length.toString(16));\n  }\n  throw new Error(\"Unknown type \" + type);\n};"
        },
        "$:/plugins/rboue/Three.js/Lib/Loaders/Ctm/CTMLoader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Loaders/Ctm/CTMLoader.js",
            "module-type": "library",
            "text": "/**\n * Loader for CTM encoded models generated by OpenCTM tools:\n *\thttp://openctm.sourceforge.net/\n *\n * Uses js-openctm library by Juan Mellado\n *\thttp://code.google.com/p/js-openctm/\n *\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.CTMLoader = function ( showStatus ) {\n\n\tTHREE.Loader.call( this, showStatus );\n\n};\n\nTHREE.CTMLoader.prototype = Object.create( THREE.Loader.prototype );\n\n// Load multiple CTM parts defined in JSON\n\nTHREE.CTMLoader.prototype.loadParts = function( url, callback, parameters ) {\n  var func = \"THREE.CTMLoader.loadParts\";\n\n\tparameters = parameters || {};\n\n\tvar scope = this;\n\n  if (TiddlyWiki && url.match(/^tw:/)) {\n    var res = TiddlyWiki.load(url);\n    //hack.log(\"res.length = \"+res.length, hack.loader, func);\n\n    var basePath = parameters.basePath ? parameters.basePath : this.extractUrlBase(url);\n    var jsonObject = JSON.parse(res);\n    var materials = [], geometries = [], counter = 0;\n    function callbackFinal(geometry) {\n      counter += 1;\n      geometries.push(geometry);\n      if (counter === jsonObject.offsets.length) {\n\tcallback(geometries, materials);\n      }\n    }\n\n    // init materials\n    for (var i = 0; i < jsonObject.materials.length; i++) {\n      materials[i] = scope.createMaterial(jsonObject.materials[i], basePath);\n    }\n\n    // load joined CTM file\n    var partUrl = basePath + jsonObject.data;\n    var parametersPart = {useWorker: parameters.useWorker, offsets: jsonObject.offsets};\n    scope.load(partUrl, callbackFinal, parametersPart);\n\n    hack.log(\"url: \"+url+\": loaded\", hack.loader, func);\n    return;\n  }\n\n\tvar xhr = new XMLHttpRequest();\n\n\tvar basePath = parameters.basePath ? parameters.basePath : this.extractUrlBase( url );\n\n\txhr.onreadystatechange = function() {\n\n\t\tif ( xhr.readyState === 4 ) {\n\n\t\t\tif ( xhr.status === 200 || xhr.status === 0 ) {\n\n\t\t\t\tvar jsonObject = JSON.parse( xhr.responseText );\n\n\t\t\t\tvar materials = [], geometries = [], counter = 0;\n\n\t\t\t\tfunction callbackFinal( geometry ) {\n\n\t\t\t\t\tcounter += 1;\n\n\t\t\t\t\tgeometries.push( geometry );\n\n\t\t\t\t\tif ( counter === jsonObject.offsets.length ) {\n\n\t\t\t\t\t\tcallback( geometries, materials );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\n\t\t\t\t// init materials\n\n\t\t\t\tfor ( var i = 0; i < jsonObject.materials.length; i ++ ) {\n\n\t\t\t\t\tmaterials[ i ] = scope.createMaterial( jsonObject.materials[ i ], basePath );\n\n\t\t\t\t}\n\n\t\t\t\t// load joined CTM file\n\n\t\t\t\tvar partUrl = basePath + jsonObject.data;\n\t\t\t\tvar parametersPart = { useWorker: parameters.useWorker, offsets: jsonObject.offsets };\n\t\t\t\tscope.load( partUrl, callbackFinal, parametersPart );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\txhr.open( \"GET\", url, true );\n\txhr.setRequestHeader( \"Content-Type\", \"text/plain\" );\n\txhr.send( null );\n\n};\n\n// Load CTMLoader compressed models\n//\t- parameters\n//\t\t- url (required)\n//\t\t- callback (required)\n\nTHREE.CTMLoader.prototype.load = function( url, callback, parameters ) {\n  var func = \"THREE.CTMLoader.load\";\n\n\tparameters = parameters || {};\n\n\tvar scope = this;\n\n\tvar offsets = parameters.offsets !== undefined ? parameters.offsets : [ 0 ];\n\n  if (TiddlyWiki && url.match(/^tw:/)) {\n    var res = TiddlyWiki.load(url);\n    //hack.log(\"res.length = \"+res.length, hack.loader, func);\n\n    var binaryData = new Uint8Array(res);\n    var s = Date.now();\n    if (parameters.useWorker) {\n      if (TiddlyWiki) {\n        alert(func+\": Worker() not supported !\");\n        return;\n      }\n      var worker = new Worker(\"js/loaders/ctm/CTMWorker.js\");\n      worker.onmessage = function(event) {\n\tvar files = event.data;\n\tfor (var i = 0; i < files.length; i++) {\n\t  var ctmFile = files[ i ];\n\t  var e1 = Date.now();\n\t  // console.log( \"CTM data parse time [worker]: \" + (e1-s) + \" ms\" );\n\t  scope.createModel( ctmFile, callback );\n\t  var e = Date.now();\n\t  console.log(\"model load time [worker]: \" + (e-e1) + \" ms, total: \" + (e-s));\n\t}\n      };\n      worker.postMessage({\"data\": binaryData, \"offsets\": offsets});\n    } else {\n      for (var i = 0; i < offsets.length; i++) {\n\tvar stream = new CTM.Stream(binaryData);\n\tstream.offset = offsets[i];\n\tvar ctmFile = new CTM.File(stream);\n\tscope.createModel(ctmFile, callback);\n      }\n      //var e = Date.now();\n      //console.log( \"CTM data parse time [inline]: \" + (e-s) + \" ms\" );\n    }\n\n    hack.log(\"url: \"+url+\": loaded\", hack.loader, func);\n    return;\n  }\n\n\tvar xhr = new XMLHttpRequest(),\n\t\tcallbackProgress = null;\n\n\tvar length = 0;\n\n\txhr.onreadystatechange = function() {\n\n\t\tif ( xhr.readyState === 4 ) {\n\n\t\t\tif ( xhr.status === 200 || xhr.status === 0 ) {\n\n\t\t\t\tvar binaryData = new Uint8Array(xhr.response);\n\n\t\t\t\tvar s = Date.now();\n\n\t\t\t\tif ( parameters.useWorker ) {\n\n\t\t\t\t\tvar worker = new Worker( \"js/loaders/ctm/CTMWorker.js\" );\n\n\t\t\t\t\tworker.onmessage = function( event ) {\n\n\t\t\t\t\t\tvar files = event.data;\n\n\t\t\t\t\t\tfor ( var i = 0; i < files.length; i ++ ) {\n\n\t\t\t\t\t\t\tvar ctmFile = files[ i ];\n\n\t\t\t\t\t\t\tvar e1 = Date.now();\n\t\t\t\t\t\t\t// console.log( \"CTM data parse time [worker]: \" + (e1-s) + \" ms\" );\n\n\t\t\t\t\t\t\tscope.createModel( ctmFile, callback );\n\n\t\t\t\t\t\t\tvar e = Date.now();\n\t\t\t\t\t\t\tconsole.log( \"model load time [worker]: \" + (e-e1) + \" ms, total: \" + (e-s));\n\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t};\n\n\t\t\t\t\tworker.postMessage( { \"data\": binaryData, \"offsets\": offsets } );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tfor ( var i = 0; i < offsets.length; i ++ ) {\n\n\t\t\t\t\t\tvar stream = new CTM.Stream( binaryData );\n\t\t\t\t\t\tstream.offset = offsets[ i ];\n\n\t\t\t\t\t\tvar ctmFile = new CTM.File( stream );\n\n\t\t\t\t\t\tscope.createModel( ctmFile, callback );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t//var e = Date.now();\n\t\t\t\t\t//console.log( \"CTM data parse time [inline]: \" + (e-s) + \" ms\" );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tconsole.error( \"Couldn't load [\" + url + \"] [\" + xhr.status + \"]\" );\n\n\t\t\t}\n\n\t\t} else if ( xhr.readyState === 3 ) {\n\n\t\t\tif ( callbackProgress ) {\n\n\t\t\t\tif ( length === 0 ) {\n\n\t\t\t\t\tlength = xhr.getResponseHeader( \"Content-Length\" );\n\n\t\t\t\t}\n\n\t\t\t\tcallbackProgress( { total: length, loaded: xhr.responseText.length } );\n\n\t\t\t}\n\n\t\t} else if ( xhr.readyState === 2 ) {\n\n\t\t\tlength = xhr.getResponseHeader( \"Content-Length\" );\n\n\t\t}\n\n\t}\n\n\txhr.open( \"GET\", url, true );\n\txhr.responseType = \"arraybuffer\";\n\n\txhr.send( null );\n\n};\n\n\nTHREE.CTMLoader.prototype.createModel = function ( file, callback ) {\n\n\tvar Model = function () {\n\n\t\tTHREE.BufferGeometry.call( this );\n\n\t\tthis.materials = [];\n\n\t\tvar indices = file.body.indices,\n\t\tpositions = file.body.vertices,\n\t\tnormals = file.body.normals;\n\n\t\tvar uvs, colors;\n\n\t\tvar uvMaps = file.body.uvMaps;\n\n\t\tif ( uvMaps !== undefined && uvMaps.length > 0 ) {\n\n\t\t\tuvs = uvMaps[ 0 ].uv;\n\n\t\t}\n\n\t\tvar attrMaps = file.body.attrMaps;\n\n\t\tif ( attrMaps !== undefined && attrMaps.length > 0 && attrMaps[ 0 ].name === 'Color' ) {\n\n\t\t\tcolors = attrMaps[ 0 ].attr;\n\n\t\t}\n\n\t\tthis.addAttribute( 'index', new THREE.BufferAttribute( indices, 1 ) );\n\t\tthis.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) );\n\n\t\tif ( normals !== undefined ) {\n\n\t\t\tthis.addAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) );\n\n\t\t}\n\n\t\tif ( uvs !== undefined ) {\n\n\t\t\tthis.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ) );\n\n\t\t}\n\n\t\tif ( colors !== undefined ) {\n\n\t\t\tthis.addAttribute( 'color', new THREE.BufferAttribute( colors, 4 ) );\n\n\t\t}\n\n\t}\n\n\tModel.prototype = Object.create( THREE.BufferGeometry.prototype );\n\n\tvar geometry = new Model();\n\n\tgeometry.computeOffsets();\n\n\t// compute vertex normals if not present in the CTM model\n\tif ( geometry.attributes[ \"normal\" ] === undefined ) {\n\t\tgeometry.computeVertexNormals();\n\t}\n\n\tcallback( geometry );\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Loaders/Ctm/ctm.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Loaders/Ctm/ctm.js",
            "module-type": "library",
            "text": "(function(){\n/*\nCopyright (c) 2011 Juan Mellado\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*/\n\n/*\nReferences:\n- \"OpenCTM: The Open Compressed Triangle Mesh file format\" by Marcus Geelnard\n  http://openctm.sourceforge.net/\n*/\n\nvar CTM = CTM || {};\n\nCTM.CompressionMethod = {\n  RAW: 0x00574152,\n  MG1: 0x0031474d,\n  MG2: 0x0032474d\n};\n\nCTM.Flags = {\n  NORMALS: 0x00000001\n};\n\nCTM.File = function(stream){\n  this.load(stream);\n};\n\nCTM.File.prototype.load = function(stream){\n  this.header = new CTM.FileHeader(stream);\n\n  this.body = new CTM.FileBody(this.header);\n  \n  this.getReader().read(stream, this.body);\n};\n\nCTM.File.prototype.getReader = function(){\n  var reader;\n\n  switch(this.header.compressionMethod){\n    case CTM.CompressionMethod.RAW:\n      reader = new CTM.ReaderRAW();\n      break;\n    case CTM.CompressionMethod.MG1:\n      reader = new CTM.ReaderMG1();\n      break;\n    case CTM.CompressionMethod.MG2:\n      reader = new CTM.ReaderMG2();\n      break;\n  }\n\n  return reader;\n};\n\nCTM.FileHeader = function(stream){\n  stream.readInt32(); //magic \"OCTM\"\n  this.fileFormat = stream.readInt32();\n  this.compressionMethod = stream.readInt32();\n  this.vertexCount = stream.readInt32();\n  this.triangleCount = stream.readInt32();\n  this.uvMapCount = stream.readInt32();\n  this.attrMapCount = stream.readInt32();\n  this.flags = stream.readInt32();\n  this.comment = stream.readString();\n};\n\nCTM.FileHeader.prototype.hasNormals = function(){\n  return this.flags & CTM.Flags.NORMALS;\n};\n\nCTM.FileBody = function(header){\n  var i = header.triangleCount * 3,\n      v = header.vertexCount * 3,\n      n = header.hasNormals()? header.vertexCount * 3: 0,\n      u = header.vertexCount * 2,\n      a = header.vertexCount * 4,\n      j = 0;\n\n  var data = new ArrayBuffer(\n    (i + v + n + (u * header.uvMapCount) + (a * header.attrMapCount) ) * 4);\n\n  this.indices = new Uint32Array(data, 0, i);\n\n  this.vertices = new Float32Array(data, i * 4, v);\n\n  if ( header.hasNormals() ){\n    this.normals = new Float32Array(data, (i + v) * 4, n);\n  }\n  \n  if (header.uvMapCount){\n    this.uvMaps = [];\n    for (j = 0; j < header.uvMapCount; ++ j){\n      this.uvMaps[j] = {uv: new Float32Array(data,\n        (i + v + n + (j * u) ) * 4, u) };\n    }\n  }\n  \n  if (header.attrMapCount){\n    this.attrMaps = [];\n    for (j = 0; j < header.attrMapCount; ++ j){\n      this.attrMaps[j] = {attr: new Float32Array(data,\n        (i + v + n + (u * header.uvMapCount) + (j * a) ) * 4, a) };\n    }\n  }\n};\n\nCTM.FileMG2Header = function(stream){\n  stream.readInt32(); //magic \"MG2H\"\n  this.vertexPrecision = stream.readFloat32();\n  this.normalPrecision = stream.readFloat32();\n  this.lowerBoundx = stream.readFloat32();\n  this.lowerBoundy = stream.readFloat32();\n  this.lowerBoundz = stream.readFloat32();\n  this.higherBoundx = stream.readFloat32();\n  this.higherBoundy = stream.readFloat32();\n  this.higherBoundz = stream.readFloat32();\n  this.divx = stream.readInt32();\n  this.divy = stream.readInt32();\n  this.divz = stream.readInt32();\n  \n  this.sizex = (this.higherBoundx - this.lowerBoundx) / this.divx;\n  this.sizey = (this.higherBoundy - this.lowerBoundy) / this.divy;\n  this.sizez = (this.higherBoundz - this.lowerBoundz) / this.divz;\n};\n\nCTM.ReaderRAW = function(){\n};\n\nCTM.ReaderRAW.prototype.read = function(stream, body){\n  this.readIndices(stream, body.indices);\n  this.readVertices(stream, body.vertices);\n  \n  if (body.normals){\n    this.readNormals(stream, body.normals);\n  }\n  if (body.uvMaps){\n    this.readUVMaps(stream, body.uvMaps);\n  }\n  if (body.attrMaps){\n    this.readAttrMaps(stream, body.attrMaps);\n  }\n};\n\nCTM.ReaderRAW.prototype.readIndices = function(stream, indices){\n  stream.readInt32(); //magic \"INDX\"\n  stream.readArrayInt32(indices);\n};\n\nCTM.ReaderRAW.prototype.readVertices = function(stream, vertices){\n  stream.readInt32(); //magic \"VERT\"\n  stream.readArrayFloat32(vertices);\n};\n\nCTM.ReaderRAW.prototype.readNormals = function(stream, normals){\n  stream.readInt32(); //magic \"NORM\"\n  stream.readArrayFloat32(normals);\n};\n\nCTM.ReaderRAW.prototype.readUVMaps = function(stream, uvMaps){\n  var i = 0;\n  for (; i < uvMaps.length; ++ i){\n    stream.readInt32(); //magic \"TEXC\"\n\n    uvMaps[i].name = stream.readString();\n    uvMaps[i].filename = stream.readString();\n    stream.readArrayFloat32(uvMaps[i].uv);\n  }\n};\n\nCTM.ReaderRAW.prototype.readAttrMaps = function(stream, attrMaps){\n  var i = 0;\n  for (; i < attrMaps.length; ++ i){\n    stream.readInt32(); //magic \"ATTR\"\n\n    attrMaps[i].name = stream.readString();\n    stream.readArrayFloat32(attrMaps[i].attr);\n  }\n};\n\nCTM.ReaderMG1 = function(){\n};\n\nCTM.ReaderMG1.prototype.read = function(stream, body){\n  this.readIndices(stream, body.indices);\n  this.readVertices(stream, body.vertices);\n  \n  if (body.normals){\n    this.readNormals(stream, body.normals);\n  }\n  if (body.uvMaps){\n    this.readUVMaps(stream, body.uvMaps);\n  }\n  if (body.attrMaps){\n    this.readAttrMaps(stream, body.attrMaps);\n  }\n};\n\nCTM.ReaderMG1.prototype.readIndices = function(stream, indices){\n  stream.readInt32(); //magic \"INDX\"\n  stream.readInt32(); //packed size\n  \n  var interleaved = new CTM.InterleavedStream(indices, 3);\n  LZMA.decompress(stream, stream, interleaved, interleaved.data.length);\n\n  CTM.restoreIndices(indices, indices.length);\n};\n\nCTM.ReaderMG1.prototype.readVertices = function(stream, vertices){\n  stream.readInt32(); //magic \"VERT\"\n  stream.readInt32(); //packed size\n  \n  var interleaved = new CTM.InterleavedStream(vertices, 1);\n  LZMA.decompress(stream, stream, interleaved, interleaved.data.length);\n};\n\nCTM.ReaderMG1.prototype.readNormals = function(stream, normals){\n  stream.readInt32(); //magic \"NORM\"\n  stream.readInt32(); //packed size\n\n  var interleaved = new CTM.InterleavedStream(normals, 3);\n  LZMA.decompress(stream, stream, interleaved, interleaved.data.length);\n};\n\nCTM.ReaderMG1.prototype.readUVMaps = function(stream, uvMaps){\n  var i = 0;\n  for (; i < uvMaps.length; ++ i){\n    stream.readInt32(); //magic \"TEXC\"\n\n    uvMaps[i].name = stream.readString();\n    uvMaps[i].filename = stream.readString();\n    \n    stream.readInt32(); //packed size\n\n    var interleaved = new CTM.InterleavedStream(uvMaps[i].uv, 2);\n    LZMA.decompress(stream, stream, interleaved, interleaved.data.length);\n  }\n};\n\nCTM.ReaderMG1.prototype.readAttrMaps = function(stream, attrMaps){\n  var i = 0;\n  for (; i < attrMaps.length; ++ i){\n    stream.readInt32(); //magic \"ATTR\"\n\n    attrMaps[i].name = stream.readString();\n    \n    stream.readInt32(); //packed size\n\n    var interleaved = new CTM.InterleavedStream(attrMaps[i].attr, 4);\n    LZMA.decompress(stream, stream, interleaved, interleaved.data.length);\n  }\n};\n\nCTM.ReaderMG2 = function(){\n};\n\nCTM.ReaderMG2.prototype.read = function(stream, body){\n  this.MG2Header = new CTM.FileMG2Header(stream);\n  \n  this.readVertices(stream, body.vertices);\n  this.readIndices(stream, body.indices);\n  \n  if (body.normals){\n    this.readNormals(stream, body);\n  }\n  if (body.uvMaps){\n    this.readUVMaps(stream, body.uvMaps);\n  }\n  if (body.attrMaps){\n    this.readAttrMaps(stream, body.attrMaps);\n  }\n};\n\nCTM.ReaderMG2.prototype.readVertices = function(stream, vertices){\n  stream.readInt32(); //magic \"VERT\"\n  stream.readInt32(); //packed size\n\n  var interleaved = new CTM.InterleavedStream(vertices, 3);\n  LZMA.decompress(stream, stream, interleaved, interleaved.data.length);\n  \n  var gridIndices = this.readGridIndices(stream, vertices);\n  \n  CTM.restoreVertices(vertices, this.MG2Header, gridIndices, this.MG2Header.vertexPrecision);\n};\n\nCTM.ReaderMG2.prototype.readGridIndices = function(stream, vertices){\n  stream.readInt32(); //magic \"GIDX\"\n  stream.readInt32(); //packed size\n  \n  var gridIndices = new Uint32Array(vertices.length / 3);\n  \n  var interleaved = new CTM.InterleavedStream(gridIndices, 1);\n  LZMA.decompress(stream, stream, interleaved, interleaved.data.length);\n  \n  CTM.restoreGridIndices(gridIndices, gridIndices.length);\n  \n  return gridIndices;\n};\n\nCTM.ReaderMG2.prototype.readIndices = function(stream, indices){\n  stream.readInt32(); //magic \"INDX\"\n  stream.readInt32(); //packed size\n\n  var interleaved = new CTM.InterleavedStream(indices, 3);\n  LZMA.decompress(stream, stream, interleaved, interleaved.data.length);\n\n  CTM.restoreIndices(indices, indices.length);\n};\n\nCTM.ReaderMG2.prototype.readNormals = function(stream, body){\n  stream.readInt32(); //magic \"NORM\"\n  stream.readInt32(); //packed size\n\n  var interleaved = new CTM.InterleavedStream(body.normals, 3);\n  LZMA.decompress(stream, stream, interleaved, interleaved.data.length);\n\n  var smooth = CTM.calcSmoothNormals(body.indices, body.vertices);\n\n  CTM.restoreNormals(body.normals, smooth, this.MG2Header.normalPrecision);\n};\n\nCTM.ReaderMG2.prototype.readUVMaps = function(stream, uvMaps){\n  var i = 0;\n  for (; i < uvMaps.length; ++ i){\n    stream.readInt32(); //magic \"TEXC\"\n\n    uvMaps[i].name = stream.readString();\n    uvMaps[i].filename = stream.readString();\n    \n    var precision = stream.readFloat32();\n    \n    stream.readInt32(); //packed size\n\n    var interleaved = new CTM.InterleavedStream(uvMaps[i].uv, 2);\n    LZMA.decompress(stream, stream, interleaved, interleaved.data.length);\n    \n    CTM.restoreMap(uvMaps[i].uv, 2, precision);\n  }\n};\n\nCTM.ReaderMG2.prototype.readAttrMaps = function(stream, attrMaps){\n  var i = 0;\n  for (; i < attrMaps.length; ++ i){\n    stream.readInt32(); //magic \"ATTR\"\n\n    attrMaps[i].name = stream.readString();\n    \n    var precision = stream.readFloat32();\n    \n    stream.readInt32(); //packed size\n\n    var interleaved = new CTM.InterleavedStream(attrMaps[i].attr, 4);\n    LZMA.decompress(stream, stream, interleaved, interleaved.data.length);\n    \n    CTM.restoreMap(attrMaps[i].attr, 4, precision);\n  }\n};\n\nCTM.restoreIndices = function(indices, len){\n  var i = 3;\n  if (len > 0){\n    indices[2] += indices[0];\n    indices[1] += indices[0];\n  }\n  for (; i < len; i += 3){\n    indices[i] += indices[i - 3];\n    \n    if (indices[i] === indices[i - 3]){\n      indices[i + 1] += indices[i - 2];\n    }else{\n      indices[i + 1] += indices[i];\n    }\n\n    indices[i + 2] += indices[i];\n  }\n};\n\nCTM.restoreGridIndices = function(gridIndices, len){\n  var i = 1;\n  for (; i < len; ++ i){\n    gridIndices[i] += gridIndices[i - 1];\n  }\n};\n\nCTM.restoreVertices = function(vertices, grid, gridIndices, precision){\n  var gridIdx, delta, x, y, z,\n      intVertices = new Uint32Array(vertices.buffer, vertices.byteOffset, vertices.length),\n      ydiv = grid.divx, zdiv = ydiv * grid.divy,\n      prevGridIdx = 0x7fffffff, prevDelta = 0,\n      i = 0, j = 0, len = gridIndices.length;\n\n  for (; i < len; j += 3){\n    x = gridIdx = gridIndices[i ++];\n    \n    z = ~~(x / zdiv);\n    x -= ~~(z * zdiv);\n    y = ~~(x / ydiv);\n    x -= ~~(y * ydiv);\n\n    delta = intVertices[j];\n    if (gridIdx === prevGridIdx){\n      delta += prevDelta;\n    }\n\n    vertices[j]     = grid.lowerBoundx +\n      x * grid.sizex + precision * delta;\n    vertices[j + 1] = grid.lowerBoundy +\n      y * grid.sizey + precision * intVertices[j + 1];\n    vertices[j + 2] = grid.lowerBoundz +\n      z * grid.sizez + precision * intVertices[j + 2];\n\n    prevGridIdx = gridIdx;\n    prevDelta = delta;\n  }\n};\n\nCTM.restoreNormals = function(normals, smooth, precision){\n  var ro, phi, theta, sinPhi,\n      nx, ny, nz, by, bz, len,\n      intNormals = new Uint32Array(normals.buffer, normals.byteOffset, normals.length),\n      i = 0, k = normals.length,\n      PI_DIV_2 = 3.141592653589793238462643 * 0.5;\n\n  for (; i < k; i += 3){\n    ro = intNormals[i] * precision;\n    phi = intNormals[i + 1];\n\n    if (phi === 0){\n      normals[i]     = smooth[i]     * ro;\n      normals[i + 1] = smooth[i + 1] * ro;\n      normals[i + 2] = smooth[i + 2] * ro;\n    }else{\n      \n      if (phi <= 4){\n        theta = (intNormals[i + 2] - 2) * PI_DIV_2;\n      }else{\n        theta = ( (intNormals[i + 2] * 4 / phi) - 2) * PI_DIV_2;\n      }\n      \n      phi *= precision * PI_DIV_2;\n      sinPhi = ro * Math.sin(phi);\n\n      nx = sinPhi * Math.cos(theta);\n      ny = sinPhi * Math.sin(theta);\n      nz = ro * Math.cos(phi);\n\n      bz = smooth[i + 1];\n      by = smooth[i] - smooth[i + 2];\n\n      len = Math.sqrt(2 * bz * bz + by * by);\n      if (len > 1e-20){\n        by /= len;\n        bz /= len;\n      }\n\n      normals[i]     = smooth[i]     * nz +\n        (smooth[i + 1] * bz - smooth[i + 2] * by) * ny - bz * nx;\n      normals[i + 1] = smooth[i + 1] * nz -\n        (smooth[i + 2]      + smooth[i]   ) * bz  * ny + by * nx;\n      normals[i + 2] = smooth[i + 2] * nz +\n        (smooth[i]     * by + smooth[i + 1] * bz) * ny + bz * nx;\n    }\n  }\n};\n\nCTM.restoreMap = function(map, count, precision){\n  var delta, value,\n      intMap = new Uint32Array(map.buffer, map.byteOffset, map.length),\n      i = 0, j, len = map.length;\n\n  for (; i < count; ++ i){\n    delta = 0;\n\n    for (j = i; j < len; j += count){\n      value = intMap[j];\n      \n      delta += value & 1? -( (value + 1) >> 1): value >> 1;\n      \n      map[j] = delta * precision;\n    }\n  }\n};\n\nCTM.calcSmoothNormals = function(indices, vertices){\n  var smooth = new Float32Array(vertices.length),\n      indx, indy, indz, nx, ny, nz,\n      v1x, v1y, v1z, v2x, v2y, v2z, len,\n      i, k;\n\n  for (i = 0, k = indices.length; i < k;){\n    indx = indices[i ++] * 3;\n    indy = indices[i ++] * 3;\n    indz = indices[i ++] * 3;\n\n    v1x = vertices[indy]     - vertices[indx];\n    v2x = vertices[indz]     - vertices[indx];\n    v1y = vertices[indy + 1] - vertices[indx + 1];\n    v2y = vertices[indz + 1] - vertices[indx + 1];\n    v1z = vertices[indy + 2] - vertices[indx + 2];\n    v2z = vertices[indz + 2] - vertices[indx + 2];\n    \n    nx = v1y * v2z - v1z * v2y;\n    ny = v1z * v2x - v1x * v2z;\n    nz = v1x * v2y - v1y * v2x;\n    \n    len = Math.sqrt(nx * nx + ny * ny + nz * nz);\n    if (len > 1e-10){\n      nx /= len;\n      ny /= len;\n      nz /= len;\n    }\n    \n    smooth[indx]     += nx;\n    smooth[indx + 1] += ny;\n    smooth[indx + 2] += nz;\n    smooth[indy]     += nx;\n    smooth[indy + 1] += ny;\n    smooth[indy + 2] += nz;\n    smooth[indz]     += nx;\n    smooth[indz + 1] += ny;\n    smooth[indz + 2] += nz;\n  }\n\n  for (i = 0, k = smooth.length; i < k; i += 3){\n    len = Math.sqrt(smooth[i] * smooth[i] + \n      smooth[i + 1] * smooth[i + 1] +\n      smooth[i + 2] * smooth[i + 2]);\n\n    if(len > 1e-10){\n      smooth[i]     /= len;\n      smooth[i + 1] /= len;\n      smooth[i + 2] /= len;\n    }\n  }\n\n  return smooth;\n};\n\nCTM.isLittleEndian = (function(){\n  var buffer = new ArrayBuffer(2),\n      bytes = new Uint8Array(buffer),\n      ints = new Uint16Array(buffer);\n\n  bytes[0] = 1;\n\n  return ints[0] === 1;\n}());\n\nCTM.InterleavedStream = function(data, count){\n  this.data = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);\n  this.offset = CTM.isLittleEndian? 3: 0;\n  this.count = count * 4;\n  this.len = this.data.length;\n};\n\nCTM.InterleavedStream.prototype.writeByte = function(value){\n  this.data[this.offset] = value;\n  \n  this.offset += this.count;\n  if (this.offset >= this.len){\n  \n    this.offset -= this.len - 4;\n    if (this.offset >= this.count){\n    \n      this.offset -= this.count + (CTM.isLittleEndian? 1: -1);\n    }\n  }\n};\n\nCTM.Stream = function(data){\n  this.data = data;\n  this.offset = 0;\n};\n\nCTM.Stream.prototype.TWO_POW_MINUS23 = Math.pow(2, -23);\n\nCTM.Stream.prototype.TWO_POW_MINUS126 = Math.pow(2, -126);\n\nCTM.Stream.prototype.readByte = function(){\n  return this.data[this.offset ++] & 0xff;\n};\n\nCTM.Stream.prototype.readInt32 = function(){\n  var i = this.readByte();\n  i |= this.readByte() << 8;\n  i |= this.readByte() << 16;\n  return i | (this.readByte() << 24);\n};\n\nCTM.Stream.prototype.readFloat32 = function(){\n  var m = this.readByte();\n  m += this.readByte() << 8;\n\n  var b1 = this.readByte();\n  var b2 = this.readByte();\n\n  m += (b1 & 0x7f) << 16; \n  var e = ( (b2 & 0x7f) << 1) | ( (b1 & 0x80) >>> 7);\n  var s = b2 & 0x80? -1: 1;\n\n  if (e === 255){\n    return m !== 0? NaN: s * Infinity;\n  }\n  if (e > 0){\n    return s * (1 + (m * this.TWO_POW_MINUS23) ) * Math.pow(2, e - 127);\n  }\n  if (m !== 0){\n    return s * m * this.TWO_POW_MINUS126;\n  }\n  return s * 0;\n};\n\nCTM.Stream.prototype.readString = function(){\n  var len = this.readInt32();\n\n  this.offset += len;\n\n  return String.fromCharCode.apply(null,this.data.subarray(this.offset - len, this.offset));\n};\n\nCTM.Stream.prototype.readArrayInt32 = function(array){\n  var i = 0, len = array.length;\n  \n  while(i < len){\n    array[i ++] = this.readInt32();\n  }\n\n  return array;\n};\n\nCTM.Stream.prototype.readArrayFloat32 = function(array){\n  var i = 0, len = array.length;\n\n  while(i < len){\n    array[i ++] = this.readFloat32();\n  }\n\n  return array;\n};\n\nexports.CTM = CTM;})();\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Loaders/Ctm/lzma.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Loaders/Ctm/lzma.js",
            "module-type": "library",
            "text": "(function(){\n\nvar LZMA = LZMA || {};\n\nLZMA.OutWindow = function(){\n  this._windowSize = 0;\n};\n\nLZMA.OutWindow.prototype.create = function(windowSize){\n  if ( (!this._buffer) || (this._windowSize !== windowSize) ){\n    this._buffer = [];\n  }\n  this._windowSize = windowSize;\n  this._pos = 0;\n  this._streamPos = 0;\n};\n\nLZMA.OutWindow.prototype.flush = function(){\n  var size = this._pos - this._streamPos;\n  if (size !== 0){\n    while(size --){\n      this._stream.writeByte(this._buffer[this._streamPos ++]);\n    }\n    if (this._pos >= this._windowSize){\n      this._pos = 0;\n    }\n    this._streamPos = this._pos;\n  }\n};\n\nLZMA.OutWindow.prototype.releaseStream = function(){\n  this.flush();\n  this._stream = null;\n};\n\nLZMA.OutWindow.prototype.setStream = function(stream){\n  this.releaseStream();\n  this._stream = stream;\n};\n\nLZMA.OutWindow.prototype.init = function(solid){\n  if (!solid){\n    this._streamPos = 0;\n    this._pos = 0;\n  }\n};\n\nLZMA.OutWindow.prototype.copyBlock = function(distance, len){\n  var pos = this._pos - distance - 1;\n  if (pos < 0){\n    pos += this._windowSize;\n  }\n  while(len --){\n    if (pos >= this._windowSize){\n      pos = 0;\n    }\n    this._buffer[this._pos ++] = this._buffer[pos ++];\n    if (this._pos >= this._windowSize){\n      this.flush();\n    }\n  }\n};\n\nLZMA.OutWindow.prototype.putByte = function(b){\n  this._buffer[this._pos ++] = b;\n  if (this._pos >= this._windowSize){\n    this.flush();\n  }\n};\n\nLZMA.OutWindow.prototype.getByte = function(distance){\n  var pos = this._pos - distance - 1;\n  if (pos < 0){\n    pos += this._windowSize;\n  }\n  return this._buffer[pos];\n};\n\nLZMA.RangeDecoder = function(){\n};\n\nLZMA.RangeDecoder.prototype.setStream = function(stream){\n  this._stream = stream;\n};\n\nLZMA.RangeDecoder.prototype.releaseStream = function(){\n  this._stream = null;\n};\n\nLZMA.RangeDecoder.prototype.init = function(){\n  var i = 5;\n\n  this._code = 0;\n  this._range = -1;\n  \n  while(i --){\n    this._code = (this._code << 8) | this._stream.readByte();\n  }\n};\n\nLZMA.RangeDecoder.prototype.decodeDirectBits = function(numTotalBits){\n  var result = 0, i = numTotalBits, t;\n\n  while(i --){\n    this._range >>>= 1;\n    t = (this._code - this._range) >>> 31;\n    this._code -= this._range & (t - 1);\n    result = (result << 1) | (1 - t);\n\n    if ( (this._range & 0xff000000) === 0){\n      this._code = (this._code << 8) | this._stream.readByte();\n      this._range <<= 8;\n    }\n  }\n\n  return result;\n};\n\nLZMA.RangeDecoder.prototype.decodeBit = function(probs, index){\n  var prob = probs[index],\n      newBound = (this._range >>> 11) * prob;\n\n  if ( (this._code ^ 0x80000000) < (newBound ^ 0x80000000) ){\n    this._range = newBound;\n    probs[index] += (2048 - prob) >>> 5;\n    if ( (this._range & 0xff000000) === 0){\n      this._code = (this._code << 8) | this._stream.readByte();\n      this._range <<= 8;\n    }\n    return 0;\n  }\n\n  this._range -= newBound;\n  this._code -= newBound;\n  probs[index] -= prob >>> 5;\n  if ( (this._range & 0xff000000) === 0){\n    this._code = (this._code << 8) | this._stream.readByte();\n    this._range <<= 8;\n  }\n  return 1;\n};\n\nLZMA.initBitModels = function(probs, len){\n  while(len --){\n    probs[len] = 1024;\n  }\n};\n\nLZMA.BitTreeDecoder = function(numBitLevels){\n  this._models = [];\n  this._numBitLevels = numBitLevels;\n};\n\nLZMA.BitTreeDecoder.prototype.init = function(){\n  LZMA.initBitModels(this._models, 1 << this._numBitLevels);\n};\n\nLZMA.BitTreeDecoder.prototype.decode = function(rangeDecoder){\n  var m = 1, i = this._numBitLevels;\n\n  while(i --){\n    m = (m << 1) | rangeDecoder.decodeBit(this._models, m);\n  }\n  return m - (1 << this._numBitLevels);\n};\n\nLZMA.BitTreeDecoder.prototype.reverseDecode = function(rangeDecoder){\n  var m = 1, symbol = 0, i = 0, bit;\n\n  for (; i < this._numBitLevels; ++ i){\n    bit = rangeDecoder.decodeBit(this._models, m);\n    m = (m << 1) | bit;\n    symbol |= bit << i;\n  }\n  return symbol;\n};\n\nLZMA.reverseDecode2 = function(models, startIndex, rangeDecoder, numBitLevels){\n  var m = 1, symbol = 0, i = 0, bit;\n\n  for (; i < numBitLevels; ++ i){\n    bit = rangeDecoder.decodeBit(models, startIndex + m);\n    m = (m << 1) | bit;\n    symbol |= bit << i;\n  }\n  return symbol;\n};\n\nLZMA.LenDecoder = function(){\n  this._choice = [];\n  this._lowCoder = [];\n  this._midCoder = [];\n  this._highCoder = new LZMA.BitTreeDecoder(8);\n  this._numPosStates = 0;\n};\n\nLZMA.LenDecoder.prototype.create = function(numPosStates){\n  for (; this._numPosStates < numPosStates; ++ this._numPosStates){\n    this._lowCoder[this._numPosStates] = new LZMA.BitTreeDecoder(3);\n    this._midCoder[this._numPosStates] = new LZMA.BitTreeDecoder(3);\n  }\n};\n\nLZMA.LenDecoder.prototype.init = function(){\n  var i = this._numPosStates;\n  LZMA.initBitModels(this._choice, 2);\n  while(i --){\n    this._lowCoder[i].init();\n    this._midCoder[i].init();\n  }\n  this._highCoder.init();\n};\n\nLZMA.LenDecoder.prototype.decode = function(rangeDecoder, posState){\n  if (rangeDecoder.decodeBit(this._choice, 0) === 0){\n    return this._lowCoder[posState].decode(rangeDecoder);\n  }\n  if (rangeDecoder.decodeBit(this._choice, 1) === 0){\n    return 8 + this._midCoder[posState].decode(rangeDecoder);\n  }\n  return 16 + this._highCoder.decode(rangeDecoder);\n};\n\nLZMA.Decoder2 = function(){\n  this._decoders = [];\n};\n\nLZMA.Decoder2.prototype.init = function(){\n  LZMA.initBitModels(this._decoders, 0x300);\n};\n\nLZMA.Decoder2.prototype.decodeNormal = function(rangeDecoder){\n  var symbol = 1;\n\n  do{\n    symbol = (symbol << 1) | rangeDecoder.decodeBit(this._decoders, symbol);\n  }while(symbol < 0x100);\n\n  return symbol & 0xff;\n};\n\nLZMA.Decoder2.prototype.decodeWithMatchByte = function(rangeDecoder, matchByte){\n  var symbol = 1, matchBit, bit;\n\n  do{\n    matchBit = (matchByte >> 7) & 1;\n    matchByte <<= 1;\n    bit = rangeDecoder.decodeBit(this._decoders, ( (1 + matchBit) << 8) + symbol);\n    symbol = (symbol << 1) | bit;\n    if (matchBit !== bit){\n      while(symbol < 0x100){\n        symbol = (symbol << 1) | rangeDecoder.decodeBit(this._decoders, symbol);\n      }\n      break;\n    }\n  }while(symbol < 0x100);\n\n  return symbol & 0xff;\n};\n\nLZMA.LiteralDecoder = function(){\n};\n\nLZMA.LiteralDecoder.prototype.create = function(numPosBits, numPrevBits){\n  var i;\n\n  if (this._coders\n    && (this._numPrevBits === numPrevBits)\n    && (this._numPosBits === numPosBits) ){\n    return;\n  }\n  this._numPosBits = numPosBits;\n  this._posMask = (1 << numPosBits) - 1;\n  this._numPrevBits = numPrevBits;\n\n  this._coders = [];\n\n  i = 1 << (this._numPrevBits + this._numPosBits);\n  while(i --){\n    this._coders[i] = new LZMA.Decoder2();\n  }\n};\n\nLZMA.LiteralDecoder.prototype.init = function(){\n  var i = 1 << (this._numPrevBits + this._numPosBits);\n  while(i --){\n    this._coders[i].init();\n  }\n};\n\nLZMA.LiteralDecoder.prototype.getDecoder = function(pos, prevByte){\n  return this._coders[( (pos & this._posMask) << this._numPrevBits)\n    + ( (prevByte & 0xff) >>> (8 - this._numPrevBits) )];\n};\n\nLZMA.Decoder = function(){\n  this._outWindow = new LZMA.OutWindow();\n  this._rangeDecoder = new LZMA.RangeDecoder();\n  this._isMatchDecoders = [];\n  this._isRepDecoders = [];\n  this._isRepG0Decoders = [];\n  this._isRepG1Decoders = [];\n  this._isRepG2Decoders = [];\n  this._isRep0LongDecoders = [];\n  this._posSlotDecoder = [];\n  this._posDecoders = [];\n  this._posAlignDecoder = new LZMA.BitTreeDecoder(4);\n  this._lenDecoder = new LZMA.LenDecoder();\n  this._repLenDecoder = new LZMA.LenDecoder();\n  this._literalDecoder = new LZMA.LiteralDecoder();\n  this._dictionarySize = -1;\n  this._dictionarySizeCheck = -1;\n\n  this._posSlotDecoder[0] = new LZMA.BitTreeDecoder(6);\n  this._posSlotDecoder[1] = new LZMA.BitTreeDecoder(6);\n  this._posSlotDecoder[2] = new LZMA.BitTreeDecoder(6);\n  this._posSlotDecoder[3] = new LZMA.BitTreeDecoder(6);\n};\n\nLZMA.Decoder.prototype.setDictionarySize = function(dictionarySize){\n  if (dictionarySize < 0){\n    return false;\n  }\n  if (this._dictionarySize !== dictionarySize){\n    this._dictionarySize = dictionarySize;\n    this._dictionarySizeCheck = Math.max(this._dictionarySize, 1);\n    this._outWindow.create( Math.max(this._dictionarySizeCheck, 4096) );\n  }\n  return true;\n};\n\nLZMA.Decoder.prototype.setLcLpPb = function(lc, lp, pb){\n  var numPosStates = 1 << pb;\n\n  if (lc > 8 || lp > 4 || pb > 4){\n    return false;\n  }\n\n  this._literalDecoder.create(lp, lc);\n\n  this._lenDecoder.create(numPosStates);\n  this._repLenDecoder.create(numPosStates);\n  this._posStateMask = numPosStates - 1;\n\n  return true;\n};\n\nLZMA.Decoder.prototype.init = function(){\n  var i = 4;\n\n  this._outWindow.init(false);\n\n  LZMA.initBitModels(this._isMatchDecoders, 192);\n  LZMA.initBitModels(this._isRep0LongDecoders, 192);\n  LZMA.initBitModels(this._isRepDecoders, 12);\n  LZMA.initBitModels(this._isRepG0Decoders, 12);\n  LZMA.initBitModels(this._isRepG1Decoders, 12);\n  LZMA.initBitModels(this._isRepG2Decoders, 12);\n  LZMA.initBitModels(this._posDecoders, 114);\n\n  this._literalDecoder.init();\n\n  while(i --){\n    this._posSlotDecoder[i].init();\n  }\n\n  this._lenDecoder.init();\n  this._repLenDecoder.init();\n  this._posAlignDecoder.init();\n  this._rangeDecoder.init();\n};\n\nLZMA.Decoder.prototype.decode = function(inStream, outStream, outSize){\n  var state = 0, rep0 = 0, rep1 = 0, rep2 = 0, rep3 = 0, nowPos64 = 0, prevByte = 0,\n      posState, decoder2, len, distance, posSlot, numDirectBits;\n\n  this._rangeDecoder.setStream(inStream);\n  this._outWindow.setStream(outStream);\n\n  this.init();\n\n  while(outSize < 0 || nowPos64 < outSize){\n    posState = nowPos64 & this._posStateMask;\n\n    if (this._rangeDecoder.decodeBit(this._isMatchDecoders, (state << 4) + posState) === 0){\n      decoder2 = this._literalDecoder.getDecoder(nowPos64 ++, prevByte);\n\n      if (state >= 7){\n        prevByte = decoder2.decodeWithMatchByte(this._rangeDecoder, this._outWindow.getByte(rep0) );\n      }else{\n        prevByte = decoder2.decodeNormal(this._rangeDecoder);\n      }\n      this._outWindow.putByte(prevByte);\n\n      state = state < 4? 0: state - (state < 10? 3: 6);\n\n    }else{\n\n      if (this._rangeDecoder.decodeBit(this._isRepDecoders, state) === 1){\n        len = 0;\n        if (this._rangeDecoder.decodeBit(this._isRepG0Decoders, state) === 0){\n          if (this._rangeDecoder.decodeBit(this._isRep0LongDecoders, (state << 4) + posState) === 0){\n            state = state < 7? 9: 11;\n            len = 1;\n          }\n        }else{\n          if (this._rangeDecoder.decodeBit(this._isRepG1Decoders, state) === 0){\n            distance = rep1;\n          }else{\n            if (this._rangeDecoder.decodeBit(this._isRepG2Decoders, state) === 0){\n              distance = rep2;\n            }else{\n              distance = rep3;\n              rep3 = rep2;\n            }\n            rep2 = rep1;\n          }\n          rep1 = rep0;\n          rep0 = distance;\n        }\n        if (len === 0){\n          len = 2 + this._repLenDecoder.decode(this._rangeDecoder, posState);\n          state = state < 7? 8: 11;\n        }\n      }else{\n        rep3 = rep2;\n        rep2 = rep1;\n        rep1 = rep0;\n\n        len = 2 + this._lenDecoder.decode(this._rangeDecoder, posState);\n        state = state < 7? 7: 10;\n\n        posSlot = this._posSlotDecoder[len <= 5? len - 2: 3].decode(this._rangeDecoder);\n        if (posSlot >= 4){\n\n          numDirectBits = (posSlot >> 1) - 1;\n          rep0 = (2 | (posSlot & 1) ) << numDirectBits;\n\n          if (posSlot < 14){\n            rep0 += LZMA.reverseDecode2(this._posDecoders,\n                rep0 - posSlot - 1, this._rangeDecoder, numDirectBits);\n          }else{\n            rep0 += this._rangeDecoder.decodeDirectBits(numDirectBits - 4) << 4;\n            rep0 += this._posAlignDecoder.reverseDecode(this._rangeDecoder);\n            if (rep0 < 0){\n              if (rep0 === -1){\n                break;\n              }\n              return false;\n            }\n          }\n        }else{\n          rep0 = posSlot;\n        }\n      }\n\n      if (rep0 >= nowPos64 || rep0 >= this._dictionarySizeCheck){\n        return false;\n      }\n\n      this._outWindow.copyBlock(rep0, len);\n      nowPos64 += len;\n      prevByte = this._outWindow.getByte(0);\n    }\n  }\n\n  this._outWindow.flush();\n  this._outWindow.releaseStream();\n  this._rangeDecoder.releaseStream();\n\n  return true;\n};\n\nLZMA.Decoder.prototype.setDecoderProperties = function(properties){\n  var value, lc, lp, pb, dictionarySize;\n\n  if (properties.size < 5){\n    return false;\n  }\n\n  value = properties.readByte();\n  lc = value % 9;\n  value = ~~(value / 9);\n  lp = value % 5;\n  pb = ~~(value / 5);\n\n  if ( !this.setLcLpPb(lc, lp, pb) ){\n    return false;\n  }\n\n  dictionarySize = properties.readByte();\n  dictionarySize |= properties.readByte() << 8;\n  dictionarySize |= properties.readByte() << 16;\n  dictionarySize += properties.readByte() * 16777216;\n\n  return this.setDictionarySize(dictionarySize);\n};\n\nLZMA.decompress = function(properties, inStream, outStream, outSize){\n  var decoder = new LZMA.Decoder();\n\n  if ( !decoder.setDecoderProperties(properties) ){\n    throw \"Incorrect stream properties\";\n  }\n\n  if ( !decoder.decode(inStream, outStream, outSize) ){\n    throw \"Error in data stream\";\n  }\n\n  return true;\n};\n\nexports.LZMA = LZMA;})();\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Loaders/Ctm/License/js-lzma.txt": {
            "type": "text/plain",
            "title": "$:/plugins/rboue/Three.js/Lib/Loaders/Ctm/License/js-lzma.txt",
            "text": "Copyright (c) 2011 Juan Mellado\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Loaders/Ctm/License/js-openctm.txt": {
            "type": "text/plain",
            "title": "$:/plugins/rboue/Three.js/Lib/Loaders/Ctm/License/js-openctm.txt",
            "text": "Copyright (c) 2011 Juan Mellado\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Loaders/Ctm/License/OpenCTM.txt": {
            "type": "text/plain",
            "title": "$:/plugins/rboue/Three.js/Lib/Loaders/Ctm/License/OpenCTM.txt",
            "text": "Copyright (c) 2009-2010 Marcus Geelnard\n\nThis software is provided 'as-is', without any express or implied\nwarranty. In no event will the authors be held liable for any damages\narising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute it\nfreely, subject to the following restrictions:\n\n    1. The origin of this software must not be misrepresented; you must not\n    claim that you wrote the original software. If you use this software\n    in a product, an acknowledgment in the product documentation would be\n    appreciated but is not required.\n\n    2. Altered source versions must be plainly marked as such, and must not\n    be misrepresented as being the original software.\n\n    3. This notice may not be removed or altered from any source\n    distribution.\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Renderers/RaytracingRenderer.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Renderers/RaytracingRenderer.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.RaytracingRenderer = function ( parameters ) {\n\n\tconsole.log( 'THREE.RaytracingRenderer', THREE.REVISION );\n\n\tparameters = parameters || {};\n\n  // *TiddlyWiki*\n  var _self = this;\n\n\tvar canvas = document.createElement( 'canvas' );\n\tvar context = canvas.getContext( '2d', {\n\t\talpha: parameters.alpha === true\n\t} );\n\n\tvar maxRecursionDepth = 3;\n\n\tvar canvasWidth, canvasHeight;\n\tvar canvasWidthHalf, canvasHeightHalf;\n\n\tvar clearColor = new THREE.Color( 0x000000 );\n\n\tvar origin = new THREE.Vector3();\n\tvar direction = new THREE.Vector3();\n\n\tvar cameraPosition = new THREE.Vector3();\n\n\tvar raycaster = new THREE.Raycaster( origin, direction );\n\tvar raycasterLight = new THREE.Raycaster();\n\n\tvar perspective;\n\tvar modelViewMatrix = new THREE.Matrix4();\n\tvar cameraNormalMatrix = new THREE.Matrix3();\n\n\tvar objects;\n\tvar lights = [];\n\tvar cache = {};\n\n\tvar animationFrameId = null;\n\n\tthis.domElement = canvas;\n\n\tthis.autoClear = true;\n\n\tthis.setClearColor = function ( color, alpha ) {\n\n\t\tclearColor.set( color );\n\n\t};\n\n\tthis.setSize = function ( width, height ) {\n\n\t\tcanvas.width = width;\n\t\tcanvas.height = height;\n\n\t\tcanvasWidth = canvas.width;\n\t\tcanvasHeight = canvas.height;\n\n\t\tcanvasWidthHalf = Math.floor( canvasWidth / 2 );\n\t\tcanvasHeightHalf = Math.floor( canvasHeight / 2 );\n\n\t\tcontext.fillStyle = 'white';\n\n\t};\n\n\tthis.setSize( canvas.width, canvas.height );\n\n\tthis.clear = function () {\n\n\t};\n\n\t//\n\n\tvar spawnRay = ( function () {\n\n\t\tvar diffuseColor = new THREE.Color();\n\t\tvar specularColor = new THREE.Color();\n\t\tvar lightColor = new THREE.Color();\n\t\tvar schlick = new THREE.Color();\n\n\t\tvar lightContribution = new THREE.Color();\n\n\t\tvar eyeVector = new THREE.Vector3();\n\t\tvar lightVector = new THREE.Vector3();\n\t\tvar normalVector = new THREE.Vector3();\n\t\tvar halfVector = new THREE.Vector3();\n\n\t\tvar localPoint = new THREE.Vector3();\n\t\tvar reflectionVector = new THREE.Vector3();\n\n\t\tvar tmpVec = new THREE.Vector3();\n\n\t\tvar tmpColor = [];\n\n\t\tfor ( var i = 0; i < maxRecursionDepth; i ++ ) {\n\n\t\t\ttmpColor[ i ] = new THREE.Color();\n\n\t\t}\n\n\t\treturn function ( rayOrigin, rayDirection, outputColor, recursionDepth ) {\n\n\t\t\tvar ray = raycaster.ray;\n\n\t\t\tray.origin = rayOrigin;\n\t\t\tray.direction = rayDirection;\n\n\t\t\t//\n\n\t\t\tvar rayLight = raycasterLight.ray;\n\n\t\t\t//\n\n\t\t\toutputColor.setRGB( 0, 0, 0 );\n\n\t\t\t//\n\n\t\t\tvar intersections = raycaster.intersectObjects( objects, true );\n\n\t\t\t// ray didn't find anything\n\t\t\t// (here should come setting of background color?)\n\n\t\t\tif ( intersections.length === 0 ) {\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\t// ray hit\n\n\t\t\tvar intersection = intersections[ 0 ];\n\n\t\t\tvar point = intersection.point;\n\t\t\tvar object = intersection.object;\n\t\t\tvar material = object.material;\n\t\t\tvar face = intersection.face;\n\n\t\t\tvar vertices = object.geometry.vertices;\n\n\t\t\t//\n\n\t\t\tvar _object = cache[ object.id ];\n\n\t\t\tlocalPoint.copy( point ).applyMatrix4( _object.inverseMatrix );\n\t\t\teyeVector.subVectors( raycaster.ray.origin, point ).normalize();\n\n\t\t\t// resolve pixel diffuse color\n\n\t\t\tif ( material instanceof THREE.MeshLambertMaterial ||\n\t\t\t\t material instanceof THREE.MeshPhongMaterial ||\n\t\t\t\t material instanceof THREE.MeshBasicMaterial ) {\n\n\t\t\t\tdiffuseColor.copyGammaToLinear( material.color );\n\n\t\t\t} else {\n\n\t\t\t\tdiffuseColor.setRGB( 1, 1, 1 );\n\n\t\t\t}\n\n\t\t\tif ( material.vertexColors === THREE.FaceColors ) {\n\n\t\t\t\tdiffuseColor.multiply( face.color );\n\n\t\t\t}\n\n\t\t\t// compute light shading\n\n\t\t\trayLight.origin.copy( point );\n\n\t\t\tif ( material instanceof THREE.MeshBasicMaterial ) {\n\n\t\t\t\tfor ( var i = 0, l = lights.length; i < l; i ++ ) {\n\n\t\t\t\t\tvar light = lights[ i ];\n\n\t\t\t\t\tlightVector.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\t\tlightVector.sub( point );\n\n\t\t\t\t\trayLight.direction.copy( lightVector ).normalize();\n\n\t\t\t\t\tvar intersections = raycasterLight.intersectObjects( objects, true );\n\n\t\t\t\t\t// point in shadow\n\n\t\t\t\t\tif ( intersections.length > 0 ) continue;\n\n\t\t\t\t\t// point visible\n\n\t\t\t\t\toutputColor.add( diffuseColor );\n\n\t\t\t\t}\n\n\t\t\t} else if ( material instanceof THREE.MeshLambertMaterial ||\n\t\t\t\t\t\tmaterial instanceof THREE.MeshPhongMaterial ) {\n\n\t\t\t\tvar normalComputed = false;\n\n\t\t\t\tfor ( var i = 0, l = lights.length; i < l; i ++ ) {\n\n\t\t\t\t\tvar light = lights[ i ];\n\n\t\t\t\t\tlightColor.copyGammaToLinear( light.color );\n\n\t\t\t\t\tlightVector.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\t\tlightVector.sub( point );\n\n\t\t\t\t\trayLight.direction.copy( lightVector ).normalize();\n\n\t\t\t\t\tvar intersections = raycasterLight.intersectObjects( objects, true );\n\n\t\t\t\t\t// point in shadow\n\n\t\t\t\t\tif ( intersections.length > 0 ) continue;\n\n\t\t\t\t\t// point lit\n\n\t\t\t\t\tif ( normalComputed === false ) {\n\n\t\t\t\t\t\t// the same normal can be reused for all lights\n\t\t\t\t\t\t// (should be possible to cache even more)\n\n\t\t\t\t\t\tcomputePixelNormal( normalVector, localPoint, material.shading, face, vertices );\n\t\t\t\t\t\tnormalVector.applyMatrix3( _object.normalMatrix ).normalize();\n\n\t\t\t\t\t\tnormalComputed = true;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// compute attenuation\n\n\t\t\t\t\tvar attenuation = 1.0;\n\n\t\t\t\t\tif ( light.physicalAttenuation === true ) {\n\n\t\t\t\t\t\tattenuation = lightVector.length();\n\t\t\t\t\t\tattenuation = 1.0 / ( attenuation * attenuation );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tlightVector.normalize();\n\n\t\t\t\t\t// compute diffuse\n\n\t\t\t\t\tvar dot = Math.max( normalVector.dot( lightVector ), 0 );\n\t\t\t\t\tvar diffuseIntensity = dot * light.intensity;\n\n\t\t\t\t\tlightContribution.copy( diffuseColor );\n\t\t\t\t\tlightContribution.multiply( lightColor );\n\t\t\t\t\tlightContribution.multiplyScalar( diffuseIntensity * attenuation );\n\n\t\t\t\t\toutputColor.add( lightContribution );\n\n\t\t\t\t\t// compute specular\n\n\t\t\t\t\tif ( material instanceof THREE.MeshPhongMaterial ) {\n\n\t\t\t\t\t\thalfVector.addVectors( lightVector, eyeVector ).normalize();\n\n\t\t\t\t\t\tvar dotNormalHalf = Math.max( normalVector.dot( halfVector ), 0.0 );\n\t\t\t\t\t\tvar specularIntensity = Math.max( Math.pow( dotNormalHalf, material.shininess ), 0.0 ) * diffuseIntensity;\n\n\t\t\t\t\t\tvar specularNormalization = ( material.shininess + 2.0 ) / 8.0;\n\n\t\t\t\t\t\tspecularColor.copyGammaToLinear( material.specular );\n\n\t\t\t\t\t\tvar alpha = Math.pow( Math.max( 1.0 - lightVector.dot( halfVector ), 0.0 ), 5.0 );\n\n\t\t\t\t\t\tschlick.r = specularColor.r + ( 1.0 - specularColor.r ) * alpha;\n\t\t\t\t\t\tschlick.g = specularColor.g + ( 1.0 - specularColor.g ) * alpha;\n\t\t\t\t\t\tschlick.b = specularColor.b + ( 1.0 - specularColor.b ) * alpha;\n\n\t\t\t\t\t\tlightContribution.copy( schlick );\n\n\t\t\t\t\t\tlightContribution.multiply( lightColor );\n\t\t\t\t\t\tlightContribution.multiplyScalar( specularNormalization * specularIntensity * attenuation );\n\t\t\t\t\t\toutputColor.add( lightContribution );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// reflection / refraction\n\n\t\t\tvar reflectivity = material.reflectivity;\n\n\t\t\tif ( ( material.mirror || material.glass ) && reflectivity > 0 && recursionDepth < maxRecursionDepth ) {\n\n\t\t\t\tif ( material.mirror ) {\n\n\t\t\t\t\treflectionVector.copy( rayDirection );\n\t\t\t\t\treflectionVector.reflect( normalVector );\n\n\t\t\t\t} else if ( material.glass ) {\n\n\t\t\t\t\tvar eta = material.refractionRatio;\n\n\t\t\t\t\tvar dotNI = rayDirection.dot( normalVector )\n\t\t\t\t\tvar k = 1.0 - eta * eta * ( 1.0 - dotNI * dotNI );\n\n\t\t\t\t\tif ( k < 0.0 ) {\n\n\t\t\t\t\t\treflectionVector.set( 0, 0, 0 );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\treflectionVector.copy( rayDirection );\n\t\t\t\t\t\treflectionVector.multiplyScalar( eta );\n\n\t\t\t\t\t\tvar alpha = eta * dotNI + Math.sqrt( k );\n\t\t\t\t\t\ttmpVec.copy( normalVector );\n\t\t\t\t\t\ttmpVec.multiplyScalar( alpha );\n\t\t\t\t\t\treflectionVector.sub( tmpVec );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tvar theta = Math.max( eyeVector.dot( normalVector ), 0.0 );\n\t\t\t\tvar rf0 = reflectivity;\n\t\t\t\tvar fresnel = rf0 + ( 1.0 - rf0 ) * Math.pow( ( 1.0 - theta ), 5.0 );\n\n\t\t\t\tvar weight = fresnel;\n\n\t\t\t\tvar zColor = tmpColor[ recursionDepth ];\n\n\t\t\t\tspawnRay( point, reflectionVector, zColor, recursionDepth + 1 );\n\n\t\t\t\tif ( material.specular !== undefined ) {\n\n\t\t\t\t\tzColor.multiply( material.specular );\n\n\t\t\t\t}\n\n\t\t\t\tzColor.multiplyScalar( weight );\n\t\t\t\toutputColor.multiplyScalar( 1 - weight );\n\t\t\t\toutputColor.add( zColor );\n\n\t\t\t}\n\n\t\t};\n\n\t}() );\n\n\tvar computePixelNormal = ( function () {\n\n\t\tvar tmpVec1 = new THREE.Vector3();\n\t\tvar tmpVec2 = new THREE.Vector3();\n\t\tvar tmpVec3 = new THREE.Vector3();\n\n\t\treturn function ( outputVector, point, shading, face, vertices ) {\n\n\t\t\tvar faceNormal = face.normal;\n\t\t\tvar vertexNormals = face.vertexNormals;\n\n\t\t\tif ( shading === THREE.FlatShading ) {\n\n\t\t\t\toutputVector.copy( faceNormal );\n\n\t\t\t} else if ( shading === THREE.SmoothShading ) {\n\n\t\t\t\t// compute barycentric coordinates\n\n\t\t\t\tvar vA = vertices[ face.a ];\n\t\t\t\tvar vB = vertices[ face.b ];\n\t\t\t\tvar vC = vertices[ face.c ];\n\n\t\t\t\ttmpVec3.crossVectors( tmpVec1.subVectors( vB, vA ), tmpVec2.subVectors( vC, vA ) );\n\t\t\t\tvar areaABC = faceNormal.dot( tmpVec3 );\n\n\t\t\t\ttmpVec3.crossVectors( tmpVec1.subVectors( vB, point ), tmpVec2.subVectors( vC, point ) );\n\t\t\t\tvar areaPBC = faceNormal.dot( tmpVec3 );\n\t\t\t\tvar a = areaPBC / areaABC;\n\n\t\t\t\ttmpVec3.crossVectors( tmpVec1.subVectors( vC, point ), tmpVec2.subVectors( vA, point ) );\n\t\t\t\tvar areaPCA = faceNormal.dot( tmpVec3 );\n\t\t\t\tvar b = areaPCA / areaABC;\n\n\t\t\t\tvar c = 1.0 - a - b;\n\n\t\t\t\t// compute interpolated vertex normal\n\n\t\t\t\ttmpVec1.copy( vertexNormals[ 0 ] );\n\t\t\t\ttmpVec1.multiplyScalar( a );\n\n\t\t\t\ttmpVec2.copy( vertexNormals[ 1 ] );\n\t\t\t\ttmpVec2.multiplyScalar( b );\n\n\t\t\t\ttmpVec3.copy( vertexNormals[ 2 ] );\n\t\t\t\ttmpVec3.multiplyScalar( c );\n\n\t\t\t\toutputVector.addVectors( tmpVec1, tmpVec2 );\n\t\t\t\toutputVector.add( tmpVec3 );\n\n\t\t\t}\n\n\t\t};\n\n\t}() );\n\n\tvar renderBlock = ( function () {\n\n\t\tvar blockSize = 64;\n\n\t\tvar canvasBlock = document.createElement( 'canvas' );\n\t\tcanvasBlock.width = blockSize;\n\t\tcanvasBlock.height = blockSize;\n\n\t\tvar contextBlock = canvasBlock.getContext( '2d', {\n\n\t\t\talpha: parameters.alpha === true\n\n\t\t} );\n\n\t\tvar imagedata = contextBlock.getImageData( 0, 0, blockSize, blockSize );\n\t\tvar data = imagedata.data;\n\n\t\tvar pixelColor = new THREE.Color();\n\n\t\treturn function ( blockX, blockY ) {\n\n\t\t\tvar index = 0;\n\n\t\t\tfor ( var y = 0; y < blockSize; y ++ ) {\n\n\t\t\t\tfor ( var x = 0; x < blockSize; x ++, index += 4 ) {\n\n\t\t\t\t\t// spawn primary ray at pixel position\n\n\t\t\t\t\torigin.copy( cameraPosition );\n\n\t\t\t\t\tdirection.set( x + blockX - canvasWidthHalf, - ( y + blockY - canvasHeightHalf ), - perspective );\n\t\t\t\t\tdirection.applyMatrix3( cameraNormalMatrix ).normalize();\n\n\t\t\t\t\tspawnRay( origin, direction, pixelColor, 0 );\n\n\t\t\t\t\t// convert from linear to gamma\n\n\t\t\t\t\tdata[ index ]     = Math.sqrt( pixelColor.r ) * 255;\n\t\t\t\t\tdata[ index + 1 ] = Math.sqrt( pixelColor.g ) * 255;\n\t\t\t\t\tdata[ index + 2 ] = Math.sqrt( pixelColor.b ) * 255;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tcontext.putImageData( imagedata, blockX, blockY );\n\n\t\t\tblockX += blockSize;\n\n\t\t\tif ( blockX >= canvasWidth ) {\n\n\t\t\t\tblockX = 0;\n\t\t\t\tblockY += blockSize;\n\n\t\t\t  if ( blockY >= canvasHeight ) {\n                            if (TiddlyWiki) {\n                              // End of rendering\n                              _self.endingCallback();\n                            }\n                            return;\n                          }\n\n\t\t\t}\n\n\t\t\tcontext.fillRect( blockX, blockY, blockSize, blockSize );\n\n\t\t\tanimationFrameId = requestAnimationFrame( function () {\n\n\t\t\t\trenderBlock( blockX, blockY );\n\n\t\t\t} );\n\n\t\t};\n\n\t}() );\n\n  this.render = function ( scene, camera /* *TiddlyWiki* */, endingCallback ) {\n\n    if (TiddlyWiki && endingCallback) {\n      this.endingCallback = endingCallback;\n    }\n\n\n\t\tif ( this.autoClear === true ) this.clear();\n\n\t\tcancelAnimationFrame( animationFrameId );\n\n\t\t// update scene graph\n\n\t\tif ( scene.autoUpdate === true ) scene.updateMatrixWorld();\n\n\t\t// update camera matrices\n\n\t\tif ( camera.parent === undefined ) camera.updateMatrixWorld();\n\n\t\tcamera.matrixWorldInverse.getInverse( camera.matrixWorld );\n\t\tcameraPosition.setFromMatrixPosition( camera.matrixWorld );\n\n\t\t//\n\n\t\tcameraNormalMatrix.getNormalMatrix( camera.matrixWorld );\n\t\torigin.copy( cameraPosition );\n\n\t\tperspective = 0.5 / Math.tan( THREE.Math.degToRad( camera.fov * 0.5 ) ) * canvasHeight;\n\n\t\tobjects = scene.children;\n\n\t\t// collect lights and set up object matrices\n\n\t\tlights.length = 0;\n\n\t\tscene.traverse( function ( object ) {\n\n\t\t\tif ( object instanceof THREE.Light ) {\n\n\t\t\t\tlights.push( object );\n\n\t\t\t}\n\n\t\t\tif ( cache[ object.id ] === undefined ) {\n\n\t\t\t\tcache[ object.id ] = {\n\t\t\t\t\tnormalMatrix: new THREE.Matrix3(),\n\t\t\t\t\tinverseMatrix: new THREE.Matrix4()\n\t\t\t\t};\n\n\t\t\t}\n\n\t\t\tmodelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld )\n\n\t\t\tvar _object = cache[ object.id ];\n\n\t\t\t_object.normalMatrix.getNormalMatrix( modelViewMatrix );\n\t\t\t_object.inverseMatrix.getInverse( object.matrixWorld );\n\n\t\t} );\n\n\t\trenderBlock( 0, 0 );\n\n\t};\n\n};"
        },
        "$:/plugins/rboue/Three.js/Lib/Renderers/CSS3DRenderer.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Renderers/CSS3DRenderer.js",
            "module-type": "library",
            "text": "/**\n * Based on http://www.emagix.net/academic/mscs-project/item/camera-sync-with-css3-and-webgl-threejs\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.CSS3DObject = function ( element ) {\n\n\tTHREE.Object3D.call( this );\n\n\tthis.element = element;\n\tthis.element.style.position = 'absolute';\n\n\tthis.addEventListener( 'removed', function ( event ) {\n\n\t\tif ( this.element.parentNode !== null ) {\n\n\t\t\tthis.element.parentNode.removeChild( this.element );\n\n\t\t}\n\n\t} );\n\n};\n\nTHREE.CSS3DObject.prototype = Object.create( THREE.Object3D.prototype );\n\nTHREE.CSS3DSprite = function ( element ) {\n\n\tTHREE.CSS3DObject.call( this, element );\n\n};\n\nTHREE.CSS3DSprite.prototype = Object.create( THREE.CSS3DObject.prototype );\n\n//\n\nTHREE.CSS3DRenderer = function () {\n\n\tconsole.log( 'THREE.CSS3DRenderer', THREE.REVISION );\n\n\tvar _width, _height;\n\tvar _widthHalf, _heightHalf;\n\n\tvar matrix = new THREE.Matrix4();\n\t\n\tvar cache = {\n\t\tcamera: { fov: 0, style: '' },\n\t\tobjects: {}\n\t};\n\n\tvar domElement = document.createElement( 'div' );\n\tdomElement.style.overflow = 'hidden';\n\n\tdomElement.style.WebkitTransformStyle = 'preserve-3d';\n\tdomElement.style.MozTransformStyle = 'preserve-3d';\n\tdomElement.style.oTransformStyle = 'preserve-3d';\n\tdomElement.style.transformStyle = 'preserve-3d';\n\n\tthis.domElement = domElement;\n\n\tvar cameraElement = document.createElement( 'div' );\n\n\tcameraElement.style.WebkitTransformStyle = 'preserve-3d';\n\tcameraElement.style.MozTransformStyle = 'preserve-3d';\n\tcameraElement.style.oTransformStyle = 'preserve-3d';\n\tcameraElement.style.transformStyle = 'preserve-3d';\n\n\tdomElement.appendChild( cameraElement );\n\n\tthis.setClearColor = function () {\n\n\t};\n\n\tthis.setSize = function ( width, height ) {\n\n\t\t_width = width;\n\t\t_height = height;\n\n\t\t_widthHalf = _width / 2;\n\t\t_heightHalf = _height / 2;\n\n\t\tdomElement.style.width = width + 'px';\n\t\tdomElement.style.height = height + 'px';\n\n\t\tcameraElement.style.width = width + 'px';\n\t\tcameraElement.style.height = height + 'px';\n\n\t};\n\n\tvar epsilon = function ( value ) {\n\n\t\treturn Math.abs( value ) < 0.000001 ? 0 : value;\n\n\t};\n\n\tvar getCameraCSSMatrix = function ( matrix ) {\n\n\t\tvar elements = matrix.elements;\n\n\t\treturn 'matrix3d(' +\n\t\t\tepsilon( elements[ 0 ] ) + ',' +\n\t\t\tepsilon( - elements[ 1 ] ) + ',' +\n\t\t\tepsilon( elements[ 2 ] ) + ',' +\n\t\t\tepsilon( elements[ 3 ] ) + ',' +\n\t\t\tepsilon( elements[ 4 ] ) + ',' +\n\t\t\tepsilon( - elements[ 5 ] ) + ',' +\n\t\t\tepsilon( elements[ 6 ] ) + ',' +\n\t\t\tepsilon( elements[ 7 ] ) + ',' +\n\t\t\tepsilon( elements[ 8 ] ) + ',' +\n\t\t\tepsilon( - elements[ 9 ] ) + ',' +\n\t\t\tepsilon( elements[ 10 ] ) + ',' +\n\t\t\tepsilon( elements[ 11 ] ) + ',' +\n\t\t\tepsilon( elements[ 12 ] ) + ',' +\n\t\t\tepsilon( - elements[ 13 ] ) + ',' +\n\t\t\tepsilon( elements[ 14 ] ) + ',' +\n\t\t\tepsilon( elements[ 15 ] ) +\n\t\t')';\n\n\t};\n\n\tvar getObjectCSSMatrix = function ( matrix ) {\n\n\t\tvar elements = matrix.elements;\n\n\t\treturn 'translate3d(-50%,-50%,0) matrix3d(' +\n\t\t\tepsilon( elements[ 0 ] ) + ',' +\n\t\t\tepsilon( elements[ 1 ] ) + ',' +\n\t\t\tepsilon( elements[ 2 ] ) + ',' +\n\t\t\tepsilon( elements[ 3 ] ) + ',' +\n\t\t\tepsilon( - elements[ 4 ] ) + ',' +\n\t\t\tepsilon( - elements[ 5 ] ) + ',' +\n\t\t\tepsilon( - elements[ 6 ] ) + ',' +\n\t\t\tepsilon( - elements[ 7 ] ) + ',' +\n\t\t\tepsilon( elements[ 8 ] ) + ',' +\n\t\t\tepsilon( elements[ 9 ] ) + ',' +\n\t\t\tepsilon( elements[ 10 ] ) + ',' +\n\t\t\tepsilon( elements[ 11 ] ) + ',' +\n\t\t\tepsilon( elements[ 12 ] ) + ',' +\n\t\t\tepsilon( elements[ 13 ] ) + ',' +\n\t\t\tepsilon( elements[ 14 ] ) + ',' +\n\t\t\tepsilon( elements[ 15 ] ) +\n\t\t')';\n\n\t};\n\n\tvar renderObject = function ( object, camera ) {\n\n\t\tif ( object instanceof THREE.CSS3DObject ) {\n\n\t\t\tvar style;\n\n\t\t\tif ( object instanceof THREE.CSS3DSprite ) {\n\n\t\t\t\t// http://swiftcoder.wordpress.com/2008/11/25/constructing-a-billboard-matrix/\n\n\t\t\t\tmatrix.copy( camera.matrixWorldInverse );\n\t\t\t\tmatrix.transpose();\n\t\t\t\tmatrix.copyPosition( object.matrixWorld );\n\t\t\t\tmatrix.scale( object.scale );\n\n\t\t\t\tmatrix.elements[ 3 ] = 0;\n\t\t\t\tmatrix.elements[ 7 ] = 0;\n\t\t\t\tmatrix.elements[ 11 ] = 0;\n\t\t\t\tmatrix.elements[ 15 ] = 1;\n\n\t\t\t\tstyle = getObjectCSSMatrix( matrix );\n\n\t\t\t} else {\n\n\t\t\t\tstyle = getObjectCSSMatrix( object.matrixWorld );\n\n\t\t\t}\n\n\t\t\tvar element = object.element;\n\t\t\tvar cachedStyle = cache.objects[ object.id ];\n\n\t\t\tif ( cachedStyle === undefined || cachedStyle !== style ) {\n\n\t\t\t\telement.style.WebkitTransform = style;\n\t\t\t\telement.style.MozTransform = style;\n\t\t\t\telement.style.oTransform = style;\n\t\t\t\telement.style.transform = style;\n\n\t\t\t\tcache.objects[ object.id ] = style;\n\n\t\t\t}\n\n\t\t\tif ( element.parentNode !== cameraElement ) {\n\n\t\t\t\tcameraElement.appendChild( element );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfor ( var i = 0, l = object.children.length; i < l; i ++ ) {\n\n\t\t\trenderObject( object.children[ i ], camera );\n\n\t\t}\n\n\t};\n\n\tthis.render = function ( scene, camera ) {\n\n\t\tvar fov = 0.5 / Math.tan( THREE.Math.degToRad( camera.fov * 0.5 ) ) * _height;\n\n\t\tif ( cache.camera.fov !== fov ) {\n\n\t\t\tdomElement.style.WebkitPerspective = fov + \"px\";\n\t\t\tdomElement.style.MozPerspective = fov + \"px\";\n\t\t\tdomElement.style.oPerspective = fov + \"px\";\n\t\t\tdomElement.style.perspective = fov + \"px\";\n\n\t\t\tcache.camera.fov = fov;\n\n\t\t}\n\n\t\tscene.updateMatrixWorld();\n\n\t\tif ( camera.parent === undefined ) camera.updateMatrixWorld();\n\n\t\tcamera.matrixWorldInverse.getInverse( camera.matrixWorld );\n\n\t\tvar style = \"translate3d(0,0,\" + fov + \"px)\" + getCameraCSSMatrix( camera.matrixWorldInverse ) +\n\t\t\t\" translate3d(\" + _widthHalf + \"px,\" + _heightHalf + \"px, 0)\";\n\n\t\tif ( cache.camera.style !== style ) {\n\n\t\t\tcameraElement.style.WebkitTransform = style;\n\t\t\tcameraElement.style.MozTransform = style;\n\t\t\tcameraElement.style.oTransform = style;\n\t\t\tcameraElement.style.transform = style;\n\t\t\t\n\t\t\tcache.camera.style = style;\n\n\t\t}\n\n\t\trenderObject( scene, camera );\n\n\t};\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Renderers/SoftwareRenderer.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Renderers/SoftwareRenderer.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n * @author ryg / http://farbrausch.de/~fg\n * @author mraleph / http://mrale.ph/\n */\n\nTHREE.SoftwareRenderer = function ( parameters ) {\n\n\tconsole.log( 'THREE.SoftwareRenderer', THREE.REVISION );\n\n\tparameters = parameters || {};\n\n\tvar canvas = document.createElement( 'canvas' );\n\tvar context = canvas.getContext( '2d', {\n\t\talpha: parameters.alpha === true\n\t} );\n\n\tvar shaders = {};\n\n\tvar canvasWidth, canvasHeight;\n\tvar canvasWBlocks, canvasHBlocks;\n\tvar viewportXScale, viewportYScale, viewportZScale;\n\tvar viewportXOffs, viewportYOffs, viewportZOffs;\n\n\tvar clearColor = new THREE.Color( 0x000000 );\n\n\tvar imagedata, data, zbuffer;\n\tvar numBlocks, blockMaxZ, blockFlags;\n\n\tvar BLOCK_ISCLEAR = (1 << 0);\n\tvar BLOCK_NEEDCLEAR = (1 << 1);\n\n\tvar subpixelBits = 4;\n\tvar subpixelBias = (1 << subpixelBits) - 1;\n\tvar blockShift = 3;\n\tvar blockSize = 1 << blockShift;\n\tvar maxZVal = (1 << 24); // Note: You want to size this so you don't get overflows.\n\n\tvar rectx1 = Infinity, recty1 = Infinity;\n\tvar rectx2 = 0, recty2 = 0;\n\n\tvar prevrectx1 = Infinity, prevrecty1 = Infinity;\n\tvar prevrectx2 = 0, prevrecty2 = 0;\n\n\tvar projector = new THREE.Projector();\n\n\tvar vector1 = new THREE.Vector3();\n\tvar vector2 = new THREE.Vector3();\n\tvar vector3 = new THREE.Vector3();\n\n\tthis.domElement = canvas;\n\n\tthis.autoClear = true;\n\n\t// WebGLRenderer compatibility\n\n\tthis.supportsVertexTextures = function () {};\n\tthis.setFaceCulling = function () {};\n\n\tthis.setClearColor = function ( color, alpha ) {\n\n\t\tclearColor.set( color );\n\n\t};\n\n\tthis.setSize = function ( width, height ) {\n\n\t\tcanvasWBlocks = Math.floor( width / blockSize );\n\t\tcanvasHBlocks = Math.floor( height / blockSize );\n\t\tcanvasWidth   = canvasWBlocks * blockSize;\n\t\tcanvasHeight  = canvasHBlocks * blockSize;\n\n\t\tvar fixScale = 1 << subpixelBits;\n\n\t\tviewportXScale =  fixScale * canvasWidth  / 2;\n\t\tviewportYScale = -fixScale * canvasHeight / 2;\n\t\tviewportZScale =             maxZVal      / 2;\n\t\tviewportXOffs  =  fixScale * canvasWidth  / 2 + 0.5;\n\t\tviewportYOffs  =  fixScale * canvasHeight / 2 + 0.5;\n\t\tviewportZOffs  =             maxZVal      / 2 + 0.5;\n\n\t\tcanvas.width = canvasWidth;\n\t\tcanvas.height = canvasHeight;\n\n\t\tcontext.fillStyle = clearColor.getStyle();\n\t\tcontext.fillRect( 0, 0, canvasWidth, canvasHeight );\n\n\t\timagedata = context.getImageData( 0, 0, canvasWidth, canvasHeight );\n\t\tdata = imagedata.data;\n\n\t\tzbuffer = new Int32Array( data.length / 4 );\n\n\t\tnumBlocks = canvasWBlocks * canvasHBlocks;\n\t\tblockMaxZ = new Int32Array( numBlocks );\n\t\tblockFlags = new Uint8Array( numBlocks );\n\n\t\tfor ( var i = 0, l = zbuffer.length; i < l; i ++ ) {\n\n\t\t\tzbuffer[ i ] = maxZVal;\n\n\t\t}\n\n\t\tfor ( var i = 0; i < numBlocks; i ++ ) {\n\n\t\t\tblockFlags[ i ] = BLOCK_ISCLEAR;\n\n\t\t}\n\n\t};\n\n\tthis.setSize( canvas.width, canvas.height );\n\n\tthis.clear = function () {\n\n\t\trectx1 = Infinity;\n\t\trecty1 = Infinity;\n\t\trectx2 = 0;\n\t\trecty2 = 0;\n\n\t\tfor ( var i = 0; i < numBlocks; i ++ ) {\n\n\t\t\tblockMaxZ[ i ] = maxZVal;\n\t\t\tblockFlags[ i ] = (blockFlags[ i ] & BLOCK_ISCLEAR) ? BLOCK_ISCLEAR : BLOCK_NEEDCLEAR;\n\n\t\t}\n\n\t};\n\n\tthis.render = function ( scene, camera ) {\n\n\t\tif ( this.autoClear === true ) this.clear();\n\n\t\tvar renderData = projector.projectScene( scene, camera, false, false );\n\t\tvar elements = renderData.elements;\n\n\t\tfor ( var e = 0, el = elements.length; e < el; e ++ ) {\n\n\t\t\tvar element = elements[ e ];\n\t\t\tvar material = element.material;\n\t\t\tvar shader = getMaterialShader( material );\n\n\t\t\tif ( element instanceof THREE.RenderableFace ) {\n\n\t\t\t\tdrawTriangle(\n\t\t\t\t\telement.v1.positionScreen,\n\t\t\t\t\telement.v2.positionScreen,\n\t\t\t\t\telement.v3.positionScreen,\n\t\t\t\t\tshader, element, material\n\t\t\t\t);\n\n\t\t\t} else if ( element instanceof THREE.RenderableSprite ) {\n\n\t\t\t\tvar scaleX = element.scale.x * 0.5;\n\t\t\t\tvar scaleY = element.scale.y * 0.5;\n\n\t\t\t\tvector1.copy( element );\n\t\t\t\tvector1.x -= scaleX;\n\t\t\t\tvector1.y += scaleY;\n\n\t\t\t\tvector2.copy( element );\n\t\t\t\tvector2.x -= scaleX;\n\t\t\t\tvector2.y -= scaleY;\n\n\t\t\t\tvector3.copy( element );\n\t\t\t\tvector3.x += scaleX;\n\t\t\t\tvector3.y += scaleY;\n\n\t\t\t\tdrawTriangle(\n\t\t\t\t\tvector1, vector2, vector3,\n\t\t\t\t\tshader, element, material\n\t\t\t\t);\n\n\t\t\t\tvector1.copy( element );\n\t\t\t\tvector1.x += scaleX;\n\t\t\t\tvector1.y += scaleY;\n\n\t\t\t\tvector2.copy( element );\n\t\t\t\tvector2.x -= scaleX;\n\t\t\t\tvector2.y -= scaleY;\n\n\t\t\t\tvector3.copy( element );\n\t\t\t\tvector3.x += scaleX;\n\t\t\t\tvector3.y -= scaleY;\n\n\t\t\t\tdrawTriangle(\n\t\t\t\t\tvector1, vector2, vector3,\n\t\t\t\t\tshader, element, material\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t}\n\n\t\tfinishClear();\n\n\t\tvar x = Math.min( rectx1, prevrectx1 );\n\t\tvar y = Math.min( recty1, prevrecty1 );\n\t\tvar width = Math.max( rectx2, prevrectx2 ) - x;\n\t\tvar height = Math.max( recty2, prevrecty2 ) - y;\n\n\t\t/*\n\t\t// debug; draw zbuffer\n\n\t\tfor ( var i = 0, l = zbuffer.length; i < l; i++ ) {\n\n\t\t\tvar o = i * 4;\n\t\t\tvar v = (65535 - zbuffer[ i ]) >> 3;\n\t\t\tdata[ o + 0 ] = v;\n\t\t\tdata[ o + 1 ] = v;\n\t\t\tdata[ o + 2 ] = v;\n\t\t\tdata[ o + 3 ] = 255;\n\t\t}\n\t\t*/\n\n\t\tif ( x !== Infinity ) {\n\n\t\t\tcontext.putImageData( imagedata, 0, 0, x, y, width, height );\n\n\t\t}\n\n\t\tprevrectx1 = rectx1; prevrecty1 = recty1;\n\t\tprevrectx2 = rectx2; prevrecty2 = recty2;\n\n\t};\n\n\tfunction getMaterialShader( material ) {\n\n\t\tvar id = material.id;\n\t\tvar shader = shaders[ id ];\n\n\t\tif ( shaders[ id ] === undefined ) {\n\n\t\t\tif ( material instanceof THREE.MeshBasicMaterial ||\n\t\t\t     material instanceof THREE.MeshLambertMaterial ||\n\t\t\t     material instanceof THREE.MeshPhongMaterial ||\n\t\t\t     material instanceof THREE.SpriteMaterial ) {\n\n\t\t\t\tvar string;\n\n\t\t\t\tif ( material.vertexColors === THREE.FaceColors ) {\n\n\t\t\t\t\tstring = [\n\t\t\t\t\t\t'buffer[ offset ] = face.color.r * 255;',\n\t\t\t\t\t\t'buffer[ offset + 1 ] = face.color.g * 255;',\n\t\t\t\t\t\t'buffer[ offset + 2 ] = face.color.b * 255;',\n\t\t\t\t\t\t'buffer[ offset + 3 ] = material.opacity * 255;',\n\t\t\t\t\t].join('\\n');\n\n\t\t\t\t} else {\n\n\t\t\t\t\tstring = [\n\t\t\t\t\t\t'buffer[ offset ] = material.color.r * 255;',\n\t\t\t\t\t\t'buffer[ offset + 1 ] = material.color.g * 255;',\n\t\t\t\t\t\t'buffer[ offset + 2 ] = material.color.b * 255;',\n\t\t\t\t\t\t'buffer[ offset + 3 ] = material.opacity * 255;',\n\t\t\t\t\t].join('\\n');\n\n\t\t\t\t}\n\n\t\t\t\tshader = new Function( 'buffer, offset, u, v, face, material', string );\n\n\t\t\t} else {\n\n\t\t\t\tvar string = [\n\t\t\t\t\t'buffer[ offset ] = u * 255;',\n\t\t\t\t\t'buffer[ offset + 1 ] = v * 255;',\n\t\t\t\t\t'buffer[ offset + 2 ] = 0;',\n\t\t\t\t\t'buffer[ offset + 3 ] = 255;'\n\t\t\t\t].join('\\n');\n\n\t\t\t\tshader = new Function( 'buffer, offset, u, v', string );\n\n\t\t\t}\n\n\t\t\tshaders[ id ] = shader;\n\n\t\t}\n\n\t\treturn shader;\n\n\t}\n\n\tfunction clearRectangle( x1, y1, x2, y2 ) {\n\n\t\tvar xmin = Math.max( Math.min( x1, x2 ), 0 );\n\t\tvar xmax = Math.min( Math.max( x1, x2 ), canvasWidth );\n\t\tvar ymin = Math.max( Math.min( y1, y2 ), 0 );\n\t\tvar ymax = Math.min( Math.max( y1, y2 ), canvasHeight );\n\n\t\tvar offset = ( xmin + ymin * canvasWidth ) * 4 + 3;\n\t\tvar linestep = ( canvasWidth - ( xmax - xmin ) ) * 4;\n\n\t\tfor ( var y = ymin; y < ymax; y ++ ) {\n\n\t\t\tfor ( var x = xmin; x < xmax; x ++ ) {\n\n\t\t\t\tdata[ offset += 4 ] = 0;\n\n\t\t\t}\n\n\t\t\toffset += linestep;\n\n\t\t}\n\n\t}\n\n\tfunction drawTriangle( v1, v2, v3, shader, face, material ) {\n\n\t\t// TODO: Implement per-pixel z-clipping\n\n\t\tif ( v1.z < -1 || v1.z > 1 || v2.z < -1 || v2.z > 1 || v3.z < -1 || v3.z > 1 ) return;\n\n\t\t// https://gist.github.com/2486101\n\t\t// explanation: http://pouet.net/topic.php?which=8760&page=1\n\n\t\t// 28.4 fixed-point coordinates\n\n\t\tvar x1 = (v1.x * viewportXScale + viewportXOffs) | 0;\n\t\tvar x2 = (v2.x * viewportXScale + viewportXOffs) | 0;\n\t\tvar x3 = (v3.x * viewportXScale + viewportXOffs) | 0;\n\n\t\tvar y1 = (v1.y * viewportYScale + viewportYOffs) | 0;\n\t\tvar y2 = (v2.y * viewportYScale + viewportYOffs) | 0;\n\t\tvar y3 = (v3.y * viewportYScale + viewportYOffs) | 0;\n\n\t\t// Z values (.28 fixed-point)\n\n\t\tvar z1 = (v1.z * viewportZScale + viewportZOffs) | 0;\n\t\tvar z2 = (v2.z * viewportZScale + viewportZOffs) | 0;\n\t\tvar z3 = (v3.z * viewportZScale + viewportZOffs) | 0;\n\n\t\t// Deltas\n\n\t\tvar dx12 = x1 - x2, dy12 = y2 - y1;\n\t\tvar dx23 = x2 - x3, dy23 = y3 - y2;\n\t\tvar dx31 = x3 - x1, dy31 = y1 - y3;\n\n\t\t// Bounding rectangle\n\n\t\tvar minx = Math.max( ( Math.min( x1, x2, x3 ) + subpixelBias ) >> subpixelBits, 0 );\n\t\tvar maxx = Math.min( ( Math.max( x1, x2, x3 ) + subpixelBias ) >> subpixelBits, canvasWidth );\n\t\tvar miny = Math.max( ( Math.min( y1, y2, y3 ) + subpixelBias ) >> subpixelBits, 0 );\n\t\tvar maxy = Math.min( ( Math.max( y1, y2, y3 ) + subpixelBias ) >> subpixelBits, canvasHeight );\n\n\t\trectx1 = Math.min( minx, rectx1 );\n\t\trectx2 = Math.max( maxx, rectx2 );\n\t\trecty1 = Math.min( miny, recty1 );\n\t\trecty2 = Math.max( maxy, recty2 );\n\n\t\t// Block size, standard 8x8 (must be power of two)\n\n\t\tvar q = blockSize;\n\n\t\t// Start in corner of 8x8 block\n\n\t\tminx &= ~(q - 1);\n\t\tminy &= ~(q - 1);\n\n\t\t// Constant part of half-edge functions\n\n\t\tvar c1 = dy12 * ((minx << subpixelBits) - x1) + dx12 * ((miny << subpixelBits) - y1);\n\t\tvar c2 = dy23 * ((minx << subpixelBits) - x2) + dx23 * ((miny << subpixelBits) - y2);\n\t\tvar c3 = dy31 * ((minx << subpixelBits) - x3) + dx31 * ((miny << subpixelBits) - y3);\n\n\t\t// Correct for fill convention\n\n\t\tif ( dy12 > 0 || ( dy12 == 0 && dx12 > 0 ) ) c1 ++;\n\t\tif ( dy23 > 0 || ( dy23 == 0 && dx23 > 0 ) ) c2 ++;\n\t\tif ( dy31 > 0 || ( dy31 == 0 && dx31 > 0 ) ) c3 ++;\n\n\t\t// Note this doesn't kill subpixel precision, but only because we test for >=0 (not >0).\n\t\t// It's a bit subtle. :)\n\t\tc1 = (c1 - 1) >> subpixelBits;\n\t\tc2 = (c2 - 1) >> subpixelBits;\n\t\tc3 = (c3 - 1) >> subpixelBits;\n\n\t\t// Z interpolation setup\n\n\t\tvar dz12 = z1 - z2, dz31 = z3 - z1;\n\t\tvar invDet = 1.0 / (dx12*dy31 - dx31*dy12);\n\t\tvar dzdx = (invDet * (dz12*dy31 - dz31*dy12)); // dz per one subpixel step in x\n\t\tvar dzdy = (invDet * (dz12*dx31 - dx12*dz31)); // dz per one subpixel step in y\n\n\t\t// Z at top/left corner of rast area\n\n\t\tvar cz = ( z1 + ((minx << subpixelBits) - x1) * dzdx + ((miny << subpixelBits) - y1) * dzdy ) | 0;\n\n\t\t// Z pixel steps\n\n\t\tvar zfixscale = (1 << subpixelBits);\n\t\tdzdx = (dzdx * zfixscale) | 0;\n\t\tdzdy = (dzdy * zfixscale) | 0;\n\n\t\t// Set up min/max corners\n\t\tvar qm1 = q - 1; // for convenience\n\t\tvar nmin1 = 0, nmax1 = 0;\n\t\tvar nmin2 = 0, nmax2 = 0;\n\t\tvar nmin3 = 0, nmax3 = 0;\n\t\tvar nminz = 0, nmaxz = 0;\n\t\tif (dx12 >= 0) nmax1 -= qm1*dx12; else nmin1 -= qm1*dx12;\n\t\tif (dy12 >= 0) nmax1 -= qm1*dy12; else nmin1 -= qm1*dy12;\n\t\tif (dx23 >= 0) nmax2 -= qm1*dx23; else nmin2 -= qm1*dx23;\n\t\tif (dy23 >= 0) nmax2 -= qm1*dy23; else nmin2 -= qm1*dy23;\n\t\tif (dx31 >= 0) nmax3 -= qm1*dx31; else nmin3 -= qm1*dx31;\n\t\tif (dy31 >= 0) nmax3 -= qm1*dy31; else nmin3 -= qm1*dy31;\n\t\tif (dzdx >= 0) nmaxz += qm1*dzdx; else nminz += qm1*dzdx;\n\t\tif (dzdy >= 0) nmaxz += qm1*dzdy; else nminz += qm1*dzdy;\n\n\t\t// Loop through blocks\n\t\tvar linestep = canvasWidth - q;\n\t\tvar scale = 1.0 / (c1 + c2 + c3);\n\n\t\tvar cb1 = c1;\n\t\tvar cb2 = c2;\n\t\tvar cb3 = c3;\n\t\tvar cbz = cz;\n\t\tvar qstep = -q;\n\t\tvar e1x = qstep * dy12;\n\t\tvar e2x = qstep * dy23;\n\t\tvar e3x = qstep * dy31;\n\t\tvar ezx = qstep * dzdx;\n\t\tvar x0 = minx;\n\n\t\tfor ( var y0 = miny; y0 < maxy; y0 += q ) {\n\n\t\t\t// New block line - keep hunting for tri outer edge in old block line dir\n\t\t\twhile ( x0 >= minx && x0 < maxx && cb1 >= nmax1 && cb2 >= nmax2 && cb3 >= nmax3 ) {\n\n\t\t\t\tx0 += qstep;\n\t\t\t\tcb1 += e1x;\n\t\t\t\tcb2 += e2x;\n\t\t\t\tcb3 += e3x;\n\t\t\t\tcbz += ezx;\n\n\t\t\t}\n\n\t\t\t// Okay, we're now in a block we know is outside. Reverse direction and go into main loop.\n\t\t\tqstep = -qstep;\n\t\t\te1x = -e1x;\n\t\t\te2x = -e2x;\n\t\t\te3x = -e3x;\n\t\t\tezx = -ezx;\n\n\t\t\twhile ( 1 ) {\n\n\t\t\t\t// Step everything\n\t\t\t\tx0 += qstep;\n\t\t\t\tcb1 += e1x;\n\t\t\t\tcb2 += e2x;\n\t\t\t\tcb3 += e3x;\n\t\t\t\tcbz += ezx;\n\n\t\t\t\t// We're done with this block line when at least one edge completely out\n\t\t\t\t// If an edge function is too small and decreasing in the current traversal\n\t\t\t\t// dir, we're done with this line.\n\t\t\t\tif (x0 < minx || x0 >= maxx) break;\n\t\t\t\tif (cb1 < nmax1) if (e1x < 0) break; else continue;\n\t\t\t\tif (cb2 < nmax2) if (e2x < 0) break; else continue;\n\t\t\t\tif (cb3 < nmax3) if (e3x < 0) break; else continue;\n\n\t\t\t\t// We can skip this block if it's already fully covered\n\t\t\t\tvar blockX = x0 >> blockShift;\n\t\t\t\tvar blockY = y0 >> blockShift;\n\t\t\t\tvar blockId = blockX + blockY * canvasWBlocks;\n\t\t\t\tvar minz = cbz + nminz;\n\n\t\t\t\t// farthest point in block closer than closest point in our tri?\n\t\t\t\tif ( blockMaxZ[ blockId ] < minz ) continue;\n\n\t\t\t\t// Need to do a deferred clear?\n\t\t\t\tvar bflags = blockFlags[ blockId ];\n\t\t\t\tif ( bflags & BLOCK_NEEDCLEAR) clearBlock( blockX, blockY );\n\t\t\t\tblockFlags[ blockId ] = bflags & ~( BLOCK_ISCLEAR | BLOCK_NEEDCLEAR );\n\n\t\t\t\t// Offset at top-left corner\n\t\t\t\tvar offset = x0 + y0 * canvasWidth;\n\n\t\t\t\t// Accept whole block when fully covered\n\t\t\t\tif ( cb1 >= nmin1 && cb2 >= nmin2 && cb3 >= nmin3 ) {\n\n\t\t\t\t\tvar maxz = cbz + nmaxz;\n\t\t\t\t\tblockMaxZ[ blockId ] = Math.min( blockMaxZ[ blockId ], maxz );\n\n\t\t\t\t\tvar cy1 = cb1;\n\t\t\t\t\tvar cy2 = cb2;\n\t\t\t\t\tvar cyz = cbz;\n\n\t\t\t\t\tfor ( var iy = 0; iy < q; iy ++ ) {\n\n\t\t\t\t\t\tvar cx1 = cy1;\n\t\t\t\t\t\tvar cx2 = cy2;\n\t\t\t\t\t\tvar cxz = cyz;\n\n\t\t\t\t\t\tfor ( var ix = 0; ix < q; ix ++ ) {\n\n\t\t\t\t\t\t\tvar z = cxz;\n\n\t\t\t\t\t\t\tif ( z < zbuffer[ offset ] ) {\n\t\t\t\t\t\t\t\tzbuffer[ offset ] = z;\n\t\t\t\t\t\t\t\tvar u = cx1 * scale;\n\t\t\t\t\t\t\t\tvar v = cx2 * scale;\n\t\t\t\t\t\t\t\tshader( data, offset * 4, u, v, face, material );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcx1 += dy12;\n\t\t\t\t\t\t\tcx2 += dy23;\n\t\t\t\t\t\t\tcxz += dzdx;\n\t\t\t\t\t\t\toffset++;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcy1 += dx12;\n\t\t\t\t\t\tcy2 += dx23;\n\t\t\t\t\t\tcyz += dzdy;\n\t\t\t\t\t\toffset += linestep;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else { // Partially covered block\n\n\t\t\t\t\tvar cy1 = cb1;\n\t\t\t\t\tvar cy2 = cb2;\n\t\t\t\t\tvar cy3 = cb3;\n\t\t\t\t\tvar cyz = cbz;\n\n\t\t\t\t\tfor ( var iy = 0; iy < q; iy ++ ) {\n\n\t\t\t\t\t\tvar cx1 = cy1;\n\t\t\t\t\t\tvar cx2 = cy2;\n\t\t\t\t\t\tvar cx3 = cy3;\n\t\t\t\t\t\tvar cxz = cyz;\n\n\t\t\t\t\t\tfor ( var ix = 0; ix < q; ix ++ ) {\n\n\t\t\t\t\t\t\tif ( ( cx1 | cx2 | cx3 ) >= 0 ) {\n\n\t\t\t\t\t\t\t\tvar z = cxz;\n\n\t\t\t\t\t\t\t\tif ( z < zbuffer[ offset ] ) {\n\t\t\t\t\t\t\t\t\tvar u = cx1 * scale;\n\t\t\t\t\t\t\t\t\tvar v = cx2 * scale;\n\n\t\t\t\t\t\t\t\t\tzbuffer[ offset ] = z;\n\t\t\t\t\t\t\t\t\tshader( data, offset * 4, u, v, face, material );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcx1 += dy12;\n\t\t\t\t\t\t\tcx2 += dy23;\n\t\t\t\t\t\t\tcx3 += dy31;\n\t\t\t\t\t\t\tcxz += dzdx;\n\t\t\t\t\t\t\toffset++;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcy1 += dx12;\n\t\t\t\t\t\tcy2 += dx23;\n\t\t\t\t\t\tcy3 += dx31;\n\t\t\t\t\t\tcyz += dzdy;\n\t\t\t\t\t\toffset += linestep;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Advance to next row of blocks\n\t\t\tcb1 += q*dx12;\n\t\t\tcb2 += q*dx23;\n\t\t\tcb3 += q*dx31;\n\t\t\tcbz += q*dzdy;\n\t\t}\n\n\t}\n\n\tfunction clearBlock( blockX, blockY ) {\n\n\t\tvar zoffset = blockX * blockSize + blockY * blockSize * canvasWidth;\n\t\tvar poffset = zoffset * 4;\n\n\t\tvar zlinestep = canvasWidth - blockSize;\n\t\tvar plinestep = zlinestep * 4;\n\n\t\tfor ( var y = 0; y < blockSize; y ++ ) {\n\n\t\t\tfor ( var x = 0; x < blockSize; x ++ ) {\n\n\t\t\t\tzbuffer[ zoffset ++ ] = maxZVal;\n\n\t\t\t\tdata[ poffset ++ ] = clearColor.r * 255 | 0;\n\t\t\t\tdata[ poffset ++ ] = clearColor.g * 255 | 0;\n\t\t\t\tdata[ poffset ++ ] = clearColor.b * 255 | 0;\n\t\t\t\tdata[ poffset ++ ] = 255;\n\n\t\t\t}\n\n\t\t\tzoffset += zlinestep;\n\t\t\tpoffset += plinestep;\n\n\t\t}\n\n\t}\n\n\tfunction finishClear( ) {\n\n\t\tvar block = 0;\n\n\t\tfor ( var y = 0; y < canvasHBlocks; y ++ ) {\n\n\t\t\tfor ( var x = 0; x < canvasWBlocks; x ++ ) {\n\n\t\t\t\tif ( blockFlags[ block ] & BLOCK_NEEDCLEAR ) {\n\n\t\t\t\t\tclearBlock( x, y );\n\t\t\t\t\tblockFlags[ block ] = BLOCK_ISCLEAR;\n\n\t\t\t\t}\n\n\t\t\t\tblock ++;\n\t\t\t}\n\n\t\t}\n\n\t}\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Renderers/WebGLRenderer3.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Renderers/WebGLRenderer3.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n *\n * parameters = {\n *   canvas: canvas,\n *   contextAttributes: {\n *     alpha: false,\n *     depth: true,\n *     stencil: false,\n *     antialias: true,\n *     premultipliedAlpha: true,\n *     preserveDrawingBuffer: false\n *   }\n * }\n *\n */\n\nTHREE.WebGLRenderer3 = function ( parameters ) {\n\n\tconsole.log( 'THREE.WebGLRenderer3', THREE.REVISION );\n\n\tparameters = parameters || {};\n\n\tvar scope = this;\n\n\tvar canvas = parameters.canvas !== undefined ? parameters.canvas : document.createElement( 'canvas' );\n\n\tvar devicePixelRatio = parameters.devicePixelRatio !== undefined\n\t\t\t\t? parameters.devicePixelRatio\n\t\t\t\t: self.devicePixelRatio !== undefined\n\t\t\t\t\t? self.devicePixelRatio\n\t\t\t\t\t: 1;\n\n\tvar gl;\n\n\ttry {\n\n\t\tvar attributes = parameters.contextAttributes || {};\n\t\t\n\t\tif ( attributes.alpha === undefined ) attributes.alpha = false;\n\n\t\tgl = canvas.getContext( 'webgl', attributes ) || canvas.getContext( 'experimental-webgl', attributes );\n\n\t\tif ( gl === null ) {\n\n\t\t\tthrow 'Error creating WebGL context.';\n\n\t\t}\n\n\t} catch ( exception ) {\n\n\t\tconsole.error( exception );\n\n\t}\n\n\tvar precision = 'highp';\n\tvar extensions = {};\n\n\tif ( gl !== null ) {\n\n\t\textensions.element_index_uint = gl.getExtension( 'OES_element_index_uint' );\n\t\textensions.texture_float = gl.getExtension( 'OES_texture_float' );\n\t\textensions.texture_float_linear = gl.getExtension( 'OES_texture_float_linear' );\n\t\textensions.standard_derivatives = gl.getExtension( 'OES_standard_derivatives' );\n\t\textensions.texture_filter_anisotropic = gl.getExtension( 'EXT_texture_filter_anisotropic' ) || gl.getExtension( 'MOZ_EXT_texture_filter_anisotropic' ) || gl.getExtension( 'WEBKIT_EXT_texture_filter_anisotropic' );\n\t\textensions.compressed_texture_s3tc = gl.getExtension( 'WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'MOZ_WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_s3tc' );\n\n\t\tgl.clearColor( 0, 0, 0, 1 );\n\t\tgl.clearDepth( 1 );\n\t\tgl.clearStencil( 0 );\n\n\t\tgl.enable( gl.DEPTH_TEST );\n\t\tgl.depthFunc( gl.LEQUAL );\n\n\t\tgl.enable( gl.CULL_FACE );\n\t\tgl.frontFace( gl.CCW );\n\t\tgl.cullFace( gl.BACK );\n\n\t\tgl.enable( gl.BLEND );\n\t\tgl.blendEquation( gl.FUNC_ADD );\n\t\tgl.blendFunc( gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA );\n\n\t\tgl.clearColor( 0, 0, 0, 0 );\n\n\t}\n\n\tvar clearColor = new THREE.Color( 0x000000 );\n\tvar clearAlpha = 0;\n\n\t//\n\n\tvar vector3 = new THREE.Vector3();\n\tvar frustum = new THREE.Frustum();\n\tvar normalMatrix = new THREE.Matrix3();\n\tvar modelViewMatrix = new THREE.Matrix4();\n\tvar cameraViewProjectionMatrix = new THREE.Matrix4();\n\n\t// buffers\n\n\tvar buffers = {};\n\n\tvar getBuffer = function ( geometry, material ) {\n\n\t\tvar hash = geometry.id.toString() + '+' + material.id.toString();\n\n\t\tif ( buffers[ hash ] !== undefined ) {\n\n\t\t\treturn buffers[ hash ];\n\n\t\t}\n\n\t\tvar vertices = geometry.vertices;\n\t\tvar faces = geometry.faces;\n\n\t\t//\n\n\t\tvar positions = [];\n\t\tvar addPosition = function ( position ) {\n\n\t\t\tpositions.push( position.x, position.y, position.z );\n\n\t\t}\n\n\t\tvar normals = [];\n\t\tvar addNormal = function ( normal ) {\n\n\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t}\n\n\t\tfor ( var i = 0, l = faces.length; i < l; i ++ ) {\n\n\t\t\tvar face = faces[ i ];\n\t\t\tvar vertexNormals = face.vertexNormals.length > 0;\n\n\t\t\taddPosition( vertices[ face.a ] );\n\t\t\taddPosition( vertices[ face.b ] );\n\t\t\taddPosition( vertices[ face.c ] );\n\n\t\t\tif ( vertexNormals === true ) {\n\n\t\t\t\taddNormal( face.vertexNormals[ 0 ] );\n\t\t\t\taddNormal( face.vertexNormals[ 1 ] );\n\t\t\t\taddNormal( face.vertexNormals[ 2 ] );\n\n\t\t\t} else {\n\n\t\t\t\taddNormal( face.normal );\n\t\t\t\taddNormal( face.normal );\n\t\t\t\taddNormal( face.normal );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvar buffer = {\n\t\t\tpositions: gl.createBuffer(),\n\t\t\tnormals: gl.createBuffer(),\n\t\t\tcount: positions.length / 3\n\t\t};\n\n\t\tgl.bindBuffer( gl.ARRAY_BUFFER, buffer.positions );\n\t\tgl.bufferData( gl.ARRAY_BUFFER, new Float32Array( positions ), gl.STATIC_DRAW );\n\n\t\tgl.bindBuffer( gl.ARRAY_BUFFER, buffer.normals );\n\t\tgl.bufferData( gl.ARRAY_BUFFER, new Float32Array( normals ), gl.STATIC_DRAW );\n\n\t\tbuffers[ hash ] = buffer;\n\n\t\tscope.info.memory.geometries ++;\n\n\t\treturn buffer;\n\n\t};\n\n\t// programs\n\n\tvar programs = {};\n\tvar programsCache = {};\n\n\tvar getProgram = function ( material ) {\n\n\t\tif ( programs[ material.id ] !== undefined ) {\n\n\t\t\treturn programs[ material.id ];\n\n\t\t}\n\n\t\tvar vertexShader = [\n\t\t\t'precision ' + precision + ' float;',\n\t\t\t\"precision \" + precision + \" int;\",\n\t\t\t'attribute vec3 position;',\n\t\t\t'attribute vec3 normal;',\n\t\t\t'uniform mat4 modelViewMatrix;',\n\t\t\t'uniform mat3 normalMatrix;',\n\t\t\t'uniform mat4 projectionMatrix;',\n\t\t\t''\n\t\t].join( '\\n' );\n\n\t\tvar fragmentShader = [\n\t\t\t'precision ' + precision + ' float;',\n\t\t\t\"precision \" + precision + \" int;\",\n\t\t\t''\n\t\t].join( '\\n' );\n\n\t\tif ( material instanceof THREE.ShaderMaterial ) {\n\n\t\t\tvertexShader += material.vertexShader;\n\t\t\tfragmentShader += material.fragmentShader;\n\n\t\t} else if ( material instanceof THREE.MeshNormalMaterial ) {\n\n\t\t\tvertexShader += [\n\t\t\t\t'varying vec3 vNormal;',\n\t\t\t\t'void main() {',\n\t\t\t\t'\tvNormal = normalize( normalMatrix * normal );',\n\t\t\t\t'\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',\n\t\t\t\t'}'\n\t\t\t].join( '\\n' );\n\n\t\t\tfragmentShader += [\n\t\t\t\t'varying vec3 vNormal;',\n\t\t\t\t'uniform float opacity;',\n\t\t\t\t'void main() {',\n\t\t\t\t'\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );',\n\t\t\t\t'}'\n\t\t\t].join( '\\n' );\n\n\t\t} else {\n\n\t\t\tvertexShader += [\n\t\t\t\t'void main() {',\n\t\t\t\t'\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',\n\t\t\t\t'}'\n\t\t\t].join( '\\n' );\n\n\t\t\tfragmentShader += [\n\t\t\t\t'void main() {',\n\t\t\t\t'\tgl_FragColor = vec4( 1.0, 0, 0, 1.0 );',\n\t\t\t\t'}'\n\t\t\t].join( '\\n' );\n\n\t\t}\n\n\t\tvar program;\n\t\tvar code = vertexShader + fragmentShader;\n\n\t\tif ( programsCache[ code ] !== undefined ) {\n\n\t\t\tprogram = programsCache[ code ];\n\t\t\tprograms[ material.id ] = program;\n\n\t\t} else {\n\n\t\t\tprogram = gl.createProgram();\n\n\t\t\tgl.attachShader( program, createShader( gl.VERTEX_SHADER, vertexShader ) );\n\t\t\tgl.attachShader( program, createShader( gl.FRAGMENT_SHADER, fragmentShader ) );\n\t\t\tgl.linkProgram( program );\n\n\t\t\tif ( gl.getProgramParameter( program, gl.LINK_STATUS ) === true ) {\n\n\t\t\t\tprogramsCache[ code ] = program;\n\t\t\t\tprograms[ material.id ] = program;\n\n\t\t\t\tscope.info.memory.programs ++;\n\n\t\t\t} else {\n\n\t\t\t\tconsole.error( 'Program Info Log: ' + gl.getProgramInfoLog( program ) );\n\t\t\t\tconsole.error( 'VALIDATE_STATUS: ' + gl.getProgramParameter( program, gl.VALIDATE_STATUS ) );\n\t\t\t\tconsole.error( 'GL_ERROR: ' + gl.getError() );\n\n\t\t\t\t// fallback\n\n\t\t\t\tprogram = getProgram( new THREE.MeshBasicMaterial() );\n\t\t\t\tprograms[ material.id ] = program;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn program;\n\n\t};\n\n\tvar createShader = function ( type, string ) {\n\n\t\tvar shader = gl.createShader( type );\n\n\t\tgl.shaderSource( shader, string );\n\t\tgl.compileShader( shader );\n\n\t\tif ( gl.getShaderParameter( shader, gl.COMPILE_STATUS ) === true ) {\n\n\t\t\t// console.log( string );\n\n\t\t} else {\n\n\t\t\tconsole.error( gl.getShaderInfoLog( shader ), string );\n\t\t\treturn null;\n\n\t\t}\n\n\t\treturn shader;\n\n\t};\n\n\tthis.info = {\n\n\t\tmemory: {\n\n\t\t\tprograms: 0,\n\t\t\tgeometries: 0,\n\t\t\ttextures: 0\n\n\t\t},\n\n\t\trender: {\n\n\t\t\tcalls: 0,\n\t\t\tvertices: 0,\n\t\t\tfaces: 0,\n\t\t\tpoints: 0\n\n\t\t}\n\n\t};\n\n\tthis.domElement = canvas;\n\tthis.extensions = extensions;\n\n\tthis.autoClear = true; // TODO: Make private\n\n\tthis.setClearColor = function ( color, alpha ) {\n\n\t\tclearColor.set( color );\n\t\tclearAlpha = alpha !== undefined ? alpha : 1;\n\n\t\tgl.clearColor( clearColor.r, clearColor.g, clearColor.b, clearAlpha );\n\n\t};\n\n\tthis.setSize = function ( width, height, updateStyle ) {\n\n\t\tcanvas.width = width * devicePixelRatio;\n\t\tcanvas.height = height * devicePixelRatio;\n\n\t\tif ( devicePixelRatio !== 1 && updateStyle !== false ) {\n\n\t\t\tcanvas.style.width = width + 'px';\n\t\t\tcanvas.style.height = height + 'px';\n\n\t\t}\n\n\t\tgl.viewport( 0, 0, canvas.width, canvas.height );\n\n\t};\n\n\tthis.clear = function ( color, depth, stencil ) {\n\n\t\tvar bits = 0;\n\n\t\tif ( color === undefined || color ) bits |= gl.COLOR_BUFFER_BIT;\n\t\tif ( depth === undefined || depth ) bits |= gl.DEPTH_BUFFER_BIT;\n\t\tif ( stencil === undefined || stencil ) bits |= gl.STENCIL_BUFFER_BIT;\n\n\t\tgl.clear( bits );\n\n\t};\n\n\t// blending\n\n\tvar currentBlending = null;\n\n\tvar setBlending = function ( blending ) {\n\n\t\tif ( blending !== currentBlending ) {\n\n\t\t\tif ( blending === THREE.NoBlending ) {\n\n\t\t\t\tgl.disable( gl.BLEND );\n\n\t\t\t} else {\n\n\t\t\t\tgl.enable( gl.BLEND );\n\n\t\t\t}\n\n\t\t\tcurrentBlending = blending;\n\n\t\t}\n\n\t};\n\n\t// depthTest\n\n\tvar currentDepthTest = null;\n\n\tvar setDepthTest = function ( value ) {\n\n\t\tif ( value !== currentDepthTest ) {\n\n\t\t\tvalue === true ? gl.enable( gl.DEPTH_TEST ) : gl.disable( gl.DEPTH_TEST );\n\t\t\tcurrentDepthTest = value;\n\n\t\t}\n\n\t};\n\n\t// depthWrite\n\n\tvar currentDepthWrite = null;\n\n\tvar setDepthWrite = function ( value ) {\n\n\t\tif ( value !== currentDepthWrite ) {\n\n\t\t\tgl.depthMask( value );\n\t\t\tcurrentDepthWrite = value;\n\n\t\t}\n\n\t};\n\n\tvar objectsOpaque = [];\n\tvar objectsTransparent = [];\n\n\tvar projectObject = function ( object ) {\n\n\t\tif ( object.visible === false ) return;\n\n\t\tif ( object instanceof THREE.Mesh && frustum.intersectsObject( object ) === true ) {\n\n\t\t\t// TODO: Do not polute scene graph with .z\n\n\t\t\tif ( object.renderDepth !== null ) {\n\n\t\t\t\tobject.z = object.renderDepth;\n\n\t\t\t} else {\n\n\t\t\t\tvector3.setFromMatrixPosition( object.matrixWorld );\n\t\t\t\tvector3.applyProjection( cameraViewProjectionMatrix );\n\n\t\t\t\tobject.z = vector3.z;\n\n\t\t\t}\n\n\t\t\tif ( object.material.transparent === true ) {\n\n\t\t\t\tobjectsTransparent.push( object );\n\n\t\t\t} else {\n\n\t\t\t\tobjectsOpaque.push( object );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfor ( var i = 0, l = object.children.length; i < l; i ++ ) {\n\n\t\t\tprojectObject( object.children[ i ] );\n\n\t\t}\n\n\t};\n\n\tvar sortOpaque = function ( a, b ) {\n\n\t\treturn a.z - b.z;\n\n\t};\n\n\tvar sortTransparent = function ( a, b ) {\n\n\t\treturn a.z !== b.z ? b.z - a.z : b.id - a.id;\n\n\t};\n\n\tvar currentBuffer, currentMaterial, currentProgram;\n\tvar locations = {};\n\n\tvar renderObject = function ( object, camera ) {\n\n\t\tvar buffer = getBuffer( object.geometry, object.material );\n\n\t\tvar material = object.material;\n\n\t\tif ( material !== currentMaterial ) {\n\n\t\t\tvar program = getProgram( object.material );\n\n\t\t\tif ( program !== currentProgram ) {\n\n\t\t\t\tgl.useProgram( program );\n\n\t\t\t\tlocations.modelViewMatrix = gl.getUniformLocation( program, 'modelViewMatrix' );\n\t\t\t\tlocations.normalMatrix = gl.getUniformLocation( program, 'normalMatrix' );\n\t\t\t\tlocations.projectionMatrix = gl.getUniformLocation( program, 'projectionMatrix' );\n\n\t\t\t\tlocations.position = gl.getAttribLocation( program, 'position' );\n\t\t\t\tlocations.normal = gl.getAttribLocation( program, 'normal' );\n\n\t\t\t\tgl.uniformMatrix4fv( locations.projectionMatrix, false, camera.projectionMatrix.elements );\n\n\t\t\t\tcurrentProgram = program;\n\n\t\t\t}\n\n\t\t\tif ( material instanceof THREE.MeshNormalMaterial ) {\n\n\t\t\t\tgl.uniform1f( gl.getUniformLocation( program, 'opacity' ), material.opacity );\n\n\t\t\t} else if ( material instanceof THREE.ShaderMaterial ) {\n\n\t\t\t\tvar uniforms = material.uniforms;\n\n\t\t\t\tfor ( var uniform in uniforms ) {\n\n\t\t\t\t\tvar location = gl.getUniformLocation( program, uniform );\n\n\t\t\t\t\tvar type = uniforms[ uniform ].type;\n\t\t\t\t\tvar value = uniforms[ uniform ].value;\n\n\t\t\t\t\tif ( type === \"i\" ) { // single integer\n\n\t\t\t\t\t\tgl.uniform1i( location, value );\n\n\t\t\t\t\t} else if ( type === \"f\" ) { // single float\n\n\t\t\t\t\t\tgl.uniform1f( location, value );\n\n\t\t\t\t\t} else if ( type === \"v2\" ) { // single THREE.Vector2\n\n\t\t\t\t\t\tgl.uniform2f( location, value.x, value.y );\n\n\t\t\t\t\t} else if ( type === \"v3\" ) { // single THREE.Vector3\n\n\t\t\t\t\t\tgl.uniform3f( location, value.x, value.y, value.z );\n\n\t\t\t\t\t} else if ( type === \"v4\" ) { // single THREE.Vector4\n\n\t\t\t\t\t\tgl.uniform4f( location, value.x, value.y, value.z, value.w );\n\n\t\t\t\t\t} else if ( type === \"c\" ) { // single THREE.Color\n\n\t\t\t\t\t\tgl.uniform3f( location, value.r, value.g, value.b );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tcurrentMaterial = material;\n\n\t\t}\n\n\t\tif ( buffer !== currentBuffer ) {\n\n\t\t\tgl.bindBuffer( gl.ARRAY_BUFFER, buffer.positions );\n\t\t\tgl.enableVertexAttribArray( locations.position );\n\t\t\tgl.vertexAttribPointer( locations.position, 3, gl.FLOAT, false, 0, 0 );\n\n\t\t\tif ( locations.normal >= 0 ) {\n\n\t\t\t\tgl.bindBuffer( gl.ARRAY_BUFFER, buffer.normals );\n\t\t\t\tgl.enableVertexAttribArray( locations.normal );\n\t\t\t\tgl.vertexAttribPointer( locations.normal, 3, gl.FLOAT, false, 0, 0 );\n\n\t\t\t}\n\n\t\t\tcurrentBuffer = buffer;\n\n\t\t}\n\n\t\tmodelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld );\n\t\tnormalMatrix.getNormalMatrix( modelViewMatrix );\n\n\t\tgl.uniformMatrix4fv( locations.modelViewMatrix, false, modelViewMatrix.elements );\n\t\tgl.uniformMatrix3fv( locations.normalMatrix, false, normalMatrix.elements );\n\n\t\tgl.drawArrays( gl.TRIANGLES, 0, buffer.count );\n\n\t\tscope.info.render.calls ++;\n\n\t};\n\n\tthis.render = function ( scene, camera ) {\n\n\t\tif ( this.autoClear === true ) this.clear();\n\n\t\tscene.updateMatrixWorld();\n\n\t\tif ( camera.parent === undefined ) camera.updateMatrixWorld();\n\n\t\tcamera.matrixWorldInverse.getInverse( camera.matrixWorld );\n\n\t\tcameraViewProjectionMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );\n\t\tfrustum.setFromMatrix( cameraViewProjectionMatrix );\n\n\t\tobjectsOpaque.length = 0;\n\t\tobjectsTransparent.length = 0;\n\n\t\tscope.info.render.calls = 0;\n\n\t\tcurrentBuffer = undefined;\n\t\tcurrentMaterial = undefined;\n\t\tcurrentProgram = undefined;\n\n\t\tprojectObject( scene );\n\n\t\tif ( objectsOpaque.length > 0 ) {\n\n\t\t\tobjectsOpaque.sort( sortOpaque );\n\n\t\t\tsetBlending( THREE.NoBlending );\n\n\t\t\tfor ( var i = 0, l = objectsOpaque.length; i < l; i ++ ) {\n\n\t\t\t\trenderObject( objectsOpaque[ i ], camera );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( objectsTransparent.length > 0 ) {\n\n\t\t\tobjectsTransparent.sort( sortTransparent );\n\n\t\t\tsetBlending( THREE.NormalBlending );\n\n\t\t\tfor ( var i = 0, l = objectsTransparent.length; i < l; i ++ ) {\n\n\t\t\t\trenderObject( objectsTransparent[ i ], camera );\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Renderers/WebGLDeferredRenderer.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Renderers/WebGLDeferredRenderer.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n * @author MPanknin / http://www.redplant.de/\n */\n\nTHREE.WebGLDeferredRenderer = function ( parameters ) {\n\n\tvar _this = this;\n\n\tvar fullWidth = parameters.width !== undefined ? parameters.width : 800;\n\tvar fullHeight = parameters.height !== undefined ? parameters.height : 600;\n\tvar currentScale = parameters.scale !== undefined ? parameters.scale : 1;\n\n\tvar scaledWidth = Math.floor( currentScale * fullWidth );\n\tvar scaledHeight = Math.floor( currentScale * fullHeight );\n\n\tvar brightness = parameters.brightness !== undefined ? parameters.brightness : 1;\n\tvar tonemapping = parameters.tonemapping !== undefined ? parameters.tonemapping : THREE.SimpleOperator;\n\tvar antialias = parameters.antialias !== undefined ? parameters.antialias : false;\n\n\tthis.renderer = parameters.renderer;\n\n\tif ( this.renderer === undefined ) {\n\n\t\tthis.renderer = new THREE.WebGLRenderer( { antialias: false } );\n\t\tthis.renderer.setSize( fullWidth, fullHeight );\n\t\tthis.renderer.setClearColor( 0x000000, 0 );\n\n\t\tthis.renderer.autoClear = false;\n\n\t}\n\n\tthis.domElement = this.renderer.domElement;\n\n\t//\n\n\tvar gl = this.renderer.context;\n\n\t//\n\n\tvar currentCamera = null;\n\tvar projectionMatrixInverse = new THREE.Matrix4();\n\n\tvar positionVS = new THREE.Vector3();\n\tvar directionVS = new THREE.Vector3();\n\tvar tempVS = new THREE.Vector3();\n\n\tvar rightVS = new THREE.Vector3();\n\tvar normalVS = new THREE.Vector3();\n\tvar upVS = new THREE.Vector3();\n\n\t//\n\n\tvar geometryLightSphere = new THREE.SphereGeometry( 1, 16, 8 );\n\tvar geometryLightPlane = new THREE.PlaneGeometry( 2, 2 );\n\n\tvar black = new THREE.Color( 0x000000 );\n\n\tvar colorShader = THREE.ShaderDeferred[ \"color\" ];\n\tvar normalDepthShader = THREE.ShaderDeferred[ \"normalDepth\" ];\n\n\t//\n\n\tvar emissiveLightShader = THREE.ShaderDeferred[ \"emissiveLight\" ];\n\tvar pointLightShader = THREE.ShaderDeferred[ \"pointLight\" ];\n\tvar spotLightShader = THREE.ShaderDeferred[ \"spotLight\" ];\n\tvar directionalLightShader = THREE.ShaderDeferred[ \"directionalLight\" ];\n\tvar hemisphereLightShader = THREE.ShaderDeferred[ \"hemisphereLight\" ];\n\tvar areaLightShader = THREE.ShaderDeferred[ \"areaLight\" ];\n\n\tvar compositeShader = THREE.ShaderDeferred[ \"composite\" ];\n\n\t//\n\n\tvar compColor, compNormal, compDepth, compLight, compFinal;\n\tvar passColor, passNormal, passDepth, passLightFullscreen, passLightProxy, compositePass;\n\n\tvar effectFXAA;\n\n\t//\n\n\tvar lightSceneFullscreen, lightSceneProxy;\n\n\t//\n\n\tvar resizableMaterials = [];\n\n\t//\n\n\tvar invisibleMaterial = new THREE.ShaderMaterial();\n\tinvisibleMaterial.visible = false;\n\n\n\tvar defaultNormalDepthMaterial = new THREE.ShaderMaterial( {\n\n\t\tuniforms:       THREE.UniformsUtils.clone( normalDepthShader.uniforms ),\n\t\tvertexShader:   normalDepthShader.vertexShader,\n\t\tfragmentShader: normalDepthShader.fragmentShader,\n\t\tblending:\t\tTHREE.NoBlending\n\n\t} );\n\n\t//\n\n\tvar initDeferredMaterials = function ( object ) {\n\n\t\tif ( object.material instanceof THREE.MeshFaceMaterial ) {\n\n\t\t\tvar colorMaterials = [];\n\t\t\tvar normalDepthMaterials = [];\n\n\t\t\tvar materials = object.material.materials;\n\n\t\t\tfor ( var i = 0, il = materials.length; i < il; i ++ ) {\n\n\t\t\t\tvar deferredMaterials = createDeferredMaterials( materials[ i ] );\n\n\t\t\t\tif ( deferredMaterials.transparent ) {\n\n\t\t\t\t\tcolorMaterials.push( invisibleMaterial );\n\t\t\t\t\tnormalDepthMaterials.push( invisibleMaterial );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tcolorMaterials.push( deferredMaterials.colorMaterial );\n\t\t\t\t\tnormalDepthMaterials.push( deferredMaterials.normalDepthMaterial );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tobject.userData.colorMaterial = new THREE.MeshFaceMaterial( colorMaterials );\n\t\t\tobject.userData.normalDepthMaterial = new THREE.MeshFaceMaterial( normalDepthMaterials );\n\n\t\t} else {\n\n\t\t\tvar deferredMaterials = createDeferredMaterials( object.material );\n\n\t\t\tobject.userData.colorMaterial = deferredMaterials.colorMaterial;\n\t\t\tobject.userData.normalDepthMaterial = deferredMaterials.normalDepthMaterial;\n\t\t\tobject.userData.transparent = deferredMaterials.transparent;\n\n\t\t}\n\n\t};\n\n\tvar createDeferredMaterials = function ( originalMaterial ) {\n\n\t\tvar deferredMaterials = {};\n\n\t\t// color material\n\t\t// -----------------\n\t\t// \tdiffuse color\n\t\t//\tspecular color\n\t\t//\tshininess\n\t\t//\tdiffuse map\n\t\t//\tvertex colors\n\t\t//\talphaTest\n\t\t// \tmorphs\n\n\t\tvar uniforms = THREE.UniformsUtils.clone( colorShader.uniforms );\n\t\tvar defines = { \"USE_MAP\": !! originalMaterial.map, \"USE_ENVMAP\": !! originalMaterial.envMap, \"GAMMA_INPUT\": true };\n\n\t\tvar material = new THREE.ShaderMaterial( {\n\n\t\t\tfragmentShader: colorShader.fragmentShader,\n\t\t\tvertexShader: \tcolorShader.vertexShader,\n\t\t\tuniforms: \t\tuniforms,\n\t\t\tdefines: \t\tdefines,\n\t\t\tshading:\t\toriginalMaterial.shading\n\n\t\t} );\n\n\t\tif ( originalMaterial instanceof THREE.MeshBasicMaterial ) {\n\n\t\t\tvar diffuse = black;\n\t\t\tvar emissive = originalMaterial.color;\n\n\t\t} else {\n\n\t\t\tvar diffuse = originalMaterial.color;\n\t\t\tvar emissive = originalMaterial.emissive !== undefined ? originalMaterial.emissive : black;\n\n\t\t}\n\n\t\tvar specular = originalMaterial.specular !== undefined ? originalMaterial.specular : black;\n\t\tvar shininess = originalMaterial.shininess !== undefined ? originalMaterial.shininess : 1;\n\t\tvar wrapAround = originalMaterial.wrapAround !== undefined ? ( originalMaterial.wrapAround ? -1 : 1 ) : 1;\n\t\tvar additiveSpecular = originalMaterial.metal !== undefined ? ( originalMaterial.metal ? 1 : -1 ) : -1;\n\n\t\tuniforms.emissive.value.copyGammaToLinear( emissive );\n\t\tuniforms.diffuse.value.copyGammaToLinear( diffuse );\n\t\tuniforms.specular.value.copyGammaToLinear( specular );\n\t\tuniforms.shininess.value = shininess;\n\t\tuniforms.wrapAround.value = wrapAround;\n\t\tuniforms.additiveSpecular.value = additiveSpecular;\n\n\t\tuniforms.map.value = originalMaterial.map;\n\n\t\tif ( originalMaterial.envMap ) {\n\n\t\t\tuniforms.envMap.value = originalMaterial.envMap;\n\t\t\tuniforms.useRefract.value = originalMaterial.envMap.mapping instanceof THREE.CubeRefractionMapping;\n\t\t\tuniforms.refractionRatio.value = originalMaterial.refractionRatio;\n\t\t\tuniforms.combine.value = originalMaterial.combine;\n\t\t\tuniforms.reflectivity.value = originalMaterial.reflectivity;\n\t\t\tuniforms.flipEnvMap.value = ( originalMaterial.envMap instanceof THREE.WebGLRenderTargetCube ) ? 1 : -1;\n\n\t\t\tuniforms.samplerNormalDepth.value = compNormalDepth.renderTarget2;\n\t\t\tuniforms.viewWidth.value = scaledWidth;\n\t\t\tuniforms.viewHeight.value = scaledHeight;\n\n\t\t\tresizableMaterials.push( { \"material\": material } );\n\n\t\t}\n\n\t\tmaterial.vertexColors = originalMaterial.vertexColors;\n\t\tmaterial.morphTargets = originalMaterial.morphTargets;\n\t\tmaterial.morphNormals = originalMaterial.morphNormals;\n\t\tmaterial.skinning = originalMaterial.skinning;\n\n\t\tmaterial.alphaTest = originalMaterial.alphaTest;\n\t\tmaterial.wireframe = originalMaterial.wireframe;\n\n\t\t// uv repeat and offset setting priorities\n\t\t//\t1. color map\n\t\t//\t2. specular map\n\t\t//\t3. normal map\n\t\t//\t4. bump map\n\n\t\tvar uvScaleMap;\n\n\t\tif ( originalMaterial.map ) {\n\n\t\t\tuvScaleMap = originalMaterial.map;\n\n\t\t} else if ( originalMaterial.specularMap ) {\n\n\t\t\tuvScaleMap = originalMaterial.specularMap;\n\n\t\t} else if ( originalMaterial.normalMap ) {\n\n\t\t\tuvScaleMap = originalMaterial.normalMap;\n\n\t\t} else if ( originalMaterial.bumpMap ) {\n\n\t\t\tuvScaleMap = originalMaterial.bumpMap;\n\n\t\t}\n\n\t\tif ( uvScaleMap !== undefined ) {\n\n\t\t\tvar offset = uvScaleMap.offset;\n\t\t\tvar repeat = uvScaleMap.repeat;\n\n\t\t\tuniforms.offsetRepeat.value.set( offset.x, offset.y, repeat.x, repeat.y );\n\n\t\t}\n\n\t\tdeferredMaterials.colorMaterial = material;\n\n\t\t// normal + depth material\n\t\t// -----------------\n\t\t//\tvertex normals\n\t\t//\tmorph normals\n\t\t//\tbump map\n\t\t//\tbump scale\n\t\t//  clip depth\n\n\t\tif ( originalMaterial.morphTargets || originalMaterial.skinning || originalMaterial.bumpMap ) {\n\n\t\t\tvar uniforms = THREE.UniformsUtils.clone( normalDepthShader.uniforms );\n\t\t\tvar defines = { \"USE_BUMPMAP\": !!originalMaterial.bumpMap };\n\n\t\t\tvar normalDepthMaterial = new THREE.ShaderMaterial( {\n\n\t\t\t\tuniforms:       uniforms,\n\t\t\t\tvertexShader:   normalDepthShader.vertexShader,\n\t\t\t\tfragmentShader: normalDepthShader.fragmentShader,\n\t\t\t\tshading:\t\toriginalMaterial.shading,\n\t\t\t\tdefines:\t\tdefines,\n\t\t\t\tblending:\t\tTHREE.NoBlending\n\n\t\t\t} );\n\n\t\t\tnormalDepthMaterial.morphTargets = originalMaterial.morphTargets;\n\t\t\tnormalDepthMaterial.morphNormals = originalMaterial.morphNormals;\n\t\t\tnormalDepthMaterial.skinning = originalMaterial.skinning;\n\n\t\t\tif ( originalMaterial.bumpMap ) {\n\n\t\t\t\tuniforms.bumpMap.value = originalMaterial.bumpMap;\n\t\t\t\tuniforms.bumpScale.value = originalMaterial.bumpScale;\n\n\t\t\t\tvar offset = originalMaterial.bumpMap.offset;\n\t\t\t\tvar repeat = originalMaterial.bumpMap.repeat;\n\n\t\t\t\tuniforms.offsetRepeat.value.set( offset.x, offset.y, repeat.x, repeat.y );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tvar normalDepthMaterial = defaultNormalDepthMaterial.clone();\n\n\t\t}\n\n\t\tnormalDepthMaterial.wireframe = originalMaterial.wireframe;\n\t\tnormalDepthMaterial.vertexColors = originalMaterial.vertexColors;\n\n\t\tdeferredMaterials.normalDepthMaterial = normalDepthMaterial;\n\n\t\t//\n\n\t\tdeferredMaterials.transparent = originalMaterial.transparent;\n\n\t\treturn deferredMaterials;\n\n\t};\n\n\tvar updatePointLightProxy = function ( lightProxy ) {\n\n\t\tvar light = lightProxy.userData.originalLight;\n\t\tvar uniforms = lightProxy.material.uniforms;\n\n\t\t// skip infinite pointlights\n\t\t// right now you can't switch between infinite and finite pointlights\n\t\t// it's just too messy as they use different proxies\n\n\t\tvar distance = light.distance;\n\n\t\tif ( distance > 0 ) {\n\n\t\t\tlightProxy.scale.set( 1, 1, 1 ).multiplyScalar( distance );\n\t\t\tuniforms[ \"lightRadius\" ].value = distance;\n\n\t\t\tpositionVS.setFromMatrixPosition( light.matrixWorld );\n\t\t\tpositionVS.applyMatrix4( currentCamera.matrixWorldInverse );\n\n\t\t\tuniforms[ \"lightPositionVS\" ].value.copy( positionVS );\n\n\t\t\tlightProxy.position.setFromMatrixPosition( light.matrixWorld );\n\n\t\t} else {\n\n\t\t\tuniforms[ \"lightRadius\" ].value = Infinity;\n\n\t\t}\n\n\t\t// linear space colors\n\n\t\tvar intensity = light.intensity * light.intensity;\n\n\t\tuniforms[ \"lightIntensity\" ].value = intensity;\n\t\tuniforms[ \"lightColor\" ].value.copyGammaToLinear( light.color );\n\n\t};\n\n\tvar createDeferredPointLight = function ( light ) {\n\n\t\t// setup light material\n\n\t\tvar materialLight = new THREE.ShaderMaterial( {\n\n\t\t\tuniforms:       THREE.UniformsUtils.clone( pointLightShader.uniforms ),\n\t\t\tvertexShader:   pointLightShader.vertexShader,\n\t\t\tfragmentShader: pointLightShader.fragmentShader,\n\n\t\t\tblending:\t\tTHREE.AdditiveBlending,\n\t\t\tdepthWrite:\t\tfalse,\n\t\t\ttransparent:\ttrue,\n\n\t\t\tside: THREE.BackSide\n\n\t\t} );\n\n\t\t// infinite pointlights use full-screen quad proxy\n\t\t// regular pointlights use sphere proxy\n\n\t\tvar  geometry;\n\n\t\tif ( light.distance > 0 ) {\n\n\t\t\tgeometry = geometryLightSphere;\n\n\t\t} else {\n\n\t\t\tgeometry = geometryLightPlane;\n\n\t\t\tmaterialLight.depthTest = false;\n\t\t\tmaterialLight.side = THREE.FrontSide;\n\n\t\t}\n\n\t\tmaterialLight.uniforms[ \"viewWidth\" ].value = scaledWidth;\n\t\tmaterialLight.uniforms[ \"viewHeight\" ].value = scaledHeight;\n\n\t\tmaterialLight.uniforms[ 'samplerColor' ].value = compColor.renderTarget2;\n\t\tmaterialLight.uniforms[ 'samplerNormalDepth' ].value = compNormalDepth.renderTarget2;\n\n\t\t// create light proxy mesh\n\n\t\tvar meshLight = new THREE.Mesh( geometry, materialLight );\n\n\t\t// keep reference for color and intensity updates\n\n\t\tmeshLight.userData.originalLight = light;\n\n\t\t// keep reference for size reset\n\n\t\tresizableMaterials.push( { \"material\": materialLight } );\n\n\t\t// sync proxy uniforms to the original light\n\n\t\tupdatePointLightProxy( meshLight );\n\n\t\treturn meshLight;\n\n\t};\n\n\tvar updateSpotLightProxy = function ( lightProxy ) {\n\n\t\tvar light = lightProxy.userData.originalLight;\n\t\tvar uniforms = lightProxy.material.uniforms;\n\n\t\tvar viewMatrix = currentCamera.matrixWorldInverse;\n\t\tvar modelMatrix = light.matrixWorld;\n\n\t\tpositionVS.setFromMatrixPosition( modelMatrix );\n\t\tpositionVS.applyMatrix4( viewMatrix );\n\n\t\tdirectionVS.setFromMatrixPosition( modelMatrix );\n\t\ttempVS.setFromMatrixPosition( light.target.matrixWorld );\n\t\tdirectionVS.sub( tempVS );\n\t\tdirectionVS.normalize();\n\t\tdirectionVS.transformDirection( viewMatrix );\n\n\t\tuniforms[ \"lightPositionVS\" ].value.copy( positionVS );\n\t\tuniforms[ \"lightDirectionVS\" ].value.copy( directionVS );\n\n\t\tuniforms[ \"lightAngle\" ].value = light.angle;\n\t\tuniforms[ \"lightDistance\" ].value = light.distance;\n\n\t\t// linear space colors\n\n\t\tvar intensity = light.intensity * light.intensity;\n\n\t\tuniforms[ \"lightIntensity\" ].value = intensity;\n\t\tuniforms[ \"lightColor\" ].value.copyGammaToLinear( light.color );\n\n\t};\n\n\tvar createDeferredSpotLight = function ( light ) {\n\n\t\t// setup light material\n\n\t\tvar uniforms = THREE.UniformsUtils.clone( spotLightShader.uniforms );\n\n\t\tvar materialLight = new THREE.ShaderMaterial( {\n\n\t\t\tuniforms:       uniforms,\n\t\t\tvertexShader:   spotLightShader.vertexShader,\n\t\t\tfragmentShader: spotLightShader.fragmentShader,\n\n\t\t\tblending:\t\tTHREE.AdditiveBlending,\n\t\t\tdepthWrite:\t\tfalse,\n\t\t\tdepthTest:\t\tfalse,\n\t\t\ttransparent:\ttrue\n\n\t\t} );\n\n\t\tuniforms[ \"viewWidth\" ].value = scaledWidth;\n\t\tuniforms[ \"viewHeight\" ].value = scaledHeight;\n\n\t\tuniforms[ 'samplerColor' ].value = compColor.renderTarget2;\n\t\tuniforms[ 'samplerNormalDepth' ].value = compNormalDepth.renderTarget2;\n\n\t\t// create light proxy mesh\n\n\t\tvar meshLight = new THREE.Mesh( geometryLightPlane, materialLight );\n\n\t\t// keep reference for color and intensity updates\n\n\t\tmeshLight.userData.originalLight = light;\n\n\t\t// keep reference for size reset\n\n\t\tresizableMaterials.push( { \"material\": materialLight } );\n\n\t\t// sync proxy uniforms to the original light\n\n\t\tupdateSpotLightProxy( meshLight );\n\n\t\treturn meshLight;\n\n\t};\n\n\tvar updateDirectionalLightProxy = function ( lightProxy ) {\n\n\t\tvar light = lightProxy.userData.originalLight;\n\t\tvar uniforms = lightProxy.material.uniforms;\n\n\t\tdirectionVS.setFromMatrixPosition( light.matrixWorld );\n\t\ttempVS.setFromMatrixPosition( light.target.matrixWorld );\n\t\tdirectionVS.sub( tempVS );\n\t\tdirectionVS.normalize();\n\t\tdirectionVS.transformDirection( currentCamera.matrixWorldInverse );\n\n\t\tuniforms[ \"lightDirectionVS\" ].value.copy( directionVS );\n\n\t\t// linear space colors\n\n\t\tvar intensity = light.intensity * light.intensity;\n\n\t\tuniforms[ \"lightIntensity\" ].value = intensity;\n\t\tuniforms[ \"lightColor\" ].value.copyGammaToLinear( light.color );\n\n\t};\n\n\tvar createDeferredDirectionalLight = function ( light ) {\n\n\t\t// setup light material\n\n\t\tvar uniforms = THREE.UniformsUtils.clone( directionalLightShader.uniforms );\n\n\t\tvar materialLight = new THREE.ShaderMaterial( {\n\n\t\t\tuniforms:       uniforms,\n\t\t\tvertexShader:   directionalLightShader.vertexShader,\n\t\t\tfragmentShader: directionalLightShader.fragmentShader,\n\n\t\t\tblending:\t\tTHREE.AdditiveBlending,\n\t\t\tdepthWrite:\t\tfalse,\n\t\t\tdepthTest:\t\tfalse,\n\t\t\ttransparent:\ttrue\n\n\t\t} );\n\n\t\tuniforms[ \"viewWidth\" ].value = scaledWidth;\n\t\tuniforms[ \"viewHeight\" ].value = scaledHeight;\n\n\t\tuniforms[ 'samplerColor' ].value = compColor.renderTarget2;\n\t\tuniforms[ 'samplerNormalDepth' ].value = compNormalDepth.renderTarget2;\n\n\t\t// create light proxy mesh\n\n\t\tvar meshLight = new THREE.Mesh( geometryLightPlane, materialLight );\n\n\t\t// keep reference for color and intensity updates\n\n\t\tmeshLight.userData.originalLight = light;\n\n\t\t// keep reference for size reset\n\n\t\tresizableMaterials.push( { \"material\": materialLight } );\n\n\t\t// sync proxy uniforms to the original light\n\n\t\tupdateDirectionalLightProxy( meshLight );\n\n\t\treturn meshLight;\n\n\t};\n\n\tvar updateHemisphereLightProxy = function ( lightProxy ) {\n\n\t\tvar light = lightProxy.userData.originalLight;\n\t\tvar uniforms = lightProxy.material.uniforms;\n\n\t\tdirectionVS.setFromMatrixPosition( light.matrixWorld );\n\t\tdirectionVS.normalize();\n\t\tdirectionVS.transformDirection( currentCamera.matrixWorldInverse );\n\n\t\tuniforms[ \"lightDirectionVS\" ].value.copy( directionVS );\n\n\t\t// linear space colors\n\n\t\tvar intensity = light.intensity * light.intensity;\n\n\t\tuniforms[ \"lightIntensity\" ].value = intensity;\n\t\tuniforms[ \"lightColorSky\" ].value.copyGammaToLinear( light.color );\n\t\tuniforms[ \"lightColorGround\" ].value.copyGammaToLinear( light.groundColor );\n\n\t};\n\n\tvar createDeferredHemisphereLight = function ( light ) {\n\n\t\t// setup light material\n\n\t\tvar uniforms = THREE.UniformsUtils.clone( hemisphereLightShader.uniforms );\n\n\t\tvar materialLight = new THREE.ShaderMaterial( {\n\n\t\t\tuniforms:       uniforms,\n\t\t\tvertexShader:   hemisphereLightShader.vertexShader,\n\t\t\tfragmentShader: hemisphereLightShader.fragmentShader,\n\n\t\t\tblending:\t\tTHREE.AdditiveBlending,\n\t\t\tdepthWrite:\t\tfalse,\n\t\t\tdepthTest:\t\tfalse,\n\t\t\ttransparent:\ttrue\n\n\t\t} );\n\n\t\tuniforms[ \"viewWidth\" ].value = scaledWidth;\n\t\tuniforms[ \"viewHeight\" ].value = scaledHeight;\n\n\t\tuniforms[ 'samplerColor' ].value = compColor.renderTarget2;\n\t\tuniforms[ 'samplerNormalDepth' ].value = compNormalDepth.renderTarget2;\n\n\t\t// create light proxy mesh\n\n\t\tvar meshLight = new THREE.Mesh( geometryLightPlane, materialLight );\n\n\t\t// keep reference for color and intensity updates\n\n\t\tmeshLight.userData.originalLight = light;\n\n\t\t// keep reference for size reset\n\n\t\tresizableMaterials.push( { \"material\": materialLight } );\n\n\t\t// sync proxy uniforms to the original light\n\n\t\tupdateHemisphereLightProxy( meshLight );\n\n\t\treturn meshLight;\n\n\t};\n\n\tvar updateAreaLightProxy = function ( lightProxy ) {\n\n\t\tvar light = lightProxy.userData.originalLight;\n\t\tvar uniforms = lightProxy.material.uniforms;\n\n\t\tvar modelMatrix = light.matrixWorld;\n\t\tvar viewMatrix = currentCamera.matrixWorldInverse;\n\n\t\tpositionVS.setFromMatrixPosition( modelMatrix );\n\t\tpositionVS.applyMatrix4( viewMatrix );\n\n\t\tuniforms[ \"lightPositionVS\" ].value.copy( positionVS );\n\n\t\trightVS.copy( light.right );\n\t\trightVS.transformDirection( modelMatrix );\n\t\trightVS.transformDirection( viewMatrix );\n\n\t\tnormalVS.copy( light.normal );\n\t\tnormalVS.transformDirection( modelMatrix );\n\t\tnormalVS.transformDirection( viewMatrix );\n\n\t\tupVS.crossVectors( rightVS, normalVS );\n\t\tupVS.normalize();\n\n\t\tuniforms[ \"lightRightVS\" ].value.copy( rightVS );\n\t\tuniforms[ \"lightNormalVS\" ].value.copy( normalVS );\n\t\tuniforms[ \"lightUpVS\" ].value.copy( upVS );\n\n\t\tuniforms[ \"lightWidth\" ].value = light.width;\n\t\tuniforms[ \"lightHeight\" ].value = light.height;\n\n\t\tuniforms[ \"constantAttenuation\" ].value = light.constantAttenuation;\n\t\tuniforms[ \"linearAttenuation\" ].value = light.linearAttenuation;\n\t\tuniforms[ \"quadraticAttenuation\" ].value = light.quadraticAttenuation;\n\n\t\t// linear space colors\n\n\t\tvar intensity = light.intensity * light.intensity;\n\n\t\tuniforms[ \"lightIntensity\" ].value = intensity;\n\t\tuniforms[ \"lightColor\" ].value.copyGammaToLinear( light.color );\n\n\t};\n\n\tvar createDeferredAreaLight = function ( light ) {\n\n\t\t// setup light material\n\n\t\tvar uniforms = THREE.UniformsUtils.clone( areaLightShader.uniforms );\n\n\t\tvar materialLight = new THREE.ShaderMaterial( {\n\n\t\t\tuniforms:       uniforms,\n\t\t\tvertexShader:   areaLightShader.vertexShader,\n\t\t\tfragmentShader: areaLightShader.fragmentShader,\n\n\t\t\tblending:\t\tTHREE.AdditiveBlending,\n\t\t\tdepthWrite:\t\tfalse,\n\t\t\tdepthTest:\t\tfalse,\n\t\t\ttransparent:\ttrue\n\n\t\t} );\n\n\t\tuniforms[ \"viewWidth\" ].value = scaledWidth;\n\t\tuniforms[ \"viewHeight\" ].value = scaledHeight;\n\n\t\tuniforms[ 'samplerColor' ].value = compColor.renderTarget2;\n\t\tuniforms[ 'samplerNormalDepth' ].value = compNormalDepth.renderTarget2;\n\n\t\t// create light proxy mesh\n\n\t\tvar meshLight = new THREE.Mesh( geometryLightPlane, materialLight );\n\n\t\t// keep reference for color and intensity updates\n\n\t\tmeshLight.userData.originalLight = light;\n\n\t\t// keep reference for size reset\n\n\t\tresizableMaterials.push( { \"material\": materialLight } );\n\n\t\t// sync proxy uniforms to the original light\n\n\t\tupdateAreaLightProxy( meshLight );\n\n\t\treturn meshLight;\n\n\t};\n\n\tvar createDeferredEmissiveLight = function () {\n\n\t\t// setup light material\n\n\t\tvar materialLight = new THREE.ShaderMaterial( {\n\n\t\t\tuniforms:       THREE.UniformsUtils.clone( emissiveLightShader.uniforms ),\n\t\t\tvertexShader:   emissiveLightShader.vertexShader,\n\t\t\tfragmentShader: emissiveLightShader.fragmentShader,\n\t\t\tdepthTest:\t\tfalse,\n\t\t\tdepthWrite:\t\tfalse,\n\t\t\tblending:\t\tTHREE.NoBlending\n\n\t\t} );\n\n\t\tmaterialLight.uniforms[ \"viewWidth\" ].value = scaledWidth;\n\t\tmaterialLight.uniforms[ \"viewHeight\" ].value = scaledHeight;\n\n\t\tmaterialLight.uniforms[ 'samplerColor' ].value = compColor.renderTarget2;\n\n\t\t// create light proxy mesh\n\n\t\tvar meshLight = new THREE.Mesh( geometryLightPlane, materialLight );\n\n\t\t// keep reference for size reset\n\n\t\tresizableMaterials.push( { \"material\": materialLight } );\n\n\t\treturn meshLight;\n\n\t};\n\n\tvar initDeferredProperties = function ( object ) {\n\n\t\tif ( object.userData.deferredInitialized ) return;\n\n\t\tif ( object.material ) initDeferredMaterials( object );\n\n\t\tif ( object instanceof THREE.PointLight ) {\n\n\t\t\tvar proxy = createDeferredPointLight( object );\n\n\t\t\tif ( object.distance > 0 ) {\n\n\t\t\t\tlightSceneProxy.add( proxy );\n\n\t\t\t} else {\n\n\t\t\t\tlightSceneFullscreen.add( proxy );\n\n\t\t\t}\n\n\t\t} else if ( object instanceof THREE.SpotLight ) {\n\n\t\t\tvar proxy = createDeferredSpotLight( object );\n\t\t\tlightSceneFullscreen.add( proxy );\n\n\t\t} else if ( object instanceof THREE.DirectionalLight ) {\n\n\t\t\tvar proxy = createDeferredDirectionalLight( object );\n\t\t\tlightSceneFullscreen.add( proxy );\n\n\t\t} else if ( object instanceof THREE.HemisphereLight ) {\n\n\t\t\tvar proxy = createDeferredHemisphereLight( object );\n\t\t\tlightSceneFullscreen.add( proxy );\n\n\t\t} else if ( object instanceof THREE.AreaLight ) {\n\n\t\t\tvar proxy = createDeferredAreaLight( object );\n\t\t\tlightSceneFullscreen.add( proxy );\n\n\t\t}\n\n\t\tobject.userData.deferredInitialized = true;\n\n\t};\n\n\t//\n\n\tvar setMaterialColor = function ( object ) {\n\n\t\tif ( object.material ) {\n\n\t\t\tif ( object.userData.transparent ) {\n\n\t\t\t\tobject.material = invisibleMaterial;\n\n\t\t\t} else {\n\n\t\t\t\tobject.material = object.userData.colorMaterial;\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tvar setMaterialNormalDepth = function ( object ) {\n\n\t\tif ( object.material ) {\n\n\t\t\tif ( object.userData.transparent ) {\n\n\t\t\t\tobject.material = invisibleMaterial;\n\n\t\t\t} else {\n\n\t\t\t\tobject.material = object.userData.normalDepthMaterial;\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\t// external API\n\n\tthis.setAntialias = function ( enabled ) {\n\n\t\tantialias = enabled;\n\n\t\tif ( antialias ) {\n\n\t\t\teffectFXAA.enabled = true;\n\t\t\tcompositePass.renderToScreen = false;\n\n\t\t} else {\n\n\t\t\teffectFXAA.enabled = false;\n\t\t\tcompositePass.renderToScreen = true;\n\t\t}\n\n\t};\n\n\tthis.getAntialias = function () {\n\n\t\treturn antialias;\n\n\t};\n\n\tthis.addEffect = function ( effect, normalDepthUniform, colorUniform ) {\n\n\t\tif ( effect.material && effect.uniforms ) {\n\n\t\t\tif ( normalDepthUniform ) effect.uniforms[ normalDepthUniform ].value = compNormalDepth.renderTarget2;\n\t\t\tif ( colorUniform )    \t  effect.uniforms[ colorUniform ].value = compColor.renderTarget2;\n\n\t\t\tif ( normalDepthUniform || colorUniform ) {\n\n\t\t\t\tresizableMaterials.push( { \"material\": effect.material, \"normalDepth\": normalDepthUniform, \"color\": colorUniform } );\n\n\t\t\t}\n\n\t\t}\n\n\t\tcompFinal.insertPass( effect, -1 );\n\n\t};\n\n\tthis.setScale = function ( scale ) {\n\n\t\tcurrentScale = scale;\n\n\t\tscaledWidth = Math.floor( currentScale * fullWidth );\n\t\tscaledHeight = Math.floor( currentScale * fullHeight );\n\n\t\tcompNormalDepth.setSize( scaledWidth, scaledHeight );\n\t\tcompColor.setSize( scaledWidth, scaledHeight );\n\t\tcompLight.setSize( scaledWidth, scaledHeight );\n\t\tcompFinal.setSize( scaledWidth, scaledHeight );\n\n\t\tcompColor.renderTarget2.shareDepthFrom = compNormalDepth.renderTarget2;\n\t\tcompLight.renderTarget2.shareDepthFrom = compNormalDepth.renderTarget2;\n\n\t\tfor ( var i = 0, il = resizableMaterials.length; i < il; i ++ ) {\n\n\t\t\tvar materialEntry = resizableMaterials[ i ];\n\n\t\t\tvar material = materialEntry.material;\n\t\t\tvar uniforms = material.uniforms;\n\n\t\t\tvar colorLabel = materialEntry.color !== undefined ? materialEntry.color : 'samplerColor';\n\t\t\tvar normalDepthLabel = materialEntry.normalDepth !== undefined ? materialEntry.normalDepth : 'samplerNormalDepth';\n\n\t\t\tif ( uniforms[ colorLabel ] ) uniforms[ colorLabel ].value = compColor.renderTarget2;\n\t\t\tif ( uniforms[ normalDepthLabel ] ) uniforms[ normalDepthLabel ].value = compNormalDepth.renderTarget2;\n\n\t\t\tif ( uniforms[ 'viewWidth' ] ) uniforms[ \"viewWidth\" ].value = scaledWidth;\n\t\t\tif ( uniforms[ 'viewHeight' ] ) uniforms[ \"viewHeight\" ].value = scaledHeight;\n\n\t\t}\n\n\t\tcompositePass.uniforms[ 'samplerLight' ].value = compLight.renderTarget2;\n\n\t\teffectFXAA.uniforms[ 'resolution' ].value.set( 1 / fullWidth, 1 / fullHeight );\n\n\t};\n\n\tthis.setSize = function ( width, height ) {\n\n\t\tfullWidth = width;\n\t\tfullHeight = height;\n\n\t\tthis.renderer.setSize( fullWidth, fullHeight );\n\n\t\tthis.setScale( currentScale );\n\n\t};\n\n\t//\n\n\tfunction updateLightProxy ( proxy ) {\n\n\t\tvar uniforms = proxy.material.uniforms;\n\n\t\tif ( uniforms[ \"matProjInverse\" ] ) uniforms[ \"matProjInverse\" ].value = projectionMatrixInverse;\n\t\tif ( uniforms[ \"matView\" ] ) uniforms[ \"matView\" ].value = currentCamera.matrixWorldInverse;\n\n\t\tvar originalLight = proxy.userData.originalLight;\n\n\t\tif ( originalLight ) {\n\n\t\t\tproxy.visible = originalLight.visible;\n\n\t\t\tif ( originalLight instanceof THREE.PointLight ) {\n\n\t\t\t\tupdatePointLightProxy( proxy );\n\n\t\t\t} else if ( originalLight instanceof THREE.SpotLight ) {\n\n\t\t\t\tupdateSpotLightProxy( proxy );\n\n\t\t\t} else if ( originalLight instanceof THREE.DirectionalLight ) {\n\n\t\t\t\tupdateDirectionalLightProxy( proxy );\n\n\t\t\t} else if ( originalLight instanceof THREE.HemisphereLight ) {\n\n\t\t\t\tupdateHemisphereLightProxy( proxy );\n\n\t\t\t} else if ( originalLight instanceof THREE.AreaLight ) {\n\n\t\t\t\tupdateAreaLightProxy( proxy );\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tthis.render = function ( scene, camera ) {\n\n\t\t// setup deferred properties\n\n\t\tif ( ! scene.userData.lightSceneProxy ) {\n\n\t\t\tscene.userData.lightSceneProxy = new THREE.Scene();\n\t\t\tscene.userData.lightSceneFullscreen = new THREE.Scene();\n\n\t\t\tvar meshLight = createDeferredEmissiveLight();\n\t\t\tscene.userData.lightSceneFullscreen.add( meshLight );\n\n\t\t}\n\n\t\tcurrentCamera = camera;\n\n\t\tlightSceneProxy = scene.userData.lightSceneProxy;\n\t\tlightSceneFullscreen = scene.userData.lightSceneFullscreen;\n\n\t\tpassColor.camera = currentCamera;\n\t\tpassNormalDepth.camera = currentCamera;\n\t\tpassLightProxy.camera = currentCamera;\n\t\tpassLightFullscreen.camera = new THREE.OrthographicCamera( -1, 1, 1, -1, 0, 1 );\n\n\t\tpassColor.scene = scene;\n\t\tpassNormalDepth.scene = scene;\n\t\tpassLightFullscreen.scene = lightSceneFullscreen;\n\t\tpassLightProxy.scene = lightSceneProxy;\n\n\t\tscene.traverse( initDeferredProperties );\n\n\t\t// update scene graph only once per frame\n\t\t// (both color and normalDepth passes use exactly the same scene state)\n\n\t\tscene.autoUpdate = false;\n\t\tscene.updateMatrixWorld();\n\n\t\t// 1) g-buffer normals + depth pass\n\n\t\tscene.traverse( setMaterialNormalDepth );\n\n\t\t// clear shared depth buffer\n\n\t\tthis.renderer.autoClearDepth = true;\n\t\tthis.renderer.autoClearStencil = true;\n\n\t\t// write 1 to shared stencil buffer\n\t\t// for non-background pixels\n\n\t\t//gl.enable( gl.STENCIL_TEST );\n\t\tgl.stencilOp( gl.REPLACE, gl.REPLACE, gl.REPLACE );\n\t\tgl.stencilFunc( gl.ALWAYS, 1, 0xffffffff );\n\t\tgl.clearStencil( 0 );\n\n\t\tcompNormalDepth.render();\n\n\t\t// just touch foreground pixels (stencil == 1)\n\t\t// both in color and light passes\n\n\t\tgl.stencilFunc( gl.EQUAL, 1, 0xffffffff );\n\t\tgl.stencilOp( gl.KEEP, gl.KEEP, gl.KEEP );\n\n\t\t// 2) g-buffer color pass\n\n\t\tscene.traverse( setMaterialColor );\n\n\t\t// must use clean slate depth buffer\n\t\t// otherwise there are z-fighting glitches\n\t\t// not enough precision between two geometry passes\n\t\t// just to use EQUAL depth test\n\n\t\tthis.renderer.autoClearDepth = true;\n\t\tthis.renderer.autoClearStencil = false;\n\n\t\tcompColor.render();\n\n\t\t// 3) light pass\n\n\t\t// do not clear depth buffer in this pass\n\t\t// depth from geometry pass is used for light culling\n\t\t// (write light proxy color pixel if behind scene pixel)\n\n\t\tthis.renderer.autoClearDepth = false;\n\n\t\tscene.autoUpdate = true;\n\n\t\tgl.depthFunc( gl.GEQUAL );\n\n\t\tprojectionMatrixInverse.getInverse( currentCamera.projectionMatrix );\n\n\t\tfor ( var i = 0, il = lightSceneProxy.children.length; i < il; i ++ ) {\n\n\t\t\tvar proxy = lightSceneProxy.children[ i ];\n\t\t\tupdateLightProxy( proxy );\n\n\t\t}\n\n\t\tfor ( var i = 0, il = lightSceneFullscreen.children.length; i < il; i ++ ) {\n\n\t\t\tvar proxy = lightSceneFullscreen.children[ i ];\n\t\t\tupdateLightProxy( proxy );\n\n\t\t}\n\n\t\tcompLight.render();\n\n\t\t// 4) composite pass\n\n\t\t// return back to usual depth and stencil handling state\n\n\t\tthis.renderer.autoClearDepth = true;\n\t\tthis.renderer.autoClearStencil = true;\n\t\tgl.depthFunc( gl.LEQUAL );\n\t\tgl.disable( gl.STENCIL_TEST );\n\n\t\tcompFinal.render( 0.1 );\n\n\t};\n\n\t//\n\n\tvar createRenderTargets = function ( ) {\n\n\t\tvar rtParamsFloatLinear = { minFilter: THREE.NearestFilter, magFilter: THREE.LinearFilter, stencilBuffer: true,\n\t\t\t\t\t\t\t\t\tformat: THREE.RGBAFormat, type: THREE.FloatType };\n\n\t\tvar rtParamsFloatNearest = { minFilter: THREE.NearestFilter, magFilter: THREE.NearestFilter, stencilBuffer: true,\n\t\t\t\t\t\t\t\t\t format: THREE.RGBAFormat, type: THREE.FloatType };\n\n\t\tvar rtParamsUByte = { minFilter: THREE.NearestFilter, magFilter: THREE.LinearFilter, stencilBuffer: false,\n\t\t\t\t\t\t\t  format: THREE.RGBFormat, type: THREE.UnsignedByteType };\n\n\t\t// g-buffers\n\n\t\tvar rtColor   = new THREE.WebGLRenderTarget( scaledWidth, scaledHeight, rtParamsFloatNearest );\n\t\tvar rtNormalDepth = new THREE.WebGLRenderTarget( scaledWidth, scaledHeight, rtParamsFloatNearest );\n\t\tvar rtLight   = new THREE.WebGLRenderTarget( scaledWidth, scaledHeight, rtParamsFloatLinear );\n\t\tvar rtFinal   = new THREE.WebGLRenderTarget( scaledWidth, scaledHeight, rtParamsUByte );\n\n\t\trtColor.generateMipmaps = false;\n\t\trtNormalDepth.generateMipmaps = false;\n\t\trtLight.generateMipmaps = false;\n\t\trtFinal.generateMipmaps = false;\n\n\t\t// normal + depth composer\n\n\t\tpassNormalDepth = new THREE.RenderPass();\n\t\tpassNormalDepth.clear = true;\n\n\t\tcompNormalDepth = new THREE.EffectComposer( _this.renderer, rtNormalDepth );\n\t\tcompNormalDepth.addPass( passNormalDepth );\n\n\t\t// color composer\n\n\t\tpassColor = new THREE.RenderPass();\n\t\tpassColor.clear = true;\n\n\t\tcompColor = new THREE.EffectComposer( _this.renderer, rtColor );\n\t\tcompColor.addPass( passColor );\n\n\t\tcompColor.renderTarget2.shareDepthFrom = compNormalDepth.renderTarget2;\n\n\t\t// light composer\n\n\t\tpassLightFullscreen = new THREE.RenderPass();\n\t\tpassLightFullscreen.clear = true;\n\n\t\tpassLightProxy = new THREE.RenderPass();\n\t\tpassLightProxy.clear = false;\n\n\t\tcompLight = new THREE.EffectComposer( _this.renderer, rtLight );\n\t\tcompLight.addPass( passLightFullscreen );\n\t\tcompLight.addPass( passLightProxy );\n\n\t\tcompLight.renderTarget2.shareDepthFrom = compNormalDepth.renderTarget2;\n\n\t\t// final composer\n\n\t\tcompositePass = new THREE.ShaderPass( compositeShader );\n\t\tcompositePass.uniforms[ 'samplerLight' ].value = compLight.renderTarget2;\n\t\tcompositePass.uniforms[ 'brightness' ].value = brightness;\n\t\tcompositePass.material.blending = THREE.NoBlending;\n\t\tcompositePass.clear = true;\n\n\t\tvar defines;\n\n\t\tswitch ( tonemapping ) {\n\n\t\t\tcase THREE.SimpleOperator:    defines = { \"TONEMAP_SIMPLE\": true };    break;\n\t\t\tcase THREE.LinearOperator:    defines = { \"TONEMAP_LINEAR\": true };    break;\n\t\t\tcase THREE.ReinhardOperator:  defines = { \"TONEMAP_REINHARD\": true };  break;\n\t\t\tcase THREE.FilmicOperator:    defines = { \"TONEMAP_FILMIC\": true };    break;\n\t\t\tcase THREE.UnchartedOperator: defines = { \"TONEMAP_UNCHARTED\": true }; break;\n\n\t\t}\n\n\t\tcompositePass.material.defines = defines;\n\n\t\t// FXAA\n\n\t\teffectFXAA = new THREE.ShaderPass( THREE.FXAAShader );\n\t\teffectFXAA.uniforms[ 'resolution' ].value.set( 1 / fullWidth, 1 / fullHeight );\n\t\teffectFXAA.renderToScreen = true;\n\n\t\t//\n\n\t\tcompFinal = new THREE.EffectComposer( _this.renderer, rtFinal );\n\t\tcompFinal.addPass( compositePass );\n\t\tcompFinal.addPass( effectFXAA );\n\n\t\tif ( antialias ) {\n\n\t\t\teffectFXAA.enabled = true;\n\t\t\tcompositePass.renderToScreen = false;\n\n\t\t} else {\n\n\t\t\teffectFXAA.enabled = false;\n\t\t\tcompositePass.renderToScreen = true;\n\n\t\t}\n\n\t};\n\n\t// init\n\n\tcreateRenderTargets();\n\n};\n\n// tonemapping operator types\n\nTHREE.NoOperator = 0;\nTHREE.SimpleOperator = 1;\nTHREE.LinearOperator = 2;\nTHREE.ReinhardOperator = 3;\nTHREE.FilmicOperator = 4;\nTHREE.UnchartedOperator = 5;\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Renderers/CSS2DRenderer.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Renderers/CSS2DRenderer.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.CSS2DObject = function ( element ) {\n\n\tTHREE.Object3D.call( this );\n\n\tthis.element = element;\n\tthis.element.style.position = 'absolute';\n\n\tthis.addEventListener( 'removed', function ( event ) {\n\n\t\tif ( this.element.parentNode !== null ) {\n\n\t\t\tthis.element.parentNode.removeChild( this.element );\n\n\t\t}\n\n\t} );\n\n};\n\nTHREE.CSS2DObject.prototype = Object.create( THREE.Object3D.prototype );\n\n//\n\nTHREE.CSS2DRenderer = function () {\n\n\tconsole.log( 'THREE.CSS2DRenderer', THREE.REVISION );\n\n\tvar _width, _height;\n\tvar _widthHalf, _heightHalf;\n\n\tvar vector = new THREE.Vector3();\n\tvar viewMatrix = new THREE.Matrix4();\n\tvar viewProjectionMatrix = new THREE.Matrix4();\n\n\tvar domElement = document.createElement( 'div' );\n\tdomElement.style.overflow = 'hidden';\n\n\tthis.domElement = domElement;\n\n\tthis.setSize = function ( width, height ) {\n\n\t\t_width = width;\n\t\t_height = height;\n\n\t\t_widthHalf = _width / 2;\n\t\t_heightHalf = _height / 2;\n\n\t\tdomElement.style.width = width + 'px';\n\t\tdomElement.style.height = height + 'px';\n\n\t};\n\n\tvar renderObject = function ( object, camera ) {\n\n\t\tif ( object instanceof THREE.CSS2DObject ) {\n\n\t\t\tvector.setFromMatrixPosition( object.matrixWorld );\n\t\t\tvector.applyProjection( viewProjectionMatrix );\n\n\t\t\tvar element = object.element;\n\t\t\tvar style = 'translate(-50%,-50%) translate(' + ( vector.x * _widthHalf + _widthHalf ) + 'px,' + ( - vector.y * _heightHalf + _heightHalf ) + 'px)';\n\n\t\t\telement.style.WebkitTransform = style;\n\t\t\telement.style.MozTransform = style;\n\t\t\telement.style.oTransform = style;\n\t\t\telement.style.transform = style;\n\n\t\t\tif ( element.parentNode !== domElement ) {\n\n\t\t\t\tdomElement.appendChild( element );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfor ( var i = 0, l = object.children.length; i < l; i ++ ) {\n\n\t\t\trenderObject( object.children[ i ], camera );\n\n\t\t}\n\n\t};\n\n\tthis.render = function ( scene, camera ) {\n\n\t\tscene.updateMatrixWorld();\n\n\t\tif ( camera.parent === undefined ) camera.updateMatrixWorld();\n\n\t\tcamera.matrixWorldInverse.getInverse( camera.matrixWorld );\n\n\t\tviewMatrix.copy( camera.matrixWorldInverse.getInverse( camera.matrixWorld ) );\n\t\tviewProjectionMatrix.multiplyMatrices( camera.projectionMatrix, viewMatrix );\n\n\t\trenderObject( scene, camera );\n\n\t};\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Renderers/SVGRenderer.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Renderers/SVGRenderer.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.SVGRenderer = function () {\n\n\tconsole.log( 'THREE.SVGRenderer', THREE.REVISION );\n\n\tvar _this = this,\n\t_renderData, _elements, _lights,\n\t_projector = new THREE.Projector(),\n\t_svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'),\n\t_svgWidth, _svgHeight, _svgWidthHalf, _svgHeightHalf,\n\n\t_v1, _v2, _v3, _v4,\n\n\t_clipBox = new THREE.Box2(),\n\t_elemBox = new THREE.Box2(),\n\n\t_color = new THREE.Color(),\n\t_diffuseColor = new THREE.Color(),\n\t_ambientLight = new THREE.Color(),\n\t_directionalLights = new THREE.Color(),\n\t_pointLights = new THREE.Color(),\n\t_clearColor = new THREE.Color(),\n\t_clearAlpha = 1,\n\n\t_w, // z-buffer to w-buffer\n\t_vector3 = new THREE.Vector3(), // Needed for PointLight\n\t_centroid = new THREE.Vector3(),\n\n\t_svgPathPool = [], _svgLinePool = [], _svgRectPool = [],\n\t_svgNode, _pathCount = 0, _lineCount = 0, _rectCount = 0,\n\t_quality = 1;\n\n\tthis.domElement = _svg;\n\n\tthis.autoClear = true;\n\tthis.sortObjects = true;\n\tthis.sortElements = true;\n\n\tthis.info = {\n\n\t\trender: {\n\n\t\t\tvertices: 0,\n\t\t\tfaces: 0\n\n\t\t}\n\n\t}\n\n\tthis.setQuality = function( quality ) {\n\n\t\tswitch(quality) {\n\n\t\t\tcase \"high\": _quality = 1; break;\n\t\t\tcase \"low\": _quality = 0; break;\n\n\t\t}\n\n\t};\n\n\t// WebGLRenderer compatibility\n\n\tthis.supportsVertexTextures = function () {};\n\tthis.setFaceCulling = function () {};\n\n\tthis.setClearColor = function ( color, alpha ) {\n\n\t\t_clearColor.set( color );\n\t\t_clearAlpha = alpha !== undefined ? alpha : 1;\n\n\t};\n\n\tthis.setSize = function( width, height ) {\n\n\t\t_svgWidth = width; _svgHeight = height;\n\t\t_svgWidthHalf = _svgWidth / 2; _svgHeightHalf = _svgHeight / 2;\n\n\t\t_svg.setAttribute( 'viewBox', ( - _svgWidthHalf ) + ' ' + ( - _svgHeightHalf ) + ' ' + _svgWidth + ' ' + _svgHeight );\n\t\t_svg.setAttribute( 'width', _svgWidth );\n\t\t_svg.setAttribute( 'height', _svgHeight );\n\n\t\t_clipBox.min.set( - _svgWidthHalf, - _svgHeightHalf );\n\t\t_clipBox.max.set( _svgWidthHalf, _svgHeightHalf );\n\n\t};\n\n\tthis.clear = function () {\n\n\t\t_pathCount = 0;\n\t\t_lineCount = 0;\n\t\t_rectCount = 0;\n\n\t\twhile ( _svg.childNodes.length > 0 ) {\n\n\t\t\t_svg.removeChild( _svg.childNodes[ 0 ] );\n\n\t\t}\n\t\t\n\t\t_svg.style.backgroundColor = 'rgba(' + ( ( _clearColor.r * 255 ) | 0 ) + ',' + ( ( _clearColor.g * 255 ) | 0 ) + ',' + ( ( _clearColor.b * 255 ) | 0 ) + ',' + _clearAlpha + ')';\n\n\t};\n\n\tthis.render = function ( scene, camera ) {\n\n\t\tif ( camera instanceof THREE.Camera === false ) {\n\n\t\t\tconsole.error( 'THREE.SVGRenderer.render: camera is not an instance of THREE.Camera.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( this.autoClear === true ) this.clear();\n\n\t\t_this.info.render.vertices = 0;\n\t\t_this.info.render.faces = 0;\n\n\t\t_renderData = _projector.projectScene( scene, camera, this.sortObjects, this.sortElements );\n\t\t_elements = _renderData.elements;\n\t\t_lights = _renderData.lights;\n\n\t\tcalculateLights( _lights );\n\n\t\tfor ( var e = 0, el = _elements.length; e < el; e ++ ) {\n\n\t\t\tvar element = _elements[ e ];\n\t\t\tvar material = element.material;\n\n\t\t\tif ( material === undefined || material.opacity === 0 ) continue;\n\n\t\t\t_elemBox.makeEmpty();\n\n\t\t\tif ( element instanceof THREE.RenderableSprite ) {\n\n\t\t\t\t_v1 = element;\n\t\t\t\t_v1.x *= _svgWidthHalf; _v1.y *= - _svgHeightHalf;\n\n\t\t\t\trenderSprite( _v1, element, material );\n\n\t\t\t} else if ( element instanceof THREE.RenderableLine ) {\n\n\t\t\t\t_v1 = element.v1; _v2 = element.v2;\n\n\t\t\t\t_v1.positionScreen.x *= _svgWidthHalf; _v1.positionScreen.y *= - _svgHeightHalf;\n\t\t\t\t_v2.positionScreen.x *= _svgWidthHalf; _v2.positionScreen.y *= - _svgHeightHalf;\n\n\t\t\t\t_elemBox.setFromPoints( [ _v1.positionScreen, _v2.positionScreen ] );\n\n\t\t\t\tif ( _clipBox.isIntersectionBox( _elemBox ) === true ) {\n\n\t\t\t\t\trenderLine( _v1, _v2, element, material );\n\n\t\t\t\t}\n\n\t\t\t} else if ( element instanceof THREE.RenderableFace ) {\n\n\t\t\t\t_v1 = element.v1; _v2 = element.v2; _v3 = element.v3;\n\n\t\t\t\tif ( _v1.positionScreen.z < -1 || _v1.positionScreen.z > 1 ) continue;\n\t\t\t\tif ( _v2.positionScreen.z < -1 || _v2.positionScreen.z > 1 ) continue;\n\t\t\t\tif ( _v3.positionScreen.z < -1 || _v3.positionScreen.z > 1 ) continue;\n\n\t\t\t\t_v1.positionScreen.x *= _svgWidthHalf; _v1.positionScreen.y *= - _svgHeightHalf;\n\t\t\t\t_v2.positionScreen.x *= _svgWidthHalf; _v2.positionScreen.y *= - _svgHeightHalf;\n\t\t\t\t_v3.positionScreen.x *= _svgWidthHalf; _v3.positionScreen.y *= - _svgHeightHalf;\n\n\t\t\t\t_elemBox.setFromPoints( [\n\t\t\t\t\t_v1.positionScreen,\n\t\t\t\t\t_v2.positionScreen,\n\t\t\t\t\t_v3.positionScreen\n\t\t\t\t] );\n\n\t\t\t\tif ( _clipBox.isIntersectionBox( _elemBox ) === true ) {\n\n\t\t\t\t\trenderFace3( _v1, _v2, _v3, element, material );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tfunction calculateLights( lights ) {\n\n\t\t_ambientLight.setRGB( 0, 0, 0 );\n\t\t_directionalLights.setRGB( 0, 0, 0 );\n\t\t_pointLights.setRGB( 0, 0, 0 );\n\n\t\tfor ( var l = 0, ll = lights.length; l < ll; l++ ) {\n\n\t\t\tvar light = lights[ l ];\n\t\t\tvar lightColor = light.color;\n\n\t\t\tif ( light instanceof THREE.AmbientLight ) {\n\n\t\t\t\t_ambientLight.r += lightColor.r;\n\t\t\t\t_ambientLight.g += lightColor.g;\n\t\t\t\t_ambientLight.b += lightColor.b;\n\n\t\t\t} else if ( light instanceof THREE.DirectionalLight ) {\n\n\t\t\t\t_directionalLights.r += lightColor.r;\n\t\t\t\t_directionalLights.g += lightColor.g;\n\t\t\t\t_directionalLights.b += lightColor.b;\n\n\t\t\t} else if ( light instanceof THREE.PointLight ) {\n\n\t\t\t\t_pointLights.r += lightColor.r;\n\t\t\t\t_pointLights.g += lightColor.g;\n\t\t\t\t_pointLights.b += lightColor.b;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction calculateLight( lights, position, normal, color ) {\n\n\t\tfor ( var l = 0, ll = lights.length; l < ll; l ++ ) {\n\n\t\t\tvar light = lights[ l ];\n\t\t\tvar lightColor = light.color;\n\n\t\t\tif ( light instanceof THREE.DirectionalLight ) {\n\n\t\t\t\tvar lightPosition = _vector3.setFromMatrixPosition( light.matrixWorld ).normalize();\n\n\t\t\t\tvar amount = normal.dot( lightPosition );\n\n\t\t\t\tif ( amount <= 0 ) continue;\n\n\t\t\t\tamount *= light.intensity;\n\n\t\t\t\tcolor.r += lightColor.r * amount;\n\t\t\t\tcolor.g += lightColor.g * amount;\n\t\t\t\tcolor.b += lightColor.b * amount;\n\n\t\t\t} else if ( light instanceof THREE.PointLight ) {\n\n\t\t\t\tvar lightPosition = _vector3.setFromMatrixPosition( light.matrixWorld );\n\n\t\t\t\tvar amount = normal.dot( _vector3.subVectors( lightPosition, position ).normalize() );\n\n\t\t\t\tif ( amount <= 0 ) continue;\n\n\t\t\t\tamount *= light.distance == 0 ? 1 : 1 - Math.min( position.distanceTo( lightPosition ) / light.distance, 1 );\n\n\t\t\t\tif ( amount == 0 ) continue;\n\n\t\t\t\tamount *= light.intensity;\n\n\t\t\t\tcolor.r += lightColor.r * amount;\n\t\t\t\tcolor.g += lightColor.g * amount;\n\t\t\t\tcolor.b += lightColor.b * amount;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction renderSprite( v1, element, material ) {\n\n\t\tvar scaleX = element.scale.x * _svgWidthHalf;\n\t\tvar scaleY = element.scale.y * _svgHeightHalf;\n\n\t\t_svgNode = getRectNode( _rectCount ++ );\n\n\t\t_svgNode.setAttribute( 'x', v1.x - ( scaleX * 0.5 ) );\n\t\t_svgNode.setAttribute( 'y', v1.y - ( scaleY * 0.5 ) );\n\t\t_svgNode.setAttribute( 'width', scaleX );\n\t\t_svgNode.setAttribute( 'height', scaleY );\n\n\t\tif ( material instanceof THREE.SpriteMaterial ) {\n\n\t\t\t_svgNode.setAttribute( 'style', 'fill: ' + material.color.getStyle() );\n\n\t\t}\n\n\t\t_svg.appendChild( _svgNode );\n\n\t}\n\n\tfunction renderLine( v1, v2, element, material ) {\n\n\t\t_svgNode = getLineNode( _lineCount ++ );\n\n\t\t_svgNode.setAttribute( 'x1', v1.positionScreen.x );\n\t\t_svgNode.setAttribute( 'y1', v1.positionScreen.y );\n\t\t_svgNode.setAttribute( 'x2', v2.positionScreen.x );\n\t\t_svgNode.setAttribute( 'y2', v2.positionScreen.y );\n\n\t\tif ( material instanceof THREE.LineBasicMaterial ) {\n\n\t\t\t_svgNode.setAttribute( 'style', 'fill: none; stroke: ' + material.color.getStyle() + '; stroke-width: ' + material.linewidth + '; stroke-opacity: ' + material.opacity + '; stroke-linecap: ' + material.linecap + '; stroke-linejoin: ' + material.linejoin );\n\n\t\t\t_svg.appendChild( _svgNode );\n\n\t\t}\n\n\t}\n\n\tfunction renderFace3( v1, v2, v3, element, material ) {\n\n\t\t_this.info.render.vertices += 3;\n\t\t_this.info.render.faces ++;\n\n\t\t_svgNode = getPathNode( _pathCount ++ );\n\t\t_svgNode.setAttribute( 'd', 'M ' + v1.positionScreen.x + ' ' + v1.positionScreen.y + ' L ' + v2.positionScreen.x + ' ' + v2.positionScreen.y + ' L ' + v3.positionScreen.x + ',' + v3.positionScreen.y + 'z' );\n\n\t\tif ( material instanceof THREE.MeshBasicMaterial ) {\n\n\t\t\t_color.copy( material.color );\n\n\t\t\tif ( material.vertexColors === THREE.FaceColors ) {\n\n\t\t\t\t_color.multiply( element.color );\n\n\t\t\t}\n\n\t\t} else if ( material instanceof THREE.MeshLambertMaterial || material instanceof THREE.MeshPhongMaterial ) {\n\n\t\t\t_diffuseColor.copy( material.color );\n\n\t\t\tif ( material.vertexColors === THREE.FaceColors ) {\n\n\t\t\t\t_diffuseColor.multiply( element.color );\n\n\t\t\t}\n\n\t\t\t_color.copy( _ambientLight );\n\n\t\t\t_centroid.copy( v1.positionWorld ).add( v2.positionWorld ).add( v3.positionWorld ).divideScalar( 3 );\n\n\t\t\tcalculateLight( _lights, _centroid, element.normalModel, _color );\n\n\t\t\t_color.multiply( _diffuseColor ).add( material.emissive );\n\n\t\t} else if ( material instanceof THREE.MeshDepthMaterial ) {\n\n\t\t\t_w = 1 - ( material.__2near / (material.__farPlusNear - element.z * material.__farMinusNear) );\n\t\t\t_color.setRGB( _w, _w, _w );\n\n\t\t} else if ( material instanceof THREE.MeshNormalMaterial ) {\n\n\t\t\tvar normal = element.normalModelView;\n\n\t\t\t_color.setRGB( normal.x, normal.y, normal.z ).multiplyScalar( 0.5 ).addScalar( 0.5 );\n\n\t\t}\n\n\t\tif ( material.wireframe ) {\n\n\t\t\t_svgNode.setAttribute( 'style', 'fill: none; stroke: ' + _color.getStyle() + '; stroke-width: ' + material.wireframeLinewidth + '; stroke-opacity: ' + material.opacity + '; stroke-linecap: ' + material.wireframeLinecap + '; stroke-linejoin: ' + material.wireframeLinejoin );\n\n\t\t} else {\n\n\t\t\t_svgNode.setAttribute( 'style', 'fill: ' + _color.getStyle() + '; fill-opacity: ' + material.opacity );\n\n\t\t}\n\n\t\t_svg.appendChild( _svgNode );\n\n\t}\n\n\tfunction getLineNode( id ) {\n\n\t\tif ( _svgLinePool[ id ] == null ) {\n\n\t\t\t_svgLinePool[ id ] = document.createElementNS( 'http://www.w3.org/2000/svg', 'line' );\n\n\t\t\tif ( _quality == 0 ) {\n\n\t\t\t\t_svgLinePool[ id ].setAttribute( 'shape-rendering', 'crispEdges' ); //optimizeSpeed\n\n\t\t\t}\n\n\t\t\treturn _svgLinePool[ id ];\n\n\t\t}\n\n\t\treturn _svgLinePool[ id ];\n\n\t}\n\n\tfunction getPathNode( id ) {\n\n\t\tif ( _svgPathPool[ id ] == null ) {\n\n\t\t\t_svgPathPool[ id ] = document.createElementNS( 'http://www.w3.org/2000/svg', 'path' );\n\n\t\t\tif ( _quality == 0 ) {\n\n\t\t\t\t_svgPathPool[ id ].setAttribute( 'shape-rendering', 'crispEdges' ); //optimizeSpeed\n\n\t\t\t}\n\n\t\t\treturn _svgPathPool[ id ];\n\n\t\t}\n\n\t\treturn _svgPathPool[ id ];\n\n\t}\n\n\tfunction getRectNode( id ) {\n\n\t\tif ( _svgRectPool[ id ] == null ) {\n\n\t\t\t_svgRectPool[ id ] = document.createElementNS( 'http://www.w3.org/2000/svg', 'rect' );\n\n\t\t\tif ( _quality == 0 ) {\n\n\t\t\t\t_svgRectPool[ id ].setAttribute( 'shape-rendering', 'crispEdges' ); //optimizeSpeed\n\n\t\t\t}\n\n\t\t\treturn _svgRectPool[ id ];\n\n\t\t}\n\n\t\treturn _svgRectPool[ id ];\n\n\t}\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Controls/DeviceOrientationControls.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Controls/DeviceOrientationControls.js",
            "module-type": "library",
            "text": "/**\n * @author richt / http://richt.me\n * @author WestLangley / http://github.com/WestLangley\n *\n * W3C Device Orientation control (http://w3c.github.io/deviceorientation/spec-source-orientation.html)\n */\n\nTHREE.DeviceOrientationControls = function ( object ) {\n\n\tvar scope = this;\n\n\tthis.object = object;\n\n\tthis.object.rotation.reorder( \"YXZ\" );\n\n\tthis.freeze = true;\n\n\tthis.deviceOrientation = {};\n\n\tthis.screenOrientation = 0;\n\n\tvar onDeviceOrientationChangeEvent = function ( event ) {\n\n\t\tscope.deviceOrientation = event;\n\n\t};\n\n\tvar onScreenOrientationChangeEvent = function () {\n\n\t\tscope.screenOrientation = window.orientation || 0;\n\n\t};\n\n\t// The angles alpha, beta and gamma form a set of intrinsic Tait-Bryan angles of type Z-X'-Y''\n\n\tvar setObjectQuaternion = function () {\n\n\t\tvar zee = new THREE.Vector3( 0, 0, 1 );\n\n\t\tvar euler = new THREE.Euler();\n\n\t\tvar q0 = new THREE.Quaternion();\n\n\t\tvar q1 = new THREE.Quaternion( - Math.sqrt( 0.5 ), 0, 0, Math.sqrt( 0.5 ) ); // - PI/2 around the x-axis\n\n\t\treturn function ( quaternion, alpha, beta, gamma, orient ) {\n\n\t\t\teuler.set( beta, alpha, - gamma, 'YXZ' );                       // 'ZXY' for the device, but 'YXZ' for us\n\n\t\t\tquaternion.setFromEuler( euler );                               // orient the device\n\n\t\t\tquaternion.multiply( q1 );                                      // camera looks out the back of the device, not the top\n\n\t\t\tquaternion.multiply( q0.setFromAxisAngle( zee, - orient ) );    // adjust for screen orientation\n\n\t\t}\n\n\t}();\n\n\tthis.connect = function() {\n\n\t\tonScreenOrientationChangeEvent(); // run once on load\n\n\t\twindow.addEventListener( 'orientationchange', onScreenOrientationChangeEvent, false );\n\t\twindow.addEventListener( 'deviceorientation', onDeviceOrientationChangeEvent, false );\n\n\t\tscope.freeze = false;\n\n\t};\n\n\tthis.disconnect = function() {\n\n\t\tscope.freeze = true;\n\n\t\twindow.removeEventListener( 'orientationchange', onScreenOrientationChangeEvent, false );\n\t\twindow.removeEventListener( 'deviceorientation', onDeviceOrientationChangeEvent, false );\n\n\t};\n\n\tthis.update = function () {\n\n\t\tif ( scope.freeze ) return;\n\n\t\tvar alpha  = scope.deviceOrientation.gamma ? THREE.Math.degToRad( scope.deviceOrientation.alpha ) : 0; // Z\n\t\tvar beta   = scope.deviceOrientation.beta  ? THREE.Math.degToRad( scope.deviceOrientation.beta  ) : 0; // X'\n\t\tvar gamma  = scope.deviceOrientation.gamma ? THREE.Math.degToRad( scope.deviceOrientation.gamma ) : 0; // Y''\n\t\tvar orient = scope.screenOrientation       ? THREE.Math.degToRad( scope.screenOrientation       ) : 0; // O\n\n\t\tsetObjectQuaternion( scope.object.quaternion, alpha, beta, gamma, orient );\n\n\t};\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Controls/EditorControls.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Controls/EditorControls.js",
            "module-type": "library",
            "text": "/**\n * @author qiao / https://github.com/qiao\n * @author mrdoob / http://mrdoob.com\n * @author alteredq / http://alteredqualia.com/\n * @author WestLangley / http://github.com/WestLangley\n */\n\nTHREE.EditorControls = function ( object, domElement ) {\n\n\tdomElement = ( domElement !== undefined ) ? domElement : document;\n\n\t// API\n\n\tthis.enabled = true;\n\tthis.center = new THREE.Vector3();\n\n\t// internals\n\n\tvar scope = this;\n\tvar vector = new THREE.Vector3();\n\n\tvar STATE = { NONE: -1, ROTATE: 0, ZOOM: 1, PAN: 2 };\n\tvar state = STATE.NONE;\n\n\tvar center = this.center;\n\tvar normalMatrix = new THREE.Matrix3();\n\tvar pointer = new THREE.Vector2();\n\tvar pointerOld = new THREE.Vector2();\n\n\t// events\n\n\tvar changeEvent = { type: 'change' };\n\n\tthis.focus = function ( target, frame ) {\n\n\t\tvar scale = new THREE.Vector3();\n\t\ttarget.matrixWorld.decompose( center, new THREE.Quaternion(), scale );\n\n\t\tif ( frame && target.geometry ) {\n\n\t\t\tscale = ( scale.x + scale.y + scale.z ) / 3;\n\t\t\tcenter.add(target.geometry.boundingSphere.center.clone().multiplyScalar( scale ));\n\t\t\tvar radius = target.geometry.boundingSphere.radius * ( scale );\n\t\t\tvar pos = object.position.clone().sub( center ).normalize().multiplyScalar( radius * 2 );\n\t\t\tobject.position.copy( center ).add( pos );\n\n\t\t}\n\n\t\tobject.lookAt( center );\n\n\t\tscope.dispatchEvent( changeEvent );\n\n\t};\n\n\tthis.pan = function ( distance ) {\n\n\t\tnormalMatrix.getNormalMatrix( object.matrix );\n\n\t\tdistance.applyMatrix3( normalMatrix );\n\t\tdistance.multiplyScalar( vector.copy( center ).sub( object.position ).length() * 0.001 );\n\n\t\tobject.position.add( distance );\n\t\tcenter.add( distance );\n\n\t\tscope.dispatchEvent( changeEvent );\n\n\t};\n\n\tthis.zoom = function ( distance ) {\n\n\t\tnormalMatrix.getNormalMatrix( object.matrix );\n\n\t\tdistance.applyMatrix3( normalMatrix );\n\t\tdistance.multiplyScalar( vector.copy( center ).sub( object.position ).length() * 0.001 );\n\n\t\tobject.position.add( distance );\n\n\t\tscope.dispatchEvent( changeEvent );\n\n\t};\n\n\tthis.rotate = function ( delta ) {\n\n\t\tvector.copy( object.position ).sub( center );\n\n\t\tvar theta = Math.atan2( vector.x, vector.z );\n\t\tvar phi = Math.atan2( Math.sqrt( vector.x * vector.x + vector.z * vector.z ), vector.y );\n\n\t\ttheta += delta.x;\n\t\tphi += delta.y;\n\n\t\tvar EPS = 0.000001;\n\n\t\tphi = Math.max( EPS, Math.min( Math.PI - EPS, phi ) );\n\n\t\tvar radius = vector.length();\n\n\t\tvector.x = radius * Math.sin( phi ) * Math.sin( theta );\n\t\tvector.y = radius * Math.cos( phi );\n\t\tvector.z = radius * Math.sin( phi ) * Math.cos( theta );\n\n\t\tobject.position.copy( center ).add( vector );\n\n\t\tobject.lookAt( center );\n\n\t\tscope.dispatchEvent( changeEvent );\n\n\t};\n\n\t// mouse\n\n\tfunction onMouseDown( event ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\n\t\tif ( event.button === 0 ) {\n\n\t\t\tstate = STATE.ROTATE;\n\n\t\t} else if ( event.button === 1 ) {\n\n\t\t\tstate = STATE.ZOOM;\n\n\t\t} else if ( event.button === 2 ) {\n\n\t\t\tstate = STATE.PAN;\n\n\t\t}\n\n\t\tpointerOld.set( event.clientX, event.clientY );\n\n\t\tdomElement.addEventListener( 'mousemove', onMouseMove, false );\n\t\tdomElement.addEventListener( 'mouseup', onMouseUp, false );\n\t\tdomElement.addEventListener( 'mouseout', onMouseUp, false );\n\t\tdomElement.addEventListener( 'dblclick', onMouseUp, false );\n\n\t}\n\n\tfunction onMouseMove( event ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\n\t\tpointer.set( event.clientX, event.clientY );\n\n\t\tvar movementX = pointer.x - pointerOld.x;\n\t\tvar movementY = pointer.y - pointerOld.y;\n\n\t\tif ( state === STATE.ROTATE ) {\n\n\t\t\tscope.rotate( new THREE.Vector3( - movementX * 0.005, - movementY * 0.005, 0 ) );\n\n\t\t} else if ( state === STATE.ZOOM ) {\n\n\t\t\tscope.zoom( new THREE.Vector3( 0, 0, movementY ) );\n\n\t\t} else if ( state === STATE.PAN ) {\n\n\t\t\tscope.pan( new THREE.Vector3( - movementX, movementY, 0 ) );\n\n\t\t}\n\n\t\tpointerOld.set( event.clientX, event.clientY );\n\n\t}\n\n\tfunction onMouseUp( event ) {\n\n\t\tdomElement.removeEventListener( 'mousemove', onMouseMove, false );\n\t\tdomElement.removeEventListener( 'mouseup', onMouseUp, false );\n\t\tdomElement.removeEventListener( 'mouseout', onMouseUp, false );\n\t\tdomElement.removeEventListener( 'dblclick', onMouseUp, false );\n\n\t\tstate = STATE.NONE;\n\n\t}\n\n\tfunction onMouseWheel( event ) {\n\n\t\t// if ( scope.enabled === false ) return;\n\n\t\tvar delta = 0;\n\n\t\tif ( event.wheelDelta ) { // WebKit / Opera / Explorer 9\n\n\t\t\tdelta = - event.wheelDelta;\n\n\t\t} else if ( event.detail ) { // Firefox\n\n\t\t\tdelta = event.detail * 10;\n\n\t\t}\n\n\t\tscope.zoom( new THREE.Vector3( 0, 0, delta ) );\n\n\t}\n\n\tdomElement.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false );\n\tdomElement.addEventListener( 'mousedown', onMouseDown, false );\n\tdomElement.addEventListener( 'mousewheel', onMouseWheel, false );\n\tdomElement.addEventListener( 'DOMMouseScroll', onMouseWheel, false ); // firefox\n\n\t// touch\n\n\tvar touch = new THREE.Vector3();\n\n\tvar touches = [ new THREE.Vector3(), new THREE.Vector3(), new THREE.Vector3() ];\n\tvar prevTouches = [ new THREE.Vector3(), new THREE.Vector3(), new THREE.Vector3() ];\n\n\tvar prevDistance = null;\n\n\tfunction touchStart( event ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tswitch ( event.touches.length ) {\n\n\t\t\tcase 1:\n\t\t\t\ttouches[ 0 ].set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY, 0 );\n\t\t\t\ttouches[ 1 ].set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY, 0 );\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\ttouches[ 0 ].set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY, 0 );\n\t\t\t\ttouches[ 1 ].set( event.touches[ 1 ].pageX, event.touches[ 1 ].pageY, 0 );\n\t\t\t\tprevDistance = touches[ 0 ].distanceTo( touches[ 1 ] );\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\tprevTouches[ 0 ].copy( touches[ 0 ] );\n\t\tprevTouches[ 1 ].copy( touches[ 1 ] );\n\n\t}\n\n\n\tfunction touchMove( event ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tvar getClosest = function( touch, touches ) {\n\n\t\t\tvar closest = touches[ 0 ];\n\n\t\t\tfor ( var i in touches ) {\n\t\t\t\tif ( closest.distanceTo(touch) > touches[ i ].distanceTo(touch) ) closest = touches[ i ];\n\t\t\t}\n\n\t\t\treturn closest;\n\n\t\t}\n\n\t\tswitch ( event.touches.length ) {\n\n\t\t\tcase 1:\n\t\t\t\ttouches[ 0 ].set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY, 0 );\n\t\t\t\ttouches[ 1 ].set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY, 0 );\n\t\t\t\tscope.rotate( touches[ 0 ].sub( getClosest( touches[ 0 ] ,prevTouches ) ).multiplyScalar( - 0.005 ) );\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\ttouches[ 0 ].set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY, 0 );\n\t\t\t\ttouches[ 1 ].set( event.touches[ 1 ].pageX, event.touches[ 1 ].pageY, 0 );\n\t\t\t\tdistance = touches[ 0 ].distanceTo( touches[ 1 ] );\n\t\t\t\tscope.zoom( new THREE.Vector3( 0, 0, prevDistance - distance ) );\n\t\t\t\tprevDistance = distance;\n\n\n\t\t\t\tvar offset0 = touches[ 0 ].clone().sub( getClosest( touches[ 0 ] ,prevTouches ) );\n\t\t\t\tvar offset1 = touches[ 1 ].clone().sub( getClosest( touches[ 1 ] ,prevTouches ) );\n\t\t\t\toffset0.x = -offset0.x;\n\t\t\t\toffset1.x = -offset1.x;\n\n\t\t\t\tscope.pan( offset0.add( offset1 ).multiplyScalar( 0.5 ) );\n\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\tprevTouches[ 0 ].copy( touches[ 0 ] );\n\t\tprevTouches[ 1 ].copy( touches[ 1 ] );\n\n\t}\n\n\tdomElement.addEventListener( 'touchstart', touchStart, false );\n\tdomElement.addEventListener( 'touchmove', touchMove, false );\n\n};\n\nTHREE.EditorControls.prototype = Object.create( THREE.EventDispatcher.prototype );\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Controls/FirstPersonControls.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Controls/FirstPersonControls.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n * @author alteredq / http://alteredqualia.com/\n * @author paulirish / http://paulirish.com/\n */\n\nTHREE.FirstPersonControls = function ( object, domElement ) {\n\n\tthis.object = object;\n\tthis.target = new THREE.Vector3( 0, 0, 0 );\n\n\tthis.domElement = ( domElement !== undefined ) ? domElement : document;\n\n\tthis.movementSpeed = 1.0;\n\tthis.lookSpeed = 0.005;\n\n\tthis.lookVertical = true;\n\tthis.autoForward = false;\n\t// this.invertVertical = false;\n\n\tthis.activeLook = true;\n\n\tthis.heightSpeed = false;\n\tthis.heightCoef = 1.0;\n\tthis.heightMin = 0.0;\n\tthis.heightMax = 1.0;\n\n\tthis.constrainVertical = false;\n\tthis.verticalMin = 0;\n\tthis.verticalMax = Math.PI;\n\n\tthis.autoSpeedFactor = 0.0;\n\n\tthis.mouseX = 0;\n\tthis.mouseY = 0;\n\n\tthis.lat = 0;\n\tthis.lon = 0;\n\tthis.phi = 0;\n\tthis.theta = 0;\n\n\tthis.moveForward = false;\n\tthis.moveBackward = false;\n\tthis.moveLeft = false;\n\tthis.moveRight = false;\n\tthis.freeze = false;\n\n\tthis.mouseDragOn = false;\n\n\tthis.viewHalfX = 0;\n\tthis.viewHalfY = 0;\n\n\tif ( this.domElement !== document ) {\n\n\t\tthis.domElement.setAttribute( 'tabindex', -1 );\n\n\t}\n\n\t//\n\n\tthis.handleResize = function () {\n\n\t\tif ( this.domElement === document ) {\n\n\t\t\tthis.viewHalfX = window.innerWidth / 2;\n\t\t\tthis.viewHalfY = window.innerHeight / 2;\n\n\t\t} else {\n\n\t\t\tthis.viewHalfX = this.domElement.offsetWidth / 2;\n\t\t\tthis.viewHalfY = this.domElement.offsetHeight / 2;\n\n\t\t}\n\n\t};\n\n\tthis.onMouseDown = function ( event ) {\n\n\t\tif ( this.domElement !== document ) {\n\n\t\t\tthis.domElement.focus();\n\n\t\t}\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tif ( this.activeLook ) {\n\n\t\t\tswitch ( event.button ) {\n\n\t\t\t\tcase 0: this.moveForward = true; break;\n\t\t\t\tcase 2: this.moveBackward = true; break;\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.mouseDragOn = true;\n\n\t};\n\n\tthis.onMouseUp = function ( event ) {\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tif ( this.activeLook ) {\n\n\t\t\tswitch ( event.button ) {\n\n\t\t\t\tcase 0: this.moveForward = false; break;\n\t\t\t\tcase 2: this.moveBackward = false; break;\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.mouseDragOn = false;\n\n\t};\n\n\tthis.onMouseMove = function ( event ) {\n\n\t\tif ( this.domElement === document ) {\n\n\t\t\tthis.mouseX = event.pageX - this.viewHalfX;\n\t\t\tthis.mouseY = event.pageY - this.viewHalfY;\n\n\t\t} else {\n\n\t\t\tthis.mouseX = event.pageX - this.domElement.offsetLeft - this.viewHalfX;\n\t\t\tthis.mouseY = event.pageY - this.domElement.offsetTop - this.viewHalfY;\n\n\t\t}\n\n\t};\n\n\tthis.onKeyDown = function ( event ) {\n\n\t\t//event.preventDefault();\n\n\t\tswitch ( event.keyCode ) {\n\n\t\t\tcase 38: /*up*/\n\t\t\tcase 87: /*W*/ this.moveForward = true; break;\n\n\t\t\tcase 37: /*left*/\n\t\t\tcase 65: /*A*/ this.moveLeft = true; break;\n\n\t\t\tcase 40: /*down*/\n\t\t\tcase 83: /*S*/ this.moveBackward = true; break;\n\n\t\t\tcase 39: /*right*/\n\t\t\tcase 68: /*D*/ this.moveRight = true; break;\n\n\t\t\tcase 82: /*R*/ this.moveUp = true; break;\n\t\t\tcase 70: /*F*/ this.moveDown = true; break;\n\n\t\t\tcase 81: /*Q*/ this.freeze = !this.freeze; break;\n\n\t\t}\n\n\t};\n\n\tthis.onKeyUp = function ( event ) {\n\n\t\tswitch( event.keyCode ) {\n\n\t\t\tcase 38: /*up*/\n\t\t\tcase 87: /*W*/ this.moveForward = false; break;\n\n\t\t\tcase 37: /*left*/\n\t\t\tcase 65: /*A*/ this.moveLeft = false; break;\n\n\t\t\tcase 40: /*down*/\n\t\t\tcase 83: /*S*/ this.moveBackward = false; break;\n\n\t\t\tcase 39: /*right*/\n\t\t\tcase 68: /*D*/ this.moveRight = false; break;\n\n\t\t\tcase 82: /*R*/ this.moveUp = false; break;\n\t\t\tcase 70: /*F*/ this.moveDown = false; break;\n\n\t\t}\n\n\t};\n\n\tthis.update = function( delta ) {\n\n\t\tif ( this.freeze ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( this.heightSpeed ) {\n\n\t\t\tvar y = THREE.Math.clamp( this.object.position.y, this.heightMin, this.heightMax );\n\t\t\tvar heightDelta = y - this.heightMin;\n\n\t\t\tthis.autoSpeedFactor = delta * ( heightDelta * this.heightCoef );\n\n\t\t} else {\n\n\t\t\tthis.autoSpeedFactor = 0.0;\n\n\t\t}\n\n\t\tvar actualMoveSpeed = delta * this.movementSpeed;\n\n\t\tif ( this.moveForward || ( this.autoForward && !this.moveBackward ) ) this.object.translateZ( - ( actualMoveSpeed + this.autoSpeedFactor ) );\n\t\tif ( this.moveBackward ) this.object.translateZ( actualMoveSpeed );\n\n\t\tif ( this.moveLeft ) this.object.translateX( - actualMoveSpeed );\n\t\tif ( this.moveRight ) this.object.translateX( actualMoveSpeed );\n\n\t\tif ( this.moveUp ) this.object.translateY( actualMoveSpeed );\n\t\tif ( this.moveDown ) this.object.translateY( - actualMoveSpeed );\n\n\t\tvar actualLookSpeed = delta * this.lookSpeed;\n\n\t\tif ( !this.activeLook ) {\n\n\t\t\tactualLookSpeed = 0;\n\n\t\t}\n\n\t\tvar verticalLookRatio = 1;\n\n\t\tif ( this.constrainVertical ) {\n\n\t\t\tverticalLookRatio = Math.PI / ( this.verticalMax - this.verticalMin );\n\n\t\t}\n\n\t\tthis.lon += this.mouseX * actualLookSpeed;\n\t\tif( this.lookVertical ) this.lat -= this.mouseY * actualLookSpeed * verticalLookRatio;\n\n\t\tthis.lat = Math.max( - 85, Math.min( 85, this.lat ) );\n\t\tthis.phi = THREE.Math.degToRad( 90 - this.lat );\n\n\t\tthis.theta = THREE.Math.degToRad( this.lon );\n\n\t\tif ( this.constrainVertical ) {\n\n\t\t\tthis.phi = THREE.Math.mapLinear( this.phi, 0, Math.PI, this.verticalMin, this.verticalMax );\n\n\t\t}\n\n\t\tvar targetPosition = this.target,\n\t\t\tposition = this.object.position;\n\n\t\ttargetPosition.x = position.x + 100 * Math.sin( this.phi ) * Math.cos( this.theta );\n\t\ttargetPosition.y = position.y + 100 * Math.cos( this.phi );\n\t\ttargetPosition.z = position.z + 100 * Math.sin( this.phi ) * Math.sin( this.theta );\n\n\t\tthis.object.lookAt( targetPosition );\n\n\t};\n\n\n\tthis.domElement.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false );\n\n\tthis.domElement.addEventListener( 'mousemove', bind( this, this.onMouseMove ), false );\n\tthis.domElement.addEventListener( 'mousedown', bind( this, this.onMouseDown ), false );\n\tthis.domElement.addEventListener( 'mouseup', bind( this, this.onMouseUp ), false );\n\t\n\twindow.addEventListener( 'keydown', bind( this, this.onKeyDown ), false );\n\twindow.addEventListener( 'keyup', bind( this, this.onKeyUp ), false );\n\n\tfunction bind( scope, fn ) {\n\n\t\treturn function () {\n\n\t\t\tfn.apply( scope, arguments );\n\n\t\t};\n\n\t};\n\n\tthis.handleResize();\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Controls/FlyControls.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Controls/FlyControls.js",
            "module-type": "library",
            "text": "/**\n * @author James Baicoianu / http://www.baicoianu.com/\n */\n\nTHREE.FlyControls = function ( object, domElement ) {\n\n\tthis.object = object;\n\n\tthis.domElement = ( domElement !== undefined ) ? domElement : document;\n\tif ( domElement ) this.domElement.setAttribute( 'tabindex', -1 );\n\n\t// API\n\n\tthis.movementSpeed = 1.0;\n\tthis.rollSpeed = 0.005;\n\n\tthis.dragToLook = false;\n\tthis.autoForward = false;\n\n\t// disable default target object behavior\n\n\t// internals\n\n\tthis.tmpQuaternion = new THREE.Quaternion();\n\n\tthis.mouseStatus = 0;\n\n\tthis.moveState = { up: 0, down: 0, left: 0, right: 0, forward: 0, back: 0, pitchUp: 0, pitchDown: 0, yawLeft: 0, yawRight: 0, rollLeft: 0, rollRight: 0 };\n\tthis.moveVector = new THREE.Vector3( 0, 0, 0 );\n\tthis.rotationVector = new THREE.Vector3( 0, 0, 0 );\n\n\tthis.handleEvent = function ( event ) {\n\n\t\tif ( typeof this[ event.type ] == 'function' ) {\n\n\t\t\tthis[ event.type ]( event );\n\n\t\t}\n\n\t};\n\n\tthis.keydown = function( event ) {\n\n\t\tif ( event.altKey ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\t//event.preventDefault();\n\n\t\tswitch ( event.keyCode ) {\n\n\t\t\tcase 16: /* shift */ this.movementSpeedMultiplier = .1; break;\n\n\t\t\tcase 87: /*W*/ this.moveState.forward = 1; break;\n\t\t\tcase 83: /*S*/ this.moveState.back = 1; break;\n\n\t\t\tcase 65: /*A*/ this.moveState.left = 1; break;\n\t\t\tcase 68: /*D*/ this.moveState.right = 1; break;\n\n\t\t\tcase 82: /*R*/ this.moveState.up = 1; break;\n\t\t\tcase 70: /*F*/ this.moveState.down = 1; break;\n\n\t\t\tcase 38: /*up*/ this.moveState.pitchUp = 1; break;\n\t\t\tcase 40: /*down*/ this.moveState.pitchDown = 1; break;\n\n\t\t\tcase 37: /*left*/ this.moveState.yawLeft = 1; break;\n\t\t\tcase 39: /*right*/ this.moveState.yawRight = 1; break;\n\n\t\t\tcase 81: /*Q*/ this.moveState.rollLeft = 1; break;\n\t\t\tcase 69: /*E*/ this.moveState.rollRight = 1; break;\n\n\t\t}\n\n\t\tthis.updateMovementVector();\n\t\tthis.updateRotationVector();\n\n\t};\n\n\tthis.keyup = function( event ) {\n\n\t\tswitch( event.keyCode ) {\n\n\t\t\tcase 16: /* shift */ this.movementSpeedMultiplier = 1; break;\n\n\t\t\tcase 87: /*W*/ this.moveState.forward = 0; break;\n\t\t\tcase 83: /*S*/ this.moveState.back = 0; break;\n\n\t\t\tcase 65: /*A*/ this.moveState.left = 0; break;\n\t\t\tcase 68: /*D*/ this.moveState.right = 0; break;\n\n\t\t\tcase 82: /*R*/ this.moveState.up = 0; break;\n\t\t\tcase 70: /*F*/ this.moveState.down = 0; break;\n\n\t\t\tcase 38: /*up*/ this.moveState.pitchUp = 0; break;\n\t\t\tcase 40: /*down*/ this.moveState.pitchDown = 0; break;\n\n\t\t\tcase 37: /*left*/ this.moveState.yawLeft = 0; break;\n\t\t\tcase 39: /*right*/ this.moveState.yawRight = 0; break;\n\n\t\t\tcase 81: /*Q*/ this.moveState.rollLeft = 0; break;\n\t\t\tcase 69: /*E*/ this.moveState.rollRight = 0; break;\n\n\t\t}\n\n\t\tthis.updateMovementVector();\n\t\tthis.updateRotationVector();\n\n\t};\n\n\tthis.mousedown = function( event ) {\n\n\t\tif ( this.domElement !== document ) {\n\n\t\t\tthis.domElement.focus();\n\n\t\t}\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tif ( this.dragToLook ) {\n\n\t\t\tthis.mouseStatus ++;\n\n\t\t} else {\n\n\t\t\tswitch ( event.button ) {\n\n\t\t\t\tcase 0: this.moveState.forward = 1; break;\n\t\t\t\tcase 2: this.moveState.back = 1; break;\n\n\t\t\t}\n\n\t\t\tthis.updateMovementVector();\n\n\t\t}\n\n\t};\n\n\tthis.mousemove = function( event ) {\n\n\t\tif ( !this.dragToLook || this.mouseStatus > 0 ) {\n\n\t\t\tvar container = this.getContainerDimensions();\n\t\t\tvar halfWidth  = container.size[ 0 ] / 2;\n\t\t\tvar halfHeight = container.size[ 1 ] / 2;\n\n\t\t\tthis.moveState.yawLeft   = - ( ( event.pageX - container.offset[ 0 ] ) - halfWidth  ) / halfWidth;\n\t\t\tthis.moveState.pitchDown =   ( ( event.pageY - container.offset[ 1 ] ) - halfHeight ) / halfHeight;\n\n\t\t\tthis.updateRotationVector();\n\n\t\t}\n\n\t};\n\n\tthis.mouseup = function( event ) {\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tif ( this.dragToLook ) {\n\n\t\t\tthis.mouseStatus --;\n\n\t\t\tthis.moveState.yawLeft = this.moveState.pitchDown = 0;\n\n\t\t} else {\n\n\t\t\tswitch ( event.button ) {\n\n\t\t\t\tcase 0: this.moveState.forward = 0; break;\n\t\t\t\tcase 2: this.moveState.back = 0; break;\n\n\t\t\t}\n\n\t\t\tthis.updateMovementVector();\n\n\t\t}\n\n\t\tthis.updateRotationVector();\n\n\t};\n\n\tthis.update = function( delta ) {\n\n\t\tvar moveMult = delta * this.movementSpeed;\n\t\tvar rotMult = delta * this.rollSpeed;\n\n\t\tthis.object.translateX( this.moveVector.x * moveMult );\n\t\tthis.object.translateY( this.moveVector.y * moveMult );\n\t\tthis.object.translateZ( this.moveVector.z * moveMult );\n\n\t\tthis.tmpQuaternion.set( this.rotationVector.x * rotMult, this.rotationVector.y * rotMult, this.rotationVector.z * rotMult, 1 ).normalize();\n\t\tthis.object.quaternion.multiply( this.tmpQuaternion );\n\n\t\t// expose the rotation vector for convenience\n\t\tthis.object.rotation.setFromQuaternion( this.object.quaternion, this.object.rotation.order );\n\n\n\t};\n\n\tthis.updateMovementVector = function() {\n\n\t\tvar forward = ( this.moveState.forward || ( this.autoForward && !this.moveState.back ) ) ? 1 : 0;\n\n\t\tthis.moveVector.x = ( -this.moveState.left    + this.moveState.right );\n\t\tthis.moveVector.y = ( -this.moveState.down    + this.moveState.up );\n\t\tthis.moveVector.z = ( -forward + this.moveState.back );\n\n\t\t//console.log( 'move:', [ this.moveVector.x, this.moveVector.y, this.moveVector.z ] );\n\n\t};\n\n\tthis.updateRotationVector = function() {\n\n\t\tthis.rotationVector.x = ( -this.moveState.pitchDown + this.moveState.pitchUp );\n\t\tthis.rotationVector.y = ( -this.moveState.yawRight  + this.moveState.yawLeft );\n\t\tthis.rotationVector.z = ( -this.moveState.rollRight + this.moveState.rollLeft );\n\n\t\t//console.log( 'rotate:', [ this.rotationVector.x, this.rotationVector.y, this.rotationVector.z ] );\n\n\t};\n\n\tthis.getContainerDimensions = function() {\n\n\t\tif ( this.domElement != document ) {\n\n\t\t\treturn {\n\t\t\t\tsize\t: [ this.domElement.offsetWidth, this.domElement.offsetHeight ],\n\t\t\t\toffset\t: [ this.domElement.offsetLeft,  this.domElement.offsetTop ]\n\t\t\t};\n\n\t\t} else {\n\n\t\t\treturn {\n\t\t\t\tsize\t: [ window.innerWidth, window.innerHeight ],\n\t\t\t\toffset\t: [ 0, 0 ]\n\t\t\t};\n\n\t\t}\n\n\t};\n\n\tfunction bind( scope, fn ) {\n\n\t\treturn function () {\n\n\t\t\tfn.apply( scope, arguments );\n\n\t\t};\n\n\t};\n\n\tthis.domElement.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false );\n\n\tthis.domElement.addEventListener( 'mousemove', bind( this, this.mousemove ), false );\n\tthis.domElement.addEventListener( 'mousedown', bind( this, this.mousedown ), false );\n\tthis.domElement.addEventListener( 'mouseup',   bind( this, this.mouseup ), false );\n\n\twindow.addEventListener( 'keydown', bind( this, this.keydown ), false );\n\twindow.addEventListener( 'keyup',   bind( this, this.keyup ), false );\n\n\tthis.updateMovementVector();\n\tthis.updateRotationVector();\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Controls/OculusControls.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Controls/OculusControls.js",
            "module-type": "library",
            "text": "/**\n * @author possan / http://possan.se/\n *\n * Oculus headtracking control\n * - use together with the oculus-rest project to get headtracking\n *   coordinates from the rift: http://github.com/possan/oculus-rest\n */\n\nTHREE.OculusControls = function ( object ) {\n\n\tthis.object = object;\n\tthis.target = new THREE.Vector3( 0, 0, 0 );\n\n\tthis.headquat = new THREE.Quaternion();\n\tthis.freeze = false;\n\n\tthis.loadAjaxJSON = function ( url, callback ) {\n\t\tvar xhr = new XMLHttpRequest();\n\t\txhr.onreadystatechange = function () {\n\t\t\tif ( xhr.readyState === xhr.DONE ) {\n\t\t\t\tif ( xhr.status === 200 || xhr.status === 0 ) {\n\t\t\t\t\tif ( xhr.responseText ) {\n\t\t\t\t\t\tvar json = JSON.parse( xhr.responseText );\n\t\t\t\t\t\tcallback( json );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\txhr.open( \"GET\", url, true );\n\t\txhr.withCredentials = false;\n\t\txhr.send( null );\n\t};\n\n\tthis.gotCoordinates = function( r ) {\n\t\tthis.headquat.set(r.quat.x, r.quat.y, r.quat.z, r.quat.w);\n\t\tthis.queuePoll();\n\t}\n\n\tthis.pollOnce = function() {\n\t\tthis.loadAjaxJSON('http://localhost:50000', bind(this, this.gotCoordinates));\n\t}\n\n\tthis.queuePoll = function() {\n\t\tsetTimeout(bind(this, this.pollOnce), 10);\n\t}\n\n\tthis.update = function( delta ) {\n\t\tif ( this.freeze ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.object.quaternion.multiply(this.headquat);\n\t};\n\n\tfunction bind( scope, fn ) {\n\t\treturn function () {\n\t\t\tfn.apply( scope, arguments );\n\t\t};\n\t};\n\n\tthis.connect = function() {\n\t\tthis.queuePoll();\n\t};\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Controls/OrbitControls.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Controls/OrbitControls.js",
            "module-type": "library",
            "text": "/**\n * @author qiao / https://github.com/qiao\n * @author mrdoob / http://mrdoob.com\n * @author alteredq / http://alteredqualia.com/\n * @author WestLangley / http://github.com/WestLangley\n * @author erich666 / http://erichaines.com\n */\n/*global THREE, console */\n\n// This set of controls performs orbiting, dollying (zooming), and panning. It maintains\n// the \"up\" direction as +Y, unlike the TrackballControls. Touch on tablet and phones is\n// supported.\n//\n//    Orbit - left mouse / touch: one finger move\n//    Zoom - middle mouse, or mousewheel / touch: two finger spread or squish\n//    Pan - right mouse, or arrow keys / touch: three finter swipe\n//\n// This is a drop-in replacement for (most) TrackballControls used in examples.\n// That is, include this js file and wherever you see:\n//    \tcontrols = new THREE.TrackballControls( camera );\n//      controls.target.z = 150;\n// Simple substitute \"OrbitControls\" and the control should work as-is.\n\nTHREE.OrbitControls = function ( object, domElement ) {\n\n\tthis.object = object;\n\tthis.domElement = ( domElement !== undefined ) ? domElement : document;\n\n\t// API\n\n\t// Set to false to disable this control\n\tthis.enabled = true;\n\n\t// \"target\" sets the location of focus, where the control orbits around\n\t// and where it pans with respect to.\n\tthis.target = new THREE.Vector3();\n\n\t// center is old, deprecated; use \"target\" instead\n\tthis.center = this.target;\n\n\t// This option actually enables dollying in and out; left as \"zoom\" for\n\t// backwards compatibility\n\tthis.noZoom = false;\n\tthis.zoomSpeed = 1.0;\n\n\t// Limits to how far you can dolly in and out\n\tthis.minDistance = 0;\n\tthis.maxDistance = Infinity;\n\n\t// Set to true to disable this control\n\tthis.noRotate = false;\n\tthis.rotateSpeed = 1.0;\n\n\t// Set to true to disable this control\n\tthis.noPan = false;\n\tthis.keyPanSpeed = 7.0;\t// pixels moved per arrow key push\n\n\t// Set to true to automatically rotate around the target\n\tthis.autoRotate = false;\n\tthis.autoRotateSpeed = 2.0; // 30 seconds per round when fps is 60\n\n\t// How far you can orbit vertically, upper and lower limits.\n\t// Range is 0 to Math.PI radians.\n\tthis.minPolarAngle = 0; // radians\n\tthis.maxPolarAngle = Math.PI; // radians\n\n\t// Set to true to disable use of the keys\n\tthis.noKeys = false;\n\n\t// The four arrow keys\n\tthis.keys = { LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40 };\n\n\t////////////\n\t// internals\n\n\tvar scope = this;\n\n\tvar EPS = 0.000001;\n\n\tvar rotateStart = new THREE.Vector2();\n\tvar rotateEnd = new THREE.Vector2();\n\tvar rotateDelta = new THREE.Vector2();\n\n\tvar panStart = new THREE.Vector2();\n\tvar panEnd = new THREE.Vector2();\n\tvar panDelta = new THREE.Vector2();\n\tvar panOffset = new THREE.Vector3();\n\n\tvar offset = new THREE.Vector3();\n\n\tvar dollyStart = new THREE.Vector2();\n\tvar dollyEnd = new THREE.Vector2();\n\tvar dollyDelta = new THREE.Vector2();\n\n\tvar phiDelta = 0;\n\tvar thetaDelta = 0;\n\tvar scale = 1;\n\tvar pan = new THREE.Vector3();\n\n\tvar lastPosition = new THREE.Vector3();\n\tvar lastQuaternion = new THREE.Quaternion();\n\n\tvar STATE = { NONE : -1, ROTATE : 0, DOLLY : 1, PAN : 2, TOUCH_ROTATE : 3, TOUCH_DOLLY : 4, TOUCH_PAN : 5 };\n\n\tvar state = STATE.NONE;\n\n\t// for reset\n\n\tthis.target0 = this.target.clone();\n\tthis.position0 = this.object.position.clone();\n\n\t// so camera.up is the orbit axis\n\n\tvar quat = new THREE.Quaternion().setFromUnitVectors( object.up, new THREE.Vector3( 0, 1, 0 ) );\n\tvar quatInverse = quat.clone().inverse();\n\n\t// events\n\n\tvar changeEvent = { type: 'change' };\n\tvar startEvent = { type: 'start'};\n\tvar endEvent = { type: 'end'};\n\n\tthis.rotateLeft = function ( angle ) {\n\n\t\tif ( angle === undefined ) {\n\n\t\t\tangle = getAutoRotationAngle();\n\n\t\t}\n\n\t\tthetaDelta -= angle;\n\n\t};\n\n\tthis.rotateUp = function ( angle ) {\n\n\t\tif ( angle === undefined ) {\n\n\t\t\tangle = getAutoRotationAngle();\n\n\t\t}\n\n\t\tphiDelta -= angle;\n\n\t};\n\n\t// pass in distance in world space to move left\n\tthis.panLeft = function ( distance ) {\n\n\t\tvar te = this.object.matrix.elements;\n\n\t\t// get X column of matrix\n\t\tpanOffset.set( te[ 0 ], te[ 1 ], te[ 2 ] );\n\t\tpanOffset.multiplyScalar( - distance );\n\t\t\n\t\tpan.add( panOffset );\n\n\t};\n\n\t// pass in distance in world space to move up\n\tthis.panUp = function ( distance ) {\n\n\t\tvar te = this.object.matrix.elements;\n\n\t\t// get Y column of matrix\n\t\tpanOffset.set( te[ 4 ], te[ 5 ], te[ 6 ] );\n\t\tpanOffset.multiplyScalar( distance );\n\t\t\n\t\tpan.add( panOffset );\n\n\t};\n\t\n\t// pass in x,y of change desired in pixel space,\n\t// right and down are positive\n\tthis.pan = function ( deltaX, deltaY ) {\n\n\t\tvar element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\n\t\tif ( scope.object.fov !== undefined ) {\n\n\t\t\t// perspective\n\t\t\tvar position = scope.object.position;\n\t\t\tvar offset = position.clone().sub( scope.target );\n\t\t\tvar targetDistance = offset.length();\n\n\t\t\t// half of the fov is center to top of screen\n\t\t\ttargetDistance *= Math.tan( ( scope.object.fov / 2 ) * Math.PI / 180.0 );\n\n\t\t\t// we actually don't use screenWidth, since perspective camera is fixed to screen height\n\t\t\tscope.panLeft( 2 * deltaX * targetDistance / element.clientHeight );\n\t\t\tscope.panUp( 2 * deltaY * targetDistance / element.clientHeight );\n\n\t\t} else if ( scope.object.top !== undefined ) {\n\n\t\t\t// orthographic\n\t\t\tscope.panLeft( deltaX * (scope.object.right - scope.object.left) / element.clientWidth );\n\t\t\tscope.panUp( deltaY * (scope.object.top - scope.object.bottom) / element.clientHeight );\n\n\t\t} else {\n\n\t\t\t// camera neither orthographic or perspective\n\t\t\tconsole.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.' );\n\n\t\t}\n\n\t};\n\n\tthis.dollyIn = function ( dollyScale ) {\n\n\t\tif ( dollyScale === undefined ) {\n\n\t\t\tdollyScale = getZoomScale();\n\n\t\t}\n\n\t\tscale /= dollyScale;\n\n\t};\n\n\tthis.dollyOut = function ( dollyScale ) {\n\n\t\tif ( dollyScale === undefined ) {\n\n\t\t\tdollyScale = getZoomScale();\n\n\t\t}\n\n\t\tscale *= dollyScale;\n\n\t};\n\n\tthis.update = function () {\n\n\t\tvar position = this.object.position;\n\n\t\toffset.copy( position ).sub( this.target );\n\n\t\t// rotate offset to \"y-axis-is-up\" space\n\t\toffset.applyQuaternion( quat );\n\n\t\t// angle from z-axis around y-axis\n\n\t\tvar theta = Math.atan2( offset.x, offset.z );\n\n\t\t// angle from y-axis\n\n\t\tvar phi = Math.atan2( Math.sqrt( offset.x * offset.x + offset.z * offset.z ), offset.y );\n\n\t\tif ( this.autoRotate ) {\n\n\t\t\tthis.rotateLeft( getAutoRotationAngle() );\n\n\t\t}\n\n\t\ttheta += thetaDelta;\n\t\tphi += phiDelta;\n\n\t\t// restrict phi to be between desired limits\n\t\tphi = Math.max( this.minPolarAngle, Math.min( this.maxPolarAngle, phi ) );\n\n\t\t// restrict phi to be betwee EPS and PI-EPS\n\t\tphi = Math.max( EPS, Math.min( Math.PI - EPS, phi ) );\n\n\t\tvar radius = offset.length() * scale;\n\n\t\t// restrict radius to be between desired limits\n\t\tradius = Math.max( this.minDistance, Math.min( this.maxDistance, radius ) );\n\t\t\n\t\t// move target to panned location\n\t\tthis.target.add( pan );\n\n\t\toffset.x = radius * Math.sin( phi ) * Math.sin( theta );\n\t\toffset.y = radius * Math.cos( phi );\n\t\toffset.z = radius * Math.sin( phi ) * Math.cos( theta );\n\n\t\t// rotate offset back to \"camera-up-vector-is-up\" space\n\t\toffset.applyQuaternion( quatInverse );\n\n\t\tposition.copy( this.target ).add( offset );\n\n\t\tthis.object.lookAt( this.target );\n\n\t\tthetaDelta = 0;\n\t\tphiDelta = 0;\n\t\tscale = 1;\n\t\tpan.set( 0, 0, 0 );\n\n\t\t// update condition is:\n\t\t// min(camera displacement, camera rotation in radians)^2 > EPS\n\t\t// using small-angle approximation cos(x/2) = 1 - x^2 / 8\n\n\t\tif ( lastPosition.distanceToSquared( this.object.position ) > EPS\n\t\t    || 8 * (1 - lastQuaternion.dot(this.object.quaternion)) > EPS ) {\n\n\t\t\tthis.dispatchEvent( changeEvent );\n\n\t\t\tlastPosition.copy( this.object.position );\n\t\t\tlastQuaternion.copy (this.object.quaternion );\n\n\t\t}\n\n\t};\n\n\n\tthis.reset = function () {\n\n\t\tstate = STATE.NONE;\n\n\t\tthis.target.copy( this.target0 );\n\t\tthis.object.position.copy( this.position0 );\n\n\t\tthis.update();\n\n\t};\n\n\tfunction getAutoRotationAngle() {\n\n\t\treturn 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed;\n\n\t}\n\n\tfunction getZoomScale() {\n\n\t\treturn Math.pow( 0.95, scope.zoomSpeed );\n\n\t}\n\n\tfunction onMouseDown( event ) {\n\n\t\tif ( scope.enabled === false ) return;\n\t\tevent.preventDefault();\n\n\t\tif ( event.button === 0 ) {\n\t\t\tif ( scope.noRotate === true ) return;\n\n\t\t\tstate = STATE.ROTATE;\n\n\t\t\trotateStart.set( event.clientX, event.clientY );\n\n\t\t} else if ( event.button === 1 ) {\n\t\t\tif ( scope.noZoom === true ) return;\n\n\t\t\tstate = STATE.DOLLY;\n\n\t\t\tdollyStart.set( event.clientX, event.clientY );\n\n\t\t} else if ( event.button === 2 ) {\n\t\t\tif ( scope.noPan === true ) return;\n\n\t\t\tstate = STATE.PAN;\n\n\t\t\tpanStart.set( event.clientX, event.clientY );\n\n\t\t}\n\n\t\tdocument.addEventListener( 'mousemove', onMouseMove, false );\n\t\tdocument.addEventListener( 'mouseup', onMouseUp, false );\n\t\tscope.dispatchEvent( startEvent );\n\n\t}\n\n\tfunction onMouseMove( event ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\n\t\tvar element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\n\t\tif ( state === STATE.ROTATE ) {\n\n\t\t\tif ( scope.noRotate === true ) return;\n\n\t\t\trotateEnd.set( event.clientX, event.clientY );\n\t\t\trotateDelta.subVectors( rotateEnd, rotateStart );\n\n\t\t\t// rotating across whole screen goes 360 degrees around\n\t\t\tscope.rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed );\n\n\t\t\t// rotating up and down along whole screen attempts to go 360, but limited to 180\n\t\t\tscope.rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed );\n\n\t\t\trotateStart.copy( rotateEnd );\n\n\t\t} else if ( state === STATE.DOLLY ) {\n\n\t\t\tif ( scope.noZoom === true ) return;\n\n\t\t\tdollyEnd.set( event.clientX, event.clientY );\n\t\t\tdollyDelta.subVectors( dollyEnd, dollyStart );\n\n\t\t\tif ( dollyDelta.y > 0 ) {\n\n\t\t\t\tscope.dollyIn();\n\n\t\t\t} else {\n\n\t\t\t\tscope.dollyOut();\n\n\t\t\t}\n\n\t\t\tdollyStart.copy( dollyEnd );\n\n\t\t} else if ( state === STATE.PAN ) {\n\n\t\t\tif ( scope.noPan === true ) return;\n\n\t\t\tpanEnd.set( event.clientX, event.clientY );\n\t\t\tpanDelta.subVectors( panEnd, panStart );\n\t\t\t\n\t\t\tscope.pan( panDelta.x, panDelta.y );\n\n\t\t\tpanStart.copy( panEnd );\n\n\t\t}\n\n\t\tscope.update();\n\n\t}\n\n\tfunction onMouseUp( /* event */ ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tdocument.removeEventListener( 'mousemove', onMouseMove, false );\n\t\tdocument.removeEventListener( 'mouseup', onMouseUp, false );\n\t\tscope.dispatchEvent( endEvent );\n\t\tstate = STATE.NONE;\n\n\t}\n\n\tfunction onMouseWheel( event ) {\n\n\t\tif ( scope.enabled === false || scope.noZoom === true ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tvar delta = 0;\n\n\t\tif ( event.wheelDelta !== undefined ) { // WebKit / Opera / Explorer 9\n\n\t\t\tdelta = event.wheelDelta;\n\n\t\t} else if ( event.detail !== undefined ) { // Firefox\n\n\t\t\tdelta = - event.detail;\n\n\t\t}\n\n\t\tif ( delta > 0 ) {\n\n\t\t\tscope.dollyOut();\n\n\t\t} else {\n\n\t\t\tscope.dollyIn();\n\n\t\t}\n\n\t\tscope.update();\n\t\tscope.dispatchEvent( startEvent );\n\t\tscope.dispatchEvent( endEvent );\n\n\t}\n\n\tfunction onKeyDown( event ) {\n\n\t\tif ( scope.enabled === false || scope.noKeys === true || scope.noPan === true ) return;\n\t\t\n\t\tswitch ( event.keyCode ) {\n\n\t\t\tcase scope.keys.UP:\n\t\t\t\tscope.pan( 0, scope.keyPanSpeed );\n\t\t\t\tscope.update();\n\t\t\t\tbreak;\n\n\t\t\tcase scope.keys.BOTTOM:\n\t\t\t\tscope.pan( 0, - scope.keyPanSpeed );\n\t\t\t\tscope.update();\n\t\t\t\tbreak;\n\n\t\t\tcase scope.keys.LEFT:\n\t\t\t\tscope.pan( scope.keyPanSpeed, 0 );\n\t\t\t\tscope.update();\n\t\t\t\tbreak;\n\n\t\t\tcase scope.keys.RIGHT:\n\t\t\t\tscope.pan( - scope.keyPanSpeed, 0 );\n\t\t\t\tscope.update();\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}\n\n\tfunction touchstart( event ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tswitch ( event.touches.length ) {\n\n\t\t\tcase 1:\t// one-fingered touch: rotate\n\n\t\t\t\tif ( scope.noRotate === true ) return;\n\n\t\t\t\tstate = STATE.TOUCH_ROTATE;\n\n\t\t\t\trotateStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\t// two-fingered touch: dolly\n\n\t\t\t\tif ( scope.noZoom === true ) return;\n\n\t\t\t\tstate = STATE.TOUCH_DOLLY;\n\n\t\t\t\tvar dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;\n\t\t\t\tvar dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;\n\t\t\t\tvar distance = Math.sqrt( dx * dx + dy * dy );\n\t\t\t\tdollyStart.set( 0, distance );\n\t\t\t\tbreak;\n\n\t\t\tcase 3: // three-fingered touch: pan\n\n\t\t\t\tif ( scope.noPan === true ) return;\n\n\t\t\t\tstate = STATE.TOUCH_PAN;\n\n\t\t\t\tpanStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tstate = STATE.NONE;\n\n\t\t}\n\n\t\tscope.dispatchEvent( startEvent );\n\n\t}\n\n\tfunction touchmove( event ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tvar element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\n\t\tswitch ( event.touches.length ) {\n\n\t\t\tcase 1: // one-fingered touch: rotate\n\n\t\t\t\tif ( scope.noRotate === true ) return;\n\t\t\t\tif ( state !== STATE.TOUCH_ROTATE ) return;\n\n\t\t\t\trotateEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\trotateDelta.subVectors( rotateEnd, rotateStart );\n\n\t\t\t\t// rotating across whole screen goes 360 degrees around\n\t\t\t\tscope.rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed );\n\t\t\t\t// rotating up and down along whole screen attempts to go 360, but limited to 180\n\t\t\t\tscope.rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed );\n\n\t\t\t\trotateStart.copy( rotateEnd );\n\n\t\t\t\tscope.update();\n\t\t\t\tbreak;\n\n\t\t\tcase 2: // two-fingered touch: dolly\n\n\t\t\t\tif ( scope.noZoom === true ) return;\n\t\t\t\tif ( state !== STATE.TOUCH_DOLLY ) return;\n\n\t\t\t\tvar dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;\n\t\t\t\tvar dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;\n\t\t\t\tvar distance = Math.sqrt( dx * dx + dy * dy );\n\n\t\t\t\tdollyEnd.set( 0, distance );\n\t\t\t\tdollyDelta.subVectors( dollyEnd, dollyStart );\n\n\t\t\t\tif ( dollyDelta.y > 0 ) {\n\n\t\t\t\t\tscope.dollyOut();\n\n\t\t\t\t} else {\n\n\t\t\t\t\tscope.dollyIn();\n\n\t\t\t\t}\n\n\t\t\t\tdollyStart.copy( dollyEnd );\n\n\t\t\t\tscope.update();\n\t\t\t\tbreak;\n\n\t\t\tcase 3: // three-fingered touch: pan\n\n\t\t\t\tif ( scope.noPan === true ) return;\n\t\t\t\tif ( state !== STATE.TOUCH_PAN ) return;\n\n\t\t\t\tpanEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\tpanDelta.subVectors( panEnd, panStart );\n\t\t\t\t\n\t\t\t\tscope.pan( panDelta.x, panDelta.y );\n\n\t\t\t\tpanStart.copy( panEnd );\n\n\t\t\t\tscope.update();\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tstate = STATE.NONE;\n\n\t\t}\n\n\t}\n\n\tfunction touchend( /* event */ ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tscope.dispatchEvent( endEvent );\n\t\tstate = STATE.NONE;\n\n\t}\n\n\tthis.domElement.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false );\n\tthis.domElement.addEventListener( 'mousedown', onMouseDown, false );\n\tthis.domElement.addEventListener( 'mousewheel', onMouseWheel, false );\n\tthis.domElement.addEventListener( 'DOMMouseScroll', onMouseWheel, false ); // firefox\n\n\tthis.domElement.addEventListener( 'touchstart', touchstart, false );\n\tthis.domElement.addEventListener( 'touchend', touchend, false );\n\tthis.domElement.addEventListener( 'touchmove', touchmove, false );\n\n\twindow.addEventListener( 'keydown', onKeyDown, false );\n\n\t// force an update at start\n\tthis.update();\n\n};\n\nTHREE.OrbitControls.prototype = Object.create( THREE.EventDispatcher.prototype );\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Controls/OrbitZControls.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Controls/OrbitZControls.js",
            "module-type": "library",
            "text": "/**\n * @author qiao / https://github.com/qiao\n * @author mrdoob / http://mrdoob.com\n * @author alteredq / http://alteredqualia.com/\n * @author WestLangley / http://github.com/WestLangley\n * @author erich666 / http://erichaines.com\n *\n * cook for adaptation to Z up (initially Y up).\n */\n/*global THREE, console */\n\n// This set of controls performs orbiting, dollying (zooming), and panning. It maintains\n// the \"up\" direction as +Z. Touch on tablet and phones is supported (but not tested, sorry).\n//\n//    Orbit - left mouse / touch: one finger move\n//    Zoom - middle mouse, or mousewheel / touch: two finger spread or squish\n//    Pan - right mouse, or arrow keys / touch: three finter swipe\n\nTHREE.OrbitZControls = function ( object, domElement ) {\n  var func = \"THREE.OrbitZControls\";\n  flagLog = false;\n  logPoint = function(p) {return \"\"+p.x+\", \"+p.y+\", \"+p.z;};\n\n\tthis.object = object;\n\tthis.domElement = ( domElement !== undefined ) ? domElement : document;\n\n  if (flagLog) console.log(func+\": object.position = \"+logPoint(this.object.position));\n  if (flagLog) console.log(func+\": object.up = \"+logPoint(this.object.up));\n\n\t// API\n\n\t// Set to false to disable this control\n\tthis.enabled = true;\n\n\t// \"target\" sets the location of focus, where the control orbits around\n\t// and where it pans with respect to.\n\tthis.target = new THREE.Vector3();\n\n\t// center is old, deprecated; use \"target\" instead\n\tthis.center = this.target;\n\n\t// This option actually enables dollying in and out; left as \"zoom\" for\n\t// backwards compatibility\n\tthis.noZoom = false;\n\tthis.zoomSpeed = 1.0;\n\n\t// Limits to how far you can dolly in and out\n\tthis.minDistance = 0;\n\tthis.maxDistance = Infinity;\n\n\t// Set to true to disable this control\n\tthis.noRotate = false;\n\tthis.rotateSpeed = 1.0;\n\n\t// Set to true to disable this control\n\tthis.noPan = false;\n\tthis.keyPanSpeed = 7.0;\t// pixels moved per arrow key push\n\n\t// Set to true to automatically rotate around the target\n\tthis.autoRotate = false;\n\tthis.autoRotateSpeed = 2.0; // 30 seconds per round when fps is 60\n\n\t// How far you can orbit vertically, upper and lower limits.\n\t// Range is 0 to Math.PI radians.\n\tthis.minPolarAngle = 0; // radians\n\tthis.maxPolarAngle = Math.PI; // radians\n\n\t// Set to true to disable use of the keys\n\tthis.noKeys = false;\n\n\t// The four arrow keys\n\tthis.keys = { LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40 };\n\n\t////////////\n\t// internals\n\n\tvar scope = this;\n\n\tvar EPS = 0.000001;\n\n\tvar rotateStart = new THREE.Vector2();\n\tvar rotateEnd = new THREE.Vector2();\n\tvar rotateDelta = new THREE.Vector2();\n\n\tvar panStart = new THREE.Vector2();\n\tvar panEnd = new THREE.Vector2();\n\tvar panDelta = new THREE.Vector2();\n\tvar panOffset = new THREE.Vector3();\n\n\tvar offset = new THREE.Vector3();\n\n\tvar dollyStart = new THREE.Vector2();\n\tvar dollyEnd = new THREE.Vector2();\n\tvar dollyDelta = new THREE.Vector2();\n\n\tvar phiDelta = 0;\n\tvar thetaDelta = 0;\n\tvar scale = 1;\n\tvar pan = new THREE.Vector3();\n\n\tvar lastPosition = new THREE.Vector3();\n\tvar lastQuaternion = new THREE.Quaternion();\n\n\tvar STATE = { NONE : -1, ROTATE : 0, DOLLY : 1, PAN : 2, TOUCH_ROTATE : 3, TOUCH_DOLLY : 4, TOUCH_PAN : 5 };\n\n\tvar state = STATE.NONE;\n\n\t// for reset\n\n\tthis.target0 = this.target.clone();\n\tthis.position0 = this.object.position.clone();\n\n\t// so camera.up is the orbit axis\n\n\tvar quat = new THREE.Quaternion().setFromUnitVectors( object.up, new THREE.Vector3( 0, 0, 1 ) );\n\tvar quatInverse = quat.clone().inverse();\n\n\t// events\n\n\tvar changeEvent = { type: 'change' };\n\tvar startEvent = { type: 'start'};\n\tvar endEvent = { type: 'end'};\n\n\tthis.rotateLeft = function ( angle ) {\n\n\t\tif ( angle === undefined ) {\n\n\t\t\tangle = getAutoRotationAngle();\n\n\t\t}\n\n\t\tthetaDelta -= angle;\n\n\t};\n\n\tthis.rotateUp = function ( angle ) {\n\n\t\tif ( angle === undefined ) {\n\n\t\t\tangle = getAutoRotationAngle();\n\n\t\t}\n\n\t\tphiDelta -= angle;\n\n\t};\n\n\t// pass in distance in world space to move left\n\tthis.panLeft = function ( distance ) {\n\n\t\tvar te = this.object.matrix.elements;\n\n\t\t// get X column of matrix\n\t\tpanOffset.set( te[ 0 ], te[ 1 ], te[ 2 ] );\n\t\tpanOffset.multiplyScalar( - distance );\n\t\t\n\t\tpan.add( panOffset );\n\n\t};\n\n\t// pass in distance in world space to move up\n\tthis.panUp = function ( distance ) {\n\n\t\tvar te = this.object.matrix.elements;\n\n\t\t// get Z column of matrix\n\t\tpanOffset.set( te[ 4 ], te[ 5 ], te[ 6 ] );\n\t\tpanOffset.multiplyScalar( distance );\n\t\t\n\t\tpan.add( panOffset );\n\n\t};\n\t\n\t// pass in x,y of change desired in pixel space,\n\t// right and down are positive\n\tthis.pan = function ( deltaX, deltaY ) {\n\n\t\tvar element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\n\t\tif ( scope.object.fov !== undefined ) {\n\n\t\t\t// perspective\n\t\t\tvar position = scope.object.position;\n\t\t\tvar offset = position.clone().sub( scope.target );\n\t\t\tvar targetDistance = offset.length();\n\n\t\t\t// half of the fov is center to top of screen\n\t\t\ttargetDistance *= Math.tan( ( scope.object.fov / 2 ) * Math.PI / 180.0 );\n\n\t\t\t// we actually don't use screenWidth, since perspective camera is fixed to screen height\n\t\t\tscope.panLeft( 2 * deltaX * targetDistance / element.clientHeight );\n\t\t\tscope.panUp( 2 * deltaY * targetDistance / element.clientHeight );\n\n\t\t} else if ( scope.object.top !== undefined ) {\n\n\t\t\t// orthographic\n\t\t\tscope.panLeft( deltaX * (scope.object.right - scope.object.left) / element.clientWidth );\n\t\t\tscope.panUp( deltaY * (scope.object.top - scope.object.bottom) / element.clientHeight );\n\n\t\t} else {\n\n\t\t\t// camera neither orthographic or perspective\n\t\t\tconsole.warn( 'WARNING: OrbitZControls.js encountered an unknown camera type - pan disabled.' );\n\n\t\t}\n\n\t};\n\n\tthis.dollyIn = function ( dollyScale ) {\n\n\t\tif ( dollyScale === undefined ) {\n\n\t\t\tdollyScale = getZoomScale();\n\n\t\t}\n\n\t\tscale /= dollyScale;\n\n\t};\n\n\tthis.dollyOut = function ( dollyScale ) {\n\n\t\tif ( dollyScale === undefined ) {\n\n\t\t\tdollyScale = getZoomScale();\n\n\t\t}\n\n\t\tscale *= dollyScale;\n\n\t};\n\n\tthis.update = function () {\n          var func = \"THREE.OrbitZControls.update\";\n\n          if (flagLog) console.log(func+\": ====================\");\n          if (flagLog) console.log(func+\": this.target = \"+logPoint(this.target));\n\n\t\tvar position = this.object.position;\n\n\t\toffset.copy( position ).sub( this.target );\n\n\t\t// rotate offset to \"z-axis-is-up\" space\n\t\toffset.applyQuaternion( quat );\n\n          if (flagLog) console.log(func+\": offset = \"+logPoint(offset));\n\n\t\t// angle from x-axis around z-axis\n\n\t\tvar theta = Math.atan2( offset.y, offset.x );\n\n\t\t// angle from z-axis\n\n\t\tvar phi = Math.atan2( Math.sqrt( offset.x * offset.x + offset.y * offset.y ), offset.z );\n\n          if (flagLog) console.log(func+\": theta = \"+(theta * 180 / Math.PI)+\" degrés, phi = \"+(phi * 180 / Math.PI)+\" degrés\");\n\n\t\tif ( this.autoRotate ) {\n\n\t\t\tthis.rotateLeft( getAutoRotationAngle() );\n\n\t\t}\n\n\t\ttheta += thetaDelta;\n\t\tphi += phiDelta;\n\n\t\t// restrict phi to be between desired limits\n\t\tphi = Math.max( this.minPolarAngle, Math.min( this.maxPolarAngle, phi ) );\n\n\t\t// restrict phi to be betwee EPS and PI-EPS\n\t\tphi = Math.max( EPS, Math.min( Math.PI - EPS, phi ) );\n\n\t\tvar radius = offset.length() * scale;\n\n\t\t// restrict radius to be between desired limits\n\t\tradius = Math.max( this.minDistance, Math.min( this.maxDistance, radius ) );\n\t\t\n\t\t// move target to panned location\n\t\tthis.target.add( pan );\n\n\t\toffset.x = radius * Math.sin( phi ) * Math.cos( theta );\n\t\toffset.z = radius * Math.cos( phi );\n\t\toffset.y = radius * Math.sin( phi ) * Math.sin( theta );\n\n\t\t// rotate offset back to \"camera-up-vector-is-up\" space\n\t\toffset.applyQuaternion( quatInverse );\n\n\t\tposition.copy( this.target ).add( offset );\n\n\t\tthis.object.lookAt( this.target );\n\n\t\tthetaDelta = 0;\n\t\tphiDelta = 0;\n\t\tscale = 1;\n\t\tpan.set( 0, 0, 0 );\n\n\t\t// update condition is:\n\t\t// min(camera displacement, camera rotation in radians)^2 > EPS\n\t\t// using small-angle approximation cos(x/2) = 1 - x^2 / 8\n\n\t\tif ( lastPosition.distanceToSquared( this.object.position ) > EPS\n\t\t    || 8 * (1 - lastQuaternion.dot(this.object.quaternion)) > EPS ) {\n\n\t\t\tthis.dispatchEvent( changeEvent );\n\n\t\t\tlastPosition.copy( this.object.position );\n\t\t\tlastQuaternion.copy (this.object.quaternion );\n\n\t\t}\n\n\t};\n\n\n\tthis.reset = function () {\n\n\t\tstate = STATE.NONE;\n\n\t\tthis.target.copy( this.target0 );\n\t\tthis.object.position.copy( this.position0 );\n\n\t\tthis.update();\n\n\t};\n\n\tfunction getAutoRotationAngle() {\n\n\t\treturn 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed;\n\n\t}\n\n\tfunction getZoomScale() {\n\n\t\treturn Math.pow( 0.95, scope.zoomSpeed );\n\n\t}\n\n\tfunction onMouseDown( event ) {\n\n\t\tif ( scope.enabled === false ) return;\n\t\tevent.preventDefault();\n\n\t\tif ( event.button === 0 ) {\n\t\t\tif ( scope.noRotate === true ) return;\n\n\t\t\tstate = STATE.ROTATE;\n\n\t\t\trotateStart.set( event.clientX, event.clientY );\n\n\t\t} else if ( event.button === 1 ) {\n\t\t\tif ( scope.noZoom === true ) return;\n\n\t\t\tstate = STATE.DOLLY;\n\n\t\t\tdollyStart.set( event.clientX, event.clientY );\n\n\t\t} else if ( event.button === 2 ) {\n\t\t\tif ( scope.noPan === true ) return;\n\n\t\t\tstate = STATE.PAN;\n\n\t\t\tpanStart.set( event.clientX, event.clientY );\n\n\t\t}\n\n\t\tdocument.addEventListener( 'mousemove', onMouseMove, false );\n\t\tdocument.addEventListener( 'mouseup', onMouseUp, false );\n\t\tscope.dispatchEvent( startEvent );\n\n\t}\n\n\tfunction onMouseMove( event ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\n\t\tvar element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\n\t\tif ( state === STATE.ROTATE ) {\n\n\t\t\tif ( scope.noRotate === true ) return;\n\n\t\t\trotateEnd.set( event.clientX, event.clientY );\n\t\t\trotateDelta.subVectors( rotateEnd, rotateStart );\n\n\t\t\t// rotating across whole screen goes 360 degrees around\n\t\t\tscope.rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed );\n\n\t\t\t// rotating up and down along whole screen attempts to go 360, but limited to 180\n\t\t\tscope.rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed );\n\n\t\t\trotateStart.copy( rotateEnd );\n\n\t\t} else if ( state === STATE.DOLLY ) {\n\n\t\t\tif ( scope.noZoom === true ) return;\n\n\t\t\tdollyEnd.set( event.clientX, event.clientY );\n\t\t\tdollyDelta.subVectors( dollyEnd, dollyStart );\n\n\t\t\tif ( dollyDelta.y > 0 ) {\n\n\t\t\t\tscope.dollyIn();\n\n\t\t\t} else {\n\n\t\t\t\tscope.dollyOut();\n\n\t\t\t}\n\n\t\t\tdollyStart.copy( dollyEnd );\n\n\t\t} else if ( state === STATE.PAN ) {\n\n\t\t\tif ( scope.noPan === true ) return;\n\n\t\t\tpanEnd.set( event.clientX, event.clientY );\n\t\t\tpanDelta.subVectors( panEnd, panStart );\n\t\t\t\n\t\t\tscope.pan( panDelta.x, panDelta.y );\n\n\t\t\tpanStart.copy( panEnd );\n\n\t\t}\n\n\t\tscope.update();\n\n\t}\n\n\tfunction onMouseUp( /* event */ ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tdocument.removeEventListener( 'mousemove', onMouseMove, false );\n\t\tdocument.removeEventListener( 'mouseup', onMouseUp, false );\n\t\tscope.dispatchEvent( endEvent );\n\t\tstate = STATE.NONE;\n\n\t}\n\n\tfunction onMouseWheel( event ) {\n\n\t\tif ( scope.enabled === false || scope.noZoom === true ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tvar delta = 0;\n\n\t\tif ( event.wheelDelta !== undefined ) { // WebKit / Opera / Explorer 9\n\n\t\t\tdelta = event.wheelDelta;\n\n\t\t} else if ( event.detail !== undefined ) { // Firefox\n\n\t\t\tdelta = - event.detail;\n\n\t\t}\n\n\t\tif ( delta > 0 ) {\n\n\t\t\tscope.dollyOut();\n\n\t\t} else {\n\n\t\t\tscope.dollyIn();\n\n\t\t}\n\n\t\tscope.update();\n\t\tscope.dispatchEvent( startEvent );\n\t\tscope.dispatchEvent( endEvent );\n\n\t}\n\n\tfunction onKeyDown( event ) {\n\n\t\tif ( scope.enabled === false || scope.noKeys === true || scope.noPan === true ) return;\n\t\t\n\t\tswitch ( event.keyCode ) {\n\n\t\t\tcase scope.keys.UP:\n\t\t\t\tscope.pan( 0, scope.keyPanSpeed );\n\t\t\t\tscope.update();\n\t\t\t\tbreak;\n\n\t\t\tcase scope.keys.BOTTOM:\n\t\t\t\tscope.pan( 0, - scope.keyPanSpeed );\n\t\t\t\tscope.update();\n\t\t\t\tbreak;\n\n\t\t\tcase scope.keys.LEFT:\n\t\t\t\tscope.pan( scope.keyPanSpeed, 0 );\n\t\t\t\tscope.update();\n\t\t\t\tbreak;\n\n\t\t\tcase scope.keys.RIGHT:\n\t\t\t\tscope.pan( - scope.keyPanSpeed, 0 );\n\t\t\t\tscope.update();\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}\n\n\tfunction touchstart( event ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tswitch ( event.touches.length ) {\n\n\t\t\tcase 1:\t// one-fingered touch: rotate\n\n\t\t\t\tif ( scope.noRotate === true ) return;\n\n\t\t\t\tstate = STATE.TOUCH_ROTATE;\n\n\t\t\t\trotateStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\t// two-fingered touch: dolly\n\n\t\t\t\tif ( scope.noZoom === true ) return;\n\n\t\t\t\tstate = STATE.TOUCH_DOLLY;\n\n\t\t\t\tvar dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;\n\t\t\t\tvar dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;\n\t\t\t\tvar distance = Math.sqrt( dx * dx + dy * dy );\n\t\t\t\tdollyStart.set( 0, distance );\n\t\t\t\tbreak;\n\n\t\t\tcase 3: // three-fingered touch: pan\n\n\t\t\t\tif ( scope.noPan === true ) return;\n\n\t\t\t\tstate = STATE.TOUCH_PAN;\n\n\t\t\t\tpanStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tstate = STATE.NONE;\n\n\t\t}\n\n\t\tscope.dispatchEvent( startEvent );\n\n\t}\n\n\tfunction touchmove( event ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tvar element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\n\t\tswitch ( event.touches.length ) {\n\n\t\t\tcase 1: // one-fingered touch: rotate\n\n\t\t\t\tif ( scope.noRotate === true ) return;\n\t\t\t\tif ( state !== STATE.TOUCH_ROTATE ) return;\n\n\t\t\t\trotateEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\trotateDelta.subVectors( rotateEnd, rotateStart );\n\n\t\t\t\t// rotating across whole screen goes 360 degrees around\n\t\t\t\tscope.rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed );\n\t\t\t\t// rotating up and down along whole screen attempts to go 360, but limited to 180\n\t\t\t\tscope.rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed );\n\n\t\t\t\trotateStart.copy( rotateEnd );\n\n\t\t\t\tscope.update();\n\t\t\t\tbreak;\n\n\t\t\tcase 2: // two-fingered touch: dolly\n\n\t\t\t\tif ( scope.noZoom === true ) return;\n\t\t\t\tif ( state !== STATE.TOUCH_DOLLY ) return;\n\n\t\t\t\tvar dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;\n\t\t\t\tvar dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;\n\t\t\t\tvar distance = Math.sqrt( dx * dx + dy * dy );\n\n\t\t\t\tdollyEnd.set( 0, distance );\n\t\t\t\tdollyDelta.subVectors( dollyEnd, dollyStart );\n\n\t\t\t\tif ( dollyDelta.y > 0 ) {\n\n\t\t\t\t\tscope.dollyOut();\n\n\t\t\t\t} else {\n\n\t\t\t\t\tscope.dollyIn();\n\n\t\t\t\t}\n\n\t\t\t\tdollyStart.copy( dollyEnd );\n\n\t\t\t\tscope.update();\n\t\t\t\tbreak;\n\n\t\t\tcase 3: // three-fingered touch: pan\n\n\t\t\t\tif ( scope.noPan === true ) return;\n\t\t\t\tif ( state !== STATE.TOUCH_PAN ) return;\n\n\t\t\t\tpanEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\tpanDelta.subVectors( panEnd, panStart );\n\t\t\t\t\n\t\t\t\tscope.pan( panDelta.x, panDelta.y );\n\n\t\t\t\tpanStart.copy( panEnd );\n\n\t\t\t\tscope.update();\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tstate = STATE.NONE;\n\n\t\t}\n\n\t}\n\n\tfunction touchend( /* event */ ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tscope.dispatchEvent( endEvent );\n\t\tstate = STATE.NONE;\n\n\t}\n\n\tthis.domElement.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false );\n\tthis.domElement.addEventListener( 'mousedown', onMouseDown, false );\n\tthis.domElement.addEventListener( 'mousewheel', onMouseWheel, false );\n\tthis.domElement.addEventListener( 'DOMMouseScroll', onMouseWheel, false ); // firefox\n\n\tthis.domElement.addEventListener( 'touchstart', touchstart, false );\n\tthis.domElement.addEventListener( 'touchend', touchend, false );\n\tthis.domElement.addEventListener( 'touchmove', touchmove, false );\n\n\twindow.addEventListener( 'keydown', onKeyDown, false );\n\n\t// force an update at start\n\tthis.update();\n\n};\n\nTHREE.OrbitZControls.prototype = Object.create( THREE.EventDispatcher.prototype );\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Controls/OrthographicTrackballControls.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Controls/OrthographicTrackballControls.js",
            "module-type": "library",
            "text": "/**\n * @author Eberhard Graether / http://egraether.com/\n * @author Patrick Fuller / http://patrick-fuller.com\n */\n\nTHREE.OrthographicTrackballControls = function ( object, domElement ) {\n\n\tvar _this = this;\n\tvar STATE = { NONE: -1, ROTATE: 0, ZOOM: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_ZOOM: 4, TOUCH_PAN: 5 };\n\n\tthis.object = object;\n\tthis.domElement = ( domElement !== undefined ) ? domElement : document;\n\n\t// API\n\n\tthis.enabled = true;\n\n\tthis.screen = { width: 0, height: 0, offsetLeft: 0, offsetTop: 0 };\n\tthis.radius = ( this.screen.width + this.screen.height ) / 4;\n\n\tthis.rotateSpeed = 1.0;\n\tthis.zoomSpeed = 1.2;\n\tthis.panSpeed = 0.3;\n\n\tthis.noRotate = false;\n\tthis.noZoom = false;\n\tthis.noPan = false;\n\n\tthis.staticMoving = false;\n\tthis.dynamicDampingFactor = 0.2;\n\n\tthis.keys = [ 65 /*A*/, 83 /*S*/, 68 /*D*/ ];\n\n\t// internals\n\n\tthis.target = new THREE.Vector3();\n\n\tvar lastPosition = new THREE.Vector3();\n\n\tvar _state = STATE.NONE,\n\t_prevState = STATE.NONE,\n\n\t_eye = new THREE.Vector3(),\n\n\t_rotateStart = new THREE.Vector3(),\n\t_rotateEnd = new THREE.Vector3(),\n\n\t_zoomStart = new THREE.Vector2(),\n\t_zoomEnd = new THREE.Vector2(),\n\t_zoomFactor = 1,\n\n\t_touchZoomDistanceStart = 0,\n\t_touchZoomDistanceEnd = 0,\n\n\t_panStart = new THREE.Vector2(),\n\t_panEnd = new THREE.Vector2();\n\n\t// for reset\n\n\tthis.target0 = this.target.clone();\n\tthis.position0 = this.object.position.clone();\n\tthis.up0 = this.object.up.clone();\n\n\tthis.left0 = this.object.left;\n\tthis.right0 = this.object.right;\n\tthis.top0 = this.object.top;\n\tthis.bottom0 = this.object.bottom;\n\tthis.center0 = new THREE.Vector2((this.left0 + this.right0) / 2.0, (this.top0 + this.bottom0) / 2.0);\n\n\t// events\n\n\tvar changeEvent = { type: 'change' };\n\n\n\t// methods\n\n\tthis.handleResize = function () {\n\n\t\tthis.screen.width = window.innerWidth;\n\t\tthis.screen.height = window.innerHeight;\n\n\t\tthis.screen.offsetLeft = 0;\n\t\tthis.screen.offsetTop = 0;\n\n\t\tthis.radius = ( this.screen.width + this.screen.height ) / 4;\n\n\t};\n\n\tthis.handleEvent = function ( event ) {\n\n\t\tif ( typeof this[ event.type ] == 'function' ) {\n\n\t\t\tthis[ event.type ]( event );\n\n\t\t}\n\n\t};\n\n\tthis.getMouseOnScreen = function ( clientX, clientY ) {\n\n\t\treturn new THREE.Vector2(\n\t\t\t( clientX - _this.screen.offsetLeft ) / _this.radius * 0.5,\n\t\t\t( clientY - _this.screen.offsetTop ) / _this.radius * 0.5\n\t\t);\n\n\t};\n\n\tthis.getMouseProjectionOnBall = function ( clientX, clientY ) {\n\n\t\tvar mouseOnBall = new THREE.Vector3(\n\t\t\t( clientX - _this.screen.width * 0.5 - _this.screen.offsetLeft ) / _this.radius,\n\t\t\t( _this.screen.height * 0.5 + _this.screen.offsetTop - clientY ) / _this.radius,\n\t\t\t0.0\n\t\t);\n\n\t\tvar length = mouseOnBall.length();\n\n\t\tif ( length > 1.0 ) {\n\n\t\t\tmouseOnBall.normalize();\n\n\t\t} else {\n\n\t\t\tmouseOnBall.z = Math.sqrt( 1.0 - length * length );\n\n\t\t}\n\n\t\t_eye.copy( _this.object.position ).sub( _this.target );\n\n\t\tvar projection = _this.object.up.clone().setLength( mouseOnBall.y );\n\t\tprojection.add( _this.object.up.clone().cross( _eye ).setLength( mouseOnBall.x ) );\n\t\tprojection.add( _eye.setLength( mouseOnBall.z ) );\n\n\t\treturn projection;\n\n\t};\n\n\tthis.rotateCamera = function () {\n\n\t\tvar angle = Math.acos( _rotateStart.dot( _rotateEnd ) / _rotateStart.length() / _rotateEnd.length() );\n\n\t\tif ( angle ) {\n\n\t\t\tvar axis = ( new THREE.Vector3() ).crossVectors( _rotateStart, _rotateEnd ).normalize(),\n\t\t\t\tquaternion = new THREE.Quaternion();\n\n\t\t\tangle *= _this.rotateSpeed;\n\n\t\t\tquaternion.setFromAxisAngle( axis, -angle );\n\n\t\t\t_eye.applyQuaternion( quaternion );\n\t\t\t_this.object.up.applyQuaternion( quaternion );\n\n\t\t\t_rotateEnd.applyQuaternion( quaternion );\n\n\t\t\tif ( _this.staticMoving ) {\n\n\t\t\t\t_rotateStart.copy( _rotateEnd );\n\n\t\t\t} else {\n\n\t\t\t\tquaternion.setFromAxisAngle( axis, angle * ( _this.dynamicDampingFactor - 1.0 ) );\n\t\t\t\t_rotateStart.applyQuaternion( quaternion );\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tthis.zoomCamera = function () {\n\n\t\tif ( _state === STATE.TOUCH_ZOOM ) {\n\n\t\t\tvar factor = _touchZoomDistanceStart / _touchZoomDistanceEnd;\n\t\t\t_touchZoomDistanceStart = _touchZoomDistanceEnd;\n\t\t\t_zoomFactor *= factor;\n\n\t\t\t_this.object.left = _zoomFactor * _this.left0 + ( 1 - _zoomFactor ) *  _this.center0.x;\n\t\t\t_this.object.right = _zoomFactor * _this.right0 + ( 1 - _zoomFactor ) *  _this.center0.x;\n\t\t\t_this.object.top = _zoomFactor * _this.top0 + ( 1 - _zoomFactor ) *  _this.center0.y;\n\t\t\t_this.object.bottom = _zoomFactor * _this.bottom0 + ( 1 - _zoomFactor ) *  _this.center0.y;\n\n\t\t} else {\n\n\t\t\tvar factor = 1.0 + ( _zoomEnd.y - _zoomStart.y ) * _this.zoomSpeed;\n\n\t\t\tif ( factor !== 1.0 && factor > 0.0 ) {\n\t\t\t\t_zoomFactor *= factor;\n\n\t\t\t\t_this.object.left = _zoomFactor * _this.left0 + ( 1 - _zoomFactor ) *  _this.center0.x;\n\t\t\t\t_this.object.right = _zoomFactor * _this.right0 + ( 1 - _zoomFactor ) *  _this.center0.x;\n\t\t\t\t_this.object.top = _zoomFactor * _this.top0 + ( 1 - _zoomFactor ) *  _this.center0.y;\n\t\t\t\t_this.object.bottom = _zoomFactor * _this.bottom0 + ( 1 - _zoomFactor ) *  _this.center0.y;\n\n\t\t\t\tif ( _this.staticMoving ) {\n\n\t\t\t\t\t_zoomStart.copy( _zoomEnd );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_zoomStart.y += ( _zoomEnd.y - _zoomStart.y ) * this.dynamicDampingFactor;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tthis.panCamera = function () {\n\n\t\tvar mouseChange = _panEnd.clone().sub( _panStart );\n\n\t\tif ( mouseChange.lengthSq() ) {\n\n\t\t\tmouseChange.multiplyScalar( _eye.length() * _this.panSpeed );\n\n\t\t\tvar pan = _eye.clone().cross( _this.object.up ).setLength( mouseChange.x );\n\t\t\tpan.add( _this.object.up.clone().setLength( mouseChange.y ) );\n\n\t\t\t_this.object.position.add( pan );\n\t\t\t_this.target.add( pan );\n\n\t\t\tif ( _this.staticMoving ) {\n\n\t\t\t\t_panStart = _panEnd;\n\n\t\t\t} else {\n\n\t\t\t\t_panStart.add( mouseChange.subVectors( _panEnd, _panStart ).multiplyScalar( _this.dynamicDampingFactor ) );\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tthis.update = function () {\n\n\t\t_eye.subVectors( _this.object.position, _this.target );\n\n\t\tif ( !_this.noRotate ) {\n\n\t\t\t_this.rotateCamera();\n\n\t\t}\n\n\t\tif ( !_this.noZoom ) {\n\n\t\t\t_this.zoomCamera();\n\t\t\t_this.object.updateProjectionMatrix();\n\n\t\t}\n\n\t\tif ( !_this.noPan ) {\n\n\t\t\t_this.panCamera();\n\n\t\t}\n\n\t\t_this.object.position.addVectors( _this.target, _eye );\n\n\t\t_this.object.lookAt( _this.target );\n\n\t\tif ( lastPosition.distanceToSquared( _this.object.position ) > 0 ) {\n\n\t\t\t_this.dispatchEvent( changeEvent );\n\n\t\t\tlastPosition.copy( _this.object.position );\n\n\t\t}\n\n\t};\n\n\tthis.reset = function () {\n\n\t\t_state = STATE.NONE;\n\t\t_prevState = STATE.NONE;\n\n\t\t_this.target.copy( _this.target0 );\n\t\t_this.object.position.copy( _this.position0 );\n\t\t_this.object.up.copy( _this.up0 );\n\n\t\t_eye.subVectors( _this.object.position, _this.target );\n\n\t\t_this.object.left = _this.left0;\n\t\t_this.object.right = _this.right0;\n\t\t_this.object.top = _this.top0;\n\t\t_this.object.bottom = _this.bottom0;\n\n\t\t_this.object.lookAt( _this.target );\n\n\t\t_this.dispatchEvent( changeEvent );\n\n\t\tlastPosition.copy( _this.object.position );\n\n\t};\n\n\t// listeners\n\n\tfunction keydown( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\twindow.removeEventListener( 'keydown', keydown );\n\n\t\t_prevState = _state;\n\n\t\tif ( _state !== STATE.NONE ) {\n\n\t\t\treturn;\n\n\t\t} else if ( event.keyCode === _this.keys[ STATE.ROTATE ] && !_this.noRotate ) {\n\n\t\t\t_state = STATE.ROTATE;\n\n\t\t} else if ( event.keyCode === _this.keys[ STATE.ZOOM ] && !_this.noZoom ) {\n\n\t\t\t_state = STATE.ZOOM;\n\n\t\t} else if ( event.keyCode === _this.keys[ STATE.PAN ] && !_this.noPan ) {\n\n\t\t\t_state = STATE.PAN;\n\n\t\t}\n\n\t}\n\n\tfunction keyup( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\t_state = _prevState;\n\n\t\twindow.addEventListener( 'keydown', keydown, false );\n\n\t}\n\n\tfunction mousedown( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tif ( _state === STATE.NONE ) {\n\n\t\t\t_state = event.button;\n\n\t\t}\n\n\t\tif ( _state === STATE.ROTATE && !_this.noRotate ) {\n\n\t\t\t_rotateStart = _rotateEnd = _this.getMouseProjectionOnBall( event.clientX, event.clientY );\n\n\t\t} else if ( _state === STATE.ZOOM && !_this.noZoom ) {\n\n\t\t\t_zoomStart = _zoomEnd = _this.getMouseOnScreen( event.clientX, event.clientY );\n\n\t\t} else if ( _state === STATE.PAN && !_this.noPan ) {\n\n\t\t\t_panStart = _panEnd = _this.getMouseOnScreen( event.clientX, event.clientY );\n\n\t\t}\n\n\t\tdocument.addEventListener( 'mousemove', mousemove, false );\n\t\tdocument.addEventListener( 'mouseup', mouseup, false );\n\n\t}\n\n\tfunction mousemove( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tif ( _state === STATE.ROTATE && !_this.noRotate ) {\n\n\t\t\t_rotateEnd = _this.getMouseProjectionOnBall( event.clientX, event.clientY );\n\n\t\t} else if ( _state === STATE.ZOOM && !_this.noZoom ) {\n\n\t\t\t_zoomEnd = _this.getMouseOnScreen( event.clientX, event.clientY );\n\n\t\t} else if ( _state === STATE.PAN && !_this.noPan ) {\n\n\t\t\t_panEnd = _this.getMouseOnScreen( event.clientX, event.clientY );\n\n\t\t}\n\n\t}\n\n\tfunction mouseup( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\t_state = STATE.NONE;\n\n\t\tdocument.removeEventListener( 'mousemove', mousemove );\n\t\tdocument.removeEventListener( 'mouseup', mouseup );\n\n\t}\n\n\tfunction mousewheel( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tvar delta = 0;\n\n\t\tif ( event.wheelDelta ) { // WebKit / Opera / Explorer 9\n\n\t\t\tdelta = event.wheelDelta / 40;\n\n\t\t} else if ( event.detail ) { // Firefox\n\n\t\t\tdelta = - event.detail / 3;\n\n\t\t}\n\n\t\t_zoomStart.y += delta * 0.01;\n\n\t}\n\n\tfunction touchstart( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\tswitch ( event.touches.length ) {\n\n\t\t\tcase 1:\n\t\t\t\t_state = STATE.TOUCH_ROTATE;\n\t\t\t\t_rotateStart = _rotateEnd = _this.getMouseProjectionOnBall( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\t_state = STATE.TOUCH_ZOOM;\n\t\t\t\tvar dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;\n\t\t\t\tvar dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;\n\t\t\t\t_touchZoomDistanceEnd = _touchZoomDistanceStart = Math.sqrt( dx * dx + dy * dy );\n\t\t\t\tbreak;\n\n\t\t\tcase 3:\n\t\t\t\t_state = STATE.TOUCH_PAN;\n\t\t\t\t_panStart = _panEnd = _this.getMouseOnScreen( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t_state = STATE.NONE;\n\n\t\t}\n\n\t}\n\n\tfunction touchmove( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tswitch ( event.touches.length ) {\n\n\t\t\tcase 1:\n\t\t\t\t_rotateEnd = _this.getMouseProjectionOnBall( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\tvar dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;\n\t\t\t\tvar dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;\n\t\t\t\t_touchZoomDistanceEnd = Math.sqrt( dx * dx + dy * dy )\n\t\t\t\tbreak;\n\n\t\t\tcase 3:\n\t\t\t\t_panEnd = _this.getMouseOnScreen( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t_state = STATE.NONE;\n\n\t\t}\n\n\t}\n\n\tfunction touchend( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\tswitch ( event.touches.length ) {\n\n\t\t\tcase 1:\n\t\t\t\t_rotateStart = _rotateEnd = _this.getMouseProjectionOnBall( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\t_touchZoomDistanceStart = _touchZoomDistanceEnd = 0;\n\t\t\t\tbreak;\n\n\t\t\tcase 3:\n\t\t\t\t_panStart = _panEnd = _this.getMouseOnScreen( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\t_state = STATE.NONE;\n\n\t}\n\n\tthis.domElement.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false );\n\n\tthis.domElement.addEventListener( 'mousedown', mousedown, false );\n\n\tthis.domElement.addEventListener( 'mousewheel', mousewheel, false );\n\tthis.domElement.addEventListener( 'DOMMouseScroll', mousewheel, false ); // firefox\n\n\tthis.domElement.addEventListener( 'touchstart', touchstart, false );\n\tthis.domElement.addEventListener( 'touchend', touchend, false );\n\tthis.domElement.addEventListener( 'touchmove', touchmove, false );\n\n\twindow.addEventListener( 'keydown', keydown, false );\n\twindow.addEventListener( 'keyup', keyup, false );\n\n\tthis.handleResize();\n\n};\n\nTHREE.OrthographicTrackballControls.prototype = Object.create( THREE.EventDispatcher.prototype );\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Controls/PointerLockControls.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Controls/PointerLockControls.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.PointerLockControls = function ( camera ) {\n\n\tvar scope = this;\n\n\tcamera.rotation.set( 0, 0, 0 );\n\n\tvar pitchObject = new THREE.Object3D();\n\tpitchObject.add( camera );\n\n\tvar yawObject = new THREE.Object3D();\n\tyawObject.position.y = 10;\n\tyawObject.add( pitchObject );\n\n\tvar moveForward = false;\n\tvar moveBackward = false;\n\tvar moveLeft = false;\n\tvar moveRight = false;\n\n\tvar isOnObject = false;\n\tvar canJump = false;\n\n\tvar prevTime = performance.now();\n\n\tvar velocity = new THREE.Vector3();\n\n\tvar PI_2 = Math.PI / 2;\n\n\tvar onMouseMove = function ( event ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tvar movementX = event.movementX || event.mozMovementX || event.webkitMovementX || 0;\n\t\tvar movementY = event.movementY || event.mozMovementY || event.webkitMovementY || 0;\n\n\t\tyawObject.rotation.y -= movementX * 0.002;\n\t\tpitchObject.rotation.x -= movementY * 0.002;\n\n\t\tpitchObject.rotation.x = Math.max( - PI_2, Math.min( PI_2, pitchObject.rotation.x ) );\n\n\t};\n\n\tvar onKeyDown = function ( event ) {\n\n\t\tswitch ( event.keyCode ) {\n\n\t\t\tcase 38: // up\n\t\t\tcase 87: // w\n\t\t\t\tmoveForward = true;\n\t\t\t\tbreak;\n\n\t\t\tcase 37: // left\n\t\t\tcase 65: // a\n\t\t\t\tmoveLeft = true; break;\n\n\t\t\tcase 40: // down\n\t\t\tcase 83: // s\n\t\t\t\tmoveBackward = true;\n\t\t\t\tbreak;\n\n\t\t\tcase 39: // right\n\t\t\tcase 68: // d\n\t\t\t\tmoveRight = true;\n\t\t\t\tbreak;\n\n\t\t\tcase 32: // space\n\t\t\t\tif ( canJump === true ) velocity.y += 350;\n\t\t\t\tcanJump = false;\n\t\t\t\tbreak;\n\n\t\t}\n\n\t};\n\n\tvar onKeyUp = function ( event ) {\n\n\t\tswitch( event.keyCode ) {\n\n\t\t\tcase 38: // up\n\t\t\tcase 87: // w\n\t\t\t\tmoveForward = false;\n\t\t\t\tbreak;\n\n\t\t\tcase 37: // left\n\t\t\tcase 65: // a\n\t\t\t\tmoveLeft = false;\n\t\t\t\tbreak;\n\n\t\t\tcase 40: // down\n\t\t\tcase 83: // s\n\t\t\t\tmoveBackward = false;\n\t\t\t\tbreak;\n\n\t\t\tcase 39: // right\n\t\t\tcase 68: // d\n\t\t\t\tmoveRight = false;\n\t\t\t\tbreak;\n\n\t\t}\n\n\t};\n\n\tdocument.addEventListener( 'mousemove', onMouseMove, false );\n\tdocument.addEventListener( 'keydown', onKeyDown, false );\n\tdocument.addEventListener( 'keyup', onKeyUp, false );\n\n\tthis.enabled = false;\n\n\tthis.getObject = function () {\n\n\t\treturn yawObject;\n\n\t};\n\n\tthis.isOnObject = function ( boolean ) {\n\n\t\tisOnObject = boolean;\n\t\tcanJump = boolean;\n\n\t};\n\n\tthis.getDirection = function() {\n\n\t\t// assumes the camera itself is not rotated\n\n\t\tvar direction = new THREE.Vector3( 0, 0, -1 );\n\t\tvar rotation = new THREE.Euler( 0, 0, 0, \"YXZ\" );\n\n\t\treturn function( v ) {\n\n\t\t\trotation.set( pitchObject.rotation.x, yawObject.rotation.y, 0 );\n\n\t\t\tv.copy( direction ).applyEuler( rotation );\n\n\t\t\treturn v;\n\n\t\t}\n\n\t}();\n\n\tthis.update = function () {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tvar time = performance.now();\n\t\tvar delta = ( time - prevTime ) / 1000;\n\n\t\tvelocity.x -= velocity.x * 10.0 * delta;\n\t\tvelocity.z -= velocity.z * 10.0 * delta;\n\n\t\tvelocity.y -= 9.8 * 100.0 * delta; // 100.0 = mass\n\n\t\tif ( moveForward ) velocity.z -= 400.0 * delta;\n\t\tif ( moveBackward ) velocity.z += 400.0 * delta;\n\n\t\tif ( moveLeft ) velocity.x -= 400.0 * delta;\n\t\tif ( moveRight ) velocity.x += 400.0 * delta;\n\n\t\tif ( isOnObject === true ) {\n\n\t\t\tvelocity.y = Math.max( 0, velocity.y );\n\n\t\t}\n\n\t\tyawObject.translateX( velocity.x * delta );\n\t\tyawObject.translateY( velocity.y * delta ); \n\t\tyawObject.translateZ( velocity.z * delta );\n\n\t\tif ( yawObject.position.y < 10 ) {\n\n\t\t\tvelocity.y = 0;\n\t\t\tyawObject.position.y = 10;\n\n\t\t\tcanJump = true;\n\n\t\t}\n\n\t\tprevTime = time;\n\n\t};\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Controls/TrackballControls.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Controls/TrackballControls.js",
            "module-type": "library",
            "text": "/**\n * @author Eberhard Graether / http://egraether.com/\n * @author Mark Lundin \t/ http://mark-lundin.com\n */\n\nTHREE.TrackballControls = function ( object, domElement ) {\n\n\tvar _this = this;\n\tvar STATE = { NONE: -1, ROTATE: 0, ZOOM: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_ZOOM_PAN: 4 };\n\n\tthis.object = object;\n\tthis.domElement = ( domElement !== undefined ) ? domElement : document;\n\n\t// API\n\n\tthis.enabled = true;\n\n\tthis.screen = { left: 0, top: 0, width: 0, height: 0 };\n\n\tthis.rotateSpeed = 1.0;\n\tthis.zoomSpeed = 1.2;\n\tthis.panSpeed = 0.3;\n\n\tthis.noRotate = false;\n\tthis.noZoom = false;\n\tthis.noPan = false;\n\tthis.noRoll = false;\n\n\tthis.staticMoving = false;\n\tthis.dynamicDampingFactor = 0.2;\n\n\tthis.minDistance = 0;\n\tthis.maxDistance = Infinity;\n\n\tthis.keys = [ 65 /*A*/, 83 /*S*/, 68 /*D*/ ];\n\n\t// internals\n\n\tthis.target = new THREE.Vector3();\n\n\tvar EPS = 0.000001;\n\n\tvar lastPosition = new THREE.Vector3();\n\n\tvar _state = STATE.NONE,\n\t_prevState = STATE.NONE,\n\n\t_eye = new THREE.Vector3(),\n\n\t_rotateStart = new THREE.Vector3(),\n\t_rotateEnd = new THREE.Vector3(),\n\n\t_zoomStart = new THREE.Vector2(),\n\t_zoomEnd = new THREE.Vector2(),\n\n\t_touchZoomDistanceStart = 0,\n\t_touchZoomDistanceEnd = 0,\n\n\t_panStart = new THREE.Vector2(),\n\t_panEnd = new THREE.Vector2();\n\n\t// for reset\n\n\tthis.target0 = this.target.clone();\n\tthis.position0 = this.object.position.clone();\n\tthis.up0 = this.object.up.clone();\n\n\t// events\n\n\tvar changeEvent = { type: 'change' };\n\tvar startEvent = { type: 'start'};\n\tvar endEvent = { type: 'end'};\n\n\n\t// methods\n\n\tthis.handleResize = function () {\n\n\t\tif ( this.domElement === document ) {\n\n\t\t\tthis.screen.left = 0;\n\t\t\tthis.screen.top = 0;\n\t\t\tthis.screen.width = window.innerWidth;\n\t\t\tthis.screen.height = window.innerHeight;\n\n\t\t} else {\n\n\t\t\tvar box = this.domElement.getBoundingClientRect();\n\t\t\t// adjustments come from similar code in the jquery offset() function\n\t\t\tvar d = this.domElement.ownerDocument.documentElement;\n\t\t\tthis.screen.left = box.left + window.pageXOffset - d.clientLeft;\n\t\t\tthis.screen.top = box.top + window.pageYOffset - d.clientTop;\n\t\t\tthis.screen.width = box.width;\n\t\t\tthis.screen.height = box.height;\n\n\t\t}\n\n\t};\n\n\tthis.handleEvent = function ( event ) {\n\n\t\tif ( typeof this[ event.type ] == 'function' ) {\n\n\t\t\tthis[ event.type ]( event );\n\n\t\t}\n\n\t};\n\n\tvar getMouseOnScreen = ( function () {\n\n\t\tvar vector = new THREE.Vector2();\n\n\t\treturn function ( pageX, pageY ) {\n\n\t\t\tvector.set(\n\t\t\t\t( pageX - _this.screen.left ) / _this.screen.width,\n\t\t\t\t( pageY - _this.screen.top ) / _this.screen.height\n\t\t\t);\n\n\t\t\treturn vector;\n\n\t\t};\n\n\t}() );\n\n\tvar getMouseProjectionOnBall = ( function () {\n\n\t\tvar vector = new THREE.Vector3();\n\t\tvar objectUp = new THREE.Vector3();\n\t\tvar mouseOnBall = new THREE.Vector3();\n\n\t\treturn function ( pageX, pageY ) {\n\n\t\t\tmouseOnBall.set(\n\t\t\t\t( pageX - _this.screen.width * 0.5 - _this.screen.left ) / (_this.screen.width*.5),\n\t\t\t\t( _this.screen.height * 0.5 + _this.screen.top - pageY ) / (_this.screen.height*.5),\n\t\t\t\t0.0\n\t\t\t);\n\n\t\t\tvar length = mouseOnBall.length();\n\n\t\t\tif ( _this.noRoll ) {\n\n\t\t\t\tif ( length < Math.SQRT1_2 ) {\n\n\t\t\t\t\tmouseOnBall.z = Math.sqrt( 1.0 - length*length );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tmouseOnBall.z = .5 / length;\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t} else if ( length > 1.0 ) {\n\n\t\t\t\tmouseOnBall.normalize();\n\n\t\t\t} else {\n\n\t\t\t\tmouseOnBall.z = Math.sqrt( 1.0 - length * length );\n\n\t\t\t}\n\n\t\t\t_eye.copy( _this.object.position ).sub( _this.target );\n\n\t\t\tvector.copy( _this.object.up ).setLength( mouseOnBall.y )\n\t\t\tvector.add( objectUp.copy( _this.object.up ).cross( _eye ).setLength( mouseOnBall.x ) );\n\t\t\tvector.add( _eye.setLength( mouseOnBall.z ) );\n\n\t\t\treturn vector;\n\n\t\t};\n\n\t}() );\n\n\tthis.rotateCamera = (function(){\n\n\t\tvar axis = new THREE.Vector3(),\n\t\t\tquaternion = new THREE.Quaternion();\n\n\n\t\treturn function () {\n\n\t\t\tvar angle = Math.acos( _rotateStart.dot( _rotateEnd ) / _rotateStart.length() / _rotateEnd.length() );\n\n\t\t\tif ( angle ) {\n\n\t\t\t\taxis.crossVectors( _rotateStart, _rotateEnd ).normalize();\n\n\t\t\t\tangle *= _this.rotateSpeed;\n\n\t\t\t\tquaternion.setFromAxisAngle( axis, -angle );\n\n\t\t\t\t_eye.applyQuaternion( quaternion );\n\t\t\t\t_this.object.up.applyQuaternion( quaternion );\n\n\t\t\t\t_rotateEnd.applyQuaternion( quaternion );\n\n\t\t\t\tif ( _this.staticMoving ) {\n\n\t\t\t\t\t_rotateStart.copy( _rotateEnd );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tquaternion.setFromAxisAngle( axis, angle * ( _this.dynamicDampingFactor - 1.0 ) );\n\t\t\t\t\t_rotateStart.applyQuaternion( quaternion );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t}());\n\n\tthis.zoomCamera = function () {\n\n\t\tif ( _state === STATE.TOUCH_ZOOM_PAN ) {\n\n\t\t\tvar factor = _touchZoomDistanceStart / _touchZoomDistanceEnd;\n\t\t\t_touchZoomDistanceStart = _touchZoomDistanceEnd;\n\t\t\t_eye.multiplyScalar( factor );\n\n\t\t} else {\n\n\t\t\tvar factor = 1.0 + ( _zoomEnd.y - _zoomStart.y ) * _this.zoomSpeed;\n\n\t\t\tif ( factor !== 1.0 && factor > 0.0 ) {\n\n\t\t\t\t_eye.multiplyScalar( factor );\n\n\t\t\t\tif ( _this.staticMoving ) {\n\n\t\t\t\t\t_zoomStart.copy( _zoomEnd );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_zoomStart.y += ( _zoomEnd.y - _zoomStart.y ) * this.dynamicDampingFactor;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tthis.panCamera = (function(){\n\n\t\tvar mouseChange = new THREE.Vector2(),\n\t\t\tobjectUp = new THREE.Vector3(),\n\t\t\tpan = new THREE.Vector3();\n\n\t\treturn function () {\n\n\t\t\tmouseChange.copy( _panEnd ).sub( _panStart );\n\n\t\t\tif ( mouseChange.lengthSq() ) {\n\n\t\t\t\tmouseChange.multiplyScalar( _eye.length() * _this.panSpeed );\n\n\t\t\t\tpan.copy( _eye ).cross( _this.object.up ).setLength( mouseChange.x );\n\t\t\t\tpan.add( objectUp.copy( _this.object.up ).setLength( mouseChange.y ) );\n\n\t\t\t\t_this.object.position.add( pan );\n\t\t\t\t_this.target.add( pan );\n\n\t\t\t\tif ( _this.staticMoving ) {\n\n\t\t\t\t\t_panStart.copy( _panEnd );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_panStart.add( mouseChange.subVectors( _panEnd, _panStart ).multiplyScalar( _this.dynamicDampingFactor ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t}());\n\n\tthis.checkDistances = function () {\n\n\t\tif ( !_this.noZoom || !_this.noPan ) {\n\n\t\t\tif ( _eye.lengthSq() > _this.maxDistance * _this.maxDistance ) {\n\n\t\t\t\t_this.object.position.addVectors( _this.target, _eye.setLength( _this.maxDistance ) );\n\n\t\t\t}\n\n\t\t\tif ( _eye.lengthSq() < _this.minDistance * _this.minDistance ) {\n\n\t\t\t\t_this.object.position.addVectors( _this.target, _eye.setLength( _this.minDistance ) );\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tthis.update = function () {\n\n\t\t_eye.subVectors( _this.object.position, _this.target );\n\n\t\tif ( !_this.noRotate ) {\n\n\t\t\t_this.rotateCamera();\n\n\t\t}\n\n\t\tif ( !_this.noZoom ) {\n\n\t\t\t_this.zoomCamera();\n\n\t\t}\n\n\t\tif ( !_this.noPan ) {\n\n\t\t\t_this.panCamera();\n\n\t\t}\n\n\t\t_this.object.position.addVectors( _this.target, _eye );\n\n\t\t_this.checkDistances();\n\n\t\t_this.object.lookAt( _this.target );\n\n\t\tif ( lastPosition.distanceToSquared( _this.object.position ) > EPS ) {\n\n\t\t\t_this.dispatchEvent( changeEvent );\n\n\t\t\tlastPosition.copy( _this.object.position );\n\n\t\t}\n\n\t};\n\n\tthis.reset = function () {\n\n\t\t_state = STATE.NONE;\n\t\t_prevState = STATE.NONE;\n\n\t\t_this.target.copy( _this.target0 );\n\t\t_this.object.position.copy( _this.position0 );\n\t\t_this.object.up.copy( _this.up0 );\n\n\t\t_eye.subVectors( _this.object.position, _this.target );\n\n\t\t_this.object.lookAt( _this.target );\n\n\t\t_this.dispatchEvent( changeEvent );\n\n\t\tlastPosition.copy( _this.object.position );\n\n\t};\n\n\t// listeners\n\n\tfunction keydown( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\twindow.removeEventListener( 'keydown', keydown );\n\n\t\t_prevState = _state;\n\n\t\tif ( _state !== STATE.NONE ) {\n\n\t\t\treturn;\n\n\t\t} else if ( event.keyCode === _this.keys[ STATE.ROTATE ] && !_this.noRotate ) {\n\n\t\t\t_state = STATE.ROTATE;\n\n\t\t} else if ( event.keyCode === _this.keys[ STATE.ZOOM ] && !_this.noZoom ) {\n\n\t\t\t_state = STATE.ZOOM;\n\n\t\t} else if ( event.keyCode === _this.keys[ STATE.PAN ] && !_this.noPan ) {\n\n\t\t\t_state = STATE.PAN;\n\n\t\t}\n\n\t}\n\n\tfunction keyup( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\t_state = _prevState;\n\n\t\twindow.addEventListener( 'keydown', keydown, false );\n\n\t}\n\n\tfunction mousedown( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tif ( _state === STATE.NONE ) {\n\n\t\t\t_state = event.button;\n\n\t\t}\n\n\t\tif ( _state === STATE.ROTATE && !_this.noRotate ) {\n\n\t\t\t_rotateStart.copy( getMouseProjectionOnBall( event.pageX, event.pageY ) );\n\t\t\t_rotateEnd.copy( _rotateStart );\n\n\t\t} else if ( _state === STATE.ZOOM && !_this.noZoom ) {\n\n\t\t\t_zoomStart.copy( getMouseOnScreen( event.pageX, event.pageY ) );\n\t\t\t_zoomEnd.copy(_zoomStart);\n\n\t\t} else if ( _state === STATE.PAN && !_this.noPan ) {\n\n\t\t\t_panStart.copy( getMouseOnScreen( event.pageX, event.pageY ) );\n\t\t\t_panEnd.copy(_panStart)\n\n\t\t}\n\n\t\tdocument.addEventListener( 'mousemove', mousemove, false );\n\t\tdocument.addEventListener( 'mouseup', mouseup, false );\n\n\t\t_this.dispatchEvent( startEvent );\n\n\t}\n\n\tfunction mousemove( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tif ( _state === STATE.ROTATE && !_this.noRotate ) {\n\n\t\t\t_rotateEnd.copy( getMouseProjectionOnBall( event.pageX, event.pageY ) );\n\n\t\t} else if ( _state === STATE.ZOOM && !_this.noZoom ) {\n\n\t\t\t_zoomEnd.copy( getMouseOnScreen( event.pageX, event.pageY ) );\n\n\t\t} else if ( _state === STATE.PAN && !_this.noPan ) {\n\n\t\t\t_panEnd.copy( getMouseOnScreen( event.pageX, event.pageY ) );\n\n\t\t}\n\n\t}\n\n\tfunction mouseup( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\t_state = STATE.NONE;\n\n\t\tdocument.removeEventListener( 'mousemove', mousemove );\n\t\tdocument.removeEventListener( 'mouseup', mouseup );\n\t\t_this.dispatchEvent( endEvent );\n\n\t}\n\n\tfunction mousewheel( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tvar delta = 0;\n\n\t\tif ( event.wheelDelta ) { // WebKit / Opera / Explorer 9\n\n\t\t\tdelta = event.wheelDelta / 40;\n\n\t\t} else if ( event.detail ) { // Firefox\n\n\t\t\tdelta = - event.detail / 3;\n\n\t\t}\n\n\t\t_zoomStart.y += delta * 0.01;\n\t\t_this.dispatchEvent( startEvent );\n\t\t_this.dispatchEvent( endEvent );\n\n\t}\n\n\tfunction touchstart( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\tswitch ( event.touches.length ) {\n\n\t\t\tcase 1:\n\t\t\t\t_state = STATE.TOUCH_ROTATE;\n\t\t\t\t_rotateStart.copy( getMouseProjectionOnBall( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ) );\n\t\t\t\t_rotateEnd.copy( _rotateStart );\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\t_state = STATE.TOUCH_ZOOM_PAN;\n\t\t\t\tvar dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;\n\t\t\t\tvar dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;\n\t\t\t\t_touchZoomDistanceEnd = _touchZoomDistanceStart = Math.sqrt( dx * dx + dy * dy );\n\n\t\t\t\tvar x = ( event.touches[ 0 ].pageX + event.touches[ 1 ].pageX ) / 2;\n\t\t\t\tvar y = ( event.touches[ 0 ].pageY + event.touches[ 1 ].pageY ) / 2;\n\t\t\t\t_panStart.copy( getMouseOnScreen( x, y ) );\n\t\t\t\t_panEnd.copy( _panStart );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t_state = STATE.NONE;\n\n\t\t}\n\t\t_this.dispatchEvent( startEvent );\n\n\n\t}\n\n\tfunction touchmove( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tswitch ( event.touches.length ) {\n\n\t\t\tcase 1:\n\t\t\t\t_rotateEnd.copy( getMouseProjectionOnBall( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ) );\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\tvar dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;\n\t\t\t\tvar dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;\n\t\t\t\t_touchZoomDistanceEnd = Math.sqrt( dx * dx + dy * dy );\n\n\t\t\t\tvar x = ( event.touches[ 0 ].pageX + event.touches[ 1 ].pageX ) / 2;\n\t\t\t\tvar y = ( event.touches[ 0 ].pageY + event.touches[ 1 ].pageY ) / 2;\n\t\t\t\t_panEnd.copy( getMouseOnScreen( x, y ) );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t_state = STATE.NONE;\n\n\t\t}\n\n\t}\n\n\tfunction touchend( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\tswitch ( event.touches.length ) {\n\n\t\t\tcase 1:\n\t\t\t\t_rotateEnd.copy( getMouseProjectionOnBall( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ) );\n\t\t\t\t_rotateStart.copy( _rotateEnd );\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\t_touchZoomDistanceStart = _touchZoomDistanceEnd = 0;\n\n\t\t\t\tvar x = ( event.touches[ 0 ].pageX + event.touches[ 1 ].pageX ) / 2;\n\t\t\t\tvar y = ( event.touches[ 0 ].pageY + event.touches[ 1 ].pageY ) / 2;\n\t\t\t\t_panEnd.copy( getMouseOnScreen( x, y ) );\n\t\t\t\t_panStart.copy( _panEnd );\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\t_state = STATE.NONE;\n\t\t_this.dispatchEvent( endEvent );\n\n\t}\n\n\tthis.domElement.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false );\n\n\tthis.domElement.addEventListener( 'mousedown', mousedown, false );\n\n\tthis.domElement.addEventListener( 'mousewheel', mousewheel, false );\n\tthis.domElement.addEventListener( 'DOMMouseScroll', mousewheel, false ); // firefox\n\n\tthis.domElement.addEventListener( 'touchstart', touchstart, false );\n\tthis.domElement.addEventListener( 'touchend', touchend, false );\n\tthis.domElement.addEventListener( 'touchmove', touchmove, false );\n\n\twindow.addEventListener( 'keydown', keydown, false );\n\twindow.addEventListener( 'keyup', keyup, false );\n\n\tthis.handleResize();\n\n\t// force an update at start\n\tthis.update();\n\n};\n\nTHREE.TrackballControls.prototype = Object.create( THREE.EventDispatcher.prototype );\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Controls/TransformControls.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Controls/TransformControls.js",
            "module-type": "library",
            "text": "/**\n * @author arodic / https://github.com/arodic\n */\n /*jshint sub:true*/\n\n(function () {\n\n\t'use strict';\n\n\tvar GizmoMaterial = function ( parameters ) {\n\n\t\tTHREE.MeshBasicMaterial.call( this );\n\n\t\tthis.depthTest = false;\n\t\tthis.depthWrite = false;\n\t\tthis.side = THREE.FrontSide;\n\t\tthis.transparent = true;\n\n\t\tthis.setValues( parameters );\n\n\t\tthis.oldColor = this.color.clone();\n\t\tthis.oldOpacity = this.opacity;\n\n\t\tthis.highlight = function( highlighted ) {\n\n\t\t\tif ( highlighted ) {\n\n\t\t\t\tthis.color.setRGB( 1, 1, 0 );\n\t\t\t\tthis.opacity = 1;\n\n\t\t\t} else {\n\n\t\t\t\t\tthis.color.copy( this.oldColor );\n\t\t\t\t\tthis.opacity = this.oldOpacity;\n\n\t\t\t}\n\n\t\t};\n\n\t};\n\n\tGizmoMaterial.prototype = Object.create( THREE.MeshBasicMaterial.prototype );\n\n\tvar GizmoLineMaterial = function ( parameters ) {\n\n\t\tTHREE.LineBasicMaterial.call( this );\n\n\t\tthis.depthTest = false;\n\t\tthis.depthWrite = false;\n\t\tthis.transparent = true;\n\t\tthis.linewidth = 1;\n\n\t\tthis.setValues( parameters );\n\n\t\tthis.oldColor = this.color.clone();\n\t\tthis.oldOpacity = this.opacity;\n\n\t\tthis.highlight = function( highlighted ) {\n\n\t\t\tif ( highlighted ) {\n\n\t\t\t\tthis.color.setRGB( 1, 1, 0 );\n\t\t\t\tthis.opacity = 1;\n\n\t\t\t} else {\n\n\t\t\t\t\tthis.color.copy( this.oldColor );\n\t\t\t\t\tthis.opacity = this.oldOpacity;\n\n\t\t\t}\n\n\t\t};\n\n\t};\n\n\tGizmoLineMaterial.prototype = Object.create( THREE.LineBasicMaterial.prototype );\n\n\tTHREE.TransformGizmo = function () {\n\n\t\tvar scope = this;\n\t\tvar showPickers = false; //debug\n\t\tvar showActivePlane = false; //debug\n\n\t\tthis.init = function () {\n\n\t\t\tTHREE.Object3D.call( this );\n\n\t\t\tthis.handles = new THREE.Object3D();\n\t\t\tthis.pickers = new THREE.Object3D();\n\t\t\tthis.planes = new THREE.Object3D();\n\n\t\t\tthis.add(this.handles);\n\t\t\tthis.add(this.pickers);\n\t\t\tthis.add(this.planes);\n\n\t\t\t//// PLANES\n\n\t\t\tvar planeGeometry = new THREE.PlaneGeometry( 50, 50, 2, 2 );\n\t\t\tvar planeMaterial = new THREE.MeshBasicMaterial( { wireframe: true } );\n\t\t\tplaneMaterial.side = THREE.DoubleSide;\n\n\t\t\tvar planes = {\n\t\t\t\t\"XY\":   new THREE.Mesh( planeGeometry, planeMaterial ),\n\t\t\t\t\"YZ\":   new THREE.Mesh( planeGeometry, planeMaterial ),\n\t\t\t\t\"XZ\":   new THREE.Mesh( planeGeometry, planeMaterial ),\n\t\t\t\t\"XYZE\": new THREE.Mesh( planeGeometry, planeMaterial )\n\t\t\t};\n\n\t\t\tthis.activePlane = planes[\"XYZE\"];\n\n\t\t\tplanes[\"YZ\"].rotation.set( 0, Math.PI/2, 0 );\n\t\t\tplanes[\"XZ\"].rotation.set( -Math.PI/2, 0, 0 );\n\n\t\t\tfor (var i in planes) {\n\t\t\t\tplanes[i].name = i;\n\t\t\t\tthis.planes.add(planes[i]);\n\t\t\t\tthis.planes[i] = planes[i];\n\t\t\t\tplanes[i].visible = false;\n\t\t\t}\n\n\t\t\t//// HANDLES AND PICKERS\n\n\t\t\tvar setupGizmos = function( gizmoMap, parent ) {\n\n\t\t\t\tfor ( var name in gizmoMap ) {\n\n\t\t\t\t\tfor ( i = gizmoMap[name].length; i--;) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar object = gizmoMap[name][i][0];\n\t\t\t\t\t\tvar position = gizmoMap[name][i][1];\n\t\t\t\t\t\tvar rotation = gizmoMap[name][i][2];\n\n\t\t\t\t\t\tobject.name = name;\n\n\t\t\t\t\t\tif ( position ) object.position.set( position[0], position[1], position[2] );\n\t\t\t\t\t\tif ( rotation ) object.rotation.set( rotation[0], rotation[1], rotation[2] );\n\t\t\t\t\t\t\n\t\t\t\t\t\tparent.add( object );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t};\n\n\t\t\tsetupGizmos(this.handleGizmos, this.handles);\n\t\t\tsetupGizmos(this.pickerGizmos, this.pickers);\n\n\t\t\t// reset Transformations\n\n\t\t\tthis.traverse(function ( child ) {\n\t\t\t\tif (child instanceof THREE.Mesh) {\n\t\t\t\t\tchild.updateMatrix();\n\n\t\t\t\t\tvar tempGeometry = new THREE.Geometry();\n\t\t\t\t\ttempGeometry.merge( child.geometry, child.matrix );\n\n\t\t\t\t\tchild.geometry = tempGeometry;\n\t\t\t\t\tchild.position.set( 0, 0, 0 );\n\t\t\t\t\tchild.rotation.set( 0, 0, 0 );\n\t\t\t\t\tchild.scale.set( 1, 1, 1 );\n\t\t\t\t}\n\t\t\t});\n\n\t\t};\n\n\t\tthis.hide = function () {\n\t\t\tthis.traverse(function( child ) {\n\t\t\t\tchild.visible = false;\n\t\t\t});\n\t\t};\n\n\t\tthis.show = function () {\n\t\t\tthis.traverse(function( child ) {\n\t\t\t\tchild.visible = true;\n\t\t\t\tif (child.parent == scope.pickers ) child.visible = showPickers;\n\t\t\t\tif (child.parent == scope.planes ) child.visible = false;\n\t\t\t});\n\t\t\tthis.activePlane.visible = showActivePlane;\n\t\t};\n\n\t\tthis.highlight = function ( axis ) {\n\t\t\tthis.traverse(function( child ) {\n\t\t\t\tif ( child.material && child.material.highlight ){\n\t\t\t\t\tif ( child.name == axis ) {\n\t\t\t\t\t\tchild.material.highlight( true );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tchild.material.highlight( false );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t};\n\n\tTHREE.TransformGizmo.prototype = Object.create( THREE.Object3D.prototype );\n\n\tTHREE.TransformGizmo.prototype.update = function ( rotation, eye ) {\n\n\t\tvar vec1 = new THREE.Vector3( 0, 0, 0 );\n\t\tvar vec2 = new THREE.Vector3( 0, 1, 0 );\n\t\tvar lookAtMatrix = new THREE.Matrix4();\n\n\t\tthis.traverse(function(child) {\n\t\t\tif ( child.name.search(\"E\") != -1 ) {\n\t\t\t\tchild.quaternion.setFromRotationMatrix( lookAtMatrix.lookAt( eye, vec1, vec2 ) );\n\t\t\t} else if ( child.name.search(\"X\") != -1 || child.name.search(\"Y\") != -1 || child.name.search(\"Z\") != -1 ) {\n\t\t\t\tchild.quaternion.setFromEuler( rotation );\n\t\t\t}\n\t\t});\n\n\t};\n\n\tTHREE.TransformGizmoTranslate = function () {\n\n\t\tTHREE.TransformGizmo.call( this );\n\n\t\tvar arrowGeometry = new THREE.Geometry();\n\t\tvar mesh = new THREE.Mesh( new THREE.CylinderGeometry( 0, 0.05, 0.2, 12, 1, false ) );\n\t\tmesh.position.y = 0.5;\n\t\tmesh.updateMatrix();\n\n\t\tarrowGeometry.merge( mesh.geometry, mesh.matrix );\n\t\t\n\t\tvar lineXGeometry = new THREE.Geometry();\n\t\tlineXGeometry.vertices.push( new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 1, 0, 0 ) );\n\n\t\tvar lineYGeometry = new THREE.Geometry();\n\t\tlineYGeometry.vertices.push( new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 0, 1, 0 ) );\n\n\t\tvar lineZGeometry = new THREE.Geometry();\n\t\tlineZGeometry.vertices.push( new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 0, 0, 1 ) );\n\n\t\tthis.handleGizmos = {\n\t\t\tX: [\n\t\t\t\t[ new THREE.Mesh( arrowGeometry, new GizmoMaterial( { color: 0xff0000 } ) ), [ 0.5, 0, 0 ], [ 0, 0, -Math.PI/2 ] ],\n\t\t\t\t[ new THREE.Line( lineXGeometry, new GizmoLineMaterial( { color: 0xff0000 } ) ) ]\n\t\t\t],\n\t\t\tY: [\n\t\t\t\t[ new THREE.Mesh( arrowGeometry, new GizmoMaterial( { color: 0x00ff00 } ) ), [ 0, 0.5, 0 ] ],\n\t\t\t\t[\tnew THREE.Line( lineYGeometry, new GizmoLineMaterial( { color: 0x00ff00 } ) ) ]\n\t\t\t],\n\t\t\tZ: [\n\t\t\t\t[ new THREE.Mesh( arrowGeometry, new GizmoMaterial( { color: 0x0000ff } ) ), [ 0, 0, 0.5 ], [ Math.PI/2, 0, 0 ] ],\n\t\t\t\t[ new THREE.Line( lineZGeometry, new GizmoLineMaterial( { color: 0x0000ff } ) ) ]\n\t\t\t],\n\t\t\tXYZ: [\n\t\t\t\t[ new THREE.Mesh( new THREE.OctahedronGeometry( 0.1, 0 ), new GizmoMaterial( { color: 0xffffff, opacity: 0.25 } ) ), [ 0, 0, 0 ], [ 0, 0, 0 ] ]\n\t\t\t],\n\t\t\tXY: [\n\t\t\t\t[ new THREE.Mesh( new THREE.PlaneGeometry( 0.29, 0.29 ), new GizmoMaterial( { color: 0xffff00, opacity: 0.25 } ) ), [ 0.15, 0.15, 0 ] ]\n\t\t\t],\n\t\t\tYZ: [\n\t\t\t\t[ new THREE.Mesh( new THREE.PlaneGeometry( 0.29, 0.29 ), new GizmoMaterial( { color: 0x00ffff, opacity: 0.25 } ) ), [ 0, 0.15, 0.15 ], [ 0, Math.PI/2, 0 ] ]\n\t\t\t],\n\t\t\tXZ: [\n\t\t\t\t[ new THREE.Mesh( new THREE.PlaneGeometry( 0.29, 0.29 ), new GizmoMaterial( { color: 0xff00ff, opacity: 0.25 } ) ), [ 0.15, 0, 0.15 ], [ -Math.PI/2, 0, 0 ] ]\n\t\t\t]\n\t\t};\n\n\t\tthis.pickerGizmos = {\n\t\t\tX: [\n\t\t\t\t[ new THREE.Mesh( new THREE.CylinderGeometry( 0.2, 0, 1, 4, 1, false ), new GizmoMaterial( { color: 0xff0000, opacity: 0.25 } ) ), [ 0.6, 0, 0 ], [ 0, 0, -Math.PI/2 ] ]\n\t\t\t],\n\t\t\tY: [\n\t\t\t\t[ new THREE.Mesh( new THREE.CylinderGeometry( 0.2, 0, 1, 4, 1, false ), new GizmoMaterial( { color: 0x00ff00, opacity: 0.25 } ) ), [ 0, 0.6, 0 ] ]\n\t\t\t],\n\t\t\tZ: [\n\t\t\t\t[ new THREE.Mesh( new THREE.CylinderGeometry( 0.2, 0, 1, 4, 1, false ), new GizmoMaterial( { color: 0x0000ff, opacity: 0.25 } ) ), [ 0, 0, 0.6 ], [ Math.PI/2, 0, 0 ] ]\n\t\t\t],\n\t\t\tXYZ: [\n\t\t\t\t[ new THREE.Mesh( new THREE.OctahedronGeometry( 0.2, 0 ), new GizmoMaterial( { color: 0xffffff, opacity: 0.25 } ) ) ]\n\t\t\t],\n\t\t\tXY: [\n\t\t\t\t[ new THREE.Mesh( new THREE.PlaneGeometry( 0.4, 0.4 ), new GizmoMaterial( { color: 0xffff00, opacity: 0.25 } ) ), [ 0.2, 0.2, 0 ] ]\n\t\t\t],\n\t\t\tYZ: [\n\t\t\t\t[ new THREE.Mesh( new THREE.PlaneGeometry( 0.4, 0.4 ), new GizmoMaterial( { color: 0x00ffff, opacity: 0.25 } ) ), [ 0, 0.2, 0.2 ], [ 0, Math.PI/2, 0 ] ]\n\t\t\t],\n\t\t\tXZ: [\n\t\t\t\t[ new THREE.Mesh( new THREE.PlaneGeometry( 0.4, 0.4 ), new GizmoMaterial( { color: 0xff00ff, opacity: 0.25 } ) ), [ 0.2, 0, 0.2 ], [ -Math.PI/2, 0, 0 ] ]\n\t\t\t]\n\t\t};\n\n\t\tthis.setActivePlane = function ( axis, eye ) {\n\n\t\t\tvar tempMatrix = new THREE.Matrix4();\n\t\t\teye.applyMatrix4( tempMatrix.getInverse( tempMatrix.extractRotation( this.planes[ \"XY\" ].matrixWorld ) ) );\n\n\t\t\tif ( axis == \"X\" ) {\n\t\t\t\tthis.activePlane = this.planes[ \"XY\" ];\n\t\t\t\tif ( Math.abs(eye.y) > Math.abs(eye.z) ) this.activePlane = this.planes[ \"XZ\" ];\n\t\t\t}\n\n\t\t\tif ( axis == \"Y\" ){\n\t\t\t\tthis.activePlane = this.planes[ \"XY\" ];\n\t\t\t\tif ( Math.abs(eye.x) > Math.abs(eye.z) ) this.activePlane = this.planes[ \"YZ\" ];\n\t\t\t}\n\n\t\t\tif ( axis == \"Z\" ){\n\t\t\t\tthis.activePlane = this.planes[ \"XZ\" ];\n\t\t\t\tif ( Math.abs(eye.x) > Math.abs(eye.y) ) this.activePlane = this.planes[ \"YZ\" ];\n\t\t\t}\n\n\t\t\tif ( axis == \"XYZ\" ) this.activePlane = this.planes[ \"XYZE\" ];\n\n\t\t\tif ( axis == \"XY\" ) this.activePlane = this.planes[ \"XY\" ];\n\n\t\t\tif ( axis == \"YZ\" ) this.activePlane = this.planes[ \"YZ\" ];\n\n\t\t\tif ( axis == \"XZ\" ) this.activePlane = this.planes[ \"XZ\" ];\n\n\t\t\tthis.hide();\n\t\t\tthis.show();\n\n\t\t};\n\n\t\tthis.init();\n\n\t};\n\n\tTHREE.TransformGizmoTranslate.prototype = Object.create( THREE.TransformGizmo.prototype );\n\n\tTHREE.TransformGizmoRotate = function () {\n\n\t\tTHREE.TransformGizmo.call( this );\n\n\t\tvar CircleGeometry = function ( radius, facing, arc ) {\n\n\t\t\t\tvar geometry = new THREE.Geometry();\n\t\t\t\tarc = arc ? arc : 1;\n\t\t\t\tfor ( var i = 0; i <= 64 * arc; ++i ) {\n\t\t\t\t\tif ( facing == 'x' ) geometry.vertices.push( new THREE.Vector3( 0, Math.cos( i / 32 * Math.PI ), Math.sin( i / 32 * Math.PI ) ).multiplyScalar(radius) );\n\t\t\t\t\tif ( facing == 'y' ) geometry.vertices.push( new THREE.Vector3( Math.cos( i / 32 * Math.PI ), 0, Math.sin( i / 32 * Math.PI ) ).multiplyScalar(radius) );\n\t\t\t\t\tif ( facing == 'z' ) geometry.vertices.push( new THREE.Vector3( Math.sin( i / 32 * Math.PI ), Math.cos( i / 32 * Math.PI ), 0 ).multiplyScalar(radius) );\n\t\t\t\t}\n\n\t\t\t\treturn geometry;\n\t\t};\n\n\t\tthis.handleGizmos = {\n\t\t\tX: [\n\t\t\t\t[ new THREE.Line( new CircleGeometry(1,'x',0.5), new GizmoLineMaterial( { color: 0xff0000 } ) ) ]\n\t\t\t],\n\t\t\tY: [\n\t\t\t\t[ new THREE.Line( new CircleGeometry(1,'y',0.5), new GizmoLineMaterial( { color: 0x00ff00 } ) ) ]\n\t\t\t],\n\t\t\tZ: [\n\t\t\t\t[ new THREE.Line( new CircleGeometry(1,'z',0.5), new GizmoLineMaterial( { color: 0x0000ff } ) ) ]\n\t\t\t],\n\t\t\tE: [\n\t\t\t\t[ new THREE.Line( new CircleGeometry(1.25,'z',1), new GizmoLineMaterial( { color: 0xcccc00 } ) ) ]\n\t\t\t],\n\t\t\tXYZE: [\n\t\t\t\t[ new THREE.Line( new CircleGeometry(1,'z',1), new GizmoLineMaterial( { color: 0x787878 } ) ) ]\n\t\t\t]\n\t\t};\n\n\t\tthis.pickerGizmos = {\n\t\t\tX: [\n\t\t\t\t[ new THREE.Mesh( new THREE.TorusGeometry( 1, 0.12, 4, 12, Math.PI ), new GizmoMaterial( { color: 0xff0000, opacity: 0.25 } ) ), [ 0, 0, 0 ], [ 0, -Math.PI/2, -Math.PI/2 ] ]\n\t\t\t],\n\t\t\tY: [\n\t\t\t\t[ new THREE.Mesh( new THREE.TorusGeometry( 1, 0.12, 4, 12, Math.PI ), new GizmoMaterial( { color: 0x00ff00, opacity: 0.25 } ) ), [ 0, 0, 0 ], [ Math.PI/2, 0, 0 ] ]\n\t\t\t],\n\t\t\tZ: [\n\t\t\t\t[ new THREE.Mesh( new THREE.TorusGeometry( 1, 0.12, 4, 12, Math.PI ), new GizmoMaterial( { color: 0x0000ff, opacity: 0.25 } ) ), [ 0, 0, 0 ], [ 0, 0, -Math.PI/2 ] ]\n\t\t\t],\n\t\t\tE: [\n\t\t\t\t[ new THREE.Mesh( new THREE.TorusGeometry( 1.25, 0.12, 2, 24 ), new GizmoMaterial( { color: 0xffff00, opacity: 0.25 } ) ) ]\n\t\t\t],\n\t\t\tXYZE: [\n\t\t\t\t[ new THREE.Mesh( new THREE.Geometry() ) ]// TODO\n\t\t\t]\n\t\t};\n\n\t\tthis.setActivePlane = function ( axis ) {\n\n\t\t\tif ( axis == \"E\" ) this.activePlane = this.planes[ \"XYZE\" ];\n\n\t\t\tif ( axis == \"X\" ) this.activePlane = this.planes[ \"YZ\" ];\n\n\t\t\tif ( axis == \"Y\" ) this.activePlane = this.planes[ \"XZ\" ];\n\n\t\t\tif ( axis == \"Z\" ) this.activePlane = this.planes[ \"XY\" ];\n\n\t\t\tthis.hide();\n\t\t\tthis.show();\n\n\t\t};\n\n\t\tthis.update = function ( rotation, eye2 ) {\n\n\t\t\tTHREE.TransformGizmo.prototype.update.apply( this, arguments );\n\n\t\t\tvar group = {\n\t\t\t\thandles: this[\"handles\"],\n\t\t\t\tpickers: this[\"pickers\"],\n\t\t\t};\n\n\t\t\tvar tempMatrix = new THREE.Matrix4();\n\t\t\tvar worldRotation = new THREE.Euler( 0, 0, 1 );\n\t\t\tvar tempQuaternion = new THREE.Quaternion();\n\t\t\tvar unitX = new THREE.Vector3( 1, 0, 0 );\n\t\t\tvar unitY = new THREE.Vector3( 0, 1, 0 );\n\t\t\tvar unitZ = new THREE.Vector3( 0, 0, 1 );\n\t\t\tvar quaternionX = new THREE.Quaternion();\n\t\t\tvar quaternionY = new THREE.Quaternion();\n\t\t\tvar quaternionZ = new THREE.Quaternion();\n\t\t\tvar eye = eye2.clone();\n\n\t\t\tworldRotation.copy( this.planes[\"XY\"].rotation );\n\t\t\ttempQuaternion.setFromEuler( worldRotation );\n\n\t\t\ttempMatrix.makeRotationFromQuaternion( tempQuaternion ).getInverse( tempMatrix );\n\t\t\teye.applyMatrix4( tempMatrix );\n\n\t\t\tthis.traverse(function(child) {\n\n\t\t\t\ttempQuaternion.setFromEuler( worldRotation );\n\n\t\t\t\tif ( child.name == \"X\" ) {\n\t\t\t\t\tquaternionX.setFromAxisAngle( unitX, Math.atan2( -eye.y, eye.z ) );\n\t\t\t\t\ttempQuaternion.multiplyQuaternions( tempQuaternion, quaternionX );\n\t\t\t\t\tchild.quaternion.copy( tempQuaternion );\n\t\t\t\t}\n\n\t\t\t\tif ( child.name == \"Y\" ) {\n\t\t\t\t\tquaternionY.setFromAxisAngle( unitY, Math.atan2( eye.x, eye.z ) );\n\t\t\t\t\ttempQuaternion.multiplyQuaternions( tempQuaternion, quaternionY );\n\t\t\t\t\tchild.quaternion.copy( tempQuaternion );\n\t\t\t\t}\n\n\t\t\t\tif ( child.name == \"Z\" ) {\n\t\t\t\t\tquaternionZ.setFromAxisAngle( unitZ, Math.atan2( eye.y, eye.x ) );\n\t\t\t\t\ttempQuaternion.multiplyQuaternions( tempQuaternion, quaternionZ );\n\t\t\t\t\tchild.quaternion.copy( tempQuaternion );\n\t\t\t\t}\n\n\t\t\t});\n\n\t\t};\n\n\t\tthis.init();\n\n\t};\n\n\tTHREE.TransformGizmoRotate.prototype = Object.create( THREE.TransformGizmo.prototype );\n\n\tTHREE.TransformGizmoScale = function () {\n\n\t\tTHREE.TransformGizmo.call( this );\n\n\t\tvar arrowGeometry = new THREE.Geometry();\n\t\tvar mesh = new THREE.Mesh( new THREE.BoxGeometry( 0.125, 0.125, 0.125 ) );\n\t\tmesh.position.y = 0.5;\n\t\tmesh.updateMatrix();\n\n\t\tarrowGeometry.merge( mesh.geometry, mesh.matrix );\n\n\t\tvar lineXGeometry = new THREE.Geometry();\n\t\tlineXGeometry.vertices.push( new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 1, 0, 0 ) );\n\n\t\tvar lineYGeometry = new THREE.Geometry();\n\t\tlineYGeometry.vertices.push( new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 0, 1, 0 ) );\n\n\t\tvar lineZGeometry = new THREE.Geometry();\n\t\tlineZGeometry.vertices.push( new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 0, 0, 1 ) );\n\n\t\tthis.handleGizmos = {\n\t\t\tX: [\n\t\t\t\t[ new THREE.Mesh( arrowGeometry, new GizmoMaterial( { color: 0xff0000 } ) ), [ 0.5, 0, 0 ], [ 0, 0, -Math.PI/2 ] ],\n\t\t\t\t[ new THREE.Line( lineXGeometry, new GizmoLineMaterial( { color: 0xff0000 } ) ) ]\n\t\t\t],\n\t\t\tY: [\n\t\t\t\t[ new THREE.Mesh( arrowGeometry, new GizmoMaterial( { color: 0x00ff00 } ) ), [ 0, 0.5, 0 ] ],\n\t\t\t\t[ new THREE.Line( lineYGeometry, new GizmoLineMaterial( { color: 0x00ff00 } ) ) ]\n\t\t\t],\n\t\t\tZ: [\n\t\t\t\t[ new THREE.Mesh( arrowGeometry, new GizmoMaterial( { color: 0x0000ff } ) ), [ 0, 0, 0.5 ], [ Math.PI/2, 0, 0 ] ],\n\t\t\t\t[ new THREE.Line( lineZGeometry, new GizmoLineMaterial( { color: 0x0000ff } ) ) ]\n\t\t\t],\n\t\t\tXYZ: [\n\t\t\t\t[ new THREE.Mesh( new THREE.BoxGeometry( 0.125, 0.125, 0.125 ), new GizmoMaterial( { color: 0xffffff, opacity: 0.25 } ) ) ]\n\t\t\t]\n\t\t};\n\n\t\tthis.pickerGizmos = {\n\t\t\tX: [\n\t\t\t\t[ new THREE.Mesh( new THREE.CylinderGeometry( 0.2, 0, 1, 4, 1, false ), new GizmoMaterial( { color: 0xff0000, opacity: 0.25 } ) ), [ 0.6, 0, 0 ], [ 0, 0, -Math.PI/2 ] ]\n\t\t\t],\n\t\t\tY: [\n\t\t\t\t[ new THREE.Mesh( new THREE.CylinderGeometry( 0.2, 0, 1, 4, 1, false ), new GizmoMaterial( { color: 0x00ff00, opacity: 0.25 } ) ), [ 0, 0.6, 0 ] ]\n\t\t\t],\n\t\t\tZ: [\n\t\t\t\t[ new THREE.Mesh( new THREE.CylinderGeometry( 0.2, 0, 1, 4, 1, false ), new GizmoMaterial( { color: 0x0000ff, opacity: 0.25 } ) ), [ 0, 0, 0.6 ], [ Math.PI/2, 0, 0 ] ]\n\t\t\t],\n\t\t\tXYZ: [\n\t\t\t\t[ new THREE.Mesh( new THREE.BoxGeometry( 0.4, 0.4, 0.4 ), new GizmoMaterial( { color: 0xffffff, opacity: 0.25 } ) ) ]\n\t\t\t]\n\t\t};\n\n\t\tthis.setActivePlane = function ( axis, eye ) {\n\n\t\t\tvar tempMatrix = new THREE.Matrix4();\n\t\t\teye.applyMatrix4( tempMatrix.getInverse( tempMatrix.extractRotation( this.planes[ \"XY\" ].matrixWorld ) ) );\n\n\t\t\tif ( axis == \"X\" ) {\n\t\t\t\tthis.activePlane = this.planes[ \"XY\" ];\n\t\t\t\tif ( Math.abs(eye.y) > Math.abs(eye.z) ) this.activePlane = this.planes[ \"XZ\" ];\n\t\t\t}\n\n\t\t\tif ( axis == \"Y\" ){\n\t\t\t\tthis.activePlane = this.planes[ \"XY\" ];\n\t\t\t\tif ( Math.abs(eye.x) > Math.abs(eye.z) ) this.activePlane = this.planes[ \"YZ\" ];\n\t\t\t}\n\n\t\t\tif ( axis == \"Z\" ){\n\t\t\t\tthis.activePlane = this.planes[ \"XZ\" ];\n\t\t\t\tif ( Math.abs(eye.x) > Math.abs(eye.y) ) this.activePlane = this.planes[ \"YZ\" ];\n\t\t\t}\n\n\t\t\tif ( axis == \"XYZ\" ) this.activePlane = this.planes[ \"XYZE\" ];\n\n\t\t\tthis.hide();\n\t\t\tthis.show();\n\n\t\t};\n\n\t\tthis.init();\n\n\t};\n\n\tTHREE.TransformGizmoScale.prototype = Object.create( THREE.TransformGizmo.prototype );\n\n\tTHREE.TransformControls = function ( camera, domElement ) {\n\n\t\t// TODO: Make non-uniform scale and rotate play nice in hierarchies\n\t\t// TODO: ADD RXYZ contol\n\n\t\tTHREE.Object3D.call( this );\n\n\t\tdomElement = ( domElement !== undefined ) ? domElement : document;\n\n\t\tthis.gizmo = {};\n\t\tthis.gizmo[\"translate\"] = new THREE.TransformGizmoTranslate();\n\t\tthis.gizmo[\"rotate\"] = new THREE.TransformGizmoRotate();\n\t\tthis.gizmo[\"scale\"] = new THREE.TransformGizmoScale();\n\n\t\tthis.add(this.gizmo[\"translate\"]);\n\t\tthis.add(this.gizmo[\"rotate\"]);\n\t\tthis.add(this.gizmo[\"scale\"]);\n\n\t\tthis.gizmo[\"translate\"].hide();\n\t\tthis.gizmo[\"rotate\"].hide();\n\t\tthis.gizmo[\"scale\"].hide();\n\n\t\tthis.object = undefined;\n\t\tthis.snap = null;\n\t\tthis.space = \"world\";\n\t\tthis.size = 1;\n\t\tthis.axis = null;\n\n\t\tvar scope = this;\n\t\t\n\t\tvar _dragging = false;\n\t\tvar _mode = \"translate\";\n\t\tvar _plane = \"XY\";\n\n\t\tvar changeEvent = { type: \"change\" };\n\n\t\tvar ray = new THREE.Raycaster();\n\t\tvar projector = new THREE.Projector();\n\t\tvar pointerVector = new THREE.Vector3();\n\n\t\tvar point = new THREE.Vector3();\n\t\tvar offset = new THREE.Vector3();\n\n\t\tvar rotation = new THREE.Vector3();\n\t\tvar offsetRotation = new THREE.Vector3();\n\t\tvar scale = 1;\n\n\t\tvar lookAtMatrix = new THREE.Matrix4();\n\t\tvar eye = new THREE.Vector3();\n\n\t\tvar tempMatrix = new THREE.Matrix4();\n\t\tvar tempVector = new THREE.Vector3();\n\t\tvar tempQuaternion = new THREE.Quaternion();\n\t\tvar unitX = new THREE.Vector3( 1, 0, 0 );\n\t\tvar unitY = new THREE.Vector3( 0, 1, 0 );\n\t\tvar unitZ = new THREE.Vector3( 0, 0, 1 );\n\n\t\tvar quaternionXYZ = new THREE.Quaternion();\n\t\tvar quaternionX = new THREE.Quaternion();\n\t\tvar quaternionY = new THREE.Quaternion();\n\t\tvar quaternionZ = new THREE.Quaternion();\n\t\tvar quaternionE = new THREE.Quaternion();\n\n\t\tvar oldPosition = new THREE.Vector3();\n\t\tvar oldScale = new THREE.Vector3();\n\t\tvar oldRotationMatrix = new THREE.Matrix4();\n\n\t\tvar parentRotationMatrix  = new THREE.Matrix4();\n\t\tvar parentScale = new THREE.Vector3();\n\n\t\tvar worldPosition = new THREE.Vector3();\n\t\tvar worldRotation = new THREE.Euler();\n\t\tvar worldRotationMatrix  = new THREE.Matrix4();\n\t\tvar camPosition = new THREE.Vector3();\n\t\tvar camRotation = new THREE.Euler();\n\n\t\tdomElement.addEventListener( \"mousedown\", onPointerDown, false );\n\t\tdomElement.addEventListener( \"touchstart\", onPointerDown, false );\n\n\t\tdomElement.addEventListener( \"mousemove\", onPointerHover, false );\n\t\tdomElement.addEventListener( \"touchmove\", onPointerHover, false );\n\n\t\tdomElement.addEventListener( \"mousemove\", onPointerMove, false );\n\t\tdomElement.addEventListener( \"touchmove\", onPointerMove, false );\n\n\t\tdomElement.addEventListener( \"mouseup\", onPointerUp, false );\n\t\tdomElement.addEventListener( \"mouseout\", onPointerUp, false );\n\t\tdomElement.addEventListener( \"touchend\", onPointerUp, false );\n\t\tdomElement.addEventListener( \"touchcancel\", onPointerUp, false );\n\t\tdomElement.addEventListener( \"touchleave\", onPointerUp, false );\n\n\t\tthis.attach = function ( object ) {\n\n\t\t\tscope.object = object;\n\n\t\t\tthis.gizmo[\"translate\"].hide();\n\t\t\tthis.gizmo[\"rotate\"].hide();\n\t\t\tthis.gizmo[\"scale\"].hide();\n\t\t\tthis.gizmo[_mode].show();\n\n\t\t\tscope.update();\n\n\t\t};\n\n\t\tthis.detach = function ( object ) {\n\n\t\t\tscope.object = undefined;\n\t\t\tthis.axis = undefined;\n\n\t\t\tthis.gizmo[\"translate\"].hide();\n\t\t\tthis.gizmo[\"rotate\"].hide();\n\t\t\tthis.gizmo[\"scale\"].hide();\n\n\t\t};\n\n\t\tthis.setMode = function ( mode ) {\n\n\t\t\t_mode = mode ? mode : _mode;\n\n\t\t\tif ( _mode == \"scale\" ) scope.space = \"local\";\n\n\t\t\tthis.gizmo[\"translate\"].hide();\n\t\t\tthis.gizmo[\"rotate\"].hide();\n\t\t\tthis.gizmo[\"scale\"].hide();\t\n\t\t\tthis.gizmo[_mode].show();\n\n\t\t\tthis.update();\n\t\t\tscope.dispatchEvent( changeEvent );\n\n\t\t};\n\n\t\tthis.setSnap = function ( snap ) {\n\n\t\t\tscope.snap = snap;\n\n\t\t};\n\n\t\tthis.setSize = function ( size ) {\n\n\t\t\tscope.size = size;\n\t\t\tthis.update();\n\t\t\tscope.dispatchEvent( changeEvent );\n\t\t\t\n\t\t};\n\n\t\tthis.setSpace = function ( space ) {\n\n\t\t\tscope.space = space;\n\t\t\tthis.update();\n\t\t\tscope.dispatchEvent( changeEvent );\n\n\t\t};\n\n\t\tthis.update = function () {\n\n\t\t\tif ( scope.object === undefined ) return;\n\n\t\t\tscope.object.updateMatrixWorld();\n\t\t\tworldPosition.setFromMatrixPosition( scope.object.matrixWorld );\n\t\t\tworldRotation.setFromRotationMatrix( tempMatrix.extractRotation( scope.object.matrixWorld ) );\n\n\t\t\tcamera.updateMatrixWorld();\n\t\t\tcamPosition.setFromMatrixPosition( camera.matrixWorld );\n\t\t\tcamRotation.setFromRotationMatrix( tempMatrix.extractRotation( camera.matrixWorld ) );\n\n\t\t\tscale = worldPosition.distanceTo( camPosition ) / 6 * scope.size;\n\t\t\tthis.position.copy( worldPosition );\n\t\t\tthis.scale.set( scale, scale, scale );\n\n\t\t\teye.copy( camPosition ).sub( worldPosition ).normalize();\n\n\t\t\tif ( scope.space == \"local\" )\n\t\t\t\tthis.gizmo[_mode].update( worldRotation, eye );\n\n\t\t\telse if ( scope.space == \"world\" )\n\t\t\t\tthis.gizmo[_mode].update( new THREE.Euler(), eye );\n\n\t\t\tthis.gizmo[_mode].highlight( scope.axis );\n\n\t\t};\n\n\t\tfunction onPointerHover( event ) {\n\n\t\t\tif ( scope.object === undefined || _dragging === true ) return;\n\n\t\t\tevent.preventDefault();\n\n\t\t\tvar pointer = event.changedTouches ? event.changedTouches[ 0 ] : event;\n\n\t\t\tvar intersect = intersectObjects( pointer, scope.gizmo[_mode].pickers.children );\n\n\t\t\tif ( intersect ) {\n\n\t\t\t\tscope.axis = intersect.object.name;\n\t\t\t\tscope.update();\n\t\t\t\tscope.dispatchEvent( changeEvent );\n\n\t\t\t} else if ( scope.axis !== null ) {\n\n\t\t\t\tscope.axis = null;\n\t\t\t\tscope.update();\n\t\t\t\tscope.dispatchEvent( changeEvent );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction onPointerDown( event ) {\n\n\t\t\tif ( scope.object === undefined || _dragging === true ) return;\n\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\n\t\t\tvar pointer = event.changedTouches ? event.changedTouches[ 0 ] : event;\n\n\t\t\tif ( pointer.button === 0 || pointer.button === undefined ) {\n\n\t\t\t\tvar intersect = intersectObjects( pointer, scope.gizmo[_mode].pickers.children );\n\n\t\t\t\tif ( intersect ) {\n\n\t\t\t\t\tscope.axis = intersect.object.name;\n\n\t\t\t\t\tscope.update();\n\n\t\t\t\t\teye.copy( camPosition ).sub( worldPosition ).normalize();\n\n\t\t\t\t\tscope.gizmo[_mode].setActivePlane( scope.axis, eye );\n\n\t\t\t\t\tvar planeIntersect = intersectObjects( pointer, [scope.gizmo[_mode].activePlane] );\n\n\t\t\t\t\toldPosition.copy( scope.object.position );\n\t\t\t\t\toldScale.copy( scope.object.scale );\n\n\t\t\t\t\toldRotationMatrix.extractRotation( scope.object.matrix );\n\t\t\t\t\tworldRotationMatrix.extractRotation( scope.object.matrixWorld );\n\n\t\t\t\t\tparentRotationMatrix.extractRotation( scope.object.parent.matrixWorld );\n\t\t\t\t\tparentScale.setFromMatrixScale( tempMatrix.getInverse( scope.object.parent.matrixWorld ) );\n\n\t\t\t\t\toffset.copy( planeIntersect.point );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t_dragging = true;\n\n\t\t}\n\n\t\tfunction onPointerMove( event ) {\n\n\t\t\tif ( scope.object === undefined || scope.axis === null || _dragging === false ) return;\n\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\n\t\t\tvar pointer = event.changedTouches? event.changedTouches[0] : event;\n\n\t\t\tvar planeIntersect = intersectObjects( pointer, [scope.gizmo[_mode].activePlane] );\n\n\t\t\tpoint.copy( planeIntersect.point );\n\n\t\t\tif ( _mode == \"translate\" ) {\n\n\t\t\t\tpoint.sub( offset );\n\t\t\t\tpoint.multiply(parentScale);\n\n\t\t\t\tif ( scope.space == \"local\" ) {\n\n\t\t\t\t\tpoint.applyMatrix4( tempMatrix.getInverse( worldRotationMatrix ) );\n\n\t\t\t\t\tif ( scope.axis.search(\"X\") == -1 ) point.x = 0;\n\t\t\t\t\tif ( scope.axis.search(\"Y\") == -1 ) point.y = 0;\n\t\t\t\t\tif ( scope.axis.search(\"Z\") == -1 ) point.z = 0;\n\n\t\t\t\t\tpoint.applyMatrix4( oldRotationMatrix );\n\n\t\t\t\t\tscope.object.position.copy( oldPosition );\n\t\t\t\t\tscope.object.position.add( point );\n\n\t\t\t\t} \n\n\t\t\t\tif ( scope.space == \"world\" || scope.axis.search(\"XYZ\") != -1 ) {\n\n\t\t\t\t\tif ( scope.axis.search(\"X\") == -1 ) point.x = 0;\n\t\t\t\t\tif ( scope.axis.search(\"Y\") == -1 ) point.y = 0;\n\t\t\t\t\tif ( scope.axis.search(\"Z\") == -1 ) point.z = 0;\n\n\t\t\t\t\tpoint.applyMatrix4( tempMatrix.getInverse( parentRotationMatrix ) );\n\n\t\t\t\t\tscope.object.position.copy( oldPosition );\n\t\t\t\t\tscope.object.position.add( point );\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( scope.snap !== null ) {\n\t\t\t\t\n\t\t\t\t\tif ( scope.axis.search(\"X\") != -1 ) scope.object.position.x = Math.round( scope.object.position.x / scope.snap ) * scope.snap;\n\t\t\t\t\tif ( scope.axis.search(\"Y\") != -1 ) scope.object.position.y = Math.round( scope.object.position.y / scope.snap ) * scope.snap;\n\t\t\t\t\tif ( scope.axis.search(\"Z\") != -1 ) scope.object.position.z = Math.round( scope.object.position.z / scope.snap ) * scope.snap;\n\t\t\t\t\n\t\t\t\t}\n\n\t\t\t} else if ( _mode == \"scale\" ) {\n\n\t\t\t\tpoint.sub( offset );\n\t\t\t\tpoint.multiply(parentScale);\n\n\t\t\t\tif ( scope.space == \"local\" ) {\n\n\t\t\t\t\tif ( scope.axis == \"XYZ\") {\n\n\t\t\t\t\t\tscale = 1 + ( ( point.y ) / 50 );\n\n\t\t\t\t\t\tscope.object.scale.x = oldScale.x * scale;\n\t\t\t\t\t\tscope.object.scale.y = oldScale.y * scale;\n\t\t\t\t\t\tscope.object.scale.z = oldScale.z * scale;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tpoint.applyMatrix4( tempMatrix.getInverse( worldRotationMatrix ) );\n\n\t\t\t\t\t\tif ( scope.axis == \"X\" ) scope.object.scale.x = oldScale.x * ( 1 + point.x / 50 );\n\t\t\t\t\t\tif ( scope.axis == \"Y\" ) scope.object.scale.y = oldScale.y * ( 1 + point.y / 50 );\n\t\t\t\t\t\tif ( scope.axis == \"Z\" ) scope.object.scale.z = oldScale.z * ( 1 + point.z / 50 );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else if ( _mode == \"rotate\" ) {\n\n\t\t\t\tpoint.sub( worldPosition );\n\t\t\t\tpoint.multiply(parentScale);\n\t\t\t\ttempVector.copy(offset).sub( worldPosition );\n\t\t\t\ttempVector.multiply(parentScale);\n\n\t\t\t\tif ( scope.axis == \"E\" ) {\n\n\t\t\t\t\tpoint.applyMatrix4( tempMatrix.getInverse( lookAtMatrix ) );\n\t\t\t\t\ttempVector.applyMatrix4( tempMatrix.getInverse( lookAtMatrix ) );\n\n\t\t\t\t\trotation.set( Math.atan2( point.z, point.y ), Math.atan2( point.x, point.z ), Math.atan2( point.y, point.x ) );\n\t\t\t\t\toffsetRotation.set( Math.atan2( tempVector.z, tempVector.y ), Math.atan2( tempVector.x, tempVector.z ), Math.atan2( tempVector.y, tempVector.x ) );\n\n\t\t\t\t\ttempQuaternion.setFromRotationMatrix( tempMatrix.getInverse( parentRotationMatrix ) );\n\n\t\t\t\t\tquaternionE.setFromAxisAngle( eye, rotation.z - offsetRotation.z );\n\t\t\t\t\tquaternionXYZ.setFromRotationMatrix( worldRotationMatrix );\n\n\t\t\t\t\ttempQuaternion.multiplyQuaternions( tempQuaternion, quaternionE );\n\t\t\t\t\ttempQuaternion.multiplyQuaternions( tempQuaternion, quaternionXYZ );\n\n\t\t\t\t\tscope.object.quaternion.copy( tempQuaternion );\n\n\t\t\t\t} else if ( scope.axis == \"XYZE\" ) {\n\n\t\t\t\t\tquaternionE.setFromEuler( point.clone().cross(tempVector).normalize() ); // rotation axis\n\n\t\t\t\t\ttempQuaternion.setFromRotationMatrix( tempMatrix.getInverse( parentRotationMatrix ) );\n\t\t\t\t\tquaternionX.setFromAxisAngle( quaternionE, - point.clone().angleTo(tempVector) );\n\t\t\t\t\tquaternionXYZ.setFromRotationMatrix( worldRotationMatrix );\n\n\t\t\t\t\ttempQuaternion.multiplyQuaternions( tempQuaternion, quaternionX );\n\t\t\t\t\ttempQuaternion.multiplyQuaternions( tempQuaternion, quaternionXYZ );\n\n\t\t\t\t\tscope.object.quaternion.copy( tempQuaternion );\n\n\t\t\t\t} else if ( scope.space == \"local\" ) {\n\n\t\t\t\t\tpoint.applyMatrix4( tempMatrix.getInverse( worldRotationMatrix ) );\n\n\t\t\t\t\ttempVector.applyMatrix4( tempMatrix.getInverse( worldRotationMatrix ) );\n\n\t\t\t\t\trotation.set( Math.atan2( point.z, point.y ), Math.atan2( point.x, point.z ), Math.atan2( point.y, point.x ) );\n\t\t\t\t\toffsetRotation.set( Math.atan2( tempVector.z, tempVector.y ), Math.atan2( tempVector.x, tempVector.z ), Math.atan2( tempVector.y, tempVector.x ) );\n\n\t\t\t\t\tquaternionXYZ.setFromRotationMatrix( oldRotationMatrix );\n\t\t\t\t\tquaternionX.setFromAxisAngle( unitX, rotation.x - offsetRotation.x );\n\t\t\t\t\tquaternionY.setFromAxisAngle( unitY, rotation.y - offsetRotation.y );\n\t\t\t\t\tquaternionZ.setFromAxisAngle( unitZ, rotation.z - offsetRotation.z );\n\n\t\t\t\t\tif ( scope.axis == \"X\" ) quaternionXYZ.multiplyQuaternions( quaternionXYZ, quaternionX );\n\t\t\t\t\tif ( scope.axis == \"Y\" ) quaternionXYZ.multiplyQuaternions( quaternionXYZ, quaternionY );\n\t\t\t\t\tif ( scope.axis == \"Z\" ) quaternionXYZ.multiplyQuaternions( quaternionXYZ, quaternionZ );\n\n\t\t\t\t\tscope.object.quaternion.copy( quaternionXYZ );\n\n\t\t\t\t} else if ( scope.space == \"world\" ) {\n\n\t\t\t\t\trotation.set( Math.atan2( point.z, point.y ), Math.atan2( point.x, point.z ), Math.atan2( point.y, point.x ) );\n\t\t\t\t\toffsetRotation.set( Math.atan2( tempVector.z, tempVector.y ), Math.atan2( tempVector.x, tempVector.z ), Math.atan2( tempVector.y, tempVector.x ) );\n\n\t\t\t\t\ttempQuaternion.setFromRotationMatrix( tempMatrix.getInverse( parentRotationMatrix ) );\n\n\t\t\t\t\tquaternionX.setFromAxisAngle( unitX, rotation.x - offsetRotation.x );\n\t\t\t\t\tquaternionY.setFromAxisAngle( unitY, rotation.y - offsetRotation.y );\n\t\t\t\t\tquaternionZ.setFromAxisAngle( unitZ, rotation.z - offsetRotation.z );\n\t\t\t\t\tquaternionXYZ.setFromRotationMatrix( worldRotationMatrix );\n\n\t\t\t\t\tif ( scope.axis == \"X\" ) tempQuaternion.multiplyQuaternions( tempQuaternion, quaternionX );\n\t\t\t\t\tif ( scope.axis == \"Y\" ) tempQuaternion.multiplyQuaternions( tempQuaternion, quaternionY );\n\t\t\t\t\tif ( scope.axis == \"Z\" ) tempQuaternion.multiplyQuaternions( tempQuaternion, quaternionZ );\n\n\t\t\t\t\ttempQuaternion.multiplyQuaternions( tempQuaternion, quaternionXYZ );\n\n\t\t\t\t\tscope.object.quaternion.copy( tempQuaternion );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tscope.update();\n\t\t\tscope.dispatchEvent( changeEvent );\n\n\t\t}\n\n\t\tfunction onPointerUp( event ) {\n\n\t\t\t_dragging = false;\n\t\t\tonPointerHover( event );\n\n\t\t}\n\n\t\tfunction intersectObjects( pointer, objects ) {\n\n\t\t\tvar rect = domElement.getBoundingClientRect();\n\t\t\tvar x = (pointer.clientX - rect.left) / rect.width;\n\t\t\tvar y = (pointer.clientY - rect.top) / rect.height;\n\t\t\tpointerVector.set( ( x ) * 2 - 1, - ( y ) * 2 + 1, 0.5 );\n\n\t\t\tprojector.unprojectVector( pointerVector, camera );\n\t\t\tray.set( camPosition, pointerVector.sub( camPosition ).normalize() );\n\n\t\t\tvar intersections = ray.intersectObjects( objects, true );\n\t\t\treturn intersections[0] ? intersections[0] : false;\n\n\t\t}\n\n\t};\n\n\tTHREE.TransformControls.prototype = Object.create( THREE.Object3D.prototype );\n\n}());"
        },
        "$:/plugins/rboue/Three.js/Lib/Controls/VRControls.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Controls/VRControls.js",
            "module-type": "library",
            "text": "/**\n * @author dmarcos / https://github.com/dmarcos\n */\n\nTHREE.VRControls = function ( camera, done ) {\n\n\tthis._camera = camera;\n\n\tthis._init = function () {\n\t\tvar self = this;\n\t\tif ( !navigator.mozGetVRDevices && !navigator.getVRDevices ) {\n\t\t\tif ( done ) {\n\t\t\t\tdone(\"Your browser is not VR Ready\");\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif ( navigator.getVRDevices ) {\n\t\t\tnavigator.getVRDevices().then( gotVRDevices );\n\t\t} else {\n\t\t\tnavigator.mozGetVRDevices( gotVRDevices );\n\t\t}\n\t\tfunction gotVRDevices( devices ) {\n\t\t\tvar vrInput;\n\t\t\tvar error;\n\t\t\tfor ( var i = 0; i < devices.length; ++i ) {\n\t\t\t\tif ( devices[i] instanceof PositionSensorVRDevice ) {\n\t\t\t\t\tvrInput = devices[i]\n\t\t\t\t\tself._vrInput = vrInput;\n\t\t\t\t\tbreak; // We keep the first we encounter\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( done ) {\n\t\t\t\tif ( !vrInput ) {\n\t\t\t\t error = 'HMD not available';\n\t\t\t\t}\n\t\t\t\tdone( error );\n\t\t\t}\n\t\t}\n\t};\n\n\tthis._init();\n\n\tthis.update = function() {\n\t\tvar camera = this._camera;\n\t\tvar quat;\n\t\tvar vrState = this.getVRState();\n\t\tif ( !vrState ) {\n\t\t\treturn;\n\t\t}\n\t\t// Applies head rotation from sensors data.\n\t\tif ( camera ) {\n\t\t\tcamera.quaternion.fromArray( vrState.hmd.rotation );\n\t\t}\n\t};\n\n\tthis.getVRState = function() {\n\t\tvar vrInput = this._vrInput;\n\t\tvar orientation;\n\t\tvar vrState;\n\t\tif ( !vrInput ) {\n\t\t\treturn null;\n\t\t}\n\t\torientation\t= vrInput.getState().orientation;\n\t\tvrState = {\n\t\t\thmd : {\n\t\t\t\trotation : [\n\t\t\t\t\torientation.x,\n\t\t\t\t\torientation.y,\n\t\t\t\t\torientation.z,\n\t\t\t\t\torientation.w\n\t\t\t\t]\n\t\t\t}\n\t\t};\n\t\treturn vrState;\n\t};\n\n};"
        },
        "$:/plugins/rboue/Three.js/config.json": {
            "title": "$:/plugins/rboue/Three.js/config.json",
            "type": "application/json",
            "text": "{\n\"\":\"Actually nothing.\",\n\n\"\":\"\"\n}"
        },
        "$:/plugins/rboue/Three.js/icon": {
            "created": "20150122113649353",
            "modified": "20150122113650949",
            "title": "$:/plugins/rboue/Three.js/icon",
            "type": "image/png",
            "text": "iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QA/wD/AP+gvaeTAAAACXBI\nWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wMRCAYZvJsQjgAAABl0RVh0Q29tbWVudABDcmVhdGVk\nIHdpdGggR0lNUFeBDhcAABHaSURBVHja7Z15VJNX3se/N7IoWElQgwiEVUBZBJdSSweFEZdaWjew\nIrZqO9O302l9562n9cx5zxydMzOnp6eli+2r09KilipuoxVKlUarUOqGBRcUiBKIiQjGLEAggZD7\n/kHTwRGyB7I837845Fnuc3+f53eX53d/l1BK4UqilOLBgwdob2+HQqGAQqGAUqmEWq2GUDMxPFWe\n22To/CrOvohw7wfCsWPHgs1mw8/PD2w2GwEBAfD39wchxKXqizg7ACqVCiKRCCKRCGKxGMHtm+36\nQGLuRyQ4OBihoaEICQmBr68vA8BISqfTQSQSQSAQoPJ2j9E32t4Sct4jUVFRiIqKAo/HA4vFYgCw\nh1tvampCXV0dvOtyHbrAvfH7SVxcHMLDw52iuXBoANra2nDp0iV4XnveKdupvoRiMnfuXAQEBDAA\nmOVWhUKcO3cOE1t+7xI9VFnY52TevHkICwtjADDk5uvr61FRUYEw2ZuuNTT5RS0T80laWhpiYmIc\npnlwCAAaGxvxww8/uKzhhwIhPT0d06ZNc28A7ty5gxMnToAn/ZNbGP6R55/8IVmyZAmCg4PdC4De\n3l6cOnUKrNpstzT8I5p1hGRkZMDT09P1ARAIBGg6nMwYfghF5VwhkZGRrgmAWq1GSUkJJtzayBjf\ngLpjvyLLli2Dl5fXiNxvRKat2trasL3wdD5jfOPyqV9P//blifD79++7hgeoqalB+4nfMIa3QAFL\nfyRJSUnOCQClFHw+H7rqFYzxrZBnynGSnp5ut3kDuzQBWq0WBw4cYIxvA/VdeJYePHgQWq3WOQDQ\naDQoKioCR/gyY3wbid30Ev3666+h0WgcG4DOzk78vfBkeGDrHxnj21hT7r5G/154Mryzs9MxAVAq\nlTh6dOfPo/193pWVKs9t+kdRZX5HR4djdQK7urpQtWMK89aPJAyv3yPjx48ffQ+gVqvxbtHpcMYk\nI6t3i06Hq9Xq0fUAWq0WRUVFYNr80dG9qZ+SdevWwcPDY+Q9gE6nw6FDhxjjj3LH8PDhw7DmJbbY\nA5SXl4NeXskY3wHkmXKcZGRkjJwHqKmpYYzvQOq78Cytr68fGQDa29uZuX0HVMvROdSSOQKzAOjr\n68MHR6rzmep2TB04cAD9/f326wOUlZVhzJUc5u13YLHmHCWZmZm29wDNzc2M8Z1AuuoV9M6dO7YF\noLe3Fw374xnjO4l2fXslT6fT2a4J4PP56L+0nAFgBNXs/z6ZPn06OBwOfHx80N/fD5VKBbFYDK/r\na43awi+dT5544gnrAWhvb0fNFxEuZ3wx9yPC5XIxbtw4AAMBLDKZDOyml0b1WaW8f5KFCxciICBg\n2HJQSnH16lVyryzVYFlTXhUTNpttHQB79+5FgOQPLgFA57TdJD4+HhEREdRQ0KVUKs2pr68/pKpc\nMqLPHZR1nsTHm97UarVafPPNN2R844tDnqOM/JLk5ORYDsDt27dx6+BMpzd+R1QhycjIeHvixInv\nmNWh0ulQU1NDpOXz7V4HcevrSXBwsNn3+SX0jgwXfRWz9joxtCaRZejCe76vc/qvfNwllSQ7O5ua\na3wAYLFYmD17Nn3qjTa0Bn5it8V8kdm1FhkfAAghWLhwIe2K3jNk+U6dOmWZB6irq4P4eIpTv/0z\nN94iU6bYJk6BUopTp04RW3eGe6YXkeXLl9O+vj6cPHmSnD17Fh0dHQgMDMTSpUuRkmKaDdRqNc5+\nMGnI32Jz60hoaKh5AOzatQvh8i1OC0DyS03+XC5XZuvrlpaWElvmK0h5VUxqa2vxyiuvoLGx8ZHr\nLly4kBQUFCA0NNToPX/88UcyVL9FyvsnWbdunekA3Lp1C7cPJTmt8X9ZYmWX8ut0OhQVFRFbdIxl\nYZ8THx8frF69mhqK+p00aVLOhQsXDkVEGB6N9fT0oOLDyUP+NiPvJgkJCTGtD3D+/Hnn9fuzjjxk\n/I6ODpSXl5Pdu3eTvXv3kjNnzhBrImlYLBZWrVplE7i4XC42bNhw21jIt1QqPfjCCy8Y/e4/btw4\nSAI+HrIvUFVVZVonUCaTYfKd/3Lat3/+/IEee01NDVmxYgXhcrlYvHgx3bhxI33xxRdpeno65XK5\n2LRpExEKhRZ17Hx9feHz1HdWdwq1F5+jCoUiwpRjq6qqKJ/PN3rPwMDAIf/PEb5M5XK5cQCqq6ud\n9uUf++S3xNvbG9u3bydz5syhx44do0PF0nd2dqKwsJBOnz6d7tmzxyJDmto5M6StB6eZde+ysjKj\nxzz22GPD/nb58mXDAPT39zt1oMfcuXOxZcsWsm3bNmrKXLhGo8HGjRvpzp07zYbAy8sLZPa/rPIC\nYrE425zjm5ubjR5jKD6w/9LyR+rlIQAEAoHTvv13p+wgx44dQ35+vlkAU0qxefNmev78ebONGRsb\na1WZvb29D5lzvI+Pj9FjjAWF3Lp1a3gA6urqnBYAHo+HLVu2WHRuX18fXn/9dbODKy2dvNHL3BxB\niYmJxkcWMsMj3xs3bgwNgFarxXBzys4g7cXnaGtrq8Xlr66uNtsLsFgstAfvtLgZ2Lroksnl9fLy\nwpo1awzXgVZr9GPWuJt5dHDU0K8ACIVCOLM+PZdhda+8pKTE7HOMfW0zprS0NJPK/dZbb5GwsDBq\nxL2bdK3BfQmWK7T/ANDQ0GD1NSxpAr29va2655tvvomEhASDhsvJySHbtm2jxiaoLl48/rMp9xxs\n618B4PQc6XJmAGQyWba115BKpSNebu+6XFpWVobt27eT4ODgh0CYOXMmKSwsJMXFxXTMmDEGr3Pp\n0iUSIPlrsin3PCvU5T8EgFKpREfjAafOe+7n53fI2mtwOByzz+np6bG67J+V/hy+detW2tLSQhsb\nG0l1dTWRSCSktraWbtiwgRrLDiIUConi9G9N7k8sUOT8Sb/CmAUMJGx0dg03A2aOwsPDLfE8Vt83\nVZ7b9LcvT0R0dHQ0TZs2jc6ePZtOnTrVJINeuXKFNBYnmN35FYvFrgXA/z5dY/UIJisry6zjKaWY\neu91m4ycUuW5TRd2BkfU1taaFKepUqnw7bffGg0LG04ikejfANy9e9fpAajgFK83NA1qTJGRkSQ9\nPd2symxtbbV5kEjbd0/RP+/67oPKykoilUpzBg/Zent70dTUREpLS8mPHwfA4+oai+FrbW0FABCd\nTofydx5zmaDPJX9WWXTewYMHSXa2ealry8vLiTNPnS/a2klYQ30hclbR5MNk6dKlZr+Vr732mtnG\nV6lUTr9AVqlUgjUaQx97idSsprt378amTZtMgoDFYuGdd94hO3bsMNuQFRUVTr99mFQqhUt5AGAg\n8KGgoADFxcUkLCxsWCMlJSURPp9P3n77bWpuEkaZTPaZK2Q6l8vl8FAoFC4FgE/9elpd/QNZs2YN\nzc7Oxrlz50hFRQXu3r0LFosFHo+HzMxMJCYmWmRAjUaD0tKCuQEuUFcKhQIeSqUSfnAtyfjpVDK1\ngQQFBdHU1FSamppqmz4GpSgpKSEBkr+6RKdZqVSC1d3dDVfU9b0xtL6+3mbttEajwb59+8hjgg0u\nM2JSqVRgCdST8uCiajk6h/70009W50JUKBRNe/bsIZNEr7jUGsmenh6QE//wdflVv21Bf6mZM+eZ\nWdOnTzerw9fV1YUzZ84QZ9230KSRkzsAoJeY+xFJTk5GdHQ0HS7LJqUUYrGYXL9+3S32NHIrAAZr\nQvQa1e2e9PH67/mUUiiVSrfbwcxtAWA0IBZTBQwAjBgAGDEAMHJPAKo4+yKYanBPCTnvEVbEWJmQ\nqQr3lI+PD1imrDdj5MIAWLuyhZHzis1mMwAwADAAuDcAkydPZmrCTcXlchkP4M6aMGECWIQQiLkf\nEaY63Et3p+wgwC8zgcHBwUyNuJn0NmcBA+lVGLmX9EkjGQ/AADCQW66CU7yeqRb3kJDzHvH19f03\nAAAwP8KriKka91BUVNSvf3sM/qfgMlM55qot6P+Iv78//Pz84OHhAS8vL3h7e4PFGni3ent7odVq\nodFooNFoIJPJIJfLRzX2cEgAeDweBIw9DUoZ+SUJDQ0Fj8cDl8vV5+2x0JC/Q3d3N8RiMWlpaUFL\nSwtC7v/3iEAxOGv4Q4smjh07hnE385gg0UHSJR0iCQkJVieFNEUajQY3b94k165dA1f8ql3up4nb\nR5599tmhARAIBGg6nOz2AFRwitfnzY8siomJoXpXPtLq6urCuXPnht0LyGL3P7CXwtAA9Pf3g/+u\nn1sDELjsJ5KQkGD2knF7qbOzE2fOnCGm7BVoijLf7iCDoX4I7zFjxsDj8W/cclr43tRPyW82tyMx\nMdFhjK8fomdlZdHQFdVWF8rriRLynx7tEf+WnJzsdsaXhX1O8vLyqCNHR8XGxtL4FxqsgiApKemR\n/z0CgL+/P+ThBW7jBSZEr1GtXr3aaCZOR1BQUBANee6iRbZRRHxBhkqEOWQPx5Q9Z11FPlFvjPf0\n9HSa8s6YMYO2TMw3G4Inn3xyyP8PCUBYWBiEnPfcwgtER0dTJyyzWceLJn0w5I5hwwIAAOnp6W7h\nAcaOHet0ZdZveG2qDNlyWABiYmLcIlBEKpXOcbYy379/3+RjWwM/IYOnfk0GAAAWLFjg8h7g8lBb\naTmwenp6YE7Gkvnz5xv83SAAkZGRLj8iIDWrqUgkcopnpJSirKzM5LJ2x35FjGVANzrPuXjxYpf3\nAje/nkElEglxdOOfPHmSmLOv06JFi4weYxQADoeDMXOPuXxf4PreGFpbW+uQz9nT04P9+/cTUrPa\nZOP7pfN/DfqwCgB9L9IdIobavnuK/mXX8YgbN244BAgajQZ8Pp9UfDgZE1t+b7Lx70z+kKSkpJjW\nBJqaQ6+5uRkN++Pd5kPR/ZBdZNasWYiOjqaGduO0h+RyOf/atWuZPVVPW1Tfw+0UbhUAAMDn89F/\nabnbfS1Uz/iaxMTEgMfj2eV7AaUU7e3tRCgUoq6uDsHtmy2u43GpZSQtLc30TrA5APT396OgoABh\nsjfd9pNxBad4/bxgFHG5XLDZbLDZbA6bzZZ5eXmZZOiuri4oFAqiUCggl8shkUjg3/w7m9Rne/BO\nkpeXB3O+ZpqdRrW9vR01X0QwUUMGAInwbCvy8vICpRRqtRqhD/5nROrryT+2EnO3zbEoj25DQwOa\n/zWbgcCBFJtbR0JDQ80+z6J4p5iYGKu3TmdkO3mmHLfI+BYDAACZmZnQxO1jIBjtoWLcPmLNhzuL\nASCEICsrC4qILxgIRknKyC9JVlYWrAlhsyrklRCCVatW/brUmNHI6e6UHWTlypWwNn7R6phnDw8P\n5Obmuk0AiSOo2f99kpubC1tMUNkk6N3b2xtr165FW9Bfahjz2Fdn2Ac/WLt2rdXb1ls1DBxOarUa\n+/fvt9l+uoweVmvgJ+T555+3aRSTTQEABmYLjxw5Ar/bmxgIbKiOqEKycuVK2Dp62eYAAANTnqWl\npbDVahZ3V19CMVm2bBnssWDFLgDoITh9+jS0F59jILBCXk+UkAULFsBeq5XsBoBeLS0tqN8Xx0Bg\ngeJfaCBBQUF2vYfdAQCA7u5uHD16FK6275699CD0M7J8+XKMxFK1EQFA3yRcvHgRitO/ZSAwIHbG\nKfL4449jpBaojhgAeonFYpSWliJcvoUBYZCa/d8nzzzzDOzt8kcdAL03uHr1Ku6VpTIQAJjydBVJ\nTEzEaCxLHxUA9Orq6sL3338Pn/r1bglCd+xXZNGiRTAletclAdBLIBDg7NmzI5YkabTVMjGfZGRk\nwNCSLbcCQC+hUIjKykoESP5AXdXwaWlpAwE1DpKFxKEA0EsikaCyshIc4csuAYIs7HMyb948hIWF\nOVzZHBIAvTo7O3H16lV0VSx2ShDGp50kM2fOxHA7lTMAmDFqaGpqQl1dHbzrch26wL3x+0lcXBzC\nw8PhSMmmnBqAwdLpdBCJRBAIBKi83ROeKs9tGtV+C+c9EhUVhaioKPB4PIxWXkG3AeA/pVKpIBKJ\nIBKJIJFIENT2hl0fSBLwMQkKCkJoaChCQkJGdQjHADCMOjo6IJVKoVQqoVAooFAo0N3dDZVKZXSR\nRsvEfOLr6wsfHx/9yh+w2WxMmjQJ5i66cAb9P0ino5gBTAIlAAAAAElFTkSuQmCC\n"
        },
        "$:/plugins/rboue/Three.js/license": {
            "title": "$:/plugins/rboue/Three.js/license",
            "text": "!Plugin license\nCopyright (C) 2015 René Boué (rboue) &lt;rboue01 (at) gmail (dot) com&gt;<br>\nAll rights reserved.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see <http://www.gnu.org/licenses/>.\n\n!Three.js r69 license\nThe Three.js r69 LICENSE file is as follows :\n\n```\nThe MIT License\n\nCopyright &copy; 2010-2014 three.js authors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n```"
        },
        "$:/plugins/rboue/Three.js/readme": {
            "title": "$:/plugins/rboue/Three.js/readme",
            "text": "Three.js r69 for ~TiddlyWiki."
        },
        "$:/plugins/rboue/Three.js/tiddlywiki.js": {
            "text": "/*\\\ntitle: $:/plugins/rboue/Three.js/tiddlywiki.js\ntype: application/javascript\nmodule-type: library\n\n  Adaptation of Three.js to TiddlyWiki.\n\n\\*/\n(function() {\n\n  var TiddlyWiki = function(widget, tiddlerTitle, widgetConfiguration) {\n    this.widget = widget; // widget\n    this.tiddlerTitle = tiddlerTitle;   // title of the main code tiddler\n    this.widgetConfiguration = widgetConfiguration; // widget's configuration object\n  };\n\n  // Static members\n\n  // Initialized at TiddlyWiki session opening\n  TiddlyWiki.sessionConfiguration = null; // Session configuration\n\n  // Static initialisations\n  TiddlyWiki.init = function(sessionConfiguration) {\n    TiddlyWiki.sessionConfiguration = sessionConfiguration;\n  };\n\n  // Get CSS raw source of a tiddler image\n  TiddlyWiki.getRawTiddlerImage = function(tiddlerName) {\n    if (!$tw || !$tw.wiki) return false;\n    // Check if it is an image tiddler\n    if (!$tw.wiki.isImageTiddler(tiddlerName)) return false;\n    var tiddler = $tw.wiki.getTiddler(tiddlerName);\n    if ((typeof(tiddler) == \"undefined\") || !tiddler) return false;\n    var text = tiddler.fields.text;\n    if (!text) return false;\n    var type = tiddler.fields.type;\n    // Render the appropriate element for the image type\n    var src = \"\";\n    switch(type) {\n    case \"image/svg+xml\":\n      src = \"data:image/svg+xml,\" + encodeURIComponent(text);\n      break;\n    default:\n      src = \"data:\" + type + \";base64,\" + text;\n      break;\n    }\n\n    return src;\n  }; \n\n  // Loading of TiddlyWiki specific URL\n  // Parameters :\n  //   <url> : URL with specific syntax : \"tw:<tiddler title>\"\n  //   <type> : \"image\" for image tiddler, \"ArrayBuffer\" for tiddler with base64 content.\n  // Returns the tiddler data (text or binary) or null.\n  // The type of data (text or binary) is deduced from the tiddler's type.\n  // Type image/xx means tiddler image.\n  // Type application/octet-stream means binary data coded with base64. In that case an ArrayBuffer\n  // is returned.\n  // Other types means plain text.\n  TiddlyWiki.load = function(url) {\n    var func = \"TiddlyWiki.load\";\n    if (!url || !url.match(/^tw:/)) return null;\n    hack.log(\"url: \"+url, hack.loader, func);\n    var tiddlerTitle = tiddlyWiki.resolvePath(url.replace(\"tw:\", \"\"), true);\n    var tiddler = $tw.wiki.getTiddler(tiddlerTitle);\n    if ((typeof(tiddler) == \"undefined\") || !tiddler) {\n      throw new Error(\"TiddlyWiki.load: \\\"\" + url + \"\\\" : unknown tiddler.\");\n    }\n    if (tiddler.fields.type.match(/^image\\//))\n      return TiddlyWiki.getRawTiddlerImage(tiddlerTitle);\n    else {\n      if (!tiddler.fields.text) {\n        console.error(\"TiddlyWiki.load: \\\"\" + url + \"\\\" seems to be unreachable or the tiddler is empty.\");\n        return null;\n      }\n      if (tiddler.fields.type == \"application/octet-stream\")\n        return StringView.makeFromBase64(tiddler.fields.text).buffer;\n      else\n        return tiddler.fields.text;\n    }\n  };\n\n  // Export current view to an image tiddler\n  // Parameters :\n  //   <domElement> : DOM element, <canvas> or <svg>.\n  //   <url> : URL with specific syntax : \"tw:<tiddler title>\".\n  //   <type> : type of image tiddler : \"image/png\" (default) or \"image/jpeg\".\n  //   <flagOverwrite> : if true, overwrites existing tiddler without asking.\n  // Saves view data as a tiddler image with required type.\n  TiddlyWiki.exportToTiddler = function(domElement, url, type, flagOverwrite) {\n    var func = \"TiddlyWiki.exportToTiddler\";\n    if (!url || !url.match(/^tw:/)) {\n      console.error(func+\": bad URL format, not a tiddler.\");\n      return;\n    }\n    hack.log(\"url: \"+url, hack.render, func);\n    var tag = domElement.tagName.toUpperCase();\n    if (!type) {\n      if (tag == \"SVG\")\n        type = \"image/svg+xml\";\n      else\n        type = \"image/png\";\n    }\n    if ((((type == \"image/png\") || (type == \"image/jpeg\")) && (tag != \"CANVAS\")) ||\n        ((type == \"image/svg+xml\") && (tag != \"SVG\"))) {\n      console.error(func+\": bad tiddler type : \"+type)\n      return;\n    }\n    var tiddlerTitle = tiddlyWiki.resolvePath(url.replace(\"tw:\", \"\"), true);\n    if (!flagOverwrite) {\n      var tiddler = $tw.wiki.getTiddler(tiddlerTitle);\n      if ((typeof(tiddler) != \"undefined\") && tiddler) {\n        if (!confirm(\"View image saving : tiddler <\"+tiddlerTitle+\"> exists, would you like to overwrite it ?\")) return;\n      }\n    }\n    var data = null;\n    if (tag == \"SVG\") {\n      data = domElement.outerHTML;\n      type = \"\"; // bad TiddlyWiki behavior (with 5.1.5) !?\n    } else\n      data = domElement.toDataURL(type).replace(/^data:.*?;base64,/, \"\");\n    //console.log(func+\": data = \"+data);\n\n    // Create the image tiddler\n    $tw.wiki.addTiddler(new $tw.Tiddler({title: tiddlerTitle, type: type, text: data}));\n  };\n\n  // Create a Worker to execute inline code\n  TiddlyWiki.createWorker = function (func) {\n    var blobURL = URL.createObjectURL(new Blob(\n      [\"(\", func.toString(), \")()\"],\n      {type: \"application/javascript\"}\n    ));\n    var worker = new Worker(blobURL);\n    URL.revokeObjectURL(blobURL);\n\n    return worker;\n  };\n\n\n  // Instance members\n\n  TiddlyWiki.prototype = {\n\n    // Resolve file path.\n    //\n    // Following behaviour apply only if widget's configuration's object property \"filesystem\"\n    // is defined. If not, file is assumed to be a tiddler's title.\n    //\n    // File path resolution is as close as possible to Unix (for executables, libraries,\n    // manuals, ...).\n    // We make assumption that tiddler title follows classical Unix Path pattern\n    // like : /dir1/dir2/ ... /dir/file. If not the case, file should be\n    // in the \"current\" directory, or completely out of path convention.\n    // The curent directory (if any) is the \"directory\" of the current sheet tiddler.\n    // Example :\n    //   File to resolve = myTiddler\n    //   Tiddler title of the current sheet = MyProject/MySubProject/calc1\n    //   Current directory = MyProject/MySubProject\n    //   Sheet file in filesystem mode = calc1\n    //   File path = MyProject/MySubProject/myTiddler\n    //\n    // Unlike Unix, there is no notion of root directory or \"/\". TiddlyWiki has no\n    // real filesystem so we can't rely on a root node. Relative versus absolute\n    // path is deduced from the following. If the first caracter of a file\n    // path is \"/\" and there is no more \"/\" after that, then the current directory is \"\".\n    // Remark that the behavior is identical to Unix. A file path beginning with a \"/\"\n    // will be directly converted in a tiddler title.\n    // By default (and unlike Unix), malformed path like multiple \"/\" instead of one\n    // are not accepted. For example \"//\" is not reduced to \"/\" and treated like a\n    // path separator. It is the responsibility of the user to be clear about the significance of\n    // it's file reference, path-like name or tiddler title. For same reason,\n    // blank characters, eventually around \"/\", are treated like ordinary characters\n    // and not deleted in the final tiddler title.\n    // With optionnal <flagNormalize> parameter set, malformed path are normalized like\n    // Unix does, but blank characters are still not deleted.\n    //\n    // If not found in the current directory, a file is searched under a collection\n    // of path directories, pre-defined in the PATH variable. Those directories are\n    // absolute (i.e. not relative to current directory).\n    // Syntax of the PATH variable :\n    //   <path1>';'<path2>';' ... ';'<pathN>\n    // The PATH is searched first in a variable defined with a <$set> widget (not actually\n    // implemented, maybe in the future if someone asks :), then in the \"path\" parameter\n    // of the <$edit-socialcalc> widget, then in the widget's configuration object, under\n    // filesystem.PATH property. The widget's configuration object is searched first in\n    // $:/config/Three.js tiddler of \"application/json\" type, then in\n    // $:/plugins/Three.js/config-defaults.json tiddler.\n    // Please note that final PATH value is never a combination of different sources. The first\n    // source that defines a valid PATH (either <$set> variable, \"path\" parameter of\n    // <$edit-socialcalc> widget or widget's configuration object) gives the proper PATH value\n    // and stops all subsequent PATH search.\n    //\n    // Search algorithm :\n    //   <file> : input file path.\n    //   <tiddlerTitle> : output.\n    //   <currentTiddlerTitle> : tiddler title of the current sheet.\n    //   PATH <- value of a \"path\" variable defined with <$set> widget, or \"path\" field\n    //           of <currentTiddlerTitle>.\n    //   currentDir <- path of <currentTiddlerTitle> (anything before the last '/', or \"\").\n    //   if <file> begins with \"./\" or \"../\" then\n    //     # Relative path\n    //     <finalPath> <- ... (search à la Unix)\n    //     if tiddler <finalPath> found then return <finalPath>\n    //   else\n    //     # Under <currentDir> or under a PATH directory, or absolute\n    //     if tiddler <currentDir>/<file> found then return <currentDir>/<file>\n    //     if <PATH> exists then\n    //       for all <dir> in <PATH>\n    //         if tiddler <dir>/<file> found then return <dir>/<file>\n    //       end for\n    //     end if\n    //     if tiddler <file> found then return file\n    //   end if\n    //\n    resolvePath: function(file, flagNormalize) {\n      var fonc = \"TiddlyWiki.resolvePath\";\n\n      hack.log(\"============= file = \"+file, hack.filesystem, fonc);\n\n      if (!file) return null;\n      var tiddlerTitle = \"\";\n      var tiddler = false;\n      if (!this.widgetConfiguration || !this.widgetConfiguration.filesystem) {\n        hack.log(\"no filesystem in widget's configuration !\", hack.filesystem, fonc);\n        return(file);\n      }\n\n      // Initialisation\n      var currentTiddlerTitle = this.tiddlerTitle\n      var currentDir = \"\";\n      tiddler = $tw.wiki.getTiddler(currentTiddlerTitle);\n      if ((typeof(tiddler) == \"undefined\") || !tiddler) return null;\n        \n      // In case current tiddler is edited, we refer to the \"file\", not the draft tiddler\n      if (tiddler.isDraft()) currentTiddlerTitle = tiddler.fields[\"draft.of\"];\n      hack.log(\"currentTiddlerTitle = \"+currentTiddlerTitle, hack.filesystem, fonc);\n        \n      // Get PATH\n      var tabPath = null;\n      if (this.widgetConfiguration.filesystem.PATH && this.widgetConfiguration.filesystem.PATH != \"\")\n        tabPath = this.widgetConfiguration.filesystem.PATH.split(/[\\s]*;[\\s]*/);\n      hack.log(\"tabPath = \"+(tabPath ? tabPath.join(\" | \"): tabPath), hack.filesystem, fonc);\n\n      currentDir = currentTiddlerTitle.replace(/[\\/][^\\/]*$/, \"\").replace(/[\\/][.][\\/]/, \"/\");;\n      hack.log(\"currentDir = \"+currentDir, hack.filesystem, fonc);\n\n      // File normalization\n      if (flagNormalize) {\n        file = file.replace(/[\\/][\\/]+/g, \"/\").replace(/\\/\\.\\//g, \"/\");\n        hack.log(\"file normalized = \"+file, hack.filesystem, fonc);\n      }\n\n      if (file.match(/^\\.\\/|^\\.\\.\\/|\\/\\.\\.\\//)) {\n        // Relative path or with relative sub-expressions\n          \n        hack.log(\"relative path\", hack.filesystem, fonc);\n        tabCurrentDir = currentDir.split(\"/\");\n        hack.log(\"tabCurrentDir = \"+tabCurrentDir.join(\" | \"), hack.filesystem, fonc);\n        tabPageName = file.split(\"/\");\n        var tabTiddlerTitle = [];\n        for (var i = 0; i < tabCurrentDir.length; i++)\n          tabTiddlerTitle.push(tabCurrentDir[i]);\n        hack.log(\"tabTiddlerTitle = \"+tabTiddlerTitle.join(\" | \"), hack.filesystem, fonc);\n        var indexInCurrentDir = tabCurrentDir.length - 1;\n        hack.log(\"indexInCurrentDir = \"+indexInCurrentDir, hack.filesystem, fonc);\n        var flagAbsolute = false;\n        for (var i = 0; i < tabPageName.length; i++) {\n          hack.log(\"boucle: tabPageName[\"+i+\"] = \"+tabPageName[i], hack.filesystem, fonc);\n          hack.log(\"  indexInCurrentDir = \"+indexInCurrentDir, hack.filesystem, fonc);\n          hack.log(\"  tabTiddlerTitle = \"+tabTiddlerTitle.join(\" | \"), hack.filesystem, fonc);\n          if (tabPageName[i] == \".\") continue;\n          if (tabPageName[i] == \"..\") {\n            indexInCurrentDir--;\n            if (tabTiddlerTitle.length == 0) {\n              // Malformed path -> it seems to be an absolute non-path tiddler title\n              hack.log(\"  malformed path case 1\", hack.filesystem, fonc);\n              flagAbsolute = true;\n              break;\n            }\n            tabTiddlerTitle.pop();\n            continue;\n          }\n          indexInCurrentDir++; // alas ! maybe we will return above currentDir\n          hack.log(\"  tabCurrentDir[indexInCurrentDir] = \"+tabCurrentDir[indexInCurrentDir], hack.filesystem, fonc);\n          if (indexInCurrentDir < tabCurrentDir.length - 1) {\n            // We wander above currentDir\n            if ((indexInCurrentDir < 0) || (tabPageName[i] != tabCurrentDir[indexInCurrentDir])) {\n              // Malformed path -> it seems to be an absolute non-path tiddler title\n              hack.log(\"  malformed path case 2\", hack.filesystem, fonc);\n              flagAbsolute = true;\n              break;\n            }\n          }\n          tabTiddlerTitle.push(tabPageName[i])\n        }\n\n        if (!flagAbsolute) {\n          tiddlerTitle = tabTiddlerTitle.join(\"/\");\n        } else {\n          tiddlerTitle = file;\n        }\n\n      } else {\n        // Not relative path\n        hack.log(\"absolute path (under curent dir, PATH dirs or really absolute)\", hack.filesystem, fonc);\n        var flagFind = false;\n          \n        // Search under currentDir\n        tiddlerTitle = currentDir + \"/\" + file;\n        var tiddler1 = $tw.wiki.getTiddler(tiddlerTitle);\n        if ((typeof(tiddler1) != \"undefined\") && tiddler1)\n          flagFind = true;\n          \n        if (!flagFind && tabPath) {\n          // Search under PATH directories\n          for (var i = 0; i < tabPath.length; i++) {\n            tiddlerTitle = tabPath[i] + \"/\" + file;\n            var tiddler2 = $tw.wiki.getTiddler(tiddlerTitle);\n            if ((typeof(tiddler2) != \"undefined\") && tiddler2) {\n              flagFind = true;\n              break;\n            }\n          }\n        }\n          \n        // Maybe a tiddler already\n        if (!flagFind)\n          tiddlerTitle = file;\n      }\n\n      hack.log(\"============= tiddler = \"+tiddlerTitle, hack.filesystem, fonc);\n      return tiddlerTitle;\n    }\n  };\n\n  exports.TiddlyWiki = TiddlyWiki;\n\n})();",
            "title": "$:/plugins/rboue/Three.js/tiddlywiki.js",
            "type": "application/javascript",
            "module-type": "library"
        },
        "$:/plugins/rboue/Three.js/view3js.js": {
            "text": "/*\\\ntitle: $:/plugins/rboue/Three.js/view3js.js\ntype: application/javascript\nmodule-type: widget\n\nThe view3js widget displays a 3D view defined in a local tiddler.\n\n```\n<$view3js tiddler=\"TiddlerTitle\" width=\"320\" height=\"400\" class=\"classnames\"/>\n```\n\nThe widget generates an HTML5 WebGL node with a 3D view produced by main javascript code tiddler.\n\nThe width and height attributes are interpreted as a number of pixels, and do not need to include the \"px\" suffix.\nThe path attribute contains a collection of pseudo-path directory to search files to be loaded.\n\n\\*/\n(function() {\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar CONST_NODE_ID_PREFIX = \"ThreejsWidget\"; // prefix of root node's id attribute\nvar CONST_MIN_HEIGHT = 300;                 // root node minimal height\nvar CONST_PLUGIN_PATH = \"$:/plugins/rboue/Three.js\";\nvar CONST_CONFIG_TIDDLER = \"$:/config/rboue/Three.js\";\nvar CONST_CONFIG_DEFAULT_TIDDLER = CONST_PLUGIN_PATH+\"/config.json\";\n\n// Get session configuration.\nvar sessionConfig = null;\nvar configTiddler = $tw.wiki.getTiddler(CONST_CONFIG_TIDDLER);\nif ((typeof(configTiddler) != \"undefined\") && configTiddler) {\n  sessionConfig = $tw.wiki.getTiddlerData(configTiddler, null)\n}\nif (!sessionConfig) {\n  var configTiddlerDefault = $tw.wiki.getTiddler(CONST_CONFIG_DEFAULT_TIDDLER);\n  if ((typeof(configTiddlerDefault) != \"undefined\") && configTiddlerDefault) {\n    sessionConfig = $tw.wiki.getTiddlerData(configTiddlerDefault, null)\n  }\n}\n\n// Create objects\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\nvar StringView = require(\"./Lib/stringview.js\").StringView;\nvar TiddlyWiki = require(\"./tiddlywiki.js\").TiddlyWiki;\nTiddlyWiki.init(sessionConfig);\n\nvar View3jsWidget = function(parseTreeNode,options) {\n  this.initialise(parseTreeNode,options);\n};\nView3jsWidget.instanceNb = 0; // count class instances\n\n// Inherit from the base widget class\nView3jsWidget.prototype = new Widget();\n\n//=======================================================================================\n\n// Render this widget into the DOM\nView3jsWidget.prototype.render = function(parent,nextSibling) {\n  var fonc = \"View3jsWidget.render\";\n  var self = this;\n\n  // Debug tools\n  var hack = {\n    flagActiv: true, // Activate the logs\n    log: function(mess, flagNoLog, fonc) {\n      if (!hack.flagActiv || flagNoLog) return;\n      var id = \"[]\";\n      if (tiddlyWiki) id = \"[\"+tiddlyWiki.widget.nodeRootId+\"]\";\n      console.log(id+(fonc ? fonc+\": \" : \"\")+mess);\n    },\n    logPoint: function(x,y) {return \"(\"+x+\",\"+y+\")\";},\n    // Following are flags activating logs for specific fonctionnalities.\n    // Value : false to activate, true to desactivate (no log).\n    bug: false,      // current bug investigation\n    filesystem: true, // filesystem\n    loader: true,     // loader\n    sceneLoader: true,  // Scene loader\n    render: true      // rendering\n  };\n  window.hack = hack;\n\n  // Create objects (continued)\n  // Unfortunately, we can't create THREE object at TiddlyWiki start time (i.e. before\n  // any widget instance) :\n  //   There is a complaint \"ReferenceError: Float32Array is not defined\" because a lot\n  //   of code is running at load time (many functions auto-defines themselves, allocating\n  //   Float32Array and returning a sub-function.\n  //   Float32Array is an object specific to WebGL. It seems that TiddlyWiki denies the use\n  //   of WebGL in sandbox environment !\n  // The THREE module is loaded only once, thanks to the TiddlyWiki's load mechanism.\n  window.StringView = StringView;\n  window.TiddlyWiki = TiddlyWiki;\n  window.THREE = require(\"./Lib/three-min.js\").THREE;\n\n  this.parentDomNode = parent;\n  this.computeAttributes();\n  this.execute();\n\n  // Create element and assign attributes\n  this.nodeRoot = this.document.createElement(\"div\");\n  this.nodeRootId = CONST_NODE_ID_PREFIX + \"-\" + ++View3jsWidget.instanceNb;\n  this.nodeRoot.setAttribute(\"id\", this.nodeRootId);\n  if (this[\"class\"])\n    this.nodeRoot.setAttribute(\"class\", this[\"class\"]);\t\t\n  if (this.width) {\n    var widthStyle = parseInt(this.width,10) + \"px\";\n    this.nodeRoot.setAttribute(\"width\", widthStyle);\n    this.nodeRoot.style.width = widthStyle;\n  }\n  if (this.height) {\n    var heightStyle = parseInt(this.height,10) + \"px\";\n    this.nodeRoot.setAttribute(\"height\", heightStyle);\n    this.nodeRoot.style.height = heightStyle;\n  } else {\n    this.nodeRoot.setAttribute(\"height\", \"\" + CONST_MIN_HEIGHT + \"px\");\n    this.nodeRoot.style.height = \"\" + CONST_MIN_HEIGHT + \"px\";\n  }\n\n  // Insert element\n  parent.insertBefore(this.nodeRoot,nextSibling);\n  this.domNodes.push(this.nodeRoot);\n\n  // UI template\n  var uiNodeCreate = function(id, that) {\n    // Create a node : <div id=\"<id>\"></div>\n    var node = that.document.createElement(\"div\");\n    node.setAttribute(\"id\", id);\n    parent.insertBefore(node, nextSibling);\n    that.domNodes.push(node);\n    return node;\n  };\n  this.nodeError = uiNodeCreate(this.nodeRootId + \"-error\", this);\n\n  // Test browser compatibility with WebGL\n  var webgl = (function () {\n    try {\n      var canvas = document.createElement(\"canvas\");\n      return !! window.WebGLRenderingContext && (canvas.getContext(\"webgl\") || canvas.getContext(\"experimental-webgl\"));\n    } catch(e) {\n      return false;\n    }\n  })();\n  if (!webgl) {\n    this.nodeError.innerHTML = window.WebGLRenderingContext ?\n      'Your graphics card does not seem to support <a href=\"http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation\" target=\"_blank\">WebGL</a>.<br/>' +\n      'Find out how to get it <a href=\"http://get.webgl.org/\" target=\"_blank\">here</a>.'\n      :\n      'Your browser does not seem to support <a href=\"http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation\" target=\"_blank\">WebGL</a>.<br/>' +\n      'Find out how to get it <a href=\"http://get.webgl.org/\" target=\"_blank\">here</a>.';\n    return;\n  }\n\n  // Get code tiddler\n  if (!this.tiddler) {\n    this.nodeError.innerHTML = \"Error: you must specify a code tiddler\";\n    return;\n  }\n  var tiddler = this.wiki.getTiddler(this.tiddler);\n  if ((typeof(tiddler) == \"undefined\") || !tiddler) {\n    this.nodeError.innerHTML = \"Error: unknown tiddler: \"+this.tiddler;\n    return;\n  }\n\n  // Get widget configuration\n  var widgetConfig = {};\n  if (this.path) {\n    widgetConfig.filesystem = {PATH: this.path};\n  } else {\n    if (sessionConfig && sessionConfig.filesystem) {\n      widgetConfig.filesystem = {};\n      if (sessionConfig.filesystem.PATH)\n        widgetConfig.filesystem.PATH = sessionConfig.filesystem.PATH;\n    }\n  }\n\n  window.tiddlyWiki = new TiddlyWiki(this, this.tiddler, widgetConfig);\n\n  // Create viewer\n\n  // Execute user code\n  // Prototype :\n  //   function main(input)\n  //     Returns : {onTiddlerRefresh: <refresh function>}\n  //\n  this.input = {node: this.nodeRoot};\n  try {\n    this.output = eval(tiddler.fields.text+\";main(this.input);\");\n  } catch(e) {\n    this.nodeError.innerHTML = \"Error when executing javascript code in <b>\"+this.tiddler+\"</b> tiddler :<br><b>\"+e+\"</b>\";\n    alert(\"Stop on error\"); // stop debug and log in case of deaf mad program\n  }\n};\n  \n// Compute the internal state of the widget\nView3jsWidget.prototype.execute = function() {\n  // Get our parameters\n  this.tiddler = this.getAttribute(\"tiddler\");\n  this.width = this.getAttribute(\"width\");\n  this.height = this.getAttribute(\"height\");\n  this.path = this.getAttribute(\"path\");\n  this[\"class\"] = this.getAttribute(\"class\");\n};\n\n// Selectively refreshes the widget if needed. Returns true if the widget or any\n// of its children needed re-rendering\nView3jsWidget.prototype.refresh = function(changedTiddlers) {\n  var fonc = \"View3jsWidget.refresh\";\n\n  var changedAttributes = this.computeAttributes();\n  if (changedAttributes.tiddler ||\n      changedAttributes.width ||\n      changedAttributes.height ||\n      changedAttributes.path ||\n      changedAttributes[\"class\"] ||\n      changedTiddlers[this.tiddler]) {\n    this.refreshSelf();\n    //hack.log(\"after this.refreshSelf()\", false, fonc);\n    return true;\n  } else {\n    //hack.log(\"other case\", false, fonc);\n    if (this.output && this.output.onTiddlerRefresh) this.output.onTiddlerRefresh();\n    return false;\t\t\n  }\n};\n\nexports.view3js = View3jsWidget;\n\n})();\n",
            "title": "$:/plugins/rboue/Three.js/view3js.js",
            "type": "application/javascript",
            "module-type": "widget"
        }
    }
}
{
    "tiddlers": {
        "$:/plugins/rboue/Three.js/Lib/SimplexNoise.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/SimplexNoise.js",
            "module-type": "library",
            "text": "// Ported from Stefan Gustavson's java implementation\n// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf\n// Read Stefan's excellent paper for details on how this code works.\n//\n// Sean McCullough banksean@gmail.com\n//\n// Added 4D noise\n// Joshua Koo zz85nus@gmail.com \n\n/**\n * You can pass in a random number generator object if you like.\n * It is assumed to have a random() method.\n */\nvar SimplexNoise = function(r) {\n\tif (r == undefined) r = Math;\n  this.grad3 = [[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0], \n                                 [1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1], \n                                 [0,1,1],[0,-1,1],[0,1,-1],[0,-1,-1]]; \n\n  this.grad4 = [[0,1,1,1], [0,1,1,-1], [0,1,-1,1], [0,1,-1,-1],\n\t     [0,-1,1,1], [0,-1,1,-1], [0,-1,-1,1], [0,-1,-1,-1],\n\t     [1,0,1,1], [1,0,1,-1], [1,0,-1,1], [1,0,-1,-1],\n\t     [-1,0,1,1], [-1,0,1,-1], [-1,0,-1,1], [-1,0,-1,-1],\n\t     [1,1,0,1], [1,1,0,-1], [1,-1,0,1], [1,-1,0,-1],\n\t     [-1,1,0,1], [-1,1,0,-1], [-1,-1,0,1], [-1,-1,0,-1],\n\t     [1,1,1,0], [1,1,-1,0], [1,-1,1,0], [1,-1,-1,0],\n\t     [-1,1,1,0], [-1,1,-1,0], [-1,-1,1,0], [-1,-1,-1,0]];\n\n  this.p = [];\n  for (var i=0; i<256; i++) {\n\t  this.p[i] = Math.floor(r.random()*256);\n  }\n  // To remove the need for index wrapping, double the permutation table length \n  this.perm = []; \n  for(var i=0; i<512; i++) {\n\t\tthis.perm[i]=this.p[i & 255];\n\t} \n\n  // A lookup table to traverse the simplex around a given point in 4D. \n  // Details can be found where this table is used, in the 4D noise method. \n  this.simplex = [ \n    [0,1,2,3],[0,1,3,2],[0,0,0,0],[0,2,3,1],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,2,3,0], \n    [0,2,1,3],[0,0,0,0],[0,3,1,2],[0,3,2,1],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,3,2,0], \n    [0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0], \n    [1,2,0,3],[0,0,0,0],[1,3,0,2],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,3,0,1],[2,3,1,0], \n    [1,0,2,3],[1,0,3,2],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,0,3,1],[0,0,0,0],[2,1,3,0], \n    [0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0], \n    [2,0,1,3],[0,0,0,0],[0,0,0,0],[0,0,0,0],[3,0,1,2],[3,0,2,1],[0,0,0,0],[3,1,2,0], \n    [2,1,0,3],[0,0,0,0],[0,0,0,0],[0,0,0,0],[3,1,0,2],[0,0,0,0],[3,2,0,1],[3,2,1,0]]; \n};\n\nSimplexNoise.prototype.dot = function(g, x, y) { \n\treturn g[0]*x + g[1]*y;\n};\n\nSimplexNoise.prototype.dot3 = function(g, x, y, z) {\n  return g[0]*x + g[1]*y + g[2]*z; \n}\n\nSimplexNoise.prototype.dot4 = function(g, x, y, z, w) {\n  return g[0]*x + g[1]*y + g[2]*z + g[3]*w;\n};\n\nSimplexNoise.prototype.noise = function(xin, yin) { \n  var n0, n1, n2; // Noise contributions from the three corners \n  // Skew the input space to determine which simplex cell we're in \n  var F2 = 0.5*(Math.sqrt(3.0)-1.0); \n  var s = (xin+yin)*F2; // Hairy factor for 2D \n  var i = Math.floor(xin+s); \n  var j = Math.floor(yin+s); \n  var G2 = (3.0-Math.sqrt(3.0))/6.0; \n  var t = (i+j)*G2; \n  var X0 = i-t; // Unskew the cell origin back to (x,y) space \n  var Y0 = j-t; \n  var x0 = xin-X0; // The x,y distances from the cell origin \n  var y0 = yin-Y0; \n  // For the 2D case, the simplex shape is an equilateral triangle. \n  // Determine which simplex we are in. \n  var i1, j1; // Offsets for second (middle) corner of simplex in (i,j) coords \n  if(x0>y0) {i1=1; j1=0;} // lower triangle, XY order: (0,0)->(1,0)->(1,1) \n  else {i1=0; j1=1;}      // upper triangle, YX order: (0,0)->(0,1)->(1,1) \n  // A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and \n  // a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where \n  // c = (3-sqrt(3))/6 \n  var x1 = x0 - i1 + G2; // Offsets for middle corner in (x,y) unskewed coords \n  var y1 = y0 - j1 + G2; \n  var x2 = x0 - 1.0 + 2.0 * G2; // Offsets for last corner in (x,y) unskewed coords \n  var y2 = y0 - 1.0 + 2.0 * G2; \n  // Work out the hashed gradient indices of the three simplex corners \n  var ii = i & 255; \n  var jj = j & 255; \n  var gi0 = this.perm[ii+this.perm[jj]] % 12; \n  var gi1 = this.perm[ii+i1+this.perm[jj+j1]] % 12; \n  var gi2 = this.perm[ii+1+this.perm[jj+1]] % 12; \n  // Calculate the contribution from the three corners \n  var t0 = 0.5 - x0*x0-y0*y0; \n  if(t0<0) n0 = 0.0; \n  else { \n    t0 *= t0; \n    n0 = t0 * t0 * this.dot(this.grad3[gi0], x0, y0);  // (x,y) of grad3 used for 2D gradient \n  } \n  var t1 = 0.5 - x1*x1-y1*y1; \n  if(t1<0) n1 = 0.0; \n  else { \n    t1 *= t1; \n    n1 = t1 * t1 * this.dot(this.grad3[gi1], x1, y1); \n  }\n  var t2 = 0.5 - x2*x2-y2*y2; \n  if(t2<0) n2 = 0.0; \n  else { \n    t2 *= t2; \n    n2 = t2 * t2 * this.dot(this.grad3[gi2], x2, y2); \n  } \n  // Add contributions from each corner to get the final noise value. \n  // The result is scaled to return values in the interval [-1,1]. \n  return 70.0 * (n0 + n1 + n2); \n};\n\n// 3D simplex noise \nSimplexNoise.prototype.noise3d = function(xin, yin, zin) { \n  var n0, n1, n2, n3; // Noise contributions from the four corners \n  // Skew the input space to determine which simplex cell we're in \n  var F3 = 1.0/3.0; \n  var s = (xin+yin+zin)*F3; // Very nice and simple skew factor for 3D \n  var i = Math.floor(xin+s); \n  var j = Math.floor(yin+s); \n  var k = Math.floor(zin+s); \n  var G3 = 1.0/6.0; // Very nice and simple unskew factor, too \n  var t = (i+j+k)*G3; \n  var X0 = i-t; // Unskew the cell origin back to (x,y,z) space \n  var Y0 = j-t; \n  var Z0 = k-t; \n  var x0 = xin-X0; // The x,y,z distances from the cell origin \n  var y0 = yin-Y0; \n  var z0 = zin-Z0; \n  // For the 3D case, the simplex shape is a slightly irregular tetrahedron. \n  // Determine which simplex we are in. \n  var i1, j1, k1; // Offsets for second corner of simplex in (i,j,k) coords \n  var i2, j2, k2; // Offsets for third corner of simplex in (i,j,k) coords \n  if(x0>=y0) { \n    if(y0>=z0) \n      { i1=1; j1=0; k1=0; i2=1; j2=1; k2=0; } // X Y Z order \n      else if(x0>=z0) { i1=1; j1=0; k1=0; i2=1; j2=0; k2=1; } // X Z Y order \n      else { i1=0; j1=0; k1=1; i2=1; j2=0; k2=1; } // Z X Y order \n    } \n  else { // x0<y0 \n    if(y0<z0) { i1=0; j1=0; k1=1; i2=0; j2=1; k2=1; } // Z Y X order \n    else if(x0<z0) { i1=0; j1=1; k1=0; i2=0; j2=1; k2=1; } // Y Z X order \n    else { i1=0; j1=1; k1=0; i2=1; j2=1; k2=0; } // Y X Z order \n  } \n  // A step of (1,0,0) in (i,j,k) means a step of (1-c,-c,-c) in (x,y,z), \n  // a step of (0,1,0) in (i,j,k) means a step of (-c,1-c,-c) in (x,y,z), and \n  // a step of (0,0,1) in (i,j,k) means a step of (-c,-c,1-c) in (x,y,z), where \n  // c = 1/6.\n  var x1 = x0 - i1 + G3; // Offsets for second corner in (x,y,z) coords \n  var y1 = y0 - j1 + G3; \n  var z1 = z0 - k1 + G3; \n  var x2 = x0 - i2 + 2.0*G3; // Offsets for third corner in (x,y,z) coords \n  var y2 = y0 - j2 + 2.0*G3; \n  var z2 = z0 - k2 + 2.0*G3; \n  var x3 = x0 - 1.0 + 3.0*G3; // Offsets for last corner in (x,y,z) coords \n  var y3 = y0 - 1.0 + 3.0*G3; \n  var z3 = z0 - 1.0 + 3.0*G3; \n  // Work out the hashed gradient indices of the four simplex corners \n  var ii = i & 255; \n  var jj = j & 255; \n  var kk = k & 255; \n  var gi0 = this.perm[ii+this.perm[jj+this.perm[kk]]] % 12; \n  var gi1 = this.perm[ii+i1+this.perm[jj+j1+this.perm[kk+k1]]] % 12; \n  var gi2 = this.perm[ii+i2+this.perm[jj+j2+this.perm[kk+k2]]] % 12; \n  var gi3 = this.perm[ii+1+this.perm[jj+1+this.perm[kk+1]]] % 12; \n  // Calculate the contribution from the four corners \n  var t0 = 0.6 - x0*x0 - y0*y0 - z0*z0; \n  if(t0<0) n0 = 0.0; \n  else { \n    t0 *= t0; \n    n0 = t0 * t0 * this.dot3(this.grad3[gi0], x0, y0, z0); \n  }\n  var t1 = 0.6 - x1*x1 - y1*y1 - z1*z1; \n  if(t1<0) n1 = 0.0; \n  else { \n    t1 *= t1; \n    n1 = t1 * t1 * this.dot3(this.grad3[gi1], x1, y1, z1); \n  } \n  var t2 = 0.6 - x2*x2 - y2*y2 - z2*z2; \n  if(t2<0) n2 = 0.0; \n  else { \n    t2 *= t2; \n    n2 = t2 * t2 * this.dot3(this.grad3[gi2], x2, y2, z2); \n  } \n  var t3 = 0.6 - x3*x3 - y3*y3 - z3*z3; \n  if(t3<0) n3 = 0.0; \n  else { \n    t3 *= t3; \n    n3 = t3 * t3 * this.dot3(this.grad3[gi3], x3, y3, z3); \n  } \n  // Add contributions from each corner to get the final noise value. \n  // The result is scaled to stay just inside [-1,1] \n  return 32.0*(n0 + n1 + n2 + n3); \n};\n\n// 4D simplex noise\nSimplexNoise.prototype.noise4d = function( x, y, z, w ) {\n\t// For faster and easier lookups\n\tvar grad4 = this.grad4;\n\tvar simplex = this.simplex;\n\tvar perm = this.perm;\n\t\n   // The skewing and unskewing factors are hairy again for the 4D case\n   var F4 = (Math.sqrt(5.0)-1.0)/4.0;\n   var G4 = (5.0-Math.sqrt(5.0))/20.0;\n   var n0, n1, n2, n3, n4; // Noise contributions from the five corners\n   // Skew the (x,y,z,w) space to determine which cell of 24 simplices we're in\n   var s = (x + y + z + w) * F4; // Factor for 4D skewing\n   var i = Math.floor(x + s);\n   var j = Math.floor(y + s);\n   var k = Math.floor(z + s);\n   var l = Math.floor(w + s);\n   var t = (i + j + k + l) * G4; // Factor for 4D unskewing\n   var X0 = i - t; // Unskew the cell origin back to (x,y,z,w) space\n   var Y0 = j - t;\n   var Z0 = k - t;\n   var W0 = l - t;\n   var x0 = x - X0;  // The x,y,z,w distances from the cell origin\n   var y0 = y - Y0;\n   var z0 = z - Z0;\n   var w0 = w - W0;\n\n   // For the 4D case, the simplex is a 4D shape I won't even try to describe.\n   // To find out which of the 24 possible simplices we're in, we need to\n   // determine the magnitude ordering of x0, y0, z0 and w0.\n   // The method below is a good way of finding the ordering of x,y,z,w and\n   // then find the correct traversal order for the simplex we’re in.\n   // First, six pair-wise comparisons are performed between each possible pair\n   // of the four coordinates, and the results are used to add up binary bits\n   // for an integer index.\n   var c1 = (x0 > y0) ? 32 : 0;\n   var c2 = (x0 > z0) ? 16 : 0;\n   var c3 = (y0 > z0) ? 8 : 0;\n   var c4 = (x0 > w0) ? 4 : 0;\n   var c5 = (y0 > w0) ? 2 : 0;\n   var c6 = (z0 > w0) ? 1 : 0;\n   var c = c1 + c2 + c3 + c4 + c5 + c6;\n   var i1, j1, k1, l1; // The integer offsets for the second simplex corner\n   var i2, j2, k2, l2; // The integer offsets for the third simplex corner\n   var i3, j3, k3, l3; // The integer offsets for the fourth simplex corner\n   // simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some order.\n   // Many values of c will never occur, since e.g. x>y>z>w makes x<z, y<w and x<w\n   // impossible. Only the 24 indices which have non-zero entries make any sense.\n   // We use a thresholding to set the coordinates in turn from the largest magnitude.\n   // The number 3 in the \"simplex\" array is at the position of the largest coordinate.\n   i1 = simplex[c][0]>=3 ? 1 : 0;\n   j1 = simplex[c][1]>=3 ? 1 : 0;\n   k1 = simplex[c][2]>=3 ? 1 : 0;\n   l1 = simplex[c][3]>=3 ? 1 : 0;\n   // The number 2 in the \"simplex\" array is at the second largest coordinate.\n   i2 = simplex[c][0]>=2 ? 1 : 0;\n   j2 = simplex[c][1]>=2 ? 1 : 0;    k2 = simplex[c][2]>=2 ? 1 : 0;\n   l2 = simplex[c][3]>=2 ? 1 : 0;\n   // The number 1 in the \"simplex\" array is at the second smallest coordinate.\n   i3 = simplex[c][0]>=1 ? 1 : 0;\n   j3 = simplex[c][1]>=1 ? 1 : 0;\n   k3 = simplex[c][2]>=1 ? 1 : 0;\n   l3 = simplex[c][3]>=1 ? 1 : 0;\n   // The fifth corner has all coordinate offsets = 1, so no need to look that up.\n   var x1 = x0 - i1 + G4; // Offsets for second corner in (x,y,z,w) coords\n   var y1 = y0 - j1 + G4;\n   var z1 = z0 - k1 + G4;\n   var w1 = w0 - l1 + G4;\n   var x2 = x0 - i2 + 2.0*G4; // Offsets for third corner in (x,y,z,w) coords\n   var y2 = y0 - j2 + 2.0*G4;\n   var z2 = z0 - k2 + 2.0*G4;\n   var w2 = w0 - l2 + 2.0*G4;\n   var x3 = x0 - i3 + 3.0*G4; // Offsets for fourth corner in (x,y,z,w) coords\n   var y3 = y0 - j3 + 3.0*G4;\n   var z3 = z0 - k3 + 3.0*G4;\n   var w3 = w0 - l3 + 3.0*G4;\n   var x4 = x0 - 1.0 + 4.0*G4; // Offsets for last corner in (x,y,z,w) coords\n   var y4 = y0 - 1.0 + 4.0*G4;\n   var z4 = z0 - 1.0 + 4.0*G4;\n   var w4 = w0 - 1.0 + 4.0*G4;\n   // Work out the hashed gradient indices of the five simplex corners\n   var ii = i & 255;\n   var jj = j & 255;\n   var kk = k & 255;\n   var ll = l & 255;\n   var gi0 = perm[ii+perm[jj+perm[kk+perm[ll]]]] % 32;\n   var gi1 = perm[ii+i1+perm[jj+j1+perm[kk+k1+perm[ll+l1]]]] % 32;\n   var gi2 = perm[ii+i2+perm[jj+j2+perm[kk+k2+perm[ll+l2]]]] % 32;\n   var gi3 = perm[ii+i3+perm[jj+j3+perm[kk+k3+perm[ll+l3]]]] % 32;\n   var gi4 = perm[ii+1+perm[jj+1+perm[kk+1+perm[ll+1]]]] % 32;\n   // Calculate the contribution from the five corners\n   var t0 = 0.6 - x0*x0 - y0*y0 - z0*z0 - w0*w0;\n   if(t0<0) n0 = 0.0;\n   else {\n     t0 *= t0;\n     n0 = t0 * t0 * this.dot4(grad4[gi0], x0, y0, z0, w0);\n   }\n  var t1 = 0.6 - x1*x1 - y1*y1 - z1*z1 - w1*w1;\n   if(t1<0) n1 = 0.0;\n   else {\n     t1 *= t1;\n     n1 = t1 * t1 * this.dot4(grad4[gi1], x1, y1, z1, w1);\n   }\n  var t2 = 0.6 - x2*x2 - y2*y2 - z2*z2 - w2*w2;\n   if(t2<0) n2 = 0.0;\n   else {\n     t2 *= t2;\n     n2 = t2 * t2 * this.dot4(grad4[gi2], x2, y2, z2, w2);\n   }   var t3 = 0.6 - x3*x3 - y3*y3 - z3*z3 - w3*w3;\n   if(t3<0) n3 = 0.0;\n   else {\n     t3 *= t3;\n     n3 = t3 * t3 * this.dot4(grad4[gi3], x3, y3, z3, w3);\n   }\n  var t4 = 0.6 - x4*x4 - y4*y4 - z4*z4 - w4*w4;\n   if(t4<0) n4 = 0.0;\n   else {\n     t4 *= t4;\n     n4 = t4 * t4 * this.dot4(grad4[gi4], x4, y4, z4, w4);\n   }\n   // Sum up and scale the result to cover the range [-1,1]\n   return 27.0 * (n0 + n1 + n2 + n3 + n4);\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Utils/UVsUtils.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Utils/UVsUtils.js",
            "module-type": "library",
            "text": "/*\n * @author gyuque / http://github.com/gyuque\n * Cylinder Mapping for ExtrudeGeometry\n */\n\nTHREE.UVsUtils = {\n\n};\n\nTHREE.UVsUtils.CylinderUVGenerator = function() {\n    this.uRepeat = 1;\n    this.targetGeometry = null;\n    this.lengthCache = null;\n};\n\nTHREE.UVsUtils.CylinderUVGenerator.prototype = {\n    generateTopUV: THREE.ExtrudeGeometry.WorldUVGenerator.generateTopUV,\n    generateBottomUV: THREE.ExtrudeGeometry.WorldUVGenerator.generateBottomUV,\n    \n    generateSideWallUV: function( geometry, extrudedShape, wallContour, extrudeOptions,\n                                  indexA, indexB, indexC, indexD, stepIndex, stepsLength,\n                                  contourIndex1, contourIndex2 ) {\n        // first call\n        if (this.targetGeometry !== geometry) {\n            this.prepare(geometry, wallContour);\n        }\n\n        // generate uv\n        var u_list = this.lengthCache;\n        var v1 = stepIndex / stepsLength;\n        var v2 = ( stepIndex + 1 ) / stepsLength;\n        \n        var u1 = u_list[contourIndex1];\n        var u2 = u_list[contourIndex2];\n        if (u1 < u2) {u1 += 1.0;}\n        \n        u1 *= this.uRepeat;\n        u2 *= this.uRepeat;\n        return [\n            new THREE.Vector2( u1, v1 ),\n            new THREE.Vector2( u2, v1 ),\n            new THREE.Vector2( u2, v2 ),\n            new THREE.Vector2( u1, v2 )\n        ];\n    },\n    \n    prepare: function(geometry, wallContour) {\n        var p1, p2;\n        var u_list = [];\n        var lengthSum = 0;\n        var len = wallContour.length;\n        for (var i = 0;i < len;i++) {\n            p1 = wallContour[ i ];\n            p2 = wallContour[ (i+1) % len ];\n\n            var dx = p1.x - p2.x;\n            var dy = p1.y - p2.y;\n            var segmentLength = Math.sqrt(dx*dx + dy*dy);\n            \n            u_list.push(lengthSum);\n            lengthSum += segmentLength;\n        }\n        \n        this.normalizeArray(u_list, lengthSum);\n        this.targetGeometry = geometry;\n        this.lengthCache = u_list;\n    },\n    \n    normalizeArray: function(ls, v) {\n        var len = ls.length;\n        for (var i = 0;i < len;i++) {\n            ls[i] /= v;\n        }\n        \n        return ls;\n    }\n};\n\n\n\n/* \n * @author zz85 / http://github.com/zz85\n * @author WestLangley / http://github.com/WestLangley\n *\n * tool for \"unwrapping\" and debugging three.js \n * geometries UV mapping\n *\n * Sample usage:\n *\tdocument.body.appendChild(\n *\t\tTHREE.UVsDebug(\n *\t\t\tnew THREE.SphereGeometry(10,10,10,10));\n *\n */\n \nTHREE.UVsDebug = function( geometry, size ) {\n\n    // handles wrapping of uv.x > 1 only\n    \n    var abc = 'abcd';\n\n    var uv, u, ax, ay;\n    var i, il, j, jl;\n    var vnum;\n\n    var a = new THREE.Vector2();\n    var b = new THREE.Vector2();\n\n    var faces = geometry.faces;\n    var uvs = geometry.faceVertexUvs[ 0 ];\n\n    var canvas = document.createElement( 'canvas' );\n    var width = size || 1024;   // power of 2 required for wrapping\n    var height = size || 1024;\n    canvas.width = width;\n    canvas.height = height;\n\n    var ctx = canvas.getContext( '2d' );\n    ctx.lineWidth = 2;\n    ctx.strokeStyle = 'rgba( 0, 0, 0, 1.0 )';\n    ctx.textAlign = 'center';\n\n    // paint background white\n\n    ctx.fillStyle = 'rgba( 255, 255, 255, 1.0 )';\n    ctx.fillRect( 0, 0, width, height );\n\n    for ( i = 0, il = uvs.length; i < il; i++ ) {\n\n        uv = uvs[ i ];\n\n        // draw lines\n\n        ctx.beginPath();\n\n        a.set( 0, 0 );\n\n        for ( j = 0, jl = uv.length; j < jl; j++ ) {\n\n            u = uv[ j ];\n\n            a.x += u.x;\n            a.y += u.y;\n\n            if ( j == 0 ) {\n\n                ctx.moveTo( u.x * width, ( 1 - u.y ) * height );\n\n            } else {\n\n                ctx.lineTo( u.x * width, ( 1 - u.y ) * height );\n\n            }\n\n        }\n\n        ctx.closePath();\n        ctx.stroke();\n\n        a.divideScalar( jl );\n\n        // label the face number\n\n        ctx.font = \"12pt Arial bold\";\n        ctx.fillStyle = 'rgba( 0, 0, 0, 1.0 )';\n        ctx.fillText( i, a.x * width, ( 1 - a.y ) * height );\n\n        if ( a.x > 0.95 ) { // wrap x // 0.95 is arbitrary\n\n            ctx.fillText( i, ( a.x % 1 ) * width, ( 1 - a.y ) * height );\n\n        }\n\n        ctx.font = \"8pt Arial bold\";\n        ctx.fillStyle = 'rgba( 0, 0, 0, 1.0 )';\n\n        // label uv edge orders\n\n        for ( j = 0, jl = uv.length; j < jl; j++ ) {\n\n            u = uv[ j ];\n            b.addVectors( a, u ).divideScalar( 2 );\n\n            vnum = faces[ i ][ abc[ j ] ];\n            ctx.fillText( abc[ j ] + vnum, b.x * width, ( 1 - b.y ) * height );\n\n            if ( b.x > 0.95 ) {  // wrap x\n\n                ctx.fillText( abc[ j ] + vnum, ( b.x % 1 ) * width, ( 1 - b.y ) * height );\n\n            }\n\n        }\n\n    }\n\n    return canvas;\n\n}\n\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Utils/GeometryUtils.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Utils/GeometryUtils.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.GeometryUtils = {\n\n\t// Merge two geometries or geometry and geometry from object (using object's transform)\n\n\tmerge: function ( geometry1, geometry2, materialIndexOffset ) {\n\n\t\tconsole.warn( 'THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.' );\n\n\t\tvar matrix;\n\n\t\tif ( geometry2 instanceof THREE.Mesh ) {\n\n\t\t\tgeometry2.matrixAutoUpdate && geometry2.updateMatrix();\n\n\t\t\tmatrix = geometry2.matrix;\n\t\t\tgeometry2 = geometry2.geometry;\n\n\t\t}\n\n\t\tgeometry1.merge( geometry2, matrix, materialIndexOffset );\n\n\t},\n\n\t// Get random point in triangle (via barycentric coordinates)\n\t// \t(uniform distribution)\n\t// \thttp://www.cgafaq.info/wiki/Random_Point_In_Triangle\n\n\trandomPointInTriangle: function () {\n\n\t\tvar vector = new THREE.Vector3();\n\n\t\treturn function ( vectorA, vectorB, vectorC ) {\n\n\t\t\tvar point = new THREE.Vector3();\n\n\t\t\tvar a = THREE.Math.random16();\n\t\t\tvar b = THREE.Math.random16();\n\n\t\t\tif ( ( a + b ) > 1 ) {\n\n\t\t\t\ta = 1 - a;\n\t\t\t\tb = 1 - b;\n\n\t\t\t}\n\n\t\t\tvar c = 1 - a - b;\n\n\t\t\tpoint.copy( vectorA );\n\t\t\tpoint.multiplyScalar( a );\n\n\t\t\tvector.copy( vectorB );\n\t\t\tvector.multiplyScalar( b );\n\n\t\t\tpoint.add( vector );\n\n\t\t\tvector.copy( vectorC );\n\t\t\tvector.multiplyScalar( c );\n\n\t\t\tpoint.add( vector );\n\n\t\t\treturn point;\n\n\t\t};\n\n\t}(),\n\n\t// Get random point in face (triangle)\n\t// (uniform distribution)\n\n\trandomPointInFace: function ( face, geometry, useCachedAreas ) {\n\n\t\tvar vA, vB, vC;\n\n\t\tvA = geometry.vertices[ face.a ];\n\t\tvB = geometry.vertices[ face.b ];\n\t\tvC = geometry.vertices[ face.c ];\n\n\t\treturn THREE.GeometryUtils.randomPointInTriangle( vA, vB, vC );\n\n\t},\n\n\t// Get uniformly distributed random points in mesh\n\t// \t- create array with cumulative sums of face areas\n\t//  - pick random number from 0 to total area\n\t//  - find corresponding place in area array by binary search\n\t//\t- get random point in face\n\n\trandomPointsInGeometry: function ( geometry, n ) {\n\n\t\tvar face, i,\n\t\t\tfaces = geometry.faces,\n\t\t\tvertices = geometry.vertices,\n\t\t\til = faces.length,\n\t\t\ttotalArea = 0,\n\t\t\tcumulativeAreas = [],\n\t\t\tvA, vB, vC, vD;\n\n\t\t// precompute face areas\n\n\t\tfor ( i = 0; i < il; i ++ ) {\n\n\t\t\tface = faces[ i ];\n\n\t\t\tvA = vertices[ face.a ];\n\t\t\tvB = vertices[ face.b ];\n\t\t\tvC = vertices[ face.c ];\n\n\t\t\tface._area = THREE.GeometryUtils.triangleArea( vA, vB, vC );\n\n\t\t\ttotalArea += face._area;\n\n\t\t\tcumulativeAreas[ i ] = totalArea;\n\n\t\t}\n\n\t\t// binary search cumulative areas array\n\n\t\tfunction binarySearchIndices( value ) {\n\n\t\t\tfunction binarySearch( start, end ) {\n\n\t\t\t\t// return closest larger index\n\t\t\t\t// if exact number is not found\n\n\t\t\t\tif ( end < start )\n\t\t\t\t\treturn start;\n\n\t\t\t\tvar mid = start + Math.floor( ( end - start ) / 2 );\n\n\t\t\t\tif ( cumulativeAreas[ mid ] > value ) {\n\n\t\t\t\t\treturn binarySearch( start, mid - 1 );\n\n\t\t\t\t} else if ( cumulativeAreas[ mid ] < value ) {\n\n\t\t\t\t\treturn binarySearch( mid + 1, end );\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn mid;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar result = binarySearch( 0, cumulativeAreas.length - 1 )\n\t\t\treturn result;\n\n\t\t}\n\n\t\t// pick random face weighted by face area\n\n\t\tvar r, index,\n\t\t\tresult = [];\n\n\t\tvar stats = {};\n\n\t\tfor ( i = 0; i < n; i ++ ) {\n\n\t\t\tr = THREE.Math.random16() * totalArea;\n\n\t\t\tindex = binarySearchIndices( r );\n\n\t\t\tresult[ i ] = THREE.GeometryUtils.randomPointInFace( faces[ index ], geometry, true );\n\n\t\t\tif ( ! stats[ index ] ) {\n\n\t\t\t\tstats[ index ] = 1;\n\n\t\t\t} else {\n\n\t\t\t\tstats[ index ] += 1;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn result;\n\n\t},\n\n\trandomPointsInBufferGeometry: function ( geometry, n ) {\n\n\t\tvar i,\n\t\t\tvertices = geometry.attributes.position.array,\n\t\t\ttotalArea = 0,\n\t\t\tcumulativeAreas = [],\n\t\t\tvA, vB, vC;\n\n\t\t// precompute face areas\n\t\tvA = new THREE.Vector3();\n\t\tvB = new THREE.Vector3();\n\t\tvC = new THREE.Vector3();\n\n\t\t// geometry._areas = [];\n\t\tvar il = vertices.length / 9;\n\n\t\tfor ( i = 0; i < il; i ++ ) {\n\n\t\t\tvA.set( vertices[i * 9 + 0], vertices[i * 9 + 1], vertices[i * 9 + 2] );\n\t\t\tvB.set( vertices[i * 9 + 3], vertices[i * 9 + 4], vertices[i * 9 + 5] );\n\t\t\tvC.set( vertices[i * 9 + 6], vertices[i * 9 + 7], vertices[i * 9 + 8] );\n\n\t\t\tarea = THREE.GeometryUtils.triangleArea( vA, vB, vC );\n\t\t\ttotalArea += area;\n\n\t\t\tcumulativeAreas.push(totalArea);\n\t\t}\n\n\t\t// binary search cumulative areas array\n\n\t\tfunction binarySearchIndices( value ) {\n\n\t\t\tfunction binarySearch( start, end ) {\n\n\t\t\t\t// return closest larger index\n\t\t\t\t// if exact number is not found\n\n\t\t\t\tif ( end < start )\n\t\t\t\t\treturn start;\n\n\t\t\t\tvar mid = start + Math.floor( ( end - start ) / 2 );\n\n\t\t\t\tif ( cumulativeAreas[ mid ] > value ) {\n\n\t\t\t\t\treturn binarySearch( start, mid - 1 );\n\n\t\t\t\t} else if ( cumulativeAreas[ mid ] < value ) {\n\n\t\t\t\t\treturn binarySearch( mid + 1, end );\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn mid;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar result = binarySearch( 0, cumulativeAreas.length - 1 )\n\t\t\treturn result;\n\n\t\t}\n\n\t\t// pick random face weighted by face area\n\n\t\tvar r, index,\n\t\t\tresult = [];\n\n\t\tfor ( i = 0; i < n; i ++ ) {\n\n\t\t\tr = THREE.Math.random16() * totalArea;\n\n\t\t\tindex = binarySearchIndices( r );\n\n\t\t\t// result[ i ] = THREE.GeometryUtils.randomPointInFace( faces[ index ], geometry, true );\n\t\t\tvA.set( vertices[index * 9 + 0], vertices[index * 9 + 1], vertices[index * 9 + 2] );\n\t\t\tvB.set( vertices[index * 9 + 3], vertices[index * 9 + 4], vertices[index * 9 + 5] );\n\t\t\tvC.set( vertices[index * 9 + 6], vertices[index * 9 + 7], vertices[index * 9 + 8] );\n\t\t\tresult[ i ] = THREE.GeometryUtils.randomPointInTriangle( vA, vB, vC );\n\n\t\t}\n\n\t\treturn result;\n\n\t},\n\n\t// Get triangle area (half of parallelogram)\n\t// http://mathworld.wolfram.com/TriangleArea.html\n\n\ttriangleArea: function () {\n\n\t\tvar vector1 = new THREE.Vector3();\n\t\tvar vector2 = new THREE.Vector3();\n\n\t\treturn function ( vectorA, vectorB, vectorC ) {\n\n\t\t\tvector1.subVectors( vectorB, vectorA );\n\t\t\tvector2.subVectors( vectorC, vectorA );\n\t\t\tvector1.cross( vector2 );\n\n\t\t\treturn 0.5 * vector1.length();\n\n\t\t};\n\n\t}(),\n\n\tcenter: function ( geometry ) {\n\n\t\tconsole.warn( 'THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.' );\n\t\treturn geometry.center();\n\n\t}\n\n};"
        },
        "$:/plugins/rboue/Three.js/Lib/Effects/VREffect.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Effects/VREffect.js",
            "module-type": "library",
            "text": "/**\n * @author dmarcos / https://github.com/dmarcos\n *\n * It handles stereo rendering\n * If mozGetVRDevices and getVRDevices APIs are not available it gracefuly falls back to a\n * regular renderer\n *\n * The HMD supported is the Oculus DK1 and The Web API doesn't currently allow\n * to query for the display resolution (only the chrome API allows it).\n * The dimensions of the screen are temporarly hardcoded (1280 x 800).\n *\n * For VR mode to work it has to be used with the Oculus enabled builds of Firefox or Chrome:\n *\n * Firefox:\n *\n * OSX: http://people.mozilla.com/~vladimir/vr/firefox-33.0a1.en-US.mac.dmg\n * WIN: http://people.mozilla.com/~vladimir/vr/firefox-33.0a1.en-US.win64-x86_64.zip\n *\n * Chrome builds:\n *\n * https://drive.google.com/folderview?id=0BzudLt22BqGRbW9WTHMtOWMzNjQ&usp=sharing#list\n *\n */\nTHREE.VREffect = function ( renderer, done ) {\n\tthis._renderer = renderer;\n\n\tthis._init = function() {\n\t\tvar self = this;\n\t\tif ( !navigator.mozGetVRDevices && !navigator.getVRDevices ) {\n\t\t\tif ( done ) {\n\t\t\t\tdone(\"Your browser is not VR Ready\");\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif ( navigator.getVRDevices ) {\n\t\t\tnavigator.getVRDevices().then( gotVRDevices );\n\t\t} else {\n\t\t\tnavigator.mozGetVRDevices( gotVRDevices );\n\t\t}\n\t\tfunction gotVRDevices( devices ) {\n\t\t\tvar vrHMD;\n\t\t\tvar error;\n\t\t\tfor ( var i = 0; i < devices.length; ++i ) {\n\t\t\t\tif ( devices[i] instanceof HMDVRDevice ) {\n\t\t\t\t\tvrHMD = devices[i];\n\t\t\t\t\tself._vrHMD = vrHMD;\n\t\t\t\t\tself.leftEyeTranslation = vrHMD.getEyeTranslation( \"left\" );\n\t\t\t\t\tself.rightEyeTranslation = vrHMD.getEyeTranslation( \"right\" );\n\t\t\t\t\tself.leftEyeFOV = vrHMD.getRecommendedEyeFieldOfView( \"left\" );\n\t\t\t\t\tself.rightEyeFOV = vrHMD.getRecommendedEyeFieldOfView( \"right\" );\n\t\t\t\t\tbreak; // We keep the first we encounter\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( done ) {\n\t\t\t\tif ( !vrHMD ) {\n\t\t\t\t error = 'HMD not available';\n\t\t\t\t}\n\t\t\t\tdone( error );\n\t\t\t}\n\t\t}\n\t};\n\n\tthis._init();\n\n\tthis.render = function ( scene, camera ) {\n\t\tvar renderer = this._renderer;\n\t\tvar vrHMD = this._vrHMD;\n\t\trenderer.enableScissorTest( false );\n\t\t// VR render mode if HMD is available\n\t\tif ( vrHMD ) {\n\t\t\tthis.renderStereo.apply( this, arguments );\n\t\t\treturn;\n\t\t}\n\t\t// Regular render mode if not HMD\n\t\trenderer.render.apply( this._renderer , arguments );\n\t};\n\n\tthis.renderStereo = function( scene, camera, renderTarget, forceClear ) {\n\t\tvar cameraLeft;\n\t\tvar cameraRight;\n\t\tvar leftEyeTranslation = this.leftEyeTranslation;\n\t\tvar rightEyeTranslation = this.rightEyeTranslation;\n\t\tvar renderer = this._renderer;\n\t\tvar rendererWidth = renderer.domElement.width / renderer.devicePixelRatio;\n\t\tvar rendererHeight = renderer.domElement.height / renderer.devicePixelRatio;\n\t\tvar eyeDivisionLine = rendererWidth / 2;\n\t\trenderer.enableScissorTest( true );\n\t\trenderer.clear();\n\n\t\t// Grab camera matrix from user.\n\t\t// This is interpreted as the head base.\n\t\tif ( camera.matrixAutoUpdate ) {\n\t\t\tcamera.updateMatrix();\n\t\t}\n\t\tvar eyeWorldMatrix = camera.matrixWorld.clone();\n\n\t\tcameraLeft = camera.clone();\n\t\tcameraRight = camera.clone();\n\t\tcameraLeft.projectionMatrix = this.FovToProjection( this.leftEyeFOV );\n\t\tcameraRight.projectionMatrix = this.FovToProjection( this.rightEyeFOV );\n\t\tcameraLeft.position.add(new THREE.Vector3(\n\t\t\tleftEyeTranslation.x, leftEyeTranslation.y, leftEyeTranslation.z) );\n\t\tcameraRight.position.add(new THREE.Vector3(\n\t\t\trightEyeTranslation.x, rightEyeTranslation.y, rightEyeTranslation.z) );\n\n\t\t// render left eye\n\t\trenderer.setViewport( 0, 0, eyeDivisionLine, rendererHeight );\n\t\trenderer.setScissor( 0, 0, eyeDivisionLine, rendererHeight );\n\t\trenderer.render( scene, cameraLeft );\n\n\t\t// render right eye\n\t\trenderer.setViewport( eyeDivisionLine, 0, eyeDivisionLine, rendererHeight );\n\t\trenderer.setScissor( eyeDivisionLine, 0, eyeDivisionLine, rendererHeight );\n\t\trenderer.render( scene, cameraRight );\n\n\t};\n\n\tthis.setFullScreen = function( enable ) {\n\t\tvar renderer = this._renderer;\n\t\tvar vrHMD = this._vrHMD;\n\t\tvar canvasOriginalSize = this._canvasOriginalSize;\n\t\tif (!vrHMD) {\n\t\t\treturn;\n\t\t}\n\t\t// If state doesn't change we do nothing\n\t\tif ( enable === this._fullScreen ) {\n\t\t\treturn;\n\t\t}\n\t\tthis._fullScreen = !!enable;\n\n\t\t// VR Mode disabled\n\t\tif ( !enable ) {\n\t\t\t// Restores canvas original size\n\t\t\trenderer.setSize( canvasOriginalSize.width, canvasOriginalSize.height );\n\t\t\treturn;\n\t\t}\n\t\t// VR Mode enabled\n\t\tthis._canvasOriginalSize = {\n\t\t\twidth: renderer.domElement.width,\n\t\t\theight: renderer.domElement.height\n\t\t};\n\t\t// Hardcoded Rift display size\n\t\trenderer.setSize( 1280, 800, false );\n\t\tthis.startFullscreen();\n\t};\n\n\tthis.startFullscreen = function() {\n\t\tvar self = this;\n\t\tvar renderer = this._renderer;\n\t\tvar vrHMD = this._vrHMD;\n\t\tvar canvas = renderer.domElement;\n\t\tvar fullScreenChange =\n\t\t\tcanvas.mozRequestFullScreen? 'mozfullscreenchange' : 'webkitfullscreenchange';\n\n\t\tdocument.addEventListener( fullScreenChange, onFullScreenChanged, false );\n\t\tfunction onFullScreenChanged() {\n\t\t\tif ( !document.mozFullScreenElement && !document.webkitFullScreenElement ) {\n\t\t\t\tself.setFullScreen( false );\n\t\t\t}\n\t\t}\n\t\tif ( canvas.mozRequestFullScreen ) {\n\t\t\tcanvas.mozRequestFullScreen( { vrDisplay: vrHMD } );\n\t\t} else {\n\t\t\tcanvas.webkitRequestFullscreen( { vrDisplay: vrHMD } );\n\t\t}\n\t};\n\n\tthis.FovToNDCScaleOffset = function( fov ) {\n\t\tvar pxscale = 2.0 / (fov.leftTan + fov.rightTan);\n\t\tvar pxoffset = (fov.leftTan - fov.rightTan) * pxscale * 0.5;\n\t\tvar pyscale = 2.0 / (fov.upTan + fov.downTan);\n\t\tvar pyoffset = (fov.upTan - fov.downTan) * pyscale * 0.5;\n\t\treturn { scale: [pxscale, pyscale], offset: [pxoffset, pyoffset] };\n\t};\n\n\tthis.FovPortToProjection = function( fov, rightHanded /* = true */, zNear /* = 0.01 */, zFar /* = 10000.0 */ )\n\t{\n\t\trightHanded = rightHanded === undefined ? true : rightHanded;\n\t\tzNear = zNear === undefined ? 0.01 : zNear;\n\t\tzFar = zFar === undefined ? 10000.0 : zFar;\n\n\t\tvar handednessScale = rightHanded ? -1.0 : 1.0;\n\n\t\t// start with an identity matrix\n\t\tvar mobj = new THREE.Matrix4();\n\t\tvar m = mobj.elements;\n\n\t\t// and with scale/offset info for normalized device coords\n\t\tvar scaleAndOffset = this.FovToNDCScaleOffset(fov);\n\n\t\t// X result, map clip edges to [-w,+w]\n\t\tm[0*4+0] = scaleAndOffset.scale[0];\n\t\tm[0*4+1] = 0.0;\n\t\tm[0*4+2] = scaleAndOffset.offset[0] * handednessScale;\n\t\tm[0*4+3] = 0.0;\n\n\t\t// Y result, map clip edges to [-w,+w]\n\t\t// Y offset is negated because this proj matrix transforms from world coords with Y=up,\n\t\t// but the NDC scaling has Y=down (thanks D3D?)\n\t\tm[1*4+0] = 0.0;\n\t\tm[1*4+1] = scaleAndOffset.scale[1];\n\t\tm[1*4+2] = -scaleAndOffset.offset[1] * handednessScale;\n\t\tm[1*4+3] = 0.0;\n\n\t\t// Z result (up to the app)\n\t\tm[2*4+0] = 0.0;\n\t\tm[2*4+1] = 0.0;\n\t\tm[2*4+2] = zFar / (zNear - zFar) * -handednessScale;\n\t\tm[2*4+3] = (zFar * zNear) / (zNear - zFar);\n\n\t\t// W result (= Z in)\n\t\tm[3*4+0] = 0.0;\n\t\tm[3*4+1] = 0.0;\n\t\tm[3*4+2] = handednessScale;\n\t\tm[3*4+3] = 0.0;\n\n\t\tmobj.transpose();\n\n\t\treturn mobj;\n\t};\n\n\tthis.FovToProjection = function( fov, rightHanded /* = true */, zNear /* = 0.01 */, zFar /* = 10000.0 */ )\n\t{\n\t\tvar fovPort = {\n\t\t\tupTan: Math.tan(fov.upDegrees * Math.PI / 180.0),\n\t\t\tdownTan: Math.tan(fov.downDegrees * Math.PI / 180.0),\n\t\t\tleftTan: Math.tan(fov.leftDegrees * Math.PI / 180.0),\n\t\t\trightTan: Math.tan(fov.rightDegrees * Math.PI / 180.0)\n\t\t};\n\t\treturn this.FovPortToProjection(fovPort, rightHanded, zNear, zFar);\n\t};\n\n};"
        },
        "$:/plugins/rboue/Three.js/Lib/Effects/OculusRiftEffect.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Effects/OculusRiftEffect.js",
            "module-type": "library",
            "text": "/**\n * @author troffmo5 / http://github.com/troffmo5\n *\n * Effect to render the scene in stereo 3d side by side with lens distortion.\n * It is written to be used with the Oculus Rift (http://www.oculusvr.com/) but\n * it works also with other HMD using the same technology\n */\n\nTHREE.OculusRiftEffect = function ( renderer, options ) {\n\t// worldFactor indicates how many units is 1 meter\n\tvar worldFactor = (options && options.worldFactor) ? options.worldFactor: 1.0;\n\n\t// Specific HMD parameters\n\tvar HMD = (options && options.HMD) ? options.HMD: {\n\t\t// Parameters from the Oculus Rift DK1\n\t\thResolution: 1280,\n\t\tvResolution: 800,\n\t\thScreenSize: 0.14976,\n\t\tvScreenSize: 0.0936,\n\t\tinterpupillaryDistance: 0.064,\n\t\tlensSeparationDistance: 0.064,\n\t\teyeToScreenDistance: 0.041,\n\t\tdistortionK : [1.0, 0.22, 0.24, 0.0],\n\t\tchromaAbParameter: [ 0.996, -0.004, 1.014, 0.0]\n\t};\n\n\t// Perspective camera\n\tvar pCamera = new THREE.PerspectiveCamera();\n\tpCamera.matrixAutoUpdate = false;\n\tpCamera.target = new THREE.Vector3();\n\n\t// Orthographic camera\n\tvar oCamera = new THREE.OrthographicCamera( -1, 1, 1, -1, 1, 1000 );\n\toCamera.position.z = 1;\n\n\t// pre-render hooks\n\tthis.preLeftRender = function() {};\n\tthis.preRightRender = function() {};\n\n\trenderer.autoClear = false;\n\tvar emptyColor = new THREE.Color(\"black\");\n\n\t// Render target\n\tvar RTParams = { minFilter: THREE.LinearFilter, magFilter: THREE.NearestFilter, format: THREE.RGBAFormat };\n\tvar renderTarget = new THREE.WebGLRenderTarget( 640, 800, RTParams );\n\tvar RTMaterial = new THREE.ShaderMaterial( {\n\t\tuniforms: {\n\t\t\t\"texid\": { type: \"t\", value: renderTarget },\n\t\t\t\"scale\": { type: \"v2\", value: new THREE.Vector2(1.0,1.0) },\n\t\t\t\"scaleIn\": { type: \"v2\", value: new THREE.Vector2(1.0,1.0) },\n\t\t\t\"lensCenter\": { type: \"v2\", value: new THREE.Vector2(0.0,0.0) },\n\t\t\t\"hmdWarpParam\": { type: \"v4\", value: new THREE.Vector4(1.0,0.0,0.0,0.0) },\n\t\t\t\"chromAbParam\": { type: \"v4\", value: new THREE.Vector4(1.0,0.0,0.0,0.0) }\n\t\t},\n\t\tvertexShader: [\n\t\t\t\"varying vec2 vUv;\",\n\t\t\t\"void main() {\",\n\t\t\t\" vUv = uv;\",\n\t\t\t\"\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\t\t\t\"}\"\n\t\t].join(\"\\n\"),\n\n\t\tfragmentShader: [\n\t\t\t\"uniform vec2 scale;\",\n\t\t\t\"uniform vec2 scaleIn;\",\n\t\t\t\"uniform vec2 lensCenter;\",\n\t\t\t\"uniform vec4 hmdWarpParam;\",\n\t\t\t'uniform vec4 chromAbParam;',\n\t\t\t\"uniform sampler2D texid;\",\n\t\t\t\"varying vec2 vUv;\",\n\t\t\t\"void main()\",\n\t\t\t\"{\",\n\t\t\t\"  vec2 uv = (vUv*2.0)-1.0;\", // range from [0,1] to [-1,1]\n\t\t\t\"  vec2 theta = (uv-lensCenter)*scaleIn;\",\n\t\t\t\"  float rSq = theta.x*theta.x + theta.y*theta.y;\",\n\t\t\t\"  vec2 rvector = theta*(hmdWarpParam.x + hmdWarpParam.y*rSq + hmdWarpParam.z*rSq*rSq + hmdWarpParam.w*rSq*rSq*rSq);\",\n\t\t\t'  vec2 rBlue = rvector * (chromAbParam.z + chromAbParam.w * rSq);',\n\t\t\t\"  vec2 tcBlue = (lensCenter + scale * rBlue);\",\n\t\t\t\"  tcBlue = (tcBlue+1.0)/2.0;\", // range from [-1,1] to [0,1]\n\t\t\t\"  if (any(bvec2(clamp(tcBlue, vec2(0.0,0.0), vec2(1.0,1.0))-tcBlue))) {\",\n\t\t\t\"    gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\",\n\t\t\t\"    return;}\",\n\t\t\t\"  vec2 tcGreen = lensCenter + scale * rvector;\",\n\t\t\t\"  tcGreen = (tcGreen+1.0)/2.0;\", // range from [-1,1] to [0,1]\n\t\t\t\"  vec2 rRed = rvector * (chromAbParam.x + chromAbParam.y * rSq);\",\n\t\t\t\"  vec2 tcRed = lensCenter + scale * rRed;\",\n\t\t\t\"  tcRed = (tcRed+1.0)/2.0;\", // range from [-1,1] to [0,1]\n\t\t\t\"  gl_FragColor = vec4(texture2D(texid, tcRed).r, texture2D(texid, tcGreen).g, texture2D(texid, tcBlue).b, 1);\",\n\t\t\t\"}\"\n\t\t].join(\"\\n\")\n\t} );\n\n\tvar mesh = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), RTMaterial );\n\n\t// Final scene\n\tvar finalScene = new THREE.Scene();\n\tfinalScene.add( oCamera );\n\tfinalScene.add( mesh );\n\n    var left = {}, right = {};\n    var distScale = 1.0;\n\tthis.setHMD = function(v) {\n\t\tHMD = v;\n\t\t// Compute aspect ratio and FOV\n\t\tvar aspect = HMD.hResolution / (2*HMD.vResolution);\n\n\t\t// Fov is normally computed with:\n\t\t//   THREE.Math.radToDeg( 2*Math.atan2(HMD.vScreenSize,2*HMD.eyeToScreenDistance) );\n\t\t// But with lens distortion it is increased (see Oculus SDK Documentation)\n\t\tvar r = -1.0 - (4 * (HMD.hScreenSize/4 - HMD.lensSeparationDistance/2) / HMD.hScreenSize);\n\t\tdistScale = (HMD.distortionK[0] + HMD.distortionK[1] * Math.pow(r,2) + HMD.distortionK[2] * Math.pow(r,4) + HMD.distortionK[3] * Math.pow(r,6));\n\t\tvar fov = THREE.Math.radToDeg(2*Math.atan2(HMD.vScreenSize*distScale, 2*HMD.eyeToScreenDistance));\n\n\t\t// Compute camera projection matrices\n\t\tvar proj = (new THREE.Matrix4()).makePerspective( fov, aspect, 0.3, 10000 );\n\t\tvar h = 4 * (HMD.hScreenSize/4 - HMD.interpupillaryDistance/2) / HMD.hScreenSize;\n\t\tleft.proj = ((new THREE.Matrix4()).makeTranslation( h, 0.0, 0.0 )).multiply(proj);\n\t\tright.proj = ((new THREE.Matrix4()).makeTranslation( -h, 0.0, 0.0 )).multiply(proj);\n\n\t\t// Compute camera transformation matrices\n\t\tleft.tranform = (new THREE.Matrix4()).makeTranslation( -worldFactor * HMD.interpupillaryDistance/2, 0.0, 0.0 );\n\t\tright.tranform = (new THREE.Matrix4()).makeTranslation( worldFactor * HMD.interpupillaryDistance/2, 0.0, 0.0 );\n\n\t\t// Compute Viewport\n\t\tleft.viewport = [0, 0, HMD.hResolution/2, HMD.vResolution];\n\t\tright.viewport = [HMD.hResolution/2, 0, HMD.hResolution/2, HMD.vResolution];\n\n\t\t// Distortion shader parameters\n\t\tvar lensShift = 4 * (HMD.hScreenSize/4 - HMD.lensSeparationDistance/2) / HMD.hScreenSize;\n\t\tleft.lensCenter = new THREE.Vector2(lensShift, 0.0);\n\t\tright.lensCenter = new THREE.Vector2(-lensShift, 0.0);\n\n\t\tRTMaterial.uniforms['hmdWarpParam'].value = new THREE.Vector4(HMD.distortionK[0], HMD.distortionK[1], HMD.distortionK[2], HMD.distortionK[3]);\n\t\tRTMaterial.uniforms['chromAbParam'].value = new THREE.Vector4(HMD.chromaAbParameter[0], HMD.chromaAbParameter[1], HMD.chromaAbParameter[2], HMD.chromaAbParameter[3]);\n\t\tRTMaterial.uniforms['scaleIn'].value = new THREE.Vector2(1.0,1.0/aspect);\n\t\tRTMaterial.uniforms['scale'].value = new THREE.Vector2(1.0/distScale, 1.0*aspect/distScale);\n\n\t\t// Create render target\n\t\tif ( renderTarget ) renderTarget.dispose();\n\t\trenderTarget = new THREE.WebGLRenderTarget( HMD.hResolution*distScale/2, HMD.vResolution*distScale, RTParams );\n\t\tRTMaterial.uniforms[ \"texid\" ].value = renderTarget;\n\n\t}\t\n\tthis.getHMD = function() {return HMD};\n\n\tthis.setHMD(HMD);\t\n\n\tthis.setSize = function ( width, height ) {\n\t\tleft.viewport = [width/2 - HMD.hResolution/2, height/2 - HMD.vResolution/2, HMD.hResolution/2, HMD.vResolution];\n\t\tright.viewport = [width/2, height/2 - HMD.vResolution/2, HMD.hResolution/2, HMD.vResolution];\n\n\t\trenderer.setSize( width, height );\n\t};\n\n\tthis.render = function ( scene, camera ) {\n\t\tvar cc = renderer.getClearColor().clone();\n\n\t\t// Clear\n\t\trenderer.setClearColor(emptyColor);\n\t\trenderer.clear();\n\t\trenderer.setClearColor(cc);\n\n\t\t// camera parameters\n\t\tif (camera.matrixAutoUpdate) camera.updateMatrix();\n\n\t\t// Render left\n\t\tthis.preLeftRender();\n\n\t\tpCamera.projectionMatrix.copy(left.proj);\n\n\t\tpCamera.matrix.copy(camera.matrix).multiply(left.tranform);\n\t\tpCamera.matrixWorldNeedsUpdate = true;\n\n\t\trenderer.setViewport(left.viewport[0], left.viewport[1], left.viewport[2], left.viewport[3]);\n\n\t\tRTMaterial.uniforms['lensCenter'].value = left.lensCenter;\n\t\trenderer.render( scene, pCamera, renderTarget, true );\n\n\t\trenderer.render( finalScene, oCamera );\n\n\t\t// Render right\n\t\tthis.preRightRender();\n\n\t\tpCamera.projectionMatrix.copy(right.proj);\n\n\t\tpCamera.matrix.copy(camera.matrix).multiply(right.tranform);\n\t\tpCamera.matrixWorldNeedsUpdate = true;\n\n\t\trenderer.setViewport(right.viewport[0], right.viewport[1], right.viewport[2], right.viewport[3]);\n\n\t\tRTMaterial.uniforms['lensCenter'].value = right.lensCenter;\n\n\t\trenderer.render( scene, pCamera, renderTarget, true );\n\t\trenderer.render( finalScene, oCamera );\n\n\t};\n\n\tthis.dispose = function() {\n\t\tif ( RTMaterial ) {\n\t\t\tRTMaterial.dispose();\n\t\t}\n\t\tif ( renderTarget ) {\n\t\t\trenderTarget.dispose();\n\t\t}\n\t};\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Effects/ParallaxBarrierEffect.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Effects/ParallaxBarrierEffect.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n * @author marklundin / http://mark-lundin.com/\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.ParallaxBarrierEffect = function ( renderer ) {\n\n\tvar eyeRight = new THREE.Matrix4();\n\tvar eyeLeft = new THREE.Matrix4();\n\tvar focalLength = 125;\n\tvar _aspect, _near, _far, _fov;\n\n\tvar _cameraL = new THREE.PerspectiveCamera();\n\t_cameraL.matrixAutoUpdate = false;\n\n\tvar _cameraR = new THREE.PerspectiveCamera();\n\t_cameraR.matrixAutoUpdate = false;\n\n\tvar _scene = new THREE.Scene();\n\n\tvar _camera = new THREE.PerspectiveCamera( 53, 1, 1, 10000 );\n\t_camera.position.z = 2;\n\t_scene.add( _camera );\n\n\tvar _params = { minFilter: THREE.LinearFilter, magFilter: THREE.NearestFilter, format: THREE.RGBAFormat };\n\n\tvar _renderTargetL = new THREE.WebGLRenderTarget( 512, 512, _params );\n\tvar _renderTargetR = new THREE.WebGLRenderTarget( 512, 512, _params );\n\n\tvar _material = new THREE.ShaderMaterial( {\n\n\t\tuniforms: {\n\n\t\t\t\"mapLeft\": { type: \"t\", value: _renderTargetL },\n\t\t\t\"mapRight\": { type: \"t\", value: _renderTargetR }\n\n\t\t},\n\n\t\tvertexShader: [\n\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\"\tvUv = vec2( uv.x, uv.y );\",\n\t\t\t\"\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tfragmentShader: [\n\n\t\t\t\"uniform sampler2D mapLeft;\",\n\t\t\t\"uniform sampler2D mapRight;\",\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\"\tvec2 uv = vUv;\",\n\n\t\t\t\"\tif ( ( mod( gl_FragCoord.y, 2.0 ) ) > 1.00 ) {\",\n\n\t\t\t\"\t\tgl_FragColor = texture2D( mapLeft, uv );\",\n\n\t\t\t\"\t} else {\",\n\n\t\t\t\"\t\tgl_FragColor = texture2D( mapRight, uv );\",\n\n\t\t\t\"\t}\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t} );\n\n\tvar mesh = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), _material );\n\t_scene.add( mesh );\n\n\tthis.setSize = function ( width, height ) {\n\n\t\t_renderTargetL = new THREE.WebGLRenderTarget( width, height, _params );\n\t\t_renderTargetR = new THREE.WebGLRenderTarget( width, height, _params );\n\n\t\t_material.uniforms[ \"mapLeft\" ].value = _renderTargetL;\n\t\t_material.uniforms[ \"mapRight\" ].value = _renderTargetR;\n\n\t\trenderer.setSize( width, height );\n\n\t};\n\n\t/*\n\t * Renderer now uses an asymmetric perspective projection\n\t * (http://paulbourke.net/miscellaneous/stereographics/stereorender/).\n\t *\n\t * Each camera is offset by the eye seperation and its projection matrix is\n\t * also skewed asymetrically back to converge on the same projection plane.\n\t * Added a focal length parameter to, this is where the parallax is equal to 0.\n\t */\n\n\tthis.render = function ( scene, camera ) {\n\n\t\tscene.updateMatrixWorld();\n\n\t\tif ( camera.parent === undefined ) camera.updateMatrixWorld();\n\n\t\tvar hasCameraChanged = ( _aspect !== camera.aspect ) || ( _near !== camera.near ) || ( _far !== camera.far ) || ( _fov !== camera.fov );\n\n\t\tif ( hasCameraChanged ) {\n\n\t\t\t_aspect = camera.aspect;\n\t\t\t_near = camera.near;\n\t\t\t_far = camera.far;\n\t\t\t_fov = camera.fov;\n\n\t\t\tvar projectionMatrix = camera.projectionMatrix.clone();\n\t\t\tvar eyeSep = focalLength / 30 * 0.5;\n\t\t\tvar eyeSepOnProjection = eyeSep * _near / focalLength;\n\t\t\tvar ymax = _near * Math.tan( THREE.Math.degToRad( _fov * 0.5 ) );\n\t\t\tvar xmin, xmax;\n\n\t\t\t// translate xOffset\n\n\t\t\teyeRight.elements[12] = eyeSep;\n\t\t\teyeLeft.elements[12] = -eyeSep;\n\n\t\t\t// for left eye\n\n\t\t\txmin = -ymax * _aspect + eyeSepOnProjection;\n\t\t\txmax = ymax * _aspect + eyeSepOnProjection;\n\n\t\t\tprojectionMatrix.elements[0] = 2 * _near / ( xmax - xmin );\n\t\t\tprojectionMatrix.elements[8] = ( xmax + xmin ) / ( xmax - xmin );\n\n\t\t\t_cameraL.projectionMatrix.copy( projectionMatrix );\n\n\t\t\t// for right eye\n\n\t\t\txmin = -ymax * _aspect - eyeSepOnProjection;\n\t\t\txmax = ymax * _aspect - eyeSepOnProjection;\n\n\t\t\tprojectionMatrix.elements[0] = 2 * _near / ( xmax - xmin );\n\t\t\tprojectionMatrix.elements[8] = ( xmax + xmin ) / ( xmax - xmin );\n\n\t\t\t_cameraR.projectionMatrix.copy( projectionMatrix );\n\n\t\t}\n\n\t\t_cameraL.matrixWorld.copy( camera.matrixWorld ).multiply( eyeLeft );\n\t\t_cameraL.position.copy( camera.position );\n\t\t_cameraL.near = camera.near;\n\t\t_cameraL.far = camera.far;\n\n\t\trenderer.render( scene, _cameraL, _renderTargetL, true );\n\n\t\t_cameraR.matrixWorld.copy( camera.matrixWorld ).multiply( eyeRight );\n\t\t_cameraR.position.copy( camera.position );\n\t\t_cameraR.near = camera.near;\n\t\t_cameraR.far = camera.far;\n\n\t\trenderer.render( scene, _cameraR, _renderTargetR, true );\n\n\t\t_scene.updateMatrixWorld();\n\n\t\trenderer.render( _scene, _camera );\n\n\t};\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Effects/AnaglyphEffect.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Effects/AnaglyphEffect.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n * @author marklundin / http://mark-lundin.com/\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.AnaglyphEffect = function ( renderer, width, height ) {\n\n\tvar eyeRight = new THREE.Matrix4();\n\tvar eyeLeft = new THREE.Matrix4();\n\tvar focalLength = 125;\n\tvar _aspect, _near, _far, _fov;\n\n\tvar _cameraL = new THREE.PerspectiveCamera();\n\t_cameraL.matrixAutoUpdate = false;\n\n\tvar _cameraR = new THREE.PerspectiveCamera();\n\t_cameraR.matrixAutoUpdate = false;\n\n\tvar _camera = new THREE.OrthographicCamera( -1, 1, 1, - 1, 0, 1 );\n\n\tvar _scene = new THREE.Scene();\n\n\tvar _params = { minFilter: THREE.LinearFilter, magFilter: THREE.NearestFilter, format: THREE.RGBAFormat };\n\n\tif ( width === undefined ) width = 512;\n\tif ( height === undefined ) height = 512;\n\n\tvar _renderTargetL = new THREE.WebGLRenderTarget( width, height, _params );\n\tvar _renderTargetR = new THREE.WebGLRenderTarget( width, height, _params );\n\n\tvar _material = new THREE.ShaderMaterial( {\n\n\t\tuniforms: {\n\n\t\t\t\"mapLeft\": { type: \"t\", value: _renderTargetL },\n\t\t\t\"mapRight\": { type: \"t\", value: _renderTargetR }\n\n\t\t},\n\n\t\tvertexShader: [\n\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\"\tvUv = vec2( uv.x, uv.y );\",\n\t\t\t\"\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tfragmentShader: [\n\n\t\t\t\"uniform sampler2D mapLeft;\",\n\t\t\t\"uniform sampler2D mapRight;\",\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\"\tvec4 colorL, colorR;\",\n\t\t\t\"\tvec2 uv = vUv;\",\n\n\t\t\t\"\tcolorL = texture2D( mapLeft, uv );\",\n\t\t\t\"\tcolorR = texture2D( mapRight, uv );\",\n\n\t\t\t\t// http://3dtv.at/Knowhow/AnaglyphComparison_en.aspx\n\n\t\t\t\"\tgl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t} );\n\n\tvar mesh = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), _material );\n\t_scene.add( mesh );\n\n\tthis.setSize = function ( width, height ) {\n\n\t\tif ( _renderTargetL ) _renderTargetL.dispose();\n\t\tif ( _renderTargetR ) _renderTargetR.dispose();\n\t\t_renderTargetL = new THREE.WebGLRenderTarget( width, height, _params );\n\t\t_renderTargetR = new THREE.WebGLRenderTarget( width, height, _params );\n\n\t\t_material.uniforms[ \"mapLeft\" ].value = _renderTargetL;\n\t\t_material.uniforms[ \"mapRight\" ].value = _renderTargetR;\n\n\t\trenderer.setSize( width, height );\n\n\t};\n\n\t/*\n\t * Renderer now uses an asymmetric perspective projection\n\t * (http://paulbourke.net/miscellaneous/stereographics/stereorender/).\n\t *\n\t * Each camera is offset by the eye seperation and its projection matrix is\n\t * also skewed asymetrically back to converge on the same projection plane.\n\t * Added a focal length parameter to, this is where the parallax is equal to 0.\n\t */\n\n\tthis.render = function ( scene, camera ) {\n\n\t\tscene.updateMatrixWorld();\n\n\t\tif ( camera.parent === undefined ) camera.updateMatrixWorld();\n\n\t\tvar hasCameraChanged = ( _aspect !== camera.aspect ) || ( _near !== camera.near ) || ( _far !== camera.far ) || ( _fov !== camera.fov );\n\n\t\tif ( hasCameraChanged ) {\n\n\t\t\t_aspect = camera.aspect;\n\t\t\t_near = camera.near;\n\t\t\t_far = camera.far;\n\t\t\t_fov = camera.fov;\n\n\t\t\tvar projectionMatrix = camera.projectionMatrix.clone();\n\t\t\tvar eyeSep = focalLength / 30 * 0.5;\n\t\t\tvar eyeSepOnProjection = eyeSep * _near / focalLength;\n\t\t\tvar ymax = _near * Math.tan( THREE.Math.degToRad( _fov * 0.5 ) );\n\t\t\tvar xmin, xmax;\n\n\t\t\t// translate xOffset\n\n\t\t\teyeRight.elements[12] = eyeSep;\n\t\t\teyeLeft.elements[12] = -eyeSep;\n\n\t\t\t// for left eye\n\n\t\t\txmin = -ymax * _aspect + eyeSepOnProjection;\n\t\t\txmax = ymax * _aspect + eyeSepOnProjection;\n\n\t\t\tprojectionMatrix.elements[0] = 2 * _near / ( xmax - xmin );\n\t\t\tprojectionMatrix.elements[8] = ( xmax + xmin ) / ( xmax - xmin );\n\n\t\t\t_cameraL.projectionMatrix.copy( projectionMatrix );\n\n\t\t\t// for right eye\n\n\t\t\txmin = -ymax * _aspect - eyeSepOnProjection;\n\t\t\txmax = ymax * _aspect - eyeSepOnProjection;\n\n\t\t\tprojectionMatrix.elements[0] = 2 * _near / ( xmax - xmin );\n\t\t\tprojectionMatrix.elements[8] = ( xmax + xmin ) / ( xmax - xmin );\n\n\t\t\t_cameraR.projectionMatrix.copy( projectionMatrix );\n\n\t\t}\n\n\t\t_cameraL.matrixWorld.copy( camera.matrixWorld ).multiply( eyeLeft );\n\t\t_cameraL.position.copy( camera.position );\n\t\t_cameraL.near = camera.near;\n\t\t_cameraL.far = camera.far;\n\n\t\trenderer.render( scene, _cameraL, _renderTargetL, true );\n\n\t\t_cameraR.matrixWorld.copy( camera.matrixWorld ).multiply( eyeRight );\n\t\t_cameraR.position.copy( camera.position );\n\t\t_cameraR.near = camera.near;\n\t\t_cameraR.far = camera.far;\n\n\t\trenderer.render( scene, _cameraR, _renderTargetR, true );\n\n\t\trenderer.render( _scene, _camera );\n\n\t};\n\n\tthis.dispose = function() {\n\t\tif ( _renderTargetL ) _renderTargetL.dispose();\n\t\tif ( _renderTargetR ) _renderTargetR.dispose();\n\t}\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Effects/StereoEffect.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Effects/StereoEffect.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n * @authod mrdoob / http://mrdoob.com/\n * @authod arodic / http://aleksandarrodic.com/\n */\n\nTHREE.StereoEffect = function ( renderer ) {\n\n\t// API\n\n\tthis.separation = 3;\n\n\t// internals\n\n\tvar _width, _height;\n\n\tvar _position = new THREE.Vector3();\n\tvar _quaternion = new THREE.Quaternion();\n\tvar _scale = new THREE.Vector3();\n\n\tvar _cameraL = new THREE.PerspectiveCamera();\n\tvar _cameraR = new THREE.PerspectiveCamera();\n\n\t// initialization\n\n\trenderer.autoClear = false;\n\n\tthis.setSize = function ( width, height ) {\n\n\t\t_width = width / 2;\n\t\t_height = height;\n\n\t\trenderer.setSize( width, height );\n\n\t};\n\n\tthis.render = function ( scene, camera ) {\n\n\t\tscene.updateMatrixWorld();\n\n\t\tif ( camera.parent === undefined ) camera.updateMatrixWorld();\n\t\n\t\tcamera.matrixWorld.decompose( _position, _quaternion, _scale );\n\n\t\t// left\n\n\t\t_cameraL.fov = camera.fov;\n\t\t_cameraL.aspect = 0.5 * camera.aspect;\n\t\t_cameraL.near = camera.near;\n\t\t_cameraL.far = camera.far;\n\t\t_cameraL.updateProjectionMatrix();\n\n\t\t_cameraL.position.copy( _position );\n\t\t_cameraL.quaternion.copy( _quaternion );\n\t\t_cameraL.translateX( - this.separation );\n\n\t\t// right\n\n\t\t_cameraR.near = camera.near;\n\t\t_cameraR.far = camera.far;\n\t\t_cameraR.projectionMatrix = _cameraL.projectionMatrix;\n\n\t\t_cameraR.position.copy( _position );\n\t\t_cameraR.quaternion.copy( _quaternion );\n\t\t_cameraR.translateX( this.separation );\n\n\t\t//\n\n\t\trenderer.setViewport( 0, 0, _width * 2, _height );\n\t\trenderer.clear();\n\n\t\trenderer.setViewport( 0, 0, _width, _height );\n\t\trenderer.render( scene, _cameraL );\n\n\t\trenderer.setViewport( _width, 0, _width, _height );\n\t\trenderer.render( scene, _cameraR );\n\n\t};\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Effects/AsciiEffect.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Effects/AsciiEffect.js",
            "module-type": "library",
            "text": "/*\n * @author zz85 / https://github.com/zz85\n *\n * Ascii generation is based on http://www.nihilogic.dk/labs/jsascii/\n * Maybe more about this later with a blog post at http://lab4games.net/zz85/blog\n *\n * 16 April 2012 - @blurspline\n */\n\nTHREE.AsciiEffect = function ( renderer, charSet, options ) {\n\n\t// its fun to create one your own!\n\n\tcharSet = ( charSet === undefined ) ? ' .:-=+*#%@' : charSet;\n\n\t// ' .,:;=|iI+hHOE#`$';\n\t// darker bolder character set from https://github.com/saw/Canvas-ASCII-Art/\n\t// ' .\\'`^\",:;Il!i~+_-?][}{1)(|/tfjrxnuvczXYUJCLQ0OZmwqpdbkhao*#MW&8%B@$'.split('');\n\n\tif ( !options ) options = {};\n\n\t// Some ASCII settings\n\n\tvar bResolution = !options['resolution'] ? 0.15 : options['resolution']; // Higher for more details\n\tvar iScale = !options['scale'] ? 1 : options['scale'];\n\tvar bColor = !options['color'] ? false : options['color']; // nice but slows down rendering!\n\tvar bAlpha = !options['alpha'] ? false : options['alpha']; // Transparency\n\tvar bBlock = !options['block'] ? false : options['block']; // blocked characters. like good O dos\n\tvar bInvert = !options['invert'] ? false : options['invert']; // black is white, white is black\n\n\tvar strResolution = 'low';\n\n\tvar width, height;\n\n\tvar domElement = document.createElement('div');\n\tdomElement.style.cursor = 'default';\n\n\tvar oAscii = document.createElement(\"table\");\n\tdomElement.appendChild( oAscii );\n\n\tvar iWidth, iHeight;\n\tvar oImg;\n\n\tthis.setSize = function ( w, h ) {\n\n\t\twidth = w;\n\t\theight = h;\n\n\t\trenderer.setSize( w, h );\n\n\t\tinitAsciiSize();\n\n\t};\n\n\n\tthis.render = function ( scene, camera ) {\n\n\t\trenderer.render( scene, camera );\n\t\tasciifyImage( renderer, oAscii );\n\n\t};\n\n\tthis.domElement = domElement;\n\n\n\t// Throw in ascii library from http://www.nihilogic.dk/labs/jsascii/jsascii.js\n\n\t/*\n\t* jsAscii 0.1\n\t* Copyright (c) 2008 Jacob Seidelin, jseidelin@nihilogic.dk, http://blog.nihilogic.dk/\n\t* MIT License [http://www.nihilogic.dk/licenses/mit-license.txt]\n\t*/\n\n\tfunction initAsciiSize() {\n\n\t\tiWidth = Math.round( width * fResolution );\n\t\tiHeight = Math.round( height * fResolution );\n\n\t\toCanvas.width = iWidth;\n\t\toCanvas.height = iHeight;\n\t\t// oCanvas.style.display = \"none\";\n\t\t// oCanvas.style.width = iWidth;\n\t\t// oCanvas.style.height = iHeight;\n\n\t\toImg = renderer.domElement;\n\n\t\tif ( oImg.style.backgroundColor ) {\n\n\t\t\toAscii.rows[0].cells[0].style.backgroundColor = oImg.style.backgroundColor;\n\t\t\toAscii.rows[0].cells[0].style.color = oImg.style.color;\n\n\t\t}\n\n\t\toAscii.cellSpacing = 0;\n\t\toAscii.cellPadding = 0;\n\n\t\tvar oStyle = oAscii.style;\n\t\toStyle.display = \"inline\";\n\t\toStyle.width = Math.round(iWidth/fResolution*iScale) + \"px\";\n\t\toStyle.height = Math.round(iHeight/fResolution*iScale) + \"px\";\n\t\toStyle.whiteSpace = \"pre\";\n\t\toStyle.margin = \"0px\";\n\t\toStyle.padding = \"0px\";\n\t\toStyle.letterSpacing = fLetterSpacing + \"px\";\n\t\toStyle.fontFamily = strFont;\n\t\toStyle.fontSize = fFontSize + \"px\";\n\t\toStyle.lineHeight = fLineHeight + \"px\";\n\t\toStyle.textAlign = \"left\";\n\t\toStyle.textDecoration = \"none\";\n\t}\n\n\n\tvar aDefaultCharList = (\" .,:;i1tfLCG08@\").split(\"\");\n\tvar aDefaultColorCharList = (\" CGO08@\").split(\"\");\n\tvar strFont = \"courier new, monospace\";\n\n\tvar oCanvasImg = renderer.domElement;\n\n\tvar oCanvas = document.createElement(\"canvas\");\n\tif (!oCanvas.getContext) {\n\t\treturn;\n\t}\n\n\tvar oCtx = oCanvas.getContext(\"2d\");\n\tif (!oCtx.getImageData) {\n\t\treturn;\n\t}\n\n\tvar aCharList = (bColor ? aDefaultColorCharList : aDefaultCharList);\n\n\tif (charSet) aCharList = charSet;\n\n\tvar fResolution = 0.5;\n\n\tswitch ( strResolution ) {\n\n\t\tcase \"low\" : \tfResolution = 0.25; break;\n\t\tcase \"medium\" : fResolution = 0.5; break;\n\t\tcase \"high\" : \tfResolution = 1; break;\n\n\t}\n\n\tif ( bResolution ) fResolution = bResolution;\n\n\t// Setup dom\n\n\tvar fFontSize = (2/fResolution)*iScale;\n\tvar fLineHeight = (2/fResolution)*iScale;\n\n\t// adjust letter-spacing for all combinations of scale and resolution to get it to fit the image width.\n\n\tvar fLetterSpacing = 0;\n\n\tif ( strResolution == \"low\" ) {\n\n\t\tswitch (iScale) {\n\t\t\tcase 1 : fLetterSpacing = -1; break;\n\t\t\tcase 2 :\n\t\t\tcase 3 : fLetterSpacing = -2.1; break;\n\t\t\tcase 4 : fLetterSpacing = -3.1; break;\n\t\t\tcase 5 : fLetterSpacing = -4.15; break;\n\t\t}\n\n\t}\n\n\tif ( strResolution == \"medium\" ) {\n\n\t\tswitch (iScale) {\n\t\t\tcase 1 : fLetterSpacing = 0; break;\n\t\t\tcase 2 : fLetterSpacing = -1; break;\n\t\t\tcase 3 : fLetterSpacing = -1.04; break;\n\t\t\tcase 4 :\n\t\t\tcase 5 : fLetterSpacing = -2.1; break;\n\t\t}\n\n\t}\n\n\tif ( strResolution == \"high\" ) {\n\n\t\tswitch (iScale) {\n\t\t\tcase 1 :\n\t\t\tcase 2 : fLetterSpacing = 0; break;\n\t\t\tcase 3 :\n\t\t\tcase 4 :\n\t\t\tcase 5 : fLetterSpacing = -1; break;\n\t\t}\n\n\t}\n\n\n\t// can't get a span or div to flow like an img element, but a table works?\n\n\n\t// convert img element to ascii\n\n\tfunction asciifyImage( canvasRenderer, oAscii ) {\n\n\t\toCtx.clearRect( 0, 0, iWidth, iHeight );\n\t\toCtx.drawImage( oCanvasImg, 0, 0, iWidth, iHeight );\n\t\tvar oImgData = oCtx.getImageData(0, 0, iWidth, iHeight).data;\n\n\t\t// Coloring loop starts now\n\t\tvar strChars = \"\";\n\n\t\t// console.time('rendering');\n\n\t\tfor (var y=0;y<iHeight;y+=2) {\n\t\t\tfor (var x=0;x<iWidth;x++) {\n\t\t\t\tvar iOffset = (y*iWidth + x) * 4;\n\n\t\t\t\tvar iRed = oImgData[iOffset];\n\t\t\t\tvar iGreen = oImgData[iOffset + 1];\n\t\t\t\tvar iBlue = oImgData[iOffset + 2];\n\t\t\t\tvar iAlpha = oImgData[iOffset + 3];\n\t\t\t\tvar iCharIdx;\n\n\t\t\t\tvar fBrightness;\n\n\t\t\t\tfBrightness = (0.3*iRed + 0.59*iGreen + 0.11*iBlue) / 255;\n\t\t\t\t// fBrightness = (0.3*iRed + 0.5*iGreen + 0.3*iBlue) / 255;\n\n\t\t\t\tif (iAlpha == 0) {\n\t\t\t\t\t// should calculate alpha instead, but quick hack :)\n\t\t\t\t\t//fBrightness *= (iAlpha / 255);\n\t\t\t\t\tfBrightness = 1;\n\n\t\t\t\t}\n\n\t\t\t\tiCharIdx = Math.floor((1-fBrightness) * (aCharList.length-1));\n\n\t\t\t\tif (bInvert) {\n\t\t\t\t\tiCharIdx = aCharList.length - iCharIdx - 1;\n\t\t\t\t}\n\n\t\t\t\t// good for debugging\n\t\t\t\t//fBrightness = Math.floor(fBrightness * 10);\n\t\t\t\t//strThisChar = fBrightness;\n\n\t\t\t\tvar strThisChar = aCharList[iCharIdx];\n\n\t\t\t\tif (strThisChar===undefined || strThisChar == \" \")\n\t\t\t\t\tstrThisChar = \"&nbsp;\";\n\n\t\t\t\tif (bColor) {\n\t\t\t\t\tstrChars += \"<span style='\"\n\t\t\t\t\t\t+ \"color:rgb(\"+iRed+\",\"+iGreen+\",\"+iBlue+\");\"\n\t\t\t\t\t\t+ (bBlock ? \"background-color:rgb(\"+iRed+\",\"+iGreen+\",\"+iBlue+\");\" : \"\")\n\t\t\t\t\t\t+ (bAlpha ? \"opacity:\" + (iAlpha/255) + \";\" : \"\")\n\t\t\t\t\t\t+ \"'>\" + strThisChar + \"</span>\";\n\t\t\t\t} else {\n\t\t\t\t\tstrChars += strThisChar;\n\t\t\t\t}\n\t\t\t}\n\t\t\tstrChars += \"<br/>\";\n\t\t}\n\n\t\toAscii.innerHTML = \"<tr><td>\" + strChars + \"</td></tr>\";\n\n\t\t// console.timeEnd('rendering');\n\n\t\t// return oAscii;\n\t}\n\n\t// end modified asciifyImage block\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Exporters/OBJExporter.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Exporters/OBJExporter.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.OBJExporter = function () {};\n\nTHREE.OBJExporter.prototype = {\n\n\tconstructor: THREE.OBJExporter,\n\n\tparse: function ( geometry ) {\n\n\t\tvar output = '';\n\n\t\tfor ( var i = 0, l = geometry.vertices.length; i < l; i ++ ) {\n\n\t\t\tvar vertex = geometry.vertices[ i ];\n\t\t\toutput += 'v ' + vertex.x + ' ' + vertex.y + ' ' + vertex.z + '\\n';\n\n\t\t}\n\n\t\t// uvs\n\n\t\tfor ( var i = 0, l = geometry.faceVertexUvs[ 0 ].length; i < l; i ++ ) {\n\n\t\t\tvar vertexUvs = geometry.faceVertexUvs[ 0 ][ i ];\n\n\t\t\tfor ( var j = 0; j < vertexUvs.length; j ++ ) {\n\n\t\t\t\tvar uv = vertexUvs[ j ];\n\t\t\t\toutput += 'vt ' + uv.x + ' ' + uv.y + '\\n';\n\n\t\t\t}\n\n\t\t}\n\n\t\t// normals\n\n\t\tfor ( var i = 0, l = geometry.faces.length; i < l; i ++ ) {\n\n\t\t\tvar normals = geometry.faces[ i ].vertexNormals;\n\n\t\t\tfor ( var j = 0; j < normals.length; j ++ ) {\n\n\t\t\t\tvar normal = normals[ j ];\n\t\t\t\toutput += 'vn ' + normal.x + ' ' + normal.y + ' ' + normal.z + '\\n';\n\n\t\t\t}\n\n\t\t}\n\n\t\t// faces\n\n\t\tfor ( var i = 0, j = 1, l = geometry.faces.length; i < l; i ++, j += 3 ) {\n\n\t\t\tvar face = geometry.faces[ i ];\n\n\t\t\toutput += 'f ';\n\t\t\toutput += ( face.a + 1 ) + '/' + ( j ) + '/' + ( j ) + ' ';\n\t\t\toutput += ( face.b + 1 ) + '/' + ( j + 1 ) + '/' + ( j + 1 ) + ' ';\n\t\t\toutput += ( face.c + 1 ) + '/' + ( j + 2 ) + '/' + ( j + 2 ) + '\\n';\n\n\t\t}\n\n\t\treturn output;\n\n\t}\n\n}\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Exporters/STLExporter.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Exporters/STLExporter.js",
            "module-type": "library",
            "text": "/**\n * @author kovacsv / http://kovacsv.hu/\n * @author mrdoob / http://mrdoob.com/\n */\n \nTHREE.STLExporter = function () {};\n\nTHREE.STLExporter.prototype = {\n\n\tconstructor: THREE.STLExporter,\n\n\tparse: ( function () {\n\n\t\tvar vector = new THREE.Vector3();\n\t\tvar normalMatrixWorld = new THREE.Matrix3();\n\n\t\treturn function ( scene ) {\n\n\t\t\tvar output = '';\n\n\t\t\toutput += 'solid exported\\n';\n\n\t\t\tscene.traverse( function ( object ) {\n\n\t\t\t\tif ( object instanceof THREE.Mesh ) {\n\n\t\t\t\t\tvar geometry = object.geometry;\n\t\t\t\t\tvar matrixWorld = object.matrixWorld;\n\n\t\t\t\t\tif ( geometry instanceof THREE.Geometry ) {\n\n\t\t\t\t\t\tvar vertices = geometry.vertices;\n\t\t\t\t\t\tvar faces = geometry.faces;\n\n\t\t\t\t\t\tnormalMatrixWorld.getNormalMatrix( matrixWorld );\n\n\t\t\t\t\t\tfor ( var i = 0, l = faces.length; i < l; i ++ ) {\n\n\t\t\t\t\t\t\tvar face = faces[ i ];\n\n\t\t\t\t\t\t\tvector.copy( face.normal ).applyMatrix3( normalMatrixWorld ).normalize();\n\n\t\t\t\t\t\t\toutput += '\\tfacet normal ' + vector.x + ' ' + vector.y + ' ' + vector.z + '\\n';\n\t\t\t\t\t\t\toutput += '\\t\\touter loop\\n';\n\n\t\t\t\t\t\t\tvar indices = [ face.a, face.b, face.c ];\n\n\t\t\t\t\t\t\tfor ( var j = 0; j < 3; j ++ ) {\n\n\t\t\t\t\t\t\t\tvector.copy( vertices[ indices[ j ] ] ).applyMatrix4( matrixWorld );\n\n\t\t\t\t\t\t\t\toutput += '\\t\\t\\tvertex ' + vector.x + ' ' + vector.y + ' ' + vector.z + '\\n';\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\toutput += '\\t\\tendloop\\n';\n\t\t\t\t\t\t\toutput += '\\tendfacet\\n';\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t\toutput += 'endsolid exported\\n';\n\n\t\t\treturn output;\n\n\t\t};\n\n\t}() )\n\n};"
        },
        "$:/plugins/rboue/Three.js/Lib/Exporters/MaterialExporter.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Exporters/MaterialExporter.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.MaterialExporter = function () {};\n\nTHREE.MaterialExporter.prototype = {\n\n\tconstructor: THREE.MaterialExporter,\n\n\tparse: function ( material ) {\n\n\t\tvar output = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.2,\n\t\t\t\ttype: 'material',\n\t\t\t\tgenerator: 'MaterialExporter'\n\t\t\t}\n\t\t};\n\n\t\toutput.uuid = material.uuid;\n\n\t\tif ( material.name !== \"\" ) output.name = material.name;\n\n\t\tif ( material instanceof THREE.MeshBasicMaterial ) {\n\n\t\t\toutput.type = 'MeshBasicMaterial';\n\t\t\toutput.color = material.color.getHex();\n\t\t\tif ( material.vertexColors !== THREE.NoColors ) output.vertexColors = material.vertexColors;\n\t\t\tif ( material.blending !== THREE.NormalBlending ) output.blending = material.blending;\n\t\t\tif ( material.side !== THREE.FrontSide ) output.side = material.side;\n\t\t\toutput.opacity = material.opacity;\n\t\t\toutput.transparent = material.transparent;\n\t\t\toutput.wireframe = material.wireframe;\n\n\t\t} else if ( material instanceof THREE.MeshLambertMaterial ) {\n\n\t\t\toutput.type = 'MeshLambertMaterial';\n\t\t\toutput.color = material.color.getHex();\n\t\t\toutput.ambient = material.ambient.getHex();\n\t\t\toutput.emissive = material.emissive.getHex();\n\t\t\tif ( material.vertexColors !== THREE.NoColors ) output.vertexColors = material.vertexColors;\n\t\t\tif ( material.blending !== THREE.NormalBlending ) output.blending = material.blending;\n\t\t\tif ( material.side !== THREE.FrontSide ) output.side = material.side;\n\t\t\toutput.opacity = material.opacity;\n\t\t\toutput.transparent = material.transparent;\n\t\t\toutput.wireframe = material.wireframe;\n\n\t\t} else if ( material instanceof THREE.MeshPhongMaterial ) {\n\n\t\t\toutput.type = 'MeshPhongMaterial';\n\t\t\toutput.color = material.color.getHex();\n\t\t\toutput.ambient = material.ambient.getHex();\n\t\t\toutput.emissive = material.emissive.getHex();\n\t\t\toutput.specular = material.specular.getHex();\n\t\t\toutput.shininess = material.shininess;\n\t\t\tif ( material.vertexColors !== THREE.NoColors ) output.vertexColors = material.vertexColors;\n\t\t\tif ( material.blending !== THREE.NormalBlending ) output.blending = material.blending;\n\t\t\tif ( material.side !== THREE.FrontSide ) output.side = material.side;\n\t\t\toutput.opacity = material.opacity;\n\t\t\toutput.transparent = material.transparent;\n\t\t\toutput.wireframe = material.wireframe;\n\n\t\t} else if ( material instanceof THREE.MeshNormalMaterial ) {\n\n\t\t\toutput.type = 'MeshNormalMaterial';\n\t\t\tif ( material.blending !== THREE.NormalBlending ) output.blending = material.blending;\n\t\t\tif ( material.side !== THREE.FrontSide ) output.side = material.side;\n\t\t\toutput.opacity = material.opacity;\n\t\t\toutput.transparent = material.transparent;\n\t\t\toutput.wireframe = material.wireframe;\n\n\t\t} else if ( material instanceof THREE.MeshDepthMaterial ) {\n\n\t\t\toutput.type = 'MeshDepthMaterial';\n\t\t\tif ( material.blending !== THREE.NormalBlending ) output.blending = material.blending;\n\t\t\tif ( material.side !== THREE.FrontSide ) output.side = material.side;\n\t\t\toutput.opacity = material.opacity;\n\t\t\toutput.transparent = material.transparent;\n\t\t\toutput.wireframe = material.wireframe;\n\n\t\t} else if ( material instanceof THREE.MeshFaceMaterial ) {\n\n\t\t\toutput.type = 'MeshFaceMaterial';\n\t\t\toutput.materials = [];\n\n\t\t\tfor ( var i = 0, l = material.materials.length; i < l; i ++ ) {\n\n\t\t\t\toutput.materials.push( this.parse( material.materials[ i ] ) );\n\n\t\t\t}\n\n\t\t} else if ( material instanceof THREE.ShaderMaterial ) {\n\n\t\t\toutput.type = 'ShaderMaterial';\n\t\t\toutput.uniforms = material.uniforms;\n\t\t\toutput.vertexShader = material.vertexShader;\n\t\t\toutput.fragmentShader = material.fragmentShader;\n\n\t\t} else if ( material instanceof THREE.SpriteMaterial ) {\n\n\t\t\toutput.type = 'SpriteMaterial';\n\t\t\toutput.color = material.color.getHex();\n\t\t\toutput.opacity = material.opacity;\n\t\t\toutput.transparent = material.transparent;\n\n\t\t}\n\n\t\treturn output;\n\n\t}\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Exporters/BufferGeometryExporter.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Exporters/BufferGeometryExporter.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.BufferGeometryExporter = function () {};\n\nTHREE.BufferGeometryExporter.prototype = {\n\n\tconstructor: THREE.BufferGeometryExporter,\n\n\tparse: function ( geometry ) {\n\n\t\tvar output = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.0,\n\t\t\t\ttype: 'BufferGeometry',\n\t\t\t\tgenerator: 'BufferGeometryExporter'\n\t\t\t},\n\t\t\tattributes: {\n\t\t\t}\n\t\t};\n\n\t\tvar attributes = geometry.attributes;\n\t\tvar offsets = geometry.offsets;\n\t\tvar boundingSphere = geometry.boundingSphere;\n\n\t\tfor ( var key in attributes ) {\n\n\t\t\tvar attribute = attributes[ key ];\n\n\t\t\tvar array = [], typeArray = attribute.array;\n\n\t\t\tfor ( var i = 0, l = typeArray.length; i < l; i ++ ) {\n\n\t\t\t\tarray[ i ] = typeArray[ i ];\n\n\t\t\t}\n\n\t\t\toutput.attributes[ key ] = {\n\t\t\t\titemSize: attribute.itemSize,\n\t\t\t\ttype: attribute.array.constructor.name,\n\t\t\t\tarray: array\n\t\t\t}\n\n\t\t}\n\n\t\tif ( offsets.length > 0 ) {\n\n\t\t\toutput.offsets = JSON.parse( JSON.stringify( offsets ) );\n\n\t\t}\n\n\t\tif ( boundingSphere !== null ) {\n\n\t\t\toutput.boundingSphere = {\n\t\t\t\tcenter: boundingSphere.center.toArray(),\n\t\t\t\tradius: boundingSphere.radius\n\t\t\t}\n\n\t\t}\n\n\t\treturn output;\n\n\t}\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Exporters/ObjectExporter.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Exporters/ObjectExporter.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.ObjectExporter = function () {};\n\nTHREE.ObjectExporter.prototype = {\n\n\tconstructor: THREE.ObjectExporter,\n\n\tparse: function ( object ) {\n\n\t\t// console.log( object );\n\n\t\tvar output = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.3,\n\t\t\t\ttype: 'Object',\n\t\t\t\tgenerator: 'ObjectExporter'\n\t\t\t}\n\t\t};\n\n\t\t//\n\n\t\tvar geometries = {};\n\t\tvar geometryExporter = new THREE.GeometryExporter();\n\t\tvar bufferGeometryExporter = new THREE.BufferGeometryExporter();\n\n\t\tvar parseGeometry = function ( geometry ) {\n\n\t\t\tif ( output.geometries === undefined ) {\n\n\t\t\t\toutput.geometries = [];\n\n\t\t\t}\n\n\t\t\tif ( geometries[ geometry.uuid ] === undefined ) {\n\n\t\t\t\tvar data = {};\n\n\t\t\t\tdata.uuid = geometry.uuid;\n\n\t\t\t\tif ( geometry.name !== \"\" ) data.name = geometry.name;\n\n\t\t\t\tvar handleParameters = function ( parameters ) {\n\n\t\t\t\t\tfor ( var i = 0; i < parameters.length; i ++ ) {\n\n\t\t\t\t\t\tvar parameter = parameters[ i ];\n\n\t\t\t\t\t\tif ( geometry.parameters[ parameter ] !== undefined ) {\n\n\t\t\t\t\t\t\tdata[ parameter ] = geometry.parameters[ parameter ];\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t};\n\n\t\t\t\tif ( geometry instanceof THREE.PlaneGeometry ) {\n\n\t\t\t\t\tdata.type = 'PlaneGeometry';\n\t\t\t\t\thandleParameters( [ 'width', 'height', 'widthSegments', 'heightSegments' ] );\n\n\t\t\t\t} else if ( geometry instanceof THREE.BoxGeometry ) {\n\n\t\t\t\t\tdata.type = 'BoxGeometry';\n\t\t\t\t\thandleParameters( [ 'width', 'height', 'depth', 'widthSegments', 'heightSegments', 'depthSegments' ] );\n\n\t\t\t\t} else if ( geometry instanceof THREE.CircleGeometry ) {\n\n\t\t\t\t\tdata.type = 'CircleGeometry';\n\t\t\t\t\thandleParameters( [ 'radius', 'segments' ] );\n\n\t\t\t\t} else if ( geometry instanceof THREE.CylinderGeometry ) {\n\n\t\t\t\t\tdata.type = 'CylinderGeometry';\n\t\t\t\t\thandleParameters( [ 'radiusTop', 'radiusBottom', 'height', 'radialSegments', 'heightSegments', 'openEnded' ] );\n\n\t\t\t\t} else if ( geometry instanceof THREE.SphereGeometry ) {\n\n\t\t\t\t\tdata.type = 'SphereGeometry';\n\t\t\t\t\thandleParameters( [ 'radius', 'widthSegments', 'heightSegments', 'phiStart', 'phiLength', 'thetaStart', 'thetaLength' ] );\n\n\t\t\t\t} else if ( geometry instanceof THREE.IcosahedronGeometry ) {\n\n\t\t\t\t\tdata.type = 'IcosahedronGeometry';\n\t\t\t\t\thandleParameters( [ 'radius', 'detail' ] );\n\n\t\t\t\t} else if ( geometry instanceof THREE.TorusGeometry ) {\n\n\t\t\t\t\tdata.type = 'TorusGeometry';\n\t\t\t\t\thandleParameters( [ 'radius', 'tube', 'radialSegments', 'tubularSegments', 'arc' ] );\n\n\t\t\t\t} else if ( geometry instanceof THREE.TorusKnotGeometry ) {\n\n\t\t\t\t\tdata.type = 'TorusKnotGeometry';\n\t\t\t\t\thandleParameters( [ 'radius', 'tube', 'radialSegments', 'tubularSegments', 'p', 'q', 'heightScale' ] );\n\n\t\t\t\t} else if ( geometry instanceof THREE.BufferGeometry ) {\n\n\t\t\t\t\tdata.type = 'BufferGeometry';\n\t\t\t\t\tdata.data = bufferGeometryExporter.parse( geometry );\n\n\t\t\t\t\tdelete data.data.metadata;\n\n\t\t\t\t} else if ( geometry instanceof THREE.Geometry ) {\n\n\t\t\t\t\tdata.type = 'Geometry';\n\t\t\t\t\tdata.data = geometryExporter.parse( geometry );\n\n\t\t\t\t\tdelete data.data.metadata;\n\n\t\t\t\t}\n\n\t\t\t\tgeometries[ geometry.uuid ] = data;\n\n\t\t\t\toutput.geometries.push( data );\n\n\t\t\t}\n\n\t\t\treturn geometry.uuid;\n\n\t\t};\n\n\t\t//\n\n\t\tvar materials = {};\n\t\tvar materialExporter = new THREE.MaterialExporter();\n\n\t\tvar parseMaterial = function ( material ) {\n\n\t\t\tif ( output.materials === undefined ) {\n\n\t\t\t\toutput.materials = [];\n\n\t\t\t}\n\n\t\t\tif ( materials[ material.uuid ] === undefined ) {\n\n\t\t\t\tvar data = materialExporter.parse( material );\n\n\t\t\t\tdelete data.metadata;\n\n\t\t\t\tmaterials[ material.uuid ] = data;\n\n\t\t\t\toutput.materials.push( data );\n\n\t\t\t}\n\n\t\t\treturn material.uuid;\n\n\t\t};\n\n\t\t//\n\n\t\tvar parseObject = function ( object ) {\n\n\t\t\tvar data = {};\n\n\t\t\tdata.uuid = object.uuid;\n\n\t\t\tif ( object.name !== '' ) data.name = object.name;\n\t\t\tif ( JSON.stringify( object.userData ) !== '{}' ) data.userData = object.userData;\n\t\t\tif ( object.visible !== true ) data.visible = object.visible;\n\n\t\t\tif ( object instanceof THREE.Scene ) {\n\n\t\t\t\tdata.type = 'Scene';\n\n\t\t\t} else if ( object instanceof THREE.PerspectiveCamera ) {\n\n\t\t\t\tdata.type = 'PerspectiveCamera';\n\t\t\t\tdata.fov = object.fov;\n\t\t\t\tdata.aspect = object.aspect;\n\t\t\t\tdata.near = object.near;\n\t\t\t\tdata.far = object.far;\n\n\t\t\t} else if ( object instanceof THREE.OrthographicCamera ) {\n\n\t\t\t\tdata.type = 'OrthographicCamera';\n\t\t\t\tdata.left = object.left;\n\t\t\t\tdata.right = object.right;\n\t\t\t\tdata.top = object.top;\n\t\t\t\tdata.bottom = object.bottom;\n\t\t\t\tdata.near = object.near;\n\t\t\t\tdata.far = object.far;\n\n\t\t\t} else if ( object instanceof THREE.AmbientLight ) {\n\n\t\t\t\tdata.type = 'AmbientLight';\n\t\t\t\tdata.color = object.color.getHex();\n\n\t\t\t} else if ( object instanceof THREE.DirectionalLight ) {\n\n\t\t\t\tdata.type = 'DirectionalLight';\n\t\t\t\tdata.color = object.color.getHex();\n\t\t\t\tdata.intensity = object.intensity;\n\n\t\t\t} else if ( object instanceof THREE.PointLight ) {\n\n\t\t\t\tdata.type = 'PointLight';\n\t\t\t\tdata.color = object.color.getHex();\n\t\t\t\tdata.intensity = object.intensity;\n\t\t\t\tdata.distance = object.distance;\n\n\t\t\t} else if ( object instanceof THREE.SpotLight ) {\n\n\t\t\t\tdata.type = 'SpotLight';\n\t\t\t\tdata.color = object.color.getHex();\n\t\t\t\tdata.intensity = object.intensity;\n\t\t\t\tdata.distance = object.distance;\n\t\t\t\tdata.angle = object.angle;\n\t\t\t\tdata.exponent = object.exponent;\n\n\t\t\t} else if ( object instanceof THREE.HemisphereLight ) {\n\n\t\t\t\tdata.type = 'HemisphereLight';\n\t\t\t\tdata.color = object.color.getHex();\n\t\t\t\tdata.groundColor = object.groundColor.getHex();\n\n\t\t\t} else if ( object instanceof THREE.Mesh ) {\n\n\t\t\t\tdata.type = 'Mesh';\n\t\t\t\tdata.geometry = parseGeometry( object.geometry );\n\t\t\t\tdata.material = parseMaterial( object.material );\n\n\t\t\t} else if ( object instanceof THREE.Sprite ) {\n\n\t\t\t\tdata.type = 'Sprite';\n\t\t\t\tdata.material = parseMaterial( object.material );\n\n\t\t\t} else {\n\n\t\t\t\tdata.type = 'Object3D';\n\n\t\t\t}\n\n\t\t\tdata.matrix = object.matrix.toArray();\n\n\t\t\tif ( object.children.length > 0 ) {\n\n\t\t\t\tdata.children = [];\n\n\t\t\t\tfor ( var i = 0; i < object.children.length; i ++ ) {\n\n\t\t\t\t\tdata.children.push( parseObject( object.children[ i ] ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn data;\n\n\t\t}\n\n\t\toutput.object = parseObject( object );\n\n\t\treturn output;\n\n\t}\n\n}\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Exporters/SceneExporter.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Exporters/SceneExporter.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.SceneExporter = function () {};\n\nTHREE.SceneExporter.prototype = {\n\n\tconstructor: THREE.SceneExporter,\n\n\tparse: function ( scene ) {\n\n\t\tvar position = Vector3String( scene.position );\n\t\tvar rotation = Vector3String( scene.rotation );\n\t\tvar scale = Vector3String( scene.scale );\n\n\t\tvar nobjects = 0;\n\t\tvar ngeometries = 0;\n\t\tvar nmaterials = 0;\n\t\tvar ntextures = 0;\n\n\t\tvar objectsArray = [];\n\t\tvar geometriesArray = [];\n\t\tvar materialsArray = [];\n\t\tvar texturesArray = [];\n\t\tvar fogsArray = [];\n\n\t\tvar geometriesMap = {};\n\t\tvar materialsMap = {};\n\t\tvar texturesMap = {};\n\n\t\t// extract objects, geometries, materials, textures\n\n\t\tvar checkTexture = function ( map ) {\n\n\t\t\tif ( ! map ) return;\n\n\t\t\tif ( ! ( map.id in texturesMap ) ) {\n\n\t\t\t\ttexturesMap[ map.id ] = true;\n\t\t\t\ttexturesArray.push( TextureString( map ) );\n\t\t\t\tntextures += 1;\n\n\t\t\t}\n\n\t\t};\n\n\t\tvar linesArray = [];\n\n\t\tfunction createObjectsList( object, pad ) {\n\n\t\t\tfor ( var i = 0; i < object.children.length; i ++ ) {\n\n\t\t\t\tvar node = object.children[ i ];\n\n\t\t\t\tif ( node instanceof THREE.Mesh ) {\n\n\t\t\t\t\tlinesArray.push( MeshString( node, pad ) );\n\t\t\t\t\tnobjects += 1;\n\n\t\t\t\t\tif ( ! ( node.geometry.id in geometriesMap ) ) {\n\n\t\t\t\t\t\tgeometriesMap[ node.geometry.id ] = true;\n\t\t\t\t\t\tgeometriesArray.push( GeometryString( node.geometry ) );\n\t\t\t\t\t\tngeometries += 1;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! ( node.material.id in materialsMap ) ) {\n\n\t\t\t\t\t\tmaterialsMap[ node.material.id ] = true;\n\t\t\t\t\t\tmaterialsArray.push( MaterialString( node.material ) );\n\t\t\t\t\t\tnmaterials += 1;\n\n\t\t\t\t\t\tcheckTexture( node.material.map );\n\t\t\t\t\t\tcheckTexture( node.material.envMap );\n\t\t\t\t\t\tcheckTexture( node.material.lightMap );\n\t\t\t\t\t\tcheckTexture( node.material.specularMap );\n\t\t\t\t\t\tcheckTexture( node.material.bumpMap );\n\t\t\t\t\t\tcheckTexture( node.material.normalMap );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( node instanceof THREE.Light ) {\n\n\t\t\t\t\tlinesArray.push( LightString( node, pad ) );\n\t\t\t\t\tnobjects += 1;\n\n\t\t\t\t} else if ( node instanceof THREE.Camera ) {\n\n\t\t\t\t\tlinesArray.push( CameraString( node, pad ) );\n\t\t\t\t\tnobjects += 1;\n\n\t\t\t\t} else if ( node instanceof THREE.Object3D ) {\n\n\t\t\t\t\tlinesArray.push( ObjectString( node, pad ) );\n\t\t\t\t\tnobjects += 1;\n\n\t\t\t\t}\n\n\t\t\t\tif ( node.children.length > 0 ) {\n\n\t\t\t\t\tlinesArray.push( PaddingString( pad + 1 ) + '\\t\\t\"children\" : {' );\n\n\t\t\t\t}\n\n\t\t\t\tcreateObjectsList( node, pad + 2 );\n\n\t\t\t\tif ( node.children.length > 0 ) {\n\n\t\t\t\t\tlinesArray.push( PaddingString( pad + 1 ) + \"\\t\\t}\" );\n\n\t\t\t\t}\n\n\t\t\t\tlinesArray.push( PaddingString( pad ) + \"\\t\\t}\" + ( i < object.children.length - 1 ? \",\\n\" : \"\" ) );\n\n\t\t\t}\n\n\t\t}\n\n\t\tcreateObjectsList( scene, 0 );\n\n\t\tvar objects = linesArray.join( \"\\n\" );\n\n\t\t// extract fog\n\n\t\tif ( scene.fog ) {\n\n\t\t\tfogsArray.push( FogString( scene.fog ) );\n\n\t\t}\n\n\t\t// generate sections\n\n\t\tvar geometries = generateMultiLineString( geometriesArray, \",\\n\\n\\t\" );\n\t\tvar materials = generateMultiLineString( materialsArray, \",\\n\\n\\t\" );\n\t\tvar textures = generateMultiLineString( texturesArray, \",\\n\\n\\t\" );\n\t\tvar fogs = generateMultiLineString( fogsArray, \",\\n\\n\\t\" );\n\n\t\t// generate defaults\n\n\t\tvar activeCamera = null;\n\n\t\tscene.traverse( function ( node ) {\n\n\t\t\tif ( node instanceof THREE.Camera && node.userData.active ) {\n\n\t\t\t\tactiveCamera = node;\n\n\t\t\t}\n\n\t\t} );\n\n\t\tvar defcamera = LabelString( activeCamera ? getObjectName( activeCamera ) : \"\" );\n\t\tvar deffog = LabelString( scene.fog ? getFogName( scene.fog ) : \"\" );\n\n\t\t// templates\n\n\t\tfunction Vector2String( v ) {\n\n\t\t\treturn \"[\" + v.x + \",\" + v.y + \"]\";\n\n\t\t}\n\n\t\tfunction Vector3String( v ) {\n\n\t\t\treturn \"[\" + v.x + \",\" + v.y + \",\" + v.z + \"]\";\n\n\t\t}\n\n\t\tfunction ColorString( c ) {\n\n\t\t\treturn \"[\" + c.r.toFixed( 3 ) + \",\" + c.g.toFixed( 3 ) + \",\" + c.b.toFixed( 3 ) + \"]\";\n\n\t\t}\n\n\t\tfunction LabelString( s ) {\n\n\t\t\treturn '\"' + s + '\"';\n\n\t\t}\n\n\t\tfunction NumConstantString( c ) {\n\n\t\t\tvar constants = [ \"NearestFilter\", \"NearestMipMapNearestFilter\" , \"NearestMipMapLinearFilter\",\n\t\t\t\t\t\t\t  \"LinearFilter\", \"LinearMipMapNearestFilter\", \"LinearMipMapLinearFilter\" ];\n\n\t\t\tfor ( var i = 0; i < constants.length; i ++ ) {\n\n\t\t\t\tif ( THREE[ constants[ i ] ] === c ) return LabelString( constants[ i ] );\n\n\t\t\t};\n\n\t\t\treturn \"\";\n\n\t\t}\n\n\t\tfunction PaddingString( n ) {\n\n\t\t\tvar output = \"\";\n\n\t\t\tfor ( var i = 0; i < n; i ++ ) output += \"\\t\";\n\n\t\t\treturn output;\n\n\t\t}\n\n\n\t\t//\n\n\t\tfunction LightString( o, n ) {\n\n\t\t\tif ( o instanceof THREE.AmbientLight ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t\\t' + LabelString( getObjectName( o ) ) + ' : {',\n\t\t\t\t'\t\"type\"  : \"AmbientLight\",',\n\t\t\t\t'\t\"color\" : ' + o.color.getHex() + ( o.children.length ? ',' : '' )\n\n\t\t\t\t];\n\n\t\t\t} else if ( o instanceof THREE.DirectionalLight ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t\\t' + LabelString( getObjectName( o ) ) + ' : {',\n\t\t\t\t'\t\"type\"      : \"DirectionalLight\",',\n\t\t\t\t'\t\"color\"     : ' + o.color.getHex() + ',',\n\t\t\t\t'\t\"intensity\" : ' + o.intensity + ',',\n\t\t\t\t'\t\"direction\" : ' + Vector3String( o.position ) + ',',\n\t\t\t\t'\t\"target\"    : ' + LabelString( getObjectName( o.target ) ) + ( o.children.length ? ',' : '' )\n\n\t\t\t\t];\n\n\t\t\t} else if ( o instanceof THREE.PointLight ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t\\t' + LabelString( getObjectName( o ) ) + ' : {',\n\t\t\t\t'\t\"type\"      : \"PointLight\",',\n\t\t\t\t'\t\"color\"     : ' + o.color.getHex() + ',',\n\t\t\t\t'\t\"intensity\" : ' + o.intensity + ',',\n\t\t\t\t'\t\"position\"  : ' + Vector3String( o.position ) + ',',\n\t\t\t\t'\t\"distance\"  : ' + o.distance + ( o.children.length ? ',' : '' )\n\n\t\t\t\t];\n\n\t\t\t} else if ( o instanceof THREE.SpotLight ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t\\t' + LabelString( getObjectName( o ) ) + ' : {',\n\t\t\t\t'\t\"type\"      : \"SpotLight\",',\n\t\t\t\t'\t\"color\"     : ' + o.color.getHex() + ',',\n\t\t\t\t'\t\"intensity\" : ' + o.intensity + ',',\n\t\t\t\t'\t\"position\"  : ' + Vector3String( o.position ) + ',',\n\t\t\t\t'\t\"distance\"  : ' + o.distance + ',',\n\t\t\t\t'\t\"angle\"     : ' + o.angle + ',',\n\t\t\t\t'\t\"exponent\"  : ' + o.exponent + ',',\n\t\t\t\t'\t\"target\"    : ' + LabelString( getObjectName( o.target ) ) + ( o.children.length ? ',' : '' )\n\n\t\t\t\t];\n\n\t\t\t} else if ( o instanceof THREE.HemisphereLight ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t\\t' + LabelString( getObjectName( o ) ) + ' : {',\n\t\t\t\t'\t\"type\"        : \"HemisphereLight\",',\n\t\t\t\t'\t\"skyColor\"    : ' + o.color.getHex() + ',',\n\t\t\t\t'\t\"groundColor\" : ' + o.groundColor.getHex() + ',',\n\t\t\t\t'\t\"intensity\"   : ' + o.intensity + ',',\n\t\t\t\t'\t\"position\"    : ' + Vector3String( o.position ) + ( o.children.length ? ',' : '' )\n\n\t\t\t\t];\n\n\t\t\t} else {\n\n\t\t\t\tvar output = [];\n\n\t\t\t}\n\n\t\t\treturn generateMultiLineString( output, '\\n\\t\\t', n );\n\n\t\t}\n\n\t\tfunction CameraString( o, n ) {\n\n\t\t\tif ( o instanceof THREE.PerspectiveCamera ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t\\t' + LabelString( getObjectName( o ) ) + ' : {',\n\t\t\t\t'\t\"type\"     : \"PerspectiveCamera\",',\n\t\t\t\t'\t\"fov\"      : ' + o.fov + ',',\n\t\t\t\t'\t\"aspect\"   : ' + o.aspect + ',',\n\t\t\t\t'\t\"near\"     : ' + o.near + ',',\n\t\t\t\t'\t\"far\"      : ' + o.far + ',',\n\t\t\t\t'\t\"position\" : ' + Vector3String( o.position ) + ( o.children.length ? ',' : '' )\n\n\t\t\t\t];\n\n\t\t\t} else if ( o instanceof THREE.OrthographicCamera ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t\\t' + LabelString( getObjectName( o ) ) + ' : {',\n\t\t\t\t'\t\"type\"     : \"OrthographicCamera\",',\n\t\t\t\t'\t\"left\"     : ' + o.left + ',',\n\t\t\t\t'\t\"right\"    : ' + o.right + ',',\n\t\t\t\t'\t\"top\"      : ' + o.top + ',',\n\t\t\t\t'\t\"bottom\"   : ' + o.bottom + ',',\n\t\t\t\t'\t\"near\"     : ' + o.near + ',',\n\t\t\t\t'\t\"far\"      : ' + o.far + ',',\n\t\t\t\t'\t\"position\" : ' + Vector3String( o.position ) + ( o.children.length ? ',' : '' )\n\n\t\t\t\t];\n\n\t\t\t} else {\n\n\t\t\t\tvar output = [];\n\n\t\t\t}\n\n\t\t\treturn generateMultiLineString( output, '\\n\\t\\t', n );\n\n\t\t}\n\n\t\tfunction ObjectString( o, n ) {\n\n\t\t\tvar output = [\n\n\t\t\t'\\t\\t' + LabelString( getObjectName( o ) ) + ' : {',\n\t\t\t'\t\"position\" : ' + Vector3String( o.position ) + ',',\n\t\t\t'\t\"rotation\" : ' + Vector3String( o.rotation ) + ',',\n\t\t\t'\t\"scale\"\t   : ' + Vector3String( o.scale ) + ',',\n\t\t\t'\t\"visible\"  : ' + o.visible + ( o.children.length ? ',' : '' )\n\n\t\t\t];\n\n\t\t\treturn generateMultiLineString( output, '\\n\\t\\t', n );\n\n\t\t}\n\n\t\tfunction MeshString( o, n ) {\n\n\t\t\tvar output = [\n\n\t\t\t'\\t\\t' + LabelString( getObjectName( o ) ) + ' : {',\n\t\t\t'\t\"geometry\" : ' + LabelString( getGeometryName( o.geometry ) ) + ',',\n\t\t\t'\t\"material\" : ' + LabelString( getMaterialName( o.material ) ) + ',',\n\t\t\t'\t\"position\" : ' + Vector3String( o.position ) + ',',\n\t\t\t'\t\"rotation\" : ' + Vector3String( o.rotation ) + ',',\n\t\t\t'\t\"scale\"\t   : ' + Vector3String( o.scale ) + ',',\n\t\t\t'\t\"visible\"  : ' + o.visible + ( o.children.length ? ',' : '' )\n\n\t\t\t];\n\n\t\t\treturn generateMultiLineString( output, '\\n\\t\\t', n );\n\n\t\t}\n\n\t\t//\n\n\t\tfunction GeometryString( g ) {\n\n\t\t\tif ( g instanceof THREE.SphereGeometry ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t' + LabelString( getGeometryName( g ) ) + ': {',\n\t\t\t\t'\t\"type\"    : \"sphere\",',\n\t\t\t\t'\t\"radius\"  : ' \t\t + g.radius + ',',\n\t\t\t\t'\t\"widthSegments\"  : ' + g.widthSegments + ',',\n\t\t\t\t'\t\"heightSegments\" : ' + g.heightSegments,\n\t\t\t\t'}'\n\n\t\t\t\t];\n\n\t\t\t} else if ( g instanceof THREE.BoxGeometry ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t' + LabelString( getGeometryName( g ) ) + ': {',\n\t\t\t\t'\t\"type\"    : \"cube\",',\n\t\t\t\t'\t\"width\"  : '  + g.width  + ',',\n\t\t\t\t'\t\"height\"  : ' + g.height + ',',\n\t\t\t\t'\t\"depth\"  : '  + g.depth  + ',',\n\t\t\t\t'\t\"widthSegments\"  : ' + g.widthSegments + ',',\n\t\t\t\t'\t\"heightSegments\" : ' + g.heightSegments + ',',\n\t\t\t\t'\t\"depthSegments\" : '  + g.depthSegments,\n\t\t\t\t'}'\n\n\t\t\t\t];\n\n\t\t\t} else if ( g instanceof THREE.PlaneGeometry ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t' + LabelString( getGeometryName( g ) ) + ': {',\n\t\t\t\t'\t\"type\"    : \"plane\",',\n\t\t\t\t'\t\"width\"  : '  + g.width  + ',',\n\t\t\t\t'\t\"height\"  : ' + g.height + ',',\n\t\t\t\t'\t\"widthSegments\"  : ' + g.widthSegments + ',',\n\t\t\t\t'\t\"heightSegments\" : ' + g.heightSegments,\n\t\t\t\t'}'\n\n\t\t\t\t];\n\n\t\t\t} else if ( g instanceof THREE.Geometry ) {\n\n\t\t\t\tif ( g.sourceType === \"ascii\" || g.sourceType === \"ctm\" || g.sourceType === \"stl\" || g.sourceType === \"vtk\" ) {\n\n\t\t\t\t\tvar output = [\n\n\t\t\t\t\t'\\t' + LabelString( getGeometryName( g ) ) + ': {',\n\t\t\t\t\t'\t\"type\" : ' + LabelString( g.sourceType ) + ',',\n\t\t\t\t\t'\t\"url\"  : ' + LabelString( g.sourceFile ),\n\t\t\t\t\t'}'\n\n\t\t\t\t\t];\n\n\t\t\t\t} else {\n\n\t\t\t\t\tvar output = [];\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tvar output = [];\n\n\t\t\t}\n\n\t\t\treturn generateMultiLineString( output, '\\n\\t\\t' );\n\n\t\t}\n\n\t\tfunction MaterialString( m ) {\n\n\t\t\tif ( m instanceof THREE.MeshBasicMaterial ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t' + LabelString( getMaterialName( m ) ) + ': {',\n\t\t\t\t'\t\"type\"    : \"MeshBasicMaterial\",',\n\t\t\t\t'\t\"parameters\"  : {',\n\t\t\t\t'\t\t\"color\"  : ' \t+ m.color.getHex() + ',',\n\n\t\t\t\tm.map ? \t\t'\t\t\"map\" : ' + LabelString( getTextureName( m.map ) ) + ',' : '',\n\t\t\t\tm.envMap ? \t\t'\t\t\"envMap\" : ' + LabelString( getTextureName( m.envMap ) ) + ',' : '',\n\t\t\t\tm.specularMap ? '\t\t\"specularMap\" : ' + LabelString( getTextureName( m.specularMap ) ) + ',' : '',\n\t\t\t\tm.lightMap ? \t'\t\t\"lightMap\" : ' + LabelString( getTextureName( m.lightMap ) ) + ',' : '',\n\n\t\t\t\t'\t\t\"reflectivity\"  : ' + m.reflectivity + ',',\n\t\t\t\t'\t\t\"transparent\" : ' + m.transparent + ',',\n\t\t\t\t'\t\t\"opacity\" : ' \t+ m.opacity + ',',\n\t\t\t\t'\t\t\"wireframe\" : ' + m.wireframe + ',',\n\t\t\t\t'\t\t\"wireframeLinewidth\" : ' + m.wireframeLinewidth,\n\t\t\t\t'\t}',\n\t\t\t\t'}'\n\n\t\t\t\t];\n\n\n\t\t\t} else if ( m instanceof THREE.MeshLambertMaterial ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t' + LabelString( getMaterialName( m ) ) + ': {',\n\t\t\t\t'\t\"type\"    : \"MeshLambertMaterial\",',\n\t\t\t\t'\t\"parameters\"  : {',\n\t\t\t\t'\t\t\"color\"  : ' \t+ m.color.getHex() + ',',\n\t\t\t\t'\t\t\"ambient\"  : ' \t+ m.ambient.getHex() + ',',\n\t\t\t\t'\t\t\"emissive\"  : ' + m.emissive.getHex() + ',',\n\n\t\t\t\tm.map ? \t\t'\t\t\"map\" : ' + LabelString( getTextureName( m.map ) ) + ',' : '',\n\t\t\t\tm.envMap ? \t\t'\t\t\"envMap\" : ' + LabelString( getTextureName( m.envMap ) ) + ',' : '',\n\t\t\t\tm.specularMap ? '\t\t\"specularMap\" : ' + LabelString( getTextureName( m.specularMap ) ) + ',' : '',\n\t\t\t\tm.lightMap ? \t'\t\t\"lightMap\" : ' + LabelString( getTextureName( m.lightMap ) ) + ',' : '',\n\n\t\t\t\t'\t\t\"reflectivity\"  : ' + m.reflectivity + ',',\n\t\t\t\t'\t\t\"transparent\" : ' + m.transparent + ',',\n\t\t\t\t'\t\t\"opacity\" : ' \t+ m.opacity + ',',\n\t\t\t\t'\t\t\"wireframe\" : ' + m.wireframe + ',',\n\t\t\t\t'\t\t\"wireframeLinewidth\" : ' + m.wireframeLinewidth,\n\t\t\t\t'\t}',\n\t\t\t\t'}'\n\n\t\t\t\t];\n\n\t\t\t} else if ( m instanceof THREE.MeshPhongMaterial ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t' + LabelString( getMaterialName( m ) ) + ': {',\n\t\t\t\t'\t\"type\"    : \"MeshPhongMaterial\",',\n\t\t\t\t'\t\"parameters\"  : {',\n\t\t\t\t'\t\t\"color\"  : ' \t+ m.color.getHex() + ',',\n\t\t\t\t'\t\t\"ambient\"  : ' \t+ m.ambient.getHex() + ',',\n\t\t\t\t'\t\t\"emissive\"  : ' + m.emissive.getHex() + ',',\n\t\t\t\t'\t\t\"specular\"  : ' + m.specular.getHex() + ',',\n\t\t\t\t'\t\t\"shininess\" : ' + m.shininess + ',',\n\n\t\t\t\tm.map ? \t\t'\t\t\"map\" : ' + LabelString( getTextureName( m.map ) ) + ',' : '',\n\t\t\t\tm.envMap ? \t\t'\t\t\"envMap\" : ' + LabelString( getTextureName( m.envMap ) ) + ',' : '',\n\t\t\t\tm.specularMap ? '\t\t\"specularMap\" : ' + LabelString( getTextureName( m.specularMap ) ) + ',' : '',\n\t\t\t\tm.lightMap ? \t'\t\t\"lightMap\" : ' + LabelString( getTextureName( m.lightMap ) ) + ',' : '',\n\t\t\t\tm.normalMap ? \t'\t\t\"normalMap\" : ' + LabelString( getTextureName( m.normalMap ) ) + ',' : '',\n\t\t\t\tm.bumpMap ? \t'\t\t\"bumpMap\" : ' + LabelString( getTextureName( m.bumpMap ) ) + ',' : '',\n\n\t\t\t\t'\t\t\"bumpScale\"  : ' + m.bumpScale + ',',\n\t\t\t\t'\t\t\"reflectivity\"  : ' + m.reflectivity + ',',\n\t\t\t\t'\t\t\"transparent\" : ' + m.transparent + ',',\n\t\t\t\t'\t\t\"opacity\" : ' \t+ m.opacity + ',',\n\t\t\t\t'\t\t\"wireframe\" : ' + m.wireframe + ',',\n\t\t\t\t'\t\t\"wireframeLinewidth\" : ' + m.wireframeLinewidth,\n\t\t\t\t'\t}',\n\t\t\t\t'}'\n\n\t\t\t\t];\n\n\t\t\t} else if ( m instanceof THREE.MeshDepthMaterial ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t' + LabelString( getMaterialName( m ) ) + ': {',\n\t\t\t\t'\t\"type\"    : \"MeshDepthMaterial\",',\n\t\t\t\t'\t\"parameters\"  : {',\n\t\t\t\t'\t\t\"transparent\" : ' + m.transparent + ',',\n\t\t\t\t'\t\t\"opacity\" : ' \t+ m.opacity + ',',\n\t\t\t\t'\t\t\"wireframe\" : ' + m.wireframe + ',',\n\t\t\t\t'\t\t\"wireframeLinewidth\" : ' + m.wireframeLinewidth,\n\t\t\t\t'\t}',\n\t\t\t\t'}'\n\n\t\t\t\t];\n\n\t\t\t} else if ( m instanceof THREE.MeshNormalMaterial ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t' + LabelString( getMaterialName( m ) ) + ': {',\n\t\t\t\t'\t\"type\"    : \"MeshNormalMaterial\",',\n\t\t\t\t'\t\"parameters\"  : {',\n\t\t\t\t'\t\t\"transparent\" : ' + m.transparent + ',',\n\t\t\t\t'\t\t\"opacity\" : ' \t+ m.opacity + ',',\n\t\t\t\t'\t\t\"wireframe\" : ' + m.wireframe + ',',\n\t\t\t\t'\t\t\"wireframeLinewidth\" : ' + m.wireframeLinewidth,\n\t\t\t\t'\t}',\n\t\t\t\t'}'\n\n\t\t\t\t];\n\n\t\t\t} else if ( m instanceof THREE.MeshFaceMaterial ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t' + LabelString( getMaterialName( m ) ) + ': {',\n\t\t\t\t'\t\"type\"    : \"MeshFaceMaterial\",',\n\t\t\t\t'\t\"parameters\"  : {}',\n\t\t\t\t'}'\n\n\t\t\t\t];\n\n\t\t\t}\n\n\t\t\treturn generateMultiLineString( output, '\\n\\t\\t' );\n\n\t\t}\n\n\t\tfunction TextureString( t ) {\n\n\t\t\t// here would be also an option to use data URI\n\t\t\t// with embedded image from \"t.image.src\"\n\t\t\t// (that's a side effect of using FileReader to load images)\n\n\t\t\tvar output = [\n\n\t\t\t'\\t' + LabelString( getTextureName( t ) ) + ': {',\n\t\t\t'\t\"url\"    : \"' + t.sourceFile + '\",',\n\t\t\t'\t\"repeat\" : ' + Vector2String( t.repeat ) + ',',\n\t\t\t'\t\"offset\" : ' + Vector2String( t.offset ) + ',',\n\t\t\t'\t\"magFilter\" : ' + NumConstantString( t.magFilter ) + ',',\n\t\t\t'\t\"minFilter\" : ' + NumConstantString( t.minFilter ) + ',',\n\t\t\t'\t\"anisotropy\" : ' + t.anisotropy,\n\t\t\t'}'\n\n\t\t\t];\n\n\t\t\treturn generateMultiLineString( output, '\\n\\t\\t' );\n\n\t\t}\n\n\t\t//\n\n\t\tfunction FogString( f ) {\n\n\t\t\tif ( f instanceof THREE.Fog ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t' + LabelString( getFogName( f ) ) + ': {',\n\t\t\t\t'\t\"type\"  : \"linear\",',\n\t\t\t\t'\t\"color\" : ' + ColorString( f.color ) + ',',\n\t\t\t\t'\t\"near\"  : '  + f.near + ',',\n\t\t\t\t'\t\"far\"   : '    + f.far,\n\t\t\t\t'}'\n\n\t\t\t\t];\n\n\t\t\t} else if ( f instanceof THREE.FogExp2 ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t' + LabelString( getFogName( f ) ) + ': {',\n\t\t\t\t'\t\"type\"    : \"exp2\",',\n\t\t\t\t'\t\"color\"   : '  + ColorString( f.color ) + ',',\n\t\t\t\t'\t\"density\" : ' + f.density,\n\t\t\t\t'}'\n\n\t\t\t\t];\n\n\t\t\t} else {\n\n\t\t\t\tvar output = [];\n\n\t\t\t}\n\n\t\t\treturn generateMultiLineString( output, '\\n\\t\\t' );\n\n\t\t}\n\n\t\t//\n\n\t\tfunction generateMultiLineString( lines, separator, padding ) {\n\n\t\t\tvar cleanLines = [];\n\n\t\t\tfor ( var i = 0; i < lines.length; i ++ ) {\n\n\t\t\t\tvar line = lines[ i ];\n\n\t\t\t\tif ( line ) {\n\n\t\t\t\t\tif ( padding ) line = PaddingString( padding ) + line;\n\t\t\t\t\tcleanLines.push(  line );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn cleanLines.join( separator );\n\n\t\t}\n\n\t\tfunction getObjectName( o ) {\n\n\t\t\treturn o.name ? o.name : \"Object_\" + o.id;\n\n\t\t}\n\n\t\tfunction getGeometryName( g ) {\n\n\t\t\treturn g.name ? g.name : \"Geometry_\" + g.id;\n\n\t\t}\n\n\t\tfunction getMaterialName( m ) {\n\n\t\t\treturn m.name ? m.name : \"Material_\" + m.id;\n\n\t\t}\n\n\t\tfunction getTextureName( t ) {\n\n\t\t\treturn t.name ? t.name : \"Texture_\" + t.id;\n\n\t\t}\n\n\t\tfunction getFogName( f ) {\n\n\t\t\treturn f.name ? f.name : \"Default fog\";\n\n\t\t}\n\n\t\t//\n\n\t\tvar output = [\n\t\t\t'{',\n\t\t\t'\t\"metadata\": {',\n\t\t\t'\t\t\"formatVersion\" : 3.2,',\n\t\t\t'\t\t\"type\"\t\t: \"scene\",',\n\t\t\t'\t\t\"generatedBy\"\t: \"SceneExporter\",',\n\t\t\t'\t\t\"objects\"       : ' + nobjects + ',',\n\t\t\t'\t\t\"geometries\"    : ' + ngeometries + ',',\n\t\t\t'\t\t\"materials\"     : ' + nmaterials + ',',\n\t\t\t'\t\t\"textures\"      : ' + ntextures,\n\t\t\t'\t},',\n\t\t\t'',\n\t\t\t'\t\"urlBaseType\": \"relativeToScene\",',\n\t\t\t'',\n\n\t\t\t'\t\"objects\" :',\n\t\t\t'\t{',\n\t\t\tobjects,\n\t\t\t'\t},',\n\t\t\t'',\n\n\t\t\t'\t\"geometries\" :',\n\t\t\t'\t{',\n\t\t\t'\\t' + \tgeometries,\n\t\t\t'\t},',\n\t\t\t'',\n\n\t\t\t'\t\"materials\" :',\n\t\t\t'\t{',\n\t\t\t'\\t' + \tmaterials,\n\t\t\t'\t},',\n\t\t\t'',\n\n\t\t\t'\t\"textures\" :',\n\t\t\t'\t{',\n\t\t\t'\\t' + \ttextures,\n\t\t\t'\t},',\n\t\t\t'',\n\n\t\t\t'\t\"fogs\" :',\n\t\t\t'\t{',\n\t\t\t'\\t' + \tfogs,\n\t\t\t'\t},',\n\t\t\t'',\n\n\t\t\t'\t\"transform\" :',\n\t\t\t'\t{',\n\t\t\t'\t\t\"position\"  : ' + position + ',',\n\t\t\t'\t\t\"rotation\"  : ' + rotation + ',',\n\t\t\t'\t\t\"scale\"     : ' + scale,\n\t\t\t'\t},',\n\t\t\t'',\n\t\t\t'\t\"defaults\" :',\n\t\t\t'\t{',\n\t\t\t'\t\t\"camera\"  : ' + defcamera + ',',\n\t\t\t'\t\t\"fog\"  \t  : ' + deffog,\n\t\t\t'\t}',\n\t\t\t'}'\n\t\t].join( '\\n' );\n\n\t\treturn JSON.parse( output );\n\n\t}\n\n}\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Exporters/HTMLExporter.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Exporters/HTMLExporter.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.HTMLExporter = function () {};\n\nTHREE.HTMLExporter.prototype = {\n\n\tconstructor: THREE.HTMLExporter,\n\n\tparse: function ( scene ) {\n\n\t\treturn output;\n\n\t}\n\n}\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Exporters/STLBinaryExporter.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Exporters/STLBinaryExporter.js",
            "module-type": "library",
            "text": "/**\n * @author kovacsv / http://kovacsv.hu/\n * @author mrdoob / http://mrdoob.com/\n * @author mudcube / http://mudcu.be/\n */\n \nTHREE.STLBinaryExporter = function () {};\n\nTHREE.STLBinaryExporter.prototype = {\n\n\tconstructor: THREE.STLBinaryExporter,\n\n\tparse: ( function () {\n\n\t\tvar vector = new THREE.Vector3();\n\t\tvar normalMatrixWorld = new THREE.Matrix3();\n\n\t\treturn function ( scene ) {\n\n\t\t\tvar triangles = 0;\n\t\t\tscene.traverse( function ( object ) {\n\t\t\t\tif ( !(object instanceof THREE.Mesh) ) return;\n\t\t\t\ttriangles += object.geometry.faces.length;\n\t\t\t});\n\n\t\t\tvar offset = 80; // skip header\n\t\t\tvar bufferLength = triangles * 2 + triangles * 3 * 4 * 4 + 80 + 4;\n\t\t\tvar arrayBuffer = new ArrayBuffer(bufferLength);\n\t\t\tvar output = new DataView(arrayBuffer);\n\t\t\toutput.setUint32(offset, triangles, true); offset += 4;\n\n\t\t\tscene.traverse( function ( object ) {\n\n\t\t\t\tif ( !(object instanceof THREE.Mesh) ) return;\n\t\t\t\tif ( !(object.geometry instanceof THREE.Geometry )) return;\n\n\t\t\t\tvar geometry = object.geometry;\n\t\t\t\tvar matrixWorld = object.matrixWorld;\n\n\t\t\t\tvar vertices = geometry.vertices;\n\t\t\t\tvar faces = geometry.faces;\n\n\t\t\t\tnormalMatrixWorld.getNormalMatrix( matrixWorld );\n\n\t\t\t\tfor ( var i = 0, l = faces.length; i < l; i ++ ) {\n\n\t\t\t\t\tvar face = faces[ i ];\n\n\t\t\t\t\tvector.copy( face.normal ).applyMatrix3( normalMatrixWorld ).normalize();\n\n\t\t\t\t\toutput.setFloat32(offset, vector.x, true); offset += 4; // normal\n\t\t\t\t\toutput.setFloat32(offset, vector.y, true); offset += 4;\n\t\t\t\t\toutput.setFloat32(offset, vector.z, true); offset += 4;\n\n\t\t\t\t\tvar indices = [ face.a, face.b, face.c ];\n\n\t\t\t\t\tfor ( var j = 0; j < 3; j ++ ) {\n\n\t\t\t\t\t\tvector.copy( vertices[ indices[ j ] ] ).applyMatrix4( matrixWorld );\n\n\t\t\t\t\t\toutput.setFloat32(offset, vector.x, true); offset += 4; // vertices\n\t\t\t\t\t\toutput.setFloat32(offset, vector.y, true); offset += 4;\n\t\t\t\t\t\toutput.setFloat32(offset, vector.z, true); offset += 4;\n\n\t\t\t\t\t}\n\n\t\t\t\t\toutput.setUint16(offset, 0, true); offset += 2; // attribute byte count\t\t\t\t\t\n\n\t\t\t\t}\n\n\t\t\t} );\n\t\t\t\n\t\t\treturn output;\n\n\t\t};\n\n\t}() )\n\n};"
        },
        "$:/plugins/rboue/Three.js/Lib/Exporters/TypedGeometryExporter.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Exporters/TypedGeometryExporter.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.TypedGeometryExporter = function () {};\n\nTHREE.TypedGeometryExporter.prototype = {\n\n\tconstructor: THREE.TypedGeometryExporter,\n\n\tparse: function ( geometry ) {\n\n\t\tvar output = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.0,\n\t\t\t\ttype: 'TypedGeometry',\n\t\t\t\tgenerator: 'TypedGeometryExporter'\n\t\t\t}\n\t\t};\n\n\t\tvar attributes = [ 'vertices', 'normals', 'uvs' ];\n\n\t\tfor ( var key in attributes ) {\n\n\t\t\tvar attribute = attributes[ key ];\n\t\t\t\n\t\t\tvar typedArray = geometry[ attribute ];\n\t\t\tvar array = [];\n\n\t\t\tfor ( var i = 0, l = typedArray.length; i < l; i ++ ) {\n\n\t\t\t\tarray[ i ] = typedArray[ i ];\n\n\t\t\t}\n\n\t\t\toutput[ attribute ] = array;\n\n\t\t}\n\n\t\tvar boundingSphere = geometry.boundingSphere;\n\n\t\tif ( boundingSphere !== null ) {\n\n\t\t\toutput.boundingSphere = {\n\t\t\t\tcenter: boundingSphere.center.toArray(),\n\t\t\t\tradius: boundingSphere.radius\n\t\t\t}\n\n\t\t}\n\n\t\treturn output;\n\n\t}\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Exporters/GeometryExporter.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Exporters/GeometryExporter.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.GeometryExporter = function () {};\n\nTHREE.GeometryExporter.prototype = {\n\n\tconstructor: THREE.GeometryExporter,\n\n\tparse: function ( geometry ) {\n\n\t\tvar output = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.0,\n\t\t\t\ttype: 'geometry',\n\t\t\t\tgenerator: 'GeometryExporter'\n\t\t\t}\n\t\t};\n\n\t\tvar vertices = [];\n\n\t\tfor ( var i = 0; i < geometry.vertices.length; i ++ ) {\n\n\t\t\tvar vertex = geometry.vertices[ i ];\n\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t}\n\n\t\tvar faces = [];\n\t\tvar normals = [];\n\t\tvar normalsHash = {};\n\t\tvar colors = [];\n\t\tvar colorsHash = {};\n\t\tvar uvs = [];\n\t\tvar uvsHash = {};\n\n\t\tfor ( var i = 0; i < geometry.faces.length; i ++ ) {\n\n\t\t\tvar face = geometry.faces[ i ];\n\n\t\t\tvar hasMaterial = false; // face.materialIndex !== undefined;\n\t\t\tvar hasFaceUv = false; // deprecated\n\t\t\tvar hasFaceVertexUv = geometry.faceVertexUvs[ 0 ][ i ] !== undefined;\n\t\t\tvar hasFaceNormal = face.normal.length() > 0;\n\t\t\tvar hasFaceVertexNormal = face.vertexNormals.length > 0;\n\t\t\tvar hasFaceColor = face.color.r !== 1 || face.color.g !== 1 || face.color.b !== 1;\n\t\t\tvar hasFaceVertexColor = face.vertexColors.length > 0;\n\n\t\t\tvar faceType = 0;\n\n\t\t\tfaceType = setBit( faceType, 0, 0 );\n\t\t\tfaceType = setBit( faceType, 1, hasMaterial );\n\t\t\tfaceType = setBit( faceType, 2, hasFaceUv );\n\t\t\tfaceType = setBit( faceType, 3, hasFaceVertexUv );\n\t\t\tfaceType = setBit( faceType, 4, hasFaceNormal );\n\t\t\tfaceType = setBit( faceType, 5, hasFaceVertexNormal );\n\t\t\tfaceType = setBit( faceType, 6, hasFaceColor );\n\t\t\tfaceType = setBit( faceType, 7, hasFaceVertexColor );\n\n\t\t\tfaces.push( faceType );\n\t\t\tfaces.push( face.a, face.b, face.c );\n\n\n\t\t\t/*\n\t\t\tif ( hasMaterial ) {\n\n\t\t\t\tfaces.push( face.materialIndex );\n\n\t\t\t}\n\t\t\t*/\n\n\t\t\tif ( hasFaceVertexUv ) {\n\n\t\t\t\tvar faceVertexUvs = geometry.faceVertexUvs[ 0 ][ i ];\n\n\t\t\t\tfaces.push(\n\t\t\t\t\tgetUvIndex( faceVertexUvs[ 0 ] ),\n\t\t\t\t\tgetUvIndex( faceVertexUvs[ 1 ] ),\n\t\t\t\t\tgetUvIndex( faceVertexUvs[ 2 ] )\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t\tif ( hasFaceNormal ) {\n\n\t\t\t\tfaces.push( getNormalIndex( face.normal ) );\n\n\t\t\t}\n\n\t\t\tif ( hasFaceVertexNormal ) {\n\n\t\t\t\tvar vertexNormals = face.vertexNormals;\n\n\t\t\t\tfaces.push(\n\t\t\t\t\tgetNormalIndex( vertexNormals[ 0 ] ),\n\t\t\t\t\tgetNormalIndex( vertexNormals[ 1 ] ),\n\t\t\t\t\tgetNormalIndex( vertexNormals[ 2 ] )\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t\tif ( hasFaceColor ) {\n\n\t\t\t\tfaces.push( getColorIndex( face.color ) );\n\n\t\t\t}\n\n\t\t\tif ( hasFaceVertexColor ) {\n\n\t\t\t\tvar vertexColors = face.vertexColors;\n\n\t\t\t\tfaces.push(\n\t\t\t\t\tgetColorIndex( vertexColors[ 0 ] ),\n\t\t\t\t\tgetColorIndex( vertexColors[ 1 ] ),\n\t\t\t\t\tgetColorIndex( vertexColors[ 2 ] )\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction setBit( value, position, enabled ) {\n\n\t\t\treturn enabled ? value | ( 1 << position ) : value & ( ~ ( 1 << position) );\n\n\t\t}\n\n\t\tfunction getNormalIndex( normal ) {\n\n\t\t\tvar hash = normal.x.toString() + normal.y.toString() + normal.z.toString();\n\n\t\t\tif ( normalsHash[ hash ] !== undefined ) {\n\n\t\t\t\treturn normalsHash[ hash ];\n\n\t\t\t}\n\n\t\t\tnormalsHash[ hash ] = normals.length / 3;\n\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\treturn normalsHash[ hash ];\n\n\t\t}\n\n\t\tfunction getColorIndex( color ) {\n\n\t\t\tvar hash = color.r.toString() + color.g.toString() + color.b.toString();\n\n\t\t\tif ( colorsHash[ hash ] !== undefined ) {\n\n\t\t\t\treturn colorsHash[ hash ];\n\n\t\t\t}\n\n\t\t\tcolorsHash[ hash ] = colors.length;\n\t\t\tcolors.push( color.getHex() );\n\n\t\t\treturn colorsHash[ hash ];\n\n\t\t}\n\n\t\tfunction getUvIndex( uv ) {\n\n\t\t\tvar hash = uv.x.toString() + uv.y.toString();\n\n\t\t\tif ( uvsHash[ hash ] !== undefined ) {\n\n\t\t\t\treturn uvsHash[ hash ];\n\n\t\t\t}\n\n\t\t\tuvsHash[ hash ] = uvs.length / 2;\n\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t\treturn uvsHash[ hash ];\n\n\t\t}\n\n\t\toutput.vertices = vertices;\n\t\toutput.normals = normals;\n\t\tif ( colors.length > 0 ) output.colors = colors;\n\t\tif ( uvs.length > 0 ) output.uvs = [ uvs ]; // temporal backward compatibility\n\t\toutput.faces = faces;\n\n\t\t//\n\n\t\treturn output;\n\n\t}\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Postprocessing/BloomPass.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Postprocessing/BloomPass.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.BloomPass = function ( strength, kernelSize, sigma, resolution ) {\n\n\tstrength = ( strength !== undefined ) ? strength : 1;\n\tkernelSize = ( kernelSize !== undefined ) ? kernelSize : 25;\n\tsigma = ( sigma !== undefined ) ? sigma : 4.0;\n\tresolution = ( resolution !== undefined ) ? resolution : 256;\n\n\t// render targets\n\n\tvar pars = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat };\n\n\tthis.renderTargetX = new THREE.WebGLRenderTarget( resolution, resolution, pars );\n\tthis.renderTargetY = new THREE.WebGLRenderTarget( resolution, resolution, pars );\n\n\t// copy material\n\n\tif ( THREE.CopyShader === undefined )\n\t\tconsole.error( \"THREE.BloomPass relies on THREE.CopyShader\" );\n\n\tvar copyShader = THREE.CopyShader;\n\n\tthis.copyUniforms = THREE.UniformsUtils.clone( copyShader.uniforms );\n\n\tthis.copyUniforms[ \"opacity\" ].value = strength;\n\n\tthis.materialCopy = new THREE.ShaderMaterial( {\n\n\t\tuniforms: this.copyUniforms,\n\t\tvertexShader: copyShader.vertexShader,\n\t\tfragmentShader: copyShader.fragmentShader,\n\t\tblending: THREE.AdditiveBlending,\n\t\ttransparent: true\n\n\t} );\n\n\t// convolution material\n\n\tif ( THREE.ConvolutionShader === undefined )\n\t\tconsole.error( \"THREE.BloomPass relies on THREE.ConvolutionShader\" );\n\n\tvar convolutionShader = THREE.ConvolutionShader;\n\n\tthis.convolutionUniforms = THREE.UniformsUtils.clone( convolutionShader.uniforms );\n\n\tthis.convolutionUniforms[ \"uImageIncrement\" ].value = THREE.BloomPass.blurx;\n\tthis.convolutionUniforms[ \"cKernel\" ].value = THREE.ConvolutionShader.buildKernel( sigma );\n\n\tthis.materialConvolution = new THREE.ShaderMaterial( {\n\n\t\tuniforms: this.convolutionUniforms,\n\t\tvertexShader:  convolutionShader.vertexShader,\n\t\tfragmentShader: convolutionShader.fragmentShader,\n\t\tdefines: {\n\t\t\t\"KERNEL_SIZE_FLOAT\": kernelSize.toFixed( 1 ),\n\t\t\t\"KERNEL_SIZE_INT\": kernelSize.toFixed( 0 )\n\t\t}\n\n\t} );\n\n\tthis.enabled = true;\n\tthis.needsSwap = false;\n\tthis.clear = false;\n\n\n\tthis.camera = new THREE.OrthographicCamera( -1, 1, 1, -1, 0, 1 );\n\tthis.scene  = new THREE.Scene();\n\n\tthis.quad = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), null );\n\tthis.scene.add( this.quad );\n\n};\n\nTHREE.BloomPass.prototype = {\n\n\trender: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {\n\n\t\tif ( maskActive ) renderer.context.disable( renderer.context.STENCIL_TEST );\n\n\t\t// Render quad with blured scene into texture (convolution pass 1)\n\n\t\tthis.quad.material = this.materialConvolution;\n\n\t\tthis.convolutionUniforms[ \"tDiffuse\" ].value = readBuffer;\n\t\tthis.convolutionUniforms[ \"uImageIncrement\" ].value = THREE.BloomPass.blurX;\n\n\t\trenderer.render( this.scene, this.camera, this.renderTargetX, true );\n\n\n\t\t// Render quad with blured scene into texture (convolution pass 2)\n\n\t\tthis.convolutionUniforms[ \"tDiffuse\" ].value = this.renderTargetX;\n\t\tthis.convolutionUniforms[ \"uImageIncrement\" ].value = THREE.BloomPass.blurY;\n\n\t\trenderer.render( this.scene, this.camera, this.renderTargetY, true );\n\n\t\t// Render original scene with superimposed blur to texture\n\n\t\tthis.quad.material = this.materialCopy;\n\n\t\tthis.copyUniforms[ \"tDiffuse\" ].value = this.renderTargetY;\n\n\t\tif ( maskActive ) renderer.context.enable( renderer.context.STENCIL_TEST );\n\n\t\trenderer.render( this.scene, this.camera, readBuffer, this.clear );\n\n\t}\n\n};\n\nTHREE.BloomPass.blurX = new THREE.Vector2( 0.001953125, 0.0 );\nTHREE.BloomPass.blurY = new THREE.Vector2( 0.0, 0.001953125 );\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Postprocessing/ShaderPass.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Postprocessing/ShaderPass.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.ShaderPass = function ( shader, textureID ) {\n\n\tthis.textureID = ( textureID !== undefined ) ? textureID : \"tDiffuse\";\n\n\tthis.uniforms = THREE.UniformsUtils.clone( shader.uniforms );\n\n\tthis.material = new THREE.ShaderMaterial( {\n\n\t\tuniforms: this.uniforms,\n\t\tvertexShader: shader.vertexShader,\n\t\tfragmentShader: shader.fragmentShader\n\n\t} );\n\n\tthis.renderToScreen = false;\n\n\tthis.enabled = true;\n\tthis.needsSwap = true;\n\tthis.clear = false;\n\n\n\tthis.camera = new THREE.OrthographicCamera( -1, 1, 1, -1, 0, 1 );\n\tthis.scene  = new THREE.Scene();\n\n\tthis.quad = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), null );\n\tthis.scene.add( this.quad );\n\n};\n\nTHREE.ShaderPass.prototype = {\n\n\trender: function ( renderer, writeBuffer, readBuffer, delta ) {\n\n\t\tif ( this.uniforms[ this.textureID ] ) {\n\n\t\t\tthis.uniforms[ this.textureID ].value = readBuffer;\n\n\t\t}\n\n\t\tthis.quad.material = this.material;\n\n\t\tif ( this.renderToScreen ) {\n\n\t\t\trenderer.render( this.scene, this.camera );\n\n\t\t} else {\n\n\t\t\trenderer.render( this.scene, this.camera, writeBuffer, this.clear );\n\n\t\t}\n\n\t}\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Postprocessing/SavePass.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Postprocessing/SavePass.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.SavePass = function ( renderTarget ) {\n\n\tif ( THREE.CopyShader === undefined )\n\t\tconsole.error( \"THREE.SavePass relies on THREE.CopyShader\" );\n\n\tvar shader = THREE.CopyShader;\n\n\tthis.textureID = \"tDiffuse\";\n\n\tthis.uniforms = THREE.UniformsUtils.clone( shader.uniforms );\n\n\tthis.material = new THREE.ShaderMaterial( {\n\n\t\tuniforms: this.uniforms,\n\t\tvertexShader: shader.vertexShader,\n\t\tfragmentShader: shader.fragmentShader\n\n\t} );\n\n\tthis.renderTarget = renderTarget;\n\n\tif ( this.renderTarget === undefined ) {\n\n\t\tthis.renderTargetParameters = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat, stencilBuffer: false };\n\t\tthis.renderTarget = new THREE.WebGLRenderTarget( window.innerWidth, window.innerHeight, this.renderTargetParameters );\n\n\t}\n\n\tthis.enabled = true;\n\tthis.needsSwap = false;\n\tthis.clear = false;\n\n\n\tthis.camera = new THREE.OrthographicCamera( -1, 1, 1, -1, 0, 1 );\n\tthis.scene  = new THREE.Scene();\n\n\tthis.quad = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), null );\n\tthis.scene.add( this.quad );\n\n};\n\nTHREE.SavePass.prototype = {\n\n\trender: function ( renderer, writeBuffer, readBuffer, delta ) {\n\n\t\tif ( this.uniforms[ this.textureID ] ) {\n\n\t\t\tthis.uniforms[ this.textureID ].value = readBuffer;\n\n\t\t}\n\n\t\tthis.quad.material = this.material;\n\n\t\trenderer.render( this.scene, this.camera, this.renderTarget, this.clear );\n\n\t}\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Postprocessing/DotScreenPass.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Postprocessing/DotScreenPass.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.DotScreenPass = function ( center, angle, scale ) {\n\n\tif ( THREE.DotScreenShader === undefined )\n\t\tconsole.error( \"THREE.DotScreenPass relies on THREE.DotScreenShader\" );\n\n\tvar shader = THREE.DotScreenShader;\n\n\tthis.uniforms = THREE.UniformsUtils.clone( shader.uniforms );\n\n\tif ( center !== undefined ) this.uniforms[ \"center\" ].value.copy( center );\n\tif ( angle !== undefined ) this.uniforms[ \"angle\"].value = angle;\n\tif ( scale !== undefined ) this.uniforms[ \"scale\"].value = scale;\n\n\tthis.material = new THREE.ShaderMaterial( {\n\n\t\tuniforms: this.uniforms,\n\t\tvertexShader: shader.vertexShader,\n\t\tfragmentShader: shader.fragmentShader\n\n\t} );\n\n\tthis.enabled = true;\n\tthis.renderToScreen = false;\n\tthis.needsSwap = true;\n\n\n\tthis.camera = new THREE.OrthographicCamera( -1, 1, 1, -1, 0, 1 );\n\tthis.scene  = new THREE.Scene();\n\n\tthis.quad = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), null );\n\tthis.scene.add( this.quad );\n\n};\n\nTHREE.DotScreenPass.prototype = {\n\n\trender: function ( renderer, writeBuffer, readBuffer, delta ) {\n\n\t\tthis.uniforms[ \"tDiffuse\" ].value = readBuffer;\n\t\tthis.uniforms[ \"tSize\" ].value.set( readBuffer.width, readBuffer.height );\n\n\t\tthis.quad.material = this.material;\n\n\t\tif ( this.renderToScreen ) {\n\n\t\t\trenderer.render( this.scene, this.camera );\n\n\t\t} else {\n\n\t\t\trenderer.render( this.scene, this.camera, writeBuffer, false );\n\n\t\t}\n\n\t}\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Postprocessing/GlitchPass.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Postprocessing/GlitchPass.js",
            "module-type": "library",
            "text": "/**\n \n */\n\nTHREE.GlitchPass = function ( dt_size ) {\n\n\tif ( THREE.DigitalGlitch === undefined ) console.error( \"THREE.GlitchPass relies on THREE.DigitalGlitch\" );\n\t\n\tvar shader = THREE.DigitalGlitch;\n\tthis.uniforms = THREE.UniformsUtils.clone( shader.uniforms );\n\n\tif(dt_size==undefined) dt_size=64;\n\t\n\t\n\tthis.uniforms[ \"tDisp\"].value=this.generateHeightmap(dt_size);\n\t\n\n\tthis.material = new THREE.ShaderMaterial({\n\t\tuniforms: this.uniforms,\n\t\tvertexShader: shader.vertexShader,\n\t\tfragmentShader: shader.fragmentShader\n\t});\n\n\tconsole.log(this.material);\n\t\n\tthis.enabled = true;\n\tthis.renderToScreen = false;\n\tthis.needsSwap = true;\n\n\n\tthis.camera = new THREE.OrthographicCamera( -1, 1, 1, -1, 0, 1 );\n\tthis.scene  = new THREE.Scene();\n\n\tthis.quad = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), null );\n\tthis.scene.add( this.quad );\n\t\n\tthis.goWild=false;\n\tthis.curF=0;\n\tthis.generateTrigger();\n\t\n};\n\nTHREE.GlitchPass.prototype = {\n\n\trender: function ( renderer, writeBuffer, readBuffer, delta ) \n\t{\n\t\tthis.uniforms[ \"tDiffuse\" ].value = readBuffer;\n\t\tthis.uniforms[ 'seed' ].value=Math.random();//default seeding\n\t\tthis.uniforms[ 'byp' ].value=0;\n\t\t\n\t\tif(this.curF % this.randX ==0 || this.goWild==true)\n\t\t{\n\t\t\tthis.uniforms[ 'amount' ].value=Math.random()/30;\n\t\t\tthis.uniforms[ 'angle' ].value=THREE.Math.randFloat(-Math.PI,Math.PI);\n\t\t\tthis.uniforms[ 'seed_x' ].value=THREE.Math.randFloat(-1,1);\n\t\t\tthis.uniforms[ 'seed_y' ].value=THREE.Math.randFloat(-1,1);\n\t\t\tthis.uniforms[ 'distortion_x' ].value=THREE.Math.randFloat(0,1);\n\t\t\tthis.uniforms[ 'distortion_y' ].value=THREE.Math.randFloat(0,1);\n\t\t\tthis.curF=0;\n\t\t\tthis.generateTrigger();\n\t\t}\n\t\telse if(this.curF % this.randX <this.randX/5)\n\t\t{\n\t\t\tthis.uniforms[ 'amount' ].value=Math.random()/90;\n\t\t\tthis.uniforms[ 'angle' ].value=THREE.Math.randFloat(-Math.PI,Math.PI);\n\t\t\tthis.uniforms[ 'distortion_x' ].value=THREE.Math.randFloat(0,1);\n\t\t\tthis.uniforms[ 'distortion_y' ].value=THREE.Math.randFloat(0,1);\n\t\t\tthis.uniforms[ 'seed_x' ].value=THREE.Math.randFloat(-0.3,0.3);\n\t\t\tthis.uniforms[ 'seed_y' ].value=THREE.Math.randFloat(-0.3,0.3);\n\t\t}\n\t\telse if(this.goWild==false)\n\t\t{\n\t\t\tthis.uniforms[ 'byp' ].value=1;\n\t\t}\n\t\tthis.curF++;\n\t\t\n\t\tthis.quad.material = this.material;\n\t\tif ( this.renderToScreen ) \n\t\t{\n\t\t\trenderer.render( this.scene, this.camera );\n\t\t} \n\t\telse \n\t\t{\n\t\t\trenderer.render( this.scene, this.camera, writeBuffer, false );\n\t\t}\n\t},\n\tgenerateTrigger:function()\n\t{\n\t\tthis.randX=THREE.Math.randInt(120,240);\n\t},\n\tgenerateHeightmap:function(dt_size)\n\t{\n\t\tvar data_arr = new Float32Array( dt_size*dt_size * 3 );\n\t\tconsole.log(dt_size);\n\t\tvar length=dt_size*dt_size;\n\t\t\n\t\tfor ( var i = 0; i < length; i++) \n\t\t{\n\t\t\tvar val=THREE.Math.randFloat(0,1);\n\t\t\tdata_arr[ i*3 + 0 ] = val;\n\t\t\tdata_arr[ i*3 + 1 ] = val;\n\t\t\tdata_arr[ i*3 + 2 ] = val;\n\t\t}\n\t\t\n\t\tvar texture = new THREE.DataTexture( data_arr, dt_size, dt_size, THREE.RGBFormat, THREE.FloatType );\n\t\tconsole.log(texture);\n\t\tconsole.log(dt_size);\n\t\ttexture.minFilter = THREE.NearestFilter;\n\t\ttexture.magFilter = THREE.NearestFilter;\n\t\ttexture.needsUpdate = true;\n\t\ttexture.flipY = false;\n\t\treturn texture;\n\t}\n};"
        },
        "$:/plugins/rboue/Three.js/Lib/Postprocessing/EffectComposer.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Postprocessing/EffectComposer.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.EffectComposer = function ( renderer, renderTarget ) {\n\n\tthis.renderer = renderer;\n\n\tif ( renderTarget === undefined ) {\n\n\t\tvar width = window.innerWidth || 1;\n\t\tvar height = window.innerHeight || 1;\n\t\tvar parameters = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat, stencilBuffer: false };\n\n\t\trenderTarget = new THREE.WebGLRenderTarget( width, height, parameters );\n\n\t}\n\n\tthis.renderTarget1 = renderTarget;\n\tthis.renderTarget2 = renderTarget.clone();\n\n\tthis.writeBuffer = this.renderTarget1;\n\tthis.readBuffer = this.renderTarget2;\n\n\tthis.passes = [];\n\n\tif ( THREE.CopyShader === undefined )\n\t\tconsole.error( \"THREE.EffectComposer relies on THREE.CopyShader\" );\n\n\tthis.copyPass = new THREE.ShaderPass( THREE.CopyShader );\n\n};\n\nTHREE.EffectComposer.prototype = {\n\n\tswapBuffers: function() {\n\n\t\tvar tmp = this.readBuffer;\n\t\tthis.readBuffer = this.writeBuffer;\n\t\tthis.writeBuffer = tmp;\n\n\t},\n\n\taddPass: function ( pass ) {\n\n\t\tthis.passes.push( pass );\n\n\t},\n\n\tinsertPass: function ( pass, index ) {\n\n\t\tthis.passes.splice( index, 0, pass );\n\n\t},\n\n\trender: function ( delta ) {\n\n\t\tthis.writeBuffer = this.renderTarget1;\n\t\tthis.readBuffer = this.renderTarget2;\n\n\t\tvar maskActive = false;\n\n\t\tvar pass, i, il = this.passes.length;\n\n\t\tfor ( i = 0; i < il; i ++ ) {\n\n\t\t\tpass = this.passes[ i ];\n\n\t\t\tif ( !pass.enabled ) continue;\n\n\t\t\tpass.render( this.renderer, this.writeBuffer, this.readBuffer, delta, maskActive );\n\n\t\t\tif ( pass.needsSwap ) {\n\n\t\t\t\tif ( maskActive ) {\n\n\t\t\t\t\tvar context = this.renderer.context;\n\n\t\t\t\t\tcontext.stencilFunc( context.NOTEQUAL, 1, 0xffffffff );\n\n\t\t\t\t\tthis.copyPass.render( this.renderer, this.writeBuffer, this.readBuffer, delta );\n\n\t\t\t\t\tcontext.stencilFunc( context.EQUAL, 1, 0xffffffff );\n\n\t\t\t\t}\n\n\t\t\t\tthis.swapBuffers();\n\n\t\t\t}\n\n\t\t\tif ( pass instanceof THREE.MaskPass ) {\n\n\t\t\t\tmaskActive = true;\n\n\t\t\t} else if ( pass instanceof THREE.ClearMaskPass ) {\n\n\t\t\t\tmaskActive = false;\n\n\t\t\t}\n\n\t\t}\n\n\t},\n\n\treset: function ( renderTarget ) {\n\n\t\tif ( renderTarget === undefined ) {\n\n\t\t\trenderTarget = this.renderTarget1.clone();\n\n\t\t\trenderTarget.width = window.innerWidth;\n\t\t\trenderTarget.height = window.innerHeight;\n\n\t\t}\n\n\t\tthis.renderTarget1 = renderTarget;\n\t\tthis.renderTarget2 = renderTarget.clone();\n\n\t\tthis.writeBuffer = this.renderTarget1;\n\t\tthis.readBuffer = this.renderTarget2;\n\n\t},\n\n\tsetSize: function ( width, height ) {\n\n\t\tvar renderTarget = this.renderTarget1.clone();\n\n\t\trenderTarget.width = width;\n\t\trenderTarget.height = height;\n\n\t\tthis.reset( renderTarget );\n\n\t}\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Postprocessing/FilmPass.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Postprocessing/FilmPass.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.FilmPass = function ( noiseIntensity, scanlinesIntensity, scanlinesCount, grayscale ) {\n\n\tif ( THREE.FilmShader === undefined )\n\t\tconsole.error( \"THREE.FilmPass relies on THREE.FilmShader\" );\n\n\tvar shader = THREE.FilmShader;\n\n\tthis.uniforms = THREE.UniformsUtils.clone( shader.uniforms );\n\n\tthis.material = new THREE.ShaderMaterial( {\n\n\t\tuniforms: this.uniforms,\n\t\tvertexShader: shader.vertexShader,\n\t\tfragmentShader: shader.fragmentShader\n\n\t} );\n\n\tif ( grayscale !== undefined )\tthis.uniforms.grayscale.value = grayscale;\n\tif ( noiseIntensity !== undefined ) this.uniforms.nIntensity.value = noiseIntensity;\n\tif ( scanlinesIntensity !== undefined ) this.uniforms.sIntensity.value = scanlinesIntensity;\n\tif ( scanlinesCount !== undefined ) this.uniforms.sCount.value = scanlinesCount;\n\n\tthis.enabled = true;\n\tthis.renderToScreen = false;\n\tthis.needsSwap = true;\n\n\n\tthis.camera = new THREE.OrthographicCamera( -1, 1, 1, -1, 0, 1 );\n\tthis.scene  = new THREE.Scene();\n\n\tthis.quad = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), null );\n\tthis.scene.add( this.quad );\n\n};\n\nTHREE.FilmPass.prototype = {\n\n\trender: function ( renderer, writeBuffer, readBuffer, delta ) {\n\n\t\tthis.uniforms[ \"tDiffuse\" ].value = readBuffer;\n\t\tthis.uniforms[ \"time\" ].value += delta;\n\n\t\tthis.quad.material = this.material;\n\n\t\tif ( this.renderToScreen ) {\n\n\t\t\trenderer.render( this.scene, this.camera );\n\n\t\t} else {\n\n\t\t\trenderer.render( this.scene, this.camera, writeBuffer, false );\n\n\t\t}\n\n\t}\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Postprocessing/RenderPass.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Postprocessing/RenderPass.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.RenderPass = function ( scene, camera, overrideMaterial, clearColor, clearAlpha ) {\n\n\tthis.scene = scene;\n\tthis.camera = camera;\n\n\tthis.overrideMaterial = overrideMaterial;\n\n\tthis.clearColor = clearColor;\n\tthis.clearAlpha = ( clearAlpha !== undefined ) ? clearAlpha : 1;\n\n\tthis.oldClearColor = new THREE.Color();\n\tthis.oldClearAlpha = 1;\n\n\tthis.enabled = true;\n\tthis.clear = true;\n\tthis.needsSwap = false;\n\n};\n\nTHREE.RenderPass.prototype = {\n\n\trender: function ( renderer, writeBuffer, readBuffer, delta ) {\n\n\t\tthis.scene.overrideMaterial = this.overrideMaterial;\n\n\t\tif ( this.clearColor ) {\n\n\t\t\tthis.oldClearColor.copy( renderer.getClearColor() );\n\t\t\tthis.oldClearAlpha = renderer.getClearAlpha();\n\n\t\t\trenderer.setClearColor( this.clearColor, this.clearAlpha );\n\n\t\t}\n\n\t\trenderer.render( this.scene, this.camera, readBuffer, this.clear );\n\n\t\tif ( this.clearColor ) {\n\n\t\t\trenderer.setClearColor( this.oldClearColor, this.oldClearAlpha );\n\n\t\t}\n\n\t\tthis.scene.overrideMaterial = null;\n\n\t}\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Postprocessing/BokehPass.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Postprocessing/BokehPass.js",
            "module-type": "library",
            "text": "/**\n * Depth-of-field post-process with bokeh shader\n */\n\n\nTHREE.BokehPass = function ( scene, camera, params ) {\n\n\tthis.scene = scene;\n\tthis.camera = camera;\n\n\tvar focus = ( params.focus !== undefined ) ? params.focus : 1.0;\n\tvar aspect = ( params.aspect !== undefined ) ? params.aspect : camera.aspect;\n\tvar aperture = ( params.aperture !== undefined ) ? params.aperture : 0.025;\n\tvar maxblur = ( params.maxblur !== undefined ) ? params.maxblur : 1.0;\n\n\t// render targets\n\n\tvar width = params.width || window.innerWidth || 1;\n\tvar height = params.height || window.innerHeight || 1;\n\n\tthis.renderTargetColor = new THREE.WebGLRenderTarget( width, height, {\n\t\tminFilter: THREE.LinearFilter,\n\t\tmagFilter: THREE.LinearFilter,\n\t\tformat: THREE.RGBFormat\n\t} );\n\n\tthis.renderTargetDepth = this.renderTargetColor.clone();\n\n\t// depth material\n\n\tthis.materialDepth = new THREE.MeshDepthMaterial();\n\n\t// bokeh material\n\n\tif ( THREE.BokehShader === undefined ) {\n\t\tconsole.error( \"THREE.BokehPass relies on THREE.BokehShader\" );\n\t}\n\t\n\tvar bokehShader = THREE.BokehShader;\n\tvar bokehUniforms = THREE.UniformsUtils.clone( bokehShader.uniforms );\n\n\tbokehUniforms[ \"tDepth\" ].value = this.renderTargetDepth;\n\n\tbokehUniforms[ \"focus\" ].value = focus;\n\tbokehUniforms[ \"aspect\" ].value = aspect;\n\tbokehUniforms[ \"aperture\" ].value = aperture;\n\tbokehUniforms[ \"maxblur\" ].value = maxblur;\n\n\tthis.materialBokeh = new THREE.ShaderMaterial({\n\t\tuniforms: bokehUniforms,\n\t\tvertexShader: bokehShader.vertexShader,\n\t\tfragmentShader: bokehShader.fragmentShader\n\t});\n\n\tthis.uniforms = bokehUniforms;\n\tthis.enabled = true;\n\tthis.needsSwap = false;\n\tthis.renderToScreen = false;\n\tthis.clear = false;\n\n\tthis.camera2 = new THREE.OrthographicCamera( -1, 1, 1, -1, 0, 1 );\n\tthis.scene2  = new THREE.Scene();\n\n\tthis.quad2 = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), null );\n\tthis.scene2.add( this.quad2 );\n\n};\n\nTHREE.BokehPass.prototype = {\n\n\trender: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {\n\n\t\tthis.quad2.material = this.materialBokeh;\n\n\t\t// Render depth into texture\n\n\t\tthis.scene.overrideMaterial = this.materialDepth;\n\n\t\trenderer.render( this.scene, this.camera, this.renderTargetDepth, true );\n\n\t\t// Render bokeh composite\n\n\t\tthis.uniforms[ \"tColor\" ].value = readBuffer;\n\n\t\tif ( this.renderToScreen ) {\n\n\t\t\trenderer.render( this.scene2, this.camera2 );\n\n\t\t} else {\n\n\t\t\trenderer.render( this.scene2, this.camera2, writeBuffer, this.clear );\n\n\t\t}\n\n\t\tthis.scene.overrideMaterial = null;\n\n\t}\n\n};\n\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Postprocessing/MaskPass.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Postprocessing/MaskPass.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.MaskPass = function ( scene, camera ) {\n\n\tthis.scene = scene;\n\tthis.camera = camera;\n\n\tthis.enabled = true;\n\tthis.clear = true;\n\tthis.needsSwap = false;\n\n\tthis.inverse = false;\n\n};\n\nTHREE.MaskPass.prototype = {\n\n\trender: function ( renderer, writeBuffer, readBuffer, delta ) {\n\n\t\tvar context = renderer.context;\n\n\t\t// don't update color or depth\n\n\t\tcontext.colorMask( false, false, false, false );\n\t\tcontext.depthMask( false );\n\n\t\t// set up stencil\n\n\t\tvar writeValue, clearValue;\n\n\t\tif ( this.inverse ) {\n\n\t\t\twriteValue = 0;\n\t\t\tclearValue = 1;\n\n\t\t} else {\n\n\t\t\twriteValue = 1;\n\t\t\tclearValue = 0;\n\n\t\t}\n\n\t\tcontext.enable( context.STENCIL_TEST );\n\t\tcontext.stencilOp( context.REPLACE, context.REPLACE, context.REPLACE );\n\t\tcontext.stencilFunc( context.ALWAYS, writeValue, 0xffffffff );\n\t\tcontext.clearStencil( clearValue );\n\n\t\t// draw into the stencil buffer\n\n\t\trenderer.render( this.scene, this.camera, readBuffer, this.clear );\n\t\trenderer.render( this.scene, this.camera, writeBuffer, this.clear );\n\n\t\t// re-enable update of color and depth\n\n\t\tcontext.colorMask( true, true, true, true );\n\t\tcontext.depthMask( true );\n\n\t\t// only render where stencil is set to 1\n\n\t\tcontext.stencilFunc( context.EQUAL, 1, 0xffffffff );  // draw if == 1\n\t\tcontext.stencilOp( context.KEEP, context.KEEP, context.KEEP );\n\n\t}\n\n};\n\n\nTHREE.ClearMaskPass = function () {\n\n\tthis.enabled = true;\n\n};\n\nTHREE.ClearMaskPass.prototype = {\n\n\trender: function ( renderer, writeBuffer, readBuffer, delta ) {\n\n\t\tvar context = renderer.context;\n\n\t\tcontext.disable( context.STENCIL_TEST );\n\n\t}\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Postprocessing/TexturePass.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Postprocessing/TexturePass.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.TexturePass = function ( texture, opacity ) {\n\n\tif ( THREE.CopyShader === undefined )\n\t\tconsole.error( \"THREE.TexturePass relies on THREE.CopyShader\" );\n\n\tvar shader = THREE.CopyShader;\n\n\tthis.uniforms = THREE.UniformsUtils.clone( shader.uniforms );\n\n\tthis.uniforms[ \"opacity\" ].value = ( opacity !== undefined ) ? opacity : 1.0;\n\tthis.uniforms[ \"tDiffuse\" ].value = texture;\n\n\tthis.material = new THREE.ShaderMaterial( {\n\n\t\tuniforms: this.uniforms,\n\t\tvertexShader: shader.vertexShader,\n\t\tfragmentShader: shader.fragmentShader\n\n\t} );\n\n\tthis.enabled = true;\n\tthis.needsSwap = false;\n\n\n\tthis.camera = new THREE.OrthographicCamera( -1, 1, 1, -1, 0, 1 );\n\tthis.scene  = new THREE.Scene();\n\n\tthis.quad = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), null );\n\tthis.scene.add( this.quad );\n\n};\n\nTHREE.TexturePass.prototype = {\n\n\trender: function ( renderer, writeBuffer, readBuffer, delta ) {\n\n\t\tthis.quad.material = this.material;\n\n\t\trenderer.render( this.scene, this.camera, readBuffer );\n\n\t}\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/ShaderToon.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/ShaderToon.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n * @author alteredq / http://alteredqualia.com/\n *\n * ShaderToon currently contains:\n *\n *\ttoon1\n *\ttoon2\n *\thatching\n *\tdotted\n */\n\nTHREE.ShaderToon = {\n\n'toon1' : {\n\n\tuniforms: {\n\n\t\t\"uDirLightPos\":\t{ type: \"v3\", value: new THREE.Vector3() },\n\t\t\"uDirLightColor\": { type: \"c\", value: new THREE.Color( 0xeeeeee ) },\n\n\t\t\"uAmbientLightColor\": { type: \"c\", value: new THREE.Color( 0x050505 ) },\n\n\t\t\"uBaseColor\":  { type: \"c\", value: new THREE.Color( 0xffffff ) }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec3 vNormal;\",\n\t\t\"varying vec3 vRefract;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\",\n\t\t\t\"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\",\n\t\t\t\"vec3 worldNormal = normalize ( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );\",\n\n\t\t\t\"vNormal = normalize( normalMatrix * normal );\",\n\n\t\t\t\"vec3 I = worldPosition.xyz - cameraPosition;\",\n\t\t\t\"vRefract = refract( normalize( I ), worldNormal, 1.02 );\",\n\n\t\t\t\"gl_Position = projectionMatrix * mvPosition;\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform vec3 uBaseColor;\",\n\n\t\t\"uniform vec3 uDirLightPos;\",\n\t\t\"uniform vec3 uDirLightColor;\",\n\n\t\t\"uniform vec3 uAmbientLightColor;\",\n\n\t\t\"varying vec3 vNormal;\",\n\n\t\t\"varying vec3 vRefract;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"float directionalLightWeighting = max( dot( normalize( vNormal ), uDirLightPos ), 0.0);\",\n\t\t\t\"vec3 lightWeighting = uAmbientLightColor + uDirLightColor * directionalLightWeighting;\",\n\n\t\t\t\"float intensity = smoothstep( - 0.5, 1.0, pow( length(lightWeighting), 20.0 ) );\",\n\t\t\t\"intensity += length(lightWeighting) * 0.2;\",\n\n\t\t\t\"float cameraWeighting = dot( normalize( vNormal ), vRefract );\",\n\t\t\t\"intensity += pow( 1.0 - length( cameraWeighting ), 6.0 );\",\n\t\t\t\"intensity = intensity * 0.2 + 0.3;\",\n\n\t\t\t\"if ( intensity < 0.50 ) {\",\n\n\t\t\t\t\"gl_FragColor = vec4( 2.0 * intensity * uBaseColor, 1.0 );\",\n\n\t\t\t\"} else {\",\n\n\t\t\t\t\"gl_FragColor = vec4( 1.0 - 2.0 * ( 1.0 - intensity ) * ( 1.0 - uBaseColor ), 1.0 );\",\n\n\t\t\t\"}\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n},\n\n'toon2' : {\n\n\tuniforms: {\n\n\t\t\"uDirLightPos\":\t{ type: \"v3\", value: new THREE.Vector3() },\n\t\t\"uDirLightColor\": { type: \"c\", value: new THREE.Color( 0xeeeeee ) },\n\n\t\t\"uAmbientLightColor\": { type: \"c\", value: new THREE.Color( 0x050505 ) },\n\n\t\t\"uBaseColor\":  { type: \"c\", value: new THREE.Color( 0xeeeeee ) },\n\t\t\"uLineColor1\": { type: \"c\", value: new THREE.Color( 0x808080 ) },\n\t\t\"uLineColor2\": { type: \"c\", value: new THREE.Color( 0x000000 ) },\n\t\t\"uLineColor3\": { type: \"c\", value: new THREE.Color( 0x000000 ) },\n\t\t\"uLineColor4\": { type: \"c\", value: new THREE.Color( 0x000000 ) }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec3 vNormal;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\t\t\t\"vNormal = normalize( normalMatrix * normal );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform vec3 uBaseColor;\",\n\t\t\"uniform vec3 uLineColor1;\",\n\t\t\"uniform vec3 uLineColor2;\",\n\t\t\"uniform vec3 uLineColor3;\",\n\t\t\"uniform vec3 uLineColor4;\",\n\n\t\t\"uniform vec3 uDirLightPos;\",\n\t\t\"uniform vec3 uDirLightColor;\",\n\n\t\t\"uniform vec3 uAmbientLightColor;\",\n\n\t\t\"varying vec3 vNormal;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"float camera = max( dot( normalize( vNormal ), vec3( 0.0, 0.0, 1.0 ) ), 0.4);\",\n\t\t\t\"float light = max( dot( normalize( vNormal ), uDirLightPos ), 0.0);\",\n\n\t\t\t\"gl_FragColor = vec4( uBaseColor, 1.0 );\",\n\n\t\t\t\"if ( length(uAmbientLightColor + uDirLightColor * light) < 1.00 ) {\",\n\n\t\t\t\t\"gl_FragColor *= vec4( uLineColor1, 1.0 );\",\n\n\t\t\t\"}\",\n\n\t\t\t\"if ( length(uAmbientLightColor + uDirLightColor * camera) < 0.50 ) {\",\n\n\t\t\t\t\"gl_FragColor *= vec4( uLineColor2, 1.0 );\",\n\n\t\t\t\"}\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n},\n\n'hatching' : {\n\n\tuniforms: {\n\n\t\t\"uDirLightPos\":\t{ type: \"v3\", value: new THREE.Vector3() },\n\t\t\"uDirLightColor\": { type: \"c\", value: new THREE.Color( 0xeeeeee ) },\n\n\t\t\"uAmbientLightColor\": { type: \"c\", value: new THREE.Color( 0x050505 ) },\n\n\t\t\"uBaseColor\":  { type: \"c\", value: new THREE.Color( 0xffffff ) },\n\t\t\"uLineColor1\": { type: \"c\", value: new THREE.Color( 0x000000 ) },\n\t\t\"uLineColor2\": { type: \"c\", value: new THREE.Color( 0x000000 ) },\n\t\t\"uLineColor3\": { type: \"c\", value: new THREE.Color( 0x000000 ) },\n\t\t\"uLineColor4\": { type: \"c\", value: new THREE.Color( 0x000000 ) }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec3 vNormal;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\t\t\t\"vNormal = normalize( normalMatrix * normal );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform vec3 uBaseColor;\",\n\t\t\"uniform vec3 uLineColor1;\",\n\t\t\"uniform vec3 uLineColor2;\",\n\t\t\"uniform vec3 uLineColor3;\",\n\t\t\"uniform vec3 uLineColor4;\",\n\n\t\t\"uniform vec3 uDirLightPos;\",\n\t\t\"uniform vec3 uDirLightColor;\",\n\n\t\t\"uniform vec3 uAmbientLightColor;\",\n\n\t\t\"varying vec3 vNormal;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"float directionalLightWeighting = max( dot( normalize(vNormal), uDirLightPos ), 0.0);\",\n\t\t\t\"vec3 lightWeighting = uAmbientLightColor + uDirLightColor * directionalLightWeighting;\",\n\n\t\t\t\"gl_FragColor = vec4( uBaseColor, 1.0 );\",\n\n\t\t\t\"if ( length(lightWeighting) < 1.00 ) {\",\n\n\t\t\t\t\"if ( mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) {\",\n\n\t\t\t\t\t\"gl_FragColor = vec4( uLineColor1, 1.0 );\",\n\n\t\t\t\t\"}\",\n\n\t\t\t\"}\",\n\n\t\t\t\"if ( length(lightWeighting) < 0.75 ) {\",\n\n\t\t\t\t\"if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) {\",\n\n\t\t\t\t\t\"gl_FragColor = vec4( uLineColor2, 1.0 );\",\n\n\t\t\t\t\"}\",\n\t\t\t\"}\",\n\n\t\t\t\"if ( length(lightWeighting) < 0.50 ) {\",\n\n\t\t\t\t\"if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) {\",\n\n\t\t\t\t\t\"gl_FragColor = vec4( uLineColor3, 1.0 );\",\n\n\t\t\t\t\"}\",\n\t\t\t\"}\",\n\n\t\t\t\"if ( length(lightWeighting) < 0.3465 ) {\",\n\n\t\t\t\t\"if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) {\",\n\n\t\t\t\t\t\"gl_FragColor = vec4( uLineColor4, 1.0 );\",\n\n\t\t\t\t\"}\",\n\t\t\t\"}\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n},\n\n'dotted' : {\n\n\tuniforms: {\n\n\t\t\"uDirLightPos\":\t{ type: \"v3\", value: new THREE.Vector3() },\n\t\t\"uDirLightColor\": { type: \"c\", value: new THREE.Color( 0xeeeeee ) },\n\n\t\t\"uAmbientLightColor\": { type: \"c\", value: new THREE.Color( 0x050505 ) },\n\n\t\t\"uBaseColor\":  { type: \"c\", value: new THREE.Color( 0xffffff ) },\n\t\t\"uLineColor1\": { type: \"c\", value: new THREE.Color( 0x000000 ) }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec3 vNormal;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\t\t\t\"vNormal = normalize( normalMatrix * normal );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform vec3 uBaseColor;\",\n\t\t\"uniform vec3 uLineColor1;\",\n\t\t\"uniform vec3 uLineColor2;\",\n\t\t\"uniform vec3 uLineColor3;\",\n\t\t\"uniform vec3 uLineColor4;\",\n\n\t\t\"uniform vec3 uDirLightPos;\",\n\t\t\"uniform vec3 uDirLightColor;\",\n\n\t\t\"uniform vec3 uAmbientLightColor;\",\n\n\t\t\"varying vec3 vNormal;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"float directionalLightWeighting = max( dot( normalize(vNormal), uDirLightPos ), 0.0);\",\n\t\t\t\"vec3 lightWeighting = uAmbientLightColor + uDirLightColor * directionalLightWeighting;\",\n\n\t\t\t\"gl_FragColor = vec4( uBaseColor, 1.0 );\",\n\n\t\t\t\"if ( length(lightWeighting) < 1.00 ) {\",\n\n\t\t\t\t\"if ( ( mod(gl_FragCoord.x, 4.001) + mod(gl_FragCoord.y, 4.0) ) > 6.00 ) {\",\n\n\t\t\t\t\t\"gl_FragColor = vec4( uLineColor1, 1.0 );\",\n\n\t\t\t\t\"}\",\n\n\t\t\t\"}\",\n\n\t\t\t\"if ( length(lightWeighting) < 0.50 ) {\",\n\n\t\t\t\t\"if ( ( mod(gl_FragCoord.x + 2.0, 4.001) + mod(gl_FragCoord.y + 2.0, 4.0) ) > 6.00 ) {\",\n\n\t\t\t\t\t\"gl_FragColor = vec4( uLineColor1, 1.0 );\",\n\n\t\t\t\t\"}\",\n\n\t\t\t\"}\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n}\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/MarchingCubes.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/MarchingCubes.js",
            "module-type": "library",
            "text": "/**\r\n * @author alteredq / http://alteredqualia.com/\r\n *\r\n * Port of greggman's ThreeD version of marching cubes to Three.js\r\n * http://webglsamples.googlecode.com/hg/blob/blob.html\r\n */\r\n\r\nTHREE.MarchingCubes = function ( resolution, material, enableUvs, enableColors ) {\r\n\r\n\tTHREE.ImmediateRenderObject.call( this );\r\n\r\n\tthis.material = material;\r\n\r\n\tthis.enableUvs = enableUvs !== undefined ? enableUvs : false;\r\n\tthis.enableColors = enableColors !== undefined ? enableColors : false;\r\n\r\n\t// functions have to be object properties\r\n\t// prototype functions kill performance\r\n\t// (tested and it was 4x slower !!!)\r\n\r\n\tthis.init = function( resolution ) {\r\n\r\n\t\tthis.resolution = resolution;\r\n\r\n\t\t// parameters\r\n\r\n\t\tthis.isolation = 80.0;\r\n\r\n\t\t// size of field, 32 is pushing it in Javascript :)\r\n\r\n\t\tthis.size = resolution;\r\n\t\tthis.size2 = this.size * this.size;\r\n\t\tthis.size3 = this.size2 * this.size;\r\n\t\tthis.halfsize = this.size / 2.0;\r\n\r\n\t\t// deltas\r\n\r\n\t\tthis.delta = 2.0 / this.size;\r\n\t\tthis.yd = this.size;\r\n\t\tthis.zd = this.size2;\r\n\r\n\t\tthis.field = new Float32Array( this.size3 );\r\n\t\tthis.normal_cache = new Float32Array( this.size3 * 3 );\r\n\r\n\t\t// temp buffers used in polygonize\r\n\r\n\t\tthis.vlist = new Float32Array( 12 * 3 );\r\n\t\tthis.nlist = new Float32Array( 12 * 3 );\r\n\r\n\t\tthis.firstDraw = true;\r\n\r\n\t\t// immediate render mode simulator\r\n\r\n\t\tthis.maxCount = 4096; // TODO: find the fastest size for this buffer\r\n\t\tthis.count = 0;\r\n\r\n\t\tthis.hasPositions = false;\r\n\t\tthis.hasNormals = false;\r\n\t\tthis.hasColors = false;\r\n\t\tthis.hasUvs = false;\r\n\r\n\t\tthis.positionArray = new Float32Array( this.maxCount * 3 );\r\n\t\tthis.normalArray   = new Float32Array( this.maxCount * 3 );\r\n\r\n\t\tif ( this.enableUvs ) {\r\n\r\n\t\t\tthis.uvArray = new Float32Array( this.maxCount * 2 );\r\n\r\n\t\t}\r\n\r\n\t\tif ( this.enableColors ) {\r\n\r\n\t\t\tthis.colorArray   = new Float32Array( this.maxCount * 3 );\r\n\r\n\t\t}\r\n\r\n\t};\r\n\r\n\t///////////////////////\r\n\t// Polygonization\r\n\t///////////////////////\r\n\r\n\tthis.lerp = function( a, b, t ) { return a + ( b - a ) * t; };\r\n\r\n\tthis.VIntX = function( q, pout, nout, offset, isol, x, y, z, valp1, valp2 ) {\r\n\r\n\t\tvar mu = ( isol - valp1 ) / ( valp2 - valp1 ),\r\n\t\tnc = this.normal_cache;\r\n\r\n\t\tpout[ offset ] \t   = x + mu * this.delta;\r\n\t\tpout[ offset + 1 ] = y;\r\n\t\tpout[ offset + 2 ] = z;\r\n\r\n\t\tnout[ offset ] \t   = this.lerp( nc[ q ],     nc[ q + 3 ], mu );\r\n\t\tnout[ offset + 1 ] = this.lerp( nc[ q + 1 ], nc[ q + 4 ], mu );\r\n\t\tnout[ offset + 2 ] = this.lerp( nc[ q + 2 ], nc[ q + 5 ], mu );\r\n\r\n\t};\r\n\r\n\tthis.VIntY = function( q, pout, nout, offset, isol, x, y, z, valp1, valp2 ) {\r\n\r\n\t\tvar mu = ( isol - valp1 ) / ( valp2 - valp1 ),\r\n\t\tnc = this.normal_cache;\r\n\r\n\t\tpout[ offset ] \t   = x;\r\n\t\tpout[ offset + 1 ] = y + mu * this.delta;\r\n\t\tpout[ offset + 2 ] = z;\r\n\r\n\t\tvar q2 = q + this.yd * 3;\r\n\r\n\t\tnout[ offset ] \t   = this.lerp( nc[ q ],     nc[ q2 ],     mu );\r\n\t\tnout[ offset + 1 ] = this.lerp( nc[ q + 1 ], nc[ q2 + 1 ], mu );\r\n\t\tnout[ offset + 2 ] = this.lerp( nc[ q + 2 ], nc[ q2 + 2 ], mu );\r\n\r\n\t};\r\n\r\n\tthis.VIntZ = function( q, pout, nout, offset, isol, x, y, z, valp1, valp2 ) {\r\n\r\n\t\tvar mu = ( isol - valp1 ) / ( valp2 - valp1 ),\r\n\t\tnc = this.normal_cache;\r\n\r\n\t\tpout[ offset ] \t   = x;\r\n\t\tpout[ offset + 1 ] = y;\r\n\t\tpout[ offset + 2 ] = z + mu * this.delta;\r\n\r\n\t\tvar q2 = q + this.zd * 3;\r\n\r\n\t\tnout[ offset ] \t   = this.lerp( nc[ q ],     nc[ q2 ],     mu );\r\n\t\tnout[ offset + 1 ] = this.lerp( nc[ q + 1 ], nc[ q2 + 1 ], mu );\r\n\t\tnout[ offset + 2 ] = this.lerp( nc[ q + 2 ], nc[ q2 + 2 ], mu );\r\n\r\n\t};\r\n\r\n\tthis.compNorm = function( q ) {\r\n\r\n\t\tvar q3 = q * 3;\r\n\r\n\t\tif ( this.normal_cache[ q3 ] === 0.0 ) {\r\n\r\n\t\t\tthis.normal_cache[ q3     ] = this.field[ q - 1  ] \t    - this.field[ q + 1 ];\r\n\t\t\tthis.normal_cache[ q3 + 1 ] = this.field[ q - this.yd ] - this.field[ q + this.yd ];\r\n\t\t\tthis.normal_cache[ q3 + 2 ] = this.field[ q - this.zd ] - this.field[ q + this.zd ];\r\n\r\n\t\t}\r\n\r\n\t};\r\n\r\n\t// Returns total number of triangles. Fills triangles.\r\n\t// (this is where most of time is spent - it's inner work of O(n3) loop )\r\n\r\n\tthis.polygonize = function( fx, fy, fz, q, isol, renderCallback ) {\r\n\r\n\t\t// cache indices\r\n\t\tvar q1 = q + 1,\r\n\t\t\tqy = q + this.yd,\r\n\t\t\tqz = q + this.zd,\r\n\t\t\tq1y = q1 + this.yd,\r\n\t\t\tq1z = q1 + this.zd,\r\n\t\t\tqyz = q + this.yd + this.zd,\r\n\t\t\tq1yz = q1 + this.yd + this.zd;\r\n\r\n\t\tvar cubeindex = 0,\r\n\t\t\tfield0 = this.field[ q ],\r\n\t\t\tfield1 = this.field[ q1 ],\r\n\t\t\tfield2 = this.field[ qy ],\r\n\t\t\tfield3 = this.field[ q1y ],\r\n\t\t\tfield4 = this.field[ qz ],\r\n\t\t\tfield5 = this.field[ q1z ],\r\n\t\t\tfield6 = this.field[ qyz ],\r\n\t\t\tfield7 = this.field[ q1yz ];\r\n\r\n\t\tif ( field0 < isol ) cubeindex |= 1;\r\n\t\tif ( field1 < isol ) cubeindex |= 2;\r\n\t\tif ( field2 < isol ) cubeindex |= 8;\r\n\t\tif ( field3 < isol ) cubeindex |= 4;\r\n\t\tif ( field4 < isol ) cubeindex |= 16;\r\n\t\tif ( field5 < isol ) cubeindex |= 32;\r\n\t\tif ( field6 < isol ) cubeindex |= 128;\r\n\t\tif ( field7 < isol ) cubeindex |= 64;\r\n\r\n\t\t// if cube is entirely in/out of the surface - bail, nothing to draw\r\n\r\n\t\tvar bits = THREE.edgeTable[ cubeindex ];\r\n\t\tif ( bits === 0 ) return 0;\r\n\r\n\t\tvar d = this.delta,\r\n\t\t\tfx2 = fx + d,\r\n\t\t\tfy2 = fy + d,\r\n\t\t\tfz2 = fz + d;\r\n\r\n\t\t// top of the cube\r\n\r\n\t\tif ( bits & 1 ) {\r\n\r\n\t\t\tthis.compNorm( q );\r\n\t\t\tthis.compNorm( q1 );\r\n\t\t\tthis.VIntX( q * 3, this.vlist, this.nlist, 0, isol, fx, fy, fz, field0, field1 );\r\n\r\n\t\t};\r\n\r\n\t\tif ( bits & 2 ) {\r\n\r\n\t\t\tthis.compNorm( q1 );\r\n\t\t\tthis.compNorm( q1y );\r\n\t\t\tthis.VIntY( q1 * 3, this.vlist, this.nlist, 3, isol, fx2, fy, fz, field1, field3 );\r\n\r\n\t\t};\r\n\r\n\t\tif ( bits & 4 ) {\r\n\r\n\t\t\tthis.compNorm( qy );\r\n\t\t\tthis.compNorm( q1y );\r\n\t\t\tthis.VIntX( qy * 3, this.vlist, this.nlist, 6, isol, fx, fy2, fz, field2, field3 );\r\n\r\n\t\t};\r\n\r\n\t\tif ( bits & 8 ) {\r\n\r\n\t\t\tthis.compNorm( q );\r\n\t\t\tthis.compNorm( qy );\r\n\t\t\tthis.VIntY( q * 3, this.vlist, this.nlist, 9, isol, fx, fy, fz, field0, field2 );\r\n\r\n\t\t};\r\n\r\n\t\t// bottom of the cube\r\n\r\n\t\tif ( bits & 16 )  {\r\n\r\n\t\t\tthis.compNorm( qz );\r\n\t\t\tthis.compNorm( q1z );\r\n\t\t\tthis.VIntX( qz * 3, this.vlist, this.nlist, 12, isol, fx, fy, fz2, field4, field5 );\r\n\r\n\t\t};\r\n\r\n\t\tif ( bits & 32 )  {\r\n\r\n\t\t\tthis.compNorm( q1z );\r\n\t\t\tthis.compNorm( q1yz );\r\n\t\t\tthis.VIntY( q1z * 3,  this.vlist, this.nlist, 15, isol, fx2, fy, fz2, field5, field7 );\r\n\r\n\t\t};\r\n\r\n\t\tif ( bits & 64 ) {\r\n\r\n\t\t\tthis.compNorm( qyz );\r\n\t\t\tthis.compNorm( q1yz );\r\n\t\t\tthis.VIntX( qyz * 3, this.vlist, this.nlist, 18, isol, fx, fy2, fz2, field6, field7 );\r\n\r\n\t\t};\r\n\r\n\t\tif ( bits & 128 ) {\r\n\r\n\t\t\tthis.compNorm( qz );\r\n\t\t\tthis.compNorm( qyz );\r\n\t\t\tthis.VIntY( qz * 3,  this.vlist, this.nlist, 21, isol, fx, fy, fz2, field4, field6 );\r\n\r\n\t\t};\r\n\r\n\t\t// vertical lines of the cube\r\n\r\n\t\tif ( bits & 256 ) {\r\n\r\n\t\t\tthis.compNorm( q );\r\n\t\t\tthis.compNorm( qz );\r\n\t\t\tthis.VIntZ( q * 3, this.vlist, this.nlist, 24, isol, fx, fy, fz, field0, field4 );\r\n\r\n\t\t};\r\n\r\n\t\tif ( bits & 512 ) {\r\n\r\n\t\t\tthis.compNorm( q1 );\r\n\t\t\tthis.compNorm( q1z );\r\n\t\t\tthis.VIntZ( q1 * 3,  this.vlist, this.nlist, 27, isol, fx2, fy,  fz, field1, field5 );\r\n\r\n\t\t};\r\n\r\n\t\tif ( bits & 1024 ) {\r\n\r\n\t\t\tthis.compNorm( q1y );\r\n\t\t\tthis.compNorm( q1yz );\r\n\t\t\tthis.VIntZ( q1y * 3, this.vlist, this.nlist, 30, isol, fx2, fy2, fz, field3, field7 );\r\n\r\n\t\t};\r\n\r\n\t\tif ( bits & 2048 ) {\r\n\r\n\t\t\tthis.compNorm( qy );\r\n\t\t\tthis.compNorm( qyz );\r\n\t\t\tthis.VIntZ( qy * 3, this.vlist, this.nlist, 33, isol, fx,  fy2, fz, field2, field6 );\r\n\r\n\t\t};\r\n\r\n\t\tcubeindex <<= 4;  // re-purpose cubeindex into an offset into triTable\r\n\r\n\t\tvar o1, o2, o3, numtris = 0, i = 0;\r\n\r\n\t\t// here is where triangles are created\r\n\r\n\t\twhile ( THREE.triTable[ cubeindex + i ] != -1 ) {\r\n\r\n\t\t\to1 = cubeindex + i;\r\n\t\t\to2 = o1 + 1;\r\n\t\t\to3 = o1 + 2;\r\n\r\n\t\t\tthis.posnormtriv( this.vlist, this.nlist,\r\n\t\t\t\t\t\t\t  3 * THREE.triTable[ o1 ],\r\n\t\t\t\t\t\t\t  3 * THREE.triTable[ o2 ],\r\n\t\t\t\t\t\t\t  3 * THREE.triTable[ o3 ],\r\n\t\t\t\t\t\t\t  renderCallback );\r\n\r\n\t\t\ti += 3;\r\n\t\t\tnumtris ++;\r\n\r\n\t\t}\r\n\r\n\t\treturn numtris;\r\n\r\n\t};\r\n\r\n\t/////////////////////////////////////\r\n\t// Immediate render mode simulator\r\n\t/////////////////////////////////////\r\n\r\n\tthis.posnormtriv = function( pos, norm, o1, o2, o3, renderCallback ) {\r\n\r\n\t\tvar c = this.count * 3;\r\n\r\n\t\t// positions\r\n\r\n\t\tthis.positionArray[ c ] \t= pos[ o1 ];\r\n\t\tthis.positionArray[ c + 1 ] = pos[ o1 + 1 ];\r\n\t\tthis.positionArray[ c + 2 ] = pos[ o1 + 2 ];\r\n\r\n\t\tthis.positionArray[ c + 3 ] = pos[ o2 ];\r\n\t\tthis.positionArray[ c + 4 ] = pos[ o2 + 1 ];\r\n\t\tthis.positionArray[ c + 5 ] = pos[ o2 + 2 ];\r\n\r\n\t\tthis.positionArray[ c + 6 ] = pos[ o3 ];\r\n\t\tthis.positionArray[ c + 7 ] = pos[ o3 + 1 ];\r\n\t\tthis.positionArray[ c + 8 ] = pos[ o3 + 2 ];\r\n\r\n\t\t// normals\r\n\r\n\t\tthis.normalArray[ c ] \t  = norm[ o1 ];\r\n\t\tthis.normalArray[ c + 1 ] = norm[ o1 + 1 ];\r\n\t\tthis.normalArray[ c + 2 ] = norm[ o1 + 2 ];\r\n\r\n\t\tthis.normalArray[ c + 3 ] = norm[ o2 ];\r\n\t\tthis.normalArray[ c + 4 ] = norm[ o2 + 1 ];\r\n\t\tthis.normalArray[ c + 5 ] = norm[ o2 + 2 ];\r\n\r\n\t\tthis.normalArray[ c + 6 ] = norm[ o3 ];\r\n\t\tthis.normalArray[ c + 7 ] = norm[ o3 + 1 ];\r\n\t\tthis.normalArray[ c + 8 ] = norm[ o3 + 2 ];\r\n\r\n\t\t// uvs\r\n\r\n\t\tif ( this.enableUvs ) {\r\n\r\n\t\t\tvar d = this.count * 2;\r\n\r\n\t\t\tthis.uvArray[ d ] \t  = pos[ o1 ];\r\n\t\t\tthis.uvArray[ d + 1 ] = pos[ o1 + 2 ];\r\n\r\n\t\t\tthis.uvArray[ d + 2 ] = pos[ o2 ];\r\n\t\t\tthis.uvArray[ d + 3 ] = pos[ o2 + 2 ];\r\n\r\n\t\t\tthis.uvArray[ d + 4 ] = pos[ o3 ];\r\n\t\t\tthis.uvArray[ d + 5 ] = pos[ o3 + 2 ];\r\n\r\n\t\t}\r\n\r\n\t\t// colors\r\n\r\n\t\tif ( this.enableColors ) {\r\n\r\n\t\t\tthis.colorArray[ c ] \t = pos[ o1 ];\r\n\t\t\tthis.colorArray[ c + 1 ] = pos[ o1 + 1 ];\r\n\t\t\tthis.colorArray[ c + 2 ] = pos[ o1 + 2 ];\r\n\r\n\t\t\tthis.colorArray[ c + 3 ] = pos[ o2 ];\r\n\t\t\tthis.colorArray[ c + 4 ] = pos[ o2 + 1 ];\r\n\t\t\tthis.colorArray[ c + 5 ] = pos[ o2 + 2 ];\r\n\r\n\t\t\tthis.colorArray[ c + 6 ] = pos[ o3 ];\r\n\t\t\tthis.colorArray[ c + 7 ] = pos[ o3 + 1 ];\r\n\t\t\tthis.colorArray[ c + 8 ] = pos[ o3 + 2 ];\r\n\r\n\t\t}\r\n\r\n\t\tthis.count += 3;\r\n\r\n\t\tif ( this.count >= this.maxCount - 3 ) {\r\n\r\n\t\t\tthis.hasPositions = true;\r\n\t\t\tthis.hasNormals = true;\r\n\r\n\t\t\tif ( this.enableUvs ) {\r\n\r\n\t\t\t\tthis.hasUvs = true;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif ( this.enableColors ) {\r\n\r\n\t\t\t\tthis.hasColors = true;\r\n\r\n\t\t\t}\r\n\r\n\t\t\trenderCallback( this );\r\n\r\n\t\t}\r\n\r\n\t};\r\n\r\n\tthis.begin = function( ) {\r\n\r\n\t\tthis.count = 0;\r\n\r\n\t\tthis.hasPositions = false;\r\n\t\tthis.hasNormals = false;\r\n\t\tthis.hasUvs = false;\r\n\t\tthis.hasColors = false;\r\n\r\n\t};\r\n\r\n\tthis.end = function( renderCallback ) {\r\n\r\n\t\tif ( this.count === 0 )\r\n\t\t\treturn;\r\n\r\n\t\tfor ( var i = this.count * 3; i < this.positionArray.length; i ++ )\r\n\t\t\tthis.positionArray[ i ] = 0.0;\r\n\r\n\t\tthis.hasPositions = true;\r\n\t\tthis.hasNormals = true;\r\n\r\n\t\tif ( this.enableUvs ) {\r\n\r\n\t\t\tthis.hasUvs = true;\r\n\r\n\t\t}\r\n\r\n\t\tif ( this.enableColors ) {\r\n\r\n\t\t\tthis.hasColors = true;\r\n\r\n\t\t}\r\n\r\n\t\trenderCallback( this );\r\n\r\n\t};\r\n\r\n\t/////////////////////////////////////\r\n\t// Metaballs\r\n\t/////////////////////////////////////\r\n\r\n\t// Adds a reciprocal ball (nice and blobby) that, to be fast, fades to zero after\r\n\t// a fixed distance, determined by strength and subtract.\r\n\r\n\tthis.addBall = function( ballx, bally, ballz, strength, subtract ) {\r\n\r\n\t\t// Let's solve the equation to find the radius:\r\n\t\t// 1.0 / (0.000001 + radius^2) * strength - subtract = 0\r\n\t\t// strength / (radius^2) = subtract\r\n\t\t// strength = subtract * radius^2\r\n\t\t// radius^2 = strength / subtract\r\n\t\t// radius = sqrt(strength / subtract)\r\n\r\n\t\tvar radius = this.size * Math.sqrt( strength / subtract ),\r\n\t\t\tzs = ballz * this.size,\r\n\t\t\tys = bally * this.size,\r\n\t\t\txs = ballx * this.size;\r\n\r\n\t\tvar min_z = Math.floor( zs - radius ); if ( min_z < 1 ) min_z = 1;\r\n\t\tvar max_z = Math.floor( zs + radius ); if ( max_z > this.size - 1 ) max_z = this.size - 1;\r\n\t\tvar min_y = Math.floor( ys - radius ); if ( min_y < 1 ) min_y = 1;\r\n\t\tvar max_y = Math.floor( ys + radius ); if ( max_y > this.size - 1 ) max_y = this.size - 1;\r\n\t\tvar min_x = Math.floor( xs - radius ); if ( min_x < 1  ) min_x = 1;\r\n\t\tvar max_x = Math.floor( xs + radius ); if ( max_x > this.size - 1 ) max_x = this.size - 1;\r\n\r\n\r\n\t\t// Don't polygonize in the outer layer because normals aren't\r\n\t\t// well-defined there.\r\n\r\n\t\tvar x, y, z, y_offset, z_offset, fx, fy, fz, fz2, fy2, val;\r\n\r\n\t\tfor ( z = min_z; z < max_z; z++ ) {\r\n\r\n\t\t\tz_offset = this.size2 * z,\r\n\t\t\tfz = z / this.size - ballz,\r\n\t\t\tfz2 = fz * fz;\r\n\r\n\t\t\tfor ( y = min_y; y < max_y; y++ ) {\r\n\r\n\t\t\t\ty_offset = z_offset + this.size * y;\r\n\t\t\t\tfy = y / this.size - bally;\r\n\t\t\t\tfy2 = fy * fy;\r\n\r\n\t\t\t\tfor ( x = min_x; x < max_x; x++ ) {\r\n\r\n\t\t\t\t\tfx = x / this.size - ballx;\r\n\t\t\t\t\tval = strength / ( 0.000001 + fx*fx + fy2 + fz2 ) - subtract;\r\n\t\t\t\t\tif ( val > 0.0 ) this.field[ y_offset + x ] += val;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t};\r\n\r\n\tthis.addPlaneX = function( strength, subtract ) {\r\n\r\n\t\tvar x, y, z, xx, val, xdiv, cxy,\r\n\r\n\t\t\t// cache attribute lookups\r\n\t\t\tsize = this.size,\r\n\t\t\tyd = this.yd,\r\n\t\t\tzd = this.zd,\r\n\t\t\tfield = this.field,\r\n\r\n\t\t\tdist = size * Math.sqrt( strength / subtract );\r\n\r\n\t\tif ( dist > size ) dist = size;\r\n\r\n\t\tfor ( x = 0; x < dist; x ++ ) {\r\n\r\n\t\t\txdiv = x / size;\r\n\t\t\txx = xdiv * xdiv;\r\n\t\t\tval = strength / ( 0.0001 + xx ) - subtract;\r\n\r\n\t\t\tif ( val > 0.0 ) {\r\n\r\n\t\t\t\tfor ( y = 0; y < size; y ++ ) {\r\n\r\n\t\t\t\t\tcxy = x + y * yd;\r\n\r\n\t\t\t\t\tfor ( z = 0; z < size; z ++ ) {\r\n\r\n\t\t\t\t\t\tfield[ zd * z + cxy ] += val;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t};\r\n\r\n\tthis.addPlaneY = function( strength, subtract ) {\r\n\r\n\t\tvar x, y, z, yy, val, ydiv, cy, cxy,\r\n\r\n\t\t\t// cache attribute lookups\r\n\t\t\tsize = this.size,\r\n\t\t\tyd = this.yd,\r\n\t\t\tzd = this.zd,\r\n\t\t\tfield = this.field,\r\n\r\n\t\t\tdist = size * Math.sqrt( strength / subtract );\r\n\r\n\t\tif ( dist > size ) dist = size;\r\n\r\n\t\tfor ( y = 0; y < dist; y ++ ) {\r\n\r\n\t\t\tydiv = y / size;\r\n\t\t\tyy = ydiv * ydiv;\r\n\t\t\tval = strength / ( 0.0001 + yy ) - subtract;\r\n\r\n\t\t\tif ( val > 0.0 ) {\r\n\r\n\t\t\t\tcy = y * yd;\r\n\r\n\t\t\t\tfor ( x = 0; x < size; x ++ ) {\r\n\r\n\t\t\t\t\tcxy = cy + x;\r\n\r\n\t\t\t\t\tfor ( z = 0; z < size; z ++ )\r\n\t\t\t\t\t\tfield[ zd * z + cxy ] += val;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t};\r\n\r\n\tthis.addPlaneZ = function( strength, subtract ) {\r\n\r\n\t\tvar x, y, z, zz, val, zdiv, cz, cyz,\r\n\r\n\t\t\t// cache attribute lookups\r\n\t\t\tsize = this.size,\r\n\t\t\tyd = this.yd,\r\n\t\t\tzd = this.zd,\r\n\t\t\tfield = this.field,\r\n\r\n\t\t\tdist = size * Math.sqrt( strength / subtract );\r\n\r\n\t\tif ( dist > size ) dist = size;\r\n\r\n\t\tfor ( z = 0; z < dist; z ++ ) {\r\n\r\n\t\t\tzdiv = z / size;\r\n\t\t\tzz = zdiv * zdiv;\r\n\t\t\tval = strength / ( 0.0001 + zz ) - subtract;\r\n\t\t\tif ( val > 0.0 ) {\r\n\r\n\t\t\t\tcz = zd * z;\r\n\r\n\t\t\t\tfor ( y = 0; y < size; y ++ ) {\r\n\r\n\t\t\t\t\tcyz = cz + y * yd;\r\n\r\n\t\t\t\t\tfor ( x = 0; x < size; x ++ )\r\n\t\t\t\t\t\tfield[ cyz + x ] += val;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t};\r\n\r\n\t/////////////////////////////////////\r\n\t// Updates\r\n\t/////////////////////////////////////\r\n\r\n\tthis.reset = function() {\r\n\r\n\t\tvar i;\r\n\r\n\t\t// wipe the normal cache\r\n\r\n\t\tfor ( i = 0; i < this.size3; i ++ ) {\r\n\r\n\t\t\tthis.normal_cache[ i * 3 ] = 0.0;\r\n\t\t\tthis.field[ i ] = 0.0;\r\n\r\n\t\t}\r\n\r\n\t};\r\n\r\n\tthis.render = function( renderCallback ) {\r\n\r\n\t\tthis.begin();\r\n\r\n\t\t// Triangulate. Yeah, this is slow.\r\n\r\n\t\tvar q, x, y, z, fx, fy, fz, y_offset, z_offset, smin2 = this.size - 2;\r\n\r\n\t\tfor ( z = 1; z < smin2; z ++ ) {\r\n\r\n\t\t\tz_offset = this.size2 * z;\r\n\t\t\tfz = ( z - this.halfsize ) / this.halfsize; //+ 1\r\n\r\n\t\t\tfor ( y = 1; y < smin2; y ++ ) {\r\n\r\n\t\t\t\ty_offset = z_offset + this.size * y;\r\n\t\t\t\tfy = ( y - this.halfsize ) / this.halfsize; //+ 1\r\n\r\n\t\t\t\tfor ( x = 1; x < smin2; x ++ ) {\r\n\r\n\t\t\t\t\tfx = ( x - this.halfsize ) / this.halfsize; //+ 1\r\n\t\t\t\t\tq = y_offset + x;\r\n\r\n\t\t\t\t\tthis.polygonize( fx, fy, fz, q, this.isolation, renderCallback );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tthis.end( renderCallback );\r\n\r\n\t};\r\n\r\n\tthis.generateGeometry = function() {\r\n\r\n\t\tvar start = 0, geo = new THREE.Geometry();\r\n\t\tvar normals = [];\r\n\r\n\t\tvar geo_callback = function( object ) {\r\n\r\n\t\t\tvar i, x, y, z, vertex, normal,\r\n\t\t\t\tface, a, b, c, na, nb, nc, nfaces;\r\n\r\n\r\n\t\t\tfor ( i = 0; i < object.count; i ++ ) {\r\n\r\n\t\t\t\ta = i * 3;\r\n\t\t\t\tb = a + 1;\r\n\t\t\t\tc = a + 2;\r\n\r\n\t\t\t\tx = object.positionArray[ a ];\r\n\t\t\t\ty = object.positionArray[ b ];\r\n\t\t\t\tz = object.positionArray[ c ];\r\n\t\t\t\tvertex = new THREE.Vector3( x, y, z );\r\n\r\n\t\t\t\tx = object.normalArray[ a ];\r\n\t\t\t\ty = object.normalArray[ b ];\r\n\t\t\t\tz = object.normalArray[ c ];\r\n\t\t\t\tnormal = new THREE.Vector3( x, y, z );\r\n\t\t\t\tnormal.normalize();\r\n\r\n\t\t\t\tgeo.vertices.push( vertex );\r\n\t\t\t\tnormals.push( normal );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tnfaces = object.count / 3;\r\n\r\n\t\t\tfor ( i = 0; i < nfaces; i ++ ) {\r\n\r\n\t\t\t\ta = ( start + i ) * 3;\r\n\t\t\t\tb = a + 1;\r\n\t\t\t\tc = a + 2;\r\n\r\n\t\t\t\tna = normals[ a ];\r\n\t\t\t\tnb = normals[ b ];\r\n\t\t\t\tnc = normals[ c ];\r\n\r\n\t\t\t\tface = new THREE.Face3( a, b, c, [ na, nb, nc ] );\r\n\r\n\t\t\t\tgeo.faces.push( face );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tstart += nfaces;\r\n\t\t\tobject.count = 0;\r\n\r\n\t\t};\r\n\r\n\t\tthis.render( geo_callback );\r\n\r\n\t\t// console.log( \"generated \" + geo.faces.length + \" triangles\" );\r\n\r\n\t\treturn geo;\r\n\r\n\t};\r\n\r\n\tthis.init( resolution );\r\n\r\n};\r\n\r\nTHREE.MarchingCubes.prototype = Object.create( THREE.ImmediateRenderObject.prototype );\r\n\r\n\r\n/////////////////////////////////////\r\n// Marching cubes lookup tables\r\n/////////////////////////////////////\r\n\r\n// These tables are straight from Paul Bourke's page:\r\n// http://local.wasp.uwa.edu.au/~pbourke/geometry/polygonise/\r\n// who in turn got them from Cory Gene Bloyd.\r\n\r\nTHREE.edgeTable = new Int32Array([\r\n0x0  , 0x109, 0x203, 0x30a, 0x406, 0x50f, 0x605, 0x70c,\r\n0x80c, 0x905, 0xa0f, 0xb06, 0xc0a, 0xd03, 0xe09, 0xf00,\r\n0x190, 0x99 , 0x393, 0x29a, 0x596, 0x49f, 0x795, 0x69c,\r\n0x99c, 0x895, 0xb9f, 0xa96, 0xd9a, 0xc93, 0xf99, 0xe90,\r\n0x230, 0x339, 0x33 , 0x13a, 0x636, 0x73f, 0x435, 0x53c,\r\n0xa3c, 0xb35, 0x83f, 0x936, 0xe3a, 0xf33, 0xc39, 0xd30,\r\n0x3a0, 0x2a9, 0x1a3, 0xaa , 0x7a6, 0x6af, 0x5a5, 0x4ac,\r\n0xbac, 0xaa5, 0x9af, 0x8a6, 0xfaa, 0xea3, 0xda9, 0xca0,\r\n0x460, 0x569, 0x663, 0x76a, 0x66 , 0x16f, 0x265, 0x36c,\r\n0xc6c, 0xd65, 0xe6f, 0xf66, 0x86a, 0x963, 0xa69, 0xb60,\r\n0x5f0, 0x4f9, 0x7f3, 0x6fa, 0x1f6, 0xff , 0x3f5, 0x2fc,\r\n0xdfc, 0xcf5, 0xfff, 0xef6, 0x9fa, 0x8f3, 0xbf9, 0xaf0,\r\n0x650, 0x759, 0x453, 0x55a, 0x256, 0x35f, 0x55 , 0x15c,\r\n0xe5c, 0xf55, 0xc5f, 0xd56, 0xa5a, 0xb53, 0x859, 0x950,\r\n0x7c0, 0x6c9, 0x5c3, 0x4ca, 0x3c6, 0x2cf, 0x1c5, 0xcc ,\r\n0xfcc, 0xec5, 0xdcf, 0xcc6, 0xbca, 0xac3, 0x9c9, 0x8c0,\r\n0x8c0, 0x9c9, 0xac3, 0xbca, 0xcc6, 0xdcf, 0xec5, 0xfcc,\r\n0xcc , 0x1c5, 0x2cf, 0x3c6, 0x4ca, 0x5c3, 0x6c9, 0x7c0,\r\n0x950, 0x859, 0xb53, 0xa5a, 0xd56, 0xc5f, 0xf55, 0xe5c,\r\n0x15c, 0x55 , 0x35f, 0x256, 0x55a, 0x453, 0x759, 0x650,\r\n0xaf0, 0xbf9, 0x8f3, 0x9fa, 0xef6, 0xfff, 0xcf5, 0xdfc,\r\n0x2fc, 0x3f5, 0xff , 0x1f6, 0x6fa, 0x7f3, 0x4f9, 0x5f0,\r\n0xb60, 0xa69, 0x963, 0x86a, 0xf66, 0xe6f, 0xd65, 0xc6c,\r\n0x36c, 0x265, 0x16f, 0x66 , 0x76a, 0x663, 0x569, 0x460,\r\n0xca0, 0xda9, 0xea3, 0xfaa, 0x8a6, 0x9af, 0xaa5, 0xbac,\r\n0x4ac, 0x5a5, 0x6af, 0x7a6, 0xaa , 0x1a3, 0x2a9, 0x3a0,\r\n0xd30, 0xc39, 0xf33, 0xe3a, 0x936, 0x83f, 0xb35, 0xa3c,\r\n0x53c, 0x435, 0x73f, 0x636, 0x13a, 0x33 , 0x339, 0x230,\r\n0xe90, 0xf99, 0xc93, 0xd9a, 0xa96, 0xb9f, 0x895, 0x99c,\r\n0x69c, 0x795, 0x49f, 0x596, 0x29a, 0x393, 0x99 , 0x190,\r\n0xf00, 0xe09, 0xd03, 0xc0a, 0xb06, 0xa0f, 0x905, 0x80c,\r\n0x70c, 0x605, 0x50f, 0x406, 0x30a, 0x203, 0x109, 0x0])\r\n\r\nTHREE.triTable = new Int32Array([\r\n-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n1, 8, 3, 9, 8, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 8, 3, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n9, 2, 10, 0, 2, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n2, 8, 3, 2, 10, 8, 10, 9, 8, -1, -1, -1, -1, -1, -1, -1,\r\n3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 11, 2, 8, 11, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n1, 9, 0, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n1, 11, 2, 1, 9, 11, 9, 8, 11, -1, -1, -1, -1, -1, -1, -1,\r\n3, 10, 1, 11, 10, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 10, 1, 0, 8, 10, 8, 11, 10, -1, -1, -1, -1, -1, -1, -1,\r\n3, 9, 0, 3, 11, 9, 11, 10, 9, -1, -1, -1, -1, -1, -1, -1,\r\n9, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n4, 3, 0, 7, 3, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 1, 9, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n4, 1, 9, 4, 7, 1, 7, 3, 1, -1, -1, -1, -1, -1, -1, -1,\r\n1, 2, 10, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n3, 4, 7, 3, 0, 4, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1,\r\n9, 2, 10, 9, 0, 2, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1,\r\n2, 10, 9, 2, 9, 7, 2, 7, 3, 7, 9, 4, -1, -1, -1, -1,\r\n8, 4, 7, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n11, 4, 7, 11, 2, 4, 2, 0, 4, -1, -1, -1, -1, -1, -1, -1,\r\n9, 0, 1, 8, 4, 7, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1,\r\n4, 7, 11, 9, 4, 11, 9, 11, 2, 9, 2, 1, -1, -1, -1, -1,\r\n3, 10, 1, 3, 11, 10, 7, 8, 4, -1, -1, -1, -1, -1, -1, -1,\r\n1, 11, 10, 1, 4, 11, 1, 0, 4, 7, 11, 4, -1, -1, -1, -1,\r\n4, 7, 8, 9, 0, 11, 9, 11, 10, 11, 0, 3, -1, -1, -1, -1,\r\n4, 7, 11, 4, 11, 9, 9, 11, 10, -1, -1, -1, -1, -1, -1, -1,\r\n9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n9, 5, 4, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 5, 4, 1, 5, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n8, 5, 4, 8, 3, 5, 3, 1, 5, -1, -1, -1, -1, -1, -1, -1,\r\n1, 2, 10, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n3, 0, 8, 1, 2, 10, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1,\r\n5, 2, 10, 5, 4, 2, 4, 0, 2, -1, -1, -1, -1, -1, -1, -1,\r\n2, 10, 5, 3, 2, 5, 3, 5, 4, 3, 4, 8, -1, -1, -1, -1,\r\n9, 5, 4, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 11, 2, 0, 8, 11, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1,\r\n0, 5, 4, 0, 1, 5, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1,\r\n2, 1, 5, 2, 5, 8, 2, 8, 11, 4, 8, 5, -1, -1, -1, -1,\r\n10, 3, 11, 10, 1, 3, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1,\r\n4, 9, 5, 0, 8, 1, 8, 10, 1, 8, 11, 10, -1, -1, -1, -1,\r\n5, 4, 0, 5, 0, 11, 5, 11, 10, 11, 0, 3, -1, -1, -1, -1,\r\n5, 4, 8, 5, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1,\r\n9, 7, 8, 5, 7, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n9, 3, 0, 9, 5, 3, 5, 7, 3, -1, -1, -1, -1, -1, -1, -1,\r\n0, 7, 8, 0, 1, 7, 1, 5, 7, -1, -1, -1, -1, -1, -1, -1,\r\n1, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n9, 7, 8, 9, 5, 7, 10, 1, 2, -1, -1, -1, -1, -1, -1, -1,\r\n10, 1, 2, 9, 5, 0, 5, 3, 0, 5, 7, 3, -1, -1, -1, -1,\r\n8, 0, 2, 8, 2, 5, 8, 5, 7, 10, 5, 2, -1, -1, -1, -1,\r\n2, 10, 5, 2, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1,\r\n7, 9, 5, 7, 8, 9, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1,\r\n9, 5, 7, 9, 7, 2, 9, 2, 0, 2, 7, 11, -1, -1, -1, -1,\r\n2, 3, 11, 0, 1, 8, 1, 7, 8, 1, 5, 7, -1, -1, -1, -1,\r\n11, 2, 1, 11, 1, 7, 7, 1, 5, -1, -1, -1, -1, -1, -1, -1,\r\n9, 5, 8, 8, 5, 7, 10, 1, 3, 10, 3, 11, -1, -1, -1, -1,\r\n5, 7, 0, 5, 0, 9, 7, 11, 0, 1, 0, 10, 11, 10, 0, -1,\r\n11, 10, 0, 11, 0, 3, 10, 5, 0, 8, 0, 7, 5, 7, 0, -1,\r\n11, 10, 5, 7, 11, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 8, 3, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n9, 0, 1, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n1, 8, 3, 1, 9, 8, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1,\r\n1, 6, 5, 2, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n1, 6, 5, 1, 2, 6, 3, 0, 8, -1, -1, -1, -1, -1, -1, -1,\r\n9, 6, 5, 9, 0, 6, 0, 2, 6, -1, -1, -1, -1, -1, -1, -1,\r\n5, 9, 8, 5, 8, 2, 5, 2, 6, 3, 2, 8, -1, -1, -1, -1,\r\n2, 3, 11, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n11, 0, 8, 11, 2, 0, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1,\r\n0, 1, 9, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1,\r\n5, 10, 6, 1, 9, 2, 9, 11, 2, 9, 8, 11, -1, -1, -1, -1,\r\n6, 3, 11, 6, 5, 3, 5, 1, 3, -1, -1, -1, -1, -1, -1, -1,\r\n0, 8, 11, 0, 11, 5, 0, 5, 1, 5, 11, 6, -1, -1, -1, -1,\r\n3, 11, 6, 0, 3, 6, 0, 6, 5, 0, 5, 9, -1, -1, -1, -1,\r\n6, 5, 9, 6, 9, 11, 11, 9, 8, -1, -1, -1, -1, -1, -1, -1,\r\n5, 10, 6, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n4, 3, 0, 4, 7, 3, 6, 5, 10, -1, -1, -1, -1, -1, -1, -1,\r\n1, 9, 0, 5, 10, 6, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1,\r\n10, 6, 5, 1, 9, 7, 1, 7, 3, 7, 9, 4, -1, -1, -1, -1,\r\n6, 1, 2, 6, 5, 1, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1,\r\n1, 2, 5, 5, 2, 6, 3, 0, 4, 3, 4, 7, -1, -1, -1, -1,\r\n8, 4, 7, 9, 0, 5, 0, 6, 5, 0, 2, 6, -1, -1, -1, -1,\r\n7, 3, 9, 7, 9, 4, 3, 2, 9, 5, 9, 6, 2, 6, 9, -1,\r\n3, 11, 2, 7, 8, 4, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1,\r\n5, 10, 6, 4, 7, 2, 4, 2, 0, 2, 7, 11, -1, -1, -1, -1,\r\n0, 1, 9, 4, 7, 8, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1,\r\n9, 2, 1, 9, 11, 2, 9, 4, 11, 7, 11, 4, 5, 10, 6, -1,\r\n8, 4, 7, 3, 11, 5, 3, 5, 1, 5, 11, 6, -1, -1, -1, -1,\r\n5, 1, 11, 5, 11, 6, 1, 0, 11, 7, 11, 4, 0, 4, 11, -1,\r\n0, 5, 9, 0, 6, 5, 0, 3, 6, 11, 6, 3, 8, 4, 7, -1,\r\n6, 5, 9, 6, 9, 11, 4, 7, 9, 7, 11, 9, -1, -1, -1, -1,\r\n10, 4, 9, 6, 4, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n4, 10, 6, 4, 9, 10, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1,\r\n10, 0, 1, 10, 6, 0, 6, 4, 0, -1, -1, -1, -1, -1, -1, -1,\r\n8, 3, 1, 8, 1, 6, 8, 6, 4, 6, 1, 10, -1, -1, -1, -1,\r\n1, 4, 9, 1, 2, 4, 2, 6, 4, -1, -1, -1, -1, -1, -1, -1,\r\n3, 0, 8, 1, 2, 9, 2, 4, 9, 2, 6, 4, -1, -1, -1, -1,\r\n0, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n8, 3, 2, 8, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1,\r\n10, 4, 9, 10, 6, 4, 11, 2, 3, -1, -1, -1, -1, -1, -1, -1,\r\n0, 8, 2, 2, 8, 11, 4, 9, 10, 4, 10, 6, -1, -1, -1, -1,\r\n3, 11, 2, 0, 1, 6, 0, 6, 4, 6, 1, 10, -1, -1, -1, -1,\r\n6, 4, 1, 6, 1, 10, 4, 8, 1, 2, 1, 11, 8, 11, 1, -1,\r\n9, 6, 4, 9, 3, 6, 9, 1, 3, 11, 6, 3, -1, -1, -1, -1,\r\n8, 11, 1, 8, 1, 0, 11, 6, 1, 9, 1, 4, 6, 4, 1, -1,\r\n3, 11, 6, 3, 6, 0, 0, 6, 4, -1, -1, -1, -1, -1, -1, -1,\r\n6, 4, 8, 11, 6, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n7, 10, 6, 7, 8, 10, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1,\r\n0, 7, 3, 0, 10, 7, 0, 9, 10, 6, 7, 10, -1, -1, -1, -1,\r\n10, 6, 7, 1, 10, 7, 1, 7, 8, 1, 8, 0, -1, -1, -1, -1,\r\n10, 6, 7, 10, 7, 1, 1, 7, 3, -1, -1, -1, -1, -1, -1, -1,\r\n1, 2, 6, 1, 6, 8, 1, 8, 9, 8, 6, 7, -1, -1, -1, -1,\r\n2, 6, 9, 2, 9, 1, 6, 7, 9, 0, 9, 3, 7, 3, 9, -1,\r\n7, 8, 0, 7, 0, 6, 6, 0, 2, -1, -1, -1, -1, -1, -1, -1,\r\n7, 3, 2, 6, 7, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n2, 3, 11, 10, 6, 8, 10, 8, 9, 8, 6, 7, -1, -1, -1, -1,\r\n2, 0, 7, 2, 7, 11, 0, 9, 7, 6, 7, 10, 9, 10, 7, -1,\r\n1, 8, 0, 1, 7, 8, 1, 10, 7, 6, 7, 10, 2, 3, 11, -1,\r\n11, 2, 1, 11, 1, 7, 10, 6, 1, 6, 7, 1, -1, -1, -1, -1,\r\n8, 9, 6, 8, 6, 7, 9, 1, 6, 11, 6, 3, 1, 3, 6, -1,\r\n0, 9, 1, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n7, 8, 0, 7, 0, 6, 3, 11, 0, 11, 6, 0, -1, -1, -1, -1,\r\n7, 11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n3, 0, 8, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 1, 9, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n8, 1, 9, 8, 3, 1, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1,\r\n10, 1, 2, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n1, 2, 10, 3, 0, 8, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1,\r\n2, 9, 0, 2, 10, 9, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1,\r\n6, 11, 7, 2, 10, 3, 10, 8, 3, 10, 9, 8, -1, -1, -1, -1,\r\n7, 2, 3, 6, 2, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n7, 0, 8, 7, 6, 0, 6, 2, 0, -1, -1, -1, -1, -1, -1, -1,\r\n2, 7, 6, 2, 3, 7, 0, 1, 9, -1, -1, -1, -1, -1, -1, -1,\r\n1, 6, 2, 1, 8, 6, 1, 9, 8, 8, 7, 6, -1, -1, -1, -1,\r\n10, 7, 6, 10, 1, 7, 1, 3, 7, -1, -1, -1, -1, -1, -1, -1,\r\n10, 7, 6, 1, 7, 10, 1, 8, 7, 1, 0, 8, -1, -1, -1, -1,\r\n0, 3, 7, 0, 7, 10, 0, 10, 9, 6, 10, 7, -1, -1, -1, -1,\r\n7, 6, 10, 7, 10, 8, 8, 10, 9, -1, -1, -1, -1, -1, -1, -1,\r\n6, 8, 4, 11, 8, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n3, 6, 11, 3, 0, 6, 0, 4, 6, -1, -1, -1, -1, -1, -1, -1,\r\n8, 6, 11, 8, 4, 6, 9, 0, 1, -1, -1, -1, -1, -1, -1, -1,\r\n9, 4, 6, 9, 6, 3, 9, 3, 1, 11, 3, 6, -1, -1, -1, -1,\r\n6, 8, 4, 6, 11, 8, 2, 10, 1, -1, -1, -1, -1, -1, -1, -1,\r\n1, 2, 10, 3, 0, 11, 0, 6, 11, 0, 4, 6, -1, -1, -1, -1,\r\n4, 11, 8, 4, 6, 11, 0, 2, 9, 2, 10, 9, -1, -1, -1, -1,\r\n10, 9, 3, 10, 3, 2, 9, 4, 3, 11, 3, 6, 4, 6, 3, -1,\r\n8, 2, 3, 8, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1,\r\n0, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n1, 9, 0, 2, 3, 4, 2, 4, 6, 4, 3, 8, -1, -1, -1, -1,\r\n1, 9, 4, 1, 4, 2, 2, 4, 6, -1, -1, -1, -1, -1, -1, -1,\r\n8, 1, 3, 8, 6, 1, 8, 4, 6, 6, 10, 1, -1, -1, -1, -1,\r\n10, 1, 0, 10, 0, 6, 6, 0, 4, -1, -1, -1, -1, -1, -1, -1,\r\n4, 6, 3, 4, 3, 8, 6, 10, 3, 0, 3, 9, 10, 9, 3, -1,\r\n10, 9, 4, 6, 10, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n4, 9, 5, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 8, 3, 4, 9, 5, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1,\r\n5, 0, 1, 5, 4, 0, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1,\r\n11, 7, 6, 8, 3, 4, 3, 5, 4, 3, 1, 5, -1, -1, -1, -1,\r\n9, 5, 4, 10, 1, 2, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1,\r\n6, 11, 7, 1, 2, 10, 0, 8, 3, 4, 9, 5, -1, -1, -1, -1,\r\n7, 6, 11, 5, 4, 10, 4, 2, 10, 4, 0, 2, -1, -1, -1, -1,\r\n3, 4, 8, 3, 5, 4, 3, 2, 5, 10, 5, 2, 11, 7, 6, -1,\r\n7, 2, 3, 7, 6, 2, 5, 4, 9, -1, -1, -1, -1, -1, -1, -1,\r\n9, 5, 4, 0, 8, 6, 0, 6, 2, 6, 8, 7, -1, -1, -1, -1,\r\n3, 6, 2, 3, 7, 6, 1, 5, 0, 5, 4, 0, -1, -1, -1, -1,\r\n6, 2, 8, 6, 8, 7, 2, 1, 8, 4, 8, 5, 1, 5, 8, -1,\r\n9, 5, 4, 10, 1, 6, 1, 7, 6, 1, 3, 7, -1, -1, -1, -1,\r\n1, 6, 10, 1, 7, 6, 1, 0, 7, 8, 7, 0, 9, 5, 4, -1,\r\n4, 0, 10, 4, 10, 5, 0, 3, 10, 6, 10, 7, 3, 7, 10, -1,\r\n7, 6, 10, 7, 10, 8, 5, 4, 10, 4, 8, 10, -1, -1, -1, -1,\r\n6, 9, 5, 6, 11, 9, 11, 8, 9, -1, -1, -1, -1, -1, -1, -1,\r\n3, 6, 11, 0, 6, 3, 0, 5, 6, 0, 9, 5, -1, -1, -1, -1,\r\n0, 11, 8, 0, 5, 11, 0, 1, 5, 5, 6, 11, -1, -1, -1, -1,\r\n6, 11, 3, 6, 3, 5, 5, 3, 1, -1, -1, -1, -1, -1, -1, -1,\r\n1, 2, 10, 9, 5, 11, 9, 11, 8, 11, 5, 6, -1, -1, -1, -1,\r\n0, 11, 3, 0, 6, 11, 0, 9, 6, 5, 6, 9, 1, 2, 10, -1,\r\n11, 8, 5, 11, 5, 6, 8, 0, 5, 10, 5, 2, 0, 2, 5, -1,\r\n6, 11, 3, 6, 3, 5, 2, 10, 3, 10, 5, 3, -1, -1, -1, -1,\r\n5, 8, 9, 5, 2, 8, 5, 6, 2, 3, 8, 2, -1, -1, -1, -1,\r\n9, 5, 6, 9, 6, 0, 0, 6, 2, -1, -1, -1, -1, -1, -1, -1,\r\n1, 5, 8, 1, 8, 0, 5, 6, 8, 3, 8, 2, 6, 2, 8, -1,\r\n1, 5, 6, 2, 1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n1, 3, 6, 1, 6, 10, 3, 8, 6, 5, 6, 9, 8, 9, 6, -1,\r\n10, 1, 0, 10, 0, 6, 9, 5, 0, 5, 6, 0, -1, -1, -1, -1,\r\n0, 3, 8, 5, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n10, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n11, 5, 10, 7, 5, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n11, 5, 10, 11, 7, 5, 8, 3, 0, -1, -1, -1, -1, -1, -1, -1,\r\n5, 11, 7, 5, 10, 11, 1, 9, 0, -1, -1, -1, -1, -1, -1, -1,\r\n10, 7, 5, 10, 11, 7, 9, 8, 1, 8, 3, 1, -1, -1, -1, -1,\r\n11, 1, 2, 11, 7, 1, 7, 5, 1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 8, 3, 1, 2, 7, 1, 7, 5, 7, 2, 11, -1, -1, -1, -1,\r\n9, 7, 5, 9, 2, 7, 9, 0, 2, 2, 11, 7, -1, -1, -1, -1,\r\n7, 5, 2, 7, 2, 11, 5, 9, 2, 3, 2, 8, 9, 8, 2, -1,\r\n2, 5, 10, 2, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1,\r\n8, 2, 0, 8, 5, 2, 8, 7, 5, 10, 2, 5, -1, -1, -1, -1,\r\n9, 0, 1, 5, 10, 3, 5, 3, 7, 3, 10, 2, -1, -1, -1, -1,\r\n9, 8, 2, 9, 2, 1, 8, 7, 2, 10, 2, 5, 7, 5, 2, -1,\r\n1, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 8, 7, 0, 7, 1, 1, 7, 5, -1, -1, -1, -1, -1, -1, -1,\r\n9, 0, 3, 9, 3, 5, 5, 3, 7, -1, -1, -1, -1, -1, -1, -1,\r\n9, 8, 7, 5, 9, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n5, 8, 4, 5, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1,\r\n5, 0, 4, 5, 11, 0, 5, 10, 11, 11, 3, 0, -1, -1, -1, -1,\r\n0, 1, 9, 8, 4, 10, 8, 10, 11, 10, 4, 5, -1, -1, -1, -1,\r\n10, 11, 4, 10, 4, 5, 11, 3, 4, 9, 4, 1, 3, 1, 4, -1,\r\n2, 5, 1, 2, 8, 5, 2, 11, 8, 4, 5, 8, -1, -1, -1, -1,\r\n0, 4, 11, 0, 11, 3, 4, 5, 11, 2, 11, 1, 5, 1, 11, -1,\r\n0, 2, 5, 0, 5, 9, 2, 11, 5, 4, 5, 8, 11, 8, 5, -1,\r\n9, 4, 5, 2, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n2, 5, 10, 3, 5, 2, 3, 4, 5, 3, 8, 4, -1, -1, -1, -1,\r\n5, 10, 2, 5, 2, 4, 4, 2, 0, -1, -1, -1, -1, -1, -1, -1,\r\n3, 10, 2, 3, 5, 10, 3, 8, 5, 4, 5, 8, 0, 1, 9, -1,\r\n5, 10, 2, 5, 2, 4, 1, 9, 2, 9, 4, 2, -1, -1, -1, -1,\r\n8, 4, 5, 8, 5, 3, 3, 5, 1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 4, 5, 1, 0, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n8, 4, 5, 8, 5, 3, 9, 0, 5, 0, 3, 5, -1, -1, -1, -1,\r\n9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n4, 11, 7, 4, 9, 11, 9, 10, 11, -1, -1, -1, -1, -1, -1, -1,\r\n0, 8, 3, 4, 9, 7, 9, 11, 7, 9, 10, 11, -1, -1, -1, -1,\r\n1, 10, 11, 1, 11, 4, 1, 4, 0, 7, 4, 11, -1, -1, -1, -1,\r\n3, 1, 4, 3, 4, 8, 1, 10, 4, 7, 4, 11, 10, 11, 4, -1,\r\n4, 11, 7, 9, 11, 4, 9, 2, 11, 9, 1, 2, -1, -1, -1, -1,\r\n9, 7, 4, 9, 11, 7, 9, 1, 11, 2, 11, 1, 0, 8, 3, -1,\r\n11, 7, 4, 11, 4, 2, 2, 4, 0, -1, -1, -1, -1, -1, -1, -1,\r\n11, 7, 4, 11, 4, 2, 8, 3, 4, 3, 2, 4, -1, -1, -1, -1,\r\n2, 9, 10, 2, 7, 9, 2, 3, 7, 7, 4, 9, -1, -1, -1, -1,\r\n9, 10, 7, 9, 7, 4, 10, 2, 7, 8, 7, 0, 2, 0, 7, -1,\r\n3, 7, 10, 3, 10, 2, 7, 4, 10, 1, 10, 0, 4, 0, 10, -1,\r\n1, 10, 2, 8, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n4, 9, 1, 4, 1, 7, 7, 1, 3, -1, -1, -1, -1, -1, -1, -1,\r\n4, 9, 1, 4, 1, 7, 0, 8, 1, 8, 7, 1, -1, -1, -1, -1,\r\n4, 0, 3, 7, 4, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n4, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n9, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n3, 0, 9, 3, 9, 11, 11, 9, 10, -1, -1, -1, -1, -1, -1, -1,\r\n0, 1, 10, 0, 10, 8, 8, 10, 11, -1, -1, -1, -1, -1, -1, -1,\r\n3, 1, 10, 11, 3, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n1, 2, 11, 1, 11, 9, 9, 11, 8, -1, -1, -1, -1, -1, -1, -1,\r\n3, 0, 9, 3, 9, 11, 1, 2, 9, 2, 11, 9, -1, -1, -1, -1,\r\n0, 2, 11, 8, 0, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n3, 2, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n2, 3, 8, 2, 8, 10, 10, 8, 9, -1, -1, -1, -1, -1, -1, -1,\r\n9, 10, 2, 0, 9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n2, 3, 8, 2, 8, 10, 0, 1, 8, 1, 10, 8, -1, -1, -1, -1,\r\n1, 10, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n1, 3, 8, 9, 1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]);\r\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Car.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Car.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.Car = function () {\n\n\tvar scope = this;\n\n\t// car geometry manual parameters\n\n\tthis.modelScale = 1;\n\n\tthis.backWheelOffset = 2;\n\n\tthis.autoWheelGeometry = true;\n\n\t// car geometry parameters automatically set from wheel mesh\n\t// \t- assumes wheel mesh is front left wheel in proper global\n\t//    position with respect to body mesh\n\t//\t- other wheels are mirrored against car root\n\t//\t- if necessary back wheels can be offset manually\n\n\tthis.wheelOffset = new THREE.Vector3();\n\n\tthis.wheelDiameter = 1;\n\n\t// car \"feel\" parameters\n\n\tthis.MAX_SPEED = 2200;\n\tthis.MAX_REVERSE_SPEED = -1500;\n\n\tthis.MAX_WHEEL_ROTATION = 0.6;\n\n\tthis.FRONT_ACCELERATION = 1250;\n\tthis.BACK_ACCELERATION = 1500;\n\n\tthis.WHEEL_ANGULAR_ACCELERATION = 1.5;\n\n\tthis.FRONT_DECCELERATION = 750;\n\tthis.WHEEL_ANGULAR_DECCELERATION = 1.0;\n\n\tthis.STEERING_RADIUS_RATIO = 0.0023;\n\n\tthis.MAX_TILT_SIDES = 0.05;\n\tthis.MAX_TILT_FRONTBACK = 0.015;\n\n\t// internal control variables\n\n\tthis.speed = 0;\n\tthis.acceleration = 0;\n\n\tthis.wheelOrientation = 0;\n\tthis.carOrientation = 0;\n\n\t// car rigging\n\n\tthis.root = new THREE.Object3D();\n\n\tthis.frontLeftWheelRoot = new THREE.Object3D();\n\tthis.frontRightWheelRoot = new THREE.Object3D();\n\n\tthis.bodyMesh = null;\n\n\tthis.frontLeftWheelMesh = null;\n\tthis.frontRightWheelMesh = null;\n\n\tthis.backLeftWheelMesh = null;\n\tthis.backRightWheelMesh = null;\n\n\tthis.bodyGeometry = null;\n\tthis.wheelGeometry = null;\n\n\tthis.bodyMaterials = null;\n\tthis.wheelMaterials = null;\n\n\t// internal helper variables\n\n\tthis.loaded = false;\n\n\tthis.meshes = [];\n\n\t// API\n\n\tthis.enableShadows = function ( enable ) {\n\n\t\tfor ( var i = 0; i < this.meshes.length; i ++ ) {\n\n\t\t\tthis.meshes[ i ].castShadow = enable;\n\t\t\tthis.meshes[ i ].receiveShadow = enable;\n\n\t\t}\n\n\t};\n\n\tthis.setVisible = function ( enable ) {\n\n\t\tfor ( var i = 0; i < this.meshes.length; i ++ ) {\n\n\t\t\tthis.meshes[ i ].visible = enable;\n\t\t\tthis.meshes[ i ].visible = enable;\n\n\t\t}\n\n\t};\n\n\tthis.loadPartsJSON = function ( bodyURL, wheelURL ) {\n\n\t\tvar loader = new THREE.JSONLoader();\n\n\t\tloader.load( bodyURL, function( geometry, materials ) { createBody( geometry, materials ) } );\n\t\tloader.load( wheelURL, function( geometry, materials ) { createWheels( geometry, materials ) } );\n\n\t};\n\n\tthis.loadPartsBinary = function ( bodyURL, wheelURL ) {\n\n\t\tvar loader = new THREE.BinaryLoader();\n\n\t\tloader.load( bodyURL, function( geometry, materials ) { createBody( geometry, materials ) } );\n\t\tloader.load( wheelURL, function( geometry, materials ) { createWheels( geometry, materials ) } );\n\n\t};\n\n\tthis.updateCarModel = function ( delta, controls ) {\n\n\t\t// speed and wheels based on controls\n\n\t\tif ( controls.moveForward ) {\n\n\t\t\tthis.speed = THREE.Math.clamp( this.speed + delta * this.FRONT_ACCELERATION, this.MAX_REVERSE_SPEED, this.MAX_SPEED );\n\t\t\tthis.acceleration = THREE.Math.clamp( this.acceleration + delta, -1, 1 );\n\n\t\t}\n\n\t\tif ( controls.moveBackward ) {\n\n\n\t\t\tthis.speed = THREE.Math.clamp( this.speed - delta * this.BACK_ACCELERATION, this.MAX_REVERSE_SPEED, this.MAX_SPEED );\n\t\t\tthis.acceleration = THREE.Math.clamp( this.acceleration - delta, -1, 1 );\n\n\t\t}\n\n\t\tif ( controls.moveLeft ) {\n\n\t\t\tthis.wheelOrientation = THREE.Math.clamp( this.wheelOrientation + delta * this.WHEEL_ANGULAR_ACCELERATION, - this.MAX_WHEEL_ROTATION, this.MAX_WHEEL_ROTATION );\n\n\t\t}\n\n\t\tif ( controls.moveRight ) {\n\n\t\t\tthis.wheelOrientation = THREE.Math.clamp( this.wheelOrientation - delta * this.WHEEL_ANGULAR_ACCELERATION, - this.MAX_WHEEL_ROTATION, this.MAX_WHEEL_ROTATION );\n\n\t\t}\n\n\t\t// speed decay\n\n\t\tif ( ! ( controls.moveForward || controls.moveBackward ) ) {\n\n\t\t\tif ( this.speed > 0 ) {\n\n\t\t\t\tvar k = exponentialEaseOut( this.speed / this.MAX_SPEED );\n\n\t\t\t\tthis.speed = THREE.Math.clamp( this.speed - k * delta * this.FRONT_DECCELERATION, 0, this.MAX_SPEED );\n\t\t\t\tthis.acceleration = THREE.Math.clamp( this.acceleration - k * delta, 0, 1 );\n\n\t\t\t} else {\n\n\t\t\t\tvar k = exponentialEaseOut( this.speed / this.MAX_REVERSE_SPEED );\n\n\t\t\t\tthis.speed = THREE.Math.clamp( this.speed + k * delta * this.BACK_ACCELERATION, this.MAX_REVERSE_SPEED, 0 );\n\t\t\t\tthis.acceleration = THREE.Math.clamp( this.acceleration + k * delta, -1, 0 );\n\n\t\t\t}\n\n\n\t\t}\n\n\t\t// steering decay\n\n\t\tif ( ! ( controls.moveLeft || controls.moveRight ) ) {\n\n\t\t\tif ( this.wheelOrientation > 0 ) {\n\n\t\t\t\tthis.wheelOrientation = THREE.Math.clamp( this.wheelOrientation - delta * this.WHEEL_ANGULAR_DECCELERATION, 0, this.MAX_WHEEL_ROTATION );\n\n\t\t\t} else {\n\n\t\t\t\tthis.wheelOrientation = THREE.Math.clamp( this.wheelOrientation + delta * this.WHEEL_ANGULAR_DECCELERATION, - this.MAX_WHEEL_ROTATION, 0 );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// car update\n\n\t\tvar forwardDelta = this.speed * delta;\n\n\t\tthis.carOrientation += ( forwardDelta * this.STEERING_RADIUS_RATIO )* this.wheelOrientation;\n\n\t\t// displacement\n\n\t\tthis.root.position.x += Math.sin( this.carOrientation ) * forwardDelta;\n\t\tthis.root.position.z += Math.cos( this.carOrientation ) * forwardDelta;\n\n\t\t// steering\n\n\t\tthis.root.rotation.y = this.carOrientation;\n\n\t\t// tilt\n\n\t\tif ( this.loaded ) {\n\n\t\t\tthis.bodyMesh.rotation.z = this.MAX_TILT_SIDES * this.wheelOrientation * ( this.speed / this.MAX_SPEED );\n\t\t\tthis.bodyMesh.rotation.x = - this.MAX_TILT_FRONTBACK * this.acceleration;\n\n\t\t}\n\n\t\t// wheels rolling\n\n\t\tvar angularSpeedRatio = 1 / ( this.modelScale * ( this.wheelDiameter / 2 ) );\n\n\t\tvar wheelDelta = forwardDelta * angularSpeedRatio;\n\n\t\tif ( this.loaded ) {\n\n\t\t\tthis.frontLeftWheelMesh.rotation.x += wheelDelta;\n\t\t\tthis.frontRightWheelMesh.rotation.x += wheelDelta;\n\t\t\tthis.backLeftWheelMesh.rotation.x += wheelDelta;\n\t\t\tthis.backRightWheelMesh.rotation.x += wheelDelta;\n\n\t\t}\n\n\t\t// front wheels steering\n\n\t\tthis.frontLeftWheelRoot.rotation.y = this.wheelOrientation;\n\t\tthis.frontRightWheelRoot.rotation.y = this.wheelOrientation;\n\n\t};\n\n\t// internal helper methods\n\n\tfunction createBody ( geometry, materials ) {\n\n\t\tscope.bodyGeometry = geometry;\n\t\tscope.bodyMaterials = materials;\n\n\t\tcreateCar();\n\n\t};\n\n\tfunction createWheels ( geometry, materials ) {\n\n\t\tscope.wheelGeometry = geometry;\n\t\tscope.wheelMaterials = materials;\n\n\t\tcreateCar();\n\n\t};\n\n\tfunction createCar () {\n\n\t\tif ( scope.bodyGeometry && scope.wheelGeometry ) {\n\n\t\t\t// compute wheel geometry parameters\n\n\t\t\tif ( scope.autoWheelGeometry ) {\n\n\t\t\t\tscope.wheelGeometry.computeBoundingBox();\n\n\t\t\t\tvar bb = scope.wheelGeometry.boundingBox;\n\n\t\t\t\tscope.wheelOffset.addVectors( bb.min, bb.max );\n\t\t\t\tscope.wheelOffset.multiplyScalar( 0.5 );\n\n\t\t\t\tscope.wheelDiameter = bb.max.y - bb.min.y;\n\n\t\t\t\tscope.wheelGeometry.center();\n\n\t\t\t}\n\n\t\t\t// rig the car\n\n\t\t\tvar s = scope.modelScale,\n\t\t\t\tdelta = new THREE.Vector3();\n\n\t\t\tvar bodyFaceMaterial = new THREE.MeshFaceMaterial( scope.bodyMaterials );\n\t\t\tvar wheelFaceMaterial = new THREE.MeshFaceMaterial( scope.wheelMaterials );\n\n\t\t\t// body\n\n\t\t\tscope.bodyMesh = new THREE.Mesh( scope.bodyGeometry, bodyFaceMaterial );\n\t\t\tscope.bodyMesh.scale.set( s, s, s );\n\n\t\t\tscope.root.add( scope.bodyMesh );\n\n\t\t\t// front left wheel\n\n\t\t\tdelta.multiplyVectors( scope.wheelOffset, new THREE.Vector3( s, s, s ) );\n\n\t\t\tscope.frontLeftWheelRoot.position.add( delta );\n\n\t\t\tscope.frontLeftWheelMesh = new THREE.Mesh( scope.wheelGeometry, wheelFaceMaterial );\n\t\t\tscope.frontLeftWheelMesh.scale.set( s, s, s );\n\n\t\t\tscope.frontLeftWheelRoot.add( scope.frontLeftWheelMesh );\n\t\t\tscope.root.add( scope.frontLeftWheelRoot );\n\n\t\t\t// front right wheel\n\n\t\t\tdelta.multiplyVectors( scope.wheelOffset, new THREE.Vector3( -s, s, s ) );\n\n\t\t\tscope.frontRightWheelRoot.position.add( delta );\n\n\t\t\tscope.frontRightWheelMesh = new THREE.Mesh( scope.wheelGeometry, wheelFaceMaterial );\n\n\t\t\tscope.frontRightWheelMesh.scale.set( s, s, s );\n\t\t\tscope.frontRightWheelMesh.rotation.z = Math.PI;\n\n\t\t\tscope.frontRightWheelRoot.add( scope.frontRightWheelMesh );\n\t\t\tscope.root.add( scope.frontRightWheelRoot );\n\n\t\t\t// back left wheel\n\n\t\t\tdelta.multiplyVectors( scope.wheelOffset, new THREE.Vector3( s, s, -s ) );\n\t\t\tdelta.z -= scope.backWheelOffset;\n\n\t\t\tscope.backLeftWheelMesh = new THREE.Mesh( scope.wheelGeometry, wheelFaceMaterial );\n\n\t\t\tscope.backLeftWheelMesh.position.add( delta );\n\t\t\tscope.backLeftWheelMesh.scale.set( s, s, s );\n\n\t\t\tscope.root.add( scope.backLeftWheelMesh );\n\n\t\t\t// back right wheel\n\n\t\t\tdelta.multiplyVectors( scope.wheelOffset, new THREE.Vector3( -s, s, -s ) );\n\t\t\tdelta.z -= scope.backWheelOffset;\n\n\t\t\tscope.backRightWheelMesh = new THREE.Mesh( scope.wheelGeometry, wheelFaceMaterial );\n\n\t\t\tscope.backRightWheelMesh.position.add( delta );\n\t\t\tscope.backRightWheelMesh.scale.set( s, s, s );\n\t\t\tscope.backRightWheelMesh.rotation.z = Math.PI;\n\n\t\t\tscope.root.add( scope.backRightWheelMesh );\n\n\t\t\t// cache meshes\n\n\t\t\tscope.meshes = [ scope.bodyMesh, scope.frontLeftWheelMesh, scope.frontRightWheelMesh, scope.backLeftWheelMesh, scope.backRightWheelMesh ];\n\n\t\t\t// callback\n\n\t\t\tscope.loaded = true;\n\n\t\t\tif ( scope.callback ) {\n\n\t\t\t\tscope.callback( scope );\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tfunction quadraticEaseOut( k ) { return - k * ( k - 2 ); }\n\tfunction cubicEaseOut( k ) { return --k * k * k + 1; }\n\tfunction circularEaseOut( k ) { return Math.sqrt( 1 - --k * k ); }\n\tfunction sinusoidalEaseOut( k ) { return Math.sin( k * Math.PI / 2 ); }\n\tfunction exponentialEaseOut( k ) { return k === 1 ? 1 : - Math.pow( 2, - 10 * k ) + 1; }\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/ShaderSkin.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/ShaderSkin.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n */\n\n\nTHREE.ShaderSkin = {\n\n\t/* ------------------------------------------------------------------------------------------\n\t//\tSimple skin shader\n\t//\t\t- per-pixel Blinn-Phong diffuse term mixed with half-Lambert wrap-around term (per color component)\n\t//\t\t- physically based specular term (Kelemen/Szirmay-Kalos specular reflectance)\n\t//\n\t//\t\t- diffuse map\n\t//\t\t- bump map\n\t//\t\t- specular map\n\t//\t\t- point, directional and hemisphere lights (use with \"lights: true\" material option)\n\t//\t\t- fog (use with \"fog: true\" material option)\n\t//\t\t- shadow maps\n\t//\n\t// ------------------------------------------------------------------------------------------ */\n\n\t'skinSimple' : {\n\n\t\tuniforms: THREE.UniformsUtils.merge( [\n\n\t\t\tTHREE.UniformsLib[ \"fog\" ],\n\t\t\tTHREE.UniformsLib[ \"lights\" ],\n\t\t\tTHREE.UniformsLib[ \"shadowmap\" ],\n\n\t\t\t{\n\n\t\t\t\"enableBump\"\t: { type: \"i\", value: 0 },\n\t\t\t\"enableSpecular\": { type: \"i\", value: 0 },\n\n\t\t\t\"tDiffuse\"\t: { type: \"t\", value: null },\n\t\t\t\"tBeckmann\"\t: { type: \"t\", value: null },\n\n\t\t\t\"diffuse\":  { type: \"c\", value: new THREE.Color( 0xeeeeee ) },\n\t\t\t\"specular\": { type: \"c\", value: new THREE.Color( 0x111111 ) },\n\t\t\t\"ambient\":  { type: \"c\", value: new THREE.Color( 0x050505 ) },\n\t\t\t\"opacity\": \t  { type: \"f\", value: 1 },\n\n\t\t\t\"uRoughness\": \t  \t\t{ type: \"f\", value: 0.15 },\n\t\t\t\"uSpecularBrightness\": \t{ type: \"f\", value: 0.75 },\n\n\t\t\t\"bumpMap\"\t: { type: \"t\", value: null },\n\t\t\t\"bumpScale\" : { type: \"f\", value: 1 },\n\n\t\t\t\"specularMap\" : { type: \"t\", value: null },\n\n\t\t\t\"offsetRepeat\" : { type: \"v4\", value: new THREE.Vector4( 0, 0, 1, 1 ) },\n\n\t\t\t\"uWrapRGB\":\t{ type: \"v3\", value: new THREE.Vector3( 0.75, 0.375, 0.1875 ) }\n\n\t\t\t}\n\n\t\t] ),\n\n\t\tfragmentShader: [\n\n\t\t\t\"#define USE_BUMPMAP\",\n\t\t\t\"#extension GL_OES_standard_derivatives : enable\",\n\n\t\t\t\"uniform bool enableBump;\",\n\t\t\t\"uniform bool enableSpecular;\",\n\n\t\t\t\"uniform vec3 ambient;\",\n\t\t\t\"uniform vec3 diffuse;\",\n\t\t\t\"uniform vec3 specular;\",\n\t\t\t\"uniform float opacity;\",\n\n\t\t\t\"uniform float uRoughness;\",\n\t\t\t\"uniform float uSpecularBrightness;\",\n\n\t\t\t\"uniform vec3 uWrapRGB;\",\n\n\t\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\t\"uniform sampler2D tBeckmann;\",\n\n\t\t\t\"uniform sampler2D specularMap;\",\n\n\t\t\t\"varying vec3 vNormal;\",\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"uniform vec3 ambientLightColor;\",\n\n\t\t\t\"#if MAX_DIR_LIGHTS > 0\",\n\n\t\t\t\t\"uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\",\n\t\t\t\t\"uniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\",\n\n\t\t\t\"#endif\",\n\n\t\t\t\"#if MAX_HEMI_LIGHTS > 0\",\n\n\t\t\t\t\"uniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\",\n\t\t\t\t\"uniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\",\n\t\t\t\t\"uniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\",\n\n\t\t\t\"#endif\",\n\n\t\t\t\"#if MAX_POINT_LIGHTS > 0\",\n\n\t\t\t\t\"uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\",\n\t\t\t\t\"uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\",\n\t\t\t\t\"uniform float pointLightDistance[ MAX_POINT_LIGHTS ];\",\n\n\t\t\t\"#endif\",\n\n\t\t\t\"varying vec3 vViewPosition;\",\n\n\t\t\tTHREE.ShaderChunk[ \"shadowmap_pars_fragment\" ],\n\t\t\tTHREE.ShaderChunk[ \"fog_pars_fragment\" ],\n\t\t\tTHREE.ShaderChunk[ \"bumpmap_pars_fragment\" ],\n\n\t\t\t// Fresnel term\n\n\t\t\t\"float fresnelReflectance( vec3 H, vec3 V, float F0 ) {\",\n\n\t\t\t\t\"float base = 1.0 - dot( V, H );\",\n\t\t\t\t\"float exponential = pow( base, 5.0 );\",\n\n\t\t\t\t\"return exponential + F0 * ( 1.0 - exponential );\",\n\n\t\t\t\"}\",\n\n\t\t\t// Kelemen/Szirmay-Kalos specular BRDF\n\n\t\t\t\"float KS_Skin_Specular( vec3 N,\", \t\t// Bumped surface normal\n\t\t\t\t\t\t\t\t\t\"vec3 L,\", \t\t// Points to light\n\t\t\t\t\t\t\t\t\t\"vec3 V,\", \t\t// Points to eye\n\t\t\t\t\t\t\t\t\t\"float m,\",  \t// Roughness\n\t\t\t\t\t\t\t\t\t\"float rho_s\", \t// Specular brightness\n\t\t\t\t\t\t\t\t\t\") {\",\n\n\t\t\t\t\"float result = 0.0;\",\n\t\t\t\t\"float ndotl = dot( N, L );\",\n\n\t\t\t\t\"if( ndotl > 0.0 ) {\",\n\n\t\t\t\t\t\"vec3 h = L + V;\", // Unnormalized half-way vector\n\t\t\t\t\t\"vec3 H = normalize( h );\",\n\n\t\t\t\t\t\"float ndoth = dot( N, H );\",\n\n\t\t\t\t\t\"float PH = pow( 2.0 * texture2D( tBeckmann, vec2( ndoth, m ) ).x, 10.0 );\",\n\n\t\t\t\t\t\"float F = fresnelReflectance( H, V, 0.028 );\",\n\t\t\t\t\t\"float frSpec = max( PH * F / dot( h, h ), 0.0 );\",\n\n\t\t\t\t\t\"result = ndotl * rho_s * frSpec;\", // BRDF * dot(N,L) * rho_s\n\n\t\t\t\t\"}\",\n\n\t\t\t\t\"return result;\",\n\n\t\t\t\"}\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"gl_FragColor = vec4( vec3( 1.0 ), opacity );\",\n\n\t\t\t\t\"vec4 colDiffuse = texture2D( tDiffuse, vUv );\",\n\t\t\t\t\"colDiffuse.rgb *= colDiffuse.rgb;\",\n\n\t\t\t\t\"gl_FragColor = gl_FragColor * colDiffuse;\",\n\n\t\t\t\t\"vec3 normal = normalize( vNormal );\",\n\t\t\t\t\"vec3 viewPosition = normalize( vViewPosition );\",\n\n\t\t\t\t\"float specularStrength;\",\n\n\t\t\t\t\"if ( enableSpecular ) {\",\n\n\t\t\t\t\t\"vec4 texelSpecular = texture2D( specularMap, vUv );\",\n\t\t\t\t\t\"specularStrength = texelSpecular.r;\",\n\n\t\t\t\t\"} else {\",\n\n\t\t\t\t\t\"specularStrength = 1.0;\",\n\n\t\t\t\t\"}\",\n\n\t\t\t\t\"#ifdef USE_BUMPMAP\",\n\n\t\t\t\t\t\"if ( enableBump ) normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t// point lights\n\n\t\t\t\t\"vec3 specularTotal = vec3( 0.0 );\",\n\n\t\t\t\t\"#if MAX_POINT_LIGHTS > 0\",\n\n\t\t\t\t\t\"vec3 pointTotal = vec3( 0.0 );\",\n\n\t\t\t\t\t\"for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\",\n\n\t\t\t\t\t\t\"vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\",\n\n\t\t\t\t\t\t\"vec3 lVector = lPosition.xyz + vViewPosition.xyz;\",\n\n\t\t\t\t\t\t\"float lDistance = 1.0;\",\n\n\t\t\t\t\t\t\"if ( pointLightDistance[ i ] > 0.0 )\",\n\t\t\t\t\t\t\t\"lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\",\n\n\t\t\t\t\t\t\"lVector = normalize( lVector );\",\n\n\t\t\t\t\t\t\"float pointDiffuseWeightFull = max( dot( normal, lVector ), 0.0 );\",\n\t\t\t\t\t\t\"float pointDiffuseWeightHalf = max( 0.5 * dot( normal, lVector ) + 0.5, 0.0 );\",\n\t\t\t\t\t\t\"vec3 pointDiffuseWeight = mix( vec3 ( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), uWrapRGB );\",\n\n\t\t\t\t\t\t\"float pointSpecularWeight = KS_Skin_Specular( normal, lVector, viewPosition, uRoughness, uSpecularBrightness );\",\n\n\t\t\t\t\t\t\"pointTotal    += lDistance * diffuse * pointLightColor[ i ] * pointDiffuseWeight;\",\n\t\t\t\t\t\t\"specularTotal += lDistance * specular * pointLightColor[ i ] * pointSpecularWeight * specularStrength;\",\n\n\t\t\t\t\t\"}\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t// directional lights\n\n\t\t\t\t\"#if MAX_DIR_LIGHTS > 0\",\n\n\t\t\t\t\t\"vec3 dirTotal = vec3( 0.0 );\",\n\n\t\t\t\t\t\"for( int i = 0; i < MAX_DIR_LIGHTS; i++ ) {\",\n\n\t\t\t\t\t\t\"vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\",\n\n\t\t\t\t\t\t\"vec3 dirVector = normalize( lDirection.xyz );\",\n\n\t\t\t\t\t\t\"float dirDiffuseWeightFull = max( dot( normal, dirVector ), 0.0 );\",\n\t\t\t\t\t\t\"float dirDiffuseWeightHalf = max( 0.5 * dot( normal, dirVector ) + 0.5, 0.0 );\",\n\t\t\t\t\t\t\"vec3 dirDiffuseWeight = mix( vec3 ( dirDiffuseWeightFull ), vec3( dirDiffuseWeightHalf ), uWrapRGB );\",\n\n\t\t\t\t\t\t\"float dirSpecularWeight =  KS_Skin_Specular( normal, dirVector, viewPosition, uRoughness, uSpecularBrightness );\",\n\n\t\t\t\t\t\t\"dirTotal \t   += diffuse * directionalLightColor[ i ] * dirDiffuseWeight;\",\n\t\t\t\t\t\t\"specularTotal += specular * directionalLightColor[ i ] * dirSpecularWeight * specularStrength;\",\n\n\t\t\t\t\t\"}\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t// hemisphere lights\n\n\t\t\t\t\"#if MAX_HEMI_LIGHTS > 0\",\n\n\t\t\t\t\t\"vec3 hemiTotal = vec3( 0.0 );\",\n\n\t\t\t\t\t\"for ( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\",\n\n\t\t\t\t\t\t\"vec4 lDirection = viewMatrix * vec4( hemisphereLightDirection[ i ], 0.0 );\",\n\t\t\t\t\t\t\"vec3 lVector = normalize( lDirection.xyz );\",\n\n\t\t\t\t\t\t\"float dotProduct = dot( normal, lVector );\",\n\t\t\t\t\t\t\"float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\",\n\n\t\t\t\t\t\t\"hemiTotal += diffuse * mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\",\n\n\t\t\t\t\t\t// specular (sky light)\n\n\t\t\t\t\t\t\"float hemiSpecularWeight = 0.0;\",\n\t\t\t\t\t\t\"hemiSpecularWeight += KS_Skin_Specular( normal, lVector, viewPosition, uRoughness, uSpecularBrightness );\",\n\n\t\t\t\t\t\t// specular (ground light)\n\n\t\t\t\t\t\t\"vec3 lVectorGround = -lVector;\",\n\t\t\t\t\t\t\"hemiSpecularWeight += KS_Skin_Specular( normal, lVectorGround, viewPosition, uRoughness, uSpecularBrightness );\",\n\n\t\t\t\t\t\t\"specularTotal += specular * mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight ) * hemiSpecularWeight * specularStrength;\",\n\n\t\t\t\t\t\"}\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t// all lights contribution summation\n\n\t\t\t\t\"vec3 totalLight = vec3( 0.0 );\",\n\n\t\t\t\t\"#if MAX_DIR_LIGHTS > 0\",\n\t\t\t\t\t\"totalLight += dirTotal;\",\n\t\t\t\t\"#endif\",\n\n\t\t\t\t\"#if MAX_POINT_LIGHTS > 0\",\n\t\t\t\t\t\"totalLight += pointTotal;\",\n\t\t\t\t\"#endif\",\n\n\t\t\t\t\"#if MAX_HEMI_LIGHTS > 0\",\n\t\t\t\t\t\"totalLight += hemiTotal;\",\n\t\t\t\t\"#endif\",\n\n\t\t\t\t\"gl_FragColor.xyz = gl_FragColor.xyz * ( totalLight + ambientLightColor * ambient ) + specularTotal;\",\n\n\t\t\t\tTHREE.ShaderChunk[ \"shadowmap_fragment\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"linear_to_gamma_fragment\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"fog_fragment\" ],\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tvertexShader: [\n\n\t\t\t\"uniform vec4 offsetRepeat;\",\n\n\t\t\t\"varying vec3 vNormal;\",\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"varying vec3 vViewPosition;\",\n\n\t\t\tTHREE.ShaderChunk[ \"shadowmap_pars_vertex\" ],\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\",\n\t\t\t\t\"vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\",\n\n\t\t\t\t\"vViewPosition = -mvPosition.xyz;\",\n\n\t\t\t\t\"vNormal = normalize( normalMatrix * normal );\",\n\n\t\t\t\t\"vUv = uv * offsetRepeat.zw + offsetRepeat.xy;\",\n\n\t\t\t\t\"gl_Position = projectionMatrix * mvPosition;\",\n\n\t\t\t\tTHREE.ShaderChunk[ \"shadowmap_vertex\" ],\n\n\t\t\t\"}\"\n\n\t\t].join( \"\\n\" )\n\n\t},\n\n\t/* ------------------------------------------------------------------------------------------\n\t//\tSkin shader\n\t//\t\t- Blinn-Phong diffuse term (using normal + diffuse maps)\n\t//\t\t- subsurface scattering approximation by four blur layers\n\t//\t\t- physically based specular term (Kelemen/Szirmay-Kalos specular reflectance)\n\t//\n\t//\t\t- point and directional lights (use with \"lights: true\" material option)\n\t//\n\t//\t\t- based on Nvidia Advanced Skin Rendering GDC 2007 presentation\n\t//\t\t  and GPU Gems 3 Chapter 14. Advanced Techniques for Realistic Real-Time Skin Rendering\n\t//\n\t//\t\t\thttp://developer.download.nvidia.com/presentations/2007/gdc/Advanced_Skin.pdf\n\t//\t\t\thttp://http.developer.nvidia.com/GPUGems3/gpugems3_ch14.html\n\t// ------------------------------------------------------------------------------------------ */\n\n\t'skin' : {\n\n\t\tuniforms: THREE.UniformsUtils.merge( [\n\n\t\t\tTHREE.UniformsLib[ \"fog\" ],\n\t\t\tTHREE.UniformsLib[ \"lights\" ],\n\n\t\t\t{\n\n\t\t\t\"passID\": { type: \"i\", value: 0 },\n\n\t\t\t\"tDiffuse\"\t: { type: \"t\", value: null },\n\t\t\t\"tNormal\"\t: { type: \"t\", value: null },\n\n\t\t\t\"tBlur1\"\t: { type: \"t\", value: null },\n\t\t\t\"tBlur2\"\t: { type: \"t\", value: null },\n\t\t\t\"tBlur3\"\t: { type: \"t\", value: null },\n\t\t\t\"tBlur4\"\t: { type: \"t\", value: null },\n\n\t\t\t\"tBeckmann\"\t: { type: \"t\", value: null },\n\n\t\t\t\"uNormalScale\": { type: \"f\", value: 1.0 },\n\n\t\t\t\"diffuse\":  { type: \"c\", value: new THREE.Color( 0xeeeeee ) },\n\t\t\t\"specular\": { type: \"c\", value: new THREE.Color( 0x111111 ) },\n\t\t\t\"ambient\":  { type: \"c\", value: new THREE.Color( 0x050505 ) },\n\t\t\t\"opacity\": \t  { type: \"f\", value: 1 },\n\n\t\t\t\"uRoughness\": \t  \t\t{ type: \"f\", value: 0.15 },\n\t\t\t\"uSpecularBrightness\": \t{ type: \"f\", value: 0.75 }\n\n\t\t\t}\n\n\t\t] ),\n\n\t\tfragmentShader: [\n\n\t\t\t\"uniform vec3 ambient;\",\n\t\t\t\"uniform vec3 diffuse;\",\n\t\t\t\"uniform vec3 specular;\",\n\t\t\t\"uniform float opacity;\",\n\n\t\t\t\"uniform float uRoughness;\",\n\t\t\t\"uniform float uSpecularBrightness;\",\n\n\t\t\t\"uniform int passID;\",\n\n\t\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\t\"uniform sampler2D tNormal;\",\n\n\t\t\t\"uniform sampler2D tBlur1;\",\n\t\t\t\"uniform sampler2D tBlur2;\",\n\t\t\t\"uniform sampler2D tBlur3;\",\n\t\t\t\"uniform sampler2D tBlur4;\",\n\n\t\t\t\"uniform sampler2D tBeckmann;\",\n\n\t\t\t\"uniform float uNormalScale;\",\n\n\t\t\t\"varying vec3 vTangent;\",\n\t\t\t\"varying vec3 vBinormal;\",\n\t\t\t\"varying vec3 vNormal;\",\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"uniform vec3 ambientLightColor;\",\n\n\t\t\t\"#if MAX_DIR_LIGHTS > 0\",\n\t\t\t\t\"uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\",\n\t\t\t\t\"uniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\",\n\t\t\t\"#endif\",\n\n\t\t\t\"#if MAX_POINT_LIGHTS > 0\",\n\t\t\t\t\"uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\",\n\t\t\t\t\"varying vec4 vPointLight[ MAX_POINT_LIGHTS ];\",\n\t\t\t\"#endif\",\n\n\t\t\t\"varying vec3 vViewPosition;\",\n\n\t\t\tTHREE.ShaderChunk[ \"fog_pars_fragment\" ],\n\n\t\t\t\"float fresnelReflectance( vec3 H, vec3 V, float F0 ) {\",\n\n\t\t\t\t\"float base = 1.0 - dot( V, H );\",\n\t\t\t\t\"float exponential = pow( base, 5.0 );\",\n\n\t\t\t\t\"return exponential + F0 * ( 1.0 - exponential );\",\n\n\t\t\t\"}\",\n\n\t\t\t// Kelemen/Szirmay-Kalos specular BRDF\n\n\t\t\t\"float KS_Skin_Specular( vec3 N,\", \t\t// Bumped surface normal\n\t\t\t\t\t\t\t\t\t\"vec3 L,\", \t\t// Points to light\n\t\t\t\t\t\t\t\t\t\"vec3 V,\", \t\t// Points to eye\n\t\t\t\t\t\t\t\t\t\"float m,\",  \t// Roughness\n\t\t\t\t\t\t\t\t\t\"float rho_s\", \t// Specular brightness\n\t\t\t\t\t\t\t\t\t\") {\",\n\n\t\t\t\t\"float result = 0.0;\",\n\t\t\t\t\"float ndotl = dot( N, L );\",\n\n\t\t\t\t\"if( ndotl > 0.0 ) {\",\n\n\t\t\t\t\t\"vec3 h = L + V;\", // Unnormalized half-way vector\n\t\t\t\t\t\"vec3 H = normalize( h );\",\n\n\t\t\t\t\t\"float ndoth = dot( N, H );\",\n\n\t\t\t\t\t\"float PH = pow( 2.0 * texture2D( tBeckmann, vec2( ndoth, m ) ).x, 10.0 );\",\n\t\t\t\t\t\"float F = fresnelReflectance( H, V, 0.028 );\",\n\t\t\t\t\t\"float frSpec = max( PH * F / dot( h, h ), 0.0 );\",\n\n\t\t\t\t\t\"result = ndotl * rho_s * frSpec;\", // BRDF * dot(N,L) * rho_s\n\n\t\t\t\t\"}\",\n\n\t\t\t\t\"return result;\",\n\n\t\t\t\"}\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"gl_FragColor = vec4( 1.0 );\",\n\n\t\t\t\t\"vec4 mColor = vec4( diffuse, opacity );\",\n\t\t\t\t\"vec4 mSpecular = vec4( specular, opacity );\",\n\n\t\t\t\t\"vec3 normalTex = texture2D( tNormal, vUv ).xyz * 2.0 - 1.0;\",\n\t\t\t\t\"normalTex.xy *= uNormalScale;\",\n\t\t\t\t\"normalTex = normalize( normalTex );\",\n\n\t\t\t\t\"vec4 colDiffuse = texture2D( tDiffuse, vUv );\",\n\t\t\t\t\"colDiffuse *= colDiffuse;\",\n\n\t\t\t\t\"gl_FragColor = gl_FragColor * colDiffuse;\",\n\n\t\t\t\t\"mat3 tsb = mat3( vTangent, vBinormal, vNormal );\",\n\t\t\t\t\"vec3 finalNormal = tsb * normalTex;\",\n\n\t\t\t\t\"vec3 normal = normalize( finalNormal );\",\n\t\t\t\t\"vec3 viewPosition = normalize( vViewPosition );\",\n\n\t\t\t\t// point lights\n\n\t\t\t\t\"vec3 specularTotal = vec3( 0.0 );\",\n\n\t\t\t\t\"#if MAX_POINT_LIGHTS > 0\",\n\n\t\t\t\t\t\"vec4 pointTotal = vec4( vec3( 0.0 ), 1.0 );\",\n\n\t\t\t\t\t\"for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\",\n\n\t\t\t\t\t\t\"vec3 pointVector = normalize( vPointLight[ i ].xyz );\",\n\t\t\t\t\t\t\"float pointDistance = vPointLight[ i ].w;\",\n\n\t\t\t\t\t\t\"float pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );\",\n\n\t\t\t\t\t\t\"pointTotal  += pointDistance * vec4( pointLightColor[ i ], 1.0 ) * ( mColor * pointDiffuseWeight );\",\n\n\t\t\t\t\t\t\"if ( passID == 1 )\",\n\t\t\t\t\t\t\t\"specularTotal += pointDistance * mSpecular.xyz * pointLightColor[ i ] * KS_Skin_Specular( normal, pointVector, viewPosition, uRoughness, uSpecularBrightness );\",\n\n\t\t\t\t\t\"}\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t// directional lights\n\n\t\t\t\t\"#if MAX_DIR_LIGHTS > 0\",\n\n\t\t\t\t\t\"vec4 dirTotal = vec4( vec3( 0.0 ), 1.0 );\",\n\n\t\t\t\t\t\"for( int i = 0; i < MAX_DIR_LIGHTS; i++ ) {\",\n\n\t\t\t\t\t\t\"vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\",\n\n\t\t\t\t\t\t\"vec3 dirVector = normalize( lDirection.xyz );\",\n\n\t\t\t\t\t\t\"float dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );\",\n\n\t\t\t\t\t\t\"dirTotal  += vec4( directionalLightColor[ i ], 1.0 ) * ( mColor * dirDiffuseWeight );\",\n\n\t\t\t\t\t\t\"if ( passID == 1 )\",\n\t\t\t\t\t\t\t\"specularTotal += mSpecular.xyz * directionalLightColor[ i ] * KS_Skin_Specular( normal, dirVector, viewPosition, uRoughness, uSpecularBrightness );\",\n\n\t\t\t\t\t\"}\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t// all lights contribution summation\n\n\t\t\t\t\"vec4 totalLight = vec4( vec3( 0.0 ), opacity );\",\n\n\t\t\t\t\"#if MAX_DIR_LIGHTS > 0\",\n\t\t\t\t\t\"totalLight += dirTotal;\",\n\t\t\t\t\"#endif\",\n\n\t\t\t\t\"#if MAX_POINT_LIGHTS > 0\",\n\t\t\t\t\t\"totalLight += pointTotal;\",\n\t\t\t\t\"#endif\",\n\n\t\t\t\t\"gl_FragColor = gl_FragColor * totalLight;\",\n\n\t\t\t\t\"if ( passID == 0 ) {\",\n\n\t\t\t\t\t\"gl_FragColor = vec4( sqrt( gl_FragColor.xyz ), gl_FragColor.w );\",\n\n\t\t\t\t\"} else if ( passID == 1 ) {\",\n\n\t\t\t\t\t//\"#define VERSION1\",\n\n\t\t\t\t\t\"#ifdef VERSION1\",\n\n\t\t\t\t\t\t\"vec3 nonblurColor = sqrt( gl_FragColor.xyz );\",\n\n\t\t\t\t\t\"#else\",\n\n\t\t\t\t\t\t\"vec3 nonblurColor = gl_FragColor.xyz;\",\n\n\t\t\t\t\t\"#endif\",\n\n\t\t\t\t\t\"vec3 blur1Color = texture2D( tBlur1, vUv ).xyz;\",\n\t\t\t\t\t\"vec3 blur2Color = texture2D( tBlur2, vUv ).xyz;\",\n\t\t\t\t\t\"vec3 blur3Color = texture2D( tBlur3, vUv ).xyz;\",\n\t\t\t\t\t\"vec3 blur4Color = texture2D( tBlur4, vUv ).xyz;\",\n\n\n\t\t\t\t\t//\"gl_FragColor = vec4( blur1Color, gl_FragColor.w );\",\n\n\t\t\t\t\t//\"gl_FragColor = vec4( vec3( 0.22, 0.5, 0.7 ) * nonblurColor + vec3( 0.2, 0.5, 0.3 ) * blur1Color + vec3( 0.58, 0.0, 0.0 ) * blur2Color, gl_FragColor.w );\",\n\n\t\t\t\t\t//\"gl_FragColor = vec4( vec3( 0.25, 0.6, 0.8 ) * nonblurColor + vec3( 0.15, 0.25, 0.2 ) * blur1Color + vec3( 0.15, 0.15, 0.0 ) * blur2Color + vec3( 0.45, 0.0, 0.0 ) * blur3Color, gl_FragColor.w );\",\n\n\n\t\t\t\t\t\"gl_FragColor = vec4( vec3( 0.22,  0.437, 0.635 ) * nonblurColor + \",\n\t\t\t\t\t\t\t\t\t\t \"vec3( 0.101, 0.355, 0.365 ) * blur1Color + \",\n\t\t\t\t\t\t\t\t\t\t \"vec3( 0.119, 0.208, 0.0 )   * blur2Color + \",\n\t\t\t\t\t\t\t\t\t\t \"vec3( 0.114, 0.0,   0.0 )   * blur3Color + \",\n\t\t\t\t\t\t\t\t\t\t \"vec3( 0.444, 0.0,   0.0 )   * blur4Color\",\n\t\t\t\t\t\t\t\t\t\t \", gl_FragColor.w );\",\n\n\t\t\t\t\t\"gl_FragColor.xyz *= pow( colDiffuse.xyz, vec3( 0.5 ) );\",\n\n\t\t\t\t\t\"gl_FragColor.xyz += ambientLightColor * ambient * colDiffuse.xyz + specularTotal;\",\n\n\t\t\t\t\t\"#ifndef VERSION1\",\n\n\t\t\t\t\t\t\"gl_FragColor.xyz = sqrt( gl_FragColor.xyz );\",\n\n\t\t\t\t\t\"#endif\",\n\n\t\t\t\t\"}\",\n\n\t\t\t\tTHREE.ShaderChunk[ \"fog_fragment\" ],\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tvertexShader: [\n\n\t\t\t\"attribute vec4 tangent;\",\n\n\t\t\t\"#ifdef VERTEX_TEXTURES\",\n\n\t\t\t\t\"uniform sampler2D tDisplacement;\",\n\t\t\t\t\"uniform float uDisplacementScale;\",\n\t\t\t\t\"uniform float uDisplacementBias;\",\n\n\t\t\t\"#endif\",\n\n\t\t\t\"varying vec3 vTangent;\",\n\t\t\t\"varying vec3 vBinormal;\",\n\t\t\t\"varying vec3 vNormal;\",\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"#if MAX_POINT_LIGHTS > 0\",\n\n\t\t\t\t\"uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\",\n\t\t\t\t\"uniform float pointLightDistance[ MAX_POINT_LIGHTS ];\",\n\n\t\t\t\t\"varying vec4 vPointLight[ MAX_POINT_LIGHTS ];\",\n\n\t\t\t\"#endif\",\n\n\t\t\t\"varying vec3 vViewPosition;\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\",\n\n\t\t\t\t\"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\t\t\"vViewPosition = -mvPosition.xyz;\",\n\n\t\t\t\t\"vNormal = normalize( normalMatrix * normal );\",\n\n\t\t\t\t// tangent and binormal vectors\n\n\t\t\t\t\"vTangent = normalize( normalMatrix * tangent.xyz );\",\n\n\t\t\t\t\"vBinormal = cross( vNormal, vTangent ) * tangent.w;\",\n\t\t\t\t\"vBinormal = normalize( vBinormal );\",\n\n\t\t\t\t\"vUv = uv;\",\n\n\t\t\t\t// point lights\n\n\t\t\t\t\"#if MAX_POINT_LIGHTS > 0\",\n\n\t\t\t\t\t\"for( int i = 0; i < MAX_POINT_LIGHTS; i++ ) {\",\n\n\t\t\t\t\t\t\"vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\",\n\n\t\t\t\t\t\t\"vec3 lVector = lPosition.xyz - mvPosition.xyz;\",\n\n\t\t\t\t\t\t\"float lDistance = 1.0;\",\n\n\t\t\t\t\t\t\"if ( pointLightDistance[ i ] > 0.0 )\",\n\t\t\t\t\t\t\t\"lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\",\n\n\t\t\t\t\t\t\"lVector = normalize( lVector );\",\n\n\t\t\t\t\t\t\"vPointLight[ i ] = vec4( lVector, lDistance );\",\n\n\t\t\t\t\t\"}\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t// displacement mapping\n\n\t\t\t\t\"#ifdef VERTEX_TEXTURES\",\n\n\t\t\t\t\t\"vec3 dv = texture2D( tDisplacement, uv ).xyz;\",\n\t\t\t\t\t\"float df = uDisplacementScale * dv.x + uDisplacementBias;\",\n\t\t\t\t\t\"vec4 displacedPosition = vec4( vNormal.xyz * df, 0.0 ) + mvPosition;\",\n\t\t\t\t\t\"gl_Position = projectionMatrix * displacedPosition;\",\n\n\t\t\t\t\"#else\",\n\n\t\t\t\t\t\"gl_Position = projectionMatrix * mvPosition;\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tvertexShaderUV: [\n\n\t\t\t\"attribute vec4 tangent;\",\n\n\t\t\t\"#ifdef VERTEX_TEXTURES\",\n\n\t\t\t\t\"uniform sampler2D tDisplacement;\",\n\t\t\t\t\"uniform float uDisplacementScale;\",\n\t\t\t\t\"uniform float uDisplacementBias;\",\n\n\t\t\t\"#endif\",\n\n\t\t\t\"varying vec3 vTangent;\",\n\t\t\t\"varying vec3 vBinormal;\",\n\t\t\t\"varying vec3 vNormal;\",\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"#if MAX_POINT_LIGHTS > 0\",\n\n\t\t\t\t\"uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\",\n\t\t\t\t\"uniform float pointLightDistance[ MAX_POINT_LIGHTS ];\",\n\n\t\t\t\t\"varying vec4 vPointLight[ MAX_POINT_LIGHTS ];\",\n\n\t\t\t\"#endif\",\n\n\t\t\t\"varying vec3 vViewPosition;\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\",\n\n\t\t\t\t\"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\t\t\"vViewPosition = -mvPosition.xyz;\",\n\n\t\t\t\t\"vNormal = normalize( normalMatrix * normal );\",\n\n\t\t\t\t// tangent and binormal vectors\n\n\t\t\t\t\"vTangent = normalize( normalMatrix * tangent.xyz );\",\n\n\t\t\t\t\"vBinormal = cross( vNormal, vTangent ) * tangent.w;\",\n\t\t\t\t\"vBinormal = normalize( vBinormal );\",\n\n\t\t\t\t\"vUv = uv;\",\n\n\t\t\t\t// point lights\n\n\t\t\t\t\"#if MAX_POINT_LIGHTS > 0\",\n\n\t\t\t\t\t\"for( int i = 0; i < MAX_POINT_LIGHTS; i++ ) {\",\n\n\t\t\t\t\t\t\"vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\",\n\n\t\t\t\t\t\t\"vec3 lVector = lPosition.xyz - mvPosition.xyz;\",\n\n\t\t\t\t\t\t\"float lDistance = 1.0;\",\n\n\t\t\t\t\t\t\"if ( pointLightDistance[ i ] > 0.0 )\",\n\t\t\t\t\t\t\t\"lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\",\n\n\t\t\t\t\t\t\"lVector = normalize( lVector );\",\n\n\t\t\t\t\t\t\"vPointLight[ i ] = vec4( lVector, lDistance );\",\n\n\t\t\t\t\t\"}\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t\"gl_Position = vec4( uv.x * 2.0 - 1.0, uv.y * 2.0 - 1.0, 0.0, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t},\n\n\t/* ------------------------------------------------------------------------------------------\n\t// Beckmann distribution function\n\t//\t- to be used in specular term of skin shader\n\t//\t- render a screen-aligned quad to precompute a 512 x 512 texture\n\t//\n\t//\t\t- from http://developer.nvidia.com/node/171\n\t ------------------------------------------------------------------------------------------ */\n\n\t\"beckmann\" : {\n\n\t\tuniforms: {},\n\n\t\tvertexShader: [\n\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"vUv = uv;\",\n\t\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tfragmentShader: [\n\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"float PHBeckmann( float ndoth, float m ) {\",\n\n\t\t\t\t\"float alpha = acos( ndoth );\",\n\t\t\t\t\"float ta = tan( alpha );\",\n\n\t\t\t\t\"float val = 1.0 / ( m * m * pow( ndoth, 4.0 ) ) * exp( -( ta * ta ) / ( m * m ) );\",\n\t\t\t\t\"return val;\",\n\n\t\t\t\"}\",\n\n\t\t\t\"float KSTextureCompute( vec2 tex ) {\",\n\n\t\t\t\t// Scale the value to fit within [0,1]  invert upon lookup.\n\n\t\t\t\t\"return 0.5 * pow( PHBeckmann( tex.x, tex.y ), 0.1 );\",\n\n\t\t\t\"}\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"float x = KSTextureCompute( vUv );\",\n\n\t\t\t\t\"gl_FragColor = vec4( x, x, x, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t}\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/ParametricGeometries.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/ParametricGeometries.js",
            "module-type": "library",
            "text": "/*\n * @author zz85\n *\n * Experimenting of primitive geometry creation using Surface Parametric equations\n *\n */\n\n\nTHREE.ParametricGeometries = {\n\n\tklein: function (v, u) {\n\t\tu *= Math.PI;\n\t\tv *= 2 * Math.PI;\n\n\t\tu = u * 2;\n\t\tvar x, y, z;\n\t\tif (u < Math.PI) {\n\t\t\tx = 3 * Math.cos(u) * (1 + Math.sin(u)) + (2 * (1 - Math.cos(u) / 2)) * Math.cos(u) * Math.cos(v);\n\t\t\tz = -8 * Math.sin(u) - 2 * (1 - Math.cos(u) / 2) * Math.sin(u) * Math.cos(v);\n\t\t} else {\n\t\t\tx = 3 * Math.cos(u) * (1 + Math.sin(u)) + (2 * (1 - Math.cos(u) / 2)) * Math.cos(v + Math.PI);\n\t\t\tz = -8 * Math.sin(u);\n\t\t}\n\n\t\ty = -2 * (1 - Math.cos(u) / 2) * Math.sin(v);\n\n\t\treturn new THREE.Vector3(x, y, z);\n\t},\n\n\tplane: function (width, height) {\n\n\t\treturn function(u, v) {\n\t\t\tvar x = u * width;\n\t\t\tvar y = 0;\n\t\t\tvar z = v * height;\n\n\t\t\treturn new THREE.Vector3(x, y, z);\n\t\t};\n\t},\n\n\tmobius: function(u, t) {\n\n\t\t// flat mobius strip\n\t\t// http://www.wolframalpha.com/input/?i=M%C3%B6bius+strip+parametric+equations&lk=1&a=ClashPrefs_*Surface.MoebiusStrip.SurfaceProperty.ParametricEquations-\n\t\tu = u - 0.5;\n\t\tvar v = 2 * Math.PI * t;\n\n\t\tvar x, y, z;\n\n\t\tvar a = 2;\n\t\tx = Math.cos(v) * (a + u * Math.cos(v/2));\n\t\ty = Math.sin(v) * (a + u * Math.cos(v/2));\n\t\tz = u * Math.sin(v/2);\n\t\treturn new THREE.Vector3(x, y, z);\n\n\t},\n\n\tmobius3d: function(u, t) {\n\n\t\t// volumetric mobius strip\n\t\tu *= Math.PI;\n\t\tt *= 2 * Math.PI;\n\n\t\tu = u * 2;\n\t\tvar phi = u / 2;\n\t\tvar major = 2.25, a = 0.125, b = 0.65;\n\t\tvar x, y, z;\n\t\tx = a * Math.cos(t) * Math.cos(phi) - b * Math.sin(t) * Math.sin(phi);\n\t\tz = a * Math.cos(t) * Math.sin(phi) + b * Math.sin(t) * Math.cos(phi);\n\t\ty = (major + x) * Math.sin(u);\n\t\tx = (major + x) * Math.cos(u);\n\t\treturn new THREE.Vector3(x, y, z);\n\t}\n\n};\n\n\n/*********************************************\n *\n * Parametric Replacement for TubeGeometry\n *\n *********************************************/\n\nTHREE.ParametricGeometries.TubeGeometry = function(path, segments, radius, segmentsRadius, closed, debug) {\n\n\tthis.path = path;\n\tthis.segments = segments || 64;\n\tthis.radius = radius || 1;\n\tthis.segmentsRadius = segmentsRadius || 8;\n\tthis.closed = closed || false;\n\tif (debug) this.debug = new THREE.Object3D();\n\n\n\tvar scope = this,\n\n\t\ttangent, normal, binormal,\n\n\t\tnumpoints = this.segments + 1,\n\n\t\tx, y, z, tx, ty, tz, u, v,\n\n\t\tcx, cy, pos, pos2 = new THREE.Vector3(),\n\t\ti, j, ip, jp, a, b, c, d, uva, uvb, uvc, uvd;\n\n\tvar frames = new THREE.TubeGeometry.FrenetFrames(path, segments, closed),\n\t\ttangents = frames.tangents,\n\t\tnormals = frames.normals,\n\t\tbinormals = frames.binormals;\n\n\t\t// proxy internals\n\t\tthis.tangents = tangents;\n\t\tthis.normals = normals;\n\t\tthis.binormals = binormals;\n\n\n\n\tvar ParametricTube = function(u, v) {\n\t\tv *= 2 * Math.PI;\n\n\t\ti = u * (numpoints - 1);\n\t\ti = Math.floor(i);\n\n\t\tpos = path.getPointAt(u);\n\n\t\ttangent = tangents[i];\n\t\tnormal = normals[i];\n\t\tbinormal = binormals[i];\n\n\t\tif (scope.debug) {\n\n\t\t\tscope.debug.add(new THREE.ArrowHelper(tangent, pos, radius, 0x0000ff));\n\t\t\tscope.debug.add(new THREE.ArrowHelper(normal, pos, radius, 0xff0000));\n\t\t\tscope.debug.add(new THREE.ArrowHelper(binormal, pos, radius, 0x00ff00));\n\n\t\t}\n\n\t\tcx = -scope.radius * Math.cos(v); // TODO: Hack: Negating it so it faces outside.\n\t\tcy = scope.radius * Math.sin(v);\n\n\t\tpos2.copy(pos);\n\t\tpos2.x += cx * normal.x + cy * binormal.x;\n\t\tpos2.y += cx * normal.y + cy * binormal.y;\n\t\tpos2.z += cx * normal.z + cy * binormal.z;\n\n\t\treturn pos2.clone();\n\t};\n\n\tTHREE.ParametricGeometry.call(this, ParametricTube, segments, segmentsRadius);\n\n};\n\nTHREE.ParametricGeometries.TubeGeometry.prototype = Object.create( THREE.Geometry.prototype );\n\n\n /*********************************************\n  *\n  * Parametric Replacement for TorusKnotGeometry\n  *\n  *********************************************/\nTHREE.ParametricGeometries.TorusKnotGeometry = function ( radius, tube, segmentsR, segmentsT, p, q, heightScale ) {\n\n\tvar scope = this;\n\n\tthis.radius = radius || 200;\n\tthis.tube = tube || 40;\n\tthis.segmentsR = segmentsR || 64;\n\tthis.segmentsT = segmentsT || 8;\n\tthis.p = p || 2;\n\tthis.q = q || 3;\n\tthis.heightScale = heightScale || 1;\n\n\n\tvar TorusKnotCurve = THREE.Curve.create(\n\n\t\tfunction() {\n\t\t},\n\n\t\tfunction(t) {\n\n\t\t\tt *= Math.PI * 2;\n\n\t\t\tvar r = 0.5;\n\n\t\t\tvar tx = (1 + r * Math.cos(q * t)) * Math.cos(p * t),\n\t\t\t\tty = (1 + r * Math.cos(q * t)) * Math.sin(p * t),\n\t\t\t\ttz = r * Math.sin(q * t);\n\n\t\t\treturn new THREE.Vector3(tx, ty * heightScale, tz).multiplyScalar(radius);\n\n\t\t}\n\n\t);\n\tvar segments = segmentsR;\n\tvar radiusSegments = segmentsT;\n\tvar extrudePath = new TorusKnotCurve();\n\n\tTHREE.ParametricGeometries.TubeGeometry.call( this, extrudePath, segments, tube, radiusSegments, true, false );\n\n\n};\n\nTHREE.ParametricGeometries.TorusKnotGeometry.prototype = Object.create( THREE.Geometry.prototype );\n\n\n /*********************************************\n  *\n  * Parametric Replacement for SphereGeometry\n  *\n  *********************************************/\nTHREE.ParametricGeometries.SphereGeometry = function(size, u, v) {\n\n\tfunction sphere(u, v) {\n\t\tu *= Math.PI;\n\t\tv *= 2 * Math.PI;\n\n\t\tvar x = size * Math.sin(u) * Math.cos(v);\n\t\tvar y = size * Math.sin(u) * Math.sin(v);\n\t\tvar z = size * Math.cos(u);\n\n\n\t\treturn new THREE.Vector3(x, y, z);\n\t}\n\n\tTHREE.ParametricGeometry.call(this, sphere, u, v, !true);\n\n};\n\nTHREE.ParametricGeometries.SphereGeometry.prototype = Object.create( THREE.Geometry.prototype );\n\n\n /*********************************************\n  *\n  * Parametric Replacement for PlaneGeometry\n  *\n  *********************************************/\n\nTHREE.ParametricGeometries.PlaneGeometry = function(width, depth, segmentsWidth, segmentsDepth) {\n\n\tfunction plane(u, v) {\n\n\t\tvar x = u * width;\n\t\tvar y = 0;\n\t\tvar z = v * depth;\n\n\t\treturn new THREE.Vector3(x, y, z);\n\t}\n\n\tTHREE.ParametricGeometry.call(this, plane, segmentsWidth, segmentsDepth);\n\n};\n\nTHREE.ParametricGeometries.PlaneGeometry.prototype = Object.create( THREE.Geometry.prototype );\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Ocean.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Ocean.js",
            "module-type": "library",
            "text": "THREE.Ocean = function (renderer, camera, scene, options) {\n\t// flag used to trigger parameter changes\n\tthis.changed = true;\n\tthis.initial = true;\n\t\n\t// Assign required parameters as object properties\n\tthis.oceanCamera = new THREE.OrthographicCamera(); //camera.clone();\n\tthis.oceanCamera.position.z = 1;\n\tthis.renderer = renderer;\n\tthis.renderer.clearColor( 0xffffff );\n\t\n\tthis.scene = new THREE.Scene();\n\t\n\t// Enable necessary extensions\n\tthis.renderer.context.getExtension('OES_texture_float');\n\tthis.renderer.context.getExtension('OES_texture_float_linear');\n\t\n\t// Assign optional parameters as variables and object properties\n\tfunction optionalParameter(value, defaultValue) {\n\t\treturn value !== undefined ? value : defaultValue;\n\t};\n\toptions = options || {};\n\tthis.clearColor = optionalParameter(options.CLEAR_COLOR, [1.0, 1.0, 1.0, 0.0]);\n\tthis.geometryOrigin = optionalParameter(options.GEOMETRY_ORIGIN, [-1000.0, -1000.0]);\n\tthis.sunDirectionX = optionalParameter(options.SUN_DIRECTION[0], -1.0);\n\tthis.sunDirectionY = optionalParameter(options.SUN_DIRECTION[1], 1.0);\n\tthis.sunDirectionZ = optionalParameter(options.SUN_DIRECTION[2], 1.0);\n\tthis.oceanColor = optionalParameter(options.OCEAN_COLOR, new THREE.Vector3(0.004, 0.016, 0.047));\n\tthis.skyColor = optionalParameter(options.SKY_COLOR, new THREE.Vector3(3.2, 9.6, 12.8));\n\tthis.exposure = optionalParameter(options.EXPOSURE, 0.35);\n\tthis.geometryResolution = optionalParameter(options.GEOMETRY_RESOLUTION, 32);\n\tthis.geometrySize = optionalParameter(options.GEOMETRY_SIZE, 2000);\n\tthis.resolution = optionalParameter(options.RESOLUTION, 64);\n\tthis.floatSize = optionalParameter(options.SIZE_OF_FLOAT, 4);\n\tthis.windX = optionalParameter(options.INITIAL_WIND[0], 10.0),\n\tthis.windY = optionalParameter(options.INITIAL_WIND[1], 10.0),\n\tthis.size = optionalParameter(options.INITIAL_SIZE, 250.0),\n\tthis.choppiness = optionalParameter(options.INITIAL_CHOPPINESS, 1.5);\n\t\n\t// \n\tthis.matrixNeedsUpdate = false;\n\t\n\t// Setup framebuffer pipeline\n\tvar LinearClampParams = {\n\t\tminFilter: THREE.LinearFilter,\n\t\tmagFilter: THREE.LinearFilter,\n\t\twrapS: THREE.ClampToEdgeWrapping,\n\t\twrapT: THREE.ClampToEdgeWrapping,\n\t\tformat: THREE.RGBAFormat,\n\t\tstencilBuffer: false,\n\t\tdepthBuffer: false,\n\t\tpremultiplyAlpha: false,\n\t\ttype: THREE.FloatType\n\t};\n\tvar NearestClampParams = {\n\t\tminFilter: THREE.NearestFilter,\n\t\tmagFilter: THREE.NearestFilter,\n\t\twrapS: THREE.ClampToEdgeWrapping,\n\t\twrapT: THREE.ClampToEdgeWrapping,\n\t\tformat: THREE.RGBAFormat,\n\t\tstencilBuffer: false,\n\t\tdepthBuffer: false,\n\t\tpremultiplyAlpha:false,\n\t\ttype: THREE.FloatType\n\t};\n\tvar NearestRepeatParams = {\n\t\tminFilter: THREE.NearestFilter,\n\t\tmagFilter: THREE.NearestFilter,\n\t\twrapS: THREE.RepeatWrapping,\n\t\twrapT: THREE.RepeatWrapping,\n\t\tformat: THREE.RGBAFormat,\n\t\tstencilBuffer: false,\n\t\tdepthBuffer: false,\n\t\tpremultiplyAlpha: false,\n\t\ttype: THREE.FloatType\n\t};\n\tthis.initialSpectrumFramebuffer = new THREE.WebGLRenderTarget(this.resolution, this.resolution, NearestRepeatParams);\n\tthis.spectrumFramebuffer = new THREE.WebGLRenderTarget(this.resolution, this.resolution, NearestClampParams);\n\tthis.pingPhaseFramebuffer = new THREE.WebGLRenderTarget(this.resolution, this.resolution, NearestClampParams);\n\tthis.pongPhaseFramebuffer = new THREE.WebGLRenderTarget(this.resolution, this.resolution, NearestClampParams);\n\tthis.pingTransformFramebuffer = new THREE.WebGLRenderTarget(this.resolution, this.resolution, NearestClampParams);\n\tthis.pongTransformFramebuffer = new THREE.WebGLRenderTarget(this.resolution, this.resolution, NearestClampParams);\n\tthis.displacementMapFramebuffer = new THREE.WebGLRenderTarget(this.resolution, this.resolution, LinearClampParams);\n\tthis.normalMapFramebuffer = new THREE.WebGLRenderTarget(this.resolution, this.resolution, LinearClampParams);\n\t\n\t// Define shaders and constant uniforms\n\t////////////////////////////////////////\n\t\n\t// 0 - The vertex shader used in all of the simulation steps\n\tvar fullscreeenVertexShader = THREE.ShaderLib[\"ocean_sim_vertex\"];\n\t\t\n\t// 1 - Horizontal wave vertices used for FFT\n\tvar oceanHorizontalShader = THREE.ShaderLib[\"ocean_subtransform\"];\n\tvar oceanHorizontalUniforms = THREE.UniformsUtils.clone(oceanHorizontalShader.uniforms);\n\tthis.materialOceanHorizontal = new THREE.ShaderMaterial({\n\t\tuniforms: oceanHorizontalUniforms,\n\t\tvertexShader: fullscreeenVertexShader.vertexShader,\n\t\tfragmentShader: \"#define HORIZONTAL \\n\" + oceanHorizontalShader.fragmentShader\n\t});\n\tthis.materialOceanHorizontal.uniforms.u_transformSize = { type: \"f\", value: this.resolution };\n\tthis.materialOceanHorizontal.uniforms.u_subtransformSize = { type: \"f\", value: null };\n\tthis.materialOceanHorizontal.uniforms.u_input = { type: \"t\", value: null };\n\tthis.materialOceanHorizontal.depthTest = false;\n\t\n\t// 2 - Vertical wave vertices used for FFT\n\tvar oceanVerticalShader = THREE.ShaderLib[\"ocean_subtransform\"];\n\tvar oceanVerticalUniforms = THREE.UniformsUtils.clone(oceanVerticalShader.uniforms);\n\tthis.materialOceanVertical = new THREE.ShaderMaterial({\n\t\tuniforms: oceanVerticalUniforms,\n\t\tvertexShader: fullscreeenVertexShader.vertexShader,\n\t\tfragmentShader: oceanVerticalShader.fragmentShader\n\t});\n\tthis.materialOceanVertical.uniforms.u_transformSize = { type: \"f\", value: this.resolution };\n\tthis.materialOceanVertical.uniforms.u_subtransformSize = { type: \"f\", value: null };\n\tthis.materialOceanVertical.uniforms.u_input = { type: \"t\", value: null };\n\tthis.materialOceanVertical.depthTest = false;\n\t\n\t// 3 - Initial spectrum used to generate height map\n\tvar initialSpectrumShader = THREE.ShaderLib[\"ocean_initial_spectrum\"];\n\tvar initialSpectrumUniforms = THREE.UniformsUtils.clone(initialSpectrumShader.uniforms);\n\tthis.materialInitialSpectrum = new THREE.ShaderMaterial({\n\t\tuniforms: initialSpectrumUniforms,\n\t\tvertexShader: fullscreeenVertexShader.vertexShader,\n\t\tfragmentShader:initialSpectrumShader.fragmentShader\n\t});\n\tthis.materialInitialSpectrum.uniforms.u_wind = { type: \"v2\", value: new THREE.Vector2() };\n\tthis.materialInitialSpectrum.uniforms.u_resolution = { type: \"f\", value: this.resolution };\n\tthis.materialInitialSpectrum.depthTest = false;\n\t\n\t// 4 - Phases used to animate heightmap\n\tvar phaseShader = THREE.ShaderLib[\"ocean_phase\"];\n\tvar phaseUniforms = THREE.UniformsUtils.clone(phaseShader.uniforms);\n\tthis.materialPhase = new THREE.ShaderMaterial({\n\t\tuniforms: phaseUniforms,\n\t\tvertexShader: fullscreeenVertexShader.vertexShader,\n\t\tfragmentShader: phaseShader.fragmentShader\n\t});\n\tthis.materialPhase.uniforms.u_resolution = { type: \"f\", value: this.resolution };\n\tthis.materialPhase.depthTest = false;\n\t\n\t// 5 - Shader used to update spectrum\n\tvar spectrumShader = THREE.ShaderLib[\"ocean_spectrum\"];\n\tvar spectrumUniforms = THREE.UniformsUtils.clone(spectrumShader.uniforms);\n\tthis.materialSpectrum = new THREE.ShaderMaterial({\n\t\tuniforms: spectrumUniforms,\n\t\tvertexShader: fullscreeenVertexShader.vertexShader,\n\t\tfragmentShader: spectrumShader.fragmentShader\n\t});\n\tthis.materialSpectrum.uniforms.u_initialSpectrum = { type: \"t\", value: null };\n\tthis.materialSpectrum.uniforms.u_resolution = { type: \"f\", value: this.resolution };\n\tthis.materialSpectrum.depthTest = false;\n\n\t// 6 - Shader used to update spectrum normals\n\tvar normalShader = THREE.ShaderLib[\"ocean_normals\"];\n\tvar normalUniforms = THREE.UniformsUtils.clone(normalShader.uniforms);\n\tthis.materialNormal = new THREE.ShaderMaterial({\n\t\tuniforms: normalUniforms,\n\t\tvertexShader: fullscreeenVertexShader.vertexShader,\n\t\tfragmentShader: normalShader.fragmentShader\n\t});\n\tthis.materialNormal.uniforms.u_displacementMap = { type: \"t\", value: null };\n\tthis.materialNormal.uniforms.u_resolution = { type: \"f\", value: this.resolution };\n\tthis.materialNormal.depthTest = false;\n\n\t// 7 - Shader used to update normals\n\tvar oceanShader = THREE.ShaderLib[\"ocean_main\"];\n\tvar oceanUniforms = THREE.UniformsUtils.clone(oceanShader.uniforms);\n\tvar oceanAttributes = THREE.UniformsUtils.clone(oceanShader.attributes);\n\tthis.materialOcean = new THREE.ShaderMaterial({\n\t\tattributes: oceanAttributes,\n\t\tuniforms: oceanUniforms,\n\t\tvertexShader: oceanShader.vertexShader,\n\t\tfragmentShader: oceanShader.fragmentShader\n\t});\n\t// this.materialOcean.wireframe = true;\n\tthis.materialOcean.uniforms.u_geometrySize = { type: \"f\", value: this.resolution };\n\tthis.materialOcean.uniforms.u_displacementMap = { type: \"t\", value: this.displacementMapFramebuffer };\n\tthis.materialOcean.uniforms.u_normalMap = { type: \"t\", value: this.normalMapFramebuffer }; \n\tthis.materialOcean.uniforms.u_oceanColor = { type: \"v3\", value: this.oceanColor }; \n\tthis.materialOcean.uniforms.u_skyColor = { type: \"v3\", value: this.skyColor };\n\tthis.materialOcean.uniforms.u_sunDirection = { type: \"v3\", value: new THREE.Vector3( this.sunDirectionX, this.sunDirectionY, this.sunDirectionZ ) };\n\tthis.materialOcean.uniforms.u_exposure = { type: \"f\", value: this.exposure };\n\n\t// Disable blending to prevent default premultiplied alpha values\n\tthis.materialOceanHorizontal.blending = 0;\n\tthis.materialOceanVertical.blending = 0;\n\tthis.materialInitialSpectrum.blending = 0;\n\tthis.materialPhase.blending = 0;\n\tthis.materialSpectrum.blending = 0;\n\tthis.materialNormal.blending = 0;\n\tthis.materialOcean.blending = 0;\n\n\t// Create the simulation plane\n\tthis.screenQuad = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ) );\n\tthis.scene.add(this.screenQuad);\n\n\t// Initialise spectrum data\n\tthis.generateSeedPhaseTexture();\n\n\t// Generate the ocean mesh\n\tthis.generateMesh();\n};\n\nTHREE.Ocean.prototype.generateMesh = function () {\n\n\tvar geometry = new THREE.PlaneGeometry( this.geometrySize, this.geometrySize, this.geometryResolution, this.geometryResolution );\n\n\tgeometry.applyMatrix( new THREE.Matrix4().makeRotationX( - Math.PI / 2 ) );\n\n\tthis.oceanMesh = new THREE.Mesh( geometry, this.materialOcean );\n};\n\nTHREE.Ocean.prototype.render = function () {\n\tthis.scene.overrideMaterial = null;\n\t\n\tif (this.changed)\n\t\tthis.renderInitialSpectrum();\n\t\n\tthis.renderWavePhase();\n\tthis.renderSpectrum();\n\tthis.renderSpectrumFFT();\n\tthis.renderNormalMap();\n\tthis.scene.overrideMaterial = null;\n};\n\nTHREE.Ocean.prototype.generateSeedPhaseTexture = function() {\n\t// Setup the seed texture\n\tthis.pingPhase = true;\n\tvar phaseArray = new window.Float32Array(this.resolution * this.resolution * 4);\n\tfor (var i = 0; i < this.resolution; i++) {\n\t\tfor (var j = 0; j < this.resolution; j++) {\n\t\t\tphaseArray[i * this.resolution * 4 + j * 4] =  Math.random() * 2.0 * Math.PI;\n\t\t\tphaseArray[i * this.resolution * 4 + j * 4 + 1] = 0.0;\n\t\t\tphaseArray[i * this.resolution * 4 + j * 4 + 2] = 0.0;\n\t\t\tphaseArray[i * this.resolution * 4 + j * 4 + 3] = 0.0;\n\t\t}\n\t}\n\t\n\tthis.pingPhaseTexture = new THREE.DataTexture(phaseArray, this.resolution, this.resolution, THREE.RGBAFormat);\n\tthis.pingPhaseTexture.minFilter = THREE.NearestFilter;\n\tthis.pingPhaseTexture.magFilter = THREE.NearestFilter;\n\tthis.pingPhaseTexture.wrapS = THREE.ClampToEdgeWrapping;\n\tthis.pingPhaseTexture.wrapT = THREE.ClampToEdgeWrapping;\n\tthis.pingPhaseTexture.type = THREE.FloatType;\n\tthis.pingPhaseTexture.needsUpdate = true;\n};\n\nTHREE.Ocean.prototype.renderInitialSpectrum = function () {\n\tthis.scene.overrideMaterial = this.materialInitialSpectrum;\n\tthis.materialInitialSpectrum.uniforms.u_wind.value.set( this.windX, this.windY );\n\tthis.materialInitialSpectrum.uniforms.u_size.value = this.size;\n\tthis.renderer.render(this.scene, this.oceanCamera, this.initialSpectrumFramebuffer, true);\n};\n\nTHREE.Ocean.prototype.renderWavePhase = function () {\n\tthis.scene.overrideMaterial = this.materialPhase;\n\tthis.screenQuad.material = this.materialPhase;\n\tif (this.initial) {\n\t\tthis.materialPhase.uniforms.u_phases.value = this.pingPhaseTexture;\n\t\tthis.initial = false;\n\t}else {\n\t\tthis.materialPhase.uniforms.u_phases.value = this.pingPhase ? this.pingPhaseFramebuffer  : this.pongPhaseFramebuffer;\n\t}\n\tthis.materialPhase.uniforms.u_deltaTime.value = this.deltaTime;\n\tthis.materialPhase.uniforms.u_size.value = this.size;\n\tthis.renderer.render(this.scene, this.oceanCamera, this.pingPhase ? this.pongPhaseFramebuffer : this.pingPhaseFramebuffer);\n\tthis.pingPhase = !this.pingPhase;\n};\n\nTHREE.Ocean.prototype.renderSpectrum = function () {\n\tthis.scene.overrideMaterial = this.materialSpectrum;\n\tthis.materialSpectrum.uniforms.u_initialSpectrum.value = this.initialSpectrumFramebuffer;\n\tthis.materialSpectrum.uniforms.u_phases.value = this.pingPhase ? this.pingPhaseFramebuffer : this.pongPhaseFramebuffer;\n\tthis.materialSpectrum.uniforms.u_choppiness.value = this.choppiness ;\n\tthis.materialSpectrum.uniforms.u_size.value = this.size ;\n\tthis.renderer.render(this.scene, this.oceanCamera, this.spectrumFramebuffer);\n};\n\nTHREE.Ocean.prototype.renderSpectrumFFT = function() {\n\t// GPU FFT using Stockham formulation\n\tvar iterations = Math.log( this.resolution ) / Math.log(2); // log2\n\t\n\tthis.scene.overrideMaterial = this.materialOceanHorizontal;\n\n\tfor (var i = 0; i < iterations; i++) {\n\t\tif (i === 0) {\n\t\t\tthis.materialOceanHorizontal.uniforms.u_input.value = this.spectrumFramebuffer;\n\t\t\tthis.materialOceanHorizontal.uniforms.u_subtransformSize.value = Math.pow(2, (i % (iterations)) + 1);\n\t\t\tthis.renderer.render(this.scene, this.oceanCamera, this.pingTransformFramebuffer);\n\t\t} \n\t\telse if (i % 2 === 1) {\n\t\t\tthis.materialOceanHorizontal.uniforms.u_input.value = this.pingTransformFramebuffer;\n\t\t\tthis.materialOceanHorizontal.uniforms.u_subtransformSize.value = Math.pow(2, (i % (iterations)) + 1);\n\t\t\tthis.renderer.render(this.scene, this.oceanCamera, this.pongTransformFramebuffer);\n\t\t}\n\t\telse {\n\t\t\tthis.materialOceanHorizontal.uniforms.u_input.value = this.pongTransformFramebuffer;\n\t\t\tthis.materialOceanHorizontal.uniforms.u_subtransformSize.value = Math.pow(2, (i % (iterations)) + 1);\n\t\t\tthis.renderer.render(this.scene, this.oceanCamera, this.pingTransformFramebuffer);\n\t\t}\n\t}\n\tthis.scene.overrideMaterial = this.materialOceanVertical;\n\tfor (var i = iterations; i < iterations*2; i++) {\n\t\tif (i === iterations * 2 - 1) {\n\t\t\tthis.materialOceanVertical.uniforms.u_input.value = (iterations % 2 === 0) ? this.pingTransformFramebuffer : this.pongTransformFramebuffer;\n\t\t\tthis.materialOceanVertical.uniforms.u_subtransformSize.value = Math.pow(2, (i % (iterations)) + 1);\n\t\t\tthis.renderer.render(this.scene, this.oceanCamera, this.displacementMapFramebuffer);\n\t\t}\n\t\telse if (i % 2 === 1) {\n\t\t\tthis.materialOceanVertical.uniforms.u_input.value = this.pingTransformFramebuffer;\n\t\t\tthis.materialOceanVertical.uniforms.u_subtransformSize.value = Math.pow(2, (i % (iterations)) + 1);\n\t\t\tthis.renderer.render(this.scene, this.oceanCamera, this.pongTransformFramebuffer);\n\t\t}\n\t\telse {\n\t\t\tthis.materialOceanVertical.uniforms.u_input.value = this.pongTransformFramebuffer;\n\t\t\tthis.materialOceanVertical.uniforms.u_subtransformSize.value = Math.pow(2, (i % (iterations)) + 1);\n\t\t\tthis.renderer.render(this.scene, this.oceanCamera, this.pingTransformFramebuffer);\n\t\t}\n\t}\n};\n\nTHREE.Ocean.prototype.renderNormalMap = function () {\n\tthis.scene.overrideMaterial = this.materialNormal;\n\tif (this.changed) this.materialNormal.uniforms.u_size.value = this.size;\n\tthis.materialNormal.uniforms.u_displacementMap.value = this.displacementMapFramebuffer;\n\tthis.renderer.render(this.scene, this.oceanCamera, this.normalMapFramebuffer, true);\n};"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/BlendShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/BlendShader.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Blend two textures\n */\n\nTHREE.BlendShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse1\": { type: \"t\", value: null },\n\t\t\"tDiffuse2\": { type: \"t\", value: null },\n\t\t\"mixRatio\":  { type: \"f\", value: 0.5 },\n\t\t\"opacity\":   { type: \"f\", value: 1.0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform float opacity;\",\n\t\t\"uniform float mixRatio;\",\n\n\t\t\"uniform sampler2D tDiffuse1;\",\n\t\t\"uniform sampler2D tDiffuse2;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 texel1 = texture2D( tDiffuse1, vUv );\",\n\t\t\t\"vec4 texel2 = texture2D( tDiffuse2, vUv );\",\n\t\t\t\"gl_FragColor = opacity * mix( texel1, texel2, mixRatio );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/RGBShiftShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/RGBShiftShader.js",
            "module-type": "library",
            "text": "/**\n * @author felixturner / http://airtight.cc/\n *\n * RGB Shift Shader\n * Shifts red and blue channels from center in opposite directions\n * Ported from http://kriss.cx/tom/2009/05/rgb-shift/\n * by Tom Butterworth / http://kriss.cx/tom/\n *\n * amount: shift distance (1 is width of input)\n * angle: shift angle in radians\n */\n\nTHREE.RGBShiftShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"amount\":   { type: \"f\", value: 0.005 },\n\t\t\"angle\":    { type: \"f\", value: 0.0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"uniform float amount;\",\n\t\t\"uniform float angle;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec2 offset = amount * vec2( cos(angle), sin(angle));\",\n\t\t\t\"vec4 cr = texture2D(tDiffuse, vUv + offset);\",\n\t\t\t\"vec4 cga = texture2D(tDiffuse, vUv);\",\n\t\t\t\"vec4 cb = texture2D(tDiffuse, vUv - offset);\",\n\t\t\t\"gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/OceanShaders.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/OceanShaders.js",
            "module-type": "library",
            "text": "// Author: Aleksandr Albert\n// Website: www.routter.co.tt\n\n// Description: A deep water ocean shader set\n// based on an implementation of a Tessendorf Waves\n// originally presented by David Li ( www.david.li/waves )\n\n// The general method is to apply shaders to simulation Framebuffers\n// and then sample these framebuffers when rendering the ocean mesh\n\n// The set uses 7 shaders:\n\n// -- Simulation shaders\n// [1] ocean_sim_vertex         -> Vertex shader used to set up a 2x2 simulation plane centered at (0,0)\n// [2] ocean_subtransform       -> Fragment shader used to subtransform the mesh (generates the displacement map)\n// [3] ocean_initial_spectrum   -> Fragment shader used to set intitial wave frequency at a texel coordinate\n// [4] ocean_phase              -> Fragment shader used to set wave phase at a texel coordinate\n// [5] ocean_spectrum           -> Fragment shader used to set current wave frequency at a texel coordinate\n// [6] ocean_normal             -> Fragment shader used to set face normals at a texel coordinate\n\n// -- Rendering Shader\n// [7] ocean_main               -> Vertex and Fragment shader used to create the final render\n\n\nTHREE.ShaderLib['ocean_sim_vertex'] = {\n\tvarying: {\n\t\t\"vUV\": { type: \"v2\" }\n\t},\n\tvertexShader: [\n\t\t'varying vec2 vUV;',\n\n\t\t'void main (void) {',\n\t\t\t'vUV = position.xy * 0.5 + 0.5;',\n\t\t\t'gl_Position = vec4(position, 1.0 );',\n\t\t'}'\n\t].join('\\n')\n};\nTHREE.ShaderLib['ocean_subtransform'] = {\n\tuniforms: {\n\t\t\"u_input\": { type: \"t\", value: null },\n\t\t\"u_transformSize\": { type: \"f\", value: 512.0 },\n\t\t\"u_subtransformSize\": { type: \"f\", value: 250.0 }\n\t},\n\tvarying: {\n\t\t\"vUV\": { type: \"v2\" }\n\t},\n\tfragmentShader: [\n\t\t//GPU FFT using a Stockham formulation\n\t\t'precision highp float;',\n\n\t\t'const float PI = 3.14159265359;',\n\n\t\t'uniform sampler2D u_input;',\n\t\t'uniform float u_transformSize;',\n\t\t'uniform float u_subtransformSize;',\n\n\t\t'varying vec2 vUV;',\n\t\t\n\t\t'vec2 multiplyComplex (vec2 a, vec2 b) {',\n\t\t\t'return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);',\n\t\t'}',\n\n\t\t'void main (void) {',\n\t\t\t'#ifdef HORIZONTAL',\n\t\t\t'float index = vUV.x * u_transformSize - 0.5;',\n\t\t\t'#else',\n\t\t\t'float index = vUV.y * u_transformSize - 0.5;',\n\t\t\t'#endif',\n\n\t\t\t'float evenIndex = floor(index / u_subtransformSize) * (u_subtransformSize * 0.5) + mod(index, u_subtransformSize * 0.5);',\n\n\t\t\t//transform two complex sequences simultaneously\n\t\t\t'#ifdef HORIZONTAL',\n\t\t\t'vec4 even = texture2D(u_input, vec2(evenIndex + 0.5, gl_FragCoord.y) / u_transformSize).rgba;',\n\t\t\t'vec4 odd = texture2D(u_input, vec2(evenIndex + u_transformSize * 0.5 + 0.5, gl_FragCoord.y) / u_transformSize).rgba;',\n\t\t\t'#else',\n\t\t\t'vec4 even = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + 0.5) / u_transformSize).rgba;',\n\t\t\t'vec4 odd = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + u_transformSize * 0.5 + 0.5) / u_transformSize).rgba;',\n\t\t\t'#endif',\n\n\t\t\t'float twiddleArgument = -2.0 * PI * (index / u_subtransformSize);',\n\t\t\t'vec2 twiddle = vec2(cos(twiddleArgument), sin(twiddleArgument));',\n\n\t\t\t'vec2 outputA = even.xy + multiplyComplex(twiddle, odd.xy);',\n\t\t\t'vec2 outputB = even.zw + multiplyComplex(twiddle, odd.zw);',\n\n\t\t\t'gl_FragColor = vec4(outputA, outputB);',\n\t\t'}'\n\t].join('\\n')\n};\nTHREE.ShaderLib['ocean_initial_spectrum'] = {\n\tuniforms: {\n\t\t\"u_wind\": { type: \"v2\", value: new THREE.Vector2(10.0, 10.0) },\n\t\t\"u_resolution\": { type: \"f\", value: 512.0 },\n\t\t\"u_size\": { type: \"f\", value: 250.0 },\n\t},\n\tfragmentShader: [\n\t\t'precision highp float;',\n\n\t\t'const float PI = 3.14159265359;',\n\t\t'const float G = 9.81;',\n\t\t'const float KM = 370.0;',\n\t\t'const float CM = 0.23;',\n\n\t\t'uniform vec2 u_wind;',\n\t\t'uniform float u_resolution;',\n\t\t'uniform float u_size;',\n\t\t\n\t\t'float square (float x) {',\n\t\t\t'return x * x;',\n\t\t'}',\n\n\t\t'float omega (float k) {',\n\t\t\t'return sqrt(G * k * (1.0 + square(k / KM)));',\n\t\t'}',\n\n\t\t'float tanh (float x) {',\n\t\t\t'return (1.0 - exp(-2.0 * x)) / (1.0 + exp(-2.0 * x));',\n\t\t'}',\n\n\t\t'void main (void) {',\n\t\t\t'vec2 coordinates = gl_FragCoord.xy - 0.5;',\n\t\t\t\n\t\t\t'float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;',\n\t\t\t'float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;',\n\t\t\t\n\t\t\t'vec2 K = (2.0 * PI * vec2(n, m)) / u_size;',\n\t\t\t'float k = length(K);',\n\t\t\t\n\t\t\t'float l_wind = length(u_wind);',\n\n\t\t\t'float Omega = 0.84;',\n\t\t\t'float kp = G * square(Omega / l_wind);',\n\n\t\t\t'float c = omega(k) / k;',\n\t\t\t'float cp = omega(kp) / kp;',\n\n\t\t\t'float Lpm = exp(-1.25 * square(kp / k));',\n\t\t\t'float gamma = 1.7;',\n\t\t\t'float sigma = 0.08 * (1.0 + 4.0 * pow(Omega, -3.0));',\n\t\t\t'float Gamma = exp(-square(sqrt(k / kp) - 1.0) / 2.0 * square(sigma));',\n\t\t\t'float Jp = pow(gamma, Gamma);',\n\t\t\t'float Fp = Lpm * Jp * exp(-Omega / sqrt(10.0) * (sqrt(k / kp) - 1.0));',\n\t\t\t'float alphap = 0.006 * sqrt(Omega);',\n\t\t\t'float Bl = 0.5 * alphap * cp / c * Fp;',\n\n\t\t\t'float z0 = 0.000037 * square(l_wind) / G * pow(l_wind / cp, 0.9);',\n\t\t\t'float uStar = 0.41 * l_wind / log(10.0 / z0);',\n\t\t\t'float alpham = 0.01 * ((uStar < CM) ? (1.0 + log(uStar / CM)) : (1.0 + 3.0 * log(uStar / CM)));',\n\t\t\t'float Fm = exp(-0.25 * square(k / KM - 1.0));',\n\t\t\t'float Bh = 0.5 * alpham * CM / c * Fm * Lpm;',\n\n\t\t\t'float a0 = log(2.0) / 4.0;',\n\t\t\t'float am = 0.13 * uStar / CM;',\n\t\t\t'float Delta = tanh(a0 + 4.0 * pow(c / cp, 2.5) + am * pow(CM / c, 2.5));',\n\n\t\t\t'float cosPhi = dot(normalize(u_wind), normalize(K));',\n\n\t\t\t'float S = (1.0 / (2.0 * PI)) * pow(k, -4.0) * (Bl + Bh) * (1.0 + Delta * (2.0 * cosPhi * cosPhi - 1.0));',\n\n\t\t\t'float dk = 2.0 * PI / u_size;',\n\t\t\t'float h = sqrt(S / 2.0) * dk;',\n\n\t\t\t'if (K.x == 0.0 && K.y == 0.0) {',\n\t\t\t\t'h = 0.0;', //no DC term\n\t\t\t'}',\n\t\t\t'gl_FragColor = vec4(h, 0.0, 0.0, 0.0);',\n\t\t'}'\n\t].join('\\n')\n};\nTHREE.ShaderLib['ocean_phase'] = {\n\tuniforms: {\n\t\t\"u_phases\": { type: \"t\", value: null },\n\t\t\"u_deltaTime\": { type: \"f\", value: null },\n\t\t\"u_resolution\": { type: \"f\", value: null },\n\t\t\"u_size\": { type: \"f\", value: null },\n\t},\n\tvarying: {\n\t\t\"vUV\": { type: \"v2\" }\n\t},\n\tfragmentShader: [\n\t\t'precision highp float;',\n\n\t\t'const float PI = 3.14159265359;',\n\t\t'const float G = 9.81;',\n\t\t'const float KM = 370.0;',\n\n\t\t'varying vec2 vUV;',\n\n\t\t'uniform sampler2D u_phases;',\n\t\t'uniform float u_deltaTime;',\n\t\t'uniform float u_resolution;',\n\t\t'uniform float u_size;',\n\n\t\t'float omega (float k) {',\n\t\t\t'return sqrt(G * k * (1.0 + k * k / KM * KM));',\n\t\t'}',\n\n\t\t'void main (void) {',\n\t\t\t'float deltaTime = 1.0 / 60.0;',\n\t\t\t'vec2 coordinates = gl_FragCoord.xy - 0.5;',\n\t\t\t'float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;',\n\t\t\t'float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;',\n\t\t\t'vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;',\n\n\t\t\t'float phase = texture2D(u_phases, vUV).r;',\n\t\t\t'float deltaPhase = omega(length(waveVector)) * u_deltaTime;',\n\t\t\t'phase = mod(phase + deltaPhase, 2.0 * PI);',\n\t\t\n\t\t\t'gl_FragColor = vec4(phase, 0.0, 0.0, 0.0);',\n\t\t'}'\n\t].join('\\n')\n};\nTHREE.ShaderLib['ocean_spectrum'] = {\n\tuniforms: {\n\t\t\"u_size\": { type: \"f\", value: null },\n\t\t\"u_resolution\": { type: \"f\", value: null },\n\t\t\"u_choppiness\": { type: \"f\", value: null },\n\t\t\"u_phases\": { type: \"t\", value: null },\n\t\t\"u_initialSpectrum\": { type: \"t\", value: null },\n\t},\n\tvarying: {\n\t\t\"vUV\": { type: \"v2\" }\n\t},\n\tfragmentShader: [\n\t\t'precision highp float;',\n\n\t\t'const float PI = 3.14159265359;',\n\t\t'const float G = 9.81;',\n\t\t'const float KM = 370.0;',\n\n\t\t'varying vec2 vUV;',\n\n\t\t'uniform float u_size;',\n\t\t'uniform float u_resolution;',\n\t\t'uniform float u_choppiness;',\n\t\t'uniform sampler2D u_phases;',\n\t\t'uniform sampler2D u_initialSpectrum;',\n\n\t\t'vec2 multiplyComplex (vec2 a, vec2 b) {',\n\t\t\t'return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);',\n\t\t'}',\n\n\t\t'vec2 multiplyByI (vec2 z) {',\n\t\t\t'return vec2(-z[1], z[0]);',\n\t\t'}',\n\n\t\t'float omega (float k) {',\n\t\t\t'return sqrt(G * k * (1.0 + k * k / KM * KM));',\n\t\t'}',\n\n\t\t'void main (void) {',\n\t\t\t'vec2 coordinates = gl_FragCoord.xy - 0.5;',\n\t\t\t'float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;',\n\t\t\t'float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;',\n\t\t\t'vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;',\n\n\t\t\t'float phase = texture2D(u_phases, vUV).r;',\n\t\t\t'vec2 phaseVector = vec2(cos(phase), sin(phase));',\n\n\t\t\t'vec2 h0 = texture2D(u_initialSpectrum, vUV).rg;',\n\t\t\t'vec2 h0Star = texture2D(u_initialSpectrum, vec2(1.0 - vUV + 1.0 / u_resolution)).rg;',\n\t\t\t'h0Star.y *= -1.0;',\n\n\t\t\t'vec2 h = multiplyComplex(h0, phaseVector) + multiplyComplex(h0Star, vec2(phaseVector.x, -phaseVector.y));',\n\n\t\t\t'vec2 hX = -multiplyByI(h * (waveVector.x / length(waveVector))) * u_choppiness;',\n\t\t\t'vec2 hZ = -multiplyByI(h * (waveVector.y / length(waveVector))) * u_choppiness;',\n\n\t\t\t//no DC term\n\t\t\t'if (waveVector.x == 0.0 && waveVector.y == 0.0) {',\n\t\t\t\t'h = vec2(0.0);',\n\t\t\t\t'hX = vec2(0.0);',\n\t\t\t\t'hZ = vec2(0.0);',\n\t\t\t'}',\n\t\t\n\t\t\t'gl_FragColor = vec4(hX + multiplyByI(h), hZ);',\n\t\t'}'\n\t].join('\\n')\n};\nTHREE.ShaderLib['ocean_normals'] = {\n\tuniforms: {\n\t\t\"u_displacementMap\": { type: \"t\", value: null },\n\t\t\"u_resolution\": { type: \"f\", value: null },\n\t\t\"u_size\": { type: \"f\", value: null },\n\t},\n\tvarying: {\n\t\t\"vUV\": { type: \"v2\" }\n\t},\n\tfragmentShader: [\n\t\t'precision highp float;',\n\n\t\t'varying vec2 vUV;',\n\t\t\n\t\t'uniform sampler2D u_displacementMap;',\n\t\t'uniform float u_resolution;',\n\t\t'uniform float u_size;',\n\n\t\t'void main (void) {',\n\t\t\t'float texel = 1.0 / u_resolution;',\n\t\t\t'float texelSize = u_size / u_resolution;',\n\n\t\t\t'vec3 center = texture2D(u_displacementMap, vUV).rgb;',\n\t\t\t'vec3 right = vec3(texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(texel, 0.0)).rgb - center;',\n\t\t\t'vec3 left = vec3(-texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(-texel, 0.0)).rgb - center;',\n\t\t\t'vec3 top = vec3(0.0, 0.0, -texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, -texel)).rgb - center;',\n\t\t\t'vec3 bottom = vec3(0.0, 0.0, texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, texel)).rgb - center;',\n\n\t\t\t'vec3 topRight = cross(right, top);',\n\t\t\t'vec3 topLeft = cross(top, left);',\n\t\t\t'vec3 bottomLeft = cross(left, bottom);',\n\t\t\t'vec3 bottomRight = cross(bottom, right);',\n\t\t\n\t\t\t'gl_FragColor = vec4(normalize(topRight + topLeft + bottomLeft + bottomRight), 1.0);',\n\t\t'}'\n\t].join('\\n')\n};\nTHREE.ShaderLib['ocean_main'] = {\n\tuniforms: {\n\t\t\"u_displacementMap\": { type: \"t\", value: null },\n\t\t\"u_normalMap\": { type: \"t\", value: null },\n\t\t\"u_geometrySize\": { type: \"f\", value: null },\n\t\t\"u_size\": { type: \"f\", value: null },\n\t\t\"u_projectionMatrix\": { type: \"m4\", value: null },\n\t\t\"u_viewMatrix\": { type: \"m4\", value: null },\n\t\t\"u_cameraPosition\": { type: \"v3\", value: null },\n\t\t\"u_skyColor\": { type: \"v3\", value: null },\n\t\t\"u_oceanColor\": { type: \"v3\", value: null },\n\t\t\"u_sunDirection\": { type: \"v3\", value: null },\n\t\t\"u_exposure\": { type: \"f\", value: null },\n\t},\n\tvarying: {\n\t\t\"vPos\": { type: \"v3\" },\n\t\t\"vUV\": { type: \"v2\" }\n\t},\n\tvertexShader: [\n\t\t'precision highp float;',\n\t\t\n\t\t'varying vec3 vPos;',\n\t\t'varying vec2 vUV;',\n\n\t\t'uniform mat4 u_projectionMatrix;',\n\t\t'uniform mat4 u_viewMatrix;',\n\t\t'uniform float u_size;',\n\t\t'uniform float u_geometrySize;',\n\t\t'uniform sampler2D u_displacementMap;',\n\n\t\t'void main (void) {',\n\t\t\t'vec3 newPos = position + texture2D(u_displacementMap, uv).rgb * (u_geometrySize / u_size);',\n\t\t\t'vPos = newPos;',\n\t\t\t'vUV = uv;',\n\t\t\t'gl_Position = u_projectionMatrix * u_viewMatrix * vec4(newPos, 1.0);',\n\t\t'}'\n\t].join('\\n'),\n\tfragmentShader: [\n\t\t'precision highp float;',\n\n\t\t'varying vec3 vPos;',\n\t\t'varying vec2 vUV;',\n\n\t\t'uniform sampler2D u_displacementMap;',\n\t\t'uniform sampler2D u_normalMap;',\n\t\t'uniform vec3 u_cameraPosition;',\n\t\t'uniform vec3 u_oceanColor;',\n\t\t'uniform vec3 u_skyColor;',\n\t\t'uniform vec3 u_sunDirection;',\n\t\t'uniform float u_exposure;',\n\n\t\t'vec3 hdr (vec3 color, float exposure) {',\n\t\t\t'return 1.0 - exp(-color * exposure);',\n\t\t'}',\n\n\t\t'void main (void) {',\n\t\t\t'vec3 normal = texture2D(u_normalMap, vUV).rgb;',\n\n\t\t\t'vec3 view = normalize(u_cameraPosition - vPos);',\n\t\t\t'float fresnel = 0.02 + 0.98 * pow(1.0 - dot(normal, view), 5.0);',\n\t\t\t'vec3 sky = fresnel * u_skyColor;',\n\n\t\t\t'float diffuse = clamp(dot(normal, normalize(u_sunDirection)), 0.0, 1.0);',\n\t\t\t'vec3 water = (1.0 - fresnel) * u_oceanColor * u_skyColor * diffuse;',\n\n\t\t\t'vec3 color = sky + water;',\n\n\t\t\t'gl_FragColor = vec4(hdr(color, u_exposure), 1.0);',\n\t\t'}'\n\t].join('\\n')\n};"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/BokehShader2.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/BokehShader2.js",
            "module-type": "library",
            "text": "/**\n * @author zz85 / https://github.com/zz85 | twitter.com/blurspline\n *\n * Depth-of-field shader with bokeh\n * ported from GLSL shader by Martins Upitis\n * http://blenderartists.org/forum/showthread.php?237488-GLSL-depth-of-field-with-bokeh-v2-4-(update)\n *\n * Requires #define RINGS and SAMPLES integers\n */\n\n\n\nTHREE.BokehShader = {\n\n\tuniforms: {\n\n\t\t\"textureWidth\":  { type: \"f\", value: 1.0 },\n\t\t\"textureHeight\":  { type: \"f\", value: 1.0 },\n\n\t\t\"focalDepth\":   { type: \"f\", value: 1.0 },\n\t\t\"focalLength\":   { type: \"f\", value: 24.0 },\n\t\t\"fstop\": { type: \"f\", value: 0.9 },\n\n\t\t\"tColor\":   { type: \"t\", value: null },\n\t\t\"tDepth\":   { type: \"t\", value: null },\n\n\t\t\"maxblur\":  { type: \"f\", value: 1.0 },\n\n\t\t\"showFocus\":   { type: \"i\", value: 0 },\n\t\t\"manualdof\":   { type: \"i\", value: 0 },\n\t\t\"vignetting\":   { type: \"i\", value: 0 },\n\t\t\"depthblur\":   { type: \"i\", value: 0 },\n\n\t\t\"threshold\":  { type: \"f\", value: 0.5 },\n\t\t\"gain\":  { type: \"f\", value: 2.0 },\n\t\t\"bias\":  { type: \"f\", value: 0.5 },\n\t\t\"fringe\":  { type: \"f\", value: 0.7 },\n\n\t\t\"znear\":  { type: \"f\", value: 0.1 },\n\t\t\"zfar\":  { type: \"f\", value: 100 },\n\n\t\t\"noise\":  { type: \"i\", value: 1 },\n\t\t\"dithering\":  { type: \"f\", value: 0.0001 },\n\t\t\"pentagon\": { type: \"i\", value: 0 },\n\n\t\t\"shaderFocus\":  { type: \"i\", value: 1 },\n\t\t\"focusCoords\":  { type: \"v2\", value: new THREE.Vector2()},\n\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"uniform sampler2D tColor;\",\n\t\t\"uniform sampler2D tDepth;\",\n\t\t\"uniform float textureWidth;\",\n\t\t\"uniform float textureHeight;\",\n\n\t\t\"const float PI = 3.14159265;\",\n\n\t\t\"float width = textureWidth; //texture width\",\n\t\t\"float height = textureHeight; //texture height\",\n\n\t\t\"vec2 texel = vec2(1.0/width,1.0/height);\",\n\n\t\t\"uniform float focalDepth;  //focal distance value in meters, but you may use autofocus option below\",\n\t\t\"uniform float focalLength; //focal length in mm\",\n\t\t\"uniform float fstop; //f-stop value\",\n\t\t\"uniform bool showFocus; //show debug focus point and focal range (red = focal point, green = focal range)\",\n\n\t\t\"/*\",\n\t\t\"make sure that these two values are the same for your camera, otherwise distances will be wrong.\",\n\t\t\"*/\",\n\n\t\t\"uniform float znear; // camera clipping start\",\n\t\t\"uniform float zfar; // camera clipping end\",\n\n\t\t\"//------------------------------------------\",\n\t\t\"//user variables\",\n\n\t\t\"const int samples = SAMPLES; //samples on the first ring\",\n\t\t\"const int rings = RINGS; //ring count\",\n\n\t\t\"const int maxringsamples = rings * samples;\",\n\n\t\t\"uniform bool manualdof; // manual dof calculation\",\n\t\t\"float ndofstart = 1.0; // near dof blur start\",\n\t\t\"float ndofdist = 2.0; // near dof blur falloff distance\",\n\t\t\"float fdofstart = 1.0; // far dof blur start\",\n\t\t\"float fdofdist = 3.0; // far dof blur falloff distance\",\n\n\t\t\"float CoC = 0.03; //circle of confusion size in mm (35mm film = 0.03mm)\",\n\n\t\t\"uniform bool vignetting; // use optical lens vignetting\",\n\n\t\t\"float vignout = 1.3; // vignetting outer border\",\n\t\t\"float vignin = 0.0; // vignetting inner border\",\n\t\t\"float vignfade = 22.0; // f-stops till vignete fades\",\n\n\t\t\"uniform bool shaderFocus;\",\n\n\t\t\"bool autofocus = shaderFocus;\",\n\t\t\"//use autofocus in shader - use with focusCoords\",\n\t\t\"// disable if you use external focalDepth value\",\n\n\t\t\"uniform vec2 focusCoords;\",\n\t\t\"// autofocus point on screen (0.0,0.0 - left lower corner, 1.0,1.0 - upper right)\",\n\t\t\"// if center of screen use vec2(0.5, 0.5);\",\n\n\t\t\"uniform float maxblur;\",\n\t\t\"//clamp value of max blur (0.0 = no blur, 1.0 default)\",\n\n\t\t\"uniform float threshold; // highlight threshold;\",\n\t\t\"uniform float gain; // highlight gain;\",\n\n\t\t\"uniform float bias; // bokeh edge bias\",\n\t\t\"uniform float fringe; // bokeh chromatic aberration / fringing\",\n\n\t\t\"uniform bool noise; //use noise instead of pattern for sample dithering\",\n\n\t\t\"uniform float dithering;\",\n\t\t\"float namount = dithering; //dither amount\",\n\n\t\t\"uniform bool depthblur; // blur the depth buffer\",\n\t\t\"float dbsize = 1.25; // depth blur size\",\n\n\t\t\"/*\",\n\t\t\"next part is experimental\",\n\t\t\"not looking good with small sample and ring count\",\n\t\t\"looks okay starting from samples = 4, rings = 4\",\n\t\t\"*/\",\n\n\t\t\"uniform bool pentagon; //use pentagon as bokeh shape?\",\n\t\t\"float feather = 0.4; //pentagon shape feather\",\n\n\t\t\"//------------------------------------------\",\n\n\t\t\"float penta(vec2 coords) {\",\n\t\t\t\"//pentagonal shape\",\n\t\t\t\"float scale = float(rings) - 1.3;\",\n\t\t\t\"vec4  HS0 = vec4( 1.0,         0.0,         0.0,  1.0);\",\n\t\t\t\"vec4  HS1 = vec4( 0.309016994, 0.951056516, 0.0,  1.0);\",\n\t\t\t\"vec4  HS2 = vec4(-0.809016994, 0.587785252, 0.0,  1.0);\",\n\t\t\t\"vec4  HS3 = vec4(-0.809016994,-0.587785252, 0.0,  1.0);\",\n\t\t\t\"vec4  HS4 = vec4( 0.309016994,-0.951056516, 0.0,  1.0);\",\n\t\t\t\"vec4  HS5 = vec4( 0.0        ,0.0         , 1.0,  1.0);\",\n\n\t\t\t\"vec4  one = vec4( 1.0 );\",\n\n\t\t\t\"vec4 P = vec4((coords),vec2(scale, scale));\",\n\n\t\t\t\"vec4 dist = vec4(0.0);\",\n\t\t\t\"float inorout = -4.0;\",\n\n\t\t\t\"dist.x = dot( P, HS0 );\",\n\t\t\t\"dist.y = dot( P, HS1 );\",\n\t\t\t\"dist.z = dot( P, HS2 );\",\n\t\t\t\"dist.w = dot( P, HS3 );\",\n\n\t\t\t\"dist = smoothstep( -feather, feather, dist );\",\n\n\t\t\t\"inorout += dot( dist, one );\",\n\n\t\t\t\"dist.x = dot( P, HS4 );\",\n\t\t\t\"dist.y = HS5.w - abs( P.z );\",\n\n\t\t\t\"dist = smoothstep( -feather, feather, dist );\",\n\t\t\t\"inorout += dist.x;\",\n\n\t\t\t\"return clamp( inorout, 0.0, 1.0 );\",\n\t\t\"}\",\n\n\t\t\"float bdepth(vec2 coords) {\",\n\t\t\t\"// Depth buffer blur\",\n\t\t\t\"float d = 0.0;\",\n\t\t\t\"float kernel[9];\",\n\t\t\t\"vec2 offset[9];\",\n\n\t\t\t\"vec2 wh = vec2(texel.x, texel.y) * dbsize;\",\n\n\t\t\t\"offset[0] = vec2(-wh.x,-wh.y);\",\n\t\t\t\"offset[1] = vec2( 0.0, -wh.y);\",\n\t\t\t\"offset[2] = vec2( wh.x -wh.y);\",\n\n\t\t\t\"offset[3] = vec2(-wh.x,  0.0);\",\n\t\t\t\"offset[4] = vec2( 0.0,   0.0);\",\n\t\t\t\"offset[5] = vec2( wh.x,  0.0);\",\n\n\t\t\t\"offset[6] = vec2(-wh.x, wh.y);\",\n\t\t\t\"offset[7] = vec2( 0.0,  wh.y);\",\n\t\t\t\"offset[8] = vec2( wh.x, wh.y);\",\n\n\t\t\t\"kernel[0] = 1.0/16.0;   kernel[1] = 2.0/16.0;   kernel[2] = 1.0/16.0;\",\n\t\t\t\"kernel[3] = 2.0/16.0;   kernel[4] = 4.0/16.0;   kernel[5] = 2.0/16.0;\",\n\t\t\t\"kernel[6] = 1.0/16.0;   kernel[7] = 2.0/16.0;   kernel[8] = 1.0/16.0;\",\n\n\n\t\t\t\"for( int i=0; i<9; i++ ) {\",\n\t\t\t\t\"float tmp = texture2D(tDepth, coords + offset[i]).r;\",\n\t\t\t\t\"d += tmp * kernel[i];\",\n\t\t\t\"}\",\n\n\t\t\t\"return d;\",\n\t\t\"}\",\n\n\n\t\t\"vec3 color(vec2 coords,float blur) {\",\n\t\t\t\"//processing the sample\",\n\n\t\t\t\"vec3 col = vec3(0.0);\",\n\n\t\t\t\"col.r = texture2D(tColor,coords + vec2(0.0,1.0)*texel*fringe*blur).r;\",\n\t\t\t\"col.g = texture2D(tColor,coords + vec2(-0.866,-0.5)*texel*fringe*blur).g;\",\n\t\t\t\"col.b = texture2D(tColor,coords + vec2(0.866,-0.5)*texel*fringe*blur).b;\",\n\n\t\t\t\"vec3 lumcoeff = vec3(0.299,0.587,0.114);\",\n\t\t\t\"float lum = dot(col.rgb, lumcoeff);\",\n\t\t\t\"float thresh = max((lum-threshold)*gain, 0.0);\",\n\t\t\t\"return col+mix(vec3(0.0),col,thresh*blur);\",\n\t\t\"}\",\n\n\t\t\"vec2 rand(vec2 coord) {\",\n\t\t\t\"// generating noise / pattern texture for dithering\",\n\n\t\t\t\"float noiseX = ((fract(1.0-coord.s*(width/2.0))*0.25)+(fract(coord.t*(height/2.0))*0.75))*2.0-1.0;\",\n\t\t\t\"float noiseY = ((fract(1.0-coord.s*(width/2.0))*0.75)+(fract(coord.t*(height/2.0))*0.25))*2.0-1.0;\",\n\n\t\t\t\"if (noise) {\",\n\t\t\t\t\"noiseX = clamp(fract(sin(dot(coord ,vec2(12.9898,78.233))) * 43758.5453),0.0,1.0)*2.0-1.0;\",\n\t\t\t\t\"noiseY = clamp(fract(sin(dot(coord ,vec2(12.9898,78.233)*2.0)) * 43758.5453),0.0,1.0)*2.0-1.0;\",\n\t\t\t\"}\",\n\n\t\t\t\"return vec2(noiseX,noiseY);\",\n\t\t\"}\",\n\n\t\t\"vec3 debugFocus(vec3 col, float blur, float depth) {\",\n\t\t\t\"float edge = 0.002*depth; //distance based edge smoothing\",\n\t\t\t\"float m = clamp(smoothstep(0.0,edge,blur),0.0,1.0);\",\n\t\t\t\"float e = clamp(smoothstep(1.0-edge,1.0,blur),0.0,1.0);\",\n\n\t\t\t\"col = mix(col,vec3(1.0,0.5,0.0),(1.0-m)*0.6);\",\n\t\t\t\"col = mix(col,vec3(0.0,0.5,1.0),((1.0-e)-(1.0-m))*0.2);\",\n\n\t\t\t\"return col;\",\n\t\t\"}\",\n\n\t\t\"float linearize(float depth) {\",\n\t\t\t\"return -zfar * znear / (depth * (zfar - znear) - zfar);\",\n\t\t\"}\",\n\n\n\t\t\"float vignette() {\",\n\t\t\t\"float dist = distance(vUv.xy, vec2(0.5,0.5));\",\n\t\t\t\"dist = smoothstep(vignout+(fstop/vignfade), vignin+(fstop/vignfade), dist);\",\n\t\t\t\"return clamp(dist,0.0,1.0);\",\n\t\t\"}\",\n\n\t\t\"float gather(float i, float j, int ringsamples, inout vec3 col, float w, float h, float blur) {\",\n\t\t\t\"float rings2 = float(rings);\",\n\t\t\t\"float step = PI*2.0 / float(ringsamples);\",\n\t\t\t\"float pw = cos(j*step)*i;\",\n\t\t\t\"float ph = sin(j*step)*i;\",\n\t\t\t\"float p = 1.0;\",\n\t\t\t\"if (pentagon) {\",\n\t\t\t\t\"p = penta(vec2(pw,ph));\",\n\t\t\t\"}\",\n\t\t\t\"col += color(vUv.xy + vec2(pw*w,ph*h), blur) * mix(1.0, i/rings2, bias) * p;\",\n\t\t\t\"return 1.0 * mix(1.0, i /rings2, bias) * p;\",\n\t\t\"}\",\n\n\t\t\"void main() {\",\n\t\t\t\"//scene depth calculation\",\n\n\t\t\t\"float depth = linearize(texture2D(tDepth,vUv.xy).x);\",\n\n\t\t\t\"// Blur depth?\",\n\t\t\t\"if (depthblur) {\",\n\t\t\t\t\"depth = linearize(bdepth(vUv.xy));\",\n\t\t\t\"}\",\n\n\t\t\t\"//focal plane calculation\",\n\n\t\t\t\"float fDepth = focalDepth;\",\n\n\t\t\t\"if (autofocus) {\",\n\n\t\t\t\t\"fDepth = linearize(texture2D(tDepth,focusCoords).x);\",\n\n\t\t\t\"}\",\n\n\t\t\t\"// dof blur factor calculation\",\n\n\t\t\t\"float blur = 0.0;\",\n\n\t\t\t\"if (manualdof) {\",\n\t\t\t\t\"float a = depth-fDepth; // Focal plane\",\n\t\t\t\t\"float b = (a-fdofstart)/fdofdist; // Far DoF\",\n\t\t\t\t\"float c = (-a-ndofstart)/ndofdist; // Near Dof\",\n\t\t\t\t\"blur = (a>0.0) ? b : c;\",\n\t\t\t\"} else {\",\n\t\t\t\t\"float f = focalLength; // focal length in mm\",\n\t\t\t\t\"float d = fDepth*1000.0; // focal plane in mm\",\n\t\t\t\t\"float o = depth*1000.0; // depth in mm\",\n\n\t\t\t\t\"float a = (o*f)/(o-f);\",\n\t\t\t\t\"float b = (d*f)/(d-f);\",\n\t\t\t\t\"float c = (d-f)/(d*fstop*CoC);\",\n\n\t\t\t\t\"blur = abs(a-b)*c;\",\n\t\t\t\"}\",\n\n\t\t\t\"blur = clamp(blur,0.0,1.0);\",\n\n\t\t\t\"// calculation of pattern for dithering\",\n\n\t\t\t\"vec2 noise = rand(vUv.xy)*namount*blur;\",\n\n\t\t\t\"// getting blur x and y step factor\",\n\n\t\t\t\"float w = (1.0/width)*blur*maxblur+noise.x;\",\n\t\t\t\"float h = (1.0/height)*blur*maxblur+noise.y;\",\n\n\t\t\t\"// calculation of final color\",\n\n\t\t\t\"vec3 col = vec3(0.0);\",\n\n\t\t\t\"if(blur < 0.05) {\",\n\t\t\t\t\"//some optimization thingy\",\n\t\t\t\t\"col = texture2D(tColor, vUv.xy).rgb;\",\n\t\t\t\"} else {\",\n\t\t\t\t\"col = texture2D(tColor, vUv.xy).rgb;\",\n\t\t\t\t\"float s = 1.0;\",\n\t\t\t\t\"int ringsamples;\",\n\n\t\t\t\t\"for (int i = 1; i <= rings; i++) {\",\n\t\t\t\t\t\"/*unboxstart*/\",\n\t\t\t\t\t\"ringsamples = i * samples;\",\n\n\t\t\t\t\t\"for (int j = 0 ; j < maxringsamples ; j++) {\",\n\t\t\t\t\t\t\"if (j >= ringsamples) break;\",\n\t\t\t\t\t\t\"s += gather(float(i), float(j), ringsamples, col, w, h, blur);\",\n\t\t\t\t\t\"}\",\n\t\t\t\t\t\"/*unboxend*/\",\n\t\t\t\t\"}\",\n\n\t\t\t\t\"col /= s; //divide by sample count\",\n\t\t\t\"}\",\n\n\t\t\t\"if (showFocus) {\",\n\t\t\t\t\"col = debugFocus(col, blur, depth);\",\n\t\t\t\"}\",\n\n\t\t\t\"if (vignetting) {\",\n\t\t\t\t\"col *= vignette();\",\n\t\t\t\"}\",\n\n\t\t\t\"gl_FragColor.rgb = col;\",\n\t\t\t\"gl_FragColor.a = 1.0;\",\n\t\t\"} \"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/EdgeShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/EdgeShader.js",
            "module-type": "library",
            "text": "/**\n * @author zz85 / https://github.com/zz85 | https://www.lab4games.net/zz85/blog\n *\n * Edge Detection Shader using Frei-Chen filter\n * Based on http://rastergrid.com/blog/2011/01/frei-chen-edge-detector\n *\n * aspect: vec2 of (1/width, 1/height)\n */\n\nTHREE.EdgeShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"aspect\":    { type: \"v2\", value: new THREE.Vector2( 512, 512 ) },\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"uniform vec2 aspect;\",\n\n\t\t\"vec2 texel = vec2(1.0 / aspect.x, 1.0 / aspect.y);\",\n\n\n\t\t\"mat3 G[9];\",\n\n\t\t// hard coded matrix values!!!! as suggested in https://github.com/neilmendoza/ofxPostProcessing/blob/master/src/EdgePass.cpp#L45\n\n\t\t\"const mat3 g0 = mat3( 0.3535533845424652, 0, -0.3535533845424652, 0.5, 0, -0.5, 0.3535533845424652, 0, -0.3535533845424652 );\",\n\t\t\"const mat3 g1 = mat3( 0.3535533845424652, 0.5, 0.3535533845424652, 0, 0, 0, -0.3535533845424652, -0.5, -0.3535533845424652 );\",\n\t\t\"const mat3 g2 = mat3( 0, 0.3535533845424652, -0.5, -0.3535533845424652, 0, 0.3535533845424652, 0.5, -0.3535533845424652, 0 );\",\n\t\t\"const mat3 g3 = mat3( 0.5, -0.3535533845424652, 0, -0.3535533845424652, 0, 0.3535533845424652, 0, 0.3535533845424652, -0.5 );\",\n\t\t\"const mat3 g4 = mat3( 0, -0.5, 0, 0.5, 0, 0.5, 0, -0.5, 0 );\",\n\t\t\"const mat3 g5 = mat3( -0.5, 0, 0.5, 0, 0, 0, 0.5, 0, -0.5 );\",\n\t\t\"const mat3 g6 = mat3( 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.6666666865348816, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204 );\",\n\t\t\"const mat3 g7 = mat3( -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, 0.6666666865348816, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408 );\",\n\t\t\"const mat3 g8 = mat3( 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408 );\",\n\n\t\t\"void main(void)\",\n\t\t\"{\",\n\n\t\t\t\"G[0] = g0,\",\n\t\t\t\"G[1] = g1,\",\n\t\t\t\"G[2] = g2,\",\n\t\t\t\"G[3] = g3,\",\n\t\t\t\"G[4] = g4,\",\n\t\t\t\"G[5] = g5,\",\n\t\t\t\"G[6] = g6,\",\n\t\t\t\"G[7] = g7,\",\n\t\t\t\"G[8] = g8;\",\n\n\t\t\t\"mat3 I;\",\n\t\t\t\"float cnv[9];\",\n\t\t\t\"vec3 sample;\",\n\n\t\t\t/* fetch the 3x3 neighbourhood and use the RGB vector's length as intensity value */\n\t\t\t\"for (float i=0.0; i<3.0; i++) {\",\n\t\t\t\t\"for (float j=0.0; j<3.0; j++) {\",\n\t\t\t\t\t\"sample = texture2D(tDiffuse, vUv + texel * vec2(i-1.0,j-1.0) ).rgb;\",\n\t\t\t\t\t\"I[int(i)][int(j)] = length(sample);\",\n\t\t\t\t\"}\",\n\t\t\t\"}\",\n\n\t\t\t/* calculate the convolution values for all the masks */\n\t\t\t\"for (int i=0; i<9; i++) {\",\n\t\t\t\t\"float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);\",\n\t\t\t\t\"cnv[i] = dp3 * dp3;\",\n\t\t\t\"}\",\n\n\t\t\t\"float M = (cnv[0] + cnv[1]) + (cnv[2] + cnv[3]);\",\n\t\t\t\"float S = (cnv[4] + cnv[5]) + (cnv[6] + cnv[7]) + (cnv[8] + M);\",\n\n\t\t\t\"gl_FragColor = vec4(vec3(sqrt(M/S)), 1.0);\",\n\t\t\"}\",\n\n\t].join(\"\\n\")\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/EdgeShader2.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/EdgeShader2.js",
            "module-type": "library",
            "text": "/**\n * @author zz85 / https://github.com/zz85 | https://www.lab4games.net/zz85/blog\n *\n * Edge Detection Shader using Sobel filter\n * Based on http://rastergrid.com/blog/2011/01/frei-chen-edge-detector\n *\n * aspect: vec2 of (1/width, 1/height)\n */\n\nTHREE.EdgeShader2 = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"aspect\":    { type: \"v2\", value: new THREE.Vector2( 512, 512 ) },\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"varying vec2 vUv;\",\n\t\t\"uniform vec2 aspect;\",\n\n\n\t\t\"vec2 texel = vec2(1.0 / aspect.x, 1.0 / aspect.y);\",\n\n\t\t\"mat3 G[2];\",\n\n\t\t\"const mat3 g0 = mat3( 1.0, 2.0, 1.0, 0.0, 0.0, 0.0, -1.0, -2.0, -1.0 );\",\n\t\t\"const mat3 g1 = mat3( 1.0, 0.0, -1.0, 2.0, 0.0, -2.0, 1.0, 0.0, -1.0 );\",\n\n\n\t\t\"void main(void)\",\n\t\t\"{\",\n\t\t\t\"mat3 I;\",\n\t\t\t\"float cnv[2];\",\n\t\t\t\"vec3 sample;\",\n\n\t\t\t\"G[0] = g0;\",\n\t\t\t\"G[1] = g1;\",\n\n\t\t\t/* fetch the 3x3 neighbourhood and use the RGB vector's length as intensity value */\n\t\t\t\"for (float i=0.0; i<3.0; i++)\",\n\t\t\t\"for (float j=0.0; j<3.0; j++) {\",\n\t\t\t\t\"sample = texture2D( tDiffuse, vUv + texel * vec2(i-1.0,j-1.0) ).rgb;\",\n\t\t\t\t\"I[int(i)][int(j)] = length(sample);\",\n\t\t\t\"}\",\n\n\t\t\t/* calculate the convolution values for all the masks */\n\t\t\t\"for (int i=0; i<2; i++) {\",\n\t\t\t\t\"float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);\",\n\t\t\t\t\"cnv[i] = dp3 * dp3; \",\n\t\t\t\"}\",\n\n\t\t\t\"gl_FragColor = vec4(0.5 * sqrt(cnv[0]*cnv[0]+cnv[1]*cnv[1]));\",\n\t\t\"} \",\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/ConvolutionShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/ConvolutionShader.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Convolution shader\n * ported from o3d sample to WebGL / GLSL\n * http://o3d.googlecode.com/svn/trunk/samples/convolution.html\n */\n\nTHREE.ConvolutionShader = {\n\n\tdefines: {\n\n\t\t\"KERNEL_SIZE_FLOAT\": \"25.0\",\n\t\t\"KERNEL_SIZE_INT\": \"25\",\n\n\t},\n\n\tuniforms: {\n\n\t\t\"tDiffuse\":        { type: \"t\", value: null },\n\t\t\"uImageIncrement\": { type: \"v2\", value: new THREE.Vector2( 0.001953125, 0.0 ) },\n\t\t\"cKernel\":         { type: \"fv1\", value: [] }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"uniform vec2 uImageIncrement;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform float cKernel[ KERNEL_SIZE_INT ];\",\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"uniform vec2 uImageIncrement;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec2 imageCoord = vUv;\",\n\t\t\t\"vec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );\",\n\n\t\t\t\"for( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {\",\n\n\t\t\t\t\"sum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];\",\n\t\t\t\t\"imageCoord += uImageIncrement;\",\n\n\t\t\t\"}\",\n\n\t\t\t\"gl_FragColor = sum;\",\n\n\t\t\"}\"\n\n\n\t].join(\"\\n\"),\n\n\tbuildKernel: function ( sigma ) {\n\n\t\t// We lop off the sqrt(2 * pi) * sigma term, since we're going to normalize anyway.\n\n\t\tfunction gauss( x, sigma ) {\n\n\t\t\treturn Math.exp( - ( x * x ) / ( 2.0 * sigma * sigma ) );\n\n\t\t}\n\n\t\tvar i, values, sum, halfWidth, kMaxKernelSize = 25, kernelSize = 2 * Math.ceil( sigma * 3.0 ) + 1;\n\n\t\tif ( kernelSize > kMaxKernelSize ) kernelSize = kMaxKernelSize;\n\t\thalfWidth = ( kernelSize - 1 ) * 0.5;\n\n\t\tvalues = new Array( kernelSize );\n\t\tsum = 0.0;\n\t\tfor ( i = 0; i < kernelSize; ++i ) {\n\n\t\t\tvalues[ i ] = gauss( i - halfWidth, sigma );\n\t\t\tsum += values[ i ];\n\n\t\t}\n\n\t\t// normalize the kernel\n\n\t\tfor ( i = 0; i < kernelSize; ++i ) values[ i ] /= sum;\n\n\t\treturn values;\n\n\t}\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/UnpackDepthRGBAShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/UnpackDepthRGBAShader.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Unpack RGBA depth shader\n * - show RGBA encoded depth as monochrome color\n */\n\nTHREE.UnpackDepthRGBAShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"opacity\":  { type: \"f\", value: 1.0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform float opacity;\",\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t// RGBA depth\n\n\t\t\"float unpackDepth( const in vec4 rgba_depth ) {\",\n\n\t\t\t\"const vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\",\n\t\t\t\"float depth = dot( rgba_depth, bit_shift );\",\n\t\t\t\"return depth;\",\n\n\t\t\"}\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"float depth = 1.0 - unpackDepth( texture2D( tDiffuse, vUv ) );\",\n\t\t\t\"gl_FragColor = opacity * vec4( vec3( depth ), 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/BokehShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/BokehShader.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Depth-of-field shader with bokeh\n * ported from GLSL shader by Martins Upitis\n * http://artmartinsh.blogspot.com/2010/02/glsl-lens-blur-filter-with-bokeh.html\n */\n\nTHREE.BokehShader = {\n\n\tuniforms: {\n\n\t\t\"tColor\":   { type: \"t\", value: null },\n\t\t\"tDepth\":   { type: \"t\", value: null },\n\t\t\"focus\":    { type: \"f\", value: 1.0 },\n\t\t\"aspect\":   { type: \"f\", value: 1.0 },\n\t\t\"aperture\": { type: \"f\", value: 0.025 },\n\t\t\"maxblur\":  { type: \"f\", value: 1.0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"uniform sampler2D tColor;\",\n\t\t\"uniform sampler2D tDepth;\",\n\n\t\t\"uniform float maxblur;\",  // max blur amount\n\t\t\"uniform float aperture;\", // aperture - bigger values for shallower depth of field\n\n\t\t\"uniform float focus;\",\n\t\t\"uniform float aspect;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec2 aspectcorrect = vec2( 1.0, aspect );\",\n\n\t\t\t\"vec4 depth1 = texture2D( tDepth, vUv );\",\n\n\t\t\t\"float factor = depth1.x - focus;\",\n\n\t\t\t\"vec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );\",\n\n\t\t\t\"vec2 dofblur9 = dofblur * 0.9;\",\n\t\t\t\"vec2 dofblur7 = dofblur * 0.7;\",\n\t\t\t\"vec2 dofblur4 = dofblur * 0.4;\",\n\n\t\t\t\"vec4 col = vec4( 0.0 );\",\n\n\t\t\t\"col += texture2D( tColor, vUv.xy );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2(  0.0,   0.4  ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2(  0.15,  0.37 ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2(  0.29,  0.29 ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.37,  0.15 ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2(  0.40,  0.0  ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2(  0.37, -0.15 ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2(  0.29, -0.29 ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2(  0.0,  -0.4  ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.15,  0.37 ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.29,  0.29 ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2(  0.37,  0.15 ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.4,   0.0  ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2(  0.15, -0.37 ) * aspectcorrect ) * dofblur );\",\n\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2(  0.15,  0.37 ) * aspectcorrect ) * dofblur9 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.37,  0.15 ) * aspectcorrect ) * dofblur9 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2(  0.37, -0.15 ) * aspectcorrect ) * dofblur9 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.15,  0.37 ) * aspectcorrect ) * dofblur9 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2(  0.37,  0.15 ) * aspectcorrect ) * dofblur9 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2(  0.15, -0.37 ) * aspectcorrect ) * dofblur9 );\",\n\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2(  0.29,  0.29 ) * aspectcorrect ) * dofblur7 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2(  0.40,  0.0  ) * aspectcorrect ) * dofblur7 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2(  0.29, -0.29 ) * aspectcorrect ) * dofblur7 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2(  0.0,  -0.4  ) * aspectcorrect ) * dofblur7 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.29,  0.29 ) * aspectcorrect ) * dofblur7 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.4,   0.0  ) * aspectcorrect ) * dofblur7 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2(  0.0,   0.4  ) * aspectcorrect ) * dofblur7 );\",\n\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2(  0.29,  0.29 ) * aspectcorrect ) * dofblur4 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2(  0.4,   0.0  ) * aspectcorrect ) * dofblur4 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2(  0.29, -0.29 ) * aspectcorrect ) * dofblur4 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2(  0.0,  -0.4  ) * aspectcorrect ) * dofblur4 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.29,  0.29 ) * aspectcorrect ) * dofblur4 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.4,   0.0  ) * aspectcorrect ) * dofblur4 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2(  0.0,   0.4  ) * aspectcorrect ) * dofblur4 );\",\n\n\t\t\t\"gl_FragColor = col / 41.0;\",\n\t\t\t\"gl_FragColor.a = 1.0;\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/HorizontalTiltShiftShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/HorizontalTiltShiftShader.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Simple fake tilt-shift effect, modulating two pass Gaussian blur (see above) by vertical position\n *\n * - 9 samples per pass\n * - standard deviation 2.7\n * - \"h\" and \"v\" parameters should be set to \"1 / width\" and \"1 / height\"\n * - \"r\" parameter control where \"focused\" horizontal line lies\n */\n\nTHREE.HorizontalTiltShiftShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"h\":        { type: \"f\", value: 1.0 / 512.0 },\n\t\t\"r\":        { type: \"f\", value: 0.35 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"uniform float h;\",\n\t\t\"uniform float r;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 sum = vec4( 0.0 );\",\n\n\t\t\t\"float hh = h * abs( r - vUv.y );\",\n\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * hh, vUv.y ) ) * 0.051;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * hh, vUv.y ) ) * 0.0918;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * hh, vUv.y ) ) * 0.12245;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * hh, vUv.y ) ) * 0.1531;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * hh, vUv.y ) ) * 0.1531;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * hh, vUv.y ) ) * 0.12245;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * hh, vUv.y ) ) * 0.0918;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * hh, vUv.y ) ) * 0.051;\",\n\n\t\t\t\"gl_FragColor = sum;\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/BrightnessContrastShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/BrightnessContrastShader.js",
            "module-type": "library",
            "text": "/**\n * @author tapio / http://tapio.github.com/\n *\n * Brightness and contrast adjustment\n * https://github.com/evanw/glfx.js\n * brightness: -1 to 1 (-1 is solid black, 0 is no change, and 1 is solid white)\n * contrast: -1 to 1 (-1 is solid gray, 0 is no change, and 1 is maximum contrast)\n */\n\nTHREE.BrightnessContrastShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\":   { type: \"t\", value: null },\n\t\t\"brightness\": { type: \"f\", value: 0 },\n\t\t\"contrast\":   { type: \"f\", value: 0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"uniform float brightness;\",\n\t\t\"uniform float contrast;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"gl_FragColor = texture2D( tDiffuse, vUv );\",\n\n\t\t\t\"gl_FragColor.rgb += brightness;\",\n\n\t\t\t\"if (contrast > 0.0) {\",\n\t\t\t\t\"gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) / (1.0 - contrast) + 0.5;\",\n\t\t\t\"} else {\",\n\t\t\t\t\"gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) * (1.0 + contrast) + 0.5;\",\n\t\t\t\"}\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/DigitalGlitch.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/DigitalGlitch.js",
            "module-type": "library",
            "text": "/**\n * @author felixturner / http://airtight.cc/\n *\n * RGB Shift Shader\n * Shifts red and blue channels from center in opposite directions\n * Ported from http://kriss.cx/tom/2009/05/rgb-shift/\n * by Tom Butterworth / http://kriss.cx/tom/\n *\n * amount: shift distance (1 is width of input)\n * angle: shift angle in radians\n */\n\nTHREE.DigitalGlitch = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\":\t\t{ type: \"t\", value: null },//diffuse texture\n\t\t\"tDisp\":\t\t{ type: \"t\", value: null },//displacement texture for digital glitch squares\n\t\t\"byp\":\t\t\t{ type: \"i\", value: 0 },//apply the glitch ?\n\t\t\"amount\":\t\t{ type: \"f\", value: 0.08 },\n\t\t\"angle\":\t\t{ type: \"f\", value: 0.02 },\n\t\t\"seed\":\t\t\t{ type: \"f\", value: 0.02 },\n\t\t\"seed_x\":\t\t{ type: \"f\", value: 0.02 },//-1,1\n\t\t\"seed_y\":\t\t{ type: \"f\", value: 0.02 },//-1,1\n\t\t\"distortion_x\":\t{ type: \"f\", value: 0.5 },\n\t\t\"distortion_y\":\t{ type: \"f\", value: 0.6 },\n\t\t\"col_s\":\t\t{ type: \"f\", value: 0.05 }\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\t\t\"void main() {\",\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\t\t\"}\"\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\t\t\"uniform int byp;\",//should we apply the glitch ?\n\t\t\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"uniform sampler2D tDisp;\",\n\t\t\n\t\t\"uniform float amount;\",\n\t\t\"uniform float angle;\",\n\t\t\"uniform float seed;\",\n\t\t\"uniform float seed_x;\",\n\t\t\"uniform float seed_y;\",\n\t\t\"uniform float distortion_x;\",\n\t\t\"uniform float distortion_y;\",\n\t\t\"uniform float col_s;\",\n\t\t\t\n\t\t\"varying vec2 vUv;\",\n\t\t\n\t\t\n\t\t\"float rand(vec2 co){\",\n\t\t\t\"return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\",\n\t\t\"}\",\n\t\t\t\t\n\t\t\"void main() {\",\n\t\t\t\"if(byp<1) {\",\n\t\t\t\t\"vec2 p = vUv;\",\n\t\t\t\t\"float xs = floor(gl_FragCoord.x / 0.5);\",\n\t\t\t\t\"float ys = floor(gl_FragCoord.y / 0.5);\",\n\t\t\t\t//based on staffantans glitch shader for unity https://github.com/staffantan/unityglitch\n\t\t\t\t\"vec4 normal = texture2D (tDisp, p*seed*seed);\",\n\t\t\t\t\"if(p.y<distortion_x+col_s && p.y>distortion_x-col_s*seed) {\",\n\t\t\t\t\t\"if(seed_x>0.){\",\n\t\t\t\t\t\t\"p.y = 1. - (p.y + distortion_y);\",\n\t\t\t\t\t\"}\",\n\t\t\t\t\t\"else {\",\n\t\t\t\t\t\t\"p.y = distortion_y;\",\n\t\t\t\t\t\"}\",\n\t\t\t\t\"}\",\n\t\t\t\t\"if(p.x<distortion_y+col_s && p.x>distortion_y-col_s*seed) {\",\n\t\t\t\t\t\"if(seed_y>0.){\",\n\t\t\t\t\t\t\"p.x=distortion_x;\",\n\t\t\t\t\t\"}\",\n\t\t\t\t\t\"else {\",\n\t\t\t\t\t\t\"p.x = 1. - (p.x + distortion_x);\",\n\t\t\t\t\t\"}\",\n\t\t\t\t\"}\",\n\t\t\t\t\"p.x+=normal.x*seed_x*(seed/5.);\",\n\t\t\t\t\"p.y+=normal.y*seed_y*(seed/5.);\",\n\t\t\t\t//base from RGB shift shader\n\t\t\t\t\"vec2 offset = amount * vec2( cos(angle), sin(angle));\",\n\t\t\t\t\"vec4 cr = texture2D(tDiffuse, p + offset);\",\n\t\t\t\t\"vec4 cga = texture2D(tDiffuse, p);\",\n\t\t\t\t\"vec4 cb = texture2D(tDiffuse, p - offset);\",\n\t\t\t\t\"gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);\",\n\t\t\t\t//add noise\n\t\t\t\t\"vec4 snow = 200.*amount*vec4(rand(vec2(xs * seed,ys * seed*50.))*0.2);\",\n\t\t\t\t\"gl_FragColor = gl_FragColor+ snow;\",\n\t\t\t\"}\",\n\t\t\t\"else {\",\n\t\t\t\t\"gl_FragColor=texture2D (tDiffuse, vUv);\",\n\t\t\t\"}\",\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/KaleidoShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/KaleidoShader.js",
            "module-type": "library",
            "text": "/**\n * @author felixturner / http://airtight.cc/\n *\n * Kaleidoscope Shader\n * Radial reflection around center point\n * Ported from: http://pixelshaders.com/editor/\n * by Toby Schachman / http://tobyschachman.com/\n *\n * sides: number of reflections\n * angle: initial angle in radians\n */\n\nTHREE.KaleidoShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"sides\":    { type: \"f\", value: 6.0 },\n\t\t\"angle\":    { type: \"f\", value: 0.0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"uniform float sides;\",\n\t\t\"uniform float angle;\",\n\t\t\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec2 p = vUv - 0.5;\",\n\t\t\t\"float r = length(p);\",\n\t\t\t\"float a = atan(p.y, p.x) + angle;\",\n\t\t\t\"float tau = 2. * 3.1416 ;\",\n\t\t\t\"a = mod(a, tau/sides);\",\n\t\t\t\"a = abs(a - tau/sides/2.) ;\",\n\t\t\t\"p = r * vec2(cos(a), sin(a));\",\n\t\t\t\"vec4 color = texture2D(tDiffuse, p + 0.5);\",\n\t\t\t\"gl_FragColor = color;\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/VerticalBlurShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/VerticalBlurShader.js",
            "module-type": "library",
            "text": "/**\n * @author zz85 / http://www.lab4games.net/zz85/blog\n *\n * Two pass Gaussian blur filter (horizontal and vertical blur shaders)\n * - described in http://www.gamerendering.com/2008/10/11/gaussian-blur-filter-shader/\n *   and used in http://www.cake23.de/traveling-wavefronts-lit-up.html\n *\n * - 9 samples per pass\n * - standard deviation 2.7\n * - \"h\" and \"v\" parameters should be set to \"1 / width\" and \"1 / height\"\n */\n\nTHREE.VerticalBlurShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"v\":        { type: \"f\", value: 1.0 / 512.0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"uniform float v;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 sum = vec4( 0.0 );\",\n\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;\",\n\n\t\t\t\"gl_FragColor = sum;\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/NormalMapShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/NormalMapShader.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Normal map shader\n * - compute normals from heightmap\n */\n\nTHREE.NormalMapShader = {\n\n\tuniforms: {\n\n\t\t\"heightMap\":  { type: \"t\", value: null },\n\t\t\"resolution\": { type: \"v2\", value: new THREE.Vector2( 512, 512 ) },\n\t\t\"scale\":      { type: \"v2\", value: new THREE.Vector2( 1, 1 ) },\n\t\t\"height\":     { type: \"f\", value: 0.05 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform float height;\",\n\t\t\"uniform vec2 resolution;\",\n\t\t\"uniform sampler2D heightMap;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"float val = texture2D( heightMap, vUv ).x;\",\n\n\t\t\t\"float valU = texture2D( heightMap, vUv + vec2( 1.0 / resolution.x, 0.0 ) ).x;\",\n\t\t\t\"float valV = texture2D( heightMap, vUv + vec2( 0.0, 1.0 / resolution.y ) ).x;\",\n\n\t\t\t\"gl_FragColor = vec4( ( 0.5 * normalize( vec3( val - valU, val - valV, height  ) ) + 0.5 ), 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/ColorifyShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/ColorifyShader.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Colorify shader\n */\n\nTHREE.ColorifyShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"color\":    { type: \"c\", value: new THREE.Color( 0xffffff ) }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform vec3 color;\",\n\t\t\"uniform sampler2D tDiffuse;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 texel = texture2D( tDiffuse, vUv );\",\n\n\t\t\t\"vec3 luma = vec3( 0.299, 0.587, 0.114 );\",\n\t\t\t\"float v = dot( texel.xyz, luma );\",\n\n\t\t\t\"gl_FragColor = vec4( v * color, texel.w );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/TechnicolorShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/TechnicolorShader.js",
            "module-type": "library",
            "text": "/**\n * @author flimshaw / http://charliehoey.com\n *\n * Technicolor Shader\n * Simulates the look of the two-strip technicolor process popular in early 20th century films.\n * More historical info here: http://www.widescreenmuseum.com/oldcolor/technicolor1.htm\n * Demo here: http://charliehoey.com/technicolor_shader/shader_test.html\n */\n\nTHREE.TechnicolorShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );\",\n\t\t\t\"vec4 newTex = vec4(tex.r, (tex.g + tex.b) * .5, (tex.g + tex.b) * .5, 1.0);\",\n\n\t\t\t\"gl_FragColor = newTex;\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/DotScreenShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/DotScreenShader.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Dot screen shader\n * based on glfx.js sepia shader\n * https://github.com/evanw/glfx.js\n */\n\nTHREE.DotScreenShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"tSize\":    { type: \"v2\", value: new THREE.Vector2( 256, 256 ) },\n\t\t\"center\":   { type: \"v2\", value: new THREE.Vector2( 0.5, 0.5 ) },\n\t\t\"angle\":    { type: \"f\", value: 1.57 },\n\t\t\"scale\":    { type: \"f\", value: 1.0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform vec2 center;\",\n\t\t\"uniform float angle;\",\n\t\t\"uniform float scale;\",\n\t\t\"uniform vec2 tSize;\",\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"float pattern() {\",\n\n\t\t\t\"float s = sin( angle ), c = cos( angle );\",\n\n\t\t\t\"vec2 tex = vUv * tSize - center;\",\n\t\t\t\"vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;\",\n\n\t\t\t\"return ( sin( point.x ) * sin( point.y ) ) * 4.0;\",\n\n\t\t\"}\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 color = texture2D( tDiffuse, vUv );\",\n\n\t\t\t\"float average = ( color.r + color.g + color.b ) / 3.0;\",\n\n\t\t\t\"gl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/LuminosityShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/LuminosityShader.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Luminosity\n * http://en.wikipedia.org/wiki/Luminosity\n */\n\nTHREE.LuminosityShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 texel = texture2D( tDiffuse, vUv );\",\n\n\t\t\t\"vec3 luma = vec3( 0.299, 0.587, 0.114 );\",\n\n\t\t\t\"float v = dot( texel.xyz, luma );\",\n\n\t\t\t\"gl_FragColor = vec4( v, v, v, texel.w );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/HorizontalBlurShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/HorizontalBlurShader.js",
            "module-type": "library",
            "text": "/**\n * @author zz85 / http://www.lab4games.net/zz85/blog\n *\n * Two pass Gaussian blur filter (horizontal and vertical blur shaders)\n * - described in http://www.gamerendering.com/2008/10/11/gaussian-blur-filter-shader/\n *   and used in http://www.cake23.de/traveling-wavefronts-lit-up.html\n *\n * - 9 samples per pass\n * - standard deviation 2.7\n * - \"h\" and \"v\" parameters should be set to \"1 / width\" and \"1 / height\"\n */\n\nTHREE.HorizontalBlurShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"h\":        { type: \"f\", value: 1.0 / 512.0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"uniform float h;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 sum = vec4( 0.0 );\",\n\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;\",\n\n\t\t\t\"gl_FragColor = sum;\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/FilmShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/FilmShader.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Film grain & scanlines shader\n *\n * - ported from HLSL to WebGL / GLSL\n * http://www.truevision3d.com/forums/showcase/staticnoise_colorblackwhite_scanline_shaders-t18698.0.html\n *\n * Screen Space Static Postprocessor\n *\n * Produces an analogue noise overlay similar to a film grain / TV static\n *\n * Original implementation and noise algorithm\n * Pat 'Hawthorne' Shearon\n *\n * Optimized scanlines + noise version with intensity scaling\n * Georg 'Leviathan' Steinrohder\n *\n * This version is provided under a Creative Commons Attribution 3.0 License\n * http://creativecommons.org/licenses/by/3.0/\n */\n\nTHREE.FilmShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\":   { type: \"t\", value: null },\n\t\t\"time\":       { type: \"f\", value: 0.0 },\n\t\t\"nIntensity\": { type: \"f\", value: 0.5 },\n\t\t\"sIntensity\": { type: \"f\", value: 0.05 },\n\t\t\"sCount\":     { type: \"f\", value: 4096 },\n\t\t\"grayscale\":  { type: \"i\", value: 1 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t// control parameter\n\t\t\"uniform float time;\",\n\n\t\t\"uniform bool grayscale;\",\n\n\t\t// noise effect intensity value (0 = no effect, 1 = full effect)\n\t\t\"uniform float nIntensity;\",\n\n\t\t// scanlines effect intensity value (0 = no effect, 1 = full effect)\n\t\t\"uniform float sIntensity;\",\n\n\t\t// scanlines effect count value (0 = no effect, 4096 = full effect)\n\t\t\"uniform float sCount;\",\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t// sample the source\n\t\t\t\"vec4 cTextureScreen = texture2D( tDiffuse, vUv );\",\n\n\t\t\t// make some noise\n\t\t\t\"float x = vUv.x * vUv.y * time *  1000.0;\",\n\t\t\t\"x = mod( x, 13.0 ) * mod( x, 123.0 );\",\n\t\t\t\"float dx = mod( x, 0.01 );\",\n\n\t\t\t// add noise\n\t\t\t\"vec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx * 100.0, 0.0, 1.0 );\",\n\n\t\t\t// get us a sine and cosine\n\t\t\t\"vec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );\",\n\n\t\t\t// add scanlines\n\t\t\t\"cResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;\",\n\n\t\t\t// interpolate between source and result by intensity\n\t\t\t\"cResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );\",\n\n\t\t\t// convert to grayscale if desired\n\t\t\t\"if( grayscale ) {\",\n\n\t\t\t\t\"cResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );\",\n\n\t\t\t\"}\",\n\n\t\t\t\"gl_FragColor =  vec4( cResult, cTextureScreen.a );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/FresnelShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/FresnelShader.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Based on Nvidia Cg tutorial\n */\n\nTHREE.FresnelShader = {\n\n\tuniforms: {\n\n\t\t\"mRefractionRatio\": { type: \"f\", value: 1.02 },\n\t\t\"mFresnelBias\": { type: \"f\", value: 0.1 },\n\t\t\"mFresnelPower\": { type: \"f\", value: 2.0 },\n\t\t\"mFresnelScale\": { type: \"f\", value: 1.0 },\n\t\t\"tCube\": { type: \"t\", value: null }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"uniform float mRefractionRatio;\",\n\t\t\"uniform float mFresnelBias;\",\n\t\t\"uniform float mFresnelScale;\",\n\t\t\"uniform float mFresnelPower;\",\n\n\t\t\"varying vec3 vReflect;\",\n\t\t\"varying vec3 vRefract[3];\",\n\t\t\"varying float vReflectionFactor;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\",\n\t\t\t\"vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\",\n\n\t\t\t\"vec3 worldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );\",\n\n\t\t\t\"vec3 I = worldPosition.xyz - cameraPosition;\",\n\n\t\t\t\"vReflect = reflect( I, worldNormal );\",\n\t\t\t\"vRefract[0] = refract( normalize( I ), worldNormal, mRefractionRatio );\",\n\t\t\t\"vRefract[1] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.99 );\",\n\t\t\t\"vRefract[2] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.98 );\",\n\t\t\t\"vReflectionFactor = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( I ), worldNormal ), mFresnelPower );\",\n\n\t\t\t\"gl_Position = projectionMatrix * mvPosition;\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform samplerCube tCube;\",\n\n\t\t\"varying vec3 vReflect;\",\n\t\t\"varying vec3 vRefract[3];\",\n\t\t\"varying float vReflectionFactor;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 reflectedColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );\",\n\t\t\t\"vec4 refractedColor = vec4( 1.0 );\",\n\n\t\t\t\"refractedColor.r = textureCube( tCube, vec3( -vRefract[0].x, vRefract[0].yz ) ).r;\",\n\t\t\t\"refractedColor.g = textureCube( tCube, vec3( -vRefract[1].x, vRefract[1].yz ) ).g;\",\n\t\t\t\"refractedColor.b = textureCube( tCube, vec3( -vRefract[2].x, vRefract[2].yz ) ).b;\",\n\n\t\t\t\"gl_FragColor = mix( refractedColor, reflectedColor, clamp( vReflectionFactor, 0.0, 1.0 ) );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/MirrorShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/MirrorShader.js",
            "module-type": "library",
            "text": "/**\n * @author felixturner / http://airtight.cc/\n *\n * Mirror Shader\n * Copies half the input to the other half\n *\n * side: side of input to mirror (0 = left, 1 = right, 2 = top, 3 = bottom)\n */\n\nTHREE.MirrorShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"side\":     { type: \"i\", value: 1 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"uniform int side;\",\n\t\t\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec2 p = vUv;\",\n\t\t\t\"if (side == 0){\",\n\t\t\t\t\"if (p.x > 0.5) p.x = 1.0 - p.x;\",\n\t\t\t\"}else if (side == 1){\",\n\t\t\t\t\"if (p.x < 0.5) p.x = 1.0 - p.x;\",\n\t\t\t\"}else if (side == 2){\",\n\t\t\t\t\"if (p.y < 0.5) p.y = 1.0 - p.y;\",\n\t\t\t\"}else if (side == 3){\",\n\t\t\t\t\"if (p.y > 0.5) p.y = 1.0 - p.y;\",\n\t\t\t\"} \",\n\t\t\t\"vec4 color = texture2D(tDiffuse, p);\",\n\t\t\t\"gl_FragColor = color;\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/DOFMipMapShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/DOFMipMapShader.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Depth-of-field shader using mipmaps\n * - from Matt Handley @applmak\n * - requires power-of-2 sized render target with enabled mipmaps\n */\n\nTHREE.DOFMipMapShader = {\n\n\tuniforms: {\n\n\t\t\"tColor\":   { type: \"t\", value: null },\n\t\t\"tDepth\":   { type: \"t\", value: null },\n\t\t\"focus\":    { type: \"f\", value: 1.0 },\n\t\t\"maxblur\":  { type: \"f\", value: 1.0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform float focus;\",\n\t\t\"uniform float maxblur;\",\n\n\t\t\"uniform sampler2D tColor;\",\n\t\t\"uniform sampler2D tDepth;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 depth = texture2D( tDepth, vUv );\",\n\n\t\t\t\"float factor = depth.x - focus;\",\n\n\t\t\t\"vec4 col = texture2D( tColor, vUv, 2.0 * maxblur * abs( focus - depth.x ) );\",\n\n\t\t\t\"gl_FragColor = col;\",\n\t\t\t\"gl_FragColor.a = 1.0;\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/HueSaturationShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/HueSaturationShader.js",
            "module-type": "library",
            "text": "/**\n * @author tapio / http://tapio.github.com/\n *\n * Hue and saturation adjustment\n * https://github.com/evanw/glfx.js\n * hue: -1 to 1 (-1 is 180 degrees in the negative direction, 0 is no change, etc.\n * saturation: -1 to 1 (-1 is solid gray, 0 is no change, and 1 is maximum contrast)\n */\n\nTHREE.HueSaturationShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\":   { type: \"t\", value: null },\n\t\t\"hue\":        { type: \"f\", value: 0 },\n\t\t\"saturation\": { type: \"f\", value: 0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"uniform float hue;\",\n\t\t\"uniform float saturation;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"gl_FragColor = texture2D( tDiffuse, vUv );\",\n\n\t\t\t// hue\n\t\t\t\"float angle = hue * 3.14159265;\",\n\t\t\t\"float s = sin(angle), c = cos(angle);\",\n\t\t\t\"vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;\",\n\t\t\t\"float len = length(gl_FragColor.rgb);\",\n\t\t\t\"gl_FragColor.rgb = vec3(\",\n\t\t\t\t\"dot(gl_FragColor.rgb, weights.xyz),\",\n\t\t\t\t\"dot(gl_FragColor.rgb, weights.zxy),\",\n\t\t\t\t\"dot(gl_FragColor.rgb, weights.yzx)\",\n\t\t\t\");\",\n\n\t\t\t// saturation\n\t\t\t\"float average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;\",\n\t\t\t\"if (saturation > 0.0) {\",\n\t\t\t\t\"gl_FragColor.rgb += (average - gl_FragColor.rgb) * (1.0 - 1.0 / (1.001 - saturation));\",\n\t\t\t\"} else {\",\n\t\t\t\t\"gl_FragColor.rgb += (average - gl_FragColor.rgb) * (-saturation);\",\n\t\t\t\"}\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/FXAAShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/FXAAShader.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n * @author davidedc / http://www.sketchpatch.net/\n *\n * NVIDIA FXAA by Timothy Lottes\n * http://timothylottes.blogspot.com/2011/06/fxaa3-source-released.html\n * - WebGL port by @supereggbert\n * http://www.glge.org/demos/fxaa/\n */\n\nTHREE.FXAAShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\":   { type: \"t\", value: null },\n\t\t\"resolution\": { type: \"v2\", value: new THREE.Vector2( 1 / 1024, 1 / 512 )  }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"uniform vec2 resolution;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"#define FXAA_REDUCE_MIN   (1.0/128.0)\",\n\t\t\"#define FXAA_REDUCE_MUL   (1.0/8.0)\",\n\t\t\"#define FXAA_SPAN_MAX     8.0\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec3 rgbNW = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ).xyz;\",\n\t\t\t\"vec3 rgbNE = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ).xyz;\",\n\t\t\t\"vec3 rgbSW = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ).xyz;\",\n\t\t\t\"vec3 rgbSE = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ).xyz;\",\n\t\t\t\"vec4 rgbaM  = texture2D( tDiffuse,  gl_FragCoord.xy  * resolution );\",\n\t\t\t\"vec3 rgbM  = rgbaM.xyz;\",\n\t\t\t\"vec3 luma = vec3( 0.299, 0.587, 0.114 );\",\n\n\t\t\t\"float lumaNW = dot( rgbNW, luma );\",\n\t\t\t\"float lumaNE = dot( rgbNE, luma );\",\n\t\t\t\"float lumaSW = dot( rgbSW, luma );\",\n\t\t\t\"float lumaSE = dot( rgbSE, luma );\",\n\t\t\t\"float lumaM  = dot( rgbM,  luma );\",\n\t\t\t\"float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );\",\n\t\t\t\"float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );\",\n\n\t\t\t\"vec2 dir;\",\n\t\t\t\"dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\",\n\t\t\t\"dir.y =  ((lumaNW + lumaSW) - (lumaNE + lumaSE));\",\n\n\t\t\t\"float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );\",\n\n\t\t\t\"float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );\",\n\t\t\t\"dir = min( vec2( FXAA_SPAN_MAX,  FXAA_SPAN_MAX),\",\n\t\t\t\t  \"max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\",\n\t\t\t\t\t\t\"dir * rcpDirMin)) * resolution;\",\n\t\t\t\"vec4 rgbA = (1.0/2.0) * (\",\n        \t\"texture2D(tDiffuse,  gl_FragCoord.xy  * resolution + dir * (1.0/3.0 - 0.5)) +\",\n\t\t\t\"texture2D(tDiffuse,  gl_FragCoord.xy  * resolution + dir * (2.0/3.0 - 0.5)));\",\n    \t\t\"vec4 rgbB = rgbA * (1.0/2.0) + (1.0/4.0) * (\",\n\t\t\t\"texture2D(tDiffuse,  gl_FragCoord.xy  * resolution + dir * (0.0/3.0 - 0.5)) +\",\n      \t\t\"texture2D(tDiffuse,  gl_FragCoord.xy  * resolution + dir * (3.0/3.0 - 0.5)));\",\n    \t\t\"float lumaB = dot(rgbB, vec4(luma, 0.0));\",\n\n\t\t\t\"if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) ) {\",\n\n\t\t\t\t\"gl_FragColor = rgbA;\",\n\n\t\t\t\"} else {\",\n\t\t\t\t\"gl_FragColor = rgbB;\",\n\n\t\t\t\"}\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/BasicShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/BasicShader.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://www.mrdoob.com\n *\n * Simple test shader\n */\n\nTHREE.BasicShader = {\n\n\tuniforms: {},\n\n\tvertexShader: [\n\n\t\t\"void main() {\",\n\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"void main() {\",\n\n\t\t\t\"gl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/FocusShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/FocusShader.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Focus shader\n * based on PaintEffect postprocess from ro.me\n * http://code.google.com/p/3-dreams-of-black/source/browse/deploy/js/effects/PaintEffect.js\n */\n\nTHREE.FocusShader = {\n\n\tuniforms : {\n\n\t\t\"tDiffuse\":       { type: \"t\", value: null },\n\t\t\"screenWidth\":    { type: \"f\", value: 1024 },\n\t\t\"screenHeight\":   { type: \"f\", value: 1024 },\n\t\t\"sampleDistance\": { type: \"f\", value: 0.94 },\n\t\t\"waveFactor\":     { type: \"f\", value: 0.00125 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform float screenWidth;\",\n\t\t\"uniform float screenHeight;\",\n\t\t\"uniform float sampleDistance;\",\n\t\t\"uniform float waveFactor;\",\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 color, org, tmp, add;\",\n\t\t\t\"float sample_dist, f;\",\n\t\t\t\"vec2 vin;\",\n\t\t\t\"vec2 uv = vUv;\",\n\n\t\t\t\"add = color = org = texture2D( tDiffuse, uv );\",\n\n\t\t\t\"vin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );\",\n\t\t\t\"sample_dist = dot( vin, vin ) * 2.0;\",\n\n\t\t\t\"f = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;\",\n\n\t\t\t\"vec2 sampleSize = vec2(  1.0 / screenWidth, 1.0 / screenHeight ) * vec2( f );\",\n\n\t\t\t\"add += tmp = texture2D( tDiffuse, uv + vec2( 0.111964, 0.993712 ) * sampleSize );\",\n\t\t\t\"if( tmp.b < color.b ) color = tmp;\",\n\n\t\t\t\"add += tmp = texture2D( tDiffuse, uv + vec2( 0.846724, 0.532032 ) * sampleSize );\",\n\t\t\t\"if( tmp.b < color.b ) color = tmp;\",\n\n\t\t\t\"add += tmp = texture2D( tDiffuse, uv + vec2( 0.943883, -0.330279 ) * sampleSize );\",\n\t\t\t\"if( tmp.b < color.b ) color = tmp;\",\n\n\t\t\t\"add += tmp = texture2D( tDiffuse, uv + vec2( 0.330279, -0.943883 ) * sampleSize );\",\n\t\t\t\"if( tmp.b < color.b ) color = tmp;\",\n\n\t\t\t\"add += tmp = texture2D( tDiffuse, uv + vec2( -0.532032, -0.846724 ) * sampleSize );\",\n\t\t\t\"if( tmp.b < color.b ) color = tmp;\",\n\n\t\t\t\"add += tmp = texture2D( tDiffuse, uv + vec2( -0.993712, -0.111964 ) * sampleSize );\",\n\t\t\t\"if( tmp.b < color.b ) color = tmp;\",\n\n\t\t\t\"add += tmp = texture2D( tDiffuse, uv + vec2( -0.707107, 0.707107 ) * sampleSize );\",\n\t\t\t\"if( tmp.b < color.b ) color = tmp;\",\n\n\t\t\t\"color = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );\",\n\t\t\t\"color = color + ( add / vec4( 8.0 ) - color ) * ( vec4( 1.0 ) - vec4( sample_dist * 0.5 ) );\",\n\n\t\t\t\"gl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );\",\n\n\t\t\"}\"\n\n\n\t].join(\"\\n\")\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/VerticalTiltShiftShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/VerticalTiltShiftShader.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Simple fake tilt-shift effect, modulating two pass Gaussian blur (see above) by vertical position\n *\n * - 9 samples per pass\n * - standard deviation 2.7\n * - \"h\" and \"v\" parameters should be set to \"1 / width\" and \"1 / height\"\n * - \"r\" parameter control where \"focused\" horizontal line lies\n */\n\nTHREE.VerticalTiltShiftShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"v\":        { type: \"f\", value: 1.0 / 512.0 },\n\t\t\"r\":        { type: \"f\", value: 0.35 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"uniform float v;\",\n\t\t\"uniform float r;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 sum = vec4( 0.0 );\",\n\n\t\t\t\"float vv = v * abs( r - vUv.y );\",\n\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * vv ) ) * 0.051;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * vv ) ) * 0.0918;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * vv ) ) * 0.12245;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * vv ) ) * 0.1531;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * vv ) ) * 0.1531;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * vv ) ) * 0.12245;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * vv ) ) * 0.0918;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * vv ) ) * 0.051;\",\n\n\t\t\t\"gl_FragColor = sum;\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/SepiaShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/SepiaShader.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Sepia tone shader\n * based on glfx.js sepia shader\n * https://github.com/evanw/glfx.js\n */\n\nTHREE.SepiaShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"amount\":   { type: \"f\", value: 1.0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform float amount;\",\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 color = texture2D( tDiffuse, vUv );\",\n\t\t\t\"vec3 c = color.rgb;\",\n\n\t\t\t\"color.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );\",\n\t\t\t\"color.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );\",\n\t\t\t\"color.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );\",\n\n\t\t\t\"gl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/CopyShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/CopyShader.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Full-screen textured quad shader\n */\n\nTHREE.CopyShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"opacity\":  { type: \"f\", value: 1.0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform float opacity;\",\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 texel = texture2D( tDiffuse, vUv );\",\n\t\t\t\"gl_FragColor = opacity * texel;\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/ColorCorrectionShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/ColorCorrectionShader.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Color correction\n */\n\nTHREE.ColorCorrectionShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"powRGB\":   { type: \"v3\", value: new THREE.Vector3( 2, 2, 2 ) },\n\t\t\"mulRGB\":   { type: \"v3\", value: new THREE.Vector3( 1, 1, 1 ) }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"uniform vec3 powRGB;\",\n\t\t\"uniform vec3 mulRGB;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"gl_FragColor = texture2D( tDiffuse, vUv );\",\n\t\t\t\"gl_FragColor.rgb = mulRGB * pow( gl_FragColor.rgb, powRGB );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/SSAOShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/SSAOShader.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Screen-space ambient occlusion shader\n * - ported from\n *   SSAO GLSL shader v1.2\n *   assembled by Martins Upitis (martinsh) (http://devlog-martinsh.blogspot.com)\n *   original technique is made by ArKano22 (http://www.gamedev.net/topic/550699-ssao-no-halo-artifacts/)\n * - modifications\n * - modified to use RGBA packed depth texture (use clear color 1,1,1,1 for depth pass)\n * - refactoring and optimizations\n */\n\nTHREE.SSAOShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\":     { type: \"t\", value: null },\n\t\t\"tDepth\":       { type: \"t\", value: null },\n\t\t\"size\":         { type: \"v2\", value: new THREE.Vector2( 512, 512 ) },\n\t\t\"cameraNear\":   { type: \"f\", value: 1 },\n\t\t\"cameraFar\":    { type: \"f\", value: 100 },\n\t\t\"onlyAO\":       { type: \"i\", value: 0 },\n\t\t\"aoClamp\":      { type: \"f\", value: 0.5 },\n\t\t\"lumInfluence\": { type: \"f\", value: 0.5 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform float cameraNear;\",\n\t\t\"uniform float cameraFar;\",\n\n\t\t\"uniform bool onlyAO;\",      // use only ambient occlusion pass?\n\n\t\t\"uniform vec2 size;\",        // texture width, height\n\t\t\"uniform float aoClamp;\",    // depth clamp - reduces haloing at screen edges\n\n\t\t\"uniform float lumInfluence;\",  // how much luminance affects occlusion\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"uniform sampler2D tDepth;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t// \"#define PI 3.14159265\",\n\t\t\"#define DL 2.399963229728653\",  // PI * ( 3.0 - sqrt( 5.0 ) )\n\t\t\"#define EULER 2.718281828459045\",\n\n\t\t// helpers\n\n\t\t\"float width = size.x;\",   // texture width\n\t\t\"float height = size.y;\",  // texture height\n\n\t\t\"float cameraFarPlusNear = cameraFar + cameraNear;\",\n\t\t\"float cameraFarMinusNear = cameraFar - cameraNear;\",\n\t\t\"float cameraCoef = 2.0 * cameraNear;\",\n\n\t\t// user variables\n\n\t\t\"const int samples = 8;\",     // ao sample count\n\t\t\"const float radius = 5.0;\",  // ao radius\n\n\t\t\"const bool useNoise = false;\",      // use noise instead of pattern for sample dithering\n\t\t\"const float noiseAmount = 0.0003;\", // dithering amount\n\n\t\t\"const float diffArea = 0.4;\",   // self-shadowing reduction\n\t\t\"const float gDisplace = 0.4;\",  // gauss bell center\n\n\n\t\t// RGBA depth\n\n\t\t\"float unpackDepth( const in vec4 rgba_depth ) {\",\n\n\t\t\t\"const vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\",\n\t\t\t\"float depth = dot( rgba_depth, bit_shift );\",\n\t\t\t\"return depth;\",\n\n\t\t\"}\",\n\n\t\t// generating noise / pattern texture for dithering\n\n\t\t\"vec2 rand( const vec2 coord ) {\",\n\n\t\t\t\"vec2 noise;\",\n\n\t\t\t\"if ( useNoise ) {\",\n\n\t\t\t\t\"float nx = dot ( coord, vec2( 12.9898, 78.233 ) );\",\n\t\t\t\t\"float ny = dot ( coord, vec2( 12.9898, 78.233 ) * 2.0 );\",\n\n\t\t\t\t\"noise = clamp( fract ( 43758.5453 * sin( vec2( nx, ny ) ) ), 0.0, 1.0 );\",\n\n\t\t\t\"} else {\",\n\n\t\t\t\t\"float ff = fract( 1.0 - coord.s * ( width / 2.0 ) );\",\n\t\t\t\t\"float gg = fract( coord.t * ( height / 2.0 ) );\",\n\n\t\t\t\t\"noise = vec2( 0.25, 0.75 ) * vec2( ff ) + vec2( 0.75, 0.25 ) * gg;\",\n\n\t\t\t\"}\",\n\n\t\t\t\"return ( noise * 2.0  - 1.0 ) * noiseAmount;\",\n\n\t\t\"}\",\n\n\t\t\"float readDepth( const in vec2 coord ) {\",\n\n\t\t\t// \"return ( 2.0 * cameraNear ) / ( cameraFar + cameraNear - unpackDepth( texture2D( tDepth, coord ) ) * ( cameraFar - cameraNear ) );\",\n\t\t\t\"return cameraCoef / ( cameraFarPlusNear - unpackDepth( texture2D( tDepth, coord ) ) * cameraFarMinusNear );\",\n\n\n\t\t\"}\",\n\n\t\t\"float compareDepths( const in float depth1, const in float depth2, inout int far ) {\",\n\n\t\t\t\"float garea = 2.0;\",                         // gauss bell width\n\t\t\t\"float diff = ( depth1 - depth2 ) * 100.0;\",  // depth difference (0-100)\n\n\t\t\t// reduce left bell width to avoid self-shadowing\n\n\t\t\t\"if ( diff < gDisplace ) {\",\n\n\t\t\t\t\"garea = diffArea;\",\n\n\t\t\t\"} else {\",\n\n\t\t\t\t\"far = 1;\",\n\n\t\t\t\"}\",\n\n\t\t\t\"float dd = diff - gDisplace;\",\n\t\t\t\"float gauss = pow( EULER, -2.0 * dd * dd / ( garea * garea ) );\",\n\t\t\t\"return gauss;\",\n\n\t\t\"}\",\n\n\t\t\"float calcAO( float depth, float dw, float dh ) {\",\n\n\t\t\t\"float dd = radius - depth * radius;\",\n\t\t\t\"vec2 vv = vec2( dw, dh );\",\n\n\t\t\t\"vec2 coord1 = vUv + dd * vv;\",\n\t\t\t\"vec2 coord2 = vUv - dd * vv;\",\n\n\t\t\t\"float temp1 = 0.0;\",\n\t\t\t\"float temp2 = 0.0;\",\n\n\t\t\t\"int far = 0;\",\n\t\t\t\"temp1 = compareDepths( depth, readDepth( coord1 ), far );\",\n\n\t\t\t// DEPTH EXTRAPOLATION\n\n\t\t\t\"if ( far > 0 ) {\",\n\n\t\t\t\t\"temp2 = compareDepths( readDepth( coord2 ), depth, far );\",\n\t\t\t\t\"temp1 += ( 1.0 - temp1 ) * temp2;\",\n\n\t\t\t\"}\",\n\n\t\t\t\"return temp1;\",\n\n\t\t\"}\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec2 noise = rand( vUv );\",\n\t\t\t\"float depth = readDepth( vUv );\",\n\n\t\t\t\"float tt = clamp( depth, aoClamp, 1.0 );\",\n\n\t\t\t\"float w = ( 1.0 / width )  / tt + ( noise.x * ( 1.0 - noise.x ) );\",\n\t\t\t\"float h = ( 1.0 / height ) / tt + ( noise.y * ( 1.0 - noise.y ) );\",\n\n\t\t\t\"float ao = 0.0;\",\n\n\t\t\t\"float dz = 1.0 / float( samples );\",\n\t\t\t\"float z = 1.0 - dz / 2.0;\",\n\t\t\t\"float l = 0.0;\",\n\n\t\t\t\"for ( int i = 0; i <= samples; i ++ ) {\",\n\n\t\t\t\t\"float r = sqrt( 1.0 - z );\",\n\n\t\t\t\t\"float pw = cos( l ) * r;\",\n\t\t\t\t\"float ph = sin( l ) * r;\",\n\t\t\t\t\"ao += calcAO( depth, pw * w, ph * h );\",\n\t\t\t\t\"z = z - dz;\",\n\t\t\t\t\"l = l + DL;\",\n\n\t\t\t\"}\",\n\n\t\t\t\"ao /= float( samples );\",\n\t\t\t\"ao = 1.0 - ao;\",\n\n\t\t\t\"vec3 color = texture2D( tDiffuse, vUv ).rgb;\",\n\n\t\t\t\"vec3 lumcoeff = vec3( 0.299, 0.587, 0.114 );\",\n\t\t\t\"float lum = dot( color.rgb, lumcoeff );\",\n\t\t\t\"vec3 luminance = vec3( lum );\",\n\n\t\t\t\"vec3 final = vec3( color * mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );\",  // mix( color * ao, white, luminance )\n\n\t\t\t\"if ( onlyAO ) {\",\n\n\t\t\t\t\"final = vec3( mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );\",  // ambient occlusion only\n\n\t\t\t\"}\",\n\n\t\t\t\"gl_FragColor = vec4( final, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/VignetteShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/VignetteShader.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Vignette shader\n * based on PaintEffect postprocess from ro.me\n * http://code.google.com/p/3-dreams-of-black/source/browse/deploy/js/effects/PaintEffect.js\n */\n\nTHREE.VignetteShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"offset\":   { type: \"f\", value: 1.0 },\n\t\t\"darkness\": { type: \"f\", value: 1.0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform float offset;\",\n\t\t\"uniform float darkness;\",\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t// Eskil's vignette\n\n\t\t\t\"vec4 texel = texture2D( tDiffuse, vUv );\",\n\t\t\t\"vec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );\",\n\t\t\t\"gl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.a );\",\n\n\t\t\t/*\n\t\t\t// alternative version from glfx.js\n\t\t\t// this one makes more \"dusty\" look (as opposed to \"burned\")\n\n\t\t\t\"vec4 color = texture2D( tDiffuse, vUv );\",\n\t\t\t\"float dist = distance( vUv, vec2( 0.5 ) );\",\n\t\t\t\"color.rgb *= smoothstep( 0.8, offset * 0.799, dist *( darkness + offset ) );\",\n\t\t\t\"gl_FragColor = color;\",\n\t\t\t*/\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/TriangleBlurShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/TriangleBlurShader.js",
            "module-type": "library",
            "text": "/**\n * @author zz85 / http://www.lab4games.net/zz85/blog\n *\n * Triangle blur shader\n * based on glfx.js triangle blur shader\n * https://github.com/evanw/glfx.js\n *\n * A basic blur filter, which convolves the image with a\n * pyramid filter. The pyramid filter is separable and is applied as two\n * perpendicular triangle filters.\n */\n\nTHREE.TriangleBlurShader = {\n\n\tuniforms : {\n\n\t\t\"texture\": { type: \"t\", value: null },\n\t\t\"delta\":   { type: \"v2\", value:new THREE.Vector2( 1, 1 )  }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"#define ITERATIONS 10.0\",\n\n\t\t\"uniform sampler2D texture;\",\n\t\t\"uniform vec2 delta;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"float random( vec3 scale, float seed ) {\",\n\n\t\t\t// use the fragment position for a different seed per-pixel\n\n\t\t\t\"return fract( sin( dot( gl_FragCoord.xyz + seed, scale ) ) * 43758.5453 + seed );\",\n\n\t\t\"}\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 color = vec4( 0.0 );\",\n\n\t\t\t\"float total = 0.0;\",\n\n\t\t\t// randomize the lookup values to hide the fixed number of samples\n\n\t\t\t\"float offset = random( vec3( 12.9898, 78.233, 151.7182 ), 0.0 );\",\n\n\t\t\t\"for ( float t = -ITERATIONS; t <= ITERATIONS; t ++ ) {\",\n\n\t\t\t\t\"float percent = ( t + offset - 0.5 ) / ITERATIONS;\",\n\t\t\t\t\"float weight = 1.0 - abs( percent );\",\n\n\t\t\t\t\"color += texture2D( texture, vUv + delta * percent ) * weight;\",\n\t\t\t\t\"total += weight;\",\n\n\t\t\t\"}\",\n\n\t\t\t\"gl_FragColor = color / total;\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Shaders/BleachBypassShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Shaders/BleachBypassShader.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Bleach bypass shader [http://en.wikipedia.org/wiki/Bleach_bypass]\n * - based on Nvidia example\n * http://developer.download.nvidia.com/shaderlibrary/webpages/shader_library.html#post_bleach_bypass\n */\n\nTHREE.BleachBypassShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"opacity\":  { type: \"f\", value: 1.0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform float opacity;\",\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 base = texture2D( tDiffuse, vUv );\",\n\n\t\t\t\"vec3 lumCoeff = vec3( 0.25, 0.65, 0.1 );\",\n\t\t\t\"float lum = dot( lumCoeff, base.rgb );\",\n\t\t\t\"vec3 blend = vec3( lum );\",\n\n\t\t\t\"float L = min( 1.0, max( 0.0, 10.0 * ( lum - 0.45 ) ) );\",\n\n\t\t\t\"vec3 result1 = 2.0 * base.rgb * blend;\",\n\t\t\t\"vec3 result2 = 1.0 - 2.0 * ( 1.0 - blend ) * ( 1.0 - base.rgb );\",\n\n\t\t\t\"vec3 newColor = mix( result1, result2, L );\",\n\n\t\t\t\"float A2 = opacity * base.a;\",\n\t\t\t\"vec3 mixRGB = A2 * newColor.rgb;\",\n\t\t\t\"mixRGB += ( ( 1.0 - A2 ) * base.rgb );\",\n\n\t\t\t\"gl_FragColor = vec4( mixRGB, base.a );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/BlendCharacterGui.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/BlendCharacterGui.js",
            "module-type": "library",
            "text": "/**\n * @author Michael Guerrero / http://realitymeltdown.com\n */\n\nfunction BlendCharacterGui(animations) {\n\n\tvar controls = {\n\n\t\tgui: null,\n\t\t\"Lock Camera\": false,\n\t\t\"Show Model\": true,\n\t\t\"Show Skeleton\": false,\n\t\t\"Time Scale\": 1.0,\n\t\t\"Step Size\": 0.016,\n\t\t\"Crossfade Time\": 3.5,\n\t\t\"idle\": 0.33,\n\t\t\"walk\": 0.33,\n\t\t\"run\": 0.33\n\n\t};\n\n\tvar animations = animations;\n\n\tthis.showModel = function() {\n\n\t\treturn controls['Show Model'];\n\n\t};\n\n\tthis.showSkeleton = function() {\n\n\t\treturn controls['Show Skeleton'];\n\n\t};\n\n\tthis.getTimeScale = function() {\n\n\t\treturn controls['Time Scale'];\n\n\t};\n\n\tthis.update = function() {\n\n\t\tcontrols[ 'idle'] = animations[ 'idle' ].weight;\n\t\tcontrols[ 'walk'] = animations[ 'walk' ].weight;\n\t\tcontrols[ 'run'] = animations[ 'run' ].weight;\n\n\t};\n\n\tvar init = function() {\n\n\t\tcontrols.gui = new dat.GUI();\n\n\t\tvar settings = controls.gui.addFolder( 'Settings' );\n\t\tvar playback = controls.gui.addFolder( 'Playback' );\n\t\tvar blending = controls.gui.addFolder( 'Blend Tuning' );\n\n\t\tsettings.add( controls, \"Lock Camera\" ).onChange( controls.lockCameraChanged );\n\t\tsettings.add( controls, \"Show Model\" ).onChange( controls.showModelChanged );\n\t\tsettings.add( controls, \"Show Skeleton\" ).onChange( controls.showSkeletonChanged );\n\t\tsettings.add( controls, \"Time Scale\", 0, 1, 0.01 );\n\t\tsettings.add( controls, \"Step Size\", 0.01, 0.1, 0.01 );\n\t\tsettings.add( controls, \"Crossfade Time\", 0.1, 6.0, 0.05 );\n\n\t\t// These controls execute functions\n\t\tplayback.add( controls, \"start\" );\n\t\tplayback.add( controls, \"pause\" );\n\t\tplayback.add( controls, \"step\" );\n\t\tplayback.add( controls, \"idle to walk\" );\n\t\tplayback.add( controls, \"walk to run\" );\n\t\tplayback.add( controls, \"warp walk to run\" );\n\n\t\tblending.add( controls, \"idle\", 0, 1, 0.01).listen().onChange( controls.weight );\n\t\tblending.add( controls, \"walk\", 0, 1, 0.01).listen().onChange( controls.weight );\n\t\tblending.add( controls, \"run\", 0, 1, 0.01).listen().onChange( controls.weight );\n\n\t\tsettings.open();\n\t\tplayback.open();\n\t\tblending.open();\n\n\t}\n\n\tvar getAnimationData = function() {\n\n\t\treturn {\n\n\t\t\tdetail: {\n\n\t\t\t\tanims: [ \"idle\", \"walk\", \"run\" ],\n\n\t\t\t\tweights: [ controls['idle'],\n\t\t\t\t\t\t   controls['walk'],\n\t\t\t\t\t\t   controls['run'] ]\n\t\t\t}\n\n\t\t};\n\t}\n\n\tcontrols.start = function() {\n\n\t\tvar startEvent = new CustomEvent( 'start-animation', getAnimationData() );\n\t\twindow.dispatchEvent(startEvent);\n\n\t};\n\n\tcontrols.stop = function() {\n\n\t\tvar stopEvent = new CustomEvent( 'stop-animation' );\n\t\twindow.dispatchEvent( stopEvent );\n\n\t};\n\n\tcontrols.pause = function() {\n\n\t\tvar pauseEvent = new CustomEvent( 'pause-animation' );\n\t\twindow.dispatchEvent( pauseEvent );\n\n\t};\n\n\tcontrols.step = function() {\n\n\t\tvar stepData = { detail: { stepSize: controls['Step Size'] } };\n\t\twindow.dispatchEvent( new CustomEvent('step-animation', stepData ));\n\n\t};\n\n\tcontrols.weight = function() {\n\n\t\t// renormalize\n\t\tvar sum = controls['idle'] + controls['walk'] + controls['run'];\n\t\tcontrols['idle'] /= sum;\n\t\tcontrols['walk'] /= sum;\n\t\tcontrols['run'] /= sum;\n\n\t\tvar weightEvent = new CustomEvent( 'weight-animation', getAnimationData() );\n\t\twindow.dispatchEvent(weightEvent);\n\t};\n\n\tcontrols.crossfade = function( from, to ) {\n\n\t\tvar fadeData = getAnimationData();\n\t\tfadeData.detail.from = from;\n\t\tfadeData.detail.to = to;\n\t\tfadeData.detail.time = controls[ \"Crossfade Time\" ];\n\n\t\twindow.dispatchEvent( new CustomEvent( 'crossfade', fadeData ) );\n\t}\n\n\tcontrols.warp = function( from, to ) {\n\n\t\tvar warpData = getAnimationData();\n\t\twarpData.detail.from = 'walk';\n\t\twarpData.detail.to = 'run';\n\t\twarpData.detail.time = controls[ \"Crossfade Time\" ];\n\n\t\twindow.dispatchEvent( new CustomEvent( 'warp', warpData ) );\n\t}\n\n\tcontrols['idle to walk'] = function() {\n\n\t\tcontrols.crossfade( 'idle', 'walk' );\n\n\t};\n\n\tcontrols['walk to run'] = function() {\n\n\t\tcontrols.crossfade( 'walk', 'run' );\n\n\t};\n\n\tcontrols['warp walk to run'] = function() {\n\n\t\tcontrols.warp( 'walk', 'run' );\n\n\t};\n\n\tcontrols.lockCameraChanged = function() {\n\n\t\tvar data = {\n\t\t\tdetail: {\n\t\t\t\tshouldLock: controls['Lock Camera']\n\t\t\t}\n\t\t}\n\n\t\twindow.dispatchEvent( new CustomEvent( 'toggle-lock-camera', data ) );\n\t}\n\n\tcontrols.showSkeletonChanged = function() {\n\n\t\tvar data = {\n\t\t\tdetail: {\n\t\t\t\tshouldShow: controls['Show Skeleton']\n\t\t\t}\n\t\t}\n\n\t\twindow.dispatchEvent( new CustomEvent( 'toggle-show-skeleton', data ) );\n\t}\n\n\n\tcontrols.showModelChanged = function() {\n\n\t\tvar data = {\n\t\t\tdetail: {\n\t\t\t\tshouldShow: controls['Show Model']\n\t\t\t}\n\t\t}\n\n\t\twindow.dispatchEvent( new CustomEvent( 'toggle-show-model', data ) );\n\t}\n\n\n\tinit.call(this);\n\n}"
        },
        "$:/plugins/rboue/Three.js/Lib/Curves/NURBSCurve.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Curves/NURBSCurve.js",
            "module-type": "library",
            "text": "/**\n * @author renej\n * NURBS curve object\n *\n * Derives from Curve, overriding getPoint and getTangent.\n *\n * Implementation is based on (x, y [, z=0 [, w=1]]) control points with w=weight.\n *\n **/\n\n\n/**************************************************************\n *\tNURBS curve\n **************************************************************/\n\nTHREE.NURBSCurve = function ( degree, knots /* array of reals */, controlPoints /* array of Vector(2|3|4) */) {\n\n\tthis.degree = degree;\n\tthis.knots = knots;\n\tthis.controlPoints = [];\n\tfor (var i = 0; i < controlPoints.length; ++i) { // ensure Vector4 for control points\n\t\tvar point = controlPoints[i];\n\t\tthis.controlPoints[i] = new THREE.Vector4(point.x, point.y, point.z, point.w);\n\t}\n\n};\n\n\nTHREE.NURBSCurve.prototype = Object.create( THREE.Curve.prototype );\n\n\nTHREE.NURBSCurve.prototype.getPoint = function ( t ) {\n\n\tvar u = this.knots[0] + t * (this.knots[this.knots.length - 1] - this.knots[0]); // linear mapping t->u\n\n\t// following results in (wx, wy, wz, w) homogeneous point\n\tvar hpoint = THREE.NURBSUtils.calcBSplinePoint(this.degree, this.knots, this.controlPoints, u);\n\n\tif (hpoint.w != 1.0) { // project to 3D space: (wx, wy, wz, w) -> (x, y, z, 1)\n\t\thpoint.divideScalar(hpoint.w);\n\t}\n\n\treturn new THREE.Vector3(hpoint.x, hpoint.y, hpoint.z);\n};\n\n\nTHREE.NURBSCurve.prototype.getTangent = function ( t ) {\n\n\tvar u = this.knots[0] + t * (this.knots[this.knots.length - 1] - this.knots[0]);\n\tvar ders = THREE.NURBSUtils.calcNURBSDerivatives(this.degree, this.knots, this.controlPoints, u, 1);\n\tvar tangent = ders[1].clone();\n\ttangent.normalize();\n\n\treturn tangent;\n};\n\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Curves/NURBSSurface.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Curves/NURBSSurface.js",
            "module-type": "library",
            "text": "/**\n * @author renej\n * NURBS surface object\n *\n * Implementation is based on (x, y [, z=0 [, w=1]]) control points with w=weight.\n *\n **/\n\n\n/**************************************************************\n *\tNURBS surface\n **************************************************************/\n\nTHREE.NURBSSurface = function ( degree1, degree2, knots1, knots2 /* arrays of reals */, controlPoints /* array^2 of Vector(2|3|4) */) {\n\n\tthis.degree1 = degree1;\n\tthis.degree2 = degree2;\n\tthis.knots1 = knots1;\n\tthis.knots2 = knots2;\n\tthis.controlPoints = [];\n\n\tvar len1 = knots1.length - degree1 - 1;\n\tvar len2 = knots2.length - degree2 - 1;\n\n\t// ensure Vector4 for control points\n\tfor (var i = 0; i < len1; ++i) {\n\t\tthis.controlPoints[i] = []\n\t\tfor (var j = 0; j < len2; ++j) {\n\t\t\tvar point = controlPoints[i][j];\n\t\t\tthis.controlPoints[i][j] = new THREE.Vector4(point.x, point.y, point.z, point.w);\n\t\t}\n\t}\n};\n\n\nTHREE.NURBSSurface.prototype = {\n\n\tconstructor: THREE.NURBSSurface,\n\n\tgetPoint: function ( t1, t2 ) {\n\n\t\tvar u = this.knots1[0] + t1 * (this.knots1[this.knots1.length - 1] - this.knots1[0]); // linear mapping t1->u\n\t\tvar v = this.knots2[0] + t2 * (this.knots2[this.knots2.length - 1] - this.knots2[0]); // linear mapping t2->u\n\n\t\treturn THREE.NURBSUtils.calcSurfacePoint(this.degree1, this.degree2, this.knots1, this.knots2, this.controlPoints, u, v);\n\t}\n};\n\n\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Curves/NURBSUtils.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Curves/NURBSUtils.js",
            "module-type": "library",
            "text": "/**\n * @author renej\n * NURBS utils\n *\n * See NURBSCurve and NURBSSurface.\n *\n **/\n\n\n/**************************************************************\n *\tNURBS Utils\n **************************************************************/\n\nTHREE.NURBSUtils = {\n\n\t/*\n\tFinds knot vector span.\n\n\tp : degree\n\tu : parametric value\n\tU : knot vector\n\t\n\treturns the span\n\t*/\n\tfindSpan: function( p,  u,  U ) {\n\t\tvar n = U.length - p - 1;\n\n\t\tif (u >= U[n]) {\n\t\t\treturn n - 1;\n\t\t}\n\n\t\tif (u <= U[p]) {\n\t\t\treturn p;\n\t\t}\n\n\t\tvar low = p;\n\t\tvar high = n;\n\t\tvar mid = Math.floor((low + high) / 2);\n\n\t\twhile (u < U[mid] || u >= U[mid + 1]) {\n\t\t  \n\t\t\tif (u < U[mid]) {\n\t\t\t\thigh = mid;\n\t\t\t} else {\n\t\t\t\tlow = mid;\n\t\t\t}\n\n\t\t\tmid = Math.floor((low + high) / 2);\n\t\t}\n\n\t\treturn mid;\n\t},\n    \n\t\t\n\t/*\n\tCalculate basis functions. See The NURBS Book, page 70, algorithm A2.2\n   \n\tspan : span in which u lies\n\tu    : parametric point\n\tp    : degree\n\tU    : knot vector\n\t\n\treturns array[p+1] with basis functions values.\n\t*/\n\tcalcBasisFunctions: function( span, u, p, U ) {\n\t\tvar N = [];\n\t\tvar left = [];\n\t\tvar right = [];\n\t\tN[0] = 1.0;\n\n\t\tfor (var j = 1; j <= p; ++j) {\n\t   \n\t\t\tleft[j] = u - U[span + 1 - j];\n\t\t\tright[j] = U[span + j] - u;\n\n\t\t\tvar saved = 0.0;\n\n\t\t\tfor (var r = 0; r < j; ++r) {\n\n\t\t\t\tvar rv = right[r + 1];\n\t\t\t\tvar lv = left[j - r];\n\t\t\t\tvar temp = N[r] / (rv + lv);\n\t\t\t\tN[r] = saved + rv * temp;\n\t\t\t\tsaved = lv * temp;\n\t\t\t }\n\n\t\t\t N[j] = saved;\n\t\t }\n\n\t\t return N;\n\t},\n\n\n\t/*\n\tCalculate B-Spline curve points. See The NURBS Book, page 82, algorithm A3.1.\n \n\tp : degree of B-Spline\n\tU : knot vector\n\tP : control points (x, y, z, w)\n\tu : parametric point\n\n\treturns point for given u\n\t*/\n\tcalcBSplinePoint: function( p, U, P, u ) {\n\t\tvar span = this.findSpan(p, u, U);\n\t\tvar N = this.calcBasisFunctions(span, u, p, U);\n\t\tvar C = new THREE.Vector4(0, 0, 0, 0);\n\n\t\tfor (var j = 0; j <= p; ++j) {\n\t\t\tvar point = P[span - p + j];\n\t\t\tvar Nj = N[j];\n\t\t\tvar wNj = point.w * Nj;\n\t\t\tC.x += point.x * wNj;\n\t\t\tC.y += point.y * wNj;\n\t\t\tC.z += point.z * wNj;\n\t\t\tC.w += point.w * Nj;\n\t\t}\n\n\t\treturn C;\n\t},\n\n\n\t/*\n\tCalculate basis functions derivatives. See The NURBS Book, page 72, algorithm A2.3.\n\n\tspan : span in which u lies\n\tu    : parametric point\n\tp    : degree\n\tn    : number of derivatives to calculate\n\tU    : knot vector\n\n\treturns array[n+1][p+1] with basis functions derivatives\n\t*/\n\tcalcBasisFunctionDerivatives: function( span,  u,  p,  n,  U ) {\n\n\t\tvar zeroArr = [];\n\t\tfor (var i = 0; i <= p; ++i)\n\t\t\tzeroArr[i] = 0.0;\n\n\t\tvar ders = [];\n\t\tfor (var i = 0; i <= n; ++i)\n\t\t\tders[i] = zeroArr.slice(0);\n\n\t\tvar ndu = [];\n\t\tfor (var i = 0; i <= p; ++i)\n\t\t\tndu[i] = zeroArr.slice(0);\n\n\t\tndu[0][0] = 1.0;\n\n\t\tvar left = zeroArr.slice(0);\n\t\tvar right = zeroArr.slice(0);\n\n\t\tfor (var j = 1; j <= p; ++j) {\n\t\t\tleft[j] = u - U[span + 1 - j];\n\t\t\tright[j] = U[span + j] - u;\n\n\t\t\tvar saved = 0.0;\n\n\t\t\tfor (var r = 0; r < j; ++r) {\n\t\t\t\tvar rv = right[r + 1];\n\t\t\t\tvar lv = left[j - r];\n\t\t\t\tndu[j][r] = rv + lv;\n\n\t\t\t\tvar temp = ndu[r][j - 1] / ndu[j][r];\n\t\t\t\tndu[r][j] = saved + rv * temp;\n\t\t\t\tsaved = lv * temp;\n\t\t\t}\n\n\t\t\tndu[j][j] = saved;\n\t\t}\n\n\t\tfor (var j = 0; j <= p; ++j) {\n\t\t\tders[0][j] = ndu[j][p];\n\t\t}\n\n\t\tfor (var r = 0; r <= p; ++r) {\n\t\t\tvar s1 = 0;\n\t\t\tvar s2 = 1;\n\n\t\t\tvar a = [];\n\t\t\tfor (var i = 0; i <= p; ++i) {\n\t\t\t\ta[i] = zeroArr.slice(0);\n\t\t\t}\n\t\t\ta[0][0] = 1.0;\n\n\t\t\tfor (var k = 1; k <= n; ++k) {\n\t\t\t\tvar d = 0.0;\n\t\t\t\tvar rk = r - k;\n\t\t\t\tvar pk = p - k;\n\n\t\t\t\tif (r >= k) {\n\t\t\t\t\ta[s2][0] = a[s1][0] / ndu[pk + 1][rk];\n\t\t\t\t\td = a[s2][0] * ndu[rk][pk];\n\t\t\t\t}\n\n\t\t\t\tvar j1 = (rk >= -1) ? 1 : -rk;\n\t\t\t\tvar j2 = (r - 1 <= pk) ? k - 1 :  p - r;\n\n\t\t\t\tfor (var j = j1; j <= j2; ++j) {\n\t\t\t\t\ta[s2][j] = (a[s1][j] - a[s1][j - 1]) / ndu[pk + 1][rk + j];\n\t\t\t\t\td += a[s2][j] * ndu[rk + j][pk];\n\t\t\t\t}\n\n\t\t\t\tif (r <= pk) {\n\t\t\t\t\ta[s2][k] = -a[s1][k - 1] / ndu[pk + 1][r];\n\t\t\t\t\td += a[s2][k] * ndu[r][pk];\n\t\t\t\t}\n\n\t\t\t\tders[k][r] = d;\n\n\t\t\t\tvar j = s1;\n\t\t\t\ts1 = s2;\n\t\t\t\ts2 = j;\n\t\t\t}\n\t\t}\n\n\t\tvar r = p;\n\n\t\tfor (var k = 1; k <= n; ++k) {\n\t\t\tfor (var j = 0; j <= p; ++j) {\n\t\t\t\tders[k][j] *= r;\n\t\t\t}\n\t\t\tr *= p - k;\n\t\t}\n\n\t\treturn ders;\n\t},\n\n\n \t/*\n\tCalculate derivatives of a B-Spline. See The NURBS Book, page 93, algorithm A3.2.\n\n\tp  : degree\n\tU  : knot vector\n\tP  : control points\n\tu  : Parametric points\n\tnd : number of derivatives\n\n\treturns array[d+1] with derivatives\n\t*/\n\tcalcBSplineDerivatives: function( p,  U,  P,  u,  nd ) {\n\t\tvar du = nd < p ? nd : p;\n\t\tvar CK = [];\n\t\tvar span = this.findSpan(p, u, U);\n\t\tvar nders = this.calcBasisFunctionDerivatives(span, u, p, du, U);\n\t\tvar Pw = [];\n\n\t\tfor (var i = 0; i < P.length; ++i) {\n\t\t\tvar point = P[i].clone();\n\t\t\tvar w = point.w;\n\n\t\t\tpoint.x *= w;\n\t\t\tpoint.y *= w;\n\t\t\tpoint.z *= w;\n\n\t\t\tPw[i] = point;\n\t\t}\n\t\tfor (var k = 0; k <= du; ++k) {\n\t\t\tvar point = Pw[span - p].clone().multiplyScalar(nders[k][0]);\n\n\t\t\tfor (var j = 1; j <= p; ++j) {\n\t\t\t\tpoint.add(Pw[span - p + j].clone().multiplyScalar(nders[k][j]));\n\t\t\t}\n\n\t\t\tCK[k] = point;\n\t\t}\n\n\t\tfor (var k = du + 1; k <= nd + 1; ++k) {\n\t\t\tCK[k] = new THREE.Vector4(0, 0, 0);\n\t\t}\n\n\t\treturn CK;\n\t},\n\n\n\t/*\n\tCalculate \"K over I\"\n\n\treturns k!/(i!(k-i)!)\n\t*/\n\tcalcKoverI: function( k, i ) {\n\t\tvar nom = 1;\n\n\t\tfor (var j = 2; j <= k; ++j) {\n\t\t\tnom *= j;\n\t\t}\n\n\t\tvar denom = 1;\n\n\t\tfor (var j = 2; j <= i; ++j) {\n\t\t\tdenom *= j;\n\t\t}\n\n\t\tfor (var j = 2; j <= k - i; ++j) {\n\t\t\tdenom *= j;\n\t\t}\n\n\t\treturn nom / denom;\n\t},\n\n\n\t/*\n\tCalculate derivatives (0-nd) of rational curve. See The NURBS Book, page 127, algorithm A4.2.\n\n\tPders : result of function calcBSplineDerivatives\n\n\treturns array with derivatives for rational curve.\n\t*/\n\tcalcRationalCurveDerivatives: function ( Pders ) {\n\t\tvar nd = Pders.length;\n\t\tvar Aders = [];\n\t\tvar wders = [];\n\n\t\tfor (var i = 0; i < nd; ++i) {\n\t\t\tvar point = Pders[i];\n\t\t\tAders[i] = new THREE.Vector3(point.x, point.y, point.z);\n\t\t\twders[i] = point.w;\n\t\t}\n\n\t\tvar CK = [];\n\n\t\tfor (var k = 0; k < nd; ++k) {\n\t\t\tvar v = Aders[k].clone();\n\n\t\t\tfor (var i = 1; i <= k; ++i) {\n\t\t\t\tv.sub(CK[k - i].clone().multiplyScalar(this.calcKoverI(k,i) * wders[i]));\n\t\t\t}\n\n\t\t\tCK[k] = v.divideScalar(wders[0]);\n\t\t}\n\n\t\treturn CK;\n\t},\n\n\n\t/*\n\tCalculate NURBS curve derivatives. See The NURBS Book, page 127, algorithm A4.2.\n\n\tp  : degree\n\tU  : knot vector\n\tP  : control points in homogeneous space\n\tu  : parametric points\n\tnd : number of derivatives\n\n\treturns array with derivatives.\n\t*/\n\tcalcNURBSDerivatives: function( p,  U,  P,  u,  nd ) {\n\t\tvar Pders = this.calcBSplineDerivatives(p, U, P, u, nd);\n\t\treturn this.calcRationalCurveDerivatives(Pders);\n\t},\n\n\n\t/*\n\tCalculate rational B-Spline surface point. See The NURBS Book, page 134, algorithm A4.3.\n \n\tp1, p2 : degrees of B-Spline surface\n\tU1, U2 : knot vectors\n\tP      : control points (x, y, z, w)\n\tu, v   : parametric values\n\n\treturns point for given (u, v)\n\t*/\n\tcalcSurfacePoint: function( p, q, U, V, P, u, v ) {\n\t\tvar uspan = this.findSpan(p, u, U);\n\t\tvar vspan = this.findSpan(q, v, V);\n\t\tvar Nu = this.calcBasisFunctions(uspan, u, p, U);\n\t\tvar Nv = this.calcBasisFunctions(vspan, v, q, V);\n\t\tvar temp = [];\n\n\t\tfor (var l = 0; l <= q; ++l) {\n\t\t\ttemp[l] = new THREE.Vector4(0, 0, 0, 0);\n\t\t\tfor (var k = 0; k <= p; ++k) {\n\t\t\t\tvar point = P[uspan - p + k][vspan - q + l].clone();\n\t\t\t\tvar w = point.w;\n\t\t\t\tpoint.x *= w;\n\t\t\t\tpoint.y *= w;\n\t\t\t\tpoint.z *= w;\n\t\t\t\ttemp[l].add(point.multiplyScalar(Nu[k]));\n\t\t\t}\n\t\t}\n\n\t\tvar Sw = new THREE.Vector4(0, 0, 0, 0);\n\t\tfor (var l = 0; l <= q; ++l) {\n\t\t\tSw.add(temp[l].multiplyScalar(Nv[l]));\n\t\t}\n\n\t\tSw.divideScalar(Sw.w);\n\t\treturn new THREE.Vector3(Sw.x, Sw.y, Sw.z);\n\t}\n\n};\n\n\n\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Geometries/ConvexGeometry.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Geometries/ConvexGeometry.js",
            "module-type": "library",
            "text": "/**\n * @author qiao / https://github.com/qiao\n * @fileoverview This is a convex hull generator using the incremental method. \n * The complexity is O(n^2) where n is the number of vertices.\n * O(nlogn) algorithms do exist, but they are much more complicated.\n *\n * Benchmark: \n *\n *  Platform: CPU: P7350 @2.00GHz Engine: V8\n *\n *  Num Vertices\tTime(ms)\n *\n *     10           1\n *     20           3\n *     30           19\n *     40           48\n *     50           107\n */\n\nTHREE.ConvexGeometry = function( vertices ) {\n\n\tTHREE.Geometry.call( this );\n\n\tvar faces = [ [ 0, 1, 2 ], [ 0, 2, 1 ] ]; \n\n\tfor ( var i = 3; i < vertices.length; i++ ) {\n\n\t\taddPoint( i );\n\n\t}\n\n\n\tfunction addPoint( vertexId ) {\n\n\t\tvar vertex = vertices[ vertexId ].clone();\n\n\t\tvar mag = vertex.length();\n\t\tvertex.x += mag * randomOffset();\n\t\tvertex.y += mag * randomOffset();\n\t\tvertex.z += mag * randomOffset();\n\n\t\tvar hole = [];\n\n\t\tfor ( var f = 0; f < faces.length; ) {\n\n\t\t\tvar face = faces[ f ];\n\n\t\t\t// for each face, if the vertex can see it,\n\t\t\t// then we try to add the face's edges into the hole.\n\t\t\tif ( visible( face, vertex ) ) {\n\n\t\t\t\tfor ( var e = 0; e < 3; e++ ) {\n\n\t\t\t\t\tvar edge = [ face[ e ], face[ ( e + 1 ) % 3 ] ];\n\t\t\t\t\tvar boundary = true;\n\n\t\t\t\t\t// remove duplicated edges.\n\t\t\t\t\tfor ( var h = 0; h < hole.length; h++ ) {\n\n\t\t\t\t\t\tif ( equalEdge( hole[ h ], edge ) ) {\n\n\t\t\t\t\t\t\thole[ h ] = hole[ hole.length - 1 ];\n\t\t\t\t\t\t\thole.pop();\n\t\t\t\t\t\t\tboundary = false;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( boundary ) {\n\n\t\t\t\t\t\thole.push( edge );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t// remove faces[ f ]\n\t\t\t\tfaces[ f ] = faces[ faces.length - 1 ];\n\t\t\t\tfaces.pop();\n\n\t\t\t} else { // not visible\n\n\t\t\t\tf++;\n\n\t\t\t}\n\t\t}\n\n\t\t// construct the new faces formed by the edges of the hole and the vertex\n\t\tfor ( var h = 0; h < hole.length; h++ ) {\n\n\t\t\tfaces.push( [ \n\t\t\t\thole[ h ][ 0 ],\n\t\t\t\thole[ h ][ 1 ],\n\t\t\t\tvertexId\n\t\t\t] );\n\n\t\t}\n\t}\n\n\t/**\n\t * Whether the face is visible from the vertex\n\t */\n\tfunction visible( face, vertex ) {\n\n\t\tvar va = vertices[ face[ 0 ] ];\n\t\tvar vb = vertices[ face[ 1 ] ];\n\t\tvar vc = vertices[ face[ 2 ] ];\n\n\t\tvar n = normal( va, vb, vc );\n\n\t\t// distance from face to origin\n\t\tvar dist = n.dot( va );\n\n\t\treturn n.dot( vertex ) >= dist; \n\n\t}\n\n\t/**\n\t * Face normal\n\t */\n\tfunction normal( va, vb, vc ) {\n\n\t\tvar cb = new THREE.Vector3();\n\t\tvar ab = new THREE.Vector3();\n\n\t\tcb.subVectors( vc, vb );\n\t\tab.subVectors( va, vb );\n\t\tcb.cross( ab );\n\n\t\tcb.normalize();\n\n\t\treturn cb;\n\n\t}\n\n\t/**\n\t * Detect whether two edges are equal.\n\t * Note that when constructing the convex hull, two same edges can only\n\t * be of the negative direction.\n\t */\n\tfunction equalEdge( ea, eb ) {\n\n\t\treturn ea[ 0 ] === eb[ 1 ] && ea[ 1 ] === eb[ 0 ]; \n\n\t}\n\n\t/**\n\t * Create a random offset between -1e-6 and 1e-6.\n\t */\n\tfunction randomOffset() {\n\n\t\treturn ( Math.random() - 0.5 ) * 2 * 1e-6;\n\n\t}\n\n\n\t/**\n\t * XXX: Not sure if this is the correct approach. Need someone to review.\n\t */\n\tfunction vertexUv( vertex ) {\n\n\t\tvar mag = vertex.length();\n\t\treturn new THREE.Vector2( vertex.x / mag, vertex.y / mag );\n\n\t}\n\n\t// Push vertices into `this.vertices`, skipping those inside the hull\n\tvar id = 0;\n\tvar newId = new Array( vertices.length ); // map from old vertex id to new id\n\n\tfor ( var i = 0; i < faces.length; i++ ) {\n\n\t\t var face = faces[ i ];\n\n\t\t for ( var j = 0; j < 3; j++ ) {\n\n\t\t\t\tif ( newId[ face[ j ] ] === undefined ) {\n\n\t\t\t\t\t\tnewId[ face[ j ] ] = id++;\n\t\t\t\t\t\tthis.vertices.push( vertices[ face[ j ] ] );\n\n\t\t\t\t}\n\n\t\t\t\tface[ j ] = newId[ face[ j ] ];\n\n\t\t }\n\n\t}\n\n\t// Convert faces into instances of THREE.Face3\n\tfor ( var i = 0; i < faces.length; i++ ) {\n\n\t\tthis.faces.push( new THREE.Face3( \n\t\t\t\tfaces[ i ][ 0 ],\n\t\t\t\tfaces[ i ][ 1 ],\n\t\t\t\tfaces[ i ][ 2 ]\n\t\t) );\n\n\t}\n\n\t// Compute UVs\n\tfor ( var i = 0; i < this.faces.length; i++ ) {\n\n\t\tvar face = this.faces[ i ];\n\n\t\tthis.faceVertexUvs[ 0 ].push( [\n\t\t\tvertexUv( this.vertices[ face.a ] ),\n\t\t\tvertexUv( this.vertices[ face.b ] ),\n\t\t\tvertexUv( this.vertices[ face.c ])\n\t\t] );\n\n\t}\n\n\tthis.computeFaceNormals();\n\tthis.computeVertexNormals();\n\n};\n\nTHREE.ConvexGeometry.prototype = Object.create( THREE.Geometry.prototype );\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Geometries/hilbert2D.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Geometries/hilbert2D.js",
            "module-type": "library",
            "text": "/**\n * Hilbert Curve: Generates 2D-Coordinates in a very fast way.\n *\n * @author Dylan Grafmyre\n *\n * Based on work by:\n * @author Thomas Diewald\n * @link http://www.openprocessing.org/sketch/15493\n *\n * @param center     Center of Hilbert curve.\n * @param size       Total width of Hilbert curve.\n * @param iterations Number of subdivisions.\n * @param v0         Corner index -X, -Z.\n * @param v1         Corner index -X, +Z.\n * @param v2         Corner index +X, +Z.\n * @param v3         Corner index +X, -Z.\n */\nfunction hilbert2D (center, size, iterations, v0, v1, v2, v3) {\n\t// Default Vars\n\tvar center     = undefined !== center ? center : new THREE.Vector3(0, 0, 0),\n\t\tsize       = undefined !== size ? size : 10,\n\t\thalf       = size / 2,\n\t\titerations = undefined !== iterations ? iterations : 1,\n\t\tv0 = undefined !== v0 ? v0 : 0,\n\t\tv1 = undefined !== v1 ? v1 : 1,\n\t\tv2 = undefined !== v2 ? v2 : 2,\n\t\tv3 = undefined !== v3 ? v3 : 3\n\t;\n\n\tvar vec_s = [\n\t\tnew THREE.Vector3( center.x - half, center.y, center.z - half ),\n\t\tnew THREE.Vector3( center.x - half, center.y, center.z + half ),\n\t\tnew THREE.Vector3( center.x + half, center.y, center.z + half ),\n\t\tnew THREE.Vector3( center.x + half, center.y, center.z - half )\n\t];\n\n\tvar vec = [\n\t\tvec_s[ v0 ],\n\t\tvec_s[ v1 ],\n\t\tvec_s[ v2 ],\n\t\tvec_s[ v3 ]\n\t];\n\n\t// Recurse iterations\n\tif (0 <= --iterations) {\n\t\tvar tmp = [];\n\n\t\tArray.prototype.push.apply( tmp, hilbert2D ( vec[ 0 ], half, iterations, v0, v3, v2, v1 ) );\n\t\tArray.prototype.push.apply( tmp, hilbert2D ( vec[ 1 ], half, iterations, v0, v1, v2, v3 ) );\n\t\tArray.prototype.push.apply( tmp, hilbert2D ( vec[ 2 ], half, iterations, v0, v1, v2, v3 ) );\n\t\tArray.prototype.push.apply( tmp, hilbert2D ( vec[ 3 ], half, iterations, v2, v1, v0, v3 ) );\n\n\t\t// Return recursive call\n\t\treturn tmp;\n\t}\n\n\t// Return complete Hilbert Curve.\n\treturn vec;\n}\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Geometries/hilbert3D.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Geometries/hilbert3D.js",
            "module-type": "library",
            "text": "/**\n * Hilbert Curve: Generates 2D-Coordinates in a very fast way.\n *\n * @author Dylan Grafmyre\n *\n * Based on work by:\n * @author Thomas Diewald\n * @link http://www.openprocessing.org/visuals/?visualID=15599\n *\n * Based on `examples/canvas_lines_colors.html`:\n * @author OpenShift guest\n * @link https://github.com/mrdoob/three.js/blob/8413a860aa95ed29c79cbb7f857c97d7880d260f/examples/canvas_lines_colors.html\n * @see  Line 149 - 186\n *\n * @param center     Center of Hilbert curve.\n * @param size       Total width of Hilbert curve.\n * @param iterations Number of subdivisions.\n * @param v0         Corner index -X, +Y, -Z.\n * @param v1         Corner index -X, +Y, +Z.\n * @param v2         Corner index -X, -Y, +Z.\n * @param v3         Corner index -X, -Y, -Z.\n * @param v4         Corner index +X, -Y, -Z.\n * @param v5         Corner index +X, -Y, +Z.\n * @param v6         Corner index +X, +Y, +Z.\n * @param v7         Corner index +X, +Y, -Z.\n */\nfunction hilbert3D(center, size, iterations, v0, v1, v2, v3, v4, v5, v6, v7) {\n\t// Default Vars\n\tvar center     = undefined !== center ? center : new THREE.Vector3(0, 0, 0),\n\t\tsize       = undefined !== size ? size : 10,\n\t\thalf       = size / 2,\n\t\titerations = undefined !== iterations ? iterations : 1,\n\t\tv0 = undefined !== v0 ? v0 : 0,\n\t\tv1 = undefined !== v1 ? v1 : 1,\n\t\tv2 = undefined !== v2 ? v2 : 2,\n\t\tv3 = undefined !== v3 ? v3 : 3,\n\t\tv4 = undefined !== v4 ? v4 : 4,\n\t\tv5 = undefined !== v5 ? v5 : 5,\n\t\tv6 = undefined !== v6 ? v6 : 6,\n\t\tv7 = undefined !== v7 ? v7 : 7\n\t;\n\n\tvar vec_s = [\n\t\tnew THREE.Vector3( center.x - half, center.y + half, center.z - half ),\n\t\tnew THREE.Vector3( center.x - half, center.y + half, center.z + half ),\n\t\tnew THREE.Vector3( center.x - half, center.y - half, center.z + half ),\n\t\tnew THREE.Vector3( center.x - half, center.y - half, center.z - half ),\n\t\tnew THREE.Vector3( center.x + half, center.y - half, center.z - half ),\n\t\tnew THREE.Vector3( center.x + half, center.y - half, center.z + half ),\n\t\tnew THREE.Vector3( center.x + half, center.y + half, center.z + half ),\n\t\tnew THREE.Vector3( center.x + half, center.y + half, center.z - half )\n\t];\n\n\tvar vec = [\n\t\tvec_s[ v0 ],\n\t\tvec_s[ v1 ],\n\t\tvec_s[ v2 ],\n\t\tvec_s[ v3 ],\n\t\tvec_s[ v4 ],\n\t\tvec_s[ v5 ],\n\t\tvec_s[ v6 ],\n\t\tvec_s[ v7 ]\n\t];\n\n\t// Recurse iterations\n\tif( --iterations >= 0 ) {\n\t\tvar tmp = [];\n\n\t\tArray.prototype.push.apply( tmp, hilbert3D ( vec[ 0 ], half, iterations, v0, v3, v4, v7, v6, v5, v2, v1 ) );\n\t\tArray.prototype.push.apply( tmp, hilbert3D ( vec[ 1 ], half, iterations, v0, v7, v6, v1, v2, v5, v4, v3 ) );\n\t\tArray.prototype.push.apply( tmp, hilbert3D ( vec[ 2 ], half, iterations, v0, v7, v6, v1, v2, v5, v4, v3 ) );\n\t\tArray.prototype.push.apply( tmp, hilbert3D ( vec[ 3 ], half, iterations, v2, v3, v0, v1, v6, v7, v4, v5 ) );\n\t\tArray.prototype.push.apply( tmp, hilbert3D ( vec[ 4 ], half, iterations, v2, v3, v0, v1, v6, v7, v4, v5 ) );\n\t\tArray.prototype.push.apply( tmp, hilbert3D ( vec[ 5 ], half, iterations, v4, v3, v2, v5, v6, v1, v0, v7 ) );\n\t\tArray.prototype.push.apply( tmp, hilbert3D ( vec[ 6 ], half, iterations, v4, v3, v2, v5, v6, v1, v0, v7 ) );\n\t\tArray.prototype.push.apply( tmp, hilbert3D ( vec[ 7 ], half, iterations, v6, v5, v2, v1, v0, v3, v4, v7 ) );\n\n\t\t// Return recursive call\n\t\treturn tmp;\n\t}\n\n\t// Return complete Hilbert Curve.\n\treturn vec;\n}\n"
        },
        "$:/plugins/rboue/Three.js/Lib/PRNG.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/PRNG.js",
            "module-type": "library",
            "text": "// Park-Miller-Carta Pseudo-Random Number Generator\n// https://github.com/pnitsch/BitmapData.js/blob/master/js/BitmapData.js\n\nvar PRNG = function () {\n\n\tthis.seed = 1;\n\tthis.next = function() { return (this.gen() / 2147483647); };\n\tthis.nextRange = function(min, max)\t{ return min + ((max - min) * this.next()) };\n\tthis.gen = function() { return this.seed = (this.seed * 16807) % 2147483647; };\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/AudioObject.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/AudioObject.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * AudioObject\n *\n *\t- 3d spatialized sound with Doppler-shift effect\n *\n *\t- uses Audio API (currently supported in WebKit-based browsers)\n *\t\thttps://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html\n *\n *\t- based on Doppler effect demo from Chromium\n * \t\thttp://chromium.googlecode.com/svn/trunk/samples/audio/doppler.html\n *\n * - parameters\n *\n *\t\t- listener\n *\t\t\tdopplerFactor\t// A constant used to determine the amount of pitch shift to use when rendering a doppler effect.\n *\t\t\tspeedOfSound\t// The speed of sound used for calculating doppler shift. The default value is 343.3 meters / second.\n *\n *\t\t- panner\n *\t\t\trefDistance\t\t// A reference distance for reducing volume as source move further from the listener.\n *\t\t\tmaxDistance\t\t// The maximum distance between source and listener, after which the volume will not be reduced any further.\n *\t\t\trolloffFactor\t// Describes how quickly the volume is reduced as source moves away from listener.\n * \t\t\tconeInnerAngle\t// An angle inside of which there will be no volume reduction.\n *\t\t\tconeOuterAngle \t// An angle outside of which the volume will be reduced to a constant value of coneOuterGain.\n *\t\t\tconeOuterGain\t// Amount of volume reduction outside of the coneOuterAngle.\n */\n\nTHREE.AudioObject = function ( url, volume, playbackRate, loop ) {\n\n\tTHREE.Object3D.call( this );\n\n\tif ( playbackRate === undefined ) playbackRate = 1;\n\tif ( volume === undefined ) volume = 1;\n\tif ( loop === undefined ) loop = true;\n\n\tif ( ! this.context ) {\n\n\t\ttry {\n\n\t\t\tTHREE.AudioObject.prototype.context = new webkitAudioContext();\n\n\t\t} catch( error ) {\n\n\t\t\tconsole.warn( \"THREE.AudioObject: webkitAudioContext not found\" );\n\t\t\treturn this;\n\n\t\t}\n\n\t}\n\n\tthis.directionalSource = false;\n\n\tthis.listener = this.context.listener;\n\tthis.panner = this.context.createPanner();\n\tthis.source = this.context.createBufferSource();\n\n\tthis.masterGainNode = this.context.createGainNode();\n\tthis.dryGainNode = this.context.createGainNode();\n\n\t// Setup initial gains\n\n\tthis.masterGainNode.gain.value = volume;\n\tthis.dryGainNode.gain.value = 3.0;\n\n\t// Connect dry mix\n\n\tthis.source.connect( this.panner );\n\tthis.panner.connect( this.dryGainNode );\n\tthis.dryGainNode.connect( this.masterGainNode );\n\n\t// Connect master gain\n\n\tthis.masterGainNode.connect( this.context.destination );\n\n\t// Set source parameters and load sound\n\n\tthis.source.playbackRate.value = playbackRate;\n\tthis.source.loop = loop;\n\n\tloadBufferAndPlay( url );\n\n\t// private properties\n\n\tvar soundPosition = new THREE.Vector3(),\n\tcameraPosition = new THREE.Vector3(),\n\toldSoundPosition = new THREE.Vector3(),\n\toldCameraPosition = new THREE.Vector3(),\n\n\tsoundDelta = new THREE.Vector3(),\n\tcameraDelta = new THREE.Vector3(),\n\n\tsoundFront = new THREE.Vector3(),\n\tcameraFront = new THREE.Vector3(),\n\tsoundUp = new THREE.Vector3(),\n\tcameraUp = new THREE.Vector3();\n\n\tvar _this = this;\n\n\t// API\n\n\tthis.setVolume = function ( volume ) {\n\n\t\tthis.masterGainNode.gain.value = volume;\n\n\t};\n\n\tthis.update = function ( camera ) {\n\n\t\toldSoundPosition.copy( soundPosition );\n\t\toldCameraPosition.copy( cameraPosition );\n\n\t\tsoundPosition.setFromMatrixPosition( this.matrixWorld );\n\t\tcameraPosition.setFromMatrixPosition( camera.matrixWorld );\n\n\t\tsoundDelta.subVectors( soundPosition, oldSoundPosition );\n\t\tcameraDelta.subVectors( cameraPosition, oldCameraPosition );\n\n\t\tcameraUp.copy( camera.up );\n\n\t\tcameraFront.set( 0, 0, -1 );\n\t\tcameraFront.transformDirection( camera.matrixWorld );\n\n\t\tthis.listener.setPosition( cameraPosition.x, cameraPosition.y, cameraPosition.z );\n\t\tthis.listener.setVelocity( cameraDelta.x, cameraDelta.y, cameraDelta.z );\n\t\tthis.listener.setOrientation( cameraFront.x, cameraFront.y, cameraFront.z, cameraUp.x, cameraUp.y, cameraUp.z );\n\n\t\tthis.panner.setPosition( soundPosition.x, soundPosition.y, soundPosition.z );\n\t\tthis.panner.setVelocity( soundDelta.x, soundDelta.y, soundDelta.z );\n\n\t\tif ( this.directionalSource ) {\n\n\t\t\tsoundFront.set( 0, 0, -1 );\n\t\t\tsoundFront.transformDirection( this.matrixWorld );\n\n\t\t\tsoundUp.copy( this.up );\n\t\t\tthis.panner.setOrientation( soundFront.x, soundFront.y, soundFront.z, soundUp.x, soundUp.y, soundUp.z );\n\n\t\t}\n\n\n\t};\n\n\tfunction loadBufferAndPlay( url ) {\n\n\t\t// Load asynchronously\n\n\t\tvar request = new XMLHttpRequest();\n\t\trequest.open( \"GET\", url, true );\n\t\trequest.responseType = \"arraybuffer\";\n\n\t\trequest.onload = function() {\n\n\t\t\t_this.source.buffer = _this.context.createBuffer( request.response, true );\n\t\t\t_this.source.noteOn( 0 );\n\n\t\t}\n\n\t\trequest.send();\n\n\t}\n\n};\n\nTHREE.AudioObject.prototype = Object.create( THREE.Object3D.prototype );\n\nTHREE.AudioObject.prototype.context = null;\nTHREE.AudioObject.prototype.type = null;\n\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Math/Lut.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Math/Lut.js",
            "module-type": "library",
            "text": "/**\n * @author daron1337 / http://daron1337.github.io/\n */\n\nTHREE.Lut = function ( colormap, numberofcolors ) {\n\n\tthis.lut = new Array();\n\tthis.map = THREE.ColorMapKeywords[ colormap ];\n\tthis.n = numberofcolors;\n\tthis.mapname = colormap;\n\n\tvar step = 1.0 / this.n;\n\n\tfor ( var i = 0; i <= 1; i += step ) {\n\n\t\tfor ( var j = 0; j < this.map.length - 1; j ++ ) {\n\n\t\t\tif ( i >= this.map[ j ][ 0 ] && i < this.map[ j + 1 ][ 0 ] ) {\n\n\t\t\t\tvar min = this.map[ j ][ 0 ];\n\t\t\t\tvar max = this.map[ j + 1 ][ 0 ];\n\n\t\t\t\tvar color = new THREE.Color( 0xffffff );\n\t\t\t\tvar minColor = new THREE.Color( 0xffffff ).setHex( this.map[ j ][ 1 ] );\n\t\t\t\tvar maxColor = new THREE.Color( 0xffffff ).setHex( this.map[ j + 1 ][ 1 ] );\n\n\t\t\t\tcolor = minColor.lerp( maxColor, ( i - min ) / ( max - min ) );\n\n\t\t\t\tthis.lut.push(color);\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn this.set( this );\n\n};\n\nTHREE.Lut.prototype = {\n\n\tconstructor: THREE.Lut,\n\n\tlut: [], map: [], mapname: 'rainbow' , n: 256, minV: 0, maxV: 1, legend: null,\n\n\tset: function ( value ) {\n\n\t\tif ( value instanceof THREE.Lut ) {\n\n\t\t\tthis.copy( value );\n\n\t\t}\n\n\t\treturn this;\n\n\t},\n\n\tsetMin: function ( min ) {\n\n\t\tthis.minV = min;\n\n\t\treturn this;\n\n\t},\n\n\tsetMax: function ( max ) {\n\n\t\tthis.maxV = max;\n\n\t\treturn this;\n\n\t},\n\n\tchangeNumberOfColors: function ( numberofcolors ) {\n\n\t\tthis.n = numberofcolors;\n\n\t\treturn new THREE.Lut( this.mapname, this.n );\n\n\t},\n\n\tchangeColorMap: function ( colormap ) {\n\n\t\tthis.mapname = colormap;\n\n\t\treturn new THREE.Lut( this.mapname, this.n );\n\n\t},\n\n\tcopy: function ( lut ) {\n\n\t\tthis.lut = lut.lut;\n\t\tthis.mapname = lut.mapname;\n\t\tthis.map = lut.map;\n\t\tthis.n = lut.n;\n\t\tthis.minV = lut.minV;\n\t\tthis.maxV = lut.maxV;\n\n\t\treturn this;\n\n\t},\n\n\tgetColor: function ( alpha ) {\n\n\t\tif ( alpha <= this.minV ) {\n\n\t\t\talpha = this.minV;\n\n\t\t} else if ( alpha >= this.maxV ) {\n\n\t\t\talpha = this.maxV;\n\n\t\t}\n\n\t\talpha = ( alpha - this.minV ) / ( this.maxV - this.minV );\n\n\t\tvar colorPosition = Math.round ( alpha * this.n );\n\t\tcolorPosition == this.n ? colorPosition -= 1 : colorPosition;\n\n\t\treturn this.lut[ colorPosition ];\n\n\t},\n\n\taddColorMap: function ( colormapName, arrayOfColors ) {\n\n\t\tTHREE.ColorMapKeywords[ colormapName ] = arrayOfColors;\n\n\t},\n\n\tsetLegendOn: function ( parameters ) {\n\n\t\tif ( parameters === undefined ) { parameters = {}; }\n\n\t\tthis.legend = {};\n\n\t\tthis.legend.layout = parameters.hasOwnProperty( 'layout' ) ? parameters[ 'layout' ] : 'vertical';\n\n\t\tthis.legend.position = parameters.hasOwnProperty( 'position' ) ? parameters[ 'position' ] : { 'x': 21.5, 'y': 8, 'z': 5 };\n\n\t\tthis.legend.dimensions = parameters.hasOwnProperty( 'dimensions' ) ? parameters[ 'dimensions' ] : { 'width': 0.5, 'height': 3 };\n\n\t\tthis.legend.canvas = document.createElement( 'canvas' );\n\n\t\tthis.legend.canvas.setAttribute( 'id', 'legend' );\n\t\tthis.legend.canvas.setAttribute( 'hidden', true );\n\n\t\tdocument.body.appendChild( this.legend.canvas );\n\n\t\tthis.legend.ctx = this.legend.canvas.getContext( '2d' );\n\n\t\tthis.legend.canvas.setAttribute( 'width',  1 );\n\t\tthis.legend.canvas.setAttribute( 'height', this.n );\n\n\t\tthis.legend.texture = new THREE.Texture( this.legend.canvas );\n\n\t\timageData = this.legend.ctx.getImageData( 0, 0, 1, this.n );\n\n\t\tdata = imageData.data;\n\t\tlen = data.length;\n\n\t\tthis.map = THREE.ColorMapKeywords[ this.mapname ];\n\n\t\tvar k = 0;\n\n\t\tvar step = 1.0 / this.n;\n\n\t\tfor ( var i = 1; i >= 0; i-=step ) {\n\n\t\t\tfor ( var j = this.map.length - 1; j >= 0; j-- ) {\n\n\t\t\t\tif ( i < this.map[ j ][ 0 ] && i >= this.map[ j - 1 ][ 0 ]  ) {\n\n\t\t\t\t\tvar min = this.map[ j - 1 ][ 0 ];\n\t\t\t\t\tvar max = this.map[ j ][ 0 ];\n\t\t\t\t\tvar color = new THREE.Color( 0xffffff );\n\t\t\t\t\tvar minColor = new THREE.Color( 0xffffff ).setHex( this.map[ j - 1][ 1 ] );\n\t\t\t\t\tvar maxColor = new THREE.Color( 0xffffff ).setHex( this.map[ j ][ 1 ] );\n\t\t\t\t\tcolor = minColor.lerp( maxColor, ( i - min ) / ( max - min ) );\n\n\t\t\t\t\tdata[ k * 4     ] = Math.round( color.r * 255 );\n\t\t\t\t\tdata[ k * 4 + 1 ] = Math.round( color.g * 255 );\n\t\t\t\t\tdata[ k * 4 + 2 ] = Math.round( color.b * 255 );\n\t\t\t\t\tdata[ k * 4 + 3 ] = 255;\n\n\t\t\t\t\tk+=1;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.legend.ctx.putImageData( imageData, 0, 0 );\n\t\tthis.legend.texture.needsUpdate = true;\n\n\t\tthis.legend.legendGeometry = new THREE.PlaneGeometry( this.legend.dimensions.width , this.legend.dimensions.height );\n\t\tthis.legend.legendMaterial = new THREE.MeshBasicMaterial( { map : this.legend.texture, side : THREE.DoubleSide } );\n\n\t\tthis.legend.mesh = new THREE.Mesh( this.legend.legendGeometry, this.legend.legendMaterial );\n\n\t\tif ( this.legend.layout == 'horizontal') {\n\n\t\t\tthis.legend.mesh.rotation.z = - 90 * ( Math.PI / 180 );\n\n\t\t}\n\n\t\tthis.legend.mesh.position.copy( this.legend.position );\n\n\t\treturn this.legend.mesh;\n\n\t},\n\n\tsetLegendOff: function () {\n\n\t\tthis.legend = null;\n\n\t\treturn this.legend;\n\n\t},\n\n\tsetLegendLayout: function ( layout ) {\n\n\t\tif ( ! this.legend ) { return false; }\n\n\t\tif ( this.legend.layout == layout ) { return false; }\n\n\t\tif ( layout != 'horizontal' && layout != 'vertical' ) { return false; }\n\n\t\tthis.layout = layout;\n\n\t\tif ( layout == 'horizontal' ) {\n\n\t\t\tthis.legend.mesh.rotation.z = 90 * ( Math.PI / 180 );\n\n\t\t}\n\n\t\tif ( layout == 'vertical' ) {\n\n\t\t\tthis.legend.mesh.rotation.z = -90 * ( Math.PI / 180 );\n\n\t\t}\n\n\t\treturn this.legend.mesh;\n\n\t},\n\n\tsetLegendPosition: function ( position ) {\n\n\t\tthis.legend.position = new THREE.Vector3( position.x, position.y, position.z );\n\n\t\treturn this.legend;\n\n\t},\n\n\tsetLegendLabels: function ( parameters, callback ) {\n\n\t\tif ( ! this.legend ) { return false; }\n\n\t\tif ( typeof parameters === 'function') { callback = parameters; }\n\n\t\tif ( parameters === undefined ) { parameters = {}; }\n\n\t\tthis.legend.labels = {};\n\n\t\tthis.legend.labels.fontsize = parameters.hasOwnProperty( 'fontsize' ) ? parameters[ 'fontsize' ] : 24;\n\n\t\tthis.legend.labels.fontface = parameters.hasOwnProperty( 'fontface' ) ? parameters[ 'fontface' ] : 'Arial';\n\n\t\tthis.legend.labels.title = parameters.hasOwnProperty( 'title' ) ? parameters[ 'title' ] : '';\n\n\t\tthis.legend.labels.um = parameters.hasOwnProperty( 'um' ) ? ' [ '+ parameters[ 'um' ] + ' ]': '';\n\n\t\tthis.legend.labels.ticks = parameters.hasOwnProperty( 'ticks' ) ? parameters[ 'ticks' ] : 0;\n\n\t\tthis.legend.labels.decimal = parameters.hasOwnProperty( 'decimal' ) ? parameters[ 'decimal' ] : 2;\n\n\t\tthis.legend.labels.notation = parameters.hasOwnProperty( 'notation' ) ? parameters[ 'notation' ] : 'standard';\n\n\t\tvar backgroundColor = { r: 255, g: 100, b: 100, a: 0.8 };\n\t\tvar borderColor =  { r: 255, g: 0, b: 0, a: 1.0 };\n\t\tvar borderThickness = 4;\n\n\t\tvar canvasTitle = document.createElement( 'canvas' );\n\t\tvar contextTitle = canvasTitle.getContext( '2d' );\n\n\t\tcontextTitle.font = 'Normal ' + this.legend.labels.fontsize * 1.2 + 'px ' + this.legend.labels.fontface;\n\n\t\tvar metrics = contextTitle.measureText( this.legend.labels.title.toString() + this.legend.labels.um.toString() );\n\t\tvar textWidth = metrics.width;\n\n\t\tcontextTitle.fillStyle   = 'rgba(' + backgroundColor.r + ',' + backgroundColor.g + ',' + backgroundColor.b + ',' + backgroundColor.a + ')';\n\n\t\tcontextTitle.strokeStyle = 'rgba(' + borderColor.r + ',' + borderColor.g + ',' + borderColor.b + ',' + borderColor.a + ')';\n\n\t\tcontextTitle.lineWidth = borderThickness;\n\n\t\tcontextTitle.fillStyle = 'rgba( 0, 0, 0, 1.0 )';\n\n\t\tcontextTitle.fillText( this.legend.labels.title.toString() + this.legend.labels.um.toString(), borderThickness, this.legend.labels.fontsize + borderThickness );\n\n\t\tvar txtTitle = new THREE.Texture( canvasTitle );\n\n\t\ttxtTitle.needsUpdate = true;\n\n\t\tvar spriteMaterialTitle = new THREE.SpriteMaterial( { map: txtTitle, useScreenCoordinates: false } );\n\n\t\tvar spriteTitle = new THREE.Sprite( spriteMaterialTitle );\n\n\t\tspriteTitle.scale.set( 2, 1, 1.0 );\n\n\t\tif ( this.legend.layout == 'vertical' ) {\n\n\t\t\tspriteTitle.position.set( this.legend.position.x + this.legend.dimensions.width, this.legend.position.y + ( this.legend.dimensions.height * 0.45 ), this.legend.position.z );\n\n\t\t}\n\n\t\tif ( this.legend.layout == 'horizontal' ) {\n\n\t\t\tspriteTitle.position.set( this.legend.position.x * 1.015, this.legend.position.y + ( this.legend.dimensions.height * 0.03 ), this.legend.position.z );\n\n\t\t}\n\n\t\tif ( this.legend.labels.ticks > 0 ) {\n\n\t\t\tvar ticks = {};\n\t\t\tvar lines = {};\n\n\t\t\tif ( this.legend.layout == 'vertical' ) {\n\n\t\t\t\tvar topPositionY = this.legend.position.y + ( this.legend.dimensions.height * 0.36 );\n\t\t\t\tvar bottomPositionY = this.legend.position.y - ( this.legend.dimensions.height * 0.61 );\n\n\t\t\t}\n\n\t\t\tif ( this.legend.layout == 'horizontal' ) {\n\n\t\t\t\tvar topPositionX = this.legend.position.x + ( this.legend.dimensions.height * 0.75 );\n\t\t\t\tvar bottomPositionX = this.legend.position.x - ( this.legend.dimensions.width * 1.2  ) ;\n\n\t\t\t}\n\n\t\t\tfor ( var i = 0; i < this.legend.labels.ticks; i++ ) {\n\n\t\t\t\tvar value = ( this.maxV - this.minV ) / ( this.legend.labels.ticks - 1  ) * i ;\n\n\t\t\t\tif ( callback ) {\n\n\t\t\t\t\tvalue = callback ( value );\n\n\t\t\t\t}\n\n\t\t\t\telse {\n\n\t\t\t\t\tif ( this.legend.labels.notation == 'scientific' ) {\n\n\t\t\t\t\t\tvalue = value.toExponential( this.legend.labels.decimal );\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\n\t\t\t\t\t\tvalue = value.toFixed( this.legend.labels.decimal );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tvar canvasTick = document.createElement( 'canvas' );\n\t\t\t\tvar contextTick = canvasTick.getContext( '2d' );\n\n\t\t\t\tcontextTick.font = 'Normal ' + this.legend.labels.fontsize + 'px ' + this.legend.labels.fontface;\n\n\t\t\t\tvar metrics = contextTick.measureText( value.toString() );\n\t\t\t\tvar textWidth = metrics.width;\n\n\t\t\t\tcontextTick.fillStyle   = 'rgba(' + backgroundColor.r + ',' + backgroundColor.g + ',' + backgroundColor.b + ',' + backgroundColor.a + ')';\n\n\t\t\t\tcontextTick.strokeStyle = 'rgba(' + borderColor.r + ',' + borderColor.g + ',' + borderColor.b + ',' + borderColor.a + ')';\n\n\t\t\t\tcontextTick.lineWidth = borderThickness;\n\n\t\t\t\tcontextTick.fillStyle = 'rgba( 0, 0, 0, 1.0 )';\n\n\t\t\t\tcontextTick.fillText( value.toString(), borderThickness, this.legend.labels.fontsize + borderThickness );\n\n\t\t\t\tvar txtTick = new THREE.Texture( canvasTick );\n\n\t\t\t\ttxtTick.needsUpdate = true;\n\n\t\t\t\tvar spriteMaterialTick = new THREE.SpriteMaterial( { map: txtTick, useScreenCoordinates: false } );\n\n\t\t\t\tvar spriteTick = new THREE.Sprite( spriteMaterialTick );\n\n\t\t\t\tspriteTick.scale.set( 2, 1, 1.0 );\n\n\t\t\t\tif ( this.legend.layout == 'vertical' ) {\n\n\t\t\t\t\tvar position = bottomPositionY + ( topPositionY - bottomPositionY ) * ( value / ( this.maxV - this.minV ) );\n\n\t\t\t\t\tspriteTick.position.set( this.legend.position.x + ( this.legend.dimensions.width * 2.7 ), position, this.legend.position.z );\n\n\t\t\t\t}\n\n\t\t\t\tif ( this.legend.layout == 'horizontal' ) {\n\n\t\t\t\t\tvar position = bottomPositionX + ( topPositionX - bottomPositionX ) * ( value / ( this.maxV - this.minV ) );\n\n\t\t\t\t\tif ( this.legend.labels.ticks > 5 ) {\n\n\t\t\t\t\t\tif ( i % 2 === 0 ) { var offset = 1.7; }\n\n\t\t\t\t\t\telse { var offset = 2.1; }\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse { var offset = 1.7; }\n\n\t\t\t\t\tspriteTick.position.set( position, this.legend.position.y - this.legend.dimensions.width * offset, this.legend.position.z );\n\n\t\t\t\t}\n\n\t\t\t\tvar material = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 2 } );\n\n\t\t\t\tvar geometry = new THREE.Geometry();\n\n\n\t\t\t\tif ( this.legend.layout == 'vertical' ) {\n\n\t\t\t\t\tvar linePosition = ( this.legend.position.y - ( this.legend.dimensions.height * 0.5 ) + 0.01 ) + ( this.legend.dimensions.height ) * ( value / ( this.maxV - this.minV ) * 0.99 );\n\n\t\t\t\t\tgeometry.vertices.push( new THREE.Vector3( this.legend.position.x + this.legend.dimensions.width * 0.55, linePosition , this.legend.position.z  ) );\n\n\t\t\t\t\tgeometry.vertices.push( new THREE.Vector3( this.legend.position.x + this.legend.dimensions.width * 0.7, linePosition, this.legend.position.z  ) );\n\n\t\t\t\t}\n\n\t\t\t\tif ( this.legend.layout == 'horizontal' ) {\n\n\t\t\t\t\tvar linePosition = ( this.legend.position.x - ( this.legend.dimensions.height * 0.5 ) + 0.01 ) + ( this.legend.dimensions.height ) * ( value / ( this.maxV - this.minV ) * 0.99 );\n\n\t\t\t\t\tgeometry.vertices.push( new THREE.Vector3( linePosition, this.legend.position.y - this.legend.dimensions.width * 0.55, this.legend.position.z  ) );\n\n\t\t\t\t\tgeometry.vertices.push( new THREE.Vector3( linePosition, this.legend.position.y - this.legend.dimensions.width * 0.7, this.legend.position.z  ) );\n\n\t\t\t\t}\n\n\t\t\t\tvar line = new THREE.Line( geometry, material );\n\n\t\t\t\tlines[ i ] = line;\n\t\t\t\tticks[ i ] = spriteTick;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn { 'title': spriteTitle,  'ticks': ticks, 'lines': lines };\n\n\t}\n\n};\n\n\nTHREE.ColorMapKeywords = {\n\n  \"rainbow\":    [ [ 0.0, '0x0000FF' ], [ 0.2, '0x00FFFF' ], [ 0.5, '0x00FF00' ], [ 0.8, '0xFFFF00'],  [1.0, '0xFF0000' ] ],\n  \"cooltowarm\": [ [ 0.0, '0x3C4EC2' ], [ 0.2, '0x9BBCFF' ], [ 0.5, '0xDCDCDC' ], [ 0.8, '0xF6A385'],  [1.0, '0xB40426' ] ],\n  \"blackbody\" : [ [ 0.0, '0x000000' ], [ 0.2, '0x780000' ], [ 0.5, '0xE63200' ], [ 0.8, '0xFFFF00'],  [1.0, '0xFFFFFF' ] ],\n  \"grayscale\" : [ [ 0.0, '0x000000' ], [ 0.2, '0x404040' ], [ 0.5, '0x7F7F80' ], [ 0.8, '0xBFBFBF'],  [1.0, '0xFFFFFF' ] ]\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Math/ColorConverter.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Math/ColorConverter.js",
            "module-type": "library",
            "text": "/**\n * @author bhouston / http://exocortex.com/\n * @author zz85 / http://github.com/zz85\n */\n\nTHREE.ColorConverter = {\n\n\tsetHSV: function ( color, h, s, v ) {\n\n\t\t// https://gist.github.com/xpansive/1337890#file-index-js\n\t\treturn color.setHSL( h, ( s * v ) / ( ( h = ( 2 - s ) * v ) < 1 ? h : ( 2 - h ) ), h * 0.5 );\n\n\t},\n\n\tgetHSV: function( color ) {\n\n\t\tvar hsl = color.getHSL();\n\n\t\t// based on https://gist.github.com/xpansive/1337890#file-index-js\n\t\thsl.s *= ( hsl.l < 0.5 ) ? hsl.l : ( 1 - hsl.l );\n\n\t\treturn {\n\t\t\th: hsl.h,\n\t\t\ts: 2 * hsl.s / ( hsl.l + hsl.s ),\n\t\t\tv: hsl.l + hsl.s\n\t\t};\n\t},\n\n\t// where c, m, y, k is between 0 and 1\n\t\n\tsetCMYK: function ( color, c, m, y, k ) {\n\n\t\tvar r = ( 1 - c ) * ( 1 - k );\n\t\tvar g = ( 1 - m ) * ( 1 - k );\n\t\tvar b = ( 1 - y ) * ( 1 - k );\n\n\t\treturn color.setRGB( r, g, b );\n\n\t},\n\n\tgetCMYK: function ( color ) {\n\n\t\tvar r = color.r;\n\t\tvar g = color.g;\n\t\tvar b = color.b;\n\t\tvar k = 1 - Math.max(r, g, b);\n\t\tvar c = ( 1 - r - k ) / ( 1 - k );\n\t\tvar m = ( 1 - g - k ) / ( 1 - k );\n\t\tvar y = ( 1 - b - k ) / ( 1 - k );\n\n\t\treturn {\n\t\t\tc: c, m: m, y: y, k: k\n\t\t};\n\n\t}\n\n\n};"
        },
        "$:/plugins/rboue/Three.js/Lib/Modifiers/TessellateModifier.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Modifiers/TessellateModifier.js",
            "module-type": "library",
            "text": "/**\n * Break faces with edges longer than maxEdgeLength\n * - not recursive\n *\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.TessellateModifier = function ( maxEdgeLength ) {\n\n\tthis.maxEdgeLength = maxEdgeLength;\n\n};\n\nTHREE.TessellateModifier.prototype.modify = function ( geometry ) {\n\n\tvar i, il, face,\n\ta, b, c, d,\n\tva, vb, vc, vd,\n\tdab, dbc, dac, dcd, dad,\n\tm, m1, m2,\n\tvm, vm1, vm2,\n\tvnm, vnm1, vnm2,\n\tvcm, vcm1, vcm2,\n\ttriA, triB,\n\tquadA, quadB,\n\tedge;\n\n\tvar faces = [];\n\tvar faceVertexUvs = [];\n\tvar maxEdgeLength = this.maxEdgeLength;\n\n\tfor ( i = 0, il = geometry.faceVertexUvs.length; i < il; i ++ ) {\n\n\t\tfaceVertexUvs[ i ] = [];\n\n\t}\n\n\tfor ( i = 0, il = geometry.faces.length; i < il; i ++ ) {\n\n\t\tface = geometry.faces[ i ];\n\n\t\tif ( face instanceof THREE.Face3 ) {\n\n\t\t\ta = face.a;\n\t\t\tb = face.b;\n\t\t\tc = face.c;\n\n\t\t\tva = geometry.vertices[ a ];\n\t\t\tvb = geometry.vertices[ b ];\n\t\t\tvc = geometry.vertices[ c ];\n\n\t\t\tdab = va.distanceTo( vb );\n\t\t\tdbc = vb.distanceTo( vc );\n\t\t\tdac = va.distanceTo( vc );\n\n\t\t\tif ( dab > maxEdgeLength || dbc > maxEdgeLength || dac > maxEdgeLength ) {\n\n\t\t\t\tm = geometry.vertices.length;\n\n\t\t\t\ttriA = face.clone();\n\t\t\t\ttriB = face.clone();\n\n\t\t\t\tif ( dab >= dbc && dab >= dac ) {\n\n\t\t\t\t\tvm = va.clone();\n\t\t\t\t\tvm.lerp( vb, 0.5 );\n\n\t\t\t\t\ttriA.a = a;\n\t\t\t\t\ttriA.b = m;\n\t\t\t\t\ttriA.c = c;\n\n\t\t\t\t\ttriB.a = m;\n\t\t\t\t\ttriB.b = b;\n\t\t\t\t\ttriB.c = c;\n\n\t\t\t\t\tif ( face.vertexNormals.length === 3 ) {\n\n\t\t\t\t\t\tvnm = face.vertexNormals[ 0 ].clone();\n\t\t\t\t\t\tvnm.lerp( face.vertexNormals[ 1 ], 0.5 );\n\n\t\t\t\t\t\ttriA.vertexNormals[ 1 ].copy( vnm );\n\t\t\t\t\t\ttriB.vertexNormals[ 0 ].copy( vnm );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( face.vertexColors.length === 3 ) {\n\n\t\t\t\t\t\tvcm = face.vertexColors[ 0 ].clone();\n\t\t\t\t\t\tvcm.lerp( face.vertexColors[ 1 ], 0.5 );\n\n\t\t\t\t\t\ttriA.vertexColors[ 1 ].copy( vcm );\n\t\t\t\t\t\ttriB.vertexColors[ 0 ].copy( vcm );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tedge = 0;\n\n\t\t\t\t} else if ( dbc >= dab && dbc >= dac ) {\n\n\t\t\t\t\tvm = vb.clone();\n\t\t\t\t\tvm.lerp( vc, 0.5 );\n\n\t\t\t\t\ttriA.a = a;\n\t\t\t\t\ttriA.b = b;\n\t\t\t\t\ttriA.c = m;\n\n\t\t\t\t\ttriB.a = m;\n\t\t\t\t\ttriB.b = c;\n\t\t\t\t\ttriB.c = a;\n\n\t\t\t\t\tif ( face.vertexNormals.length === 3 ) {\n\n\t\t\t\t\t\tvnm = face.vertexNormals[ 1 ].clone();\n\t\t\t\t\t\tvnm.lerp( face.vertexNormals[ 2 ], 0.5 );\n\n\t\t\t\t\t\ttriA.vertexNormals[ 2 ].copy( vnm );\n\n\t\t\t\t\t\ttriB.vertexNormals[ 0 ].copy( vnm );\n\t\t\t\t\t\ttriB.vertexNormals[ 1 ].copy( face.vertexNormals[ 2 ] );\n\t\t\t\t\t\ttriB.vertexNormals[ 2 ].copy( face.vertexNormals[ 0 ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( face.vertexColors.length === 3 ) {\n\n\t\t\t\t\t\tvcm = face.vertexColors[ 1 ].clone();\n\t\t\t\t\t\tvcm.lerp( face.vertexColors[ 2 ], 0.5 );\n\n\t\t\t\t\t\ttriA.vertexColors[ 2 ].copy( vcm );\n\n\t\t\t\t\t\ttriB.vertexColors[ 0 ].copy( vcm );\n\t\t\t\t\t\ttriB.vertexColors[ 1 ].copy( face.vertexColors[ 2 ] );\n\t\t\t\t\t\ttriB.vertexColors[ 2 ].copy( face.vertexColors[ 0 ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tedge = 1;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tvm = va.clone();\n\t\t\t\t\tvm.lerp( vc, 0.5 );\n\n\t\t\t\t\ttriA.a = a;\n\t\t\t\t\ttriA.b = b;\n\t\t\t\t\ttriA.c = m;\n\n\t\t\t\t\ttriB.a = m;\n\t\t\t\t\ttriB.b = b;\n\t\t\t\t\ttriB.c = c;\n\n\t\t\t\t\tif ( face.vertexNormals.length === 3 ) {\n\n\t\t\t\t\t\tvnm = face.vertexNormals[ 0 ].clone();\n\t\t\t\t\t\tvnm.lerp( face.vertexNormals[ 2 ], 0.5 );\n\n\t\t\t\t\t\ttriA.vertexNormals[ 2 ].copy( vnm );\n\t\t\t\t\t\ttriB.vertexNormals[ 0 ].copy( vnm );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( face.vertexColors.length === 3 ) {\n\n\t\t\t\t\t\tvcm = face.vertexColors[ 0 ].clone();\n\t\t\t\t\t\tvcm.lerp( face.vertexColors[ 2 ], 0.5 );\n\n\t\t\t\t\t\ttriA.vertexColors[ 2 ].copy( vcm );\n\t\t\t\t\t\ttriB.vertexColors[ 0 ].copy( vcm );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tedge = 2;\n\n\t\t\t\t}\n\n\t\t\t\tfaces.push( triA, triB );\n\t\t\t\tgeometry.vertices.push( vm );\n\n\t\t\t\tvar j, jl, uvs, uvA, uvB, uvC, uvM, uvsTriA, uvsTriB;\n\n\t\t\t\tfor ( j = 0, jl = geometry.faceVertexUvs.length; j < jl; j ++ ) {\n\n\t\t\t\t\tif ( geometry.faceVertexUvs[ j ].length ) {\n\n\t\t\t\t\t\tuvs = geometry.faceVertexUvs[ j ][ i ];\n\n\t\t\t\t\t\tuvA = uvs[ 0 ];\n\t\t\t\t\t\tuvB = uvs[ 1 ];\n\t\t\t\t\t\tuvC = uvs[ 2 ];\n\n\t\t\t\t\t\t// AB\n\n\t\t\t\t\t\tif ( edge === 0 ) {\n\n\t\t\t\t\t\t\tuvM = uvA.clone();\n\t\t\t\t\t\t\tuvM.lerp( uvB, 0.5 );\n\n\t\t\t\t\t\t\tuvsTriA = [ uvA.clone(), uvM.clone(), uvC.clone() ];\n\t\t\t\t\t\t\tuvsTriB = [ uvM.clone(), uvB.clone(), uvC.clone() ];\n\n\t\t\t\t\t\t// BC\n\n\t\t\t\t\t\t} else if ( edge === 1 ) {\n\n\t\t\t\t\t\t\tuvM = uvB.clone();\n\t\t\t\t\t\t\tuvM.lerp( uvC, 0.5 );\n\n\t\t\t\t\t\t\tuvsTriA = [ uvA.clone(), uvB.clone(), uvM.clone() ];\n\t\t\t\t\t\t\tuvsTriB = [ uvM.clone(), uvC.clone(), uvA.clone() ];\n\n\t\t\t\t\t\t// AC\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tuvM = uvA.clone();\n\t\t\t\t\t\t\tuvM.lerp( uvC, 0.5 );\n\n\t\t\t\t\t\t\tuvsTriA = [ uvA.clone(), uvB.clone(), uvM.clone() ];\n\t\t\t\t\t\t\tuvsTriB = [ uvM.clone(), uvB.clone(), uvC.clone() ];\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfaceVertexUvs[ j ].push( uvsTriA, uvsTriB );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tfaces.push( face );\n\n\t\t\t\tfor ( j = 0, jl = geometry.faceVertexUvs.length; j < jl; j ++ ) {\n\n\t\t\t\t\tfaceVertexUvs[ j ].push( geometry.faceVertexUvs[ j ][ i ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\ta = face.a;\n\t\t\tb = face.b;\n\t\t\tc = face.c;\n\t\t\td = face.d;\n\n\t\t\tva = geometry.vertices[ a ];\n\t\t\tvb = geometry.vertices[ b ];\n\t\t\tvc = geometry.vertices[ c ];\n\t\t\tvd = geometry.vertices[ d ];\n\n\t\t\tdab = va.distanceTo( vb );\n\t\t\tdbc = vb.distanceTo( vc );\n\t\t\tdcd = vc.distanceTo( vd );\n\t\t\tdad = va.distanceTo( vd );\n\n\t\t\tif ( dab > maxEdgeLength || dbc > maxEdgeLength || dcd > maxEdgeLength || dad > maxEdgeLength ) {\n\n\t\t\t\tm1 = geometry.vertices.length;\n\t\t\t\tm2 = geometry.vertices.length + 1;\n\n\t\t\t\tquadA = face.clone();\n\t\t\t\tquadB = face.clone();\n\n\t\t\t\tif ( ( dab >= dbc && dab >= dcd && dab >= dad ) || ( dcd >= dbc && dcd >= dab && dcd >= dad ) ) {\n\n\t\t\t\t\tvm1 = va.clone();\n\t\t\t\t\tvm1.lerp( vb, 0.5 );\n\n\t\t\t\t\tvm2 = vc.clone();\n\t\t\t\t\tvm2.lerp( vd, 0.5 );\n\n\t\t\t\t\tquadA.a = a;\n\t\t\t\t\tquadA.b = m1;\n\t\t\t\t\tquadA.c = m2;\n\t\t\t\t\tquadA.d = d;\n\n\t\t\t\t\tquadB.a = m1;\n\t\t\t\t\tquadB.b = b;\n\t\t\t\t\tquadB.c = c;\n\t\t\t\t\tquadB.d = m2;\n\n\t\t\t\t\tif ( face.vertexNormals.length === 4 ) {\n\n\t\t\t\t\t\tvnm1 = face.vertexNormals[ 0 ].clone();\n\t\t\t\t\t\tvnm1.lerp( face.vertexNormals[ 1 ], 0.5 );\n\n\t\t\t\t\t\tvnm2 = face.vertexNormals[ 2 ].clone();\n\t\t\t\t\t\tvnm2.lerp( face.vertexNormals[ 3 ], 0.5 );\n\n\t\t\t\t\t\tquadA.vertexNormals[ 1 ].copy( vnm1 );\n\t\t\t\t\t\tquadA.vertexNormals[ 2 ].copy( vnm2 );\n\n\t\t\t\t\t\tquadB.vertexNormals[ 0 ].copy( vnm1 );\n\t\t\t\t\t\tquadB.vertexNormals[ 3 ].copy( vnm2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( face.vertexColors.length === 4 ) {\n\n\t\t\t\t\t\tvcm1 = face.vertexColors[ 0 ].clone();\n\t\t\t\t\t\tvcm1.lerp( face.vertexColors[ 1 ], 0.5 );\n\n\t\t\t\t\t\tvcm2 = face.vertexColors[ 2 ].clone();\n\t\t\t\t\t\tvcm2.lerp( face.vertexColors[ 3 ], 0.5 );\n\n\t\t\t\t\t\tquadA.vertexColors[ 1 ].copy( vcm1 );\n\t\t\t\t\t\tquadA.vertexColors[ 2 ].copy( vcm2 );\n\n\t\t\t\t\t\tquadB.vertexColors[ 0 ].copy( vcm1 );\n\t\t\t\t\t\tquadB.vertexColors[ 3 ].copy( vcm2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tedge = 0;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tvm1 = vb.clone();\n\t\t\t\t\tvm1.lerp( vc, 0.5 );\n\n\t\t\t\t\tvm2 = vd.clone();\n\t\t\t\t\tvm2.lerp( va, 0.5 );\n\n\t\t\t\t\tquadA.a = a;\n\t\t\t\t\tquadA.b = b;\n\t\t\t\t\tquadA.c = m1;\n\t\t\t\t\tquadA.d = m2;\n\n\t\t\t\t\tquadB.a = m2;\n\t\t\t\t\tquadB.b = m1;\n\t\t\t\t\tquadB.c = c;\n\t\t\t\t\tquadB.d = d;\n\n\t\t\t\t\tif ( face.vertexNormals.length === 4 ) {\n\n\t\t\t\t\t\tvnm1 = face.vertexNormals[ 1 ].clone();\n\t\t\t\t\t\tvnm1.lerp( face.vertexNormals[ 2 ], 0.5 );\n\n\t\t\t\t\t\tvnm2 = face.vertexNormals[ 3 ].clone();\n\t\t\t\t\t\tvnm2.lerp( face.vertexNormals[ 0 ], 0.5 );\n\n\t\t\t\t\t\tquadA.vertexNormals[ 2 ].copy( vnm1 );\n\t\t\t\t\t\tquadA.vertexNormals[ 3 ].copy( vnm2 );\n\n\t\t\t\t\t\tquadB.vertexNormals[ 0 ].copy( vnm2 );\n\t\t\t\t\t\tquadB.vertexNormals[ 1 ].copy( vnm1 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( face.vertexColors.length === 4 ) {\n\n\t\t\t\t\t\tvcm1 = face.vertexColors[ 1 ].clone();\n\t\t\t\t\t\tvcm1.lerp( face.vertexColors[ 2 ], 0.5 );\n\n\t\t\t\t\t\tvcm2 = face.vertexColors[ 3 ].clone();\n\t\t\t\t\t\tvcm2.lerp( face.vertexColors[ 0 ], 0.5 );\n\n\t\t\t\t\t\tquadA.vertexColors[ 2 ].copy( vcm1 );\n\t\t\t\t\t\tquadA.vertexColors[ 3 ].copy( vcm2 );\n\n\t\t\t\t\t\tquadB.vertexColors[ 0 ].copy( vcm2 );\n\t\t\t\t\t\tquadB.vertexColors[ 1 ].copy( vcm1 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tedge = 1;\n\n\t\t\t\t}\n\n\t\t\t\tfaces.push( quadA, quadB );\n\t\t\t\tgeometry.vertices.push( vm1, vm2 );\n\n\t\t\t\tvar j, jl, uvs, uvA, uvB, uvC, uvD, uvM1, uvM2, uvsQuadA, uvsQuadB;\n\n\t\t\t\tfor ( j = 0, jl = geometry.faceVertexUvs.length; j < jl; j ++ ) {\n\n\t\t\t\t\tif ( geometry.faceVertexUvs[ j ].length ) {\n\n\t\t\t\t\t\tuvs = geometry.faceVertexUvs[ j ][ i ];\n\n\t\t\t\t\t\tuvA = uvs[ 0 ];\n\t\t\t\t\t\tuvB = uvs[ 1 ];\n\t\t\t\t\t\tuvC = uvs[ 2 ];\n\t\t\t\t\t\tuvD = uvs[ 3 ];\n\n\t\t\t\t\t\t// AB + CD\n\n\t\t\t\t\t\tif ( edge === 0 ) {\n\n\t\t\t\t\t\t\tuvM1 = uvA.clone();\n\t\t\t\t\t\t\tuvM1.lerp( uvB, 0.5 );\n\n\t\t\t\t\t\t\tuvM2 = uvC.clone();\n\t\t\t\t\t\t\tuvM2.lerp( uvD, 0.5 );\n\n\t\t\t\t\t\t\tuvsQuadA = [ uvA.clone(), uvM1.clone(), uvM2.clone(), uvD.clone() ];\n\t\t\t\t\t\t\tuvsQuadB = [ uvM1.clone(), uvB.clone(), uvC.clone(), uvM2.clone() ];\n\n\t\t\t\t\t\t// BC + AD\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tuvM1 = uvB.clone();\n\t\t\t\t\t\t\tuvM1.lerp( uvC, 0.5 );\n\n\t\t\t\t\t\t\tuvM2 = uvD.clone();\n\t\t\t\t\t\t\tuvM2.lerp( uvA, 0.5 );\n\n\t\t\t\t\t\t\tuvsQuadA = [ uvA.clone(), uvB.clone(), uvM1.clone(), uvM2.clone() ];\n\t\t\t\t\t\t\tuvsQuadB = [ uvM2.clone(), uvM1.clone(), uvC.clone(), uvD.clone() ];\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfaceVertexUvs[ j ].push( uvsQuadA, uvsQuadB );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tfaces.push( face );\n\n\t\t\t\tfor ( j = 0, jl = geometry.faceVertexUvs.length; j < jl; j ++ ) {\n\n\t\t\t\t\tfaceVertexUvs[ j ].push( geometry.faceVertexUvs[ j ][ i ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tgeometry.faces = faces;\n\tgeometry.faceVertexUvs = faceVertexUvs;\n\n}\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Modifiers/ExplodeModifier.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Modifiers/ExplodeModifier.js",
            "module-type": "library",
            "text": "/**\n * Make all faces use unique vertices\n * so that each face can be separated from others\n *\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.ExplodeModifier = function () {\n\n};\n\nTHREE.ExplodeModifier.prototype.modify = function ( geometry ) {\n\n\tvar vertices = [];\n\n\tfor ( var i = 0, il = geometry.faces.length; i < il; i ++ ) {\n\n\t\tvar n = vertices.length;\n\n\t\tvar face = geometry.faces[ i ];\n\n\t\tvar a = face.a;\n\t\tvar b = face.b;\n\t\tvar c = face.c;\n\n\t\tvar va = geometry.vertices[ a ];\n\t\tvar vb = geometry.vertices[ b ];\n\t\tvar vc = geometry.vertices[ c ];\n\n\t\tvertices.push( va.clone() );\n\t\tvertices.push( vb.clone() );\n\t\tvertices.push( vc.clone() );\n\n\t\tface.a = n;\n\t\tface.b = n + 1;\n\t\tface.c = n + 2;\n\n\t}\n\n\tgeometry.vertices = vertices;\n\tdelete geometry.__tmpVertices;\n\n}\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Modifiers/SubdivisionModifier.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Modifiers/SubdivisionModifier.js",
            "module-type": "library",
            "text": "/*\r\n *\t@author zz85 / http://twitter.com/blurspline / http://www.lab4games.net/zz85/blog \r\n *\r\n *\tSubdivision Geometry Modifier \r\n *\t\tusing Loop Subdivision Scheme\r\n *\r\n *\tReferences:\r\n *\t\thttp://graphics.stanford.edu/~mdfisher/subdivision.html\r\n *\t\thttp://www.holmes3d.net/graphics/subdivision/\r\n *\t\thttp://www.cs.rutgers.edu/~decarlo/readings/subdiv-sg00c.pdf\r\n *\r\n *\tKnown Issues:\r\n *\t\t- currently doesn't handle UVs\r\n *\t\t- currently doesn't handle \"Sharp Edges\"\r\n *\r\n */\r\n\r\nTHREE.SubdivisionModifier = function ( subdivisions ) {\r\n\r\n\tthis.subdivisions = (subdivisions === undefined ) ? 1 : subdivisions;\r\n\r\n};\r\n\r\n// Applies the \"modify\" pattern\r\nTHREE.SubdivisionModifier.prototype.modify = function ( geometry ) {\r\n\r\n\tvar repeats = this.subdivisions;\r\n\r\n\twhile ( repeats-- > 0 ) {\r\n\t\tthis.smooth( geometry );\r\n\t}\r\n\r\n\tdelete geometry.__tmpVertices;\r\n\r\n\tgeometry.computeFaceNormals();\r\n\tgeometry.computeVertexNormals();\r\n\r\n};\r\n\r\n(function() {\r\n\r\n\t// Some constants\r\n\tvar WARNINGS = !true; // Set to true for development\r\n\tvar ABC = [ 'a', 'b', 'c' ];\r\n\t\r\n\r\n\tfunction getEdge( a, b, map ) {\r\n\r\n\t\tvar vertexIndexA = Math.min( a, b );\r\n\t\tvar vertexIndexB = Math.max( a, b );\r\n\r\n\t\tvar key = vertexIndexA + \"_\" + vertexIndexB;\r\n\r\n\t\treturn map[ key ];\r\n\r\n\t}\r\n\r\n\r\n\tfunction processEdge( a, b, vertices, map, face, metaVertices ) {\r\n\r\n\t\tvar vertexIndexA = Math.min( a, b );\r\n\t\tvar vertexIndexB = Math.max( a, b );\r\n\r\n\t\tvar key = vertexIndexA + \"_\" + vertexIndexB;\r\n\r\n\t\tvar edge;\r\n\r\n\t\tif ( key in map ) {\r\n\r\n\t\t\tedge = map[ key ];\r\n\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\tvar vertexA = vertices[ vertexIndexA ];\r\n\t\t\tvar vertexB = vertices[ vertexIndexB ];\r\n\r\n\t\t\tedge = {\r\n\r\n\t\t\t\ta: vertexA, // pointer reference\r\n\t\t\t\tb: vertexB,\r\n\t\t\t\tnewEdge: null,\r\n\t\t\t\t// aIndex: a, // numbered reference\r\n\t\t\t\t// bIndex: b,\r\n\t\t\t\tfaces: [] // pointers to face\r\n\r\n\t\t\t};\r\n\r\n\t\t\tmap[ key ] = edge;\r\n\r\n\t\t}\r\n\r\n\t\tedge.faces.push( face );\r\n\r\n\t\tmetaVertices[ a ].edges.push( edge );\r\n\t\tmetaVertices[ b ].edges.push( edge );\r\n\t\t\r\n\r\n\t}\r\n\r\n\tfunction generateLookups( vertices, faces, metaVertices, edges ) {\r\n\r\n\t\tvar i, il, face, edge;\r\n\r\n\t\tfor ( i = 0, il = vertices.length; i < il; i++ ) {\r\n\t\t\tmetaVertices[ i ] = { edges: [] };\r\n\t\t}\r\n\t\t\r\n\t\tfor ( i = 0, il = faces.length; i < il; i++ ) {\r\n\t\t\tface = faces[ i ];\r\n\r\n\t\t\tprocessEdge( face.a, face.b, vertices, edges, face, metaVertices );\r\n\t\t\tprocessEdge( face.b, face.c, vertices, edges, face, metaVertices );\r\n\t\t\tprocessEdge( face.c, face.a, vertices, edges, face, metaVertices );\r\n\r\n\t\t}\r\n\t}\r\n\r\n\tfunction newFace( newFaces, a, b, c ) {\r\n\r\n\t\tnewFaces.push( new THREE.Face3( a, b, c ) );\r\n\r\n\t}\r\n\r\n\r\n\t/////////////////////////////\r\n\r\n\t// Performs one iteration of Subdivision\r\n\tTHREE.SubdivisionModifier.prototype.smooth = function ( geometry ) {\r\n\r\n\t\tvar tmp = new THREE.Vector3();\r\n\r\n\t\tvar oldVertices, oldFaces;\r\n\t\tvar newVertices, newFaces; // newUVs = [];\r\n\r\n\t\tvar n, l, i, il, j, k;\r\n\t\tvar metaVertices, sourceEdges;\r\n\r\n\t\t// new stuff.\r\n\t\tvar sourceEdges, newEdgeVertices, newSourceVertices\r\n\r\n\t\toldVertices = geometry.vertices; // { x, y, z}\r\n\t\toldFaces = geometry.faces; // { a: oldVertex1, b: oldVertex2, c: oldVertex3 }\r\n\r\n\t\t/******************************************************\r\n\t\t *\r\n\t\t * Step 0: Preprocess Geometry to Generate edges Lookup\r\n\t\t *\r\n\t\t *******************************************************/\r\n\r\n\t\tmetaVertices = new Array( oldVertices.length );\r\n\t\tsourceEdges = {}; // Edge => { oldVertex1, oldVertex2, faces[]  }\r\n\r\n\t\tgenerateLookups(oldVertices, oldFaces, metaVertices, sourceEdges);\r\n\r\n\r\n\t\t/******************************************************\r\n\t\t *\r\n\t\t *\tStep 1. \r\n\t\t *\tFor each edge, create a new Edge Vertex,\r\n\t\t *\tthen position it.\r\n\t\t *\r\n\t\t *******************************************************/\r\n\r\n\t\tnewEdgeVertices = [];\r\n\t\tvar other, currentEdge, newEdge, face;\r\n\t\tvar edgeVertexWeight, adjacentVertexWeight, connectedFaces;\r\n\r\n\t\tfor ( i in sourceEdges ) {\r\n\r\n\t\t\tcurrentEdge = sourceEdges[ i ];\r\n\t\t\tnewEdge = new THREE.Vector3();\r\n\r\n\t\t\tedgeVertexWeight = 3 / 8;\r\n\t\t\tadjacentVertexWeight = 1 / 8;\r\n\r\n\t\t\tconnectedFaces = currentEdge.faces.length;\r\n\r\n\t\t\t// check how many linked faces. 2 should be correct.\r\n\t\t\tif ( connectedFaces != 2 ) {\r\n\r\n\t\t\t\t// if length is not 2, handle condition\r\n\t\t\t\tedgeVertexWeight = 0.5;\r\n\t\t\t\tadjacentVertexWeight = 0;\r\n\r\n\t\t\t\tif ( connectedFaces != 1 ) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (WARNINGS) console.warn('Subdivision Modifier: Number of connected faces != 2, is: ', connectedFaces, currentEdge);\r\n\t\t\t\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tnewEdge.addVectors( currentEdge.a, currentEdge.b ).multiplyScalar( edgeVertexWeight );\r\n\r\n\t\t\ttmp.set( 0, 0, 0 );\r\n\r\n\t\t\tfor ( j = 0; j < connectedFaces; j++ ) {\r\n\r\n\t\t\t\tface = currentEdge.faces[ j ];\r\n\t\t\t\t\r\n\t\t\t\tfor ( k = 0; k < 3; k++ ) {\r\n\r\n\t\t\t\t\tother = oldVertices[ face[ ABC[k] ] ];\r\n\t\t\t\t\tif (other !== currentEdge.a && other !== currentEdge.b ) break;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttmp.add( other );\r\n\r\n\t\t\t}\r\n\r\n\t\t\ttmp.multiplyScalar( adjacentVertexWeight );\r\n\t\t\tnewEdge.add( tmp );\r\n\r\n\t\t\tcurrentEdge.newEdge = newEdgeVertices.length;\r\n\t\t\tnewEdgeVertices.push(newEdge);\r\n\r\n\t\t\t// console.log(currentEdge, newEdge);\r\n\t\t}\r\n\r\n\t\t/******************************************************\r\n\t\t *\r\n\t\t *\tStep 2. \r\n\t\t *\tReposition each source vertices.\r\n\t\t *\r\n\t\t *******************************************************/\r\n\r\n\t\tvar beta, sourceVertexWeight, connectingVertexWeight;\r\n\t\tvar connectingEdge, connectingEdges, oldVertex, newSourceVertex;\r\n\t\tnewSourceVertices = [];\r\n\r\n\t\tfor ( i = 0, il = oldVertices.length; i < il; i++ ) {\r\n\r\n\t\t\toldVertex = oldVertices[ i ];\r\n\r\n\t\t\t// find all connecting edges (using lookupTable)\r\n\t\t\tconnectingEdges = metaVertices[ i ].edges;\r\n\t\t\tn = connectingEdges.length;\r\n\t\t\tbeta;\r\n\r\n\t\t\tif ( n == 3 ) {\r\n\r\n\t\t\t\tbeta = 3 / 16;\r\n\r\n\t\t\t} else if ( n > 3 ) {\r\n\r\n\t\t\t\tbeta = 3 / ( 8 * n ); // Warren's modified formula\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// Loop's original beta formula\r\n\t\t\t// beta = 1 / n * ( 5/8 - Math.pow( 3/8 + 1/4 * Math.cos( 2 * Math. PI / n ), 2) );\r\n\r\n\t\t\tsourceVertexWeight = 1 - n * beta;\r\n\t\t\tconnectingVertexWeight = beta;\r\n\r\n\t\t\tif ( n <= 2 ) {\r\n\t\t\t\t\r\n\t\t\t\t// crease and boundary rules\r\n\t\t\t\t// console.warn('crease and boundary rules');\r\n\r\n\t\t\t\tif ( n == 2 ) {\r\n\r\n\t\t\t\t\tif (WARNINGS) console.warn('2 connecting edges', connectingEdges);\r\n\t\t\t\t\tsourceVertexWeight = 3 / 4;\r\n\t\t\t\t\tconnectingVertexWeight = 1 / 8;\r\n\r\n\t\t\t\t\t// sourceVertexWeight = 1;\r\n\t\t\t\t\t// connectingVertexWeight = 0;\r\n\r\n\t\t\t\t} else if ( n == 1 ) {\r\n\r\n\t\t\t\t\tif (WARNINGS) console.warn('only 1 connecting edge');\r\n\r\n\t\t\t\t} else if ( n == 0 ) {\r\n\r\n\t\t\t\t\tif (WARNINGS) console.warn('0 connecting edges');\r\n\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\tnewSourceVertex = oldVertex.clone().multiplyScalar( sourceVertexWeight );\r\n\r\n\t\t\ttmp.set( 0, 0, 0 );\r\n\r\n\t\t\tfor ( j=0; j < n; j++ ) {\r\n\r\n\t\t\t\tconnectingEdge = connectingEdges[ j ];\r\n\t\t\t\tother = connectingEdge.a !== oldVertex ? connectingEdge.a : connectingEdge.b;\r\n\t\t\t\ttmp.add( other );\r\n\r\n\t\t\t}\r\n\r\n\t\t\ttmp.multiplyScalar( connectingVertexWeight );\r\n\t\t\tnewSourceVertex.add( tmp );\r\n\t\t\t\r\n\t\t\tnewSourceVertices.push( newSourceVertex );\r\n\r\n\t\t}\r\n\r\n\t\t\t\t\t\t\t   \r\n\t\t/******************************************************\r\n\t\t *\r\n\t\t *\tStep 3. \r\n\t\t *\tGenerate Faces between source vertecies\r\n\t\t *\tand edge vertices.\r\n\t\t *\r\n\t\t *******************************************************/\r\n\r\n\t\tnewVertices = newSourceVertices.concat( newEdgeVertices );\r\n\t\tvar sl = newSourceVertices.length, edge1, edge2, edge3;\r\n\t\tnewFaces = [];\r\n\r\n\t\tfor ( i = 0, il = oldFaces.length; i < il; i++ ) {\r\n\r\n\t\t\tface = oldFaces[ i ];\r\n\r\n\t\t\t// find the 3 new edges vertex of each old face\r\n\r\n\t\t\tedge1 = getEdge( face.a, face.b, sourceEdges ).newEdge + sl;\r\n\t\t\tedge2 = getEdge( face.b, face.c, sourceEdges ).newEdge + sl;\r\n\t\t\tedge3 = getEdge( face.c, face.a, sourceEdges ).newEdge + sl;\r\n\r\n\t\t\t// create 4 faces.\r\n\r\n\t\t\tnewFace( newFaces, edge1, edge2, edge3 );\r\n\t\t\tnewFace( newFaces, face.a, edge1, edge3 );\r\n\t\t\tnewFace( newFaces, face.b, edge2, edge1 );\r\n\t\t\tnewFace( newFaces, face.c, edge3, edge2 );\r\n\r\n\t\t}\r\n\r\n\t\t// Overwrite old arrays\r\n\t\tgeometry.vertices = newVertices;\r\n\t\tgeometry.faces = newFaces;\r\n\r\n\t\t// console.log('done');\r\n\r\n\t};\r\n\r\n\r\n})();"
        },
        "$:/plugins/rboue/Three.js/Lib/BlendCharacter.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/BlendCharacter.js",
            "module-type": "library",
            "text": "/**\n * @author Michael Guerrero / http://realitymeltdown.com\n */\n\nTHREE.BlendCharacter = function () {\n\n\tthis.animations = {};\n\tthis.weightSchedule = [];\n\tthis.warpSchedule = [];\n\n\tthis.load = function ( url, onLoad ) {\n\n\t\tvar scope = this;\n\n\t\tvar loader = new THREE.JSONLoader();\n\t\tloader.load( url, function( geometry, materials ) {\n\n\t\t\tvar originalMaterial = materials[ 0 ];\n\t\t\toriginalMaterial.skinning = true;\n\n\t\t\tTHREE.SkinnedMesh.call( scope, geometry, originalMaterial );\n\n\t\t\t// Create the animations\n\n\t\t\tfor ( var i = 0; i < geometry.animations.length; ++i ) {\n\n\t\t\t\tvar animName = geometry.animations[ i ].name;\n\t\t\t\tscope.animations[ animName ] = new THREE.Animation( scope, geometry.animations[ i ] );\n\n\t\t\t}\n\n\t\t\t// Create the debug visualization\n\n\t\t\tscope.skeletonHelper = new THREE.SkeletonHelper( scope );\n\t\t\tscope.skeletonHelper.material.linewidth = 3;\n\t\t\tscope.add( scope.skeletonHelper );\n\n\t\t\tscope.showSkeleton( false );\n\n\t\t\t// Loading is complete, fire the callback\n\t\t\tif ( onLoad !== undefined ) onLoad();\n\n\t\t} );\n\n\t};\n\n\tthis.update = function( dt ) {\n\n\t\tfor ( var i = this.weightSchedule.length - 1; i >= 0; --i ) {\n\n\t\t\tvar data = this.weightSchedule[ i ];\n\t\t\tdata.timeElapsed += dt;\n\n\t\t\t// If the transition is complete, remove it from the schedule\n\n\t\t\tif ( data.timeElapsed > data.duration ) {\n\n\t\t\t\tdata.anim.weight = data.endWeight;\n\t\t\t\tthis.weightSchedule.splice( i, 1 );\n\n\t\t\t\t// If we've faded out completely, stop the animation\n\n\t\t\t\tif ( data.anim.weight == 0 ) {\n\n\t\t\t\t\tdata.anim.stop( 0 );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// interpolate the weight for the current time\n\n\t\t\t\tdata.anim.weight = data.startWeight + (data.endWeight - data.startWeight) * data.timeElapsed / data.duration;\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.updateWarps( dt );\n\t\tthis.skeletonHelper.update();\n\n\t};\n\n\tthis.updateWarps = function( dt ) {\n\n\t\t// Warping modifies the time scale over time to make 2 animations of different\n\t\t// lengths match. This is useful for smoothing out transitions that get out of\n\t\t// phase such as between a walk and run cycle\n\n\t\tfor ( var i = this.warpSchedule.length - 1; i >= 0; --i ) {\n\n\t\t\tvar data = this.warpSchedule[ i ];\n\t\t\tdata.timeElapsed += dt;\n\n\t\t\tif ( data.timeElapsed > data.duration ) {\n\n\t\t\t\tdata.to.weight = 1;\n\t\t\t\tdata.to.timeScale = 1;\n\t\t\t\tdata.from.weight = 0;\n\t\t\t\tdata.from.timeScale = 1;\n\t\t\t\tdata.from.stop( 0 );\n\n\t\t\t\tthis.warpSchedule.splice( i, 1 );\n\n\t\t\t} else {\n\n\t\t\t\tvar alpha = data.timeElapsed / data.duration;\n\n\t\t\t\tvar fromLength = data.from.data.length;\n\t\t\t\tvar toLength = data.to.data.length;\n\n\t\t\t\tvar fromToRatio = fromLength / toLength;\n\t\t\t\tvar toFromRatio = toLength / fromLength;\n\n\t\t\t\t// scale from each time proportionally to the other animation\n\n\t\t\t\tdata.from.timeScale = ( 1 - alpha ) + fromToRatio * alpha;\n\t\t\t\tdata.to.timeScale = alpha + toFromRatio * ( 1 - alpha );\n\n\t\t\t\tdata.from.weight = 1 - alpha;\n\t\t\t\tdata.to.weight = alpha;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tthis.play = function(animName, weight) {\n\n\t\tthis.animations[ animName ].play( 0, weight );\n\n\t};\n\n\tthis.crossfade = function( fromAnimName, toAnimName, duration ) {\n\n\t\tvar fromAnim = this.animations[ fromAnimName ];\n\t\tvar toAnim = this.animations[ toAnimName ];\n\n\t\tfromAnim.play( 0, 1 );\n\t\ttoAnim.play( 0, 0 );\n\n\t\tthis.weightSchedule.push( {\n\n\t\t\tanim: fromAnim,\n\t\t\tstartWeight: 1,\n\t\t\tendWeight: 0,\n\t\t\ttimeElapsed: 0,\n\t\t\tduration: duration\n\n\t\t} );\n\n\t\tthis.weightSchedule.push( {\n\n\t\t\tanim: toAnim,\n\t\t\tstartWeight: 0,\n\t\t\tendWeight: 1,\n\t\t\ttimeElapsed: 0,\n\t\t\tduration: duration\n\n\t\t} );\n\n\t};\n\n\tthis.warp = function( fromAnimName, toAnimName, duration ) {\n\n\t\tvar fromAnim = this.animations[ fromAnimName ];\n\t\tvar toAnim = this.animations[ toAnimName ];\n\n\t\tfromAnim.play( 0, 1 );\n\t\ttoAnim.play( 0, 0 );\n\n\t\tthis.warpSchedule.push( {\n\n\t\t\tfrom: fromAnim,\n\t\t\tto: toAnim,\n\t\t\ttimeElapsed: 0,\n\t\t\tduration: duration\n\n\t\t} );\n\n\t};\n\n\tthis.applyWeight = function(animName, weight) {\n\n\t\tthis.animations[ animName ].weight = weight;\n\n\t};\n\n\tthis.pauseAll = function() {\n\n\t\tfor ( var a in this.animations ) {\n\n\t\t\tif ( this.animations[ a ].isPlaying ) {\n\n\t\t\t\tthis.animations[ a ].stop();\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tthis.unPauseAll = function() {\n\n\tfor ( var a in this.animations ) {\n\n\t  if ( this.animations[ a ].isPlaying && this.animations[ a ].isPaused ) {\n\n\t\tthis.animations[ a ].pause();\n\n\t  }\n\n\t}\n\n  };\n\n\n\tthis.stopAll = function() {\n\n\t\tfor ( a in this.animations ) {\n\n\t\t\tif ( this.animations[ a ].isPlaying ) {\n\t\t\t\tthis.animations[ a ].stop(0);\n\t\t\t}\n\n\t\t\tthis.animations[ a ].weight = 0;\n\n\t\t}\n\n\t\tthis.weightSchedule.length = 0;\n\t\tthis.warpSchedule.length = 0;\n\n\t}\n\n\tthis.showSkeleton = function( boolean ) {\n\n\t\tthis.skeletonHelper.visible = boolean;\n\n\t}\n\n\tthis.showModel = function( boolean ) {\n\n\t\tthis.visible = boolean;\n\n\t}\n\n};\n\n\nTHREE.BlendCharacter.prototype = Object.create( THREE.SkinnedMesh.prototype );\n\nTHREE.BlendCharacter.prototype.getForward = function() {\n\n\tvar forward = new THREE.Vector3();\n\n\treturn function() {\n\n\t\t// pull the character's forward basis vector out of the matrix\n\t\tforward.set(\n\t\t\t-this.matrix.elements[ 8 ],\n\t\t\t-this.matrix.elements[ 9 ],\n\t\t\t-this.matrix.elements[ 10 ]\n\t\t);\n\n\t\treturn forward;\n\t}\n}\n\n"
        },
        "$:/plugins/rboue/Three.js/Lib/SkyShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/SkyShader.js",
            "module-type": "library",
            "text": "/**\n * @author zz85 / https://github.com/zz85\n * \n * Based on \"A Practical Analytic Model for Daylight\" \n * aka The Preetham Model, the de facto standard analytic skydome model\n * http://www.cs.utah.edu/~shirley/papers/sunsky/sunsky.pdf\n * \n * First implemented by Simon Wallner\n * http://www.simonwallner.at/projects/atmospheric-scattering\n * \n * Improved by Martin Upitis\n * http://blenderartists.org/forum/showthread.php?245954-preethams-sky-impementation-HDR\n * \n * Three.js integration by zz85 http://twitter.com/blurspline\n*/\n\nTHREE.ShaderLib['sky'] = {\n\n\tuniforms: {\n\n\t\tluminance:\t { type: \"f\", value:1 },\n\t\tturbidity:\t { type: \"f\", value:2 },\n\t\treileigh:\t { type: \"f\", value:1 },\n\t\tmieCoefficient:\t { type: \"f\", value:0.005 },\n\t\tmieDirectionalG: { type: \"f\", value:0.8 },\n\t\tsunPosition: \t { type: \"v3\", value: new THREE.Vector3() }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec3 vWorldPosition;\",\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\",\n\t\t\t\"vWorldPosition = worldPosition.xyz;\",\n\t\t\t\"vUv = uv;\",\n\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\",\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\n\t\t\"uniform sampler2D skySampler;\",\n\t\t\"uniform vec3 sunPosition;\",\n\t\t\"varying vec3 vWorldPosition;\",\n\t\t\"varying vec2 vUv;\",\n\n\n\t\t\"vec3 cameraPos = vec3(0., 0., 0.);\",\n\t\t\"// uniform sampler2D sDiffuse;\",\n\t\t\"// const float turbidity = 10.0; //\",\n\t\t\"// const float reileigh = 2.; //\",\n\t\t\"// const float luminance = 1.0; //\",\n\t\t\"// const float mieCoefficient = 0.005;\",\n\t\t\"// const float mieDirectionalG = 0.8;\",\n\n\t\t\"uniform float luminance;\",\n\t\t\"uniform float turbidity;\",\n\t\t\"uniform float reileigh;\",\n\t\t\"uniform float mieCoefficient;\",\n\t\t\"uniform float mieDirectionalG;\",\n\n\n\t\t\"vec3 sunDirection = normalize(sunPosition);\",\n\t\t\"float reileighCoefficient = reileigh;\",\n\n\t\t\"// constants for atmospheric scattering\",\n\t\t\"const float e = 2.71828182845904523536028747135266249775724709369995957;\",\n\t\t\"const float pi = 3.141592653589793238462643383279502884197169;\",\n\n\t\t\"const float n = 1.0003; // refractive index of air\",\n\t\t\"const float N = 2.545E25; // number of molecules per unit volume for air at\",\n\t\t\t\t\t\t\t\t\"// 288.15K and 1013mb (sea level -45 celsius)\",\n\t\t\"const float pn = 0.035;\t// depolatization factor for standard air\",\n\n\t\t\"// wavelength of used primaries, according to preetham\",\n\t\t\"const vec3 lambda = vec3(680E-9, 550E-9, 450E-9);\",\n\n\t\t\"// mie stuff\",\n\t\t\"// K coefficient for the primaries\",\n\t\t\"const vec3 K = vec3(0.686, 0.678, 0.666);\",\n\t\t\"const float v = 4.0;\",\n\n\t\t\"// optical length at zenith for molecules\",\n\t\t\"const float rayleighZenithLength = 8.4E3;\",\n\t\t\"const float mieZenithLength = 1.25E3;\",\n\t\t\"const vec3 up = vec3(0.0, 1.0, 0.0);\",\n\n\t\t\"const float EE = 1000.0;\",\n\t\t\"const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324;\",\n\t\t\"// 66 arc seconds -> degrees, and the cosine of that\",\n\n\t\t\"// earth shadow hack\",\n\t\t\"const float cutoffAngle = pi/1.95;\",\n\t\t\"const float steepness = 1.5;\",\n\n\n\t\t\"vec3 totalRayleigh(vec3 lambda)\",\n\t\t\"{\",\n\t\t\t\"return (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn));\",\n\t\t\"}\",\n\n\t\t\"float rayleighPhase(float cosTheta)\",\n\t\t\"{\t \",\n\t\t\t\"return (3.0 / (16.0*pi)) * (1.0 + pow(cosTheta, 2.0));\",\n\t\t\"//\treturn (1.0 / (3.0*pi)) * (1.0 + pow(cosTheta, 2.0));\",\n\t\t\"//\treturn (3.0 / 4.0) * (1.0 + pow(cosTheta, 2.0));\",\n\t\t\"}\",\n\n\t\t\"vec3 totalMie(vec3 lambda, vec3 K, float T)\",\n\t\t\"{\",\n\t\t\t\"float c = (0.2 * T ) * 10E-18;\",\n\t\t\t\"return 0.434 * c * pi * pow((2.0 * pi) / lambda, vec3(v - 2.0)) * K;\",\n\t\t\"}\",\n\n\t\t\"float hgPhase(float cosTheta, float g)\",\n\t\t\"{\",\n\t\t\t\"return (1.0 / (4.0*pi)) * ((1.0 - pow(g, 2.0)) / pow(1.0 - 2.0*g*cosTheta + pow(g, 2.0), 1.5));\",\n\t\t\"}\",\n\n\t\t\"float sunIntensity(float zenithAngleCos)\",\n\t\t\"{\",\n\t\t\t\"return EE * max(0.0, 1.0 - exp(-((cutoffAngle - acos(zenithAngleCos))/steepness)));\",\n\t\t\"}\",\n\n\t\t\"// float logLuminance(vec3 c)\",\n\t\t\"// {\",\n\t\t\"// \treturn log(c.r * 0.2126 + c.g * 0.7152 + c.b * 0.0722);\",\n\t\t\"// }\",\n\n\t\t\"// Filmic ToneMapping http://filmicgames.com/archives/75\",\n\t\t\"float A = 0.15;\",\n\t\t\"float B = 0.50;\",\n\t\t\"float C = 0.10;\",\n\t\t\"float D = 0.20;\",\n\t\t\"float E = 0.02;\",\n\t\t\"float F = 0.30;\",\n\t\t\"float W = 1000.0;\",\n\n\t\t\"vec3 Uncharted2Tonemap(vec3 x)\",\n\t\t\"{\",\n\t\t   \"return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;\",\n\t\t\"}\",\n\n\n\t\t\"void main() \",\n\t\t\"{\",\n\t\t\t\"float sunfade = 1.0-clamp(1.0-exp((sunPosition.y/450000.0)),0.0,1.0);\",\n\n\t\t\t\"// luminance =  1.0 ;// vWorldPosition.y / 450000. + 0.5; //sunPosition.y / 450000. * 1. + 0.5;\",\n\n\t\t\t \"// gl_FragColor = vec4(sunfade, sunfade, sunfade, 1.0);\",\n\t\t\t\n\t\t\t\"reileighCoefficient = reileighCoefficient - (1.0* (1.0-sunfade));\",\n\t\t\t\n\t\t\t\"float sunE = sunIntensity(dot(sunDirection, up));\",\n\n\t\t\t\"// extinction (absorbtion + out scattering) \",\n\t\t\t\"// rayleigh coefficients\",\n\t\t\t\"vec3 betaR = totalRayleigh(lambda) * reileighCoefficient;\",\n\n\t\t\t\"// mie coefficients\",\n\t\t\t\"vec3 betaM = totalMie(lambda, K, turbidity) * mieCoefficient;\",\n\n\t\t\t\"// optical length\",\n\t\t\t\"// cutoff angle at 90 to avoid singularity in next formula.\",\n\t\t\t\"float zenithAngle = acos(max(0.0, dot(up, normalize(vWorldPosition - cameraPos))));\",\n\t\t\t\"float sR = rayleighZenithLength / (cos(zenithAngle) + 0.15 * pow(93.885 - ((zenithAngle * 180.0) / pi), -1.253));\",\n\t\t\t\"float sM = mieZenithLength / (cos(zenithAngle) + 0.15 * pow(93.885 - ((zenithAngle * 180.0) / pi), -1.253));\",\n\n\n\n\t\t\t\"// combined extinction factor\t\",\n\t\t\t\"vec3 Fex = exp(-(betaR * sR + betaM * sM));\",\n\n\t\t\t\"// in scattering\",\n\t\t\t\"float cosTheta = dot(normalize(vWorldPosition - cameraPos), sunDirection);\",\n\n\t\t\t\"float rPhase = rayleighPhase(cosTheta*0.5+0.5);\",\n\t\t\t\"vec3 betaRTheta = betaR * rPhase;\",\n\n\t\t\t\"float mPhase = hgPhase(cosTheta, mieDirectionalG);\",\n\t\t\t\"vec3 betaMTheta = betaM * mPhase;\",\n\n\n\t\t\t\"vec3 Lin = pow(sunE * ((betaRTheta + betaMTheta) / (betaR + betaM)) * (1.0 - Fex),vec3(1.5));\",\n\t\t\t\"Lin *= mix(vec3(1.0),pow(sunE * ((betaRTheta + betaMTheta) / (betaR + betaM)) * Fex,vec3(1.0/2.0)),clamp(pow(1.0-dot(up, sunDirection),5.0),0.0,1.0));\",\n\n\t\t\t\"//nightsky\",\n\t\t\t\"vec3 direction = normalize(vWorldPosition - cameraPos);\",\n\t\t\t\"float theta = acos(direction.y); // elevation --> y-axis, [-pi/2, pi/2]\",\n\t\t\t\"float phi = atan(direction.z, direction.x); // azimuth --> x-axis [-pi/2, pi/2]\",\n\t\t\t\"vec2 uv = vec2(phi, theta) / vec2(2.0*pi, pi) + vec2(0.5, 0.0);\",\n\t\t\t\"// vec3 L0 = texture2D(skySampler, uv).rgb+0.1 * Fex;\",\n\t\t\t\"vec3 L0 = vec3(0.1) * Fex;\",\n\t\t\t\n\t\t\t\"// composition + solar disc\",\n\t\t\t\"//if (cosTheta > sunAngularDiameterCos)\",\n\t\t\t\"float sundisk = smoothstep(sunAngularDiameterCos,sunAngularDiameterCos+0.00002,cosTheta);\",\n\t\t\t\"// if (normalize(vWorldPosition - cameraPos).y>0.0)\",\n\t\t\t\"L0 += (sunE * 19000.0 * Fex)*sundisk;\",\n\n\n\t\t\t\"vec3 whiteScale = 1.0/Uncharted2Tonemap(vec3(W));\",\n\t\t\t\n\t\t\t\"vec3 texColor = (Lin+L0);   \",\n\t\t\t\"texColor *= 0.04 ;\",\n\t\t\t\"texColor += vec3(0.0,0.001,0.0025)*0.3;\",\n\t\t\t\n\t\t\t\"float g_fMaxLuminance = 1.0;\",\n\t\t\t\"float fLumScaled = 0.1 / luminance;     \",\n\t\t\t\"float fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (g_fMaxLuminance * g_fMaxLuminance)))) / (1.0 + fLumScaled); \",\n\n\t\t\t\"float ExposureBias = fLumCompressed;\",\n\t\t   \n\t\t\t\"vec3 curr = Uncharted2Tonemap((log2(2.0/pow(luminance,4.0)))*texColor);\",\n\t\t\t\"vec3 color = curr*whiteScale;\",\n\n\t\t\t\"vec3 retColor = pow(color,vec3(1.0/(1.2+(1.2*sunfade))));\",\n\n\t\t\t\n\t\t\t\"gl_FragColor.rgb = retColor;\",\n\t\t\t\t\n\t\t\t\"gl_FragColor.a = 1.0;\",\n\t\t\"}\",\n\n\t].join(\"\\n\")\n\n};\n\nTHREE.Sky = function () {\n\n\tvar skyShader = THREE.ShaderLib[ \"sky\" ];\n\tvar skyUniforms = THREE.UniformsUtils.clone( skyShader.uniforms );\n\n\tvar skyMat = new THREE.ShaderMaterial( { \n\t\tfragmentShader: skyShader.fragmentShader, \n\t\tvertexShader: skyShader.vertexShader, \n\t\tuniforms: skyUniforms,\n\t\tside: THREE.BackSide\n\t} );\n\n\tvar skyGeo = new THREE.SphereGeometry( 450000, 32, 15 );\n\tvar skyMesh = new THREE.Mesh( skyGeo, skyMat );\n\n\n\t// Expose variables\n\tthis.mesh = skyMesh;\n\tthis.uniforms = skyUniforms;\n\n\n};\n\n"
        },
        "$:/plugins/rboue/Three.js/Lib/SimulationRenderer.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/SimulationRenderer.js",
            "module-type": "library",
            "text": "/**\n * @author zz85 https://github.com/zz85 / http://www.lab4games.net/zz85/blog\n *\n * Bird Simulation Render\n *\n * \tA simple scene rendering a quad of the following shaders\n *\t1. Pass-thru Shader,\n *\t2. Bird Position Update Shader,\n *\t3. Bird Velocity Update Shader\n *\n */\n\nfunction SimulationRenderer(WIDTH, renderer) {\n\n\tWIDTH = WIDTH || 4;\n\tvar camera = new THREE.Camera();\n\tcamera.position.z = 1;\n\n\t// Init RTT stuff\n\tgl = renderer.getContext();\n\n\tif( !gl.getExtension( \"OES_texture_float\" )) {\n\t\talert( \"No OES_texture_float support for float textures!\" );\n\t\treturn;\n\t}\n\n\tif( gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS) == 0) {\n\t\talert( \"No support for vertex shader textures!\" );\n\t\treturn;\n\t}\n\n\tvar scene = new THREE.Scene();\n\n\tvar uniforms = {\n\t\ttime: { type: \"f\", value: 1.0 },\n\t\tresolution: { type: \"v2\", value: new THREE.Vector2( WIDTH, WIDTH ) },\n\t\ttexture: { type: \"t\", value: null }\n\t};\n\n\tvar passThruShader = new THREE.ShaderMaterial( {\n\t\tuniforms: uniforms,\n\t\tvertexShader: document.getElementById( 'vertexShader' ).textContent,\n\t\tfragmentShader: document.getElementById( 'fragmentShader' ).textContent\n\t} );\n\n\tvar mesh = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), passThruShader );\n\n\tvar positionShader = new THREE.ShaderMaterial( {\n\n\t\tuniforms: {\n\t\t\ttime: { type: \"f\", value: 1.0 },\n\t\t\tdelta: { type: \"f\", value: 0.0 },\n\t\t\tresolution: { type: \"v2\", value: new THREE.Vector2( WIDTH, WIDTH ) },\n\t\t\ttexturePosition: { type: \"t\", value: null },\n\t\t\ttextureVelocity: { type: \"t\", value: null },\n\t\t},\n\t\tvertexShader: document.getElementById( 'vertexShader' ).textContent,\n\t\tfragmentShader: document.getElementById( 'fragmentShaderPosition' ).textContent\n\n\t} );\n\n\tthis.positionShader = positionShader;\n\n\tvar velocityShader = new THREE.ShaderMaterial( {\n\n\t\tuniforms: {\n\t\t\ttime: { type: \"f\", value: 1.0 },\n\t\t\tdelta: { type: \"f\", value: 0.0 },\n\t\t\tresolution: { type: \"v2\", value: new THREE.Vector2( WIDTH, WIDTH ) },\n\t\t\ttexturePosition: { type: \"t\", value: null },\n\t\t\ttextureVelocity: { type: \"t\", value: null },\n\t\t\ttesting: { type: \"f\", value: 1.0 },\n\t\t\tseperationDistance: { type: \"f\", value: 1.0 },\n\t\t\talignmentDistance: { type: \"f\", value: 1.0 },\n\t\t\tcohesionDistance: { type: \"f\", value: 1.0 },\n\t\t\tfreedomFactor: { type: \"f\", value: 1.0 },\n\t\t\tpredator: { type: \"v3\", value: new THREE.Vector3() }\n\t\t},\n\t\tdefines: {\n\t\t\tWIDTH: WIDTH.toFixed(2)\n\t\t},\n\t\tvertexShader: document.getElementById( 'vertexShader' ).textContent,\n\t\tfragmentShader: document.getElementById( 'fragmentShaderVelocity' ).textContent\n\n\t} );\n\n\tthis.velocityUniforms = velocityShader.uniforms;\n\n\tscene.add( mesh );\n\n\tvar flipflop = true;\n\tvar rtPosition1, rtPosition2, rtVelocity1, rtVelocity2;\n\n\tfunction init() {\n\t\tvar dtPosition = generatePositionTexture();\n\t\tvar dtVelocity = generateVelocityTexture();\n\n\t\trtPosition1 = getRenderTarget( THREE.RGBAFormat );\n\t\trtPosition2 = rtPosition1.clone();\n\t\trtVelocity1 = getRenderTarget( THREE.RGBFormat );\n\t\trtVelocity2 = rtVelocity1.clone();\n\n\t\tsimulator.renderTexture(dtPosition, rtPosition1);\n\t\tsimulator.renderTexture(rtPosition1, rtPosition2);\n\n\t\tsimulator.renderTexture(dtVelocity, rtVelocity1);\n\t\tsimulator.renderTexture(rtVelocity1, rtVelocity2);\n\n\t\tsimulator.velocityUniforms.testing.value = 10;\n\t}\n\n\tthis.init = init;\n\n\tfunction getRenderTarget( type ) {\n\t\tvar renderTarget = new THREE.WebGLRenderTarget(WIDTH, WIDTH, {\n\t\t\twrapS: THREE.RepeatWrapping,\n\t\t\twrapT: THREE.RepeatWrapping,\n\t\t\tminFilter: THREE.NearestFilter,\n\t\t\tmagFilter: THREE.NearestFilter,\n\t\t\tformat: type,\n\t\t\ttype: THREE.FloatType,\n\t\t\tstencilBuffer: false\n\t\t});\n\n\t\treturn renderTarget;\n\t}\n\n\t// Takes a texture, and render out as another texture\n\tthis.renderTexture = function ( input, output ) {\n\t\tmesh.material = passThruShader;\n\t\tuniforms.texture.value = input;\n\t\trenderer.render( scene, camera, output );\n\t}\n\n\n\tthis.renderPosition = function(position, velocity, output, delta) {\n\t\tmesh.material = positionShader;\n\t\tpositionShader.uniforms.texturePosition.value = position;\n\t\tpositionShader.uniforms.textureVelocity.value = velocity;\n\t\tpositionShader.uniforms.time.value = performance.now();\n\t\tpositionShader.uniforms.delta.value = delta;\n\t\trenderer.render( scene, camera, output );\n\t\tthis.currentPosition = output;\n\t}\n\n\tthis.renderVelocity = function(position, velocity, output, delta) {\n\t\tmesh.material = velocityShader;\n\t\tvelocityShader.uniforms.texturePosition.value = position;\n\t\tvelocityShader.uniforms.textureVelocity.value = velocity;\n\t\tvelocityShader.uniforms.time.value = performance.now();\n\t\tvelocityShader.uniforms.delta.value = delta;\n\t\trenderer.render( scene, camera, output );\n\t\tthis.currentVelocity = output;\n\t}\n\n\tthis.simulate = function( delta ) {\n\n\t\tif (flipflop) {\n\n\t\t\tsimulator.renderVelocity( rtPosition1, rtVelocity1, rtVelocity2, delta );\n\t\t\tsimulator.renderPosition( rtPosition1, rtVelocity2, rtPosition2, delta );\n\n\t\t} else {\n\n\t\t\tsimulator.renderVelocity( rtPosition2, rtVelocity2, rtVelocity1, delta );\n\t\t\tsimulator.renderPosition( rtPosition2, rtVelocity1, rtPosition1, delta );\n\n\t\t}\n\n\t\tflipflop = !flipflop;\n\n\t}\n\n\tfunction generatePositionTexture() {\n\n\t\tvar a = new Float32Array( PARTICLES * 4 );\n\n\t\tfor ( var k = 0, kl = a.length; k < kl; k += 4 ) {\n\n\t\t\tvar x = Math.random() * BOUNDS - BOUNDS_HALF;\n\t\t\tvar y = Math.random() * BOUNDS - BOUNDS_HALF;\n\t\t\tvar z = Math.random() * BOUNDS - BOUNDS_HALF;\n\n\t\t\ta[ k + 0 ] = x;\n\t\t\ta[ k + 1 ] = y;\n\t\t\ta[ k + 2 ] = z;\n\t\t\ta[ k + 3 ] = 1;\n\n\t\t}\n\n\t\tvar texture = new THREE.DataTexture( a, WIDTH, WIDTH, THREE.RGBAFormat, THREE.FloatType );\n\t\ttexture.minFilter = THREE.NearestFilter;\n\t\ttexture.magFilter = THREE.NearestFilter;\n\t\ttexture.needsUpdate = true;\n\t\ttexture.flipY = false;\n\n\t\treturn texture;\n\n\t}\n\n\tfunction generateVelocityTexture() {\n\n\t\tvar a = new Float32Array( PARTICLES * 3 );\n\n\t\tfor ( var k = 0, kl = a.length; k < kl; k += 3 ) {\n\n\t\t\tvar x = Math.random() - 0.5;\n\t\t\tvar y = Math.random() - 0.5;\n\t\t\tvar z = Math.random() - 0.5;\n\n\t\t\ta[ k + 0 ] = x * 10;\n\t\t\ta[ k + 1 ] = y * 10;\n\t\t\ta[ k + 2 ] = z * 10;\n\n\t\t}\n\n\t\tvar texture = new THREE.DataTexture( a, WIDTH, WIDTH, THREE.RGBFormat, THREE.FloatType );\n\t\ttexture.minFilter = THREE.NearestFilter;\n\t\ttexture.magFilter = THREE.NearestFilter;\n\t\ttexture.needsUpdate = true;\n\t\ttexture.flipY = false;\n\n\t\treturn texture;\n\n\t}\n\n}"
        },
        "$:/plugins/rboue/Three.js/Lib/ImprovedNoise.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/ImprovedNoise.js",
            "module-type": "library",
            "text": "// http://mrl.nyu.edu/~perlin/noise/\n\nvar ImprovedNoise = function () {\n\n\tvar p = [151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,\n\t\t 23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,\n\t\t 174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,\n\t\t 133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,\n\t\t 89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,\n\t\t 202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,\n\t\t 248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,\n\t\t 178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,\n\t\t 14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,\n\t\t 93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180];\n\n\tfor (var i=0; i < 256 ; i++) {\n\n\t\tp[256+i] = p[i];\n\n\t}\n\n\tfunction fade(t) {\n\n\t\treturn t * t * t * (t * (t * 6 - 15) + 10);\n\n\t}\n\n\tfunction lerp(t, a, b) {\n\n\t\treturn a + t * (b - a);\n\n\t}\n\n\tfunction grad(hash, x, y, z) {\n\n\t\tvar h = hash & 15;\n\t\tvar u = h < 8 ? x : y, v = h < 4 ? y : h == 12 || h == 14 ? x : z;\n\t\treturn ((h&1) == 0 ? u : -u) + ((h&2) == 0 ? v : -v);\n\n\t}\n\n\treturn {\n\n\t\tnoise: function (x, y, z) {\n\n\t\t\tvar floorX = ~~x, floorY = ~~y, floorZ = ~~z;\n\n\t\t\tvar X = floorX & 255, Y = floorY & 255, Z = floorZ & 255;\n\n\t\t\tx -= floorX;\n\t\t\ty -= floorY;\n\t\t\tz -= floorZ;\n\n\t\t\tvar xMinus1 = x -1, yMinus1 = y - 1, zMinus1 = z - 1;\n\n\t\t\tvar u = fade(x), v = fade(y), w = fade(z);\n\n\t\t\tvar A = p[X]+Y, AA = p[A]+Z, AB = p[A+1]+Z, B = p[X+1]+Y, BA = p[B]+Z, BB = p[B+1]+Z;\n\n\t\t\treturn lerp(w, lerp(v, lerp(u, grad(p[AA], x, y, z), \n\t\t\t\t\t\t\tgrad(p[BA], xMinus1, y, z)),\n\t\t\t\t\t\tlerp(u, grad(p[AB], x, yMinus1, z),\n\t\t\t\t\t\t\tgrad(p[BB], xMinus1, yMinus1, z))),\n\t\t\t\t\tlerp(v, lerp(u, grad(p[AA+1], x, y, zMinus1),\n\t\t\t\t\t\t\tgrad(p[BA+1], xMinus1, y, z-1)),\n\t\t\t\t\t\tlerp(u, grad(p[AB+1], x, yMinus1, zMinus1),\n\t\t\t\t\t\t\tgrad(p[BB+1], xMinus1, yMinus1, zMinus1))));\n\n\t\t}\n\t}\n}\n"
        },
        "$:/plugins/rboue/Three.js/Lib/ShaderTerrain.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/ShaderTerrain.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n */\n\nTHREE.ShaderTerrain = {\n\n\t/* -------------------------------------------------------------------------\n\t//\tDynamic terrain shader\n\t//\t\t- Blinn-Phong\n\t//\t\t- height + normal + diffuse1 + diffuse2 + specular + detail maps\n\t//\t\t- point, directional and hemisphere lights (use with \"lights: true\" material option)\n\t//\t\t- shadow maps receiving\n\t ------------------------------------------------------------------------- */\n\n\t'terrain' : {\n\n\t\tuniforms: THREE.UniformsUtils.merge( [\n\n\t\t\tTHREE.UniformsLib[ \"fog\" ],\n\t\t\tTHREE.UniformsLib[ \"lights\" ],\n\t\t\tTHREE.UniformsLib[ \"shadowmap\" ],\n\n\t\t\t{\n\n\t\t\t\"enableDiffuse1\"  : { type: \"i\", value: 0 },\n\t\t\t\"enableDiffuse2\"  : { type: \"i\", value: 0 },\n\t\t\t\"enableSpecular\"  : { type: \"i\", value: 0 },\n\t\t\t\"enableReflection\": { type: \"i\", value: 0 },\n\n\t\t\t\"tDiffuse1\"\t   : { type: \"t\", value: null },\n\t\t\t\"tDiffuse2\"\t   : { type: \"t\", value: null },\n\t\t\t\"tDetail\"\t   : { type: \"t\", value: null },\n\t\t\t\"tNormal\"\t   : { type: \"t\", value: null },\n\t\t\t\"tSpecular\"\t   : { type: \"t\", value: null },\n\t\t\t\"tDisplacement\": { type: \"t\", value: null },\n\n\t\t\t\"uNormalScale\": { type: \"f\", value: 1.0 },\n\n\t\t\t\"uDisplacementBias\": { type: \"f\", value: 0.0 },\n\t\t\t\"uDisplacementScale\": { type: \"f\", value: 1.0 },\n\n\t\t\t\"diffuse\": { type: \"c\", value: new THREE.Color( 0xeeeeee ) },\n\t\t\t\"specular\": { type: \"c\", value: new THREE.Color( 0x111111 ) },\n\t\t\t\"ambient\": { type: \"c\", value: new THREE.Color( 0x050505 ) },\n\t\t\t\"shininess\": { type: \"f\", value: 30 },\n\t\t\t\"opacity\": { type: \"f\", value: 1 },\n\n\t\t\t\"uRepeatBase\"    : { type: \"v2\", value: new THREE.Vector2( 1, 1 ) },\n\t\t\t\"uRepeatOverlay\" : { type: \"v2\", value: new THREE.Vector2( 1, 1 ) },\n\n\t\t\t\"uOffset\" : { type: \"v2\", value: new THREE.Vector2( 0, 0 ) }\n\n\t\t\t}\n\n\t\t] ),\n\n\t\tfragmentShader: [\n\n\t\t\t\"uniform vec3 ambient;\",\n\t\t\t\"uniform vec3 diffuse;\",\n\t\t\t\"uniform vec3 specular;\",\n\t\t\t\"uniform float shininess;\",\n\t\t\t\"uniform float opacity;\",\n\n\t\t\t\"uniform bool enableDiffuse1;\",\n\t\t\t\"uniform bool enableDiffuse2;\",\n\t\t\t\"uniform bool enableSpecular;\",\n\n\t\t\t\"uniform sampler2D tDiffuse1;\",\n\t\t\t\"uniform sampler2D tDiffuse2;\",\n\t\t\t\"uniform sampler2D tDetail;\",\n\t\t\t\"uniform sampler2D tNormal;\",\n\t\t\t\"uniform sampler2D tSpecular;\",\n\t\t\t\"uniform sampler2D tDisplacement;\",\n\n\t\t\t\"uniform float uNormalScale;\",\n\n\t\t\t\"uniform vec2 uRepeatOverlay;\",\n\t\t\t\"uniform vec2 uRepeatBase;\",\n\n\t\t\t\"uniform vec2 uOffset;\",\n\n\t\t\t\"varying vec3 vTangent;\",\n\t\t\t\"varying vec3 vBinormal;\",\n\t\t\t\"varying vec3 vNormal;\",\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"uniform vec3 ambientLightColor;\",\n\n\t\t\t\"#if MAX_DIR_LIGHTS > 0\",\n\n\t\t\t\t\"uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\",\n\t\t\t\t\"uniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\",\n\n\t\t\t\"#endif\",\n\n\t\t\t\"#if MAX_HEMI_LIGHTS > 0\",\n\n\t\t\t\t\"uniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\",\n\t\t\t\t\"uniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\",\n\t\t\t\t\"uniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\",\n\n\t\t\t\"#endif\",\n\n\t\t\t\"#if MAX_POINT_LIGHTS > 0\",\n\n\t\t\t\t\"uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\",\n\t\t\t\t\"uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\",\n\t\t\t\t\"uniform float pointLightDistance[ MAX_POINT_LIGHTS ];\",\n\n\t\t\t\"#endif\",\n\n\t\t\t\"varying vec3 vViewPosition;\",\n\n\t\t\tTHREE.ShaderChunk[ \"shadowmap_pars_fragment\" ],\n\t\t\tTHREE.ShaderChunk[ \"fog_pars_fragment\" ],\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"gl_FragColor = vec4( vec3( 1.0 ), opacity );\",\n\n\t\t\t\t\"vec3 specularTex = vec3( 1.0 );\",\n\n\t\t\t\t\"vec2 uvOverlay = uRepeatOverlay * vUv + uOffset;\",\n\t\t\t\t\"vec2 uvBase = uRepeatBase * vUv;\",\n\n\t\t\t\t\"vec3 normalTex = texture2D( tDetail, uvOverlay ).xyz * 2.0 - 1.0;\",\n\t\t\t\t\"normalTex.xy *= uNormalScale;\",\n\t\t\t\t\"normalTex = normalize( normalTex );\",\n\n\t\t\t\t\"if( enableDiffuse1 && enableDiffuse2 ) {\",\n\n\t\t\t\t\t\"vec4 colDiffuse1 = texture2D( tDiffuse1, uvOverlay );\",\n\t\t\t\t\t\"vec4 colDiffuse2 = texture2D( tDiffuse2, uvOverlay );\",\n\n\t\t\t\t\t\"#ifdef GAMMA_INPUT\",\n\n\t\t\t\t\t\t\"colDiffuse1.xyz *= colDiffuse1.xyz;\",\n\t\t\t\t\t\t\"colDiffuse2.xyz *= colDiffuse2.xyz;\",\n\n\t\t\t\t\t\"#endif\",\n\n\t\t\t\t\t\"gl_FragColor = gl_FragColor * mix ( colDiffuse1, colDiffuse2, 1.0 - texture2D( tDisplacement, uvBase ) );\",\n\n\t\t\t\t\" } else if( enableDiffuse1 ) {\",\n\n\t\t\t\t\t\"gl_FragColor = gl_FragColor * texture2D( tDiffuse1, uvOverlay );\",\n\n\t\t\t\t\"} else if( enableDiffuse2 ) {\",\n\n\t\t\t\t\t\"gl_FragColor = gl_FragColor * texture2D( tDiffuse2, uvOverlay );\",\n\n\t\t\t\t\"}\",\n\n\t\t\t\t\"if( enableSpecular )\",\n\t\t\t\t\t\"specularTex = texture2D( tSpecular, uvOverlay ).xyz;\",\n\n\t\t\t\t\"mat3 tsb = mat3( vTangent, vBinormal, vNormal );\",\n\t\t\t\t\"vec3 finalNormal = tsb * normalTex;\",\n\n\t\t\t\t\"vec3 normal = normalize( finalNormal );\",\n\t\t\t\t\"vec3 viewPosition = normalize( vViewPosition );\",\n\n\t\t\t\t// point lights\n\n\t\t\t\t\"#if MAX_POINT_LIGHTS > 0\",\n\n\t\t\t\t\t\"vec3 pointDiffuse = vec3( 0.0 );\",\n\t\t\t\t\t\"vec3 pointSpecular = vec3( 0.0 );\",\n\n\t\t\t\t\t\"for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\",\n\n\t\t\t\t\t\t\"vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\",\n\t\t\t\t\t\t\"vec3 lVector = lPosition.xyz + vViewPosition.xyz;\",\n\n\t\t\t\t\t\t\"float lDistance = 1.0;\",\n\t\t\t\t\t\t\"if ( pointLightDistance[ i ] > 0.0 )\",\n\t\t\t\t\t\t\t\"lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\",\n\n\t\t\t\t\t\t\"lVector = normalize( lVector );\",\n\n\t\t\t\t\t\t\"vec3 pointHalfVector = normalize( lVector + viewPosition );\",\n\t\t\t\t\t\t\"float pointDistance = lDistance;\",\n\n\t\t\t\t\t\t\"float pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\",\n\t\t\t\t\t\t\"float pointDiffuseWeight = max( dot( normal, lVector ), 0.0 );\",\n\n\t\t\t\t\t\t\"float pointSpecularWeight = specularTex.r * max( pow( pointDotNormalHalf, shininess ), 0.0 );\",\n\n\t\t\t\t\t\t\"pointDiffuse += pointDistance * pointLightColor[ i ] * diffuse * pointDiffuseWeight;\",\n\t\t\t\t\t\t\"pointSpecular += pointDistance * pointLightColor[ i ] * specular * pointSpecularWeight * pointDiffuseWeight;\",\n\n\t\t\t\t\t\"}\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t// directional lights\n\n\t\t\t\t\"#if MAX_DIR_LIGHTS > 0\",\n\n\t\t\t\t\t\"vec3 dirDiffuse = vec3( 0.0 );\",\n\t\t\t\t\t\"vec3 dirSpecular = vec3( 0.0 );\",\n\n\t\t\t\t\t\"for( int i = 0; i < MAX_DIR_LIGHTS; i++ ) {\",\n\n\t\t\t\t\t\t\"vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\",\n\n\t\t\t\t\t\t\"vec3 dirVector = normalize( lDirection.xyz );\",\n\t\t\t\t\t\t\"vec3 dirHalfVector = normalize( dirVector + viewPosition );\",\n\n\t\t\t\t\t\t\"float dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\",\n\t\t\t\t\t\t\"float dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );\",\n\n\t\t\t\t\t\t\"float dirSpecularWeight = specularTex.r * max( pow( dirDotNormalHalf, shininess ), 0.0 );\",\n\n\t\t\t\t\t\t\"dirDiffuse += directionalLightColor[ i ] * diffuse * dirDiffuseWeight;\",\n\t\t\t\t\t\t\"dirSpecular += directionalLightColor[ i ] * specular * dirSpecularWeight * dirDiffuseWeight;\",\n\n\t\t\t\t\t\"}\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t// hemisphere lights\n\n\t\t\t\t\"#if MAX_HEMI_LIGHTS > 0\",\n\n\t\t\t\t\t\"vec3 hemiDiffuse  = vec3( 0.0 );\",\n\t\t\t\t\t\"vec3 hemiSpecular = vec3( 0.0 );\" ,\n\n\t\t\t\t\t\"for( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\",\n\n\t\t\t\t\t\t\"vec4 lDirection = viewMatrix * vec4( hemisphereLightDirection[ i ], 0.0 );\",\n\t\t\t\t\t\t\"vec3 lVector = normalize( lDirection.xyz );\",\n\n\t\t\t\t\t\t// diffuse\n\n\t\t\t\t\t\t\"float dotProduct = dot( normal, lVector );\",\n\t\t\t\t\t\t\"float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\",\n\n\t\t\t\t\t\t\"hemiDiffuse += diffuse * mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\",\n\n\t\t\t\t\t\t// specular (sky light)\n\n\t\t\t\t\t\t\"float hemiSpecularWeight = 0.0;\",\n\n\t\t\t\t\t\t\"vec3 hemiHalfVectorSky = normalize( lVector + viewPosition );\",\n\t\t\t\t\t\t\"float hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;\",\n\t\t\t\t\t\t\"hemiSpecularWeight += specularTex.r * max( pow( hemiDotNormalHalfSky, shininess ), 0.0 );\",\n\n\t\t\t\t\t\t// specular (ground light)\n\n\t\t\t\t\t\t\"vec3 lVectorGround = -lVector;\",\n\n\t\t\t\t\t\t\"vec3 hemiHalfVectorGround = normalize( lVectorGround + viewPosition );\",\n\t\t\t\t\t\t\"float hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;\",\n\t\t\t\t\t\t\"hemiSpecularWeight += specularTex.r * max( pow( hemiDotNormalHalfGround, shininess ), 0.0 );\",\n\n\t\t\t\t\t\t\"hemiSpecular += specular * mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight ) * hemiSpecularWeight * hemiDiffuseWeight;\",\n\n\t\t\t\t\t\"}\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t// all lights contribution summation\n\n\t\t\t\t\"vec3 totalDiffuse = vec3( 0.0 );\",\n\t\t\t\t\"vec3 totalSpecular = vec3( 0.0 );\",\n\n\t\t\t\t\"#if MAX_DIR_LIGHTS > 0\",\n\n\t\t\t\t\t\"totalDiffuse += dirDiffuse;\",\n\t\t\t\t\t\"totalSpecular += dirSpecular;\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t\"#if MAX_HEMI_LIGHTS > 0\",\n\n\t\t\t\t\t\"totalDiffuse += hemiDiffuse;\",\n\t\t\t\t\t\"totalSpecular += hemiSpecular;\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t\"#if MAX_POINT_LIGHTS > 0\",\n\n\t\t\t\t\t\"totalDiffuse += pointDiffuse;\",\n\t\t\t\t\t\"totalSpecular += pointSpecular;\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t//\"gl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient) + totalSpecular;\",\n\t\t\t\t\"gl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient + totalSpecular );\",\n\n\t\t\t\tTHREE.ShaderChunk[ \"shadowmap_fragment\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"linear_to_gamma_fragment\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"fog_fragment\" ],\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tvertexShader: [\n\n\t\t\t\"attribute vec4 tangent;\",\n\n\t\t\t\"uniform vec2 uRepeatBase;\",\n\n\t\t\t\"uniform sampler2D tNormal;\",\n\n\t\t\t\"#ifdef VERTEX_TEXTURES\",\n\n\t\t\t\t\"uniform sampler2D tDisplacement;\",\n\t\t\t\t\"uniform float uDisplacementScale;\",\n\t\t\t\t\"uniform float uDisplacementBias;\",\n\n\t\t\t\"#endif\",\n\n\t\t\t\"varying vec3 vTangent;\",\n\t\t\t\"varying vec3 vBinormal;\",\n\t\t\t\"varying vec3 vNormal;\",\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"varying vec3 vViewPosition;\",\n\n\t\t\tTHREE.ShaderChunk[ \"shadowmap_pars_vertex\" ],\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"vNormal = normalize( normalMatrix * normal );\",\n\n\t\t\t\t// tangent and binormal vectors\n\n\t\t\t\t\"vTangent = normalize( normalMatrix * tangent.xyz );\",\n\n\t\t\t\t\"vBinormal = cross( vNormal, vTangent ) * tangent.w;\",\n\t\t\t\t\"vBinormal = normalize( vBinormal );\",\n\n\t\t\t\t// texture coordinates\n\n\t\t\t\t\"vUv = uv;\",\n\n\t\t\t\t\"vec2 uvBase = uv * uRepeatBase;\",\n\n\t\t\t\t// displacement mapping\n\n\t\t\t\t\"#ifdef VERTEX_TEXTURES\",\n\n\t\t\t\t\t\"vec3 dv = texture2D( tDisplacement, uvBase ).xyz;\",\n\t\t\t\t\t\"float df = uDisplacementScale * dv.x + uDisplacementBias;\",\n\t\t\t\t\t\"vec3 displacedPosition = normal * df + position;\",\n\n\t\t\t\t\t\"vec4 worldPosition = modelMatrix * vec4( displacedPosition, 1.0 );\",\n\t\t\t\t\t\"vec4 mvPosition = modelViewMatrix * vec4( displacedPosition, 1.0 );\",\n\n\t\t\t\t\"#else\",\n\n\t\t\t\t\t\"vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\",\n\t\t\t\t\t\"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t\"gl_Position = projectionMatrix * mvPosition;\",\n\n\t\t\t\t\"vViewPosition = -mvPosition.xyz;\",\n\n\t\t\t\t\"vec3 normalTex = texture2D( tNormal, uvBase ).xyz * 2.0 - 1.0;\",\n\t\t\t\t\"vNormal = normalMatrix * normalTex;\",\n\n\t\t\t\tTHREE.ShaderChunk[ \"shadowmap_vertex\" ],\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t}\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/WaterShader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/WaterShader.js",
            "module-type": "library",
            "text": "/**\n * @author jbouny / https://github.com/jbouny\n *\n * Work based on :\n * @author Slayvin / http://slayvin.net : Flat mirror for three.js\n * @author Stemkoski / http://www.adelphi.edu/~stemkoski : An implementation of water shader based on the flat mirror\n * @author Jonas Wagner / http://29a.ch/ && http://29a.ch/slides/2012/webglwater/ : Water shader explanations in WebGL\n */\n\nTHREE.ShaderLib['water'] = {\n\n\tuniforms: { \"normalSampler\":\t{ type: \"t\", value: null },\n\t\t\t\t\"mirrorSampler\":\t{ type: \"t\", value: null },\n\t\t\t\t\"alpha\":\t\t\t{ type: \"f\", value: 1.0 },\n\t\t\t\t\"time\":\t\t\t\t{ type: \"f\", value: 0.0 },\n\t\t\t\t\"distortionScale\":\t{ type: \"f\", value: 20.0 },\n\t\t\t\t\"textureMatrix\" :\t{ type: \"m4\", value: new THREE.Matrix4() },\n\t\t\t\t\"sunColor\":\t\t\t{ type: \"c\", value: new THREE.Color( 0x7F7F7F ) },\n\t\t\t\t\"sunDirection\":\t\t{ type: \"v3\", value: new THREE.Vector3( 0.70707, 0.70707, 0 ) },\n\t\t\t\t\"eye\":\t\t\t\t{ type: \"v3\", value: new THREE.Vector3( 0, 0, 0 ) },\n\t\t\t\t\"waterColor\":\t\t{ type: \"c\", value: new THREE.Color( 0x555555 ) }\n\t},\n\n\tvertexShader: [\n\t\t'uniform mat4 textureMatrix;',\n\t\t'uniform float time;',\n\n\t\t'varying vec4 mirrorCoord;',\n\t\t'varying vec3 worldPosition;',\n\t\t\n\t\t'void main()',\n\t\t'{',\n\t\t'\tmirrorCoord = modelMatrix * vec4( position, 1.0 );',\n\t\t'\tworldPosition = mirrorCoord.xyz;',\n\t\t'\tmirrorCoord = textureMatrix * mirrorCoord;',\n\t\t'\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',\n\t\t'}'\n\t].join('\\n'),\n\n\tfragmentShader: [\n\t\t'precision highp float;',\n\t\t\n\t\t'uniform sampler2D mirrorSampler;',\n\t\t'uniform float alpha;',\n\t\t'uniform float time;',\n\t\t'uniform float distortionScale;',\n\t\t'uniform sampler2D normalSampler;',\n\t\t'uniform vec3 sunColor;',\n\t\t'uniform vec3 sunDirection;',\n\t\t'uniform vec3 eye;',\n\t\t'uniform vec3 waterColor;',\n\n\t\t'varying vec4 mirrorCoord;',\n\t\t'varying vec3 worldPosition;',\n\t\t\n\t\t'vec4 getNoise( vec2 uv )',\n\t\t'{',\n\t\t'\tvec2 uv0 = ( uv / 103.0 ) + vec2(time / 17.0, time / 29.0);',\n\t\t'\tvec2 uv1 = uv / 107.0-vec2( time / -19.0, time / 31.0 );',\n\t\t'\tvec2 uv2 = uv / vec2( 8907.0, 9803.0 ) + vec2( time / 101.0, time / 97.0 );',\n\t\t'\tvec2 uv3 = uv / vec2( 1091.0, 1027.0 ) - vec2( time / 109.0, time / -113.0 );',\n\t\t'\tvec4 noise = ( texture2D( normalSampler, uv0 ) ) +',\n        '\t\t( texture2D( normalSampler, uv1 ) ) +',\n        '\t\t( texture2D( normalSampler, uv2 ) ) +',\n\t\t'\t\t( texture2D( normalSampler, uv3 ) );',\n\t\t'\treturn noise * 0.5 - 1.0;',\n\t\t'}',\n\t\t\n\t\t'void sunLight( const vec3 surfaceNormal, const vec3 eyeDirection, float shiny, float spec, float diffuse, inout vec3 diffuseColor, inout vec3 specularColor )',\n\t\t'{',\n\t\t'\tvec3 reflection = normalize( reflect( -sunDirection, surfaceNormal ) );',\n\t\t'\tfloat direction = max( 0.0, dot( eyeDirection, reflection ) );',\n\t\t'\tspecularColor += pow( direction, shiny ) * sunColor * spec;',\n\t\t'\tdiffuseColor += max( dot( sunDirection, surfaceNormal ), 0.0 ) * sunColor * diffuse;',\n\t\t'}',\n\t\t\n\t\t'void main()',\n\t\t'{',\n\t\t'\tvec4 noise = getNoise( worldPosition.xz );',\n\t\t'\tvec3 surfaceNormal = normalize( noise.xzy * vec3( 1.5, 1.0, 1.5 ) );',\n\n\t\t'\tvec3 diffuseLight = vec3(0.0);',\n\t\t'\tvec3 specularLight = vec3(0.0);',\n\n\t\t'\tvec3 worldToEye = eye-worldPosition;',\n\t\t'\tvec3 eyeDirection = normalize( worldToEye );',\n\t\t'\tsunLight( surfaceNormal, eyeDirection, 100.0, 2.0, 0.5, diffuseLight, specularLight );',\n\t\t\n\t\t'\tfloat distance = length(worldToEye);',\n\n\t\t'\tvec2 distortion = surfaceNormal.xz * ( 0.001 + 1.0 / distance ) * distortionScale;',\n\t\t'\tvec3 reflectionSample = vec3( texture2D( mirrorSampler, mirrorCoord.xy / mirrorCoord.z + distortion ) );',\n\n\t\t'\tfloat theta = max( dot( eyeDirection, surfaceNormal ), 0.0 );',\n\t\t'\tfloat rf0 = 0.3;',\n\t\t'\tfloat reflectance = rf0 + ( 1.0 - rf0 ) * pow( ( 1.0 - theta ), 5.0 );',\n\t\t'\tvec3 scatter = max( 0.0, dot( surfaceNormal, eyeDirection ) ) * waterColor;',\n\t\t'\tvec3 albedo = mix( sunColor * diffuseLight * 0.3 + scatter, ( vec3( 0.1 ) + reflectionSample * 0.9 + reflectionSample * specularLight ), reflectance );',\n\t\t'\tgl_FragColor = vec4( albedo, alpha );',\n\t\t'}'\n\t].join('\\n')\n\n};\n\nTHREE.Water = function ( renderer, camera, scene, options ) {\n\n\tTHREE.Object3D.call( this );\n\tthis.name = 'water_' + this.id;\n\n\tfunction optionalParameter ( value, defaultValue ) {\n\t\treturn value !== undefined ? value : defaultValue;\n\t};\n\n\toptions = options || {};\n\t\n\tthis.matrixNeedsUpdate = true;\n\t\n\tvar width = optionalParameter( options.textureWidth, 512 );\n\tvar height = optionalParameter( options.textureHeight, 512 );\n\tthis.clipBias = optionalParameter( options.clipBias, 0.0 );\n\tthis.alpha = optionalParameter( options.alpha, 1.0 );\n\tthis.time = optionalParameter( options.time, 0.0 );\n\tthis.normalSampler = optionalParameter( options.waterNormals, null );\n\tthis.sunDirection = optionalParameter( options.sunDirection, new THREE.Vector3( 0.70707, 0.70707, 0.0 ) );\n\tthis.sunColor = new THREE.Color( optionalParameter( options.sunColor, 0xffffff ) );\n\tthis.waterColor = new THREE.Color( optionalParameter( options.waterColor, 0x7F7F7F ) );\n\tthis.eye = optionalParameter( options.eye, new THREE.Vector3( 0, 0, 0 ) );\n\tthis.distortionScale = optionalParameter( options.distortionScale, 20.0 );\n\t\n\tthis.renderer = renderer;\n\tthis.scene = scene;\n\tthis.mirrorPlane = new THREE.Plane();\n\tthis.normal = new THREE.Vector3( 0, 0, 1 );\n\tthis.mirrorWorldPosition = new THREE.Vector3();\n\tthis.cameraWorldPosition = new THREE.Vector3();\n\tthis.rotationMatrix = new THREE.Matrix4();\n\tthis.lookAtPosition = new THREE.Vector3( 0, 0, -1 );\n\tthis.clipPlane = new THREE.Vector4();\n\t\n\tif ( camera instanceof THREE.PerspectiveCamera )\n\t\tthis.camera = camera;\n\telse \n\t{\n\t\tthis.camera = new THREE.PerspectiveCamera();\n\t\tconsole.log(this.name + ': camera is not a Perspective Camera!')\n\t}\n\n\tthis.textureMatrix = new THREE.Matrix4();\n\n\tthis.mirrorCamera = this.camera.clone();\n\t\n\tthis.texture = new THREE.WebGLRenderTarget( width, height );\n\tthis.tempTexture = new THREE.WebGLRenderTarget( width, height );\n\t\n\tvar mirrorShader = THREE.ShaderLib[ \"water\" ];\n\tvar mirrorUniforms = THREE.UniformsUtils.clone( mirrorShader.uniforms );\n\n\tthis.material = new THREE.ShaderMaterial( { \n\t\tfragmentShader: mirrorShader.fragmentShader, \n\t\tvertexShader: mirrorShader.vertexShader, \n\t\tuniforms: mirrorUniforms,\n\t\ttransparent: true\n\t} );\n\n\tthis.material.uniforms.mirrorSampler.value = this.texture;\n\tthis.material.uniforms.textureMatrix.value = this.textureMatrix;\n\tthis.material.uniforms.alpha.value = this.alpha;\n\tthis.material.uniforms.time.value = this.time;\n\tthis.material.uniforms.normalSampler.value = this.normalSampler;\n\tthis.material.uniforms.sunColor.value = this.sunColor;\n\tthis.material.uniforms.waterColor.value = this.waterColor;\n\tthis.material.uniforms.sunDirection.value = this.sunDirection;\n\tthis.material.uniforms.distortionScale.value = this.distortionScale;\n\t\n\tthis.material.uniforms.eye.value = this.eye;\n\t\n\tif ( !THREE.Math.isPowerOfTwo(width) || !THREE.Math.isPowerOfTwo(height) )\n\t{\n\t\tthis.texture.generateMipmaps = false;\n\t\tthis.tempTexture.generateMipmaps = false;\n\t}\n\n\tthis.updateTextureMatrix();\n\tthis.render();\n};\n\nTHREE.Water.prototype = Object.create( THREE.Mirror.prototype );\n\n\nTHREE.Water.prototype.updateTextureMatrix = function () {\n\n\tfunction sign(x) { return x ? x < 0 ? -1 : 1 : 0; }\n\n\tthis.updateMatrixWorld();\n\tthis.camera.updateMatrixWorld();\n\n\tthis.mirrorWorldPosition.setFromMatrixPosition( this.matrixWorld );\n\tthis.cameraWorldPosition.setFromMatrixPosition( this.camera.matrixWorld );\n\n\tthis.rotationMatrix.extractRotation( this.matrixWorld );\n\n\tthis.normal.set( 0, 0, 1 );\n\tthis.normal.applyMatrix4( this.rotationMatrix );\n\n\tvar view = this.mirrorWorldPosition.clone().sub( this.cameraWorldPosition );\n\tview.reflect( this.normal ).negate();\n\tview.add( this.mirrorWorldPosition );\n\n\tthis.rotationMatrix.extractRotation( this.camera.matrixWorld );\n\n\tthis.lookAtPosition.set(0, 0, -1);\n\tthis.lookAtPosition.applyMatrix4( this.rotationMatrix );\n\tthis.lookAtPosition.add( this.cameraWorldPosition );\n\n\tvar target = this.mirrorWorldPosition.clone().sub( this.lookAtPosition );\n\ttarget.reflect( this.normal ).negate();\n\ttarget.add( this.mirrorWorldPosition );\n\n\tthis.up.set(0, -1, 0);\n\tthis.up.applyMatrix4( this.rotationMatrix );\n\tthis.up.reflect( this.normal ).negate();\n\n\tthis.mirrorCamera.position.copy( view );\n\tthis.mirrorCamera.up = this.up;\n\tthis.mirrorCamera.lookAt( target );\n\tthis.mirrorCamera.aspect = this.camera.aspect;\n\n\tthis.mirrorCamera.updateProjectionMatrix();\n\tthis.mirrorCamera.updateMatrixWorld();\n\tthis.mirrorCamera.matrixWorldInverse.getInverse(this.mirrorCamera.matrixWorld);\n\n\t// Update the texture matrix\n\tthis.textureMatrix.set( 0.5, 0.0, 0.0, 0.5,\n\t\t\t\t\t\t\t0.0, 0.5, 0.0, 0.5,\n\t\t\t\t\t\t\t0.0, 0.0, 0.5, 0.5,\n\t\t\t\t\t\t\t0.0, 0.0, 0.0, 1.0 );\n\tthis.textureMatrix.multiply(this.mirrorCamera.projectionMatrix);\n\tthis.textureMatrix.multiply(this.mirrorCamera.matrixWorldInverse);\n\n\t// Now update projection matrix with new clip plane, implementing code from: http://www.terathon.com/code/oblique.html\n\t// Paper explaining this technique: http://www.terathon.com/lengyel/Lengyel-Oblique.pdf\n\tthis.mirrorPlane.setFromNormalAndCoplanarPoint( this.normal, this.mirrorWorldPosition );\n\tthis.mirrorPlane.applyMatrix4(this.mirrorCamera.matrixWorldInverse);\n\n\tthis.clipPlane.set(this.mirrorPlane.normal.x, this.mirrorPlane.normal.y, this.mirrorPlane.normal.z, this.mirrorPlane.constant );\n\n\tvar q = new THREE.Vector4();\n\tvar projectionMatrix = this.mirrorCamera.projectionMatrix;\n\n\tq.x = (sign(this.clipPlane.x) + projectionMatrix.elements[8]) / projectionMatrix.elements[0];\n\tq.y = (sign(this.clipPlane.y) + projectionMatrix.elements[9]) / projectionMatrix.elements[5];\n\tq.z = -1.0;\n\tq.w = (1.0 + projectionMatrix.elements[10]) / projectionMatrix.elements[14];\n\n\t// Calculate the scaled plane vector\n\tvar c = new THREE.Vector4();\n\tc = this.clipPlane.multiplyScalar( 2.0 / this.clipPlane.dot(q) );\n\n\t// Replacing the third row of the projection matrix\n\tprojectionMatrix.elements[2] = c.x;\n\tprojectionMatrix.elements[6] = c.y;\n\tprojectionMatrix.elements[10] = c.z + 1.0 - this.clipBias;\n\tprojectionMatrix.elements[14] = c.w;\n\t\n\tvar worldCoordinates = new THREE.Vector3();\n\tworldCoordinates.setFromMatrixPosition( this.camera.matrixWorld );\n\tthis.eye = worldCoordinates;\n\tthis.material.uniforms.eye.value = this.eye;\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Octree.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Octree.js",
            "module-type": "library",
            "text": "/*!\n *\n * threeoctree.js (r60) / https://github.com/collinhover/threeoctree\n * (sparse) dynamic 3D spatial representation structure for fast searches.\n *\n * @author Collin Hover / http://collinhover.com/\n * based on Dynamic Octree by Piko3D @ http://www.piko3d.com/ and Octree by Marek Pawlowski @ pawlowski.it\n *\n */\n ( function ( THREE ) { \"use strict\";\n\t\n\t/*===================================================\n\n\tutility\n\n\t=====================================================*/\n\t\n\tfunction isNumber ( n ) {\n\t\treturn !isNaN( n ) && isFinite( n );\n\t}\n\t\n\tfunction isArray ( target ) {\n\t\treturn Object.prototype.toString.call( target ) === '[object Array]';\n\t}\n\t\n\tfunction toArray ( target ) {\n\t\treturn target ? ( isArray ( target ) !== true ? [ target ] : target ) : [];\n\t}\n\t\n\tfunction indexOfValue( array, value ) {\n\t\t\n\t\tfor ( var i = 0, il = array.length; i < il; i++ ) {\n\t\t\t\n\t\t\tif ( array[ i ] === value ) {\n\t\t\t\t\n\t\t\t\treturn i;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn -1;\n\t\t\n\t}\n\t\n\tfunction indexOfPropertyWithValue( array, property, value ) {\n\t\t\n\t\tfor ( var i = 0, il = array.length; i < il; i++ ) {\n\t\t\t\n\t\t\tif ( array[ i ][ property ] === value ) {\n\t\t\t\t\n\t\t\t\treturn i;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn -1;\n\t\t\n\t}\n\n\t/*===================================================\n\n\toctree\n\n\t=====================================================*/\n\n\tTHREE.Octree = function ( parameters ) {\n\t\t\n\t\t// handle parameters\n\t\t\n\t\tparameters = parameters || {};\n\t\t\n\t\tparameters.tree = this;\n\t\t\n\t\t// static properties ( modification is not recommended )\n\t\t\n\t\tthis.nodeCount = 0;\n\t\t\n\t\tthis.INDEX_INSIDE_CROSS = -1;\n\t\tthis.INDEX_OUTSIDE_OFFSET = 2;\n\t\t\n\t\tthis.INDEX_OUTSIDE_POS_X = isNumber( parameters.INDEX_OUTSIDE_POS_X ) ? parameters.INDEX_OUTSIDE_POS_X : 0;\n\t\tthis.INDEX_OUTSIDE_NEG_X = isNumber( parameters.INDEX_OUTSIDE_NEG_X ) ? parameters.INDEX_OUTSIDE_NEG_X : 1;\n\t\tthis.INDEX_OUTSIDE_POS_Y = isNumber( parameters.INDEX_OUTSIDE_POS_Y ) ? parameters.INDEX_OUTSIDE_POS_Y : 2;\n\t\tthis.INDEX_OUTSIDE_NEG_Y = isNumber( parameters.INDEX_OUTSIDE_NEG_Y ) ? parameters.INDEX_OUTSIDE_NEG_Y : 3;\n\t\tthis.INDEX_OUTSIDE_POS_Z = isNumber( parameters.INDEX_OUTSIDE_POS_Z ) ? parameters.INDEX_OUTSIDE_POS_Z : 4;\n\t\tthis.INDEX_OUTSIDE_NEG_Z = isNumber( parameters.INDEX_OUTSIDE_NEG_Z ) ? parameters.INDEX_OUTSIDE_NEG_Z : 5;\n\t\t\n\t\tthis.INDEX_OUTSIDE_MAP = [];\n\t\tthis.INDEX_OUTSIDE_MAP[ this.INDEX_OUTSIDE_POS_X ] = { index: this.INDEX_OUTSIDE_POS_X, count: 0, x: 1, y: 0, z: 0 };\n\t\tthis.INDEX_OUTSIDE_MAP[ this.INDEX_OUTSIDE_NEG_X ] = { index: this.INDEX_OUTSIDE_NEG_X, count: 0, x: -1, y: 0, z: 0 };\n\t\tthis.INDEX_OUTSIDE_MAP[ this.INDEX_OUTSIDE_POS_Y ] = { index: this.INDEX_OUTSIDE_POS_Y, count: 0, x: 0, y: 1, z: 0 };\n\t\tthis.INDEX_OUTSIDE_MAP[ this.INDEX_OUTSIDE_NEG_Y ] = { index: this.INDEX_OUTSIDE_NEG_Y, count: 0, x: 0, y: -1, z: 0 };\n\t\tthis.INDEX_OUTSIDE_MAP[ this.INDEX_OUTSIDE_POS_Z ] = { index: this.INDEX_OUTSIDE_POS_Z, count: 0, x: 0, y: 0, z: 1 };\n\t\tthis.INDEX_OUTSIDE_MAP[ this.INDEX_OUTSIDE_NEG_Z ] = { index: this.INDEX_OUTSIDE_NEG_Z, count: 0, x: 0, y: 0, z: -1 };\n\t\t\n\t\tthis.FLAG_POS_X = 1 << ( this.INDEX_OUTSIDE_POS_X + 1 );\n\t\tthis.FLAG_NEG_X = 1 << ( this.INDEX_OUTSIDE_NEG_X + 1 );\n\t\tthis.FLAG_POS_Y = 1 << ( this.INDEX_OUTSIDE_POS_Y + 1 );\n\t\tthis.FLAG_NEG_Y = 1 << ( this.INDEX_OUTSIDE_NEG_Y + 1 );\n\t\tthis.FLAG_POS_Z = 1 << ( this.INDEX_OUTSIDE_POS_Z + 1 );\n\t\tthis.FLAG_NEG_Z = 1 << ( this.INDEX_OUTSIDE_NEG_Z + 1 );\n\t\t\n\t\tthis.utilVec31Search = new THREE.Vector3();\n\t\tthis.utilVec32Search = new THREE.Vector3();\n\t\t\n\t\t// pass scene to see octree structure\n\t\t\n\t\tthis.scene = parameters.scene;\n\t\t\n\t\tif ( this.scene ) {\n\t\t\t\n\t\t\tthis.visualGeometry = new THREE.BoxGeometry( 1, 1, 1 );\n\t\t\tthis.visualMaterial = new THREE.MeshBasicMaterial( { color: 0xFF0066, wireframe: true, wireframeLinewidth: 1 } );\n\t\t\t\n\t\t}\n\t\t\n\t\t// properties\n\t\t\n\t\tthis.objects = [];\n\t\tthis.objectsMap = {};\n\t\tthis.objectsData = [];\n\t\tthis.objectsDeferred = [];\n\t\t\n\t\tthis.depthMax = isNumber( parameters.depthMax ) ? parameters.depthMax : Infinity;\n\t\tthis.objectsThreshold = isNumber( parameters.objectsThreshold ) ? parameters.objectsThreshold : 8;\n\t\tthis.overlapPct = isNumber( parameters.overlapPct ) ? parameters.overlapPct : 0.15;\n\t\tthis.undeferred = parameters.undeferred || false;\n\t\t\n\t\tthis.root = parameters.root instanceof THREE.OctreeNode ? parameters.root : new THREE.OctreeNode( parameters );\n\t\t\n\t};\n\n\tTHREE.Octree.prototype = {\n\t\t\n\t\tupdate: function () {\n\t\t\t\n\t\t\t// add any deferred objects that were waiting for render cycle\n\t\t\t\n\t\t\tif ( this.objectsDeferred.length > 0 ) {\n\t\t\t\t\n\t\t\t\tfor ( var i = 0, il = this.objectsDeferred.length; i < il; i++ ) {\n\t\t\t\t\t\n\t\t\t\t\tvar deferred = this.objectsDeferred[ i ];\n\t\t\t\t\t\n\t\t\t\t\tthis.addDeferred( deferred.object, deferred.options );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tthis.objectsDeferred.length = 0;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\tadd: function ( object, options ) {\n\t\t\t\n\t\t\t// add immediately\n\t\t\t\n\t\t\tif ( this.undeferred ) {\n\t\t\t\t\n\t\t\t\tthis.updateObject( object );\n\t\t\t\t\n\t\t\t\tthis.addDeferred( object, options );\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t// defer add until update called\n\t\t\t\t\n\t\t\t\tthis.objectsDeferred.push( { object: object, options: options } );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\taddDeferred: function ( object, options ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tgeometry,\n\t\t\t\tfaces,\n\t\t\t\tuseFaces,\n\t\t\t\tvertices,\n\t\t\t\tuseVertices,\n\t\t\t\tobjectData;\n\t\t\t\n\t\t\t// ensure object is not object data\n\t\t\t\n\t\t\tif ( object instanceof THREE.OctreeObjectData ) {\n\t\t\t\t\n\t\t\t\tobject = object.object;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// check uuid to avoid duplicates\n\t\t\t\n\t\t\tif ( !object.uuid ) {\n\t\t\t\t\n\t\t\t\tobject.uuid = THREE.Math.generateUUID();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif ( !this.objectsMap[ object.uuid ] ) {\n\t\t\t\t\n\t\t\t\t// store\n\t\t\t\t\n\t\t\t\tthis.objects.push( object );\n\t\t\t\tthis.objectsMap[ object.uuid ] = object;\n\t\t\t\t\n\t\t\t\t// check options\n\t\t\t\t\n\t\t\t\tif ( options ) {\n\t\t\t\t\t\n\t\t\t\t\tuseFaces = options.useFaces;\n\t\t\t\t\tuseVertices = options.useVertices;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( useVertices === true ) {\n\t\t\t\t\t\n\t\t\t\t\tgeometry = object.geometry;\n\t\t\t\t\tvertices = geometry.vertices;\n\t\t\t\t\t\n\t\t\t\t\tfor ( i = 0, l = vertices.length; i < l; i++ ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tthis.addObjectData( object, vertices[ i ] );\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else if ( useFaces === true ) {\n\t\t\t\t\t\n\t\t\t\t\tgeometry = object.geometry;\n\t\t\t\t\tfaces = geometry.faces;\n\t\t\t\t\t\n\t\t\t\t\tfor ( i = 0, l = faces.length; i < l; i++ ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tthis.addObjectData( object, faces[ i ] );\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\tthis.addObjectData( object );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\taddObjectData: function ( object, part ) {\n\t\t\t\n\t\t\tvar objectData = new THREE.OctreeObjectData( object, part );\n\t\t\t\n\t\t\t// add to tree objects data list\n\t\t\t\n\t\t\tthis.objectsData.push( objectData );\n\t\t\t\n\t\t\t// add to nodes\n\t\t\t\n\t\t\tthis.root.addObject( objectData );\n\t\t\t\n\t\t},\n\t\t\n\t\tremove: function ( object ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tobjectData = object,\n\t\t\t\tindex,\n\t\t\t\tobjectsDataRemoved;\n\t\t\t\n\t\t\t// ensure object is not object data for index search\n\t\t\t\n\t\t\tif ( object instanceof THREE.OctreeObjectData ) {\n\t\t\t\t\n\t\t\t\tobject = object.object;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// check uuid\n\t\t\t\n\t\t\tif ( this.objectsMap[ object.uuid ] ) {\n\t\t\t\t\n\t\t\t\tthis.objectsMap[ object.uuid ] = undefined;\n\t\t\t\t\n\t\t\t\t// check and remove from objects, nodes, and data lists\n\t\t\t\t\n\t\t\t\tindex = indexOfValue( this.objects, object );\n\t\t\t\t\n\t\t\t\tif ( index !== -1 ) {\n\t\t\t\t\t\n\t\t\t\t\tthis.objects.splice( index, 1 );\n\t\t\t\t\t\n\t\t\t\t\t// remove from nodes\n\t\t\t\t\t\n\t\t\t\t\tobjectsDataRemoved = this.root.removeObject( objectData );\n\t\t\t\t\t\n\t\t\t\t\t// remove from objects data list\n\t\t\t\t\t\n\t\t\t\t\tfor ( i = 0, l = objectsDataRemoved.length; i < l; i++ ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tobjectData = objectsDataRemoved[ i ];\n\t\t\t\t\t\t\n\t\t\t\t\t\tindex = indexOfValue( this.objectsData, objectData );\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( index !== -1 ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.objectsData.splice( index, 1 );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else if ( this.objectsDeferred.length > 0 ) {\n\t\t\t\t\n\t\t\t\t// check and remove from deferred\n\t\t\t\t\n\t\t\t\tindex = indexOfPropertyWithValue( this.objectsDeferred, 'object', object );\n\t\t\t\t\n\t\t\t\tif ( index !== -1 ) {\n\t\t\t\t\t\n\t\t\t\t\tthis.objectsDeferred.splice( index, 1 );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\textend: function ( octree ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tobjectsData,\n\t\t\t\tobjectData;\n\t\t\t\t\n\t\t\tif ( octree instanceof THREE.Octree ) {\n\t\t\t\t\n\t\t\t\t// for each object data\n\t\t\t\t\n\t\t\t\tobjectsData = octree.objectsData;\n\t\t\t\t\n\t\t\t\tfor ( i = 0, l = objectsData.length; i < l; i++ ) {\n\t\t\t\t\t\n\t\t\t\t\tobjectData = objectsData[ i ];\n\t\t\t\t\t\n\t\t\t\t\tthis.add( objectData, { useFaces: objectData.faces, useVertices: objectData.vertices } );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\trebuild: function () {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tnode,\n\t\t\t\tobject,\n\t\t\t\tobjectData,\n\t\t\t\tindexOctant,\n\t\t\t\tindexOctantLast,\n\t\t\t\tobjectsUpdate = [];\n\t\t\t\n\t\t\t// check all object data for changes in position\n\t\t\t// assumes all object matrices are up to date\n\t\t\t\n\t\t\tfor ( i = 0, l = this.objectsData.length; i < l; i++ ) {\n\t\t\t\t\n\t\t\t\tobjectData = this.objectsData[ i ];\n\t\t\t\t\n\t\t\t\tnode = objectData.node;\n\t\t\t\t\n\t\t\t\t// update object\n\t\t\t\t\n\t\t\t\tobjectData.update();\n\t\t\t\t\n\t\t\t\t// if position has changed since last organization of object in tree\n\t\t\t\t\n\t\t\t\tif ( node instanceof THREE.OctreeNode && !objectData.positionLast.equals( objectData.position ) ) {\n\t\t\t\t\t\n\t\t\t\t\t// get octant index of object within current node\n\t\t\t\t\t\n\t\t\t\t\tindexOctantLast = objectData.indexOctant;\n\t\t\t\t\t\n\t\t\t\t\tindexOctant = node.getOctantIndex( objectData );\n\t\t\t\t\t\n\t\t\t\t\t// if object octant index has changed\n\t\t\t\t\t\n\t\t\t\t\tif ( indexOctant !== indexOctantLast ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// add to update list\n\t\t\t\t\t\t\n\t\t\t\t\t\tobjectsUpdate.push( objectData );\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// update changed objects\n\t\t\t\n\t\t\tfor ( i = 0, l = objectsUpdate.length; i < l; i++ ) {\n\t\t\t\t\n\t\t\t\tobjectData = objectsUpdate[ i ];\n\t\t\t\t\n\t\t\t\t// remove object from current node\n\t\t\t\t\n\t\t\t\tobjectData.node.removeObject( objectData );\n\t\t\t\t\n\t\t\t\t// add object to tree root\n\t\t\t\t\n\t\t\t\tthis.root.addObject( objectData );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\tupdateObject: function ( object ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tparentCascade = [ object ],\n\t\t\t\tparent,\n\t\t\t\tparentUpdate;\n\t\t\t\n\t\t\t// search all parents between object and root for world matrix update\n\t\t\t\n\t\t\tparent = object.parent;\n\t\t\t\n\t\t\twhile( parent ) {\n\t\t\t\t\n\t\t\t\tparentCascade.push( parent );\n\t\t\t\tparent = parent.parent;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfor ( i = 0, l = parentCascade.length; i < l; i++ ) {\n\t\t\t\t\n\t\t\t\tparent = parentCascade[ i ];\n\t\t\t\t\n\t\t\t\tif ( parent.matrixWorldNeedsUpdate === true ) {\n\t\t\t\t\t\n\t\t\t\t\tparentUpdate = parent;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// update world matrix starting at uppermost parent that needs update\n\t\t\t\n\t\t\tif ( typeof parentUpdate !== 'undefined' ) {\n\t\t\t\t\n\t\t\t\tparentUpdate.updateMatrixWorld();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\tsearch: function ( position, radius, organizeByObject, direction ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tnode,\n\t\t\t\tobjects,\n\t\t\t\tobjectData,\n\t\t\t\tobject,\n\t\t\t\tresults,\n\t\t\t\tresultData,\n\t\t\t\tresultsObjectsIndices,\n\t\t\t\tresultObjectIndex,\n\t\t\t\tdirectionPct;\n\t\t\t\n\t\t\t// add root objects\n\t\t\t\n\t\t\tobjects = [].concat( this.root.objects );\n\t\t\t\n\t\t\t// ensure radius (i.e. distance of ray) is a number\n\t\t\t\n\t\t\tif ( !( radius > 0 ) ) {\n\t\t\t\t\n\t\t\t\tradius = Number.MAX_VALUE;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// if direction passed, normalize and find pct\n\t\t\t\n\t\t\tif ( direction instanceof THREE.Vector3 ) {\n\t\t\t\t\n\t\t\t\tdirection = this.utilVec31Search.copy( direction ).normalize();\n\t\t\t\tdirectionPct = this.utilVec32Search.set( 1, 1, 1 ).divide( direction );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// search each node of root\n\t\t\t\n\t\t\tfor ( i = 0, l = this.root.nodesIndices.length; i < l; i++ ) {\n\t\t\t\t\n\t\t\t\tnode = this.root.nodesByIndex[ this.root.nodesIndices[ i ] ];\n\t\t\t\t\n\t\t\t\tobjects = node.search( position, radius, objects, direction, directionPct );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// if should organize results by object\n\t\t\t\n\t\t\tif ( organizeByObject === true ) {\n\t\t\t\t\n\t\t\t\tresults = [];\n\t\t\t\tresultsObjectsIndices = [];\n\t\t\t\t\n\t\t\t\t// for each object data found\n\t\t\t\t\n\t\t\t\tfor ( i = 0, l = objects.length; i < l; i++ ) {\n\t\t\t\t\t\n\t\t\t\t\tobjectData = objects[ i ];\n\t\t\t\t\tobject = objectData.object;\n\t\t\t\t\t\n\t\t\t\t\tresultObjectIndex = indexOfValue( resultsObjectsIndices, object );\n\t\t\t\t\t\n\t\t\t\t\t// if needed, create new result data\n\t\t\t\t\t\n\t\t\t\t\tif ( resultObjectIndex === -1 ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tresultData = {\n\t\t\t\t\t\t\tobject: object,\n\t\t\t\t\t\t\tfaces: [],\n\t\t\t\t\t\t\tvertices: []\n\t\t\t\t\t\t};\n\t\t\t\t\t\t\n\t\t\t\t\t\tresults.push( resultData );\n\t\t\t\t\t\t\n\t\t\t\t\t\tresultsObjectsIndices.push( object );\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\tresultData = results[ resultObjectIndex ];\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// object data has faces or vertices, add to list\n\t\t\t\t\t\n\t\t\t\t\tif ( objectData.faces ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tresultData.faces.push( objectData.faces );\n\t\t\t\t\t\t\n\t\t\t\t\t} else if ( objectData.vertices ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tresultData.vertices.push( objectData.vertices );\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tresults = objects;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn results;\n\t\t\t\n\t\t},\n\t\t\n\t\tsetRoot: function ( root ) { \n\t\t\t\n\t\t\tif ( root instanceof THREE.OctreeNode ) {\n\t\t\t\t\n\t\t\t\t// store new root\n\t\t\t\t\n\t\t\t\tthis.root = root;\n\t\t\t\t\n\t\t\t\t// update properties\n\t\t\t\t\n\t\t\t\tthis.root.updateProperties();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\tgetDepthEnd: function () {\n\t\t\t\n\t\t\treturn this.root.getDepthEnd();\n\t\t\t\n\t\t},\n\t\t\n\t\tgetNodeCountEnd: function () {\n\t\t\t\n\t\t\treturn this.root.getNodeCountEnd();\n\t\t\t\n\t\t},\n\t\t\n\t\tgetObjectCountEnd: function () {\n\t\t\t\n\t\t\treturn this.root.getObjectCountEnd();\n\t\t\t\n\t\t},\n\t\t\n\t\ttoConsole: function () {\n\t\t\t\n\t\t\tthis.root.toConsole();\n\t\t\t\n\t\t}\n\t\t\n\t};\n\n\t/*===================================================\n\n\tobject data\n\n\t=====================================================*/\n\n\tTHREE.OctreeObjectData = function ( object, part ) {\n\t\t\n\t\t// properties\n\t\t\n\t\tthis.object = object;\n\t\t\n\t\t// handle part by type\n\t\t\n\t\tif ( part instanceof THREE.Face3 ) {\n\t\t\t\n\t\t\tthis.faces = part;\n\t\t\tthis.face3 = true;\n\t\t\tthis.utilVec31FaceBounds = new THREE.Vector3();\n\t\t\t\n\t\t} else if ( part instanceof THREE.Vector3 ) {\n\t\t\t\n\t\t\tthis.vertices = part;\n\t\t\t\n\t\t}\n\t\t\n\t\tthis.radius = 0;\n\t\tthis.position = new THREE.Vector3();\n\t\t\t\n\t\t// initial update\n\t\t\n\t\tif ( this.object instanceof THREE.Object3D ) {\n\t\t\t\n\t\t\tthis.update();\n\t\t\t\n\t\t}\n\t\t\n\t\tthis.positionLast = this.position.clone();\n\t\t\n\t};\n\n\tTHREE.OctreeObjectData.prototype = {\n\t\t\n\t\tupdate: function () {\n\t\t\t\n\t\t\tif ( this.face3 ) {\n\t\t\t\t\n\t\t\t\tthis.radius = this.getFace3BoundingRadius( this.object, this.faces );\n\t\t\t\tthis.position.copy( this.faces.centroid ).applyMatrix4( this.object.matrixWorld );\n\t\t\t\t\n\t\t\t} else if ( this.vertices ) {\n\t\t\t\t\n\t\t\t\tthis.radius = this.object.material.size || 1;\n\t\t\t\tthis.position.copy( this.vertices ).applyMatrix4( this.object.matrixWorld );\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tif ( this.object.geometry ) {\n\t\t\t\t\t\n\t\t\t\t\tif ( this.object.geometry.boundingSphere === null ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tthis.object.geometry.computeBoundingSphere();\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tthis.radius = this.object.geometry.boundingSphere.radius;\n\t\t\t\t\tthis.position.copy( this.object.geometry.boundingSphere.center ).applyMatrix4( this.object.matrixWorld );\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\tthis.radius = this.object.boundRadius;\n\t\t\t\t\tthis.position.setFromMatrixPosition( this.object.matrixWorld );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tthis.radius = this.radius * Math.max( this.object.scale.x, this.object.scale.y, this.object.scale.z );\n\t\t\t\n\t\t},\n\t\t\n\t\tgetFace3BoundingRadius: function ( object, face ) {\n\n\t\t\tif ( face.centroid === undefined ) face.centroid = new THREE.Vector3();\n\t\t\t\n\t\t\tvar geometry = object.geometry || object,\n\t\t\t\tvertices = geometry.vertices,\n\t\t\t\tcentroid = face.centroid,\n\t\t\t\tva = vertices[ face.a ], vb = vertices[ face.b ], vc = vertices[ face.c ],\n\t\t\t\tcentroidToVert = this.utilVec31FaceBounds,\n\t\t\t\tradius;\n\t\t\t\t\n\t\t\tcentroid.addVectors( va, vb ).add( vc ).divideScalar( 3 );\n\t\t\tradius = Math.max( centroidToVert.subVectors( centroid, va ).length(), centroidToVert.subVectors( centroid, vb ).length(), centroidToVert.subVectors( centroid, vc ).length() );\n\t\t\t\n\t\t\treturn radius;\n\t\t\t\n\t\t}\n\t\t\n\t};\n\n\t/*===================================================\n\n\tnode\n\n\t=====================================================*/\n\n\tTHREE.OctreeNode = function ( parameters ) {\n\t\t\n\t\t// utility\n\t\t\n\t\tthis.utilVec31Branch = new THREE.Vector3();\n\t\tthis.utilVec31Expand = new THREE.Vector3();\n\t\tthis.utilVec31Ray = new THREE.Vector3();\n\t\t\n\t\t// handle parameters\n\t\t\n\t\tparameters = parameters || {};\n\t\t\n\t\t// store or create tree\n\t\t\n\t\tif ( parameters.tree instanceof THREE.Octree ) {\n\t\t\t\n\t\t\tthis.tree = parameters.tree;\n\t\t\t\n\t\t} else if ( parameters.parent instanceof THREE.OctreeNode !== true ) {\n\t\t\t\n\t\t\tparameters.root = this;\n\t\t\t\n\t\t\tthis.tree = new THREE.Octree( parameters );\n\t\t\t\n\t\t}\n\t\t\n\t\t// basic properties\n\t\t\n\t\tthis.id = this.tree.nodeCount++;\n\t\tthis.position = parameters.position instanceof THREE.Vector3 ? parameters.position : new THREE.Vector3();\n\t\tthis.radius = parameters.radius > 0 ? parameters.radius : 1;\n\t\tthis.indexOctant = parameters.indexOctant;\n\t\tthis.depth = 0;\n\t\t\n\t\t// reset and assign parent\n\t\t\n\t\tthis.reset();\n\t\tthis.setParent( parameters.parent );\n\t\t\n\t\t// additional properties\n\t\t\n\t\tthis.overlap = this.radius * this.tree.overlapPct;\n\t\tthis.radiusOverlap = this.radius + this.overlap;\n\t\tthis.left = this.position.x - this.radiusOverlap;\n\t\tthis.right = this.position.x + this.radiusOverlap;\n\t\tthis.bottom = this.position.y - this.radiusOverlap;\n\t\tthis.top = this.position.y + this.radiusOverlap;\n\t\tthis.back = this.position.z - this.radiusOverlap;\n\t\tthis.front = this.position.z + this.radiusOverlap;\n\t\t\n\t\t// visual\n\t\t\n\t\tif ( this.tree.scene ) {\n\t\t\t\n\t\t\tthis.visual = new THREE.Mesh( this.tree.visualGeometry, this.tree.visualMaterial );\n\t\t\tthis.visual.scale.set( this.radiusOverlap * 2, this.radiusOverlap * 2, this.radiusOverlap * 2 );\n\t\t\tthis.visual.position.copy( this.position );\n\t\t\tthis.tree.scene.add( this.visual );\n\t\t\t\n\t\t}\n\t\t\n\t};\n\n\tTHREE.OctreeNode.prototype = {\n\t\t\n\t\tsetParent: function ( parent ) {\n\t\t\t\n\t\t\t// store new parent\n\t\t\t\n\t\t\tif ( parent !== this && this.parent !== parent ) {\n\t\t\t\t\n\t\t\t\tthis.parent = parent;\n\t\t\t\t\n\t\t\t\t// update properties\n\t\t\t\t\n\t\t\t\tthis.updateProperties();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\tupdateProperties: function () {\n\t\t\t\n\t\t\tvar i, l;\n\t\t\t\n\t\t\t// properties\n\t\t\t\n\t\t\tif ( this.parent instanceof THREE.OctreeNode ) {\n\t\t\t\t\n\t\t\t\tthis.tree = this.parent.tree;\n\t\t\t\tthis.depth = this.parent.depth + 1;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tthis.depth = 0;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// cascade\n\t\t\t\n\t\t\tfor ( i = 0, l = this.nodesIndices.length; i < l; i++ ) {\n\t\t\t\t\n\t\t\t\tthis.nodesByIndex[ this.nodesIndices[ i ] ].updateProperties();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\treset: function ( cascade, removeVisual ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tnode,\n\t\t\t\tnodesIndices = this.nodesIndices || [],\n\t\t\t\tnodesByIndex = this.nodesByIndex;\n\t\t\t\n\t\t\tthis.objects = [];\n\t\t\tthis.nodesIndices = [];\n\t\t\tthis.nodesByIndex = {};\n\t\t\t\n\t\t\t// unset parent in nodes\n\t\t\t\n\t\t\tfor ( i = 0, l = nodesIndices.length; i < l; i++ ) {\n\t\t\t\t\n\t\t\t\tnode = nodesByIndex[ nodesIndices[ i ] ];\n\t\t\t\t\n\t\t\t\tnode.setParent( undefined );\n\t\t\t\t\n\t\t\t\tif ( cascade === true ) {\n\t\t\t\t\t\n\t\t\t\t\tnode.reset( cascade, removeVisual );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// visual\n\t\t\t\n\t\t\tif ( removeVisual === true && this.visual && this.visual.parent ) {\n\t\t\t\t\n\t\t\t\tthis.visual.parent.remove( this.visual );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\taddNode: function ( node, indexOctant ) {\n\t\t\t\n\t\t\tnode.indexOctant = indexOctant;\n\t\t\t\n\t\t\tif ( indexOfValue( this.nodesIndices, indexOctant ) === -1 ) {\n\t\t\t\t\n\t\t\t\tthis.nodesIndices.push( indexOctant );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tthis.nodesByIndex[ indexOctant ] = node;\n\t\t\t\n\t\t\tif ( node.parent !== this ) {\n\t\t\t\t\n\t\t\t\tnode.setParent( this );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\tremoveNode: function ( indexOctant ) {\n\t\t\t\n\t\t\tvar index,\n\t\t\t\tnode;\n\t\t\t\t\n\t\t\tindex = indexOfValue( this.nodesIndices, indexOctant );\n\t\t\t\n\t\t\tthis.nodesIndices.splice( index, 1 );\n\t\t\t\n\t\t\tnode = node || this.nodesByIndex[ indexOctant ];\n\t\t\t\n\t\t\tdelete this.nodesByIndex[ indexOctant ];\n\t\t\t\n\t\t\tif ( node.parent === this ) {\n\t\t\t\t\n\t\t\t\tnode.setParent( undefined );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\taddObject: function ( object ) {\n\t\t\t\n\t\t\tvar index,\n\t\t\t\tindexOctant,\n\t\t\t\tnode;\n\t\t\t\n\t\t\t// get object octant index\n\t\t\t\n\t\t\tindexOctant = this.getOctantIndex( object );\n\t\t\t\n\t\t\t// if object fully contained by an octant, add to subtree\n\t\t\tif ( indexOctant > -1 && this.nodesIndices.length > 0 ) {\n\t\t\t\t\n\t\t\t\tnode = this.branch( indexOctant );\n\t\t\t\t\n\t\t\t\tnode.addObject( object );\n\t\t\t\t\n\t\t\t} else if ( indexOctant < -1 && this.parent instanceof THREE.OctreeNode ) {\n\t\t\t\t\n\t\t\t\t// if object lies outside bounds, add to parent node\n\t\t\t\t\n\t\t\t\tthis.parent.addObject( object );\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t// add to this objects list\n\t\t\t\t\n\t\t\t\tindex = indexOfValue( this.objects, object );\n\t\t\t\t\n\t\t\t\tif ( index === -1 ) {\n\t\t\t\t\t\n\t\t\t\t\tthis.objects.push( object );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// node reference\n\t\t\t\t\n\t\t\t\tobject.node = this;\n\t\t\t\t\n\t\t\t\t// check if need to expand, split, or both\n\t\t\t\t\n\t\t\t\tthis.checkGrow();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\taddObjectWithoutCheck: function ( objects ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tobject;\n\n\t\t\tfor ( i = 0, l = objects.length; i < l; i++ ) {\n\t\t\t\t\n\t\t\t\tobject = objects[ i ];\n\t\t\t\t\n\t\t\t\tthis.objects.push( object );\n\t\t\t\t\n\t\t\t\tobject.node = this;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\tremoveObject: function ( object ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tnodesRemovedFrom,\n\t\t\t\tremoveData;\n\t\t\t\n\t\t\t// cascade through tree to find and remove object\n\t\t\t\n\t\t\tremoveData = this.removeObjectRecursive( object, { searchComplete: false, nodesRemovedFrom: [], objectsDataRemoved: [] } );\n\t\t\t\n\t\t\t// if object removed, try to shrink the nodes it was removed from\n\t\t\t\n\t\t\tnodesRemovedFrom = removeData.nodesRemovedFrom;\n\t\t\t\n\t\t\tif ( nodesRemovedFrom.length > 0 ) {\n\t\t\t\t\n\t\t\t\tfor ( i = 0, l = nodesRemovedFrom.length; i < l; i++ ) {\n\t\t\t\t\t\n\t\t\t\t\tnodesRemovedFrom[ i ].shrink();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn removeData.objectsDataRemoved;\n\t\t\t\n\t\t},\n\t\t\n\t\tremoveObjectRecursive: function ( object, removeData ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tindex = -1,\n\t\t\t\tobjectData,\n\t\t\t\tnode,\n\t\t\t\tobjectRemoved;\n\t\t\t\n\t\t\t// find index of object in objects list\n\t\t\t\n\t\t\t// search and remove object data (fast)\n\t\t\tif ( object instanceof THREE.OctreeObjectData ) {\n\t\t\t\t\n\t\t\t\t// remove from this objects list\n\t\t\t\t\n\t\t\t\tindex = indexOfValue( this.objects, object );\n\t\t\t\t\n\t\t\t\tif ( index !== -1 ) {\n\t\t\t\t\t\n\t\t\t\t\tthis.objects.splice( index, 1 );\n\t\t\t\t\tobject.node = undefined;\n\t\t\t\t\t\n\t\t\t\t\tremoveData.objectsDataRemoved.push( object );\n\t\t\t\t\t\n\t\t\t\t\tremoveData.searchComplete = objectRemoved = true;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\n\t\t\t\t// search each object data for object and remove (slow)\n\t\t\t\t\n\t\t\t\tfor ( i = this.objects.length - 1; i >= 0; i-- ) {\n\t\t\t\t\t\n\t\t\t\t\tobjectData = this.objects[ i ];\n\t\t\t\t\t\n\t\t\t\t\tif ( objectData.object === object ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tthis.objects.splice( i, 1 );\n\t\t\t\t\t\tobjectData.node = undefined;\n\t\t\t\t\t\t\n\t\t\t\t\t\tremoveData.objectsDataRemoved.push( objectData );\n\t\t\t\t\t\t\n\t\t\t\t\t\tobjectRemoved = true;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( !objectData.faces && !objectData.vertices ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tremoveData.searchComplete = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// if object data removed and this is not on nodes removed from\n\t\t\t\n\t\t\tif ( objectRemoved === true ) {\n\t\t\t\t\n\t\t\t\tremoveData.nodesRemovedFrom.push( this );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// if search not complete, search nodes\n\t\t\t\n\t\t\tif ( removeData.searchComplete !== true ) {\n\t\t\t\t\n\t\t\t\tfor ( i = 0, l = this.nodesIndices.length; i < l; i++ ) {\n\t\t\t\t\t\n\t\t\t\t\tnode = this.nodesByIndex[ this.nodesIndices[ i ] ];\n\t\t\t\t\t\n\t\t\t\t\t// try removing object from node\n\t\t\t\t\t\n\t\t\t\t\tremoveData = node.removeObjectRecursive( object, removeData );\n\t\t\t\t\t\n\t\t\t\t\tif ( removeData.searchComplete === true ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn removeData;\n\t\t\t\n\t\t},\n\t\t\n\t\tcheckGrow: function () {\n\t\t\t\n\t\t\t// if object count above max\n\t\t\t\n\t\t\tif ( this.objects.length > this.tree.objectsThreshold && this.tree.objectsThreshold > 0 ) {\n\t\t\t\t\n\t\t\t\tthis.grow();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\tgrow: function () {\n\t\t\t\n\t\t\tvar indexOctant,\n\t\t\t\tobject,\n\t\t\t\tobjectsExpand = [],\n\t\t\t\tobjectsExpandOctants = [],\n\t\t\t\tobjectsSplit = [],\n\t\t\t\tobjectsSplitOctants = [],\n\t\t\t\tobjectsRemaining = [],\n\t\t\t\ti, l;\n\t\t\t\n\t\t\t// for each object\n\t\t\t\n\t\t\tfor ( i = 0, l = this.objects.length; i < l; i++ ) {\n\t\t\t\t\n\t\t\t\tobject = this.objects[ i ];\n\t\t\t\t\n\t\t\t\t// get object octant index\n\t\t\t\t\n\t\t\t\tindexOctant = this.getOctantIndex( object );\n\t\t\t\t\n\t\t\t\t// if lies within octant\n\t\t\t\tif ( indexOctant > -1 ) {\n\t\t\t\t\t\n\t\t\t\t\tobjectsSplit.push( object );\n\t\t\t\t\tobjectsSplitOctants.push( indexOctant );\n\t\t\t\t\n\t\t\t\t} else if ( indexOctant < -1 ) {\n\t\t\t\t\t\n\t\t\t\t\t// lies outside radius\n\t\t\t\t\t\n\t\t\t\t\tobjectsExpand.push( object );\n\t\t\t\t\tobjectsExpandOctants.push( indexOctant );\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\n\t\t\t\t\t// lies across bounds between octants\n\t\t\t\t\t\n\t\t\t\t\tobjectsRemaining.push( object );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// if has objects to split\n\t\t\t\n\t\t\tif ( objectsSplit.length > 0) {\n\t\t\t\t\n\t\t\t\tobjectsRemaining = objectsRemaining.concat( this.split( objectsSplit, objectsSplitOctants ) );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// if has objects to expand\n\t\t\t\n\t\t\tif ( objectsExpand.length > 0) {\n\t\t\t\t\n\t\t\t\tobjectsRemaining = objectsRemaining.concat( this.expand( objectsExpand, objectsExpandOctants ) );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// store remaining\n\t\t\t\n\t\t\tthis.objects = objectsRemaining;\n\t\t\t\n\t\t\t// merge check\n\t\t\t\n\t\t\tthis.checkMerge();\n\t\t\t\n\t\t},\n\t\t\n\t\tsplit: function ( objects, octants ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tindexOctant,\n\t\t\t\tobject,\n\t\t\t\tnode,\n\t\t\t\tobjectsRemaining;\n\t\t\t\n\t\t\t// if not at max depth\n\t\t\t\n\t\t\tif ( this.depth < this.tree.depthMax ) {\n\t\t\t\t\n\t\t\t\tobjects = objects || this.objects;\n\t\t\t\t\n\t\t\t\toctants = octants || [];\n\t\t\t\t\n\t\t\t\tobjectsRemaining = [];\n\t\t\t\t\n\t\t\t\t// for each object\n\t\t\t\t\n\t\t\t\tfor ( i = 0, l = objects.length; i < l; i++ ) {\n\t\t\t\t\t\n\t\t\t\t\tobject = objects[ i ];\n\t\t\t\t\t\n\t\t\t\t\t// get object octant index\n\t\t\t\t\t\n\t\t\t\t\tindexOctant = octants[ i ];\n\t\t\t\t\t\n\t\t\t\t\t// if object contained by octant, branch this tree\n\t\t\t\t\t\n\t\t\t\t\tif ( indexOctant > -1 ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tnode = this.branch( indexOctant );\n\t\t\t\t\t\t\n\t\t\t\t\t\tnode.addObject( object );\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\tobjectsRemaining.push( object );\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// if all objects, set remaining as new objects\n\t\t\t\t\n\t\t\t\tif ( objects === this.objects ) {\n\t\t\t\t\t\n\t\t\t\t\tthis.objects = objectsRemaining;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tobjectsRemaining = this.objects;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn objectsRemaining;\n\t\t\t\n\t\t},\n\t\t\n\t\tbranch: function ( indexOctant ) {\n\t\t\t\n\t\t\tvar node,\n\t\t\t\toverlap,\n\t\t\t\tradius,\n\t\t\t\tradiusOffset,\n\t\t\t\toffset,\n\t\t\t\tposition;\n\t\t\t\n\t\t\t// node exists\n\t\t\t\n\t\t\tif ( this.nodesByIndex[ indexOctant ] instanceof THREE.OctreeNode ) {\n\t\t\t\t\n\t\t\t\tnode = this.nodesByIndex[ indexOctant ];\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t// properties\n\t\t\t\t\n\t\t\t\tradius = ( this.radiusOverlap ) * 0.5;\n\t\t\t\toverlap = radius * this.tree.overlapPct;\n\t\t\t\tradiusOffset = radius - overlap;\n\t\t\t\toffset = this.utilVec31Branch.set( indexOctant & 1 ? radiusOffset : -radiusOffset, indexOctant & 2 ? radiusOffset : -radiusOffset, indexOctant & 4 ? radiusOffset : -radiusOffset );\n\t\t\t\tposition = new THREE.Vector3().addVectors( this.position, offset );\n\t\t\t\t\n\t\t\t\t// node\n\t\t\t\t\n\t\t\t\tnode = new THREE.OctreeNode( {\n\t\t\t\t\ttree: this.tree,\n\t\t\t\t\tparent: this,\n\t\t\t\t\tposition: position,\n\t\t\t\t\tradius: radius,\n\t\t\t\t\tindexOctant: indexOctant\n\t\t\t\t} );\n\t\t\t\t\n\t\t\t\t// store\n\t\t\t\t\n\t\t\t\tthis.addNode( node, indexOctant );\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn node;\n\t\t\t\n\t\t},\n\t\t\n\t\texpand: function ( objects, octants ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tobject,\n\t\t\t\tobjectsRemaining,\n\t\t\t\tobjectsExpand,\n\t\t\t\tindexOctant,\n\t\t\t\tflagsOutside,\n\t\t\t\tindexOutside,\n\t\t\t\tindexOctantInverse,\n\t\t\t\tiom = this.tree.INDEX_OUTSIDE_MAP,\n\t\t\t\tindexOutsideCounts,\n\t\t\t\tinfoIndexOutside1,\n\t\t\t\tinfoIndexOutside2,\n\t\t\t\tinfoIndexOutside3,\n\t\t\t\tindexOutsideBitwise1,\n\t\t\t\tindexOutsideBitwise2,\n\t\t\t\tinfoPotential1,\n\t\t\t\tinfoPotential2,\n\t\t\t\tinfoPotential3,\n\t\t\t\tindexPotentialBitwise1,\n\t\t\t\tindexPotentialBitwise2,\n\t\t\t\toctantX, octantY, octantZ,\n\t\t\t\toverlap,\n\t\t\t\tradius,\n\t\t\t\tradiusOffset,\n\t\t\t\tradiusParent,\n\t\t\t\toverlapParent,\n\t\t\t\toffset = this.utilVec31Expand,\n\t\t\t\tposition,\n\t\t\t\tparent;\n\t\t\t\n\t\t\t// handle max depth down tree\n\t\t\t\n\t\t\tif ( this.tree.root.getDepthEnd() < this.tree.depthMax ) {\n\t\t\t\t\n\t\t\t\tobjects = objects || this.objects;\n\t\t\t\toctants = octants || [];\n\t\t\t\t\n\t\t\t\tobjectsRemaining = [];\n\t\t\t\tobjectsExpand = [];\n\t\t\t\t\n\t\t\t\t// reset counts\n\t\t\t\t\n\t\t\t\tfor ( i = 0, l = iom.length; i < l; i++ ) {\n\t\t\t\t\t\n\t\t\t\t\tiom[ i ].count = 0;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// for all outside objects, find outside octants containing most objects\n\t\t\t\t\n\t\t\t\tfor ( i = 0, l = objects.length; i < l; i++ ) {\n\t\t\t\t\t\n\t\t\t\t\tobject = objects[ i ];\n\t\t\t\t\t\n\t\t\t\t\t// get object octant index\n\t\t\t\t\t\n\t\t\t\t\tindexOctant = octants[ i ] ;\n\t\t\t\t\t\n\t\t\t\t\t// if object outside this, include in calculations\n\t\t\t\t\t\n\t\t\t\t\tif ( indexOctant < -1 ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// convert octant index to outside flags\n\t\t\t\t\t\t\n\t\t\t\t\t\tflagsOutside = -indexOctant - this.tree.INDEX_OUTSIDE_OFFSET;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// check against bitwise flags\n\t\t\t\t\t\t\n\t\t\t\t\t\t// x\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( flagsOutside & this.tree.FLAG_POS_X ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tiom[ this.tree.INDEX_OUTSIDE_POS_X ].count++;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if ( flagsOutside & this.tree.FLAG_NEG_X ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tiom[ this.tree.INDEX_OUTSIDE_NEG_X ].count++;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// y\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( flagsOutside & this.tree.FLAG_POS_Y ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tiom[ this.tree.INDEX_OUTSIDE_POS_Y ].count++;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if ( flagsOutside & this.tree.FLAG_NEG_Y ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tiom[ this.tree.INDEX_OUTSIDE_NEG_Y ].count++;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// z\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( flagsOutside & this.tree.FLAG_POS_Z ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tiom[ this.tree.INDEX_OUTSIDE_POS_Z ].count++;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if ( flagsOutside & this.tree.FLAG_NEG_Z ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tiom[ this.tree.INDEX_OUTSIDE_NEG_Z ].count++;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// store in expand list\n\t\t\t\t\t\t\n\t\t\t\t\t\tobjectsExpand.push( object );\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\tobjectsRemaining.push( object );\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// if objects to expand\n\t\t\t\t\n\t\t\t\tif ( objectsExpand.length > 0 ) {\n\t\t\t\t\t\n\t\t\t\t\t// shallow copy index outside map\n\t\t\t\t\t\n\t\t\t\t\tindexOutsideCounts = iom.slice( 0 );\n\t\t\t\t\t\n\t\t\t\t\t// sort outside index count so highest is first\n\t\t\t\t\t\n\t\t\t\t\tindexOutsideCounts.sort( function ( a, b ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn b.count - a.count;\n\t\t\t\t\t\t\n\t\t\t\t\t} );\n\t\t\t\t\t\n\t\t\t\t\t// get highest outside indices\n\t\t\t\t\t\n\t\t\t\t\t// first is first\n\t\t\t\t\tinfoIndexOutside1 = indexOutsideCounts[ 0 ];\n\t\t\t\t\tindexOutsideBitwise1 = infoIndexOutside1.index | 1;\n\t\t\t\t\t\n\t\t\t\t\t// second is ( one of next two bitwise OR 1 ) that is not opposite of ( first bitwise OR 1 )\n\t\t\t\t\t\n\t\t\t\t\tinfoPotential1 = indexOutsideCounts[ 1 ];\n\t\t\t\t\tinfoPotential2 = indexOutsideCounts[ 2 ];\n\t\t\t\t\t\n\t\t\t\t\tinfoIndexOutside2 = ( infoPotential1.index | 1 ) !== indexOutsideBitwise1 ? infoPotential1 : infoPotential2;\n\t\t\t\t\tindexOutsideBitwise2 = infoIndexOutside2.index | 1;\n\t\t\t\t\t\n\t\t\t\t\t// third is ( one of next three bitwise OR 1 ) that is not opposite of ( first or second bitwise OR 1 )\n\t\t\t\t\t\n\t\t\t\t\tinfoPotential1 = indexOutsideCounts[ 2 ];\n\t\t\t\t\tinfoPotential2 = indexOutsideCounts[ 3 ];\n\t\t\t\t\tinfoPotential3 = indexOutsideCounts[ 4 ];\n\t\t\t\t\t\n\t\t\t\t\tindexPotentialBitwise1 = infoPotential1.index | 1;\n\t\t\t\t\tindexPotentialBitwise2 = infoPotential2.index | 1;\n\t\t\t\t\t\n\t\t\t\t\tinfoIndexOutside3 = indexPotentialBitwise1 !== indexOutsideBitwise1 && indexPotentialBitwise1 !== indexOutsideBitwise2 ? infoPotential1 : indexPotentialBitwise2 !== indexOutsideBitwise1 && indexPotentialBitwise2 !== indexOutsideBitwise2 ? infoPotential2 : infoPotential3;\n\t\t\t\t\t\n\t\t\t\t\t// get this octant normal based on outside octant indices\n\t\t\t\t\t\n\t\t\t\t\toctantX = infoIndexOutside1.x + infoIndexOutside2.x + infoIndexOutside3.x;\n\t\t\t\t\toctantY = infoIndexOutside1.y + infoIndexOutside2.y + infoIndexOutside3.y;\n\t\t\t\t\toctantZ = infoIndexOutside1.z + infoIndexOutside2.z + infoIndexOutside3.z;\n\t\t\t\t\t\n\t\t\t\t\t// get this octant indices based on octant normal\n\t\t\t\t\t\n\t\t\t\t\tindexOctant = this.getOctantIndexFromPosition( octantX, octantY, octantZ );\n\t\t\t\t\tindexOctantInverse = this.getOctantIndexFromPosition( -octantX, -octantY, -octantZ );\n\t\t\t\t\t\n\t\t\t\t\t// properties\n\t\t\t\t\t\n\t\t\t\t\toverlap = this.overlap;\n\t\t\t\t\tradius = this.radius;\n\t\t\t\t\t\n\t\t\t\t\t// radius of parent comes from reversing overlap of this, unless overlap percent is 0\n\t\t\t\t\t\n\t\t\t\t\tradiusParent = this.tree.overlapPct > 0 ? overlap / ( ( 0.5 * this.tree.overlapPct ) * ( 1 + this.tree.overlapPct ) ) : radius * 2; \n\t\t\t\t\toverlapParent = radiusParent * this.tree.overlapPct;\n\t\t\t\t\t\n\t\t\t\t\t// parent offset is difference between radius + overlap of parent and child\n\t\t\t\t\t\n\t\t\t\t\tradiusOffset = ( radiusParent + overlapParent ) - ( radius + overlap );\n\t\t\t\t\toffset.set( indexOctant & 1 ? radiusOffset : -radiusOffset, indexOctant & 2 ? radiusOffset : -radiusOffset, indexOctant & 4 ? radiusOffset : -radiusOffset );\n\t\t\t\t\tposition = new THREE.Vector3().addVectors( this.position, offset );\n\t\t\t\t\t\n\t\t\t\t\t// parent\n\t\t\t\t\t\n\t\t\t\t\tparent = new THREE.OctreeNode( {\n\t\t\t\t\t\ttree: this.tree,\n\t\t\t\t\t\tposition: position,\n\t\t\t\t\t\tradius: radiusParent\n\t\t\t\t\t} );\n\t\t\t\t\t\n\t\t\t\t\t// set self as node of parent\n\t\t\t\t\t\n\t\t\t\t\tparent.addNode( this, indexOctantInverse );\n\t\t\t\t\t\n\t\t\t\t\t// set parent as root\n\t\t\t\t\t\n\t\t\t\t\tthis.tree.setRoot( parent );\n\t\t\t\t\t\n\t\t\t\t\t// add all expand objects to parent\n\t\t\t\t\t\n\t\t\t\t\tfor ( i = 0, l = objectsExpand.length; i < l; i++ ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tthis.tree.root.addObject( objectsExpand[ i ] );\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// if all objects, set remaining as new objects\n\t\t\t\t\n\t\t\t\tif ( objects === this.objects ) {\n\t\t\t\t\t\n\t\t\t\t\tthis.objects = objectsRemaining;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tobjectsRemaining = objects;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn objectsRemaining;\n\t\t\t\n\t\t},\n\t\t\n\t\tshrink: function () {\n\t\t\t\n\t\t\t// merge check\n\t\t\t\n\t\t\tthis.checkMerge();\n\t\t\t\n\t\t\t// contract check\n\t\t\t\n\t\t\tthis.tree.root.checkContract();\n\t\t\t\n\t\t},\n\t\t\n\t\tcheckMerge: function () {\n\t\t\t\n\t\t\tvar nodeParent = this,\n\t\t\t\tnodeMerge;\n\t\t\t\n\t\t\t// traverse up tree as long as node + entire subtree's object count is under minimum\n\t\t\t\n\t\t\twhile ( nodeParent.parent instanceof THREE.OctreeNode && nodeParent.getObjectCountEnd() < this.tree.objectsThreshold ) {\n\t\t\t\t\n\t\t\t\tnodeMerge = nodeParent;\n\t\t\t\tnodeParent = nodeParent.parent;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// if parent node is not this, merge entire subtree into merge node\n\t\t\t\n\t\t\tif ( nodeParent !== this ) {\n\t\t\t\t\n\t\t\t\tnodeParent.merge( nodeMerge );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\tmerge: function ( nodes ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tj, k,\n\t\t\t\tnode;\n\t\t\t\n\t\t\t// handle nodes\n\t\t\t\n\t\t\tnodes = toArray( nodes );\n\t\t\t\n\t\t\tfor ( i = 0, l = nodes.length; i < l; i++ ) {\n\t\t\t\t\n\t\t\t\tnode = nodes[ i ];\n\t\t\t\t\n\t\t\t\t// gather node + all subtree objects\n\t\t\t\t\n\t\t\t\tthis.addObjectWithoutCheck( node.getObjectsEnd() );\n\t\t\t\t\n\t\t\t\t// reset node + entire subtree\n\t\t\t\t\n\t\t\t\tnode.reset( true, true );\n\t\t\t\t\n\t\t\t\t// remove node\n\t\t\t\t\n\t\t\t\tthis.removeNode( node.indexOctant, node );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// merge check\n\t\t\t\n\t\t\tthis.checkMerge();\n\t\t\t\n\t\t},\n\t\t\n\t\tcheckContract: function () {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tnode,\n\t\t\t\tnodeObjectsCount,\n\t\t\t\tnodeHeaviest,\n\t\t\t\tnodeHeaviestObjectsCount,\n\t\t\t\toutsideHeaviestObjectsCount;\n\t\t\t\n\t\t\t// find node with highest object count\n\t\t\t\n\t\t\tif ( this.nodesIndices.length > 0 ) {\n\t\t\t\t\n\t\t\t\tnodeHeaviestObjectsCount = 0;\n\t\t\t\toutsideHeaviestObjectsCount = this.objects.length;\n\t\t\t\t\n\t\t\t\tfor ( i = 0, l = this.nodesIndices.length; i < l; i++ ) {\n\t\t\t\t\t\n\t\t\t\t\tnode = this.nodesByIndex[ this.nodesIndices[ i ] ];\n\t\t\t\t\t\n\t\t\t\t\tnodeObjectsCount = node.getObjectCountEnd();\n\t\t\t\t\toutsideHeaviestObjectsCount += nodeObjectsCount;\n\t\t\t\t\t\n\t\t\t\t\tif ( nodeHeaviest instanceof THREE.OctreeNode === false || nodeObjectsCount > nodeHeaviestObjectsCount ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tnodeHeaviest = node;\n\t\t\t\t\t\tnodeHeaviestObjectsCount = nodeObjectsCount;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// subtract heaviest count from outside count\n\t\t\t\t\n\t\t\t\toutsideHeaviestObjectsCount -= nodeHeaviestObjectsCount;\n\t\t\t\t\n\t\t\t\t// if should contract\n\t\t\t\t\n\t\t\t\tif ( outsideHeaviestObjectsCount < this.tree.objectsThreshold && nodeHeaviest instanceof THREE.OctreeNode ) {\n\t\t\t\t\t\n\t\t\t\t\tthis.contract( nodeHeaviest );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\tcontract: function ( nodeRoot ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tnode;\n\t\t\t\n\t\t\t// handle all nodes\n\t\t\t\n\t\t\tfor ( i = 0, l = this.nodesIndices.length; i < l; i++ ) {\n\t\t\t\t\n\t\t\t\tnode = this.nodesByIndex[ this.nodesIndices[ i ] ];\n\t\t\t\t\n\t\t\t\t// if node is not new root\n\t\t\t\t\n\t\t\t\tif ( node !== nodeRoot ) {\n\t\t\t\t\t\n\t\t\t\t\t// add node + all subtree objects to root\n\t\t\t\t\t\n\t\t\t\t\tnodeRoot.addObjectWithoutCheck( node.getObjectsEnd() );\n\t\t\t\t\t\n\t\t\t\t\t// reset node + entire subtree\n\t\t\t\t\t\n\t\t\t\t\tnode.reset( true, true );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// add own objects to root\n\t\t\t\n\t\t\tnodeRoot.addObjectWithoutCheck( this.objects );\n\t\t\t\n\t\t\t// reset self\n\t\t\t\n\t\t\tthis.reset( false, true );\n\t\t\t\n\t\t\t// set new root\n\t\t\t\n\t\t\tthis.tree.setRoot( nodeRoot );\n\t\t\t\n\t\t\t// contract check on new root\n\t\t\t\n\t\t\tnodeRoot.checkContract();\n\t\t\t\n\t\t},\n\t\t\n\t\tgetOctantIndex: function ( objectData ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tpositionObj,\n\t\t\t\tradiusObj,\n\t\t\t\tposition = this.position,\n\t\t\t\tradiusOverlap = this.radiusOverlap,\n\t\t\t\toverlap = this.overlap,\n\t\t\t\tdeltaX, deltaY, deltaZ,\n\t\t\t\tdistX, distY, distZ, \n\t\t\t\tdistance,\n\t\t\t\tindexOctant = 0;\n\t\t\t\n\t\t\t// handle type\n\t\t\t\n\t\t\tif ( objectData instanceof THREE.OctreeObjectData ) {\n\t\t\t\t\n\t\t\t\tradiusObj = objectData.radius;\n\t\t\t\t\n\t\t\t\tpositionObj = objectData.position;\n\t\t\t\t\n\t\t\t\t// update object data position last\n\t\t\t\t\n\t\t\t\tobjectData.positionLast.copy( positionObj );\n\t\t\t\t\n\t\t\t} else if ( objectData instanceof THREE.OctreeNode ) {\n\t\t\t\t\n\t\t\t\tpositionObj = objectData.position;\n\t\t\t\t\n\t\t\t\tradiusObj = 0;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// find delta and distance\n\t\t\t\n\t\t\tdeltaX = positionObj.x - position.x;\n\t\t\tdeltaY = positionObj.y - position.y;\n\t\t\tdeltaZ = positionObj.z - position.z;\n\t\t\t\n\t\t\tdistX = Math.abs( deltaX );\n\t\t\tdistY = Math.abs( deltaY );\n\t\t\tdistZ = Math.abs( deltaZ );\n\t\t\tdistance = Math.max( distX, distY, distZ );\n\t\t\t\n\t\t\t// if outside, use bitwise flags to indicate on which sides object is outside of\n\t\t\t\n\t\t\tif ( distance + radiusObj > radiusOverlap ) {\n\t\t\t\t\n\t\t\t\t// x\n\t\t\t\t\n\t\t\t\tif ( distX + radiusObj > radiusOverlap ) {\n\t\t\t\t\t\n\t\t\t\t\tindexOctant = indexOctant ^ ( deltaX > 0 ? this.tree.FLAG_POS_X : this.tree.FLAG_NEG_X );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// y\n\t\t\t\t\n\t\t\t\tif ( distY + radiusObj > radiusOverlap ) {\n\t\t\t\t\t\n\t\t\t\t\tindexOctant = indexOctant ^ ( deltaY > 0 ? this.tree.FLAG_POS_Y : this.tree.FLAG_NEG_Y );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// z\n\t\t\t\t\n\t\t\t\tif ( distZ + radiusObj > radiusOverlap ) {\n\t\t\t\t\t\n\t\t\t\t\tindexOctant = indexOctant ^ ( deltaZ > 0 ? this.tree.FLAG_POS_Z : this.tree.FLAG_NEG_Z );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tobjectData.indexOctant = -indexOctant - this.tree.INDEX_OUTSIDE_OFFSET;\n\t\t\t\t\n\t\t\t\treturn objectData.indexOctant;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// return octant index from delta xyz\n\t\t\t\n\t\t\tif ( deltaX - radiusObj > -overlap ) {\n\t\t\t\t\n\t\t\t\t// x right\n\t\t\t\t\n\t\t\t\tindexOctant = indexOctant | 1;\n\t\t\t\t\n\t\t\t} else if ( !( deltaX + radiusObj < overlap ) ) {\n\t\t\t\t\n\t\t\t\t// x left\n\t\t\t\t\n\t\t\t\tobjectData.indexOctant = this.tree.INDEX_INSIDE_CROSS;\n\t\t\t\treturn objectData.indexOctant;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif ( deltaY - radiusObj > -overlap ) {\n\t\t\t\t\n\t\t\t\t// y right\n\t\t\t\t\n\t\t\t\tindexOctant = indexOctant | 2;\n\t\t\t\t\n\t\t\t} else if ( !( deltaY + radiusObj < overlap ) ) {\n\t\t\t\t\n\t\t\t\t// y left\n\t\t\t\t\n\t\t\t\tobjectData.indexOctant = this.tree.INDEX_INSIDE_CROSS;\n\t\t\t\treturn objectData.indexOctant;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif ( deltaZ - radiusObj > -overlap ) {\n\t\t\t\t\n\t\t\t\t// z right\n\t\t\t\t\n\t\t\t\tindexOctant = indexOctant | 4;\n\t\t\t\t\n\t\t\t} else if ( !( deltaZ + radiusObj < overlap ) ) {\n\t\t\t\t\n\t\t\t\t// z left\n\t\t\t\t\n\t\t\t\tobjectData.indexOctant = this.tree.INDEX_INSIDE_CROSS;\n\t\t\t\treturn objectData.indexOctant;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tobjectData.indexOctant = indexOctant;\n\t\t\treturn objectData.indexOctant;\n\t\t\t\n\t\t},\n\t\t\n\t\tgetOctantIndexFromPosition: function ( x, y, z ) {\n\t\t\t\n\t\t\tvar indexOctant = 0;\n\t\t\t\n\t\t\tif ( x > 0 ) {\n\t\t\t\t\n\t\t\t\tindexOctant = indexOctant | 1;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif ( y > 0 ) {\n\t\t\t\t\n\t\t\t\tindexOctant = indexOctant | 2;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif ( z > 0 ) {\n\t\t\t\t\n\t\t\t\tindexOctant = indexOctant | 4;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn indexOctant;\n\t\t\t\n\t\t},\n\t\t\n\t\tsearch: function ( position, radius, objects, direction, directionPct ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tnode,\n\t\t\t\tintersects;\n\t\t\t\n\t\t\t// test intersects by parameters\n\t\t\t\n\t\t\tif ( direction ) {\n\t\t\t\t\n\t\t\t\tintersects = this.intersectRay( position, direction, radius, directionPct );\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tintersects = this.intersectSphere( position, radius );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// if intersects\n\t\t\t\n\t\t\tif ( intersects === true ) {\n\t\t\t\t\n\t\t\t\t// gather objects\n\t\t\t\t\n\t\t\t\tobjects = objects.concat( this.objects );\n\t\t\t\t\n\t\t\t\t// search subtree\n\t\t\t\t\n\t\t\t\tfor ( i = 0, l = this.nodesIndices.length; i < l; i++ ) {\n\t\t\t\t\t\n\t\t\t\t\tnode = this.nodesByIndex[ this.nodesIndices[ i ] ];\n\t\t\t\t\t\n\t\t\t\t\tobjects = node.search( position, radius, objects, direction );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn objects;\n\t\t\t\n\t\t},\n\t\t\n\t\tintersectSphere: function ( position, radius ) {\n\t\t\t\n\t\t\tvar\tdistance = radius * radius,\n\t\t\t\tpx = position.x,\n\t\t\t\tpy = position.y,\n\t\t\t\tpz = position.z;\n\t\t\t\n\t\t\tif ( px < this.left ) {\n\t\t\t\tdistance -= Math.pow( px - this.left, 2 );\n\t\t\t} else if ( px > this.right ) {\n\t\t\t\tdistance -= Math.pow( px - this.right, 2 );\n\t\t\t}\n\t\t\t\n\t\t\tif ( py < this.bottom ) {\n\t\t\t\tdistance -= Math.pow( py - this.bottom, 2 );\n\t\t\t} else if ( py > this.top ) {\n\t\t\t\tdistance -= Math.pow( py - this.top, 2 );\n\t\t\t}\n\t\t\t\n\t\t\tif ( pz < this.back ) {\n\t\t\t\tdistance -= Math.pow( pz - this.back, 2 );\n\t\t\t} else if ( pz > this.front ) {\n\t\t\t\tdistance -= Math.pow( pz - this.front, 2 );\n\t\t\t}\n\t\t\t\n\t\t\treturn distance >= 0;\n\t\t\t\n\t\t},\n\t\t\n\t\tintersectRay: function ( origin, direction, distance, directionPct ) {\n\t\t\t\n\t\t\tif ( typeof directionPct === 'undefined' ) {\n\t\t\t\t\n\t\t\t\tdirectionPct = this.utilVec31Ray.set( 1, 1, 1 ).divide( direction );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tvar t1 = ( this.left - origin.x ) * directionPct.x,\n\t\t\t\tt2 = ( this.right - origin.x ) * directionPct.x,\n\t\t\t\tt3 = ( this.bottom - origin.y ) * directionPct.y,\n\t\t\t\tt4 = ( this.top - origin.y ) * directionPct.y,\n\t\t\t\tt5 = ( this.back - origin.z ) * directionPct.z,\n\t\t\t\tt6 = ( this.front - origin.z ) * directionPct.z,\n\t\t\t\ttmax = Math.min( Math.min( Math.max( t1, t2), Math.max( t3, t4) ), Math.max( t5, t6) ),\n\t\t\t\ttmin;\n\n\t\t\t// ray would intersect in reverse direction, i.e. this is behind ray\n\t\t\tif (tmax < 0)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\ttmin = Math.max( Math.max( Math.min( t1, t2), Math.min( t3, t4)), Math.min( t5, t6));\n\t\t\t\n\t\t\t// if tmin > tmax or tmin > ray distance, ray doesn't intersect AABB\n\t\t\tif( tmin > tmax || tmin > distance ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t\t\n\t\t},\n\t\t\n\t\tgetDepthEnd: function ( depth ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tnode;\n\n\t\t\tif ( this.nodesIndices.length > 0 ) {\n\t\t\t\t\n\t\t\t\tfor ( i = 0, l = this.nodesIndices.length; i < l; i++ ) {\n\n\t\t\t\t\tnode = this.nodesByIndex[ this.nodesIndices[ i ] ];\n\n\t\t\t\t\tdepth = node.getDepthEnd( depth );\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\n\t\t\t\tdepth = !depth || this.depth > depth ? this.depth : depth;\n\n\t\t\t}\n\n\t\t\treturn depth;\n\t\t\t\n\t\t},\n\t\t\n\t\tgetNodeCountEnd: function () {\n\t\t\t\n\t\t\treturn this.tree.root.getNodeCountRecursive() + 1;\n\t\t\t\n\t\t},\n\t\t\n\t\tgetNodeCountRecursive: function () {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tcount = this.nodesIndices.length;\n\t\t\t\n\t\t\tfor ( i = 0, l = this.nodesIndices.length; i < l; i++ ) {\n\t\t\t\t\n\t\t\t\tcount += this.nodesByIndex[ this.nodesIndices[ i ] ].getNodeCountRecursive();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn count;\n\t\t\t\n\t\t},\n\t\t\n\t\tgetObjectsEnd: function ( objects ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tnode;\n\t\t\t\n\t\t\tobjects = ( objects || [] ).concat( this.objects );\n\t\t\t\n\t\t\tfor ( i = 0, l = this.nodesIndices.length; i < l; i++ ) {\n\t\t\t\t\n\t\t\t\tnode = this.nodesByIndex[ this.nodesIndices[ i ] ];\n\t\t\t\t\n\t\t\t\tobjects = node.getObjectsEnd( objects );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn objects;\n\t\t\t\n\t\t},\n\t\t\n\t\tgetObjectCountEnd: function () {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tcount = this.objects.length;\n\t\t\t\n\t\t\tfor ( i = 0, l = this.nodesIndices.length; i < l; i++ ) {\n\t\t\t\t\n\t\t\t\tcount += this.nodesByIndex[ this.nodesIndices[ i ] ].getObjectCountEnd();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn count;\n\t\t\t\n\t\t},\n\t\t\n\t\tgetObjectCountStart: function () {\n\t\t\t\n\t\t\tvar count = this.objects.length,\n\t\t\t\tparent = this.parent;\n\t\t\t\n\t\t\twhile( parent instanceof THREE.OctreeNode ) {\n\t\t\t\t\n\t\t\t\tcount += parent.objects.length;\n\t\t\t\tparent = parent.parent;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn count;\n\t\t\t\n\t\t},\n\t\t\n\t\ttoConsole: function ( space ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tnode,\n\t\t\t\tspaceAddition = '   ';\n\t\t\t\n\t\t\tspace = typeof space === 'string' ? space : spaceAddition;\n\t\t\t\n\t\t\tconsole.log( ( this.parent ? space + ' octree NODE > ' : ' octree ROOT > ' ), this, ' // id: ', this.id, ' // indexOctant: ', this.indexOctant, ' // position: ', this.position.x, this.position.y, this.position.z, ' // radius: ', this.radius, ' // depth: ', this.depth );\n\t\t\tconsole.log( ( this.parent ? space + ' ' : ' ' ), '+ objects ( ', this.objects.length, ' ) ', this.objects );\n\t\t\tconsole.log( ( this.parent ? space + ' ' : ' ' ), '+ children ( ', this.nodesIndices.length, ' )', this.nodesIndices, this.nodesByIndex );\n\t\t\t\n\t\t\tfor ( i = 0, l = this.nodesIndices.length; i < l; i++ ) {\n\t\t\t\t\n\t\t\t\tnode = this.nodesByIndex[ this.nodesIndices[ i ] ];\n\t\t\t\t\n\t\t\t\tnode.toConsole( space + spaceAddition );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t};\n\n\t/*===================================================\n\n\traycaster additional functionality\n\n\t=====================================================*/\n\t\n\tTHREE.Raycaster.prototype.intersectOctreeObject = function ( object, recursive ) {\n\t\t\n\t\tvar intersects,\n\t\t\toctreeObject,\n\t\t\tfacesAll,\n\t\t\tfacesSearch;\n\t\t\n\t\tif ( object.object instanceof THREE.Object3D ) {\n\t\t\t\n\t\t\toctreeObject = object;\n\t\t\tobject = octreeObject.object;\n\t\t\t\n\t\t\t// temporarily replace object geometry's faces with octree object faces\n\t\t\t\n\t\t\tfacesSearch = octreeObject.faces;\n\t\t\tfacesAll = object.geometry.faces;\n\t\t\t\n\t\t\tif ( facesSearch.length > 0 ) {\n\t\t\t\t\n\t\t\t\tobject.geometry.faces = facesSearch;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// intersect\n\t\t\t\n\t\t\tintersects = this.intersectObject( object, recursive );\n\t\t\t\n\t\t\t// revert object geometry's faces\n\t\t\t\n\t\t\tif ( facesSearch.length > 0 ) {\n\t\t\t\t\n\t\t\t\tobject.geometry.faces = facesAll;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tintersects = this.intersectObject( object, recursive );\n\t\t\t\n\t\t}\n\t\t\n\t\treturn intersects;\n\t\t\n\t};\n\t\n\tTHREE.Raycaster.prototype.intersectOctreeObjects = function ( objects, recursive ) {\n\t\t\n\t\tvar i, il,\n\t\t\tintersects = [];\n\t\t\n\t\tfor ( i = 0, il = objects.length; i < il; i++ ) {\n\t\t\t\n\t\t\tintersects = intersects.concat( this.intersectOctreeObject( objects[ i ], recursive ) );\n\t\t\n\t\t}\n\t\t\n\t\treturn intersects;\n\t\t\n\t};\n\n}( THREE ) );"
        },
        "$:/plugins/rboue/Three.js/Lib/TypedArrayUtils.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/TypedArrayUtils.js",
            "module-type": "library",
            "text": "\nTHREE.TypedArrayUtils = {};\n\n/**\n * In-place quicksort for typed arrays (e.g. for Float32Array)\n * provides fast sorting\n * useful e.g. for a custom shader and/or BufferGeometry\n *\n * @author Roman Bolzern <roman.bolzern@fhnw.ch>, 2013\n * @author I4DS http://www.fhnw.ch/i4ds, 2013\n * @license MIT License <http://www.opensource.org/licenses/mit-license.php>\n *\n * Complexity: http://bigocheatsheet.com/ see Quicksort\n *\n * Example: \n * points: [x, y, z, x, y, z, x, y, z, ...]\n * eleSize: 3 //because of (x, y, z)\n * orderElement: 0 //order according to x\n */\n\nTHREE.TypedArrayUtils.quicksortIP = function ( arr, eleSize, orderElement ) {\n\n\tvar stack = [];\n\tvar sp = -1;\n\tvar left = 0;\n\tvar right = arr.length / eleSize - 1;\n\tvar tmp = 0.0, x = 0, y = 0;\n\n\tvar swapF = function ( a, b ) {\n\n\t\ta *= eleSize; b *= eleSize;\n\n\t\tfor ( y = 0; y < eleSize; y ++ ) {\n\n\t\t\ttmp = arr[ a + y ];\n\t\t\tarr[ a + y ]=arr[ b + y ];\n\t\t\tarr[ b + y ]=tmp;\n\n\t\t}\n\n\t};\n\t\n\tvar i, j, swap = new Float32Array( eleSize ), temp = new Float32Array( eleSize );\n\n\twhile ( true ) {\n\n\t\tif ( right - left <= 25 ) {\n\n\t\t\tfor ( j= left + 1; j <= right; j ++ ) {\n\n\t\t\t\tfor ( x = 0; x < eleSize; x ++ ) {\n\t\t\t\n\t\t\t\t\tswap[ x ] = arr[ j * eleSize + x ];\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ti = j - 1;\n\t\t\t\t\n\t\t\t\twhile ( i >= left && arr[ i * eleSize + orderElement ] > swap[orderElement ] ) {\n\n\t\t\t\t\tfor ( x = 0; x < eleSize; x ++ ) {\n\n\t\t\t\t\t\tarr[ ( i + 1 ) * eleSize + x ] = arr[ i * eleSize + x ];\n\n\t\t\t\t\t}\n\n\t\t\t\t\ti --;\n\n\t\t\t\t}\n\n\t\t\t\tfor ( x = 0; x < eleSize; x ++ ) {\n\n\t\t\t\t\tarr[ ( i + 1 ) * eleSize + x ] = swap[ x ];\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t\tif ( sp == -1 ) break;\n\n\t\t\tright = stack[ sp -- ]; //?\n\t\t\tleft = stack[ sp -- ];\n\n\t\t} else {\n\n\t\t\tvar median = ( left + right ) >> 1;\n\n\t\t\ti = left + 1;\n\t\t\tj = right;\n\t\n\t\t\tswapF( median, i );\n\n\t\t\tif ( arr[ left * eleSize + orderElement ] > arr[ right * eleSize + orderElement ] ) {\n\t\t\n\t\t\t\tswapF( left, right );\n\t\t\t\t\n\t\t\t}\n\n\t\t\tif ( arr[ i * eleSize + orderElement ] > arr[ right * eleSize + orderElement ] ) {\n\t\t\n\t\t\t\tswapF( i, right );\n\t\t\n\t\t\t}\n\n\t\t\tif ( arr[ left * eleSize + orderElement ] > arr[ i * eleSize + orderElement ] ) {\n\t\t\n\t\t\t\tswapF( left, i );\n\t\t\t\n\t\t\t}\n\n\t\t\tfor ( x = 0; x < eleSize; x ++ ) {\n\n\t\t\t\ttemp[ x ] = arr[ i * eleSize + x ];\n\n\t\t\t}\n\t\t\t\n\t\t\twhile ( true ) {\n\t\t\t\t\n\t\t\t\tdo i ++; while ( arr[ i * eleSize + orderElement ] < temp[ orderElement ] );\n\t\t\t\tdo j --; while ( arr[ j * eleSize + orderElement ] > temp[ orderElement ] );\n\t\t\t\t\n\t\t\t\tif ( j < i ) break;\n\t\t\n\t\t\t\tswapF( i, j );\n\t\t\t\n\t\t\t}\n\n\t\t\tfor ( x = 0; x < eleSize; x ++ ) {\n\n\t\t\t\tarr[ ( left + 1 ) * eleSize + x ] = arr[ j * eleSize + x ];\n\t\t\t\tarr[ j * eleSize + x ] = temp[ x ];\n\n\t\t\t}\n\n\t\t\tif ( right - i + 1 >= j - left ) {\n\n\t\t\t\tstack[ ++ sp ] = i;\n\t\t\t\tstack[ ++ sp ] = right;\n\t\t\t\tright = j - 1;\n\n\t\t\t} else {\n\n\t\t\t\tstack[ ++ sp ] = left;\n\t\t\t\tstack[ ++ sp ] = j - 1;\n\t\t\t\tleft = i;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn arr;\n\n};\n\n\n\n/**\n * k-d Tree for typed arrays (e.g. for Float32Array), in-place\n * provides fast nearest neighbour search\n * useful e.g. for a custom shader and/or BufferGeometry, saves tons of memory\n * has no insert and remove, only buildup and neares neighbour search\n *\n * Based on https://github.com/ubilabs/kd-tree-javascript by Ubilabs\n *\n * @author Roman Bolzern <roman.bolzern@fhnw.ch>, 2013\n * @author I4DS http://www.fhnw.ch/i4ds, 2013\n * @license MIT License <http://www.opensource.org/licenses/mit-license.php>\n *\n * Requires typed array quicksort\n *\n * Example: \n * points: [x, y, z, x, y, z, x, y, z, ...]\n * metric: function(a, b){\treturn Math.pow(a[0] - b[0], 2) +  Math.pow(a[1] - b[1], 2) +  Math.pow(a[2] - b[2], 2); }  //Manhatten distance\n * eleSize: 3 //because of (x, y, z)\n *\n * Further information (including mathematical properties)\n * http://en.wikipedia.org/wiki/Binary_tree\n * http://en.wikipedia.org/wiki/K-d_tree\n *\n * If you want to further minimize memory usage, remove Node.depth and replace in search algorithm with a traversal to root node (see comments at THREE.TypedArrayUtils.Kdtree.prototype.Node)\n */\n\n THREE.TypedArrayUtils.Kdtree = function ( points, metric, eleSize ) {\n\n\tvar self = this;\n\t\n\tvar maxDepth = 0;\n\t\n\tvar getPointSet = function ( points, pos ) {\n\n\t\treturn points.subarray( pos * eleSize, pos * eleSize + eleSize );\n\n\t};\n\t\t\n\tfunction buildTree( points, depth, parent, pos ) {\n\n\t\tvar dim = depth % eleSize,\n\t\t\tmedian,\n\t\t\tnode,\n\t\t\tplength = points.length / eleSize;\n\n\t\tif ( depth > maxDepth ) maxDepth = depth;\n\t\t\n\t\tif ( plength === 0 ) return null;\n\t\tif ( plength === 1 ) {\n\n\t\t\treturn new self.Node( getPointSet( points, 0 ), depth, parent, pos );\n\n\t\t}\n\n\t\tTHREE.TypedArrayUtils.quicksortIP( points, eleSize, dim );\n\t\t\n\t\tmedian = Math.floor( plength / 2 );\n\t\t\n\t\tnode = new self.Node( getPointSet( points, median ) , depth, parent, median + pos );\n\t\tnode.left = buildTree( points.subarray( 0, median * eleSize), depth + 1, node, pos );\n\t\tnode.right = buildTree( points.subarray( ( median + 1 ) * eleSize, points.length ), depth + 1, node, pos + median + 1 );\n\n\t\treturn node;\n\t\n\t}\n\n\tthis.root = buildTree( points, 0, null, 0 );\n\t\t\n\tthis.getMaxDepth = function () { return maxDepth; };\n\t\n\tthis.nearest = function ( point, maxNodes , maxDistance ) {\n\t\n\t\t /* point: array of size eleSize \n\t\t\tmaxNodes: max amount of nodes to return \n\t\t\tmaxDistance: maximum distance to point result nodes should have\n\t\t\tcondition (not implemented): function to test node before it's added to the result list, e.g. test for view frustum\n\t\t*/\n\n\t\tvar i,\n\t\t\tresult,\n\t\t\tbestNodes;\n\n\t\tbestNodes = new THREE.TypedArrayUtils.Kdtree.BinaryHeap(\n\n\t\t\tfunction ( e ) { return -e[ 1 ]; }\n\n\t\t);\n\n\t\tfunction nearestSearch( node ) {\n\n\t\t\tvar bestChild,\n\t\t\t\tdimension = node.depth % eleSize,\n\t\t\t\townDistance = metric(point, node.obj),\n\t\t\t\tlinearDistance = 0,\n\t\t\t\totherChild,\n\t\t\t\ti,\n\t\t\t\tlinearPoint = [];\n\n\t\t\tfunction saveNode( node, distance ) {\n\n\t\t\t\tbestNodes.push( [ node, distance ] );\n\n\t\t\t\tif ( bestNodes.size() > maxNodes ) {\n\n\t\t\t\t\tbestNodes.pop();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tfor ( i = 0; i < eleSize; i += 1 ) {\n\n\t\t\t\tif ( i === node.depth % eleSize ) {\n\n\t\t\t\t\tlinearPoint[ i ] = point[ i ];\n\n\t\t\t\t} else {\n\n\t\t\t\t\tlinearPoint[ i ] = node.obj[ i ];\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tlinearDistance = metric( linearPoint, node.obj );\n\n\t\t\t// if it's a leaf\n\n\t\t\tif ( node.right === null && node.left === null ) {\n\n\t\t\t\tif ( bestNodes.size() < maxNodes || ownDistance < bestNodes.peek()[ 1 ] ) {\n\n\t\t\t\t\tsaveNode( node, ownDistance );\n\n\t\t\t\t}\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tif ( node.right === null ) {\n\n\t\t\t\tbestChild = node.left;\n\n\t\t\t} else if ( node.left === null ) {\n\n\t\t\t\tbestChild = node.right;\n\n\t\t\t} else {\n\n\t\t\t\tif ( point[ dimension ] < node.obj[ dimension ] ) {\n\n\t\t\t\t\tbestChild = node.left;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tbestChild = node.right;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// recursive search\n\n\t\t\tnearestSearch( bestChild );\n\n\t\t\tif ( bestNodes.size() < maxNodes || ownDistance < bestNodes.peek()[ 1 ] ) {\n\n\t\t\t\tsaveNode( node, ownDistance );\n\n\t\t\t}\n\n\t\t\t// if there's still room or the current distance is nearer than the best distance\n\n\t\t\tif ( bestNodes.size() < maxNodes || Math.abs(linearDistance) < bestNodes.peek()[ 1 ] ) {\n\n\t\t\t\tif ( bestChild === node.left ) {\n\n\t\t\t\t\totherChild = node.right;\n\n\t\t\t\t} else {\n\n\t\t\t\t\totherChild = node.left;\n\n\t\t\t\t}\n\n\t\t\t\tif ( otherChild !== null ) {\n\n\t\t\t\t\tnearestSearch( otherChild );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( maxDistance ) {\n\n\t\t\tfor ( i = 0; i < maxNodes; i += 1 ) {\n\n\t\t\t\tbestNodes.push( [ null, maxDistance ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\tnearestSearch( self.root );\n\n\t\tresult = [];\n\n\t\tfor ( i = 0; i < maxNodes; i += 1 ) {\n\n\t\t\tif ( bestNodes.content[ i ][ 0 ] ) {\n\n\t\t\t\tresult.push( [ bestNodes.content[ i ][ 0 ], bestNodes.content[ i ][ 1 ] ] );\n\n\t\t\t}\n\n\t\t}\n\t\t\n\t\treturn result;\n\t\n\t};\n\t\n};\n\n/**\n * If you need to free up additional memory and agree with an additional O( log n ) traversal time you can get rid of \"depth\" and \"pos\" in Node:\n * Depth can be easily done by adding 1 for every parent (care: root node has depth 0, not 1)\n * Pos is a bit tricky: Assuming the tree is balanced (which is the case when after we built it up), perform the following steps:\n *   By traversing to the root store the path e.g. in a bit pattern (01001011, 0 is left, 1 is right)\n *   From buildTree we know that \"median = Math.floor( plength / 2 );\", therefore for each bit...\n *     0: amountOfNodesRelevantForUs = Math.floor( (pamountOfNodesRelevantForUs - 1) / 2 );\n *     1: amountOfNodesRelevantForUs = Math.ceil( (pamountOfNodesRelevantForUs - 1) / 2 );\n *        pos += Math.floor( (pamountOfNodesRelevantForUs - 1) / 2 );\n *     when recursion done, we still need to add all left children of target node:\n *        pos += Math.floor( (pamountOfNodesRelevantForUs - 1) / 2 );\n *        and I think you need to +1 for the current position, not sure.. depends, try it out ^^\n *\n * I experienced that for 200'000 nodes you can get rid of 4 MB memory each, leading to 8 MB memory saved.\n */\nTHREE.TypedArrayUtils.Kdtree.prototype.Node = function ( obj, depth, parent, pos ) {\n\n\tthis.obj = obj;\n\tthis.left = null;\n\tthis.right = null;\n\tthis.parent = parent;\n\tthis.depth = depth;\n\tthis.pos = pos;\n\n}; \n\n/**\n * Binary heap implementation\n * @author http://eloquentjavascript.net/appendix2.htm\n */\n\nTHREE.TypedArrayUtils.Kdtree.BinaryHeap = function ( scoreFunction ) {\n\n\tthis.content = [];\n\tthis.scoreFunction = scoreFunction;\n\n};\n\nTHREE.TypedArrayUtils.Kdtree.BinaryHeap.prototype = {\n\n\tpush: function ( element ) {\n\n\t\t// Add the new element to the end of the array.\n\t\tthis.content.push( element );\n\n\t\t// Allow it to bubble up.\n\t\tthis.bubbleUp( this.content.length - 1 );\n\n\t},\n\n\tpop: function () {\n\n\t\t// Store the first element so we can return it later.\n\t\tvar result = this.content[ 0 ];\n\n\t\t// Get the element at the end of the array.\n\t\tvar end = this.content.pop();\n\n\t\t// If there are any elements left, put the end element at the\n\t\t// start, and let it sink down.\n\t\tif ( this.content.length > 0 ) {\n\n\t\t\tthis.content[ 0 ] = end;\n\t\t\tthis.sinkDown( 0 );\n\n\t\t}\n\n\t\treturn result;\n\n\t},\n\n\tpeek: function () {\n\n\t\treturn this.content[ 0 ];\n\n\t},\n\n\tremove: function ( node ) {\n\n\t\tvar len = this.content.length;\n\n\t\t// To remove a value, we must search through the array to find it.\n\t\tfor ( var i = 0; i < len; i ++ ) {\n\n\t\t\tif ( this.content[ i ] == node ) {\n\n\t\t\t\t// When it is found, the process seen in 'pop' is repeated\n\t\t\t\t// to fill up the hole.\n\t\t\t\tvar end = this.content.pop();\n\n\t\t\t\tif ( i != len - 1 ) {\n\n\t\t\t\t\tthis.content[ i ] = end;\n\n\t\t\t\t\tif ( this.scoreFunction( end ) < this.scoreFunction( node ) ) {\n\n\t\t\t\t\t\tthis.bubbleUp( i );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tthis.sinkDown( i );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t}\n\n\t\tthrow new Error( \"Node not found.\" );\n\n\t},\n\n\tsize: function () {\n\n\t\treturn this.content.length;\n\n\t},\n\n\tbubbleUp: function ( n ) {\n\n\t\t// Fetch the element that has to be moved.\n\t\tvar element = this.content[ n ];\n\n\t\t// When at 0, an element can not go up any further.\n\t\twhile ( n > 0 ) {\n\n\t\t\t// Compute the parent element's index, and fetch it.\n\t\t\tvar parentN = Math.floor( ( n + 1 ) / 2 ) - 1,\n\t\t\t\tparent = this.content[ parentN ];\n\n\t\t\t// Swap the elements if the parent is greater.\n\t\t\tif ( this.scoreFunction( element ) < this.scoreFunction( parent ) ) {\n\n\t\t\t\tthis.content[ parentN ] = element;\n\t\t\t\tthis.content[ n ] = parent;\n\n\t\t\t\t// Update 'n' to continue at the new position.\n\t\t\t\tn = parentN;\n\n\t\t\t} else {\n\n\t\t\t\t// Found a parent that is less, no need to move it further.\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t},\n\n\tsinkDown: function ( n ) {\n\n\t\t// Look up the target element and its score.\n\t\tvar length = this.content.length,\n\t\t\telement = this.content[ n ],\n\t\t\telemScore = this.scoreFunction( element );\n\n\t\twhile ( true ) {\n\n\t\t\t// Compute the indices of the child elements.\n\t\t\tvar child2N = ( n + 1 ) * 2, child1N = child2N - 1;\n\n\t\t\t// This is used to store the new position of the element, if any.\n\t\t\tvar swap = null;\n\n\t\t\t// If the first child exists (is inside the array)...\n\t\t\tif ( child1N < length ) {\n\n\t\t\t\t// Look it up and compute its score.\n\t\t\t\tvar child1 = this.content[ child1N ],\n\t\t\t\t\tchild1Score = this.scoreFunction( child1 );\n\n\t\t\t\t// If the score is less than our element's, we need to swap.\n\t\t\t\tif ( child1Score < elemScore ) swap = child1N;\n\n\t\t\t}\n\n\t\t\t// Do the same checks for the other child.\n\t\t\tif ( child2N < length ) {\n\n\t\t\t\tvar child2 = this.content[ child2N ],\n\t\t\t\t\tchild2Score = this.scoreFunction( child2 );\n\n\t\t\t\tif ( child2Score < ( swap === null ? elemScore : child1Score ) ) swap = child2N;\n\n\t\t\t}\n\n\t\t\t// If the element needs to be moved, swap it, and continue.\n\t\t\tif ( swap !== null ) {\n\n\t\t\t\tthis.content[ n ] = this.content[ swap ];\n\t\t\t\tthis.content[ swap ] = element;\n\t\t\t\tn = swap;\n\n\t\t\t} else {\n\n\t\t\t\t// Otherwise, we are done.\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n};"
        },
        "$:/plugins/rboue/Three.js/Lib/Mirror.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Mirror.js",
            "module-type": "library",
            "text": "/**\r\n * @author Slayvin / http://slayvin.net\r\n */\r\n\r\nTHREE.ShaderLib['mirror'] = {\r\n\r\n\tuniforms: { \"mirrorColor\": { type: \"c\", value: new THREE.Color(0x7F7F7F) },\r\n\t\t\t\t\"mirrorSampler\": { type: \"t\", value: null },\r\n\t\t\t\t\"textureMatrix\" : { type: \"m4\", value: new THREE.Matrix4() }\r\n\t},\r\n\r\n\tvertexShader: [\r\n\r\n\t\t\"uniform mat4 textureMatrix;\",\r\n\r\n\t\t\"varying vec4 mirrorCoord;\",\r\n\r\n\t\t\"void main() {\",\r\n\r\n\t\t\t\"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\",\r\n\t\t\t\"vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\",\r\n\t\t\t\"mirrorCoord = textureMatrix * worldPosition;\",\r\n\r\n\t\t\t\"gl_Position = projectionMatrix * mvPosition;\",\r\n\r\n\t\t\"}\"\r\n\r\n\t].join(\"\\n\"),\r\n\r\n\tfragmentShader: [\r\n\r\n\t\t\"uniform vec3 mirrorColor;\",\r\n\t\t\"uniform sampler2D mirrorSampler;\",\r\n\r\n\t\t\"varying vec4 mirrorCoord;\",\r\n\r\n\t\t\"float blendOverlay(float base, float blend) {\",\r\n\t\t\t\"return( base < 0.5 ? ( 2.0 * base * blend ) : (1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );\",\r\n\t\t\"}\",\r\n\t\t\r\n\t\t\"void main() {\",\r\n\r\n\t\t\t\"vec4 color = texture2DProj(mirrorSampler, mirrorCoord);\",\r\n\t\t\t\"color = vec4(blendOverlay(mirrorColor.r, color.r), blendOverlay(mirrorColor.g, color.g), blendOverlay(mirrorColor.b, color.b), 1.0);\",\r\n\r\n\t\t\t\"gl_FragColor = color;\",\r\n\r\n\t\t\"}\"\r\n\r\n\t].join(\"\\n\")\r\n\r\n};\r\n\r\nTHREE.Mirror = function ( renderer, camera, options ) {\r\n\r\n\tTHREE.Object3D.call( this );\r\n\r\n\tthis.name = 'mirror_' + this.id;\r\n\r\n\toptions = options || {};\r\n\r\n\tthis.matrixNeedsUpdate = true;\r\n\r\n\tvar width = options.textureWidth !== undefined ? options.textureWidth : 512;\r\n\tvar height = options.textureHeight !== undefined ? options.textureHeight : 512;\r\n\r\n\tthis.clipBias = options.clipBias !== undefined ? options.clipBias : 0.0;\r\n\r\n\tvar mirrorColor = options.color !== undefined ? new THREE.Color(options.color) : new THREE.Color(0x7F7F7F);\r\n\r\n\tthis.renderer = renderer;\r\n\tthis.mirrorPlane = new THREE.Plane();\r\n\tthis.normal = new THREE.Vector3( 0, 0, 1 );\r\n\tthis.mirrorWorldPosition = new THREE.Vector3();\r\n\tthis.cameraWorldPosition = new THREE.Vector3();\r\n\tthis.rotationMatrix = new THREE.Matrix4();\r\n\tthis.lookAtPosition = new THREE.Vector3(0, 0, -1);\r\n\tthis.clipPlane = new THREE.Vector4();\r\n\t\r\n\t// For debug only, show the normal and plane of the mirror\r\n\tvar debugMode = options.debugMode !== undefined ? options.debugMode : false;\r\n\r\n\tif ( debugMode ) {\r\n\r\n\t\tvar arrow = new THREE.ArrowHelper(new THREE.Vector3( 0, 0, 1 ), new THREE.Vector3( 0, 0, 0 ), 10, 0xffff80 );\r\n\t\tvar planeGeometry = new THREE.Geometry();\r\n\t\tplaneGeometry.vertices.push( new THREE.Vector3( -10, -10, 0 ) );\r\n\t\tplaneGeometry.vertices.push( new THREE.Vector3( 10, -10, 0 ) );\r\n\t\tplaneGeometry.vertices.push( new THREE.Vector3( 10, 10, 0 ) );\r\n\t\tplaneGeometry.vertices.push( new THREE.Vector3( -10, 10, 0 ) );\r\n\t\tplaneGeometry.vertices.push( planeGeometry.vertices[0] );\r\n\t\tvar plane = new THREE.Line( planeGeometry, new THREE.LineBasicMaterial( { color: 0xffff80 } ) );\r\n\r\n\t\tthis.add(arrow);\r\n\t\tthis.add(plane);\r\n\r\n\t}\r\n\r\n\tif ( camera instanceof THREE.PerspectiveCamera ) {\r\n\r\n\t\tthis.camera = camera;\r\n\r\n\t} else {\r\n\r\n\t\tthis.camera = new THREE.PerspectiveCamera();\r\n\t\tconsole.log( this.name + ': camera is not a Perspective Camera!' );\r\n\r\n\t}\r\n\r\n\tthis.textureMatrix = new THREE.Matrix4();\r\n\r\n\tthis.mirrorCamera = this.camera.clone();\r\n\r\n\tthis.texture = new THREE.WebGLRenderTarget( width, height );\r\n\tthis.tempTexture = new THREE.WebGLRenderTarget( width, height );\r\n\r\n\tvar mirrorShader = THREE.ShaderLib[ \"mirror\" ];\r\n\tvar mirrorUniforms = THREE.UniformsUtils.clone( mirrorShader.uniforms );\r\n\r\n\tthis.material = new THREE.ShaderMaterial( {\r\n\r\n\t\tfragmentShader: mirrorShader.fragmentShader,\r\n\t\tvertexShader: mirrorShader.vertexShader,\r\n\t\tuniforms: mirrorUniforms\r\n\r\n\t} );\r\n\r\n\tthis.material.uniforms.mirrorSampler.value = this.texture;\r\n\tthis.material.uniforms.mirrorColor.value = mirrorColor;\r\n\tthis.material.uniforms.textureMatrix.value = this.textureMatrix;\r\n\r\n\tif ( !THREE.Math.isPowerOfTwo(width) || !THREE.Math.isPowerOfTwo( height ) ) {\r\n\r\n\t\tthis.texture.generateMipmaps = false;\r\n\t\tthis.tempTexture.generateMipmaps = false;\r\n\r\n\t}\r\n\r\n\tthis.updateTextureMatrix();\r\n\tthis.render();\r\n\r\n};\r\n\r\nTHREE.Mirror.prototype = Object.create( THREE.Object3D.prototype );\r\n\r\nTHREE.Mirror.prototype.renderWithMirror = function ( otherMirror ) {\r\n\r\n\t// update the mirror matrix to mirror the current view\r\n\tthis.updateTextureMatrix();\r\n\tthis.matrixNeedsUpdate = false;\r\n\r\n\t// set the camera of the other mirror so the mirrored view is the reference view\r\n\tvar tempCamera = otherMirror.camera;\r\n\totherMirror.camera = this.mirrorCamera;\r\n\r\n\t// render the other mirror in temp texture\r\n\totherMirror.renderTemp();\r\n\totherMirror.material.uniforms.mirrorSampler.value = otherMirror.tempTexture;\r\n\r\n\t// render the current mirror\r\n\tthis.render();\r\n\tthis.matrixNeedsUpdate = true;\r\n\r\n\t// restore material and camera of other mirror\r\n\totherMirror.material.uniforms.mirrorSampler.value = otherMirror.texture;\r\n\totherMirror.camera = tempCamera;\r\n\r\n\t// restore texture matrix of other mirror\r\n\totherMirror.updateTextureMatrix();\r\n};\r\n\r\nTHREE.Mirror.prototype.updateTextureMatrix = function () {\r\n\r\n\tvar sign = THREE.Math.sign;\r\n\r\n\tthis.updateMatrixWorld();\r\n\tthis.camera.updateMatrixWorld();\r\n\r\n\tthis.mirrorWorldPosition.setFromMatrixPosition( this.matrixWorld );\r\n\tthis.cameraWorldPosition.setFromMatrixPosition( this.camera.matrixWorld );\r\n\r\n\tthis.rotationMatrix.extractRotation( this.matrixWorld );\r\n\r\n\tthis.normal.set( 0, 0, 1 );\r\n\tthis.normal.applyMatrix4( this.rotationMatrix );\r\n\r\n\tvar view = this.mirrorWorldPosition.clone().sub( this.cameraWorldPosition );\r\n\tview.reflect( this.normal ).negate();\r\n\tview.add( this.mirrorWorldPosition );\r\n\r\n\tthis.rotationMatrix.extractRotation( this.camera.matrixWorld );\r\n\r\n\tthis.lookAtPosition.set(0, 0, -1);\r\n\tthis.lookAtPosition.applyMatrix4( this.rotationMatrix );\r\n\tthis.lookAtPosition.add( this.cameraWorldPosition );\r\n\r\n\tvar target = this.mirrorWorldPosition.clone().sub( this.lookAtPosition );\r\n\ttarget.reflect( this.normal ).negate();\r\n\ttarget.add( this.mirrorWorldPosition );\r\n\r\n\tthis.up.set( 0, -1, 0 );\r\n\tthis.up.applyMatrix4( this.rotationMatrix );\r\n\tthis.up.reflect( this.normal ).negate();\r\n\r\n\tthis.mirrorCamera.position.copy( view );\r\n\tthis.mirrorCamera.up = this.up;\r\n\tthis.mirrorCamera.lookAt( target );\r\n\r\n\tthis.mirrorCamera.updateProjectionMatrix();\r\n\tthis.mirrorCamera.updateMatrixWorld();\r\n\tthis.mirrorCamera.matrixWorldInverse.getInverse( this.mirrorCamera.matrixWorld );\r\n\r\n\t// Update the texture matrix\r\n\tthis.textureMatrix.set( 0.5, 0.0, 0.0, 0.5,\r\n\t\t\t\t\t\t\t0.0, 0.5, 0.0, 0.5,\r\n\t\t\t\t\t\t\t0.0, 0.0, 0.5, 0.5,\r\n\t\t\t\t\t\t\t0.0, 0.0, 0.0, 1.0 );\r\n\tthis.textureMatrix.multiply( this.mirrorCamera.projectionMatrix );\r\n\tthis.textureMatrix.multiply( this.mirrorCamera.matrixWorldInverse );\r\n\r\n\t// Now update projection matrix with new clip plane, implementing code from: http://www.terathon.com/code/oblique.html\r\n\t// Paper explaining this technique: http://www.terathon.com/lengyel/Lengyel-Oblique.pdf\r\n\tthis.mirrorPlane.setFromNormalAndCoplanarPoint( this.normal, this.mirrorWorldPosition );\r\n\tthis.mirrorPlane.applyMatrix4( this.mirrorCamera.matrixWorldInverse );\r\n\r\n\tthis.clipPlane.set( this.mirrorPlane.normal.x, this.mirrorPlane.normal.y, this.mirrorPlane.normal.z, this.mirrorPlane.constant );\r\n\r\n\tvar q = new THREE.Vector4();\r\n\tvar projectionMatrix = this.mirrorCamera.projectionMatrix;\r\n\r\n\tq.x = ( sign(this.clipPlane.x) + projectionMatrix.elements[8] ) / projectionMatrix.elements[0];\r\n\tq.y = ( sign(this.clipPlane.y) + projectionMatrix.elements[9] ) / projectionMatrix.elements[5];\r\n\tq.z = - 1.0;\r\n\tq.w = ( 1.0 + projectionMatrix.elements[10] ) / projectionMatrix.elements[14];\r\n\r\n\t// Calculate the scaled plane vector\r\n\tvar c = new THREE.Vector4();\r\n\tc = this.clipPlane.multiplyScalar( 2.0 / this.clipPlane.dot(q) );\r\n\r\n\t// Replacing the third row of the projection matrix\r\n\tprojectionMatrix.elements[2] = c.x;\r\n\tprojectionMatrix.elements[6] = c.y;\r\n\tprojectionMatrix.elements[10] = c.z + 1.0 - this.clipBias;\r\n\tprojectionMatrix.elements[14] = c.w;\r\n\r\n};\r\n\r\nTHREE.Mirror.prototype.render = function () {\r\n\r\n\tif ( this.matrixNeedsUpdate ) this.updateTextureMatrix();\r\n\r\n\tthis.matrixNeedsUpdate = true;\r\n\r\n\t// Render the mirrored view of the current scene into the target texture\r\n\tvar scene = this;\r\n\r\n\twhile ( scene.parent !== undefined ) {\r\n\r\n\t\tscene = scene.parent;\r\n\r\n\t}\r\n\r\n\tif ( scene !== undefined && scene instanceof THREE.Scene) {\r\n\r\n\t\tthis.renderer.render( scene, this.mirrorCamera, this.texture, true );\r\n\r\n\t}\r\n\r\n};\r\n\r\nTHREE.Mirror.prototype.renderTemp = function () {\r\n\r\n\tif ( this.matrixNeedsUpdate ) this.updateTextureMatrix();\r\n\r\n\tthis.matrixNeedsUpdate = true;\r\n\r\n\t// Render the mirrored view of the current scene into the target texture\r\n\tvar scene = this;\r\n\r\n\twhile ( scene.parent !== undefined ) {\r\n\r\n\t\tscene = scene.parent;\r\n\r\n\t}\r\n\r\n\tif ( scene !== undefined && scene instanceof THREE.Scene) {\r\n\r\n\t\tthis.renderer.render( scene, this.mirrorCamera, this.tempTexture, true );\r\n\r\n\t}\r\n\r\n};\r\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Sparks.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Sparks.js",
            "module-type": "library",
            "text": "/*\n * @author zz85 (http://github.com/zz85 http://www.lab4games.net/zz85/blog)\n *\n * a simple to use javascript 3d particles system inspired by FliNT and Stardust\n * created with TWEEN.js and THREE.js\n *\n * for feature requests or bugs, please visit https://github.com/zz85/sparks.js\n *\n * licensed under the MIT license\n */\n\nvar SPARKS = {};\n\n/********************************\n* Emitter Class\n*\n*   Creates and Manages Particles\n*********************************/\n\nSPARKS.Emitter = function (counter) {\n\n    this._counter = counter ? counter : new SPARKS.SteadyCounter(10); // provides number of particles to produce\n\n    this._particles = [];\n\n\n    this._initializers = []; // use for creation of particles\n    this._actions = [];     // uses action to update particles\n    this._activities = [];  //  not supported yet\n\n    this._handlers = [];\n\n    this.callbacks = {};\n};\n\n\nSPARKS.Emitter.prototype = {\n\n\t_TIMESTEP: 15,\n\t_timer: null,\n\t_lastTime: null,\n\t_timerStep: 10,\n\t_velocityVerlet: true,\n\n\t// run its built in timer / stepping\n\tstart: function() {\n\t\tthis._lastTime = Date.now();\n\t\tthis._timer = setTimeout(this.step, this._timerStep, this);\n\t\tthis._isRunning = true;\n\t},\n\n\tstop: function() {\n\t\tthis._isRunning = false;\n\t\tclearTimeout(this._timer);\n\t},\n\n\tisRunning: function() {\n\t\treturn this._isRunning & true;\n\t},\n\n\t// Step gets called upon by the engine\n\t// but attempts to call update() on a regular basics\n\t// This method is also described in http://gameclosure.com/2011/04/11/deterministic-delta-tee-in-js-games/\n\tstep: function(emitter) {\n\n\t\tvar time = Date.now();\n\t\tvar elapsed = time - emitter._lastTime;\n\n\t\tif (!this._velocityVerlet) {\n\t\t\t// if elapsed is way higher than time step, (usually after switching tabs, or excution cached in ff)\n\t\t\t// we will drop cycles. perhaps set to a limit of 10 or something?\n\t\t\tvar maxBlock = emitter._TIMESTEP * 20;\n\n\t\t\tif (elapsed >= maxBlock) {\n\t\t\t\t//console.log('warning: sparks.js is fast fowarding engine, skipping steps', elapsed / emitter._TIMESTEP);\n\t\t\t\t//emitter.update( (elapsed - maxBlock) / 1000);\n\t\t\t\telapsed = maxBlock;\n\t\t\t}\n\n\t\t\twhile(elapsed >= emitter._TIMESTEP) {\n\t\t\t\temitter.update(emitter._TIMESTEP / 1000);\n\t\t\t\telapsed -= emitter._TIMESTEP;\n\t\t\t}\n\t\t\temitter._lastTime = time - elapsed;\n\n\t\t} else {\n\t\t\temitter.update(elapsed/1000);\n\t\t\temitter._lastTime = time;\n\t\t}\n\n\n\n\t\tif (emitter._isRunning)\n\t\tsetTimeout(emitter.step, emitter._timerStep, emitter);\n\n\t},\n\n\n\t// Update particle engine in seconds, not milliseconds\n    update: function(time) {\n\n\t\tvar i, j;\n        var len = this._counter.updateEmitter( this, time );\n\n        // Create particles\n        for( i = 0; i < len; i++ ) {\n            this.createParticle();\n        }\n\n        // Update activities\n        len = this._activities.length;\n        for ( i = 0; i < len; i++ )\n        {\n            this._activities[i].update( this, time );\n        }\n\n\n        len = this._actions.length;\n\n\t\tvar particle;\n\t\tvar action;\n        var len2 = this._particles.length;\n\n        for( j = 0; j < len; j++ )\n        {\n            action = this._actions[j];\n            for ( i = 0; i < len2; ++i )\n            {\n                particle = this._particles[i];\n                action.update( this, particle, time );\n            }\n        }\n\n\n        // remove dead particles\n        for ( i = len2; i--; )\n        {\n            particle = this._particles[i];\n            if ( particle.isDead )\n            {\n                //particle =\n\t\t\t\tthis._particles.splice( i, 1 );\n                this.dispatchEvent(\"dead\", particle);\n\t\t\t\tSPARKS.VectorPool.release(particle.position); //\n\t\t\t\tSPARKS.VectorPool.release(particle.velocity);\n\n            } else {\n                this.dispatchEvent(\"updated\", particle);\n            }\n        }\n\n\t\tthis.dispatchEvent(\"loopUpdated\");\n\n    },\n\n    createParticle: function() {\n        var particle = new SPARKS.Particle();\n        // In future, use a Particle Factory\n        var len = this._initializers.length, i;\n\n        for ( i = 0; i < len; i++ ) {\n            this._initializers[i].initialize( this, particle );\n        }\n\n        this._particles.push( particle );\n\n        this.dispatchEvent(\"created\", particle); // ParticleCreated\n\n        return particle;\n    },\n\n    addInitializer: function (initializer) {\n        this._initializers.push(initializer);\n    },\n\n    addAction: function (action) {\n        this._actions.push(action);\n    },\n\n    removeInitializer: function (initializer) {\n\t\tvar index = this._initializers.indexOf(initializer);\n\t\tif (index > -1) {\n\t\t\tthis._initializers.splice( index, 1 );\n\t\t}\n    },\n\n    removeAction: function (action) {\n\t\tvar index = this._actions.indexOf(action);\n\t\tif (index > -1) {\n\t\t\tthis._actions.splice( index, 1 );\n\t\t}\n\t\t//console.log('removeAction', index, this._actions);\n    },\n\n    addCallback: function(name, callback) {\n        this.callbacks[name] = callback;\n    },\n\n    dispatchEvent: function(name, args) {\n        var callback = this.callbacks[name];\n        if (callback) {\n            callback(args);\n        }\n\n    }\n\n\n};\n\n\n/*\n * Constant Names for\n * Events called by emitter.dispatchEvent()\n *\n */\nSPARKS.EVENT_PARTICLE_CREATED = \"created\"\nSPARKS.EVENT_PARTICLE_UPDATED = \"updated\"\nSPARKS.EVENT_PARTICLE_DEAD = \"dead\";\nSPARKS.EVENT_LOOP_UPDATED = \"loopUpdated\";\n\n\n\n/*\n * Steady Counter attempts to produces a particle rate steadily\n *\n */\n\n// Number of particles per seconds\nSPARKS.SteadyCounter = function(rate) {\n    this.rate = rate;\n\n\t// we use a shortfall counter to make up for slow emitters\n\tthis.leftover = 0;\n\n};\n\nSPARKS.SteadyCounter.prototype.updateEmitter = function(emitter, time) {\n\n\tvar targetRelease = time * this.rate + this.leftover;\n\tvar actualRelease = Math.floor(targetRelease);\n\n\tthis.leftover = targetRelease - actualRelease;\n\n\treturn actualRelease;\n};\n\n\n/*\n * Shot Counter produces specified particles\n * on a single impluse or burst\n */\n\nSPARKS.ShotCounter = function(particles) {\n\tthis.particles = particles;\n\tthis.used = false;\n};\n\nSPARKS.ShotCounter.prototype.updateEmitter = function(emitter, time) {\n\n\tif (this.used) {\n\t\treturn 0;\n\t} else {\n\t\tthis.used = true;\n\t}\n\n\treturn this.particles;\n};\n\n\n/********************************\n* Particle Class\n*\n*   Represents a single particle\n*********************************/\nSPARKS.Particle = function() {\n\n    /**\n     * The lifetime of the particle, in seconds.\n     */\n    this.lifetime = 0;\n\n    /**\n     * The age of the particle, in seconds.\n     */\n    this.age = 0;\n\n    /**\n     * The energy of the particle.\n     */\n    this.energy = 1;\n\n    /**\n     * Whether the particle is dead and should be removed from the stage.\n     */\n    this.isDead = false;\n\n    this.target = null; // tag\n\n    /**\n     * For 3D\n     */\n\n     this.position = SPARKS.VectorPool.get().set(0,0,0); //new THREE.Vector3( 0, 0, 0 );\n     this.velocity = SPARKS.VectorPool.get().set(0,0,0); //new THREE.Vector3( 0, 0, 0 );\n\tthis._oldvelocity = SPARKS.VectorPool.get().set(0,0,0);\n     // rotation vec3\n     // angVelocity vec3\n     // faceAxis vec3\n\n};\n\n\n/********************************\n* Action Classes\n*\n*   An abstract class which have\n*   update function\n*********************************/\nSPARKS.Action = function() {\n    this._priority = 0;\n};\n\n\nSPARKS.Age = function(easing) {\n    this._easing = (easing == null) ? TWEEN.Easing.Linear.None : easing;\n};\n\nSPARKS.Age.prototype.update = function (emitter, particle, time) {\n    particle.age += time;\n    if( particle.age >= particle.lifetime )\n    {\n        particle.energy = 0;\n        particle.isDead = true;\n    }\n    else\n    {\n        var t = this._easing(particle.age / particle.lifetime);\n        particle.energy = -1 * t + 1;\n    }\n};\n\n/*\n// Mark particle as dead when particle's < 0\n\nSPARKS.Death = function(easing) {\n    this._easing = (easing == null) ? TWEEN.Linear.None : easing;\n};\n\nSPARKS.Death.prototype.update = function (emitter, particle, time) {\n    if (particle.life <= 0) {\n        particle.isDead = true;\n    }\n};\n*/\n\n\nSPARKS.Move = function() {\n\n};\n\nSPARKS.Move.prototype.update = function(emitter, particle, time) {\n    // attempt verlet velocity updating.\n    var p = particle.position;\n\tvar v = particle.velocity;\n    var old = particle._oldvelocity;\n\n\tif (this._velocityVerlet) {\n\t\tp.x += (v.x + old.x) * 0.5 * time;\n\t\tp.y += (v.y + old.y) * 0.5 * time;\n\t\tp.z += (v.z + old.z) * 0.5 * time;\n\t} else {\n\t\tp.x += v.x * time;\n\t\tp.y += v.y * time;\n\t\tp.z += v.z * time;\n\t}\n\n    //  OldVel = Vel;\n    // Vel = Vel + Accel * dt;\n    // Pos = Pos + (vel + Vel + Accel * dt) * 0.5 * dt;\n\n\n\n};\n\n/* Marks particles found in specified zone dead */\nSPARKS.DeathZone = function(zone) {\n    this.zone = zone;\n};\n\nSPARKS.DeathZone.prototype.update = function(emitter, particle, time) {\n\n    if (this.zone.contains(particle.position)) {\n\t\tparticle.isDead = true;\n\t}\n\n};\n\n/*\n * SPARKS.ActionZone applies an action when particle is found in zone\n */\nSPARKS.ActionZone = function(action, zone) {\n\tthis.action = action;\n    this.zone = zone;\n};\n\nSPARKS.ActionZone.prototype.update = function(emitter, particle, time) {\n\n    if (this.zone.contains(particle.position)) {\n\t\tthis.action.update( emitter, particle, time );\n\t}\n\n};\n\n/*\n * Accelerate action affects velocity in specified 3d direction\n */\nSPARKS.Accelerate = function(x,y,z) {\n\n\tif (x instanceof THREE.Vector3) {\n\t\tthis.acceleration = x;\n\t\treturn;\n\t}\n\n    this.acceleration = new THREE.Vector3(x,y,z);\n\n};\n\nSPARKS.Accelerate.prototype.update = function(emitter, particle, time) {\n    var acc = this.acceleration;\n\n    var v = particle.velocity;\n\n\tparticle._oldvelocity.set(v.x, v.y, v.z);\n\n    v.x += acc.x * time;\n    v.y += acc.y * time;\n    v.z += acc.z * time;\n\n};\n\n/*\n * Accelerate Factor accelerate based on a factor of particle's velocity.\n */\nSPARKS.AccelerateFactor = function(factor) {\n    this.factor = factor;\n};\n\nSPARKS.AccelerateFactor.prototype.update = function(emitter, particle, time) {\n    var factor = this.factor;\n\n    var v = particle.velocity;\n\tvar len = v.length();\n\tvar adjFactor;\n    if (len>0) {\n\n\t\tadjFactor = factor * time / len;\n\t\tadjFactor += 1;\n\n\t\tv.multiplyScalar(adjFactor);\n\t\t// v.x *= adjFactor;\n\t\t// \t    v.y *= adjFactor;\n\t\t// \t    v.z *= adjFactor;\n\t}\n\n};\n\n/*\nAccelerateNormal\n * AccelerateVelocity affects velocity based on its velocity direction\n */\nSPARKS.AccelerateVelocity = function(factor) {\n\n\tthis.factor = factor;\n\n};\n\nSPARKS.AccelerateVelocity.prototype.update = function(emitter, particle, time) {\n    var factor = this.factor;\n\n    var v = particle.velocity;\n\n\n    v.z += - v.x * factor;\n    v.y += v.z * factor;\n    v.x +=  v.y * factor;\n\n};\n\n\n/* Set the max ammount of x,y,z drift movements in a second */\nSPARKS.RandomDrift = function(x,y,z) {\n\tif (x instanceof THREE.Vector3) {\n\t\tthis.drift = x;\n\t\treturn;\n\t}\n\n    this.drift = new THREE.Vector3(x,y,z);\n}\n\n\nSPARKS.RandomDrift.prototype.update = function(emitter, particle, time) {\n    var drift = this.drift;\n\n    var v = particle.velocity;\n\n    v.x += ( Math.random() - 0.5 ) * drift.x * time;\n    v.y += ( Math.random() - 0.5 ) * drift.y * time;\n    v.z += ( Math.random() - 0.5 ) * drift.z * time;\n\n};\n\n/********************************\n* Zone Classes\n*\n*   An abstract classes which have\n*   getLocation() function\n*********************************/\nSPARKS.Zone = function() {\n};\n\n// TODO, contains() for Zone\n\nSPARKS.PointZone = function(pos) {\n    this.pos = pos;\n};\n\nSPARKS.PointZone.prototype.getLocation = function() {\n    return this.pos;\n};\n\nSPARKS.PointZone = function(pos) {\n    this.pos = pos;\n};\n\nSPARKS.PointZone.prototype.getLocation = function() {\n    return this.pos;\n};\n\nSPARKS.LineZone = function(start, end) {\n    this.start = start;\n\tthis.end = end;\n\tthis._length = end.clone().sub( start );\n};\n\nSPARKS.LineZone.prototype.getLocation = function() {\n    var len = this._length.clone();\n\n\tlen.multiplyScalar( Math.random() );\n\treturn len.add( this.start );\n\n};\n\n// Basically a RectangleZone\nSPARKS.ParallelogramZone = function(corner, side1, side2) {\n    this.corner = corner;\n\tthis.side1 = side1;\n\tthis.side2 = side2;\n};\n\nSPARKS.ParallelogramZone.prototype.getLocation = function() {\n\n\tvar d1 = this.side1.clone().multiplyScalar( Math.random() );\n\tvar d2 = this.side2.clone().multiplyScalar( Math.random() );\n\td1.add(d2);\n\treturn d1.add( this.corner );\n\n};\n\nSPARKS.CubeZone = function(position, x, y, z) {\n    this.position = position;\n\tthis.x = x;\n\tthis.y = y;\n\tthis.z = z;\n};\n\nSPARKS.CubeZone.prototype.getLocation = function() {\n    //TODO use pool?\n\n\tvar location = this.position.clone();\n\tlocation.x += Math.random() * this.x;\n\tlocation.y += Math.random() * this.y;\n\tlocation.z += Math.random() * this.z;\n\n\treturn location;\n\n};\n\n\nSPARKS.CubeZone.prototype.contains = function(position) {\n\n\tvar startX = this.position.x;\n\tvar startY = this.position.y;\n\tvar startZ = this.position.z;\n\tvar x = this.x; // width\n\tvar y = this.y; // depth\n\tvar z = this.z; // height\n\n\tif (x<0) {\n\t\tstartX += x;\n\t\tx = Math.abs(x);\n\t}\n\n\tif (y<0) {\n\t\tstartY += y;\n\t\ty = Math.abs(y);\n\t}\n\n\tif (z<0) {\n\t\tstartZ += z;\n\t\tz = Math.abs(z);\n\t}\n\n\tvar diffX = position.x - startX;\n\tvar diffY = position.y - startY;\n\tvar diffZ = position.z - startZ;\n\n\tif ( (diffX > 0) && (diffX < x) &&\n\t\t\t(diffY > 0) && (diffY < y) &&\n\t\t\t(diffZ > 0) && (diffZ < z) ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n\n};\n\n\n\n/**\n * The constructor creates a DiscZone 3D zone.\n *\n * @param centre The point at the center of the disc.\n * @param normal A vector normal to the disc.\n * @param outerRadius The outer radius of the disc.\n * @param innerRadius The inner radius of the disc. This defines the hole\n * in the center of the disc. If set to zero, there is no hole.\n */\n\n/*\n// BUGGY!!\nSPARKS.DiscZone = function(center, radiusNormal, outerRadius, innerRadius) {\n    this.center = center;\n\tthis.radiusNormal = radiusNormal;\n\tthis.outerRadius = (outerRadius==undefined) ? 0 : outerRadius;\n\tthis.innerRadius = (innerRadius==undefined) ? 0 : innerRadius;\n\n};\n\nSPARKS.DiscZone.prototype.getLocation = function() {\n    var rand = Math.random();\n\tvar _innerRadius = this.innerRadius;\n\tvar _outerRadius = this.outerRadius;\n\tvar center = this.center;\n\tvar _normal = this.radiusNormal;\n\n\t_distToOrigin = _normal.dot( center );\n\n\tvar radius = _innerRadius + (1 - rand * rand ) * ( _outerRadius - _innerRadius );\n\tvar angle = Math.random() * SPARKS.Utils.TWOPI;\n\n\tvar _distToOrigin = _normal.dot( center );\n\tvar axes = SPARKS.Utils.getPerpendiculars( _normal.clone() );\n\tvar _planeAxis1 = axes[0];\n\tvar _planeAxis2 = axes[1];\n\n\tvar p = _planeAxis1.clone();\n\tp.multiplyScalar( radius * Math.cos( angle ) );\n\tvar p2 = _planeAxis2.clone();\n\tp2.multiplyScalar( radius * Math.sin( angle ) );\n\tp.add( p2 );\n\treturn _center.add( p );\n\n};\n*/\n\nSPARKS.SphereCapZone = function(x, y, z, minr, maxr, angle) {\n    this.x = x;\n    this.y = y;\n    this.z = z;\n    this.minr = minr;\n    this.maxr = maxr;\n    this.angle = angle;\n};\n\nSPARKS.SphereCapZone.prototype.getLocation = function() {\n    var theta = Math.PI *2  * SPARKS.Utils.random();\n    var r = SPARKS.Utils.random();\n\n    //new THREE.Vector3\n    var v =  SPARKS.VectorPool.get().set(r * Math.cos(theta), -1 / Math.tan(this.angle * SPARKS.Utils.DEGREE_TO_RADIAN), r * Math.sin(theta));\n\n    //v.length = StardustMath.interpolate(0, _minRadius, 1, _maxRadius, Math.random());\n\n    var i = this.minr - ((this.minr-this.maxr) *  Math.random() );\n    v.multiplyScalar(i);\n\n\tv.__markedForReleased = true;\n\n    return v;\n};\n\n\n/********************************\n* Initializer Classes\n*\n*   Classes which initializes\n*   particles. Implements initialize( emitter:Emitter, particle:Particle )\n*********************************/\n\n// Specifies random life between max and min\nSPARKS.Lifetime = function(min, max) {\n    this._min = min;\n\n    this._max = max ? max : min;\n\n};\n\nSPARKS.Lifetime.prototype.initialize = function( emitter/*Emitter*/, particle/*Particle*/ ) {\n    particle.lifetime = this._min + SPARKS.Utils.random() * ( this._max - this._min );\n};\n\n\nSPARKS.Position = function(zone) {\n    this.zone = zone;\n};\n\nSPARKS.Position.prototype.initialize = function( emitter/*Emitter*/, particle/*Particle*/ ) {\n    var pos = this.zone.getLocation();\n    particle.position.set(pos.x, pos.y, pos.z);\n};\n\nSPARKS.Velocity = function(zone) {\n    this.zone = zone;\n};\n\nSPARKS.Velocity.prototype.initialize = function( emitter/*Emitter*/, particle/*Particle*/ ) {\n    var pos = this.zone.getLocation();\n    particle.velocity.set(pos.x, pos.y, pos.z);\n\tif (pos.__markedForReleased) {\n\t\t//console.log(\"release\");\n\t\tSPARKS.VectorPool.release(pos);\n\t\tpos.__markedForReleased = false;\n\t}\n};\n\nSPARKS.Target = function(target, callback) {\n    this.target = target;\n    this.callback = callback;\n};\n\nSPARKS.Target.prototype.initialize = function( emitter, particle ) {\n\n    if (this.callback) {\n        particle.target = this.callback();\n    } else {\n        particle.target = this.target;\n    }\n\n};\n\n/********************************\n* VectorPool\n*\n*  Reuse much of Vectors if possible\n*********************************/\n\nSPARKS.VectorPool = {\n\t__pools: [],\n\n\t// Get a new Vector\n\tget: function() {\n\t\tif (this.__pools.length>0) {\n\t\t\treturn this.__pools.pop();\n\t\t}\n\n\t\treturn this._addToPool();\n\n\t},\n\n\t// Release a vector back into the pool\n\trelease: function(v) {\n\t\tthis.__pools.push(v);\n\t},\n\n\t// Create a bunch of vectors and add to the pool\n\t_addToPool: function() {\n\t\t//console.log(\"creating some pools\");\n\n\t\tfor (var i=0, size = 100; i < size; i++) {\n\t\t\tthis.__pools.push(new THREE.Vector3());\n\t\t}\n\n\t\treturn new THREE.Vector3();\n\n\t}\n\n\n\n};\n\n\n/********************************\n* Util Classes\n*\n*   Classes which initializes\n*   particles. Implements initialize( emitter:Emitter, particle:Particle )\n*********************************/\nSPARKS.Utils = {\n    random: function() {\n        return Math.random();\n    },\n    DEGREE_TO_RADIAN: Math.PI / 180,\n\tTWOPI: Math.PI * 2,\n\n\tgetPerpendiculars: function(normal) {\n\t\tvar p1 = this.getPerpendicular( normal );\n\t\tvar p2 = normal.cross( p1 );\n\t\tp2.normalize();\n\t\treturn [ p1, p2 ];\n\t},\n\n\tgetPerpendicular: function( v )\n\t{\n\t\tif( v.x == 0 )\n\t\t{\n\t\t\treturn new THREE.Vector3D( 1, 0, 0 );\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar temp = new THREE.Vector3( v.y, -v.x, 0 );\n\t\t\treturn temp.normalize();\n\t\t}\n\t}\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Cameras/CombinedCamera.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Cameras/CombinedCamera.js",
            "module-type": "library",
            "text": "/**\n *\t@author zz85 / http://twitter.com/blurspline / http://www.lab4games.net/zz85/blog\n *\n *\tA general perpose camera, for setting FOV, Lens Focal Length,\n *\t\tand switching between perspective and orthographic views easily.\n *\t\tUse this only if you do not wish to manage\n *\t\tboth a Orthographic and Perspective Camera\n *\n */\n\n\nTHREE.CombinedCamera = function ( width, height, fov, near, far, orthoNear, orthoFar ) {\n\n\tTHREE.Camera.call( this );\n\n\tthis.fov = fov;\n\n\tthis.left = -width / 2;\n\tthis.right = width / 2\n\tthis.top = height / 2;\n\tthis.bottom = -height / 2;\n\n\t// We could also handle the projectionMatrix internally, but just wanted to test nested camera objects\n\n\tthis.cameraO = new THREE.OrthographicCamera( width / - 2, width / 2, height / 2, height / - 2, \torthoNear, orthoFar );\n\tthis.cameraP = new THREE.PerspectiveCamera( fov, width / height, near, far );\n\n\tthis.zoom = 1;\n\n\tthis.toPerspective();\n\n\tvar aspect = width/height;\n\n};\n\nTHREE.CombinedCamera.prototype = Object.create( THREE.Camera.prototype );\n\nTHREE.CombinedCamera.prototype.toPerspective = function () {\n\n\t// Switches to the Perspective Camera\n\n\tthis.near = this.cameraP.near;\n\tthis.far = this.cameraP.far;\n\n\tthis.cameraP.fov =  this.fov / this.zoom ;\n\n\tthis.cameraP.updateProjectionMatrix();\n\n\tthis.projectionMatrix = this.cameraP.projectionMatrix;\n\n\tthis.inPerspectiveMode = true;\n\tthis.inOrthographicMode = false;\n\n};\n\nTHREE.CombinedCamera.prototype.toOrthographic = function () {\n\n\t// Switches to the Orthographic camera estimating viewport from Perspective\n\n\tvar fov = this.fov;\n\tvar aspect = this.cameraP.aspect;\n\tvar near = this.cameraP.near;\n\tvar far = this.cameraP.far;\n\n\t// The size that we set is the mid plane of the viewing frustum\n\n\tvar hyperfocus = ( near + far ) / 2;\n\n\tvar halfHeight = Math.tan( fov / 2 ) * hyperfocus;\n\tvar planeHeight = 2 * halfHeight;\n\tvar planeWidth = planeHeight * aspect;\n\tvar halfWidth = planeWidth / 2;\n\n\thalfHeight /= this.zoom;\n\thalfWidth /= this.zoom;\n\n\tthis.cameraO.left = -halfWidth;\n\tthis.cameraO.right = halfWidth;\n\tthis.cameraO.top = halfHeight;\n\tthis.cameraO.bottom = -halfHeight;\n\n\t// this.cameraO.left = -farHalfWidth;\n\t// this.cameraO.right = farHalfWidth;\n\t// this.cameraO.top = farHalfHeight;\n\t// this.cameraO.bottom = -farHalfHeight;\n\n\t// this.cameraO.left = this.left / this.zoom;\n\t// this.cameraO.right = this.right / this.zoom;\n\t// this.cameraO.top = this.top / this.zoom;\n\t// this.cameraO.bottom = this.bottom / this.zoom;\n\n\tthis.cameraO.updateProjectionMatrix();\n\n\tthis.near = this.cameraO.near;\n\tthis.far = this.cameraO.far;\n\tthis.projectionMatrix = this.cameraO.projectionMatrix;\n\n\tthis.inPerspectiveMode = false;\n\tthis.inOrthographicMode = true;\n\n};\n\n\nTHREE.CombinedCamera.prototype.setSize = function( width, height ) {\n\n\tthis.cameraP.aspect = width / height;\n\tthis.left = -width / 2;\n\tthis.right = width / 2\n\tthis.top = height / 2;\n\tthis.bottom = -height / 2;\n\n};\n\n\nTHREE.CombinedCamera.prototype.setFov = function( fov ) {\n\n\tthis.fov = fov;\n\n\tif ( this.inPerspectiveMode ) {\n\n\t\tthis.toPerspective();\n\n\t} else {\n\n\t\tthis.toOrthographic();\n\n\t}\n\n};\n\n// For mantaining similar API with PerspectiveCamera\n\nTHREE.CombinedCamera.prototype.updateProjectionMatrix = function() {\n\n\tif ( this.inPerspectiveMode ) {\n\n\t\tthis.toPerspective();\n\n\t} else {\n\n\t\tthis.toPerspective();\n\t\tthis.toOrthographic();\n\n\t}\n\n};\n\n/*\n* Uses Focal Length (in mm) to estimate and set FOV\n* 35mm (fullframe) camera is used if frame size is not specified;\n* Formula based on http://www.bobatkins.com/photography/technical/field_of_view.html\n*/\nTHREE.CombinedCamera.prototype.setLens = function ( focalLength, frameHeight ) {\n\n\tif ( frameHeight === undefined ) frameHeight = 24;\n\n\tvar fov = 2 * THREE.Math.radToDeg( Math.atan( frameHeight / ( focalLength * 2 ) ) );\n\n\tthis.setFov( fov );\n\n\treturn fov;\n};\n\n\nTHREE.CombinedCamera.prototype.setZoom = function( zoom ) {\n\n\tthis.zoom = zoom;\n\n\tif ( this.inPerspectiveMode ) {\n\n\t\tthis.toPerspective();\n\n\t} else {\n\n\t\tthis.toOrthographic();\n\n\t}\n\n};\n\nTHREE.CombinedCamera.prototype.toFrontView = function() {\n\n\tthis.rotation.x = 0;\n\tthis.rotation.y = 0;\n\tthis.rotation.z = 0;\n\n\t// should we be modifing the matrix instead?\n\n\tthis.rotationAutoUpdate = false;\n\n};\n\nTHREE.CombinedCamera.prototype.toBackView = function() {\n\n\tthis.rotation.x = 0;\n\tthis.rotation.y = Math.PI;\n\tthis.rotation.z = 0;\n\tthis.rotationAutoUpdate = false;\n\n};\n\nTHREE.CombinedCamera.prototype.toLeftView = function() {\n\n\tthis.rotation.x = 0;\n\tthis.rotation.y = - Math.PI / 2;\n\tthis.rotation.z = 0;\n\tthis.rotationAutoUpdate = false;\n\n};\n\nTHREE.CombinedCamera.prototype.toRightView = function() {\n\n\tthis.rotation.x = 0;\n\tthis.rotation.y = Math.PI / 2;\n\tthis.rotation.z = 0;\n\tthis.rotationAutoUpdate = false;\n\n};\n\nTHREE.CombinedCamera.prototype.toTopView = function() {\n\n\tthis.rotation.x = - Math.PI / 2;\n\tthis.rotation.y = 0;\n\tthis.rotation.z = 0;\n\tthis.rotationAutoUpdate = false;\n\n};\n\nTHREE.CombinedCamera.prototype.toBottomView = function() {\n\n\tthis.rotation.x = Math.PI / 2;\n\tthis.rotation.y = 0;\n\tthis.rotation.z = 0;\n\tthis.rotationAutoUpdate = false;\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/ProxyGeometry.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/ProxyGeometry.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n * @author kile / http://kile.stravaganza.org/\n * @author alteredq / http://alteredqualia.com/\n * @author mikael emtinger / http://gomo.se/\n * @author zz85 / http://www.lab4games.net/zz85/blog\n * @author bhouston / http://exocortex.com\n * @author jbaicoianu / http://baicoianu.com\n */\n\nTHREE.ProxyGeometry = function ( ) {\n\n\tTHREE.BufferGeometry.call( this );\n\n\tthis.addEventListener( 'allocate', this.onGeometryAllocate);\n\n\t// TODO - implement as BufferGeometry attributes\n\tthis.morphTargets = [];\n\tthis.morphColors = [];\n\n};\n\nTHREE.ProxyGeometry.prototype = Object.create( THREE.IndexedGeometry2.prototype );\n\nObject.defineProperties(THREE.ProxyGeometry.prototype, {\n\tvertices: { \n\t\tenumerable: true, \n\t\tconfigurable: true, \n\t\tget: function() { return this.createVertexProxies(); }\n\t},\n\tfaces: {\n\t\tenumerable: true,\t\n\t\tget: function() { return this.createFaceProxies() } \n\t},\n\tfaceVertexUvs: {\n\t\tenumerable: true,\t\n\t\tget: function() { return this.createUvProxies() } \n\t},\n\tcolors: {\n\t\tenumerable: true,\t\n\t\tget: function() { return this.createColorProxies() } \n\t},\n\tskinIndices: {\n\t\tenumerable: true,\t\n\t\tget: function() { return this.createSkinIndexProxies() } \n\t},\n\tskinWeights: {\n\t\tenumerable: true,\t\n\t\tget: function() { return this.createSkinWeightProxies() } \n\t},\n\t// TODO - fill in additional proxies:\n\t// - morphColors\n\t// - morphNormals\n\t// - morphTargets\n\n\tverticesNeedUpdate: {\n\t\tenumerable: true,\t\n\t\tget: function() { if (this.attributes[ 'position' ]) return this.attributes[ 'position' ].needsUpdate; } ,\n\t\tset: function(v) { if (this.attributes[ 'position' ]) this.attributes[ 'position' ].needsUpdate = v; } \n\t},\n\tcolorsNeedUpdate: {\n\t\tenumerable: true,\t\n\t\tget: function() { if (this.attributes[ 'color' ]) return this.attributes[ 'color' ].needsUpdate; } ,\n\t\tset: function(v) { if (this.attributes[ 'color' ]) this.attributes[ 'color' ].needsUpdate = v; } \n\t},\n\tnormalsNeedUpdate: {\n\t\tenumerable: true,\t\n\t\tget: function() { if (this.attributes[ 'normal' ]) return this.attributes[ 'normal' ].needsUpdate; } ,\n\t\tset: function(v) { if (this.attributes[ 'normal' ]) this.attributes[ 'normal' ].needsUpdate = v; } \n\t},\n});\n\nTHREE.ProxyGeometry.prototype.createVertexProxies = function(values) {\n\n\tif (!this.hasOwnProperty('vertices')) {\n\n\t\t// Replace the prototype getter with a local array property\n\n\t\tObject.defineProperty( this, \"vertices\", { value: [], writable: true } );\n\n\t} else {\n\n\t\t// Start with a new, empty array\n\n\t\tthis.vertices = [];\n\n\t}\n\n\t// If the attribute buffer has already been populated, set up proxy objects\n\n\tthis.populateProxyFromBuffer(this.vertices, \"position\", THREE.ProxyVector3, 3);\n\n\t// If values were passed in, store them in the buffer via the proxy objects\n\n\tif (values) {\n\n\t\tfor (var i = 0; i < values.length; i++) {\n\n\t\t\tthis.vertices[i].copy(values[i]);\n\n\t\t}\n\t}\n\n\t// Return a reference to the newly-created array\n\n\treturn this.vertices;\n\n}\n\nTHREE.ProxyGeometry.prototype.createFaceProxies = function(values) {\n\n\tif (!this.hasOwnProperty(\"faces\")) {\n\n\t\t// Replace the prototype getter with a local array property\n\n\t\tObject.defineProperty( this, \"faces\", { value: [], writable: true } );\n\n\t} else {\n\n\t\t// Start with a new, empty array\n\n\t\tthis.faces = [];\n\t}\n\n\t// If the attribute buffer has already been populated, set up proxy objects\n\n\tvar faces = this.faces,\n\t\t\tindexarray = false,\n\t\t\tpositionarray = false,\n\t\t\tnormalarray = false,\n\t\t\tcolorarray = false,\n\t\t\ttangentarray = false;\n\n\tif ( this.attributes[ 'index' ] ) {\n\t\tindexarray = this.attributes[ 'index' ].array;\n\t}\n\tif ( this.attributes[ 'position' ] ) {\n\t\tpositionarray = this.attributes[ 'position' ].array;\n\t}\n\tif (this.attributes[ 'normal' ]) {\n\t\tnormalarray = this.attributes[ 'normal' ].array;\n\t}\n\tif (this.attributes[ 'color' ]) {\n\t\tcolorarray = this.attributes[ 'color' ].array;\n\t}\n\tif (this.attributes[ 'tangent' ]) {\n\t\ttangentarray = this.attributes[ 'tangent' ].array;\n\t}\n\n\t// TODO - this should be accomplished using \"virtual\" functions on various classes (IndexedGeometry, SmoothGeometry, etc)\n\n\tif (indexarray) {\n\n\t\tfor ( var i = 0, l = indexarray.length / 3; i < l; i ++ ) {\n\n\t\t\tvar o = i * 3;\n\n\t\t\tvar face = new THREE.ProxyFace3( indexarray, i * 3 );\n\t\t\tfaces.push(face);\n\n\t\t}\n\n\t} else if (positionarray) {\n\n\t\tfor ( var i = 0, l = positionarray.length / 3; i < l; i += 3 ) {\n\n\t\t\tvar o = i * 3;\n\t\t\tvar v1 = i, v2 = i+1, v3 = i+2;\n\n\t\t\tvar face = new THREE.ProxyFace3( v1, v2, v3 );\n\t\t\tfaces.push(face);\n\n\t\t}\n\n\t}\n\n\t// If values were passed in, store them in the buffer via the proxy objects\n\n\tif (values) {\n\n\t\tfor (var i = 0, l = values.length; i < l; i++) {\n\n\t\t\tvar f = faces[i],\n\t\t\t    v = values[i];\n\n\t\t\tf.a = v.a;\n\t\t\tf.b = v.b;\n\t\t\tf.c = v.c;\n\n\t\t}\n\n\t}\n\n\tif (normalarray) {\n\n\t\tthis.createFaceVertexNormalProxies(values);\n\n\t}\n\n\tif (colorarray) {\n\n\t\tthis.createFaceVertexColorProxies(values);\n\n\t}\n\n\tif (tangentarray) {\n\n\t\tthis.createFaceVertexTangentProxies(values);\n\n\t}\n\n\t// Return a reference to the newly-created array\n\n\treturn this.faces;\n\n}\n\nTHREE.ProxyGeometry.prototype.createFaceVertexNormalProxies = function(values) {\n\n\tif ( this.attributes[ 'normal' ] && this.attributes[ 'normal' ].array ) {\n\n\t\tvar normalarray = this.attributes[ 'normal' ].array;\n\n\t\tfor (var i = 0, l = this.faces.length; i < l; i++) {\n\n\t\t\tvar f = this.faces[i];\n\n\t\t\tf.vertexNormals = [\n\t\t\t\tnew THREE.ProxyVector3(normalarray, f.a * 3),\n\t\t\t\tnew THREE.ProxyVector3(normalarray, f.b * 3),\n\t\t\t\tnew THREE.ProxyVector3(normalarray, f.c * 3),\n\t\t\t];\n\t\t\tf.normal = new THREE.MultiVector3(f.vertexNormals);\n\n\t\t}\n\t}\n\n\t// If values were passed in, store them in the buffer via the proxy objects\n\n\tif (values) {\n\n\t\tfor (var i = 0, l = values.length; i < l; i++) {\n\n\t\t\tvar f = this.faces[i],\n\t\t\t    v = values[i];\n\n\t\t\tif (v.vertexNormals.length > 0) {\n\n\t\t\t\tfor (var j = 0, l2 = f.vertexNormals.length; j < l2; j++) {\n\n\t\t\t\t\tf.vertexNormals[j].copy(v.vertexNormals[j]);\n\n\t\t\t\t}\n\n\t\t\t} else if (v.normal) {\n\n\t\t\t\tf.normal.copy(v.normal);\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\nTHREE.ProxyGeometry.prototype.createFaceVertexColorProxies = function(values) {\n\n\tif ( this.attributes[ 'color' ] && this.attributes[ 'color' ].array ) {\n\n\t\tvar colorarray = this.attributes[ 'color' ].array;\n\n\t\tfor (var i = 0, l = this.faces.length; i < l; i++) {\n\t\t\tvar f = this.faces[i];\n\n\t\t\tif ( this.attributes[ 'index' ] ) {\n\t\t\t\tf.vertexColors = [\n\t\t\t\t\t\tnew THREE.ProxyColor(colorarray, f.a * 3),\n\t\t\t\t\t\tnew THREE.ProxyColor(colorarray, f.b * 3),\n\t\t\t\t\t\tnew THREE.ProxyColor(colorarray, f.c * 3),\n\t\t\t\t\t];\n\t\t\t} else {\n\t\t\t\tvar o = i * 9;\n\n\t\t\t\tf.vertexColors = [\n\t\t\t\t\t\tnew THREE.ProxyColor(colorarray, o),\n\t\t\t\t\t\tnew THREE.ProxyColor(colorarray, o + 3),\n\t\t\t\t\t\tnew THREE.ProxyColor(colorarray, o + 6),\n\t\t\t\t\t];\n\t\t\t}\n\t\t\tf.color = new THREE.MultiColor(f.vertexColors);\n\n\t\t}\n\t}\n\n\t// If values were passed in, store them in the buffer via the proxy objects\n\n\tif (values) {\n\n\t\tfor (var i = 0, l = values.length; i < l; i++) {\n\n\t\t\tvar f = this.faces[i],\n\t\t\t    v = values[i];\n\n\t\t\tfor (var j = 0, l2 = f.vertexColors.length; j < l2; j++) {\n\n\t\t\t\tif (v.vertexColors.length > 0) {\n\n\t\t\t\t\tf.vertexColors[j].copy(v.vertexColors[j]);\n\n\t\t\t\t} else if (v.color) {\n\n\t\t\t\t\tf.color.copy(v.color);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\nTHREE.ProxyGeometry.prototype.createFaceVertexTangentProxies = function(values) {\n\n\tif ( this.attributes[ 'tangent' ] && this.attributes[ 'tangent' ].array ) {\n\n\t\tvar tangentarray = this.attributes[ 'tangent' ].array;\n\n\t\tfor (var i = 0, l = this.faces.length; i < l; i++) {\n\n\t\t\tvar f = this.faces[i];\n\n\t\t\tf.vertexTangents = [\n\t\t\t\tnew THREE.ProxyVector3(tangentarray, f.a * 3),\n\t\t\t\tnew THREE.ProxyVector3(tangentarray, f.b * 3),\n\t\t\t\tnew THREE.ProxyVector3(tangentarray, f.c * 3),\n\t\t\t];\n\n\t\t}\n\t}\n\n\t// If values were passed in, store them in the buffer via the proxy objects\n\n\tif (values) {\n\n\t\tfor (var i = 0, l = values.length; i < l; i++) {\n\n\t\t\tvar f = this.faces[i],\n\t\t\t    v = values[i];\n\n\t\t\tif (v.vertexTangents.length > 0) {\n\n\t\t\t\tfor (var j = 0, l2 = f.vertexTangents.length; j < l2; j++) {\n\n\t\t\t\t\tf.vertexTangents[j].copy(v.vertexTangents[j]);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\nTHREE.ProxyGeometry.prototype.createUvProxies = function(values) {\n\n\t// Replace the prototype getter with a local array property\n\n\tif (!this.hasOwnProperty(\"faceVertexUvs\")) {\n\t\tObject.defineProperty( this, \"faceVertexUvs\", { value: [[]], writable: true } );\n\t} else {\n\t\tthis.faceVertexUvs = [[]];\n\t}\n\n\t// If the attribute buffer has already been populated, set up proxy objects\n\n\tif ( this.attributes[ 'uv' ] && this.attributes[ 'uv' ].array ) {\n\n\t\tvar faces = this.faces;\n\t\tvar uvarray = this.attributes[ 'uv' ].array;\n\n\t\tfor (var i = 0, l = faces.length; i < l; i++) {\n\t\t\tvar f = faces[i];\n\n\t\t\tthis.faceVertexUvs[0][i] = [];\n\n\t\t\tif ( this.attributes[ 'index' ] ) {\n\t\t\t\tthis.faceVertexUvs[0][i][0] = new THREE.ProxyVector2(uvarray, f.a * 2);\n\t\t\t\tthis.faceVertexUvs[0][i][1] = new THREE.ProxyVector2(uvarray, f.b * 2);\n\t\t\t\tthis.faceVertexUvs[0][i][2] = new THREE.ProxyVector2(uvarray, f.c * 2);\n\t\t\t} else {\n\t\t\t\tvar o = i * 6;\n\t\t\t\tthis.faceVertexUvs[0][i][0] = new THREE.ProxyVector2(uvarray, o);\n\t\t\t\tthis.faceVertexUvs[0][i][1] = new THREE.ProxyVector2(uvarray, o + 2);\n\t\t\t\tthis.faceVertexUvs[0][i][2] = new THREE.ProxyVector2(uvarray, o + 4);\n\t\t\t}\n\n\t\t}\n\t\n\t}\n\n\t// If values were passed in, store them in the buffer via the proxy objects\n\n\tif (values) {\n\n\t\tfor (var i = 0, l = values.length; i < l; i++) {\n\n\t\t\tfor (var j = 0, l2 = values[i].length; j < l2; j++) {\n\n\t\t\t\tvar uv = values[i][j];\n\t\t\t\tthis.faceVertexUvs[0][i][j].copy(uv);\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t// Return a reference to the newly-created array\n\n\treturn this.faceVertexUvs;\n\n}\n\nTHREE.ProxyGeometry.prototype.createSkinIndexProxies = function(values) {\n\n\t// Replace the prototype getter with a local array property\n\n\tif (!this.hasOwnProperty('skinIndices')) {\n\t\tObject.defineProperty( this, \"skinIndices\", { value: [], writable: true } );\n\t} else {\n\t\tthis.skinIndices = [];\n\t}\n\n\t// If the attribute buffer has already been populated, set up proxy objects\n\n\tthis.populateProxyFromBuffer(this.skinIndices, \"skinIndex\", THREE.ProxyVector4, 4);\n\n\t// If values were passed in, store them in the buffer via the proxy objects\n\n\tif (values) {\n\n\t\tfor (var i = 0; i < values.length; i++) {\n\n\t\t\tthis.skinIndices[i].copy(values[i]);\n\n\t\t}\n\n\t}\n\n\t// Return a reference to the newly-created array\n\n\treturn this.skinIndices;\n\n}\n\nTHREE.ProxyGeometry.prototype.createSkinWeightProxies = function(values) {\n\n\t// Replace the prototype getter with a local array property\n\n\tif (!this.hasOwnProperty('skinWeights')) {\n\t\tObject.defineProperty( this, \"skinWeights\", { value: [], writable: true } );\n\t} else {\n\t\tthis.skinWeights = [];\n\t}\n\n\t// If the attribute buffer has already been populated, set up proxy objects\n\n\tthis.populateProxyFromBuffer(this.skinWeights, \"skinWeight\", THREE.ProxyVector4, 4);\n\n\t// If values were passed in, store them in the buffer via the proxy objects\n\n\tif (values) {\n\n\t\tfor (var i = 0; i < values.length; i++) {\n\n\t\t\tthis.skinWeights[i].copy(values[i]);\n\n\t\t}\n\n\t}\n\n\t// Return a reference to the newly-created array\n\n\treturn this.skinWeights;\n\n}\n\nTHREE.ProxyGeometry.prototype.createColorProxies = function(values) {\n\n\t// Replace the prototype getter with a local array property\n\n\tif (!this.hasOwnProperty('colors')) {\n\t\tObject.defineProperty( this, \"colors\", { value: [], writable: true } );\n\t} else {\n\t\tthis.colors = [];\n\t}\n\n\t// If the attribute buffer has already been populated, set up proxy objects\n\n\tthis.populateProxyFromBuffer(this.colors, \"color\", THREE.ProxyColor, 3);\n\n\t// If values were passed in, store them in the buffer via the proxy objects\n\n\tif (values) {\n\n\t\tfor (var i = 0; i < values.length; i++) {\n\n\t\t\tthis.colors[i].copy(values[i]);\n\n\t\t}\n\n\t}\n\n\t// Return a reference to the newly-created array\n\n\treturn this.colors;\n\n}\n\nTHREE.ProxyGeometry.prototype.populateProxyFromBuffer = function(attr, buffername, proxytype, itemsize, offset, count) {\n\n\tif ( this.attributes[ buffername ] && this.attributes[ buffername ].array ) {\n\n\t\tvar array = this.attributes[ buffername ].array;\n\t\tvar size = itemsize || this.attributes[ buffername ].itemSize;\n\t\tvar start = offset || 0;\n\t\t\n\t\tcount = count || (array.length / size - start);\n\n\t\tfor ( var i = start, l = start + count; i < l; i ++ ) {\n\n\t\t\tattr.push( new proxytype( array, i * size ) );\n\n\t\t}\n\n\t}\n\n}\n\n/*\n * Checks for duplicate vertices with hashmap.\n * Duplicated vertices are removed\n * and faces' vertices are updated.\n */\n\nTHREE.ProxyGeometry.prototype.mergeVertices = function () {\n\n\tvar verticesMap = {}; // Hashmap for looking up vertice by position coordinates (and making sure they are unique)\n\tvar unique = [], changes = [];\n\n\tvar v, key;\n\tvar precisionPoints = 4; // number of decimal points, eg. 4 for epsilon of 0.0001\n\tvar precision = Math.pow( 10, precisionPoints );\n\tvar i,il, face;\n\tvar indices, k, j, jl, u;\n\n\tfor ( i = 0, il = this.vertices.length; i < il; i ++ ) {\n\n\t\tv = this.vertices[ i ];\n\t\tkey = Math.round( v.x * precision ) + '_' + Math.round( v.y * precision ) + '_' + Math.round( v.z * precision );\n\n\t\tif ( verticesMap[ key ] === undefined ) {\n\n\t\t\tverticesMap[ key ] = i;\n\t\t\tunique.push( this.vertices[ i ] );\n\t\t\tchanges[ i ] = unique.length - 1;\n\n\t\t} else {\n\n\t\t\t//console.log('Duplicate vertex found. ', i, ' could be using ', verticesMap[key]);\n\t\t\tchanges[ i ] = changes[ verticesMap[ key ] ];\n\n\t\t}\n\n\t};\n\n\n\t// if faces are completely degenerate after merging vertices, we\n\t// have to remove them from the geometry.\n\tvar faceIndicesToRemove = [];\n\n\tfor( i = 0, il = this.faces.length; i < il; i ++ ) {\n\n\t\tface = this.faces[ i ];\n\n\t\tface.a = changes[ face.a ];\n\t\tface.b = changes[ face.b ];\n\t\tface.c = changes[ face.c ];\n\n\t\tindices = [ face.a, face.b, face.c ];\n\n\t\tvar dupIndex = -1;\n\n\t\t// if any duplicate vertices are found in a Face3\n\t\t// we have to remove the face as nothing can be saved\n\t\tfor ( var n = 0; n < 3; n ++ ) {\n\t\t\tif ( indices[ n ] == indices[ ( n + 1 ) % 3 ] ) {\n\n\t\t\t\tdupIndex = n;\n\t\t\t\tfaceIndicesToRemove.push( i );\n\t\t\t\tbreak;\n\n\t\t\t}\n\t\t}\n\n\t}\n\n\tfor ( i = faceIndicesToRemove.length - 1; i >= 0; i -- ) {\n\t\tvar idx = faceIndicesToRemove[ i ];\n\n\t\tthis.faces.splice( idx, 1 );\n\n\t\tfor ( j = 0, jl = this.faceVertexUvs.length; j < jl; j ++ ) {\n\n\t\t\tthis.faceVertexUvs[ j ].splice( idx, 1 );\n\n\t\t}\n\n\t}\n\n\t// Use unique set of vertices\n\n\tvar diff = this.vertices.length - unique.length;\n\tthis.vertices = unique;\n\treturn diff;\n\n}\n\nTHREE.ProxyGeometry.prototype.onGeometryAllocate = function (ev) {\n\n\t// Prevent allocate event listener from firing multiple times\n\tthis.removeEventListener( 'allocate', this.onGeometryAllocate);\n\n\tif (this.hasOwnProperty('vertices')) {\n\t\tvar attr = new THREE.Float32Attribute(this.vertices.length, 3);\n\t\tthis.addAttribute('position', attr);\n\t\tthis.createVertexProxies(this.vertices);\n\t}\n\tif (this.hasOwnProperty('faces')) {\n\t\tvar idxattr = new THREE.Uint16Attribute(this.faces.length, 3);\n\t\tthis.addAttribute('index', idxattr);\n\n\t\tif (this.faces.length > 0) {\n\t\t\tvar hasnormals = (this.hasOwnProperty('normals') || this.faces[0].normal || this.faces[0].vertexNormals.length > 0);\n\t\t\tvar hascolors = (this.hasOwnProperty('colors') || this.faces[0].color || this.faces[0].vertexColors.length > 0);\n\t\t\tvar hastangents = (this.faces[0].vertexTangents.length > 0);\n\n\t\t\tif (hasnormals) {\n\t\t\t\tvar normalattr = new THREE.Float32Attribute(this.vertices.length, 3);\n\t\t\t\tthis.addAttribute('normal', normalattr);\n\t\t\t}\n\n\t\t\tif (hascolors) {\n\t\t\t\tvar colorattr = new THREE.Float32Attribute(this.faces.length * 3, 3);\n\t\t\t\tthis.addAttribute('color', colorattr);\n\t\t\t}\n\n\t\t\tif (hastangents) {\n\t\t\t\tvar tangentattr = new THREE.Float32Attribute(this.faces.length * 3, 3);\n\t\t\t\tthis.addAttribute('tangent', tangentattr);\n\t\t\t}\n\t\t}\n\n\t\tthis.createFaceProxies(this.faces);\n\t}\n\n\tif (this.hasOwnProperty('faceVertexUvs')) {\n\n\t\tvar uvattr = new THREE.Float32Attribute(this.faces.length * 3, 2);\n\t\tthis.addAttribute('uv', uvattr);\n\t\tthis.createUvProxies(this.faceVertexUvs[0]);\n\n\t}\n\n\tif (this.hasOwnProperty('skinIndices')) {\n\n\t\tvar skinidxattr = new THREE.Float32Attribute(this.skinIndices.length, 4);\n\t\tthis.addAttribute('skinIndex', skinidxattr);\n\t\tthis.createSkinIndexProxies(this.skinIndices);\n\n\t}\n\n\tif (this.hasOwnProperty('skinWeights')) {\n\n\t\tvar skinweightattr = new THREE.Float32Attribute(this.skinWeights.length, 4);\n\t\tthis.addAttribute('skinWeight', skinweightattr);\n\t\tthis.createSkinWeightProxies(this.skinWeights);\n\n\t}\n}\n\nTHREE.ProxyGeometry.prototype.computeFaceNormals = function() {\n\n\tthis.dispatchEvent( { type: 'allocate' } );\n\n\treturn THREE.BufferGeometry.prototype.computeFaceNormals.call(this);\n\n}\n\nTHREE.ProxyGeometry.prototype.computeVertexNormals = function() {\n\n\tthis.dispatchEvent( { type: 'allocate' } );\n\n\treturn THREE.BufferGeometry.prototype.computeVertexNormals.call(this);\n\n}\n\nTHREE.ProxyGeometry.prototype.computeTangents = function() {\n\n\tthis.dispatchEvent( { type: 'allocate' } );\n\n\tvar ret = THREE.BufferGeometry.prototype.computeTangents.call(this);\n\n\t// FIXME - this doesn't work yet\n\t//this.createFaceVertexTangentProxies();\n\n\treturn ret;\n\n}\n\nTHREE.ProxyGeometry.prototype.computeBoundingSphere = function() {\n\n\tthis.dispatchEvent( { type: 'allocate' } );\n\n\treturn THREE.BufferGeometry.prototype.computeBoundingSphere.call(this);\n\n}\n\nTHREE.ProxyGeometry.prototype.computeBoundingBox = function () {\n\n\tthis.dispatchEvent( { type: 'allocate' } );\n\n\treturn THREE.BufferGeometry.prototype.computeBoundingBox.call(this);\n\n}\nTHREE.ProxyGeometry.prototype.clone = function () {\n\n\tvar buff = THREE.BufferGeometry.prototype.clone.call(this);\n\tvar geo = new THREE.ProxyGeometry();\n\tgeo.attributes = buff.attributes;\n\tgeo.offsets = buff.offsets;\n\n\treturn geo;\n\n}\n\nTHREE.EventDispatcher.prototype.apply( THREE.ProxyGeometry.prototype );\n\nTHREE.ProxyGeometryIdCount = 0;\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/IndexedTypedGeometry.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/IndexedTypedGeometry.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.IndexedTypedGeometry = function () {\n\n\tTHREE.BufferGeometry.call( this );\n\n};\n\nTHREE.IndexedTypedGeometry.prototype = Object.create( THREE.BufferGeometry.prototype );\n\nTHREE.IndexedTypedGeometry.prototype.setArrays = function ( indices, vertices, normals, uvs ) {\n\n\tthis.indices = indices;\n\tthis.vertices = vertices;\n\tthis.normals = normals;\n\tthis.uvs = uvs;\n\n\tthis.attributes[ 'index' ] = { array: indices, itemSize: 1 };\n\tthis.attributes[ 'position' ] = { array: vertices, itemSize: 3 };\n\tthis.attributes[ 'normal' ] = { array: normals, itemSize: 3 };\n\tthis.attributes[ 'uv' ] = { array: uvs, itemSize: 2 };\n\n\treturn this;\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/TypedGeometry.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/TypedGeometry.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.TypedGeometry = function ( size ) {\n\n\tTHREE.BufferGeometry.call( this );\n\n\tif ( size !== undefined ) {\n\n\t\tthis.vertices = new Float32Array( size * 3 * 3 );\n\t\tthis.normals = new Float32Array( size * 3 * 3 );\n\t\tthis.uvs = new Float32Array( size * 3 * 2 );\n\n\t\tthis.attributes[ 'position' ] = { array: this.vertices, itemSize: 3 };\n\t\tthis.attributes[ 'normal' ] = { array: this.normals, itemSize: 3 };\n\t\tthis.attributes[ 'uv' ] = { array: this.uvs, itemSize: 2 };\n\n\t}\n\n};\n\nTHREE.TypedGeometry.prototype = Object.create( THREE.BufferGeometry.prototype );\n\nTHREE.TypedGeometry.prototype.setArrays = function ( vertices, normals, uvs ) {\n\n\tthis.vertices = vertices;\n\tthis.normals = normals;\n\tthis.uvs = uvs;\n\n\tthis.attributes[ 'position' ] = { array: vertices, itemSize: 3 };\n\tthis.attributes[ 'normal' ] = { array: normals, itemSize: 3 };\n\tthis.attributes[ 'uv' ] = { array: uvs, itemSize: 2 };\n\n\treturn this;\n\n};\n\nTHREE.TypedGeometry.prototype.merge = ( function () {\n\n\tvar offset = 0;\n\tvar normalMatrix = new THREE.Matrix3();\n\n\treturn function ( geometry, matrix, startOffset ) {\n\n\t\tif ( startOffset !== undefined ) offset = startOffset;\n\n\t\tvar offset2 = offset * 2;\n\t\tvar offset3 = offset * 3;\n\n\t\tvar vertices = this.attributes[ 'position' ].array;\n\t\tvar normals = this.attributes[ 'normal' ].array;\n\t\tvar uvs = this.attributes[ 'uv' ].array;\n\n\t\tif ( geometry instanceof THREE.TypedGeometry ) {\n\n\t\t\tvar vertices2 = geometry.attributes[ 'position' ].array;\n\t\t\tvar normals2 = geometry.attributes[ 'normal' ].array;\n\t\t\tvar uvs2 = geometry.attributes[ 'uv' ].array;\n\n\t\t\tfor ( var i = 0, l = vertices2.length; i < l; i += 3 ) {\n\n\t\t\t\tvertices[ i + offset3     ] = vertices2[ i     ];\n\t\t\t\tvertices[ i + offset3 + 1 ] = vertices2[ i + 1 ];\n\t\t\t\tvertices[ i + offset3 + 2 ] = vertices2[ i + 2 ];\n\n\t\t\t\tnormals[ i + offset3     ] = normals2[ i     ];\n\t\t\t\tnormals[ i + offset3 + 1 ] = normals2[ i + 1 ];\n\t\t\t\tnormals[ i + offset3 + 2 ] = normals2[ i + 2 ];\n\n\t\t\t\tuvs[ i + offset2     ] = uvs2[ i     ];\n\t\t\t\tuvs[ i + offset2 + 1 ] = uvs2[ i + 1 ];\n\n\t\t\t}\n\n\t\t} else if ( geometry instanceof THREE.IndexedTypedGeometry ) {\n\n\t\t\tvar indices2 = geometry.attributes[ 'index' ].array;\n\t\t\tvar vertices2 = geometry.attributes[ 'position' ].array;\n\t\t\tvar normals2 = geometry.attributes[ 'normal' ].array;\n\t\t\tvar uvs2 = geometry.attributes[ 'uv' ].array;\n\n\t\t\tfor ( var i = 0, l = indices2.length; i < l; i ++ ) {\n\n\t\t\t\tvar index = indices2[ i ];\n\n\t\t\t\tvar index3 = index * 3;\n\t\t\t\tvar i3 = i * 3;\n\n\t\t\t\tvertices[ i3 + offset3 ] = vertices2[ index3 ];\n\t\t\t\tvertices[ i3 + offset3 + 1 ] = vertices2[ index3 + 1 ];\n\t\t\t\tvertices[ i3 + offset3 + 2 ] = vertices2[ index3 + 2 ];\n\n\t\t\t\tnormals[ i3 + offset3 ] = normals2[ index3 ];\n\t\t\t\tnormals[ i3 + offset3 + 1 ] = normals2[ index3 + 1 ];\n\t\t\t\tnormals[ i3 + offset3 + 2 ] = normals2[ index3 + 2 ];\n\n\t\t\t\tvar index2 = index * 2;\n\t\t\t\tvar i2 = i * 2;\n\n\t\t\t\tuvs[ i2 + offset2 ] = uvs2[ index2 ];\n\t\t\t\tuvs[ i2 + offset2 + 1 ] = uvs2[ index2 + 1 ];\n\n\t\t\t}\n\n\t\t\tif ( matrix !== undefined ) {\n\n\t\t\t\tmatrix.applyToVector3Array( vertices, offset3, indices2.length * 3 );\n\n\t\t\t\tnormalMatrix.getNormalMatrix( matrix );\n\t\t\t\tnormalMatrix.applyToVector3Array( normals, offset3, indices2.length * 3 );\n\n\t\t\t}\n\n\t\t\toffset += indices2.length;\n\n\t\t}\n\n\t};\n\n} )();"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/PlaneTypedGeometry.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/PlaneTypedGeometry.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as\n */\n\nTHREE.PlaneTypedGeometry = function ( width, height, widthSegments, heightSegments ) {\n\n\tthis.parameters = {\n\t\twidth: width,\n\t\theight: height,\n\t\twidthSegments: widthSegments,\n\t\theightSegments: heightSegments\n\t};\n\n\tvar width_half = width / 2;\n\tvar height_half = height / 2;\n\n\tvar gridX = widthSegments || 1;\n\tvar gridY = heightSegments || 1;\n\n\tvar gridX1 = gridX + 1;\n\tvar gridY1 = gridY + 1;\n\n\tvar segment_width = width / gridX;\n\tvar segment_height = height / gridY;\n\n\tvar vertices = new Float32Array( gridX1 * gridY1 * 3 );\n\tvar normals = new Float32Array( gridX1 * gridY1 * 3 );\n\tvar uvs = new Float32Array( gridX1 * gridY1 * 2 );\n\n\tvar offset = 0;\n\tvar offset2 = 0;\n\n\tfor ( var iy = 0; iy < gridY1; iy ++ ) {\n\n\t\tvar y = iy * segment_height - height_half;\n\n\t\tfor ( var ix = 0; ix < gridX1; ix ++ ) {\n\n\t\t\tvar x = ix * segment_width - width_half;\n\n\t\t\tvertices[ offset     ] = x;\n\t\t\tvertices[ offset + 1 ] = - y;\n\n\t\t\tnormals[ offset + 2 ] = 1;\n\n\t\t\tuvs[ offset2     ] = ix / gridX;\n\t\t\tuvs[ offset2 + 1 ] = 1 - ( iy / gridY );\n\n\t\t\toffset += 3;\n\t\t\toffset2 += 2;\n\n\t\t}\n\n\t}\n\n\toffset = 0;\n\n\tvar indices = new ( ( vertices.length / 3 ) > 65535 ? Uint32Array : Uint16Array )( gridX * gridY * 6 );\n\n\tfor ( var iy = 0; iy < gridY; iy ++ ) {\n\n\t\tfor ( var ix = 0; ix < gridX; ix ++ ) {\n\n\t\t\tvar a = ix + gridX1 * iy;\n\t\t\tvar b = ix + gridX1 * ( iy + 1 );\n\t\t\tvar c = ( ix + 1 ) + gridX1 * ( iy + 1 );\n\t\t\tvar d = ( ix + 1 ) + gridX1 * iy;\n\n\t\t\tindices[ offset     ] = a;\n\t\t\tindices[ offset + 1 ] = b;\n\t\t\tindices[ offset + 2 ] = d;\n\n\t\t\tindices[ offset + 3 ] = b;\n\t\t\tindices[ offset + 4 ] = c;\n\t\t\tindices[ offset + 5 ] = d;\n\n\t\t\toffset += 6;\n\n\t\t}\n\n\t}\n\n\tTHREE.IndexedTypedGeometry.call( this );\n\n\tthis.setArrays( indices, vertices, normals, uvs );\n\tthis.computeBoundingSphere();\n\n};\n\nTHREE.PlaneTypedGeometry.prototype = Object.create( THREE.IndexedTypedGeometry.prototype );\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/Geometry4.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/Geometry4.js",
            "module-type": "library",
            "text": "THREE.Geometry4 = function ( size ) {\n\n        THREE.BufferGeometry.call( this );\n\n        var verticesBuffer = new ArrayBuffer( size * 3 * 4 );\n        var normalsBuffer = new ArrayBuffer( size * 3 * 4 );\n        var uvsBuffer = new ArrayBuffer( size * 2 * 4 );\n\n        this.attributes[ 'position' ] = { array: new Float32Array( verticesBuffer, 0, size * 3 ), itemSize: 3 };\n        this.attributes[ 'normal' ] = { array: new Float32Array( normalsBuffer, 0, size * 3 ), itemSize: 3 };\n        this.attributes[ 'uv' ] = { array: new Float32Array( uvsBuffer, 0, size * 2 ), itemSize: 2 };\n\n        this.vertices = new THREE.VectorArrayProxy( this.attributes[ 'position' ] );\n        this.normals = new THREE.VectorArrayProxy( this.attributes[ 'normal' ] );\n        this.uvs = new THREE.VectorArrayProxy( this.attributes[ 'uv' ] );\n\n};\nTHREE.Geometry4.prototype = Object.create( THREE.BufferGeometry.prototype );\n\nTHREE.VectorArrayProxy = function(attribute) {\n\n        // Acts as a proxy for an array of vectors, by setting up accessors which return THREE.Vector*Proxy objects\n\n        this.attribute = attribute;\n\n        for (var i = 0, l = this.attribute.array.length / this.attribute.itemSize; i < l; i++)  {\n\n                Object.defineProperty(this, i, {\n                        get: (function(i) { return function() { return this.getValue(i); }})(i),\n                        set: (function(i) { return function(v) { return this.setValue(i, v); }})(i),\n                });\n\n        }\n\n}\n\nTHREE.VectorArrayProxy.prototype.getValue = function(i) {\n\n        // Allocates a new THREE.Vector2Proxy or THREE.Vector3Proxy depending on the itemSize of our attribute\n\n        var subarray = this.attribute.array.subarray(i * this.attribute.itemSize, (i + 1) * this.attribute.itemSize);\n\n        switch (this.attribute.itemSize) {\n\n                case 2:\n                        return new THREE.Vector2Proxy(subarray);\n\n                case 3:\n                        return new THREE.Vector3Proxy(subarray);\n\n        }\n\n}\nTHREE.VectorArrayProxy.prototype.setValue = function(i, v) {\n\n        var vec = this[i];\n        vec.copy(v);\n\n}\n\n// Vector Proxy Objects\n\nTHREE.Vector2Proxy = function(subarray) {\n\n        this.subarray = subarray;\n\n}\nTHREE.Vector2Proxy.prototype = Object.create( THREE.Vector2.prototype );\nObject.defineProperty(THREE.Vector2Proxy.prototype, 'x', { get: function() { return this.subarray[0]; }, set: function(v) { this.subarray[0] = v; } });\nObject.defineProperty(THREE.Vector2Proxy.prototype, 'y', { get: function() { return this.subarray[1]; }, set: function(v) { this.subarray[1] = v; } });\n\n\nTHREE.Vector3Proxy = function(subarray) {\n\n        this.subarray = subarray;\n\n}\nTHREE.Vector3Proxy.prototype = Object.create( THREE.Vector3.prototype );\n\nObject.defineProperty(THREE.Vector3Proxy.prototype, 'x', { get: function() { return this.subarray[0]; }, set: function(v) { this.subarray[0] = v; } });\nObject.defineProperty(THREE.Vector3Proxy.prototype, 'y', { get: function() { return this.subarray[1]; }, set: function(v) { this.subarray[1] = v; } });\nObject.defineProperty(THREE.Vector3Proxy.prototype, 'z', { get: function() { return this.subarray[2]; }, set: function(v) { this.subarray[2] = v; } });"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneBufferGeometry.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneBufferGeometry.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as\n */\n\nTHREE.PlaneBufferGeometry = function ( width, height, widthSegments, heightSegments ) {\n\n\tTHREE.BufferGeometry.call( this );\n\n\tthis.parameters = {\n\t\twidth: width,\n\t\theight: height,\n\t\twidthSegments: widthSegments,\n\t\theightSegments: heightSegments\n\t};\n\n\tvar width_half = width / 2;\n\tvar height_half = height / 2;\n\n\tvar gridX = widthSegments || 1;\n\tvar gridY = heightSegments || 1;\n\n\tvar gridX1 = gridX + 1;\n\tvar gridY1 = gridY + 1;\n\n\tvar segment_width = width / gridX;\n\tvar segment_height = height / gridY;\n\n\tvar vertices = new Float32Array( gridX1 * gridY1 * 3 );\n\tvar normals = new Float32Array( gridX1 * gridY1 * 3 );\n\tvar uvs = new Float32Array( gridX1 * gridY1 * 2 );\n\n\tvar offset = 0;\n\tvar offset2 = 0;\n\n\tfor ( var iy = 0; iy < gridY1; iy ++ ) {\n\n\t\tvar y = iy * segment_height - height_half;\n\n\t\tfor ( var ix = 0; ix < gridX1; ix ++ ) {\n\n\t\t\tvar x = ix * segment_width - width_half;\n\n\t\t\tvertices[ offset     ] = x;\n\t\t\tvertices[ offset + 1 ] = - y;\n\n\t\t\tnormals[ offset + 2 ] = 1;\n\n\t\t\tuvs[ offset2     ] = ix / gridX;\n\t\t\tuvs[ offset2 + 1 ] = 1 - ( iy / gridY );\n\n\t\t\toffset += 3;\n\t\t\toffset2 += 2;\n\n\t\t}\n\n\t}\n\n\toffset = 0;\n\n\tvar indices = new Uint16Array( gridX * gridY * 6 );\n\n\tfor ( var iy = 0; iy < gridY; iy ++ ) {\n\n\t\tfor ( var ix = 0; ix < gridX; ix ++ ) {\n\n\t\t\tvar a = ix + gridX1 * iy;\n\t\t\tvar b = ix + gridX1 * ( iy + 1 );\n\t\t\tvar c = ( ix + 1 ) + gridX1 * ( iy + 1 );\n\t\t\tvar d = ( ix + 1 ) + gridX1 * iy;\n\n\t\t\tindices[ offset     ] = a;\n\t\t\tindices[ offset + 1 ] = b;\n\t\t\tindices[ offset + 2 ] = d;\n\n\t\t\tindices[ offset + 3 ] = b;\n\t\t\tindices[ offset + 4 ] = c;\n\t\t\tindices[ offset + 5 ] = d;\n\n\t\t\toffset += 6;\n\n\t\t}\n\n\t}\n\n\tthis.attributes[ 'index' ] = { array: indices, itemSize: 1 };\n\tthis.attributes[ 'position' ] = { array: vertices, itemSize: 3 };\n\tthis.attributes[ 'normal' ] = { array: normals, itemSize: 3 };\n\tthis.attributes[ 'uv' ] = { array: uvs, itemSize: 2 };\n\n};\n\nTHREE.PlaneBufferGeometry.prototype = Object.create( THREE.BufferGeometry.prototype );\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneGeometry3.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneGeometry3.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as\n */\n\nTHREE.PlaneGeometry3 = function ( width, height, widthSegments, heightSegments ) {\n\n\tTHREE.Geometry3.call( this, ( widthSegments * heightSegments ) * 2 * 3 );\n\n\tvar vertices = this.vertices;\n\tvar normals = this.normals;\n\tvar uvs = this.uvs;\n\n\tthis.width = width;\n\tthis.height = height;\n\n\tthis.widthSegments = widthSegments || 1;\n\tthis.heightSegments = heightSegments || 1;\n\n\tvar widthHalf = width / 2;\n\tvar heightHalf = height / 2;\n\n\tvar gridX = this.widthSegments;\n\tvar gridY = this.heightSegments;\n\n\tvar segmentWidth = this.width / gridX;\n\tvar segmentHeight = this.height / gridY;\n\n\tvar offset = 0;\n\n\tfor ( var iy = 0; iy < gridY; iy ++ ) {\n\n\t\tvar y1 = iy * segmentHeight - heightHalf;\n\t\tvar y2 = ( iy + 1 ) * segmentHeight - heightHalf;\n\n\t\tfor ( var ix = 0; ix < gridX; ix ++ ) {\n\n\t\t\tvar x1 = ix * segmentWidth - widthHalf;\n\t\t\tvar x2 = ( ix + 1 ) * segmentWidth - widthHalf;\n\n\t\t\tvertices[ offset + 0 ][ 0 ] = x1;\n\t\t\tvertices[ offset + 0 ][ 1 ] = y1;\n\n\t\t\tvertices[ offset + 1 ][ 0 ] = x2;\n\t\t\tvertices[ offset + 1 ][ 1 ] = y1;\n\n\t\t\tvertices[ offset + 2 ][ 0 ] = x1;\n\t\t\tvertices[ offset + 2 ][ 1 ] = y2;\n\n\t\t\tnormals[ offset + 0 ][ 2 ] = 1;\n\t\t\tnormals[ offset + 1 ][ 2 ] = 1;\n\t\t\tnormals[ offset + 2 ][ 2 ] = 1;\n\n\t\t\tvertices[ offset + 3 ][ 0 ] = x2;\n\t\t\tvertices[ offset + 3 ][ 1 ] = y1;\n\n\t\t\tvertices[ offset + 4 ][ 0 ] = x2;\n\t\t\tvertices[ offset + 4 ][ 1 ] = y2;\n\n\t\t\tvertices[ offset + 5 ][ 0 ] = x1;\n\t\t\tvertices[ offset + 5 ][ 1 ] = y2;\n\n\t\t\tnormals[ offset + 3 ][ 2 ] = 1;\n\t\t\tnormals[ offset + 4 ][ 2 ] = 1;\n\t\t\tnormals[ offset + 5 ][ 2 ] = 1;\n\n\t\t\toffset += 6;\n\n\t\t}\n\n\t}\n\n};\n\nTHREE.PlaneGeometry3.prototype = Object.create( THREE.Geometry3.prototype );\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/Geometry2Loader.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/Geometry2Loader.js",
            "module-type": "library",
            "text": "/**\r\n * @author mrdoob / http://mrdoob.com/\r\n */\r\n\r\nTHREE.Geometry2Loader = function ( manager ) {\r\n\r\n\tthis.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;\r\n\r\n};\r\n\r\nTHREE.Geometry2Loader.prototype = {\r\n\r\n\tconstructor: THREE.Geometry2Loader,\r\n\r\n\tload: function ( url, onLoad, onProgress, onError ) {\r\n\r\n\t\tvar scope = this;\r\n\r\n\t\tvar loader = new THREE.XHRLoader();\r\n\t\tloader.setCrossOrigin( this.crossOrigin );\r\n\t\tloader.load( url, function ( text ) {\r\n\r\n\t\t\tonLoad( scope.parse( JSON.parse( text ) ) );\r\n\r\n\t\t} );\r\n\r\n\t},\r\n\r\n\tsetCrossOrigin: function ( value ) {\r\n\r\n\t\tthis.crossOrigin = value;\r\n\r\n\t},\r\n\r\n\tparse: function ( json ) {\r\n\r\n\t\tvar geometry = new THREE.Geometry2( json.vertices.length / 3 );\r\n\r\n\t\tvar attributes = [ 'vertices', 'normals', 'uvs' ];\r\n\t\tvar boundingSphere = json.boundingSphere;\r\n\r\n\t\tfor ( var key in attributes ) {\r\n\r\n\t\t\tvar attribute = attributes[ key ];\r\n\t\t\tgeometry[ attribute ].set( json[ attribute ] );\r\n\r\n\t\t}\r\n\r\n\t\tif ( boundingSphere !== undefined ) {\r\n\r\n\t\t\tgeometry.boundingSphere = new THREE.Sphere(\r\n\t\t\t\tnew THREE.Vector3().fromArray( boundingSphere.center !== undefined ? boundingSphere.center : [ 0, 0, 0 ] ),\r\n\t\t\t\tboundingSphere.radius\r\n\t\t\t);\r\n\r\n\t\t}\r\n\r\n\t\treturn geometry;\r\n\r\n\t}\r\n\r\n};\r\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/IndexedGeometry5.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/IndexedGeometry5.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.IndexedGeometry5 = function ( indices, size ) {\n\n\tTHREE.BufferGeometry.call( this );\n\n\tvar verticesBuffer = new Float32Array( size * 3 );\n\tvar normalsBuffer = new Float32Array( size * 3 );\n\tvar uvsBuffer = new Float32Array( size * 2 );\n\n\tthis.indices = new Uint16Array( indices );\n\tthis.vertices = [];\n\tthis.normals = [];\n\tthis.uvs = [];\n\n\tfor ( var i = 0; i < size; i ++ ) {\n\n\t\tthis.vertices.push( new THREE.TypedVector3( verticesBuffer, i * 3 ) );\n\t\tthis.normals.push( new THREE.TypedVector3( normalsBuffer, i * 3 ) );\n\t\tthis.uvs.push( new THREE.TypedVector2( uvsBuffer, i * 2 ) );\n\n\t}\n\n\tthis.attributes[ 'index' ] = { array: this.indices, itemSize: 1 };\n\tthis.attributes[ 'position' ] = { array: verticesBuffer, itemSize: 3 };\n\tthis.attributes[ 'normal' ] = { array: normalsBuffer, itemSize: 3 };\n\tthis.attributes[ 'uv' ] = { array: uvsBuffer, itemSize: 2 };\n\n};\n\nTHREE.IndexedGeometry5.prototype = Object.create( THREE.BufferGeometry.prototype );\n\nTHREE.TypedVector2 = function ( array, offset ) {\n\n\tthis.array = array;\n\tthis.offset = offset;\n\t\n};\n\nTHREE.TypedVector2.prototype = Object.create( THREE.Vector2.prototype );\n\nObject.defineProperties( THREE.TypedVector2.prototype, {\n\t'x': {\n\t\tget: function () { return this.array[ this.offset ]; },\n\t\tset: function ( v ) { this.array[ this.offset ] = v; }\n\t},\n\t'y': {\n\t\tget: function () { return this.array[ this.offset + 1 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 1 ] = v; }\n\t}\n} );\n\nTHREE.TypedVector3 = function ( array, offset ) {\n\t\n\tthis.array = array;\n\tthis.offset = offset;\n\n};\n\nTHREE.TypedVector3.prototype = Object.create( THREE.Vector3.prototype );\n\nObject.defineProperties( THREE.TypedVector3.prototype, {\n\t'x': {\n\t\tget: function () { return this.array[ this.offset ]; },\n\t\tset: function ( v ) { this.array[ this.offset ] = v; }\n\t},\n\t'y': {\n\t\tget: function () { return this.array[ this.offset + 1 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 1 ] = v; }\n\t},\n\t'z': {\n\t\tget: function () { return this.array[ this.offset + 2 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 2 ] = v; }\n\t}\n} );"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/Geometry2.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/Geometry2.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.Geometry2 = function ( size ) {\n\n\tTHREE.BufferGeometry.call( this );\n\n\tthis.vertices = new THREE.Float32Attribute( size, 3 );\n\tthis.normals = new THREE.Float32Attribute( size, 3 );\n\tthis.uvs = new THREE.Float32Attribute( size, 2 );\n\n\tthis.addAttribute( 'position', this.vertices );\n\tthis.addAttribute( 'normal', this.normals );\n\tthis.addAttribute( 'uv', this.uvs );\n\n};\n\nTHREE.Geometry2.prototype = Object.create( THREE.BufferGeometry.prototype );"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneGeometry6.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneGeometry6.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.PlaneGeometry6 = function ( width, height, widthSegments, heightSegments ) {\n\n\tTHREE.PlaneBufferGeometry.call( this, width, height, widthSegments, heightSegments );\n\n\tvar indices = this.attributes.index.array;\n\tvar vertices = this.attributes.position.array;\n\tvar normals = this.attributes.normal.array;\n\tvar uvs = this.attributes.uv.array;\n\n\tthis.indices = indices;\n\tthis.vertices = [];\n\tthis.normals = [];\n\tthis.uvs = [];\n\n\tfor ( var i = 0, l = vertices.length / 3; i < l; i ++ ) {\n\n\t\tthis.vertices.push( new THREE.TypedVector3( vertices, i * 3 ) );\n\t\tthis.normals.push( new THREE.TypedVector3( normals, i * 3 ) );\n\t\tthis.uvs.push( new THREE.TypedVector2( uvs, i * 2 ) );\n\n\t}\n\n};\n\nTHREE.PlaneGeometry6.prototype = Object.create( THREE.PlaneBufferGeometry.prototype );"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneGeometry2.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneGeometry2.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as\n */\n\nTHREE.PlaneGeometry2 = function ( width, height, widthSegments, heightSegments ) {\n\n\tTHREE.Geometry2.call( this, ( widthSegments * heightSegments ) * 2 * 3 );\n\n\tvar vertices = this.vertices.array;\n\tvar normals = this.normals.array;\n\tvar uvs = this.uvs.array;\n\n\tthis.width = width;\n\tthis.height = height;\n\n\tthis.widthSegments = widthSegments || 1;\n\tthis.heightSegments = heightSegments || 1;\n\n\tvar widthHalf = width / 2;\n\tvar heightHalf = height / 2;\n\n\tvar gridX = this.widthSegments;\n\tvar gridY = this.heightSegments;\n\n\tvar segmentWidth = this.width / gridX;\n\tvar segmentHeight = this.height / gridY;\n\n\tvar offset = 0;\n\n\tfor ( var iy = 0; iy < gridY; iy ++ ) {\n\n\t\tvar y1 = iy * segmentHeight - heightHalf;\n\t\tvar y2 = ( iy + 1 ) * segmentHeight - heightHalf;\n\n\t\tfor ( var ix = 0; ix < gridX; ix ++ ) {\n\n\t\t\tvar x1 = ix * segmentWidth - widthHalf;\n\t\t\tvar x2 = ( ix + 1 ) * segmentWidth - widthHalf;\n\n\t\t\tvertices[ offset + 0 ] = x1;\n\t\t\tvertices[ offset + 1 ] = y1;\n\n\t\t\tvertices[ offset + 3 ] = x2;\n\t\t\tvertices[ offset + 4 ] = y1;\n\n\t\t\tvertices[ offset + 6 ] = x1;\n\t\t\tvertices[ offset + 7 ] = y2;\n\n\t\t\tnormals[ offset + 2 ] = 1;\n\t\t\tnormals[ offset + 5 ] = 1;\n\t\t\tnormals[ offset + 8 ] = 1;\n\n\t\t\tvertices[ offset + 9 ] = x2;\n\t\t\tvertices[ offset + 10 ] = y1;\n\n\t\t\tvertices[ offset + 12 ] = x2;\n\t\t\tvertices[ offset + 13 ] = y2;\n\n\t\t\tvertices[ offset + 15 ] = x1;\n\t\t\tvertices[ offset + 16 ] = y2;\n\n\t\t\tnormals[ offset + 11 ] = 1;\n\t\t\tnormals[ offset + 13 ] = 1;\n\t\t\tnormals[ offset + 17 ] = 1;\n\n\t\t\toffset += 18;\n\n\t\t}\n\n\t}\n\n};\n\nTHREE.PlaneGeometry2.prototype = Object.create( THREE.Geometry2.prototype );\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/Geometry5b.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/Geometry5b.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.Geometry5b = function ( bufferGeometry ) {\n\n\tTHREE.BufferGeometry.call( this );\n\n\tthis.attributes = bufferGeometry.attributes;\n\n\tvar verticesBuffer = this.attributes.position.array;\n\tvar normalsBuffer = this.attributes.normal.array;\n\tvar uvsBuffer = this.attributes.uv.array;\n\n\tthis.vertices = [];\n\tthis.normals = [];\n\tthis.uvs = [];\n\n\tfor ( var i = 0, l = verticesBuffer.length / 3; i < l; i ++ ) {\n\n\t\tthis.vertices.push( new THREE.TypedVector3( verticesBuffer, i * 3 ) );\n\t\tthis.normals.push( new THREE.TypedVector3( normalsBuffer, i * 3 ) );\n\t\tthis.uvs.push( new THREE.TypedVector2( uvsBuffer, i * 2 ) );\n\n\t}\n\n};\n\nTHREE.Geometry5b.prototype = Object.create( THREE.BufferGeometry.prototype );\n\nTHREE.TypedVector2 = function ( array, offset ) {\n\n\tthis.array = array;\n\tthis.offset = offset;\n\t\n};\n\nTHREE.TypedVector2.prototype = Object.create( THREE.Vector2.prototype );\n\nObject.defineProperties( THREE.TypedVector2.prototype, {\n\t'x': {\n\t\tget: function () { return this.array[ this.offset ]; },\n\t\tset: function ( v ) { this.array[ this.offset ] = v; }\n\t},\n\t'y': {\n\t\tget: function () { return this.array[ this.offset + 1 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 1 ] = v; }\n\t}\n} );\n\nTHREE.TypedVector3 = function ( array, offset ) {\n\t\n\tthis.array = array;\n\tthis.offset = offset;\n\n};\n\nTHREE.TypedVector3.prototype = Object.create( THREE.Vector3.prototype );\n\nObject.defineProperties( THREE.TypedVector3.prototype, {\n\t'x': {\n\t\tget: function () { return this.array[ this.offset ]; },\n\t\tset: function ( v ) { this.array[ this.offset ] = v; }\n\t},\n\t'y': {\n\t\tget: function () { return this.array[ this.offset + 1 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 1 ] = v; }\n\t},\n\t'z': {\n\t\tget: function () { return this.array[ this.offset + 2 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 2 ] = v; }\n\t}\n} );"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/IndexedGeometry3.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/IndexedGeometry3.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.IndexedGeometry3 = function ( indices, size ) {\n\n\tTHREE.BufferGeometry.call( this );\n\n\tvar verticesBuffer = new ArrayBuffer( size * 3 * 4 );\n\tvar normalsBuffer = new ArrayBuffer( size * 3 * 4 );\n\tvar uvsBuffer = new ArrayBuffer( size * 2 * 4 );\n\n\tthis.indices = new Uint16Array( indices );\n\tthis.vertices = [];\n\tthis.normals = [];\n\tthis.uvs = [];\n\n\tfor ( var i = 0; i < size; i ++ ) {\n\n\t\tthis.vertices.push( new Float32Array( verticesBuffer, i * 3 * 4, 3 ) );\n\t\tthis.normals.push( new Float32Array( normalsBuffer, i * 3 * 4, 3 ) );\n\t\tthis.uvs.push( new Float32Array( uvsBuffer, i * 2 * 4, 2 ) );\n\n\t}\n\n\tthis.attributes[ 'index' ] = { array: this.indices, itemSize: 1 };\n\tthis.attributes[ 'position' ] = { array: new Float32Array( verticesBuffer, 0, size * 3 ), itemSize: 3 };\n\tthis.attributes[ 'normal' ] = { array: new Float32Array( normalsBuffer, 0, size * 3 ), itemSize: 3 };\n\tthis.attributes[ 'uv' ] = { array: new Float32Array( uvsBuffer, 0, size * 2 ), itemSize: 2 };\n\n};\n\nTHREE.Geometry3.prototype = Object.create( THREE.BufferGeometry.prototype );"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneGeometry2b.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneGeometry2b.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as\n */\n\nTHREE.PlaneGeometry2b = function ( width, height, widthSegments, heightSegments ) {\n\n\tTHREE.Geometry2.call( this, ( widthSegments * heightSegments ) * 2 * 3 );\n\n\tvar vertices = this.vertices;\n\tvar normals = this.normals;\n\tvar uvs = this.uvs;\n\n\tthis.width = width;\n\tthis.height = height;\n\n\tthis.widthSegments = widthSegments || 1;\n\tthis.heightSegments = heightSegments || 1;\n\n\tvar widthHalf = width / 2;\n\tvar heightHalf = height / 2;\n\n\tvar gridX = this.widthSegments;\n\tvar gridY = this.heightSegments;\n\n\tvar segmentWidth = this.width / gridX;\n\tvar segmentHeight = this.height / gridY;\n\n\tvar index = 0;\n\n\tfor ( var iy = 0; iy < gridY; iy ++ ) {\n\n\t\tvar y1 = iy * segmentHeight - heightHalf;\n\t\tvar y2 = ( iy + 1 ) * segmentHeight - heightHalf;\n\n\t\tfor ( var ix = 0; ix < gridX; ix ++ ) {\n\n\t\t\tvar x1 = ix * segmentWidth - widthHalf;\n\t\t\tvar x2 = ( ix + 1 ) * segmentWidth - widthHalf;\n\n\t\t\tthis.vertices.setXY( index + 0,  x1, y1 );\n\t\t\tthis.vertices.setXY( index + 1,  x2, y1 );\n\t\t\tthis.vertices.setXY( index + 2,  x1, y2 );\n\n\t\t\tthis.vertices.setXY( index + 3, x2, y1 );\n\t\t\tthis.vertices.setXY( index + 4, x2, y2 );\n\t\t\tthis.vertices.setXY( index + 5, x1, y2 );\n\n\t\t\tthis.normals.setZ( index + 0, 1 );\n\t\t\tthis.normals.setZ( index + 1, 1 );\n\t\t\tthis.normals.setZ( index + 2, 1 );\n\n\t\t\tthis.normals.setZ( index + 3, 1 );\n\t\t\tthis.normals.setZ( index + 4, 1 );\n\t\t\tthis.normals.setZ( index + 5, 1 );\n\n\t\t\tindex += 6;\n\n\t\t}\n\n\t}\n\n};\n\nTHREE.PlaneGeometry2b.prototype = Object.create( THREE.Geometry2.prototype );\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/BoxGeometry2.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/BoxGeometry2.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Cube.as\n */\n\nTHREE.BoxGeometry2 = function ( width, height, depth, widthSegments, heightSegments, depthSegments ) {\n\n\tvar scope = this;\n\n\tthis.width = width;\n\tthis.height = height;\n\tthis.depth = depth;\n\n\tthis.widthSegments = widthSegments || 1;\n\tthis.heightSegments = heightSegments || 1;\n\tthis.depthSegments = depthSegments || 1;\n\n\tvar width_half = this.width / 2;\n\tvar height_half = this.height / 2;\n\tvar depth_half = this.depth / 2;\n\n\tvar vector = new THREE.Vector3();\n\n\tvar vectors = [];\n\tvar vertices = [];\n\n\tvar addVertex = function ( a, b, c ) {\n\n\t\tvertices.push( vectors[ a ], vectors[ a + 1 ], vectors[ a + 2 ] );\n\t\tvertices.push( vectors[ b ], vectors[ b + 1 ], vectors[ b + 2 ] );\n\t\tvertices.push( vectors[ c ], vectors[ c + 1 ], vectors[ c + 2 ] );\n\n\t};\n\n\tbuildPlane( 'z', 'y', - 1, - 1, this.depth, this.height, width_half, 0 ); // px\n\tbuildPlane( 'z', 'y',   1, - 1, this.depth, this.height, - width_half, 1 ); // nx\n\tbuildPlane( 'x', 'z',   1,   1, this.width, this.depth, height_half, 2 ); // py\n\tbuildPlane( 'x', 'z',   1, - 1, this.width, this.depth, - height_half, 3 ); // ny\n\tbuildPlane( 'x', 'y',   1, - 1, this.width, this.height, depth_half, 4 ); // pz\n\tbuildPlane( 'x', 'y', - 1, - 1, this.width, this.height, - depth_half, 5 ); // nz\n\n\tfunction buildPlane( u, v, udir, vdir, width, height, depth, materialIndex ) {\n\n\t\tvar w, ix, iy,\n\t\tgridX = scope.widthSegments,\n\t\tgridY = scope.heightSegments,\n\t\twidth_half = width / 2,\n\t\theight_half = height / 2,\n\t\toffset = vectors.length;\n\n\t\tif ( ( u === 'x' && v === 'y' ) || ( u === 'y' && v === 'x' ) ) {\n\n\t\t\tw = 'z';\n\n\t\t} else if ( ( u === 'x' && v === 'z' ) || ( u === 'z' && v === 'x' ) ) {\n\n\t\t\tw = 'y';\n\t\t\tgridY = scope.depthSegments;\n\n\t\t} else if ( ( u === 'z' && v === 'y' ) || ( u === 'y' && v === 'z' ) ) {\n\n\t\t\tw = 'x';\n\t\t\tgridX = scope.depthSegments;\n\n\t\t}\n\n\t\tvar gridX1 = gridX + 1,\n\t\tgridY1 = gridY + 1,\n\t\tsegment_width = width / gridX,\n\t\tsegment_height = height / gridY,\n\t\tnormal = new THREE.Vector3();\n\n\t\tnormal[ w ] = depth > 0 ? 1 : - 1;\n\n\t\tfor ( iy = 0; iy < gridY1; iy ++ ) {\n\n\t\t\tfor ( ix = 0; ix < gridX1; ix ++ ) {\n\n\t\t\t\tvector[ u ] = ( ix * segment_width - width_half ) * udir;\n\t\t\t\tvector[ v ] = ( iy * segment_height - height_half ) * vdir;\n\t\t\t\tvector[ w ] = depth;\n\n\t\t\t\tvectors.push( vector.x, vector.y, vector.z );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfor ( iy = 0; iy < gridY; iy++ ) {\n\n\t\t\tfor ( ix = 0; ix < gridX; ix++ ) {\n\n\t\t\t\tvar a = ix + gridX1 * iy;\n\t\t\t\tvar b = ix + gridX1 * ( iy + 1 );\n\t\t\t\tvar c = ( ix + 1 ) + gridX1 * ( iy + 1 );\n\t\t\t\tvar d = ( ix + 1 ) + gridX1 * iy;\n\n\t\t\t\taddVertex( a * 3 + offset, b * 3 + offset, d * 3 + offset );\n\t\t\t\taddVertex( b * 3 + offset, c * 3 + offset, d * 3 + offset );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tTHREE.Geometry2.call( this, vertices.length / 3 );\n\n\tthis.vertices.set( vertices );\n\n};\n\nTHREE.BoxGeometry2.prototype = Object.create( THREE.Geometry2.prototype );\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneGeometry99.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneGeometry99.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.PlaneGeometry99 = function ( width, height, widthSegments, heightSegments ) {\n\n\tTHREE.Geometry99.call( this );\n\n\tthis.parameters = {\n\t\twidth: width,\n\t\theight: height,\n\t\twidthSegments: widthSegments,\n\t\theightSegments: heightSegments\n\t};\n\n\tvar width_half = width / 2;\n\tvar height_half = height / 2;\n\n\tvar gridX = widthSegments || 1;\n\tvar gridY = heightSegments || 1;\n\n\tvar gridX1 = gridX + 1;\n\tvar gridY1 = gridY + 1;\n\n\tvar segment_width = width / gridX;\n\tvar segment_height = height / gridY;\n\n\tvar vertices = new Float32Array( gridX1 * gridY1 * 3 );\n\tvar normals = new Float32Array( gridX1 * gridY1 * 3 );\n\tvar uvs = new Float32Array( gridX1 * gridY1 * 2 );\n\n\tvar offset = 0;\n\tvar offset2 = 0;\n\n\tfor ( var iy = 0; iy < gridY1; iy ++ ) {\n\n\t\tvar y = iy * segment_height - height_half;\n\n\t\tfor ( var ix = 0; ix < gridX1; ix ++ ) {\n\n\t\t\tvar x = ix * segment_width - width_half;\n\n\t\t\tvertices[ offset     ] = x;\n\t\t\tvertices[ offset + 1 ] = - y;\n\n\t\t\tnormals[ offset + 2 ] = 1;\n\n\t\t\tuvs[ offset2     ] = ix / gridX;\n\t\t\tuvs[ offset2 + 1 ] = 1 - ( iy / gridY );\n\n\t\t\toffset += 3;\n\t\t\toffset2 += 2;\n\n\t\t}\n\n\t}\n\n\toffset = 0;\n\n\tvar indices = new Uint16Array( gridX * gridY * 6 );\n\n\tfor ( var iy = 0; iy < gridY; iy ++ ) {\n\n\t\tfor ( var ix = 0; ix < gridX; ix ++ ) {\n\n\t\t\tvar a = ix + gridX1 * iy;\n\t\t\tvar b = ix + gridX1 * ( iy + 1 );\n\t\t\tvar c = ( ix + 1 ) + gridX1 * ( iy + 1 );\n\t\t\tvar d = ( ix + 1 ) + gridX1 * iy;\n\n\t\t\tindices[ offset     ] = a;\n\t\t\tindices[ offset + 1 ] = b;\n\t\t\tindices[ offset + 2 ] = d;\n\n\t\t\tindices[ offset + 3 ] = b;\n\t\t\tindices[ offset + 4 ] = c;\n\t\t\tindices[ offset + 5 ] = d;\n\n\t\t\toffset += 6;\n\n\t\t}\n\n\t}\n\n\tthis.attributes[ 'index' ] = { array: indices, itemSize: 1 };\n\tthis.attributes[ 'position' ] = { array: vertices, itemSize: 3 };\n\tthis.attributes[ 'normal' ] = { array: normals, itemSize: 3 };\n\tthis.attributes[ 'uv' ] = { array: uvs, itemSize: 2 };\n\n};\n\nTHREE.PlaneGeometry99.prototype = Object.create( THREE.Geometry99.prototype );"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/TypedGeometry.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/TypedGeometry.js",
            "module-type": "library",
            "text": "THREE.TypedVector2 = function ( array, offset ) {\n\n\tthis.array = array;\n\tthis.offset = offset * 2;\n\n};\n\nTHREE.TypedVector2.prototype = {\n\n\tconstructor: THREE.TypedVector3,\n\n\tget x () {\n\n\t\treturn this.array[ this.offset ];\n\n\t},\n\n\tset x ( value ) {\n\n\t\tthis.array[ this.offset ] = value;\n\n\t},\n\n\tget y () {\n\n\t\treturn this.array[ this.offset + 1 ];\n\n\t},\n\n\tset y ( value ) {\n\n\t\tthis.array[ this.offset + 1 ] = value;\n\n\t},\n\n\tset: function ( x, y ) {\n\n\t\tthis.array[ this.offset ] = x;\n\t\tthis.array[ this.offset + 1 ] = y;\n\t\treturn this;\n\n\t}\n\n};\n\nTHREE.TypedVector3 = function ( array, offset ) {\n\n\tthis.array = array;\n\tthis.offset = offset * 3;\n\n};\n\nTHREE.TypedVector3.prototype = {\n\n\tconstructor: THREE.TypedVector3,\n\n\tget x () {\n\n\t\treturn this.array[ this.offset ];\n\n\t},\n\n\tset x ( value ) {\n\n\t\tthis.array[ this.offset ] = value;\n\n\t},\n\n\tget y () {\n\n\t\treturn this.array[ this.offset + 1 ];\n\n\t},\n\n\tset y ( value ) {\n\n\t\tthis.array[ this.offset + 1 ] = value;\n\n\t},\n\n\tget z () {\n\n\t\treturn this.array[ this.offset + 2 ];\n\n\t},\n\n\tset z ( value ) {\n\n\t\tthis.array[ this.offset + 2 ] = value;\n\n\t},\n\n\tset: function ( x, y, z ) {\n\n\t\tthis.array[ this.offset ] = x;\n\t\tthis.array[ this.offset + 1 ] = y;\n\t\tthis.array[ this.offset + 2 ] = z;\n\t\treturn this;\n\n\t},\n\n\ttoString: function () {\n\n\t\treturn '[' + this.array[ this.offset ] + ',' + this.array[ this.offset + 1 ] + ',' + this.array[ this.offset + 2 ] + ']';\n\n\t}\n\n};\n\nTHREE.TypedFace = function ( positions, normals, uvs, offset ) {\n\n\tthis.positions = positions;\n\tthis.normals = normals;\n\tthis.uvs = uvs;\n\tthis.offset = offset * 3;\n\n};\n\nTHREE.TypedFace.prototype = {\n\n\tconstructor: THREE.TypedFace,\n\n\tvertex: function ( index ) {\n\n\t\treturn new THREE.TypedVector3( this.positions, this.offset + index );\n\n\t},\n\n\tnormal: function ( index ) {\n\n\t\treturn new THREE.TypedVector3( this.normals, this.offset + index );\n\n\t},\n\n\tuv: function ( index ) {\n\n\t\treturn new THREE.TypedVector2( this.uvs, this.offset + index );\n\n\t}\n\n}\n\n\nTHREE.TypedGeometry = function ( size ) {\n\n\tthis.id = THREE.GeometryIdCount ++;\n\tthis.uuid = THREE.Math.generateUUID();\n\n\tthis.name = '';\n\n\tthis.positions = new Float32Array( size * 3 * 3 );\n\tthis.normals = new Float32Array( size * 3 * 3 );\n\tthis.uvs = new Float32Array( size * 3 * 2 );\n\n\tthis.boundingBox = null;\n\tthis.boundingSphere = null;\n\n};\n\nTHREE.TypedGeometry.prototype = {\n\n\tconstructor: THREE.TypedGeometry,\n\n\tface: function ( index ) {\n\n\t\treturn new THREE.TypedFace( this.positions, this.normals, this.uvs, index );\n\n\t},\n\n\tdispose: function () {\n\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t}\n\n};\n\nTHREE.EventDispatcher.prototype.apply( THREE.TypedGeometry.prototype );\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/Geometry3.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/Geometry3.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.Geometry3 = function ( size ) {\n\n\tTHREE.BufferGeometry.call( this );\n\n\tvar verticesBuffer = new ArrayBuffer( size * 3 * 4 );\n\tvar normalsBuffer = new ArrayBuffer( size * 3 * 4 );\n\tvar uvsBuffer = new ArrayBuffer( size * 2 * 4 );\n\n\tthis.vertices = [];\n\tthis.normals = [];\n\tthis.uvs = [];\n\n\tfor ( var i = 0; i < size; i ++ ) {\n\n\t\tthis.vertices.push( new Float32Array( verticesBuffer, i * 3 * 4, 3 ) );\n\t\tthis.normals.push( new Float32Array( normalsBuffer, i * 3 * 4, 3 ) );\n\t\tthis.uvs.push( new Float32Array( uvsBuffer, i * 2 * 4, 2 ) );\n\n\t}\n\n\tthis.attributes[ 'position' ] = { array: new Float32Array( verticesBuffer, 0, size * 3 ), itemSize: 3 };\n\tthis.attributes[ 'normal' ] = { array: new Float32Array( normalsBuffer, 0, size * 3 ), itemSize: 3 };\n\tthis.attributes[ 'uv' ] = { array: new Float32Array( uvsBuffer, 0, size * 2 ), itemSize: 2 };\n\n};\n\nTHREE.Geometry3.prototype = Object.create( THREE.BufferGeometry.prototype );"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneGeometry5.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneGeometry5.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as\n */\n\nTHREE.PlaneGeometry5 = function ( width, height, widthSegments, heightSegments ) {\n\n\tTHREE.Geometry5.call( this, ( widthSegments * heightSegments ) * 2 * 3 );\n\n\tvar vertices = this.vertices;\n\tvar normals = this.normals;\n\tvar uvs = this.uvs;\n\n\tthis.width = width;\n\tthis.height = height;\n\n\tthis.widthSegments = widthSegments || 1;\n\tthis.heightSegments = heightSegments || 1;\n\n\tvar widthHalf = width / 2;\n\tvar heightHalf = height / 2;\n\n\tvar gridX = this.widthSegments;\n\tvar gridY = this.heightSegments;\n\n\tvar segmentWidth = this.width / gridX;\n\tvar segmentHeight = this.height / gridY;\n\n\tvar offset = 0;\n\n\tfor ( var iy = 0; iy < gridY; iy ++ ) {\n\n\t\tvar y1 = iy * segmentHeight - heightHalf;\n\t\tvar y2 = ( iy + 1 ) * segmentHeight - heightHalf;\n\n\t\tfor ( var ix = 0; ix < gridX; ix ++ ) {\n\n\t\t\tvar x1 = ix * segmentWidth - widthHalf;\n\t\t\tvar x2 = ( ix + 1 ) * segmentWidth - widthHalf;\n\n\t\t\tvertices[ offset + 0 ].set( x1, y1, 0 );\n\t\t\tvertices[ offset + 1 ].set( x2, y1, 0 );\n\t\t\tvertices[ offset + 2 ].set( x1, y2, 0 );\n\n\t\t\tnormals[ offset + 0 ].z = 1;\n\t\t\tnormals[ offset + 1 ].z = 1;\n\t\t\tnormals[ offset + 2 ].z = 1;\n\n\t\t\tvertices[ offset + 3 ].set( x2, y1, 0 );\n\t\t\tvertices[ offset + 4 ].set( x2, y2, 0 );\n\t\t\tvertices[ offset + 5 ].set( x1, y2, 0 );\n\n\t\t\tnormals[ offset + 3 ].z = 1;\n\t\t\tnormals[ offset + 4 ].z = 1;\n\t\t\tnormals[ offset + 5 ].z = 1;\n\n\t\t\toffset += 6;\n\n\t\t}\n\n\t}\n\n};\n\nTHREE.PlaneGeometry5.prototype = Object.create( THREE.Geometry5.prototype );\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneGeometry.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneGeometry.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as\n */\n\nTHREE.PlaneGeometry = function ( width, height, widthSegments, heightSegments ) {\n\n\tTHREE.Geometry.call( this );\n\n\tthis.width = width;\n\tthis.height = height;\n\n\tthis.widthSegments = widthSegments || 1;\n\tthis.heightSegments = heightSegments || 1;\n\n\tvar ix, iz;\n\tvar width_half = width / 2;\n\tvar height_half = height / 2;\n\n\tvar gridX = this.widthSegments;\n\tvar gridZ = this.heightSegments;\n\n\tvar gridX1 = gridX + 1;\n\tvar gridZ1 = gridZ + 1;\n\n\tvar segment_width = this.width / gridX;\n\tvar segment_height = this.height / gridZ;\n\n\tvar normal = new THREE.Vector3( 0, 0, 1 );\n\n\tfor ( iz = 0; iz < gridZ1; iz ++ ) {\n\n\t\tfor ( ix = 0; ix < gridX1; ix ++ ) {\n\n\t\t\tvar x = ix * segment_width - width_half;\n\t\t\tvar y = iz * segment_height - height_half;\n\n\t\t\tthis.vertices.push( new THREE.Vector3( x, - y, 0 ) );\n\n\t\t}\n\n\t}\n\n\tfor ( iz = 0; iz < gridZ; iz ++ ) {\n\n\t\tfor ( ix = 0; ix < gridX; ix ++ ) {\n\n\t\t\tvar a = ix + gridX1 * iz;\n\t\t\tvar b = ix + gridX1 * ( iz + 1 );\n\t\t\tvar c = ( ix + 1 ) + gridX1 * ( iz + 1 );\n\t\t\tvar d = ( ix + 1 ) + gridX1 * iz;\n\n\t\t\tvar uva = new THREE.Vector2( ix / gridX, 1 - iz / gridZ );\n\t\t\tvar uvb = new THREE.Vector2( ix / gridX, 1 - ( iz + 1 ) / gridZ );\n\t\t\tvar uvc = new THREE.Vector2( ( ix + 1 ) / gridX, 1 - ( iz + 1 ) / gridZ );\n\t\t\tvar uvd = new THREE.Vector2( ( ix + 1 ) / gridX, 1 - iz / gridZ );\n\n\t\t\tvar face = new THREE.Face3( a, b, d );\n\t\t\tface.normal.copy( normal );\n\t\t\tface.vertexNormals.push( normal.clone(), normal.clone(), normal.clone() );\n\n\t\t\tthis.faces.push( face );\n\t\t\tthis.faceVertexUvs[ 0 ].push( [ uva, uvb, uvd ] );\n\n\t\t\tface = new THREE.Face3( b, c, d );\n\t\t\tface.normal.copy( normal );\n\t\t\tface.vertexNormals.push( normal.clone(), normal.clone(), normal.clone() );\n\n\t\t\tthis.faces.push( face );\n\t\t\tthis.faceVertexUvs[ 0 ].push( [ uvb.clone(), uvc, uvd.clone() ] );\n\n\t\t}\n\n\t}\n\n};\n\nTHREE.PlaneGeometry.prototype = Object.create( THREE.Geometry.prototype );\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/Geometry5.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/Geometry5.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.Geometry5 = function ( size ) {\n\n\tTHREE.BufferGeometry.call( this );\n\n\tvar verticesBuffer = new Float32Array( size * 3 );\n\tvar normalsBuffer = new Float32Array( size * 3 );\n\tvar uvsBuffer = new Float32Array( size * 2 );\n\n\tthis.vertices = [];\n\tthis.normals = [];\n\tthis.uvs = [];\n\n\tfor ( var i = 0; i < size; i ++ ) {\n\n\t\tthis.vertices.push( new THREE.TypedVector3( verticesBuffer, i * 3 ) );\n\t\tthis.normals.push( new THREE.TypedVector3( normalsBuffer, i * 3 ) );\n\t\tthis.uvs.push( new THREE.TypedVector2( uvsBuffer, i * 2 ) );\n\n\t}\n\n\tthis.attributes[ 'position' ] = { array: verticesBuffer, itemSize: 3 };\n\tthis.attributes[ 'normal' ] = { array: normalsBuffer, itemSize: 3 };\n\tthis.attributes[ 'uv' ] = { array: uvsBuffer, itemSize: 2 };\n\n};\n\nTHREE.Geometry5.prototype = Object.create( THREE.BufferGeometry.prototype );\n\nTHREE.TypedVector2 = function ( array, offset ) {\n\n\tthis.array = array;\n\tthis.offset = offset;\n\t\n};\n\nTHREE.TypedVector2.prototype = Object.create( THREE.Vector2.prototype );\n\nObject.defineProperties( THREE.TypedVector2.prototype, {\n\t'x': {\n\t\tget: function () { return this.array[ this.offset ]; },\n\t\tset: function ( v ) { this.array[ this.offset ] = v; }\n\t},\n\t'y': {\n\t\tget: function () { return this.array[ this.offset + 1 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 1 ] = v; }\n\t}\n} );\n\nTHREE.TypedVector3 = function ( array, offset ) {\n\t\n\tthis.array = array;\n\tthis.offset = offset;\n\n};\n\nTHREE.TypedVector3.prototype = Object.create( THREE.Vector3.prototype );\n\nObject.defineProperties( THREE.TypedVector3.prototype, {\n\t'x': {\n\t\tget: function () { return this.array[ this.offset ]; },\n\t\tset: function ( v ) { this.array[ this.offset ] = v; }\n\t},\n\t'y': {\n\t\tget: function () { return this.array[ this.offset + 1 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 1 ] = v; }\n\t},\n\t'z': {\n\t\tget: function () { return this.array[ this.offset + 2 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 2 ] = v; }\n\t}\n} );"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/IndexedPlaneGeometry5.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/IndexedPlaneGeometry5.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as\n */\n\nTHREE.IndexedPlaneGeometry5 = function ( width, height, widthSegments, heightSegments ) {\n\n\tthis.width = width;\n\tthis.height = height;\n\n\tthis.widthSegments = widthSegments || 1;\n\tthis.heightSegments = heightSegments || 1;\n\n\tvar width_half = width / 2;\n\tvar height_half = height / 2;\n\n\tvar gridX = this.widthSegments;\n\tvar gridY = this.heightSegments;\n\n\tvar gridX1 = gridX + 1;\n\tvar gridY1 = gridY + 1;\n\n\tvar segment_width = this.width / gridX;\n\tvar segment_height = this.height / gridY;\n\n\tvar indices = gridX * gridY * 6;\n\tvar vertices = gridX1 * gridY1;\n\n\tTHREE.IndexedGeometry5.call( this, indices, vertices );\n\n\tvar offset = 0;\n\n\tfor ( var iy = 0; iy < gridY1; iy ++ ) {\n\n\t\tvar y = iy * segment_height - height_half;\n\n\t\tfor ( var ix = 0; ix < gridX1; ix ++ ) {\n\n\t\t\tvar x = ix * segment_width - width_half;\n\n\t\t\tthis.vertices[ offset ].x = x;\n\t\t\tthis.vertices[ offset ].y = - y;\n\n\t\t\tthis.normals[ offset ].z = 1;\n\n\t\t\tthis.uvs[ offset ].x = ix / gridX;\n\t\t\tthis.uvs[ offset ].y = iy / gridY;\n\n\t\t\toffset ++;\n\n\t\t}\n\n\t}\n\n\tvar offset = 0;\n\n\tfor ( var iy = 0; iy < gridY; iy ++ ) {\n\n\t\tfor ( var ix = 0; ix < gridX; ix ++ ) {\n\n\t\t\tvar a = ix + gridX1 * iy;\n\t\t\tvar b = ix + gridX1 * ( iy + 1 );\n\t\t\tvar c = ( ix + 1 ) + gridX1 * ( iy + 1 );\n\t\t\tvar d = ( ix + 1 ) + gridX1 * iy;\n\n\t\t\tthis.indices[ offset     ] = a;\n\t\t\tthis.indices[ offset + 1 ] = b;\n\t\t\tthis.indices[ offset + 2 ] = d;\n\n\t\t\tthis.indices[ offset + 3 ] = b;\n\t\t\tthis.indices[ offset + 4 ] = c;\n\t\t\tthis.indices[ offset + 5 ] = d;\n\n\t\t\toffset += 6;\n\n\t\t}\n\n\t}\n\n};\n\nTHREE.IndexedPlaneGeometry5.prototype = Object.create( THREE.IndexedGeometry5.prototype );\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/CircleTypedGeometry.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/CircleTypedGeometry.js",
            "module-type": "library",
            "text": "/**\n * @author hughes\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.CircleTypedGeometry = function ( radius, segments, thetaStart, thetaLength ) {\n\n\tthis.parameters = {\n\t\tradius: radius,\n\t\tsegments: segments,\n\t\tthetaStart: thetaStart,\n\t\tthetaLength: thetaLength\n\t};\n\n\tradius = radius || 50;\n\tsegments = segments !== undefined ? Math.max( 3, segments ) : 8;\n\n\tthetaStart = thetaStart !== undefined ? thetaStart : 0;\n\tthetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2;\n\n\t//\n\n\tvar elements = segments + 2;\n\n\tvar indices = new Uint16Array( segments * 3 );\n\tvar vertices = new Float32Array( elements * 3 );\n\tvar normals = new Float32Array( elements * 3 );\n\tvar uvs = new Float32Array( elements * 2 );\n\n\t// center\n\n\tnormals[ 2 ] = 1;\n\n\tuvs[ 0 ] = 0.5;\n\tuvs[ 1 ] = 0.5;\n\n\tvar offset = 0, offset2 = 2, offset3 = 3;\n\n\tfor ( var i = 0; i <= segments; i ++ ) {\n\n\t\tvar segment = thetaStart + i / segments * thetaLength;\n\n\t\tvar x = radius * Math.cos( segment );\n\t\tvar y = radius * Math.sin( segment );\n\n\t\tvertices[ offset3     ] = x;\n\t\tvertices[ offset3 + 1 ] = y;\n\n\t\tnormals[ offset3 + 2 ] = 1;\n\n\t\tuvs[ offset2     ] = ( x / radius + 1 ) / 2;\n\t\tuvs[ offset2 + 1 ] = ( y / radius + 1 ) / 2;\n\n\t\toffset2 += 2;\n\t\toffset3 += 3;\n\n\t\t//\n\n\t\tindices[ offset     ] = 0;\n\t\tindices[ offset + 1 ] = i + 1;\n\t\tindices[ offset + 2 ] = i + 2;\n\n\t\toffset  += 3;\n\n\t}\n\n\tTHREE.IndexedTypedGeometry.call( this );\n\n\tthis.setArrays( indices, vertices, normals, uvs );\n\n\tthis.boundingSphere = new THREE.Sphere( new THREE.Vector3(), radius );\n\n};\n\nTHREE.CircleTypedGeometry.prototype = Object.create( THREE.IndexedTypedGeometry.prototype );\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/Proxies/ProxyVector2.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/Proxies/ProxyVector2.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n * @author jbaicoianu / http://baicoianu.com/\n */\n\nTHREE.ProxyVector2 = function ( array, offset ) {\n\t\n\tthis.array = array;\n\tthis.offset = offset;\n\n};\n\nTHREE.ProxyVector2.prototype = Object.create( THREE.Vector2.prototype );\n\nObject.defineProperties( THREE.ProxyVector2.prototype, {\n\t'x': {\n\t\tget: function () { return this.array[ this.offset ]; },\n\t\tset: function ( v ) { this.array[ this.offset ] = v; }\n\t},\n\t'y': {\n\t\tget: function () { return this.array[ this.offset + 1 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 1 ] = v; }\n\t}\n} );\n\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/Proxies/ProxyFace3.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/Proxies/ProxyFace3.js",
            "module-type": "library",
            "text": "/**\n * @author jbaicoianu / http://baicoianu.com/\n */\n\nTHREE.ProxyFace3 = function ( array, offset, vertexNormals, vertexColors, vertexTangents ) {\n\n\tthis.array = array;\n\tthis.offset = offset;\n\tthis.vertexNormals = vertexNormals || [];\n\tthis.vertexColors = vertexColors || [];\n\tthis.vertexTangents = vertexTangents || [];\n\n\tthis.normal = new THREE.MultiVector3( this.vertexNormals );\n\tthis.color = new THREE.MultiColor( this.vertexColors );\n\n\t//THREE.Face3.call( this, array[offset], array[offset+1], array[offset+2] /*, normal, color, materialIndex */);\n\n}\n\nTHREE.ProxyFace3.prototype = Object.create( THREE.Face3.prototype );\n\nObject.defineProperties( THREE.ProxyFace3.prototype, {\n\t'a': {\n\t\tenumerable: true,\t\n\t\tget: function () { return this.array[ this.offset ]; },\n\t\tset: function ( v ) { this.array[ this.offset ] = v; }\n\t},\n\t'b': {\n\t\tenumerable: true,\t\n\t\tget: function () { return this.array[ this.offset + 1 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 1 ] = v; }\n\t},\n\t'c': {\n\t\tenumerable: true,\t\n\t\tget: function () { return this.array[ this.offset + 2 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 2 ] = v; }\n\t},\n} );\n\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/Proxies/MultiColor.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/Proxies/MultiColor.js",
            "module-type": "library",
            "text": "// Allows updating of multiple THREE.Color objects with the same value\n// Used for face.color -> face.vertexColor[] compatibility layer for non-indexed geometry\n\nTHREE.MultiColor = function(links) {\n\n\tthis.links = links;\n\n}\n\nTHREE.MultiColor.prototype = Object.create( THREE.Color.prototype );\n\nTHREE.MultiColor.prototype.setAll = function(axis, value) {\n\n\tfor (var i = 0, l = this.links.length; i < l; i++) {\n\n\t\tthis.links[i][axis] = value;\n\n\t}\n\n}\n\n// Getters return value from the first linked color\n// Setters set the same value for all linked colors\nObject.defineProperties( THREE.MultiColor.prototype, {\n\t'r': {\n\t\tget: function () { return (this.links[0] ? this.links[0].r : 0); },\n\t\tset: function ( v ) { this.setAll('r', v); }\n\t},\n\t'g': {\n\t\tget: function () { return (this.links[0] ? this.links[0].g : 0); },\n\t\tset: function ( v ) { this.setAll('g', v); }\n\t},\n\t'b': {\n\t\tget: function () { return (this.links[0] ? this.links[0].b : 0); },\n\t\tset: function ( v ) { this.setAll('b', v); }\n\t}\n} );\n\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/Proxies/ProxyColor.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/Proxies/ProxyColor.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n * @author jbaicoianu / http://baicoianu.com/\n */\n\nTHREE.ProxyColor = function ( array, offset ) {\n\n\tthis.array = array;\n\tthis.offset = offset;\n\n}\n\nTHREE.ProxyColor.prototype = Object.create( THREE.Color.prototype );\n\nObject.defineProperties( THREE.ProxyColor.prototype, {\n\t'r': {\n\t\tenumerable: true,\t\n\t\tget: function () { return this.array[ this.offset ]; },\n\t\tset: function ( v ) { this.array[ this.offset ] = v; }\n\t},\n\t'g': {\n\t\tenumerable: true,\t\n\t\tget: function () { return this.array[ this.offset + 1 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 1 ] = v; }\n\t},\n\t'b': {\n\t\tenumerable: true,\t\n\t\tget: function () { return this.array[ this.offset + 2 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 2 ] = v; }\n\t}\n} );\n\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/Proxies/MultiVector3.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/Proxies/MultiVector3.js",
            "module-type": "library",
            "text": "// Allows updating of multiple THREE.Vector3 objects with the same value\n// Used for face.normal -> face.vertexNormal[] compatibility layer for FlatShading\n\nTHREE.MultiVector3 = function(links) {\n\n\tthis.links = links;\n\n}\n\nTHREE.MultiVector3.prototype = Object.create( THREE.Vector3.prototype );\n\nTHREE.MultiVector3.prototype.setAll = function(axis, value) {\n\n\tfor (var i = 0, l = this.links.length; i < l; i++) {\n\n\t\tthis.links[i][axis] = value;\n\n\t}\n\n}\n\n// Getters return value from the first linked vector\n// Setters set the same value for all linked vectors\nObject.defineProperties( THREE.MultiVector3.prototype, {\n\t'x': {\n\t\tget: function () { return (this.links[0] ? this.links[0].x : 0); },\n\t\tset: function ( v ) { this.setAll('x', v); }\n\t},\n\t'y': {\n\t\tget: function () { return (this.links[0] ? this.links[0].y : 0); },\n\t\tset: function ( v ) { this.setAll('y', v); }\n\t},\n\t'z': {\n\t\tget: function () { return (this.links[0] ? this.links[0].z : 0); },\n\t\tset: function ( v ) { this.setAll('z', v); }\n\t}\n} );\n\n\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/Proxies/ProxyVector3.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/Proxies/ProxyVector3.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n * @author jbaicoianu / http://baicoianu.com/\n */\n\nTHREE.ProxyVector3 = function ( array, offset ) {\n\t\n\tthis.array = array;\n\tthis.offset = offset;\n\n};\n\nTHREE.ProxyVector3.prototype = Object.create( THREE.Vector3.prototype );\n\nObject.defineProperties( THREE.ProxyVector3.prototype, {\n\t'x': {\n\t\tget: function () { return this.array[ this.offset ]; },\n\t\tset: function ( v ) { this.array[ this.offset ] = v; }\n\t},\n\t'y': {\n\t\tget: function () { return this.array[ this.offset + 1 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 1 ] = v; }\n\t},\n\t'z': {\n\t\tget: function () { return this.array[ this.offset + 2 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 2 ] = v; }\n\t}\n} );\n\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/Proxies/ProxyVector4.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/Proxies/ProxyVector4.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n * @author jbaicoianu / http://baicoianu.com/\n */\n\nTHREE.ProxyVector4 = function ( array, offset ) {\n\t\n\tthis.array = array;\n\tthis.offset = offset;\n\n};\n\nTHREE.ProxyVector4.prototype = Object.create( THREE.Vector4.prototype );\n\nObject.defineProperties( THREE.ProxyVector4.prototype, {\n\t'x': {\n\t\tget: function () { return this.array[ this.offset ]; },\n\t\tset: function ( v ) { this.array[ this.offset ] = v; }\n\t},\n\t'y': {\n\t\tget: function () { return this.array[ this.offset + 1 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 1 ] = v; }\n\t},\n\t'z': {\n\t\tget: function () { return this.array[ this.offset + 2 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 2 ] = v; }\n\t},\n\t'w': {\n\t\tget: function () { return this.array[ this.offset + 3 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 3 ] = v; }\n\t}\n} );\n\n"
        },
        "$:/plugins/rboue/Three.js/Lib/Wip/GeometryEditor.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/Wip/GeometryEditor.js",
            "module-type": "library",
            "text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.GeometryEditor = function ( geometry ) {\n\n\tthis.geometry = geometry;\n\n};\n\nObject.defineProperties( THREE.GeometryEditor.prototype, {\n\tvertices: { \n\t\tenumerable: true,\n\t\tget: function() { return this.createVertexProxies(); }\n\t},\n\tnormals: {\n\t\tenumerable: true,\n\t\tget: function() { return this.createNormalProxies(); } \n\t},\n\tuvs: {\n\t\tenumerable: true,\n\t\tget: function() { return this.createUVProxies(); } \n\t}\n} );\n\nTHREE.GeometryEditor.prototype.createVertexProxies = function () {\n\n\tObject.defineProperty( this, 'vertices', { value: [], writable: true } );\n\n\tvar attributes = this.geometry.attributes;\n\tvar length = attributes.position.array.length / 3;\n\n\tfor ( var i = 0; i < length; i ++ ) {\n\n\t\tthis.vertices.push( new THREE.ProxyVector3( attributes.position.array, i * 3 ) );\n\n\t}\n\n\treturn this.vertices;\n\n};\n\nTHREE.GeometryEditor.prototype.createNormalProxies = function () {\n\n\tObject.defineProperty( this, 'normals', { value: [], writable: true } );\n\n\tvar attributes = this.geometry.attributes;\n\tvar length = attributes.position.array.length / 3;\n\n\tfor ( var i = 0; i < length; i ++ ) {\n\n\t\tthis.normals.push( new THREE.ProxyVector3( attributes.normal.array, i * 3 ) );\n\n\t}\n\n\treturn this.normals;\n\n};\n\nTHREE.GeometryEditor.prototype.createUVProxies = function () {\n\n\tObject.defineProperty( this, 'uvs', { value: [], writable: true } );\n\n\tvar attributes = this.geometry.attributes;\n\tvar length = attributes.position.array.length / 3;\n\n\tfor ( var i = 0; i < length; i ++ ) {\n\n\t\tthis.uvs.push( new THREE.ProxyVector2( attributes.uv.array, i * 2 ) );\n\n\t}\n\n\treturn this.uvs;\n\n};"
        },
        "$:/plugins/rboue/Three.js/Lib/ShaderGodRays.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/ShaderGodRays.js",
            "module-type": "library",
            "text": "/**\n * @author huwb / http://huwbowles.com/\n *\n * God-rays (crepuscular rays)\n *\n * Similar implementation to the one used by Crytek for CryEngine 2 [Sousa2008].\n * Blurs a mask generated from the depth map along radial lines emanating from the light\n * source. The blur repeatedly applies a blur filter of increasing support but constant\n * sample count to produce a blur filter with large support.\n *\n * My implementation performs 3 passes, similar to the implementation from Sousa. I found\n * just 6 samples per pass produced acceptible results. The blur is applied three times,\n * with decreasing filter support. The result is equivalent to a single pass with\n * 6*6*6 = 216 samples.\n *\n * References:\n *\n * Sousa2008 - Crysis Next Gen Effects, GDC2008, http://www.crytek.com/sites/default/files/GDC08_SousaT_CrysisEffects.ppt\n */\n\nTHREE.ShaderGodRays = {\n\n\t/**\n\t * The god-ray generation shader.\n\t *\n\t * First pass:\n\t *\n\t * The input is the depth map. I found that the output from the\n\t * THREE.MeshDepthMaterial material was directly suitable without\n\t * requiring any treatment whatsoever.\n\t *\n\t * The depth map is blurred along radial lines towards the \"sun\". The\n\t * output is written to a temporary render target (I used a 1/4 sized\n\t * target).\n\t *\n\t * Pass two & three:\n\t *\n\t * The results of the previous pass are re-blurred, each time with a\n\t * decreased distance between samples.\n\t */\n\n\t'godrays_generate': {\n\n\t\tuniforms: {\n\n\t\t\ttInput: {\n\t\t\t\ttype: \"t\",\n\t\t\t\tvalue: null\n\t\t\t},\n\n\t\t\tfStepSize: {\n\t\t\t\ttype: \"f\",\n\t\t\t\tvalue: 1.0\n\t\t\t},\n\n\t\t\tvSunPositionScreenSpace: {\n\t\t\t\ttype: \"v2\",\n\t\t\t\tvalue: new THREE.Vector2( 0.5, 0.5 )\n\t\t\t}\n\n\t\t},\n\n\t\tvertexShader: [\n\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"vUv = uv;\",\n\t\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tfragmentShader: [\n\n\t\t\t\"#define TAPS_PER_PASS 6.0\",\n\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"uniform sampler2D tInput;\",\n\n\t\t\t\"uniform vec2 vSunPositionScreenSpace;\",\n\t\t\t\"uniform float fStepSize;\", // filter step size\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t// delta from current pixel to \"sun\" position\n\n\t\t\t\t\"vec2 delta = vSunPositionScreenSpace - vUv;\",\n\t\t\t\t\"float dist = length( delta );\",\n\n\t\t\t\t// Step vector (uv space)\n\n\t\t\t\t\"vec2 stepv = fStepSize * delta / dist;\",\n\n\t\t\t\t// Number of iterations between pixel and sun\n\n\t\t\t\t\"float iters = dist/fStepSize;\",\n\n\t\t\t\t\"vec2 uv = vUv.xy;\",\n\t\t\t\t\"float col = 0.0;\",\n\n\t\t\t\t// This breaks ANGLE in Chrome 22\n\t\t\t\t//\t- see http://code.google.com/p/chromium/issues/detail?id=153105\n\n\t\t\t\t/*\n\t\t\t\t// Unrolling didnt do much on my hardware (ATI Mobility Radeon 3450),\n\t\t\t\t// so i've just left the loop\n\n\t\t\t\t\"for ( float i = 0.0; i < TAPS_PER_PASS; i += 1.0 ) {\",\n\n\t\t\t\t\t// Accumulate samples, making sure we dont walk past the light source.\n\n\t\t\t\t\t// The check for uv.y < 1 would not be necessary with \"border\" UV wrap\n\t\t\t\t\t// mode, with a black border colour. I don't think this is currently\n\t\t\t\t\t// exposed by three.js. As a result there might be artifacts when the\n\t\t\t\t\t// sun is to the left, right or bottom of screen as these cases are\n\t\t\t\t\t// not specifically handled.\n\n\t\t\t\t\t\"col += ( i <= iters && uv.y < 1.0 ? texture2D( tInput, uv ).r : 0.0 );\",\n\t\t\t\t\t\"uv += stepv;\",\n\n\t\t\t\t\"}\",\n\t\t\t\t*/\n\n\t\t\t\t// Unrolling loop manually makes it work in ANGLE\n\n\t\t\t\t\"if ( 0.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r;\",\n\t\t\t\t\"uv += stepv;\",\n\n\t\t\t\t\"if ( 1.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r;\",\n\t\t\t\t\"uv += stepv;\",\n\n\t\t\t\t\"if ( 2.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r;\",\n\t\t\t\t\"uv += stepv;\",\n\n\t\t\t\t\"if ( 3.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r;\",\n\t\t\t\t\"uv += stepv;\",\n\n\t\t\t\t\"if ( 4.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r;\",\n\t\t\t\t\"uv += stepv;\",\n\n\t\t\t\t\"if ( 5.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r;\",\n\t\t\t\t\"uv += stepv;\",\n\n\t\t\t\t// Should technically be dividing by 'iters', but 'TAPS_PER_PASS' smooths out\n\t\t\t\t// objectionable artifacts, in particular near the sun position. The side\n\t\t\t\t// effect is that the result is darker than it should be around the sun, as\n\t\t\t\t// TAPS_PER_PASS is greater than the number of samples actually accumulated.\n\t\t\t\t// When the result is inverted (in the shader 'godrays_combine', this produces\n\t\t\t\t// a slight bright spot at the position of the sun, even when it is occluded.\n\n\t\t\t\t\"gl_FragColor = vec4( col/TAPS_PER_PASS );\",\n\t\t\t\t\"gl_FragColor.a = 1.0;\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t},\n\n\t/**\n\t * Additively applies god rays from texture tGodRays to a background (tColors).\n\t * fGodRayIntensity attenuates the god rays.\n\t */\n\n\t'godrays_combine': {\n\n\t\tuniforms: {\n\n\t\t\ttColors: {\n\t\t\t\ttype: \"t\",\n\t\t\t\tvalue: null\n\t\t\t},\n\n\t\t\ttGodRays: {\n\t\t\t\ttype: \"t\",\n\t\t\t\tvalue: null\n\t\t\t},\n\n\t\t\tfGodRayIntensity: {\n\t\t\t\ttype: \"f\",\n\t\t\t\tvalue: 0.69\n\t\t\t},\n\n\t\t\tvSunPositionScreenSpace: {\n\t\t\t\ttype: \"v2\",\n\t\t\t\tvalue: new THREE.Vector2( 0.5, 0.5 )\n\t\t\t}\n\n\t\t},\n\n\t\tvertexShader: [\n\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"vUv = uv;\",\n\t\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t\t].join(\"\\n\"),\n\n\t\tfragmentShader: [\n\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"uniform sampler2D tColors;\",\n\t\t\t\"uniform sampler2D tGodRays;\",\n\n\t\t\t\"uniform vec2 vSunPositionScreenSpace;\",\n\t\t\t\"uniform float fGodRayIntensity;\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t// Since THREE.MeshDepthMaterial renders foreground objects white and background\n\t\t\t\t// objects black, the god-rays will be white streaks. Therefore value is inverted\n\t\t\t\t// before being combined with tColors\n\n\t\t\t\t\"gl_FragColor = texture2D( tColors, vUv ) + fGodRayIntensity * vec4( 1.0 - texture2D( tGodRays, vUv ).r );\",\n\t\t\t\t\"gl_FragColor.a = 1.0;\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t},\n\n\n\t/**\n\t * A dodgy sun/sky shader. Makes a bright spot at the sun location. Would be\n\t * cheaper/faster/simpler to implement this as a simple sun sprite.\n\t */\n\n\t'godrays_fake_sun': {\n\n\t\tuniforms: {\n\n\t\t\tvSunPositionScreenSpace: {\n\t\t\t\ttype: \"v2\",\n\t\t\t\tvalue: new THREE.Vector2( 0.5, 0.5 )\n\t\t\t},\n\n\t\t\tfAspect: {\n\t\t\t\ttype: \"f\",\n\t\t\t\tvalue: 1.0\n\t\t\t},\n\n\t\t\tsunColor: {\n\t\t\t\ttype: \"c\",\n\t\t\t\tvalue: new THREE.Color( 0xffee00 )\n\t\t\t},\n\n\t\t\tbgColor: {\n\t\t\t\ttype: \"c\",\n\t\t\t\tvalue: new THREE.Color( 0x000000 )\n\t\t\t}\n\n\t\t},\n\n\t\tvertexShader: [\n\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"vUv = uv;\",\n\t\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tfragmentShader: [\n\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"uniform vec2 vSunPositionScreenSpace;\",\n\t\t\t\"uniform float fAspect;\",\n\n\t\t\t\"uniform vec3 sunColor;\",\n\t\t\t\"uniform vec3 bgColor;\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"vec2 diff = vUv - vSunPositionScreenSpace;\",\n\n\t\t\t\t// Correct for aspect ratio\n\n\t\t\t\t\"diff.x *= fAspect;\",\n\n\t\t\t\t\"float prop = clamp( length( diff ) / 0.5, 0.0, 1.0 );\",\n\t\t\t\t\"prop = 0.35 * pow( 1.0 - prop, 3.0 );\",\n\n\t\t\t\t\"gl_FragColor.xyz = mix( sunColor, bgColor, 1.0 - prop );\",\n\t\t\t\t\"gl_FragColor.w = 1.0;\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t}\n\n};\n"
        },
        "$:/plugins/rboue/Three.js/Lib/CurveExtras.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/CurveExtras.js",
            "module-type": "library",
            "text": "/*\n * A bunch of parametric curves\n * @author zz85\n *\n * Formulas collected from various sources\n *\thttp://mathworld.wolfram.com/HeartCurve.html\n *\thttp://mathdl.maa.org/images/upload_library/23/stemkoski/knots/page6.html\n *\thttp://en.wikipedia.org/wiki/Viviani%27s_curve\n *\thttp://mathdl.maa.org/images/upload_library/23/stemkoski/knots/page4.html\n *\thttp://www.mi.sanu.ac.rs/vismath/taylorapril2011/Taylor.pdf\n *\thttp://prideout.net/blog/?p=44\n */\n\n// Lets define some curves\nTHREE.Curves = {};\n\n\n THREE.Curves.GrannyKnot = THREE.Curve.create( function(){},\n\n\t function(t) {\n\t    t = 2 * Math.PI * t;\n\n\t    var x = -0.22 * Math.cos(t) - 1.28 * Math.sin(t) - 0.44 * Math.cos(3 * t) - 0.78 * Math.sin(3 * t);\n\t    var y = -0.1 * Math.cos(2 * t) - 0.27 * Math.sin(2 * t) + 0.38 * Math.cos(4 * t) + 0.46 * Math.sin(4 * t);\n\t    var z = 0.7 * Math.cos(3 * t) - 0.4 * Math.sin(3 * t);\n\t    return new THREE.Vector3(x, y, z).multiplyScalar(20);\n\t}\n);\n\nTHREE.Curves.HeartCurve = THREE.Curve.create(\n\nfunction(s) {\n\n\tthis.scale = (s === undefined) ? 5 : s;\n\n},\n\nfunction(t) {\n\n\tt *= 2 * Math.PI;\n\n\tvar tx = 16 * Math.pow(Math.sin(t), 3);\n\tvar ty = 13 * Math.cos(t) - 5 * Math.cos(2 * t) - 2 * Math.cos(3 * t) - Math.cos(4 * t), tz = 0;\n\n\treturn new THREE.Vector3(tx, ty, tz).multiplyScalar(this.scale);\n\n}\n\n);\n\n\n\n// Viviani's Curve\nTHREE.Curves.VivianiCurve = THREE.Curve.create(\n\n\tfunction(radius) {\n\n\t\tthis.radius = radius;\n\t},\n\n\tfunction(t) {\n\n\t\tt = t * 4 * Math.PI; // Normalized to 0..1\n\t\tvar a = this.radius / 2;\n\t\tvar tx = a * (1 + Math.cos(t)),\n\t\t\tty = a * Math.sin(t),\n\t\t\ttz = 2 * a * Math.sin(t / 2);\n\n\t\treturn new THREE.Vector3(tx, ty, tz);\n\n\t}\n\n);\n\n\nTHREE.Curves.KnotCurve = THREE.Curve.create(\n\n\tfunction() {\n\n\t},\n\n\tfunction(t) {\n\n\t\tt *= 2 * Math.PI;\n\n\t\tvar R = 10;\n\t\tvar s = 50;\n\t\tvar tx = s * Math.sin(t),\n\t\t\tty = Math.cos(t) * (R + s * Math.cos(t)),\n\t\t\ttz = Math.sin(t) * (R + s * Math.cos(t));\n\n\t\treturn new THREE.Vector3(tx, ty, tz);\n\n\t}\n\n);\n\nTHREE.Curves.HelixCurve = THREE.Curve.create(\n\n\tfunction() {\n\n\t},\n\n\tfunction(t) {\n\n\t\tvar a = 30; // radius\n\t\tvar b = 150; //height\n\t\tvar t2 = 2 * Math.PI * t * b / 30;\n\t\tvar tx = Math.cos(t2) * a,\n\t\t\tty = Math.sin(t2) * a,\n\t\t\ttz = b * t;\n\n\t\treturn new THREE.Vector3(tx, ty, tz);\n\n\t}\n\n);\n\nTHREE.Curves.TrefoilKnot = THREE.Curve.create(\n\n\tfunction(s) {\n\n\t\tthis.scale = (s === undefined) ? 10 : s;\n\n\t},\n\n\tfunction(t) {\n\n\t\tt *= Math.PI * 2;\n\t\tvar tx = (2 + Math.cos(3 * t)) * Math.cos(2 * t),\n\t\t\tty = (2 + Math.cos(3 * t)) * Math.sin(2 * t),\n\t\t\ttz = Math.sin(3 * t);\n\n\t\treturn new THREE.Vector3(tx, ty, tz).multiplyScalar(this.scale);\n\n\t}\n\n);\n\nTHREE.Curves.TorusKnot = THREE.Curve.create(\n\n\tfunction(s) {\n\n\t\tthis.scale = (s === undefined) ? 10 : s;\n\n\t},\n\n\tfunction(t) {\n\n\t\tvar p = 3,\n\t\t\tq = 4;\n\t\tt *= Math.PI * 2;\n\t\tvar tx = (2 + Math.cos(q * t)) * Math.cos(p * t),\n\t\t\tty = (2 + Math.cos(q * t)) * Math.sin(p * t),\n\t\t\ttz = Math.sin(q * t);\n\n\t\treturn new THREE.Vector3(tx, ty, tz).multiplyScalar(this.scale);\n\n\t}\n\n);\n\n\nTHREE.Curves.CinquefoilKnot = THREE.Curve.create(\n\n\tfunction(s) {\n\n\t\tthis.scale = (s === undefined) ? 10 : s;\n\n\t},\n\n\tfunction(t) {\n\n\t\tvar p = 2,\n\t\t\tq = 5;\n\t\tt *= Math.PI * 2;\n\t\tvar tx = (2 + Math.cos(q * t)) * Math.cos(p * t),\n\t\t\tty = (2 + Math.cos(q * t)) * Math.sin(p * t),\n\t\t\ttz = Math.sin(q * t);\n\n\t\treturn new THREE.Vector3(tx, ty, tz).multiplyScalar(this.scale);\n\n\t}\n\n);\n\n\nTHREE.Curves.TrefoilPolynomialKnot = THREE.Curve.create(\n\n\tfunction(s) {\n\n\t\tthis.scale = (s === undefined) ? 10 : s;\n\n\t},\n\n\tfunction(t) {\n\n\t\tt = t * 4 - 2;\n\t\tvar tx = Math.pow(t, 3) - 3 * t,\n\t\t\tty = Math.pow(t, 4) - 4 * t * t,\n\t\t\ttz = 1 / 5 * Math.pow(t, 5) - 2 * t;\n\n\t\treturn new THREE.Vector3(tx, ty, tz).multiplyScalar(this.scale);\n\n\t}\n\n);\n\n// var scaleTo = function(x, y) {\n//   var r = y - x;\n//   return function(t) {\n//     t * r + x;\n//   };\n// }\nvar scaleTo = function(x, y, t) {\n\n\t\tvar r = y - x;\n\t\treturn t * r + x;\n\n\t}\n\nTHREE.Curves.FigureEightPolynomialKnot = THREE.Curve.create(\n\n\tfunction(s) {\n\n\t\tthis.scale = (s === undefined) ? 1 : s;\n\n\t},\n\n\tfunction(t) {\n\n\t\tt = scaleTo(-4, 4, t);\n\t\tvar tx = 2 / 5 * t * (t * t - 7) * (t * t - 10),\n\t\t\tty = Math.pow(t, 4) - 13 * t * t,\n\t\t\ttz = 1 / 10 * t * (t * t - 4) * (t * t - 9) * (t * t - 12);\n\n\t\treturn new THREE.Vector3(tx, ty, tz).multiplyScalar(this.scale);\n\n\t}\n\n);\n\nTHREE.Curves.DecoratedTorusKnot4a = THREE.Curve.create(\n\n\tfunction(s) {\n\n\t\tthis.scale = (s === undefined) ? 40 : s;\n\n\t},\n\n\tfunction(t) {\n\n\t\tt *= Math.PI * 2;\n\t\tvar\n\t\tx = Math.cos(2 * t) * (1 + 0.6 * (Math.cos(5 * t) + 0.75 * Math.cos(10 * t))),\n\t\t\ty = Math.sin(2 * t) * (1 + 0.6 * (Math.cos(5 * t) + 0.75 * Math.cos(10 * t))),\n\t\t\tz = 0.35 * Math.sin(5 * t);\n\n\t\treturn new THREE.Vector3(x, y, z).multiplyScalar(this.scale);\n\n\t}\n\n);\n\n\nTHREE.Curves.DecoratedTorusKnot4b = THREE.Curve.create(\n\n\tfunction(s) {\n\n\t\tthis.scale = (s === undefined) ? 40 : s;\n\n\t},\n\n\tfunction(t) {\n\t\tvar fi = t * Math.PI * 2;\n\t\tvar x = Math.cos(2 * fi) * (1 + 0.45 * Math.cos(3 * fi) + 0.4 * Math.cos(9 * fi)),\n\t\t\ty = Math.sin(2 * fi) * (1 + 0.45 * Math.cos(3 * fi) + 0.4 * Math.cos(9 * fi)),\n\t\t\tz = 0.2 * Math.sin(9 * fi);\n\n\t\treturn new THREE.Vector3(x, y, z).multiplyScalar(this.scale);\n\n\t}\n\n);\n\n\nTHREE.Curves.DecoratedTorusKnot5a = THREE.Curve.create(\n\n\tfunction(s) {\n\n\t\tthis.scale = (s === undefined) ? 40 : s;\n\n\t},\n\n\tfunction(t) {\n\n\t\tvar fi = t * Math.PI * 2;\n\t\tvar x = Math.cos(3 * fi) * (1 + 0.3 * Math.cos(5 * fi) + 0.5 * Math.cos(10 * fi)),\n\t\t\ty = Math.sin(3 * fi) * (1 + 0.3 * Math.cos(5 * fi) + 0.5 * Math.cos(10 * fi)),\n\t\t\tz = 0.2 * Math.sin(20 * fi);\n\n\t\treturn new THREE.Vector3(x, y, z).multiplyScalar(this.scale);\n\n\t}\n\n);\n\nTHREE.Curves.DecoratedTorusKnot5c = THREE.Curve.create(\n\n\tfunction(s) {\n\n\t\tthis.scale = (s === undefined) ? 40 : s;\n\n\t},\n\n\tfunction(t) {\n\n\t\tvar fi = t * Math.PI * 2;\n\t\tvar x = Math.cos(4 * fi) * (1 + 0.5 * (Math.cos(5 * fi) + 0.4 * Math.cos(20 * fi))),\n\t\t\ty = Math.sin(4 * fi) * (1 + 0.5 * (Math.cos(5 * fi) + 0.4 * Math.cos(20 * fi))),\n\t\t\tz = 0.35 * Math.sin(15 * fi);\n\n\t\treturn new THREE.Vector3(x, y, z).multiplyScalar(this.scale);\n\n\t}\n\n);"
        },
        "$:/plugins/rboue/Three.js/Lib/UCSCharacter.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/UCSCharacter.js",
            "module-type": "library",
            "text": "THREE.UCSCharacter = function() {\n\n\tvar scope = this;\n\t\n\tvar mesh;\n\n\tthis.scale = 1;\n\n\tthis.root = new THREE.Object3D();\n\t\n\tthis.numSkins;\n\tthis.numMorphs;\n\t\n\tthis.skins = [];\n\tthis.materials = [];\n\tthis.morphs = [];\n\n\tthis.onLoadComplete = function () {};\n\t\n\tthis.loadCounter = 0;\n\n\tthis.loadParts = function ( config ) {\n\t\t\n\t\tthis.numSkins = config.skins.length;\n\t\tthis.numMorphs = config.morphs.length;\n\t\t\n\t\t// Character geometry + number of skins\n\t\tthis.loadCounter = 1 + config.skins.length;\n\t\t\n\t\t// SKINS\n\t\tthis.skins = loadTextures( config.baseUrl + \"skins/\", config.skins );\n\t\tthis.materials = createMaterials( this.skins );\n\t\t\n\t\t// MORPHS\n\t\tthis.morphs = config.morphs;\n\t\t\n\t\t// CHARACTER\n\t\tvar loader = new THREE.JSONLoader();\n\t\tconsole.log( config.baseUrl + config.character );\n\t\tloader.load( config.baseUrl + config.character, function( geometry ) {\n\t\t\tgeometry.computeBoundingBox();\n\t\t\tgeometry.computeVertexNormals();\n\n\t\t\t//THREE.AnimationHandler.add( geometry.animation );\n\n\t\t\tmesh = new THREE.SkinnedMesh( geometry, new THREE.MeshFaceMaterial() );\n\t\t\tscope.root.add( mesh );\n\t\t\t\n\t\t\tvar bb = geometry.boundingBox;\n\t\t\tscope.root.scale.set( config.s, config.s, config.s );\n\t\t\tscope.root.position.set( config.x, config.y - bb.min.y * config.s, config.z );\n\n\t\t\tmesh.castShadow = true;\n\t\t\tmesh.receiveShadow = true;\n\n\t\t\tanimation = new THREE.Animation( mesh, geometry.animation );\n\t\t\tanimation.play();\n\t\t\t\n\t\t\tscope.setSkin(0);\n\t\t\t\n\t\t\tscope.checkLoadComplete();\n\t\t} );\n\n\t};\n\t\n\tthis.setSkin = function( index ) {\n\t\tif ( mesh && scope.materials ) {\n\t\t\tmesh.material = scope.materials[ index ];\n\t\t}\n\t};\n\t\n\tthis.updateMorphs = function( influences ) {\n\t\tif ( mesh ) {\n\t\t\tfor ( var i = 0; i < scope.numMorphs; i ++ ) {\n\t\t\t\tmesh.morphTargetInfluences[ i ] = influences[ scope.morphs[ i ] ] / 100;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tfunction loadTextures( baseUrl, textureUrls ) {\n\t\tvar mapping = new THREE.UVMapping();\n\t\tvar textures = [];\n\n\t\tfor ( var i = 0; i < textureUrls.length; i ++ ) {\n\n\t\t\ttextures[ i ] = THREE.ImageUtils.loadTexture( baseUrl + textureUrls[ i ], mapping, scope.checkLoadComplete );\n\t\t\ttextures[ i ].name = textureUrls[ i ];\n\n\t\t}\n\n\t\treturn textures;\n\t};\n\n\tfunction createMaterials( skins ) {\n\t\tvar materials = [];\n\t\t\n\t\tfor ( var i = 0; i < skins.length; i ++ ) {\n\n\t\t\tmaterials[ i ] = new THREE.MeshLambertMaterial( {\n\t\t\t\tcolor: 0xeeeeee,\n\t\t\t\tspecular: 10.0,\n\t\t\t\tmap: skins[ i ],\n\t\t\t\tskinning: true,\n\t\t\t\tmorphTargets: true,\n\t\t\t\twrapAround: true\n\t\t\t} );\n\n\t\t}\n\t\t\n\t\treturn materials;\n\t}\n\n\tthis.checkLoadComplete = function () {\n\n\t\tscope.loadCounter -= 1;\n\n\t\tif ( scope.loadCounter === 0 ) {\n\n\t\t\tscope.onLoadComplete();\n\n\t\t}\n\n\t}\n\n}\n"
        },
        "$:/plugins/rboue/Three.js/Lib/ShaderDeferred.js": {
            "type": "application/javascript",
            "title": "$:/plugins/rboue/Three.js/Lib/ShaderDeferred.js",
            "module-type": "library",
            "text": "/**\n * @author alteredq / http://alteredqualia.com/\n * @author MPanknin / http://www.redplant.de/\n * @author benaadams / http://blog.illyriad.co.uk/\n *\n */\n\n\nTHREE.DeferredShaderChunk = {\n\n\t// decode float to vec3\n\n\tunpackFloat: [\n\n\t\t\"vec3 float_to_vec3( float data ) {\",\n\n\t\t\t\"vec3 uncompressed;\",\n\t\t\t\"uncompressed.x = fract( data );\",\n\t\t\t\"float zInt = floor( data / 255.0 );\",\n\t\t\t\"uncompressed.z = fract( zInt / 255.0 );\",\n\t\t\t\"uncompressed.y = fract( floor( data - ( zInt * 255.0 ) ) / 255.0 );\",\n\t\t\t\"return uncompressed;\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tcomputeVertexPositionVS: [\n\n\t\t\"vec2 texCoord = gl_FragCoord.xy / vec2( viewWidth, viewHeight );\",\n\n\t\t\"vec4 normalDepth = texture2D( samplerNormalDepth, texCoord );\",\n\t\t\"float z = normalDepth.w;\",\n\n\t\t\"if ( z == 0.0 ) discard;\",\n\n\t\t\"vec2 xy = texCoord * 2.0 - 1.0;\",\n\n\t\t\"vec4 vertexPositionProjected = vec4( xy, z, 1.0 );\",\n\t\t\"vec4 vertexPositionVS = matProjInverse * vertexPositionProjected;\",\n\t\t\"vertexPositionVS.xyz /= vertexPositionVS.w;\",\n\t\t\"vertexPositionVS.w = 1.0;\"\n\n\t].join(\"\\n\"),\n\n\tcomputeNormal: [\n\n\t\t\"vec3 normal = normalDepth.xyz * 2.0 - 1.0;\"\n\n\t].join(\"\\n\"),\n\n\tunpackColorMap: [\n\n\t\t\"vec4 colorMap = texture2D( samplerColor, texCoord );\",\n\n\t\t\"vec3 albedo = float_to_vec3( abs( colorMap.x ) );\",\n\t\t\"vec3 specularColor = float_to_vec3( abs( colorMap.y ) );\",\n\t\t\"float shininess = abs( colorMap.z );\",\n\t\t\"float wrapAround = sign( colorMap.z );\",\n\t\t\"float additiveSpecular = sign( colorMap.y );\"\n\n\t].join(\"\\n\"),\n\n\tcomputeDiffuse: [\n\n\t\t\"float dotProduct = dot( normal, lightVector );\",\n\t\t\"float diffuseFull = max( dotProduct, 0.0 );\",\n\n\t\t\"vec3 diffuse;\",\n\n\t\t\"if ( wrapAround < 0.0 ) {\",\n\n\t\t\t// wrap around lighting\n\n\t\t\t\"float diffuseHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\",\n\n\t\t\t\"const vec3 wrapRGB = vec3( 1.0, 1.0, 1.0 );\",\n\t\t\t\"diffuse = mix( vec3( diffuseFull ), vec3( diffuseHalf ), wrapRGB );\",\n\n\t\t\"} else {\",\n\n\t\t\t// simple lighting\n\n\t\t\t\"diffuse = vec3( diffuseFull );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tcomputeSpecular: [\n\n\t\t\"vec3 halfVector = normalize( lightVector - normalize( vertexPositionVS.xyz ) );\",\n\t\t\"float dotNormalHalf = max( dot( normal, halfVector ), 0.0 );\",\n\n\t\t// simple specular\n\n\t\t//\"vec3 specular = specularColor * max( pow( dotNormalHalf, shininess ), 0.0 ) * diffuse;\",\n\n\t\t// physically based specular\n\n\t\t\"float specularNormalization = ( shininess + 2.0001 ) / 8.0;\",\n\n\t\t\"vec3 schlick = specularColor + vec3( 1.0 - specularColor ) * pow( 1.0 - dot( lightVector, halfVector ), 5.0 );\",\n\t\t\"vec3 specular = schlick * max( pow( dotNormalHalf, shininess ), 0.0 ) * diffuse * specularNormalization;\"\n\n\t].join(\"\\n\"),\n\n\tcombine: [\n\n\t\t\"vec3 light = lightIntensity * lightColor;\",\n\t\t\"gl_FragColor = vec4( light * ( albedo * diffuse + specular ), attenuation );\"\n\n\t].join(\"\\n\")\n\n};\n\nTHREE.ShaderDeferred = {\n\n\t\"color\" : {\n\n\t\tuniforms: THREE.UniformsUtils.merge( [\n\n\t\t\tTHREE.UniformsLib[ \"common\" ],\n\t\t\tTHREE.UniformsLib[ \"fog\" ],\n\t\t\tTHREE.UniformsLib[ \"shadowmap\" ],\n\n\t\t\t{\n\t\t\t\t\"emissive\" :  { type: \"c\", value: new THREE.Color( 0x000000 ) },\n\t\t\t\t\"specular\" :  { type: \"c\", value: new THREE.Color( 0x111111 ) },\n\t\t\t\t\"shininess\":  { type: \"f\", value: 30 },\n\t\t\t\t\"wrapAround\": \t\t{ type: \"f\", value: 1 },\n\t\t\t\t\"additiveSpecular\": { type: \"f\", value: 1 },\n\n\t\t\t\t\"samplerNormalDepth\": { type: \"t\", value: null },\n\t\t\t\t\"viewWidth\": \t\t{ type: \"f\", value: 800 },\n\t\t\t\t\"viewHeight\": \t\t{ type: \"f\", value: 600 }\n\t\t\t}\n\n\t\t] ),\n\n\t\tfragmentShader : [\n\n\t\t\t\"uniform vec3 diffuse;\",\n\t\t\t\"uniform vec3 specular;\",\n\t\t\t\"uniform vec3 emissive;\",\n\t\t\t\"uniform float shininess;\",\n\t\t\t\"uniform float wrapAround;\",\n\t\t\t\"uniform float additiveSpecular;\",\n\n\t\t\tTHREE.ShaderChunk[ \"color_pars_fragment\" ],\n\t\t\tTHREE.ShaderChunk[ \"map_pars_fragment\" ],\n\t\t\tTHREE.ShaderChunk[ \"lightmap_pars_fragment\" ],\n\n\t\t\t\"#ifdef USE_ENVMAP\",\n\n\t\t\t\t\"varying vec3 vWorldPosition;\",\n\n\t\t\t\t\"uniform float reflectivity;\",\n\t\t\t\t\"uniform samplerCube envMap;\",\n\t\t\t\t\"uniform float flipEnvMap;\",\n\t\t\t\t\"uniform int combine;\",\n\n\t\t\t\t\"uniform bool useRefract;\",\n\t\t\t\t\"uniform float refractionRatio;\",\n\n\t\t\t\t\"uniform sampler2D samplerNormalDepth;\",\n\t\t\t\t\"uniform float viewHeight;\",\n\t\t\t\t\"uniform float viewWidth;\",\n\n\t\t\t\"#endif\",\n\n\t\t\tTHREE.ShaderChunk[ \"fog_pars_fragment\" ],\n\t\t\tTHREE.ShaderChunk[ \"shadowmap_pars_fragment\" ],\n\t\t\tTHREE.ShaderChunk[ \"specularmap_pars_fragment\" ],\n\n\t\t\t\"const float unit = 255.0/256.0;\",\n\n\t\t\t\"float vec3_to_float( vec3 data ) {\",\n\n\t\t\t\t\"highp float compressed = fract( data.x * unit ) + floor( data.y * unit * 255.0 ) + floor( data.z * unit * 255.0 ) * 255.0;\",\n\t\t\t\t\"return compressed;\",\n\n\t\t\t\"}\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"const float opacity = 1.0;\",\n\n\t\t\t\t\"gl_FragColor = vec4( diffuse, opacity );\",\n\n\t\t\t\tTHREE.ShaderChunk[ \"map_fragment\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"alphatest_fragment\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"specularmap_fragment\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"lightmap_fragment\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"color_fragment\" ],\n\n\t\t\t\t\"#ifdef USE_ENVMAP\",\n\n\t\t\t\t\t\"vec2 texCoord = gl_FragCoord.xy / vec2( viewWidth, viewHeight );\",\n\t\t\t\t\t\"vec4 normalDepth = texture2D( samplerNormalDepth, texCoord );\",\n\t\t\t\t\t\"vec3 normal = normalDepth.xyz * 2.0 - 1.0;\",\n\n\t\t\t\t\t\"vec3 reflectVec;\",\n\n\t\t\t\t\t\"vec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\",\n\n\t\t\t\t\t\"if ( useRefract ) {\",\n\n\t\t\t\t\t\t\"reflectVec = refract( cameraToVertex, normal, refractionRatio );\",\n\n\t\t\t\t\t\"} else { \",\n\n\t\t\t\t\t\t\"reflectVec = reflect( cameraToVertex, normal );\",\n\n\t\t\t\t\t\"}\",\n\n\t\t\t\t\t\"#ifdef DOUBLE_SIDED\",\n\n\t\t\t\t\t\t\"float flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\",\n\t\t\t\t\t\t\"vec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\",\n\n\t\t\t\t\t\"#else\",\n\n\t\t\t\t\t\t\"vec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\",\n\n\t\t\t\t\t\"#endif\",\n\n\t\t\t\t\t\"#ifdef GAMMA_INPUT\",\n\n\t\t\t\t\t\t\"cubeColor.xyz *= cubeColor.xyz;\",\n\n\t\t\t\t\t\"#endif\",\n\n\t\t\t\t\t\"if ( combine == 1 ) {\",\n\n\t\t\t\t\t\t\"gl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularStrength * reflectivity );\",\n\n\t\t\t\t\t\"} else if ( combine == 2 ) {\",\n\n\t\t\t\t\t\t\"gl_FragColor.xyz += cubeColor.xyz * specularStrength * reflectivity;\",\n\n\t\t\t\t\t\"} else {\",\n\n\t\t\t\t\t\t\"gl_FragColor.xyz = mix( gl_FragColor.xyz, gl_FragColor.xyz * cubeColor.xyz, specularStrength * reflectivity );\",\n\n\t\t\t\t\t\"}\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\tTHREE.ShaderChunk[ \"shadowmap_fragment\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"fog_fragment\" ],\n\n\t\t\t\t//\n\n\t\t\t\t\"const float compressionScale = 0.999;\",\n\n\t\t\t\t//\n\n\t\t\t\t\"vec3 diffuseMapColor;\",\n\n\t\t\t\t\"#ifdef USE_MAP\",\n\n\t\t\t\t\t\"diffuseMapColor = texelColor.xyz;\",\n\n\t\t\t\t\"#else\",\n\n\t\t\t\t\t\"diffuseMapColor = vec3( 1.0 );\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t// diffuse color\n\n\t\t\t\t\"gl_FragColor.x = vec3_to_float( compressionScale * gl_FragColor.xyz );\",\n\n\t\t\t\t// specular color\n\n\t\t\t\t\"if ( additiveSpecular < 0.0 ) {\",\n\n\t\t\t\t\t\"gl_FragColor.y = vec3_to_float( compressionScale * specular );\",\n\n\t\t\t\t\"} else {\",\n\n\t\t\t\t\t\"gl_FragColor.y = vec3_to_float( compressionScale * specular * diffuseMapColor );\",\n\n\t\t\t\t\"}\",\n\n\t\t\t\t\"gl_FragColor.y *= additiveSpecular;\",\n\n\t\t\t\t// shininess\n\n\t\t\t\t\"gl_FragColor.z = wrapAround * shininess;\",\n\n\t\t\t\t// emissive color\n\n\t\t\t\t\"#ifdef USE_COLOR\",\n\n\t\t\t\t\t\"gl_FragColor.w = vec3_to_float( compressionScale * emissive * diffuseMapColor * vColor );\",\n\n\t\t\t\t\"#else\",\n\n\t\t\t\t\t\"gl_FragColor.w = vec3_to_float( compressionScale * emissive * diffuseMapColor );\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tvertexShader : [\n\n\t\t\tTHREE.ShaderChunk[ \"map_pars_vertex\" ],\n\t\t\tTHREE.ShaderChunk[ \"lightmap_pars_vertex\" ],\n\t\t\tTHREE.ShaderChunk[ \"color_pars_vertex\" ],\n\t\t\tTHREE.ShaderChunk[ \"morphtarget_pars_vertex\" ],\n\t\t\tTHREE.ShaderChunk[ \"skinning_pars_vertex\" ],\n\t\t\tTHREE.ShaderChunk[ \"shadowmap_pars_vertex\" ],\n\n\t\t\t\"#ifdef USE_ENVMAP\",\n\n\t\t\t\t\"varying vec3 vWorldPosition;\",\n\n\t\t\t\"#endif\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\tTHREE.ShaderChunk[ \"map_vertex\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"lightmap_vertex\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"color_vertex\" ],\n\n\t\t\t\tTHREE.ShaderChunk[ \"skinbase_vertex\" ],\n\n\t\t\t\tTHREE.ShaderChunk[ \"morphtarget_vertex\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"skinning_vertex\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"default_vertex\" ],\n\n\t\t\t\tTHREE.ShaderChunk[ \"worldpos_vertex\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"shadowmap_vertex\" ],\n\n\t\t\t\t\"#ifdef USE_ENVMAP\",\n\n\t\t\t\t\t\"vWorldPosition = worldPosition.xyz;\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t},\n\n\t\"normalDepth\" : {\n\n\t\tuniforms: {\n\n\t\t\tbumpMap: \t  { type: \"t\", value: null },\n\t\t\tbumpScale:\t  { type: \"f\", value: 1 },\n\t\t\toffsetRepeat: { type: \"v4\", value: new THREE.Vector4( 0, 0, 1, 1 ) }\n\n\t\t},\n\n\t\tfragmentShader : [\n\n\t\t\t\"#ifdef USE_BUMPMAP\",\n\n\t\t\t\t\"#extension GL_OES_standard_derivatives : enable\\n\",\n\n\t\t\t\t\"varying vec2 vUv;\",\n\t\t\t\t\"varying vec3 vViewPosition;\",\n\n\t\t\t\tTHREE.ShaderChunk[ \"bumpmap_pars_fragment\" ],\n\n\t\t\t\"#endif\",\n\n\t\t\t\"varying vec3 normalView;\",\n\t\t\t\"varying vec4 clipPos;\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"vec3 normal = normalize( normalView );\",\n\n\t\t\t\t\"#ifdef USE_BUMPMAP\",\n\n\t\t\t\t\t\"normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t\"gl_FragColor.xyz = normal * 0.5 + 0.5;\",\n\t\t\t\t\"gl_FragColor.w = clipPos.z / clipPos.w;\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tvertexShader : [\n\n\t\t\t\"varying vec3 normalView;\",\n\t\t\t\"varying vec4 clipPos;\",\n\n\t\t\t\"#ifdef USE_BUMPMAP\",\n\n\t\t\t\t\"varying vec2 vUv;\",\n\t\t\t\t\"varying vec3 vViewPosition;\",\n\n\t\t\t\t\"uniform vec4 offsetRepeat;\",\n\n\t\t\t\"#endif\",\n\n\t\t\tTHREE.ShaderChunk[ \"morphtarget_pars_vertex\" ],\n\t\t\tTHREE.ShaderChunk[ \"skinning_pars_vertex\" ],\n\n\t\t\t\"void main() {\",\n\n\t\t\t\tTHREE.ShaderChunk[ \"morphnormal_vertex\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"skinbase_vertex\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"skinnormal_vertex\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"defaultnormal_vertex\" ],\n\n\t\t\t\tTHREE.ShaderChunk[ \"morphtarget_vertex\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"skinning_vertex\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"default_vertex\" ],\n\n\t\t\t\t\"normalView = normalize( normalMatrix * objectNormal );\",\n\n\t\t\t\t\"#ifdef USE_BUMPMAP\",\n\n\t\t\t\t\t\"vUv = uv * offsetRepeat.zw + offsetRepeat.xy;\",\n\t\t\t\t\t\"vViewPosition = -mvPosition.xyz;\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t\"clipPos = gl_Position;\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t},\n\n\t\"composite\" : {\n\n\t\tuniforms: {\n\n\t\t\tsamplerLight: \t{ type: \"t\", value: null },\n\t\t\tbrightness:\t\t{ type: \"f\", value: 1 }\n\n\t\t},\n\n\t\tfragmentShader : [\n\n\t\t\t\"varying vec2 texCoord;\",\n\t\t\t\"uniform sampler2D samplerLight;\",\n\t\t\t\"uniform float brightness;\",\n\n\t\t\t// tonemapping operators\n\t\t\t// based on John Hable's HLSL snippets\n\t\t\t// from http://filmicgames.com/archives/75\n\n\t\t\t\"#ifdef TONEMAP_UNCHARTED\",\n\n\t\t\t\t\"const float A = 0.15;\",\n\t\t\t\t\"const float B = 0.50;\",\n\t\t\t\t\"const float C = 0.10;\",\n\t\t\t\t\"const float D = 0.20;\",\n\t\t\t\t\"const float E = 0.02;\",\n\t\t\t\t\"const float F = 0.30;\",\n\t\t\t\t\"const float W = 11.2;\",\n\n\t\t\t\t\"vec3 Uncharted2Tonemap( vec3 x ) {\",\n\n\t\t\t\t   \"return ( ( x * ( A * x + C * B ) + D * E ) / ( x * ( A * x + B ) + D * F ) ) - E / F;\",\n\n\t\t\t\t\"}\",\n\n\t\t\t\"#endif\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"vec3 inColor = texture2D( samplerLight, texCoord ).xyz;\",\n\t\t\t\t\"inColor *= brightness;\",\n\n\t\t\t\t\"vec3 outColor;\",\n\n\t\t\t\t\"#if defined( TONEMAP_SIMPLE )\",\n\n\t\t\t\t\t\"outColor = sqrt( inColor );\",\n\n\t\t\t\t\"#elif defined( TONEMAP_LINEAR )\",\n\n\t\t\t\t\t// simple linear to gamma conversion\n\n\t\t\t\t\t\"outColor = pow( inColor, vec3( 1.0 / 2.2 ) );\",\n\n\t\t\t\t\"#elif defined( TONEMAP_REINHARD )\",\n\n\t\t\t\t\t// Reinhard operator\n\n\t\t\t\t\t\"inColor = inColor / ( 1.0 + inColor );\",\n\t\t\t\t\t\"outColor = pow( inColor, vec3( 1.0 / 2.2 ) );\",\n\n\t\t\t\t\"#elif defined( TONEMAP_FILMIC )\",\n\n\t\t\t\t\t// filmic operator by Jim Hejl and Richard Burgess-Dawson\n\n\t\t\t\t\t\"vec3 x = max( vec3( 0.0 ), inColor - 0.004 );\",\n\t\t\t\t\t\"outColor = ( x * ( 6.2 * x + 0.5 ) ) / ( x * ( 6.2 * x + 1.7 ) + 0.06 );\",\n\n\t\t\t\t\"#elif defined( TONEMAP_UNCHARTED )\",\n\n\t\t\t\t\t// tonemapping operator from Uncharted 2 by John Hable\n\n\t\t\t\t\t\"float ExposureBias = 2.0;\",\n\t\t\t\t\t\"vec3 curr = Uncharted2Tonemap( ExposureBias * inColor );\",\n\n\t\t\t\t\t\"vec3 whiteScale = vec3( 1.0 ) / Uncharted2Tonemap( vec3( W ) );\",\n\t\t\t\t\t\"vec3 color = curr * whiteScale;\",\n\n\t\t\t\t\t\"outColor = pow( color, vec3( 1.0 / 2.2 ) );\",\n\n\t\t\t\t\"#else\",\n\n\t\t\t\t\t\"outColor = inColor;\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t\"gl_FragColor = vec4( outColor, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tvertexShader : [\n\n\t\t\t\"varying vec2 texCoord;\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"vec4 pos = vec4( sign( position.xy ), 0.0, 1.0 );\",\n\t\t\t\t\"texCoord = pos.xy * vec2( 0.5 ) + 0.5;\",\n\t\t\t\t\"gl_Position = pos;\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t},\n\n\t\"pointLight\" : {\n\n\t\tuniforms: {\n\n\t\t\tsamplerNormalDepth: { type: \"t\", value: null },\n\t\t\tsamplerColor: \t\t{ type: \"t\", value: null },\n\t\t\tmatProjInverse: { type: \"m4\", value: new THREE.Matrix4() },\n\t\t\tviewWidth: \t\t{ type: \"f\", value: 800 },\n\t\t\tviewHeight: \t{ type: \"f\", value: 600 },\n\n\t\t\tlightPositionVS:{ type: \"v3\", value: new THREE.Vector3( 0, 0, 0 ) },\n\t\t\tlightColor: \t{ type: \"c\", value: new THREE.Color( 0x000000 ) },\n\t\t\tlightIntensity: { type: \"f\", value: 1.0 },\n\t\t\tlightRadius: \t{ type: \"f\", value: 1.0 }\n\n\t\t},\n\n\t\tfragmentShader : [\n\n\t\t\t\"uniform sampler2D samplerColor;\",\n\t\t\t\"uniform sampler2D samplerNormalDepth;\",\n\n\t\t\t\"uniform float lightRadius;\",\n\t\t\t\"uniform float lightIntensity;\",\n\t\t\t\"uniform float viewHeight;\",\n\t\t\t\"uniform float viewWidth;\",\n\n\t\t\t\"uniform vec3 lightColor;\",\n\t\t\t\"uniform vec3 lightPositionVS;\",\n\n\t\t\t\"uniform mat4 matProjInverse;\",\n\n\t\t\tTHREE.DeferredShaderChunk[ \"unpackFloat\" ],\n\n\t\t\t\"void main() {\",\n\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeVertexPositionVS\" ],\n\n\t\t\t\t// bail out early when pixel outside of light sphere\n\n\t\t\t\t\"vec3 lightVector = lightPositionVS - vertexPositionVS.xyz;\",\n\t\t\t\t\"float distance = length( lightVector );\",\n\n\t\t\t\t\"if ( distance > lightRadius ) discard;\",\n\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeNormal\" ],\n\t\t\t\tTHREE.DeferredShaderChunk[ \"unpackColorMap\" ],\n\n\t\t\t\t// compute light\n\n\t\t\t\t\"lightVector = normalize( lightVector );\",\n\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeDiffuse\" ],\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeSpecular\" ],\n\n\t\t\t\t// combine\n\n\t\t\t\t\"float cutoff = 0.3;\",\n\t\t\t\t\"float denom = distance / lightRadius + 1.0;\",\n\t\t\t\t\"float attenuation = 1.0 / ( denom * denom );\",\n\t\t\t\t\"attenuation = ( attenuation - cutoff ) / ( 1.0 - cutoff );\",\n\t\t\t\t\"attenuation = max( attenuation, 0.0 );\",\n\t\t\t\t\"attenuation *= attenuation;\",\n\n\t\t\t\tTHREE.DeferredShaderChunk[ \"combine\" ],\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tvertexShader : [\n\n\t\t\t\"void main() { \",\n\n\t\t\t\t// sphere proxy needs real position\n\n\t\t\t\t\"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\",\n\t\t\t\t\"gl_Position = projectionMatrix * mvPosition;\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t},\n\n\t\"spotLight\" : {\n\n\t\tuniforms: {\n\n\t\t\tsamplerNormalDepth: { type: \"t\", value: null },\n\t\t\tsamplerColor: \t\t{ type: \"t\", value: null },\n\t\t\tmatProjInverse: { type: \"m4\", value: new THREE.Matrix4() },\n\t\t\tviewWidth: \t\t{ type: \"f\", value: 800 },\n\t\t\tviewHeight: \t{ type: \"f\", value: 600 },\n\n\t\t\tlightPositionVS :{ type: \"v3\", value: new THREE.Vector3( 0, 1, 0 ) },\n\t\t\tlightDirectionVS:{ type: \"v3\", value: new THREE.Vector3( 0, 1, 0 ) },\n\t\t\tlightColor: \t{ type: \"c\", value: new THREE.Color( 0x000000 ) },\n\t\t\tlightIntensity: { type: \"f\", value: 1.0 },\n\t\t\tlightDistance: \t{ type: \"f\", value: 1.0 },\n\t\t\tlightAngle: \t{ type: \"f\", value: 1.0 }\n\n\t\t},\n\n\t\tfragmentShader : [\n\n\t\t\t\"uniform vec3 lightPositionVS;\",\n\t\t\t\"uniform vec3 lightDirectionVS;\",\n\n\t\t\t\"uniform sampler2D samplerColor;\",\n\t\t\t\"uniform sampler2D samplerNormalDepth;\",\n\n\t\t\t\"uniform float viewHeight;\",\n\t\t\t\"uniform float viewWidth;\",\n\n\t\t\t\"uniform float lightAngle;\",\n\t\t\t\"uniform float lightIntensity;\",\n\t\t\t\"uniform vec3 lightColor;\",\n\n\t\t\t\"uniform mat4 matProjInverse;\",\n\n\t\t\tTHREE.DeferredShaderChunk[ \"unpackFloat\" ],\n\n\t\t\t\"void main() {\",\n\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeVertexPositionVS\" ],\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeNormal\" ],\n\t\t\t\tTHREE.DeferredShaderChunk[ \"unpackColorMap\" ],\n\n\t\t\t\t// compute light\n\n\t\t\t\t\"vec3 lightVector = normalize( lightPositionVS.xyz - vertexPositionVS.xyz );\",\n\n\t\t\t\t\"float rho = dot( lightDirectionVS, lightVector );\",\n\t\t\t\t\"float rhoMax = cos( lightAngle * 0.5 );\",\n\n\t\t\t\t\"if ( rho <= rhoMax ) discard;\",\n\n\t\t\t\t\"float theta = rhoMax + 0.0001;\",\n\t\t\t\t\"float phi = rhoMax + 0.05;\",\n\t\t\t\t\"float falloff = 4.0;\",\n\n\t\t\t\t\"float spot = 0.0;\",\n\n\t\t\t\t\"if ( rho >= phi ) {\",\n\n\t\t\t\t\t\"spot = 1.0;\",\n\n\t\t\t\t\"} else if ( rho <= theta ) {\",\n\n\t\t\t\t\t\"spot = 0.0;\",\n\n\t\t\t\t\"} else { \",\n\n\t\t\t\t\t\"spot = pow( ( rho - theta ) / ( phi - theta ), falloff );\",\n\n\t\t\t\t\"}\",\n\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeDiffuse\" ],\n\n\t\t\t\t\"diffuse *= spot;\",\n\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeSpecular\" ],\n\n\t\t\t\t// combine\n\n\t\t\t\t\"const float attenuation = 1.0;\",\n\n\t\t\t\tTHREE.DeferredShaderChunk[ \"combine\" ],\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tvertexShader : [\n\n\t\t\t\"void main() { \",\n\n\t\t\t\t// full screen quad proxy\n\n\t\t\t\t\"gl_Position = vec4( sign( position.xy ), 0.0, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t},\n\n\t\"directionalLight\" : {\n\n\t\tuniforms: {\n\n\t\t\tsamplerNormalDepth: { type: \"t\", value: null },\n\t\t\tsamplerColor: \t\t{ type: \"t\", value: null },\n\t\t\tmatProjInverse: { type: \"m4\", value: new THREE.Matrix4() },\n\t\t\tviewWidth: \t\t{ type: \"f\", value: 800 },\n\t\t\tviewHeight: \t{ type: \"f\", value: 600 },\n\n\t\t\tlightDirectionVS: { type: \"v3\", value: new THREE.Vector3( 0, 1, 0 ) },\n\t\t\tlightColor: \t{ type: \"c\", value: new THREE.Color( 0x000000 ) },\n\t\t\tlightIntensity: { type: \"f\", value: 1.0 }\n\n\t\t},\n\n\t\tfragmentShader : [\n\n\t\t\t\"uniform sampler2D samplerColor;\",\n\t\t\t\"uniform sampler2D samplerNormalDepth;\",\n\n\t\t\t\"uniform float lightRadius;\",\n\t\t\t\"uniform float lightIntensity;\",\n\t\t\t\"uniform float viewHeight;\",\n\t\t\t\"uniform float viewWidth;\",\n\n\t\t\t\"uniform vec3 lightColor;\",\n\t\t\t\"uniform vec3 lightDirectionVS;\",\n\n\t\t\t\"uniform mat4 matProjInverse;\",\n\n\t\t\tTHREE.DeferredShaderChunk[ \"unpackFloat\" ],\n\n\t\t\t\"void main() {\",\n\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeVertexPositionVS\" ],\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeNormal\" ],\n\t\t\t\tTHREE.DeferredShaderChunk[ \"unpackColorMap\" ],\n\n\t\t\t\t// compute light\n\n\t\t\t\t\"vec3 lightVector = lightDirectionVS;\",\n\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeDiffuse\" ],\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeSpecular\" ],\n\n\t\t\t\t// combine\n\n\t\t\t\t\"const float attenuation = 1.0;\",\n\n\t\t\t\tTHREE.DeferredShaderChunk[ \"combine\" ],\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tvertexShader : [\n\n\t\t\t\"void main() { \",\n\n\t\t\t\t// full screen quad proxy\n\n\t\t\t\t\"gl_Position = vec4( sign( position.xy ), 0.0, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t},\n\n\t\"hemisphereLight\" : {\n\n\t\tuniforms: {\n\n\t\t\tsamplerNormalDepth: { type: \"t\", value: null },\n\t\t\tsamplerColor: \t\t{ type: \"t\", value: null },\n\t\t\tmatProjInverse: { type: \"m4\", value: new THREE.Matrix4() },\n\t\t\tviewWidth: \t\t{ type: \"f\", value: 800 },\n\t\t\tviewHeight: \t{ type: \"f\", value: 600 },\n\n\t\t\tlightDirectionVS: { type: \"v3\", value: new THREE.Vector3( 0, 1, 0 ) },\n\t\t\tlightColorSky: \t  { type: \"c\", value: new THREE.Color( 0x000000 ) },\n\t\t\tlightColorGround: { type: \"c\", value: new THREE.Color( 0x000000 ) },\n\t\t\tlightIntensity:   { type: \"f\", value: 1.0 }\n\n\t\t},\n\n\t\tfragmentShader : [\n\n\t\t\t\"uniform sampler2D samplerColor;\",\n\t\t\t\"uniform sampler2D samplerNormalDepth;\",\n\n\t\t\t\"uniform float lightRadius;\",\n\t\t\t\"uniform float lightIntensity;\",\n\t\t\t\"uniform float viewHeight;\",\n\t\t\t\"uniform float viewWidth;\",\n\n\t\t\t\"uniform vec3 lightColorSky;\",\n\t\t\t\"uniform vec3 lightColorGround;\",\n\t\t\t\"uniform vec3 lightDirectionVS;\",\n\n\t\t\t\"uniform mat4 matProjInverse;\",\n\n\t\t\tTHREE.DeferredShaderChunk[ \"unpackFloat\" ],\n\n\t\t\t\"void main() {\",\n\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeVertexPositionVS\" ],\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeNormal\" ],\n\t\t\t\tTHREE.DeferredShaderChunk[ \"unpackColorMap\" ],\n\n\t\t\t\t// compute light\n\n\t\t\t\t\"vec3 lightVector = lightDirectionVS;\",\n\n\t\t\t\t// diffuse\n\n\t\t\t\t\"float dotProduct = dot( normal, lightVector );\",\n\t\t\t\t\"float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\",\n\n\t\t\t\t\"vec3 hemiColor = mix( lightColorGround, lightColorSky, hemiDiffuseWeight );\",\n\n\t\t\t\t\"vec3 diffuse = hemiColor;\",\n\n\t\t\t\t// specular (sky light)\n\n\t\t\t\t\"vec3 hemiHalfVectorSky = normalize( lightVector - vertexPositionVS.xyz );\",\n\t\t\t\t\"float hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;\",\n\t\t\t\t\"float hemiSpecularWeightSky = max( pow( hemiDotNormalHalfSky, shininess ), 0.0 );\",\n\n\t\t\t\t// specular (ground light)\n\n\t\t\t\t\"vec3 lVectorGround = -lightVector;\",\n\n\t\t\t\t\"vec3 hemiHalfVectorGround = normalize( lVectorGround - vertexPositionVS.xyz );\",\n\t\t\t\t\"float hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;\",\n\t\t\t\t\"float hemiSpecularWeightGround = max( pow( hemiDotNormalHalfGround, shininess ), 0.0 );\",\n\n\t\t\t\t\"float dotProductGround = dot( normal, lVectorGround );\",\n\n\t\t\t\t\"float specularNormalization = ( shininess + 2.0001 ) / 8.0;\",\n\n\t\t\t\t\"vec3 schlickSky = specularColor + vec3( 1.0 - specularColor ) * pow( 1.0 - dot( lightVector, hemiHalfVectorSky ), 5.0 );\",\n\t\t\t\t\"vec3 schlickGround = specularColor + vec3( 1.0 - specularColor ) * pow( 1.0 - dot( lVectorGround, hemiHalfVectorGround ), 5.0 );\",\n\t\t\t\t\"vec3 specular = hemiColor * specularNormalization * ( schlickSky * hemiSpecularWeightSky * max( dotProduct, 0.0 ) + schlickGround * hemiSpecularWeightGround * max( dotProductGround, 0.0 ) );\",\n\n\t\t\t\t// combine\n\n\t\t\t\t\"gl_FragColor = vec4( lightIntensity * ( albedo * diffuse + specular ), 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tvertexShader : [\n\n\t\t\t\"void main() { \",\n\n\t\t\t\t// full screen quad proxy\n\n\t\t\t\t\"gl_Position = vec4( sign( position.xy ), 0.0, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t},\n\n\t\"areaLight\" : {\n\n\t\tuniforms: {\n\n\t\t\tsamplerNormalDepth: { type: \"t\", value: null },\n\t\t\tsamplerColor: \t\t{ type: \"t\", value: null },\n\t\t\tmatProjInverse: { type: \"m4\", value: new THREE.Matrix4() },\n\t\t\tviewWidth: \t\t{ type: \"f\", value: 800 },\n\t\t\tviewHeight: \t{ type: \"f\", value: 600 },\n\n\t\t\tlightPositionVS: { type: \"v3\", value: new THREE.Vector3( 0, 1, 0 ) },\n\t\t\tlightNormalVS: \t { type: \"v3\", value: new THREE.Vector3( 0, -1, 0 ) },\n\t\t\tlightRightVS:  \t { type: \"v3\", value: new THREE.Vector3( 1, 0, 0 ) },\n\t\t\tlightUpVS:  \t { type: \"v3\", value: new THREE.Vector3( 1, 0, 0 ) },\n\n\t\t\tlightColor: \t{ type: \"c\", value: new THREE.Color( 0x000000 ) },\n\t\t\tlightIntensity: { type: \"f\", value: 1.0 },\n\n\t\t\tlightWidth:  { type: \"f\", value: 1.0 },\n\t\t\tlightHeight: { type: \"f\", value: 1.0 },\n\n\t\t\tconstantAttenuation:  { type: \"f\", value: 1.5 },\n\t\t\tlinearAttenuation:    { type: \"f\", value: 0.5 },\n\t\t\tquadraticAttenuation: { type: \"f\", value: 0.1 }\n\n\t\t},\n\n\t\tfragmentShader : [\n\n\t\t\t\"uniform vec3 lightPositionVS;\",\n\t\t\t\"uniform vec3 lightNormalVS;\",\n\t\t\t\"uniform vec3 lightRightVS;\",\n\t\t\t\"uniform vec3 lightUpVS;\",\n\n\t\t\t\"uniform sampler2D samplerColor;\",\n\t\t\t\"uniform sampler2D samplerNormalDepth;\",\n\n\t\t\t\"uniform float lightWidth;\",\n\t\t\t\"uniform float lightHeight;\",\n\n\t\t\t\"uniform float constantAttenuation;\",\n\t\t\t\"uniform float linearAttenuation;\",\n\t\t\t\"uniform float quadraticAttenuation;\",\n\n\t\t\t\"uniform float lightIntensity;\",\n\t\t\t\"uniform vec3 lightColor;\",\n\n\t\t\t\"uniform float viewHeight;\",\n\t\t\t\"uniform float viewWidth;\",\n\n\t\t\t\"uniform mat4 matProjInverse;\",\n\n\t\t\tTHREE.DeferredShaderChunk[ \"unpackFloat\" ],\n\n\t\t\t\"vec3 projectOnPlane( vec3 point, vec3 planeCenter, vec3 planeNorm ) {\",\n\n\t\t\t\t\"return point - dot( point - planeCenter, planeNorm ) * planeNorm;\",\n\n\t\t\t\"}\",\n\n\t\t\t\"bool sideOfPlane( vec3 point, vec3 planeCenter, vec3 planeNorm ) {\",\n\n\t\t\t\t\"return ( dot( point - planeCenter, planeNorm ) >= 0.0 );\",\n\n\t\t\t\"}\",\n\n\t\t\t\"vec3 linePlaneIntersect( vec3 lp, vec3 lv, vec3 pc, vec3 pn ) {\",\n\n\t\t\t\t\"return lp + lv * ( dot( pn, pc - lp ) / dot( pn, lv ) );\",\n\n\t\t\t\"}\",\n\n\t\t\t\"float calculateAttenuation( float dist ) {\",\n\n\t\t\t\t\"return ( 1.0 / ( constantAttenuation + linearAttenuation * dist + quadraticAttenuation * dist * dist ) );\",\n\n\t\t\t\"}\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeVertexPositionVS\" ],\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeNormal\" ],\n\t\t\t\tTHREE.DeferredShaderChunk[ \"unpackColorMap\" ],\n\n\t\t\t\t\"float w = lightWidth;\",\n\t\t\t\t\"float h = lightHeight;\",\n\n\t\t\t\t\"vec3 proj = projectOnPlane( vertexPositionVS.xyz, lightPositionVS, lightNormalVS );\",\n\t\t\t\t\"vec3 dir = proj - lightPositionVS;\",\n\n\t\t\t\t\"vec2 diagonal = vec2( dot( dir, lightRightVS ), dot( dir, lightUpVS ) );\",\n\t\t\t\t\"vec2 nearest2D = vec2( clamp( diagonal.x, -w, w ), clamp( diagonal.y, -h, h ) );\",\n\t\t\t\t\"vec3 nearestPointInside = vec3( lightPositionVS ) + ( lightRightVS * nearest2D.x + lightUpVS * nearest2D.y );\",\n\n\t\t\t\t\"vec3 lightDir = normalize( nearestPointInside - vertexPositionVS.xyz );\",\n\t\t\t\t\"float NdotL = max( dot( lightNormalVS, -lightDir ), 0.0 );\",\n\t\t\t\t\"float NdotL2 = max( dot( normal, lightDir ), 0.0 );\",\n\n\t\t\t\t//\"if ( NdotL2 * NdotL > 0.0 && sideOfPlane( vertexPositionVS.xyz, lightPositionVS, lightNormalVS ) ) {\",\n\t\t\t\t\"if ( NdotL2 * NdotL > 0.0 ) {\",\n\n\t\t\t\t\t// diffuse\n\n\t\t\t\t\t\"vec3 diffuse = vec3( sqrt( NdotL * NdotL2 ) );\",\n\n\t\t\t\t\t// specular\n\n\t\t\t\t\t\"vec3 specular = vec3( 0.0 );\",\n\n\t\t\t\t\t\"vec3 R = reflect( normalize( -vertexPositionVS.xyz ), normal );\",\n\t\t\t\t\t\"vec3 E = linePlaneIntersect( vertexPositionVS.xyz, R, vec3( lightPositionVS ), lightNormalVS );\",\n\n\t\t\t\t\t\"float specAngle = dot( R, lightNormalVS );\",\n\n\t\t\t\t\t\"if ( specAngle > 0.0 ) {\",\n\n\t\t\t\t\t\t\"vec3 dirSpec = E - vec3( lightPositionVS );\",\n\t\t\t\t\t\t\"vec2 dirSpec2D = vec2( dot( dirSpec, lightRightVS ), dot( dirSpec, lightUpVS ) );\",\n\t\t\t\t\t\t\"vec2 nearestSpec2D = vec2( clamp( dirSpec2D.x, -w, w ), clamp( dirSpec2D.y, -h, h ) );\",\n\t\t\t\t\t\t\"float specFactor = 1.0 - clamp( length( nearestSpec2D - dirSpec2D ) * 0.05 * shininess, 0.0, 1.0 );\",\n\t\t\t\t\t\t\"specular = specularColor * specFactor * specAngle * diffuse;\",\n\n\t\t\t\t\t\"}\",\n\n\t\t\t\t\t// combine\n\n\t\t\t\t\t\"float dist = distance( vertexPositionVS.xyz, nearestPointInside );\",\n\t\t\t\t\t\"float attenuation = calculateAttenuation( dist );\",\n\n\t\t\t\t\tTHREE.DeferredShaderChunk[ \"combine\" ],\n\n\t\t\t\t\"} else {\",\n\n\t\t\t\t\t\"discard;\",\n\n\t\t\t\t\"}\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tvertexShader : [\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t// full screen quad proxy\n\n\t\t\t\t\"gl_Position = vec4( sign( position.xy ), 0.0, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t},\n\n\t\"emissiveLight\" : {\n\n\t\tuniforms: {\n\n\t\t\tsamplerColor: \t{ type: \"t\", value: null },\n\t\t\tviewWidth: \t\t{ type: \"f\", value: 800 },\n\t\t\tviewHeight: \t{ type: \"f\", value: 600 },\n\n\t\t},\n\n\t\tfragmentShader : [\n\n\t\t\t\"uniform sampler2D samplerColor;\",\n\n\t\t\t\"uniform float viewHeight;\",\n\t\t\t\"uniform float viewWidth;\",\n\n\t\t\tTHREE.DeferredShaderChunk[ \"unpackFloat\" ],\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"vec2 texCoord = gl_FragCoord.xy / vec2( viewWidth, viewHeight );\",\n\n\t\t\t\t\"vec4 colorMap = texture2D( samplerColor, texCoord );\",\n\t\t\t\t\"vec3 emissiveColor = float_to_vec3( abs( colorMap.w ) );\",\n\n\t\t\t\t\"gl_FragColor = vec4( emissiveColor, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tvertexShader : [\n\n\t\t\t\"void main() { \",\n\n\t\t\t\t// full screen quad proxy\n\n\t\t\t\t\"gl_Position = vec4( sign( position.xy ), 0.0, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t}\n\n};\n"
        },
        "$:/plugins/rboue/Three.js-plus/icon": {
            "created": "20150122113649353",
            "modified": "20150122113650949",
            "title": "$:/plugins/rboue/Three.js-plus/icon",
            "type": "image/png",
            "text": "iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QA/wD/AP+gvaeTAAAACXBI\nWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wMRCAYZvJsQjgAAABl0RVh0Q29tbWVudABDcmVhdGVk\nIHdpdGggR0lNUFeBDhcAABHaSURBVHja7Z15VJNX3se/N7IoWElQgwiEVUBZBJdSSweFEZdaWjew\nIrZqO9O302l9562n9cx5zxydMzOnp6eli+2r09KilipuoxVKlUarUOqGBRcUiBKIiQjGLEAggZD7\n/kHTwRGyB7I837845Fnuc3+f53eX53d/l1BK4UqilOLBgwdob2+HQqGAQqGAUqmEWq2GUDMxPFWe\n22To/CrOvohw7wfCsWPHgs1mw8/PD2w2GwEBAfD39wchxKXqizg7ACqVCiKRCCKRCGKxGMHtm+36\nQGLuRyQ4OBihoaEICQmBr68vA8BISqfTQSQSQSAQoPJ2j9E32t4Sct4jUVFRiIqKAo/HA4vFYgCw\nh1tvampCXV0dvOtyHbrAvfH7SVxcHMLDw52iuXBoANra2nDp0iV4XnveKdupvoRiMnfuXAQEBDAA\nmOVWhUKcO3cOE1t+7xI9VFnY52TevHkICwtjADDk5uvr61FRUYEw2ZuuNTT5RS0T80laWhpiYmIc\npnlwCAAaGxvxww8/uKzhhwIhPT0d06ZNc28A7ty5gxMnToAn/ZNbGP6R55/8IVmyZAmCg4PdC4De\n3l6cOnUKrNpstzT8I5p1hGRkZMDT09P1ARAIBGg6nMwYfghF5VwhkZGRrgmAWq1GSUkJJtzayBjf\ngLpjvyLLli2Dl5fXiNxvRKat2trasL3wdD5jfOPyqV9P//blifD79++7hgeoqalB+4nfMIa3QAFL\nfyRJSUnOCQClFHw+H7rqFYzxrZBnynGSnp5ut3kDuzQBWq0WBw4cYIxvA/VdeJYePHgQWq3WOQDQ\naDQoKioCR/gyY3wbid30Ev3666+h0WgcG4DOzk78vfBkeGDrHxnj21hT7r5G/154Mryzs9MxAVAq\nlTh6dOfPo/193pWVKs9t+kdRZX5HR4djdQK7urpQtWMK89aPJAyv3yPjx48ffQ+gVqvxbtHpcMYk\nI6t3i06Hq9Xq0fUAWq0WRUVFYNr80dG9qZ+SdevWwcPDY+Q9gE6nw6FDhxjjj3LH8PDhw7DmJbbY\nA5SXl4NeXskY3wHkmXKcZGRkjJwHqKmpYYzvQOq78Cytr68fGQDa29uZuX0HVMvROdSSOQKzAOjr\n68MHR6rzmep2TB04cAD9/f326wOUlZVhzJUc5u13YLHmHCWZmZm29wDNzc2M8Z1AuuoV9M6dO7YF\noLe3Fw374xnjO4l2fXslT6fT2a4J4PP56L+0nAFgBNXs/z6ZPn06OBwOfHx80N/fD5VKBbFYDK/r\na43awi+dT5544gnrAWhvb0fNFxEuZ3wx9yPC5XIxbtw4AAMBLDKZDOyml0b1WaW8f5KFCxciICBg\n2HJQSnH16lVyryzVYFlTXhUTNpttHQB79+5FgOQPLgFA57TdJD4+HhEREdRQ0KVUKs2pr68/pKpc\nMqLPHZR1nsTHm97UarVafPPNN2R844tDnqOM/JLk5ORYDsDt27dx6+BMpzd+R1QhycjIeHvixInv\nmNWh0ulQU1NDpOXz7V4HcevrSXBwsNn3+SX0jgwXfRWz9joxtCaRZejCe76vc/qvfNwllSQ7O5ua\na3wAYLFYmD17Nn3qjTa0Bn5it8V8kdm1FhkfAAghWLhwIe2K3jNk+U6dOmWZB6irq4P4eIpTv/0z\nN94iU6bYJk6BUopTp04RW3eGe6YXkeXLl9O+vj6cPHmSnD17Fh0dHQgMDMTSpUuRkmKaDdRqNc5+\nMGnI32Jz60hoaKh5AOzatQvh8i1OC0DyS03+XC5XZuvrlpaWElvmK0h5VUxqa2vxyiuvoLGx8ZHr\nLly4kBQUFCA0NNToPX/88UcyVL9FyvsnWbdunekA3Lp1C7cPJTmt8X9ZYmWX8ut0OhQVFRFbdIxl\nYZ8THx8frF69mhqK+p00aVLOhQsXDkVEGB6N9fT0oOLDyUP+NiPvJgkJCTGtD3D+/Hnn9fuzjjxk\n/I6ODpSXl5Pdu3eTvXv3kjNnzhBrImlYLBZWrVplE7i4XC42bNhw21jIt1QqPfjCCy8Y/e4/btw4\nSAI+HrIvUFVVZVonUCaTYfKd/3Lat3/+/IEee01NDVmxYgXhcrlYvHgx3bhxI33xxRdpeno65XK5\n2LRpExEKhRZ17Hx9feHz1HdWdwq1F5+jCoUiwpRjq6qqKJ/PN3rPwMDAIf/PEb5M5XK5cQCqq6ud\n9uUf++S3xNvbG9u3bydz5syhx44do0PF0nd2dqKwsJBOnz6d7tmzxyJDmto5M6StB6eZde+ysjKj\nxzz22GPD/nb58mXDAPT39zt1oMfcuXOxZcsWsm3bNmrKXLhGo8HGjRvpzp07zYbAy8sLZPa/rPIC\nYrE425zjm5ubjR5jKD6w/9LyR+rlIQAEAoHTvv13p+wgx44dQ35+vlkAU0qxefNmev78ebONGRsb\na1WZvb29D5lzvI+Pj9FjjAWF3Lp1a3gA6urqnBYAHo+HLVu2WHRuX18fXn/9dbODKy2dvNHL3BxB\niYmJxkcWMsMj3xs3bgwNgFarxXBzys4g7cXnaGtrq8Xlr66uNtsLsFgstAfvtLgZ2Lroksnl9fLy\nwpo1awzXgVZr9GPWuJt5dHDU0K8ACIVCOLM+PZdhda+8pKTE7HOMfW0zprS0NJPK/dZbb5GwsDBq\nxL2bdK3BfQmWK7T/ANDQ0GD1NSxpAr29va2655tvvomEhASDhsvJySHbtm2jxiaoLl48/rMp9xxs\n618B4PQc6XJmAGQyWba115BKpSNebu+6XFpWVobt27eT4ODgh0CYOXMmKSwsJMXFxXTMmDEGr3Pp\n0iUSIPlrsin3PCvU5T8EgFKpREfjAafOe+7n53fI2mtwOByzz+np6bG67J+V/hy+detW2tLSQhsb\nG0l1dTWRSCSktraWbtiwgRrLDiIUConi9G9N7k8sUOT8Sb/CmAUMJGx0dg03A2aOwsPDLfE8Vt83\nVZ7b9LcvT0R0dHQ0TZs2jc6ePZtOnTrVJINeuXKFNBYnmN35FYvFrgXA/z5dY/UIJisry6zjKaWY\neu91m4ycUuW5TRd2BkfU1taaFKepUqnw7bffGg0LG04ikejfANy9e9fpAajgFK83NA1qTJGRkSQ9\nPd2symxtbbV5kEjbd0/RP+/67oPKykoilUpzBg/Zent70dTUREpLS8mPHwfA4+oai+FrbW0FABCd\nTofydx5zmaDPJX9WWXTewYMHSXa2ealry8vLiTNPnS/a2klYQ30hclbR5MNk6dKlZr+Vr732mtnG\nV6lUTr9AVqlUgjUaQx97idSsprt378amTZtMgoDFYuGdd94hO3bsMNuQFRUVTr99mFQqhUt5AGAg\n8KGgoADFxcUkLCxsWCMlJSURPp9P3n77bWpuEkaZTPaZK2Q6l8vl8FAoFC4FgE/9elpd/QNZs2YN\nzc7Oxrlz50hFRQXu3r0LFosFHo+HzMxMJCYmWmRAjUaD0tKCuQEuUFcKhQIeSqUSfnAtyfjpVDK1\ngQQFBdHU1FSamppqmz4GpSgpKSEBkr+6RKdZqVSC1d3dDVfU9b0xtL6+3mbttEajwb59+8hjgg0u\nM2JSqVRgCdST8uCiajk6h/70009W50JUKBRNe/bsIZNEr7jUGsmenh6QE//wdflVv21Bf6mZM+eZ\nWdOnTzerw9fV1YUzZ84QZ9230KSRkzsAoJeY+xFJTk5GdHQ0HS7LJqUUYrGYXL9+3S32NHIrAAZr\nQvQa1e2e9PH67/mUUiiVSrfbwcxtAWA0IBZTBQwAjBgAGDEAMHJPAKo4+yKYanBPCTnvEVbEWJmQ\nqQr3lI+PD1imrDdj5MIAWLuyhZHzis1mMwAwADAAuDcAkydPZmrCTcXlchkP4M6aMGECWIQQiLkf\nEaY63Et3p+wgwC8zgcHBwUyNuJn0NmcBA+lVGLmX9EkjGQ/AADCQW66CU7yeqRb3kJDzHvH19f03\nAAAwP8KriKka91BUVNSvf3sM/qfgMlM55qot6P+Iv78//Pz84OHhAS8vL3h7e4PFGni3ent7odVq\nodFooNFoIJPJIJfLRzX2cEgAeDweBIw9DUoZ+SUJDQ0Fj8cDl8vV5+2x0JC/Q3d3N8RiMWlpaUFL\nSwtC7v/3iEAxOGv4Q4smjh07hnE385gg0UHSJR0iCQkJVieFNEUajQY3b94k165dA1f8ql3up4nb\nR5599tmhARAIBGg6nOz2AFRwitfnzY8siomJoXpXPtLq6urCuXPnht0LyGL3P7CXwtAA9Pf3g/+u\nn1sDELjsJ5KQkGD2knF7qbOzE2fOnCGm7BVoijLf7iCDoX4I7zFjxsDj8W/cclr43tRPyW82tyMx\nMdFhjK8fomdlZdHQFdVWF8rriRLynx7tEf+WnJzsdsaXhX1O8vLyqCNHR8XGxtL4FxqsgiApKemR\n/z0CgL+/P+ThBW7jBSZEr1GtXr3aaCZOR1BQUBANee6iRbZRRHxBhkqEOWQPx5Q9Z11FPlFvjPf0\n9HSa8s6YMYO2TMw3G4Inn3xyyP8PCUBYWBiEnPfcwgtER0dTJyyzWceLJn0w5I5hwwIAAOnp6W7h\nAcaOHet0ZdZveG2qDNlyWABiYmLcIlBEKpXOcbYy379/3+RjWwM/IYOnfk0GAAAWLFjg8h7g8lBb\naTmwenp6YE7Gkvnz5xv83SAAkZGRLj8iIDWrqUgkcopnpJSirKzM5LJ2x35FjGVANzrPuXjxYpf3\nAje/nkElEglxdOOfPHmSmLOv06JFi4weYxQADoeDMXOPuXxf4PreGFpbW+uQz9nT04P9+/cTUrPa\nZOP7pfN/DfqwCgB9L9IdIobavnuK/mXX8YgbN244BAgajQZ8Pp9UfDgZE1t+b7Lx70z+kKSkpJjW\nBJqaQ6+5uRkN++Pd5kPR/ZBdZNasWYiOjqaGduO0h+RyOf/atWuZPVVPW1Tfw+0UbhUAAMDn89F/\nabnbfS1Uz/iaxMTEgMfj2eV7AaUU7e3tRCgUoq6uDsHtmy2u43GpZSQtLc30TrA5APT396OgoABh\nsjfd9pNxBad4/bxgFHG5XLDZbLDZbA6bzZZ5eXmZZOiuri4oFAqiUCggl8shkUjg3/w7m9Rne/BO\nkpeXB3O+ZpqdRrW9vR01X0QwUUMGAInwbCvy8vICpRRqtRqhD/5nROrryT+2EnO3zbEoj25DQwOa\n/zWbgcCBFJtbR0JDQ80+z6J4p5iYGKu3TmdkO3mmHLfI+BYDAACZmZnQxO1jIBjtoWLcPmLNhzuL\nASCEICsrC4qILxgIRknKyC9JVlYWrAlhsyrklRCCVatW/brUmNHI6e6UHWTlypWwNn7R6phnDw8P\n5Obmuk0AiSOo2f99kpubC1tMUNkk6N3b2xtr165FW9Bfahjz2Fdn2Ac/WLt2rdXb1ls1DBxOarUa\n+/fvt9l+uoweVmvgJ+T555+3aRSTTQEABmYLjxw5Ar/bmxgIbKiOqEKycuVK2Dp62eYAAANTnqWl\npbDVahZ3V19CMVm2bBnssWDFLgDoITh9+jS0F59jILBCXk+UkAULFsBeq5XsBoBeLS0tqN8Xx0Bg\ngeJfaCBBQUF2vYfdAQCA7u5uHD16FK6275699CD0M7J8+XKMxFK1EQFA3yRcvHgRitO/ZSAwIHbG\nKfL4449jpBaojhgAeonFYpSWliJcvoUBYZCa/d8nzzzzDOzt8kcdAL03uHr1Ku6VpTIQAJjydBVJ\nTEzEaCxLHxUA9Orq6sL3338Pn/r1bglCd+xXZNGiRTAletclAdBLIBDg7NmzI5YkabTVMjGfZGRk\nwNCSLbcCQC+hUIjKykoESP5AXdXwaWlpAwE1DpKFxKEA0EsikaCyshIc4csuAYIs7HMyb948hIWF\nOVzZHBIAvTo7O3H16lV0VSx2ShDGp50kM2fOxHA7lTMAmDFqaGpqQl1dHbzrch26wL3x+0lcXBzC\nw8PhSMmmnBqAwdLpdBCJRBAIBKi83ROeKs9tGtV+C+c9EhUVhaioKPB4PIxWXkG3AeA/pVKpIBKJ\nIBKJIJFIENT2hl0fSBLwMQkKCkJoaChCQkJGdQjHADCMOjo6IJVKoVQqoVAooFAo0N3dDZVKZXSR\nRsvEfOLr6wsfHx/9yh+w2WxMmjQJ5i66cAb9P0ino5gBTAIlAAAAAElFTkSuQmCC\n"
        },
        "$:/plugins/rboue/Three.js-plus/license": {
            "title": "$:/plugins/rboue/Three.js-plus/license",
            "text": "!Plugin license\nCopyright (C) 2015 René Boué (rboue) &lt;rboue01 (at) gmail (dot) com&gt;<br>\nAll rights reserved.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see <http://www.gnu.org/licenses/>.\n\n!Three.js r69 license\nThe Three.js r69 LICENSE file is as follows :\n\n```\nThe MIT License\n\nCopyright &copy; 2010-2014 three.js authors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n```"
        },
        "$:/plugins/rboue/Three.js-plus/readme": {
            "title": "$:/plugins/rboue/Three.js-plus/readme",
            "text": "Three.js r69 extras for ~TiddlyWiki (needs Three.js plugin)."
        }
    }
}
/*\
title: $:/plugins/rboue/Three.js/view3js.js
type: application/javascript
module-type: widget

The view3js widget displays a 3D view defined in a local tiddler.

```
<$view3js tiddler="TiddlerTitle" width="320" height="400" class="classnames"/>
```

The widget generates an HTML5 WebGL node with a 3D view produced by main javascript code tiddler.

The width and height attributes are interpreted as a number of pixels, and do not need to include the "px" suffix.
The path attribute contains a collection of pseudo-path directory to search files to be loaded.

\*/
(function() {

/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";

var CONST_NODE_ID_PREFIX = "ThreejsWidget"; // prefix of root node's id attribute
var CONST_MIN_HEIGHT = 300;                 // root node minimal height
var CONST_PLUGIN_PATH = "$:/plugins/rboue/Three.js";
var CONST_CONFIG_TIDDLER = "$:/config/rboue/Three.js";
var CONST_CONFIG_DEFAULT_TIDDLER = CONST_PLUGIN_PATH+"/config.json";

// Get session configuration.
var sessionConfig = null;
var configTiddler = $tw.wiki.getTiddler(CONST_CONFIG_TIDDLER);
if ((typeof(configTiddler) != "undefined") && configTiddler) {
  sessionConfig = $tw.wiki.getTiddlerData(configTiddler, null)
}
if (!sessionConfig) {
  var configTiddlerDefault = $tw.wiki.getTiddler(CONST_CONFIG_DEFAULT_TIDDLER);
  if ((typeof(configTiddlerDefault) != "undefined") && configTiddlerDefault) {
    sessionConfig = $tw.wiki.getTiddlerData(configTiddlerDefault, null)
  }
}

// Create objects
var Widget = require("$:/core/modules/widgets/widget.js").widget;
var StringView = require("./Lib/stringview.js").StringView;
var TiddlyWiki = require("./tiddlywiki.js").TiddlyWiki;
TiddlyWiki.init(sessionConfig);

var View3jsWidget = function(parseTreeNode,options) {
  this.initialise(parseTreeNode,options);
};
View3jsWidget.instanceNb = 0; // count class instances

// Inherit from the base widget class
View3jsWidget.prototype = new Widget();

//=======================================================================================

// Render this widget into the DOM
View3jsWidget.prototype.render = function(parent,nextSibling) {
  var fonc = "View3jsWidget.render";
  var self = this;

  // Debug tools
  var hack = {
    flagActiv: true, // Activate the logs
    log: function(mess, flagNoLog, fonc) {
      if (!hack.flagActiv || flagNoLog) return;
      var id = "[]";
      if (tiddlyWiki) id = "["+tiddlyWiki.widget.nodeRootId+"]";
      console.log(id+(fonc ? fonc+": " : "")+mess);
    },
    logPoint: function(x,y) {return "("+x+","+y+")";},
    // Following are flags activating logs for specific fonctionnalities.
    // Value : false to activate, true to desactivate (no log).
    bug: false,      // current bug investigation
    filesystem: true, // filesystem
    loader: true,     // loader
    sceneLoader: true,  // Scene loader
    render: true      // rendering
  };
  window.hack = hack;

  // Create objects (continued)
  // Unfortunately, we can't create THREE object at TiddlyWiki start time (i.e. before
  // any widget instance) :
  //   There is a complaint "ReferenceError: Float32Array is not defined" because a lot
  //   of code is running at load time (many functions auto-defines themselves, allocating
  //   Float32Array and returning a sub-function.
  //   Float32Array is an object specific to WebGL. It seems that TiddlyWiki denies the use
  //   of WebGL in sandbox environment !
  // The THREE module is loaded only once, thanks to the TiddlyWiki's load mechanism.
  window.StringView = StringView;
  window.TiddlyWiki = TiddlyWiki;
  window.THREE = require("./Lib/three-min.js").THREE;

  this.parentDomNode = parent;
  this.computeAttributes();
  this.execute();

  // Create element and assign attributes
  this.nodeRoot = this.document.createElement("div");
  this.nodeRootId = CONST_NODE_ID_PREFIX + "-" + ++View3jsWidget.instanceNb;
  this.nodeRoot.setAttribute("id", this.nodeRootId);
  if (this["class"])
    this.nodeRoot.setAttribute("class", this["class"]);
  if (this.width) {
    var widthStyle = parseInt(this.width,10) + "px";
    this.nodeRoot.setAttribute("width", widthStyle);
    this.nodeRoot.style.width = widthStyle;
  }
  if (this.height) {
    var heightStyle = parseInt(this.height,10) + "px";
    this.nodeRoot.setAttribute("height", heightStyle);
    this.nodeRoot.style.height = heightStyle;
  } else {
    this.nodeRoot.setAttribute("height", "" + CONST_MIN_HEIGHT + "px");
    this.nodeRoot.style.height = "" + CONST_MIN_HEIGHT + "px";
  }

  // Insert element
  parent.insertBefore(this.nodeRoot,nextSibling);
  this.domNodes.push(this.nodeRoot);

  // UI template
  var uiNodeCreate = function(id, that) {
    // Create a node : <div id="<id>"></div>
    var node = that.document.createElement("div");
    node.setAttribute("id", id);
    parent.insertBefore(node, nextSibling);
    that.domNodes.push(node);
    return node;
  };
  this.nodeError = uiNodeCreate(this.nodeRootId + "-error", this);

  // Test browser compatibility with WebGL
  var webgl = (function () {
    try {
      var canvas = document.createElement("canvas");
      return !! window.WebGLRenderingContext && (canvas.getContext("webgl") || canvas.getContext("experimental-webgl"));
    } catch(e) {
      return false;
    }
  })();
  if (!webgl) {
    this.nodeError.innerHTML = window.WebGLRenderingContext ?
      'Your graphics card does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" target="_blank">WebGL</a>.<br/>' +
      'Find out how to get it <a href="http://get.webgl.org/" target="_blank">here</a>.'
      :
      'Your browser does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" target="_blank">WebGL</a>.<br/>' +
      'Find out how to get it <a href="http://get.webgl.org/" target="_blank">here</a>.';
    return;
  }

  // Get code tiddler
  if (!this.tiddler) {
    this.nodeError.innerHTML = "Error: you must specify a code tiddler";
    return;
  }
  var tiddler = this.wiki.getTiddler(this.tiddler);
  if ((typeof(tiddler) == "undefined") || !tiddler) {
    this.nodeError.innerHTML = "Error: unknown tiddler: "+this.tiddler;
    return;
  }

  // Get widget configuration
  var widgetConfig = {};
  if (this.path) {
    widgetConfig.filesystem = {PATH: this.path};
  } else {
    if (sessionConfig && sessionConfig.filesystem) {
      widgetConfig.filesystem = {};
      if (sessionConfig.filesystem.PATH)
        widgetConfig.filesystem.PATH = sessionConfig.filesystem.PATH;
    }
  }

  window.tiddlyWiki = new TiddlyWiki(this, this.tiddler, widgetConfig);

  // Create viewer

  // Execute user code
  // Prototype :
  //   function main(input)
  //     Returns : {onTiddlerRefresh: <refresh function>}
  //
  this.input = {node: this.nodeRoot};
  try {
    this.output = eval(tiddler.fields.text+";main(this.input, this.opts);");
  } catch(e) {
    this.nodeError.innerHTML = "Error when executing javascript code in <b>"+this.tiddler+"</b> tiddler :<br><b>"+e+"</b>";
    alert("Stop on error"); // stop debug and log in case of deaf mad program
  }
};

// Compute the internal state of the widget
View3jsWidget.prototype.execute = function() {
  // Get our parameters
  this.tiddler = this.getAttribute("tiddler");
  this.width = this.getAttribute("width");
  this.height = this.getAttribute("height");
  this.path = this.getAttribute("path");
  this["class"] = this.getAttribute("class");
  this.opts = this.getAttribute("opts", undefined);

  if (this.opts) {
    try {
      this.opts = JSON.parse(this.opts);
    } catch (e) {
      
    }
  } else {
    this.opts = {};
  }
};

// Selectively refreshes the widget if needed. Returns true if the widget or any
// of its children needed re-rendering
View3jsWidget.prototype.refresh = function(changedTiddlers) {
  var fonc = "View3jsWidget.refresh";

  var changedAttributes = this.computeAttributes();
  if (changedAttributes.tiddler ||
      changedAttributes.width ||
      changedAttributes.height ||
      changedAttributes.path ||
      changedAttributes["class"] ||
      changedTiddlers[this.tiddler]) {
    this.refreshSelf();
    //hack.log("after this.refreshSelf()", false, fonc);
    return true;
  } else {
    //hack.log("other case", false, fonc);
    if (this.output && this.output.onTiddlerRefresh) this.output.onTiddlerRefresh();
    return false;
  }
};

exports.view3js = View3jsWidget;

})();


$:/core/ui/MoreSideBar/All
$:/core/ui/SideBar/More

{
    "tiddlers": {
        "$:/info/browser": {
            "title": "$:/info/browser",
            "text": "yes"
        },
        "$:/info/node": {
            "title": "$:/info/node",
            "text": "no"
        },
        "$:/info/url/full": {
            "title": "$:/info/url/full",
            "text": "file:///home/inmysocks/TiddlyWiki/Wikis/ThreeJSDataVis/output/index.html"
        },
        "$:/info/url/host": {
            "title": "$:/info/url/host",
            "text": ""
        },
        "$:/info/url/hostname": {
            "title": "$:/info/url/hostname",
            "text": ""
        },
        "$:/info/url/protocol": {
            "title": "$:/info/url/protocol",
            "text": "file:"
        },
        "$:/info/url/port": {
            "title": "$:/info/url/port",
            "text": ""
        },
        "$:/info/url/pathname": {
            "title": "$:/info/url/pathname",
            "text": "/home/inmysocks/TiddlyWiki/Wikis/ThreeJSDataVis/output/index.html"
        },
        "$:/info/url/search": {
            "title": "$:/info/url/search",
            "text": ""
        },
        "$:/info/url/origin": {
            "title": "$:/info/url/origin",
            "text": "null"
        }
    }
}
$:/themes/OokTech/Mobile
{
    "tiddlers": {
        "$:/themes/tiddlywiki/snowwhite/base": {
            "title": "$:/themes/tiddlywiki/snowwhite/base",
            "tags": "[[$:/tags/Stylesheet]]",
            "text": "\\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline\n\n.tc-sidebar-header {\n\ttext-shadow: 0 1px 0 <<colour sidebar-foreground-shadow>>;\n}\n\n.tc-tiddler-info {\n\t<<box-shadow \"inset 1px 2px 3px rgba(0,0,0,0.1)\">>\n}\n\n@media screen {\n\t.tc-tiddler-frame {\n\t\t<<box-shadow \"1px 1px 5px rgba(0, 0, 0, 0.3)\">>\n\t}\n}\n\n@media (max-width: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}}) {\n\t.tc-tiddler-frame {\n\t\t<<box-shadow none>>\n\t}\n}\n\n.tc-page-controls button svg, .tc-tiddler-controls button svg, .tc-topbar button svg {\n\t<<transition \"fill 150ms ease-in-out\">>\n}\n\n.tc-tiddler-controls button.tc-selected,\n.tc-page-controls button.tc-selected {\n\t<<filter \"drop-shadow(0px -1px 2px rgba(0,0,0,0.25))\">>\n}\n\n.tc-tiddler-frame input.tc-edit-texteditor {\n\t<<box-shadow \"inset 0 1px 8px rgba(0, 0, 0, 0.15)\">>\n}\n\n.tc-edit-tags {\n\t<<box-shadow \"inset 0 1px 8px rgba(0, 0, 0, 0.15)\">>\n}\n\n.tc-tiddler-frame .tc-edit-tags input.tc-edit-texteditor {\n\t<<box-shadow \"none\">>\n\tborder: none;\n\toutline: none;\n}\n\ncanvas.tc-edit-bitmapeditor  {\n\t<<box-shadow \"2px 2px 5px rgba(0, 0, 0, 0.5)\">>\n}\n\n.tc-drop-down {\n\tborder-radius: 4px;\n\t<<box-shadow \"2px 2px 10px rgba(0, 0, 0, 0.5)\">>\n}\n\n.tc-block-dropdown {\n\tborder-radius: 4px;\n\t<<box-shadow \"2px 2px 10px rgba(0, 0, 0, 0.5)\">>\n}\n\n.tc-modal {\n\tborder-radius: 6px;\n\t<<box-shadow \"0 3px 7px rgba(0,0,0,0.3)\">>\n}\n\n.tc-modal-footer {\n\tborder-radius: 0 0 6px 6px;\n\t<<box-shadow \"inset 0 1px 0 #fff\">>;\n}\n\n\n.tc-alert {\n\tborder-radius: 6px;\n\t<<box-shadow \"0 3px 7px rgba(0,0,0,0.6)\">>\n}\n\n.tc-notification {\n\tborder-radius: 6px;\n\t<<box-shadow \"0 3px 7px rgba(0,0,0,0.3)\">>\n\ttext-shadow: 0 1px 0 rgba(255,255,255, 0.8);\n}\n\n.tc-sidebar-lists .tc-tab-set .tc-tab-divider {\n\tborder-top: none;\n\theight: 1px;\n\t<<background-linear-gradient \"left, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.0) 100%\">>\n}\n\n.tc-more-sidebar > .tc-tab-set > .tc-tab-buttons > button {\n\t<<background-linear-gradient \"left, rgba(0,0,0,0.01) 0%, rgba(0,0,0,0.1) 100%\">>\n}\n\n.tc-more-sidebar > .tc-tab-set > .tc-tab-buttons > button.tc-tab-selected {\n\t<<background-linear-gradient \"left, rgba(0,0,0,0.05) 0%, rgba(255,255,255,0.05) 100%\">>\n}\n\n.tc-message-box img {\n\t<<box-shadow \"1px 1px 3px rgba(0,0,0,0.5)\">>\n}\n\n.tc-plugin-info {\n\t<<box-shadow \"1px 1px 3px rgba(0,0,0,0.5)\">>\n}\n"
        }
    }
}
{
    "tiddlers": {
        "$:/themes/tiddlywiki/vanilla/themetweaks": {
            "title": "$:/themes/tiddlywiki/vanilla/themetweaks",
            "tags": "$:/tags/ControlPanel/Appearance",
            "caption": "{{$:/language/ThemeTweaks/ThemeTweaks}}",
            "text": "\\define lingo-base() $:/language/ThemeTweaks/\n\n\\define replacement-text()\n[img[$(imageTitle)$]]\n\\end\n\n\\define backgroundimage-dropdown()\n<div class=\"tc-drop-down-wrapper\">\n<$button popup=<<qualify \"$:/state/popup/themetweaks/backgroundimage\">> class=\"tc-btn-invisible tc-btn-dropdown\">{{$:/core/images/down-arrow}}</$button>\n<$reveal state=<<qualify \"$:/state/popup/themetweaks/backgroundimage\">> type=\"popup\" position=\"belowleft\" text=\"\" default=\"\">\n<div class=\"tc-drop-down\">\n<$macrocall $name=\"image-picker\" actions=\"\"\"\n\n<$action-setfield\n\t$tiddler=\"$:/themes/tiddlywiki/vanilla/settings/backgroundimage\"\n\t$value=<<imageTitle>>\n/>\n\n\"\"\"/>\n</div>\n</$reveal>\n</div>\n\\end\n\n\\define backgroundimageattachment-dropdown()\n<$select tiddler=\"$:/themes/tiddlywiki/vanilla/settings/backgroundimageattachment\" default=\"scroll\">\n<option value=\"scroll\"><<lingo Settings/BackgroundImageAttachment/Scroll>></option>\n<option value=\"fixed\"><<lingo Settings/BackgroundImageAttachment/Fixed>></option>\n</$select>\n\\end\n\n\\define backgroundimagesize-dropdown()\n<$select tiddler=\"$:/themes/tiddlywiki/vanilla/settings/backgroundimagesize\" default=\"scroll\">\n<option value=\"auto\"><<lingo Settings/BackgroundImageSize/Auto>></option>\n<option value=\"cover\"><<lingo Settings/BackgroundImageSize/Cover>></option>\n<option value=\"contain\"><<lingo Settings/BackgroundImageSize/Contain>></option>\n</$select>\n\\end\n\n<<lingo ThemeTweaks/Hint>>\n\n! <<lingo Options>>\n\n|<$link to=\"$:/themes/tiddlywiki/vanilla/options/sidebarlayout\"><<lingo Options/SidebarLayout>></$link> |<$select tiddler=\"$:/themes/tiddlywiki/vanilla/options/sidebarlayout\"><option value=\"fixed-fluid\"><<lingo Options/SidebarLayout/Fixed-Fluid>></option><option value=\"fluid-fixed\"><<lingo Options/SidebarLayout/Fluid-Fixed>></option></$select> |\n|<$link to=\"$:/themes/tiddlywiki/vanilla/options/stickytitles\"><<lingo Options/StickyTitles>></$link><br>//<<lingo Options/StickyTitles/Hint>>// |<$select tiddler=\"$:/themes/tiddlywiki/vanilla/options/stickytitles\"><option value=\"no\">{{$:/language/No}}</option><option value=\"yes\">{{$:/language/Yes}}</option></$select> |\n|<$link to=\"$:/themes/tiddlywiki/vanilla/options/codewrapping\"><<lingo Options/CodeWrapping>></$link> |<$select tiddler=\"$:/themes/tiddlywiki/vanilla/options/codewrapping\"><option value=\"pre\">{{$:/language/No}}</option><option value=\"pre-wrap\">{{$:/language/Yes}}</option></$select> |\n\n! <<lingo Settings>>\n\n|<$link to=\"$:/themes/tiddlywiki/vanilla/settings/fontfamily\"><<lingo Settings/FontFamily>></$link> |<$edit-text tiddler=\"$:/themes/tiddlywiki/vanilla/settings/fontfamily\" default=\"\" tag=\"input\"/> | |\n|<$link to=\"$:/themes/tiddlywiki/vanilla/settings/codefontfamily\"><<lingo Settings/CodeFontFamily>></$link> |<$edit-text tiddler=\"$:/themes/tiddlywiki/vanilla/settings/codefontfamily\" default=\"\" tag=\"input\"/> | |\n|<$link to=\"$:/themes/tiddlywiki/vanilla/settings/backgroundimage\"><<lingo Settings/BackgroundImage>></$link> |<$edit-text tiddler=\"$:/themes/tiddlywiki/vanilla/settings/backgroundimage\" default=\"\" tag=\"input\"/> |<<backgroundimage-dropdown>> |\n|<$link to=\"$:/themes/tiddlywiki/vanilla/settings/backgroundimageattachment\"><<lingo Settings/BackgroundImageAttachment>></$link> |<<backgroundimageattachment-dropdown>> | |\n|<$link to=\"$:/themes/tiddlywiki/vanilla/settings/backgroundimagesize\"><<lingo Settings/BackgroundImageSize>></$link> |<<backgroundimagesize-dropdown>> | |\n\n! <<lingo Metrics>>\n\n|<$link to=\"$:/themes/tiddlywiki/vanilla/metrics/fontsize\"><<lingo Metrics/FontSize>></$link> |<$edit-text tiddler=\"$:/themes/tiddlywiki/vanilla/metrics/fontsize\" default=\"\" tag=\"input\"/> |\n|<$link to=\"$:/themes/tiddlywiki/vanilla/metrics/lineheight\"><<lingo Metrics/LineHeight>></$link> |<$edit-text tiddler=\"$:/themes/tiddlywiki/vanilla/metrics/lineheight\" default=\"\" tag=\"input\"/> |\n|<$link to=\"$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize\"><<lingo Metrics/BodyFontSize>></$link> |<$edit-text tiddler=\"$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize\" default=\"\" tag=\"input\"/> |\n|<$link to=\"$:/themes/tiddlywiki/vanilla/metrics/bodylineheight\"><<lingo Metrics/BodyLineHeight>></$link> |<$edit-text tiddler=\"$:/themes/tiddlywiki/vanilla/metrics/bodylineheight\" default=\"\" tag=\"input\"/> |\n|<$link to=\"$:/themes/tiddlywiki/vanilla/metrics/storyleft\"><<lingo Metrics/StoryLeft>></$link><br>//<<lingo Metrics/StoryLeft/Hint>>// |^<$edit-text tiddler=\"$:/themes/tiddlywiki/vanilla/metrics/storyleft\" default=\"\" tag=\"input\"/> |\n|<$link to=\"$:/themes/tiddlywiki/vanilla/metrics/storytop\"><<lingo Metrics/StoryTop>></$link><br>//<<lingo Metrics/StoryTop/Hint>>// |^<$edit-text tiddler=\"$:/themes/tiddlywiki/vanilla/metrics/storytop\" default=\"\" tag=\"input\"/> |\n|<$link to=\"$:/themes/tiddlywiki/vanilla/metrics/storyright\"><<lingo Metrics/StoryRight>></$link><br>//<<lingo Metrics/StoryRight/Hint>>// |^<$edit-text tiddler=\"$:/themes/tiddlywiki/vanilla/metrics/storyright\" default=\"\" tag=\"input\"/> |\n|<$link to=\"$:/themes/tiddlywiki/vanilla/metrics/storywidth\"><<lingo Metrics/StoryWidth>></$link><br>//<<lingo Metrics/StoryWidth/Hint>>// |^<$edit-text tiddler=\"$:/themes/tiddlywiki/vanilla/metrics/storywidth\" default=\"\" tag=\"input\"/> |\n|<$link to=\"$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth\"><<lingo Metrics/TiddlerWidth>></$link><br>//<<lingo Metrics/TiddlerWidth/Hint>>//<br> |^<$edit-text tiddler=\"$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth\" default=\"\" tag=\"input\"/> |\n|<$link to=\"$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint\"><<lingo Metrics/SidebarBreakpoint>></$link><br>//<<lingo Metrics/SidebarBreakpoint/Hint>>// |^<$edit-text tiddler=\"$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint\" default=\"\" tag=\"input\"/> |\n|<$link to=\"$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth\"><<lingo Metrics/SidebarWidth>></$link><br>//<<lingo Metrics/SidebarWidth/Hint>>// |^<$edit-text tiddler=\"$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth\" default=\"\" tag=\"input\"/> |\n"
        },
        "$:/themes/tiddlywiki/vanilla/base": {
            "title": "$:/themes/tiddlywiki/vanilla/base",
            "tags": "[[$:/tags/Stylesheet]]",
            "text": "\\define custom-background-datauri()\n<$set name=\"background\" value={{$:/themes/tiddlywiki/vanilla/settings/backgroundimage}}>\n<$list filter=\"[<background>is[image]]\">\n`background: url(`\n<$list filter=\"[<background>!has[_canonical_uri]]\">\n<$macrocall $name=\"datauri\" title={{$:/themes/tiddlywiki/vanilla/settings/backgroundimage}}/>\n</$list>\n<$list filter=\"[<background>has[_canonical_uri]]\">\n<$view tiddler={{$:/themes/tiddlywiki/vanilla/settings/backgroundimage}} field=\"_canonical_uri\"/>\n</$list>\n`) center center;`\n`background-attachment: `{{$:/themes/tiddlywiki/vanilla/settings/backgroundimageattachment}}`;\n-webkit-background-size:` {{$:/themes/tiddlywiki/vanilla/settings/backgroundimagesize}}`;\n-moz-background-size:` {{$:/themes/tiddlywiki/vanilla/settings/backgroundimagesize}}`;\n-o-background-size:` {{$:/themes/tiddlywiki/vanilla/settings/backgroundimagesize}}`;\nbackground-size:` {{$:/themes/tiddlywiki/vanilla/settings/backgroundimagesize}}`;`\n</$list>\n</$set>\n\\end\n\n\\define if-fluid-fixed(text,hiddenSidebarText)\n<$reveal state=\"$:/themes/tiddlywiki/vanilla/options/sidebarlayout\" type=\"match\" text=\"fluid-fixed\">\n$text$\n<$reveal state=\"$:/state/sidebar\" type=\"nomatch\" text=\"yes\" default=\"yes\">\n$hiddenSidebarText$\n</$reveal>\n</$reveal>\n\\end\n\n\\define if-editor-height-fixed(then,else)\n<$reveal state=\"$:/config/TextEditor/EditorHeight/Mode\" type=\"match\" text=\"fixed\">\n$then$\n</$reveal>\n<$reveal state=\"$:/config/TextEditor/EditorHeight/Mode\" type=\"match\" text=\"auto\">\n$else$\n</$reveal>\n\\end\n\n\\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline macrocallblock\n\n/*\n** Start with the normalize CSS reset, and then belay some of its effects\n*/\n\n{{$:/themes/tiddlywiki/vanilla/reset}}\n\n*, input[type=\"search\"] {\n\tbox-sizing: border-box;\n\t-moz-box-sizing: border-box;\n\t-webkit-box-sizing: border-box;\n}\n\nhtml button {\n\tline-height: 1.2;\n\tcolor: <<colour button-foreground>>;\n\tbackground: <<colour button-background>>;\n\tborder-color: <<colour button-border>>;\n}\n\n/*\n** Basic element styles\n*/\n\nhtml {\n\tfont-family: {{$:/themes/tiddlywiki/vanilla/settings/fontfamily}};\n\ttext-rendering: optimizeLegibility; /* Enables kerning and ligatures etc. */\n\t-webkit-font-smoothing: antialiased;\n\t-moz-osx-font-smoothing: grayscale;\n}\n\nhtml:-webkit-full-screen {\n\tbackground-color: <<colour page-background>>;\n}\n\nbody.tc-body {\n\tfont-size: {{$:/themes/tiddlywiki/vanilla/metrics/fontsize}};\n\tline-height: {{$:/themes/tiddlywiki/vanilla/metrics/lineheight}};\n\tword-wrap: break-word;\n\t<<custom-background-datauri>>\n\tcolor: <<colour foreground>>;\n\tbackground-color: <<colour page-background>>;\n\tfill: <<colour foreground>>;\n}\n\nh1, h2, h3, h4, h5, h6 {\n\tline-height: 1.2;\n\tfont-weight: 300;\n}\n\npre {\n\tdisplay: block;\n\tpadding: 14px;\n\tmargin-top: 1em;\n\tmargin-bottom: 1em;\n\tword-break: normal;\n\tword-wrap: break-word;\n\twhite-space: {{$:/themes/tiddlywiki/vanilla/options/codewrapping}};\n\tbackground-color: <<colour pre-background>>;\n\tborder: 1px solid <<colour pre-border>>;\n\tpadding: 0 3px 2px;\n\tborder-radius: 3px;\n\tfont-family: {{$:/themes/tiddlywiki/vanilla/settings/codefontfamily}};\n}\n\ncode {\n\tcolor: <<colour code-foreground>>;\n\tbackground-color: <<colour code-background>>;\n\tborder: 1px solid <<colour code-border>>;\n\twhite-space: {{$:/themes/tiddlywiki/vanilla/options/codewrapping}};\n\tpadding: 0 3px 2px;\n\tborder-radius: 3px;\n\tfont-family: {{$:/themes/tiddlywiki/vanilla/settings/codefontfamily}};\n}\n\nblockquote {\n\tborder-left: 5px solid <<colour blockquote-bar>>;\n\tmargin-left: 25px;\n\tpadding-left: 10px;\n\tquotes: \"\\201C\"\"\\201D\"\"\\2018\"\"\\2019\";\n}\n\nblockquote.tc-big-quote {\n\tfont-family: Georgia, serif;\n\tposition: relative;\n\tbackground: <<colour pre-background>>;\n\tborder-left: none;\n\tmargin-left: 50px;\n\tmargin-right: 50px;\n\tpadding: 10px;\n    border-radius: 8px;\n}\n\nblockquote.tc-big-quote cite:before {\n\tcontent: \"\\2014 \\2009\";\n}\n\nblockquote.tc-big-quote:before {\n\tfont-family: Georgia, serif;\n\tcolor: <<colour blockquote-bar>>;\n\tcontent: open-quote;\n\tfont-size: 8em;\n\tline-height: 0.1em;\n\tmargin-right: 0.25em;\n\tvertical-align: -0.4em;\n\tposition: absolute;\n    left: -50px;\n    top: 42px;\n}\n\nblockquote.tc-big-quote:after {\n\tfont-family: Georgia, serif;\n\tcolor: <<colour blockquote-bar>>;\n\tcontent: close-quote;\n\tfont-size: 8em;\n\tline-height: 0.1em;\n\tmargin-right: 0.25em;\n\tvertical-align: -0.4em;\n\tposition: absolute;\n    right: -80px;\n    bottom: -20px;\n}\n\ndl dt {\n\tfont-weight: bold;\n\tmargin-top: 6px;\n}\n\ntextarea,\ninput[type=text],\ninput[type=search],\ninput[type=\"\"],\ninput:not([type]) {\n\tcolor: <<colour foreground>>;\n\tbackground: <<colour background>>;\n}\n\n.tc-muted {\n\tcolor: <<colour muted-foreground>>;\n}\n\nsvg.tc-image-button {\n\tpadding: 0px 1px 1px 0px;\n}\n\n.tc-icon-wrapper > svg {\n\twidth: 1em;\n\theight: 1em;\n}\n\nkbd {\n\tdisplay: inline-block;\n\tpadding: 3px 5px;\n\tfont-size: 0.8em;\n\tline-height: 1.2;\n\tcolor: <<colour foreground>>;\n\tvertical-align: middle;\n\tbackground-color: <<colour background>>;\n\tborder: solid 1px <<colour muted-foreground>>;\n\tborder-bottom-color: <<colour muted-foreground>>;\n\tborder-radius: 3px;\n\tbox-shadow: inset 0 -1px 0 <<colour muted-foreground>>;\n}\n\n/*\nMarkdown likes putting code elements inside pre elements\n*/\npre > code {\n\tpadding: 0;\n\tborder: none;\n\tbackground-color: inherit;\n\tcolor: inherit;\n}\n\ntable {\n\tborder: 1px solid <<colour table-border>>;\n\twidth: auto;\n\tmax-width: 100%;\n\tcaption-side: bottom;\n\tmargin-top: 1em;\n\tmargin-bottom: 1em;\n}\n\ntable th, table td {\n\tpadding: 0 7px 0 7px;\n\tborder-top: 1px solid <<colour table-border>>;\n\tborder-left: 1px solid <<colour table-border>>;\n}\n\ntable thead tr td, table th {\n\tbackground-color: <<colour table-header-background>>;\n\tfont-weight: bold;\n}\n\ntable tfoot tr td {\n\tbackground-color: <<colour table-footer-background>>;\n}\n\n.tc-csv-table {\n\twhite-space: nowrap;\n}\n\n.tc-tiddler-frame img,\n.tc-tiddler-frame svg,\n.tc-tiddler-frame canvas,\n.tc-tiddler-frame embed,\n.tc-tiddler-frame iframe {\n\tmax-width: 100%;\n}\n\n.tc-tiddler-body > embed,\n.tc-tiddler-body > iframe {\n\twidth: 100%;\n\theight: 600px;\n}\n\n/*\n** Links\n*/\n\nbutton.tc-tiddlylink,\na.tc-tiddlylink {\n\ttext-decoration: none;\n\tfont-weight: normal;\n\tcolor: <<colour tiddler-link-foreground>>;\n\t-webkit-user-select: inherit; /* Otherwise the draggable attribute makes links impossible to select */\n}\n\n.tc-sidebar-lists a.tc-tiddlylink {\n\tcolor: <<colour sidebar-tiddler-link-foreground>>;\n}\n\n.tc-sidebar-lists a.tc-tiddlylink:hover {\n\tcolor: <<colour sidebar-tiddler-link-foreground-hover>>;\n}\n\nbutton.tc-tiddlylink:hover,\na.tc-tiddlylink:hover {\n\ttext-decoration: underline;\n}\n\na.tc-tiddlylink-resolves {\n}\n\na.tc-tiddlylink-shadow {\n\tfont-weight: bold;\n}\n\na.tc-tiddlylink-shadow.tc-tiddlylink-resolves {\n\tfont-weight: normal;\n}\n\na.tc-tiddlylink-missing {\n\tfont-style: italic;\n}\n\na.tc-tiddlylink-external {\n\ttext-decoration: underline;\n\tcolor: <<colour external-link-foreground>>;\n\tbackground-color: <<colour external-link-background>>;\n}\n\na.tc-tiddlylink-external:visited {\n\tcolor: <<colour external-link-foreground-visited>>;\n\tbackground-color: <<colour external-link-background-visited>>;\n}\n\na.tc-tiddlylink-external:hover {\n\tcolor: <<colour external-link-foreground-hover>>;\n\tbackground-color: <<colour external-link-background-hover>>;\n}\n\n/*\n** Drag and drop styles\n*/\n\n.tc-tiddler-dragger {\n\tposition: relative;\n\tz-index: -10000;\n}\n\n.tc-tiddler-dragger-inner {\n\tposition: absolute;\n\ttop: -1000px;\n\tleft: -1000px;\n\tdisplay: inline-block;\n\tpadding: 8px 20px;\n\tfont-size: 16.9px;\n\tfont-weight: bold;\n\tline-height: 20px;\n\tcolor: <<colour dragger-foreground>>;\n\ttext-shadow: 0 1px 0 rgba(0, 0, 0, 1);\n\twhite-space: nowrap;\n\tvertical-align: baseline;\n\tbackground-color: <<colour dragger-background>>;\n\tborder-radius: 20px;\n}\n\n.tc-tiddler-dragger-cover {\n\tposition: absolute;\n\tbackground-color: <<colour page-background>>;\n}\n\n.tc-dropzone {\n\tposition: relative;\n}\n\n.tc-dropzone.tc-dragover:before {\n\tz-index: 10000;\n\tdisplay: block;\n\tposition: fixed;\n\ttop: 0;\n\tleft: 0;\n\tright: 0;\n\tbackground: <<colour dropzone-background>>;\n\ttext-align: center;\n\tcontent: \"<<lingo DropMessage>>\";\n}\n\n.tc-droppable > .tc-droppable-placeholder {\n\tdisplay: none;\n}\n\n.tc-droppable.tc-dragover > .tc-droppable-placeholder {\n\tdisplay: block;\n\tborder: 2px dashed <<colour dropzone-background>>;\n}\n\n.tc-draggable {\n\tcursor: move;\n}\n\n/*\n** Plugin reload warning\n*/\n\n.tc-plugin-reload-warning {\n\tz-index: 1000;\n\tdisplay: block;\n\tposition: fixed;\n\ttop: 0;\n\tleft: 0;\n\tright: 0;\n\tbackground: <<colour alert-background>>;\n\ttext-align: center;\n}\n\n/*\n** Buttons\n*/\n\nbutton svg, button img, label svg, label img {\n\tvertical-align: middle;\n}\n\n.tc-btn-invisible {\n\tpadding: 0;\n\tmargin: 0;\n\tbackground: none;\n\tborder: none;\n    cursor: pointer;\n}\n\n.tc-btn-boxed {\n\tfont-size: 0.6em;\n\tpadding: 0.2em;\n\tmargin: 1px;\n\tbackground: none;\n\tborder: 1px solid <<colour tiddler-controls-foreground>>;\n\tborder-radius: 0.25em;\n}\n\nhtml body.tc-body .tc-btn-boxed svg {\n\tfont-size: 1.6666em;\n}\n\n.tc-btn-boxed:hover {\n\tbackground: <<colour muted-foreground>>;\n\tcolor: <<colour background>>;\n}\n\nhtml body.tc-body .tc-btn-boxed:hover svg {\n\tfill: <<colour background>>;\n}\n\n.tc-btn-rounded {\n\tfont-size: 0.5em;\n\tline-height: 2;\n\tpadding: 0em 0.3em 0.2em 0.4em;\n\tmargin: 1px;\n\tborder: 1px solid <<colour muted-foreground>>;\n\tbackground: <<colour muted-foreground>>;\n\tcolor: <<colour background>>;\n\tborder-radius: 2em;\n}\n\nhtml body.tc-body .tc-btn-rounded svg {\n\tfont-size: 1.6666em;\n\tfill: <<colour background>>;\n}\n\n.tc-btn-rounded:hover {\n\tborder: 1px solid <<colour muted-foreground>>;\n\tbackground: <<colour background>>;\n\tcolor: <<colour muted-foreground>>;\n}\n\nhtml body.tc-body .tc-btn-rounded:hover svg {\n\tfill: <<colour muted-foreground>>;\n}\n\n.tc-btn-icon svg {\n\theight: 1em;\n\twidth: 1em;\n\tfill: <<colour muted-foreground>>;\n}\n\n.tc-btn-text {\n\tpadding: 0;\n\tmargin: 0;\n}\n\n.tc-btn-big-green {\n\tdisplay: inline-block;\n\tpadding: 8px;\n\tmargin: 4px 8px 4px 8px;\n\tbackground: <<colour download-background>>;\n\tcolor: <<colour download-foreground>>;\n\tfill: <<colour download-foreground>>;\n\tborder: none;\n\tfont-size: 1.2em;\n\tline-height: 1.4em;\n\ttext-decoration: none;\n}\n\n.tc-btn-big-green svg,\n.tc-btn-big-green img {\n\theight: 2em;\n\twidth: 2em;\n\tvertical-align: middle;\n\tfill: <<colour download-foreground>>;\n}\n\n.tc-sidebar-lists input {\n\tcolor: <<colour foreground>>;\n}\n\n.tc-sidebar-lists button {\n\tcolor: <<colour sidebar-button-foreground>>;\n\tfill: <<colour sidebar-button-foreground>>;\n}\n\n.tc-sidebar-lists button.tc-btn-mini {\n\tcolor: <<colour sidebar-muted-foreground>>;\n}\n\n.tc-sidebar-lists button.tc-btn-mini:hover {\n\tcolor: <<colour sidebar-muted-foreground-hover>>;\n}\n\nbutton svg.tc-image-button, button .tc-image-button img {\n\theight: 1em;\n\twidth: 1em;\n}\n\n.tc-unfold-banner {\n\tposition: absolute;\n\tpadding: 0;\n\tmargin: 0;\n\tbackground: none;\n\tborder: none;\n\twidth: 100%;\n\twidth: calc(100% + 2px);\n\tmargin-left: -43px;\n\ttext-align: center;\n\tborder-top: 2px solid <<colour tiddler-info-background>>;\n\tmargin-top: 4px;\n}\n\n.tc-unfold-banner:hover {\n\tbackground: <<colour tiddler-info-background>>;\n\tborder-top: 2px solid <<colour tiddler-info-border>>;\n}\n\n.tc-unfold-banner svg, .tc-fold-banner svg {\n\theight: 0.75em;\n\tfill: <<colour tiddler-controls-foreground>>;\n}\n\n.tc-unfold-banner:hover svg, .tc-fold-banner:hover svg {\n\tfill: <<colour tiddler-controls-foreground-hover>>;\n}\n\n.tc-fold-banner {\n\tposition: absolute;\n\tpadding: 0;\n\tmargin: 0;\n\tbackground: none;\n\tborder: none;\n\twidth: 23px;\n\ttext-align: center;\n\tmargin-left: -35px;\n\ttop: 6px;\n\tbottom: 6px;\n}\n\n.tc-fold-banner:hover {\n\tbackground: <<colour tiddler-info-background>>;\n}\n\n@media (max-width: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}}) {\n\n\t.tc-unfold-banner {\n\t\tposition: static;\n\t\twidth: calc(100% + 59px);\n\t}\n\n\t.tc-fold-banner {\n\t\twidth: 16px;\n\t\tmargin-left: -16px;\n\t\tfont-size: 0.75em;\n\t}\n\n}\n\n/*\n** Tags and missing tiddlers\n*/\n\n.tc-tag-list-item {\n\tposition: relative;\n\tdisplay: inline-block;\n\tmargin-right: 7px;\n}\n\n.tc-tags-wrapper {\n\tmargin: 4px 0 14px 0;\n}\n\n.tc-missing-tiddler-label {\n\tfont-style: italic;\n\tfont-weight: normal;\n\tdisplay: inline-block;\n\tfont-size: 11.844px;\n\tline-height: 14px;\n\twhite-space: nowrap;\n\tvertical-align: baseline;\n}\n\nbutton.tc-tag-label, span.tc-tag-label {\n\tdisplay: inline-block;\n\tpadding: 0.16em 0.7em;\n\tfont-size: 0.9em;\n\tfont-weight: 400;\n\tline-height: 1.2em;\n\tcolor: <<colour tag-foreground>>;\n\twhite-space: nowrap;\n\tvertical-align: baseline;\n\tbackground-color: <<colour tag-background>>;\n\tborder-radius: 1em;\n}\n\n.tc-untagged-separator {\n\twidth: 10em;\n\tleft: 0;\n\tmargin-left: 0;\n\tborder: 0;\n\theight: 1px;\n\tbackground: <<colour tab-divider>>;\n}\n\nbutton.tc-untagged-label {\n\tbackground-color: <<colour untagged-background>>;\n}\n\n.tc-tag-label svg, .tc-tag-label img {\n\theight: 1em;\n\twidth: 1em;\n\tfill: <<colour tag-foreground>>;\n\tvertical-align: text-bottom;\n}\n\n.tc-tag-manager-table .tc-tag-label {\n\twhite-space: normal;\n}\n\n.tc-tag-manager-tag {\n\twidth: 100%;\n}\n\n/*\n** Page layout\n*/\n\n.tc-topbar {\n\tposition: fixed;\n\tz-index: 1200;\n}\n\n.tc-topbar-left {\n\tleft: 29px;\n\ttop: 5px;\n}\n\n.tc-topbar-right {\n\ttop: 5px;\n\tright: 29px;\n}\n\n.tc-topbar button {\n\tpadding: 8px;\n}\n\n.tc-topbar svg {\n\tfill: <<colour muted-foreground>>;\n}\n\n.tc-topbar button:hover svg {\n\tfill: <<colour foreground>>;\n}\n\n.tc-sidebar-header {\n\tcolor: <<colour sidebar-foreground>>;\n\tfill: <<colour sidebar-foreground>>;\n}\n\n.tc-sidebar-header .tc-title a.tc-tiddlylink-resolves {\n\tfont-weight: 300;\n}\n\n.tc-sidebar-header .tc-sidebar-lists p {\n\tmargin-top: 3px;\n\tmargin-bottom: 3px;\n}\n\n.tc-sidebar-header .tc-missing-tiddler-label {\n\tcolor: <<colour sidebar-foreground>>;\n}\n\n.tc-advanced-search input {\n\twidth: 60%;\n}\n\n.tc-search a svg {\n\twidth: 1.2em;\n\theight: 1.2em;\n\tvertical-align: middle;\n}\n\n.tc-page-controls {\n\tmargin-top: 14px;\n\tfont-size: 1.5em;\n}\n\n.tc-page-controls button {\n\tmargin-right: 0.5em;\n}\n\n.tc-page-controls a.tc-tiddlylink:hover {\n\ttext-decoration: none;\n}\n\n.tc-page-controls img {\n\twidth: 1em;\n}\n\n.tc-page-controls svg {\n\tfill: <<colour sidebar-controls-foreground>>;\n}\n\n.tc-page-controls button:hover svg, .tc-page-controls a:hover svg {\n\tfill: <<colour sidebar-controls-foreground-hover>>;\n}\n\n.tc-menu-list-item {\n\twhite-space: nowrap;\n}\n\n.tc-menu-list-count {\n\tfont-weight: bold;\n}\n\n.tc-menu-list-subitem {\n\tpadding-left: 7px;\n}\n\n.tc-story-river {\n\tposition: relative;\n}\n\n@media (max-width: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}}) {\n\n\t.tc-sidebar-header {\n\t\tpadding: 14px;\n\t\tmin-height: 32px;\n\t\tmargin-top: {{$:/themes/tiddlywiki/vanilla/metrics/storytop}};\n\t}\n\n\t.tc-story-river {\n\t\tposition: relative;\n\t\tpadding: 0;\n\t}\n}\n\n@media (min-width: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}}) {\n\n\t.tc-message-box {\n\t\tmargin: 21px -21px 21px -21px;\n\t}\n\n\t.tc-sidebar-scrollable {\n\t\tposition: fixed;\n\t\ttop: {{$:/themes/tiddlywiki/vanilla/metrics/storytop}};\n\t\tleft: {{$:/themes/tiddlywiki/vanilla/metrics/storyright}};\n\t\tbottom: 0;\n\t\tright: 0;\n\t\toverflow-y: auto;\n\t\toverflow-x: auto;\n\t\t-webkit-overflow-scrolling: touch;\n\t\tmargin: 0 0 0 -42px;\n\t\tpadding: 71px 0 28px 42px;\n\t}\n\n\thtml[dir=\"rtl\"] .tc-sidebar-scrollable {\n\t\tleft: auto;\n\t\tright: {{$:/themes/tiddlywiki/vanilla/metrics/storyright}};\n\t}\n\n\t.tc-story-river {\n\t\tposition: relative;\n\t\tleft: {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}};\n\t\ttop: {{$:/themes/tiddlywiki/vanilla/metrics/storytop}};\n\t\twidth: {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}};\n\t\tpadding: 42px 42px 42px 42px;\n\t}\n\n<<if-no-sidebar \"\n\n\t.tc-story-river {\n\t\twidth: calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}});\n\t}\n\n\">>\n\n}\n\n@media print {\n\n\tbody.tc-body {\n\t\tbackground-color: transparent;\n\t}\n\n\t.tc-sidebar-header, .tc-topbar {\n\t\tdisplay: none;\n\t}\n\n\t.tc-story-river {\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t}\n\n\t.tc-story-river .tc-tiddler-frame {\n\t\tmargin: 0;\n\t\tborder: none;\n\t\tpadding: 0;\n\t}\n}\n\n/*\n** Tiddler styles\n*/\n\n.tc-tiddler-frame {\n\tposition: relative;\n\tmargin-bottom: 28px;\n\tbackground-color: <<colour tiddler-background>>;\n\tborder: 1px solid <<colour tiddler-border>>;\n}\n\n{{$:/themes/tiddlywiki/vanilla/sticky}}\n\n.tc-tiddler-info {\n\tpadding: 14px 42px 14px 42px;\n\tbackground-color: <<colour tiddler-info-background>>;\n\tborder-top: 1px solid <<colour tiddler-info-border>>;\n\tborder-bottom: 1px solid <<colour tiddler-info-border>>;\n}\n\n.tc-tiddler-info p {\n\tmargin-top: 3px;\n\tmargin-bottom: 3px;\n}\n\n.tc-tiddler-info .tc-tab-buttons button.tc-tab-selected {\n\tbackground-color: <<colour tiddler-info-tab-background>>;\n\tborder-bottom: 1px solid <<colour tiddler-info-tab-background>>;\n}\n\n.tc-view-field-table {\n\twidth: 100%;\n}\n\n.tc-view-field-name {\n\twidth: 1%; /* Makes this column be as narrow as possible */\n\ttext-align: right;\n\tfont-style: italic;\n\tfont-weight: 200;\n}\n\n.tc-view-field-value {\n}\n\n@media (max-width: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}}) {\n\t.tc-tiddler-frame {\n\t\tpadding: 14px 14px 14px 14px;\n\t}\n\n\t.tc-tiddler-info {\n\t\tmargin: 0 -14px 0 -14px;\n\t}\n}\n\n@media (min-width: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}}) {\n\t.tc-tiddler-frame {\n\t\tpadding: 28px 42px 42px 42px;\n\t\twidth: {{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}};\n\t\tborder-radius: 2px;\n\t}\n\n<<if-no-sidebar \"\n\n\t.tc-tiddler-frame {\n\t\twidth: 100%;\n\t}\n\n\">>\n\n\t.tc-tiddler-info {\n\t\tmargin: 0 -42px 0 -42px;\n\t}\n}\n\n.tc-site-title,\n.tc-titlebar {\n\tfont-weight: 300;\n\tfont-size: 2.35em;\n\tline-height: 1.2em;\n\tcolor: <<colour tiddler-title-foreground>>;\n\tmargin: 0;\n}\n\n.tc-site-title {\n\tcolor: <<colour site-title-foreground>>;\n}\n\n.tc-tiddler-title-icon {\n\tvertical-align: middle;\n}\n\n.tc-system-title-prefix {\n\tcolor: <<colour muted-foreground>>;\n}\n\n.tc-titlebar h2 {\n\tfont-size: 1em;\n\tdisplay: inline;\n}\n\n.tc-titlebar img {\n\theight: 1em;\n}\n\n.tc-subtitle {\n\tfont-size: 0.9em;\n\tcolor: <<colour tiddler-subtitle-foreground>>;\n\tfont-weight: 300;\n}\n\n.tc-tiddler-missing .tc-title {\n  font-style: italic;\n  font-weight: normal;\n}\n\n.tc-tiddler-frame .tc-tiddler-controls {\n\tfloat: right;\n}\n\n.tc-tiddler-controls .tc-drop-down {\n\tfont-size: 0.6em;\n}\n\n.tc-tiddler-controls .tc-drop-down .tc-drop-down {\n\tfont-size: 1em;\n}\n\n.tc-tiddler-controls > span > button {\n\tvertical-align: baseline;\n\tmargin-left:5px;\n}\n\n.tc-tiddler-controls button svg, .tc-tiddler-controls button img,\n.tc-search button svg, .tc-search a svg {\n\tfill: <<colour tiddler-controls-foreground>>;\n}\n\n.tc-tiddler-controls button svg, .tc-tiddler-controls button img {\n\theight: 0.75em;\n}\n\n.tc-search button svg, .tc-search a svg {\n    height: 1.2em;\n    width: 1.2em;\n    margin: 0 0.25em;\n}\n\n.tc-tiddler-controls button.tc-selected svg,\n.tc-page-controls button.tc-selected svg  {\n\tfill: <<colour tiddler-controls-foreground-selected>>;\n}\n\n.tc-tiddler-controls button.tc-btn-invisible:hover svg,\n.tc-search button:hover svg, .tc-search a:hover svg {\n\tfill: <<colour tiddler-controls-foreground-hover>>;\n}\n\n@media print {\n\t.tc-tiddler-controls {\n\t\tdisplay: none;\n\t}\n}\n\n.tc-tiddler-help { /* Help prompts within tiddler template */\n\tcolor: <<colour muted-foreground>>;\n\tmargin-top: 14px;\n}\n\n.tc-tiddler-help a.tc-tiddlylink {\n\tcolor: <<colour very-muted-foreground>>;\n}\n\n.tc-tiddler-frame .tc-edit-texteditor {\n\twidth: 100%;\n\tmargin: 4px 0 4px 0;\n}\n\n.tc-tiddler-frame input.tc-edit-texteditor,\n.tc-tiddler-frame textarea.tc-edit-texteditor,\n.tc-tiddler-frame iframe.tc-edit-texteditor {\n\tpadding: 3px 3px 3px 3px;\n\tborder: 1px solid <<colour tiddler-editor-border>>;\n\tbackground-color: <<colour tiddler-editor-background>>;\n\tline-height: 1.3em;\n\t-webkit-appearance: none;\n}\n\n.tc-tiddler-frame .tc-binary-warning {\n\twidth: 100%;\n\theight: 5em;\n\ttext-align: center;\n\tpadding: 3em 3em 6em 3em;\n\tbackground: <<colour alert-background>>;\n\tborder: 1px solid <<colour alert-border>>;\n}\n\ncanvas.tc-edit-bitmapeditor  {\n\tborder: 6px solid <<colour tiddler-editor-border-image>>;\n\tcursor: crosshair;\n\t-moz-user-select: none;\n\t-webkit-user-select: none;\n\t-ms-user-select: none;\n\tmargin-top: 6px;\n\tmargin-bottom: 6px;\n}\n\n.tc-edit-bitmapeditor-width {\n\tdisplay: block;\n}\n\n.tc-edit-bitmapeditor-height {\n\tdisplay: block;\n}\n\n.tc-tiddler-body {\n\tclear: both;\n}\n\n.tc-tiddler-frame .tc-tiddler-body {\n\tfont-size: {{$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize}};\n\tline-height: {{$:/themes/tiddlywiki/vanilla/metrics/bodylineheight}};\n}\n\n.tc-titlebar, .tc-tiddler-edit-title {\n\toverflow: hidden; /* https://github.com/Jermolene/TiddlyWiki5/issues/282 */\n}\n\nhtml body.tc-body.tc-single-tiddler-window {\n\tmargin: 1em;\n\tbackground: <<colour tiddler-background>>;\n}\n\n.tc-single-tiddler-window img,\n.tc-single-tiddler-window svg,\n.tc-single-tiddler-window canvas,\n.tc-single-tiddler-window embed,\n.tc-single-tiddler-window iframe {\n\tmax-width: 100%;\n}\n\n/*\n** Editor\n*/\n\n.tc-editor-toolbar {\n\tmargin-top: 8px;\n}\n\n.tc-editor-toolbar button {\n\tvertical-align: middle;\n\tbackground-color: <<colour tiddler-controls-foreground>>;\n\tfill: <<colour tiddler-controls-foreground-selected>>;\n\tborder-radius: 4px;\n\tpadding: 3px;\n\tmargin: 2px 0 2px 4px;\n}\n\n.tc-editor-toolbar button.tc-text-editor-toolbar-item-adjunct {\n\tmargin-left: 1px;\n\twidth: 1em;\n\tborder-radius: 8px;\n}\n\n.tc-editor-toolbar button.tc-text-editor-toolbar-item-start-group {\n\tmargin-left: 11px;\n}\n\n.tc-editor-toolbar button.tc-selected {\n\tbackground-color: <<colour primary>>;\n}\n\n.tc-editor-toolbar button svg {\n\twidth: 1.6em;\n\theight: 1.2em;\n}\n\n.tc-editor-toolbar button:hover {\n\tbackground-color: <<colour tiddler-controls-foreground-selected>>;\n\tfill: <<colour background>>;\n}\n\n.tc-editor-toolbar .tc-text-editor-toolbar-more {\n\twhite-space: normal;\n}\n\n.tc-editor-toolbar .tc-text-editor-toolbar-more button {\n\tdisplay: inline-block;\n\tpadding: 3px;\n\twidth: auto;\n}\n\n.tc-editor-toolbar .tc-search-results {\n\tpadding: 0;\n}\n\n/*\n** Adjustments for fluid-fixed mode\n*/\n\n@media (min-width: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}}) {\n\n<<if-fluid-fixed text:\"\"\"\n\n\t.tc-story-river {\n\t\tpadding-right: 0;\n\t\tposition: relative;\n\t\twidth: auto;\n\t\tleft: 0;\n\t\tmargin-left: {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}};\n\t\tmargin-right: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}};\n\t}\n\n\t.tc-tiddler-frame {\n\t\twidth: 100%;\n\t}\n\n\t.tc-sidebar-scrollable {\n\t\tleft: auto;\n\t\tbottom: 0;\n\t\tright: 0;\n\t\twidth: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}};\n\t}\n\n\tbody.tc-body .tc-storyview-zoomin-tiddler {\n\t\twidth: 100%;\n\t\twidth: calc(100% - 42px);\n\t}\n\n\"\"\" hiddenSidebarText:\"\"\"\n\n\t.tc-story-river {\n\t\tpadding-right: 3em;\n\t\tmargin-right: 0;\n\t}\n\n\tbody.tc-body .tc-storyview-zoomin-tiddler {\n\t\twidth: 100%;\n\t\twidth: calc(100% - 84px);\n\t}\n\n\"\"\">>\n\n}\n\n/*\n** Toolbar buttons\n*/\n\n.tc-page-controls svg.tc-image-new-button {\n  fill: <<colour toolbar-new-button>>;\n}\n\n.tc-page-controls svg.tc-image-options-button {\n  fill: <<colour toolbar-options-button>>;\n}\n\n.tc-page-controls svg.tc-image-save-button {\n  fill: <<colour toolbar-save-button>>;\n}\n\n.tc-tiddler-controls button svg.tc-image-info-button {\n  fill: <<colour toolbar-info-button>>;\n}\n\n.tc-tiddler-controls button svg.tc-image-edit-button {\n  fill: <<colour toolbar-edit-button>>;\n}\n\n.tc-tiddler-controls button svg.tc-image-close-button {\n  fill: <<colour toolbar-close-button>>;\n}\n\n.tc-tiddler-controls button svg.tc-image-delete-button {\n  fill: <<colour toolbar-delete-button>>;\n}\n\n.tc-tiddler-controls button svg.tc-image-cancel-button {\n  fill: <<colour toolbar-cancel-button>>;\n}\n\n.tc-tiddler-controls button svg.tc-image-done-button {\n  fill: <<colour toolbar-done-button>>;\n}\n\n/*\n** Tiddler edit mode\n*/\n\n.tc-tiddler-edit-frame em.tc-edit {\n\tcolor: <<colour muted-foreground>>;\n\tfont-style: normal;\n}\n\n.tc-edit-type-dropdown a.tc-tiddlylink-missing {\n\tfont-style: normal;\n}\n\n.tc-edit-tags {\n\tborder: 1px solid <<colour tiddler-editor-border>>;\n\tpadding: 4px 8px 4px 8px;\n}\n\n.tc-edit-add-tag {\n\tdisplay: inline-block;\n}\n\n.tc-edit-add-tag .tc-add-tag-name input {\n\twidth: 50%;\n}\n\n.tc-edit-add-tag .tc-keyboard {\n\tdisplay:inline;\n}\n\n.tc-edit-tags .tc-tag-label {\n\tdisplay: inline-block;\n}\n\n.tc-edit-tags-list {\n\tmargin: 14px 0 14px 0;\n}\n\n.tc-remove-tag-button {\n\tpadding-left: 4px;\n}\n\n.tc-tiddler-preview {\n\toverflow: auto;\n}\n\n.tc-tiddler-preview-preview {\n\tfloat: right;\n\twidth: 49%;\n\tborder: 1px solid <<colour tiddler-editor-border>>;\n\tmargin: 4px 0 3px 3px;\n\tpadding: 3px 3px 3px 3px;\n}\n\n<<if-editor-height-fixed then:\"\"\"\n\n.tc-tiddler-preview-preview {\n\toverflow-y: scroll;\n\theight: {{$:/config/TextEditor/EditorHeight/Height}};\n}\n\n\"\"\">>\n\n.tc-tiddler-frame .tc-tiddler-preview .tc-edit-texteditor {\n\twidth: 49%;\n}\n\n.tc-tiddler-frame .tc-tiddler-preview canvas.tc-edit-bitmapeditor {\n\tmax-width: 49%;\n}\n\n.tc-edit-fields {\n\twidth: 100%;\n}\n\n\n.tc-edit-fields table, .tc-edit-fields tr, .tc-edit-fields td {\n\tborder: none;\n\tpadding: 4px;\n}\n\n.tc-edit-fields > tbody > .tc-edit-field:nth-child(odd) {\n\tbackground-color: <<colour tiddler-editor-fields-odd>>;\n}\n\n.tc-edit-fields > tbody > .tc-edit-field:nth-child(even) {\n\tbackground-color: <<colour tiddler-editor-fields-even>>;\n}\n\n.tc-edit-field-name {\n\ttext-align: right;\n}\n\n.tc-edit-field-value input {\n\twidth: 100%;\n}\n\n.tc-edit-field-remove {\n}\n\n.tc-edit-field-remove svg {\n\theight: 1em;\n\twidth: 1em;\n\tfill: <<colour muted-foreground>>;\n\tvertical-align: middle;\n}\n\n.tc-edit-field-add-name {\n\tdisplay: inline-block;\n\twidth: 15%;\n}\n\n.tc-edit-field-add-value {\n\tdisplay: inline-block;\n\twidth: 40%;\n}\n\n.tc-edit-field-add-button {\n\tdisplay: inline-block;\n\twidth: 10%;\n}\n\n/*\n** Storyview Classes\n*/\n\n.tc-storyview-zoomin-tiddler {\n\tposition: absolute;\n\tdisplay: block;\n\twidth: 100%;\n}\n\n@media (min-width: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}}) {\n\n\t.tc-storyview-zoomin-tiddler {\n\t\twidth: calc(100% - 84px);\n\t}\n\n}\n\n/*\n** Dropdowns\n*/\n\n.tc-btn-dropdown {\n\ttext-align: left;\n}\n\n.tc-btn-dropdown svg, .tc-btn-dropdown img {\n\theight: 1em;\n\twidth: 1em;\n\tfill: <<colour muted-foreground>>;\n}\n\n.tc-drop-down-wrapper {\n\tposition: relative;\n}\n\n.tc-drop-down {\n\tmin-width: 380px;\n\tborder: 1px solid <<colour dropdown-border>>;\n\tbackground-color: <<colour dropdown-background>>;\n\tpadding: 7px 0 7px 0;\n\tmargin: 4px 0 0 0;\n\twhite-space: nowrap;\n\ttext-shadow: none;\n\tline-height: 1.4;\n}\n\n.tc-drop-down .tc-drop-down {\n\tmargin-left: 14px;\n}\n\n.tc-drop-down button svg, .tc-drop-down a svg  {\n\tfill: <<colour foreground>>;\n}\n\n.tc-drop-down button.tc-btn-invisible:hover svg {\n\tfill: <<colour foreground>>;\n}\n\n.tc-drop-down p {\n\tpadding: 0 14px 0 14px;\n}\n\n.tc-drop-down svg {\n\twidth: 1em;\n\theight: 1em;\n}\n\n.tc-drop-down img {\n\twidth: 1em;\n}\n\n.tc-drop-down-language-chooser img {\n\twidth: 2em;\n\tvertical-align: baseline;\n}\n\n.tc-drop-down a, .tc-drop-down button {\n\tdisplay: block;\n\tpadding: 0 14px 0 14px;\n\twidth: 100%;\n\ttext-align: left;\n\tcolor: <<colour foreground>>;\n\tline-height: 1.4;\n}\n\n.tc-drop-down .tc-tab-set .tc-tab-buttons button {\n\tdisplay: inline-block;\n    width: auto;\n    margin-bottom: 0px;\n    border-bottom-left-radius: 0;\n    border-bottom-right-radius: 0;\n}\n\n.tc-drop-down .tc-prompt {\n\tpadding: 0 14px;\n}\n\n.tc-drop-down .tc-chooser {\n\tborder: none;\n}\n\n.tc-drop-down .tc-chooser .tc-swatches-horiz {\n\tfont-size: 0.4em;\n\tpadding-left: 1.2em;\n}\n\n.tc-drop-down .tc-file-input-wrapper {\n\twidth: 100%;\n}\n\n.tc-drop-down .tc-file-input-wrapper button {\n\tcolor: <<colour foreground>>;\n}\n\n.tc-drop-down a:hover, .tc-drop-down button:hover, .tc-drop-down .tc-file-input-wrapper:hover button {\n\tcolor: <<colour tiddler-link-background>>;\n\tbackground-color: <<colour tiddler-link-foreground>>;\n\ttext-decoration: none;\n}\n\n.tc-drop-down .tc-tab-buttons button {\n\tbackground-color: <<colour dropdown-tab-background>>;\n}\n\n.tc-drop-down .tc-tab-buttons button.tc-tab-selected {\n\tbackground-color: <<colour dropdown-tab-background-selected>>;\n\tborder-bottom: 1px solid <<colour dropdown-tab-background-selected>>;\n}\n\n.tc-drop-down-bullet {\n\tdisplay: inline-block;\n\twidth: 0.5em;\n}\n\n.tc-drop-down .tc-tab-contents a {\n\tpadding: 0 0.5em 0 0.5em;\n}\n\n.tc-block-dropdown-wrapper {\n\tposition: relative;\n}\n\n.tc-block-dropdown {\n\tposition: absolute;\n\tmin-width: 220px;\n\tborder: 1px solid <<colour dropdown-border>>;\n\tbackground-color: <<colour dropdown-background>>;\n\tpadding: 7px 0;\n\tmargin: 4px 0 0 0;\n\twhite-space: nowrap;\n\tz-index: 1000;\n\ttext-shadow: none;\n}\n\n.tc-block-dropdown.tc-search-drop-down {\n\tmargin-left: -12px;\n}\n\n.tc-block-dropdown a {\n\tdisplay: block;\n\tpadding: 4px 14px 4px 14px;\n}\n\n.tc-block-dropdown.tc-search-drop-down a {\n\tdisplay: block;\n\tpadding: 0px 10px 0px 10px;\n}\n\n.tc-drop-down .tc-dropdown-item-plain,\n.tc-block-dropdown .tc-dropdown-item-plain {\n\tpadding: 4px 14px 4px 7px;\n}\n\n.tc-drop-down .tc-dropdown-item,\n.tc-block-dropdown .tc-dropdown-item {\n\tpadding: 4px 14px 4px 7px;\n\tcolor: <<colour muted-foreground>>;\n}\n\n.tc-block-dropdown a:hover {\n\tcolor: <<colour tiddler-link-background>>;\n\tbackground-color: <<colour tiddler-link-foreground>>;\n\ttext-decoration: none;\n}\n\n.tc-search-results {\n\tpadding: 0 7px 0 7px;\n}\n\n.tc-image-chooser, .tc-colour-chooser {\n\twhite-space: normal;\n}\n\n.tc-image-chooser a,\n.tc-colour-chooser a {\n\tdisplay: inline-block;\n\tvertical-align: top;\n\ttext-align: center;\n\tposition: relative;\n}\n\n.tc-image-chooser a {\n\tborder: 1px solid <<colour muted-foreground>>;\n\tpadding: 2px;\n\tmargin: 2px;\n\twidth: 4em;\n\theight: 4em;\n}\n\n.tc-colour-chooser a {\n\tpadding: 3px;\n\twidth: 2em;\n\theight: 2em;\n\tvertical-align: middle;\n}\n\n.tc-image-chooser a:hover,\n.tc-colour-chooser a:hover {\n\tbackground: <<colour primary>>;\n\tpadding: 0px;\n\tborder: 3px solid <<colour primary>>;\n}\n\n.tc-image-chooser a svg,\n.tc-image-chooser a img {\n\tdisplay: inline-block;\n\twidth: auto;\n\theight: auto;\n\tmax-width: 3.5em;\n\tmax-height: 3.5em;\n\tposition: absolute;\n\ttop: 0;\n\tbottom: 0;\n\tleft: 0;\n\tright: 0;\n\tmargin: auto;\n}\n\n/*\n** Modals\n*/\n\n.tc-modal-wrapper {\n\tposition: fixed;\n\toverflow: auto;\n\toverflow-y: scroll;\n\ttop: 0;\n\tright: 0;\n\tbottom: 0;\n\tleft: 0;\n\tz-index: 900;\n}\n\n.tc-modal-backdrop {\n\tposition: fixed;\n\ttop: 0;\n\tright: 0;\n\tbottom: 0;\n\tleft: 0;\n\tz-index: 1000;\n\tbackground-color: <<colour modal-backdrop>>;\n}\n\n.tc-modal {\n\tz-index: 1100;\n\tbackground-color: <<colour modal-background>>;\n\tborder: 1px solid <<colour modal-border>>;\n}\n\n@media (max-width: 55em) {\n\t.tc-modal {\n\t\tposition: fixed;\n\t\ttop: 1em;\n\t\tleft: 1em;\n\t\tright: 1em;\n\t}\n\n\t.tc-modal-body {\n\t\toverflow-y: auto;\n\t\tmax-height: 400px;\n\t\tmax-height: 60vh;\n\t}\n}\n\n@media (min-width: 55em) {\n\t.tc-modal {\n\t\tposition: fixed;\n\t\ttop: 2em;\n\t\tleft: 25%;\n\t\twidth: 50%;\n\t}\n\n\t.tc-modal-body {\n\t\toverflow-y: auto;\n\t\tmax-height: 400px;\n\t\tmax-height: 60vh;\n\t}\n}\n\n.tc-modal-header {\n\tpadding: 9px 15px;\n\tborder-bottom: 1px solid <<colour modal-header-border>>;\n}\n\n.tc-modal-header h3 {\n\tmargin: 0;\n\tline-height: 30px;\n}\n\n.tc-modal-header img, .tc-modal-header svg {\n\twidth: 1em;\n\theight: 1em;\n}\n\n.tc-modal-body {\n\tpadding: 15px;\n}\n\n.tc-modal-footer {\n\tpadding: 14px 15px 15px;\n\tmargin-bottom: 0;\n\ttext-align: right;\n\tbackground-color: <<colour modal-footer-background>>;\n\tborder-top: 1px solid <<colour modal-footer-border>>;\n}\n\n/*\n** Notifications\n*/\n\n.tc-notification {\n\tposition: fixed;\n\ttop: 14px;\n\tright: 42px;\n\tz-index: 1300;\n\tmax-width: 280px;\n\tpadding: 0 14px 0 14px;\n\tbackground-color: <<colour notification-background>>;\n\tborder: 1px solid <<colour notification-border>>;\n}\n\n/*\n** Tabs\n*/\n\n.tc-tab-set.tc-vertical {\n\tdisplay: -webkit-flex;\n\tdisplay: flex;\n}\n\n.tc-tab-buttons {\n\tfont-size: 0.85em;\n\tpadding-top: 1em;\n\tmargin-bottom: -2px;\n}\n\n.tc-tab-buttons.tc-vertical  {\n\tz-index: 100;\n\tdisplay: block;\n\tpadding-top: 14px;\n\tvertical-align: top;\n\ttext-align: right;\n\tmargin-bottom: inherit;\n\tmargin-right: -1px;\n\tmax-width: 33%;\n\t-webkit-flex: 0 0 auto;\n\tflex: 0 0 auto;\n}\n\n.tc-tab-buttons button.tc-tab-selected {\n\tcolor: <<colour tab-foreground-selected>>;\n\tbackground-color: <<colour tab-background-selected>>;\n\tborder-left: 1px solid <<colour tab-border-selected>>;\n\tborder-top: 1px solid <<colour tab-border-selected>>;\n\tborder-right: 1px solid <<colour tab-border-selected>>;\n}\n\n.tc-tab-buttons button {\n\tcolor: <<colour tab-foreground>>;\n\tpadding: 3px 5px 3px 5px;\n\tmargin-right: 0.3em;\n\tfont-weight: 300;\n\tborder: none;\n\tbackground: inherit;\n\tbackground-color: <<colour tab-background>>;\n\tborder-left: 1px solid <<colour tab-border>>;\n\tborder-top: 1px solid <<colour tab-border>>;\n\tborder-right: 1px solid <<colour tab-border>>;\n\tborder-top-left-radius: 2px;\n\tborder-top-right-radius: 2px;\n}\n\n.tc-tab-buttons.tc-vertical button {\n\tdisplay: block;\n\twidth: 100%;\n\tmargin-top: 3px;\n\tmargin-right: 0;\n\ttext-align: right;\n\tbackground-color: <<colour tab-background>>;\n\tborder-left: 1px solid <<colour tab-border>>;\n\tborder-bottom: 1px solid <<colour tab-border>>;\n\tborder-right: none;\n\tborder-top-left-radius: 2px;\n\tborder-bottom-left-radius: 2px;\n}\n\n.tc-tab-buttons.tc-vertical button.tc-tab-selected {\n\tbackground-color: <<colour tab-background-selected>>;\n\tborder-right: 1px solid <<colour tab-background-selected>>;\n}\n\n.tc-tab-divider {\n\tborder-top: 1px solid <<colour tab-divider>>;\n}\n\n.tc-tab-divider.tc-vertical  {\n\tdisplay: none;\n}\n\n.tc-tab-content {\n\tmargin-top: 14px;\n}\n\n.tc-tab-content.tc-vertical  {\n\tdisplay: inline-block;\n\tvertical-align: top;\n\tpadding-top: 0;\n\tpadding-left: 14px;\n\tborder-left: 1px solid <<colour tab-border>>;\n\t-webkit-flex: 1 0 70%;\n\tflex: 1 0 70%;\n}\n\n.tc-sidebar-lists .tc-tab-buttons {\n\tmargin-bottom: -1px;\n}\n\n.tc-sidebar-lists .tc-tab-buttons button.tc-tab-selected {\n\tbackground-color: <<colour sidebar-tab-background-selected>>;\n\tcolor: <<colour sidebar-tab-foreground-selected>>;\n\tborder-left: 1px solid <<colour sidebar-tab-border-selected>>;\n\tborder-top: 1px solid <<colour sidebar-tab-border-selected>>;\n\tborder-right: 1px solid <<colour sidebar-tab-border-selected>>;\n}\n\n.tc-sidebar-lists .tc-tab-buttons button {\n\tbackground-color: <<colour sidebar-tab-background>>;\n\tcolor: <<colour sidebar-tab-foreground>>;\n\tborder-left: 1px solid <<colour sidebar-tab-border>>;\n\tborder-top: 1px solid <<colour sidebar-tab-border>>;\n\tborder-right: 1px solid <<colour sidebar-tab-border>>;\n}\n\n.tc-sidebar-lists .tc-tab-divider {\n\tborder-top: 1px solid <<colour sidebar-tab-divider>>;\n}\n\n.tc-more-sidebar > .tc-tab-set > .tc-tab-buttons > button {\n\tdisplay: block;\n\twidth: 100%;\n\tbackground-color: <<colour sidebar-tab-background>>;\n\tborder-top: none;\n\tborder-left: none;\n\tborder-bottom: none;\n\tborder-right: 1px solid #ccc;\n\tmargin-bottom: inherit;\n}\n\n.tc-more-sidebar > .tc-tab-set > .tc-tab-buttons > button.tc-tab-selected {\n\tbackground-color: <<colour sidebar-tab-background-selected>>;\n\tborder: none;\n}\n\n/*\n** Manager\n*/\n\n.tc-manager-wrapper {\n\t\n}\n\n.tc-manager-controls {\n\t\n}\n\n.tc-manager-control {\n\tmargin: 0.5em 0;\n}\n\n.tc-manager-list {\n\twidth: 100%;\n\tborder-top: 1px solid <<colour muted-foreground>>;\n\tborder-left: 1px solid <<colour muted-foreground>>;\n\tborder-right: 1px solid <<colour muted-foreground>>;\n}\n\n.tc-manager-list-item {\n\n}\n\n.tc-manager-list-item-heading {\n    display: block;\n    width: 100%;\n    text-align: left;\t\n\tborder-bottom: 1px solid <<colour muted-foreground>>;\n\tpadding: 3px;\n}\n\n.tc-manager-list-item-heading-selected {\n\tfont-weight: bold;\n\tcolor: <<colour background>>;\n\tfill: <<colour background>>;\n\tbackground-color: <<colour foreground>>;\n}\n\n.tc-manager-list-item-heading:hover {\n\tbackground: <<colour primary>>;\n\tcolor: <<colour background>>;\n}\n\n.tc-manager-list-item-content {\n\tdisplay: flex;\n}\n\n.tc-manager-list-item-content-sidebar {\n    flex: 1 0;\n    background: <<colour tiddler-editor-background>>;\n    border-right: 0.5em solid <<colour muted-foreground>>;\n    border-bottom: 0.5em solid <<colour muted-foreground>>;\n    white-space: nowrap;\n}\n\n.tc-manager-list-item-content-item-heading {\n\tdisplay: block;\n\twidth: 100%;\n\ttext-align: left;\n    background: <<colour muted-foreground>>;\n\ttext-transform: uppercase;\n\tfont-size: 0.6em;\n\tfont-weight: bold;\n    padding: 0.5em 0 0.5em 0;\n}\n\n.tc-manager-list-item-content-item-body {\n\tpadding: 0 0.5em 0 0.5em;\n}\n\n.tc-manager-list-item-content-item-body > pre {\n\tmargin: 0.5em 0 0.5em 0;\n\tborder: none;\n\tbackground: inherit;\n}\n\n.tc-manager-list-item-content-tiddler {\n    flex: 3 1;\n    border-left: 0.5em solid <<colour muted-foreground>>;\n    border-right: 0.5em solid <<colour muted-foreground>>;\n    border-bottom: 0.5em solid <<colour muted-foreground>>;\n}\n\n.tc-manager-list-item-content-item-body > table {\n\tborder: none;\n\tpadding: 0;\n\tmargin: 0;\n}\n\n.tc-manager-list-item-content-item-body > table td {\n\tborder: none;\n}\n\n.tc-manager-icon-editor > button {\n\twidth: 100%;\n}\n\n.tc-manager-icon-editor > button > svg,\n.tc-manager-icon-editor > button > button {\n\twidth: 100%;\n\theight: auto;\n}\n\n/*\n** Alerts\n*/\n\n.tc-alerts {\n\tposition: fixed;\n\ttop: 0;\n\tleft: 0;\n\tmax-width: 500px;\n\tz-index: 20000;\n}\n\n.tc-alert {\n\tposition: relative;\n\tmargin: 28px;\n\tpadding: 14px 14px 14px 14px;\n\tborder: 2px solid <<colour alert-border>>;\n\tbackground-color: <<colour alert-background>>;\n}\n\n.tc-alert-toolbar {\n\tposition: absolute;\n\ttop: 14px;\n\tright: 14px;\n}\n\n.tc-alert-toolbar svg {\n\tfill: <<colour alert-muted-foreground>>;\n}\n\n.tc-alert-subtitle {\n\tcolor: <<colour alert-muted-foreground>>;\n\tfont-weight: bold;\n}\n\n.tc-alert-highlight {\n\tcolor: <<colour alert-highlight>>;\n}\n\n@media (min-width: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}}) {\n\n\t.tc-static-alert {\n\t\tposition: relative;\n\t}\n\n\t.tc-static-alert-inner {\n\t\tposition: absolute;\n\t\tz-index: 100;\n\t}\n\n}\n\n.tc-static-alert-inner {\n\tpadding: 0 2px 2px 42px;\n\tcolor: <<colour static-alert-foreground>>;\n}\n\n/*\n** Control panel\n*/\n\n.tc-control-panel td {\n\tpadding: 4px;\n}\n\n.tc-control-panel table, .tc-control-panel table input, .tc-control-panel table textarea {\n\twidth: 100%;\n}\n\n.tc-plugin-info {\n\tdisplay: block;\n\tborder: 1px solid <<colour muted-foreground>>;\n\tbackground-colour: <<colour background>>;\n\tmargin: 0.5em 0 0.5em 0;\n\tpadding: 4px;\n}\n\n.tc-plugin-info-disabled {\n\tbackground: -webkit-repeating-linear-gradient(45deg, #ff0, #ff0 10px, #eee 10px, #eee 20px);\n\tbackground: repeating-linear-gradient(45deg, #ff0, #ff0 10px, #eee 10px, #eee 20px);\n}\n\n.tc-plugin-info-disabled:hover {\n\tbackground: -webkit-repeating-linear-gradient(45deg, #aa0, #aa0 10px, #888 10px, #888 20px);\n\tbackground: repeating-linear-gradient(45deg, #aa0, #aa0 10px, #888 10px, #888 20px);\n}\n\na.tc-tiddlylink.tc-plugin-info:hover {\n\ttext-decoration: none;\n\tbackground-color: <<colour primary>>;\n\tcolor: <<colour background>>;\n\tfill: <<colour foreground>>;\n}\n\na.tc-tiddlylink.tc-plugin-info:hover .tc-plugin-info > .tc-plugin-info-chunk > svg {\n\tfill: <<colour foreground>>;\n}\n\n.tc-plugin-info-chunk {\n\tdisplay: inline-block;\n\tvertical-align: middle;\n}\n\n.tc-plugin-info-chunk h1 {\n\tfont-size: 1em;\n\tmargin: 2px 0 2px 0;\n}\n\n.tc-plugin-info-chunk h2 {\n\tfont-size: 0.8em;\n\tmargin: 2px 0 2px 0;\n}\n\n.tc-plugin-info-chunk div {\n\tfont-size: 0.7em;\n\tmargin: 2px 0 2px 0;\n}\n\n.tc-plugin-info:hover > .tc-plugin-info-chunk > img, .tc-plugin-info:hover > .tc-plugin-info-chunk > svg {\n\twidth: 2em;\n\theight: 2em;\n\tfill: <<colour foreground>>;\n}\n\n.tc-plugin-info > .tc-plugin-info-chunk > img, .tc-plugin-info > .tc-plugin-info-chunk > svg {\n\twidth: 2em;\n\theight: 2em;\n\tfill: <<colour muted-foreground>>;\n}\n\n.tc-plugin-info.tc-small-icon > .tc-plugin-info-chunk > img, .tc-plugin-info.tc-small-icon > .tc-plugin-info-chunk > svg {\n\twidth: 1em;\n\theight: 1em;\n}\n\n.tc-plugin-info-dropdown {\n\tborder: 1px solid <<colour muted-foreground>>;\n\tmargin-top: -8px;\n}\n\n.tc-plugin-info-dropdown-message {\n\tbackground: <<colour message-background>>;\n\tpadding: 0.5em 1em 0.5em 1em;\n\tfont-weight: bold;\n\tfont-size: 0.8em;\n}\n\n.tc-plugin-info-dropdown-body {\n\tpadding: 1em 1em 1em 1em;\n}\n\n/*\n** Message boxes\n*/\n\n.tc-message-box {\n\tborder: 1px solid <<colour message-border>>;\n\tbackground: <<colour message-background>>;\n\tpadding: 0px 21px 0px 21px;\n\tfont-size: 12px;\n\tline-height: 18px;\n\tcolor: <<colour message-foreground>>;\n}\n\n.tc-message-box svg {\n\twidth: 1em;\n\theight: 1em;\n    vertical-align: text-bottom;\n}\n\n/*\n** Pictures\n*/\n\n.tc-bordered-image {\n\tborder: 1px solid <<colour muted-foreground>>;\n\tpadding: 5px;\n\tmargin: 5px;\n}\n\n/*\n** Floats\n*/\n\n.tc-float-right {\n\tfloat: right;\n}\n\n/*\n** Chooser\n*/\n\n.tc-chooser {\n\tborder: 1px solid <<colour table-border>>;\n}\n\n.tc-chooser-item {\n\tborder: 8px;\n\tpadding: 2px 4px;\n}\n\n.tc-chooser-item a.tc-tiddlylink {\n\tdisplay: block;\n\ttext-decoration: none;\n\tcolor: <<colour tiddler-link-foreground>>;\n\tbackground-color: <<colour tiddler-link-background>>;\n}\n\n.tc-chooser-item a.tc-tiddlylink:hover {\n\ttext-decoration: none;\n\tcolor: <<colour tiddler-link-background>>;\n\tbackground-color: <<colour tiddler-link-foreground>>;\n}\n\n/*\n** Palette swatches\n*/\n\n.tc-swatches-horiz {\n}\n\n.tc-swatches-horiz .tc-swatch {\n\tdisplay: inline-block;\n}\n\n.tc-swatch {\n\twidth: 2em;\n\theight: 2em;\n\tmargin: 0.4em;\n\tborder: 1px solid #888;\n}\n\n/*\n** Table of contents\n*/\n\n.tc-sidebar-lists .tc-table-of-contents {\n\twhite-space: nowrap;\n}\n\n.tc-table-of-contents button {\n\tcolor: <<colour sidebar-foreground>>;\n}\n\n.tc-table-of-contents svg {\n\twidth: 0.7em;\n\theight: 0.7em;\n\tvertical-align: middle;\n\tfill: <<colour sidebar-foreground>>;\n}\n\n.tc-table-of-contents ol {\n\tlist-style-type: none;\n\tpadding-left: 0;\n}\n\n.tc-table-of-contents ol ol {\n\tpadding-left: 1em;\n}\n\n.tc-table-of-contents li {\n\tfont-size: 1.0em;\n\tfont-weight: bold;\n}\n\n.tc-table-of-contents li a {\n\tfont-weight: bold;\n}\n\n.tc-table-of-contents li li {\n\tfont-size: 0.95em;\n\tfont-weight: normal;\n\tline-height: 1.4;\n}\n\n.tc-table-of-contents li li a {\n\tfont-weight: normal;\n}\n\n.tc-table-of-contents li li li {\n\tfont-size: 0.95em;\n\tfont-weight: 200;\n\tline-height: 1.5;\n}\n\n.tc-table-of-contents li li li a {\n\tfont-weight: bold;\n}\n\n.tc-table-of-contents li li li li {\n\tfont-size: 0.95em;\n\tfont-weight: 200;\n}\n\n.tc-tabbed-table-of-contents {\n\tdisplay: -webkit-flex;\n\tdisplay: flex;\n}\n\n.tc-tabbed-table-of-contents .tc-table-of-contents {\n\tz-index: 100;\n\tdisplay: inline-block;\n\tpadding-left: 1em;\n\tmax-width: 50%;\n\t-webkit-flex: 0 0 auto;\n\tflex: 0 0 auto;\n\tbackground: <<colour tab-background>>;\n\tborder-left: 1px solid <<colour tab-border>>;\n\tborder-top: 1px solid <<colour tab-border>>;\n\tborder-bottom: 1px solid <<colour tab-border>>;\n}\n\n.tc-tabbed-table-of-contents .tc-table-of-contents .toc-item > a,\n.tc-tabbed-table-of-contents .tc-table-of-contents .toc-item-selected > a {\n\tdisplay: block;\n\tpadding: 0.12em 1em 0.12em 0.25em;\n}\n\n.tc-tabbed-table-of-contents .tc-table-of-contents .toc-item > a {\n\tborder-top: 1px solid <<colour tab-background>>;\n\tborder-left: 1px solid <<colour tab-background>>;\n\tborder-bottom: 1px solid <<colour tab-background>>;\n}\n\n.tc-tabbed-table-of-contents .tc-table-of-contents .toc-item > a:hover {\n\ttext-decoration: none;\n\tborder-top: 1px solid <<colour tab-border>>;\n\tborder-left: 1px solid <<colour tab-border>>;\n\tborder-bottom: 1px solid <<colour tab-border>>;\n\tbackground: <<colour tab-border>>;\n}\n\n.tc-tabbed-table-of-contents .tc-table-of-contents .toc-item-selected > a {\n\tborder-top: 1px solid <<colour tab-border>>;\n\tborder-left: 1px solid <<colour tab-border>>;\n\tborder-bottom: 1px solid <<colour tab-border>>;\n\tbackground: <<colour background>>;\n\tmargin-right: -1px;\n}\n\n.tc-tabbed-table-of-contents .tc-table-of-contents .toc-item-selected > a:hover {\n\ttext-decoration: none;\n}\n\n.tc-tabbed-table-of-contents .tc-tabbed-table-of-contents-content {\n\tdisplay: inline-block;\n\tvertical-align: top;\n\tpadding-left: 1.5em;\n\tpadding-right: 1.5em;\n\tborder: 1px solid <<colour tab-border>>;\n\t-webkit-flex: 1 0 50%;\n\tflex: 1 0 50%;\n}\n\n/*\n** Dirty indicator\n*/\n\nbody.tc-dirty span.tc-dirty-indicator, body.tc-dirty span.tc-dirty-indicator svg {\n\tfill: <<colour dirty-indicator>>;\n\tcolor: <<colour dirty-indicator>>;\n}\n\n/*\n** File inputs\n*/\n\n.tc-file-input-wrapper {\n\tposition: relative;\n\toverflow: hidden;\n\tdisplay: inline-block;\n\tvertical-align: middle;\n}\n\n.tc-file-input-wrapper input[type=file] {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tright: 0;\n\tbottom: 0;\n\tfont-size: 999px;\n\tmax-width: 100%;\n\tmax-height: 100%;\n\tfilter: alpha(opacity=0);\n\topacity: 0;\n\toutline: none;\n\tbackground: white;\n\tcursor: pointer;\n\tdisplay: inline-block;\n}\n\n/*\n** Thumbnail macros\n*/\n\n.tc-thumbnail-wrapper {\n\tposition: relative;\n\tdisplay: inline-block;\n\tmargin: 6px;\n\tvertical-align: top;\n}\n\n.tc-thumbnail-right-wrapper {\n\tfloat:right;\n\tmargin: 0.5em 0 0.5em 0.5em;\n}\n\n.tc-thumbnail-image {\n\ttext-align: center;\n\toverflow: hidden;\n\tborder-radius: 3px;\n}\n\n.tc-thumbnail-image svg,\n.tc-thumbnail-image img {\n\tfilter: alpha(opacity=1);\n\topacity: 1;\n\tmin-width: 100%;\n\tmin-height: 100%;\n\tmax-width: 100%;\n}\n\n.tc-thumbnail-wrapper:hover .tc-thumbnail-image svg,\n.tc-thumbnail-wrapper:hover .tc-thumbnail-image img {\n\tfilter: alpha(opacity=0.8);\n\topacity: 0.8;\n}\n\n.tc-thumbnail-background {\n\tposition: absolute;\n\tborder-radius: 3px;\n}\n\n.tc-thumbnail-icon svg,\n.tc-thumbnail-icon img {\n\twidth: 3em;\n\theight: 3em;\n\t<<filter \"drop-shadow(2px 2px 4px rgba(0,0,0,0.3))\">>\n}\n\n.tc-thumbnail-wrapper:hover .tc-thumbnail-icon svg,\n.tc-thumbnail-wrapper:hover .tc-thumbnail-icon img {\n\tfill: #fff;\n\t<<filter \"drop-shadow(3px 3px 4px rgba(0,0,0,0.6))\">>\n}\n\n.tc-thumbnail-icon {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tright: 0;\n\tbottom: 0;\n\tdisplay: -webkit-flex;\n\t-webkit-align-items: center;\n\t-webkit-justify-content: center;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.tc-thumbnail-caption {\n\tposition: absolute;\n\tbackground-color: #777;\n\tcolor: #fff;\n\ttext-align: center;\n\tbottom: 0;\n\twidth: 100%;\n\tfilter: alpha(opacity=0.9);\n\topacity: 0.9;\n\tline-height: 1.4;\n\tborder-bottom-left-radius: 3px;\n\tborder-bottom-right-radius: 3px;\n}\n\n.tc-thumbnail-wrapper:hover .tc-thumbnail-caption {\n\tfilter: alpha(opacity=1);\n\topacity: 1;\n}\n\n/*\n** Errors\n*/\n\n.tc-error {\n\tbackground: #f00;\n\tcolor: #fff;\n}"
        },
        "$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize": {
            "title": "$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize",
            "text": "15px"
        },
        "$:/themes/tiddlywiki/vanilla/metrics/bodylineheight": {
            "title": "$:/themes/tiddlywiki/vanilla/metrics/bodylineheight",
            "text": "22px"
        },
        "$:/themes/tiddlywiki/vanilla/metrics/fontsize": {
            "title": "$:/themes/tiddlywiki/vanilla/metrics/fontsize",
            "text": "14px"
        },
        "$:/themes/tiddlywiki/vanilla/metrics/lineheight": {
            "title": "$:/themes/tiddlywiki/vanilla/metrics/lineheight",
            "text": "20px"
        },
        "$:/themes/tiddlywiki/vanilla/metrics/storyleft": {
            "title": "$:/themes/tiddlywiki/vanilla/metrics/storyleft",
            "text": "0px"
        },
        "$:/themes/tiddlywiki/vanilla/metrics/storytop": {
            "title": "$:/themes/tiddlywiki/vanilla/metrics/storytop",
            "text": "0px"
        },
        "$:/themes/tiddlywiki/vanilla/metrics/storyright": {
            "title": "$:/themes/tiddlywiki/vanilla/metrics/storyright",
            "text": "770px"
        },
        "$:/themes/tiddlywiki/vanilla/metrics/storywidth": {
            "title": "$:/themes/tiddlywiki/vanilla/metrics/storywidth",
            "text": "770px"
        },
        "$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth": {
            "title": "$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth",
            "text": "686px"
        },
        "$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint": {
            "title": "$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint",
            "text": "960px"
        },
        "$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth": {
            "title": "$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth",
            "text": "350px"
        },
        "$:/themes/tiddlywiki/vanilla/options/stickytitles": {
            "title": "$:/themes/tiddlywiki/vanilla/options/stickytitles",
            "text": "no"
        },
        "$:/themes/tiddlywiki/vanilla/options/sidebarlayout": {
            "title": "$:/themes/tiddlywiki/vanilla/options/sidebarlayout",
            "text": "fixed-fluid"
        },
        "$:/themes/tiddlywiki/vanilla/options/codewrapping": {
            "title": "$:/themes/tiddlywiki/vanilla/options/codewrapping",
            "text": "pre-wrap"
        },
        "$:/themes/tiddlywiki/vanilla/reset": {
            "title": "$:/themes/tiddlywiki/vanilla/reset",
            "type": "text/plain",
            "text": "/*! normalize.css v3.0.0 | MIT License | git.io/normalize */\n\n/**\n * 1. Set default font family to sans-serif.\n * 2. Prevent iOS text size adjust after orientation change, without disabling\n *    user zoom.\n */\n\nhtml {\n  font-family: sans-serif; /* 1 */\n  -ms-text-size-adjust: 100%; /* 2 */\n  -webkit-text-size-adjust: 100%; /* 2 */\n}\n\n/**\n * Remove default margin.\n */\n\nbody {\n  margin: 0;\n}\n\n/* HTML5 display definitions\n   ========================================================================== */\n\n/**\n * Correct `block` display not defined in IE 8/9.\n */\n\narticle,\naside,\ndetails,\nfigcaption,\nfigure,\nfooter,\nheader,\nhgroup,\nmain,\nnav,\nsection,\nsummary {\n  display: block;\n}\n\n/**\n * 1. Correct `inline-block` display not defined in IE 8/9.\n * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.\n */\n\naudio,\ncanvas,\nprogress,\nvideo {\n  display: inline-block; /* 1 */\n  vertical-align: baseline; /* 2 */\n}\n\n/**\n * Prevent modern browsers from displaying `audio` without controls.\n * Remove excess height in iOS 5 devices.\n */\n\naudio:not([controls]) {\n  display: none;\n  height: 0;\n}\n\n/**\n * Address `[hidden]` styling not present in IE 8/9.\n * Hide the `template` element in IE, Safari, and Firefox < 22.\n */\n\n[hidden],\ntemplate {\n  display: none;\n}\n\n/* Links\n   ========================================================================== */\n\n/**\n * Remove the gray background color from active links in IE 10.\n */\n\na {\n  background: transparent;\n}\n\n/**\n * Improve readability when focused and also mouse hovered in all browsers.\n */\n\na:active,\na:hover {\n  outline: 0;\n}\n\n/* Text-level semantics\n   ========================================================================== */\n\n/**\n * Address styling not present in IE 8/9, Safari 5, and Chrome.\n */\n\nabbr[title] {\n  border-bottom: 1px dotted;\n}\n\n/**\n * Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome.\n */\n\nb,\nstrong {\n  font-weight: bold;\n}\n\n/**\n * Address styling not present in Safari 5 and Chrome.\n */\n\ndfn {\n  font-style: italic;\n}\n\n/**\n * Address variable `h1` font-size and margin within `section` and `article`\n * contexts in Firefox 4+, Safari 5, and Chrome.\n */\n\nh1 {\n  font-size: 2em;\n  margin: 0.67em 0;\n}\n\n/**\n * Address styling not present in IE 8/9.\n */\n\nmark {\n  background: #ff0;\n  color: #000;\n}\n\n/**\n * Address inconsistent and variable font size in all browsers.\n */\n\nsmall {\n  font-size: 80%;\n}\n\n/**\n * Prevent `sub` and `sup` affecting `line-height` in all browsers.\n */\n\nsub,\nsup {\n  font-size: 75%;\n  line-height: 0;\n  position: relative;\n  vertical-align: baseline;\n}\n\nsup {\n  top: -0.5em;\n}\n\nsub {\n  bottom: -0.25em;\n}\n\n/* Embedded content\n   ========================================================================== */\n\n/**\n * Remove border when inside `a` element in IE 8/9.\n */\n\nimg {\n  border: 0;\n}\n\n/**\n * Correct overflow displayed oddly in IE 9.\n */\n\nsvg:not(:root) {\n  overflow: hidden;\n}\n\n/* Grouping content\n   ========================================================================== */\n\n/**\n * Address margin not present in IE 8/9 and Safari 5.\n */\n\nfigure {\n  margin: 1em 40px;\n}\n\n/**\n * Address differences between Firefox and other browsers.\n */\n\nhr {\n  -moz-box-sizing: content-box;\n  box-sizing: content-box;\n  height: 0;\n}\n\n/**\n * Contain overflow in all browsers.\n */\n\npre {\n  overflow: auto;\n}\n\n/**\n * Address odd `em`-unit font size rendering in all browsers.\n */\n\ncode,\nkbd,\npre,\nsamp {\n  font-family: monospace, monospace;\n  font-size: 1em;\n}\n\n/* Forms\n   ========================================================================== */\n\n/**\n * Known limitation: by default, Chrome and Safari on OS X allow very limited\n * styling of `select`, unless a `border` property is set.\n */\n\n/**\n * 1. Correct color not being inherited.\n *    Known issue: affects color of disabled elements.\n * 2. Correct font properties not being inherited.\n * 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.\n */\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n  color: inherit; /* 1 */\n  font: inherit; /* 2 */\n  margin: 0; /* 3 */\n}\n\n/**\n * Address `overflow` set to `hidden` in IE 8/9/10.\n */\n\nbutton {\n  overflow: visible;\n}\n\n/**\n * Address inconsistent `text-transform` inheritance for `button` and `select`.\n * All other form control elements do not inherit `text-transform` values.\n * Correct `button` style inheritance in Firefox, IE 8+, and Opera\n * Correct `select` style inheritance in Firefox.\n */\n\nbutton,\nselect {\n  text-transform: none;\n}\n\n/**\n * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\n *    and `video` controls.\n * 2. Correct inability to style clickable `input` types in iOS.\n * 3. Improve usability and consistency of cursor style between image-type\n *    `input` and others.\n */\n\nbutton,\nhtml input[type=\"button\"], /* 1 */\ninput[type=\"reset\"],\ninput[type=\"submit\"] {\n  -webkit-appearance: button; /* 2 */\n  cursor: pointer; /* 3 */\n}\n\n/**\n * Re-set default cursor for disabled elements.\n */\n\nbutton[disabled],\nhtml input[disabled] {\n  cursor: default;\n}\n\n/**\n * Remove inner padding and border in Firefox 4+.\n */\n\nbutton::-moz-focus-inner,\ninput::-moz-focus-inner {\n  border: 0;\n  padding: 0;\n}\n\n/**\n * Address Firefox 4+ setting `line-height` on `input` using `!important` in\n * the UA stylesheet.\n */\n\ninput {\n  line-height: normal;\n}\n\n/**\n * It's recommended that you don't attempt to style these elements.\n * Firefox's implementation doesn't respect box-sizing, padding, or width.\n *\n * 1. Address box sizing set to `content-box` in IE 8/9/10.\n * 2. Remove excess padding in IE 8/9/10.\n */\n\ninput[type=\"checkbox\"],\ninput[type=\"radio\"] {\n  box-sizing: border-box; /* 1 */\n  padding: 0; /* 2 */\n}\n\n/**\n * Fix the cursor style for Chrome's increment/decrement buttons. For certain\n * `font-size` values of the `input`, it causes the cursor style of the\n * decrement button to change from `default` to `text`.\n */\n\ninput[type=\"number\"]::-webkit-inner-spin-button,\ninput[type=\"number\"]::-webkit-outer-spin-button {\n  height: auto;\n}\n\n/**\n * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.\n * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome\n *    (include `-moz` to future-proof).\n */\n\ninput[type=\"search\"] {\n  -webkit-appearance: textfield; /* 1 */\n  -moz-box-sizing: content-box;\n  -webkit-box-sizing: content-box; /* 2 */\n  box-sizing: content-box;\n}\n\n/**\n * Remove inner padding and search cancel button in Safari and Chrome on OS X.\n * Safari (but not Chrome) clips the cancel button when the search input has\n * padding (and `textfield` appearance).\n */\n\ninput[type=\"search\"]::-webkit-search-cancel-button,\ninput[type=\"search\"]::-webkit-search-decoration {\n  -webkit-appearance: none;\n}\n\n/**\n * Define consistent border, margin, and padding.\n */\n\nfieldset {\n  border: 1px solid #c0c0c0;\n  margin: 0 2px;\n  padding: 0.35em 0.625em 0.75em;\n}\n\n/**\n * 1. Correct `color` not being inherited in IE 8/9.\n * 2. Remove padding so people aren't caught out if they zero out fieldsets.\n */\n\nlegend {\n  border: 0; /* 1 */\n  padding: 0; /* 2 */\n}\n\n/**\n * Remove default vertical scrollbar in IE 8/9.\n */\n\ntextarea {\n  overflow: auto;\n}\n\n/**\n * Don't inherit the `font-weight` (applied by a rule above).\n * NOTE: the default cannot safely be changed in Chrome and Safari on OS X.\n */\n\noptgroup {\n  font-weight: bold;\n}\n\n/* Tables\n   ========================================================================== */\n\n/**\n * Remove most spacing between table cells.\n */\n\ntable {\n  border-collapse: collapse;\n  border-spacing: 0;\n}\n\ntd,\nth {\n  padding: 0;\n}\n"
        },
        "$:/themes/tiddlywiki/vanilla/settings/fontfamily": {
            "title": "$:/themes/tiddlywiki/vanilla/settings/fontfamily",
            "text": "\"Helvetica Neue\", Helvetica, Arial, \"Lucida Grande\", \"DejaVu Sans\", sans-serif"
        },
        "$:/themes/tiddlywiki/vanilla/settings/codefontfamily": {
            "title": "$:/themes/tiddlywiki/vanilla/settings/codefontfamily",
            "text": "Monaco, Consolas, \"Lucida Console\", \"DejaVu Sans Mono\", monospace"
        },
        "$:/themes/tiddlywiki/vanilla/settings/backgroundimageattachment": {
            "title": "$:/themes/tiddlywiki/vanilla/settings/backgroundimageattachment",
            "text": "fixed"
        },
        "$:/themes/tiddlywiki/vanilla/settings/backgroundimagesize": {
            "title": "$:/themes/tiddlywiki/vanilla/settings/backgroundimagesize",
            "text": "auto"
        },
        "$:/themes/tiddlywiki/vanilla/sticky": {
            "title": "$:/themes/tiddlywiki/vanilla/sticky",
            "text": "<$reveal state=\"$:/themes/tiddlywiki/vanilla/options/stickytitles\" type=\"match\" text=\"yes\">\n``\n.tc-tiddler-title {\n\tposition: -webkit-sticky;\n\tposition: -moz-sticky;\n\tposition: -o-sticky;\n\tposition: -ms-sticky;\n\tposition: sticky;\n\ttop: 0px;\n\tbackground: ``<<colour tiddler-background>>``;\n\tz-index: 500;\n}\n``\n</$reveal>\n"
        }
    }
}
"""{
	"rotation": {
    "x": {{$:/settings/Rotations!!x}},
    "y": {{$:/settings/Rotations!!y}},
		"z": {{$:/settings/Rotations!!z}}
	},
  "size": {
    "width": 200,
    "height": 200
  }
}"""
<$wikify
  name='INPUT'
  text={{Inputs}}
>
  <$view3js
    tiddler='test'
    opts=<<INPUT>>
  />
</$wikify>

{{Set Values}}
x:
<$range
  tiddler='$:/settings/Rotations'
  field='x'
  min='-3.14'
  max='3.14'
  step='0.01'
/>

y:
<$range
  tiddler='$:/settings/Rotations'
  field='y'
  min='-3.14'
  max='3.14'
  step='0.01'
/>

z:
<$range
  tiddler='$:/settings/Rotations'
  field='z'
  min='-3.14'
  max='3.14'
  step='0.01'
/>
var main = function (input, opts) {
  if (opts) {
    if (opts.size) {
      var width = opts.size.width;
      var height = opts.size.height;
    } else {
      var width = 700;
      var height = 400;
    }
  } else {
    var width = 700;
    var height = 400;
  }
  // Define the scene
  var scene = new THREE.Scene();
  // Set up camera
  var camera = new THREE.PerspectiveCamera(75, width/height, 0.1, 1000);
  // Place the camera
  camera.position.z = 2;
  // Initialise renderer
  var renderer = new THREE.WebGLRenderer({alpha: true});
  // Set background color to white
  //renderer.setClearColorHex(0xffffff, 0);
  // Set view size
  renderer.setSize(width, height);
  // Add light source
  //scene.add(new THREE.AmbientLight(0x404040));
  var light = new THREE.DirectionalLight(0xff00ff);
  light.position.set(0, 10, 0);
  scene.add(light);

  // Make dom node
  input.node.appendChild(renderer.domElement);

  // Sphere at origin to make things smoothly
  var sphereGeometry = new THREE.SphereGeometry(0.1, 32, 32);
  // Generic stem shape
  var stemGeometry = new THREE.CylinderGeometry(0.1, 0.1, 1, 50, false);
  // Move origin of stem shape to make things move correctly
  stemGeometry.applyMatrix(new THREE.Matrix4().makeTranslation(0.5, 0.5, 0.5));
  // Make 3 stems for x, y and z
  var stemMeshX = new THREE.Mesh(stemGeometry);
  var stemMeshY = new THREE.Mesh(stemGeometry);
  var stemMeshZ = new THREE.Mesh(stemGeometry);
  // Make origin sphere to smooth things out
  var sphereMesh = new THREE.Mesh(sphereGeometry);
  // Shift stems so that they match the correct position (y and z may be backwards?)
  stemMeshX.position.set(0, -0.5, -0.5);
  stemMeshY.position.set(-0.5, 0.5, 0);
  stemMeshZ.position.set(-0.5, 0, -0.5);
  // Cylinders are oriented in the z axis by default, so rotate the x and y stems
  stemMeshX.rotation.z = 3.14/2;
  stemMeshY.rotation.x = 3.14/2;
  // Update the matricies so we can combine the meshes
  stemMeshX.updateMatrix();
  stemMeshY.updateMatrix();
  stemMeshZ.updateMatrix();
  sphereMesh.updateMatrix();
  // New geometry so we can move everything as a single unit
  var singleGeometry = new THREE.Geometry();
  // Add the 4 pieces to our geometry
  singleGeometry.merge(stemMeshX.geometry, stemMeshX.matrix);
  singleGeometry.merge(stemMeshY.geometry, stemMeshY.matrix);
  singleGeometry.merge(stemMeshZ.geometry, stemMeshZ.matrix);
  singleGeometry.merge(sphereMesh.geometry, sphereMesh.matrix);
  // Set our material
  var material = new THREE.MeshNormalMaterial();
  // Make final mesh for the full thing
  var mesh = new THREE.Mesh(singleGeometry, material);
  // Add the final mesh to the scene
  scene.add(mesh);

  var render = function () {
    requestAnimationFrame(render);
    // If we have input from the sensors apply the rotations from that
    if (opts) {
      if (opts.rotation) {
        mesh.rotation.x = opts.rotation.x || 0;
        mesh.rotation.y = opts.rotation.y || 0;
        mesh.rotation.z = opts.rotation.z || 0;
      }
    } else {
      // Constant rotations in all three axes for testing.
      mesh.rotation.x += 0.01;
      mesh.rotation.y += 0.01;
      mesh.rotation.z += 0.01;
    }
    renderer.render(scene, camera);
  }
  render();
}